@syncfusion/ej2-schedule 20.3.49 → 20.3.52

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.3.49
3
+ * version : 20.3.52
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.3.47",
3
+ "_id": "@syncfusion/ej2-schedule@20.3.50",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-mY9pHw0JrYsYwOWA27ejxr7OU/hoJuqKxJKfKP5lkSokLXN34IPY6slTHB//Z4EuleTB14+kpRYXYk6eR7qj+Q==",
5
+ "_integrity": "sha512-NdLi6k1P/VKN4TRQa6wTqHC9UJ5ANVt6OK78LkxKllyqhGkmo4aMfX59Wuh2qQaSLw1rXIYMfysxn383iM9zGw==",
6
6
  "_location": "/@syncfusion/ej2-schedule",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,10 +23,10 @@
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.3.47.tgz",
27
- "_shasum": "2c9c56ea584275a1ff5960e0eb785a473de71655",
26
+ "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-schedule/-/ej2-schedule-20.3.50.tgz",
27
+ "_shasum": "3302f7574621bbd7211cb88db9147e6b62f13c94",
28
28
  "_spec": "@syncfusion/ej2-schedule@*",
29
- "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
29
+ "_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
30
30
  "author": {
31
31
  "name": "Syncfusion Inc."
32
32
  },
@@ -35,16 +35,16 @@
35
35
  },
36
36
  "bundleDependencies": false,
37
37
  "dependencies": {
38
- "@syncfusion/ej2-base": "~20.3.49",
39
- "@syncfusion/ej2-buttons": "~20.3.49",
40
- "@syncfusion/ej2-calendars": "~20.3.49",
41
- "@syncfusion/ej2-data": "~20.3.47",
42
- "@syncfusion/ej2-dropdowns": "~20.3.49",
38
+ "@syncfusion/ej2-base": "~20.3.50",
39
+ "@syncfusion/ej2-buttons": "~20.3.50",
40
+ "@syncfusion/ej2-calendars": "~20.3.50",
41
+ "@syncfusion/ej2-data": "~20.3.50",
42
+ "@syncfusion/ej2-dropdowns": "~20.3.50",
43
43
  "@syncfusion/ej2-excel-export": "~20.3.47",
44
- "@syncfusion/ej2-inputs": "~20.3.49",
45
- "@syncfusion/ej2-lists": "~20.3.47",
46
- "@syncfusion/ej2-navigations": "~20.3.49",
47
- "@syncfusion/ej2-popups": "~20.3.49"
44
+ "@syncfusion/ej2-inputs": "~20.3.50",
45
+ "@syncfusion/ej2-lists": "~20.3.51",
46
+ "@syncfusion/ej2-navigations": "~20.3.52",
47
+ "@syncfusion/ej2-popups": "~20.3.50"
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.3.49",
84
+ "version": "20.3.52",
85
85
  "sideEffects": false
86
86
  }
@@ -56,9 +56,11 @@ var Gregorian = /** @class */ (function () {
56
56
  }
57
57
  };
58
58
  Gregorian.prototype.setMonth = function (date, interval, startDate) {
59
+ date.setDate(1);
59
60
  date.setFullYear(date.getFullYear());
60
61
  date.setMonth(interval - 1);
61
- date.setDate(startDate);
62
+ var maxDay = new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();
63
+ date.setDate(Math.min(startDate, maxDay));
62
64
  };
