@syncfusion/ej2-schedule 21.1.38 → 21.1.41

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.
Files changed (59) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/ej2-schedule.min.js +2 -2
  3. package/dist/ej2-schedule.umd.min.js +2 -2
  4. package/dist/ej2-schedule.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-schedule.es2015.js +59 -51
  6. package/dist/es6/ej2-schedule.es2015.js.map +1 -1
  7. package/dist/es6/ej2-schedule.es5.js +66 -58
  8. package/dist/es6/ej2-schedule.es5.js.map +1 -1
  9. package/dist/global/ej2-schedule.min.js +2 -2
  10. package/dist/global/ej2-schedule.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +12 -12
  13. package/src/schedule/base/resource.js +1 -1
  14. package/src/schedule/base/schedule.d.ts +5 -3
  15. package/src/schedule/base/schedule.js +11 -7
  16. package/src/schedule/event-renderer/agenda-base.js +2 -2
  17. package/src/schedule/event-renderer/event-base.js +1 -1
  18. package/src/schedule/event-renderer/month.js +2 -2
  19. package/src/schedule/event-renderer/timeline-view.js +4 -11
  20. package/src/schedule/event-renderer/vertical-view.js +5 -11
  21. package/src/schedule/exports/print.js +11 -2
  22. package/src/schedule/popups/event-window.js +11 -3
  23. package/src/schedule/popups/quick-popups.js +5 -5
  24. package/src/schedule/renderer/month.js +2 -2
  25. package/src/schedule/renderer/renderer.js +1 -0
  26. package/src/schedule/renderer/timeline-year.js +4 -6
  27. package/src/schedule/renderer/vertical-view.js +5 -4
  28. package/src/schedule/renderer/view-base.js +2 -2
  29. package/styles/bootstrap-dark.css +6 -2
  30. package/styles/bootstrap.css +6 -2
  31. package/styles/bootstrap4.css +6 -2
  32. package/styles/bootstrap5-dark.css +6 -2
  33. package/styles/bootstrap5.css +6 -2
  34. package/styles/fabric-dark.css +6 -2
  35. package/styles/fabric.css +6 -2
  36. package/styles/fluent-dark.css +6 -2
  37. package/styles/fluent.css +6 -2
  38. package/styles/highcontrast-light.css +6 -2
  39. package/styles/highcontrast.css +6 -2
  40. package/styles/material-dark.css +6 -2
  41. package/styles/material.css +6 -2
  42. package/styles/schedule/_layout.scss +6 -2
  43. package/styles/schedule/bootstrap-dark.css +6 -2
  44. package/styles/schedule/bootstrap.css +6 -2
  45. package/styles/schedule/bootstrap4.css +6 -2
  46. package/styles/schedule/bootstrap5-dark.css +6 -2
  47. package/styles/schedule/bootstrap5.css +6 -2
  48. package/styles/schedule/fabric-dark.css +6 -2
  49. package/styles/schedule/fabric.css +6 -2
  50. package/styles/schedule/fluent-dark.css +6 -2
  51. package/styles/schedule/fluent.css +6 -2
  52. package/styles/schedule/highcontrast-light.css +6 -2
  53. package/styles/schedule/highcontrast.css +6 -2
  54. package/styles/schedule/material-dark.css +6 -2
  55. package/styles/schedule/material.css +6 -2
  56. package/styles/schedule/tailwind-dark.css +6 -2
  57. package/styles/schedule/tailwind.css +6 -2
  58. package/styles/tailwind-dark.css +6 -2
  59. package/styles/tailwind.css +6 -2
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 21.1.38
3
+ * version : 21.1.41
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@21.1.37",
3
+ "_id": "@syncfusion/ej2-schedule@21.1.39",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-NLCQtiu5Olzfi6SxLt7AYA1KmVoEH8iCMIfnH3R+AGKx2M3jAc8kj254/r6ZjCOG+Hv5HJzRlzXcpsjcF6STUA==",
5
+ "_integrity": "sha512-QCuW7EJLOWM4mzsfa7H6Y3GFtwpxmm/hoS9Zh7AM9yaczBZGfo1fVoMa1BX9kj/GvnVKd1dQKg4bww2ljX7wng==",
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.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-schedule/-/ej2-schedule-21.1.37.tgz",
27
- "_shasum": "ca770b8410b16994dc458ebd2dce869f52476c1d",
26
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-schedule/-/ej2-schedule-21.1.39.tgz",
27
+ "_shasum": "48df2b6ebc4f2cfc54708f2e049cf7b0add5e953",
28
28
  "_spec": "@syncfusion/ej2-schedule@*",
29
29
  "_where": "/jenkins/workspace/elease-automation_release_21.1.1/packages/included",
30
30
  "author": {
@@ -35,16 +35,16 @@
35
35
  },
36
36
  "bundleDependencies": false,
