@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
@@ -1905,6 +1905,29 @@ var KeyboardInteraction = /** @__PURE__ @class */ (function () {
1905
1905
  break;
1906
1906
  case 'escape':
1907
1907
  this.processEscape(e);
1908
+ break;
1909
+ case 'fTwelve':
1910
+ if (this.parent.allowInline && this.parent.inlineModule) {
1911
+ e.preventDefault();
1912
+ this.processFTwelve(e);
1913
+ }
1914
+ break;
1915
+ }
1916
+ };
1917
+ KeyboardInteraction.prototype.processFTwelve = function (e) {
1918
+ var target = e.target;
1919
+ if (target.classList.contains(WORK_CELLS_CLASS) || target.classList.contains(ALLDAY_CELLS_CLASS)) {
1920
+ this.parent.activeCellsData = this.getSelectedElements(target);
1921
+ var args = extend(this.parent.activeCellsData, { cancel: false, event: e });
1922
+ var inlineArgs = {
1923
+ element: args.element,
1924
+ groupIndex: args.groupIndex, type: 'Cell'
1925
+ };
1926
+ this.parent.notify(inlineClick, inlineArgs);
1927
+ }
1928
+ if (target.classList.contains(APPOINTMENT_CLASS)) {
1929
+ target.click();
1930
+ return;
1908
1931
  }
1909
1932
  };
