@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.
@@ -6358,7 +6358,7 @@ var EventBase = /** @__PURE__ @class */ (function () {
6358
6358
  }
6359
6359
  else {
6360
6360
  var appointmentSubject = createElement('div', { className: SUBJECT_CLASS });
6361
- appointmentSubject.innerText = this.parent.sanitize(eventSubject);
6361
+ this.parent.sanitize(eventSubject, appointmentSubject);
6362
6362
  templateElement = [appointmentSubject];
6363
6363
  }
6364
6364
  append(templateElement, appointmentWrapper);
@@ -6919,7 +6919,7 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
6919
6919
  }
6920
6920
  else {
6921
6921
  var appointmentSubject = createElement('div', { className: SUBJECT_CLASS });
6922
- appointmentSubject.innerText = this.parent.sanitize(recordSubject);
6922
+ this.parent.sanitize(recordSubject, appointmentSubject);
6923
6923
  if (isAllDay) {
6924
6924
  if (record[fieldMapping.isAllDay]) {
6925
6925
  templateElement = [appointmentSubject];
@@ -6952,7 +6952,7 @@ var VerticalEvent = /** @__PURE__ @class */ (function (_super) {
6952
6952
  innerHTML: timeStr
6953
6953
  });
6954
6954
  var appointmentLocation = createElement('div', { className: LOCATION_CLASS });
6955
- appointmentLocation.innerText = this.parent.sanitize((record[fieldMapping.location] || this.parent.eventSettings.fields.location.default || ''));
6955
+ this.parent.sanitize((record[fieldMapping.location] || this.parent.eventSettings.fields.location.default || ''), appointmentLocation);
6956
6956
  templateElement = [appointmentSubject, appointmentTime, appointmentLocation];
6957
6957
  }
6958
6958
  }
@@ -7839,7 +7839,7 @@ var MonthEvent = /** @__PURE__ @class */ (function (_super) {
7839
7839
  else {
7840
7840
  var eventLocation = (record[this.fields.location] || this.parent.eventSettings.fields.location.default || '');
7841
7841
  var appointmentSubject = createElement('div', { className: SUBJECT_CLASS });
7842
- appointmentSubject.innerText = this.parent.sanitize((eventSubject + (eventLocation ? '; ' + eventLocation : '')));
7842
+ this.parent.sanitize((eventSubject + (eventLocation ? '; ' + eventLocation : '')), appointmentSubject);
7843
7843
  var appointmentStartTime = createElement('div', {
7844
7844
  className: APPOINTMENT_TIME + (this.parent.isAdaptive ? ' ' + DISABLE_CLASS : ''),
7845
7845
  innerHTML: this.parent.getTimeString(eventData[this.fields.startTime])
@@ -7883,7 +7883,7 @@ var MonthEvent = /** @__PURE__ @class */ (function (_super) {
7883
7883
  className: APPOINTMENT_TIME + (this.parent.isAdaptive ? ' ' + DISABLE_CLASS : ''), innerHTML: timeString
7884
7884
  });
7885
7885
  var appLocation = createElement('div', { className: LOCATION_CLASS });
7886
- appLocation.innerText = this.parent.sanitize(eventLocation);
7886
+ this.parent.sanitize(eventLocation, appLocation);
7887
7887
  innerElement = [appointmentSubject, appTime, appLocation];
7888
7888
  }
7889
7889
  var wrap = createElement('div', { className: 'e-inner-wrap' });
@@ -9337,7 +9337,7 @@ var QuickPopups = /** @__PURE__ @class */ (function () {
9337
9337
  }
9338
9338
  else {
9339
9339
  appointmentElement.appendChild(createElement('div', { className: SUBJECT_CLASS }));
9340
- appointmentElement.firstElementChild.innerText = this_1.parent.sanitize(eventText);
9340
+ this_1.parent.sanitize(eventText, appointmentElement.firstElementChild);
9341
9341
  }
9342
9342
  if (!isNullOrUndefined(groupIndex)) {
9343
9343
  appointmentElement.setAttribute('data-group-index', groupIndex);
@@ -9597,7 +9597,7 @@ var QuickPopups = /** @__PURE__ @class */ (function () {
9597
9597
  var templateWrapper = createElement('div', { innerHTML: header });
9598
9598
  if (headerType === 'Event') {
9599
9599
  var subjectText = templateWrapper.querySelector('.' + SUBJECT_CLASS);
9600
- subjectText.innerText = this.parent.sanitize(args.eventSubject);
9600
+ this.parent.sanitize(args.eventSubject, subjectText);
9601
9601
  }
9602
9602
  append([].slice.call(templateWrapper.childNodes), headerTemplate);
9603
9603
  }
@@ -9661,19 +9661,19 @@ var QuickPopups = /** @__PURE__ @class */ (function () {
9661
9661
  if (data[this.parent.eventFields.location]) {
9662
9662
  var locationDetails = templateWrapper.querySelector('.' + LOCATION_DETAILS_CLASS);
9663
9663
  if (!isNullOrUndefined(locationDetails)) {
9664
- locationDetails.innerText = this.parent.sanitize(data[this.parent.eventFields.location]);
9664
+ this.parent.sanitize(data[this.parent.eventFields.location], locationDetails);
9665
9665
  }
9666
9666
  }
9667
9667
  if (data[this.parent.eventFields.description]) {
9668
9668
  var descriptionDetails = templateWrapper.querySelector('.' + DESCRIPTION_DETAILS_CLASS);
9669
9669
  if (!isNullOrUndefined(descriptionDetails)) {
9670
- descriptionDetails.innerText = this.parent.sanitize(data[this.parent.eventFields.description]);
9670
+ this.parent.sanitize(data[this.parent.eventFields.description], descriptionDetails);
9671
9671
  }
9672
9672
  }
9673
9673
  if (resourceText) {
9674
9674
  var resourceDetails = templateWrapper.querySelector('.' + RESOURCE_DETAILS_CLASS);
9675
9675
  if (!isNullOrUndefined(resourceDetails)) {
9676
- resourceDetails.innerText = this.parent.sanitize(resourceText);
9676
+ this.parent.sanitize(resourceText, resourceDetails);
9677
9677
  }
9678
9678
  }
9679
9679
  append([].slice.call(templateWrapper.childNodes), contentTemplate);
@@ -11956,6 +11956,7 @@ var EventWindow = /** @__PURE__ @class */ (function () {
11956
11956
  var element = formElements_1[_i];
11957
11957
  remove(element);
11958
11958
  }
11959
+ this.parent.resetTemplates(['editorTemplate']);
11959
11960
  }
11960
11961
  var templateId = this.parent.element.id + '_editorTemplate';
11961
11962
  var tempEle = [].slice.call(this.parent.getEditorTemplate()(args || {}, this.parent, 'editorTemplate', templateId, false));
@@ -12530,10 +12531,13 @@ var EventWindow = /** @__PURE__ @class */ (function () {
12530
12531
  }
12531
12532
  };
12532
12533
  EventWindow.prototype.applyFormValidation = function () {
12534
+ var form = this.element.querySelector('.' + FORM_CLASS);
12535
+ if (!form) {
12536
+ return;
12537
+ }
12533
12538
  var getValidationRule = function (rules) {
12534
12539
  return (rules && Object.keys(rules).length > 0) ? rules : undefined;
12535
12540
  };
12536
- var form = this.element.querySelector('.' + FORM_CLASS);
12537
12541
  var rules = {};
12538
12542
  var subjectRule = getValidationRule(this.parent.eventSettings.fields.subject.validation);
12539
12543
  if (!isNullOrUndefined(subjectRule)) {
@@ -13364,7 +13368,8 @@ var EventWindow = /** @__PURE__ @class */ (function () {
13364
13368
  value = element.checked;
13365
13369
  }
13366
13370
  else {
13367
- value = this.parent.sanitize(element.value);
13371
+ value = this.parent.enableHtmlSanitizer ?
13372
+ SanitizeHtmlHelper.sanitize(element.value) : element.value;
13368
13373
  }
13369
13374
  }
13370
13375
  return value;
@@ -13509,6 +13514,9 @@ var EventWindow = /** @__PURE__ @class */ (function () {
13509
13514
  else if (element.classList.contains('e-multiselect')) {
13510
13515
  instance = element.ej2_instances;
13511
13516
  }
13517
+ else if (element.classList.contains('e-numerictextbox')) {
13518
+ instance = element.ej2_instances;
13519
+ }
13512
13520
  if (instance && instance[0]) {
13513
13521
  instance[0].destroy();
13514
13522
  }
@@ -15887,7 +15895,7 @@ var ResourceBase = /** @__PURE__ @class */ (function () {
15887
15895
  return resData[resourceLevel.idField] === resource.groupOrder[parseInt(i.toString(), 10)];
15888
15896
  });
15889
15897
  var resourceName = createElement('div', { className: RESOURCE_NAME });
15890
- resourceName.innerText = this_2.parent.sanitize(resourceText[0][resourceLevel.textField]);
15898
+ this_2.parent.sanitize(resourceText[0][resourceLevel.textField], resourceName);
15891
15899
  headerCollection.push(resourceName);
15892
15900
  var levelIcon = createElement('div', { className: 'e-icons e-icon-next' });
15893
15901
  headerCollection.push(levelIcon);
@@ -16692,17 +16700,20 @@ var Schedule = /** @__PURE__ @class */ (function (_super) {
16692
16700
  }
16693
16701
  };
16694
16702
  /**
16695
- * Method to sanitize any suspected untrusted strings and scripts before rendering them.
16703
+ * This method renders untrusted strings and scripts securely by sanitizing them first.
16696
16704
  *
16697
16705
  * @param {string} value - A string value representing the HTML string value to be sanitized.
16698
- * @returns {string} A sanitized Html string.
16706
+ * @param {HTMLElement} element - An HTML element to which the sanitized or unsanitized HTML string will be assigned.
16707
+ * @returns {void}
16699
16708
  * @private
16700
16709
  */
16701
- Schedule.prototype.sanitize = function (value) {
16710
+ Schedule.prototype.sanitize = function (value, element) {
16702
16711
  if (this.enableHtmlSanitizer) {
16703
- return SanitizeHtmlHelper.sanitize(value);
16712
+ element.innerText = SanitizeHtmlHelper.sanitize(value);
16713
+ }
16714
+ else {
16715
+ element.innerHTML = value;
16704
16716
  }
16705
- return value;
16706
16717
  };
16707
16718
  Schedule.prototype.initializeResources = function (isSetModel) {
16708
16719
  if (isSetModel === void 0) { isSetModel = false; }
@@ -22883,7 +22894,7 @@ var ViewBase = /** @__PURE__ @class */ (function () {
22883
22894
  }
22884
22895
  else {
22885
22896
  var resourceText = createElement('div', { className: className });
22886
- resourceText.innerText = this.parent.sanitize(tdData.resourceData[tdData.resource.textField]);
22897
+ this.parent.sanitize(tdData.resourceData[tdData.resource.textField], resourceText);
22887
22898
  tdElement.appendChild(resourceText);
22888
22899
  }
22889
22900
  };
@@ -25265,11 +25276,11 @@ var AgendaBase = /** @__PURE__ @class */ (function (_super) {
25265
25276
  eventSubject += ',';
25266
25277
  }
25267
25278
  var appSubjectText = createElement('div', { className: SUBJECT_CLASS });
25268
- appSubjectText.innerText = this.parent.sanitize(eventSubject);
25279
+ this.parent.sanitize(eventSubject, appSubjectText);
25269
25280
  appSubjectWrap.appendChild(appSubjectText);
25270
25281
  if (!isNullOrUndefined(eventLocation) && eventLocation !== '') {
25271
25282
  var appLocation = createElement('div', { className: LOCATION_CLASS });
25272
- appLocation.innerText = this.parent.sanitize(eventLocation);
25283
+ this.parent.sanitize(eventLocation, appLocation);
25273
25284
  appSubjectWrap.appendChild(appLocation);
25274
25285
  }
25275
25286
  if (!isNullOrUndefined(event[fieldMapping.recurrenceRule])) {