37
37
  "dependencies": {
38
- "@syncfusion/ej2-base": "~21.1.38",
38
+ "@syncfusion/ej2-base": "~21.1.40",
39
39
  "@syncfusion/ej2-buttons": "~21.1.37",
40
- "@syncfusion/ej2-calendars": "~21.1.38",
40
+ "@syncfusion/ej2-calendars": "~21.1.41",
41
41
  "@syncfusion/ej2-data": "~21.1.38",
42
- "@syncfusion/ej2-dropdowns": "~21.1.38",
42
+ "@syncfusion/ej2-dropdowns": "~21.1.41",
43
43
  "@syncfusion/ej2-excel-export": "~21.1.37",
44
- "@syncfusion/ej2-inputs": "~21.1.38",
45
- "@syncfusion/ej2-lists": "~21.1.37",
46
- "@syncfusion/ej2-navigations": "~21.1.38",
47
- "@syncfusion/ej2-popups": "~21.1.37"
44
+ "@syncfusion/ej2-inputs": "~21.1.39",
45
+ "@syncfusion/ej2-lists": "~21.1.41",
46
+ "@syncfusion/ej2-navigations": "~21.1.39",
47
+ "@syncfusion/ej2-popups": "~21.1.41"
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": "21.1.38",
76
+ "version": "21.1.41",
77
77
  "sideEffects": false
78
78
  }
@@ -432,7 +432,7 @@ var ResourceBase = /** @class */ (function () {
432
432
  return resData[resourceLevel.idField] === resource.groupOrder[parseInt(i.toString(), 10)];
433
433
  });
434
434
  var resourceName = createElement('div', { className: cls.RESOURCE_NAME });
435
- resourceName.innerText = this_2.parent.sanitize(resourceText[0][resourceLevel.textField]);
435
+ this_2.parent.sanitize(resourceText[0][resourceLevel.textField], resourceName);
436
436
  headerCollection.push(resourceName);
437
437
  var levelIcon = createElement('div', { className: 'e-icons e-icon-next' });
438
438
  headerCollection.push(levelIcon);
@@ -80,6 +80,7 @@ export declare class Schedule extends Component<HTMLElement> implements INotifyP
80
80
  workCellAction: WorkCellInteraction;
81
81
  tzModule: Timezone;
82
82
  resourceBase: ResourceBase;
83
+ currentTimezoneDate: Date;
83
84
  private cellHeaderTemplateFn;
84
85
  private cellTemplateFn;
85
86
  private dateHeaderTemplateFn;
@@ -910,13 +911,14 @@ export declare class Schedule extends Component<HTMLElement> implements INotifyP
910
911
  */
911
912
  resetTemplates(templates?: string[]): void;
912
913
  /**
913
- * Method to sanitize any suspected untrusted strings and scripts before rendering them.
914
+ * This method renders untrusted strings and scripts securely by sanitizing them first.
914
915
  *
915
916
  * @param {string} value - A string value representing the HTML string value to be sanitized.
916
- * @returns {string} A sanitized Html string.
917
+ * @param {HTMLElement} element - An HTML element to which the sanitized or unsanitized HTML string will be assigned.
918
+ * @returns {void}
917
919
  * @private
918
920
  */
919
- sanitize(value: string): string;
921
+ sanitize(value: string, element: HTMLElement): void;
920
922
  private initializeResources;
921
923
  /**
922
924
  * Method to render the layout elements
@@ -160,17 +160,20 @@ var Schedule = /** @class */ (function (_super) {
160
160
  }
161
161
  };
162
162
  /**
163
- * Method to sanitize any suspected untrusted strings and scripts before rendering them.
163
+ * This method renders untrusted strings and scripts securely by sanitizing them first.
164
164
  *
165
165
  * @param {string} value - A string value representing the HTML string value to be sanitized.
166
- * @returns {string} A sanitized Html string.
166
+ * @param {HTMLElement} element - An HTML element to which the sanitized or unsanitized HTML string will be assigned.
167
+ * @returns {void}
167
168
  * @private
168
169
  */
