@syncfusion/ej2-dropdowns 23.1.41 → 23.1.43
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 +29 -2
- 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 +90 -14
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +93 -17
- 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 +10 -10
- package/src/drop-down-base/drop-down-base.d.ts +7 -0
- package/src/drop-down-base/drop-down-base.js +17 -0
- package/src/drop-down-list/drop-down-list.js +35 -5
- package/src/drop-down-tree/drop-down-tree.js +3 -3
- package/src/mention/mention.d.ts +1 -0
- package/src/mention/mention.js +38 -9
|
@@ -1424,6 +1424,23 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1424
1424
|
}
|
|
1425
1425
|
return dataSource;
|
|
1426
1426
|
}
|
|
1427
|
+
/**
|
|
1428
|
+
* Return the index of item which matched with given value in data source
|
|
1429
|
+
*
|
|
1430
|
+
* @param {string | number | boolean} value - Specifies given value.
|
|
1431
|
+
* @returns {number} Returns the index of the item.
|
|
1432
|
+
*/
|
|
1433
|
+
getIndexByValueFilter(value) {
|
|
1434
|
+
let index;
|
|
1435
|
+
const listItems = this.renderItems(this.selectData, this.fields);
|
|
1436
|
+
for (let i = 0; i < listItems.children.length; i++) {
|
|
1437
|
+
if (!isNullOrUndefined(value) && listItems.children[i].getAttribute('data-value') === value.toString()) {
|
|
1438
|
+
index = i;
|
|
1439
|
+
break;
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
return index;
|
|
1443
|
+
}
|
|
1427
1444
|
/**
|
|
1428
1445
|
* Return the index of item which matched with given value in data source
|
|
1429
1446
|
*
|
|
@@ -2692,6 +2709,13 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2692
2709
|
}
|
|
2693
2710
|
}
|
|
2694
2711
|
updateUpDownAction(e, isVirtualKeyAction) {
|
|
2712
|
+
if (this.allowFiltering && !this.enableVirtualization && this.getModuleName() !== 'autocomplete') {
|
|
2713
|
+
let value = this.getItemData().value;
|
|
2714
|
+
let filterIndex = this.getIndexByValue(value);
|
|
2715
|
+
if (!isNullOrUndefined(filterIndex)) {
|
|
2716
|
+
this.activeIndex = filterIndex;
|
|
2717
|
+
}
|
|
2718
|
+
}
|
|
2695
2719
|
const focusEle = this.list.querySelector('.' + dropDownListClasses.focus);
|
|
2696
2720
|
if (this.isSelectFocusItem(focusEle) && !isVirtualKeyAction) {
|
|
2697
2721
|
this.setSelection(focusEle, e);
|
|
@@ -2736,6 +2760,13 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2736
2760
|
this.setSelection(nextItem, e);
|
|
2737
2761
|
}
|
|
2738
2762
|
}
|
|
2763
|
+
if (this.allowFiltering && !this.enableVirtualization && this.getModuleName() !== 'autocomplete') {
|
|
2764
|
+
let value = this.getItemData().value;
|
|
2765
|
+
let filterIndex = this.getIndexByValueFilter(value);
|
|
2766
|
+
if (!isNullOrUndefined(filterIndex)) {
|
|
2767
|
+
this.activeIndex = filterIndex;
|
|
2768
|
+
}
|
|
2769
|
+
}
|
|
2739
2770
|
e.preventDefault();
|
|
2740
2771
|
}
|
|
2741
2772
|
updateHomeEndAction(e, isVirtualKeyAction) {
|
|
@@ -3036,7 +3067,18 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3036
3067
|
if (isNullOrUndefined(value)) {
|
|
3037
3068
|
value = 'null';
|
|
3038
3069
|
}
|
|
3039
|
-
this.
|
|
3070
|
+
if (this.allowFiltering && !this.enableVirtualization && this.getModuleName() !== 'autocomplete') {
|
|
3071
|
+
let filterIndex = this.getIndexByValueFilter(value);
|
|
3072
|
+
if (!isNullOrUndefined(filterIndex)) {
|
|
3073
|
+
this.activeIndex = filterIndex;
|
|
3074
|
+
}
|
|
3075
|
+
else {
|
|
3076
|
+
this.activeIndex = this.getIndexByValue(value);
|
|
3077
|
+
}
|
|
3078
|
+
}
|
|
3079
|
+
else {
|
|
3080
|
+
this.activeIndex = this.getIndexByValue(value);
|
|
3081
|
+
}
|
|
3040
3082
|
}
|
|
3041
3083
|
activeItem(li) {
|
|
3042
3084
|
if (this.isValidLI(li) && !li.classList.contains(dropDownBaseClasses.selected)) {
|
|
@@ -3062,6 +3104,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3062
3104
|
detach(this.valueTempElement);
|
|
3063
3105
|
this.inputElement.style.display = 'block';
|
|
3064
3106
|
}
|
|
3107
|
+
if (!isNullOrUndefined(dataItem.value) && !this.enableVirtualization && this.allowFiltering) {
|
|
3108
|
+
this.activeIndex = this.getIndexByValueFilter(dataItem.value);
|
|
3109
|
+
}
|
|
3065
3110
|
const clearIcon = dropDownListClasses.clearIcon;
|
|
3066
3111
|
const isFilterElement = this.isFiltering() && this.filterInput && (this.getModuleName() === 'combobox');
|
|
3067
3112
|
const clearElement = isFilterElement && this.filterInput.parentElement.querySelector('.' + clearIcon);
|
|
@@ -4538,7 +4583,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4538
4583
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4539
4584
|
this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
|
|
4540
4585
|
}
|
|
4541
|
-
this.
|
|
4586
|
+
if (this.getModuleName() !== 'autocomplete' && this.totalItemCount != 0 && this.totalItemCount > (this.itemCount * 2)) {
|
|
4587
|
+
this.getSkeletonCount();
|
|
4588
|
+
}
|
|
4542
4589
|
this.UpdateSkeleton();
|
|
4543
4590
|
this.listData = currentData;
|
|
4544
4591
|
this.updateActionCompleteDataValues(ulElement, currentData);
|
|
@@ -7395,12 +7442,12 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
7395
7442
|
const nodes = this.treeObj.element.querySelectorAll('li');
|
|
7396
7443
|
const checkedNodes = this.treeObj.element.querySelectorAll('li .e-checkbox-wrapper[aria-checked=true]');
|
|
7397
7444
|
const wrap = closest(this.checkBoxElement, '.' + CHECKBOXWRAP);
|
|
7398
|
-
if (wrap && args.action === 'uncheck' && (args.isInteracted || checkedNodes.length === 0 || args.data[0].isChecked
|
|
7445
|
+
if (wrap && args.action === 'uncheck' && (args.isInteracted || checkedNodes.length === 0 || (!isNullOrUndefined(args.data[0]) && args.data[0].isChecked === 'false'))) {
|
|
7399
7446
|
this.isReverseUpdate = true;
|
|
7400
7447
|
this.changeState(wrap, 'uncheck');
|
|
7401
7448
|
this.isReverseUpdate = false;
|
|
7402
7449
|
}
|
|
7403
|
-
else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length && (args.isInteracted || this.isCheckAllCalled || args.data[0].isChecked
|
|
7450
|
+
else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length && (args.isInteracted || this.isCheckAllCalled || (!isNullOrUndefined(args.data[0]) && args.data[0].isChecked === 'true'))) {
|
|
7404
7451
|
this.isReverseUpdate = true;
|
|
7405
7452
|
this.isCheckAllCalled = false;
|
|
7406
7453
|
this.changeState(wrap, 'check');
|
|
@@ -8363,7 +8410,6 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
8363
8410
|
this.clearTemplate();
|
|
8364
8411
|
this.unWireEvents();
|
|
8365
8412
|
this.setCssClass(null, this.cssClass);
|
|
8366
|
-
this.setProperties({ value: [] }, true);
|
|
8367
8413
|
this.setProperties({ text: null }, true);
|
|
8368
8414
|
this.treeObj.destroy();
|
|
8369
8415
|
this.destroyFilter();
|
|
@@ -8406,6 +8452,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
8406
8452
|
this.overFlowWrapper = null;
|
|
8407
8453
|
this.keyboardModule = null;
|
|
8408
8454
|
super.destroy();
|
|
8455
|
+
this.setProperties({ value: [] }, true);
|
|
8409
8456
|
}
|
|
8410
8457
|
destroyFilter() {
|
|
8411
8458
|
if (this.filterObj) {
|
|
@@ -18010,6 +18057,8 @@ let Mention = class Mention extends DropDownBase {
|
|
|
18010
18057
|
this.initializePopup(popupEle, offsetValue, left);
|
|
18011
18058
|
this.checkCollision(popupEle);
|
|
18012
18059
|
popupEle.style.visibility = 'visible';
|
|
18060
|
+
let popupLeft = popupEle.parentElement.offsetWidth - popupEle.offsetWidth;
|
|
18061
|
+
let popupHeight = popupEle.offsetHeight;
|
|
18013
18062
|
addClass([popupEle], ['e-mention', 'e-popup', 'e-popup-close']);
|
|
18014
18063
|
if (!isNullOrUndefined(this.list)) {
|
|
18015
18064
|
this.unWireListEvents();
|
|
@@ -18038,9 +18087,23 @@ let Mention = class Mention extends DropDownBase {
|
|
|
18038
18087
|
popupEle.style.cssText = 'top: '.concat(coordinates.top.toString(), 'px;\n left: ').concat(coordinates.left.toString(), 'px;\nposition: absolute;\n display: block;');
|
|
18039
18088
|
}
|
|
18040
18089
|
else {
|
|
18041
|
-
|
|
18042
|
-
|
|
18090
|
+
if (this.collision.length > 0 && this.collision.indexOf('right') > -1 && this.collision.indexOf('bottom') === -1) {
|
|
18091
|
+
popupEle.style.cssText = 'top: '.concat(coordinates.top.toString(), 'px;\n left: ').concat(popupLeft.toString(), 'px;\nposition: absolute;\n display: block;');
|
|
18092
|
+
}
|
|
18093
|
+
else if (this.collision && this.collision.length > 0 && this.collision.indexOf('bottom') > -1 && this.collision.indexOf('right') === -1) {
|
|
18094
|
+
popupEle.style.left = formatUnit(coordinates.left);
|
|
18095
|
+
popupEle.style.top = formatUnit(coordinates.top - parseInt(popupHeight.toString()));
|
|
18096
|
+
}
|
|
18097
|
+
else if (this.collision && this.collision.length > 0 && this.collision.indexOf('bottom') > -1 && this.collision.indexOf('right') > -1) {
|
|
18098
|
+
popupEle.style.left = formatUnit(popupLeft);
|
|
18099
|
+
popupEle.style.top = formatUnit(coordinates.top - parseInt(popupHeight.toString()));
|
|
18100
|
+
}
|
|
18101
|
+
else {
|
|
18102
|
+
popupEle.style.left = formatUnit(coordinates.left);
|
|
18103
|
+
popupEle.style.top = formatUnit(coordinates.top - parseInt(this.popupHeight.toString()));
|
|
18104
|
+
}
|
|
18043
18105
|
this.isCollided = false;
|
|
18106
|
+
this.collision = [];
|
|
18044
18107
|
}
|
|
18045
18108
|
popupEle.style.width = this.popupWidth !== '100%' && !isNullOrUndefined(this.popupWidth) ? formatUnit(this.popupWidth) : 'auto';
|
|
18046
18109
|
this.setHeight(popupEle);
|
|
@@ -18069,8 +18132,8 @@ let Mention = class Mention extends DropDownBase {
|
|
|
18069
18132
|
checkCollision(popupEle) {
|
|
18070
18133
|
if (!Browser.isDevice || (Browser.isDevice && !(this.getModuleName() === 'mention'))) {
|
|
18071
18134
|
let coordinates = this.getCoordinates(this.inputElement, this.getTriggerCharPosition());
|
|
18072
|
-
|
|
18073
|
-
if (collision.length > 0) {
|
|
18135
|
+
this.collision = isCollide(popupEle, null, coordinates.left, coordinates.top);
|
|
18136
|
+
if (this.collision.length > 0) {
|
|
18074
18137
|
popupEle.style.marginTop = -parseInt(getComputedStyle(popupEle).marginTop, 10) + 'px';
|
|
18075
18138
|
this.isCollided = true;
|
|
18076
18139
|
}
|
|
@@ -18204,10 +18267,18 @@ let Mention = class Mention extends DropDownBase {
|
|
|
18204
18267
|
document.body.removeChild(div);
|
|
18205
18268
|
}
|
|
18206
18269
|
else {
|
|
18207
|
-
|
|
18208
|
-
|
|
18209
|
-
|
|
18210
|
-
|
|
18270
|
+
if (this.collision && this.collision.length > 0 && this.collision.indexOf('right') > -1 && this.collision.indexOf('bottom') === -1) {
|
|
18271
|
+
coordinates = {
|
|
18272
|
+
top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10),
|
|
18273
|
+
left: rect.left + windowLeft + width
|
|
18274
|
+
};
|
|
18275
|
+
}
|
|
18276
|
+
else {
|
|
18277
|
+
coordinates = {
|
|
18278
|
+
top: rect.top + windowTop + parseInt(getComputedStyle(this.inputElement).fontSize, 10) - (this.isCollided ? 10 : 0),
|
|
18279
|
+
left: rect.left + windowLeft + width
|
|
18280
|
+
};
|
|
18281
|
+
}
|
|
18211
18282
|
}
|
|
18212
18283
|
return coordinates;
|
|
18213
18284
|
}
|
|
@@ -18510,7 +18581,12 @@ let Mention = class Mention extends DropDownBase {
|
|
|
18510
18581
|
value = this.displayTempElement.innerHTML;
|
|
18511
18582
|
}
|
|
18512
18583
|
if (this.isContentEditable(this.inputElement)) {
|
|
18513
|
-
|
|
18584
|
+
if (Browser.isAndroid) {
|
|
18585
|
+
return '<span contenteditable="true" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
|
|
18586
|
+
}
|
|
18587
|
+
else {
|
|
18588
|
+
return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
|
|
18589
|
+
}
|
|
18514
18590
|
}
|
|
18515
18591
|
else {
|
|
18516
18592
|
return showChar + value;
|