@syncfusion/ej2-dropdowns 23.1.40 → 23.1.42
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/CHANGELOG.md +34 -0
- 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 +77 -12
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +77 -12
- 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 +9 -9
- package/src/drop-down-base/drop-down-base.d.ts +1 -0
- package/src/drop-down-base/drop-down-base.js +5 -0
- package/src/drop-down-list/drop-down-list.d.ts +3 -0
- package/src/drop-down-list/drop-down-list.js +33 -2
- package/src/drop-down-tree/drop-down-tree.js +2 -2
- package/src/mention/mention.d.ts +1 -0
- package/src/mention/mention.js +32 -8
- package/src/multi-select/multi-select.js +5 -0
- package/styles/auto-complete/bootstrap4.css +13 -2
- package/styles/bootstrap-dark.css +1 -1
- package/styles/bootstrap.css +1 -1
- package/styles/bootstrap4.css +33 -3
- package/styles/bootstrap5-dark.css +1 -1
- package/styles/bootstrap5.css +1 -1
- package/styles/combo-box/bootstrap4.css +13 -2
- package/styles/drop-down-list/_bootstrap4-definition.scss +13 -2
- package/styles/drop-down-list/bootstrap4.css +13 -2
- package/styles/fabric-dark.css +1 -1
- package/styles/fabric.css +1 -1
- package/styles/fluent-dark.css +1 -1
- package/styles/fluent.css +1 -1
- package/styles/highcontrast-light.css +1 -1
- package/styles/highcontrast.css +1 -1
- package/styles/list-box/_theme.scss +1 -1
- package/styles/list-box/bootstrap-dark.css +1 -1
- package/styles/list-box/bootstrap.css +1 -1
- package/styles/list-box/bootstrap4.css +1 -1
- package/styles/list-box/bootstrap5-dark.css +1 -1
- package/styles/list-box/bootstrap5.css +1 -1
- package/styles/list-box/fabric-dark.css +1 -1
- package/styles/list-box/fabric.css +1 -1
- package/styles/list-box/fluent-dark.css +1 -1
- package/styles/list-box/fluent.css +1 -1
- package/styles/list-box/highcontrast-light.css +1 -1
- package/styles/list-box/highcontrast.css +1 -1
- package/styles/list-box/material-dark.css +1 -1
- package/styles/list-box/material.css +1 -1
- package/styles/list-box/material3-dark.css +1 -1
- package/styles/list-box/material3.css +1 -1
- package/styles/list-box/tailwind-dark.css +1 -1
- package/styles/list-box/tailwind.css +1 -1
- package/styles/material-dark.css +1 -1
- package/styles/material.css +1 -1
- package/styles/material3-dark.css +1 -1
- package/styles/material3.css +1 -1
- package/styles/multi-select/_bootstrap4-definition.scss +19 -0
- package/styles/multi-select/bootstrap4.css +19 -0
- package/styles/tailwind-dark.css +1 -1
- package/styles/tailwind.css +1 -1
|
@@ -1697,6 +1697,11 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1697
1697
|
this.initialize(e);
|
|
1698
1698
|
}
|
|
1699
1699
|
};
|
|
1700
|
+
DropDownBase.prototype.removeScrollEvent = function () {
|
|
1701
|
+
if (this.list) {
|
|
1702
|
+
EventHandler.remove(this.list, 'scroll', this.setFloatingHeader);
|
|
1703
|
+
}
|
|
1704
|
+
};
|
|
1700
1705
|
/**
|
|
1701
1706
|
* Return the module name of this component.
|
|
1702
1707
|
*
|
|
@@ -2094,6 +2099,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2094
2099
|
_this.pageCount = 0;
|
|
2095
2100
|
_this.isPreventKeyAction = false;
|
|
2096
2101
|
_this.generatedDataObject = {};
|
|
2102
|
+
_this.isTouched = false;
|
|
2097
2103
|
_this.virtualListInfo = {
|
|
2098
2104
|
currentPageNumber: null,
|
|
2099
2105
|
direction: null,
|
|
@@ -3863,7 +3869,12 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3863
3869
|
this.updateActionCompleteDataValues(ulElement, list);
|
|
3864
3870
|
}
|
|
3865
3871
|
}
|
|
3866
|
-
|
|
3872
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3873
|
+
if ((this.allowCustom || (this.allowFiltering && !this.isValueInList(list, this.value) && this.dataSource instanceof DataManager)) && !this.enableVirtualization) {
|
|
3874
|
+
this.addNewItem(list, selectedItem);
|
|
3875
|
+
}
|
|
3876
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3877
|
+
else if ((this.allowCustom || (this.allowFiltering && this.isValueInList(list, this.value))) && !this.enableVirtualization) {
|
|
3867
3878
|
this.addNewItem(list, selectedItem);
|
|
3868
3879
|
}
|
|
3869
3880
|
if (!isNullOrUndefined(this.itemData) || (isNullOrUndefined(this.itemData) && this.enableVirtualization)) {
|
|
@@ -3897,6 +3908,24 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3897
3908
|
}
|
|
3898
3909
|
};
|
|
3899
3910
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3911
|
+
DropDownList.prototype.isValueInList = function (list, valueToFind) {
|
|
3912
|
+
if (Array.isArray(list)) {
|
|
3913
|
+
for (var i = 0; i < list.length; i++) {
|
|
3914
|
+
if (list[i] === valueToFind) {
|
|
3915
|
+
return true;
|
|
3916
|
+
}
|
|
3917
|
+
}
|
|
3918
|
+
}
|
|
3919
|
+
else if (typeof list === 'object' && list !== null) {
|
|
3920
|
+
for (var key in list) {
|
|
3921
|
+
if (Object.prototype.hasOwnProperty.call(list, key) && list[key] === valueToFind) {
|
|
3922
|
+
return true;
|
|
3923
|
+
}
|
|
3924
|
+
}
|
|
3925
|
+
}
|
|
3926
|
+
return false;
|
|
3927
|
+
};
|
|
3928
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3900
3929
|
DropDownList.prototype.checkFieldValue = function (list, fieldValue) {
|
|
3901
3930
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3902
3931
|
var checkField = list;
|
|
@@ -4661,6 +4690,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4661
4690
|
* @returns {void}
|
|
4662
4691
|
*/
|
|
4663
4692
|
DropDownList.prototype.render = function () {
|
|
4693
|
+
this.preselectedIndex = !isNullOrUndefined(this.index) ? this.index : null;
|
|
4664
4694
|
if (this.element.tagName === 'INPUT') {
|
|
4665
4695
|
this.inputElement = this.element;
|
|
4666
4696
|
if (isNullOrUndefined(this.inputElement.getAttribute('role'))) {
|
|
@@ -4898,7 +4928,6 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4898
4928
|
if (this.allowFiltering && newProp.dataSource && !isNullOrUndefined(Object.keys(newProp.dataSource))) {
|
|
4899
4929
|
this.actionCompleteData = { ulElement: null, list: null, isUpdated: false };
|
|
4900
4930
|
this.actionData = this.actionCompleteData;
|
|
4901
|
-
this.itemData = null;
|
|
4902
4931
|
}
|
|
4903
4932
|
else if (this.allowFiltering && newProp.query && !isNullOrUndefined(Object.keys(newProp.query))) {
|
|
4904
4933
|
this.actionCompleteData = this.getModuleName() === 'combobox' ?
|
|
@@ -4944,6 +4973,13 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4944
4973
|
*/
|
|
4945
4974
|
DropDownList.prototype.onPropertyChanged = function (newProp, oldProp) {
|
|
4946
4975
|
var _this = this;
|
|
4976
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4977
|
+
if (!isNullOrUndefined(newProp.dataSource) && !this.isTouched && (isNullOrUndefined(newProp.value) && isNullOrUndefined(newProp.index)) && !isNullOrUndefined(this.preselectedIndex)) {
|
|
4978
|
+
newProp.index = this.preselectedIndex;
|
|
4979
|
+
}
|
|
4980
|
+
if (!isNullOrUndefined(newProp.value) || !isNullOrUndefined(newProp.index)) {
|
|
4981
|
+
this.isTouched = true;
|
|
4982
|
+
}
|
|
4947
4983
|
if (this.getModuleName() === 'dropdownlist') {
|
|
4948
4984
|
this.checkData(newProp);
|
|
4949
4985
|
this.setUpdateInitial(['fields', 'query', 'dataSource'], newProp);
|
|
@@ -7524,12 +7560,12 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
7524
7560
|
var nodes = this.treeObj.element.querySelectorAll('li');
|
|
7525
7561
|
var checkedNodes = this.treeObj.element.querySelectorAll('li .e-checkbox-wrapper[aria-checked=true]');
|
|
7526
7562
|
var wrap = closest(this.checkBoxElement, '.' + CHECKBOXWRAP);
|
|
7527
|
-
if (wrap && args.action === 'uncheck' && (args.isInteracted || checkedNodes.length === 0)) {
|
|
7563
|
+
if (wrap && args.action === 'uncheck' && (args.isInteracted || checkedNodes.length === 0 || args.data[0].isChecked == "false")) {
|
|
7528
7564
|
this.isReverseUpdate = true;
|
|
7529
7565
|
this.changeState(wrap, 'uncheck');
|
|
7530
7566
|
this.isReverseUpdate = false;
|
|
7531
7567
|
}
|
|
7532
|
-
else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length && (args.isInteracted || this.isCheckAllCalled)) {
|
|
7568
|
+
else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length && (args.isInteracted || this.isCheckAllCalled || args.data[0].isChecked == "true")) {
|
|
7533
7569
|
this.isReverseUpdate = true;
|
|
7534
7570
|
this.isCheckAllCalled = false;
|
|
7535
7571
|
this.changeState(wrap, 'check');
|
|
@@ -13956,6 +13992,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
13956
13992
|
}
|
|
13957
13993
|
this.updateSelectElementData(this.allowFiltering);
|
|
13958
13994
|
break;
|
|
13995
|
+
case 'fields':
|
|
13996
|
+
if (isNullOrUndefined(this.fields.groupBy)) {
|
|
13997
|
+
this.removeScrollEvent();
|
|
13998
|
+
}
|
|
13999
|
+
break;
|
|
13959
14000
|
default:
|
|
13960
14001
|
{
|
|
13961
14002
|
// eslint-disable-next-line max-len
|
|
@@ -18292,6 +18333,8 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
18292
18333
|
_this.initializePopup(popupEle_1, offsetValue, left);
|
|
18293
18334
|
_this.checkCollision(popupEle_1);
|
|
18294
18335
|
popupEle_1.style.visibility = 'visible';
|
|
18336
|
+
var popupLeft_1 = popupEle_1.parentElement.offsetWidth - popupEle_1.offsetWidth;
|
|
18337
|
+
var popupHeight_1 = popupEle_1.offsetHeight;
|
|
18295
18338
|
addClass([popupEle_1], ['e-mention', 'e-popup', 'e-popup-close']);
|
|
18296
18339
|
if (!isNullOrUndefined(_this.list)) {
|
|
18297
18340
|
_this.unWireListEvents();
|
|
@@ -18320,9 +18363,23 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
18320
18363
|
popupEle_1.style.cssText = 'top: '.concat(coordinates_1.top.toString(), 'px;\n left: ').concat(coordinates_1.left.toString(), 'px;\nposition: absolute;\n display: block;');
|
|
18321
18364
|
}
|
|
18322
18365
|
else {
|
|
18323
|
-
|
|
18324
|
-
|
|
18366
|
+
if (_this.collision.length > 0 && _this.collision.indexOf('right') > -1 && _this.collision.indexOf('bottom') === -1) {
|
|
18367
|
+
popupEle_1.style.cssText = 'top: '.concat(coordinates_1.top.toString(), 'px;\n left: ').concat(popupLeft_1.toString(), 'px;\nposition: absolute;\n display: block;');
|
|
18368
|
+
}
|
|
18369
|
+
else if (_this.collision && _this.collision.length > 0 && _this.collision.indexOf('bottom') > -1 && _this.collision.indexOf('right') === -1) {
|
|
18370
|
+
popupEle_1.style.left = formatUnit(coordinates_1.left);
|
|
18371
|
+
popupEle_1.style.top = formatUnit(coordinates_1.top - parseInt(popupHeight_1.toString()));
|
|
18372
|
+
}
|
|
18373
|
+
else if (_this.collision && _this.collision.length > 0 && _this.collision.indexOf('bottom') > -1 && _this.collision.indexOf('right') > -1) {
|
|
18374
|
+
popupEle_1.style.left = formatUnit(popupLeft_1);
|
|
18375
|
+
popupEle_1.style.top = formatUnit(coordinates_1.top - parseInt(popupHeight_1.toString()));
|
|
18376
|
+
}
|
|
18377
|
+
else {
|
|
18378
|
+
popupEle_1.style.left = formatUnit(coordinates_1.left);
|
|
18379
|
+
popupEle_1.style.top = formatUnit(coordinates_1.top - parseInt(_this.popupHeight.toString()));
|
|
18380
|
+
}
|
|
18325
18381
|
_this.isCollided = false;
|
|
18382
|
+
_this.collision = [];
|
|
18326
18383
|
}
|
|
18327
18384
|
popupEle_1.style.width = _this.popupWidth !== '100%' && !isNullOrUndefined(_this.popupWidth) ? formatUnit(_this.popupWidth) : 'auto';
|
|
18328
18385
|
_this.setHeight(popupEle_1);
|
|
@@ -18351,8 +18408,8 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
18351
18408
|
Mention.prototype.checkCollision = function (popupEle) {
|
|
18352
18409
|
if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'mention'))) {
|
|
18353
18410
|
var coordinates = this.getCoordinates(this.inputElement, this.getTriggerCharPosition());
|
|
18354
|
-
|
|
18355
|
-
if (collision.length > 0) {
|
|
18411
|
+
this.collision = isCollide(popupEle, null, coordinates.left, coordinates.top);
|
|
18412
|
+
if (this.collision.length > 0) {
|
|
18356
18413
|
popupEle.style.marginTop = -parseInt(getComputedStyle(popupEle).marginTop, 10) + 'px';
|
|
18357
18414
|
this.isCollided = true;
|
|
18358
18415
|
}
|
|
@@ -18487,10 +18544,18 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
18487
18544
|
document.body.removeChild(div);
|
|
18488
18545
|
}
|
|
18489
18546
|
else {
|
|
18490
|
-
|
|
18491
|
-
|
|
18492
|
-
|
|
18493
|
-
|
|
18547
|
+
if (this.collision && this.collision.length > 0 && this.collision.indexOf('right') > -1 && this.collision.indexOf('bottom') === -1) {
|
|
18548
|
+
coordinates = {
|
|
18549
|
+
top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10),
|
|
18550
|
+
left: rect.left + windowLeft + width
|
|
18551
|
+
};
|
|
18552
|
+
}
|
|
18553
|
+
else {
|
|
18554
|
+
coordinates = {
|
|
18555
|
+
top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10) - (this.isCollided ? 10 : 0),
|
|
18556
|
+
left: rect.left + windowLeft + width
|
|
18557
|
+
};
|
|
18558
|
+
}
|
|
18494
18559
|
}
|
|
18495
18560
|
return coordinates;
|
|
18496
18561
|
};
|