@syncfusion/ej2-dropdowns 25.1.40 → 25.1.41
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 +14 -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 +276 -164
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +276 -164
- 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 +8 -8
- 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 +65 -41
- 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 +156 -68
- package/.eslintrc.json +0 -260
- package/tslint.json +0 -111
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 25.1.
|
|
3
|
+
* version : 25.1.41
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-dropdowns@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-dropdowns@25.1.
|
|
3
|
+
"_id": "@syncfusion/ej2-dropdowns@25.1.40",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-6DDoNXRwihclI1cvrUHH8Gvr/wxNd9q6xbG0MDIKI+YkHlXQmKzFpWMJiryVAUISQ9FxXkZ31GbC4odDlpX8QA==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-dropdowns",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"/@syncfusion/ej2-spreadsheet",
|
|
35
35
|
"/@syncfusion/ej2-vue-dropdowns"
|
|
36
36
|
],
|
|
37
|
-
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-25.1.
|
|
38
|
-
"_shasum": "
|
|
37
|
+
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-25.1.40.tgz",
|
|
38
|
+
"_shasum": "5279cf8e0bc8d91c654d5be6c294f94c62c51a12",
|
|
39
39
|
"_spec": "@syncfusion/ej2-dropdowns@*",
|
|
40
40
|
"_where": "/jenkins/workspace/elease-automation_release_25.1.1/packages/included",
|
|
41
41
|
"author": {
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
"@syncfusion/ej2-base": "~25.1.35",
|
|
47
47
|
"@syncfusion/ej2-data": "~25.1.35",
|
|
48
48
|
"@syncfusion/ej2-inputs": "~25.1.40",
|
|
49
|
-
"@syncfusion/ej2-lists": "~25.1.
|
|
50
|
-
"@syncfusion/ej2-navigations": "~25.1.
|
|
49
|
+
"@syncfusion/ej2-lists": "~25.1.41",
|
|
50
|
+
"@syncfusion/ej2-navigations": "~25.1.41",
|
|
51
51
|
"@syncfusion/ej2-notifications": "~25.1.35",
|
|
52
|
-
"@syncfusion/ej2-popups": "~25.1.
|
|
52
|
+
"@syncfusion/ej2-popups": "~25.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": "25.1.
|
|
77
|
+
"version": "25.1.41",
|
|
78
78
|
"sideEffects": false,
|
|
79
79
|
"homepage": "https://www.syncfusion.com/javascript-ui-controls"
|
|
80
80
|
}
|
|
@@ -90,7 +90,7 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
90
90
|
if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
|
|
91
91
|
filterQuery.where('', filterType, queryString, this.ignoreCase, this.ignoreAccent);
|
|
92
92
|
}
|
|
93
|
-
else
|
|
93
|
+
else {
|
|
94
94
|
var mapping = !isNullOrUndefined(this.fields.value) ? this.fields.value : '';
|
|
95
95
|
filterQuery.where(mapping, filterType, queryString, this.ignoreCase, this.ignoreAccent);
|
|
96
96
|
}
|
|
@@ -106,7 +106,7 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
106
106
|
}
|
|
107
107
|
filterQuery.take(this.suggestionCount);
|
|
108
108
|
}
|
|
109
|
-
if (this.enableVirtualization
|
|
109
|
+
if (this.enableVirtualization) {
|
|
110
110
|
var queryTakeValue = 0;
|
|
111
111
|
var querySkipValue = 0;
|
|
112
112
|
var takeValue = this.getTakeValue();
|
|
@@ -156,14 +156,6 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
156
156
|
}
|
|
157
157
|
filterQuery.requiresCount();
|
|
158
158
|
}
|
|
159
|
-
else if (this.enableVirtualization && (this.dataSource instanceof DataManager && !this.virtualGroupDataSource)) {
|
|
160
|
-
for (var queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
|
|
161
|
-
if (filterQuery.queries[queryElements].fn === 'onSkip' || filterQuery.queries[queryElements].fn === 'onTake') {
|
|
162
|
-
filterQuery.queries.splice(queryElements, 1);
|
|
163
|
-
--queryElements;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
159
|
return filterQuery;
|
|
168
160
|
};
|
|
169
161
|
AutoComplete.prototype.searchLists = function (e) {
|
|
@@ -151,7 +151,7 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
151
151
|
if (this.enableVirtualization && this.value) {
|
|
152
152
|
var fields = (this.fields.value) ? this.fields.value : '';
|
|
153
153
|
var currentValue_1 = this.allowObjectBinding && !isNullOrUndefined(this.value) ? getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
|
|
154
|
-
if (this.dataSource instanceof DataManager
|
|
154
|
+
if (this.dataSource instanceof DataManager) {
|
|
155
155
|
var getItem = new DataManager(this.virtualGroupDataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', currentValue_1)));
|
|
156
156
|
if (getItem && getItem.length > 0) {
|
|
157
157
|
this.itemData = getItem[0];
|
|
@@ -47,6 +47,8 @@ export interface IDropdownlist extends Component<HTMLElement> {
|
|
|
47
47
|
allowFiltering: boolean;
|
|
48
48
|
isPopupOpen: boolean;
|
|
49
49
|
isTyped: boolean;
|
|
50
|
+
setCurrentView: boolean;
|
|
51
|
+
isRequesting: boolean;
|
|
50
52
|
itemCount: number;
|
|
51
53
|
fields: FieldSettingsModel;
|
|
52
54
|
generatedDataObject: GeneratedData;
|
|
@@ -198,9 +198,10 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
198
198
|
var query = this.parent.getForQuery(this.parent.value).clone();
|
|
199
199
|
query = query.skip(0).take(this.parent.itemCount - (this.parent.value.length - this.parent.viewPortInfo.startIndex));
|
|
200
200
|
this.parent.appendUncheckList = true;
|
|
201
|
+
this.parent.setCurrentView = false;
|
|
201
202
|
this.parent.resetList(this.parent.dataSource, this.parent.fields, query);
|
|
202
203
|
isListUpdated = false;
|
|
203
|
-
this.parent.appendUncheckList = false;
|
|
204
|
+
this.parent.appendUncheckList = this.parent.dataSource instanceof DataManager ? this.parent.appendUncheckList : false;
|
|
204
205
|
isListUpdated = false;
|
|
205
206
|
}
|
|
206
207
|
else {
|
|
@@ -223,9 +224,10 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
223
224
|
var query = this.parent.getForQuery(this.parent.value).clone();
|
|
224
225
|
query = query.skip(0).take(this.parent.itemCount - (this.parent.value.length - this.parent.viewPortInfo.startIndex));
|
|
225
226
|
this.parent.appendUncheckList = true;
|
|
227
|
+
this.parent.setCurrentView = false;
|
|
226
228
|
this.parent.resetList(this.parent.dataSource, this.parent.fields, query);
|
|
227
229
|
isListUpdated = false;
|
|
228
|
-
this.parent.appendUncheckList = false;
|
|
230
|
+
this.parent.appendUncheckList = this.parent.dataSource instanceof DataManager ? this.parent.appendUncheckList : false;
|
|
229
231
|
}
|
|
230
232
|
}
|
|
231
233
|
else {
|
|
@@ -236,6 +238,7 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
236
238
|
var query = this.parent.getForQuery(this.parent.value).clone();
|
|
237
239
|
var skipvalue = this.parent.viewPortInfo.startIndex - this.parent.value.length >= 0 ? this.parent.viewPortInfo.startIndex - this.parent.value.length : 0;
|
|
238
240
|
query = query.skip(skipvalue);
|
|
241
|
+
this.parent.setCurrentView = false;
|
|
239
242
|
this.parent.resetList(this.parent.dataSource, this.parent.fields, query);
|
|
240
243
|
isListUpdated = false;
|
|
241
244
|
}
|
|
@@ -257,6 +260,7 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
257
260
|
else {
|
|
258
261
|
query = query.skip(this.parent.viewPortInfo.startIndex);
|
|
259
262
|
}
|
|
263
|
+
this.parent.setCurrentView = false;
|
|
260
264
|
this.parent.resetList(this.parent.dataSource, this.parent.fields, query);
|
|
261
265
|
isResetListCalled = true;
|
|
262
266
|
break;
|
|
@@ -278,6 +282,7 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
278
282
|
else {
|
|
279
283
|
query = query.skip(this.parent.viewPortInfo.startIndex);
|
|
280
284
|
}
|
|
285
|
+
this.parent.setCurrentView = false;
|
|
281
286
|
this.parent.resetList(this.parent.dataSource, this.parent.fields, query);
|
|
282
287
|
isResetListCalled = true;
|
|
283
288
|
}
|
|
@@ -289,6 +294,7 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
289
294
|
currentData.push(alreadyAddedData[0]);
|
|
290
295
|
}
|
|
291
296
|
}
|
|
297
|
+
this.parent.setCurrentView = false;
|
|
292
298
|
}
|
|
293
299
|
}
|
|
294
300
|
if (!isResetListCalled && isListUpdated) {
|
|
@@ -356,6 +362,7 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
356
362
|
if (isStartIndexInitialised && !((this.parent.totalItemCount == queryStartIndex) && (this.parent.totalItemCount == queryEndIndex))) {
|
|
357
363
|
this.parent.virtualItemStartIndex = queryStartIndex;
|
|
358
364
|
this.parent.virtualItemEndIndex = queryEndIndex;
|
|
365
|
+
this.parent.setCurrentView = true;
|
|
359
366
|
this.generateAndExecuteQueryAsync(query, queryStartIndex, queryEndIndex);
|
|
360
367
|
if (this.component === 'multiselect' && this.parent.hideSelectedItem && this.parent.value && Array.isArray(this.parent.value) && this.parent.value.length > 0) {
|
|
361
368
|
this.parent.totalItemsCount();
|
|
@@ -365,7 +372,9 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
365
372
|
this.parent.virtualItemEndIndex = this.parent.viewPortInfo.endIndex;
|
|
366
373
|
}
|
|
367
374
|
}
|
|
368
|
-
this.
|
|
375
|
+
if (!(this.parent.dataSource instanceof DataManager) || (this.parent.dataSource instanceof DataManager && !this.parent.isRequesting)) {
|
|
376
|
+
this.setCurrentViewDataAsync();
|
|
377
|
+
}
|
|
369
378
|
};
|
|
370
379
|
VirtualScroll.prototype.dataProcessAsync = function (isOpenPopup) {
|
|
371
380
|
this.parent.selectedValueInfo = null;
|
|
@@ -398,7 +407,7 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
398
407
|
return [4 /*yield*/, this.dataProcessAsync()];
|
|
399
408
|
case 1:
|
|
400
409
|
_a.sent();
|
|
401
|
-
if (this.parent.keyboardEvent != null) {
|
|
410
|
+
if (this.parent.keyboardEvent != null && (!(this.parent.dataSource instanceof DataManager) || (this.parent.dataSource instanceof DataManager && !this.parent.isRequesting))) {
|
|
402
411
|
this.parent.handleVirtualKeyboardActions(this.parent.keyboardEvent, this.parent.pageCount);
|
|
403
412
|
}
|
|
404
413
|
if (!this.parent.customFilterQuery) {
|
|
@@ -233,6 +233,7 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
|
|
|
233
233
|
private isCheckBoxSelection;
|
|
234
234
|
protected totalItemCount: number;
|
|
235
235
|
protected dataCount: number;
|
|
236
|
+
protected remoteDataCount: number;
|
|
236
237
|
protected isRemoteDataUpdated: boolean;
|
|
237
238
|
protected virtualGroupDataSource: {
|
|
238
239
|
[key: string]: Object;
|
|
@@ -277,6 +278,7 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
|
|
|
277
278
|
protected appendUncheckList: boolean;
|
|
278
279
|
protected getInitialData: boolean;
|
|
279
280
|
protected preventPopupOpen: boolean;
|
|
281
|
+
protected setCurrentView: boolean;
|
|
280
282
|
protected customFilterQuery: Query;
|
|
281
283
|
protected virtualSelectAllData: {
|
|
282
284
|
[key: string]: Object;
|
|
@@ -563,6 +565,7 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
|
|
|
563
565
|
* @returns {void}
|
|
564
566
|
*/
|
|
565
567
|
private setListData;
|
|
568
|
+
protected handleVirtualKeyboardActions(e: KeyboardEventArgs, pageCount: number): void;
|
|
566
569
|
protected updatePopupState(): void;
|
|
567
570
|
protected updateRemoteData(): void;
|
|
568
571
|
private bindChildItems;
|
|
@@ -100,9 +100,10 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
100
100
|
_this.isCheckBoxSelection = false;
|
|
101
101
|
_this.totalItemCount = 0;
|
|
102
102
|
_this.dataCount = 0;
|
|
103
|
+
_this.remoteDataCount = -1;
|
|
103
104
|
_this.isRemoteDataUpdated = false;
|
|
104
105
|
_this.isIncrementalRequest = false;
|
|
105
|
-
_this.itemCount =
|
|
106
|
+
_this.itemCount = 30;
|
|
106
107
|
_this.virtualListHeight = 0;
|
|
107
108
|
_this.isVirtualScrolling = false;
|
|
108
109
|
_this.isPreventScrollAction = false;
|
|
@@ -129,7 +130,6 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
129
130
|
_this.appendUncheckList = false;
|
|
130
131
|
_this.getInitialData = false;
|
|
131
132
|
_this.preventPopupOpen = true;
|
|
132
|
-
_this.customFilterQuery = new Query();
|
|
133
133
|
_this.virtualListInfo = {
|
|
134
134
|
currentPageNumber: null,
|
|
135
135
|
direction: null,
|
|
@@ -405,10 +405,9 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
405
405
|
this.virtualListInfo = this.viewPortInfo;
|
|
406
406
|
};
|
|
407
407
|
DropDownBase.prototype.getFilteringSkeletonCount = function () {
|
|
408
|
-
var difference = this.dataCount - this.viewPortInfo.endIndex;
|
|
409
408
|
var currentSkeletonCount = this.skeletonCount;
|
|
410
409
|
this.getSkeletonCount(true);
|
|
411
|
-
this.skeletonCount = this.dataCount > this.itemCount * 2 ? this.skeletonCount :
|
|
410
|
+
this.skeletonCount = this.dataCount > this.itemCount * 2 ? this.skeletonCount : 0;
|
|
412
411
|
var skeletonUpdated = true;
|
|
413
412
|
if ((this.getModuleName() === 'autocomplete' || this.getModuleName() === 'multiselect') && (this.totalItemCount < (this.itemCount * 2))) {
|
|
414
413
|
this.skeletonCount = 0;
|
|
@@ -442,10 +441,10 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
442
441
|
DropDownBase.prototype.getSkeletonCount = function (retainSkeleton) {
|
|
443
442
|
this.virtualListHeight = this.listContainerHeight != null ? parseInt(this.listContainerHeight, 10) : this.virtualListHeight;
|
|
444
443
|
var actualCount = this.virtualListHeight > 0 ? Math.floor(this.virtualListHeight / this.listItemHeight) : 0;
|
|
445
|
-
this.skeletonCount = actualCount *
|
|
444
|
+
this.skeletonCount = actualCount * 4 < this.itemCount ? this.itemCount : actualCount * 4;
|
|
446
445
|
this.itemCount = retainSkeleton ? this.itemCount : this.skeletonCount;
|
|
447
446
|
this.virtualItemCount = this.itemCount;
|
|
448
|
-
this.skeletonCount = Math.floor(this.skeletonCount / 2)
|
|
447
|
+
this.skeletonCount = Math.floor(this.skeletonCount / 2);
|
|
449
448
|
};
|
|
450
449
|
DropDownBase.prototype.GetVirtualTrackHeight = function () {
|
|
451
450
|
var height = this.totalItemCount === this.viewPortInfo.endIndex ? this.totalItemCount * this.listItemHeight - this.itemCount * this.listItemHeight : this.totalItemCount * this.listItemHeight;
|
|
@@ -670,41 +669,53 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
670
669
|
if (!eventArgs.cancel) {
|
|
671
670
|
_this.isRequesting = true;
|
|
672
671
|
_this.showSpinner();
|
|
673
|
-
if (dataSource instanceof DataManager
|
|
672
|
+
if (dataSource instanceof DataManager) {
|
|
674
673
|
_this.isRequested = true;
|
|
674
|
+
var isWhereExist_1 = false;
|
|
675
675
|
if (_this.isDataFetched) {
|
|
676
676
|
_this.emptyDataRequest(fields);
|
|
677
677
|
return;
|
|
678
678
|
}
|
|
679
679
|
eventArgs.data.executeQuery(_this.getQuery(eventArgs.query)).then(function (e) {
|
|
680
680
|
_this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
681
|
+
var isReOrder = true;
|
|
682
|
+
if (!_this.virtualSelectAll) {
|
|
683
|
+
var newQuery = _this.getQuery(eventArgs.query);
|
|
684
|
+
for (var queryElements = 0; queryElements < newQuery.queries.length; queryElements++) {
|
|
685
|
+
if (newQuery.queries[queryElements].fn === 'onWhere') {
|
|
686
|
+
isWhereExist_1 = true;
|
|
686
687
|
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
688
|
+
}
|
|
689
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
690
|
+
if (_this.isVirtualizationEnabled && (e.count != 0 && e.count < (_this.itemCount * 2))) {
|
|
691
|
+
if (newQuery) {
|
|
692
|
+
for (var queryElements = 0; queryElements < newQuery.queries.length; queryElements++) {
|
|
693
|
+
if (newQuery.queries[queryElements].fn === 'onTake') {
|
|
694
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
695
|
+
newQuery.queries[queryElements].e.nos = e.count;
|
|
696
|
+
}
|
|
697
|
+
if (_this.getModuleName() === 'multiselect' && (newQuery.queries[queryElements].e.condition == 'or' || newQuery.queries[queryElements].e.operator == 'equal')) {
|
|
698
|
+
isReOrder = false;
|
|
699
|
+
}
|
|
692
700
|
}
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
else {
|
|
704
|
+
_this.isVirtualTrackHeight = false;
|
|
705
|
+
if (newQuery) {
|
|
706
|
+
for (var queryElements = 0; queryElements < newQuery.queries.length; queryElements++) {
|
|
707
|
+
if (_this.getModuleName() === 'multiselect' && ((newQuery.queries[queryElements].e && newQuery.queries[queryElements].e.condition == 'or') || (newQuery.queries[queryElements].e && newQuery.queries[queryElements].e.operator == 'equal'))) {
|
|
708
|
+
isReOrder = false;
|
|
709
|
+
}
|
|
700
710
|
}
|
|
701
711
|
}
|
|
702
|
-
_this.hideSpinner();
|
|
703
|
-
_this.isRequested = false;
|
|
704
|
-
_this.isRequesting = false;
|
|
705
|
-
_this.updatePopupState();
|
|
706
|
-
return;
|
|
707
712
|
}
|
|
713
|
+
}
|
|
714
|
+
if (isReOrder) {
|
|
715
|
+
// eslint-disable @typescript-eslint/no-explicit-any
|
|
716
|
+
_this.dataCount = _this.totalItemCount = e.count;
|
|
717
|
+
}
|
|
718
|
+
_this.trigger('actionComplete', e, function (e) {
|
|
708
719
|
if (!e.cancel) {
|
|
709
720
|
_this.isRequesting = false;
|
|
710
721
|
var listItems = e.result;
|
|
@@ -712,12 +723,16 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
712
723
|
ulElement = _this.renderItems(listItems, fields);
|
|
713
724
|
return;
|
|
714
725
|
}
|
|
715
|
-
if (listItems.length === 0) {
|
|
726
|
+
if ((!_this.isVirtualizationEnabled && listItems.length === 0) || (_this.isVirtualizationEnabled && listItems.length === 0 && !isWhereExist_1)) {
|
|
716
727
|
_this.isDataFetched = true;
|
|
717
728
|
}
|
|
729
|
+
if (!isWhereExist_1) {
|
|
730
|
+
_this.remoteDataCount = e.count;
|
|
731
|
+
}
|
|
718
732
|
_this.dataCount = e.count;
|
|
719
733
|
_this.totalItemCount = e.count;
|
|
720
734
|
ulElement = _this.renderItems(listItems, fields);
|
|
735
|
+
_this.appendUncheckList = false;
|
|
721
736
|
_this.onActionComplete(ulElement, listItems, e);
|
|
722
737
|
if (_this.groupTemplate) {
|
|
723
738
|
_this.renderGroupTemplate(ulElement);
|
|
@@ -730,6 +745,17 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
730
745
|
_this.preventPopupOpen = false;
|
|
731
746
|
return;
|
|
732
747
|
}
|
|
748
|
+
if (_this.isVirtualizationEnabled && _this.setCurrentView) {
|
|
749
|
+
_this.notify("setCurrentViewDataAsync", {
|
|
750
|
+
module: "VirtualScroll",
|
|
751
|
+
});
|
|
752
|
+
}
|
|
753
|
+
if (_this.keyboardEvent != null) {
|
|
754
|
+
_this.handleVirtualKeyboardActions(_this.keyboardEvent, _this.pageCount);
|
|
755
|
+
}
|
|
756
|
+
if (_this.isVirtualizationEnabled) {
|
|
757
|
+
_this.getFilteringSkeletonCount();
|
|
758
|
+
}
|
|
733
759
|
}
|
|
734
760
|
});
|
|
735
761
|
}).catch(function (e) {
|
|
@@ -766,7 +792,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
766
792
|
}
|
|
767
793
|
if (isReOrder) {
|
|
768
794
|
listItems = (newQuery).executeLocal(dataManager);
|
|
769
|
-
_this.isVirtualTrackHeight = true;
|
|
795
|
+
_this.isVirtualTrackHeight = (!(_this.dataSource instanceof DataManager) && !_this.isCustomDataUpdated) ? true : false;
|
|
770
796
|
}
|
|
771
797
|
}
|
|
772
798
|
}
|
|
@@ -781,7 +807,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
781
807
|
}
|
|
782
808
|
}
|
|
783
809
|
}
|
|
784
|
-
if (isReOrder) {
|
|
810
|
+
if (isReOrder && (!(_this.dataSource instanceof DataManager) && !_this.isCustomDataUpdated)) {
|
|
785
811
|
// eslint-disable @typescript-eslint/no-explicit-any
|
|
786
812
|
_this.dataCount = _this.totalItemCount = _this.virtualSelectAll ? listItems.length : listItems.count;
|
|
787
813
|
}
|
|
@@ -818,6 +844,9 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
818
844
|
});
|
|
819
845
|
}
|
|
820
846
|
};
|
|
847
|
+
DropDownBase.prototype.handleVirtualKeyboardActions = function (e, pageCount) {
|
|
848
|
+
// Used this method in component side.
|
|
849
|
+
};
|
|
821
850
|
DropDownBase.prototype.updatePopupState = function () {
|
|
822
851
|
// Used this method in component side.
|
|
823
852
|
};
|
|
@@ -929,6 +958,9 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
929
958
|
addClass([ulElement.children[i]], HIDE_GROUPLIST);
|
|
930
959
|
}
|
|
931
960
|
}
|
|
961
|
+
if (ulElement.children[0].classList.contains('e-hide-group-header')) {
|
|
962
|
+
setStyleAttribute(ulElement.children[1], { zIndex: 11 });
|
|
963
|
+
}
|
|
932
964
|
}
|
|
933
965
|
}
|
|
934
966
|
if (!isNullOrUndefined(this.list)) {
|
|
@@ -1077,19 +1109,11 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
1077
1109
|
for (var i = topIndex; i > -1; i--) {
|
|
1078
1110
|
var index = this.isVirtualizationEnabled ? i + virtualListCount : i;
|
|
1079
1111
|
if (this.isVirtualizationEnabled) {
|
|
1080
|
-
var groupListLength = this.list.querySelectorAll('.e-list-group-item').length;
|
|
1081
|
-
var loadedGroupList = 0;
|
|
1082
1112
|
if (isCount) {
|
|
1083
1113
|
count++;
|
|
1084
1114
|
}
|
|
1085
1115
|
if (this.fixedHeaderElement && this.updateGroupHeader(index, liCollections, target)) {
|
|
1086
|
-
|
|
1087
|
-
if (count >= this.getPageCount()) {
|
|
1088
|
-
break;
|
|
1089
|
-
}
|
|
1090
|
-
if (groupListLength <= loadedGroupList) {
|
|
1091
|
-
break;
|
|
1092
|
-
}
|
|
1116
|
+
break;
|
|
1093
1117
|
}
|
|
1094
1118
|
if (isDownkey) {
|
|
1095
1119
|
if ((!isNullOrUndefined(liCollections[index]) && liCollections[index].classList.contains(dropDownBaseClasses.selected) && this.getModuleName() !== 'autocomplete') || (!isNullOrUndefined(liCollections[index]) && liCollections[index].classList.contains(dropDownBaseClasses.focus) && this.getModuleName() === 'autocomplete')) {
|
|
@@ -436,7 +436,7 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
436
436
|
private updateHomeEndAction;
|
|
437
437
|
protected selectCurrentValueOnTab(e: KeyboardEventArgs): void;
|
|
438
438
|
protected mobileKeyActionHandler(e: KeyboardEventArgs): void;
|
|
439
|
-
|
|
439
|
+
protected handleVirtualKeyboardActions(e: KeyboardEventArgs, pageCount: number): void;
|
|
440
440
|
protected selectCurrentItem(e: KeyboardEventArgs): void;
|
|
441
441
|
protected isSelectFocusItem(element: Element): boolean;
|
|
442
442
|
private pageUpSelection;
|
|
@@ -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
|