@syncfusion/ej2-schedule 27.1.52 → 27.1.55

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 27.1.52
3
+ * version : 27.1.55
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-schedule@*",
3
- "_id": "@syncfusion/ej2-schedule@27.1.51",
3
+ "_id": "@syncfusion/ej2-schedule@27.1.53",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-tWoxWvJfAIU2htx1DrK3slTP2JUiQ1enkPZYB+tFAcYgy+zNWv9ypSpFDIbFKtk5cSZs+fSPNMGHW5cZYEYUjA==",
5
+ "_integrity": "sha512-eCYWez3dZD5pMKNeAPRVDLdH/X+5htZeVD65OxMdfIMS5/Fqmwjh4rZ0JmgowSEZon522i41/I5gF2TzCTvm0g==",
6
6
  "_location": "/@syncfusion/ej2-schedule",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,8 +23,8 @@
23
23
  "/@syncfusion/ej2-react-schedule",
24
24
  "/@syncfusion/ej2-vue-schedule"
25
25
  ],
26
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-schedule/-/ej2-schedule-27.1.51.tgz",
27
- "_shasum": "0f6618c8304d52cd417e3d37cda1c0af19d9b949",
26
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-schedule/-/ej2-schedule-27.1.53.tgz",
27
+ "_shasum": "10390d6fc7e1a6861d7b096db0238f3b84f463c5",
28
28
  "_spec": "@syncfusion/ej2-schedule@*",
29
29
  "_where": "/jenkins/workspace/elease-automation_release_27.1.1/packages/included",
30
30
  "author": {
@@ -35,16 +35,16 @@
35
35
  },
36
36
  "bundleDependencies": false,
37
37
  "dependencies": {
38
- "@syncfusion/ej2-base": "~27.1.52",
39
- "@syncfusion/ej2-buttons": "~27.1.51",
40
- "@syncfusion/ej2-calendars": "~27.1.52",
38
+ "@syncfusion/ej2-base": "~27.1.55",
39
+ "@syncfusion/ej2-buttons": "~27.1.53",
40
+ "@syncfusion/ej2-calendars": "~27.1.55",
41
41
  "@syncfusion/ej2-data": "~27.1.52",
42
- "@syncfusion/ej2-dropdowns": "~27.1.52",
42
+ "@syncfusion/ej2-dropdowns": "~27.1.55",
43
43
  "@syncfusion/ej2-excel-export": "~27.1.50",
44
- "@syncfusion/ej2-inputs": "~27.1.50",
44
+ "@syncfusion/ej2-inputs": "~27.1.55",
45
45
  "@syncfusion/ej2-lists": "~27.1.50",
46
- "@syncfusion/ej2-navigations": "~27.1.52",
47
- "@syncfusion/ej2-popups": "~27.1.50"
46
+ "@syncfusion/ej2-navigations": "~27.1.55",
47
+ "@syncfusion/ej2-popups": "~27.1.55"
48
48
  },
49
49
  "deprecated": false,
50
50
  "description": "Flexible scheduling library with more built-in features and enhanced customization options similar to outlook and google calendar, allowing the users to plan and manage their appointments with efficient data-binding support.",
@@ -73,6 +73,6 @@
73
73
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
74
74
  },
75
75
  "typings": "index.d.ts",
76
- "version": "27.1.52",
76
+ "version": "27.1.55",
77
77
  "sideEffects": false
78
78
  }
