@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, Property, ChildProperty, selectAll, compile, L10n, addClass, removeClass, extend, append, setStyleAttribute, prepend, rippleEffect, detach, Complex, Event, NotifyPropertyChanges, Component, classList, closest, KeyboardEvents, attributes, isUndefined, formatUnit, Animation, getUniqueID, remove,
|
|
1
|
+
import { EventHandler, Touch, isNullOrUndefined, getValue, select, Browser, debounce, Property, ChildProperty, selectAll, compile, L10n, addClass, removeClass, extend, append, setStyleAttribute, prepend, rippleEffect, detach, Complex, Event, NotifyPropertyChanges, Component, 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';
|
|
@@ -416,7 +416,7 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
416
416
|
if (this.component === 'combobox') {
|
|
417
417
|
var totalData = 0;
|
|
418
418
|
if (this.parent.dataSource instanceof DataManager) {
|
|
419
|
-
totalData = this.parent.
|
|
419
|
+
totalData = this.parent.dataSource.dataSource.json.length;
|
|
420
420
|
}
|
|
421
421
|
else if (this.parent.dataSource && this.parent.dataSource.length > 0) {
|
|
422
422
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -3743,7 +3743,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3743
3743
|
EventHandler.add(this.inputWrapper.container, 'mousedown', this.dropDownClick, this);
|
|
3744
3744
|
EventHandler.add(this.inputWrapper.container, 'focus', this.focusIn, this);
|
|
3745
3745
|
EventHandler.add(this.inputWrapper.container, 'keypress', this.onSearch, this);
|
|
3746
|
-
|
|
3746
|
+
this.resizeHandler = this.windowResize.bind(this);
|
|
3747
|
+
window.addEventListener('resize', this.resizeHandler);
|
|
3747
3748
|
this.bindCommonEvent();
|
|
3748
3749
|
};
|
|
3749
3750
|
DropDownList.prototype.bindCommonEvent = function () {
|
|
@@ -4533,7 +4534,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4533
4534
|
EventHandler.remove(this.inputWrapper.container, 'mousedown', this.dropDownClick);
|
|
4534
4535
|
EventHandler.remove(this.inputWrapper.container, 'keypress', this.onSearch);
|
|
4535
4536
|
EventHandler.remove(this.inputWrapper.container, 'focus', this.focusIn);
|
|
4536
|
-
|
|
4537
|
+
if (this.resizeHandler) {
|
|
4538
|
+
window.removeEventListener('resize', this.resizeHandler);
|
|
4539
|
+
this.resizeHandler = null;
|
|
4540
|
+
}
|
|
4537
4541
|
}
|
|
4538
4542
|
this.unBindCommonEvent();
|
|
4539
4543
|
};
|
|
@@ -5800,7 +5804,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
5800
5804
|
_this.setFooterTemplate(popupEle_1);
|
|
5801
5805
|
_this.isUpdateFooterHeight = _this.footer.offsetHeight !== 0;
|
|
5802
5806
|
}
|
|
5803
|
-
|
|
5807
|
+
var appendToElement = _this.getAppendToElement();
|
|
5808
|
+
appendToElement.appendChild(popupEle_1);
|
|
5804
5809
|
popupEle_1.style.top = '0px';
|
|
5805
5810
|
initialPopupHeight = popupEle_1.clientHeight;
|
|
5806
5811
|
if (_this.enableVirtualization && (_this.itemTemplate || _this.isAngular)) {
|
|
@@ -6062,6 +6067,16 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
6062
6067
|
}
|
|
6063
6068
|
});
|
|
6064
6069
|
};
|
|
6070
|
+
DropDownList.prototype.getAppendToElement = function () {
|
|
6071
|
+
if (this.isAngular) {
|
|
6072
|
+
var cdkPane = this.element && this.element.closest ? this.element.closest('.cdk-overlay-pane') : null;
|
|
6073
|
+
var popoverEl = this.element && this.element.closest ? this.element.closest('[popover]') : null;
|
|
6074
|
+
if (cdkPane && popoverEl) {
|
|
6075
|
+
return cdkPane;
|
|
6076
|
+
}
|
|
6077
|
+
}
|
|
6078
|
+
return document.body;
|
|
6079
|
+
};
|
|
6065
6080
|
DropDownList.prototype.checkCollision = function (popupEle) {
|
|
6066
6081
|
if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'dropdownlist' || this.isDropDownClick))) {
|
|
6067
6082
|
var collision = isCollide(popupEle);
|
|
@@ -6834,7 +6849,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
6834
6849
|
var listParentHeight = formatUnit(this.popupHeight);
|
|
6835
6850
|
listParent.style.height = (parseInt(listParentHeight, 10)).toString() + 'px';
|
|
6836
6851
|
listParent.appendChild(item);
|
|
6837
|
-
|
|
6852
|
+
var appendToElement = this.getAppendToElement();
|
|
6853
|
+
appendToElement.appendChild(listParent);
|
|
6838
6854
|
this.virtualListHeight = listParent.getBoundingClientRect().height;
|
|
6839
6855
|
var listItemHeight = Math.ceil(item.getBoundingClientRect().height) +
|
|
6840
6856
|
parseInt(window.getComputedStyle(item).marginBottom, 10);
|
|
@@ -8922,12 +8938,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
8922
8938
|
temp = this.getOverflowVal(index);
|
|
8923
8939
|
data += temp;
|
|
8924
8940
|
temp = this.overFlowWrapper.innerHTML;
|
|
8925
|
-
|
|
8926
|
-
this.overFlowWrapper.innerText = SanitizeHtmlHelper.sanitize(data);
|
|
8927
|
-
}
|
|
8928
|
-
else {
|
|
8929
|
-
this.overFlowWrapper.innerHTML = data;
|
|
8930
|
-
}
|
|
8941
|
+
this.overFlowWrapper[this.getDomSetter()] = this.getSanitizedText(data);
|
|
8931
8942
|
wrapperleng = this.overFlowWrapper.offsetWidth;
|
|
8932
8943
|
overAllContainer = this.inputWrapper.offsetWidth;
|
|
8933
8944
|
if ((wrapperleng + downIconWidth + this.clearIconWidth) > overAllContainer) {
|
|
@@ -9507,6 +9518,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
9507
9518
|
dataBound: this.OnDataBound.bind(this),
|
|
9508
9519
|
allowMultiSelection: this.allowMultiSelection,
|
|
9509
9520
|
enableHtmlSanitizer: this.enableHtmlSanitizer,
|
|
9521
|
+
disableHtmlEncode: this.disableHtmlEncode,
|
|
9510
9522
|
showCheckBox: this.showCheckBox,
|
|
9511
9523
|
autoCheck: this.treeSettings.autoCheck,
|
|
9512
9524
|
sortOrder: this.sortOrder,
|
|
@@ -10493,12 +10505,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
10493
10505
|
});
|
|
10494
10506
|
var chipContent = this.createElement('span', { className: CHIP_CONTENT });
|
|
10495
10507
|
var chipClose = this.createElement('span', { className: CHIP_CLOSE + ' ' + ICONS });
|
|
10496
|
-
|
|
10497
|
-
chipContent.innerText = SanitizeHtmlHelper.sanitize(text);
|
|
10498
|
-
}
|
|
10499
|
-
else {
|
|
10500
|
-
chipContent.innerHTML = text;
|
|
10501
|
-
}
|
|
10508
|
+
chipContent[this.getDomSetter()] = this.getSanitizedText(text);
|
|
10502
10509
|
chip.appendChild(chipContent);
|
|
10503
10510
|
this.chipCollection.appendChild(chip);
|
|
10504
10511
|
if (this.showClearButton) {
|
|
@@ -10937,6 +10944,12 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
10937
10944
|
this.hiddenElement.removeAttribute('multiple');
|
|
10938
10945
|
}
|
|
10939
10946
|
};
|
|
10947
|
+
DropDownTree.prototype.getDomSetter = function () {
|
|
10948
|
+
return this.disableHtmlEncode ? 'textContent' : 'innerHTML';
|
|
10949
|
+
};
|
|
10950
|
+
DropDownTree.prototype.getSanitizedText = function (text) {
|
|
10951
|
+
return this.enableHtmlSanitizer ? SanitizeHtmlHelper.sanitize(text) : text;
|
|
10952
|
+
};
|
|
10940
10953
|
/**
|
|
10941
10954
|
* Dynamically change the value of properties.
|
|
10942
10955
|
*
|
|
@@ -11406,6 +11419,9 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
11406
11419
|
__decorate$2([
|
|
11407
11420
|
Property(true)
|
|
11408
11421
|
], DropDownTree.prototype, "enableHtmlSanitizer", void 0);
|
|
11422
|
+
__decorate$2([
|
|
11423
|
+
Property(true)
|
|
11424
|
+
], DropDownTree.prototype, "disableHtmlEncode", void 0);
|
|
11409
11425
|
__decorate$2([
|
|
11410
11426
|
Property(true)
|
|
11411
11427
|
], DropDownTree.prototype, "showClearButton", void 0);
|
|
@@ -16868,7 +16884,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
16868
16884
|
};
|
|
16869
16885
|
MultiSelect.prototype.wireEvent = function () {
|
|
16870
16886
|
EventHandler.add(this.componentWrapper, 'mousedown', this.wrapperClick, this);
|
|
16871
|
-
|
|
16887
|
+
this.resizeHandler = this.windowResize.bind(this);
|
|
16888
|
+
window.addEventListener('resize', this.resizeHandler);
|
|
16872
16889
|
EventHandler.add(this.inputElement, 'focus', this.focusInHandler, this);
|
|
16873
16890
|
EventHandler.add(this.inputElement, 'keydown', this.onKeyDown, this);
|
|
16874
16891
|
EventHandler.add(this.inputElement, 'keyup', this.keyUp, this);
|
|
@@ -18179,7 +18196,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
18179
18196
|
if (!isNullOrUndefined(this.componentWrapper)) {
|
|
18180
18197
|
EventHandler.remove(this.componentWrapper, 'mousedown', this.wrapperClick);
|
|
18181
18198
|
}
|
|
18182
|
-
|
|
18199
|
+
if (this.resizeHandler) {
|
|
18200
|
+
window.removeEventListener('resize', this.resizeHandler);
|
|
18201
|
+
this.resizeHandler = null;
|
|
18202
|
+
}
|
|
18183
18203
|
if (!isNullOrUndefined(this.inputElement)) {
|
|
18184
18204
|
EventHandler.remove(this.inputElement, 'focus', this.focusInHandler);
|
|
18185
18205
|
EventHandler.remove(this.inputElement, 'keydown', this.onKeyDown);
|
|
@@ -21936,7 +21956,8 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
21936
21956
|
if (form) {
|
|
21937
21957
|
EventHandler.add(form, 'reset', this.formResetHandler, this);
|
|
21938
21958
|
}
|
|
21939
|
-
|
|
21959
|
+
this.boundResizeHandler = this.resizeHandler.bind(this);
|
|
21960
|
+
window.addEventListener('resize', this.boundResizeHandler);
|
|
21940
21961
|
};
|
|
21941
21962
|
ListBox.prototype.wireToolbarEvent = function () {
|
|
21942
21963
|
if (this.toolbarSettings.items.length) {
|
|
@@ -21958,7 +21979,10 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
21958
21979
|
if (form) {
|
|
21959
21980
|
EventHandler.remove(form, 'reset', this.formResetHandler);
|
|
21960
21981
|
}
|
|
21961
|
-
|
|
21982
|
+
if (this.boundResizeHandler) {
|
|
21983
|
+
window.removeEventListener('resize', this.boundResizeHandler);
|
|
21984
|
+
this.boundResizeHandler = null;
|
|
21985
|
+
}
|
|
21962
21986
|
};
|
|
21963
21987
|
ListBox.prototype.clickHandler = function (e) {
|
|
21964
21988
|
var li = closest(e.target, '.' + 'e-list-item');
|
|
@@ -23578,16 +23602,21 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
23578
23602
|
this.wireEvent();
|
|
23579
23603
|
};
|
|
23580
23604
|
Mention.prototype.wireEvent = function () {
|
|
23581
|
-
|
|
23605
|
+
this.keyupHandler = this.onKeyUp.bind(this);
|
|
23606
|
+
EventHandler.add(this.inputElement, 'keyup', this.keyupHandler, this);
|
|
23582
23607
|
this.bindCommonEvent();
|
|
23583
23608
|
};
|
|
23584
23609
|
Mention.prototype.unWireEvent = function () {
|
|
23585
|
-
|
|
23610
|
+
if (this.keyupHandler) {
|
|
23611
|
+
EventHandler.remove(this.inputElement, 'keyup', this.keyupHandler);
|
|
23612
|
+
this.keyupHandler = null;
|
|
23613
|
+
}
|
|
23586
23614
|
this.unBindCommonEvent();
|
|
23587
23615
|
};
|
|
23588
23616
|
Mention.prototype.bindCommonEvent = function () {
|
|
23589
23617
|
if (!Browser.isDevice) {
|
|
23590
|
-
this.
|
|
23618
|
+
this.keydownHandler = this.keyDownHandler.bind(this);
|
|
23619
|
+
this.inputElement.addEventListener('keydown', this.keydownHandler, !this.isRTE);
|
|
23591
23620
|
}
|
|
23592
23621
|
};
|
|
23593
23622
|
/**
|
|
@@ -23776,8 +23805,9 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
23776
23805
|
return !isNullOrUndefined(element);
|
|
23777
23806
|
};
|
|
23778
23807
|
Mention.prototype.unBindCommonEvent = function () {
|
|
23779
|
-
if (!Browser.isDevice) {
|
|
23780
|
-
this.inputElement.removeEventListener('keydown', this.
|
|
23808
|
+
if (!Browser.isDevice && this.keydownHandler) {
|
|
23809
|
+
this.inputElement.removeEventListener('keydown', this.keydownHandler, !this.isRTE);
|
|
23810
|
+
this.keydownHandler = null;
|
|
23781
23811
|
}
|
|
23782
23812
|
};
|
|
23783
23813
|
Mention.prototype.onKeyUp = function (e) {
|
|
@@ -24260,9 +24290,11 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
24260
24290
|
addClass([popupEle_1], 'e-rte-elements');
|
|
24261
24291
|
}
|
|
24262
24292
|
}
|
|
24293
|
+
var appendToElement = _this.getAppendToElement();
|
|
24294
|
+
_this.popupAppendTo = appendToElement;
|
|
24263
24295
|
if ((!_this.popupObj || !document.body.contains(_this.popupObj.element)) ||
|
|
24264
24296
|
!document.contains(popupEle_1) && isNullOrUndefined(_this.target)) {
|
|
24265
|
-
|
|
24297
|
+
appendToElement.appendChild(popupEle_1);
|
|
24266
24298
|
}
|
|
24267
24299
|
var coordinates_1;
|
|
24268
24300
|
popupEle_1.style.visibility = 'hidden';
|
|
@@ -24335,6 +24367,19 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
24335
24367
|
}
|
|
24336
24368
|
});
|
|
24337
24369
|
};
|
|
24370
|
+
Mention.prototype.getAppendToElement = function () {
|
|
24371
|
+
if (this.popupAppendTo) {
|
|
24372
|
+
return this.popupAppendTo;
|
|
24373
|
+
}
|
|
24374
|
+
if (this.isAngular) {
|
|
24375
|
+
var cdkPane = this.element && this.element.closest ? this.element.closest('.cdk-overlay-pane') : null;
|
|
24376
|
+
var popoverEl = this.element && this.element.closest ? this.element.closest('[popover]') : null;
|
|
24377
|
+
if (cdkPane && popoverEl) {
|
|
24378
|
+
return cdkPane;
|
|
24379
|
+
}
|
|
24380
|
+
}
|
|
24381
|
+
return document.body;
|
|
24382
|
+
};
|
|
24338
24383
|
Mention.prototype.setHeight = function (popupEle) {
|
|
24339
24384
|
if (this.popupHeight !== 'auto' && this.list) {
|
|
24340
24385
|
this.list.style.maxHeight = (parseInt(this.listHeight, 10) - 2).toString() + 'px'; // due to box-sizing property
|