@syncfusion/ej2-dropdowns 25.1.40 → 25.2.3
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 +22 -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 +280 -166
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +279 -165
- 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 +12 -12
- package/src/auto-complete/auto-complete.js +2 -10
- package/src/combo-box/combo-box.js +1 -1
- package/src/common/interface.d.ts +2 -0
- package/src/common/virtual-scroll.js +13 -4
- package/src/drop-down-base/drop-down-base.d.ts +3 -0
- package/src/drop-down-base/drop-down-base.js +67 -42
- package/src/drop-down-list/drop-down-list.d.ts +1 -1
- package/src/drop-down-list/drop-down-list.js +37 -27
- package/src/list-box/list-box.js +1 -6
- package/src/multi-select/multi-select.d.ts +3 -1
- package/src/multi-select/multi-select.js +157 -68
|
@@ -898,8 +898,11 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
898
898
|
var focusEle = this.list.querySelector('.' + dropDownListClasses.focus);
|
|
899
899
|
if (this.isSelectFocusItem(focusEle) && !isVirtualKeyAction) {
|
|
900
900
|
this.setSelection(focusEle, e);
|
|
901
|
-
if (this.enableVirtualization
|
|
901
|
+
if (this.enableVirtualization) {
|
|
902
902
|
var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
|
|
903
|
+
if (this.fields.groupBy) {
|
|
904
|
+
selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex == 0 ? this.selectedLI.offsetHeight - selectedLiOffsetTop : selectedLiOffsetTop - this.selectedLI.offsetHeight;
|
|
905
|
+
}
|
|
903
906
|
this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * this.selectedLI.offsetHeight);
|
|
904
907
|
}
|
|
905
908
|
}
|
|
@@ -936,7 +939,13 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
936
939
|
}
|
|
937
940
|
}
|
|
938
941
|
if (!isNullOrUndefined(nextItem)) {
|
|
942
|
+
var focusAtFirstElement = this.liCollections[this.skeletonCount] && this.liCollections[this.skeletonCount].classList.contains('e-item-focus');
|
|
939
943
|
this.setSelection(nextItem, e);
|
|
944
|
+
if (focusAtFirstElement && this.enableVirtualization && this.getModuleName() === 'autocomplete' && !isVirtualKeyAction) {
|
|
945
|
+
var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
|
|
946
|
+
selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex == 0 && this.fields.groupBy ? this.selectedLI.offsetHeight - selectedLiOffsetTop : selectedLiOffsetTop - this.selectedLI.offsetHeight;
|
|
947
|
+
this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * this.selectedLI.offsetHeight);
|
|
948
|
+
}
|
|
940
949
|
}
|
|
941
950
|
else if (this.enableVirtualization && !this.isPopupOpen && this.getModuleName() !== 'autocomplete' && ((this.viewPortInfo.endIndex !== this.totalItemCount && e.action === 'down') || (this.viewPortInfo.startIndex !== 0 && e.action === 'up'))) {
|
|
942
951
|
if (e.action === 'down') {
|
|
@@ -1063,14 +1072,13 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
1063
1072
|
}
|
|
1064
1073
|
break;
|
|
1065
1074
|
case 'pageUp':
|
|
1066
|
-
|
|
1067
|
-
this.activeIndex = Math.round(count);
|
|
1075
|
+
this.activeIndex = this.getModuleName() === 'autocomplete' ? this.getIndexByValue(this.selectedLI.getAttribute('data-value')) + this.getPageCount() - 1 : this.getIndexByValue(this.previousValue);
|
|
1068
1076
|
this.pageUpSelection(this.activeIndex - this.getPageCount(), e, true);
|
|
1069
1077
|
e.preventDefault();
|
|
1070
1078
|
break;
|
|
1071
1079
|
case 'pageDown':
|
|
1072
|
-
this.activeIndex =
|
|
1073
|
-
this.pageDownSelection(this.activeIndex + this.getPageCount(), e, true);
|
|
1080
|
+
this.activeIndex = this.getModuleName() === 'autocomplete' ? this.getIndexByValue(this.selectedLI.getAttribute('data-value')) - this.getPageCount() : this.getIndexByValue(this.previousValue);
|
|
1081
|
+
this.pageDownSelection(!isNullOrUndefined(this.activeIndex) ? (this.activeIndex + this.getPageCount()) : (2 * this.getPageCount()), e, true);
|
|
1074
1082
|
e.preventDefault();
|
|
1075
1083
|
break;
|
|
1076
1084
|
case 'home':
|
|
@@ -1107,8 +1115,8 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
1107
1115
|
};
|
|
1108
1116
|
DropDownList.prototype.pageUpSelection = function (steps, event, isVirtualKeyAction) {
|
|
1109
1117
|
var previousItem = steps >= 0 ? this.liCollections[steps + 1] : this.liCollections[0];
|
|
1110
|
-
if ((this.enableVirtualization && this.activeIndex == null)
|
|
1111
|
-
previousItem = steps >= 0 ? this.liCollections[steps + this.skeletonCount + 1] : this.liCollections[0];
|
|
1118
|
+
if ((this.enableVirtualization && this.activeIndex == null)) {
|
|
1119
|
+
previousItem = (this.liCollections.length >= steps && steps >= 0) ? this.liCollections[steps + this.skeletonCount + 1] : this.liCollections[0];
|
|
1112
1120
|
}
|
|
1113
1121
|
if (!isNullOrUndefined(previousItem) && previousItem.classList.contains('e-virtual-list')) {
|
|
1114
1122
|
previousItem = this.liCollections[this.skeletonCount];
|
|
@@ -1140,7 +1148,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
1140
1148
|
steps = this.getModuleName() === 'dropdownlist' && this.allowFiltering ? steps + 1 : steps;
|
|
1141
1149
|
previousItem = steps < list.length ? this.liCollections[steps] : this.liCollections[list.length - 1];
|
|
1142
1150
|
}
|
|
1143
|
-
if ((this.enableVirtualization && this.activeIndex == null)
|
|
1151
|
+
if ((this.enableVirtualization && this.activeIndex == null)) {
|
|
1144
1152
|
previousItem = steps <= list.length ? this.liCollections[steps + this.skeletonCount - 1] : this.liCollections[list.length - 1];
|
|
1145
1153
|
}
|
|
1146
1154
|
this.PageUpDownSelection(previousItem, event);
|
|
@@ -1326,6 +1334,11 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
1326
1334
|
}
|
|
1327
1335
|
}
|
|
1328
1336
|
else {
|
|
1337
|
+
if (this.enableVirtualization && this.activeIndex == null && this.dataSource instanceof DataManager) {
|
|
1338
|
+
this.UpdateSkeleton();
|
|
1339
|
+
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
1340
|
+
this.ulElement = this.list.querySelector('ul');
|
|
1341
|
+
}
|
|
1329
1342
|
this.activeIndex = this.getIndexByValue(value);
|
|
1330
1343
|
}
|
|
1331
1344
|
};
|
|
@@ -1385,7 +1398,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
1385
1398
|
if (this.enableVirtualization && this.value) {
|
|
1386
1399
|
var fields = (this.fields.value) ? this.fields.value : '';
|
|
1387
1400
|
var currentValue = this.allowObjectBinding && !isNullOrUndefined(this.value) ? getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
|
|
1388
|
-
if (this.dataSource instanceof DataManager
|
|
1401
|
+
if (this.dataSource instanceof DataManager) {
|
|
1389
1402
|
var getItem = new DataManager(this.virtualGroupDataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', currentValue)));
|
|
1390
1403
|
if (getItem && getItem.length > 0) {
|
|
1391
1404
|
this.itemData = getItem[0];
|
|
@@ -1730,7 +1743,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
1730
1743
|
if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
|
|
1731
1744
|
filterQuery.where('', filterType, this.typedString, this.ignoreCase, this.ignoreAccent);
|
|
1732
1745
|
}
|
|
1733
|
-
else if (((this.getModuleName() !== 'combobox')
|
|
1746
|
+
else if (((this.getModuleName() !== 'combobox')) || (this.isFiltering() && this.getModuleName() === 'combobox' && this.typedString !== '')) {
|
|
1734
1747
|
var fields = (this.fields.text) ? this.fields.text : '';
|
|
1735
1748
|
filterQuery.where(fields, filterType, this.typedString, this.ignoreCase, this.ignoreAccent);
|
|
1736
1749
|
}
|
|
@@ -1738,7 +1751,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
1738
1751
|
else {
|
|
1739
1752
|
filterQuery = (this.enableVirtualization && !isNullOrUndefined(this.customFilterQuery)) ? this.customFilterQuery.clone() : query ? query.clone() : this.query ? this.query.clone() : new Query();
|
|
1740
1753
|
}
|
|
1741
|
-
if (this.enableVirtualization &&
|
|
1754
|
+
if (this.enableVirtualization && this.viewPortInfo.endIndex != 0) {
|
|
1742
1755
|
var takeValue = this.getTakeValue();
|
|
1743
1756
|
var alreadySkipAdded = false;
|
|
1744
1757
|
if (filterQuery) {
|
|
@@ -1805,14 +1818,6 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
1805
1818
|
}
|
|
1806
1819
|
filterQuery.requiresCount();
|
|
1807
1820
|
}
|
|
1808
|
-
else if (this.enableVirtualization && (this.dataSource instanceof DataManager && !this.virtualGroupDataSource)) {
|
|
1809
|
-
for (var queryElements_4 = 0; queryElements_4 < filterQuery.queries.length; queryElements_4++) {
|
|
1810
|
-
if (filterQuery.queries[queryElements_4].fn === 'onSkip' || filterQuery.queries[queryElements_4].fn === 'onTake') {
|
|
1811
|
-
filterQuery.queries.splice(queryElements_4, 1);
|
|
1812
|
-
--queryElements_4;
|
|
1813
|
-
}
|
|
1814
|
-
}
|
|
1815
|
-
}
|
|
1816
1821
|
return filterQuery;
|
|
1817
1822
|
};
|
|
1818
1823
|
DropDownList.prototype.getSelectionPoints = function () {
|
|
@@ -1839,7 +1844,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
1839
1844
|
return;
|
|
1840
1845
|
}
|
|
1841
1846
|
_this.isCustomFilter = true;
|
|
1842
|
-
_this.customFilterQuery = query;
|
|
1847
|
+
_this.customFilterQuery = query.clone();
|
|
1843
1848
|
_this.filteringAction(dataSource, query, fields);
|
|
1844
1849
|
},
|
|
1845
1850
|
baseEventArgs: e,
|
|
@@ -2145,6 +2150,9 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
2145
2150
|
this.addNewItem(list, selectedItem);
|
|
2146
2151
|
}
|
|
2147
2152
|
if (!isNullOrUndefined(this.itemData) || (isNullOrUndefined(this.itemData) && this.enableVirtualization)) {
|
|
2153
|
+
this.getSkeletonCount();
|
|
2154
|
+
this.skeletonCount = this.totalItemCount != 0 && this.totalItemCount < (this.itemCount * 2) ? 0 : this.skeletonCount;
|
|
2155
|
+
this.UpdateSkeleton();
|
|
2148
2156
|
this.focusIndexItem();
|
|
2149
2157
|
}
|
|
2150
2158
|
if (this.enableVirtualization) {
|
|
@@ -2247,7 +2255,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
2247
2255
|
};
|
|
2248
2256
|
DropDownList.prototype.focusIndexItem = function () {
|
|
2249
2257
|
var value = this.getItemData().value;
|
|
2250
|
-
this.activeIndex = this.getIndexByValue(value);
|
|
2258
|
+
this.activeIndex = ((this.enableVirtualization && !isNullOrUndefined(value)) || !this.enableVirtualization) ? this.getIndexByValue(value) : this.activeIndex;
|
|
2251
2259
|
var element = this.findListElement(this.list, 'li', 'data-value', value);
|
|
2252
2260
|
this.selectedLI = element;
|
|
2253
2261
|
this.activeItem(element);
|
|
@@ -2668,7 +2676,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
2668
2676
|
}
|
|
2669
2677
|
else {
|
|
2670
2678
|
if (this.enableVirtualization) {
|
|
2671
|
-
liCount = keyAction == "pageDown" ? this.getPageCount() : liCount;
|
|
2679
|
+
liCount = keyAction == "pageDown" ? this.getPageCount() + 1 : liCount;
|
|
2672
2680
|
}
|
|
2673
2681
|
this.list.scrollTop += this.selectedLI.offsetHeight * liCount;
|
|
2674
2682
|
}
|
|
@@ -2687,7 +2695,6 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
2687
2695
|
this.isPreventKeyAction = false;
|
|
2688
2696
|
this.isKeyBoardAction = false;
|
|
2689
2697
|
this.isPreventScrollAction = false;
|
|
2690
|
-
nextOffset = nextOffset + (this.selectedLI.offsetHeight * liCount);
|
|
2691
2698
|
}
|
|
2692
2699
|
this.list.scrollTop = nextOffset;
|
|
2693
2700
|
}
|
|
@@ -2745,7 +2752,6 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
2745
2752
|
this.isPreventKeyAction = false;
|
|
2746
2753
|
this.isKeyBoardAction = false;
|
|
2747
2754
|
this.isPreventScrollAction = false;
|
|
2748
|
-
nextOffset = nextOffset - (this.selectedLI.offsetHeight * liCount);
|
|
2749
2755
|
}
|
|
2750
2756
|
this.list.scrollTop = this.list.scrollTop + nextOffset;
|
|
2751
2757
|
}
|
|
@@ -2940,7 +2946,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
2940
2946
|
sentinelInfo: {},
|
|
2941
2947
|
offsets: {},
|
|
2942
2948
|
startIndex: 0,
|
|
2943
|
-
endIndex:
|
|
2949
|
+
endIndex: this.itemCount,
|
|
2944
2950
|
};
|
|
2945
2951
|
if (this.getModuleName() === 'combobox') {
|
|
2946
2952
|
this.typedString = "";
|
|
@@ -2948,8 +2954,12 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
2948
2954
|
this.previousStartIndex = 0;
|
|
2949
2955
|
this.previousEndIndex = 0;
|
|
2950
2956
|
if (this.dataSource instanceof DataManager) {
|
|
2951
|
-
|
|
2952
|
-
|
|
2957
|
+
if (this.remoteDataCount >= 0) {
|
|
2958
|
+
this.totalItemCount = this.dataCount = this.remoteDataCount;
|
|
2959
|
+
}
|
|
2960
|
+
else {
|
|
2961
|
+
this.resetList(this.dataSource);
|
|
2962
|
+
}
|
|
2953
2963
|
}
|
|
2954
2964
|
else {
|
|
2955
2965
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
package/src/list-box/list-box.js
CHANGED
|
@@ -1668,12 +1668,6 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
1668
1668
|
tListBox.ulElement.removeChild(noRecElem);
|
|
1669
1669
|
}
|
|
1670
1670
|
}
|
|
1671
|
-
if (isRefresh) {
|
|
1672
|
-
var noRecElem = fListBox.ulElement.childNodes[0];
|
|
1673
|
-
if (noRecElem) {
|
|
1674
|
-
fListBox.ulElement.removeChild(noRecElem);
|
|
1675
|
-
}
|
|
1676
|
-
}
|
|
1677
1671
|
if (fListBox.listData.length > 0) {
|
|
1678
1672
|
// eslint-disable-next-line prefer-spread
|
|
1679
1673
|
flistboxarray = Array.apply(null, { length: fListBox.ulElement.childElementCount }).map(Number.call, Number);
|
|
@@ -1719,6 +1713,7 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
1719
1713
|
tListBox.liCollections = tliCollections.concat(fliCollections);
|
|
1720
1714
|
}
|
|
1721
1715
|
fListBox.value = [];
|
|
1716
|
+
listData = listData.filter(function (data) { return (data !== undefined); });
|
|
1722
1717
|
listData = listData
|
|
1723
1718
|
.filter(function (data) { return data.isHeader !== true; });
|
|
1724
1719
|
var sortedData = listData.filter(function (val) {
|
|
@@ -53,6 +53,8 @@ export declare class MultiSelect extends DropDownBase implements IInput {
|
|
|
53
53
|
private isCustomRendered;
|
|
54
54
|
private isRemoteSelection;
|
|
55
55
|
private isSelectAllTarget;
|
|
56
|
+
private previousFocusItem;
|
|
57
|
+
private selectedListData;
|
|
56
58
|
/**
|
|
57
59
|
* The `fields` property maps the columns of the data table and binds the data to the component.
|
|
58
60
|
* * text - Maps the text column from data table for each list item.
|
|
@@ -687,7 +689,7 @@ export declare class MultiSelect extends DropDownBase implements IInput {
|
|
|
687
689
|
private updateAriaAttribute;
|
|
688
690
|
private homeNavigation;
|
|
689
691
|
private updateSelectionList;
|
|
690
|
-
|
|
692
|
+
protected handleVirtualKeyboardActions(e: KeyboardEventArgs, pageCount: number): void;
|
|
691
693
|
private onKeyDown;
|
|
692
694
|
private arrowDown;
|
|
693
695
|
private arrowUp;
|