@syncfusion/ej2-dropdowns 23.2.7-52849 → 24.1.41-566987
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 +20 -132
- package/dist/ej2-dropdowns.umd.min.js +1 -1
- package/dist/ej2-dropdowns.umd.min.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es2015.js +654 -116
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +658 -119
- package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
- package/package.json +13 -13
- package/src/auto-complete/auto-complete.js +9 -4
- package/src/combo-box/combo-box.js +74 -2
- package/src/common/incremental-search.d.ts +1 -1
- package/src/common/incremental-search.js +50 -7
- package/src/common/interface.d.ts +2 -0
- package/src/common/virtual-scroll.js +22 -1
- package/src/drop-down-base/drop-down-base.d.ts +23 -3
- package/src/drop-down-base/drop-down-base.js +154 -40
- package/src/drop-down-list/drop-down-list.d.ts +10 -3
- package/src/drop-down-list/drop-down-list.js +305 -41
- package/src/drop-down-tree/drop-down-tree.js +24 -20
- package/src/list-box/list-box.js +8 -1
- package/src/mention/mention.js +5 -1
- package/src/multi-select/checkbox-selection.js +4 -1
- package/src/multi-select/multi-select.js +4 -2
- package/styles/auto-complete/_bds-definition.scss +2 -0
- package/styles/bootstrap-dark.css +16 -9
- package/styles/bootstrap.css +16 -9
- package/styles/bootstrap4.css +11 -9
- package/styles/bootstrap5-dark.css +11 -9
- package/styles/bootstrap5.css +11 -9
- package/styles/combo-box/_bds-definition.scss +2 -0
- package/styles/drop-down-base/_bds-definition.scss +134 -0
- package/styles/drop-down-base/_layout.scss +0 -8
- package/styles/drop-down-base/bootstrap-dark.css +0 -8
- package/styles/drop-down-base/bootstrap.css +0 -8
- package/styles/drop-down-base/bootstrap4.css +0 -8
- package/styles/drop-down-base/bootstrap5-dark.css +0 -8
- package/styles/drop-down-base/bootstrap5.css +0 -8
- package/styles/drop-down-base/fabric-dark.css +0 -8
- package/styles/drop-down-base/fabric.css +0 -8
- package/styles/drop-down-base/fluent-dark.css +0 -8
- package/styles/drop-down-base/fluent.css +0 -8
- package/styles/drop-down-base/highcontrast-light.css +0 -8
- package/styles/drop-down-base/highcontrast.css +0 -8
- package/styles/drop-down-base/material-dark.css +0 -8
- package/styles/drop-down-base/material.css +0 -8
- package/styles/drop-down-base/material3-dark.css +0 -8
- package/styles/drop-down-base/material3.css +0 -8
- package/styles/drop-down-base/tailwind-dark.css +0 -8
- package/styles/drop-down-base/tailwind.css +0 -8
- package/styles/drop-down-list/_bds-definition.scss +134 -0
- package/styles/drop-down-list/_layout.scss +5 -0
- package/styles/drop-down-list/bootstrap-dark.css +5 -0
- package/styles/drop-down-list/bootstrap.css +5 -0
- package/styles/drop-down-list/bootstrap4.css +5 -0
- package/styles/drop-down-list/bootstrap5-dark.css +5 -0
- package/styles/drop-down-list/bootstrap5.css +5 -0
- package/styles/drop-down-list/fabric-dark.css +5 -0
- package/styles/drop-down-list/fabric.css +5 -0
- package/styles/drop-down-list/fluent-dark.css +5 -0
- package/styles/drop-down-list/fluent.css +5 -0
- package/styles/drop-down-list/highcontrast-light.css +5 -0
- package/styles/drop-down-list/highcontrast.css +5 -0
- package/styles/drop-down-list/icons/_bds.scss +14 -0
- package/styles/drop-down-list/material-dark.css +5 -0
- package/styles/drop-down-list/material.css +5 -0
- package/styles/drop-down-list/material3-dark.css +5 -0
- package/styles/drop-down-list/material3.css +5 -0
- package/styles/drop-down-list/tailwind-dark.css +5 -0
- package/styles/drop-down-list/tailwind.css +5 -0
- package/styles/drop-down-tree/_bds-definition.scss +61 -0
- package/styles/drop-down-tree/_layout.scss +5 -0
- package/styles/drop-down-tree/bootstrap-dark.css +4 -0
- package/styles/drop-down-tree/bootstrap.css +4 -0
- package/styles/drop-down-tree/bootstrap4.css +4 -0
- package/styles/drop-down-tree/bootstrap5-dark.css +4 -0
- package/styles/drop-down-tree/bootstrap5.css +4 -0
- package/styles/drop-down-tree/fabric-dark.css +4 -0
- package/styles/drop-down-tree/fabric.css +4 -0
- package/styles/drop-down-tree/fluent-dark.css +4 -0
- package/styles/drop-down-tree/fluent.css +4 -0
- package/styles/drop-down-tree/highcontrast-light.css +4 -0
- package/styles/drop-down-tree/highcontrast.css +4 -0
- package/styles/drop-down-tree/icons/_bds.scss +11 -0
- package/styles/drop-down-tree/material-dark.css +4 -0
- package/styles/drop-down-tree/material.css +4 -0
- package/styles/drop-down-tree/material3-dark.css +4 -0
- package/styles/drop-down-tree/material3.css +4 -0
- package/styles/drop-down-tree/tailwind-dark.css +4 -0
- package/styles/drop-down-tree/tailwind.css +4 -0
- package/styles/fabric-dark.css +12 -9
- package/styles/fabric.css +12 -9
- package/styles/fluent-dark.css +16 -9
- package/styles/fluent.css +16 -9
- package/styles/highcontrast-light.css +12 -9
- package/styles/highcontrast.css +12 -9
- package/styles/list-box/_bds-definition.scss +136 -0
- package/styles/list-box/icons/_bds.scss +25 -0
- package/styles/material-dark.css +11 -9
- package/styles/material.css +11 -9
- package/styles/material3-dark.css +11 -9
- package/styles/material3.css +11 -9
- package/styles/mention/_bds-definition.scss +1 -0
- package/styles/multi-select/_bds-definition.scss +235 -0
- package/styles/multi-select/_bootstrap-dark-definition.scss +4 -0
- package/styles/multi-select/_bootstrap-definition.scss +4 -0
- package/styles/multi-select/_fluent-definition.scss +5 -0
- package/styles/multi-select/_layout.scss +8 -1
- package/styles/multi-select/bootstrap-dark.css +7 -1
- package/styles/multi-select/bootstrap.css +7 -1
- package/styles/multi-select/bootstrap4.css +2 -1
- package/styles/multi-select/bootstrap5-dark.css +2 -1
- package/styles/multi-select/bootstrap5.css +2 -1
- package/styles/multi-select/fabric-dark.css +3 -1
- package/styles/multi-select/fabric.css +3 -1
- package/styles/multi-select/fluent-dark.css +7 -1
- package/styles/multi-select/fluent.css +7 -1
- package/styles/multi-select/highcontrast-light.css +3 -1
- package/styles/multi-select/highcontrast.css +3 -1
- package/styles/multi-select/icons/_bds.scss +26 -0
- package/styles/multi-select/material-dark.css +2 -1
- package/styles/multi-select/material.css +2 -1
- package/styles/multi-select/material3-dark.css +2 -1
- package/styles/multi-select/material3.css +2 -1
- package/styles/multi-select/tailwind-dark.css +2 -1
- package/styles/multi-select/tailwind.css +2 -1
- package/styles/tailwind-dark.css +11 -9
- package/styles/tailwind.css +11 -9
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-dropdowns@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-dropdowns@
|
|
3
|
+
"_id": "@syncfusion/ej2-dropdowns@18.66.19",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-s44ZbX8pmdJIl6CM2ku298JD2p3QiAnI2/rPJQu9kar1yjLrXdnokG80WPDU3/isZ1NUsKcuMCaU38P/keLcMA==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-dropdowns",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -34,22 +34,22 @@
|
|
|
34
34
|
"/@syncfusion/ej2-spreadsheet",
|
|
35
35
|
"/@syncfusion/ej2-vue-dropdowns"
|
|
36
36
|
],
|
|
37
|
-
"_resolved": "https://nexus.syncfusion.com/repository/ej2-
|
|
38
|
-
"_shasum": "
|
|
37
|
+
"_resolved": "https://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-18.66.19.tgz",
|
|
38
|
+
"_shasum": "b096d3578c1d78fb2eb247425960d07e5af5657b",
|
|
39
39
|
"_spec": "@syncfusion/ej2-dropdowns@*",
|
|
40
|
-
"_where": "/jenkins/workspace/elease-
|
|
40
|
+
"_where": "/jenkins/workspace/elease-automation_release_24.1.1/packages/included",
|
|
41
41
|
"author": {
|
|
42
42
|
"name": "Syncfusion Inc."
|
|
43
43
|
},
|
|
44
44
|
"bundleDependencies": false,
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@syncfusion/ej2-base": "~
|
|
47
|
-
"@syncfusion/ej2-data": "~
|
|
48
|
-
"@syncfusion/ej2-inputs": "~
|
|
49
|
-
"@syncfusion/ej2-lists": "~
|
|
50
|
-
"@syncfusion/ej2-navigations": "~
|
|
51
|
-
"@syncfusion/ej2-notifications": "~
|
|
52
|
-
"@syncfusion/ej2-popups": "~
|
|
46
|
+
"@syncfusion/ej2-base": "~24.1.41",
|
|
47
|
+
"@syncfusion/ej2-data": "~24.1.41",
|
|
48
|
+
"@syncfusion/ej2-inputs": "~24.1.41",
|
|
49
|
+
"@syncfusion/ej2-lists": "~24.1.41",
|
|
50
|
+
"@syncfusion/ej2-navigations": "~24.1.41",
|
|
51
|
+
"@syncfusion/ej2-notifications": "~24.1.41",
|
|
52
|
+
"@syncfusion/ej2-popups": "~24.1.41"
|
|
53
53
|
},
|
|
54
54
|
"deprecated": false,
|
|
55
55
|
"description": "Essential JS 2 DropDown Components",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"module": "./index.js",
|
|
75
75
|
"name": "@syncfusion/ej2-dropdowns",
|
|
76
76
|
"typings": "index.d.ts",
|
|
77
|
-
"version": "
|
|
77
|
+
"version": "24.1.41-566987",
|
|
78
78
|
"sideEffects": false,
|
|
79
79
|
"homepage": "https://www.syncfusion.com/javascript-ui-controls"
|
|
80
80
|
}
|
|
@@ -84,7 +84,7 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
84
84
|
if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
|
|
85
85
|
filterQuery.where('', filterType, queryString, this.ignoreCase, this.ignoreAccent);
|
|
86
86
|
}
|
|
87
|
-
else {
|
|
87
|
+
else if ((!this.enableVirtualization) || (this.enableVirtualization && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource)))) {
|
|
88
88
|
var mapping = !isNullOrUndefined(this.fields.value) ? this.fields.value : '';
|
|
89
89
|
filterQuery.where(mapping, filterType, queryString, this.ignoreCase, this.ignoreAccent);
|
|
90
90
|
}
|
|
@@ -100,7 +100,7 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
100
100
|
}
|
|
101
101
|
filterQuery.take(this.suggestionCount);
|
|
102
102
|
}
|
|
103
|
-
if (this.enableVirtualization) {
|
|
103
|
+
if (this.enableVirtualization && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource))) {
|
|
104
104
|
var takeValue = this.getTakeValue();
|
|
105
105
|
filterQuery.skip(this.virtualItemStartIndex);
|
|
106
106
|
filterQuery.take(takeValue);
|
|
@@ -182,7 +182,7 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
182
182
|
document.getElementsByClassName('e-popup')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
if (this.
|
|
185
|
+
if ((this.getModuleName() === 'autocomplete' && !(this.dataSource instanceof DataManager)) || (this.getModuleName() === 'autocomplete' && (this.dataSource instanceof DataManager) && this.totalItemCount != 0)) {
|
|
186
186
|
this.getFilteringSkeletonCount();
|
|
187
187
|
}
|
|
188
188
|
}
|
|
@@ -203,7 +203,12 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
203
203
|
};
|
|
204
204
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
205
205
|
AutoComplete.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
|
|
206
|
-
this.
|
|
206
|
+
if (!this.enableVirtualization) {
|
|
207
|
+
this.fixedHeaderElement = null;
|
|
208
|
+
}
|
|
209
|
+
if ((this.getModuleName() === 'autocomplete' && !(this.dataSource instanceof DataManager)) || (this.getModuleName() === 'autocomplete' && (this.dataSource instanceof DataManager) && this.totalItemCount != 0)) {
|
|
210
|
+
this.getFilteringSkeletonCount();
|
|
211
|
+
}
|
|
207
212
|
_super.prototype.onActionComplete.call(this, ulElement, list, e);
|
|
208
213
|
var item = this.list.querySelector('.' + dropDownListClasses.li);
|
|
209
214
|
if (!isNullOrUndefined(item)) {
|
|
@@ -220,7 +220,7 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
220
220
|
if (this.isSelectCustom) {
|
|
221
221
|
this.removeSelection();
|
|
222
222
|
}
|
|
223
|
-
if (!this.preventAutoFill && this.getModuleName() === 'combobox' && this.isTyped) {
|
|
223
|
+
if (!this.preventAutoFill && this.getModuleName() === 'combobox' && this.isTyped && !this.enableVirtualization) {
|
|
224
224
|
setTimeout(function () {
|
|
225
225
|
_this.inlineSearch();
|
|
226
226
|
});
|
|
@@ -229,7 +229,7 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
229
229
|
ComboBox.prototype.getFocusElement = function () {
|
|
230
230
|
var dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
|
|
231
231
|
var selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : this.list;
|
|
232
|
-
var isSelected = dataItem.text === this.inputElement.value && !isNullOrUndefined(selected);
|
|
232
|
+
var isSelected = dataItem.text && dataItem.text.toString() === this.inputElement.value && !isNullOrUndefined(selected);
|
|
233
233
|
if (isSelected) {
|
|
234
234
|
return selected;
|
|
235
235
|
}
|
|
@@ -239,6 +239,70 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
239
239
|
var dataSource = this.sortedData;
|
|
240
240
|
var type = this.typeOfData(dataSource).typeof;
|
|
241
241
|
var activeItem = Search(inputValue, this.liCollections, this.filterType, true, dataSource, this.fields, type);
|
|
242
|
+
if (this.enableVirtualization && inputValue !== '' && this.getModuleName() !== 'autocomplete' && this.isTyped && !this.allowFiltering) {
|
|
243
|
+
var updatingincrementalindex = false;
|
|
244
|
+
if ((this.viewPortInfo.endIndex >= this.incrementalEndIndex && this.incrementalEndIndex <= this.totalItemCount) || this.incrementalEndIndex == 0) {
|
|
245
|
+
updatingincrementalindex = true;
|
|
246
|
+
this.incrementalStartIndex = this.incrementalEndIndex;
|
|
247
|
+
if (this.incrementalEndIndex == 0) {
|
|
248
|
+
this.incrementalEndIndex = 100 > this.totalItemCount ? this.totalItemCount : 100;
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
this.incrementalEndIndex = this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100;
|
|
252
|
+
}
|
|
253
|
+
this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
|
|
254
|
+
updatingincrementalindex = true;
|
|
255
|
+
}
|
|
256
|
+
if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
|
|
257
|
+
this.updateIncrementalView(0, this.itemCount);
|
|
258
|
+
}
|
|
259
|
+
activeItem = Search(inputValue, this.incrementalLiCollections, this.filterType, true, dataSource, this.fields, type);
|
|
260
|
+
while (isNullOrUndefined(activeItem) && this.incrementalEndIndex < this.totalItemCount) {
|
|
261
|
+
this.incrementalStartIndex = this.incrementalEndIndex;
|
|
262
|
+
this.incrementalEndIndex = this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100;
|
|
263
|
+
this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
|
|
264
|
+
updatingincrementalindex = true;
|
|
265
|
+
if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
|
|
266
|
+
this.updateIncrementalView(0, this.itemCount);
|
|
267
|
+
}
|
|
268
|
+
activeItem = Search(inputValue, this.incrementalLiCollections, this.filterType, true, dataSource, this.fields, type);
|
|
269
|
+
if (!isNullOrUndefined(activeItem)) {
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
if (isNullOrUndefined(activeItem) && this.incrementalEndIndex >= this.totalItemCount) {
|
|
273
|
+
this.incrementalStartIndex = 0;
|
|
274
|
+
this.incrementalEndIndex = 100 > this.totalItemCount ? this.totalItemCount : 100;
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
if (activeItem.index) {
|
|
279
|
+
if ((!(this.viewPortInfo.startIndex >= activeItem.index)) || (!(activeItem.index >= this.viewPortInfo.endIndex))) {
|
|
280
|
+
var startIndex = activeItem.index - ((this.itemCount / 2) - 2) > 0 ? activeItem.index - ((this.itemCount / 2) - 2) : 0;
|
|
281
|
+
var endIndex = this.viewPortInfo.startIndex + this.itemCount > this.totalItemCount ? this.totalItemCount : this.viewPortInfo.startIndex + this.itemCount;
|
|
282
|
+
if (startIndex != this.viewPortInfo.startIndex) {
|
|
283
|
+
this.updateIncrementalView(startIndex, endIndex);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
if (!isNullOrUndefined(activeItem.item)) {
|
|
288
|
+
var index_1 = this.getIndexByValue(activeItem.item.getAttribute('data-value')) - this.skeletonCount;
|
|
289
|
+
if (index_1 > this.itemCount / 2) {
|
|
290
|
+
var startIndex = this.viewPortInfo.startIndex + ((this.itemCount / 2) - 2) < this.totalItemCount ? this.viewPortInfo.startIndex + ((this.itemCount / 2) - 2) : this.totalItemCount;
|
|
291
|
+
var endIndex = this.viewPortInfo.startIndex + this.itemCount > this.totalItemCount ? this.totalItemCount : this.viewPortInfo.startIndex + this.itemCount;
|
|
292
|
+
this.updateIncrementalView(startIndex, endIndex);
|
|
293
|
+
}
|
|
294
|
+
activeItem.item = this.getElementByValue(activeItem.item.getAttribute('data-value'));
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
this.updateIncrementalView(0, this.itemCount);
|
|
298
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
299
|
+
this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
|
|
300
|
+
this.list.scrollTop = 0;
|
|
301
|
+
}
|
|
302
|
+
if (activeItem && activeItem.item) {
|
|
303
|
+
activeItem.item = this.getElementByValue(activeItem.item.getAttribute('data-value'));
|
|
304
|
+
}
|
|
305
|
+
}
|
|
242
306
|
var activeElement = activeItem.item;
|
|
243
307
|
if (!isNullOrUndefined(activeElement)) {
|
|
244
308
|
var count = this.getIndexByValue(activeElement.getAttribute('data-value')) - 1;
|
|
@@ -249,6 +313,14 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
249
313
|
if (!this.enableVirtualization) {
|
|
250
314
|
this.list.scrollTop = count * height + fixedHead;
|
|
251
315
|
}
|
|
316
|
+
else {
|
|
317
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
318
|
+
this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
|
|
319
|
+
if (this.enableVirtualization && !this.fields.groupBy) {
|
|
320
|
+
var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? activeElement.offsetTop + (this.virtualListInfo.startIndex * activeElement.offsetHeight) : activeElement.offsetTop;
|
|
321
|
+
this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * activeElement.offsetHeight);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
252
324
|
addClass([activeElement], dropDownListClasses.focus);
|
|
253
325
|
}
|
|
254
326
|
}
|
|
@@ -13,7 +13,7 @@ export declare type SearchType = 'StartsWith' | 'Equal' | 'EndsWith' | 'Contains
|
|
|
13
13
|
* @param {string} elementId - Specifies the list element ID.
|
|
14
14
|
* @returns {Element} Returns list item based on key code matches with list text content.
|
|
15
15
|
*/
|
|
16
|
-
export declare function incrementalSearch(keyCode: number, items: HTMLElement[], selectedIndex: number, ignoreCase: boolean, elementId: string): Element;
|
|
16
|
+
export declare function incrementalSearch(keyCode: number, items: HTMLElement[], selectedIndex: number, ignoreCase: boolean, elementId: string, queryStringUpdated?: boolean, currentValue?: string, isVirtual?: boolean, refresh?: boolean): Element;
|
|
17
17
|
/**
|
|
18
18
|
* Search the list item based on given input value matches with search type.
|
|
19
19
|
*
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
var queryString = '';
|
|
5
5
|
var prevString = '';
|
|
6
|
+
var tempQueryString = '';
|
|
6
7
|
var matches = [];
|
|
7
8
|
var activeClass = 'e-active';
|
|
8
9
|
var prevElementId = '';
|
|
@@ -17,21 +18,49 @@ var prevElementId = '';
|
|
|
17
18
|
* @param {string} elementId - Specifies the list element ID.
|
|
18
19
|
* @returns {Element} Returns list item based on key code matches with list text content.
|
|
19
20
|
*/
|
|
20
|
-
export function incrementalSearch(keyCode, items, selectedIndex, ignoreCase, elementId) {
|
|
21
|
-
queryString
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
export function incrementalSearch(keyCode, items, selectedIndex, ignoreCase, elementId, queryStringUpdated, currentValue, isVirtual, refresh) {
|
|
22
|
+
if (!queryStringUpdated || queryString === '') {
|
|
23
|
+
if (tempQueryString != '') {
|
|
24
|
+
queryString = tempQueryString + String.fromCharCode(keyCode);
|
|
25
|
+
tempQueryString = '';
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
queryString += String.fromCharCode(keyCode);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
else if (queryString == prevString) {
|
|
32
|
+
tempQueryString = String.fromCharCode(keyCode);
|
|
33
|
+
}
|
|
34
|
+
if (isVirtual) {
|
|
35
|
+
setTimeout(function () {
|
|
36
|
+
tempQueryString = '';
|
|
37
|
+
}, 700);
|
|
38
|
+
setTimeout(function () {
|
|
39
|
+
queryString = '';
|
|
40
|
+
}, 3000);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
setTimeout(function () {
|
|
44
|
+
queryString = '';
|
|
45
|
+
}, 1000);
|
|
46
|
+
}
|
|
25
47
|
var index;
|
|
26
48
|
queryString = ignoreCase ? queryString.toLowerCase() : queryString;
|
|
27
|
-
if (prevElementId === elementId && prevString === queryString) {
|
|
49
|
+
if (prevElementId === elementId && prevString === queryString && !refresh) {
|
|
28
50
|
for (var i = 0; i < matches.length; i++) {
|
|
29
51
|
if (matches[i].classList.contains(activeClass)) {
|
|
30
52
|
index = i;
|
|
31
53
|
break;
|
|
32
54
|
}
|
|
55
|
+
if (currentValue && matches[i].textContent.toLowerCase() === currentValue.toLowerCase()) {
|
|
56
|
+
index = i;
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
33
59
|
}
|
|
34
60
|
index = index + 1;
|
|
61
|
+
if (isVirtual) {
|
|
62
|
+
return matches[index] && matches.length - 1 != index ? matches[index] : matches[matches.length];
|
|
63
|
+
}
|
|
35
64
|
return matches[index] ? matches[index] : matches[0];
|
|
36
65
|
}
|
|
37
66
|
else {
|
|
@@ -61,6 +90,20 @@ export function incrementalSearch(keyCode, items, selectedIndex, ignoreCase, ele
|
|
|
61
90
|
} while (i !== selectedIndex);
|
|
62
91
|
prevString = queryString;
|
|
63
92
|
prevElementId = elementId;
|
|
93
|
+
if (isVirtual) {
|
|
94
|
+
var indexUpdated = false;
|
|
95
|
+
for (var i_1 = 0; i_1 < matches.length; i_1++) {
|
|
96
|
+
if (currentValue && matches[i_1].textContent.toLowerCase() === currentValue.toLowerCase()) {
|
|
97
|
+
index = i_1;
|
|
98
|
+
indexUpdated = true;
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (currentValue && indexUpdated) {
|
|
103
|
+
index = index + 1;
|
|
104
|
+
}
|
|
105
|
+
return matches[index] ? matches[index] : matches[0];
|
|
106
|
+
}
|
|
64
107
|
return matches[0];
|
|
65
108
|
}
|
|
66
109
|
}
|
|
@@ -97,7 +140,7 @@ export function Search(inputVal, items, searchType, ignoreCase, dataSource, fiel
|
|
|
97
140
|
});
|
|
98
141
|
});
|
|
99
142
|
}
|
|
100
|
-
text = dataSource && filterValue ? (ignoreCase ? filterValue.toLocaleLowerCase() : filterValue).replace(/^\s+|\s+$/g, '') : (ignoreCase ? item.textContent.toLocaleLowerCase() : item.textContent).replace(/^\s+|\s+$/g, '');
|
|
143
|
+
text = dataSource && filterValue ? (ignoreCase ? filterValue.toString().toLocaleLowerCase() : filterValue).replace(/^\s+|\s+$/g, '') : (ignoreCase ? item.textContent.toLocaleLowerCase() : item.textContent).replace(/^\s+|\s+$/g, '');
|
|
101
144
|
/* eslint-disable security/detect-non-literal-regexp */
|
|
102
145
|
if ((searchType === 'Equal' && text === queryStr) || (searchType === 'StartsWith' && text.substr(0, strLength) === queryStr) || (searchType === 'EndsWith' && text.substr(text.length - queryStr.length) === queryStr) || (searchType === 'Contains' && new RegExp(queryStr, "g").test(text))) {
|
|
103
146
|
itemData.item = item;
|
|
@@ -57,6 +57,7 @@ export interface IDropdownlist extends Component<HTMLElement> {
|
|
|
57
57
|
listData: {
|
|
58
58
|
[key: string]: Object;
|
|
59
59
|
}[] | string[] | boolean[] | number[];
|
|
60
|
+
skeletonCount: number;
|
|
60
61
|
getSkeletonCount(retainSkeleton?: boolean): void;
|
|
61
62
|
getItems(): HTMLElement[];
|
|
62
63
|
getQuery(query: Query): Query;
|
|
@@ -73,4 +74,5 @@ export interface IDropdownlist extends Component<HTMLElement> {
|
|
|
73
74
|
[key: string]: Object;
|
|
74
75
|
}[] | DataManager | string[] | number[] | boolean[], fields?: FieldSettingsModel, query?: Query, e?: MouseEvent | KeyboardEventArgs | TouchEvent): void;
|
|
75
76
|
findListElement(list: HTMLElement, findNode: string, attribute: string, value: string | boolean | number): HTMLElement;
|
|
77
|
+
scrollStop(e?: Event): void;
|
|
76
78
|
}
|
|
@@ -46,7 +46,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
46
46
|
};
|
|
47
47
|
import { EventHandler, Browser, select, isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
48
48
|
import { debounce, Touch } from '@syncfusion/ej2-base';
|
|
49
|
-
import { Query } from '@syncfusion/ej2-data';
|
|
49
|
+
import { DataManager, Query } from '@syncfusion/ej2-data';
|
|
50
50
|
var VirtualScroll = /** @class */ (function () {
|
|
51
51
|
function VirtualScroll(parent) {
|
|
52
52
|
var _this = this;
|
|
@@ -150,9 +150,24 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
150
150
|
query = this.getPageQuery(query, virtualItemStartIndex, virtualItemEndIndex);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
+
var tempCustomFilter = this.parent.isCustomFilter;
|
|
154
|
+
if (this.component === 'combobox') {
|
|
155
|
+
var totalData = 0;
|
|
156
|
+
if (this.parent.dataSource instanceof DataManager) {
|
|
157
|
+
totalData = this.parent.dataSource.dataSource.json.length;
|
|
158
|
+
}
|
|
159
|
+
else if (this.parent.dataSource && this.parent.dataSource.length > 0) {
|
|
160
|
+
totalData = this.parent.dataSource.length;
|
|
161
|
+
}
|
|
162
|
+
if (totalData > 0) {
|
|
163
|
+
this.parent.isCustomFilter = (totalData == this.parent.totalItemCount && this.parent.queryString != this.parent.typedString) ? true : this.parent.isCustomFilter;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
153
166
|
this.parent.resetList(dataSource, this.parent.fields, query);
|
|
167
|
+
this.parent.isCustomFilter = tempCustomFilter;
|
|
154
168
|
};
|
|
155
169
|
VirtualScroll.prototype.removeSkipAndTakeEvents = function (query) {
|
|
170
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
156
171
|
query.queries = query.queries.filter(function (event) {
|
|
157
172
|
return event.fn !== 'onSkip' && event.fn !== 'onTake';
|
|
158
173
|
});
|
|
@@ -181,6 +196,9 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
181
196
|
if (virtualContentElement) {
|
|
182
197
|
(virtualContentElement).style = this.parent.getTransformValues();
|
|
183
198
|
}
|
|
199
|
+
if (this.parent.fields.groupBy) {
|
|
200
|
+
this.parent.scrollStop();
|
|
201
|
+
}
|
|
184
202
|
};
|
|
185
203
|
VirtualScroll.prototype.generateQueryAndSetQueryIndexAsync = function (query, isPopupOpen) {
|
|
186
204
|
var isStartIndexInitialised = false;
|
|
@@ -231,6 +249,9 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
231
249
|
}
|
|
232
250
|
else {
|
|
233
251
|
this.parent.getSkeletonCount(true);
|
|
252
|
+
if (this.component === 'combobox') {
|
|
253
|
+
this.parent.skeletonCount = this.parent.totalItemCount != 0 && this.parent.totalItemCount < (this.parent.itemCount * 2) ? 0 : this.parent.skeletonCount;
|
|
254
|
+
}
|
|
234
255
|
}
|
|
235
256
|
}
|
|
236
257
|
return [4 /*yield*/, this.dataProcessAsync()];
|
|
@@ -178,6 +178,11 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
|
|
|
178
178
|
[key: string]: Object;
|
|
179
179
|
}[] | string[] | boolean[] | number[];
|
|
180
180
|
protected ulElement: HTMLElement;
|
|
181
|
+
protected incrementalLiCollections: HTMLElement[];
|
|
182
|
+
protected incrementalListData: {
|
|
183
|
+
[key: string]: Object;
|
|
184
|
+
}[] | string[] | boolean[] | number[];
|
|
185
|
+
protected incrementalUlElement: HTMLElement;
|
|
181
186
|
protected liCollections: HTMLElement[];
|
|
182
187
|
private bindEvent;
|
|
183
188
|
private scrollTimer;
|
|
@@ -223,6 +228,14 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
|
|
|
223
228
|
private virtualizedItemsCount;
|
|
224
229
|
protected totalItemCount: number;
|
|
225
230
|
protected dataCount: number;
|
|
231
|
+
protected isRemoteDataUpdated: boolean;
|
|
232
|
+
protected virtualGroupDataSource: {
|
|
233
|
+
[key: string]: Object;
|
|
234
|
+
}[] | DataManager | string[] | number[] | boolean[];
|
|
235
|
+
protected isIncrementalRequest: boolean;
|
|
236
|
+
protected itemCount: number;
|
|
237
|
+
/**
|
|
238
|
+
|
|
226
239
|
/**
|
|
227
240
|
* The `fields` property maps the columns of the data table and binds the data to the component.
|
|
228
241
|
* * text - Maps the text column from data table for each list item.
|
|
@@ -490,6 +503,8 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
|
|
|
490
503
|
* @returns {void}
|
|
491
504
|
*/
|
|
492
505
|
private setListData;
|
|
506
|
+
protected updatePopupState(): void;
|
|
507
|
+
protected updateRemoteData(): void;
|
|
493
508
|
private bindChildItems;
|
|
494
509
|
protected updateListValues(): void;
|
|
495
510
|
protected findListElement(list: HTMLElement, findNode: string, attribute: string, value: string | boolean | number): HTMLElement;
|
|
@@ -532,7 +547,10 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
|
|
|
532
547
|
[key: string]: Object;
|
|
533
548
|
}[] | string[] | number[] | boolean[], fields: FieldSettingsModel): FieldSettingsModel;
|
|
534
549
|
protected setFloatingHeader(e: Event): void;
|
|
535
|
-
protected scrollStop(e?: Event): void;
|
|
550
|
+
protected scrollStop(e?: Event, isDownkey?: boolean): void;
|
|
551
|
+
protected getPageCount(returnExactCount?: boolean): number;
|
|
552
|
+
private updateGroupHeader;
|
|
553
|
+
private updateGroupFixedHeader;
|
|
536
554
|
protected getValidLi(): HTMLElement;
|
|
537
555
|
/**
|
|
538
556
|
* To render the list items
|
|
@@ -544,6 +562,8 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
|
|
|
544
562
|
protected renderItems(listData: {
|
|
545
563
|
[key: string]: Object;
|
|
546
564
|
}[], fields: FieldSettingsModel): HTMLElement;
|
|
565
|
+
private createVirtualContent;
|
|
566
|
+
private updateListElements;
|
|
547
567
|
protected templateListItem(dataSource: {
|
|
548
568
|
[key: string]: Object;
|
|
549
569
|
}[], fields: FieldSettingsModel): HTMLElement;
|
|
@@ -560,14 +580,14 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
|
|
|
560
580
|
* @param {string | number | boolean} value - Specifies given value.
|
|
561
581
|
* @returns {number} Returns the index of the item.
|
|
562
582
|
*/
|
|
563
|
-
protected
|
|
583
|
+
protected getIndexByValue(value: string | number | boolean): number;
|
|
564
584
|
/**
|
|
565
585
|
* Return the index of item which matched with given value in data source
|
|
566
586
|
*
|
|
567
587
|
* @param {string | number | boolean} value - Specifies given value.
|
|
568
588
|
* @returns {number} Returns the index of the item.
|
|
569
589
|
*/
|
|
570
|
-
protected
|
|
590
|
+
protected getIndexByValueFilter(value: string | number | boolean): number;
|
|
571
591
|
/**
|
|
572
592
|
* To dispatch the event manually
|
|
573
593
|
*
|