@syncfusion/ej2-dropdowns 25.1.35 → 25.1.39
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 +48 -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 +270 -109
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +272 -111
- 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 +9 -9
- package/src/auto-complete/auto-complete.js +45 -29
- package/src/combo-box/combo-box.js +1 -4
- package/src/common/highlight-search.js +4 -0
- package/src/common/interface.d.ts +1 -0
- package/src/common/virtual-scroll.js +5 -5
- package/src/drop-down-base/drop-down-base.d.ts +3 -0
- package/src/drop-down-base/drop-down-base.js +37 -4
- package/src/drop-down-list/drop-down-list.js +71 -34
- package/src/drop-down-tree/drop-down-tree.js +21 -9
- package/src/list-box/list-box-model.d.ts +13 -1
- package/src/list-box/list-box.d.ts +12 -0
- package/src/list-box/list-box.js +4 -1
- package/src/mention/mention.js +1 -1
- package/src/multi-select/checkbox-selection.d.ts +2 -0
- package/src/multi-select/checkbox-selection.js +8 -1
- package/src/multi-select/multi-select-model.d.ts +1 -1
- package/src/multi-select/multi-select.d.ts +1 -0
- package/src/multi-select/multi-select.js +75 -22
- package/styles/fluent-dark.css +1 -1
- package/styles/fluent.css +1 -1
- package/styles/list-box/_layout.scss +6 -2
- package/styles/list-box/tailwind-dark.css +0 -10
- package/styles/list-box/tailwind.css +0 -10
- package/styles/material-dark.css +9 -0
- package/styles/material.css +9 -0
- package/styles/multi-select/_fluent-definition.scss +1 -1
- package/styles/multi-select/_material-dark-definition.scss +11 -0
- package/styles/multi-select/_material-definition.scss +11 -0
- package/styles/multi-select/fluent-dark.css +1 -1
- package/styles/multi-select/fluent.css +1 -1
- package/styles/multi-select/material-dark.css +9 -0
- package/styles/multi-select/material.css +9 -0
- package/styles/tailwind-dark.css +0 -10
- package/styles/tailwind.css +0 -10
- package/.eslintrc.json +0 -260
- package/tslint.json +0 -111
|
@@ -185,6 +185,10 @@ function resetIncrementalSearchValues(elementId) {
|
|
|
185
185
|
* @returns {void}
|
|
186
186
|
*/
|
|
187
187
|
function highlightSearch(element, query, ignoreCase, type) {
|
|
188
|
+
const isHtmlElement = /<[^>]*>/g.test(element.innerText);
|
|
189
|
+
if (isHtmlElement) {
|
|
190
|
+
element.innerText = element.innerText.replace(/[\u00A0-\u9999<>&]/g, (match) => `&#${match.charCodeAt(0)};`);
|
|
191
|
+
}
|
|
188
192
|
if (query === '') {
|
|
189
193
|
return;
|
|
190
194
|
}
|
|
@@ -423,10 +427,8 @@ class VirtualScroll {
|
|
|
423
427
|
this.parent.list.querySelector('.e-virtual-ddl-content').removeChild(reOrderList);
|
|
424
428
|
}
|
|
425
429
|
var query = this.parent.getForQuery(this.parent.value).clone();
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
query = query.skip(skipvalue);
|
|
429
|
-
}
|
|
430
|
+
var skipvalue = this.parent.viewPortInfo.startIndex - this.parent.value.length >= 0 ? this.parent.viewPortInfo.startIndex - this.parent.value.length : 0;
|
|
431
|
+
query = query.skip(skipvalue);
|
|
430
432
|
this.parent.resetList(this.parent.dataSource, this.parent.fields, query);
|
|
431
433
|
isListUpdated = false;
|
|
432
434
|
}
|
|
@@ -587,7 +589,9 @@ class VirtualScroll {
|
|
|
587
589
|
if (this.parent.keyboardEvent != null) {
|
|
588
590
|
this.parent.handleVirtualKeyboardActions(this.parent.keyboardEvent, this.parent.pageCount);
|
|
589
591
|
}
|
|
590
|
-
this.parent.
|
|
592
|
+
if (!this.parent.customFilterQuery) {
|
|
593
|
+
this.parent.isCustomFilter = false;
|
|
594
|
+
}
|
|
591
595
|
});
|
|
592
596
|
}
|
|
593
597
|
scrollListener(scrollArgs) {
|
|
@@ -824,6 +828,9 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
824
828
|
this.incrementalPreQueryString = '';
|
|
825
829
|
this.isObjectCustomValue = false;
|
|
826
830
|
this.appendUncheckList = false;
|
|
831
|
+
this.getInitialData = false;
|
|
832
|
+
this.preventPopupOpen = true;
|
|
833
|
+
this.customFilterQuery = new Query();
|
|
827
834
|
this.virtualListInfo = {
|
|
828
835
|
currentPageNumber: null,
|
|
829
836
|
direction: null,
|
|
@@ -1135,6 +1142,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1135
1142
|
const actualCount = this.virtualListHeight > 0 ? Math.floor(this.virtualListHeight / this.listItemHeight) : 0;
|
|
1136
1143
|
this.skeletonCount = actualCount * 2 < this.itemCount ? this.itemCount : actualCount * 2;
|
|
1137
1144
|
this.itemCount = retainSkeleton ? this.itemCount : this.skeletonCount;
|
|
1145
|
+
this.virtualItemCount = this.itemCount;
|
|
1138
1146
|
this.skeletonCount = Math.floor(this.skeletonCount / 2) + 2;
|
|
1139
1147
|
}
|
|
1140
1148
|
GetVirtualTrackHeight() {
|
|
@@ -1228,6 +1236,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1228
1236
|
*/
|
|
1229
1237
|
initialize(e) {
|
|
1230
1238
|
this.bindEvent = true;
|
|
1239
|
+
this.preventPopupOpen = true;
|
|
1231
1240
|
this.actionFailureTemplateId = `${this.element.id}${ACTIONFAILURETEMPLATE_PROPERTY}`;
|
|
1232
1241
|
if (this.element.tagName === 'UL') {
|
|
1233
1242
|
const jsonElement = ListBase.createJsonFromElement(this.element);
|
|
@@ -1411,6 +1420,12 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1411
1420
|
}
|
|
1412
1421
|
this.isRequested = false;
|
|
1413
1422
|
this.bindChildItems(listItems, ulElement, fields, e);
|
|
1423
|
+
if (this.getInitialData) {
|
|
1424
|
+
this.setListData(dataSource, fields, query, event);
|
|
1425
|
+
this.getInitialData = false;
|
|
1426
|
+
this.preventPopupOpen = false;
|
|
1427
|
+
return;
|
|
1428
|
+
}
|
|
1414
1429
|
}
|
|
1415
1430
|
});
|
|
1416
1431
|
}).catch((e) => {
|
|
@@ -1482,6 +1497,11 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1482
1497
|
this.renderGroupTemplate(ulElement);
|
|
1483
1498
|
}
|
|
1484
1499
|
this.bindChildItems(localDataArgs.result, ulElement, fields);
|
|
1500
|
+
if (this.getInitialData) {
|
|
1501
|
+
this.getInitialData = false;
|
|
1502
|
+
this.preventPopupOpen = false;
|
|
1503
|
+
return;
|
|
1504
|
+
}
|
|
1485
1505
|
setTimeout(() => {
|
|
1486
1506
|
if (this.getModuleName() === 'multiselect' && this.itemTemplate != null && (ulElement.childElementCount > 0 && (ulElement.children[0].childElementCount > 0 || (this.fields.groupBy && ulElement.children[1] && ulElement.children[1].childElementCount > 0)))) {
|
|
1487
1507
|
this.updateDataList();
|
|
@@ -1582,7 +1602,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1582
1602
|
onActionComplete(ulElement, list, e) {
|
|
1583
1603
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
1584
1604
|
this.listData = list;
|
|
1585
|
-
if (this.isVirtualizationEnabled && !this.isCustomDataUpdated) {
|
|
1605
|
+
if (this.isVirtualizationEnabled && !this.isCustomDataUpdated && !this.virtualSelectAll) {
|
|
1586
1606
|
this.notify("setGeneratedData", {
|
|
1587
1607
|
module: "VirtualScroll",
|
|
1588
1608
|
});
|
|
@@ -1804,6 +1824,9 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1804
1824
|
this.fixedHeaderElement.style.display = 'block';
|
|
1805
1825
|
}
|
|
1806
1826
|
getValidLi() {
|
|
1827
|
+
if (this.isVirtualizationEnabled) {
|
|
1828
|
+
return this.liCollections[0].classList.contains('e-virtual-list') ? this.liCollections[this.skeletonCount] : this.liCollections[0];
|
|
1829
|
+
}
|
|
1807
1830
|
return this.liCollections[0];
|
|
1808
1831
|
}
|
|
1809
1832
|
/**
|
|
@@ -1878,7 +1901,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1878
1901
|
}
|
|
1879
1902
|
this.updateListElements(listData);
|
|
1880
1903
|
}
|
|
1881
|
-
else if ((!virtualUlElement)) {
|
|
1904
|
+
else if ((!virtualUlElement) || (!virtualUlElement.firstChild)) {
|
|
1882
1905
|
this.list.innerHTML = '';
|
|
1883
1906
|
this.createVirtualContent();
|
|
1884
1907
|
this.list.querySelector('.e-virtual-ddl-content').appendChild(ulElement);
|
|
@@ -2222,6 +2245,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
2222
2245
|
}
|
|
2223
2246
|
}
|
|
2224
2247
|
const itemsCount = this.getItems().length;
|
|
2248
|
+
const isListboxEmpty = itemsCount === 0;
|
|
2225
2249
|
const selectedItemValue = this.list.querySelector('.' + dropDownBaseClasses.selected);
|
|
2226
2250
|
items = (items instanceof Array ? items : [items]);
|
|
2227
2251
|
let index;
|
|
@@ -2256,11 +2280,24 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
2256
2280
|
li.setAttribute('role', 'option');
|
|
2257
2281
|
this.notify('addItem', { module: 'CheckBoxSelection', item: li });
|
|
2258
2282
|
liCollections.push(li);
|
|
2259
|
-
this.
|
|
2283
|
+
if (this.getModuleName() === 'listbox') {
|
|
2284
|
+
this.listData.splice(isListboxEmpty ? this.listData.length : index, 0, item);
|
|
2285
|
+
if (this.listData.length !== this.sortedData.length) {
|
|
2286
|
+
this.sortedData = this.listData;
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
else {
|
|
2290
|
+
this.listData.push(item);
|
|
2291
|
+
}
|
|
2260
2292
|
if (this.sortOrder === 'None' && isNullOrUndefined(itemIndex) && index === 0) {
|
|
2261
2293
|
index = null;
|
|
2262
2294
|
}
|
|
2263
|
-
this.
|
|
2295
|
+
if (this.getModuleName() === 'listbox') {
|
|
2296
|
+
this.updateActionCompleteData(li, item, isListboxEmpty ? null : index);
|
|
2297
|
+
}
|
|
2298
|
+
else {
|
|
2299
|
+
this.updateActionCompleteData(li, item, index);
|
|
2300
|
+
}
|
|
2264
2301
|
//Listbox event
|
|
2265
2302
|
this.trigger('beforeItemRender', { element: li, item: item });
|
|
2266
2303
|
}
|
|
@@ -4123,6 +4160,10 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4123
4160
|
e.preventDefault();
|
|
4124
4161
|
break;
|
|
4125
4162
|
default:
|
|
4163
|
+
if (this.isFiltering() && this.getModuleName() === 'combobox' && isNullOrUndefined(this.list)) {
|
|
4164
|
+
this.getInitialData = true;
|
|
4165
|
+
this.renderList();
|
|
4166
|
+
}
|
|
4126
4167
|
this.typedString = this.filterInput.value;
|
|
4127
4168
|
this.preventAutoFill = false;
|
|
4128
4169
|
this.searchLists(e);
|
|
@@ -4171,13 +4212,13 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4171
4212
|
if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
|
|
4172
4213
|
filterQuery.where('', filterType, this.typedString, this.ignoreCase, this.ignoreAccent);
|
|
4173
4214
|
}
|
|
4174
|
-
else {
|
|
4215
|
+
else if (((this.getModuleName() !== 'combobox') || this.enableVirtualization) || (this.isFiltering() && this.getModuleName() === 'combobox' && this.typedString !== '')) {
|
|
4175
4216
|
const fields = (this.fields.text) ? this.fields.text : '';
|
|
4176
4217
|
filterQuery.where(fields, filterType, this.typedString, this.ignoreCase, this.ignoreAccent);
|
|
4177
4218
|
}
|
|
4178
4219
|
}
|
|
4179
4220
|
else {
|
|
4180
|
-
filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
|
|
4221
|
+
filterQuery = (this.enableVirtualization && !isNullOrUndefined(this.customFilterQuery)) ? this.customFilterQuery.clone() : query ? query.clone() : this.query ? this.query.clone() : new Query();
|
|
4181
4222
|
}
|
|
4182
4223
|
if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource))) {
|
|
4183
4224
|
var takeValue = this.getTakeValue();
|
|
@@ -4192,26 +4233,36 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4192
4233
|
}
|
|
4193
4234
|
let queryTakeValue = 0;
|
|
4194
4235
|
let querySkipValue = 0;
|
|
4195
|
-
if (
|
|
4196
|
-
for (let queryElements = 0; queryElements <
|
|
4197
|
-
if (
|
|
4198
|
-
querySkipValue =
|
|
4236
|
+
if (filterQuery && filterQuery.queries.length > 0) {
|
|
4237
|
+
for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
|
|
4238
|
+
if (filterQuery.queries[queryElements].fn === 'onSkip') {
|
|
4239
|
+
querySkipValue = filterQuery.queries[queryElements].e.nos;
|
|
4240
|
+
}
|
|
4241
|
+
if (filterQuery.queries[queryElements].fn === 'onTake') {
|
|
4242
|
+
queryTakeValue = takeValue <= filterQuery.queries[queryElements].e.nos ? filterQuery.queries[queryElements].e.nos : takeValue;
|
|
4199
4243
|
}
|
|
4244
|
+
}
|
|
4245
|
+
}
|
|
4246
|
+
if (queryTakeValue <= 0 && this.query && this.query.queries.length > 0) {
|
|
4247
|
+
for (let queryElements = 0; queryElements < this.query.queries.length; queryElements++) {
|
|
4200
4248
|
if (this.query.queries[queryElements].fn === 'onTake') {
|
|
4201
4249
|
queryTakeValue = takeValue <= this.query.queries[queryElements].e.nos ? this.query.queries[queryElements].e.nos : takeValue;
|
|
4202
4250
|
}
|
|
4203
4251
|
}
|
|
4204
4252
|
}
|
|
4205
4253
|
let skipExists = false;
|
|
4206
|
-
let takeExists = false;
|
|
4207
4254
|
if (filterQuery && filterQuery.queries.length > 0) {
|
|
4208
4255
|
for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
|
|
4209
4256
|
if (filterQuery.queries[queryElements].fn === 'onSkip') {
|
|
4210
|
-
|
|
4257
|
+
querySkipValue = filterQuery.queries[queryElements].e.nos;
|
|
4258
|
+
filterQuery.queries.splice(queryElements, 1);
|
|
4259
|
+
--queryElements;
|
|
4260
|
+
continue;
|
|
4211
4261
|
}
|
|
4212
4262
|
if (filterQuery.queries[queryElements].fn === 'onTake') {
|
|
4213
|
-
|
|
4214
|
-
filterQuery.queries
|
|
4263
|
+
queryTakeValue = filterQuery.queries[queryElements].e.nos <= queryTakeValue ? queryTakeValue : filterQuery.queries[queryElements].e.nos;
|
|
4264
|
+
filterQuery.queries.splice(queryElements, 1);
|
|
4265
|
+
--queryElements;
|
|
4215
4266
|
}
|
|
4216
4267
|
}
|
|
4217
4268
|
}
|
|
@@ -4227,17 +4278,23 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4227
4278
|
filterQuery.take(this.incrementalEndIndex);
|
|
4228
4279
|
}
|
|
4229
4280
|
else {
|
|
4230
|
-
if (
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
filterQuery.take(takeValue);
|
|
4236
|
-
}
|
|
4281
|
+
if (queryTakeValue > 0) {
|
|
4282
|
+
filterQuery.take(queryTakeValue);
|
|
4283
|
+
}
|
|
4284
|
+
else {
|
|
4285
|
+
filterQuery.take(takeValue);
|
|
4237
4286
|
}
|
|
4238
4287
|
}
|
|
4239
4288
|
filterQuery.requiresCount();
|
|
4240
4289
|
}
|
|
4290
|
+
else if (this.enableVirtualization && (this.dataSource instanceof DataManager && !this.virtualGroupDataSource)) {
|
|
4291
|
+
for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
|
|
4292
|
+
if (filterQuery.queries[queryElements].fn === 'onSkip' || filterQuery.queries[queryElements].fn === 'onTake') {
|
|
4293
|
+
filterQuery.queries.splice(queryElements, 1);
|
|
4294
|
+
--queryElements;
|
|
4295
|
+
}
|
|
4296
|
+
}
|
|
4297
|
+
}
|
|
4241
4298
|
return filterQuery;
|
|
4242
4299
|
}
|
|
4243
4300
|
getSelectionPoints() {
|
|
@@ -4263,6 +4320,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4263
4320
|
return;
|
|
4264
4321
|
}
|
|
4265
4322
|
this.isCustomFilter = true;
|
|
4323
|
+
this.customFilterQuery = query;
|
|
4266
4324
|
this.filteringAction(dataSource, query, fields);
|
|
4267
4325
|
},
|
|
4268
4326
|
baseEventArgs: e,
|
|
@@ -4290,7 +4348,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4290
4348
|
}
|
|
4291
4349
|
filteringAction(dataSource, query, fields) {
|
|
4292
4350
|
if (!isNullOrUndefined(this.filterInput)) {
|
|
4293
|
-
this.beforePopupOpen = (!this.isPopupOpen && this.getModuleName() === 'combobox' && this.filterInput.value === '') ?
|
|
4351
|
+
this.beforePopupOpen = ((!this.isPopupOpen && this.getModuleName() === 'combobox' && this.filterInput.value === '') || this.getInitialData) ?
|
|
4294
4352
|
false : true;
|
|
4295
4353
|
let isNoData = this.list.classList.contains(dropDownBaseClasses.noData);
|
|
4296
4354
|
if (this.filterInput.value.trim() === '' && !this.itemTemplate) {
|
|
@@ -4298,6 +4356,12 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4298
4356
|
this.isTyped = false;
|
|
4299
4357
|
if (!isNullOrUndefined(this.actionCompleteData.ulElement) && !isNullOrUndefined(this.actionCompleteData.list)) {
|
|
4300
4358
|
if (this.enableVirtualization) {
|
|
4359
|
+
if (this.isFiltering()) {
|
|
4360
|
+
this.isPreventScrollAction = true;
|
|
4361
|
+
this.list.scrollTop = 0;
|
|
4362
|
+
this.previousStartIndex = 0;
|
|
4363
|
+
this.virtualListInfo = null;
|
|
4364
|
+
}
|
|
4301
4365
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4302
4366
|
this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
|
|
4303
4367
|
this.resetList(dataSource, fields, query);
|
|
@@ -4466,6 +4530,13 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4466
4530
|
this.isNotSearchList = false;
|
|
4467
4531
|
return;
|
|
4468
4532
|
}
|
|
4533
|
+
if (this.getInitialData) {
|
|
4534
|
+
this.updateActionCompleteDataValues(ulElement, list);
|
|
4535
|
+
}
|
|
4536
|
+
if (!this.preventPopupOpen && this.getModuleName() === 'combobox') {
|
|
4537
|
+
this.beforePopupOpen = true;
|
|
4538
|
+
this.preventPopupOpen = true;
|
|
4539
|
+
}
|
|
4469
4540
|
let tempItemCount = this.itemCount;
|
|
4470
4541
|
if (this.isActive || !isNullOrUndefined(ulElement)) {
|
|
4471
4542
|
const selectedItem = this.selectedLI ? this.selectedLI.cloneNode(true) : null;
|
|
@@ -4643,7 +4714,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4643
4714
|
else {
|
|
4644
4715
|
this.actionCompleteData.ulElement.appendChild(li.cloneNode(true));
|
|
4645
4716
|
}
|
|
4646
|
-
if (this.isFiltering() && this.actionCompleteData.list.indexOf(item) < 0) {
|
|
4717
|
+
if (this.isFiltering() && this.actionCompleteData.list && this.actionCompleteData.list.indexOf(item) < 0) {
|
|
4647
4718
|
this.actionCompleteData.list.push(item);
|
|
4648
4719
|
}
|
|
4649
4720
|
}
|
|
@@ -4698,7 +4769,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4698
4769
|
popupEle.setAttribute('aria-label', this.element.id);
|
|
4699
4770
|
popupEle.setAttribute('role', 'dialog');
|
|
4700
4771
|
const searchBox = this.setSearchBox(popupEle);
|
|
4701
|
-
this.listContainerHeight = formatUnit(this.popupHeight);
|
|
4772
|
+
this.listContainerHeight = this.allowFiltering && this.getModuleName() === 'dropdownlist' && Browser.isDevice ? formatUnit(Math.round(window.outerHeight).toString() + 'px') : formatUnit(this.popupHeight);
|
|
4702
4773
|
if (this.headerTemplate) {
|
|
4703
4774
|
this.setHeaderTemplate(popupEle);
|
|
4704
4775
|
}
|
|
@@ -4713,6 +4784,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4713
4784
|
this.listItemHeight = listitems.length > 0 ? Math.ceil(listitems[0].getBoundingClientRect().height) : 0;
|
|
4714
4785
|
}
|
|
4715
4786
|
if (this.enableVirtualization && !this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
4787
|
+
this.getSkeletonCount();
|
|
4788
|
+
this.skeletonCount = this.totalItemCount < (this.itemCount * 2) ? 0 : this.skeletonCount;
|
|
4716
4789
|
if (!this.list.querySelector('.e-virtual-ddl-content')) {
|
|
4717
4790
|
this.list.appendChild(this.createElement('div', {
|
|
4718
4791
|
className: 'e-virtual-ddl-content',
|
|
@@ -5017,7 +5090,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5017
5090
|
const inputWidth = this.inputWrapper.container.offsetWidth * parseFloat(width) / 100;
|
|
5018
5091
|
width = inputWidth.toString() + 'px';
|
|
5019
5092
|
}
|
|
5020
|
-
if (Browser.isDevice && (!this.allowFiltering && (this.getModuleName() === 'dropdownlist' ||
|
|
5093
|
+
if (Browser.isDevice && (width.indexOf('px') > -1) && (!this.allowFiltering && (this.getModuleName() === 'dropdownlist' ||
|
|
5021
5094
|
(this.isDropDownClick && this.getModuleName() === 'combobox')))) {
|
|
5022
5095
|
const firstItem = this.isEmptyList() ? this.list : this.liCollections[0];
|
|
5023
5096
|
width = (parseInt(width, 10) + (parseInt(getComputedStyle(firstItem).textIndent, 10) -
|
|
@@ -5315,7 +5388,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5315
5388
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5316
5389
|
dataSourceCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
|
|
5317
5390
|
}
|
|
5318
|
-
if (this.enableVirtualization && this.isFiltering() &&
|
|
5391
|
+
if (this.enableVirtualization && this.isFiltering() && isFilterValue && this.totalItemCount !== dataSourceCount) {
|
|
5319
5392
|
this.updateInitialData();
|
|
5320
5393
|
this.checkAndResetCache();
|
|
5321
5394
|
}
|
|
@@ -5436,7 +5509,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5436
5509
|
this.setFields();
|
|
5437
5510
|
this.inputWrapper.container.style.width = formatUnit(this.width);
|
|
5438
5511
|
this.inputWrapper.container.classList.add('e-ddl');
|
|
5439
|
-
if (this.floatLabelType
|
|
5512
|
+
if (this.floatLabelType !== 'Never') {
|
|
5440
5513
|
Input.calculateWidth(this.inputElement, this.inputWrapper.container);
|
|
5441
5514
|
}
|
|
5442
5515
|
if (!isNullOrUndefined(this.inputWrapper.buttons[0]) && this.inputWrapper.container.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never') {
|
|
@@ -6077,6 +6150,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6077
6150
|
}
|
|
6078
6151
|
}
|
|
6079
6152
|
this.isVirtualTrackHeight = false;
|
|
6153
|
+
this.customFilterQuery = null;
|
|
6080
6154
|
this.closePopup(0, e);
|
|
6081
6155
|
const dataItem = this.getItemData();
|
|
6082
6156
|
let isSelectVal = !isNullOrUndefined(this.selectedLI);
|
|
@@ -6114,7 +6188,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6114
6188
|
}
|
|
6115
6189
|
addClass([this.inputWrapper.container], [dropDownListClasses.inputFocus]);
|
|
6116
6190
|
this.onFocus(e);
|
|
6117
|
-
if (this.floatLabelType
|
|
6191
|
+
if (this.floatLabelType !== 'Never') {
|
|
6118
6192
|
Input.calculateWidth(this.inputElement, this.inputWrapper.container);
|
|
6119
6193
|
}
|
|
6120
6194
|
}
|
|
@@ -6136,7 +6210,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6136
6210
|
this.targetElement().blur();
|
|
6137
6211
|
}
|
|
6138
6212
|
removeClass([this.inputWrapper.container], [dropDownListClasses.inputFocus]);
|
|
6139
|
-
if (this.floatLabelType
|
|
6213
|
+
if (this.floatLabelType !== 'Never') {
|
|
6140
6214
|
Input.calculateWidth(this.inputElement, this.inputWrapper.container);
|
|
6141
6215
|
}
|
|
6142
6216
|
}
|
|
@@ -6187,17 +6261,18 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6187
6261
|
detach(this.inputWrapper.container);
|
|
6188
6262
|
}
|
|
6189
6263
|
this.hiddenElement = null;
|
|
6264
|
+
this.filterInput = null;
|
|
6190
6265
|
this.inputWrapper = null;
|
|
6191
6266
|
this.keyboardModule = null;
|
|
6192
6267
|
this.ulElement = null;
|
|
6193
6268
|
this.list = null;
|
|
6269
|
+
this.clearIconElement = null;
|
|
6194
6270
|
this.popupObj = null;
|
|
6195
6271
|
this.popupContentElement = null;
|
|
6196
6272
|
this.rippleFun = null;
|
|
6197
6273
|
this.selectedLI = null;
|
|
6198
6274
|
this.liCollections = null;
|
|
6199
6275
|
this.item = null;
|
|
6200
|
-
this.inputWrapper = null;
|
|
6201
6276
|
this.footer = null;
|
|
6202
6277
|
this.header = null;
|
|
6203
6278
|
this.previousSelectedLI = null;
|
|
@@ -6214,9 +6289,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6214
6289
|
floatLabelType: this.floatLabelType,
|
|
6215
6290
|
properties: this.properties
|
|
6216
6291
|
}, this.clearButton);
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
}
|
|
6292
|
+
this.clearButton = null;
|
|
6293
|
+
this.inputElement = null;
|
|
6220
6294
|
super.destroy();
|
|
6221
6295
|
}
|
|
6222
6296
|
/* eslint-disable valid-jsdoc, jsdoc/require-returns-description */
|
|
@@ -6714,7 +6788,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
6714
6788
|
cancel: false,
|
|
6715
6789
|
preventDefaultAction: false,
|
|
6716
6790
|
event: event,
|
|
6717
|
-
text: value,
|
|
6791
|
+
text: value.trim(),
|
|
6718
6792
|
fields: filterFields
|
|
6719
6793
|
};
|
|
6720
6794
|
this.trigger('filtering', args, (args) => {
|
|
@@ -6722,7 +6796,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
6722
6796
|
let flag = false;
|
|
6723
6797
|
let fields;
|
|
6724
6798
|
this.isFilteredData = true;
|
|
6725
|
-
if (
|
|
6799
|
+
if (args.text === '') {
|
|
6726
6800
|
this.isFilteredData = false;
|
|
6727
6801
|
this.isFilterRestore = true;
|
|
6728
6802
|
this.isFromFilterChange = false;
|
|
@@ -6733,18 +6807,18 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
6733
6807
|
}
|
|
6734
6808
|
else {
|
|
6735
6809
|
if (this.treeDataType === 1) {
|
|
6736
|
-
fields = this.selfReferencefilter(
|
|
6810
|
+
fields = this.selfReferencefilter(args.text, args.fields);
|
|
6737
6811
|
}
|
|
6738
6812
|
else {
|
|
6739
6813
|
if (this.fields.dataSource instanceof DataManager) {
|
|
6740
|
-
fields = this.remoteDataFilter(
|
|
6814
|
+
fields = this.remoteDataFilter(args.text, args.fields);
|
|
6741
6815
|
fields.child = this.fields.child;
|
|
6742
6816
|
this.treeObj.fields = this.getTreeFields(args.fields);
|
|
6743
6817
|
this.treeObj.dataBind();
|
|
6744
6818
|
flag = true;
|
|
6745
6819
|
}
|
|
6746
6820
|
else {
|
|
6747
|
-
fields = this.nestedFilter(
|
|
6821
|
+
fields = this.nestedFilter(args.text, args.fields);
|
|
6748
6822
|
}
|
|
6749
6823
|
}
|
|
6750
6824
|
}
|
|
@@ -7412,12 +7486,12 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
7412
7486
|
createHiddenElement() {
|
|
7413
7487
|
if (this.allowMultiSelection || this.showCheckBox) {
|
|
7414
7488
|
this.hiddenElement = this.createElement('select', {
|
|
7415
|
-
attrs: { 'aria-hidden': 'true', 'class': HIDDENELEMENT, 'tabindex': '-1', 'multiple': '' }
|
|
7489
|
+
attrs: { 'aria-hidden': 'true', 'class': HIDDENELEMENT, 'tabindex': '-1', 'multiple': '', 'aria-label': this.getModuleName() }
|
|
7416
7490
|
});
|
|
7417
7491
|
}
|
|
7418
7492
|
else {
|
|
7419
7493
|
this.hiddenElement = this.createElement('select', {
|
|
7420
|
-
attrs: { 'aria-hidden': 'true', 'tabindex': '-1', 'class': HIDDENELEMENT }
|
|
7494
|
+
attrs: { 'aria-hidden': 'true', 'tabindex': '-1', 'class': HIDDENELEMENT, 'aria-label': this.getModuleName() }
|
|
7421
7495
|
});
|
|
7422
7496
|
}
|
|
7423
7497
|
prepend([this.hiddenElement], this.inputWrapper);
|
|
@@ -7561,9 +7635,11 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
7561
7635
|
}
|
|
7562
7636
|
setAttributes() {
|
|
7563
7637
|
this.inputEle.setAttribute('tabindex', '-1');
|
|
7638
|
+
this.inputEle.setAttribute('aria-label', this.getModuleName());
|
|
7564
7639
|
const id = this.element.getAttribute('id');
|
|
7565
7640
|
this.hiddenElement.id = id + '_hidden';
|
|
7566
7641
|
this.inputWrapper.setAttribute('tabindex', '0');
|
|
7642
|
+
this.inputWrapper.setAttribute('aria-label', this.getModuleName());
|
|
7567
7643
|
attributes(this.inputWrapper, this.getAriaAttributes());
|
|
7568
7644
|
}
|
|
7569
7645
|
setHTMLAttributes() {
|
|
@@ -7905,7 +7981,12 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
7905
7981
|
focusedElement.setAttribute('tabindex', '0');
|
|
7906
7982
|
}
|
|
7907
7983
|
else {
|
|
7908
|
-
|
|
7984
|
+
let oldFocussedNode = this.treeObj.element.querySelector('.e-node-focus');
|
|
7985
|
+
focusedElement = this.treeObj.element.querySelector('li:not(.e-disable):not(.e-prevent)');
|
|
7986
|
+
if (oldFocussedNode && oldFocussedNode != focusedElement) {
|
|
7987
|
+
oldFocussedNode.setAttribute('tabindex', '-1');
|
|
7988
|
+
removeClass([oldFocussedNode], 'e-node-focus');
|
|
7989
|
+
}
|
|
7909
7990
|
}
|
|
7910
7991
|
focusedElement.focus();
|
|
7911
7992
|
addClass([focusedElement], ['e-node-focus']);
|
|
@@ -8752,7 +8833,12 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
8752
8833
|
}
|
|
8753
8834
|
setFooterTemplate() {
|
|
8754
8835
|
if (this.footer) {
|
|
8755
|
-
this.
|
|
8836
|
+
if (this.isReact && typeof this.footerTemplate === 'function') {
|
|
8837
|
+
this.clearTemplate(['footerTemplate']);
|
|
8838
|
+
}
|
|
8839
|
+
else {
|
|
8840
|
+
this.footer.innerHTML = '';
|
|
8841
|
+
}
|
|
8756
8842
|
}
|
|
8757
8843
|
else {
|
|
8758
8844
|
this.footer = this.createElement('div');
|
|
@@ -10079,7 +10165,7 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
10079
10165
|
this.preventAutoFill = this.inputElement.value === '' ? false : this.preventAutoFill;
|
|
10080
10166
|
this.setAutoFill(activeElement, isKeyNavigate);
|
|
10081
10167
|
}
|
|
10082
|
-
else if (this.inputElement.value === '') {
|
|
10168
|
+
else if (!isNullOrUndefined(this.inputElement) && this.inputElement.value === '') {
|
|
10083
10169
|
this.activeIndex = null;
|
|
10084
10170
|
if (!isNullOrUndefined(this.list)) {
|
|
10085
10171
|
if (!this.enableVirtualization) {
|
|
@@ -10332,9 +10418,6 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
10332
10418
|
render() {
|
|
10333
10419
|
super.render();
|
|
10334
10420
|
this.setSearchBox();
|
|
10335
|
-
if (this.isFiltering() && this.getModuleName() === 'combobox' && isNullOrUndefined(this.list)) {
|
|
10336
|
-
super.renderList();
|
|
10337
|
-
}
|
|
10338
10421
|
this.renderComplete();
|
|
10339
10422
|
}
|
|
10340
10423
|
/**
|
|
@@ -10627,12 +10710,17 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
10627
10710
|
return 'EJS-AUTOCOMPLETE';
|
|
10628
10711
|
}
|
|
10629
10712
|
getQuery(query) {
|
|
10630
|
-
|
|
10713
|
+
let filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
|
|
10631
10714
|
let value = this.allowObjectBinding && !isNullOrUndefined(this.value) ? getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
|
|
10632
10715
|
const filterType = (this.queryString === '' && !isNullOrUndefined(value)) ? 'equal' : this.filterType;
|
|
10633
10716
|
const queryString = (this.queryString === '' && !isNullOrUndefined(value)) ? value : this.queryString;
|
|
10634
10717
|
if (this.isFiltered) {
|
|
10635
|
-
|
|
10718
|
+
if ((this.enableVirtualization && !isNullOrUndefined(this.customFilterQuery))) {
|
|
10719
|
+
filterQuery = this.customFilterQuery.clone();
|
|
10720
|
+
}
|
|
10721
|
+
else if (!this.enableVirtualization) {
|
|
10722
|
+
return filterQuery;
|
|
10723
|
+
}
|
|
10636
10724
|
}
|
|
10637
10725
|
if (this.queryString !== null && this.queryString !== '') {
|
|
10638
10726
|
const dataType = this.typeOfData(this.dataSource).typeof;
|
|
@@ -10658,48 +10746,61 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
10658
10746
|
if (this.enableVirtualization && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource))) {
|
|
10659
10747
|
let queryTakeValue = 0;
|
|
10660
10748
|
let querySkipValue = 0;
|
|
10661
|
-
|
|
10662
|
-
|
|
10663
|
-
|
|
10664
|
-
|
|
10749
|
+
var takeValue = this.getTakeValue();
|
|
10750
|
+
if (filterQuery && filterQuery.queries.length > 0) {
|
|
10751
|
+
for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
|
|
10752
|
+
if (filterQuery.queries[queryElements].fn === 'onSkip') {
|
|
10753
|
+
querySkipValue = filterQuery.queries[queryElements].e.nos;
|
|
10754
|
+
}
|
|
10755
|
+
if (filterQuery.queries[queryElements].fn === 'onTake') {
|
|
10756
|
+
queryTakeValue = takeValue <= filterQuery.queries[queryElements].e.nos ? filterQuery.queries[queryElements].e.nos : takeValue;
|
|
10665
10757
|
}
|
|
10758
|
+
}
|
|
10759
|
+
}
|
|
10760
|
+
if (queryTakeValue <= 0 && this.query && this.query.queries.length > 0) {
|
|
10761
|
+
for (let queryElements = 0; queryElements < this.query.queries.length; queryElements++) {
|
|
10666
10762
|
if (this.query.queries[queryElements].fn === 'onTake') {
|
|
10667
10763
|
queryTakeValue = takeValue <= this.query.queries[queryElements].e.nos ? this.query.queries[queryElements].e.nos : takeValue;
|
|
10668
10764
|
}
|
|
10669
10765
|
}
|
|
10670
10766
|
}
|
|
10671
|
-
let skipExists = false;
|
|
10672
|
-
let takeExists = false;
|
|
10673
10767
|
if (filterQuery && filterQuery.queries.length > 0) {
|
|
10674
10768
|
for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
|
|
10675
10769
|
if (filterQuery.queries[queryElements].fn === 'onSkip') {
|
|
10676
|
-
|
|
10770
|
+
querySkipValue = filterQuery.queries[queryElements].e.nos;
|
|
10771
|
+
filterQuery.queries.splice(queryElements, 1);
|
|
10772
|
+
--queryElements;
|
|
10773
|
+
continue;
|
|
10677
10774
|
}
|
|
10678
10775
|
if (filterQuery.queries[queryElements].fn === 'onTake') {
|
|
10679
|
-
|
|
10680
|
-
filterQuery.queries
|
|
10776
|
+
queryTakeValue = filterQuery.queries[queryElements].e.nos <= queryTakeValue ? queryTakeValue : filterQuery.queries[queryElements].e.nos;
|
|
10777
|
+
filterQuery.queries.splice(queryElements, 1);
|
|
10778
|
+
--queryElements;
|
|
10681
10779
|
}
|
|
10682
10780
|
}
|
|
10683
10781
|
}
|
|
10684
|
-
|
|
10685
|
-
|
|
10686
|
-
if (querySkipValue > 0 && this.virtualItemStartIndex <= querySkipValue) {
|
|
10687
|
-
filterQuery.skip(querySkipValue);
|
|
10688
|
-
}
|
|
10689
|
-
else {
|
|
10690
|
-
filterQuery.skip(this.virtualItemStartIndex);
|
|
10691
|
-
}
|
|
10782
|
+
if (querySkipValue > 0 && this.virtualItemStartIndex <= querySkipValue) {
|
|
10783
|
+
filterQuery.skip(querySkipValue);
|
|
10692
10784
|
}
|
|
10693
|
-
|
|
10694
|
-
|
|
10695
|
-
|
|
10696
|
-
|
|
10697
|
-
|
|
10698
|
-
|
|
10699
|
-
|
|
10785
|
+
else {
|
|
10786
|
+
filterQuery.skip(this.virtualItemStartIndex);
|
|
10787
|
+
}
|
|
10788
|
+
if (queryTakeValue > 0 && takeValue <= queryTakeValue) {
|
|
10789
|
+
filterQuery.take(queryTakeValue);
|
|
10790
|
+
}
|
|
10791
|
+
else {
|
|
10792
|
+
filterQuery.take(takeValue);
|
|
10700
10793
|
}
|
|
10701
10794
|
filterQuery.requiresCount();
|
|
10702
10795
|
}
|
|
10796
|
+
else if (this.enableVirtualization && (this.dataSource instanceof DataManager && !this.virtualGroupDataSource)) {
|
|
10797
|
+
for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
|
|
10798
|
+
if (filterQuery.queries[queryElements].fn === 'onSkip' || filterQuery.queries[queryElements].fn === 'onTake') {
|
|
10799
|
+
filterQuery.queries.splice(queryElements, 1);
|
|
10800
|
+
--queryElements;
|
|
10801
|
+
}
|
|
10802
|
+
}
|
|
10803
|
+
}
|
|
10703
10804
|
return filterQuery;
|
|
10704
10805
|
}
|
|
10705
10806
|
searchLists(e) {
|
|
@@ -10727,6 +10828,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
10727
10828
|
return;
|
|
10728
10829
|
}
|
|
10729
10830
|
this.isFiltered = true;
|
|
10831
|
+
this.customFilterQuery = query;
|
|
10730
10832
|
this.filterAction(dataSource, query, fields);
|
|
10731
10833
|
},
|
|
10732
10834
|
cancel: false
|
|
@@ -10856,10 +10958,6 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
10856
10958
|
}, 0);
|
|
10857
10959
|
}
|
|
10858
10960
|
else {
|
|
10859
|
-
const isHtmlElement = /<[^>]*>/g.test(e.item.innerText);
|
|
10860
|
-
if (isHtmlElement) {
|
|
10861
|
-
e.item.innerText = e.item.innerText.replace(/[\u00A0-\u9999<>&]/g, (match) => `&#${match.charCodeAt(0)};`);
|
|
10862
|
-
}
|
|
10863
10961
|
highlightSearch(e.item, this.queryString, this.ignoreCase, this.filterType);
|
|
10864
10962
|
}
|
|
10865
10963
|
}
|
|
@@ -11002,11 +11100,12 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
11002
11100
|
renderHightSearch() {
|
|
11003
11101
|
if (this.highlight) {
|
|
11004
11102
|
for (let i = 0; i < this.liCollections.length; i++) {
|
|
11005
|
-
|
|
11103
|
+
let isHighlight = this.ulElement.querySelector('.e-active');
|
|
11006
11104
|
if (!isHighlight) {
|
|
11007
11105
|
revertHighlightSearch(this.liCollections[i]);
|
|
11008
11106
|
highlightSearch(this.liCollections[i], this.queryString, this.ignoreCase, this.filterType);
|
|
11009
11107
|
}
|
|
11108
|
+
isHighlight = null;
|
|
11010
11109
|
}
|
|
11011
11110
|
}
|
|
11012
11111
|
}
|
|
@@ -11480,7 +11579,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11480
11579
|
attributes(this.inputElement, { 'aria-expanded': 'true', 'aria-owns': this.element.id + '_popup', 'aria-controls': this.element.id });
|
|
11481
11580
|
this.updateAriaActiveDescendant();
|
|
11482
11581
|
if (this.isFirstClick) {
|
|
11483
|
-
if (this.enableVirtualization && this.mode === 'CheckBox' && this.value) {
|
|
11582
|
+
if (this.enableVirtualization && this.mode === 'CheckBox' && this.value && this.enableSelectionOrder) {
|
|
11484
11583
|
this.updateVirtualReOrderList();
|
|
11485
11584
|
}
|
|
11486
11585
|
this.loadTemplate();
|
|
@@ -11550,9 +11649,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11550
11649
|
}
|
|
11551
11650
|
if (this.enableVirtualization) {
|
|
11552
11651
|
const focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
|
|
11553
|
-
|
|
11554
|
-
this.scrollBottom(focusedItem);
|
|
11555
|
-
}
|
|
11652
|
+
this.scrollBottom(focusedItem);
|
|
11556
11653
|
}
|
|
11557
11654
|
}
|
|
11558
11655
|
focusAtFirstListItem() {
|
|
@@ -11923,7 +12020,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11923
12020
|
&& (this.mode === 'CheckBox' && this.showSelectAll))) || (this.enableVirtualization && this.mode === 'CheckBox' && this.showSelectAll && this.virtualSelectAll && this.value && this.value.length === this.totalItemCount)) {
|
|
11924
12021
|
this.notify('checkSelectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'check' });
|
|
11925
12022
|
}
|
|
11926
|
-
else if ((searchCount !== searchActiveCount) && (this.mode === 'CheckBox' && this.showSelectAll)) {
|
|
12023
|
+
else if ((searchCount !== searchActiveCount) && (this.mode === 'CheckBox' && this.showSelectAll) && ((!this.enableVirtualization) || (this.enableVirtualization && !this.virtualSelectAll))) {
|
|
11927
12024
|
this.notify('checkSelectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'uncheck' });
|
|
11928
12025
|
}
|
|
11929
12026
|
if (this.enableGroupCheckBox && this.fields.groupBy && !this.enableSelectionOrder) {
|
|
@@ -11982,9 +12079,14 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11982
12079
|
this.dataUpdater(dataSource, query, fields);
|
|
11983
12080
|
}
|
|
11984
12081
|
getQuery(query) {
|
|
11985
|
-
|
|
12082
|
+
let filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
|
|
11986
12083
|
if (this.isFiltered) {
|
|
11987
|
-
|
|
12084
|
+
if ((this.enableVirtualization && !isNullOrUndefined(this.customFilterQuery))) {
|
|
12085
|
+
filterQuery = this.customFilterQuery.clone();
|
|
12086
|
+
}
|
|
12087
|
+
else if (!this.enableVirtualization) {
|
|
12088
|
+
return filterQuery;
|
|
12089
|
+
}
|
|
11988
12090
|
}
|
|
11989
12091
|
if (this.filterAction) {
|
|
11990
12092
|
if ((this.targetElement() !== null && !this.enableVirtualization) || (this.enableVirtualization && this.targetElement() !== null && this.targetElement().trim() !== '')) {
|
|
@@ -12006,6 +12108,15 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12006
12108
|
if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && !this.virtualSelectAll && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource))) {
|
|
12007
12109
|
return this.virtualFilterQuery(filterQuery);
|
|
12008
12110
|
}
|
|
12111
|
+
else if (this.enableVirtualization && (this.dataSource instanceof DataManager && !this.virtualGroupDataSource)) {
|
|
12112
|
+
for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
|
|
12113
|
+
if (filterQuery.queries[queryElements].fn === 'onSkip' || filterQuery.queries[queryElements].fn === 'onTake') {
|
|
12114
|
+
filterQuery.queries.splice(queryElements, 1);
|
|
12115
|
+
--queryElements;
|
|
12116
|
+
}
|
|
12117
|
+
}
|
|
12118
|
+
return filterQuery;
|
|
12119
|
+
}
|
|
12009
12120
|
return query ? query : this.query ? this.query : new Query();
|
|
12010
12121
|
}
|
|
12011
12122
|
}
|
|
@@ -12013,7 +12124,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12013
12124
|
var takeValue = this.getTakeValue();
|
|
12014
12125
|
var isReOrder = true;
|
|
12015
12126
|
var isSkip = true;
|
|
12016
|
-
var isTake = true;
|
|
12017
12127
|
for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
|
|
12018
12128
|
if (this.getModuleName() === 'multiselect' && ((filterQuery.queries[queryElements].e && filterQuery.queries[queryElements].e.condition == 'or') || (filterQuery.queries[queryElements].e && filterQuery.queries[queryElements].e.operator == 'equal'))) {
|
|
12019
12129
|
isReOrder = false;
|
|
@@ -12022,7 +12132,31 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12022
12132
|
isSkip = false;
|
|
12023
12133
|
}
|
|
12024
12134
|
if (filterQuery.queries[queryElements].fn === 'onTake') {
|
|
12025
|
-
|
|
12135
|
+
|
|
12136
|
+
}
|
|
12137
|
+
}
|
|
12138
|
+
let queryTakeValue = 0;
|
|
12139
|
+
if (filterQuery && filterQuery.queries.length > 0) {
|
|
12140
|
+
for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
|
|
12141
|
+
if (filterQuery.queries[queryElements].fn === 'onTake') {
|
|
12142
|
+
queryTakeValue = takeValue <= filterQuery.queries[queryElements].e.nos ? filterQuery.queries[queryElements].e.nos : takeValue;
|
|
12143
|
+
}
|
|
12144
|
+
}
|
|
12145
|
+
}
|
|
12146
|
+
if (queryTakeValue <= 0 && this.query && this.query.queries.length > 0) {
|
|
12147
|
+
for (let queryElements = 0; queryElements < this.query.queries.length; queryElements++) {
|
|
12148
|
+
if (this.query.queries[queryElements].fn === 'onTake') {
|
|
12149
|
+
queryTakeValue = takeValue <= this.query.queries[queryElements].e.nos ? this.query.queries[queryElements].e.nos : takeValue;
|
|
12150
|
+
}
|
|
12151
|
+
}
|
|
12152
|
+
}
|
|
12153
|
+
if (filterQuery && filterQuery.queries.length > 0) {
|
|
12154
|
+
for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
|
|
12155
|
+
if (filterQuery.queries[queryElements].fn === 'onTake') {
|
|
12156
|
+
queryTakeValue = filterQuery.queries[queryElements].e.nos <= queryTakeValue ? queryTakeValue : filterQuery.queries[queryElements].e.nos;
|
|
12157
|
+
filterQuery.queries.splice(queryElements, 1);
|
|
12158
|
+
--queryElements;
|
|
12159
|
+
}
|
|
12026
12160
|
}
|
|
12027
12161
|
}
|
|
12028
12162
|
if ((this.allowFiltering && isSkip) || !isReOrder || (!this.allowFiltering && isSkip)) {
|
|
@@ -12033,13 +12167,14 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12033
12167
|
filterQuery.skip(this.virtualItemStartIndex);
|
|
12034
12168
|
}
|
|
12035
12169
|
}
|
|
12036
|
-
if (
|
|
12037
|
-
|
|
12038
|
-
|
|
12039
|
-
|
|
12040
|
-
|
|
12041
|
-
|
|
12042
|
-
|
|
12170
|
+
if (this.isIncrementalRequest) {
|
|
12171
|
+
filterQuery.take(this.incrementalEndIndex);
|
|
12172
|
+
}
|
|
12173
|
+
else if (queryTakeValue > 0) {
|
|
12174
|
+
filterQuery.take(queryTakeValue);
|
|
12175
|
+
}
|
|
12176
|
+
else {
|
|
12177
|
+
filterQuery.take(takeValue);
|
|
12043
12178
|
}
|
|
12044
12179
|
filterQuery.requiresCount();
|
|
12045
12180
|
return filterQuery;
|
|
@@ -12362,7 +12497,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12362
12497
|
parseInt(getComputedStyle(this.dropIcon).marginRight);
|
|
12363
12498
|
elementWidth = this.overAllWrapper.clientWidth - (downIconWidth + 2 * (parseInt(getComputedStyle(this.inputElement).paddingRight)));
|
|
12364
12499
|
}
|
|
12365
|
-
if (this.floatLabelType
|
|
12500
|
+
if (this.floatLabelType !== 'Never') {
|
|
12366
12501
|
Input.calculateWidth(elementWidth, this.overAllWrapper, this.getModuleName());
|
|
12367
12502
|
}
|
|
12368
12503
|
}
|
|
@@ -13603,7 +13738,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
13603
13738
|
let currentText = [];
|
|
13604
13739
|
const value = this.allowObjectBinding ? getValue(((this.fields.value) ? this.fields.value : ''), this.value[this.value.length - 1]) : this.value[this.value.length - 1];
|
|
13605
13740
|
temp = this.getTextByValue(value);
|
|
13606
|
-
var textValues = this.text != null ? this.text + ',' + temp : temp;
|
|
13741
|
+
var textValues = this.text != null && this.text != "" ? this.text + ',' + temp : temp;
|
|
13607
13742
|
currentText.push(textValues);
|
|
13608
13743
|
this.setProperties({ text: currentText.toString() }, true);
|
|
13609
13744
|
}
|
|
@@ -13972,6 +14107,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
13972
14107
|
}
|
|
13973
14108
|
}
|
|
13974
14109
|
});
|
|
14110
|
+
this.checkCollision(this.popupWrapper);
|
|
13975
14111
|
this.popupContentElement = this.popupObj.element.querySelector('.e-content');
|
|
13976
14112
|
if (this.mode === 'CheckBox' && Browser.isDevice && this.allowFiltering) {
|
|
13977
14113
|
this.notify('deviceSearchBox', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
@@ -13981,6 +14117,15 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
13981
14117
|
}
|
|
13982
14118
|
}
|
|
13983
14119
|
}
|
|
14120
|
+
checkCollision(popupEle) {
|
|
14121
|
+
if (!(this.mode === 'CheckBox' && Browser.isDevice && this.allowFiltering)) {
|
|
14122
|
+
const collision = isCollide(popupEle);
|
|
14123
|
+
if (collision.length > 0) {
|
|
14124
|
+
popupEle.style.marginTop = -parseInt(getComputedStyle(popupEle).marginTop, 10) + 'px';
|
|
14125
|
+
}
|
|
14126
|
+
this.popupObj.resolveCollision();
|
|
14127
|
+
}
|
|
14128
|
+
}
|
|
13984
14129
|
setHeaderTemplate() {
|
|
13985
14130
|
let compiledString;
|
|
13986
14131
|
if (this.header) {
|
|
@@ -14242,6 +14387,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
14242
14387
|
return;
|
|
14243
14388
|
}
|
|
14244
14389
|
this.isFiltered = true;
|
|
14390
|
+
this.customFilterQuery = query;
|
|
14245
14391
|
this.remoteFilterAction = true;
|
|
14246
14392
|
this.dataUpdater(dataSource, query, fields);
|
|
14247
14393
|
},
|
|
@@ -14530,7 +14676,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
14530
14676
|
(element && (element.getAttribute('aria-selected') === 'true' && this.hideSelectedItem) &&
|
|
14531
14677
|
(this.mode === 'Box' || this.mode === 'Default'))) || (this.enableVirtualization && value != null && text != null && !isCustomData)) {
|
|
14532
14678
|
let currentText = [];
|
|
14533
|
-
var textValues = this.text != null ? this.text + ',' + text : text;
|
|
14679
|
+
var textValues = this.text != null && this.text != "" ? this.text + ',' + text : text;
|
|
14534
14680
|
currentText.push(textValues);
|
|
14535
14681
|
this.setProperties({ text: currentText.toString() }, true);
|
|
14536
14682
|
this.addChip(text, value);
|
|
@@ -14558,7 +14704,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
14558
14704
|
this.wireListEvents();
|
|
14559
14705
|
}
|
|
14560
14706
|
let currentText = [];
|
|
14561
|
-
var textValues = this.text != null ? this.text + ',' + text : text;
|
|
14707
|
+
var textValues = this.text != null && this.text != "" ? this.text + ',' + text : text;
|
|
14562
14708
|
currentText.push(textValues);
|
|
14563
14709
|
this.setProperties({ text: currentText.toString() }, true);
|
|
14564
14710
|
this.addChip(text, value);
|
|
@@ -15425,7 +15571,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
15425
15571
|
if (this.enableVirtualization) {
|
|
15426
15572
|
if (state) {
|
|
15427
15573
|
this.virtualSelectAll = true;
|
|
15428
|
-
this.resetList(this.dataSource, this.fields, new Query()
|
|
15574
|
+
this.resetList(this.dataSource, this.fields, new Query());
|
|
15429
15575
|
if (this.virtualSelectAllData instanceof Array) {
|
|
15430
15576
|
for (var i = 0; i < this.virtualSelectAllData.length; i++) {
|
|
15431
15577
|
if (li[this.skeletonCount + i]) {
|
|
@@ -15495,8 +15641,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
15495
15641
|
}
|
|
15496
15642
|
this.value = [];
|
|
15497
15643
|
this.virtualSelectAll = false;
|
|
15498
|
-
|
|
15499
|
-
|
|
15644
|
+
if (!isNullOrUndefined(this.viewPortInfo.startIndex) && !isNullOrUndefined(this.viewPortInfo.endIndex)) {
|
|
15645
|
+
this.notify("setCurrentViewDataAsync", {
|
|
15646
|
+
component: this.getModuleName(),
|
|
15647
|
+
module: "VirtualScroll",
|
|
15648
|
+
});
|
|
15649
|
+
}
|
|
15500
15650
|
}
|
|
15501
15651
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15502
15652
|
const virtualTrackElement = this.list.getElementsByClassName('e-virtual-ddl')[0];
|
|
@@ -15980,6 +16130,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
15980
16130
|
duration: 100,
|
|
15981
16131
|
delay: delay ? delay : 0
|
|
15982
16132
|
};
|
|
16133
|
+
this.customFilterQuery = null;
|
|
15983
16134
|
const eventArgs = { popup: this.popupObj, cancel: false, animation: animModel, event: e || null };
|
|
15984
16135
|
this.trigger('close', eventArgs, (eventArgs) => {
|
|
15985
16136
|
if (!eventArgs.cancel) {
|
|
@@ -16002,7 +16153,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16002
16153
|
if (this.mode === 'CheckBox' && this.showSelectAll) {
|
|
16003
16154
|
EventHandler.remove(this.popupObj.element, 'click', this.clickHandler);
|
|
16004
16155
|
}
|
|
16005
|
-
if (this.enableVirtualization && this.mode === 'CheckBox') {
|
|
16156
|
+
if (this.enableVirtualization && this.mode === 'CheckBox' && this.enableSelectionOrder) {
|
|
16006
16157
|
this.viewPortInfo.startIndex = this.virtualItemStartIndex = 0;
|
|
16007
16158
|
this.viewPortInfo.endIndex = this.virtualItemEndIndex = this.viewPortInfo.startIndex > 0 ? this.viewPortInfo.endIndex : this.itemCount;
|
|
16008
16159
|
this.previousStartIndex = 0;
|
|
@@ -17018,13 +17169,20 @@ class CheckBoxSelection {
|
|
|
17018
17169
|
if (this.parent.allowFiltering && this.parent.targetInputElement.value === '') {
|
|
17019
17170
|
this.parent.search(null);
|
|
17020
17171
|
}
|
|
17021
|
-
this.parent.refreshPopup();
|
|
17022
17172
|
this.parent.refreshListItems(null);
|
|
17173
|
+
this.parent.refreshPopup();
|
|
17023
17174
|
this.clearIconElement.style.visibility = 'hidden';
|
|
17024
17175
|
this.filterInput.focus();
|
|
17025
17176
|
this.setReorder(e);
|
|
17177
|
+
this.boundPreventListSelection = this.preventListSelection.bind(this);
|
|
17178
|
+
this.parent.popupWrapper.addEventListener('mouseup', this.boundPreventListSelection, true);
|
|
17026
17179
|
e.preventDefault();
|
|
17027
17180
|
}
|
|
17181
|
+
preventListSelection(e) {
|
|
17182
|
+
e.stopPropagation();
|
|
17183
|
+
this.parent.popupWrapper.removeEventListener('mouseup', this.boundPreventListSelection, true);
|
|
17184
|
+
this.boundPreventListSelection = null;
|
|
17185
|
+
}
|
|
17028
17186
|
setDeviceSearchBox() {
|
|
17029
17187
|
this.parent.popupObj.element.classList.add(device);
|
|
17030
17188
|
this.parent.popupObj.element.classList.add(mobileFilter);
|
|
@@ -17423,7 +17581,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
17423
17581
|
}
|
|
17424
17582
|
}
|
|
17425
17583
|
updateActionCompleteData(li, item, index) {
|
|
17426
|
-
this.jsonData.splice(index, 0, item);
|
|
17584
|
+
this.jsonData.splice(index === null ? this.jsonData.length : index, 0, item);
|
|
17427
17585
|
}
|
|
17428
17586
|
initToolbar() {
|
|
17429
17587
|
const pos = this.toolbarSettings.position;
|
|
@@ -19612,6 +19770,9 @@ __decorate$6([
|
|
|
19612
19770
|
__decorate$6([
|
|
19613
19771
|
Property(null)
|
|
19614
19772
|
], ListBox.prototype, "filterBarPlaceholder", void 0);
|
|
19773
|
+
__decorate$6([
|
|
19774
|
+
Property('None')
|
|
19775
|
+
], ListBox.prototype, "sortOrder", void 0);
|
|
19615
19776
|
__decorate$6([
|
|
19616
19777
|
Event()
|
|
19617
19778
|
], ListBox.prototype, "beforeItemRender", void 0);
|
|
@@ -20061,7 +20222,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
20061
20222
|
}
|
|
20062
20223
|
}
|
|
20063
20224
|
else if (this.allowSpaces && this.queryString !== '' && currentRange && currentRange.trim() !== '' && currentRange.replace('\u00a0', ' ').lastIndexOf(' ') < currentRange.length - 1 &&
|
|
20064
|
-
e.keyCode !== 38 && e.keyCode !== 40 && e.keyCode !== 8 && this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0)) {
|
|
20225
|
+
e.keyCode !== 38 && e.keyCode !== 40 && e.keyCode !== 8 && (this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0) || (this.liCollections && this.liCollections.length > 0))) {
|
|
20065
20226
|
this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
|
|
20066
20227
|
this.searchLists(e);
|
|
20067
20228
|
}
|