@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.
@@ -6260,7 +6260,7 @@ class EventBase {
6260
6260
  }
6261
6261
  else {
6262
6262
  const appointmentSubject = createElement('div', { className: SUBJECT_CLASS });
6263
- appointmentSubject.innerText = this.parent.sanitize(eventSubject);
6263
+ this.parent.sanitize(eventSubject, appointmentSubject);
6264
6264
  templateElement = [appointmentSubject];
6265
6265
  }
6266
6266
  append(templateElement, appointmentWrapper);
@@ -6786,7 +6786,7 @@ class VerticalEvent extends EventBase {
6786
6786
  }
6787
6787
  else {
6788
6788
  const appointmentSubject = createElement('div', { className: SUBJECT_CLASS });
6789
- appointmentSubject.innerText = this.parent.sanitize(recordSubject);
6789
+ this.parent.sanitize(recordSubject, appointmentSubject);
6790
6790
  if (isAllDay) {
6791
6791
  if (record[fieldMapping.isAllDay]) {
6792
6792
  templateElement = [appointmentSubject];
@@ -6819,7 +6819,7 @@ class VerticalEvent extends EventBase {
6819
6819
  innerHTML: timeStr
6820
6820
  });
6821
6821
  const appointmentLocation = createElement('div', { className: LOCATION_CLASS });
6822
- appointmentLocation.innerText = this.parent.sanitize((record[fieldMapping.location] || this.parent.eventSettings.fields.location.default || ''));
6822
+ this.parent.sanitize((record[fieldMapping.location] || this.parent.eventSettings.fields.location.default || ''), appointmentLocation);
6823
6823
  templateElement = [appointmentSubject, appointmentTime, appointmentLocation];
6824
6824
  }
6825
6825
  }
