@syncfusion/ej2-schedule 20.2.38 → 20.2.45

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 : 20.2.38
3
+ * version : 20.2.45
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. 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@20.2.36",
3
+ "_id": "@syncfusion/ej2-schedule@20.2.40",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-LvbKoK7n6mykYe9JbXXXshmU2sZVFJ0OJA22Ng55q2fBao9kgZt+AmwYZk9ffzyFZbzAYgIPKSiNrRF9+Ps3PA==",
5
+ "_integrity": "sha512-kU/0Be1pH5yFXhucutY7aGY+0JD6l+S/dOwICMpItjm794B1hhepBKqgexfw9BuGB0hDGOnNHsQEwVnZ+yXt+w==",
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": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-schedule/-/ej2-schedule-20.2.36.tgz",
27
- "_shasum": "9714b4fa139a8afc99b3875e52350e177510889d",
26
+ "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-schedule/-/ej2-schedule-20.2.40.tgz",
27
+ "_shasum": "d9b88f81c4941440ba79cefcb0ec412a5b581ccb",
28
28
  "_spec": "@syncfusion/ej2-schedule@*",
29
29
  "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
30
30
  "author": {
@@ -35,16 +35,16 @@
35
35
  },
36
36
  "bundleDependencies": false,
37
37
  "dependencies": {
38
- "@syncfusion/ej2-base": "~20.2.38",
39
- "@syncfusion/ej2-buttons": "~20.2.38",
40
- "@syncfusion/ej2-calendars": "~20.2.38",
41
- "@syncfusion/ej2-data": "~20.2.38",
42
- "@syncfusion/ej2-dropdowns": "~20.2.38",
43
- "@syncfusion/ej2-excel-export": "~20.2.38",
44
- "@syncfusion/ej2-inputs": "~20.2.38",
45
- "@syncfusion/ej2-lists": "~20.2.38",
46
- "@syncfusion/ej2-navigations": "~20.2.38",
47
- "@syncfusion/ej2-popups": "~20.2.38"
38
+ "@syncfusion/ej2-base": "~20.2.45",
39
+ "@syncfusion/ej2-buttons": "~20.2.45",
40
+ "@syncfusion/ej2-calendars": "~20.2.45",
41
+ "@syncfusion/ej2-data": "~20.2.45",
42
+ "@syncfusion/ej2-dropdowns": "~20.2.45",
43
+ "@syncfusion/ej2-excel-export": "~20.2.45",
44
+ "@syncfusion/ej2-inputs": "~20.2.45",
45
+ "@syncfusion/ej2-lists": "~20.2.45",
46
+ "@syncfusion/ej2-navigations": "~20.2.45",
47
+ "@syncfusion/ej2-popups": "~20.2.45"
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.",
@@ -81,6 +81,6 @@
81
81
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
82
82
  },
83
83
  "typings": "index.d.ts",
84
- "version": "20.2.38",
84
+ "version": "20.2.45",
85
85
  "sideEffects": false
86
86
  }
