@syncfusion/ej2-lists 28.1.37 → 28.2.3

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,4 +1,4 @@
1
- import { isNullOrUndefined, getValue, extend, prepend, SanitizeHtmlHelper, merge, addClass, isVisible, attributes, append, compile, ChildProperty, Property, Component, detach, removeClass, formatUnit, animationMode, Animation, closest, EventHandler, Touch, remove, rippleEffect, Complex, Event, NotifyPropertyChanges, select, Base, isBlazor, getComponent, getUniqueID, Draggable, compareElementParent } from '@syncfusion/ej2-base';
1
+ import { isNullOrUndefined, getValue, extend, SanitizeHtmlHelper, prepend, merge, addClass, isVisible, attributes, append, compile, ChildProperty, Property, Component, detach, removeClass, formatUnit, animationMode, Animation, closest, EventHandler, Touch, remove, rippleEffect, Complex, Event, NotifyPropertyChanges, select, Base, isBlazor, getComponent, getUniqueID, Draggable, compareElementParent } from '@syncfusion/ej2-base';
2
2
  import { Query, DataManager } from '@syncfusion/ej2-data';
3
3
  import { createCheckBox } from '@syncfusion/ej2-buttons';
4
4
 
@@ -259,6 +259,18 @@ var ListBase;
259
259
  li = generateSingleLevelLI(createElement, curItem, fieldData, fields, curOpt.itemClass, innerEle, (Object.prototype.hasOwnProperty.call(curItem, 'isHeader') &&
260
260
  curItem.isHeader) ? true : false, id, i, options);
261
261
  anchorElement = li.querySelector('.' + cssClass.anchorWrap);
262
+ if (Object.prototype.hasOwnProperty.call(fieldData, fields.tooltip)) {
263
+ let tooltipText = fieldData[fields.tooltip];
264
+ if (options && options.enableHtmlSanitizer) {
265
+ tooltipText = SanitizeHtmlHelper.sanitize(tooltipText);
266
+ }
267
+ else {
268
+ let tooltipTextElement = createElement('span', { innerHTML: tooltipText });
269
+ tooltipText = tooltipTextElement.innerText;
270
+ tooltipTextElement = null;
271
+ }
272
+ li.setAttribute('title', tooltipText);
273
+ }
262
274
  if (curOpt.itemNavigable && checkboxElement.length) {
263
275
  prepend(checkboxElement, li.firstElementChild);
264
276
  }
@@ -823,6 +835,9 @@ var ListBase;
823
835
  if (dataSource && Object.prototype.hasOwnProperty.call(fieldData, fields.enabled) && fieldData[fields.enabled].toString() === 'false') {
824
836
  li.classList.add(cssClass.disabled);
825
837
  }
838
+ if (options && options.enableHtmlSanitizer) {
839
+ text = SanitizeHtmlHelper.sanitize(text);
840
+ }
826
841
  if (grpLI) {
827
842
  li.innerText = text;
828
843
  }
@@ -941,8 +956,7 @@ var ListBase;
941
956
  ? true : false;
942
957
  }
943
958
  if (options && options.enableHtmlSanitizer) {
944
- // eslint-disable-next-line no-self-assign
945
- text = text;
959
+ text = SanitizeHtmlHelper.sanitize(text);
946
960
  }
947
961
  const li = createElement('li', {
948
962
  className: (grpLI === true ? cssClass.group : cssClass.li) + ' ' + (isNullOrUndefined(className) ? '' : className),
@@ -994,7 +1008,7 @@ var ListBase;
994
1008
  attrs: (ariaAttributes.itemText !== '' ? { role: ariaAttributes.itemText } : {})
995
1009
  });
996
1010
  if (options && options.enableHtmlSanitizer) {
997
- element.innerText = SanitizeHtmlHelper.sanitize(text);
1011
+ element.innerText = text;
998
1012
  }
999
1013
  else {
1000
1014
  element.innerHTML = text;