@syncfusion/ej2-dropdowns 25.1.41 → 25.2.4
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/.eslintrc.json +260 -0
- package/CHANGELOG.md +32 -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 +184 -119
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +193 -127
- package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
- package/dist/global/ej2-dropdowns.min.js +2 -2
- package/dist/global/ej2-dropdowns.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +12 -12
- package/src/drop-down-base/drop-down-base.d.ts +7 -2
- package/src/drop-down-base/drop-down-base.js +21 -9
- package/src/drop-down-list/drop-down-list.js +2 -2
- package/src/drop-down-tree/drop-down-tree.js +8 -4
- package/src/multi-select/multi-select.d.ts +2 -0
- package/src/multi-select/multi-select.js +162 -112
- package/tslint.json +111 -0
|
@@ -840,6 +840,8 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
840
840
|
this.appendUncheckList = false;
|
|
841
841
|
this.getInitialData = false;
|
|
842
842
|
this.preventPopupOpen = true;
|
|
843
|
+
this.virtualSelectAllState = false;
|
|
844
|
+
this.CurrentEvent = null;
|
|
843
845
|
this.virtualListInfo = {
|
|
844
846
|
currentPageNumber: null,
|
|
845
847
|
direction: null,
|
|
@@ -1434,8 +1436,8 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1434
1436
|
if (!isWhereExist) {
|
|
1435
1437
|
this.remoteDataCount = e.count;
|
|
1436
1438
|
}
|
|
1437
|
-
this.dataCount = e.count;
|
|
1438
|
-
this.totalItemCount = e.count;
|
|
1439
|
+
this.dataCount = !this.virtualSelectAll ? e.count : this.dataCount;
|
|
1440
|
+
this.totalItemCount = !this.virtualSelectAll ? e.count : this.totalItemCount;
|
|
1439
1441
|
ulElement = this.renderItems(listItems, fields);
|
|
1440
1442
|
this.appendUncheckList = false;
|
|
1441
1443
|
this.onActionComplete(ulElement, listItems, e);
|
|
@@ -1461,6 +1463,12 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1461
1463
|
if (this.isVirtualizationEnabled) {
|
|
1462
1464
|
this.getFilteringSkeletonCount();
|
|
1463
1465
|
}
|
|
1466
|
+
if (this.virtualSelectAll && this.virtualSelectAllData) {
|
|
1467
|
+
this.virtualSelectionAll(this.virtualSelectAllState, this.liCollections, this.CurrentEvent);
|
|
1468
|
+
this.virtualSelectAllState = false;
|
|
1469
|
+
this.CurrentEvent = null;
|
|
1470
|
+
this.virtualSelectAll = false;
|
|
1471
|
+
}
|
|
1464
1472
|
}
|
|
1465
1473
|
});
|
|
1466
1474
|
}).catch((e) => {
|
|
@@ -1512,11 +1520,11 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1512
1520
|
}
|
|
1513
1521
|
}
|
|
1514
1522
|
}
|
|
1515
|
-
if (isReOrder && (!(this.dataSource instanceof DataManager) && !this.isCustomDataUpdated)) {
|
|
1523
|
+
if (isReOrder && (!(this.dataSource instanceof DataManager) && !this.isCustomDataUpdated) && !this.virtualSelectAll) {
|
|
1516
1524
|
// eslint-disable @typescript-eslint/no-explicit-any
|
|
1517
1525
|
this.dataCount = this.totalItemCount = this.virtualSelectAll ? listItems.length : listItems.count;
|
|
1518
1526
|
}
|
|
1519
|
-
listItems = this.isVirtualizationEnabled
|
|
1527
|
+
listItems = this.isVirtualizationEnabled ? listItems.result : listItems;
|
|
1520
1528
|
// eslint-enable @typescript-eslint/no-explicit-any
|
|
1521
1529
|
const localDataArgs = { cancel: false, result: listItems };
|
|
1522
1530
|
this.isPreventChange = this.isAngular && this.preventChange ? true : this.isPreventChange;
|
|
@@ -1555,6 +1563,9 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1555
1563
|
updatePopupState() {
|
|
1556
1564
|
// Used this method in component side.
|
|
1557
1565
|
}
|
|
1566
|
+
virtualSelectionAll(state, li, event) {
|
|
1567
|
+
// Used this method in component side.
|
|
1568
|
+
}
|
|
1558
1569
|
updateRemoteData() {
|
|
1559
1570
|
this.setListData(this.dataSource, this.fields, this.query);
|
|
1560
1571
|
}
|
|
@@ -2041,10 +2052,10 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
2041
2052
|
*/
|
|
2042
2053
|
getIndexByValueFilter(value) {
|
|
2043
2054
|
let index;
|
|
2044
|
-
const listItems = this.renderItems(this.
|
|
2045
|
-
if (listItems
|
|
2046
|
-
for (let i = 0; i < listItems.
|
|
2047
|
-
if (!isNullOrUndefined(value) && listItems
|
|
2055
|
+
const listItems = this.renderItems(this.dataSource, this.fields).querySelectorAll('li' + ':not(.e-list-group-item)');
|
|
2056
|
+
if (listItems) {
|
|
2057
|
+
for (let i = 0; i < listItems.length; i++) {
|
|
2058
|
+
if (!isNullOrUndefined(value) && listItems[i].getAttribute('data-value') === value.toString()) {
|
|
2048
2059
|
index = i;
|
|
2049
2060
|
break;
|
|
2050
2061
|
}
|
|
@@ -2272,7 +2283,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
2272
2283
|
}
|
|
2273
2284
|
}
|
|
2274
2285
|
const itemsCount = this.getItems().length;
|
|
2275
|
-
|
|
2286
|
+
let isListboxEmpty = itemsCount === 0;
|
|
2276
2287
|
const selectedItemValue = this.list.querySelector('.' + dropDownBaseClasses.selected);
|
|
2277
2288
|
items = (items instanceof Array ? items : [items]);
|
|
2278
2289
|
let index;
|
|
@@ -2321,6 +2332,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
2321
2332
|
}
|
|
2322
2333
|
if (this.getModuleName() === 'listbox') {
|
|
2323
2334
|
this.updateActionCompleteData(li, item, isListboxEmpty ? null : index);
|
|
2335
|
+
isListboxEmpty = true;
|
|
2324
2336
|
}
|
|
2325
2337
|
else {
|
|
2326
2338
|
this.updateActionCompleteData(li, item, index);
|
|
@@ -2368,7 +2380,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
2368
2380
|
}
|
|
2369
2381
|
}
|
|
2370
2382
|
else {
|
|
2371
|
-
if (this.liCollections[index]) {
|
|
2383
|
+
if (this.liCollections[index] && this.liCollections[index].parentNode) {
|
|
2372
2384
|
this.liCollections[index].parentNode.insertBefore(liCollections[i], this.liCollections[index]);
|
|
2373
2385
|
}
|
|
2374
2386
|
else {
|
|
@@ -4952,7 +4964,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4952
4964
|
this.popupContentElement.setAttribute('id', 'no-record');
|
|
4953
4965
|
}
|
|
4954
4966
|
this.inputElement.setAttribute('aria-expanded', 'true');
|
|
4955
|
-
this.inputElement.setAttribute('aria-controls', this.element.id);
|
|
4967
|
+
this.inputElement.setAttribute('aria-controls', this.element.id + '_popup');
|
|
4956
4968
|
const inputParent = this.isFiltering() ? this.filterInput.parentElement : this.inputWrapper.container;
|
|
4957
4969
|
addClass([inputParent], [dropDownListClasses.inputFocus]);
|
|
4958
4970
|
const animModel = { name: 'FadeIn', duration: 100 };
|
|
@@ -5476,6 +5488,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5476
5488
|
destroyPopup() {
|
|
5477
5489
|
this.isPopupOpen = false;
|
|
5478
5490
|
this.isFilterFocus = false;
|
|
5491
|
+
this.inputElement.removeAttribute('aria-controls');
|
|
5479
5492
|
if (this.popupObj) {
|
|
5480
5493
|
this.popupObj.destroy();
|
|
5481
5494
|
detach(this.popupObj.element);
|
|
@@ -5566,7 +5579,6 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5566
5579
|
attributes(this.targetElement(), { 'aria-label': this.getModuleName() });
|
|
5567
5580
|
this.inputElement.setAttribute('aria-label', this.getModuleName());
|
|
5568
5581
|
this.inputElement.setAttribute('aria-expanded', 'false');
|
|
5569
|
-
this.inputElement.setAttribute('aria-controls', this.element.id + '_popups');
|
|
5570
5582
|
}
|
|
5571
5583
|
attributes(this.targetElement(), this.getAriaAttributes());
|
|
5572
5584
|
this.updateDataAttribute(this.htmlAttributes);
|
|
@@ -8028,10 +8040,14 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
8028
8040
|
focusedElement.focus();
|
|
8029
8041
|
addClass([focusedElement], ['e-node-focus']);
|
|
8030
8042
|
}
|
|
8031
|
-
if (this.
|
|
8032
|
-
const
|
|
8033
|
-
this.
|
|
8034
|
-
this.checkSelectAll
|
|
8043
|
+
if (this.treeObj.checkedNodes.length > 0) {
|
|
8044
|
+
const nodes = this.treeObj.element.querySelectorAll('li');
|
|
8045
|
+
const checkedNodes = this.treeObj.element.querySelectorAll('li[aria-checked=true]');
|
|
8046
|
+
if ((checkedNodes.length === nodes.length || this.checkSelectAll) && this.checkBoxElement) {
|
|
8047
|
+
const wrap = closest(this.checkBoxElement, '.' + CHECKBOXWRAP);
|
|
8048
|
+
this.changeState(wrap, 'check');
|
|
8049
|
+
this.checkSelectAll = false;
|
|
8050
|
+
}
|
|
8035
8051
|
}
|
|
8036
8052
|
if (this.allowFiltering) {
|
|
8037
8053
|
removeClass([this.inputWrapper], [INPUTFOCUS]);
|
|
@@ -11447,6 +11463,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11447
11463
|
this.resetMainList = null;
|
|
11448
11464
|
this.resetFilteredData = false;
|
|
11449
11465
|
this.preventSetCurrentData = false;
|
|
11466
|
+
this.isSelectAllLoop = false;
|
|
11450
11467
|
this.scrollFocusStatus = false;
|
|
11451
11468
|
this.keyDownStatus = false;
|
|
11452
11469
|
this.IsScrollerAtEnd = function () {
|
|
@@ -11771,7 +11788,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11771
11788
|
if (!isNullOrUndefined(this.value)) {
|
|
11772
11789
|
this.tempValues = this.allowObjectBinding ? this.value.slice() : this.value.slice();
|
|
11773
11790
|
}
|
|
11774
|
-
let customValue = this.allowObjectBinding ? this.getDataByValue(value) : this.getFormattedValue(value);
|
|
11791
|
+
let customValue = this.allowObjectBinding ? this.getDataByValue(this.getFormattedValue(value)) : this.getFormattedValue(value);
|
|
11775
11792
|
if (this.allowCustomValue && (value !== 'false' && customValue === false || (!isNullOrUndefined(customValue) &&
|
|
11776
11793
|
customValue.toString() === 'NaN'))) {
|
|
11777
11794
|
customValue = value;
|
|
@@ -12145,6 +12162,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12145
12162
|
if (this.enableVirtualization && (this.viewPortInfo.endIndex != 0) && !this.virtualSelectAll) {
|
|
12146
12163
|
return this.virtualFilterQuery(filterQuery);
|
|
12147
12164
|
}
|
|
12165
|
+
if (this.virtualSelectAll) {
|
|
12166
|
+
return query ? query.take(this.maximumSelectionLength).requiresCount() : this.query ? this.query.take(this.maximumSelectionLength).requiresCount() : new Query().take(this.maximumSelectionLength).requiresCount();
|
|
12167
|
+
}
|
|
12148
12168
|
return query ? query : this.query ? this.query : new Query();
|
|
12149
12169
|
}
|
|
12150
12170
|
}
|
|
@@ -13310,7 +13330,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
13310
13330
|
this.removeChipSelection();
|
|
13311
13331
|
this.addChipSelection(temp, e);
|
|
13312
13332
|
}
|
|
13313
|
-
const currentChip = this.allowObjectBinding ? this.getDataByValue(selectedElem.getAttribute('data-value')) : selectedElem.getAttribute('data-value');
|
|
13333
|
+
const currentChip = this.allowObjectBinding ? this.getDataByValue(this.getFormattedValue(selectedElem.getAttribute('data-value'))) : selectedElem.getAttribute('data-value');
|
|
13314
13334
|
this.removeValue(currentChip, e);
|
|
13315
13335
|
this.makeTextBoxEmpty();
|
|
13316
13336
|
}
|
|
@@ -13496,7 +13516,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
13496
13516
|
if (this.enabled && !this.readonly) {
|
|
13497
13517
|
const element = e.target.parentElement;
|
|
13498
13518
|
const customVal = element.getAttribute('data-value');
|
|
13499
|
-
let value = this.allowObjectBinding ? this.getDataByValue(customVal) : this.getFormattedValue(customVal);
|
|
13519
|
+
let value = this.allowObjectBinding ? this.getDataByValue(this.getFormattedValue(customVal)) : this.getFormattedValue(customVal);
|
|
13500
13520
|
if (this.allowCustomValue && ((customVal !== 'false' && value === false) ||
|
|
13501
13521
|
(!isNullOrUndefined(value) && value.toString() === 'NaN'))) {
|
|
13502
13522
|
value = customVal;
|
|
@@ -13586,8 +13606,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
13586
13606
|
dropDownBaseClasses.selected;
|
|
13587
13607
|
if (index !== -1) {
|
|
13588
13608
|
const currentValue = this.allowObjectBinding ? getValue(((this.fields.value) ? this.fields.value : ''), value) : value;
|
|
13589
|
-
const element = this.findListElement(this.list, 'li', 'data-value', currentValue);
|
|
13590
|
-
const val = this.getDataByValue(value);
|
|
13609
|
+
const element = this.virtualSelectAll ? null : this.findListElement(this.list, 'li', 'data-value', currentValue);
|
|
13610
|
+
const val = this.allowObjectBinding ? value : this.getDataByValue(value);
|
|
13591
13611
|
const eventArgs = {
|
|
13592
13612
|
e: eve,
|
|
13593
13613
|
item: element,
|
|
@@ -13770,9 +13790,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
13770
13790
|
this.value = [];
|
|
13771
13791
|
}
|
|
13772
13792
|
let currentValue = this.allowObjectBinding ? this.getDataByValue(value) : value;
|
|
13773
|
-
if ((this.allowObjectBinding && !this.isObjectInArray(value, this.value)) || (!this.allowObjectBinding && this.value.indexOf(currentValue) < 0)) {
|
|
13793
|
+
if ((this.allowObjectBinding && !this.isObjectInArray(this.getDataByValue(value), this.value)) || (!this.allowObjectBinding && this.value.indexOf(currentValue) < 0)) {
|
|
13774
13794
|
this.setProperties({ value: [].concat([], this.value, [currentValue]) }, true);
|
|
13775
|
-
if (this.enableVirtualization) {
|
|
13795
|
+
if (this.enableVirtualization && !this.isSelectAllLoop) {
|
|
13776
13796
|
let data = this.viewWrapper.innerHTML;
|
|
13777
13797
|
let temp;
|
|
13778
13798
|
data += (this.value.length === 1) ? '' : this.delimiterChar + ' ';
|
|
@@ -14608,7 +14628,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
14608
14628
|
if (!this.enableVirtualization) {
|
|
14609
14629
|
this.listData = this.mainData;
|
|
14610
14630
|
}
|
|
14611
|
-
if (!isNullOrUndefined(this.hiddenElement)) {
|
|
14631
|
+
if (!isNullOrUndefined(this.hiddenElement) && !this.enableVirtualization) {
|
|
14612
14632
|
this.hiddenElement.innerHTML = '';
|
|
14613
14633
|
}
|
|
14614
14634
|
if (!isNullOrUndefined(this.value)) {
|
|
@@ -14636,6 +14656,27 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
14636
14656
|
let textValues = this.text != null && this.text != "" ? this.text + ',' + temp : temp;
|
|
14637
14657
|
data += temp + delimiterChar + ' ';
|
|
14638
14658
|
text.push(textValues);
|
|
14659
|
+
hiddenElementContent = this.hiddenElement.innerHTML;
|
|
14660
|
+
if ((e && e.currentTarget && e.currentTarget.classList.contains('e-chips-close')) || (e && (e.key === 'Backspace'))) {
|
|
14661
|
+
var item = e.target.parentElement.getAttribute('data-value');
|
|
14662
|
+
if (e.key === 'Backspace') {
|
|
14663
|
+
const lastChild = this.hiddenElement.lastChild;
|
|
14664
|
+
if (lastChild) {
|
|
14665
|
+
this.hiddenElement.removeChild(lastChild);
|
|
14666
|
+
}
|
|
14667
|
+
}
|
|
14668
|
+
else {
|
|
14669
|
+
this.hiddenElement.childNodes.forEach((option) => {
|
|
14670
|
+
if (option.value === item) {
|
|
14671
|
+
option.parentNode.removeChild(option);
|
|
14672
|
+
}
|
|
14673
|
+
});
|
|
14674
|
+
}
|
|
14675
|
+
hiddenElementContent = this.hiddenElement.innerHTML;
|
|
14676
|
+
}
|
|
14677
|
+
else {
|
|
14678
|
+
hiddenElementContent += "<option selected value=\"" + value + "\">" + index + "</option>";
|
|
14679
|
+
}
|
|
14639
14680
|
break;
|
|
14640
14681
|
}
|
|
14641
14682
|
else {
|
|
@@ -14854,7 +14895,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
14854
14895
|
}
|
|
14855
14896
|
updateListSelection(li, e, length) {
|
|
14856
14897
|
const customVal = li.getAttribute('data-value');
|
|
14857
|
-
let value = this.allowObjectBinding ? this.getDataByValue(customVal) : this.getFormattedValue(customVal);
|
|
14898
|
+
let value = this.allowObjectBinding ? this.getDataByValue(this.getFormattedValue(customVal)) : this.getFormattedValue(customVal);
|
|
14858
14899
|
if (this.allowCustomValue && ((customVal !== 'false' && value === false) ||
|
|
14859
14900
|
(!isNullOrUndefined(value) && value.toString() === 'NaN'))) {
|
|
14860
14901
|
value = customVal;
|
|
@@ -15558,14 +15599,14 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
15558
15599
|
let li;
|
|
15559
15600
|
if (!isNullOrUndefined(this.list)) {
|
|
15560
15601
|
li = this.list.querySelectorAll(state ?
|
|
15561
|
-
'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
|
|
15562
|
-
'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)');
|
|
15602
|
+
'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide):not(.e-virtual-list)' :
|
|
15603
|
+
'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide):not(.e-virtual-list)');
|
|
15563
15604
|
}
|
|
15564
15605
|
if (this.value && this.value.length && event && event.target
|
|
15565
15606
|
&& closest(event.target, '.e-close-hooker') && this.allowFiltering) {
|
|
15566
15607
|
li = this.mainList.querySelectorAll(state ?
|
|
15567
|
-
'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
|
|
15568
|
-
'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)');
|
|
15608
|
+
'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide):not(.e-virtual-list)' :
|
|
15609
|
+
'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide):not(.e-virtual-list)');
|
|
15569
15610
|
}
|
|
15570
15611
|
if (this.enableGroupCheckBox && this.mode === 'CheckBox' && !isNullOrUndefined(this.fields.groupBy)) {
|
|
15571
15612
|
let target = (event ? (this.groupTemplate ? closest(event.target, '.e-list-group-item') : event.target) : null);
|
|
@@ -15627,8 +15668,109 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
15627
15668
|
}
|
|
15628
15669
|
this.addValidInputClass();
|
|
15629
15670
|
}
|
|
15671
|
+
virtualSelectionAll(state, li, event) {
|
|
15672
|
+
let index = 0;
|
|
15673
|
+
let length = li.length;
|
|
15674
|
+
let count = this.maximumSelectionLength;
|
|
15675
|
+
if (state) {
|
|
15676
|
+
length = this.virtualSelectAllData && this.virtualSelectAllData.length != 0 ? this.virtualSelectAllData.length : length;
|
|
15677
|
+
this.listData = this.virtualSelectAllData;
|
|
15678
|
+
const ulElement = this.createListItems(this.virtualSelectAllData.slice(0, 30), this.fields);
|
|
15679
|
+
const firstItems = ulElement.querySelectorAll('li');
|
|
15680
|
+
const fragment = document.createDocumentFragment();
|
|
15681
|
+
firstItems.forEach((node) => {
|
|
15682
|
+
fragment.appendChild(node.cloneNode(true));
|
|
15683
|
+
});
|
|
15684
|
+
li.forEach((node) => {
|
|
15685
|
+
fragment.appendChild(node.cloneNode(true));
|
|
15686
|
+
});
|
|
15687
|
+
const concatenatedNodeList = fragment.childNodes;
|
|
15688
|
+
if (this.virtualSelectAllData instanceof Array) {
|
|
15689
|
+
while (index < length && index <= 50 && index < count) {
|
|
15690
|
+
this.isSelectAllTarget = (length === index + 1);
|
|
15691
|
+
if (concatenatedNodeList[index]) {
|
|
15692
|
+
let value = this.allowObjectBinding ? this.getDataByValue(concatenatedNodeList[index].getAttribute('data-value')) : this.getFormattedValue(concatenatedNodeList[index].getAttribute('data-value'));
|
|
15693
|
+
if (((!this.allowObjectBinding && this.value && this.value.indexOf(value) >= 0) || (this.allowObjectBinding && this.indexOfObjectInArray(value, this.value) >= 0))) {
|
|
15694
|
+
index++;
|
|
15695
|
+
continue;
|
|
15696
|
+
}
|
|
15697
|
+
this.updateListSelection(concatenatedNodeList[index], event, length - index);
|
|
15698
|
+
}
|
|
15699
|
+
else {
|
|
15700
|
+
let value = getValue((this.fields.value) ? this.fields.value : '', this.virtualSelectAllData[index]);
|
|
15701
|
+
value = this.allowObjectBinding ? this.getDataByValue(value) : value;
|
|
15702
|
+
if (((!this.allowObjectBinding && this.value && this.value.indexOf(value) >= 0) || (this.allowObjectBinding && this.indexOfObjectInArray(value, this.value) >= 0))) {
|
|
15703
|
+
index++;
|
|
15704
|
+
continue;
|
|
15705
|
+
}
|
|
15706
|
+
if (this.value && value != null && Array.isArray(this.value) && ((!this.allowObjectBinding && this.value.indexOf(value) < 0) || (this.allowObjectBinding && !this.isObjectInArray(value, this.value)))) {
|
|
15707
|
+
this.dispatchSelect(value, event, null, false, length);
|
|
15708
|
+
}
|
|
15709
|
+
}
|
|
15710
|
+
index++;
|
|
15711
|
+
}
|
|
15712
|
+
if (length > 50) {
|
|
15713
|
+
setTimeout(() => {
|
|
15714
|
+
if (this.virtualSelectAllData && this.virtualSelectAllData.length > 0) {
|
|
15715
|
+
this.virtualSelectAllData.map((obj) => {
|
|
15716
|
+
if (this.value && obj[this.fields.value] != null && Array.isArray(this.value) && ((!this.allowObjectBinding && this.value.indexOf(obj[this.fields.value]) < 0) || (this.allowObjectBinding && !this.isObjectInArray(obj[this.fields.value], this.value)))) {
|
|
15717
|
+
this.dispatchSelect(obj[this.fields.value], event, null, false, length);
|
|
15718
|
+
}
|
|
15719
|
+
});
|
|
15720
|
+
}
|
|
15721
|
+
this.updatedataValueItems(event);
|
|
15722
|
+
this.isSelectAllLoop = false;
|
|
15723
|
+
if (!this.changeOnBlur) {
|
|
15724
|
+
this.updateValueState(event, this.value, this.tempValues);
|
|
15725
|
+
this.isSelectAll = this.isSelectAll ? !this.isSelectAll : this.isSelectAll;
|
|
15726
|
+
}
|
|
15727
|
+
this.updateHiddenElement();
|
|
15728
|
+
if (this.popupWrapper && li[index - 1] && li[index - 1].classList.contains('e-item-focus')) {
|
|
15729
|
+
const selectAllParent = document.getElementsByClassName('e-selectall-parent')[0];
|
|
15730
|
+
if (selectAllParent && selectAllParent.classList.contains('e-item-focus')) {
|
|
15731
|
+
li[index - 1].classList.remove('e-item-focus');
|
|
15732
|
+
}
|
|
15733
|
+
}
|
|
15734
|
+
}, 0);
|
|
15735
|
+
}
|
|
15736
|
+
}
|
|
15737
|
+
}
|
|
15738
|
+
else {
|
|
15739
|
+
if (this.virtualSelectAllData && this.virtualSelectAllData.length > 0) {
|
|
15740
|
+
this.virtualSelectAllData.map((obj) => {
|
|
15741
|
+
this.virtualSelectAll = true;
|
|
15742
|
+
this.removeValue(this.value[index], event, this.value.length - index);
|
|
15743
|
+
});
|
|
15744
|
+
}
|
|
15745
|
+
this.updatedataValueItems(event);
|
|
15746
|
+
if (!this.changeOnBlur) {
|
|
15747
|
+
this.updateValueState(event, this.value, this.tempValues);
|
|
15748
|
+
this.isSelectAll = this.isSelectAll ? !this.isSelectAll : this.isSelectAll;
|
|
15749
|
+
}
|
|
15750
|
+
this.updateHiddenElement();
|
|
15751
|
+
this.value = [];
|
|
15752
|
+
this.virtualSelectAll = false;
|
|
15753
|
+
if (!isNullOrUndefined(this.viewPortInfo.startIndex) && !isNullOrUndefined(this.viewPortInfo.endIndex)) {
|
|
15754
|
+
this.notify("setCurrentViewDataAsync", {
|
|
15755
|
+
component: this.getModuleName(),
|
|
15756
|
+
module: "VirtualScroll",
|
|
15757
|
+
});
|
|
15758
|
+
}
|
|
15759
|
+
}
|
|
15760
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15761
|
+
const virtualTrackElement = this.list.getElementsByClassName('e-virtual-ddl')[0];
|
|
15762
|
+
if (virtualTrackElement) {
|
|
15763
|
+
(virtualTrackElement).style = this.GetVirtualTrackHeight();
|
|
15764
|
+
}
|
|
15765
|
+
this.UpdateSkeleton();
|
|
15766
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15767
|
+
const virtualContentElement = this.list.getElementsByClassName('e-virtual-ddl-content')[0];
|
|
15768
|
+
if (virtualContentElement) {
|
|
15769
|
+
(virtualContentElement).style = this.getTransformValues();
|
|
15770
|
+
}
|
|
15771
|
+
}
|
|
15630
15772
|
updateValue(event, li, state) {
|
|
15631
|
-
|
|
15773
|
+
let length = li.length;
|
|
15632
15774
|
const beforeSelectArgs = {
|
|
15633
15775
|
event: event,
|
|
15634
15776
|
items: state ? li : [],
|
|
@@ -15649,95 +15791,14 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
15649
15791
|
}
|
|
15650
15792
|
if (!beforeSelectArgs.preventSelectEvent) {
|
|
15651
15793
|
if (this.enableVirtualization) {
|
|
15652
|
-
|
|
15653
|
-
|
|
15794
|
+
this.virtualSelectAll = true;
|
|
15795
|
+
this.virtualSelectAllState = state;
|
|
15796
|
+
this.CurrentEvent = event;
|
|
15797
|
+
if (!this.virtualSelectAllData) {
|
|
15654
15798
|
this.resetList(this.dataSource, this.fields, new Query());
|
|
15655
|
-
if (this.virtualSelectAllData instanceof Array) {
|
|
15656
|
-
for (var i = 0; i < this.virtualSelectAllData.length; i++) {
|
|
15657
|
-
if (li[this.skeletonCount + i]) {
|
|
15658
|
-
let value = this.allowObjectBinding ? this.getDataByValue(li[this.skeletonCount + i].getAttribute('data-value')) : this.getFormattedValue(li[this.skeletonCount + i].getAttribute('data-value'));
|
|
15659
|
-
if (((!this.allowObjectBinding && this.value && this.value.indexOf(value) === 1) || (this.allowObjectBinding && this.indexOfObjectInArray(value, this.value) === 1))) {
|
|
15660
|
-
continue;
|
|
15661
|
-
}
|
|
15662
|
-
this.updateListSelection(li[this.skeletonCount + i], event, length - i);
|
|
15663
|
-
}
|
|
15664
|
-
else {
|
|
15665
|
-
if (this.fields) {
|
|
15666
|
-
let value = getValue(this.fields.value, this.virtualSelectAllData[i]);
|
|
15667
|
-
value = this.allowObjectBinding ? this.getDataByValue(value) : value;
|
|
15668
|
-
if (((!this.allowObjectBinding && this.value && this.value.indexOf(value) === 1) || (this.allowObjectBinding && this.indexOfObjectInArray(value, this.value) === 1))) {
|
|
15669
|
-
continue;
|
|
15670
|
-
}
|
|
15671
|
-
if (this.value && value != null && Array.isArray(this.value) && ((!this.allowObjectBinding && this.value.indexOf(value) < 0) || (this.allowObjectBinding && !this.isObjectInArray(value, this.value)))) {
|
|
15672
|
-
this.dispatchSelect(value, event, null, false, length);
|
|
15673
|
-
}
|
|
15674
|
-
}
|
|
15675
|
-
}
|
|
15676
|
-
}
|
|
15677
|
-
if (this.virtualSelectAllData && this.value.length != this.virtualSelectAllData.length && this.virtualItemStartIndex != 0) {
|
|
15678
|
-
if (this.virtualItemStartIndex > this.itemCount) {
|
|
15679
|
-
for (var i = 0; i < this.itemCount; i++) {
|
|
15680
|
-
if (this.fields) {
|
|
15681
|
-
let value = getValue(this.fields.value, this.virtualSelectAllData[i]);
|
|
15682
|
-
value = this.allowObjectBinding ? this.getDataByValue(value) : value;
|
|
15683
|
-
if (this.value && value != null && Array.isArray(this.value) && ((!this.allowObjectBinding && this.value.indexOf(value) < 0) || (this.allowObjectBinding && !this.isObjectInArray(value, this.value)))) {
|
|
15684
|
-
this.setProperties({ value: [].concat([], this.value, this.allowObjectBinding ? [this.virtualSelectAllData[i]] : [value]) }, true);
|
|
15685
|
-
}
|
|
15686
|
-
}
|
|
15687
|
-
}
|
|
15688
|
-
}
|
|
15689
|
-
}
|
|
15690
|
-
else {
|
|
15691
|
-
for (var i = 0; i < this.virtualItemStartIndex; i++) {
|
|
15692
|
-
if (this.fields) {
|
|
15693
|
-
var value = getValue(this.fields.value, this.virtualSelectAllData[i]);
|
|
15694
|
-
value = this.allowObjectBinding ? this.getDataByValue(value) : value;
|
|
15695
|
-
if (Array.isArray(this.value) && ((!this.allowObjectBinding && this.value.indexOf(value) < 0) || (this.allowObjectBinding && !this.isObjectInArray(value, this.value)))) {
|
|
15696
|
-
this.setProperties({ value: [].concat([], this.value, this.allowObjectBinding ? [this.virtualSelectAllData[i]] : [value]) }, true);
|
|
15697
|
-
}
|
|
15698
|
-
}
|
|
15699
|
-
}
|
|
15700
|
-
}
|
|
15701
|
-
}
|
|
15702
|
-
}
|
|
15703
|
-
else {
|
|
15704
|
-
while (index < this.value.length && index <= 50 && index < count && this.value.length > 0) {
|
|
15705
|
-
this.removeValue(this.value[index], event, this.value.length - index);
|
|
15706
|
-
index++;
|
|
15707
|
-
}
|
|
15708
|
-
if (length > 50) {
|
|
15709
|
-
setTimeout(() => {
|
|
15710
|
-
while (index < this.value.length && index < count && this.value.length > 0) {
|
|
15711
|
-
this.removeValue(value[index], event, this.value.length - index);
|
|
15712
|
-
index++;
|
|
15713
|
-
}
|
|
15714
|
-
this.updatedataValueItems(event);
|
|
15715
|
-
if (!this.changeOnBlur) {
|
|
15716
|
-
this.updateValueState(event, this.value, this.tempValues);
|
|
15717
|
-
this.isSelectAll = this.isSelectAll ? !this.isSelectAll : this.isSelectAll;
|
|
15718
|
-
}
|
|
15719
|
-
this.updateHiddenElement();
|
|
15720
|
-
}, 0);
|
|
15721
|
-
}
|
|
15722
|
-
this.value = [];
|
|
15723
|
-
this.virtualSelectAll = false;
|
|
15724
|
-
if (!isNullOrUndefined(this.viewPortInfo.startIndex) && !isNullOrUndefined(this.viewPortInfo.endIndex)) {
|
|
15725
|
-
this.notify("setCurrentViewDataAsync", {
|
|
15726
|
-
component: this.getModuleName(),
|
|
15727
|
-
module: "VirtualScroll",
|
|
15728
|
-
});
|
|
15729
|
-
}
|
|
15730
15799
|
}
|
|
15731
|
-
|
|
15732
|
-
|
|
15733
|
-
if (virtualTrackElement) {
|
|
15734
|
-
(virtualTrackElement).style = this.GetVirtualTrackHeight();
|
|
15735
|
-
}
|
|
15736
|
-
this.UpdateSkeleton();
|
|
15737
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15738
|
-
const virtualContentElement = this.list.getElementsByClassName('e-virtual-ddl-content')[0];
|
|
15739
|
-
if (virtualContentElement) {
|
|
15740
|
-
(virtualContentElement).style = this.getTransformValues();
|
|
15800
|
+
if (this.virtualSelectAllData) {
|
|
15801
|
+
this.virtualSelectionAll(state, li, event);
|
|
15741
15802
|
}
|
|
15742
15803
|
}
|
|
15743
15804
|
else {
|
|
@@ -15826,7 +15887,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
15826
15887
|
this.updateValueState(event, this.value, this.tempValues);
|
|
15827
15888
|
this.isSelectAll = this.isSelectAll ? !this.isSelectAll : this.isSelectAll;
|
|
15828
15889
|
}
|
|
15829
|
-
this.
|
|
15890
|
+
if ((this.enableVirtualization && this.value && this.value.length > 0) || !this.enableVirtualization) {
|
|
15891
|
+
this.updateHiddenElement();
|
|
15892
|
+
}
|
|
15830
15893
|
}
|
|
15831
15894
|
}
|
|
15832
15895
|
updateHiddenElement() {
|
|
@@ -15930,7 +15993,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
15930
15993
|
}
|
|
15931
15994
|
this.selectAllItem(state, event);
|
|
15932
15995
|
}
|
|
15933
|
-
this.
|
|
15996
|
+
if (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualSelectAllData)) {
|
|
15997
|
+
this.virtualSelectAll = false;
|
|
15998
|
+
}
|
|
15934
15999
|
}
|
|
15935
16000
|
/**
|
|
15936
16001
|
* Get the properties to be maintained in the persisted state.
|