@syncfusion/ej2-schedule 27.1.50 → 27.1.51

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.50
3
+ * version : 27.1.51
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.48",
3
+ "_id": "@syncfusion/ej2-schedule@27.1.50",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-GQffkT4ABTCmTBf9pPJpeeK5ygE2veOdOPvSKFQOGA0ydZXSzDDbYhNSvfLGyHcybcJWj6NxNyNbbJ7kHI3deg==",
5
+ "_integrity": "sha512-gZRE4byvqUJ1Vl5mWybcZuVP1XRw92DCfRM/UiWrjtAbAUX+zHCDVjwyuIJtz8lbR+JrrSpIRFn/kTqkxKZEmQ==",
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.48.tgz",
27
- "_shasum": "e574faa7c52c4a0332da422baa23137a282c4c42",
26
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-schedule/-/ej2-schedule-27.1.50.tgz",
27
+ "_shasum": "9017f33d1852c653a865ac22eda7ed0c76a4032a",
28
28
  "_spec": "@syncfusion/ej2-schedule@*",
29
29
  "_where": "/jenkins/workspace/elease-automation_release_27.1.1/packages/included",
30
30
  "author": {
@@ -36,14 +36,14 @@
36
36
  "bundleDependencies": false,
37
37
  "dependencies": {
38
38
  "@syncfusion/ej2-base": "~27.1.50",
39
- "@syncfusion/ej2-buttons": "~27.1.50",
40
- "@syncfusion/ej2-calendars": "~27.1.50",
41
- "@syncfusion/ej2-data": "~27.1.50",
42
- "@syncfusion/ej2-dropdowns": "~27.1.50",
39
+ "@syncfusion/ej2-buttons": "~27.1.51",
40
+ "@syncfusion/ej2-calendars": "~27.1.51",
41
+ "@syncfusion/ej2-data": "~27.1.51",
42
+ "@syncfusion/ej2-dropdowns": "~27.1.51",
43
43
  "@syncfusion/ej2-excel-export": "~27.1.50",
44
44
  "@syncfusion/ej2-inputs": "~27.1.50",
45
45
  "@syncfusion/ej2-lists": "~27.1.50",
46
- "@syncfusion/ej2-navigations": "~27.1.50",
46
+ "@syncfusion/ej2-navigations": "~27.1.51",
47
47
  "@syncfusion/ej2-popups": "~27.1.50"
48
48
  },
49
49
  "deprecated": false,
@@ -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.50",
76
+ "version": "27.1.51",
77
77
  "sideEffects": false
78
78
  }
