@syncfusion/ej2-dropdowns 23.2.7 → 24.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 +19 -131
- 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 +653 -116
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +657 -119
- 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 +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 +153 -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/drop-down-tree/_layout.scss +6 -0
- package/styles/drop-down-tree/fluent-dark.css +2 -0
- package/styles/drop-down-tree/fluent.css +2 -0
- package/styles/fluent-dark.css +2 -0
- package/styles/fluent.css +2 -0
|
@@ -12,6 +12,7 @@ import { TreeView } from '@syncfusion/ej2-navigations';
|
|
|
12
12
|
*/
|
|
13
13
|
var queryString = '';
|
|
14
14
|
var prevString = '';
|
|
15
|
+
var tempQueryString = '';
|
|
15
16
|
var matches$1 = [];
|
|
16
17
|
var activeClass = 'e-active';
|
|
17
18
|
var prevElementId = '';
|
|
@@ -26,21 +27,49 @@ var prevElementId = '';
|
|
|
26
27
|
* @param {string} elementId - Specifies the list element ID.
|
|
27
28
|
* @returns {Element} Returns list item based on key code matches with list text content.
|
|
28
29
|
*/
|
|
29
|
-
function incrementalSearch(keyCode, items, selectedIndex, ignoreCase, elementId) {
|
|
30
|
-
queryString
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
function incrementalSearch(keyCode, items, selectedIndex, ignoreCase, elementId, queryStringUpdated, currentValue, isVirtual, refresh) {
|
|
31
|
+
if (!queryStringUpdated || queryString === '') {
|
|
32
|
+
if (tempQueryString != '') {
|
|
33
|
+
queryString = tempQueryString + String.fromCharCode(keyCode);
|
|
34
|
+
tempQueryString = '';
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
queryString += String.fromCharCode(keyCode);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
else if (queryString == prevString) {
|
|
41
|
+
tempQueryString = String.fromCharCode(keyCode);
|
|
42
|
+
}
|
|
43
|
+
if (isVirtual) {
|
|
44
|
+
setTimeout(function () {
|
|
45
|
+
tempQueryString = '';
|
|
46
|
+
}, 700);
|
|
47
|
+
setTimeout(function () {
|
|
48
|
+
queryString = '';
|
|
49
|
+
}, 3000);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
setTimeout(function () {
|
|
53
|
+
queryString = '';
|
|
54
|
+
}, 1000);
|
|
55
|
+
}
|
|
34
56
|
var index;
|
|
35
57
|
queryString = ignoreCase ? queryString.toLowerCase() : queryString;
|
|
36
|
-
if (prevElementId === elementId && prevString === queryString) {
|
|
58
|
+
if (prevElementId === elementId && prevString === queryString && !refresh) {
|
|
37
59
|
for (var i = 0; i < matches$1.length; i++) {
|
|
38
60
|
if (matches$1[i].classList.contains(activeClass)) {
|
|
39
61
|
index = i;
|
|
40
62
|
break;
|
|
41
63
|
}
|
|
64
|
+
if (currentValue && matches$1[i].textContent.toLowerCase() === currentValue.toLowerCase()) {
|
|
65
|
+
index = i;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
42
68
|
}
|
|
43
69
|
index = index + 1;
|
|
70
|
+
if (isVirtual) {
|
|
71
|
+
return matches$1[index] && matches$1.length - 1 != index ? matches$1[index] : matches$1[matches$1.length];
|
|
72
|
+
}
|
|
44
73
|
return matches$1[index] ? matches$1[index] : matches$1[0];
|
|
45
74
|
}
|
|
46
75
|
else {
|
|
@@ -70,6 +99,20 @@ function incrementalSearch(keyCode, items, selectedIndex, ignoreCase, elementId)
|
|
|
70
99
|
} while (i !== selectedIndex);
|
|
71
100
|
prevString = queryString;
|
|
72
101
|
prevElementId = elementId;
|
|
102
|
+
if (isVirtual) {
|
|
103
|
+
var indexUpdated = false;
|
|
104
|
+
for (var i_1 = 0; i_1 < matches$1.length; i_1++) {
|
|
105
|
+
if (currentValue && matches$1[i_1].textContent.toLowerCase() === currentValue.toLowerCase()) {
|
|
106
|
+
index = i_1;
|
|
107
|
+
indexUpdated = true;
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (currentValue && indexUpdated) {
|
|
112
|
+
index = index + 1;
|
|
113
|
+
}
|
|
114
|
+
return matches$1[index] ? matches$1[index] : matches$1[0];
|
|
115
|
+
}
|
|
73
116
|
return matches$1[0];
|
|
74
117
|
}
|
|
75
118
|
}
|
|
@@ -106,7 +149,7 @@ function Search(inputVal, items, searchType, ignoreCase, dataSource, fields, typ
|
|
|
106
149
|
});
|
|
107
150
|
});
|
|
108
151
|
}
|
|
109
|
-
text = dataSource && filterValue ? (ignoreCase ? filterValue.toLocaleLowerCase() : filterValue).replace(/^\s+|\s+$/g, '') : (ignoreCase ? item.textContent.toLocaleLowerCase() : item.textContent).replace(/^\s+|\s+$/g, '');
|
|
152
|
+
text = dataSource && filterValue ? (ignoreCase ? filterValue.toString().toLocaleLowerCase() : filterValue).replace(/^\s+|\s+$/g, '') : (ignoreCase ? item.textContent.toLocaleLowerCase() : item.textContent).replace(/^\s+|\s+$/g, '');
|
|
110
153
|
/* eslint-disable security/detect-non-literal-regexp */
|
|
111
154
|
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))) {
|
|
112
155
|
itemData.item = item;
|
|
@@ -344,9 +387,24 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
344
387
|
query = this.getPageQuery(query, virtualItemStartIndex, virtualItemEndIndex);
|
|
345
388
|
}
|
|
346
389
|
}
|
|
390
|
+
var tempCustomFilter = this.parent.isCustomFilter;
|
|
391
|
+
if (this.component === 'combobox') {
|
|
392
|
+
var totalData = 0;
|
|
393
|
+
if (this.parent.dataSource instanceof DataManager) {
|
|
394
|
+
totalData = this.parent.dataSource.dataSource.json.length;
|
|
395
|
+
}
|
|
396
|
+
else if (this.parent.dataSource && this.parent.dataSource.length > 0) {
|
|
397
|
+
totalData = this.parent.dataSource.length;
|
|
398
|
+
}
|
|
399
|
+
if (totalData > 0) {
|
|
400
|
+
this.parent.isCustomFilter = (totalData == this.parent.totalItemCount && this.parent.queryString != this.parent.typedString) ? true : this.parent.isCustomFilter;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
347
403
|
this.parent.resetList(dataSource, this.parent.fields, query);
|
|
404
|
+
this.parent.isCustomFilter = tempCustomFilter;
|
|
348
405
|
};
|
|
349
406
|
VirtualScroll.prototype.removeSkipAndTakeEvents = function (query) {
|
|
407
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
350
408
|
query.queries = query.queries.filter(function (event) {
|
|
351
409
|
return event.fn !== 'onSkip' && event.fn !== 'onTake';
|
|
352
410
|
});
|
|
@@ -375,6 +433,9 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
375
433
|
if (virtualContentElement) {
|
|
376
434
|
(virtualContentElement).style = this.parent.getTransformValues();
|
|
377
435
|
}
|
|
436
|
+
if (this.parent.fields.groupBy) {
|
|
437
|
+
this.parent.scrollStop();
|
|
438
|
+
}
|
|
378
439
|
};
|
|
379
440
|
VirtualScroll.prototype.generateQueryAndSetQueryIndexAsync = function (query, isPopupOpen) {
|
|
380
441
|
var isStartIndexInitialised = false;
|
|
@@ -425,6 +486,9 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
|
|
|
425
486
|
}
|
|
426
487
|
else {
|
|
427
488
|
this.parent.getSkeletonCount(true);
|
|
489
|
+
if (this.component === 'combobox') {
|
|
490
|
+
this.parent.skeletonCount = this.parent.totalItemCount != 0 && this.parent.totalItemCount < (this.parent.itemCount * 2) ? 0 : this.parent.skeletonCount;
|
|
491
|
+
}
|
|
428
492
|
}
|
|
429
493
|
}
|
|
430
494
|
return [4 /*yield*/, this.dataProcessAsync()];
|
|
@@ -678,6 +742,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
678
742
|
_this.virtualizedItemsCount = 0;
|
|
679
743
|
_this.totalItemCount = 0;
|
|
680
744
|
_this.dataCount = 0;
|
|
745
|
+
_this.isRemoteDataUpdated = false;
|
|
746
|
+
_this.isIncrementalRequest = false;
|
|
747
|
+
_this.itemCount = 10;
|
|
681
748
|
return _this;
|
|
682
749
|
}
|
|
683
750
|
DropDownBase.prototype.getPropObject = function (prop, newProp, oldProp) {
|
|
@@ -1074,7 +1141,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1074
1141
|
if (!eventArgs.cancel) {
|
|
1075
1142
|
_this.isRequesting = true;
|
|
1076
1143
|
_this.showSpinner();
|
|
1077
|
-
if (dataSource instanceof DataManager) {
|
|
1144
|
+
if (dataSource instanceof DataManager && !_this.virtualGroupDataSource) {
|
|
1078
1145
|
_this.isRequested = true;
|
|
1079
1146
|
if (_this.isDataFetched) {
|
|
1080
1147
|
_this.emptyDataRequest(fields);
|
|
@@ -1083,8 +1150,39 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1083
1150
|
eventArgs.data.executeQuery(_this.getQuery(eventArgs.query)).then(function (e) {
|
|
1084
1151
|
_this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;
|
|
1085
1152
|
_this.trigger('actionComplete', e, function (e) {
|
|
1153
|
+
if (!_this.virtualGroupDataSource && _this.isVirtualizationEnabled) {
|
|
1154
|
+
_this.isRemoteDataUpdated = true;
|
|
1155
|
+
if ((_this.getModuleName() === 'combobox' && _this.isAllowFiltering && _this.isVirtualizationEnabled && e.result)) {
|
|
1156
|
+
e.result = e.result.result;
|
|
1157
|
+
}
|
|
1158
|
+
if (e.result.length > 0) {
|
|
1159
|
+
var dataSource_2 = e.result;
|
|
1160
|
+
if (_this.isVirtualizationEnabled && _this.fields.groupBy) {
|
|
1161
|
+
var data = new DataManager(dataSource_2).executeLocal(new Query().group(_this.fields.groupBy));
|
|
1162
|
+
_this.virtualGroupDataSource = data.records;
|
|
1163
|
+
}
|
|
1164
|
+
else {
|
|
1165
|
+
_this.virtualGroupDataSource = dataSource_2;
|
|
1166
|
+
_this.hideSpinner();
|
|
1167
|
+
_this.isRequested = false;
|
|
1168
|
+
_this.isRequesting = false;
|
|
1169
|
+
_this.setListData(dataSource_2, fields, query, event);
|
|
1170
|
+
return;
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
_this.hideSpinner();
|
|
1174
|
+
_this.isRequested = false;
|
|
1175
|
+
_this.isRequesting = false;
|
|
1176
|
+
_this.updatePopupState();
|
|
1177
|
+
return;
|
|
1178
|
+
}
|
|
1086
1179
|
if (!e.cancel) {
|
|
1180
|
+
_this.isRequesting = false;
|
|
1087
1181
|
var listItems = e.result;
|
|
1182
|
+
if (_this.isIncrementalRequest) {
|
|
1183
|
+
ulElement = _this.renderItems(listItems, fields);
|
|
1184
|
+
return;
|
|
1185
|
+
}
|
|
1088
1186
|
if (listItems.length === 0) {
|
|
1089
1187
|
_this.isDataFetched = true;
|
|
1090
1188
|
}
|
|
@@ -1098,7 +1196,6 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1098
1196
|
_this.isRequested = false;
|
|
1099
1197
|
_this.bindChildItems(listItems, ulElement, fields, e);
|
|
1100
1198
|
}
|
|
1101
|
-
_this.isRequesting = false;
|
|
1102
1199
|
});
|
|
1103
1200
|
}).catch(function (e) {
|
|
1104
1201
|
_this.isRequested = false;
|
|
@@ -1109,8 +1206,25 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1109
1206
|
}
|
|
1110
1207
|
else {
|
|
1111
1208
|
_this.isRequesting = false;
|
|
1112
|
-
var
|
|
1113
|
-
|
|
1209
|
+
var listItems = void 0;
|
|
1210
|
+
if (_this.isVirtualizationEnabled && !_this.virtualGroupDataSource && _this.fields.groupBy) {
|
|
1211
|
+
var data = new DataManager(_this.dataSource).executeLocal(new Query().group(_this.fields.groupBy));
|
|
1212
|
+
_this.virtualGroupDataSource = data.records;
|
|
1213
|
+
}
|
|
1214
|
+
var dataManager = _this.isVirtualizationEnabled && _this.virtualGroupDataSource ? new DataManager(_this.virtualGroupDataSource) : new DataManager(eventArgs.data);
|
|
1215
|
+
listItems = (_this.getQuery(eventArgs.query)).executeLocal(dataManager);
|
|
1216
|
+
if (_this.isVirtualizationEnabled && _this.getModuleName() === 'autocomplete' && (listItems.count != 0 && listItems.count < (_this.itemCount * 2))) {
|
|
1217
|
+
var newQuery = _this.getQuery(eventArgs.query);
|
|
1218
|
+
if (newQuery) {
|
|
1219
|
+
for (var queryElements = 0; queryElements < newQuery.queries.length; queryElements++) {
|
|
1220
|
+
if (newQuery.queries[queryElements].fn === 'onTake') {
|
|
1221
|
+
newQuery.queries[queryElements].e.nos = listItems.count;
|
|
1222
|
+
listItems = (newQuery).executeLocal(dataManager);
|
|
1223
|
+
break;
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1114
1228
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1115
1229
|
_this.dataCount = listItems.count;
|
|
1116
1230
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -1120,6 +1234,10 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1120
1234
|
var localDataArgs = { cancel: false, result: listItems };
|
|
1121
1235
|
_this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;
|
|
1122
1236
|
_this.trigger('actionComplete', localDataArgs, function (localDataArgs) {
|
|
1237
|
+
if (_this.isIncrementalRequest) {
|
|
1238
|
+
ulElement = _this.renderItems(localDataArgs.result, fields);
|
|
1239
|
+
return;
|
|
1240
|
+
}
|
|
1123
1241
|
if (!localDataArgs.cancel) {
|
|
1124
1242
|
ulElement = _this.renderItems(localDataArgs.result, fields);
|
|
1125
1243
|
_this.onActionComplete(ulElement, localDataArgs.result, event);
|
|
@@ -1139,6 +1257,12 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1139
1257
|
});
|
|
1140
1258
|
}
|
|
1141
1259
|
};
|
|
1260
|
+
DropDownBase.prototype.updatePopupState = function () {
|
|
1261
|
+
// Used this method in component side.
|
|
1262
|
+
};
|
|
1263
|
+
DropDownBase.prototype.updateRemoteData = function () {
|
|
1264
|
+
this.setListData(this.dataSource, this.fields, this.query);
|
|
1265
|
+
};
|
|
1142
1266
|
DropDownBase.prototype.bindChildItems = function (listItems, ulElement, fields, e) {
|
|
1143
1267
|
var _this = this;
|
|
1144
1268
|
if (listItems.length >= 100 && this.getModuleName() === 'autocomplete') {
|
|
@@ -1226,7 +1350,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1226
1350
|
if (this.isReact) {
|
|
1227
1351
|
this.clearTemplate(['itemTemplate', 'groupTemplate', 'actionFailureTemplate', 'noRecordsTemplate']);
|
|
1228
1352
|
}
|
|
1229
|
-
|
|
1353
|
+
if (!this.isVirtualizationEnabled) {
|
|
1354
|
+
this.fixedHeaderElement = isNullOrUndefined(this.fixedHeaderElement) ? this.fixedHeaderElement : null;
|
|
1355
|
+
}
|
|
1230
1356
|
if (this.getModuleName() === 'multiselect' && this.properties.allowCustomValue && this.fields.groupBy) {
|
|
1231
1357
|
for (var i = 0; i < ulElement.childElementCount; i++) {
|
|
1232
1358
|
if (ulElement.children[i].classList.contains('e-list-group-item')) {
|
|
@@ -1367,25 +1493,67 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1367
1493
|
this.scrollStop(e);
|
|
1368
1494
|
}
|
|
1369
1495
|
};
|
|
1370
|
-
DropDownBase.prototype.scrollStop = function (e) {
|
|
1496
|
+
DropDownBase.prototype.scrollStop = function (e, isDownkey) {
|
|
1371
1497
|
var target = !isNullOrUndefined(e) ? e.target : this.list;
|
|
1372
1498
|
var liHeight = parseInt(getComputedStyle(this.getValidLi(), null).getPropertyValue('height'), 10);
|
|
1373
1499
|
var topIndex = Math.round(target.scrollTop / liHeight);
|
|
1374
1500
|
var liCollections = this.list.querySelectorAll('li' + ':not(.e-hide-listitem)');
|
|
1501
|
+
var virtualListCount = this.list.querySelectorAll('.e-virtual-list').length;
|
|
1502
|
+
var count = 0;
|
|
1503
|
+
var isCount = false;
|
|
1375
1504
|
for (var i = topIndex; i > -1; i--) {
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1505
|
+
var index = this.isVirtualizationEnabled ? i + virtualListCount : i;
|
|
1506
|
+
if (this.isVirtualizationEnabled) {
|
|
1507
|
+
var groupListLength = this.list.querySelectorAll('.e-list-group-item').length;
|
|
1508
|
+
var loadedGroupList = 0;
|
|
1509
|
+
if (isCount) {
|
|
1510
|
+
count++;
|
|
1511
|
+
}
|
|
1512
|
+
if (this.updateGroupHeader(index, liCollections, target)) {
|
|
1513
|
+
loadedGroupList++;
|
|
1514
|
+
if (count >= this.getPageCount()) {
|
|
1515
|
+
break;
|
|
1516
|
+
}
|
|
1517
|
+
if (groupListLength <= loadedGroupList) {
|
|
1518
|
+
break;
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
if (isDownkey) {
|
|
1522
|
+
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')) {
|
|
1523
|
+
count++;
|
|
1524
|
+
isCount = true;
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1382
1527
|
}
|
|
1383
1528
|
else {
|
|
1384
|
-
this.
|
|
1385
|
-
|
|
1529
|
+
if (this.updateGroupHeader(index, liCollections, target)) {
|
|
1530
|
+
break;
|
|
1531
|
+
}
|
|
1386
1532
|
}
|
|
1387
1533
|
}
|
|
1388
1534
|
};
|
|
1535
|
+
DropDownBase.prototype.getPageCount = function (returnExactCount) {
|
|
1536
|
+
var liHeight = this.list.classList.contains(dropDownBaseClasses.noData) ? null :
|
|
1537
|
+
getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
|
|
1538
|
+
var pageCount = Math.round(this.list.getBoundingClientRect().height / parseInt(liHeight, 10));
|
|
1539
|
+
return returnExactCount ? pageCount : Math.round(pageCount);
|
|
1540
|
+
};
|
|
1541
|
+
DropDownBase.prototype.updateGroupHeader = function (index, liCollections, target) {
|
|
1542
|
+
if (!isNullOrUndefined(liCollections[index]) && liCollections[index].classList.contains(dropDownBaseClasses.group)) {
|
|
1543
|
+
this.updateGroupFixedHeader(liCollections[index], target);
|
|
1544
|
+
return true;
|
|
1545
|
+
}
|
|
1546
|
+
else {
|
|
1547
|
+
this.fixedHeaderElement.style.display = 'none';
|
|
1548
|
+
this.fixedHeaderElement.style.top = 'none';
|
|
1549
|
+
return false;
|
|
1550
|
+
}
|
|
1551
|
+
};
|
|
1552
|
+
DropDownBase.prototype.updateGroupFixedHeader = function (element, target) {
|
|
1553
|
+
this.fixedHeaderElement.innerHTML = element.innerHTML;
|
|
1554
|
+
this.fixedHeaderElement.style.top = target.scrollTop + 'px';
|
|
1555
|
+
this.fixedHeaderElement.style.display = 'block';
|
|
1556
|
+
};
|
|
1389
1557
|
DropDownBase.prototype.getValidLi = function () {
|
|
1390
1558
|
return this.liCollections[0];
|
|
1391
1559
|
};
|
|
@@ -1419,45 +1587,54 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1419
1587
|
var virtualUlElement = this.list.querySelector('.e-virtual-ddl-content');
|
|
1420
1588
|
if ((listData.length >= this.virtualizedItemsCount && oldUlElement && virtualUlElement) || (oldUlElement && virtualUlElement && this.isAllowFiltering) || (oldUlElement && virtualUlElement && this.getModuleName() === 'autocomplete')) {
|
|
1421
1589
|
virtualUlElement.replaceChild(ulElement, oldUlElement);
|
|
1422
|
-
this.
|
|
1423
|
-
this.ulElement = this.list.querySelector('ul');
|
|
1424
|
-
this.listData = listData;
|
|
1425
|
-
this.postRender(this.list, listData, this.bindEvent);
|
|
1590
|
+
this.updateListElements(listData);
|
|
1426
1591
|
}
|
|
1427
1592
|
else if ((!virtualUlElement)) {
|
|
1428
1593
|
this.list.innerHTML = '';
|
|
1429
|
-
this.
|
|
1430
|
-
this.
|
|
1431
|
-
this.
|
|
1432
|
-
this.listData = listData;
|
|
1433
|
-
this.postRender(this.list, listData, this.bindEvent);
|
|
1594
|
+
this.createVirtualContent();
|
|
1595
|
+
this.list.querySelector('.e-virtual-ddl-content').appendChild(ulElement);
|
|
1596
|
+
this.updateListElements(listData);
|
|
1434
1597
|
}
|
|
1435
1598
|
}
|
|
1436
1599
|
}
|
|
1437
1600
|
else {
|
|
1438
1601
|
ulElement = this.createListItems(listData, fields);
|
|
1602
|
+
if (this.isIncrementalRequest) {
|
|
1603
|
+
this.incrementalLiCollections = ulElement.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
1604
|
+
this.incrementalUlElement = ulElement;
|
|
1605
|
+
this.incrementalListData = listData;
|
|
1606
|
+
return ulElement;
|
|
1607
|
+
}
|
|
1439
1608
|
if (this.isVirtualizationEnabled) {
|
|
1440
1609
|
var oldUlElement = this.list.querySelector('.e-list-parent');
|
|
1441
1610
|
var virtualUlElement = this.list.querySelector('.e-virtual-ddl-content');
|
|
1442
1611
|
if ((listData.length >= this.virtualizedItemsCount && oldUlElement && virtualUlElement) || (oldUlElement && virtualUlElement && this.isAllowFiltering) || (oldUlElement && virtualUlElement && this.getModuleName() === 'autocomplete')) {
|
|
1443
1612
|
virtualUlElement.replaceChild(ulElement, oldUlElement);
|
|
1444
|
-
this.
|
|
1445
|
-
this.ulElement = this.list.querySelector('ul');
|
|
1446
|
-
this.listData = listData;
|
|
1447
|
-
this.postRender(this.list, listData, this.bindEvent);
|
|
1613
|
+
this.updateListElements(listData);
|
|
1448
1614
|
}
|
|
1449
1615
|
else if ((!virtualUlElement)) {
|
|
1450
1616
|
this.list.innerHTML = '';
|
|
1451
|
-
this.
|
|
1452
|
-
this.
|
|
1453
|
-
this.
|
|
1454
|
-
this.listData = listData;
|
|
1455
|
-
this.postRender(this.list, listData, this.bindEvent);
|
|
1617
|
+
this.createVirtualContent();
|
|
1618
|
+
this.list.querySelector('.e-virtual-ddl-content').appendChild(ulElement);
|
|
1619
|
+
this.updateListElements(listData);
|
|
1456
1620
|
}
|
|
1457
1621
|
}
|
|
1458
1622
|
}
|
|
1459
1623
|
return ulElement;
|
|
1460
1624
|
};
|
|
1625
|
+
DropDownBase.prototype.createVirtualContent = function () {
|
|
1626
|
+
if (!this.list.querySelector('.e-virtual-ddl-content')) {
|
|
1627
|
+
this.list.appendChild(this.createElement('div', {
|
|
1628
|
+
className: 'e-virtual-ddl-content',
|
|
1629
|
+
}));
|
|
1630
|
+
}
|
|
1631
|
+
};
|
|
1632
|
+
DropDownBase.prototype.updateListElements = function (listData) {
|
|
1633
|
+
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
1634
|
+
this.ulElement = this.list.querySelector('ul');
|
|
1635
|
+
this.listData = listData;
|
|
1636
|
+
this.postRender(this.list, listData, this.bindEvent);
|
|
1637
|
+
};
|
|
1461
1638
|
DropDownBase.prototype.templateListItem = function (dataSource, fields) {
|
|
1462
1639
|
var option = this.listOption(dataSource, fields);
|
|
1463
1640
|
option.templateID = this.itemTemplateId;
|
|
@@ -1529,11 +1706,11 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1529
1706
|
* @param {string | number | boolean} value - Specifies given value.
|
|
1530
1707
|
* @returns {number} Returns the index of the item.
|
|
1531
1708
|
*/
|
|
1532
|
-
DropDownBase.prototype.
|
|
1709
|
+
DropDownBase.prototype.getIndexByValue = function (value) {
|
|
1533
1710
|
var index;
|
|
1534
|
-
var listItems = this.
|
|
1535
|
-
for (var i = 0; i < listItems.
|
|
1536
|
-
if (!isNullOrUndefined(value) && listItems
|
|
1711
|
+
var listItems = this.getItems();
|
|
1712
|
+
for (var i = 0; i < listItems.length; i++) {
|
|
1713
|
+
if (!isNullOrUndefined(value) && listItems[i].getAttribute('data-value') === value.toString()) {
|
|
1537
1714
|
index = i;
|
|
1538
1715
|
break;
|
|
1539
1716
|
}
|
|
@@ -1546,11 +1723,11 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1546
1723
|
* @param {string | number | boolean} value - Specifies given value.
|
|
1547
1724
|
* @returns {number} Returns the index of the item.
|
|
1548
1725
|
*/
|
|
1549
|
-
DropDownBase.prototype.
|
|
1726
|
+
DropDownBase.prototype.getIndexByValueFilter = function (value) {
|
|
1550
1727
|
var index;
|
|
1551
|
-
var listItems = this.
|
|
1552
|
-
for (var i = 0; i < listItems.length; i++) {
|
|
1553
|
-
if (!isNullOrUndefined(value) && listItems[i].getAttribute('data-value') === value.toString()) {
|
|
1728
|
+
var listItems = this.renderItems(this.selectData, this.fields);
|
|
1729
|
+
for (var i = 0; i < listItems.children.length; i++) {
|
|
1730
|
+
if (!isNullOrUndefined(value) && listItems.children[i].getAttribute('data-value') === value.toString()) {
|
|
1554
1731
|
index = i;
|
|
1555
1732
|
break;
|
|
1556
1733
|
}
|
|
@@ -2115,7 +2292,6 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2115
2292
|
_this.isListSearched = false;
|
|
2116
2293
|
_this.preventChange = false;
|
|
2117
2294
|
_this.isAngular = false;
|
|
2118
|
-
_this.itemCount = 10;
|
|
2119
2295
|
_this.virtualListHeight = 0;
|
|
2120
2296
|
_this.isVirtualScrolling = false;
|
|
2121
2297
|
_this.isPreventScrollAction = false;
|
|
@@ -2130,6 +2306,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2130
2306
|
_this.pageCount = 0;
|
|
2131
2307
|
_this.isPreventKeyAction = false;
|
|
2132
2308
|
_this.generatedDataObject = {};
|
|
2309
|
+
_this.incrementalQueryString = '';
|
|
2310
|
+
_this.incrementalEndIndex = 0;
|
|
2311
|
+
_this.incrementalStartIndex = 0;
|
|
2312
|
+
_this.incrementalPreQueryString = '';
|
|
2133
2313
|
_this.isTouched = false;
|
|
2134
2314
|
_this.virtualListInfo = {
|
|
2135
2315
|
currentPageNumber: null,
|
|
@@ -2239,8 +2419,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2239
2419
|
};
|
|
2240
2420
|
DropDownList.prototype.renderList = function (e, isEmptyData) {
|
|
2241
2421
|
_super.prototype.render.call(this, e, isEmptyData);
|
|
2242
|
-
|
|
2243
|
-
|
|
2422
|
+
if (!(this.dataSource instanceof DataManager)) {
|
|
2423
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2424
|
+
this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
|
|
2425
|
+
}
|
|
2244
2426
|
this.unWireListEvents();
|
|
2245
2427
|
this.wireListEvents();
|
|
2246
2428
|
};
|
|
@@ -2704,12 +2886,136 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2704
2886
|
DropDownList.prototype.isValidLI = function (li) {
|
|
2705
2887
|
return (li && li.hasAttribute('role') && li.getAttribute('role') === 'option');
|
|
2706
2888
|
};
|
|
2889
|
+
DropDownList.prototype.updateIncrementalInfo = function (startIndex, endIndex) {
|
|
2890
|
+
this.viewPortInfo.startIndex = startIndex;
|
|
2891
|
+
this.viewPortInfo.endIndex = endIndex;
|
|
2892
|
+
this.updateVirtualItemIndex();
|
|
2893
|
+
this.isIncrementalRequest = true;
|
|
2894
|
+
this.resetList(this.dataSource, this.fields, this.query);
|
|
2895
|
+
this.isIncrementalRequest = false;
|
|
2896
|
+
};
|
|
2897
|
+
DropDownList.prototype.updateIncrementalView = function (startIndex, endIndex) {
|
|
2898
|
+
this.viewPortInfo.startIndex = startIndex;
|
|
2899
|
+
this.viewPortInfo.endIndex = endIndex;
|
|
2900
|
+
this.updateVirtualItemIndex();
|
|
2901
|
+
this.resetList(this.dataSource, this.fields, this.query);
|
|
2902
|
+
this.UpdateSkeleton();
|
|
2903
|
+
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
2904
|
+
this.ulElement = this.list.querySelector('ul');
|
|
2905
|
+
};
|
|
2906
|
+
DropDownList.prototype.updateIncrementalItemIndex = function (startIndex, endIndex) {
|
|
2907
|
+
this.incrementalStartIndex = startIndex;
|
|
2908
|
+
this.incrementalEndIndex = endIndex;
|
|
2909
|
+
};
|
|
2707
2910
|
DropDownList.prototype.incrementalSearch = function (e) {
|
|
2708
2911
|
if (this.liCollections.length > 0) {
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
this.
|
|
2912
|
+
if (this.enableVirtualization) {
|
|
2913
|
+
var updatingincrementalindex = false;
|
|
2914
|
+
var queryStringUpdated = false;
|
|
2915
|
+
var activeElement = this.ulElement.getElementsByClassName('e-active')[0];
|
|
2916
|
+
var currentValue = activeElement ? activeElement.textContent : null;
|
|
2917
|
+
if (this.incrementalQueryString == '') {
|
|
2918
|
+
this.incrementalQueryString = String.fromCharCode(e.charCode);
|
|
2919
|
+
this.incrementalPreQueryString = this.incrementalQueryString;
|
|
2920
|
+
}
|
|
2921
|
+
else if (String.fromCharCode(e.charCode).toLocaleLowerCase() == this.incrementalPreQueryString.toLocaleLowerCase()) {
|
|
2922
|
+
queryStringUpdated = true;
|
|
2923
|
+
}
|
|
2924
|
+
else {
|
|
2925
|
+
this.incrementalQueryString = String.fromCharCode(e.charCode);
|
|
2926
|
+
}
|
|
2927
|
+
if ((this.viewPortInfo.endIndex >= this.incrementalEndIndex && this.incrementalEndIndex <= this.totalItemCount) || this.incrementalEndIndex == 0) {
|
|
2928
|
+
updatingincrementalindex = true;
|
|
2929
|
+
this.incrementalStartIndex = this.incrementalEndIndex;
|
|
2930
|
+
if (this.incrementalEndIndex == 0) {
|
|
2931
|
+
this.incrementalEndIndex = 100 > this.totalItemCount ? this.totalItemCount : 100;
|
|
2932
|
+
}
|
|
2933
|
+
else {
|
|
2934
|
+
this.incrementalEndIndex = this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100;
|
|
2935
|
+
}
|
|
2936
|
+
this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
|
|
2937
|
+
updatingincrementalindex = true;
|
|
2938
|
+
}
|
|
2939
|
+
if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
|
|
2940
|
+
this.updateIncrementalView(0, this.itemCount);
|
|
2941
|
+
}
|
|
2942
|
+
var li = incrementalSearch(e.charCode, this.incrementalLiCollections, this.activeIndex, true, this.element.id, queryStringUpdated, currentValue, true);
|
|
2943
|
+
while (isNullOrUndefined(li) && this.incrementalEndIndex < this.totalItemCount) {
|
|
2944
|
+
this.updateIncrementalItemIndex(this.incrementalEndIndex, this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100);
|
|
2945
|
+
this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
|
|
2946
|
+
updatingincrementalindex = true;
|
|
2947
|
+
if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
|
|
2948
|
+
this.updateIncrementalView(0, this.itemCount);
|
|
2949
|
+
}
|
|
2950
|
+
li = incrementalSearch(e.charCode, this.incrementalLiCollections, 0, true, this.element.id, queryStringUpdated, currentValue, true, true);
|
|
2951
|
+
if (!isNullOrUndefined(li)) {
|
|
2952
|
+
break;
|
|
2953
|
+
}
|
|
2954
|
+
if (isNullOrUndefined(li) && this.incrementalEndIndex >= this.totalItemCount) {
|
|
2955
|
+
this.updateIncrementalItemIndex(0, 100 > this.totalItemCount ? this.totalItemCount : 100);
|
|
2956
|
+
break;
|
|
2957
|
+
}
|
|
2958
|
+
}
|
|
2959
|
+
if (isNullOrUndefined(li) && this.incrementalEndIndex >= this.totalItemCount) {
|
|
2960
|
+
this.updateIncrementalItemIndex(0, 100 > this.totalItemCount ? this.totalItemCount : 100);
|
|
2961
|
+
this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
|
|
2962
|
+
updatingincrementalindex = true;
|
|
2963
|
+
if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
|
|
2964
|
+
this.updateIncrementalView(0, this.itemCount);
|
|
2965
|
+
}
|
|
2966
|
+
li = incrementalSearch(e.charCode, this.incrementalLiCollections, 0, true, this.element.id, queryStringUpdated, currentValue, true, true);
|
|
2967
|
+
}
|
|
2968
|
+
var index = li && this.getIndexByValue(li.getAttribute('data-value'));
|
|
2969
|
+
if (!index) {
|
|
2970
|
+
for (var i = 0; i < this.incrementalLiCollections.length; i++) {
|
|
2971
|
+
if (!isNullOrUndefined(li) && !isNullOrUndefined(li.getAttribute('data-value')) && this.incrementalLiCollections[i].getAttribute('data-value') === li.getAttribute('data-value').toString()) {
|
|
2972
|
+
index = i;
|
|
2973
|
+
index = this.incrementalStartIndex + index;
|
|
2974
|
+
break;
|
|
2975
|
+
}
|
|
2976
|
+
}
|
|
2977
|
+
}
|
|
2978
|
+
else {
|
|
2979
|
+
index = index - this.skeletonCount;
|
|
2980
|
+
}
|
|
2981
|
+
if (index) {
|
|
2982
|
+
if ((!(this.viewPortInfo.startIndex >= index)) || (!(index >= this.viewPortInfo.endIndex))) {
|
|
2983
|
+
var startIndex = index - ((this.itemCount / 2) - 2) > 0 ? index - ((this.itemCount / 2) - 2) : 0;
|
|
2984
|
+
var endIndex = this.viewPortInfo.startIndex + this.itemCount > this.totalItemCount ? this.totalItemCount : this.viewPortInfo.startIndex + this.itemCount;
|
|
2985
|
+
this.updateIncrementalView(startIndex, endIndex);
|
|
2986
|
+
}
|
|
2987
|
+
}
|
|
2988
|
+
if (!isNullOrUndefined(li)) {
|
|
2989
|
+
var index_1 = this.getIndexByValue(li.getAttribute('data-value')) - this.skeletonCount;
|
|
2990
|
+
if (index_1 > this.itemCount / 2) {
|
|
2991
|
+
var startIndex = this.viewPortInfo.startIndex + ((this.itemCount / 2) - 2) < this.totalItemCount ? this.viewPortInfo.startIndex + ((this.itemCount / 2) - 2) : this.totalItemCount;
|
|
2992
|
+
var endIndex = this.viewPortInfo.startIndex + this.itemCount > this.totalItemCount ? this.totalItemCount : this.viewPortInfo.startIndex + this.itemCount;
|
|
2993
|
+
this.updateIncrementalView(startIndex, endIndex);
|
|
2994
|
+
}
|
|
2995
|
+
li = this.getElementByValue(li.getAttribute('data-value'));
|
|
2996
|
+
this.setSelection(li, e);
|
|
2997
|
+
this.setScrollPosition();
|
|
2998
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2999
|
+
this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
|
|
3000
|
+
if (this.enableVirtualization && !this.fields.groupBy) {
|
|
3001
|
+
var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
|
|
3002
|
+
this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * this.selectedLI.offsetHeight);
|
|
3003
|
+
}
|
|
3004
|
+
this.incrementalPreQueryString = this.incrementalQueryString;
|
|
3005
|
+
}
|
|
3006
|
+
else {
|
|
3007
|
+
this.updateIncrementalView(0, this.itemCount);
|
|
3008
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3009
|
+
this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
|
|
3010
|
+
this.list.scrollTop = 0;
|
|
3011
|
+
}
|
|
3012
|
+
}
|
|
3013
|
+
else {
|
|
3014
|
+
var li = incrementalSearch(e.charCode, this.liCollections, this.activeIndex, true, this.element.id);
|
|
3015
|
+
if (!isNullOrUndefined(li)) {
|
|
3016
|
+
this.setSelection(li, e);
|
|
3017
|
+
this.setScrollPosition();
|
|
3018
|
+
}
|
|
2713
3019
|
}
|
|
2714
3020
|
}
|
|
2715
3021
|
};
|
|
@@ -2765,6 +3071,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2765
3071
|
if (isNullOrUndefined(this.list) && !this.isRequested && !isTabAction && e.action !== 'escape') {
|
|
2766
3072
|
this.searchKeyEvent = e;
|
|
2767
3073
|
this.renderList(e);
|
|
3074
|
+
this.UpdateSkeleton();
|
|
3075
|
+
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
3076
|
+
this.ulElement = this.list.querySelector('ul');
|
|
2768
3077
|
}
|
|
2769
3078
|
if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&
|
|
2770
3079
|
isNavigation && this.liCollections.length === 0) || this.isRequested) {
|
|
@@ -2842,7 +3151,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2842
3151
|
var focusEle = this.list.querySelector('.' + dropDownListClasses.focus);
|
|
2843
3152
|
if (this.isSelectFocusItem(focusEle) && !isVirtualKeyAction) {
|
|
2844
3153
|
this.setSelection(focusEle, e);
|
|
2845
|
-
if (this.enableVirtualization) {
|
|
3154
|
+
if (this.enableVirtualization && !this.fields.groupBy && this.getModuleName() !== 'combobox') {
|
|
2846
3155
|
var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.selectedLI.offsetTop + (this.virtualListInfo.startIndex * this.selectedLI.offsetHeight) : this.selectedLI.offsetTop;
|
|
2847
3156
|
this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * this.selectedLI.offsetHeight);
|
|
2848
3157
|
}
|
|
@@ -2870,7 +3179,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2870
3179
|
}
|
|
2871
3180
|
else {
|
|
2872
3181
|
if (this.getModuleName() === 'autocomplete') {
|
|
2873
|
-
var value = this.selectedLI.
|
|
3182
|
+
var value = this.getFormattedValue(this.selectedLI.getAttribute('data-value'));
|
|
2874
3183
|
nextItem = this.getElementByValue(value);
|
|
2875
3184
|
}
|
|
2876
3185
|
else {
|
|
@@ -2882,26 +3191,75 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2882
3191
|
if (!isNullOrUndefined(nextItem)) {
|
|
2883
3192
|
this.setSelection(nextItem, e);
|
|
2884
3193
|
}
|
|
3194
|
+
else if (this.enableVirtualization && !this.isPopupOpen && this.getModuleName() !== 'autocomplete' && ((this.viewPortInfo.endIndex !== this.totalItemCount && e.action === 'down') || (this.viewPortInfo.startIndex !== 0 && e.action === 'up'))) {
|
|
3195
|
+
if (e.action === 'down') {
|
|
3196
|
+
this.viewPortInfo.startIndex = (this.viewPortInfo.startIndex + this.itemCount) < (this.totalItemCount - this.itemCount) ? this.viewPortInfo.startIndex + this.itemCount : this.totalItemCount - this.itemCount;
|
|
3197
|
+
this.viewPortInfo.endIndex = this.viewPortInfo.startIndex + this.itemCount;
|
|
3198
|
+
this.updateVirtualItemIndex();
|
|
3199
|
+
this.isCustomFilter = this.getModuleName() === 'combobox' ? true : this.isCustomFilter;
|
|
3200
|
+
this.resetList(this.dataSource, this.fields, this.query);
|
|
3201
|
+
this.isCustomFilter = this.getModuleName() === 'combobox' ? false : this.isCustomFilter;
|
|
3202
|
+
var value_2 = this.liCollections[0].getAttribute('data-value') !== "null" ? this.getFormattedValue(this.liCollections[0].getAttribute('data-value')) : null;
|
|
3203
|
+
var selectedData = this.getDataByValue(value_2);
|
|
3204
|
+
if (selectedData) {
|
|
3205
|
+
this.itemData = selectedData;
|
|
3206
|
+
}
|
|
3207
|
+
}
|
|
3208
|
+
else if (e.action === 'up') {
|
|
3209
|
+
this.viewPortInfo.startIndex = (this.viewPortInfo.startIndex - this.itemCount) > 0 ? this.viewPortInfo.startIndex - this.itemCount : 0;
|
|
3210
|
+
this.viewPortInfo.endIndex = this.viewPortInfo.startIndex + this.itemCount;
|
|
3211
|
+
this.updateVirtualItemIndex();
|
|
3212
|
+
this.isCustomFilter = this.getModuleName() === 'combobox' ? true : this.isCustomFilter;
|
|
3213
|
+
this.resetList(this.dataSource, this.fields, this.query);
|
|
3214
|
+
this.isCustomFilter = this.getModuleName() === 'combobox' ? false : this.isCustomFilter;
|
|
3215
|
+
var value_3 = this.liCollections[this.liCollections.length - 1].getAttribute('data-value') !== "null" ? this.getFormattedValue(this.liCollections[this.liCollections.length - 1].getAttribute('data-value')) : null;
|
|
3216
|
+
var selectedData = this.getDataByValue(value_3);
|
|
3217
|
+
if (selectedData) {
|
|
3218
|
+
this.itemData = selectedData;
|
|
3219
|
+
}
|
|
3220
|
+
}
|
|
3221
|
+
this.UpdateSkeleton();
|
|
3222
|
+
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
3223
|
+
this.ulElement = this.list.querySelector('ul');
|
|
3224
|
+
this.handleVirtualKeyboardActions(e, this.pageCount);
|
|
3225
|
+
}
|
|
2885
3226
|
}
|
|
2886
3227
|
if (this.allowFiltering && !this.enableVirtualization && this.getModuleName() !== 'autocomplete') {
|
|
2887
|
-
var
|
|
2888
|
-
var filterIndex = this.getIndexByValueFilter(
|
|
3228
|
+
var value_4 = this.getItemData().value;
|
|
3229
|
+
var filterIndex = this.getIndexByValueFilter(value_4);
|
|
2889
3230
|
if (!isNullOrUndefined(filterIndex)) {
|
|
2890
3231
|
this.activeIndex = filterIndex;
|
|
2891
3232
|
}
|
|
2892
3233
|
}
|
|
2893
3234
|
e.preventDefault();
|
|
2894
3235
|
};
|
|
3236
|
+
DropDownList.prototype.updateVirtualItemIndex = function () {
|
|
3237
|
+
this.virtualItemStartIndex = this.viewPortInfo.startIndex;
|
|
3238
|
+
this.virtualItemEndIndex = this.viewPortInfo.endIndex;
|
|
3239
|
+
this.virtualListInfo = this.viewPortInfo;
|
|
3240
|
+
};
|
|
2895
3241
|
DropDownList.prototype.updateHomeEndAction = function (e, isVirtualKeyAction) {
|
|
2896
3242
|
if (this.getModuleName() === 'dropdownlist') {
|
|
2897
3243
|
var findLi = 0;
|
|
2898
3244
|
if (e.action === 'home') {
|
|
2899
3245
|
findLi = 0;
|
|
2900
|
-
if (this.enableVirtualization) {
|
|
3246
|
+
if (this.enableVirtualization && this.isPopupOpen) {
|
|
2901
3247
|
findLi = this.skeletonCount;
|
|
2902
3248
|
}
|
|
3249
|
+
else if (this.enableVirtualization && !this.isPopupOpen && this.viewPortInfo.startIndex !== 0) {
|
|
3250
|
+
this.viewPortInfo.startIndex = 0;
|
|
3251
|
+
this.viewPortInfo.endIndex = this.itemCount;
|
|
3252
|
+
this.updateVirtualItemIndex();
|
|
3253
|
+
this.resetList(this.dataSource, this.fields, this.query);
|
|
3254
|
+
}
|
|
2903
3255
|
}
|
|
2904
3256
|
else {
|
|
3257
|
+
if (this.enableVirtualization && !this.isPopupOpen && this.viewPortInfo.endIndex !== this.totalItemCount) {
|
|
3258
|
+
this.viewPortInfo.startIndex = this.totalItemCount - this.itemCount;
|
|
3259
|
+
this.viewPortInfo.endIndex = this.totalItemCount;
|
|
3260
|
+
this.updateVirtualItemIndex();
|
|
3261
|
+
this.resetList(this.dataSource, this.fields, this.query);
|
|
3262
|
+
}
|
|
2905
3263
|
findLi = this.getItems().length - 1;
|
|
2906
3264
|
}
|
|
2907
3265
|
e.preventDefault();
|
|
@@ -2997,12 +3355,6 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2997
3355
|
DropDownList.prototype.isSelectFocusItem = function (element) {
|
|
2998
3356
|
return !isNullOrUndefined(element);
|
|
2999
3357
|
};
|
|
3000
|
-
DropDownList.prototype.getPageCount = function (returnExactCount) {
|
|
3001
|
-
var liHeight = this.list.classList.contains(dropDownBaseClasses.noData) ? null :
|
|
3002
|
-
getComputedStyle(this.getItems()[0], null).getPropertyValue('height');
|
|
3003
|
-
var pageCount = Math.round(this.list.getBoundingClientRect().height / parseInt(liHeight, 10));
|
|
3004
|
-
return returnExactCount ? pageCount : Math.round(pageCount);
|
|
3005
|
-
};
|
|
3006
3358
|
DropDownList.prototype.pageUpSelection = function (steps, event, isVirtualKeyAction) {
|
|
3007
3359
|
var previousItem = steps >= 0 ? this.liCollections[steps + 1] : this.liCollections[0];
|
|
3008
3360
|
if ((this.enableVirtualization && this.activeIndex == null) || isVirtualKeyAction) {
|
|
@@ -3265,7 +3617,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3265
3617
|
.then(function (e) {
|
|
3266
3618
|
if (e.result.length > 0) {
|
|
3267
3619
|
_this.itemData = e.result[0];
|
|
3268
|
-
|
|
3620
|
+
var dataItem = _this.getItemData();
|
|
3621
|
+
if ((_this.value === dataItem.value && _this.text !== dataItem.text) || (_this.value !== dataItem.value && _this.text === dataItem.text)) {
|
|
3622
|
+
_this.setProperties({ 'text': dataItem.text, 'value': dataItem.value });
|
|
3623
|
+
}
|
|
3269
3624
|
}
|
|
3270
3625
|
});
|
|
3271
3626
|
}
|
|
@@ -3273,7 +3628,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3273
3628
|
var getItem = new DataManager(this.dataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', this.value)));
|
|
3274
3629
|
if (getItem && getItem.length > 0) {
|
|
3275
3630
|
this.itemData = getItem[0];
|
|
3276
|
-
|
|
3631
|
+
var dataItem = this.getItemData();
|
|
3632
|
+
if ((this.value === dataItem.value && this.text !== dataItem.text) || (this.value !== dataItem.value && this.text === dataItem.text)) {
|
|
3633
|
+
this.setProperties({ 'text': dataItem.text, 'value': dataItem.value });
|
|
3634
|
+
}
|
|
3277
3635
|
}
|
|
3278
3636
|
}
|
|
3279
3637
|
}
|
|
@@ -3535,7 +3893,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3535
3893
|
this.typedString = this.filterInput.value;
|
|
3536
3894
|
this.preventAutoFill = false;
|
|
3537
3895
|
this.searchLists(e);
|
|
3538
|
-
if (this.enableVirtualization) {
|
|
3896
|
+
if ((this.enableVirtualization && this.getModuleName() !== 'autocomplete') || (this.getModuleName() === 'autocomplete' && !(this.dataSource instanceof DataManager)) || (this.getModuleName() === 'autocomplete' && (this.dataSource instanceof DataManager) && this.totalItemCount != 0)) {
|
|
3539
3897
|
this.getFilteringSkeletonCount();
|
|
3540
3898
|
}
|
|
3541
3899
|
break;
|
|
@@ -3550,19 +3908,28 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3550
3908
|
var currentSkeletonCount = this.skeletonCount;
|
|
3551
3909
|
this.getSkeletonCount(true);
|
|
3552
3910
|
this.skeletonCount = this.dataCount > this.itemCount * 2 ? this.skeletonCount : difference > this.skeletonCount ? this.skeletonCount : difference > 0 ? difference : 0;
|
|
3911
|
+
var skeletonUpdated = true;
|
|
3912
|
+
if (this.getModuleName() === 'autocomplete' && (this.totalItemCount != 0 && this.totalItemCount < (this.itemCount * 2))) {
|
|
3913
|
+
this.skeletonCount = 0;
|
|
3914
|
+
skeletonUpdated = false;
|
|
3915
|
+
}
|
|
3553
3916
|
if (!this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
3554
3917
|
var isSkeletonCountChange = currentSkeletonCount !== this.skeletonCount;
|
|
3555
|
-
if (currentSkeletonCount !== this.skeletonCount) {
|
|
3918
|
+
if (currentSkeletonCount !== this.skeletonCount && skeletonUpdated) {
|
|
3556
3919
|
this.UpdateSkeleton(true, Math.abs(currentSkeletonCount - this.skeletonCount));
|
|
3557
3920
|
}
|
|
3558
3921
|
else {
|
|
3559
3922
|
this.UpdateSkeleton();
|
|
3560
3923
|
}
|
|
3561
3924
|
this.liCollections = this.list.querySelectorAll('.e-list-item');
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3925
|
+
if ((this.list.getElementsByClassName('e-virtual-ddl').length > 0)) {
|
|
3926
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3927
|
+
this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
|
|
3928
|
+
}
|
|
3929
|
+
if (this.list.getElementsByClassName('e-virtual-ddl-content').length > 0) {
|
|
3930
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3931
|
+
this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
|
|
3932
|
+
}
|
|
3566
3933
|
}
|
|
3567
3934
|
};
|
|
3568
3935
|
DropDownList.prototype.getSkeletonCount = function (retainSkeleton) {
|
|
@@ -3615,12 +3982,26 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3615
3982
|
else {
|
|
3616
3983
|
filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
|
|
3617
3984
|
}
|
|
3618
|
-
if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0)) {
|
|
3985
|
+
if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource))) {
|
|
3619
3986
|
var takeValue = this.getTakeValue();
|
|
3620
|
-
|
|
3987
|
+
var alreadySkipAdded = false;
|
|
3988
|
+
if (filterQuery) {
|
|
3989
|
+
for (var queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
|
|
3990
|
+
if (filterQuery.queries[queryElements].fn === 'onSkip') {
|
|
3991
|
+
alreadySkipAdded = true;
|
|
3992
|
+
break;
|
|
3993
|
+
}
|
|
3994
|
+
}
|
|
3995
|
+
}
|
|
3996
|
+
if (this.allowFiltering || !this.isPopupOpen || !alreadySkipAdded) {
|
|
3621
3997
|
filterQuery.skip(this.virtualItemStartIndex);
|
|
3622
3998
|
}
|
|
3623
|
-
|
|
3999
|
+
if (this.isIncrementalRequest) {
|
|
4000
|
+
filterQuery.take(this.incrementalEndIndex);
|
|
4001
|
+
}
|
|
4002
|
+
else {
|
|
4003
|
+
filterQuery.take(takeValue);
|
|
4004
|
+
}
|
|
3624
4005
|
filterQuery.requiresCount();
|
|
3625
4006
|
}
|
|
3626
4007
|
return filterQuery;
|
|
@@ -3864,7 +4245,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3864
4245
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3865
4246
|
DropDownList.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
|
|
3866
4247
|
var _this = this;
|
|
3867
|
-
if (this.dataSource instanceof DataManager && !isNullOrUndefined(e)) {
|
|
4248
|
+
if (this.dataSource instanceof DataManager && !isNullOrUndefined(e) && !this.virtualGroupDataSource) {
|
|
3868
4249
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3869
4250
|
this.totalItemCount = e.count;
|
|
3870
4251
|
}
|
|
@@ -3891,7 +4272,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3891
4272
|
this.list.scrollTop = 0;
|
|
3892
4273
|
}
|
|
3893
4274
|
if (!isNullOrUndefined(ulElement)) {
|
|
3894
|
-
attributes(ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
|
|
4275
|
+
attributes(ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false', 'aria-label': 'listbox' });
|
|
3895
4276
|
}
|
|
3896
4277
|
if (this.initRemoteRender) {
|
|
3897
4278
|
this.initial = true;
|
|
@@ -4017,10 +4398,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4017
4398
|
DropDownList.prototype.addNewItem = function (listData, newElement) {
|
|
4018
4399
|
var _this = this;
|
|
4019
4400
|
if (!isNullOrUndefined(this.itemData) && !isNullOrUndefined(newElement)) {
|
|
4020
|
-
var
|
|
4401
|
+
var value_5 = this.getItemData().value;
|
|
4021
4402
|
var isExist = listData.some(function (data) {
|
|
4022
|
-
return (((typeof data === 'string' || typeof data === 'number') && data ===
|
|
4023
|
-
(getValue(_this.fields.value, data) ===
|
|
4403
|
+
return (((typeof data === 'string' || typeof data === 'number') && data === value_5) ||
|
|
4404
|
+
(getValue(_this.fields.value, data) === value_5));
|
|
4024
4405
|
});
|
|
4025
4406
|
if (!isExist) {
|
|
4026
4407
|
this.addItem(this.itemData);
|
|
@@ -4111,6 +4492,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4111
4492
|
DropDownList.prototype.GetVirtualTrackHeight = function () {
|
|
4112
4493
|
var height = this.totalItemCount === this.viewPortInfo.endIndex ? this.totalItemCount * this.listItemHeight - this.itemCount * this.listItemHeight : this.totalItemCount * this.listItemHeight;
|
|
4113
4494
|
var heightDimension = "height: " + (height - this.itemCount * this.listItemHeight) + "px;";
|
|
4495
|
+
if (this.getModuleName() === 'autocomplete' && this.skeletonCount === 0) {
|
|
4496
|
+
return "height: 0px;";
|
|
4497
|
+
}
|
|
4114
4498
|
return heightDimension;
|
|
4115
4499
|
};
|
|
4116
4500
|
DropDownList.prototype.renderPopup = function (e) {
|
|
@@ -4125,6 +4509,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4125
4509
|
var popupEle = _this.createElement('div', {
|
|
4126
4510
|
id: _this.element.id + '_popup', className: 'e-ddl e-popup ' + (_this.cssClass !== null ? _this.cssClass : '')
|
|
4127
4511
|
});
|
|
4512
|
+
popupEle.setAttribute('aria-label', _this.element.id);
|
|
4513
|
+
popupEle.setAttribute('role', 'dialog');
|
|
4128
4514
|
var searchBox = _this.setSearchBox(popupEle);
|
|
4129
4515
|
_this.listHeight = formatUnit(_this.popupHeight);
|
|
4130
4516
|
if (_this.headerTemplate) {
|
|
@@ -4209,9 +4595,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4209
4595
|
parseInt(getComputedStyle(_this.inputElement.parentElement).borderLeftWidth, 10));
|
|
4210
4596
|
}
|
|
4211
4597
|
}
|
|
4212
|
-
_this.getFocusElement();
|
|
4213
4598
|
_this.createPopup(popupEle, offsetValue, left);
|
|
4214
4599
|
_this.popupContentElement = _this.popupObj.element.querySelector('.e-content');
|
|
4600
|
+
_this.getFocusElement();
|
|
4215
4601
|
_this.checkCollision(popupEle);
|
|
4216
4602
|
if (Browser.isDevice) {
|
|
4217
4603
|
_this.popupObj.element.classList.add(dropDownListClasses.device);
|
|
@@ -4251,7 +4637,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4251
4637
|
enable: _this.enableVirtualization,
|
|
4252
4638
|
});
|
|
4253
4639
|
setTimeout(function () {
|
|
4254
|
-
if (_this.value) {
|
|
4640
|
+
if (_this.value || _this.list.querySelector('.e-active')) {
|
|
4255
4641
|
_this.updateSelectionList();
|
|
4256
4642
|
if (_this.selectedValueInfo && _this.viewPortInfo && _this.viewPortInfo.offsets.top) {
|
|
4257
4643
|
_this.list.scrollTop = _this.viewPortInfo.offsets.top;
|
|
@@ -4262,8 +4648,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4262
4648
|
}
|
|
4263
4649
|
}, 5);
|
|
4264
4650
|
}
|
|
4265
|
-
attributes(_this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': _this.element.id + '
|
|
4651
|
+
attributes(_this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': _this.element.id + '_popup', 'aria-controls': _this.element.id });
|
|
4266
4652
|
_this.inputElement.setAttribute('aria-expanded', 'true');
|
|
4653
|
+
_this.inputElement.setAttribute('aria-controls', _this.element.id);
|
|
4267
4654
|
var inputParent = _this.isFiltering() ? _this.filterInput.parentElement : _this.inputWrapper.container;
|
|
4268
4655
|
addClass([inputParent], [dropDownListClasses.inputFocus]);
|
|
4269
4656
|
var animModel = { name: 'FadeIn', duration: 100 };
|
|
@@ -4328,7 +4715,12 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4328
4715
|
_this.destroyPopup();
|
|
4329
4716
|
if (_this.isFiltering() && _this.actionCompleteData.list && _this.actionCompleteData.list[0]) {
|
|
4330
4717
|
_this.isActive = true;
|
|
4331
|
-
|
|
4718
|
+
if (_this.enableVirtualization) {
|
|
4719
|
+
_this.onActionComplete(_this.ulElement, _this.listData, null, true);
|
|
4720
|
+
}
|
|
4721
|
+
else {
|
|
4722
|
+
_this.onActionComplete(_this.actionCompleteData.ulElement, _this.actionCompleteData.list, null, true);
|
|
4723
|
+
}
|
|
4332
4724
|
}
|
|
4333
4725
|
},
|
|
4334
4726
|
open: function () {
|
|
@@ -4435,6 +4827,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4435
4827
|
return width;
|
|
4436
4828
|
};
|
|
4437
4829
|
DropDownList.prototype.scrollBottom = function (isInitial, isInitialSelection, keyAction) {
|
|
4830
|
+
var _this = this;
|
|
4438
4831
|
if (isInitialSelection === void 0) { isInitialSelection = false; }
|
|
4439
4832
|
if (keyAction === void 0) { keyAction = null; }
|
|
4440
4833
|
if (isNullOrUndefined(this.selectedLI) && this.enableVirtualization) {
|
|
@@ -4499,6 +4892,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4499
4892
|
|
|
4500
4893
|
}
|
|
4501
4894
|
this.isKeyBoardAction = isScrollerCHanged;
|
|
4895
|
+
if (this.enableVirtualization && this.fields.groupBy && this.fixedHeaderElement && (keyAction == "down")) {
|
|
4896
|
+
setTimeout(function () {
|
|
4897
|
+
_this.scrollStop(null, true);
|
|
4898
|
+
}, 100);
|
|
4899
|
+
}
|
|
4502
4900
|
}
|
|
4503
4901
|
};
|
|
4504
4902
|
DropDownList.prototype.scrollTop = function (keyAction) {
|
|
@@ -4704,7 +5102,15 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4704
5102
|
if (this.isReact && this.isFiltering() && this.itemTemplate != null) {
|
|
4705
5103
|
this.actionCompleteData.ulElement = this.ulElement.cloneNode(true);
|
|
4706
5104
|
}
|
|
4707
|
-
var dataSourceCount
|
|
5105
|
+
var dataSourceCount;
|
|
5106
|
+
if (this.dataSource instanceof DataManager) {
|
|
5107
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5108
|
+
dataSourceCount = this.virtualGroupDataSource && this.virtualGroupDataSource.length ? this.virtualGroupDataSource.length : 0;
|
|
5109
|
+
}
|
|
5110
|
+
else {
|
|
5111
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5112
|
+
dataSourceCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
|
|
5113
|
+
}
|
|
4708
5114
|
if (this.enableVirtualization && this.isFiltering() && this.value != null && isFilterValue && this.totalItemCount !== dataSourceCount) {
|
|
4709
5115
|
this.updateInitialData();
|
|
4710
5116
|
this.checkAndResetCache();
|
|
@@ -4727,8 +5133,14 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4727
5133
|
}
|
|
4728
5134
|
this.previousStartIndex = 0;
|
|
4729
5135
|
this.previousEndIndex = 0;
|
|
4730
|
-
|
|
4731
|
-
|
|
5136
|
+
if (this.dataSource instanceof DataManager) {
|
|
5137
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5138
|
+
this.totalItemCount = this.dataCount = this.virtualGroupDataSource && this.virtualGroupDataSource.length ? this.virtualGroupDataSource.length : 0;
|
|
5139
|
+
}
|
|
5140
|
+
else {
|
|
5141
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5142
|
+
this.totalItemCount = this.dataCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
|
|
5143
|
+
}
|
|
4732
5144
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4733
5145
|
if (this.list.getElementsByClassName('e-virtual-ddl')[0]) {
|
|
4734
5146
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -4838,6 +5250,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4838
5250
|
}
|
|
4839
5251
|
else if (this.getModuleName() === 'dropdownlist') {
|
|
4840
5252
|
attributes(this.targetElement(), { 'aria-label': this.getModuleName() });
|
|
5253
|
+
this.inputElement.setAttribute('aria-label', this.getModuleName());
|
|
5254
|
+
this.inputElement.setAttribute('aria-expanded', 'false');
|
|
5255
|
+
this.inputElement.setAttribute('aria-controls', this.element.id + '_popups');
|
|
4841
5256
|
}
|
|
4842
5257
|
attributes(this.targetElement(), this.getAriaAttributes());
|
|
4843
5258
|
this.updateDataAttribute(this.htmlAttributes);
|
|
@@ -5103,6 +5518,14 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
5103
5518
|
this_1.clearAll();
|
|
5104
5519
|
break;
|
|
5105
5520
|
}
|
|
5521
|
+
if (this_1.enableVirtualization) {
|
|
5522
|
+
this_1.updateValues();
|
|
5523
|
+
this_1.updateInputFields();
|
|
5524
|
+
this_1.notify("setCurrentViewDataAsync", {
|
|
5525
|
+
module: "VirtualScroll",
|
|
5526
|
+
});
|
|
5527
|
+
break;
|
|
5528
|
+
}
|
|
5106
5529
|
if (!this_1.list) {
|
|
5107
5530
|
if (this_1.dataSource instanceof DataManager) {
|
|
5108
5531
|
this_1.initRemoteRender = true;
|
|
@@ -5146,6 +5569,15 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
5146
5569
|
this_1.clearAll();
|
|
5147
5570
|
break;
|
|
5148
5571
|
}
|
|
5572
|
+
if (this_1.enableVirtualization) {
|
|
5573
|
+
this_1.updateValues();
|
|
5574
|
+
this_1.updateInputFields();
|
|
5575
|
+
this_1.notify("setCurrentViewDataAsync", {
|
|
5576
|
+
module: "VirtualScroll",
|
|
5577
|
+
});
|
|
5578
|
+
this_1.preventChange = this_1.isAngular && this_1.preventChange ? !this_1.preventChange : this_1.preventChange;
|
|
5579
|
+
break;
|
|
5580
|
+
}
|
|
5149
5581
|
this_1.notify('beforeValueChange', { newProp: newProp }); // gird component value type change
|
|
5150
5582
|
if (!this_1.list) {
|
|
5151
5583
|
if (this_1.dataSource instanceof DataManager) {
|
|
@@ -5295,6 +5727,12 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
5295
5727
|
}
|
|
5296
5728
|
};
|
|
5297
5729
|
};
|
|
5730
|
+
DropDownList.prototype.updatePopupState = function () {
|
|
5731
|
+
if (this.beforePopupOpen) {
|
|
5732
|
+
this.beforePopupOpen = false;
|
|
5733
|
+
this.showPopup();
|
|
5734
|
+
}
|
|
5735
|
+
};
|
|
5298
5736
|
DropDownList.prototype.setReadOnly = function () {
|
|
5299
5737
|
if (this.readonly) {
|
|
5300
5738
|
addClass([this.inputWrapper.container], ['e-readonly']);
|
|
@@ -5427,6 +5865,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
5427
5865
|
this.closePopup(0, e);
|
|
5428
5866
|
var dataItem = this.getItemData();
|
|
5429
5867
|
var isSelectVal = !isNullOrUndefined(this.selectedLI);
|
|
5868
|
+
if (isSelectVal && this.enableVirtualization && this.selectedLI.classList) {
|
|
5869
|
+
isSelectVal = this.selectedLI.classList.contains('e-active');
|
|
5870
|
+
}
|
|
5430
5871
|
if (this.inputElement && this.inputElement.value.trim() === '' && !this.isInteracted && (this.isSelectCustom ||
|
|
5431
5872
|
isSelectVal && this.inputElement.value !== dataItem.text)) {
|
|
5432
5873
|
this.isSelectCustom = false;
|
|
@@ -5920,14 +6361,17 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
5920
6361
|
DropDownTree.prototype.render = function () {
|
|
5921
6362
|
var isTree = select('#' + this.element.id + '_tree', document);
|
|
5922
6363
|
if (isTree) {
|
|
5923
|
-
var popupDiv = select('#' + this.element.id + '
|
|
6364
|
+
var popupDiv = select('#' + this.element.id + '_options', document);
|
|
5924
6365
|
detach(popupDiv ? popupDiv : isTree.parentElement);
|
|
5925
6366
|
}
|
|
5926
6367
|
this.ensureAutoCheck();
|
|
5927
6368
|
if (this.element.tagName === 'INPUT') {
|
|
5928
6369
|
this.inputEle = this.element;
|
|
5929
6370
|
if (isNullOrUndefined(this.inputEle.getAttribute('role'))) {
|
|
5930
|
-
this.inputEle.setAttribute('
|
|
6371
|
+
this.inputEle.setAttribute('aria-expanded', 'false');
|
|
6372
|
+
this.inputEle.setAttribute('role', 'combobox');
|
|
6373
|
+
this.inputEle.setAttribute('aria-haspopup', 'tree');
|
|
6374
|
+
this.inputEle.setAttribute('aria-controls', this.element.id + "_options");
|
|
5931
6375
|
}
|
|
5932
6376
|
if (isNullOrUndefined(this.inputEle.getAttribute('type'))) {
|
|
5933
6377
|
this.inputEle.setAttribute('type', 'text');
|
|
@@ -6095,8 +6539,12 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
6095
6539
|
}
|
|
6096
6540
|
_this.treeObj.fields = _this.getTreeFields(fields);
|
|
6097
6541
|
_this.treeObj.dataBind();
|
|
6098
|
-
if (_this.hasTemplate && _this.portals) {
|
|
6099
|
-
|
|
6542
|
+
if (_this.hasTemplate && _this.portals && _this.treeObj.portals) {
|
|
6543
|
+
for (var i = 0; i < _this.treeObj.portals.length; i++) {
|
|
6544
|
+
if (_this.portals.indexOf(_this.treeObj.portals[i]) == -1) {
|
|
6545
|
+
_this.portals.push(_this.treeObj.portals[i]);
|
|
6546
|
+
}
|
|
6547
|
+
}
|
|
6100
6548
|
if (_this.isReact) {
|
|
6101
6549
|
_this.renderReactTemplates();
|
|
6102
6550
|
}
|
|
@@ -6556,16 +7004,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
6556
7004
|
}
|
|
6557
7005
|
};
|
|
6558
7006
|
DropDownTree.prototype.getAriaAttributes = function () {
|
|
6559
|
-
|
|
6560
|
-
return {
|
|
6561
|
-
'aria-disabled': disable,
|
|
6562
|
-
'aria-owns': this.element.id + '_options',
|
|
6563
|
-
'role': 'listbox',
|
|
6564
|
-
'aria-haspopup': 'true',
|
|
6565
|
-
'aria-expanded': 'false',
|
|
6566
|
-
'aria-activedescendant': 'null',
|
|
6567
|
-
'aria-labelledby': this.hiddenElement.id
|
|
6568
|
-
};
|
|
7007
|
+
return {};
|
|
6569
7008
|
};
|
|
6570
7009
|
DropDownTree.prototype.updateOverFlowView = function () {
|
|
6571
7010
|
this.overFlowWrapper.classList.remove(TOTAL_COUNT_WRAPPER);
|
|
@@ -6916,7 +7355,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
6916
7355
|
}
|
|
6917
7356
|
}
|
|
6918
7357
|
else {
|
|
6919
|
-
this.
|
|
7358
|
+
this.inputEle.setAttribute(htmlAttr, this.htmlAttributes["" + htmlAttr]);
|
|
6920
7359
|
}
|
|
6921
7360
|
}
|
|
6922
7361
|
}
|
|
@@ -7170,8 +7609,10 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
7170
7609
|
addClass([_this.inputWrapper], [ICONANIMATION]);
|
|
7171
7610
|
if (_this.isFirstRender) {
|
|
7172
7611
|
_this.popupEle = _this.createElement('div', {
|
|
7173
|
-
id: _this.element.id + '
|
|
7612
|
+
id: _this.element.id + '_options', className: POPUP_CLASS + ' ' + (_this.cssClass != null ? _this.cssClass : '')
|
|
7174
7613
|
});
|
|
7614
|
+
_this.popupEle.setAttribute('role', 'region');
|
|
7615
|
+
_this.popupEle.setAttribute('aria-label', _this.element.id);
|
|
7175
7616
|
document.body.appendChild(_this.popupEle);
|
|
7176
7617
|
_this.createPopup(_this.popupEle);
|
|
7177
7618
|
}
|
|
@@ -7207,7 +7648,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
7207
7648
|
}
|
|
7208
7649
|
}
|
|
7209
7650
|
if (!isCancelled) {
|
|
7210
|
-
attributes(_this.
|
|
7651
|
+
attributes(_this.inputEle, { 'aria-expanded': 'true' });
|
|
7211
7652
|
_this.popupObj.show(null, (_this.zIndex === 1000) ? _this.inputEle : null);
|
|
7212
7653
|
removeClass([_this.popupEle], DDTHIDEICON);
|
|
7213
7654
|
_this.updatePopupHeight();
|
|
@@ -7659,8 +8100,12 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
7659
8100
|
}
|
|
7660
8101
|
};
|
|
7661
8102
|
DropDownTree.prototype.onNodeExpanded = function (args) {
|
|
7662
|
-
if (this.hasTemplate && this.portals) {
|
|
7663
|
-
|
|
8103
|
+
if (this.hasTemplate && this.portals && this.treeObj.portals) {
|
|
8104
|
+
for (var i = 0; i < this.treeObj.portals.length; i++) {
|
|
8105
|
+
if (this.portals.indexOf(this.treeObj.portals[i]) == -1) {
|
|
8106
|
+
this.portals.push(this.treeObj.portals[i]);
|
|
8107
|
+
}
|
|
8108
|
+
}
|
|
7664
8109
|
/* eslint-enable */
|
|
7665
8110
|
this.renderReactTemplates();
|
|
7666
8111
|
}
|
|
@@ -8693,7 +9138,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
8693
9138
|
if (this.popupEle) {
|
|
8694
9139
|
addClass([this.popupEle], DDTHIDEICON);
|
|
8695
9140
|
}
|
|
8696
|
-
attributes(this.
|
|
9141
|
+
attributes(this.inputEle, { 'aria-expanded': 'false' });
|
|
8697
9142
|
if (this.popupObj && this.isPopupOpen) {
|
|
8698
9143
|
this.popupObj.hide();
|
|
8699
9144
|
if (this.inputFocus) {
|
|
@@ -9115,7 +9560,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
9115
9560
|
if (this.isSelectCustom) {
|
|
9116
9561
|
this.removeSelection();
|
|
9117
9562
|
}
|
|
9118
|
-
if (!this.preventAutoFill && this.getModuleName() === 'combobox' && this.isTyped) {
|
|
9563
|
+
if (!this.preventAutoFill && this.getModuleName() === 'combobox' && this.isTyped && !this.enableVirtualization) {
|
|
9119
9564
|
setTimeout(function () {
|
|
9120
9565
|
_this.inlineSearch();
|
|
9121
9566
|
});
|
|
@@ -9124,7 +9569,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
9124
9569
|
ComboBox.prototype.getFocusElement = function () {
|
|
9125
9570
|
var dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
|
|
9126
9571
|
var selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : this.list;
|
|
9127
|
-
var isSelected = dataItem.text === this.inputElement.value && !isNullOrUndefined(selected);
|
|
9572
|
+
var isSelected = dataItem.text && dataItem.text.toString() === this.inputElement.value && !isNullOrUndefined(selected);
|
|
9128
9573
|
if (isSelected) {
|
|
9129
9574
|
return selected;
|
|
9130
9575
|
}
|
|
@@ -9134,6 +9579,70 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
9134
9579
|
var dataSource = this.sortedData;
|
|
9135
9580
|
var type = this.typeOfData(dataSource).typeof;
|
|
9136
9581
|
var activeItem = Search(inputValue, this.liCollections, this.filterType, true, dataSource, this.fields, type);
|
|
9582
|
+
if (this.enableVirtualization && inputValue !== '' && this.getModuleName() !== 'autocomplete' && this.isTyped && !this.allowFiltering) {
|
|
9583
|
+
var updatingincrementalindex = false;
|
|
9584
|
+
if ((this.viewPortInfo.endIndex >= this.incrementalEndIndex && this.incrementalEndIndex <= this.totalItemCount) || this.incrementalEndIndex == 0) {
|
|
9585
|
+
updatingincrementalindex = true;
|
|
9586
|
+
this.incrementalStartIndex = this.incrementalEndIndex;
|
|
9587
|
+
if (this.incrementalEndIndex == 0) {
|
|
9588
|
+
this.incrementalEndIndex = 100 > this.totalItemCount ? this.totalItemCount : 100;
|
|
9589
|
+
}
|
|
9590
|
+
else {
|
|
9591
|
+
this.incrementalEndIndex = this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100;
|
|
9592
|
+
}
|
|
9593
|
+
this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
|
|
9594
|
+
updatingincrementalindex = true;
|
|
9595
|
+
}
|
|
9596
|
+
if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
|
|
9597
|
+
this.updateIncrementalView(0, this.itemCount);
|
|
9598
|
+
}
|
|
9599
|
+
activeItem = Search(inputValue, this.incrementalLiCollections, this.filterType, true, dataSource, this.fields, type);
|
|
9600
|
+
while (isNullOrUndefined(activeItem) && this.incrementalEndIndex < this.totalItemCount) {
|
|
9601
|
+
this.incrementalStartIndex = this.incrementalEndIndex;
|
|
9602
|
+
this.incrementalEndIndex = this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100;
|
|
9603
|
+
this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
|
|
9604
|
+
updatingincrementalindex = true;
|
|
9605
|
+
if (this.viewPortInfo.startIndex !== 0 || updatingincrementalindex) {
|
|
9606
|
+
this.updateIncrementalView(0, this.itemCount);
|
|
9607
|
+
}
|
|
9608
|
+
activeItem = Search(inputValue, this.incrementalLiCollections, this.filterType, true, dataSource, this.fields, type);
|
|
9609
|
+
if (!isNullOrUndefined(activeItem)) {
|
|
9610
|
+
break;
|
|
9611
|
+
}
|
|
9612
|
+
if (isNullOrUndefined(activeItem) && this.incrementalEndIndex >= this.totalItemCount) {
|
|
9613
|
+
this.incrementalStartIndex = 0;
|
|
9614
|
+
this.incrementalEndIndex = 100 > this.totalItemCount ? this.totalItemCount : 100;
|
|
9615
|
+
break;
|
|
9616
|
+
}
|
|
9617
|
+
}
|
|
9618
|
+
if (activeItem.index) {
|
|
9619
|
+
if ((!(this.viewPortInfo.startIndex >= activeItem.index)) || (!(activeItem.index >= this.viewPortInfo.endIndex))) {
|
|
9620
|
+
var startIndex = activeItem.index - ((this.itemCount / 2) - 2) > 0 ? activeItem.index - ((this.itemCount / 2) - 2) : 0;
|
|
9621
|
+
var endIndex = this.viewPortInfo.startIndex + this.itemCount > this.totalItemCount ? this.totalItemCount : this.viewPortInfo.startIndex + this.itemCount;
|
|
9622
|
+
if (startIndex != this.viewPortInfo.startIndex) {
|
|
9623
|
+
this.updateIncrementalView(startIndex, endIndex);
|
|
9624
|
+
}
|
|
9625
|
+
}
|
|
9626
|
+
}
|
|
9627
|
+
if (!isNullOrUndefined(activeItem.item)) {
|
|
9628
|
+
var index_1 = this.getIndexByValue(activeItem.item.getAttribute('data-value')) - this.skeletonCount;
|
|
9629
|
+
if (index_1 > this.itemCount / 2) {
|
|
9630
|
+
var startIndex = this.viewPortInfo.startIndex + ((this.itemCount / 2) - 2) < this.totalItemCount ? this.viewPortInfo.startIndex + ((this.itemCount / 2) - 2) : this.totalItemCount;
|
|
9631
|
+
var endIndex = this.viewPortInfo.startIndex + this.itemCount > this.totalItemCount ? this.totalItemCount : this.viewPortInfo.startIndex + this.itemCount;
|
|
9632
|
+
this.updateIncrementalView(startIndex, endIndex);
|
|
9633
|
+
}
|
|
9634
|
+
activeItem.item = this.getElementByValue(activeItem.item.getAttribute('data-value'));
|
|
9635
|
+
}
|
|
9636
|
+
else {
|
|
9637
|
+
this.updateIncrementalView(0, this.itemCount);
|
|
9638
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9639
|
+
this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
|
|
9640
|
+
this.list.scrollTop = 0;
|
|
9641
|
+
}
|
|
9642
|
+
if (activeItem && activeItem.item) {
|
|
9643
|
+
activeItem.item = this.getElementByValue(activeItem.item.getAttribute('data-value'));
|
|
9644
|
+
}
|
|
9645
|
+
}
|
|
9137
9646
|
var activeElement = activeItem.item;
|
|
9138
9647
|
if (!isNullOrUndefined(activeElement)) {
|
|
9139
9648
|
var count = this.getIndexByValue(activeElement.getAttribute('data-value')) - 1;
|
|
@@ -9144,6 +9653,14 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
9144
9653
|
if (!this.enableVirtualization) {
|
|
9145
9654
|
this.list.scrollTop = count * height + fixedHead;
|
|
9146
9655
|
}
|
|
9656
|
+
else {
|
|
9657
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9658
|
+
this.list.getElementsByClassName('e-virtual-ddl-content')[0].style = this.getTransformValues();
|
|
9659
|
+
if (this.enableVirtualization && !this.fields.groupBy) {
|
|
9660
|
+
var selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ? activeElement.offsetTop + (this.virtualListInfo.startIndex * activeElement.offsetHeight) : activeElement.offsetTop;
|
|
9661
|
+
this.list.scrollTop = selectedLiOffsetTop - (this.list.querySelectorAll('.e-virtual-list').length * activeElement.offsetHeight);
|
|
9662
|
+
}
|
|
9663
|
+
}
|
|
9147
9664
|
addClass([activeElement], dropDownListClasses.focus);
|
|
9148
9665
|
}
|
|
9149
9666
|
}
|
|
@@ -9843,7 +10360,7 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
9843
10360
|
if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
|
|
9844
10361
|
filterQuery.where('', filterType, queryString, this.ignoreCase, this.ignoreAccent);
|
|
9845
10362
|
}
|
|
9846
|
-
else {
|
|
10363
|
+
else if ((!this.enableVirtualization) || (this.enableVirtualization && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource)))) {
|
|
9847
10364
|
var mapping = !isNullOrUndefined(this.fields.value) ? this.fields.value : '';
|
|
9848
10365
|
filterQuery.where(mapping, filterType, queryString, this.ignoreCase, this.ignoreAccent);
|
|
9849
10366
|
}
|
|
@@ -9859,7 +10376,7 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
9859
10376
|
}
|
|
9860
10377
|
filterQuery.take(this.suggestionCount);
|
|
9861
10378
|
}
|
|
9862
|
-
if (this.enableVirtualization) {
|
|
10379
|
+
if (this.enableVirtualization && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource))) {
|
|
9863
10380
|
var takeValue = this.getTakeValue();
|
|
9864
10381
|
filterQuery.skip(this.virtualItemStartIndex);
|
|
9865
10382
|
filterQuery.take(takeValue);
|
|
@@ -9941,7 +10458,7 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
9941
10458
|
document.getElementsByClassName('e-popup')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
|
|
9942
10459
|
}
|
|
9943
10460
|
}
|
|
9944
|
-
if (this.
|
|
10461
|
+
if ((this.getModuleName() === 'autocomplete' && !(this.dataSource instanceof DataManager)) || (this.getModuleName() === 'autocomplete' && (this.dataSource instanceof DataManager) && this.totalItemCount != 0)) {
|
|
9945
10462
|
this.getFilteringSkeletonCount();
|
|
9946
10463
|
}
|
|
9947
10464
|
}
|
|
@@ -9962,7 +10479,12 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
9962
10479
|
};
|
|
9963
10480
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9964
10481
|
AutoComplete.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
|
|
9965
|
-
this.
|
|
10482
|
+
if (!this.enableVirtualization) {
|
|
10483
|
+
this.fixedHeaderElement = null;
|
|
10484
|
+
}
|
|
10485
|
+
if ((this.getModuleName() === 'autocomplete' && !(this.dataSource instanceof DataManager)) || (this.getModuleName() === 'autocomplete' && (this.dataSource instanceof DataManager) && this.totalItemCount != 0)) {
|
|
10486
|
+
this.getFilteringSkeletonCount();
|
|
10487
|
+
}
|
|
9966
10488
|
_super.prototype.onActionComplete.call(this, ulElement, list, e);
|
|
9967
10489
|
var item = this.list.querySelector('.' + dropDownListClasses.li);
|
|
9968
10490
|
if (!isNullOrUndefined(item)) {
|
|
@@ -10646,7 +11168,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
10646
11168
|
if (_this.popupObj) {
|
|
10647
11169
|
_this.popupObj.show(eventArgs.animation, (_this.zIndex === 1000) ? _this.element : null);
|
|
10648
11170
|
}
|
|
10649
|
-
attributes(_this.inputElement, { 'aria-expanded': 'true', 'aria-owns': _this.
|
|
11171
|
+
attributes(_this.inputElement, { 'aria-expanded': 'true', 'aria-owns': _this.element.id + '_popup', 'aria-controls': _this.element.id });
|
|
10650
11172
|
_this.updateAriaActiveDescendant();
|
|
10651
11173
|
if (_this.isFirstClick) {
|
|
10652
11174
|
_this.loadTemplate();
|
|
@@ -10727,7 +11249,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
10727
11249
|
};
|
|
10728
11250
|
MultiSelect.prototype.updateListARIA = function () {
|
|
10729
11251
|
if (!isNullOrUndefined(this.ulElement)) {
|
|
10730
|
-
attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
|
|
11252
|
+
attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false', 'aria-label': 'list' });
|
|
10731
11253
|
}
|
|
10732
11254
|
var disableStatus = !isNullOrUndefined(this.inputElement) && (this.inputElement.disabled) ? true : false;
|
|
10733
11255
|
if (!this.isPopupOpen() && !isNullOrUndefined(this.inputElement)) {
|
|
@@ -14324,6 +14846,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
14324
14846
|
this.setWidth(this.width);
|
|
14325
14847
|
this.overAllWrapper.appendChild(this.componentWrapper);
|
|
14326
14848
|
this.popupWrapper = this.createElement('div', { id: this.element.id + '_popup', className: POPUP_WRAPPER });
|
|
14849
|
+
this.popupWrapper.setAttribute('aria-label', this.element.id);
|
|
14850
|
+
this.popupWrapper.setAttribute('role', 'dialog');
|
|
14327
14851
|
if (this.mode === 'Delimiter' || this.mode === 'CheckBox') {
|
|
14328
14852
|
this.delimiterWrapper = this.createElement('span', { className: DELIMITER_WRAPPER, styles: 'display:none' });
|
|
14329
14853
|
this.componentWrapper.appendChild(this.delimiterWrapper);
|
|
@@ -15054,7 +15578,10 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
15054
15578
|
'role': 'combobox',
|
|
15055
15579
|
'autocomplete': 'off',
|
|
15056
15580
|
'autocapitalize': 'off',
|
|
15057
|
-
'spellcheck': 'false'
|
|
15581
|
+
'spellcheck': 'false',
|
|
15582
|
+
'aria-label': 'multiselect',
|
|
15583
|
+
'aria-expanded': 'true',
|
|
15584
|
+
'aria-controls': args.popupElement.id
|
|
15058
15585
|
});
|
|
15059
15586
|
this.clearIconElement = this.filterInput.parentElement.querySelector('.' + clearIcon);
|
|
15060
15587
|
if (!Browser.isDevice && this.clearIconElement) {
|
|
@@ -15419,6 +15946,12 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
15419
15946
|
var hiddenSelect = this.createElement('select', { className: 'e-hidden-select', attrs: { 'multiple': '' } });
|
|
15420
15947
|
hiddenSelect.style.visibility = 'hidden';
|
|
15421
15948
|
this.list.classList.add('e-listbox-wrapper');
|
|
15949
|
+
this.list.querySelector('.e-list-parent').setAttribute('role', 'presentation');
|
|
15950
|
+
var groupHdrs = this.list.querySelectorAll('.e-list-group-item');
|
|
15951
|
+
for (var i = 0; i < groupHdrs.length; i++) {
|
|
15952
|
+
groupHdrs[i].removeAttribute('tabindex');
|
|
15953
|
+
groupHdrs[i].setAttribute('role', 'option');
|
|
15954
|
+
}
|
|
15422
15955
|
if (this.itemTemplate) {
|
|
15423
15956
|
this.list.classList.add('e-list-template');
|
|
15424
15957
|
}
|
|
@@ -16483,7 +17016,8 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
16483
17016
|
'autocomplete': 'off',
|
|
16484
17017
|
'autocorrect': 'off',
|
|
16485
17018
|
'autocapitalize': 'off',
|
|
16486
|
-
'spellcheck': 'false'
|
|
17019
|
+
'spellcheck': 'false',
|
|
17020
|
+
'role': 'textbox'
|
|
16487
17021
|
});
|
|
16488
17022
|
if (this.height.toString().indexOf('%') < 0) {
|
|
16489
17023
|
addClass([this.list], 'e-filter-list');
|
|
@@ -17890,6 +18424,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
17890
18424
|
}
|
|
17891
18425
|
}
|
|
17892
18426
|
this.inputElement.setAttribute('role', 'textbox');
|
|
18427
|
+
this.inputElement.setAttribute('aria-label', 'mention');
|
|
17893
18428
|
this.queryString = this.elementValue();
|
|
17894
18429
|
this.wireEvent();
|
|
17895
18430
|
};
|
|
@@ -18200,7 +18735,10 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
|
|
|
18200
18735
|
var value = this.getFormattedValue(focusItem.getAttribute('data-value'));
|
|
18201
18736
|
this.selectEventCallback(focusItem, this.getDataByValue(value), value, true);
|
|
18202
18737
|
}
|
|
18203
|
-
if (this.beforePopupOpen) {
|
|
18738
|
+
if (this.beforePopupOpen && this.isPopupOpen) {
|
|
18739
|
+
if (this.initRemoteRender && !isNullOrUndefined(this.popupObj.element)) {
|
|
18740
|
+
this.popupObj.element.remove();
|
|
18741
|
+
}
|
|
18204
18742
|
this.renderPopup();
|
|
18205
18743
|
}
|
|
18206
18744
|
}
|