@syncfusion/ej2-lists 28.1.33 → 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, Property, ChildProperty, detach, removeClass, formatUnit, animationMode, Animation, closest, EventHandler, Touch, remove, rippleEffect, Complex, Event, NotifyPropertyChanges, Component, select, isBlazor, getComponent, getUniqueID, Draggable, compareElementParent, Base } from '@syncfusion/ej2-base';
1
+ import { isNullOrUndefined, getValue, extend, SanitizeHtmlHelper, prepend, merge, addClass, isVisible, attributes, append, compile, Property, ChildProperty, detach, removeClass, formatUnit, animationMode, Animation, closest, EventHandler, Touch, remove, rippleEffect, Complex, Event, NotifyPropertyChanges, Component, select, isBlazor, getComponent, getUniqueID, Draggable, compareElementParent, Base } 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
+ var tooltipText = fieldData[fields.tooltip];
264
+ if (options && options.enableHtmlSanitizer) {
265
+ tooltipText = SanitizeHtmlHelper.sanitize(tooltipText);
266
+ }
267
+ else {
268
+ var 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
  }
@@ -826,6 +838,9 @@ var ListBase;
826
838
  if (dataSource && Object.prototype.hasOwnProperty.call(fieldData, fields.enabled) && fieldData[fields.enabled].toString() === 'false') {
827
839
  li.classList.add(cssClass.disabled);
828
840
  }
841
+ if (options && options.enableHtmlSanitizer) {
842
+ text = SanitizeHtmlHelper.sanitize(text);
843
+ }
829
844
  if (grpLI) {
830
845
  li.innerText = text;
831
846
  }
@@ -944,8 +959,7 @@ var ListBase;
944
959
  ? true : false;
945
960
  }
946
961
  if (options && options.enableHtmlSanitizer) {
947
- // eslint-disable-next-line no-self-assign
948
- text = text;
962
+ text = SanitizeHtmlHelper.sanitize(text);
949
963
  }
950
964
  var li = createElement('li', {
951
965
  className: (grpLI === true ? cssClass.group : cssClass.li) + ' ' + (isNullOrUndefined(className) ? '' : className),
@@ -997,7 +1011,7 @@ var ListBase;
997
1011
  attrs: (ariaAttributes.itemText !== '' ? { role: ariaAttributes.itemText } : {})
998
1012
  });
999
1013
  if (options && options.enableHtmlSanitizer) {
1000
- element.innerText = SanitizeHtmlHelper.sanitize(text);
1014
+ element.innerText = text;
1001
1015
  }
1002
1016
  else {
1003
1017
  element.innerHTML = text;
@@ -4285,6 +4299,7 @@ var Sortable = /** @__PURE__ @class */ (function (_super) {
4285
4299
  var isPlaceHolderPresent = _this.isPlaceHolderPresent(dropInst);
4286
4300
  if (isPlaceHolderPresent) {
4287
4301
  var curIdx_1 = _this.getIndex(dropInst.placeHolderElement, dropInst);
4302
+ prevIdx = _this === dropInst && (prevIdx - curIdx_1) >= 1 ? prevIdx - 1 : prevIdx;
4288
4303
  var args = {
4289
4304
  previousIndex: prevIdx, currentIndex: curIdx_1, target: e.target, droppedElement: _this.target,
4290
4305
  helper: e.helper, cancel: false, handled: false
@@ -4300,7 +4315,7 @@ var Sortable = /** @__PURE__ @class */ (function (_super) {
4300
4315
  }
4301
4316
  dropInst.element.insertBefore(_this.target, dropInst.placeHolderElement);
4302
4317
  var curIdx_2 = _this.getIndex(_this.target, dropInst);
4303
- prevIdx = _this === dropInst && (prevIdx - curIdx_2) > 1 ? prevIdx - 1 : prevIdx;
4318
+ prevIdx = _this === dropInst && (prevIdx - curIdx_2) >= 1 ? prevIdx - 1 : prevIdx;
4304
4319
  _this.trigger('drop', {
4305
4320
  event: e.event, element: dropInst.element, previousIndex: prevIdx, currentIndex: curIdx_2,
4306
4321
  target: e.target, helper: e.helper, droppedElement: _this.target, scopeName: _this.scope, handled: handled