@@ -26,6 +26,8 @@ export declare class DragAndDrop extends ActionBase {
26
26
  private dragArea;
27
27
  private enableCurrentViewDrag;
28
28
  private isPreventMultiDrag;
29
+ private slotsUptoCursor;
30
+ private eleTop;
29
31
  wireDragEvent(element: HTMLElement): void;
30
32
  setDragArea(): void;
31
33
  private dragHelper;
@@ -51,14 +51,17 @@ var DragAndDrop = /** @class */ (function (_super) {
51
51
  _this.isCursorAhead = false;
52
52
  _this.enableCurrentViewDrag = false;
53
53
  _this.isPreventMultiDrag = false;
54
+ _this.slotsUptoCursor = -1;
55
+ _this.eleTop = 0;
54
56
  return _this;
55
57
  }
56
58
  DragAndDrop.prototype.wireDragEvent = function (element) {
59
+ var isVerticalView = ['Day', 'Week', 'WorkWeek'].indexOf(this.parent.currentView) > -1;
57
60
  new Draggable(element, {
58
61
  abort: '.' + cls.EVENT_RESIZE_CLASS,
59
62
  clone: true,
60
63
  isDragScroll: true,
61
- enableTailMode: (this.parent.eventDragArea) ? true : false,
64
+ enableTailMode: (this.parent.eventDragArea || isVerticalView) ? true : false,
62
65
  cursorAt: (this.parent.eventDragArea) ? { left: -20, top: -20 } : { left: 0, top: 0 },
63
66
  dragArea: this.dragArea,
64
67
  dragStart: this.dragStart.bind(this),
@@ -82,6 +85,8 @@ var DragAndDrop = /** @class */ (function (_super) {
82
85
  }
83
86
  this.setDragActionDefaultValues();
84
87
  this.actionObj.element = e.element;
88
+ this.eleTop = parseFloat(this.actionObj.element.style.top);
89
+ this.slotsUptoCursor = -1;
85
90
  this.actionObj.action = 'drag';
86
91
  var elements = [];
87
92
  if (!this.parent.allowMultiDrag || isNullOrUndefined(this.parent.selectedElements) || this.parent.selectedElements.length === 0 ||
@@ -160,7 +165,13 @@ var DragAndDrop = /** @class */ (function (_super) {
160
165
  }
161
166
  var top_1 = parseInt(e.top, 10);
162
167
  top_1 = top_1 < 0 ? 0 : top_1;
163
- topValue = formatUnit(Math.floor(top_1 / cellHeight) * cellHeight);
168
+ if (this.slotsUptoCursor < 0) {
169
+ var cellsCountUptoCursor = Math.floor(top_1 / cellHeight);
170
+ var cellsCountUptoEleTop = Math.floor(this.eleTop / cellHeight);
171
+ this.slotsUptoCursor = cellsCountUptoCursor - cellsCountUptoEleTop;
172
+ }
173
+ top_1 = (Math.floor((top_1 + 1) / cellHeight) - this.slotsUptoCursor) * cellHeight;
174
+ topValue = formatUnit(top_1 < 0 ? 0 : top_1);
164
175
  var scrollHeight = this.parent.element.querySelector('.e-content-wrap').scrollHeight;
165
176
  var cloneBottom = parseInt(topValue, 10) + this.actionObj.clone.offsetHeight;
166
177
  if (cloneBottom > scrollHeight) {
@@ -595,7 +606,7 @@ var DragAndDrop = /** @class */ (function (_super) {
595
606
  (dragArea.scrollTop + dragArea.offsetHeight - this.actionObj.clone.offsetHeight + window.pageYOffset) +
596
607
  (this.actionObj.clone.offsetHeight - this.heightUptoCursorPoint);
597
608
  offsetTop = Math.round(offsetTop / this.actionObj.cellHeight) * this.actionObj.cellHeight;
598
- if (dragArea.scrollTop > 0) {
609
+ if (dragArea.scrollTop > 0 && offsetTop < dragArea.scrollHeight) {
599
610
  this.actionObj.clone.style.top = formatUnit(offsetTop);
600
611
  }
601
612
  }
@@ -843,7 +854,7 @@ var DragAndDrop = /** @class */ (function (_super) {
843
854
  var appHeight = this.parent.activeViewOptions.timeScale.enable ? this.verticalEvent.getHeight(eStart, eEnd) :
844
855
  this.actionObj.element.offsetHeight;
845
856
  var topValue = this.parent.activeViewOptions.timeScale.enable ?
846
- this.verticalEvent.getTopValue(eStart, dayIndex, indexGroup) : this.actionObj.element.offsetTop;
857
+ this.verticalEvent.getTopValue(eStart) : this.actionObj.element.offsetTop;
847
858
  if (isNullOrUndefined(index)) {
848
859
  if (i === 0) {
849
860
  this.actionObj.clone.style.top = formatUnit(topValue);
@@ -212,6 +212,9 @@ var ScheduleTouch = /** @class */ (function () {
212
212
  this.element.style.transform = 'translatex(' + (this.parent.enableRtl ? prevWidth : -this.currentPanel.element.offsetLeft) + 'px)';
213
213
  };
214
214
  ScheduleTouch.prototype.onTransitionEnd = function () {
215
+ if (!isNullOrUndefined(this.element) && !this.element.classList.contains(cls.TRANSLATE_CLASS)) {
216
+ return;
217
+ }
215
218
  removeClass([this.element], cls.TRANSLATE_CLASS);
216
219
  this.element.style.transitionDuration = '';
217
220
  this.element.style.transform = '';
@@ -44,7 +44,8 @@ export declare class VerticalEvent extends EventBase {
44
44
  renderNormalEvents(eventObj: Record<string, any>, dayIndex: number, resource: number, dayCount: number, inline?: boolean): void;
45
45
  private getEventWidth;
46
46
  private getEventLeft;
47
- getTopValue(date: Date, day: number, resource: number): number;
47
+ private getStartEndHours;
48
+ getTopValue(date: Date): number;
48
49
  private getOverlapIndex;
49
50
  private adjustOverlapElements;
50
51
  private setAllDayRowHeight;
@@ -35,8 +35,8 @@ var VerticalEvent = /** @class */ (function (_super) {
35
35
  _this.slotCount = _this.parent.activeViewOptions.timeScale.slotCount;
36
36
  _this.interval = _this.parent.activeViewOptions.timeScale.interval;
37
37
  _this.allDayLevel = 0;
38
- _this.startHour = _this.parent.activeView.getStartHour();
39
- _this.endHour = _this.parent.activeView.getEndHour();
38
+ _this.startHour = _this.getStartEndHours(_this.parent.activeViewOptions.startHour);
39
+ _this.endHour = _this.getStartEndHours(_this.parent.activeViewOptions.endHour);
40
40
  _this.element = _this.parent.activeView.getPanel();
41
41
  _this.fields = _this.parent.eventFields;
42
42
  _this.animation = new Animation({ progress: _this.animationUiUpdate.bind(_this) });
@@ -170,7 +170,7 @@ var VerticalEvent = /** @class */ (function (_super) {
170
170
  var renderDates = this.dateRender[parseInt(resource.toString(), 10)];
171
171
  for (var day = 0, length_1 = renderDates.length; day < length_1; day++) {
172
172
  var startDate = new Date(renderDates[parseInt(day.toString(), 10)].getTime());
173
- var endDate = util.addDays(renderDates[parseInt(day.toString(), 10)], 1);
173
+ var endDate = util.resetTime(util.addDays(renderDates[parseInt(day.toString(), 10)], 1));
174
174
  var filterEvents = this.filterEvents(startDate, endDate, this.parent.blockProcessed, this.resources[parseInt(resource.toString(), 10)]);
175
175
  for (var _a = 0, filterEvents_1 = filterEvents; _a < filterEvents_1.length; _a++) {
176
176
  var event_1 = filterEvents_1[_a];
@@ -201,7 +201,7 @@ var VerticalEvent = /** @class */ (function (_super) {
201
201
  }
202
202
  else {
203
203
  blockHeight = formatUnit(this.getHeight(eStart, eEnd));
204
- blockTop = formatUnit(this.getTopValue(eStart, dayIndex, resource));
204
+ blockTop = formatUnit(this.getTopValue(eStart));
205
205
  }
206
206
  var appointmentElement = this.createBlockAppointmentElement(eventObj, resource, this.isResourceEventTemplate);
207
207
  setStyleAttribute(appointmentElement, { 'width': '100%', 'height': blockHeight, 'top': blockTop });
@@ -234,7 +234,7 @@ var VerticalEvent = /** @class */ (function (_super) {
234
234
  renderDates[parseInt(day.toString(), 10)] <= renderedDate[renderedDate.length - 1]; day++) {
235
235
  this_1.renderedEvents = [];
236
236
  var startDate = new Date(renderDates[parseInt(day.toString(), 10)].getTime());
237
- var endDate = util.addDays(renderDates[parseInt(day.toString(), 10)], 1);
237
+ var endDate = util.resetTime(util.addDays(renderDates[parseInt(day.toString(), 10)], 1));
238
238
  var filterEvents = this_1.filterEvents(startDate, endDate, eventCollection, this_1.resources[parseInt(resource.toString(), 10)]);
239
239
  if (isRender) {
240
240
  for (var _i = 0, filterEvents_2 = filterEvents; _i < filterEvents_2.length; _i++) {
@@ -579,7 +579,7 @@ var VerticalEvent = /** @class */ (function (_super) {
579
579
  if (eStart <= eEnd && isValidEvent && this.isWorkDayAvailable(resource, eStart)) {
580
580
  var appHeight = record.isSpanned.isSameDuration ? this.cellHeight : this.getHeight(eStart, eEnd);
581
581
  if (eStart.getTime() >= schedule.startHour.getTime()) {
582
- topValue = this.getTopValue(eStart, dayIndex, resource);
582
+ topValue = this.getTopValue(eStart);
583
583
  }
584
584
  var appIndex = this.getOverlapIndex(record, dayIndex, false, resource);
585
585
  record.Index = appIndex;
@@ -640,13 +640,20 @@ var VerticalEvent = /** @class */ (function (_super) {
640
640
  var tempLeft = (parseFloat(appWidth) + 1) * index;
641
641
  return (tempLeft > 99 ? 99 : tempLeft) + '%';
642
642
  };
643
- VerticalEvent.prototype.getTopValue = function (date, day, resource) {
644
- var viewDate = util.resetTime(this.dateRender[parseInt(resource.toString(), 10)][parseInt(day.toString(), 10)]);
645
- var startEndHours = util.getStartEndHours(viewDate, this.startHour, this.endHour);
646
- var startHour = startEndHours.startHour;
647
- var adjustedStartHour = util.isDaylightSavingTime(viewDate) && (startHour.getHours() !== this.startHour.getHours()) ?
648
- this.startHour.getHours() : startHour.getHours();
649
- var diffInMinutes = ((date.getHours() - adjustedStartHour) * 60) + (date.getMinutes() - startHour.getMinutes());
643
+ VerticalEvent.prototype.getStartEndHours = function (startEndTime) {
644
+ if (!isNullOrUndefined(startEndTime) && startEndTime !== '') {
645
+ var startEndDate = new Date(2000, 0, 0, 0);
646
+ var timeString = startEndTime.split(':');
647
+ if (timeString.length === 2) {
648
+ startEndDate.setHours(parseInt(timeString[0], 10), parseInt(timeString[1], 10), 0);
649
+ }
650
+ return startEndDate;
651
+ }
652
+ return null;
653
+ };
654
+ VerticalEvent.prototype.getTopValue = function (date) {
655
+ var startHour = this.getStartEndHours(this.parent.activeViewOptions.startHour);
656
+ var diffInMinutes = ((date.getHours() - startHour.getHours()) * 60) + (date.getMinutes() - startHour.getMinutes());
650
657
  return (this.parent.activeViewOptions.timeScale.enable) ? ((diffInMinutes * this.cellHeight * this.slotCount) / this.interval) : 0;
651
658
  };
652
659
  VerticalEvent.prototype.getOverlapIndex = function (record, day, isAllDay, resource) {
@@ -369,7 +369,7 @@ var VerticalView = /** @class */ (function (_super) {
369
369
  }
370
370
  };
371
371
  VerticalView.prototype.getTopFromDateTime = function (date) {
372
- var startHour = this.getStartHour();
372
+ var startHour = this.getStartEndHours(this.parent.activeViewOptions.startHour);
373
373
  var diffInMinutes = ((date.getHours() - startHour.getHours()) * 60) + (date.getMinutes() - startHour.getMinutes());
374
374
  return (diffInMinutes * this.getWorkCellHeight() * this.parent.activeViewOptions.timeScale.slotCount) /
375
375
  this.parent.activeViewOptions.timeScale.interval;
@@ -264,6 +264,10 @@ var ViewBase = /** @class */ (function () {
264
264
  }
265
265
  startHour.setMilliseconds(0);
266
266
  endHour.setMilliseconds(0);
267
+ if (util.resetTime(date).getTime() !== util.resetTime(startHour).getTime()) {
268
+ startHour = new Date(2000, 0, 0, startHour.getHours(), startHour.getMinutes(), startHour.getMilliseconds());
269
+ endHour = new Date(2000, 0, 0, endHour.getHours(), endHour.getMinutes(), endHour.getMilliseconds());
270
+ }
267
271
  return !(util.getDateInMs(date) < util.getDateInMs(startHour) || util.getDateInMs(date) >= util.getDateInMs(endHour) ||
268
272
  !this.isWorkDay(date, workDays));
269
273
  };