1910
1933
  KeyboardInteraction.prototype.addEventListener = function () {
@@ -5152,7 +5175,7 @@ var EventBase = /** @__PURE__ @class */ (function () {
5152
5175
  if (timeZonePropChanged) {
5153
5176
  this_1.processTimezoneChange(event_1, oldTimezone);
5154
5177
  }
5155
- else if (!this_1.parent.isPrinting) {
5178
+ else if (!this_1.parent.isPrinting && !this_1.parent.uiStateValues.isResize) {
5156
5179
  event_1 = this_1.processTimezone(event_1);
5157
5180
  }
5158
5181
  for (var level = 0; level < resourceCollection.length; level++) {
@@ -6192,7 +6215,9 @@ var EventBase = /** @__PURE__ @class */ (function () {
6192
6215
  var scheduleId = this.parent.element.id + '_';
6193
6216
  var viewName = this.parent.activeViewOptions.eventTemplateName;
6194
6217
  var templateId = scheduleId + viewName + 'eventTemplate';
6195
- templateElement = this.parent.getAppointmentTemplate()(record, this.parent, 'eventTemplate', templateId, false);
6218
+ var templateName = 'eventTemplate' + (this.parent.activeViewOptions.group.resources.length > 0 &&
6219
+ this.parent.currentView.indexOf('Year') === -1 ? '_' + resIndex : '');
6220
+ templateElement = this.parent.getAppointmentTemplate()(record, this.parent, templateName, templateId, false);
6196
6221
  }
6197
6222
  else {
6198
6223
  var appointmentSubject = createElement('div', {
@@ -6657,7 +6682,9 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
6657
6682
  var elementId = this.parent.element.id + '_';
6658
6683
  var viewName = this.parent.activeViewOptions.eventTemplateName;
6659
6684
  var templateId = elementId + viewName + 'eventTemplate';
6660
- templateElement = this.parent.getAppointmentTemplate()(record, this.parent, 'eventTemplate', templateId, false);
6685
+ var resIndex = this.parent.uiStateValues.isGroupAdaptive ? this.parent.uiStateValues.groupIndex : resource;
6686
+ var templateName = 'eventTemplate' + (this.parent.activeViewOptions.group.resources.length > 0 ? '_' + resIndex : '');
6687
+ templateElement = this.parent.getAppointmentTemplate()(record, this.parent, templateName, templateId, false);
6661
6688
  }
6662
6689
  else {
6663
6690
  var appointmentSubject = createElement('div', { className: SUBJECT_CLASS, innerHTML: recordSubject });
@@ -6847,6 +6874,8 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
6847
6874
  appointmentElement_1 = this.createAppointmentElement(eventObj, true, record.data, resource);
6848
6875
  }
6849
6876
  addClass([appointmentElement_1], ALLDAY_APPOINTMENT_CLASS);
6877
+ var eventData = extend({}, record.data, null, true);
6878
+ eventObj.data = eventData;
6850
6879
  var args = { data: eventObj, element: appointmentElement_1, cancel: false };
6851
6880
  this.parent.trigger(eventRendered, args, function (eventArgs) {
6852
6881
  if (!eventArgs.cancel) {
@@ -6928,7 +6957,11 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
6928
6957
  subjectElement.style.maxHeight = formatUnit(maxHeight);
6929
6958
  }
6930
6959
  var index = this.parent.activeViewOptions.group.byDate ? (this.resources.length * dayIndex) + resource : dayCount;
6931
- this.appendEvent(eventObj, appointmentElement, index, tempData.appLeft);
6960
+ var eventData = {};
6961
+ eventData[this.fields.startTime] = eventObj[this.fields.startTime];
6962
+ eventData[this.fields.endTime] = eventObj[this.fields.endTime];
6963
+ record.data = eventData;
6964
+ this.appendEvent(record, appointmentElement, index, tempData.appLeft);
6932
6965
  this.wireAppointmentEvents(appointmentElement, eventObj);
6933
6966
  if (appHeight_1 < this.cellHeight) {
6934
6967
  var resizeHandlers = [].slice.call(appointmentElement.querySelectorAll('.' + EVENT_RESIZE_CLASS));
@@ -7576,7 +7609,8 @@ var MonthEvent = /** @__PURE__ @class */ (function (_super) {
7576
7609
  var scheduleId = this.parent.element.id + '_';
7577
7610
  var viewName = this.parent.activeViewOptions.eventTemplateName;
7578
7611
  var templateId = scheduleId + viewName + 'eventTemplate';
7579
- templateElement = this.parent.getAppointmentTemplate()(eventObj, this.parent, 'eventTemplate', templateId, false);
7612
+ var eventTemplate = 'eventTemplate' + (this.parent.activeViewOptions.group.resources.length > 0 ? '_' + resIndex : '');
7613
+ templateElement = this.parent.getAppointmentTemplate()(eventObj, this.parent, eventTemplate, templateId, false);
7580
7614
  }
7581
7615
  else {
7582
7616
  var eventLocation = (record[this.fields.location] || this.parent.eventSettings.fields.location.default || '');
@@ -7908,6 +7942,7 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
7908
7942
  _this.interval = _this.parent.activeViewOptions.timeScale.interval;
7909
7943
  _this.day = 0;
7910
7944
  _this.rowIndex = 0;
7945
+ _this.cellTops = [];
7911
7946
  _this.renderType = type;
7912
7947
  _this.eventContainers = [].slice.call(_this.element.querySelectorAll('.' + APPOINTMENT_CONTAINER_CLASS));
7913
7948
  var tr = [].slice.call(_this.element.querySelectorAll('.' + CONTENT_TABLE_CLASS + ' tbody tr'));
@@ -8027,9 +8062,7 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
8027
8062
  var cellTd = this.getCellTd();
8028
8063
  var overlapCount = (isNullOrUndefined(this.parent.eventSettings.sortComparer)) ? this.getIndex(startTime) : this.getSortComparerIndex(startTime, endTime);
8029
8064
  event.Index = overlapCount;
8030
- var elem = this.element.querySelector('.' + APPOINTMENT_CLASS);
8031
- var eleHeight = (elem) ? elem.getBoundingClientRect().height : 0;
8032
- var appHeight = (elem && eleHeight > 0) ? eleHeight : this.eventHeight;
8065
+ var appHeight = this.eventHeight;
8033
8066
  var diffInDays = eventData.count;
8034
8067
  var eventObj = extend({}, event, null, true);
8035
8068
  eventObj[this.fields.startTime] = eventData[this.fields.startTime];
@@ -8045,7 +8078,10 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
8045
8078
  var position = this.getPosition(startTime, endTime, event[this.fields.isAllDay], this.day);
8046
8079
  appWidth_1 = (appWidth_1 <= 0) ? this.cellWidth : appWidth_1; // appWidth 0 when start and end time as same
8047
8080
  this.renderedEvents.push(extend({}, event, null, true));
8048
- var top_1 = this.getRowTop(resIndex);
8081
+ if (isNullOrUndefined(this.cellTops[resIndex])) {
8082
+ this.cellTops[resIndex] = this.getRowTop(resIndex);
8083
+ }
8084
+ var top_1 = this.cellTops[resIndex];
8049
8085
  var appTop = (top_1 + (this.maxHeight ? 0 : EVENT_GAP$1)) + (overlapCount * (appHeight + EVENT_GAP$1));
8050
8086
  appLeft = (this.parent.enableRtl) ? 0 : position;
8051
8087
  appRight = (this.parent.enableRtl) ? position : 0;
@@ -8149,7 +8185,7 @@ var TimelineEvent = /** @__PURE__ @class */ (function (_super) {
8149
8185
  }
8150
8186
  };
8151
8187
  TimelineEvent.prototype.updateCellHeight = function (cell, height) {
8152
- if ((height > cell.getBoundingClientRect().height)) {
8188
+ if ((height > this.cellHeight)) {
8153
8189
  setStyleAttribute(cell, { 'height': height + 'px' });
8154
8190
  if (this.parent.activeViewOptions.group.resources.length > 0) {
8155
8191
  var resourceCell = this.parent.element.querySelector('.' + RESOURCE_COLUMN_TABLE_CLASS + ' ' + 'tbody td[data-group-index="' +
@@ -9193,13 +9229,12 @@ var QuickPopups = /** @__PURE__ @class */ (function () {
9193
9229
  if (saveButton) {
9194
9230
  this.renderButton('e-flat e-primary', '', this.parent.activeViewOptions.readonly, saveButton, this.saveClick);
9195
9231
  }
9196
- this.quickPopup.content = quickCellPopup;
9197
- this.quickPopup.dataBind();
9198
- this.applyFormValidation();
9199
9232
  if (this.morePopup) {
9200
9233
  this.morePopup.hide();
9201
9234
  }
9235
+ this.quickPopup.content = quickCellPopup;
9202
9236
  this.quickPopup.relateTo = target;
9237
+ this.quickPopup.dataBind();
9203
9238
  this.beforeQuickPopupOpen(target);
9204
9239
  };
9205
9240
  QuickPopups.prototype.isSameEventClick = function (events) {
@@ -9266,13 +9301,13 @@ var QuickPopups = /** @__PURE__ @class */ (function () {
9266
9301
  if (deleteButton) {
9267
9302
  this.renderButton('e-flat', '', deleteAction, deleteButton, this.deleteClick);
9268
9303
  }
9269
- this.quickPopup.content = quickEventPopup;
9270
- this.quickPopup.dataBind();
9271
9304
  if (this.morePopup && !closest(events.element, '.' + MORE_EVENT_WRAPPER_CLASS)) {
9272
9305
  this.morePopup.hide();
9273
9306
  }
9307
+ this.quickPopup.content = quickEventPopup;
9274
9308
  this.quickPopup.relateTo = this.parent.isAdaptive ? document.body :
9275
9309
  closest(events.element, '.' + APPOINTMENT_CLASS);
9310
+ this.quickPopup.dataBind();
9276
9311
  this.beforeQuickPopupOpen(events.element);
9277
9312
  }
9278
9313
  };
@@ -9566,6 +9601,7 @@ var QuickPopups = /** @__PURE__ @class */ (function () {
9566
9601
  });
9567
9602
  };
9568
9603
  QuickPopups.prototype.saveClick = function (event) {
9604
+ this.applyFormValidation();
9569
9605
  this.dialogEvent = event;
9570
9606
  this.isCrudAction = true;
9571
9607
  this.quickPopupHide();
@@ -11971,7 +12007,7 @@ var EventWindow = /** @__PURE__ @class */ (function () {
11971
12007
  return labelText;
11972
12008
  };
11973
12009
  EventWindow.prototype.onChange = function (args) {
11974
- var target = (args.event.target);
12010
+ var target = args.event.currentTarget.querySelector('input');
11975
12011
  if (target.classList.contains(EVENT_WINDOW_ALL_DAY_CLASS)) {
11976
12012
  this.onAllDayChange(args.checked);
11977
12013
  }
@@ -16427,7 +16463,7 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
16427
16463
  if (this && isNullOrUndefined(this.uiStateValues) || !(this.enablePersistence)) {
16428
16464
  this.uiStateValues = {
16429
16465
  expand: false, isInitial: true, left: 0, top: 0, isGroupAdaptive: false,
16430
- isIgnoreOccurrence: false, groupIndex: 0, action: false, isBlock: false, isCustomMonth: true
16466
+ isIgnoreOccurrence: false, groupIndex: 0, action: false, isBlock: false, isCustomMonth: true, isResize: false
16431
16467
  };
16432
16468
  }
16433
16469
  this.activeCellsData = { startTime: this.getCurrentTime(), endTime: this.getCurrentTime(), isAllDay: false };
@@ -16889,9 +16925,11 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
16889
16925
  }
16890
16926
  if (this.currentView === 'Month' || ((this.currentView !== 'Agenda' && this.currentView !== 'MonthAgenda')
16891
16927
  && !this.activeViewOptions.timeScale.enable) || this.activeView.isTimelineView()) {
16928
+ this.uiStateValues.isResize = true;
16892
16929
  this.activeView.resetColWidth();
16893
16930
  this.notify(scrollUiUpdate, { cssProperties: this.getCssProperties(), isPreventScrollUpdate: true });
16894
16931
  this.refreshEvents(false);
16932
+ this.uiStateValues.isResize = false;
16895
16933
  }
16896
16934
  else {
16897
16935
  this.notify(contentReady, {});
@@ -17957,7 +17995,19 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
17957
17995
  }
17958
17996
  else {
17959
17997
  if (this.activeViewOptions && this.activeViewOptions.eventTemplate) {
17960
- this.resetTemplates(['eventTemplate']);
17998
+ var templateNames = ['eventTemplate'];
17999
+ if (this.crudModule && this.crudModule.crudObj.isCrudAction &&
18000
+ ['Agenda', 'MonthAgenda', 'Year', 'TimelineYear'].indexOf(this.currentView) === -1) {
18001
+ templateNames = [];
18002
+ for (var i = 0, len = this.crudModule.crudObj.sourceEvent.length; i < len; i++) {
18003
+ templateNames.push('eventTemplate_' + this.crudModule.crudObj.sourceEvent[i].groupIndex);
18004
+ if (this.crudModule.crudObj.targetEvent[i] && this.crudModule.crudObj.sourceEvent[i].groupIndex !==
18005
+ this.crudModule.crudObj.targetEvent[i].groupIndex) {
18006
+ templateNames.push('eventTemplate_' + this.crudModule.crudObj.targetEvent[i].groupIndex);
18007
+ }
18008
+ }
18009
+ }
18010
+ this.resetTemplates(templateNames);
17961
18011
  }
17962
18012
  var eventsData = this.eventsData || [];
17963
18013
  var blockData = this.blockData || [];
@@ -19812,6 +19862,7 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
19812
19862
  var rowIndex = this.parent.activeViewOptions.orientation === 'Vertical' ? index : month;
19813
19863
  var td = this.parent.element.querySelector(".e-content-wrap tr:nth-child(" + (rowIndex + 1) + ") td");
19814
19864
  this.cellHeight = td.offsetHeight;
19865
+ this.groupOrder = resource.groupOrder;
19815
19866
  for (var a = 0; a < eventDatas.length; a++) {
19816
19867
  var data = eventDatas[a];
19817
19868
  var overlapIndex = void 0;
@@ -20048,7 +20099,9 @@ var YearEvent = /** @__PURE__ @class */ (function (_super) {
20048
20099
  }
20049
20100
  }
20050
20101
  else {
20051
- if (((resetTime(appStart).getTime() <= dateStart) && (resetTime(appEnd).getTime() >= dateStart)) ||
20102
+ var timeCondition = app[this.fields.isAllDay] ? resetTime(appEnd).getTime() > dateStart :
20103
+ resetTime(appEnd).getTime() >= dateStart;
20104
+ if (((resetTime(appStart).getTime() <= dateStart) && (timeCondition)) ||
20052
20105
  (resetTime(appStart).getTime() >= dateStart) && (resetTime(appEnd).getTime() <= dateEnd)) {
20053
20106
  appointmentsList.push(app);
20054
20107
  }
@@ -20557,14 +20610,16 @@ var DragAndDrop = /** @__PURE__ @class */ (function (_super) {
20557
20610
  else {
20558
20611
  outWrapper = this.parent.element.querySelector('.' + APPOINTMENT_CONTAINER_CLASS);
20559
20612
  }
20560
- var tarWrapper_1 = outWrapper.querySelector('.' + APPOINTMENT_WRAPPER_CLASS);
20561
- if (!tarWrapper_1) {
20562
- tarWrapper_1 = createElement('div', { className: APPOINTMENT_WRAPPER_CLASS });
20563
- outWrapper.appendChild(tarWrapper_1);
20613
+ if (!isNullOrUndefined(outWrapper)) {
20614
+ var tarWrapper_1 = outWrapper.querySelector('.' + APPOINTMENT_WRAPPER_CLASS);
20615
+ if (!tarWrapper_1) {
20616
+ tarWrapper_1 = createElement('div', { className: APPOINTMENT_WRAPPER_CLASS });
20617
+ outWrapper.appendChild(tarWrapper_1);
20618
+ }
20619
+ this.actionObj.cloneElement.forEach(function (ele) {
20620
+ tarWrapper_1.appendChild(ele);
20621
+ });
20564
20622
  }
20565
- this.actionObj.cloneElement.forEach(function (ele) {
20566
- tarWrapper_1.appendChild(ele);
20567
- });
20568
20623
  }
20569
20624
  };
20570
20625
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -22304,7 +22359,7 @@ var VerticalView = /** @__PURE__ @class */ (function (_super) {
22304
22359
  if (this.parent.activeViewOptions.allowVirtualScrolling) {
22305
22360
  clsList.push(VIRTUAL_SCROLL_CLASS);
22306
22361
  }
22307
- if (this.parent.eventSettings.ignoreWhitespace) {
22362
+ if (this.parent.rowAutoHeight && this.parent.eventSettings.ignoreWhitespace) {
22308
22363
  clsList.push(IGNORE_WHITESPACE);
22309
22364
  }
22310
22365
  this.renderPanel(type);
@@ -22984,7 +23039,7 @@ var Month = /** @__PURE__ @class */ (function (_super) {
22984
23039
  if (this.parent.activeViewOptions.allowVirtualScrolling) {
22985
23040
  clsList.push(VIRTUAL_SCROLL_CLASS);
22986
23041
  }
22987
- if (this.parent.eventSettings.ignoreWhitespace) {
23042
+ if (this.parent.rowAutoHeight && this.parent.eventSettings.ignoreWhitespace) {
22988
23043
  clsList.push(IGNORE_WHITESPACE);
22989
23044
  }
22990
23045
  addClass([this.element], clsList);
@@ -23572,7 +23627,7 @@ var Year = /** @__PURE__ @class */ (function (_super) {
23572
23627
  var weekNumber = this.parent.getWeekNumberContent(weekDates);
23573
23628
  var td = createElement('td', {
23574
23629
  className: 'e-week-number',
23575
- attrs: { 'role': 'gridcell', 'title': 'Week ' + weekNumber },
23630
+ attrs: { 'role': 'gridcell', 'title': this.parent.localeObj.getConstant('week') + ' ' + weekNumber },
23576
23631
  innerHTML: weekNumber
23577
23632
  });
23578
23633
  tr_1.appendChild(td);
@@ -23985,7 +24040,7 @@ var AgendaBase = /** @__PURE__ @class */ (function (_super) {
23985
24040
  var eventElement = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
23986
24041
  for (var _i = 0, eventElement_1 = eventElement; _i < eventElement_1.length; _i++) {
23987
24042
  var element = eventElement_1[_i];
23988
- this.parent.eventBase.wireAppointmentEvents(element, null, true);
24043
+ this.parent.eventBase.wireAppointmentEvents(element, this.parent.getEventDetails(element), true);
23989
24044
  }
23990
24045
  var dateHeaderElement = [].slice.call(this.parent.element.querySelectorAll('.e-m-date'));
23991
24046
  for (var _a = 0, dateHeaderElement_1 = dateHeaderElement; _a < dateHeaderElement_1.length; _a++) {