@syncfusion/ej2-dropdowns 32.2.6 → 32.2.8
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.
- package/dist/ej2-dropdowns.min.js +2 -2
- package/dist/ej2-dropdowns.umd.min.js +2 -2
- package/dist/ej2-dropdowns.umd.min.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es2015.js +73 -28
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +73 -28
- package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
- package/dist/global/ej2-dropdowns.min.js +2 -2
- package/dist/global/ej2-dropdowns.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +5 -5
- package/src/common/virtual-scroll.js +1 -1
- package/src/drop-down-list/drop-down-list.d.ts +2 -0
- package/src/drop-down-list/drop-down-list.js +20 -4
- package/src/drop-down-tree/drop-down-tree-model.d.ts +13 -0
- package/src/drop-down-tree/drop-down-tree.d.ts +14 -0
- package/src/drop-down-tree/drop-down-tree.js +12 -12
- package/src/list-box/list-box.d.ts +1 -0
- package/src/list-box/list-box.js +6 -2
- package/src/mention/mention.d.ts +4 -0
- package/src/mention/mention.js +27 -6
- package/src/multi-select/multi-select.d.ts +1 -0
- package/src/multi-select/multi-select.js +6 -2
- package/styles/drop-down-base/material3-dark.css +0 -6
- package/styles/drop-down-base/material3.css +0 -6
- package/styles/drop-down-list/material3-dark.css +0 -1
- package/styles/drop-down-list/material3.css +0 -1
- package/styles/drop-down-tree/material3-dark.css +0 -2
- package/styles/drop-down-tree/material3.css +0 -2
- package/styles/material3-dark-lite.css +0 -9
- package/styles/material3-dark.css +0 -9
- package/styles/material3-lite.css +0 -9
- package/styles/material3.css +0 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventHandler, Touch, isNullOrUndefined, getValue, select, Browser, debounce, ChildProperty, Property, Component, selectAll, compile, L10n, addClass, removeClass, extend, append, setStyleAttribute, prepend, rippleEffect, detach, Complex, Event, NotifyPropertyChanges, classList, closest, KeyboardEvents, attributes, isUndefined, formatUnit, Animation, getUniqueID, remove,
|
|
1
|
+
import { EventHandler, Touch, isNullOrUndefined, getValue, select, Browser, debounce, ChildProperty, Property, Component, selectAll, compile, L10n, addClass, removeClass, extend, append, setStyleAttribute, prepend, rippleEffect, detach, Complex, Event, NotifyPropertyChanges, classList, closest, KeyboardEvents, attributes, isUndefined, formatUnit, Animation, getUniqueID, remove, setValue, matches as matches$1, SanitizeHtmlHelper, createElement, getComponent } from '@syncfusion/ej2-base';
|
|
2
2
|
import { DataManager, Query, DataUtil, Predicate, JsonAdaptor } from '@syncfusion/ej2-data';
|
|
3
3
|
import { ListBase, Sortable, cssClass, moveTo } from '@syncfusion/ej2-lists';
|
|
4
4
|
import { Skeleton } from '@syncfusion/ej2-notifications';
|
|
@@ -368,7 +368,7 @@ class VirtualScroll {
|
|
|
368
368
|
if (this.component === 'combobox') {
|
|
369
369
|
let totalData = 0;
|
|
370
370
|
if (this.parent.dataSource instanceof DataManager) {
|
|
371
|
-
totalData = this.parent.
|
|
371
|
+
totalData = this.parent.dataSource.dataSource.json.length;
|
|
372
372
|
}
|
|
373
373
|
else if (this.parent.dataSource && this.parent.dataSource.length > 0) {
|
|
374
374
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -3634,7 +3634,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3634
3634
|
EventHandler.add(this.inputWrapper.container, 'mousedown', this.dropDownClick, this);
|
|
3635
3635
|
EventHandler.add(this.inputWrapper.container, 'focus', this.focusIn, this);
|
|
3636
3636
|
EventHandler.add(this.inputWrapper.container, 'keypress', this.onSearch, this);
|
|
3637
|
-
|
|
3637
|
+
this.resizeHandler = this.windowResize.bind(this);
|
|
3638
|
+
window.addEventListener('resize', this.resizeHandler);
|
|
3638
3639
|
this.bindCommonEvent();
|
|
3639
3640
|
}
|
|
3640
3641
|
bindCommonEvent() {
|
|
@@ -4424,7 +4425,10 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4424
4425
|
EventHandler.remove(this.inputWrapper.container, 'mousedown', this.dropDownClick);
|
|
4425
4426
|
EventHandler.remove(this.inputWrapper.container, 'keypress', this.onSearch);
|
|
4426
4427
|
EventHandler.remove(this.inputWrapper.container, 'focus', this.focusIn);
|
|
4427
|
-
|
|
4428
|
+
if (this.resizeHandler) {
|
|
4429
|
+
window.removeEventListener('resize', this.resizeHandler);
|
|
4430
|
+
this.resizeHandler = null;
|
|
4431
|
+
}
|
|
4428
4432
|
}
|
|
4429
4433
|
this.unBindCommonEvent();
|
|
4430
4434
|
}
|
|
@@ -5675,7 +5679,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5675
5679
|
this.setFooterTemplate(popupEle);
|
|
5676
5680
|
this.isUpdateFooterHeight = this.footer.offsetHeight !== 0;
|
|
5677
5681
|
}
|
|
5678
|
-
|
|
5682
|
+
const appendToElement = this.getAppendToElement();
|
|
5683
|
+
appendToElement.appendChild(popupEle);
|
|
5679
5684
|
popupEle.style.top = '0px';
|
|
5680
5685
|
initialPopupHeight = popupEle.clientHeight;
|
|
5681
5686
|
if (this.enableVirtualization && (this.itemTemplate || this.isAngular)) {
|
|
@@ -5936,6 +5941,16 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5936
5941
|
}
|
|
5937
5942
|
});
|
|
5938
5943
|
}
|
|
5944
|
+
getAppendToElement() {
|
|
5945
|
+
if (this.isAngular) {
|
|
5946
|
+
const cdkPane = this.element && this.element.closest ? this.element.closest('.cdk-overlay-pane') : null;
|
|
5947
|
+
const popoverEl = this.element && this.element.closest ? this.element.closest('[popover]') : null;
|
|
5948
|
+
if (cdkPane && popoverEl) {
|
|
5949
|
+
return cdkPane;
|
|
5950
|
+
}
|
|
5951
|
+
}
|
|
5952
|
+
return document.body;
|
|
5953
|
+
}
|
|
5939
5954
|
checkCollision(popupEle) {
|
|
5940
5955
|
if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'dropdownlist' || this.isDropDownClick))) {
|
|
5941
5956
|
const collision = isCollide(popupEle);
|
|
@@ -6701,7 +6716,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6701
6716
|
const listParentHeight = formatUnit(this.popupHeight);
|
|
6702
6717
|
listParent.style.height = (parseInt(listParentHeight, 10)).toString() + 'px';
|
|
6703
6718
|
listParent.appendChild(item);
|
|
6704
|
-
|
|
6719
|
+
const appendToElement = this.getAppendToElement();
|
|
6720
|
+
appendToElement.appendChild(listParent);
|
|
6705
6721
|
this.virtualListHeight = listParent.getBoundingClientRect().height;
|
|
6706
6722
|
const listItemHeight = Math.ceil(item.getBoundingClientRect().height) +
|
|
6707
6723
|
parseInt(window.getComputedStyle(item).marginBottom, 10);
|
|
@@ -8743,12 +8759,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
8743
8759
|
temp = this.getOverflowVal(index);
|
|
8744
8760
|
data += temp;
|
|
8745
8761
|
temp = this.overFlowWrapper.innerHTML;
|
|
8746
|
-
|
|
8747
|
-
this.overFlowWrapper.innerText = SanitizeHtmlHelper.sanitize(data);
|
|
8748
|
-
}
|
|
8749
|
-
else {
|
|
8750
|
-
this.overFlowWrapper.innerHTML = data;
|
|
8751
|
-
}
|
|
8762
|
+
this.overFlowWrapper[this.getDomSetter()] = this.getSanitizedText(data);
|
|
8752
8763
|
wrapperleng = this.overFlowWrapper.offsetWidth;
|
|
8753
8764
|
overAllContainer = this.inputWrapper.offsetWidth;
|
|
8754
8765
|
if ((wrapperleng + downIconWidth + this.clearIconWidth) > overAllContainer) {
|
|
@@ -9321,6 +9332,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
9321
9332
|
dataBound: this.OnDataBound.bind(this),
|
|
9322
9333
|
allowMultiSelection: this.allowMultiSelection,
|
|
9323
9334
|
enableHtmlSanitizer: this.enableHtmlSanitizer,
|
|
9335
|
+
disableHtmlEncode: this.disableHtmlEncode,
|
|
9324
9336
|
showCheckBox: this.showCheckBox,
|
|
9325
9337
|
autoCheck: this.treeSettings.autoCheck,
|
|
9326
9338
|
sortOrder: this.sortOrder,
|
|
@@ -10298,12 +10310,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
10298
10310
|
});
|
|
10299
10311
|
const chipContent = this.createElement('span', { className: CHIP_CONTENT });
|
|
10300
10312
|
const chipClose = this.createElement('span', { className: CHIP_CLOSE + ' ' + ICONS });
|
|
10301
|
-
|
|
10302
|
-
chipContent.innerText = SanitizeHtmlHelper.sanitize(text);
|
|
10303
|
-
}
|
|
10304
|
-
else {
|
|
10305
|
-
chipContent.innerHTML = text;
|
|
10306
|
-
}
|
|
10313
|
+
chipContent[this.getDomSetter()] = this.getSanitizedText(text);
|
|
10307
10314
|
chip.appendChild(chipContent);
|
|
10308
10315
|
this.chipCollection.appendChild(chip);
|
|
10309
10316
|
if (this.showClearButton) {
|
|
@@ -10742,6 +10749,12 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
10742
10749
|
this.hiddenElement.removeAttribute('multiple');
|
|
10743
10750
|
}
|
|
10744
10751
|
}
|
|
10752
|
+
getDomSetter() {
|
|
10753
|
+
return this.disableHtmlEncode ? 'textContent' : 'innerHTML';
|
|
10754
|
+
}
|
|
10755
|
+
getSanitizedText(text) {
|
|
10756
|
+
return this.enableHtmlSanitizer ? SanitizeHtmlHelper.sanitize(text) : text;
|
|
10757
|
+
}
|
|
10745
10758
|
/**
|
|
10746
10759
|
* Dynamically change the value of properties.
|
|
10747
10760
|
*
|
|
@@ -11209,6 +11222,9 @@ __decorate$2([
|
|
|
11209
11222
|
__decorate$2([
|
|
11210
11223
|
Property(true)
|
|
11211
11224
|
], DropDownTree.prototype, "enableHtmlSanitizer", void 0);
|
|
11225
|
+
__decorate$2([
|
|
11226
|
+
Property(true)
|
|
11227
|
+
], DropDownTree.prototype, "disableHtmlEncode", void 0);
|
|
11212
11228
|
__decorate$2([
|
|
11213
11229
|
Property(true)
|
|
11214
11230
|
], DropDownTree.prototype, "showClearButton", void 0);
|
|
@@ -16594,7 +16610,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16594
16610
|
}
|
|
16595
16611
|
wireEvent() {
|
|
16596
16612
|
EventHandler.add(this.componentWrapper, 'mousedown', this.wrapperClick, this);
|
|
16597
|
-
|
|
16613
|
+
this.resizeHandler = this.windowResize.bind(this);
|
|
16614
|
+
window.addEventListener('resize', this.resizeHandler);
|
|
16598
16615
|
EventHandler.add(this.inputElement, 'focus', this.focusInHandler, this);
|
|
16599
16616
|
EventHandler.add(this.inputElement, 'keydown', this.onKeyDown, this);
|
|
16600
16617
|
EventHandler.add(this.inputElement, 'keyup', this.keyUp, this);
|
|
@@ -17892,7 +17909,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
17892
17909
|
if (!isNullOrUndefined(this.componentWrapper)) {
|
|
17893
17910
|
EventHandler.remove(this.componentWrapper, 'mousedown', this.wrapperClick);
|
|
17894
17911
|
}
|
|
17895
|
-
|
|
17912
|
+
if (this.resizeHandler) {
|
|
17913
|
+
window.removeEventListener('resize', this.resizeHandler);
|
|
17914
|
+
this.resizeHandler = null;
|
|
17915
|
+
}
|
|
17896
17916
|
if (!isNullOrUndefined(this.inputElement)) {
|
|
17897
17917
|
EventHandler.remove(this.inputElement, 'focus', this.focusInHandler);
|
|
17898
17918
|
EventHandler.remove(this.inputElement, 'keydown', this.onKeyDown);
|
|
@@ -21586,7 +21606,8 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
21586
21606
|
if (form) {
|
|
21587
21607
|
EventHandler.add(form, 'reset', this.formResetHandler, this);
|
|
21588
21608
|
}
|
|
21589
|
-
|
|
21609
|
+
this.boundResizeHandler = this.resizeHandler.bind(this);
|
|
21610
|
+
window.addEventListener('resize', this.boundResizeHandler);
|
|
21590
21611
|
}
|
|
21591
21612
|
wireToolbarEvent() {
|
|
21592
21613
|
if (this.toolbarSettings.items.length) {
|
|
@@ -21608,7 +21629,10 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
21608
21629
|
if (form) {
|
|
21609
21630
|
EventHandler.remove(form, 'reset', this.formResetHandler);
|
|
21610
21631
|
}
|
|
21611
|
-
|
|
21632
|
+
if (this.boundResizeHandler) {
|
|
21633
|
+
window.removeEventListener('resize', this.boundResizeHandler);
|
|
21634
|
+
this.boundResizeHandler = null;
|
|
21635
|
+
}
|
|
21612
21636
|
}
|
|
21613
21637
|
clickHandler(e) {
|
|
21614
21638
|
const li = closest(e.target, '.' + 'e-list-item');
|
|
@@ -23191,16 +23215,21 @@ let Mention = class Mention extends DropDownBase {
|
|
|
23191
23215
|
this.wireEvent();
|
|
23192
23216
|
}
|
|
23193
23217
|
wireEvent() {
|
|
23194
|
-
|
|
23218
|
+
this.keyupHandler = this.onKeyUp.bind(this);
|
|
23219
|
+
EventHandler.add(this.inputElement, 'keyup', this.keyupHandler, this);
|
|
23195
23220
|
this.bindCommonEvent();
|
|
23196
23221
|
}
|
|
23197
23222
|
unWireEvent() {
|
|
23198
|
-
|
|
23223
|
+
if (this.keyupHandler) {
|
|
23224
|
+
EventHandler.remove(this.inputElement, 'keyup', this.keyupHandler);
|
|
23225
|
+
this.keyupHandler = null;
|
|
23226
|
+
}
|
|
23199
23227
|
this.unBindCommonEvent();
|
|
23200
23228
|
}
|
|
23201
23229
|
bindCommonEvent() {
|
|
23202
23230
|
if (!Browser.isDevice) {
|
|
23203
|
-
this.
|
|
23231
|
+
this.keydownHandler = this.keyDownHandler.bind(this);
|
|
23232
|
+
this.inputElement.addEventListener('keydown', this.keydownHandler, !this.isRTE);
|
|
23204
23233
|
}
|
|
23205
23234
|
}
|
|
23206
23235
|
/**
|
|
@@ -23389,8 +23418,9 @@ let Mention = class Mention extends DropDownBase {
|
|
|
23389
23418
|
return !isNullOrUndefined(element);
|
|
23390
23419
|
}
|
|
23391
23420
|
unBindCommonEvent() {
|
|
23392
|
-
if (!Browser.isDevice) {
|
|
23393
|
-
this.inputElement.removeEventListener('keydown', this.
|
|
23421
|
+
if (!Browser.isDevice && this.keydownHandler) {
|
|
23422
|
+
this.inputElement.removeEventListener('keydown', this.keydownHandler, !this.isRTE);
|
|
23423
|
+
this.keydownHandler = null;
|
|
23394
23424
|
}
|
|
23395
23425
|
}
|
|
23396
23426
|
onKeyUp(e) {
|
|
@@ -23867,9 +23897,11 @@ let Mention = class Mention extends DropDownBase {
|
|
|
23867
23897
|
addClass([popupEle], 'e-rte-elements');
|
|
23868
23898
|
}
|
|
23869
23899
|
}
|
|
23900
|
+
const appendToElement = this.getAppendToElement();
|
|
23901
|
+
this.popupAppendTo = appendToElement;
|
|
23870
23902
|
if ((!this.popupObj || !document.body.contains(this.popupObj.element)) ||
|
|
23871
23903
|
!document.contains(popupEle) && isNullOrUndefined(this.target)) {
|
|
23872
|
-
|
|
23904
|
+
appendToElement.appendChild(popupEle);
|
|
23873
23905
|
}
|
|
23874
23906
|
let coordinates;
|
|
23875
23907
|
popupEle.style.visibility = 'hidden';
|
|
@@ -23942,6 +23974,19 @@ let Mention = class Mention extends DropDownBase {
|
|
|
23942
23974
|
}
|
|
23943
23975
|
});
|
|
23944
23976
|
}
|
|
23977
|
+
getAppendToElement() {
|
|
23978
|
+
if (this.popupAppendTo) {
|
|
23979
|
+
return this.popupAppendTo;
|
|
23980
|
+
}
|
|
23981
|
+
if (this.isAngular) {
|
|
23982
|
+
const cdkPane = this.element && this.element.closest ? this.element.closest('.cdk-overlay-pane') : null;
|
|
23983
|
+
const popoverEl = this.element && this.element.closest ? this.element.closest('[popover]') : null;
|
|
23984
|
+
if (cdkPane && popoverEl) {
|
|
23985
|
+
return cdkPane;
|
|
23986
|
+
}
|
|
23987
|
+
}
|
|
23988
|
+
return document.body;
|
|
23989
|
+
}
|
|
23945
23990
|
setHeight(popupEle) {
|
|
23946
23991
|
if (this.popupHeight !== 'auto' && this.list) {
|
|
23947
23992
|
this.list.style.maxHeight = (parseInt(this.listHeight, 10) - 2).toString() + 'px'; // due to box-sizing property
|