@syncfusion/ej2-schedule 19.3.46 → 19.3.48

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 : 19.3.46
3
+ * version : 19.3.48
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@19.3.44",
3
+ "_id": "@syncfusion/ej2-schedule@19.3.46",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-87+s+0IrE3yQihCE6UUKguSL+rXlZht7yNpKdB4QI0dP1fxMBFU7jcX5lT0i8ompgfgbVFnIhvKn8KRW9B56og==",
5
+ "_integrity": "sha512-x1dE8/ZswBw4vAbLAILohZWlisR8SymVBt4/qwG38WgG+4nQ+yamS89F+aD/KkXQdFZ+zFdWKZbUCyNCPUDUUQ==",
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/@syncfusion/ej2-schedule/-/ej2-schedule-19.3.44.tgz",
27
- "_shasum": "4b5e552c1a66161a17a8d01f15d421455cc36d76",
26
+ "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix/@syncfusion/ej2-schedule/-/ej2-schedule-19.3.46.tgz",
27
+ "_shasum": "96b789963b4984b83da4f6a024bd5e08e6869712",
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": "~19.3.43",
38
+ "@syncfusion/ej2-base": "~19.3.47",
39
39
  "@syncfusion/ej2-buttons": "~19.3.44",
40
40
  "@syncfusion/ej2-calendars": "~19.3.46",
41
- "@syncfusion/ej2-data": "~19.3.46",
42
- "@syncfusion/ej2-dropdowns": "~19.3.46",
43
- "@syncfusion/ej2-excel-export": "~19.3.44",
44
- "@syncfusion/ej2-inputs": "~19.3.44",
45
- "@syncfusion/ej2-lists": "~19.3.45",
41
+ "@syncfusion/ej2-data": "~19.3.47",
42
+ "@syncfusion/ej2-dropdowns": "~19.3.48",
43
+ "@syncfusion/ej2-excel-export": "~19.3.48",
44
+ "@syncfusion/ej2-inputs": "~19.3.48",
45
+ "@syncfusion/ej2-lists": "~19.3.48",
46
46
  "@syncfusion/ej2-navigations": "~19.3.46",
47
- "@syncfusion/ej2-popups": "~19.3.43"
47
+ "@syncfusion/ej2-popups": "~19.3.47"
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": "19.3.46",
84
+ "version": "19.3.48",
85
85
  "sideEffects": false
86
86
  }