63
65
  Gregorian.prototype.addYears = function (date, interval) {
64
66
  date.setFullYear(date.getFullYear() + interval);
@@ -13,7 +13,7 @@ export declare class Crud {
13
13
  refreshDataManager(): void;
14
14
  private dataManagerSuccess;
15
15
  dataManagerFailure(e: ReturnType): void;
16
- refreshProcessedData(): void;
16
+ refreshProcessedData(isVirtualScrollAction?: boolean): void;
17
17
  private refreshData;
18
18
  addEvent(eventData: Record<string, any> | Record<string, any>[]): void;
19
19
  saveEvent(eventData: Record<string, any> | Record<string, any>[], action: CurrentAction): void;
@@ -62,7 +62,8 @@ 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 () {
65
+ Crud.prototype.refreshProcessedData = function (isVirtualScrollAction) {
66
+ if (isVirtualScrollAction === void 0) { isVirtualScrollAction = false; }
66
67
  if (this.parent.dragAndDropModule) {
67
68
  this.parent.dragAndDropModule.actionObj.action = '';
68
69
  removeClass([this.parent.element], 'e-event-action');
@@ -82,6 +83,10 @@ var Crud = /** @class */ (function () {
82
83
  }
83
84
  this.parent.resetTemplates(templateNames);
84
85
  }
86
+ if (isVirtualScrollAction) {
87
+ this.parent.notify(events.dataReady, { processedData: this.parent.eventsProcessed });
88
+ return;
89
+ }
85
90
  var eventsData = this.parent.eventsData || [];
86
91
  var blockData = this.parent.blockData || [];
87
92
  var data = eventsData.concat(blockData);
@@ -33,6 +33,7 @@ var KeyboardInteraction = /** @class */ (function () {
33
33
  enter: 'enter',
34
34
  escape: 'escape',
35
35
  delete: 'delete',
36
+ backspace: 'backspace',
36
37
  home: 'home',
37
38
  pageUp: 'pageup',
38
39
  pageDown: 'pagedown',
@@ -104,6 +105,7 @@ var KeyboardInteraction = /** @class */ (function () {
104
105
  this.processTab(e, e.shiftKey);
105
106
  break;
106
107
  case 'delete':
108
+ case 'backspace':
107
109
  this.processDelete(e);
108
110
  break;
109
111
  case 'ctrlShiftUpArrow':
@@ -22,8 +22,8 @@ var ScheduleTouch = /** @class */ (function () {
22
22
  }
23
23
  ScheduleTouch.prototype.scrollHandler = function (e) {
24
24
  if (this.parent.currentView === 'Agenda' || this.parent.uiStateValues.action || !this.parent.allowSwiping ||
25
- (e.originalEvent && (e.originalEvent.target.classList.contains(cls.APPOINTMENT_CLASS) ||
26
- closest(e.originalEvent.target, '.' + cls.APPOINTMENT_CLASS)))) {
25
+ (e.originalEvent && e.originalEvent.target && (e.originalEvent.target.classList.contains(cls.APPOINTMENT_CLASS) ||
26
+ closest(e.originalEvent.target, '.' + cls.APPOINTMENT_CLASS)) && !this.parent.isAdaptive)) {
27
27
  return;
28
28
  }
29
29
  if (!this.timeStampStart) {
@@ -89,7 +89,9 @@ var VirtualScroll = /** @class */ (function () {
89
89
  };
90
90
  VirtualScroll.prototype.renderEvents = function () {
91
91
  this.setTabIndex();
92
- this.parent.refreshEvents(false);
92
+ if (this.parent.crudModule) {
93
+ this.parent.crudModule.refreshProcessedData(true);
94
+ }
93
95
  if (this.parent.currentView !== 'Month') {
94
96
  this.parent.notify(events.contentReady, {});
95
97
  }
@@ -2195,11 +2195,11 @@ var Schedule = /** @class */ (function (_super) {
2195
2195
  */
2196
2196
  Schedule.prototype.refreshEvents = function (isRemoteRefresh) {
2197
2197
  if (isRemoteRefresh === void 0) { isRemoteRefresh = true; }
2198
- if (this.dragAndDropModule) {
2199
- this.dragAndDropModule.actionObj.action = '';
2200
- removeClass([this.element], cls.EVENT_ACTION_CLASS);
2201
- }
2202
2198
  if (isRemoteRefresh) {
2199
+ if (this.dragAndDropModule) {
2200
+ this.dragAndDropModule.actionObj.action = '';
2201
+ removeClass([this.element], cls.EVENT_ACTION_CLASS);
2202
+ }
2203
2203
  this.crudModule.refreshDataManager();
2204
2204
  }
2205
2205
  else {
@@ -849,7 +849,8 @@ var EventBase = /** @class */ (function () {
849
849
  }
850
850
  if (idType === 'number') {
851
851
  var datas = this.parent.eventsData.concat(this.parent.blockData);
852
- var maxId = Math.max.apply(Math, datas.map(function (event) { return event[_this.parent.eventFields.id]; }));
852
+ var appIds = datas.map(function (event) { return event[_this.parent.eventFields.id]; });
853
+ var maxId = appIds.reduce(function (a, b) { return Math.max(a, b); });
853
854
  maxId = isNullOrUndefined(resourceId) ? maxId : maxId + resourceId;
854
855
  eventId = maxId + 1;
855
856
  }
@@ -43,5 +43,6 @@ export declare class TimelineEvent extends MonthEvent {
43
43
  getCellTd(): HTMLElement;
44
44
  renderBlockIndicator(cellTd: HTMLElement, position: number, resIndex: number): void;
45
45
  setMaxEventHeight(event: HTMLElement, cell: HTMLElement): void;
46
+ private isDayProcess;
46
47
  destroy(): void;
47
48
  }
@@ -160,7 +160,13 @@ var TimelineEvent = /** @class */ (function (_super) {
160
160
  eventObj[this.fields.endTime] = eventData[this.fields.endTime];
161
161
  var currentDate = util.resetTime(new Date(this.dateRender[this.day].getTime()));
162
162
  var schedule = util.getStartEndHours(currentDate, this.startHour, this.endHour);
163
- var isValidEvent = this.isValidEvent(eventObj, startTime, endTime, schedule);
163
+ var isValidEvent = true;
164
+ if (this.isDayProcess() || eventObj[this.fields.isAllDay]) {
165
+ isValidEvent = true;
166
+ }
167
+ else {
168
+ isValidEvent = this.isValidEvent(eventObj, startTime, endTime, schedule);
169
+ }
164
170
  if (startTime <= endTime && isValidEvent) {
165
171
  var appWidth_1 = this.getEventWidth(startTime, endTime, event[this.fields.isAllDay], diffInDays);
166
172
  appWidth_1 = this.renderType === 'day' ? appWidth_1 - 2 : appWidth_1;
@@ -323,14 +329,19 @@ var TimelineEvent = /** @class */ (function (_super) {
323
329
  TimelineEvent.prototype.getStartTime = function (event, eventData) {
324
330
  var startTime = event[this.fields.startTime];
325
331
  var schedule = util.getStartEndHours(startTime, this.startHour, this.endHour);
326
- if (schedule.startHour.getTime() >= eventData[this.fields.startTime]) {
327
- startTime = schedule.startHour;
328
- }
329
- else if (schedule.endHour.getTime() <= eventData[this.fields.startTime]) {
330
- startTime = this.getNextDay(schedule.startHour, eventData);
332
+ if (this.isDayProcess()) {
333
+ startTime = event[this.fields.startTime];
331
334
  }
332
335
  else {
333
- startTime = eventData[this.fields.startTime];
336
+ if (schedule.startHour.getTime() >= eventData[this.fields.startTime]) {
337
+ startTime = schedule.startHour;
338
+ }
339
+ else if (schedule.endHour.getTime() <= eventData[this.fields.startTime]) {
340
+ startTime = this.getNextDay(schedule.startHour, eventData);
341
+ }
342
+ else {
343
+ startTime = eventData[this.fields.startTime];
344
+ }
334
345
  }
335
346
  // To overcome the overflow
336
347
  eventData.trimStartTime = (event[this.fields.isAllDay]) ? schedule.startHour : eventData[this.fields.startTime];
@@ -350,17 +361,15 @@ var TimelineEvent = /** @class */ (function (_super) {
350
361
  TimelineEvent.prototype.getEndTime = function (event, eventData) {
351
362
  var endTime = event[this.fields.endTime];
352
363
  var schedule = util.getStartEndHours(endTime, this.startHour, this.endHour);
353
- if (this.parent.currentView === 'TimelineMonth' || !this.parent.activeViewOptions.timeScale.enable ||
354
- (this.parent.activeViewOptions.headerRows.length > 0 &&
355
- this.parent.activeViewOptions.headerRows.slice(-1)[0].option !== 'Hour')) {
364
+ if (this.isDayProcess()) {
356
365
  endTime = eventData[this.fields.endTime];
357
366
  }
358
367
  else {
359
368
  endTime = eventData[this.fields.endTime];
360
- if (schedule.endHour.getTime() <= eventData[this.fields.endTime]) {
369
+ if (schedule.endHour.getTime() <= eventData[this.fields.endTime] || event[this.fields.isAllDay]) {
361
370
  endTime = schedule.endHour;
362
371
  }
363
- if (schedule.startHour.getTime() >= eventData[this.fields.endTime].getTime() && !event.isAllDay) {
372
+ if (schedule.startHour.getTime() >= eventData[this.fields.endTime].getTime() && !event[this.fields.isAllDay]) {
364
373
  endTime = this.getPreviousDay(schedule.startHour, schedule.endHour, eventData);
365
374
  }
366
375
  }
@@ -513,6 +522,14 @@ var TimelineEvent = /** @class */ (function (_super) {
513
522
  'height': (this.cellHeight - (this.maxHeight ? 0 : EVENT_GAP) - (this.maxHeight ? 0 : this.moreIndicatorHeight)) + 'px'
514
523
  });
515
524
  };
525
+ TimelineEvent.prototype.isDayProcess = function () {
526
+ if (this.parent.currentView === 'TimelineMonth' || !this.parent.activeViewOptions.timeScale.enable ||
527
+ (this.parent.activeViewOptions.headerRows.length > 0 &&
528
+ this.parent.activeViewOptions.headerRows.slice(-1)[0].option !== 'Hour')) {
529
+ return true;
530
+ }
531
+ return false;
532
+ };
516
533
  TimelineEvent.prototype.destroy = function () {
517
534
  this.renderType = null;
518
535
  this.eventContainers = null;
@@ -9,6 +9,7 @@ export declare class ICalendarImport {
9
9
  initializeCalendarImport(fileContent: Blob | string): void;
10
10
  private iCalendarParser;
11
11
  private processOccurrence;
12
+ private getExcludeDateString;
12
13
  private getDateString;
13
14
  private dateParsing;
14
15
  protected getModuleName(): string;
@@ -117,9 +117,9 @@ var ICalendarImport = /** @class */ (function () {
117
117
  }
118
118
  });
119
119
  var app = extend([], events, null, true);
120
- this.parent.addEvent(this.processOccurrence(app));
120
+ this.parent.addEvent(this.processOccurrence(app, id));
121
121
  };
122
- ICalendarImport.prototype.processOccurrence = function (app) {
122
+ ICalendarImport.prototype.processOccurrence = function (app, maxId) {
123
123
  var _this = this;
124
124
  var appoint = [];
125
125
  var uId = 'UID';
@@ -139,31 +139,49 @@ var ICalendarImport = /** @class */ (function () {
139
139
  if (appointmentIds.indexOf(eventObj[fields.id]) < 0) {
140
140
  var data = app.filter(function (data) { return data.UID === eventObj[uId]; });
141
141
  if (data.length > 1 && isNullOrUndefined(eventObj[fields.recurrenceID])) {
142
+ id = typeof (maxId) === 'number' ? maxId++ : id;
142
143
  for (var i = 0; i < data.length; i++) {
143
144
  // eslint-disable-next-line no-prototype-builtins
144
145
  if (data[i].hasOwnProperty(fields.recurrenceID)) {
145
146
  var exdate = data[i][fields.recurrenceID];
146
- data[i][fields.id] = _this.parent.eventBase.generateGuid();
147
+ data[i][fields.id] = typeof (maxId) === 'number' ? maxId++ : _this.parent.eventBase.generateGuid();
147
148
  data[i][fields.recurrenceID] = id;
148
149
  data[i][fields.recurrenceException] = null;
149
- parentObj[fields.recurrenceException] = (isNullOrUndefined(parentObj[fields.recurrenceException])) ?
150
- exdate : parentObj[fields.recurrenceException] + ',' + exdate;
150
+ parentObj[fields.recurrenceException] =
151
+ _this.getExcludeDateString(parentObj[fields.recurrenceException], exdate);
151
152
  delete data[i][uId];
152
153
  appoint.push(data[i]);
153
154
  }
154
155
  }
155
156
  delete parentObj[uId];
157
+ parentObj[fields.id] = id;
156
158
  appoint.push(parentObj);
157
159
  // eslint-disable-next-line no-prototype-builtins
158
160
  }
159
161
  else if (!eventObj.hasOwnProperty(fields.recurrenceID)) {
160
162
  delete eventObj[uId];
163
+ eventObj[fields.id] = typeof (maxId) === 'number' ? maxId++ : id;
161
164
  appoint.push(eventObj);
162
165
  }
163
166
  }
164
167
  });
165
168
  return appoint;
166
169
  };
170
+ ICalendarImport.prototype.getExcludeDateString = function (parentException, occurrenceException) {
171
+ if (isNullOrUndefined(parentException)) {
172
+ return occurrenceException;
173
+ }
174
+ else if (isNullOrUndefined(occurrenceException)) {
175
+ return parentException;
176
+ }
177
+ var parentExDate = parentException.split(',').map(function (x) { return x.split('T')[0]; });
178
+ var childExDate = occurrenceException.split(',').map(function (x) { return x.split('T')[0]; });
179
+ var exDate = parentExDate.filter(function (x) { return childExDate.indexOf(x) > -1; });
180
+ if (exDate.length > 0) {
181
+ return parentException;
182
+ }
183
+ return parentException + ',' + occurrenceException;
184
+ };
167
185
  ICalendarImport.prototype.getDateString = function (value) {
168
186
  value = value || '';
169
187
  // eslint-disable-next-line no-useless-escape
@@ -500,7 +500,8 @@ var EventWindow = /** @class */ (function () {
500
500
  var filter = resourceModel.dataSource.filter(function (data) {
501
501
  return data[resourceModel.groupIDField] === args.value[j];
502
502
  })[0];
503
- var groupId = filter[resourceCollection[i + 1].groupIDField];
503
+ var groupId = (!isNullOrUndefined(filter)) ?
504
+ filter[resourceCollection[i + 1].groupIDField] : null;
504
505
  var filterRes = this_1.filterDatasource(i, groupId);
505
506
  datasource = datasource.concat(filterRes);
506
507
  };
@@ -517,6 +518,7 @@ var EventWindow = /** @class */ (function () {
517
518
  var resourceData = this.parent.resourceBase.resourceCollection[index + 1];
518
519
  var resObject = this.element.querySelector('.e-' + resourceData.field).
519
520
  ej2_instances[0];
521
+ resObject.clear();
520
522
  return resObject;
521
523
  };
522
524
  EventWindow.prototype.onDropdownResourceChange = function (args) {
@@ -531,7 +533,8 @@ var EventWindow = /** @class */ (function () {
531
533
  var groupId = args.itemData[resourceCollection[i].idField];
532
534
  resObj.dataSource = this.filterDatasource(i, groupId);
533
535
  resObj.dataBind();
534
- var resValue = resObj.dataSource[0][resourceCollection[i + 1].idField];
536
+ var resValue = (resObj.dataSource.length > 0) ?
537
+ resObj.dataSource[0][resourceCollection[i + 1].idField] : null;
535
538
  resObj.value = (resourceCollection[i + 1].allowMultiple) ? [resValue] : resValue;
536
539
  resObj.dataBind();
537
540
  }