@syncfusion/ej2-dropdowns 32.2.6 → 32.2.7

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 : 32.2.4
3
+ * version : 32.2.7
4
4
  * Copyright Syncfusion Inc. 2001 - 2025. 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,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-dropdowns",
3
- "version": "32.2.6",
3
+ "version": "32.2.7",
4
4
  "description": "Essential JS 2 DropDown Components",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -10,11 +10,11 @@
10
10
  "dependencies": {
11
11
  "@syncfusion/ej2-base": "~32.2.6",
12
12
  "@syncfusion/ej2-data": "~32.2.3",
13
- "@syncfusion/ej2-inputs": "~32.2.3",
14
- "@syncfusion/ej2-lists": "~32.2.6",
15
- "@syncfusion/ej2-navigations": "~32.2.6",
13
+ "@syncfusion/ej2-inputs": "~32.2.7",
14
+ "@syncfusion/ej2-lists": "~32.2.7",
15
+ "@syncfusion/ej2-navigations": "~32.2.7",
16
16
  "@syncfusion/ej2-notifications": "~32.2.3",
17
- "@syncfusion/ej2-popups": "~32.2.6"
17
+ "@syncfusion/ej2-popups": "~32.2.7"
18
18
  },
19
19
  "devDependencies": {},
20
20
  "keywords": [
@@ -133,6 +133,7 @@ export declare class DropDownList extends DropDownBase implements IInput {
133
133
  private filterArgs;
134
134
  private isReactTemplateUpdate;
135
135
  private iOSscrollPosition;
136
+ private resizeHandler;
136
137
  /**
137
138
  * Sets CSS classes to the root element of the component that allows customization of appearance.
138
139
  *
@@ -593,7 +593,8 @@ var DropDownList = /** @class */ (function (_super) {
593
593
  EventHandler.add(this.inputWrapper.container, 'mousedown', this.dropDownClick, this);
594
594
  EventHandler.add(this.inputWrapper.container, 'focus', this.focusIn, this);
595
595
  EventHandler.add(this.inputWrapper.container, 'keypress', this.onSearch, this);
596
- EventHandler.add(window, 'resize', this.windowResize, this);
596
+ this.resizeHandler = this.windowResize.bind(this);
597
+ window.addEventListener('resize', this.resizeHandler);
597
598
  this.bindCommonEvent();
598
599
  };
599
600
  DropDownList.prototype.bindCommonEvent = function () {
@@ -1383,7 +1384,10 @@ var DropDownList = /** @class */ (function (_super) {
1383
1384
  EventHandler.remove(this.inputWrapper.container, 'mousedown', this.dropDownClick);
1384
1385
  EventHandler.remove(this.inputWrapper.container, 'keypress', this.onSearch);
1385
1386
  EventHandler.remove(this.inputWrapper.container, 'focus', this.focusIn);
1386
- EventHandler.remove(window, 'resize', this.windowResize);
1387
+ if (this.resizeHandler) {
1388
+ window.removeEventListener('resize', this.resizeHandler);
1389
+ this.resizeHandler = null;
1390
+ }
1387
1391
  }
1388
1392
  this.unBindCommonEvent();
1389
1393
  };
@@ -410,10 +410,23 @@ export interface DropDownTreeModel extends ComponentModel{
410
410
  * Specifies whether to display or remove the untrusted HTML values in the Dropdown Tree component.
411
411
  * If 'enableHtmlSanitizer' set to true, the component will sanitize any suspected untrusted strings and scripts before rendering them.
412
412
  *
413
+ * **Note:** To correctly remove untrusted HTML values, `disableHtmlEncode` must also be set to true. When `enableHtmlSanitizer` is set to false, `disableHtmlEncode` must also be set to false.
414
+ *
413
415
  * @default true
414
416
  */
415
417
  enableHtmlSanitizer?: boolean;
416
418
 
419
+ /**
420
+ * Enables rendering of raw text content in the Dropdown Tree component without HTML encoding.
421
+ * When set to true, the text will be displayed exactly as provided (including HTML tags or special characters),
422
+ * instead of being encoded or truncated (e.g., `hiiih<hihi` will be shown as-is).
423
+ *
424
+ * **Note:** To preserve and render raw HTML content correctly, `enableHtmlSanitizer` must also be set to false.
425
+ *
426
+ * @default true
427
+ */
428
+ disableHtmlEncode?: boolean
429
+
417
430
  /**
418
431
  * Specifies whether to show or hide the clear icon in textbox.
419
432
  * When the clear button is clicked, `value`, `text` properties will be reset to null.
@@ -580,9 +580,21 @@ export declare class DropDownTree extends Component<HTMLElement> implements INot
580
580
  * Specifies whether to display or remove the untrusted HTML values in the Dropdown Tree component.
581
581
  * If 'enableHtmlSanitizer' set to true, the component will sanitize any suspected untrusted strings and scripts before rendering them.
582
582
  *
583
+ * **Note:** To correctly remove untrusted HTML values, `disableHtmlEncode` must also be set to true. When `enableHtmlSanitizer` is set to false, `disableHtmlEncode` must also be set to false.
584
+ *
583
585
  * @default true
584
586
  */
585
587
  enableHtmlSanitizer: boolean;
588
+ /**
589
+ * Enables rendering of raw text content in the Dropdown Tree component without HTML encoding.
590
+ * When set to true, the text will be displayed exactly as provided (including HTML tags or special characters),
591
+ * instead of being encoded or truncated (e.g., `hiiih<hihi` will be shown as-is).
592
+ *
593
+ * **Note:** To preserve and render raw HTML content correctly, `enableHtmlSanitizer` must also be set to false.
594
+ *
595
+ * @default true
596
+ */
597
+ disableHtmlEncode: boolean;
586
598
  /**
587
599
  * Specifies whether to show or hide the clear icon in textbox.
588
600
  * When the clear button is clicked, `value`, `text` properties will be reset to null.
@@ -898,6 +910,8 @@ export declare class DropDownTree extends Component<HTMLElement> implements INot
898
910
  private updateText;
899
911
  private updateModelMode;
900
912
  private updateOption;
913
+ private getDomSetter;
914
+ private getSanitizedText;
901
915
  /**
902
916
  * Dynamically change the value of properties.
903
917
  *
@@ -1072,12 +1072,7 @@ var DropDownTree = /** @class */ (function (_super) {
1072
1072
  temp = this.getOverflowVal(index);
1073
1073
  data += temp;
1074
1074
  temp = this.overFlowWrapper.innerHTML;
1075
- if (this.enableHtmlSanitizer) {
1076
- this.overFlowWrapper.innerText = SanitizeHtmlHelper.sanitize(data);
1077
- }
1078
- else {
1079
- this.overFlowWrapper.innerHTML = data;
1080
- }
1075
+ this.overFlowWrapper[this.getDomSetter()] = this.getSanitizedText(data);
1081
1076
  wrapperleng = this.overFlowWrapper.offsetWidth;
1082
1077
  overAllContainer = this.inputWrapper.offsetWidth;
1083
1078
  if ((wrapperleng + downIconWidth + this.clearIconWidth) > overAllContainer) {
@@ -1657,6 +1652,7 @@ var DropDownTree = /** @class */ (function (_super) {
1657
1652
  dataBound: this.OnDataBound.bind(this),
1658
1653
  allowMultiSelection: this.allowMultiSelection,
1659
1654
  enableHtmlSanitizer: this.enableHtmlSanitizer,
1655
+ disableHtmlEncode: this.disableHtmlEncode,
1660
1656
  showCheckBox: this.showCheckBox,
1661
1657
  autoCheck: this.treeSettings.autoCheck,
1662
1658
  sortOrder: this.sortOrder,
@@ -2643,12 +2639,7 @@ var DropDownTree = /** @class */ (function (_super) {
2643
2639
  });
2644
2640
  var chipContent = this.createElement('span', { className: CHIP_CONTENT });
2645
2641
  var chipClose = this.createElement('span', { className: CHIP_CLOSE + ' ' + ICONS });
2646
- if (this.enableHtmlSanitizer) {
2647
- chipContent.innerText = SanitizeHtmlHelper.sanitize(text);
2648
- }
2649
- else {
2650
- chipContent.innerHTML = text;
2651
- }
2642
+ chipContent[this.getDomSetter()] = this.getSanitizedText(text);
2652
2643
  chip.appendChild(chipContent);
2653
2644
  this.chipCollection.appendChild(chip);
2654
2645
  if (this.showClearButton) {
@@ -3087,6 +3078,12 @@ var DropDownTree = /** @class */ (function (_super) {
3087
3078
  this.hiddenElement.removeAttribute('multiple');
3088
3079
  }
3089
3080
  };
3081
+ DropDownTree.prototype.getDomSetter = function () {
3082
+ return this.disableHtmlEncode ? 'textContent' : 'innerHTML';
3083
+ };
3084
+ DropDownTree.prototype.getSanitizedText = function (text) {
3085
+ return this.enableHtmlSanitizer ? SanitizeHtmlHelper.sanitize(text) : text;
3086
+ };
3090
3087
  /**
3091
3088
  * Dynamically change the value of properties.
3092
3089
  *
@@ -3556,6 +3553,9 @@ var DropDownTree = /** @class */ (function (_super) {
3556
3553
  __decorate([
3557
3554
  Property(true)
3558
3555
  ], DropDownTree.prototype, "enableHtmlSanitizer", void 0);
3556
+ __decorate([
3557
+ Property(true)
3558
+ ], DropDownTree.prototype, "disableHtmlEncode", void 0);
3559
3559
  __decorate([
3560
3560
  Property(true)
3561
3561
  ], DropDownTree.prototype, "showClearButton", void 0);
@@ -138,6 +138,7 @@ export declare class ListBox extends DropDownBase {
138
138
  private timer;
139
139
  private inputFormName;
140
140
  private selectedListItemCount;
141
+ private boundResizeHandler;
141
142
  /**
142
143
  * Sets the CSS classes to root element of this component, which helps to customize the
143
144
  * complete styles.
@@ -1236,7 +1236,8 @@ var ListBox = /** @class */ (function (_super) {
1236
1236
  if (form) {
1237
1237
  EventHandler.add(form, 'reset', this.formResetHandler, this);
1238
1238
  }
1239
- window.addEventListener('resize', this.resizeHandler.bind(this));
1239
+ this.boundResizeHandler = this.resizeHandler.bind(this);
1240
+ window.addEventListener('resize', this.boundResizeHandler);
1240
1241
  };
1241
1242
  ListBox.prototype.wireToolbarEvent = function () {
1242
1243
  if (this.toolbarSettings.items.length) {
@@ -1258,7 +1259,10 @@ var ListBox = /** @class */ (function (_super) {
1258
1259
  if (form) {
1259
1260
  EventHandler.remove(form, 'reset', this.formResetHandler);
1260
1261
  }
1261
- window.removeEventListener('resize', this.resizeHandler.bind(this));
1262
+ if (this.boundResizeHandler) {
1263
+ window.removeEventListener('resize', this.boundResizeHandler);
1264
+ this.boundResizeHandler = null;
1265
+ }
1262
1266
  };
1263
1267
  ListBox.prototype.clickHandler = function (e) {
1264
1268
  var li = closest(e.target, '.' + 'e-list-item');
@@ -59,6 +59,9 @@ export declare class Mention extends DropDownBase {
59
59
  private isUpDownKey;
60
60
  private isRTE;
61
61
  private keyEventName;
62
+ private keyupHandler;
63
+ private keydownHandler;
64
+ private popupAppendTo;
62
65
  /**
63
66
  * Defines class/multiple classes separated by a space for the mention component.
64
67
  *
@@ -410,6 +413,7 @@ export declare class Mention extends DropDownBase {
410
413
  hidePopup(e?: MouseEvent | KeyboardEventArgs): void;
411
414
  private closePopup;
412
415
  private renderPopup;
416
+ protected getAppendToElement(): HTMLElement;
413
417
  private setHeight;
414
418
  private checkCollision;
415
419
  private getTriggerCharPosition;
@@ -145,16 +145,21 @@ var Mention = /** @class */ (function (_super) {
145
145
  this.wireEvent();
146
146
  };
147
147
  Mention.prototype.wireEvent = function () {
148
- EventHandler.add(this.inputElement, 'keyup', this.onKeyUp, this);
148
+ this.keyupHandler = this.onKeyUp.bind(this);
149
+ EventHandler.add(this.inputElement, 'keyup', this.keyupHandler, this);
149
150
  this.bindCommonEvent();
150
151
  };
151
152
  Mention.prototype.unWireEvent = function () {
152
- EventHandler.remove(this.inputElement, 'keyup', this.onKeyUp);
153
+ if (this.keyupHandler) {
154
+ EventHandler.remove(this.inputElement, 'keyup', this.keyupHandler);
155
+ this.keyupHandler = null;
156
+ }
153
157
  this.unBindCommonEvent();
154
158
  };
155
159
  Mention.prototype.bindCommonEvent = function () {
156
160
  if (!Browser.isDevice) {
157
- this.inputElement.addEventListener('keydown', this.keyDownHandler.bind(this), !this.isRTE);
161
+ this.keydownHandler = this.keyDownHandler.bind(this);
162
+ this.inputElement.addEventListener('keydown', this.keydownHandler, !this.isRTE);
158
163
  }
159
164
  };
160
165
  /**
@@ -343,8 +348,9 @@ var Mention = /** @class */ (function (_super) {
343
348
  return !isNullOrUndefined(element);
344
349
  };
345
350
  Mention.prototype.unBindCommonEvent = function () {
346
- if (!Browser.isDevice) {
347
- this.inputElement.removeEventListener('keydown', this.keyDownHandler.bind(this), !this.isRTE);
351
+ if (!Browser.isDevice && this.keydownHandler) {
352
+ this.inputElement.removeEventListener('keydown', this.keydownHandler, !this.isRTE);
353
+ this.keydownHandler = null;
348
354
  }
349
355
  };
350
356
  Mention.prototype.onKeyUp = function (e) {
@@ -827,9 +833,11 @@ var Mention = /** @class */ (function (_super) {
827
833
  addClass([popupEle_1], 'e-rte-elements');
828
834
  }
829
835
  }
836
+ var appendToElement = _this.getAppendToElement();
837
+ _this.popupAppendTo = appendToElement;
830
838
  if ((!_this.popupObj || !document.body.contains(_this.popupObj.element)) ||
831
839
  !document.contains(popupEle_1) && isNullOrUndefined(_this.target)) {
832
- document.body.appendChild(popupEle_1);
840
+ appendToElement.appendChild(popupEle_1);
833
841
  }
834
842
  var coordinates_1;
835
843
  popupEle_1.style.visibility = 'hidden';
@@ -902,6 +910,19 @@ var Mention = /** @class */ (function (_super) {
902
910
  }
903
911
  });
904
912
  };
913
+ Mention.prototype.getAppendToElement = function () {
914
+ if (this.popupAppendTo) {
915
+ return this.popupAppendTo;
916
+ }
917
+ if (this.isAngular) {
918
+ var cdkPane = this.element && this.element.closest ? this.element.closest('.cdk-overlay-pane') : null;
919
+ var popoverEl = this.element && this.element.closest ? this.element.closest('[popover]') : null;
920
+ if (cdkPane && popoverEl) {
921
+ return cdkPane;
922
+ }
923
+ }
924
+ return document.body;
925
+ };
905
926
  Mention.prototype.setHeight = function (popupEle) {
906
927
  if (this.popupHeight !== 'auto' && this.list) {
907
928
  this.list.style.maxHeight = (parseInt(this.listHeight, 10) - 2).toString() + 'px'; // due to box-sizing property
@@ -75,6 +75,7 @@ export declare class MultiSelect extends DropDownBase implements IInput {
75
75
  private isFilterPrevented;
76
76
  private isFilteringAction;
77
77
  private headerTemplateHeight;
78
+ private resizeHandler;
78
79
  /**
79
80
  * The `fields` property maps the columns of the data table and binds the data to the component.
80
81
  * * text - Maps the text column from data table for each list item.
@@ -3577,7 +3577,8 @@ var MultiSelect = /** @class */ (function (_super) {
3577
3577
  };
3578
3578
  MultiSelect.prototype.wireEvent = function () {
3579
3579
  EventHandler.add(this.componentWrapper, 'mousedown', this.wrapperClick, this);
3580
- EventHandler.add(window, 'resize', this.windowResize, this);
3580
+ this.resizeHandler = this.windowResize.bind(this);
3581
+ window.addEventListener('resize', this.resizeHandler);
3581
3582
  EventHandler.add(this.inputElement, 'focus', this.focusInHandler, this);
3582
3583
  EventHandler.add(this.inputElement, 'keydown', this.onKeyDown, this);
3583
3584
  EventHandler.add(this.inputElement, 'keyup', this.keyUp, this);
@@ -4888,7 +4889,10 @@ var MultiSelect = /** @class */ (function (_super) {
4888
4889
  if (!isNullOrUndefined(this.componentWrapper)) {
4889
4890
  EventHandler.remove(this.componentWrapper, 'mousedown', this.wrapperClick);
4890
4891
  }
4891
- EventHandler.remove(window, 'resize', this.windowResize);
4892
+ if (this.resizeHandler) {
4893
+ window.removeEventListener('resize', this.resizeHandler);
4894
+ this.resizeHandler = null;
4895
+ }
4892
4896
  if (!isNullOrUndefined(this.inputElement)) {
4893
4897
  EventHandler.remove(this.inputElement, 'focus', this.focusInHandler);
4894
4898
  EventHandler.remove(this.inputElement, 'keydown', this.onKeyDown);