@@ -7664,7 +7664,7 @@ class MonthEvent extends EventBase {
7664
7664
  else {
7665
7665
  const eventLocation = (record[this.fields.location] || this.parent.eventSettings.fields.location.default || '');
7666
7666
  const appointmentSubject = createElement('div', { className: SUBJECT_CLASS });
7667
- appointmentSubject.innerText = this.parent.sanitize((eventSubject + (eventLocation ? '; ' + eventLocation : '')));
7667
+ this.parent.sanitize((eventSubject + (eventLocation ? '; ' + eventLocation : '')), appointmentSubject);
7668
7668
  const appointmentStartTime = createElement('div', {
7669
7669
  className: APPOINTMENT_TIME + (this.parent.isAdaptive ? ' ' + DISABLE_CLASS : ''),
7670
7670
  innerHTML: this.parent.getTimeString(eventData[this.fields.startTime])
@@ -7708,7 +7708,7 @@ class MonthEvent extends EventBase {
7708
7708
  className: APPOINTMENT_TIME + (this.parent.isAdaptive ? ' ' + DISABLE_CLASS : ''), innerHTML: timeString
7709
7709
  });
7710
7710
  const appLocation = createElement('div', { className: LOCATION_CLASS });
7711
- appLocation.innerText = this.parent.sanitize(eventLocation);
7711
+ this.parent.sanitize(eventLocation, appLocation);
7712
7712
  innerElement = [appointmentSubject, appTime, appLocation];
7713
7713
  }
7714
7714
  const wrap = createElement('div', { className: 'e-inner-wrap' });
@@ -9124,7 +9124,7 @@ class QuickPopups {
9124
9124
  }
9125
9125
  else {
9126
9126
  appointmentElement.appendChild(createElement('div', { className: SUBJECT_CLASS }));
9127
- appointmentElement.firstElementChild.innerText = this.parent.sanitize(eventText);
9127
+ this.parent.sanitize(eventText, appointmentElement.firstElementChild);
9128
9128
  }
9129
9129
  if (!isNullOrUndefined(groupIndex)) {
9130
9130
  appointmentElement.setAttribute('data-group-index', groupIndex);
@@ -9379,7 +9379,7 @@ class QuickPopups {
9379
9379
  const templateWrapper = createElement('div', { innerHTML: header });
9380
9380
  if (headerType === 'Event') {
9381
9381
  const subjectText = templateWrapper.querySelector('.' + SUBJECT_CLASS);
9382
- subjectText.innerText = this.parent.sanitize(args.eventSubject);
9382
+ this.parent.sanitize(args.eventSubject, subjectText);
9383
9383
  }
9384
9384
  append([].slice.call(templateWrapper.childNodes), headerTemplate);
9385
9385
  }
@@ -9443,19 +9443,19 @@ class QuickPopups {
9443
9443
  if (data[this.parent.eventFields.location]) {
9444
9444
  const locationDetails = templateWrapper.querySelector('.' + LOCATION_DETAILS_CLASS);
9445
9445
  if (!isNullOrUndefined(locationDetails)) {
9446
- locationDetails.innerText = this.parent.sanitize(data[this.parent.eventFields.location]);
9446
+ this.parent.sanitize(data[this.parent.eventFields.location], locationDetails);
9447
9447
  }
9448
9448
  }
9449
9449
  if (data[this.parent.eventFields.description]) {
9450
9450
  const descriptionDetails = templateWrapper.querySelector('.' + DESCRIPTION_DETAILS_CLASS);
9451
9451
  if (!isNullOrUndefined(descriptionDetails)) {
9452
- descriptionDetails.innerText = this.parent.sanitize(data[this.parent.eventFields.description]);
9452
+ this.parent.sanitize(data[this.parent.eventFields.description], descriptionDetails);
9453
9453
  }
9454
9454
  }
9455
9455
  if (resourceText) {
9456
9456
  const resourceDetails = templateWrapper.querySelector('.' + RESOURCE_DETAILS_CLASS);
9457
9457
  if (!isNullOrUndefined(resourceDetails)) {
9458
- resourceDetails.innerText = this.parent.sanitize(resourceText);
9458
+ this.parent.sanitize(resourceText, resourceDetails);
9459
9459
  }
9460
9460
  }
9461
9461
  append([].slice.call(templateWrapper.childNodes), contentTemplate);
@@ -11687,6 +11687,7 @@ class EventWindow {
11687
11687
  for (const element of formElements) {
11688
11688
  remove(element);
11689
11689
  }
11690
+ this.parent.resetTemplates(['editorTemplate']);
11690
11691
  }
11691
11692
  const templateId = this.parent.element.id + '_editorTemplate';
11692
11693
  const tempEle = [].slice.call(this.parent.getEditorTemplate()(args || {}, this.parent, 'editorTemplate', templateId, false));
@@ -12250,8 +12251,11 @@ class EventWindow {
12250
12251
  }
12251
12252
  }
12252
12253
  applyFormValidation() {
12253
- const getValidationRule = (rules) => (rules && Object.keys(rules).length > 0) ? rules : undefined;
12254
12254
  const form = this.element.querySelector('.' + FORM_CLASS);
12255
+ if (!form) {
12256
+ return;
12257
+ }
12258
+ const getValidationRule = (rules) => (rules && Object.keys(rules).length > 0) ? rules : undefined;
12255
12259
  const rules = {};
12256
12260
  const subjectRule = getValidationRule(this.parent.eventSettings.fields.subject.validation);
12257
12261
  if (!isNullOrUndefined(subjectRule)) {
@@ -13062,7 +13066,8 @@ class EventWindow {
13062
13066
  value = element.checked;
13063
13067
  }
13064
13068
  else {
13065
- value = this.parent.sanitize(element.value);
13069
+ value = this.parent.enableHtmlSanitizer ?
13070
+ SanitizeHtmlHelper.sanitize(element.value) : element.value;
13066
13071
  }
13067
13072
  }
13068
13073
  return value;
@@ -13206,6 +13211,9 @@ class EventWindow {
13206
13211
  else if (element.classList.contains('e-multiselect')) {
13207
13212
  instance = element.ej2_instances;
13208
13213
  }
13214
+ else if (element.classList.contains('e-numerictextbox')) {
13215
+ instance = element.ej2_instances;
13216
+ }
13209
13217
  if (instance && instance[0]) {
13210
13218
  instance[0].destroy();
13211
13219
  }
@@ -15348,7 +15356,7 @@ class ResourceBase {
15348
15356
  const resourceLevel = this.resourceCollection[parseInt(i.toString(), 10)];
15349
15357
  const resourceText = resourceLevel.dataSource.filter((resData) => resData[resourceLevel.idField] === resource.groupOrder[parseInt(i.toString(), 10)]);
15350
15358
  const resourceName = createElement('div', { className: RESOURCE_NAME });
15351
- resourceName.innerText = this.parent.sanitize(resourceText[0][resourceLevel.textField]);
15359
+ this.parent.sanitize(resourceText[0][resourceLevel.textField], resourceName);
15352
15360
  headerCollection.push(resourceName);
15353
15361
  const levelIcon = createElement('div', { className: 'e-icons e-icon-next' });
15354
15362
  headerCollection.push(levelIcon);
@@ -16079,17 +16087,20 @@ let Schedule = class Schedule extends Component {
16079
16087
  }
16080
16088
  }
16081
16089
  /**
16082
- * Method to sanitize any suspected untrusted strings and scripts before rendering them.
16090
+ * This method renders untrusted strings and scripts securely by sanitizing them first.
16083
16091
  *
16084
16092
  * @param {string} value - A string value representing the HTML string value to be sanitized.
16085
- * @returns {string} A sanitized Html string.
16093
+ * @param {HTMLElement} element - An HTML element to which the sanitized or unsanitized HTML string will be assigned.
16094
+ * @returns {void}
16086
16095
  * @private
16087
16096
  */
16088
- sanitize(value) {
16097
+ sanitize(value, element) {
16089
16098
  if (this.enableHtmlSanitizer) {
16090
- return SanitizeHtmlHelper.sanitize(value);
16099
+ element.innerText = SanitizeHtmlHelper.sanitize(value);
16100
+ }
16101
+ else {
16102
+ element.innerHTML = value;
16091
16103
  }
16092
- return value;
16093
16104
  }
16094
16105
  initializeResources(isSetModel = false) {
16095
16106
  if (this.resources.length > 0) {
@@ -22117,7 +22128,7 @@ class ViewBase {
22117
22128
  }
22118
22129
  else {
22119
22130
  const resourceText = createElement('div', { className: className });
22120
- resourceText.innerText = this.parent.sanitize(tdData.resourceData[tdData.resource.textField]);
22131
+ this.parent.sanitize(tdData.resourceData[tdData.resource.textField], resourceText);
22121
22132
  tdElement.appendChild(resourceText);
22122
22133
  }
22123
22134
  }
@@ -24355,11 +24366,11 @@ class AgendaBase extends ViewBase {
24355
24366
  eventSubject += ',';
24356
24367
  }
24357
24368
  const appSubjectText = createElement('div', { className: SUBJECT_CLASS });
24358
- appSubjectText.innerText = this.parent.sanitize(eventSubject);
24369
+ this.parent.sanitize(eventSubject, appSubjectText);
24359
24370
  appSubjectWrap.appendChild(appSubjectText);
24360
24371
  if (!isNullOrUndefined(eventLocation) && eventLocation !== '') {
24361
24372
  const appLocation = createElement('div', { className: LOCATION_CLASS });
24362
- appLocation.innerText = this.parent.sanitize(eventLocation);
24373
+ this.parent.sanitize(eventLocation, appLocation);
24363
24374
  appSubjectWrap.appendChild(appLocation);
24364
24375
  }
24365
24376
  if (!isNullOrUndefined(event[fieldMapping.recurrenceRule])) {