169
- Schedule.prototype.sanitize = function (value) {
170
+ Schedule.prototype.sanitize = function (value, element) {
170
171
  if (this.enableHtmlSanitizer) {
171
- return SanitizeHtmlHelper.sanitize(value);
172
+ element.innerText = SanitizeHtmlHelper.sanitize(value);
173
+ }
174
+ else {
175
+ element.innerHTML = value;
172
176
  }
173
- return value;
174
177
  };
175
178
  Schedule.prototype.initializeResources = function (isSetModel) {
176
179
  if (isSetModel === void 0) { isSetModel = false; }
@@ -692,7 +695,8 @@ var Schedule = /** @class */ (function (_super) {
692
695
  isIgnoreOccurrence: false, groupIndex: 0, action: false, isBlock: false, isCustomMonth: true, isPreventTimezone: false
693
696
  };
694
697
  }
695
- this.activeCellsData = { startTime: this.getCurrentTime(), endTime: this.getCurrentTime(), isAllDay: false };
698
+ this.currentTimezoneDate = this.getCurrentTime();
699
+ this.activeCellsData = { startTime: new Date(this.currentTimezoneDate), endTime: new Date(this.currentTimezoneDate), isAllDay: false };
696
700
  this.activeEventData = { event: undefined, element: undefined };
697
701
  this.getDefaultLocale();
698
702
  this.localeObj = new L10n(this.getModuleName(), this.defaultLocale, this.locale);
@@ -1142,7 +1146,7 @@ var Schedule = /** @class */ (function (_super) {
1142
1146
  */
1143
1147
  Schedule.prototype.getStartEndTime = function (startEndTime) {
1144
1148
  if (!isNullOrUndefined(startEndTime) && startEndTime !== '') {
1145
- var startEndDate = util.resetTime(this.getCurrentTime());
1149
+ var startEndDate = util.resetTime(new Date(this.currentTimezoneDate) || this.getCurrentTime());
1146
1150
  var timeString = startEndTime.split(':');
1147
1151
  if (timeString.length === 2) {
1148
1152
  startEndDate.setHours(parseInt(timeString[0], 10), parseInt(timeString[1], 10), 0);
@@ -111,11 +111,11 @@ var AgendaBase = /** @class */ (function (_super) {
111
111
  eventSubject += ',';
112
112
  }
113
113
  var appSubjectText = createElement('div', { className: cls.SUBJECT_CLASS });
114
- appSubjectText.innerText = this.parent.sanitize(eventSubject);
114
+ this.parent.sanitize(eventSubject, appSubjectText);
115
115
  appSubjectWrap.appendChild(appSubjectText);
116
116
  if (!isNullOrUndefined(eventLocation) && eventLocation !== '') {
117
117
  var appLocation = createElement('div', { className: cls.LOCATION_CLASS });
118
- appLocation.innerText = this.parent.sanitize(eventLocation);
118
+ this.parent.sanitize(eventLocation, appLocation);
119
119
  appSubjectWrap.appendChild(appLocation);
120
120
  }
121
121
  if (!isNullOrUndefined(event[fieldMapping.recurrenceRule])) {
@@ -1118,7 +1118,7 @@ var EventBase = /** @class */ (function () {
1118
1118
  }
1119
1119
  else {
1120
1120
  var appointmentSubject = createElement('div', { className: cls.SUBJECT_CLASS });
1121
- appointmentSubject.innerText = this.parent.sanitize(eventSubject);
1121
+ this.parent.sanitize(eventSubject, appointmentSubject);
1122
1122
  templateElement = [appointmentSubject];
1123
1123
  }
1124
1124
  append(templateElement, appointmentWrapper);
@@ -410,7 +410,7 @@ var MonthEvent = /** @class */ (function (_super) {
410
410
  else {
411
411
  var eventLocation = (record[this.fields.location] || this.parent.eventSettings.fields.location.default || '');
412
412
  var appointmentSubject = createElement('div', { className: cls.SUBJECT_CLASS });
413
- appointmentSubject.innerText = this.parent.sanitize((eventSubject + (eventLocation ? '; ' + eventLocation : '')));
413
+ this.parent.sanitize((eventSubject + (eventLocation ? '; ' + eventLocation : '')), appointmentSubject);
414
414
  var appointmentStartTime = createElement('div', {
415
415
  className: cls.APPOINTMENT_TIME + (this.parent.isAdaptive ? ' ' + cls.DISABLE_CLASS : ''),
416
416
  innerHTML: this.parent.getTimeString(eventData[this.fields.startTime])
@@ -454,7 +454,7 @@ var MonthEvent = /** @class */ (function (_super) {
454
454
  className: cls.APPOINTMENT_TIME + (this.parent.isAdaptive ? ' ' + cls.DISABLE_CLASS : ''), innerHTML: timeString
455
455
  });
456
456
  var appLocation = createElement('div', { className: cls.LOCATION_CLASS });
457
- appLocation.innerText = this.parent.sanitize(eventLocation);
457
+ this.parent.sanitize(eventLocation, appLocation);
458
458
  innerElement = [appointmentSubject, appTime, appLocation];
459
459
  }
460
460
  var wrap = createElement('div', { className: 'e-inner-wrap' });
@@ -168,12 +168,12 @@ var TimelineEvent = /** @class */ (function (_super) {
168
168
  isValidEvent = this.isValidEvent(eventObj, startTime, endTime, schedule);
169
169
  }
170
170
  if (startTime <= endTime && isValidEvent) {
171
- var appWidth_1 = this.getEventWidth(startTime, endTime, event[this.fields.isAllDay], diffInDays);
172
- appWidth_1 = this.renderType === 'day' ? appWidth_1 - 2 : appWidth_1;
171
+ var appWidth = this.getEventWidth(startTime, endTime, event[this.fields.isAllDay], diffInDays);
172
+ appWidth = this.renderType === 'day' ? appWidth - 2 : appWidth;
173
173
  var appLeft = 0;
174
174
  var appRight = 0;
175
175
  var position = this.getPosition(startTime, endTime, event[this.fields.isAllDay], this.day);
176
- appWidth_1 = (appWidth_1 <= 0) ? this.cellWidth : appWidth_1; // appWidth 0 when start and end time as same
176
+ appWidth = (appWidth <= 0) ? this.cellWidth : appWidth; // appWidth 0 when start and end time as same
177
177
  this.renderedEvents.push(extend({}, event, null, true));
178
178
  if (isNullOrUndefined(this.cellTops[parseInt(resIndex.toString(), 10)])) {
179
179
  this.cellTops[parseInt(resIndex.toString(), 10)] = this.getRowTop(resIndex);
@@ -194,7 +194,7 @@ var TimelineEvent = /** @class */ (function (_super) {
194
194
  }
195
195
  this.applyResourceColor(appointmentElement, event, 'backgroundColor', this.groupOrder);
196
196
  setStyleAttribute(appointmentElement, {
197
- 'width': appWidth_1 + 'px', 'left': appLeft + 'px', 'right': appRight + 'px', 'top': appTop + 'px'
197
+ 'width': appWidth + 'px', 'left': appLeft + 'px', 'right': appRight + 'px', 'top': appTop + 'px'
198
198
  });
199
199
  this.wireAppointmentEvents(appointmentElement, event);
200
200
  this.renderEventElement(event, appointmentElement, cellTd);
@@ -202,13 +202,6 @@ var TimelineEvent = /** @class */ (function (_super) {
202
202
  var firstChild = this.getFirstChild(resIndex);
203
203
  this.updateCellHeight(firstChild, height);
204
204
  }
205
- if (this.parent.activeViewOptions.option !== 'TimelineMonth' && this.parent.activeViewOptions.timeScale.enable
206
- && appWidth_1 < this.cellWidth) {
207
- var resizeHandlers = [].slice.call(appointmentElement.querySelectorAll('.' + cls.EVENT_RESIZE_CLASS));
208
- resizeHandlers.forEach(function (resizeHandler) {
209
- resizeHandler.style.width = Math.ceil(appWidth_1 / resizeHandler.getBoundingClientRect().width) + 'px';
210
- });
211
- }
212
205
  }
213
206
  else {
214
207
  for (var i = 0; i < diffInDays; i++) {
@@ -345,7 +345,7 @@ var VerticalEvent = /** @class */ (function (_super) {
345
345
  }
346
346
  else {
347
347
  var appointmentSubject = createElement('div', { className: cls.SUBJECT_CLASS });
348
- appointmentSubject.innerText = this.parent.sanitize(recordSubject);
348
+ this.parent.sanitize(recordSubject, appointmentSubject);
349
349
  if (isAllDay) {
350
350
  if (record[fieldMapping.isAllDay]) {
351
351
  templateElement = [appointmentSubject];
@@ -378,7 +378,7 @@ var VerticalEvent = /** @class */ (function (_super) {
378
378
  innerHTML: timeStr
379
379
  });
380
380
  var appointmentLocation = createElement('div', { className: cls.LOCATION_CLASS });
381
- appointmentLocation.innerText = this.parent.sanitize((record[fieldMapping.location] || this.parent.eventSettings.fields.location.default || ''));
381
+ this.parent.sanitize((record[fieldMapping.location] || this.parent.eventSettings.fields.location.default || ''), appointmentLocation);
382
382
  templateElement = [appointmentSubject, appointmentTime, appointmentLocation];
383
383
  }
384
384
  }
@@ -557,7 +557,7 @@ var VerticalEvent = /** @class */ (function (_super) {
557
557
  return;
558
558
  }
559
559
  if (eStart <= eEnd && isValidEvent && this.isWorkDayAvailable(resource, eStart)) {
560
- var appHeight_1 = this.getHeight(eStart, eEnd);
560
+ var appHeight = this.getHeight(eStart, eEnd);
561
561
  if (eStart.getTime() > schedule.startHour.getTime()) {
562
562
  topValue = this.getTopValue(eStart, dayIndex, resource);
563
563
  }
@@ -594,10 +594,10 @@ var VerticalEvent = /** @class */ (function (_super) {
594
594
  }
595
595
  setStyleAttribute(appointmentElement, {
596
596
  'width': (this.parent.eventSettings.enableMaxHeight ? '100%' : tempData.appWidth),
597
- 'height': appHeight_1 + 'px', 'top': topValue + 'px'
597
+ 'height': appHeight + 'px', 'top': topValue + 'px'
598
598
  });
599
599
  var iconHeight = appointmentElement.querySelectorAll('.' + cls.EVENT_INDICATOR_CLASS).length * 15;
600
- var maxHeight = appHeight_1 - 40 - iconHeight;
600
+ var maxHeight = appHeight - 40 - iconHeight;
601
601
  var subjectElement = appointmentElement.querySelector('.' + cls.SUBJECT_CLASS);
602
602
  if (!this.parent.isAdaptive && subjectElement) {
603
603
  subjectElement.style.maxHeight = formatUnit(maxHeight);
@@ -609,12 +609,6 @@ var VerticalEvent = /** @class */ (function (_super) {
609
609
  record.data = eventData;
610
610
  this.appendEvent(record, appointmentElement, index, tempData.appLeft);
611
611
  this.wireAppointmentEvents(appointmentElement, eventObj);
612
- if (appHeight_1 < this.cellHeight) {
613
- var resizeHandlers = [].slice.call(appointmentElement.querySelectorAll('.' + cls.EVENT_RESIZE_CLASS));
614
- resizeHandlers.forEach(function (resizeHandler) {
615
- resizeHandler.style.height = Math.ceil(appHeight_1 / resizeHandler.offsetHeight) + 'px';
616
- });
617
- }
618
612
  }
619
613
  };
620
614
  VerticalEvent.prototype.getEventWidth = function () {
@@ -92,6 +92,8 @@ var Print = /** @class */ (function () {
92
92
  ];
93
93
  var scheduleTemplates = ['cellHeaderTemplate', 'dayHeaderTemplate', 'monthHeaderTemplate', 'cellTemplate',
94
94
  'dateHeaderTemplate', 'dateRangeTemplate', 'eventTemplate', 'resourceHeaderTemplate', 'headerIndentTemplate'];
95
+ var scheduleEvents = ['actionBegin', 'actionComplete', 'actionFailure', 'created', 'dataBinding', 'dataBound',
96
+ 'destroyed', 'eventRendered', 'moreEventsClick', 'navigating', 'popupOpen', 'popupClose', 'renderCell'];
95
97
  var eventSettings;
96
98
  var group;
97
99
  var timeScale;
@@ -99,12 +101,15 @@ var Print = /** @class */ (function () {
99
101
  for (var _i = 0, scheduleProps_1 = scheduleProps; _i < scheduleProps_1.length; _i++) {
100
102
  var key = scheduleProps_1[_i];
101
103
  switch (key) {
102
- case 'eventSettings':
104
+ case 'eventSettings': {
103
105
  eventSettings = Object.assign({}, this.parent.eventSettings.properties);
104
106
  eventSettings.dataSource = this.parent.eventsData;
105
- eventSettings.template = typeof (eventSettings.template) === 'function' ? null : eventSettings.template;
107
+ var eventTemplate = !isNullOrUndefined(printOptions.eventSettings) &&
108
+ !isNullOrUndefined(printOptions.eventSettings.template) ? printOptions.eventSettings.template : eventSettings.template;
109
+ eventSettings.template = typeof (eventTemplate) === 'function' ? null : eventTemplate;
106
110
  printModel.eventSettings = eventSettings;
107
111
  break;
112
+ }
108
113
  case 'group':
109
114
  group = isNullOrUndefined(printOptions.group) ? this.parent.group : printOptions.group;
110
115
  group.headerTooltipTemplate = null;
@@ -140,6 +145,10 @@ var Print = /** @class */ (function () {
140
145
  (typeof (printOptions["" + key]) === 'function' ? null : printOptions["" + key]);
141
146
  break;
142
147
  }
148
+ if (scheduleEvents.indexOf(key) > -1) {
149
+ printModel["" + key] = printOptions["" + key];
150
+ break;
151
+ }
143
152
  printModel["" + key] = isNullOrUndefined(printOptions["" + key]) ?
144
153
  this.parent["" + key] : printOptions["" + key];
145
154
  break;
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  import { createElement, isNullOrUndefined, addClass, remove, EventHandler, extend, append, detach } from '@syncfusion/ej2-base';
3
- import { cldrData, removeClass, getValue, getDefaultDateObject, closest } from '@syncfusion/ej2-base';
3
+ import { cldrData, removeClass, getValue, getDefaultDateObject, closest, SanitizeHtmlHelper } from '@syncfusion/ej2-base';
4
4
  import { Query, Deferred } from '@syncfusion/ej2-data';
5
5
  import { CheckBox, Button } from '@syncfusion/ej2-buttons';
6
6
  import { Dialog } from '@syncfusion/ej2-popups';
@@ -262,6 +262,7 @@ var EventWindow = /** @class */ (function () {
262
262
  var element = formElements_1[_i];
263
263
  remove(element);
264
264
  }
265
+ this.parent.resetTemplates(['editorTemplate']);
265
266
  }
266
267
  var templateId = this.parent.element.id + '_editorTemplate';
267
268
  var tempEle = [].slice.call(this.parent.getEditorTemplate()(args || {}, this.parent, 'editorTemplate', templateId, false));
@@ -836,10 +837,13 @@ var EventWindow = /** @class */ (function () {
836
837
  }
837
838
  };
838
839
  EventWindow.prototype.applyFormValidation = function () {
840
+ var form = this.element.querySelector('.' + cls.FORM_CLASS);
841
+ if (!form) {
842
+ return;
843
+ }
839
844
  var getValidationRule = function (rules) {
840
845
  return (rules && Object.keys(rules).length > 0) ? rules : undefined;
841
846
  };
842
- var form = this.element.querySelector('.' + cls.FORM_CLASS);
843
847
  var rules = {};
844
848
  var subjectRule = getValidationRule(this.parent.eventSettings.fields.subject.validation);
845
849
  if (!isNullOrUndefined(subjectRule)) {
@@ -1670,7 +1674,8 @@ var EventWindow = /** @class */ (function () {
1670
1674
  value = element.checked;
1671
1675
  }
1672
1676
  else {
1673
- value = this.parent.sanitize(element.value);
1677
+ value = this.parent.enableHtmlSanitizer ?
1678
+ SanitizeHtmlHelper.sanitize(element.value) : element.value;
1674
1679
  }
1675
1680
  }
1676
1681
  return value;
@@ -1815,6 +1820,9 @@ var EventWindow = /** @class */ (function () {
1815
1820
  else if (element.classList.contains('e-multiselect')) {
1816
1821
  instance = element.ej2_instances;
1817
1822
  }
1823
+ else if (element.classList.contains('e-numerictextbox')) {
1824
+ instance = element.ej2_instances;
1825
+ }
1818
1826
  if (instance && instance[0]) {
1819
1827
  instance[0].destroy();
1820
1828
  }
@@ -332,7 +332,7 @@ var QuickPopups = /** @class */ (function () {
332
332
  }
333
333
  else {
334
334
  appointmentElement.appendChild(createElement('div', { className: cls.SUBJECT_CLASS }));
335
- appointmentElement.firstElementChild.innerText = this_1.parent.sanitize(eventText);
335
+ this_1.parent.sanitize(eventText, appointmentElement.firstElementChild);
336
336
  }
337
337
  if (!isNullOrUndefined(groupIndex)) {
338
338
  appointmentElement.setAttribute('data-group-index', groupIndex);
@@ -592,7 +592,7 @@ var QuickPopups = /** @class */ (function () {
592
592
  var templateWrapper = createElement('div', { innerHTML: header });
593
593
  if (headerType === 'Event') {
594
594
  var subjectText = templateWrapper.querySelector('.' + cls.SUBJECT_CLASS);
595
- subjectText.innerText = this.parent.sanitize(args.eventSubject);
595
+ this.parent.sanitize(args.eventSubject, subjectText);
596
596
  }
597
597
  append([].slice.call(templateWrapper.childNodes), headerTemplate);
598
598
  }
@@ -656,19 +656,19 @@ var QuickPopups = /** @class */ (function () {
656
656
  if (data[this.parent.eventFields.location]) {
657
657
  var locationDetails = templateWrapper.querySelector('.' + cls.LOCATION_DETAILS_CLASS);
658
658
  if (!isNullOrUndefined(locationDetails)) {
659
- locationDetails.innerText = this.parent.sanitize(data[this.parent.eventFields.location]);
659
+ this.parent.sanitize(data[this.parent.eventFields.location], locationDetails);
660
660
  }
661
661
  }
662
662
  if (data[this.parent.eventFields.description]) {
663
663
  var descriptionDetails = templateWrapper.querySelector('.' + cls.DESCRIPTION_DETAILS_CLASS);
664
664
  if (!isNullOrUndefined(descriptionDetails)) {
665
- descriptionDetails.innerText = this.parent.sanitize(data[this.parent.eventFields.description]);
665
+ this.parent.sanitize(data[this.parent.eventFields.description], descriptionDetails);
666
666
  }
667
667
  }
668
668
  if (resourceText) {
669
669
  var resourceDetails = templateWrapper.querySelector('.' + cls.RESOURCE_DETAILS_CLASS);
670
670
  if (!isNullOrUndefined(resourceDetails)) {
671
- resourceDetails.innerText = this.parent.sanitize(resourceText);
671
+ this.parent.sanitize(resourceText, resourceDetails);
672
672
  }
673
673
  }
674
674
  append([].slice.call(templateWrapper.childNodes), contentTemplate);
@@ -174,7 +174,7 @@ var Month = /** @class */ (function (_super) {
174
174
  for (var col = 0; col < count; col++) {
175
175
  var classList = [cls.HEADER_CELLS_CLASS];
176
176
  var currentDateIndex = renderDates.slice(0, count).map(function (date) { return date.getDay(); });
177
- if (isCurrentMonth && currentDateIndex.indexOf(this.parent.getCurrentTime().getDay()) === col) {
177
+ if (isCurrentMonth && currentDateIndex.indexOf(this.parent.currentTimezoneDate.getDay()) === col) {
178
178
  classList.push(cls.CURRENT_DAY_CLASS);
179
179
  }
180
180
  dateSlots.push({ date: renderDates[parseInt(col.toString(), 10)], type: 'monthDay', className: classList, colSpan: 1, workDays: workDays });
@@ -546,7 +546,7 @@ var Month = /** @class */ (function (_super) {
546
546
  addClass([dateHeader], cls.NAVIGATE_CLASS);
547
547
  var skeleton = 'full';
548
548
  var announcementText = this.parent.globalize.formatDate(data.date, { skeleton: skeleton, calendar: this.parent.getCalendarMode() });
549
- dateHeader.setAttribute('aria-label', announcementText);
549
+ ntd.setAttribute('aria-label', announcementText);
550
550
  }
551
551
  };
552
552
  Month.prototype.getMonthStart = function (currentDate) {
@@ -105,6 +105,7 @@ var Render = /** @class */ (function () {
105
105
  }
106
106
  }
107
107
  this.updateHeader();
108
+ this.parent.currentTimezoneDate = this.parent.getCurrentTime();
108
109
  this.parent.activeView.renderLayout(cls.CURRENT_PANEL_CLASS);
109
110
  this.parent.renderTemplates();
110
111
  if (this.parent.eventTooltip) {
@@ -236,8 +236,11 @@ var TimelineYear = /** @class */ (function (_super) {
236
236
  else {
237
237
  isDateAvail = column >= monthStart.getDay() && date.getTime() < monthEnd.getTime();
238
238
  }
239
+ var announcementText = this.parent.globalize.formatDate(date, {
240
+ skeleton: 'full', calendar: this.parent.getCalendarMode()
241
+ });
239
242
  var td = createElement('td', {
240
- className: cls.WORK_CELLS_CLASS, attrs: { 'aria-selected': 'false' }
243
+ className: cls.WORK_CELLS_CLASS, attrs: { 'aria-selected': 'false', 'aria-label': announcementText }
241
244
  });
242
245
  contentTr.appendChild(td);
243
246
  var dateHeader = createElement('div', {
@@ -245,11 +248,6 @@ var TimelineYear = /** @class */ (function (_super) {
245
248
  innerHTML: (isDateAvail) ?
246
249
  this.parent.globalize.formatDate(date, { skeleton: 'd', calendar: this.parent.getCalendarMode() }) : ''
247
250
  });
248
- var skeleton = 'full';
249
- var announcementText = this.parent.globalize.formatDate(date, {
250
- skeleton: skeleton, calendar: this.parent.getCalendarMode()
251
- });
252
- dateHeader.setAttribute('aria-label', announcementText);
253
251
  if (isDateAvail) {
254
252
  var tds = [td];
255
253
  var classList = [];
@@ -239,7 +239,8 @@ var VerticalView = /** @class */ (function (_super) {
239
239
  this.parent.activeViewOptions.headerRows.slice(-1)[0].option !== 'Hour') {
240
240
  return;
241
241
  }
242
- if (this.parent.showTimeIndicator && this.isWorkHourRange(this.parent.getCurrentTime())) {
242
+ var currentDate = this.parent.getCurrentTime();
243
+ if (this.parent.showTimeIndicator && this.isWorkHourRange(currentDate)) {
243
244
  var currentDateIndex = this.getCurrentTimeIndicatorIndex();
244
245
  if (currentDateIndex.length > 0) {
245
246
  var workCells = [].slice.call(this.element.querySelectorAll('.' + cls.WORK_CELLS_CLASS));
@@ -247,7 +248,6 @@ var VerticalView = /** @class */ (function (_super) {
247
248
  this.changeCurrentTimePosition();
248
249
  }
249
250
  if (isNullOrUndefined(this.currentTimeIndicatorTimer)) {
250
- var currentDate = this.parent.getCurrentTime();
251
251
  var interval = util.MS_PER_MINUTE - ((currentDate.getSeconds() * 1000) + currentDate.getMilliseconds());
252
252
  if (interval <= (util.MS_PER_MINUTE - 1000)) {
253
253
  window.setTimeout(function () {
@@ -274,11 +274,12 @@ var VerticalView = /** @class */ (function (_super) {
274
274
  if (!isNullOrUndefined(this.parent.resourceBase) && (this.parent.activeViewOptions.group.resources.length > 0) &&
275
275
  !this.parent.uiStateValues.isGroupAdaptive) {
276
276
  var count = 0;
277
+ var currentDate = util.resetTime(this.parent.getCurrentTime());
277
278
  if (this.parent.virtualScrollModule && this.parent.activeViewOptions.allowVirtualScrolling &&
278
279
  this.parent.activeViewOptions.group.byDate) {
279
280
  for (var _i = 0, _a = this.parent.resourceBase.expandedResources; _i < _a.length; _i++) {
280
281
  var resource = _a[_i];
281
- if (util.resetTime(resource.date).getTime() === util.resetTime(this.parent.getCurrentTime()).getTime()) {
282
+ if (util.resetTime(resource.date).getTime() === currentDate.getTime()) {
282
283
  currentDateIndex.push(count);
283
284
  }
284
285
  count += 1;
@@ -287,7 +288,7 @@ var VerticalView = /** @class */ (function (_super) {
287
288
  else {
288
289
  for (var _b = 0, _c = this.parent.resourceBase.renderedResources; _b < _c.length; _b++) {
289
290
  var resource = _c[_b];
290
- var index = this.parent.getIndexOfDate(resource.renderDates, util.resetTime(this.parent.getCurrentTime()));
291
+ var index = this.parent.getIndexOfDate(resource.renderDates, currentDate);
291
292
  if (index >= 0) {
292
293
  var resIndex = this.parent.activeViewOptions.group.byDate ?
293
294
  (this.parent.resourceBase.lastResourceLevel.length * index) + count : count + index;
@@ -217,7 +217,7 @@ var ViewBase = /** @class */ (function () {
217
217
  return endHour;
218
218
  };
219
219
  ViewBase.prototype.isCurrentDate = function (date) {
220
- return date.setHours(0, 0, 0, 0) === this.parent.getCurrentTime().setHours(0, 0, 0, 0);
220
+ return date.setHours(0, 0, 0, 0) === new Date(this.parent.currentTimezoneDate).setHours(0, 0, 0, 0);
221
221
  };
222
222
  ViewBase.prototype.isCurrentMonth = function (date) {
223
223
  if (this.parent.activeViewOptions.displayDate || this.parent.activeViewOptions.numberOfWeeks > 0) {
@@ -425,7 +425,7 @@ var ViewBase = /** @class */ (function () {
425
425
  }
426
426
  else {
427
427
  var resourceText = createElement('div', { className: className });
428
- resourceText.innerText = this.parent.sanitize(tdData.resourceData[tdData.resource.textField]);
428
+ this.parent.sanitize(tdData.resourceData[tdData.resource.textField], resourceText);
429
429
  tdElement.appendChild(resourceText);
430
430
  }
431
431
  };
@@ -697,7 +697,9 @@
697
697
  }
698
698
  .e-schedule .e-event-resize.e-left-handler, .e-schedule .e-event-resize.e-right-handler {
699
699
  height: 100%;
700
- width: 10px;
700
+ min-width: 1px;
701
+ max-width: 10px;
702
+ width: 20%;
701
703
  }
702
704
  .e-schedule .e-event-resize.e-left-handler {
703
705
  cursor: ew-resize;
@@ -710,7 +712,9 @@
710
712
  right: 0;
711
713
  }
712
714
  .e-schedule .e-event-resize.e-top-handler, .e-schedule .e-event-resize.e-bottom-handler {
713
- height: 10px;
715
+ min-height: 1px;
716
+ max-height: 10px;
717
+ height: 20%;
714
718
  width: 100%;
715
719
  }
716
720
  .e-schedule .e-event-resize.e-top-handler {
@@ -697,7 +697,9 @@
697
697
  }
698
698
  .e-schedule .e-event-resize.e-left-handler, .e-schedule .e-event-resize.e-right-handler {
699
699
  height: 100%;
700
- width: 10px;
700
+ min-width: 1px;
701
+ max-width: 10px;
702
+ width: 20%;
701
703
  }
702
704
  .e-schedule .e-event-resize.e-left-handler {
703
705
  cursor: ew-resize;
@@ -710,7 +712,9 @@
710
712
  right: 0;
711
713
  }
712
714
  .e-schedule .e-event-resize.e-top-handler, .e-schedule .e-event-resize.e-bottom-handler {
713
- height: 10px;
715
+ min-height: 1px;
716
+ max-height: 10px;
717
+ height: 20%;
714
718
  width: 100%;
715
719
  }
716
720
  .e-schedule .e-event-resize.e-top-handler {
@@ -776,7 +776,9 @@
776
776
  }
777
777
  .e-schedule .e-event-resize.e-left-handler, .e-schedule .e-event-resize.e-right-handler {
778
778
  height: 100%;
779
- width: 10px;
779
+ min-width: 1px;
780
+ max-width: 10px;
781
+ width: 20%;
780
782
  }
781
783
  .e-schedule .e-event-resize.e-left-handler {
782
784
  cursor: ew-resize;
@@ -789,7 +791,9 @@
789
791
  right: 0;
790
792
  }
791
793
  .e-schedule .e-event-resize.e-top-handler, .e-schedule .e-event-resize.e-bottom-handler {
792
- height: 10px;
794
+ min-height: 1px;
795
+ max-height: 10px;
796
+ height: 20%;
793
797
  width: 100%;
794
798
  }
795
799
  .e-schedule .e-event-resize.e-top-handler {
@@ -750,7 +750,9 @@
750
750
  }
751
751
  .e-schedule .e-event-resize.e-left-handler, .e-schedule .e-event-resize.e-right-handler {
752
752
  height: 100%;
753
- width: 10px;
753
+ min-width: 1px;
754
+ max-width: 10px;
755
+ width: 20%;
754
756
  }
755
757
  .e-schedule .e-event-resize.e-left-handler {
756
758
  cursor: ew-resize;
@@ -763,7 +765,9 @@
763
765
  right: 0;
764
766
  }
765
767
  .e-schedule .e-event-resize.e-top-handler, .e-schedule .e-event-resize.e-bottom-handler {
766
- height: 10px;
768
+ min-height: 1px;
769
+ max-height: 10px;
770
+ height: 20%;
767
771
  width: 100%;
768
772
  }
769
773
  .e-schedule .e-event-resize.e-top-handler {
@@ -750,7 +750,9 @@
750
750
  }
751
751
  .e-schedule .e-event-resize.e-left-handler, .e-schedule .e-event-resize.e-right-handler {
752
752
  height: 100%;
753
- width: 10px;
753
+ min-width: 1px;
754
+ max-width: 10px;
755
+ width: 20%;
754
756
  }
755
757
  .e-schedule .e-event-resize.e-left-handler {
756
758
  cursor: ew-resize;
@@ -763,7 +765,9 @@
763
765
  right: 0;
764
766
  }
765
767
  .e-schedule .e-event-resize.e-top-handler, .e-schedule .e-event-resize.e-bottom-handler {
766
- height: 10px;
768
+ min-height: 1px;
769
+ max-height: 10px;
770
+ height: 20%;
767
771
  width: 100%;
768
772
  }
769
773
  .e-schedule .e-event-resize.e-top-handler {