@@ -145,6 +145,7 @@ var Crud = /** @class */ (function () {
145
145
  if (addArgs.addedRecords instanceof Array) {
146
146
  for (var _i = 0, _a = addArgs.addedRecords; _i < _a.length; _i++) {
147
147
  var event_1 = _a[_i];
148
+ event_1 = _this.parent.eventBase.updateEventDateTime(event_1);
148
149
  var eventData_1 = extend({}, _this.parent.eventBase.processTimezone(event_1, true), null, true);
149
150
  editParams.addedRecords.push(eventData_1);
150
151
  }
@@ -202,6 +203,7 @@ var Crud = /** @class */ (function () {
202
203
  if (saveArgs.changedRecords instanceof Array) {
203
204
  for (var _i = 0, _a = saveArgs.changedRecords; _i < _a.length; _i++) {
204
205
  var event_3 = _a[_i];
206
+ event_3 = _this.parent.eventBase.updateEventDateTime(event_3);
205
207
  var eventData_2 = extend({}, _this.parent.eventBase.processTimezone(event_3, true), null, true);
206
208
  editParams.changedRecords.push(eventData_2);
207
209
  }
@@ -686,18 +686,20 @@ var DragAndDrop = /** @class */ (function (_super) {
686
686
  var eventData = [];
687
687
  var startTime = event[eventFields.startTime];
688
688
  var endTime = event[eventFields.endTime];
689
- var isDifferentDate = util.resetTime(new Date(startTime.getTime())) < util.resetTime(new Date(endTime.getTime()));
690
- if (isDifferentDate) {
691
- var scheduleStartHour = this.parent.activeView.getStartHour();
692
- var scheduleEndHour = this.parent.activeView.getEndHour();
693
- var startDate = util.getStartEndHours(util.resetTime(startTime), scheduleStartHour, scheduleEndHour);
694
- var endDate = util.getStartEndHours(util.resetTime(endTime), scheduleStartHour, scheduleEndHour);
695
- var firstEventObj = extend({}, event, null, true);
696
- firstEventObj[eventFields.endTime] = startDate.endHour;
697
- eventData.push(firstEventObj);
698
- var secondEventObj = extend({}, event, null, true);
699
- secondEventObj[eventFields.startTime] = endDate.startHour;
700
- eventData.push(secondEventObj);
689
+ if (util.resetTime(new Date(startTime.getTime())) < util.resetTime(new Date(endTime.getTime()))) {
690
+ var startReferenceDate = util.resetTime(new Date(startTime.getTime()));
691
+ var endReferenceDate = new Date(startReferenceDate.getTime());
692
+ for (var i = 0; startReferenceDate < new Date(endTime.getTime()); i++) {
693
+ endReferenceDate = new Date(endReferenceDate.setDate(startReferenceDate.getDate() + 1));
694
+ var eventObj = extend({}, event, null, true);
695
+ eventObj[eventFields.startTime] = new Date(startReferenceDate);
696
+ eventObj[eventFields.endTime] = new Date(endReferenceDate);
697
+ startReferenceDate = new Date(startReferenceDate.setDate(startReferenceDate.getDate() + 1));
698
+ eventData.push(eventObj);
699
+ }
700
+ var index = eventData.length - 1;
701
+ eventData[0][eventFields.startTime] = startTime;
702
+ eventData[index][eventFields.endTime] = endTime;
701
703
  }
702
704
  else {
703
705
  eventData.push(event);
@@ -768,8 +770,7 @@ var DragAndDrop = /** @class */ (function (_super) {
768
770
  // eslint-disable-next-line max-len
769
771
  this.parent.getDateFromElement(isNullOrUndefined(index) ? this.actionObj.target : this.targetTd)));
770
772
  var splitEvents = this.splitEvent(event);
771
- var events_1 = event[this.parent.eventFields.isAllDay] ||
772
- this.parent.eventBase.isAllDayAppointment(event) || splitEvents.length > 2 ? [event] : splitEvents;
773
+ var events_1 = this.parent.eventBase.isAllDayAppointment(event) || splitEvents.length > 2 || !(this.parent.eventSettings.spannedEventPlacement == 'TimeSlot') ? [event] : splitEvents;
773
774
  for (var i = 0; i < events_1.length; i++) {
774
775
  if (i > 0) {
775
776
  var filterQuery = ".e-day-wrapper[data-date=\"" + util.resetTime(events_1[i][this.parent.eventFields.startTime]).getTime() + "\"]";
@@ -1518,7 +1518,7 @@ export declare class Schedule extends Component<HTMLElement> implements INotifyP
1518
1518
  * @param {string} templateName Accepts the template name
1519
1519
  * @returns {void}
1520
1520
  */
1521
- refreshTemplates(templateName: string): void;
1521
+ refreshTemplates(templateName?: string): void;
1522
1522
  /**
1523
1523
  * Refreshes the Schedule layout without re-render.
1524
1524
  *
@@ -1611,6 +1611,7 @@ var Schedule = /** @class */ (function (_super) {
1611
1611
  this.eventWindow.refresh();
1612
1612
  }
1613
1613
  break;
1614
+ case 'spannedEventPlacement':
1614
1615
  case 'enableMaxHeight':
1615
1616
  case 'enableIndicator':
1616
1617
  this.refreshEvents(false);
@@ -41,3 +41,7 @@ export declare type TemplateType = 'Both' | 'Cell' | 'Event';
41
41
  * An enum that holds the different type of week number options in the scheduler.
42
42
  */
43
43
  export declare type WeekRule = 'FirstDay' | 'FirstFourDayWeek' | 'FirstFullWeek';
44
+ /**
45
+ * An enum that holds the options to render the spanned events in all day row or time slot.
46
+ */
47
+ export declare type SpannedEventPlacement = 'AllDayRow' | 'TimeSlot';
@@ -17,6 +17,7 @@ export declare class EventBase {
17
17
  */
18
18
  constructor(parent: Schedule);
19
19
  processData(events: Record<string, any>[], timeZonePropChanged?: boolean, oldTimezone?: string): Record<string, any>[];
20
+ updateEventDateTime(eventData: Record<string, any>): Record<string, any>;
20
21
  getProcessedEvents(eventCollection?: Record<string, any>[]): Record<string, any>[];
21
22
  timezonePropertyChange(oldTimezone: string): void;
22
23
  timezoneConvert(eventData: Record<string, any>): void;
@@ -37,12 +37,7 @@ var EventBase = /** @class */ (function () {
37
37
  if (generateID) {
38
38
  event_1[fields.id] = temp++;
39
39
  }
40
- if (typeof event_1[fields.startTime] === 'string') {
41
- event_1[fields.startTime] = util.getDateFromString(event_1[fields.startTime]);
42
- }
43
- if (typeof event_1[fields.endTime] === 'string') {
44
- event_1[fields.endTime] = util.getDateFromString(event_1[fields.endTime]);
45
- }
40
+ event_1 = this_1.updateEventDateTime(event_1);
46
41
  if (timeZonePropChanged) {
47
42
  this_1.processTimezoneChange(event_1, oldTimezone);
48
43
  }
@@ -119,6 +114,15 @@ var EventBase = /** @class */ (function () {
119
114
  this.parent.blockProcessed = blockData;
120
115
  return eventData;
121
116
  };
117
+ EventBase.prototype.updateEventDateTime = function (eventData) {
118
+ if (typeof eventData[this.parent.eventFields.startTime] === 'string') {
119
+ eventData[this.parent.eventFields.startTime] = util.getDateFromString(eventData[this.parent.eventFields.startTime]);
120
+ }
121
+ if (typeof eventData[this.parent.eventFields.endTime] === 'string') {
122
+ eventData[this.parent.eventFields.endTime] = util.getDateFromString(eventData[this.parent.eventFields.endTime]);
123
+ }
124
+ return eventData;
125
+ };
122
126
  EventBase.prototype.getProcessedEvents = function (eventCollection) {
123
127
  if (eventCollection === void 0) { eventCollection = this.parent.eventsData; }
124
128
  var processed = [];
@@ -636,7 +640,7 @@ var EventBase = /** @class */ (function () {
636
640
  var isAllDay = event[fieldMapping.isAllDay];
637
641
  var isFullDay = ((event[fieldMapping.endTime].getTime() - event[fieldMapping.startTime].getTime())
638
642
  / util.MS_PER_DAY) >= 1;
639
- return (isAllDay || isFullDay) ? true : false;
643
+ return (isAllDay || (!(this.parent.eventSettings.spannedEventPlacement == 'TimeSlot') && isFullDay)) ? true : false;
640
644
  };
641
645
  EventBase.prototype.addEventListener = function () {
642
646
  this.parent.on(event.documentClick, this.appointmentBorderRemove, this);
@@ -124,10 +124,10 @@ var MonthEvent = /** @class */ (function (_super) {
124
124
  this.parent.virtualScrollModule.updateVirtualScrollHeight();
125
125
  }
126
126
  }
127
- this.parent.notify(events.scrollUiUpdate, data);
128
127
  if (!this.parent.enablePersistence) {
129
128
  this.parent.notify(events.contentReady, {});
130
129
  }
130
+ this.parent.notify(events.scrollUiUpdate, data);
131
131
  if (this.parent.currentView === 'Month' && this.parent.showWeekNumber) {
132
132
  var totalCells_1 = [].slice.call(this.parent.element.querySelectorAll('.e-content-wrap table tr td:first-child'));
133
133
  var weekNumberCells = [].slice.call(this.parent.element.querySelectorAll('.' + cls.WEEK_NUMBER_CLASS));
@@ -1,4 +1,4 @@
1
- import { Property, ChildProperty, Complex } from '@syncfusion/ej2-base';import { Query, DataManager } from '@syncfusion/ej2-data';import { SortComparerFunction } from '../base/interface';import { Field } from './fields';import { FieldModel } from './fields-model';
1
+ import { Property, ChildProperty, Complex } from '@syncfusion/ej2-base';import { Query, DataManager } from '@syncfusion/ej2-data';import { SortComparerFunction } from '../base/interface';import { SpannedEventPlacement } from '../base/type';import { Field } from './fields';import { FieldModel } from './fields-model';
2
2
 
3
3
  /**
4
4
  * Interface for a class EventSettings
@@ -57,6 +57,17 @@ export interface EventSettingsModel {
57
57
  */
58
58
  tooltipTemplate?: string;
59
59
 
60
+ /**
61
+ * Defines the option to render the spanned events (more than 24 hours) in either `AllDayRow` or `TimeSlot`. By default it renders in `AllDayRow`.
62
+ * This property is applicable for `Day`, `Week` and `WorkWeek` views only. The possible values for this property as follows
63
+ * * AllDayRow
64
+ * * TimeSlot
65
+ * {% codeBlock src='schedule/spannedEventPlacement/index.md' %}{% endcodeBlock %}
66
+ *
67
+ * @default 'AllDayRow'
68
+ */
69
+ spannedEventPlacement?: SpannedEventPlacement;
70
+
60
71
  /**
61
72
  * Defines the resource name, to decides the color of which particular resource level is to be applied on appointments, when
62
73
  * grouping is enabled on scheduler.
@@ -1,6 +1,7 @@
1
1
  import { ChildProperty } from '@syncfusion/ej2-base';
2
2
  import { Query, DataManager } from '@syncfusion/ej2-data';
3
3
  import { SortComparerFunction } from '../base/interface';
4
+ import { SpannedEventPlacement } from '../base/type';
4
5
  import { FieldModel } from './fields-model';
5
6
  /**
6
7
  * Holds the configuration of event related options and dataSource binding to Schedule.
@@ -52,6 +53,16 @@ export declare class EventSettings extends ChildProperty<EventSettings> {
52
53
  * @default null
53
54
  */
54
55
  tooltipTemplate: string;
56
+ /**
57
+ * Defines the option to render the spanned events (more than 24 hours) in either `AllDayRow` or `TimeSlot`. By default it renders in `AllDayRow`.
58
+ * This property is applicable for `Day`, `Week` and `WorkWeek` views only. The possible values for this property as follows
59
+ * * AllDayRow
60
+ * * TimeSlot
61
+ * {% codeBlock src='schedule/spannedEventPlacement/index.md' %}{% endcodeBlock %}
62
+ *
63
+ * @default 'AllDayRow'
64
+ */
65
+ spannedEventPlacement: SpannedEventPlacement;
55
66
  /**
56
67
  * Defines the resource name, to decides the color of which particular resource level is to be applied on appointments, when
57
68
  * grouping is enabled on scheduler.
@@ -46,6 +46,9 @@ var EventSettings = /** @class */ (function (_super) {
46
46
  __decorate([
47
47
  Property()
48
48
  ], EventSettings.prototype, "tooltipTemplate", void 0);
49
+ __decorate([
50
+ Property('AllDayRow')
51
+ ], EventSettings.prototype, "spannedEventPlacement", void 0);
49
52
  __decorate([
50
53
  Property()
51
54
  ], EventSettings.prototype, "resourceColorField", void 0);
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import { createElement, remove } from '@syncfusion/ej2-base';
2
+ import { createElement, isNullOrUndefined, remove } from '@syncfusion/ej2-base';
3
3
  import { FormValidator } from '@syncfusion/ej2-inputs';
4
4
  import * as cls from '../base/css-constant';
5
5
  /**
@@ -49,6 +49,9 @@ var FieldValidator = /** @class */ (function () {
49
49
  if (!elem && !this.ignoreError) {
50
50
  this.createTooltip(inputElement, error, id, '');
51
51
  }
52
+ if (!isNullOrUndefined(elem)) {
53
+ elem.querySelector(".e-error").innerHTML = error.innerHTML;
54
+ }
52
55
  };
53
56
  FieldValidator.prototype.createTooltip = function (element, error, name, display) {
54
57
  var dlgContent;
@@ -67,7 +67,7 @@ var Agenda = /** @class */ (function (_super) {
67
67
  var event_1 = _a[_i];
68
68
  delete event_1.generatedDates;
69
69
  }
70
- var eventCollection = args.processedData;
70
+ var eventCollection = this.parent.activeViewOptions.allowVirtualScrolling ? args.processedData : this.parent.eventsProcessed;
71
71
  if (this.parent.uiStateValues.isGroupAdaptive) {
72
72
  var resource = this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];
73
73
  this.dataSource = this.parent.eventBase.filterEventsByResource(resource, this.dataSource);
@@ -171,6 +171,7 @@ var Agenda = /** @class */ (function (_super) {
171
171
  var filterData = this.appointmentFiltering(agendaDate);
172
172
  var nTr = this.createTableRowElement(agendaDate, 'data');
173
173
  if (this.element.querySelector('tr[aria-rowindex="' + parseInt(nTr.getAttribute('aria-rowindex'), 10) + '"]')) {
174
+ agendaDate = util.addDays(agendaDate, 1);
174
175
  continue;
175
176
  }
176
177
  var dTd = nTr.children[0];