@@ -365,11 +365,8 @@ var Resize = /** @class */ (function (_super) {
365
365
  var eventStart = new Date(this.actionObj.event[this.parent.eventFields.startTime].getTime());
366
366
  var eventEnd = new Date(this.actionObj.event[this.parent.eventFields.endTime].getTime());
367
367
  var resizeTime;
368
- var isDateHeader = false;
369
368
  var headerName = this.parent.currentView;
370
- var isTimeViews = ['TimelineDay', 'TimelineWeek', 'TimelineWorkWeek'].indexOf(this.parent.currentView) > -1;
371
369
  var isTimelineMonth = this.parent.currentView === 'TimelineMonth';
372
- var isWithoutScale = isTimelineMonth || isTimeViews && !this.parent.activeViewOptions.timeScale.enable;
373
370
  if (this.parent.activeView.isTimelineView()) {
374
371
  var tr = this.parent.getContentTable().querySelector('tr');
375
372
  if (this.parent.activeViewOptions.headerRows.length > 0) {
@@ -402,7 +399,6 @@ var Resize = /** @class */ (function (_super) {
402
399
  }
403
400
  cellIndex = !isTimelineMonth ? Math.round(offsetValue / (this.parent.getElementWidth(tr) / noOfDays)) :
404
401
  Math.floor(offsetValue / Math.floor(this.parent.getElementWidth(tr) / noOfDays));
405
- isDateHeader = isTimeViews && headerName === 'Date';
406
402
  cellIndex = isLeft ? cellIndex : isTimelineMonth ? cellIndex + 1 : cellIndex;
407
403
  isLastCell = cellIndex === tdCollections.length;
408
404
  cellIndex = (cellIndex < 0) ? 0 : (cellIndex >= noOfDays) ? noOfDays - 1 : cellIndex;
@@ -468,15 +464,14 @@ var Resize = /** @class */ (function (_super) {
468
464
  !this.parent.activeViewOptions.timeScale.enable;
469
465
  if (isLeft) {
470
466
  if ((eventEnd.getTime() - resizeTime.getTime()) <= 0) {
471
- resizeTime = isWithoutScale ? util.resetTime(eventEnd) : eventStart;
467
+ resizeTime = isNotHourSlot ? util.resetTime(eventEnd) : eventStart;
472
468
  }
473
469
  this.actionObj.start = !isNotHourSlot ? this.calculateIntervalTime(resizeTime) : resizeTime;
474
470
  }
475
471
  else {
476
- var isTimeScaleViews = isTimeViews && this.parent.activeViewOptions.timeScale.enable;
477
- var resizeEnd = ((!isTimeScaleViews || isDateHeader || isTimeViews && ['Week', 'Month', 'Year'].indexOf(headerName) > -1)
478
- && resizeTime.getHours() === 0 && resizeTime.getMinutes() === 0) ? util.addDays(resizeTime, 1) : resizeTime;
479
- if (isWithoutScale && (resizeEnd.getTime() - eventStart.getTime()) <= 0) {
472
+ var resizeEnd = (isNotHourSlot && resizeTime.getHours() === 0 && resizeTime.getMinutes() === 0) ?
473
+ util.addDays(resizeTime, 1) : resizeTime;
474
+ if (isNotHourSlot && (resizeEnd.getTime() - eventStart.getTime()) <= 0) {
480
475
  resizeEnd = util.addDays(util.resetTime(eventStart), 1);
481
476
  }
482
477
  this.actionObj.end = !isNotHourSlot ? this.calculateIntervalTime(resizeEnd) : resizeEnd;
@@ -1967,8 +1967,9 @@ var Schedule = /** @class */ (function (_super) {
1967
1967
  var msMajorInterval = this.activeViewOptions.timeScale.interval * util.MS_PER_MINUTE;
1968
1968
  var msInterval = msMajorInterval / this.activeViewOptions.timeScale.slotCount;
1969
1969
  var offsetDiff = ((viewStartHour.getTimezoneOffset() - startHour.getTimezoneOffset()) * util.MS_PER_MINUTE);
1970
+ var endOffsetDiff = Math.abs((viewStartHour.getTimezoneOffset() - endHour.getTimezoneOffset()) * util.MS_PER_MINUTE);
1970
1971
  var startIndex = Math.round((startHour.getTime() - viewStartHour.getTime() + offsetDiff) / msInterval);
1971
- var endIndex = Math.ceil((endHour.getTime() - viewStartHour.getTime() + offsetDiff) / msInterval);
1972
+ var endIndex = Math.ceil((endHour.getTime() - viewStartHour.getTime() - endOffsetDiff) / msInterval);
1972
1973
  var tempStartIndex = startIndex;
1973
1974
  var tempEndIndex = endIndex;
1974
1975
  var cells = [];
@@ -48,6 +48,7 @@ export declare class MonthEvent extends EventBase {
48
48
  getIndex(date: Date): number;
49
49
  moreIndicatorClick(event: Event): void;
50
50
  renderEventElement(event: Record<string, any>, appointmentElement: HTMLElement, cellTd: Element): void;
51
+ private getSpannedTime;
51
52
  getEventData(event: Record<string, any>): Record<string, any>;
52
53
  renderElement(cellTd: HTMLElement | Element, element: HTMLElement, isAppointment?: boolean): void;
53
54
  getMoreIndicatorElement(count: number, startDate: Date, endDate: Date): HTMLElement;
@@ -641,7 +641,7 @@ var MonthEvent = /** @class */ (function (_super) {
641
641
  var _this = this;
642
642
  var eventType = appointmentElement.classList.contains(cls.BLOCK_APPOINTMENT_CLASS) ? 'blockEvent' : 'event';
643
643
  var isAppointment = appointmentElement.classList.contains(cls.APPOINTMENT_CLASS);
644
- var eventObj = this.getEventData(event);
644
+ var eventObj = this.parent.currentView === 'Month' ? this.getSpannedTime(event) : this.getEventData(event);
645
645
  var args = { data: eventObj, element: appointmentElement, cancel: false, type: eventType };
646
646
  this.parent.trigger(events.eventRendered, args, function (eventArgs) {
647
647
  if (eventArgs.cancel) {
@@ -652,6 +652,16 @@ var MonthEvent = /** @class */ (function (_super) {
652
652
  }
653
653
  });
654
654
  };
655
+ MonthEvent.prototype.getSpannedTime = function (event) {
656
+ var eventObj = extend({}, event, null, true);
657
+ if ((eventObj[this.fields.startTime]).getDate() === (eventObj.data[this.fields.startTime]).getDate()) {
658
+ eventObj[this.fields.startTime] = eventObj.data[this.fields.startTime];
659
+ }
660
+ if ((eventObj[this.fields.endTime]).getDate() === (eventObj.data[this.fields.endTime]).getDate()) {
661
+ eventObj[this.fields.endTime] = eventObj.data[this.fields.endTime];
662
+ }
663
+ return eventObj;
664
+ };
655
665
  MonthEvent.prototype.getEventData = function (event) {
656
666
  var eventObj = extend({}, event, null, true);
657
667
  eventObj[this.fields.startTime] = event.data[this.fields.startTime];
@@ -40,6 +40,7 @@ export declare class TimelineEvent extends MonthEvent {
40
40
  private getAppointmentLeft;
41
41
  getPosition(startTime: Date, endTime: Date, isAllDay: boolean, day: number): number;
42
42
  private getFilterEvents;
43
+ private getIntervalInMinutes;
43
44
  private isAlreadyAvail;
44
45
  getRowTop(resIndex: number): number;
45
46
  getCellTd(): HTMLElement;
@@ -465,13 +465,8 @@ var TimelineEvent = /** @class */ (function (_super) {
465
465
  }
466
466
  };
467
467
  TimelineEvent.prototype.getSameDayEventsWidth = function (startDate, endDate) {
468
- var intervalMins = this.interval;
469
- if (this.slotsPerDay === 1) {
470
- var hoursRange = util.getStartEndHours(util.resetTime(new Date(startDate.getTime())), this.startHour, this.endHour);
471
- intervalMins = (hoursRange.endHour.getTime() - hoursRange.startHour.getTime()) / util.MS_PER_MINUTE;
472
- }
473
468
  return ((util.getUniversalTime(endDate) - util.getUniversalTime(startDate)) /
474
- util.MS_PER_MINUTE * (this.cellWidth * this.slotCount) / intervalMins);
469
+ util.MS_PER_MINUTE * (this.cellWidth * this.slotCount) / this.getIntervalInMinutes(startDate));
475
470
  };
476
471
  TimelineEvent.prototype.getSpannedEventsWidth = function (startDate, endDate, diffInDays) {
477
472
  var width = (diffInDays * this.slotsPerDay) * this.cellWidth;
@@ -497,13 +492,13 @@ var TimelineEvent = /** @class */ (function (_super) {
497
492
  TimelineEvent.prototype.getAppointmentLeft = function (schedule, startTime, day) {
498
493
  var slotTd = (this.isSameDay(startTime, schedule.startHour)) ?
499
494
  ((util.getUniversalTime(startTime) - util.getUniversalTime(schedule.startHour)) /
500
- (util.MS_PER_MINUTE * this.interval)) * this.slotCount : 0;
495
+ (util.MS_PER_MINUTE * this.getIntervalInMinutes(startTime))) * this.slotCount : 0;
501
496
  if (day === 0) {
502
497
  return slotTd;
503
498
  }
504
499
  else {
505
500
  var daySlot = Math.round((((util.getUniversalTime(schedule.endHour) - util.getUniversalTime(schedule.startHour)) /
506
- util.MS_PER_MINUTE) / this.interval) * this.slotCount);
501
+ util.MS_PER_MINUTE) / this.getIntervalInMinutes(startTime)) * this.slotCount);
507
502
  return (daySlot * day) + slotTd;
508
503
  }
509
504
  };
@@ -536,6 +531,13 @@ var TimelineEvent = /** @class */ (function (_super) {
536
531
  return this.getFilteredEvents(startTime, endTime, gIndex, eventsList);
537
532
  }
538
533
  };
534
+ TimelineEvent.prototype.getIntervalInMinutes = function (startDate) {
535
+ if (this.slotsPerDay !== 1) {
536
+ return this.interval;
537
+ }
538
+ var hoursRange = util.getStartEndHours(util.resetTime(new Date(startDate.getTime())), this.startHour, this.endHour);
539
+ return (hoursRange.endHour.getTime() - hoursRange.startHour.getTime()) / util.MS_PER_MINUTE;
540
+ };
539
541
  TimelineEvent.prototype.isAlreadyAvail = function (appPos, cellTd) {
540
542
  var moreIndicator = [].slice.call(cellTd.querySelectorAll('.' + cls.MORE_INDICATOR_CLASS));
541
543
  for (var i = 0; i < moreIndicator.length; i++) {
@@ -689,10 +689,32 @@ var VerticalEvent = /** @class */ (function (_super) {
689
689
  if (this.parent.activeViewOptions.group.resources.length > 0) {
690
690
  this.overlapList = this.filterEventsByResource(this.resources[parseInt(resource.toString(), 10)], this.overlapList);
691
691
  }
692
+ var queue_1 = [];
692
693
  this.overlapList.forEach(function (obj) {
693
- var filterList = appointmentList_1.filter(function (data) {
694
- return data[fieldMapping.endTime] > obj[fieldMapping.startTime] && data[fieldMapping.startTime] <= obj[fieldMapping.endTime];
695
- });
694
+ queue_1.push(obj);
695
+ var filterList = [];
696
+ var processedIds = new Set();
697
+ var _loop_2 = function () {
698
+ var currentObj = queue_1.shift();
699
+ var overlaps = appointmentList_1.filter(function (data) {
700
+ return data[fieldMapping.endTime] > currentObj[fieldMapping.startTime] &&
701
+ data[fieldMapping.startTime] <= currentObj[fieldMapping.endTime] &&
702
+ !processedIds.has(data[fieldMapping.id]);
703
+ });
704
+ overlaps.forEach(function (overlap) {
705
+ filterList.push(overlap);
706
+ processedIds.add(overlap[fieldMapping.id]);
707
+ queue_1.push(overlap);
708
+ });
709
+ if (processedIds.size < appointmentList_1.length - 1) {
710
+ return "break";
711
+ }
712
+ };
713
+ while (queue_1.length > 0) {
714
+ var state_1 = _loop_2();
715
+ if (state_1 === "break")
716
+ break;
717
+ }
696
718
  if (_this.parent.activeViewOptions.group.resources.length > 0) {
697
719
  filterList = _this.filterEventsByResource(_this.resources[parseInt(resource.toString(), 10)], filterList);
698
720
  }
@@ -1037,6 +1037,9 @@ var EventWindow = /** @class */ (function () {
1037
1037
  else if (element.classList.contains('e-checkbox')) {
1038
1038
  fieldSelector = 'e-checkbox';
1039
1039
  }
1040
+ else if (element.classList.contains('e-numerictextbox')) {
1041
+ fieldSelector = 'e-numerictextbox';
1042
+ }
1040
1043
  var classSelector = isDropDowns ? "." + fieldSelector + ":not(.e-control)" : "." + fieldSelector;
1041
1044
  var control = closest(element, classSelector) || element.querySelector("." + fieldSelector);
1042
1045
  if (control) {
@@ -1786,6 +1789,9 @@ var EventWindow = /** @class */ (function () {
1786
1789
  else if (element.classList.contains('e-checkbox')) {
1787
1790
  value = element.ej2_instances[0].checked;
1788
1791
  }
1792
+ else if (element.classList.contains('e-numerictextbox')) {
1793
+ value = element.ej2_instances[0].value;
1794
+ }
1789
1795
  else {
1790
1796
  if (element.type === 'checkbox') {
1791
1797
  value = element.checked;
@@ -1830,6 +1836,11 @@ var EventWindow = /** @class */ (function () {
1830
1836
  instance.checked = value;
1831
1837
  instance.dataBind();
1832
1838
  }
1839
+ else if (element.classList.contains('e-numerictextbox')) {
1840
+ var instance = element.ej2_instances[0];
1841
+ instance.value = value;
1842
+ instance.dataBind();
1843
+ }
1833
1844
  else {
1834
1845
  if (element.type !== 'checkbox') {
1835
1846
  element.value = value || '';
@@ -1867,6 +1878,11 @@ var EventWindow = /** @class */ (function () {
1867
1878
  instance.checked = false;
1868
1879
  instance.dataBind();
1869
1880
  }
1881
+ else if (element.classList.contains('e-numerictextbox')) {
1882
+ var instance = element.ej2_instances[0];
1883
+ instance.value = null;
1884
+ instance.dataBind();
1885
+ }
1870
1886
  else {
1871
1887
  if (element.type === 'checkbox') {
1872
1888
  element.checked = false;