@syncfusion/ej2-schedule 21.1.39 → 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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 21.1.39
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.38",
3
+ "_id": "@syncfusion/ej2-schedule@21.1.39",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-jPAJzAQE5jigxLxQ332/yTx/gSPQ+ULU57cvZt74shmRjK75My/O+tBI2RDHhf2gZWqA60Skm+1BP9C6Auiaug==",
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.38.tgz",
27
- "_shasum": "749859087a3dbcf2959367298d72399caef697fc",
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.39",
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.39",
42
+ "@syncfusion/ej2-dropdowns": "~21.1.41",
43
43
  "@syncfusion/ej2-excel-export": "~21.1.37",
44
44
  "@syncfusion/ej2-inputs": "~21.1.39",
45
- "@syncfusion/ej2-lists": "~21.1.39",
45
+ "@syncfusion/ej2-lists": "~21.1.41",
46
46
  "@syncfusion/ej2-navigations": "~21.1.39",
47
- "@syncfusion/ej2-popups": "~21.1.37"
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.39",
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);
@@ -911,13 +911,14 @@ export declare class Schedule extends Component<HTMLElement> implements INotifyP
911
911
  */
912
912
  resetTemplates(templates?: string[]): void;
913
913
  /**
914
- * 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.
915
915
  *
916
916
  * @param {string} value - A string value representing the HTML string value to be sanitized.
917
- * @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}
918
919
  * @private
919
920
  */
920
- sanitize(value: string): string;
921
+ sanitize(value: string, element: HTMLElement): void;
921
922
  private initializeResources;
922
923
  /**
923
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; }
@@ -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' });
@@ -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
  }
@@ -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);
@@ -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
  };