@@ -13,6 +13,7 @@ export declare class Crud {
13
13
  refreshDataManager(): void;
14
14
  private dataManagerSuccess;
15
15
  dataManagerFailure(e: ReturnType): void;
16
+ refreshProcessedData(): void;
16
17
  private refreshData;
17
18
  addEvent(eventData: Record<string, any> | Record<string, any>[]): void;
18
19
  saveEvent(eventData: Record<string, any> | Record<string, any>[], action: CurrentAction): void;
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  /* eslint-disable max-len */
3
- import { isNullOrUndefined, extend } from '@syncfusion/ej2-base';
3
+ import { isNullOrUndefined, extend, removeClass } from '@syncfusion/ej2-base';
4
4
  import { getRecurrenceStringFromDate, generate } from '../../recurrence-editor/date-generator';
5
5
  import * as events from '../base/constant';
6
6
  import * as util from '../base/util';
@@ -43,7 +43,7 @@ var Crud = /** @class */ (function () {
43
43
  var resultData = extend([], args.result, null, true);
44
44
  _this.parent.eventsData = resultData.filter(function (data) { return !data[_this.parent.eventFields.isBlock]; });
45
45
  _this.parent.blockData = resultData.filter(function (data) { return data[_this.parent.eventFields.isBlock]; });
46
- _this.parent.refreshEvents(false);
46
+ _this.refreshProcessedData();
47
47
  if (_this.parent.dragAndDropModule && _this.parent.dragAndDropModule.actionObj.action === 'drag') {
48
48
  _this.parent.dragAndDropModule.navigationWrapper();
49
49
  }
@@ -62,6 +62,31 @@ var Crud = /** @class */ (function () {
62
62
  }
63
63
  this.parent.trigger(events.actionFailure, { error: e }, function () { return _this.parent.hideSpinner(); });
64
64
  };
65
+ Crud.prototype.refreshProcessedData = function () {
66
+ if (this.parent.dragAndDropModule) {
67
+ this.parent.dragAndDropModule.actionObj.action = '';
68
+ removeClass([this.parent.element], 'e-event-action');
69
+ }
70
+ if (this.parent.activeViewOptions && this.parent.activeViewOptions.eventTemplate) {
71
+ var templateNames = ['eventTemplate'];
72
+ if (this.crudObj.isCrudAction &&
73
+ ['Agenda', 'MonthAgenda', 'Year', 'TimelineYear'].indexOf(this.parent.currentView) === -1) {
74
+ templateNames = [];
75
+ for (var i = 0, len = this.crudObj.sourceEvent.length; i < len; i++) {
76
+ templateNames.push('eventTemplate_' + this.crudObj.sourceEvent[i].groupIndex);
77
+ if (this.crudObj.targetEvent[i] && this.crudObj.sourceEvent[i].groupIndex !==
78
+ this.crudObj.targetEvent[i].groupIndex) {
79
+ templateNames.push('eventTemplate_' + this.crudObj.targetEvent[i].groupIndex);
80
+ }
81
+ }
82
+ }
83
+ this.parent.resetTemplates(templateNames);
84
+ }
85
+ var eventsData = this.parent.eventsData || [];
86
+ var blockData = this.parent.blockData || [];
87
+ var data = eventsData.concat(blockData);
88
+ this.parent.notify(events.dataReady, { processedData: this.parent.eventBase ? this.parent.eventBase.processData(data) : [] });
89
+ };
65
90
  Crud.prototype.refreshData = function (args) {
66
91
  var _this = this;
67
92
  var actionArgs = {
@@ -492,7 +492,7 @@ export interface UIStateArgs {
492
492
  action?: boolean;
493
493
  isBlock?: boolean;
494
494
  isCustomMonth?: boolean;
495
- isResize?: boolean;
495
+ isPreventTimezone?: boolean;
496
496
  }
497
497
  /**
498
498
  * @private
@@ -657,7 +657,7 @@ var Schedule = /** @class */ (function (_super) {
657
657
  if (this && isNullOrUndefined(this.uiStateValues) || !(this.enablePersistence)) {
658
658
  this.uiStateValues = {
659
659
  expand: false, isInitial: true, left: 0, top: 0, isGroupAdaptive: false,
660
- isIgnoreOccurrence: false, groupIndex: 0, action: false, isBlock: false, isCustomMonth: true, isResize: false
660
+ isIgnoreOccurrence: false, groupIndex: 0, action: false, isBlock: false, isCustomMonth: true, isPreventTimezone: false
661
661
  };
662
662
  }
663
663
  this.activeCellsData = { startTime: this.getCurrentTime(), endTime: this.getCurrentTime(), isAllDay: false };
@@ -1119,11 +1119,9 @@ var Schedule = /** @class */ (function (_super) {
1119
1119
  }
1120
1120
  if (this.currentView === 'Month' || ((this.currentView !== 'Agenda' && this.currentView !== 'MonthAgenda')
1121
1121
  && !this.activeViewOptions.timeScale.enable) || this.activeView.isTimelineView()) {
1122
- this.uiStateValues.isResize = true;
1123
1122
  this.activeView.resetColWidth();
1124
1123
  this.notify(events.scrollUiUpdate, { cssProperties: this.getCssProperties(), isPreventScrollUpdate: true });
1125
1124
  this.refreshEvents(false);
1126
- this.uiStateValues.isResize = false;
1127
1125
  }
1128
1126
  else {
1129
1127
  this.notify(events.contentReady, {});
@@ -2195,25 +2193,15 @@ var Schedule = /** @class */ (function (_super) {
2195
2193
  this.crudModule.refreshDataManager();
2196
2194
  }
2197
2195
  else {
2198
- if (this.activeViewOptions && this.activeViewOptions.eventTemplate) {
2199
- var templateNames = ['eventTemplate'];
2200
- if (this.crudModule && this.crudModule.crudObj.isCrudAction &&
2201
- ['Agenda', 'MonthAgenda', 'Year', 'TimelineYear'].indexOf(this.currentView) === -1) {
2202
- templateNames = [];
2203
- for (var i = 0, len = this.crudModule.crudObj.sourceEvent.length; i < len; i++) {
2204
- templateNames.push('eventTemplate_' + this.crudModule.crudObj.sourceEvent[i].groupIndex);
2205
- if (this.crudModule.crudObj.targetEvent[i] && this.crudModule.crudObj.sourceEvent[i].groupIndex !==
2206
- this.crudModule.crudObj.targetEvent[i].groupIndex) {
2207
- templateNames.push('eventTemplate_' + this.crudModule.crudObj.targetEvent[i].groupIndex);
2208
- }
2209
- }
2210
- }
2211
- this.resetTemplates(templateNames);
2196
+ if (this.uiStateValues) {
2197
+ this.uiStateValues.isPreventTimezone = true;
2198
+ }
2199
+ if (this.crudModule) {
2200
+ this.crudModule.refreshProcessedData();
2201
+ }
2202
+ if (this.uiStateValues) {
2203
+ this.uiStateValues.isPreventTimezone = false;
2212
2204
  }
2213
- var eventsData = this.eventsData || [];
2214
- var blockData = this.blockData || [];
2215
- var data = eventsData.concat(blockData);
2216
- this.notify(events.dataReady, { processedData: this.eventBase ? this.eventBase.processData(data) : [] });
2217
2205
  }
2218
2206
  };
2219
2207
  /**
@@ -41,7 +41,7 @@ var EventBase = /** @class */ (function () {
41
41
  if (timeZonePropChanged) {
42
42
  this_1.processTimezoneChange(event_1, oldTimezone);
43
43
  }
44
- else if (!this_1.parent.isPrinting && !this_1.parent.uiStateValues.isResize) {
44
+ else if (!this_1.parent.isPrinting && !this_1.parent.uiStateValues.isPreventTimezone) {
45
45
  event_1 = this_1.processTimezone(event_1);
46
46
  }
47
47
  for (var level = 0; level < resourceCollection.length; level++) {
@@ -6,6 +6,7 @@ export declare class ICalendarExport {
6
6
  private parent;
7
7
  constructor(parent: Schedule);
8
8
  initializeCalendarExport(fileName: string, customData: Record<string, any>[]): void;
9
+ getCalendarString(fileName?: string, customData?: Record<string, any>[]): string;
9
10
  private customFieldFilter;
10
11
  private convertDateToString;
11
12
  private download;
@@ -9,6 +9,10 @@ var ICalendarExport = /** @class */ (function () {
9
9
  this.parent = parent;
10
10
  }
11
11
  ICalendarExport.prototype.initializeCalendarExport = function (fileName, customData) {
12
+ var icsString = this.getCalendarString(fileName, customData);
13
+ this.download(icsString, fileName);
14
+ };
15
+ ICalendarExport.prototype.getCalendarString = function (fileName, customData) {
12
16
  var _this = this;
13
17
  var eventsData = (customData) ? customData :
14
18
  extend([], this.parent.eventsData, null, true);
@@ -94,7 +98,7 @@ var ICalendarExport = /** @class */ (function () {
94
98
  'X-WR-TIMEZONE:' + timeZone
95
99
  ].join(SEPARATOR);
96
100
  var icsString = iCalendar + SEPARATOR + iCalendarEvents.join(SEPARATOR) + SEPARATOR + 'END:VCALENDAR';
97
- this.download(icsString, fileName);
101
+ return icsString;
98
102
  };
99
103
  ICalendarExport.prototype.customFieldFilter = function (eventObj, fields) {
100
104
  var defaultFields = Object.keys(fields).map(function (key) { return fields[key]; });
@@ -38,5 +38,6 @@ export declare class Agenda extends AgendaBase implements IRenderer {
38
38
  addEventListener(): void;
39
39
  removeEventListener(): void;
40
40
  private onAgendaScrollUiUpdate;
41
+ scrollToDate(scrollDate: Date): void;
41
42
  destroy(): void;
42
43
  }
@@ -436,6 +436,20 @@ var Agenda = /** @class */ (function (_super) {
436
436
  contentArea.style.height = formatUnit(this.parent.element.offsetHeight - headerHeight);
437
437
  }
438
438
  };
439
+ Agenda.prototype.scrollToDate = function (scrollDate) {
440
+ var date = new Date(+util.resetTime(scrollDate));
441
+ if (this.parent.activeViewOptions.allowVirtualScrolling) {
442
+ if (!this.parent.hideEmptyAgendaDays || this.parent.getEvents(date, util.addDays(date, 1), true).length > 0) {
443
+ this.parent.changeDate(date);
444
+ }
445
+ }
446
+ else {
447
+ var dateElement = this.element.querySelector('.' + cls.AGENDA_CELLS_CLASS + '[data-date="' + date.getTime() + '"]');
448
+ if (dateElement) {
449
+ this.getContentAreaElement().scrollTop = dateElement.offsetTop;
450
+ }
451
+ }
452
+ };
439
453
  Agenda.prototype.destroy = function () {
440
454
  if (!this.parent || this.parent && this.parent.isDestroyed) {
441
455
  return;
@@ -57,9 +57,12 @@ var TimelineViews = /** @class */ (function (_super) {
57
57
  if (scrollDate) {
58
58
  index = this.parent.getIndexOfDate(this.renderDates, util.resetTime(scrollDate));
59
59
  if (index >= 0) {
60
- var timeString = hour.split(':');
61
- if (timeString.length === 2) {
62
- date = new Date(scrollDate.setHours(parseInt(timeString[0], 10), parseInt(timeString[1], 10), 0));
60
+ date = scrollDate;
61
+ if (!isNullOrUndefined(hour)) {
62
+ var timeString = hour.split(':');
63
+ if (timeString.length === 2) {
64
+ date = new Date(scrollDate.setHours(parseInt(timeString[0], 10), parseInt(timeString[1], 10), 0));
65
+ }
63
66
  }
64
67
  }
65
68
  }
@@ -67,8 +70,14 @@ var TimelineViews = /** @class */ (function (_super) {
67
70
  if (isNullOrUndefined(date)) {
68
71
  return;
69
72
  }
70
- var scrollLeft = isNullOrUndefined(scrollDate) ? this.getLeftFromDateTime(null, date) :
71
- this.getLeftFromDateTime([index], date);
73
+ var scrollLeft;
74
+ if (isNullOrUndefined(hour) || !this.parent.activeViewOptions.timeScale.enable) {
75
+ scrollLeft = index * this.getWorkCellWidth();
76
+ }
77
+ else {
78
+ scrollLeft = isNullOrUndefined(scrollDate) ? this.getLeftFromDateTime(null, date) :
79
+ this.getLeftFromDateTime([index], date);
80
+ }
72
81
  this.getScrollableElement().scrollLeft = !this.parent.enableRtl ? scrollLeft : -scrollLeft;
73
82
  };
74
83
  TimelineViews.prototype.generateColumnLevels = function () {
@@ -422,13 +422,25 @@ var TimelineYear = /** @class */ (function (_super) {
422
422
  append(cellTemplate, td);
423
423
  };
424
424
  TimelineYear.prototype.scrollToDate = function (scrollDate) {
425
- if (this.parent.activeViewOptions.group.resources.length === 0) {
426
- var date = +new Date(util.resetTime(scrollDate));
427
- var element = this.element.querySelector('[data-date="' + date + '"]');
428
- if (element) {
429
- this.getScrollableElement().scrollLeft = element.offsetLeft;
430
- this.getScrollableElement().scrollTop = element.offsetTop;
425
+ var date;
426
+ if (this.parent.activeViewOptions.group.resources !== null && this.parent.activeViewOptions.group.resources.length > 0 &&
427
+ !this.parent.uiStateValues.isGroupAdaptive) {
428
+ date = +new Date(util.resetTime(util.firstDateOfMonth(scrollDate)));
429
+ }
430
+ else {
431
+ date = +new Date(util.resetTime(scrollDate));
432
+ }
433
+ var element = this.element.querySelector('[data-date="' + date + '"]');
434
+ if (element) {
435
+ var wrap = this.getScrollableElement();
436
+ if (this.parent.enableRtl) {
437
+ var conTable = this.element.querySelector('.' + cls.CONTENT_TABLE_CLASS);
438
+ wrap.scrollLeft = -(conTable.offsetWidth - element.offsetLeft - element.offsetWidth);
439
+ }
440
+ else {
441
+ wrap.scrollLeft = element.offsetLeft;
431
442
  }
443
+ wrap.scrollTop = element.offsetTop;
432
444
  }
433
445
  };
434
446
  TimelineYear.prototype.getScrollableElement = function () {
@@ -40,5 +40,6 @@ export declare class Year extends ViewBase implements IRenderer {
40
40
  removeEventListener(): void;
41
41
  onDataReady(args: NotifyEventArgs): void;
42
42
  wireEvents(element: HTMLElement, type: string): void;
43
+ scrollToDate(scrollDate: Date): void;
43
44
  destroy(): void;
44
45
  }
@@ -386,6 +386,14 @@ var Year = /** @class */ (function (_super) {
386
386
  EventHandler.add(element, 'scroll', this.onContentScroll, this);
387
387
  }
388
388
  };
389
+ Year.prototype.scrollToDate = function (scrollDate) {
390
+ var date = +new Date(util.resetTime(scrollDate));
391
+ var element = this.element.querySelector('.' + cls.WORK_CELLS_CLASS + ':not(.' + cls.OTHERMONTH_CLASS + ')[data-date="' + date + '"]');
392
+ if (element) {
393
+ element = closest(element, '.e-month-calendar');
394
+ this.getContentAreaElement().scrollTop = element.offsetTop;
395
+ }
396
+ };
389
397
  Year.prototype.destroy = function () {
390
398
  if (!this.parent || this.parent && this.parent.isDestroyed) {
391
399
  return;