@syncfusion/ej2-dropdowns 20.1.51 → 20.1.52
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 +6 -0
- 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 +81 -68
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +45 -31
- 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 +5 -5
- package/src/auto-complete/auto-complete.js +3 -1
- package/src/combo-box/combo-box.js +4 -3
- package/src/common/incremental-search.js +1 -1
- package/src/drop-down-base/drop-down-base.js +5 -3
- package/src/drop-down-list/drop-down-list.js +1 -1
- package/src/drop-down-tree/drop-down-tree-model.d.ts +2 -2
- package/src/drop-down-tree/drop-down-tree.js +5 -5
- package/src/list-box/list-box.js +16 -10
- package/src/multi-select/multi-select-model.d.ts +1 -1
- package/src/multi-select/multi-select.js +10 -7
|
@@ -92,7 +92,7 @@ function Search(inputVal, items, searchType, ignoreCase) {
|
|
|
92
92
|
for (let i = 0, itemsData = listItems; i < itemsData.length; i++) {
|
|
93
93
|
const item = itemsData[i];
|
|
94
94
|
const text = (ignoreCase ? item.textContent.toLocaleLowerCase() : item.textContent).replace(/^\s+|\s+$/g, '');
|
|
95
|
-
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,
|
|
95
|
+
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))) {
|
|
96
96
|
itemData.item = item;
|
|
97
97
|
itemData.index = i;
|
|
98
98
|
return { item: item, index: i };
|
|
@@ -308,7 +308,8 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
308
308
|
compareValue = value;
|
|
309
309
|
dataSource.filter((item) => {
|
|
310
310
|
const itemValue = getValue(fields.value, item);
|
|
311
|
-
if (!isNullOrUndefined(itemValue) && !isNullOrUndefined(value)
|
|
311
|
+
if (!isNullOrUndefined(itemValue) && !isNullOrUndefined(value)
|
|
312
|
+
&& itemValue.toString() === compareValue.toString()) {
|
|
312
313
|
value = getValue(fields.text, item);
|
|
313
314
|
}
|
|
314
315
|
});
|
|
@@ -731,7 +732,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
731
732
|
if (this.getModuleName() === 'multiselect' && this.properties.allowCustomValue && this.fields.groupBy) {
|
|
732
733
|
for (let i = 0; i < ulElement.childElementCount; i++) {
|
|
733
734
|
if (ulElement.children[i].classList.contains('e-list-group-item')) {
|
|
734
|
-
if (isNullOrUndefined(ulElement.children[i].innerHTML) || ulElement.children[i].innerHTML
|
|
735
|
+
if (isNullOrUndefined(ulElement.children[i].innerHTML) || ulElement.children[i].innerHTML === '') {
|
|
735
736
|
addClass([ulElement.children[i]], HIDE_GROUPLIST);
|
|
736
737
|
}
|
|
737
738
|
}
|
|
@@ -858,8 +859,8 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
858
859
|
this.scrollStop(e);
|
|
859
860
|
}
|
|
860
861
|
scrollStop(e) {
|
|
861
|
-
|
|
862
|
-
|
|
862
|
+
const target = !isNullOrUndefined(e) ? e.target : this.list;
|
|
863
|
+
const liHeight = parseInt(getComputedStyle(this.getValidLi(), null).getPropertyValue('height'), 10);
|
|
863
864
|
const topIndex = Math.round(target.scrollTop / liHeight);
|
|
864
865
|
const liCollections = this.list.querySelectorAll('li' + ':not(.e-hide-listitem)');
|
|
865
866
|
for (let i = topIndex; i > -1; i--) {
|
|
@@ -947,10 +948,10 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
947
948
|
Refer bug report https://bugzilla.mozilla.org/show_bug.cgi?id=137688
|
|
948
949
|
Refer alternate solution https://stackoverflow.com/a/41696234/9133493*/
|
|
949
950
|
if (isNaN(borderWidth)) {
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
951
|
+
const borderTopWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-top-width'), 10);
|
|
952
|
+
const borderBottomWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-bottom-width'), 10);
|
|
953
|
+
const borderLeftWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-left-width'), 10);
|
|
954
|
+
const borderRightWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-right-width'), 10);
|
|
954
955
|
borderWidth = (borderTopWidth + borderBottomWidth + borderLeftWidth + borderRightWidth);
|
|
955
956
|
}
|
|
956
957
|
}
|
|
@@ -1217,7 +1218,8 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1217
1218
|
}
|
|
1218
1219
|
if (this.itemTemplate && !isHeader) {
|
|
1219
1220
|
const itemCheck = this.templateCompiler(this.itemTemplate);
|
|
1220
|
-
const compiledString = itemCheck ?
|
|
1221
|
+
const compiledString = itemCheck ?
|
|
1222
|
+
compile(select(this.itemTemplate, document).innerHTML.trim()) : compile(this.itemTemplate);
|
|
1221
1223
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1222
1224
|
const addItemTemplate = compiledString(item, this, 'itemTemplate', this.itemTemplateId, this.isStringTemplate, null, li);
|
|
1223
1225
|
if (addItemTemplate) {
|
|
@@ -2388,9 +2390,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2388
2390
|
detach(this.valueTempElement);
|
|
2389
2391
|
this.inputElement.style.display = 'block';
|
|
2390
2392
|
}
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2393
|
+
const clearIcon = dropDownListClasses.clearIcon;
|
|
2394
|
+
const isFilterElement = this.isFiltering() && this.filterInput && (this.getModuleName() === 'combobox');
|
|
2395
|
+
const clearElement = isFilterElement && this.filterInput.parentElement.querySelector('.' + clearIcon);
|
|
2394
2396
|
if (this.isFiltering() && clearElement) {
|
|
2395
2397
|
clearElement.style.removeProperty('visibility');
|
|
2396
2398
|
}
|
|
@@ -3895,7 +3897,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3895
3897
|
if (!this.enabled) {
|
|
3896
3898
|
return;
|
|
3897
3899
|
}
|
|
3898
|
-
if (this.isFiltering() && this.dataSource instanceof DataManager && (this.actionData.list
|
|
3900
|
+
if (this.isFiltering() && this.dataSource instanceof DataManager && (this.actionData.list !== this.actionCompleteData.list) &&
|
|
3899
3901
|
this.actionData.list && this.actionData.ulElement) {
|
|
3900
3902
|
this.actionCompleteData = this.actionData;
|
|
3901
3903
|
this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list, null, true);
|
|
@@ -5490,7 +5492,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
5490
5492
|
}
|
|
5491
5493
|
else {
|
|
5492
5494
|
if (this.showCheckBox) {
|
|
5493
|
-
|
|
5495
|
+
const difference = this.value.filter((e) => {
|
|
5494
5496
|
return this.treeObj.checkedNodes.indexOf(e) === -1;
|
|
5495
5497
|
});
|
|
5496
5498
|
if (difference.length > 0 || this.treeSettings.autoCheck) {
|
|
@@ -6253,7 +6255,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
6253
6255
|
}
|
|
6254
6256
|
else if (this.treeDataType === 1) {
|
|
6255
6257
|
for (let i = 0, objlen = this.treeItems.length; i < objlen; i++) {
|
|
6256
|
-
|
|
6258
|
+
const dataId = getValue(this.fields.value, this.treeItems[i]);
|
|
6257
6259
|
if (!isNullOrUndefined(this.treeItems[i]) && !isNullOrUndefined(dataId) && dataId.toString() === id) {
|
|
6258
6260
|
return this.treeItems[i];
|
|
6259
6261
|
}
|
|
@@ -6270,19 +6272,19 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
6270
6272
|
return newChildItems;
|
|
6271
6273
|
}
|
|
6272
6274
|
for (let i = 0, objlen = obj.length; i < objlen; i++) {
|
|
6273
|
-
|
|
6275
|
+
const dataValue = getValue(mapper.value, obj[i]);
|
|
6274
6276
|
if (obj[i] && dataValue && dataValue.toString() === id) {
|
|
6275
6277
|
return obj[i];
|
|
6276
6278
|
}
|
|
6277
6279
|
else if (typeof mapper.child === 'string' && !isNullOrUndefined(getValue(mapper.child, obj[i]))) {
|
|
6278
|
-
|
|
6280
|
+
const childNodeData = getValue(mapper.child, obj[i]);
|
|
6279
6281
|
newChildItems = this.getChildNodeData(childNodeData, this.getChildMapperFields(mapper), id);
|
|
6280
6282
|
if (newChildItems !== undefined) {
|
|
6281
6283
|
break;
|
|
6282
6284
|
}
|
|
6283
6285
|
}
|
|
6284
6286
|
else if (this.fields.dataSource instanceof DataManager && !isNullOrUndefined(getValue('child', obj[i]))) {
|
|
6285
|
-
|
|
6287
|
+
const child = 'child';
|
|
6286
6288
|
newChildItems = this.getChildNodeData(getValue(child, obj[i]), this.getChildMapperFields(mapper), id);
|
|
6287
6289
|
if (newChildItems !== undefined) {
|
|
6288
6290
|
break;
|
|
@@ -6401,7 +6403,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
6401
6403
|
addClass([this.inputWrapper], SHOW_CHIP);
|
|
6402
6404
|
}
|
|
6403
6405
|
const chip = this.createElement('span', {
|
|
6404
|
-
className: CHIP
|
|
6406
|
+
className: CHIP
|
|
6405
6407
|
});
|
|
6406
6408
|
if (!this.inputEle.classList.contains(CHIP_INPUT)) {
|
|
6407
6409
|
addClass([this.inputEle], CHIP_INPUT);
|
|
@@ -6537,7 +6539,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
6537
6539
|
this.ensurePlaceHolder();
|
|
6538
6540
|
}
|
|
6539
6541
|
resetValue(isDynamicChange) {
|
|
6540
|
-
if (this.value
|
|
6542
|
+
if (this.value === [] && this.text === null) {
|
|
6541
6543
|
return;
|
|
6542
6544
|
}
|
|
6543
6545
|
Input.setValue(null, this.inputEle, this.floatLabelType);
|
|
@@ -6918,10 +6920,10 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
6918
6920
|
this.updateTreeSettings(newProp);
|
|
6919
6921
|
break;
|
|
6920
6922
|
case 'customTemplate':
|
|
6921
|
-
if (this.mode !==
|
|
6923
|
+
if (this.mode !== 'Custom') {
|
|
6922
6924
|
return;
|
|
6923
6925
|
}
|
|
6924
|
-
this.chipCollection.innerHTML =
|
|
6926
|
+
this.chipCollection.innerHTML = '';
|
|
6925
6927
|
this.setTagValues();
|
|
6926
6928
|
break;
|
|
6927
6929
|
case 'sortOrder':
|
|
@@ -7139,7 +7141,7 @@ __decorate$2([
|
|
|
7139
7141
|
Property('')
|
|
7140
7142
|
], DropDownTree.prototype, "cssClass", void 0);
|
|
7141
7143
|
__decorate$2([
|
|
7142
|
-
Property(
|
|
7144
|
+
Property('${value.length} item(s) selected')
|
|
7143
7145
|
], DropDownTree.prototype, "customTemplate", void 0);
|
|
7144
7146
|
__decorate$2([
|
|
7145
7147
|
Property(',')
|
|
@@ -7600,7 +7602,7 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7600
7602
|
}
|
|
7601
7603
|
}
|
|
7602
7604
|
if (!this.isAndroidAutoFill(currentValue)) {
|
|
7603
|
-
this.setAutoFillSelection(currentValue);
|
|
7605
|
+
this.setAutoFillSelection(currentValue, isHover);
|
|
7604
7606
|
}
|
|
7605
7607
|
}
|
|
7606
7608
|
}
|
|
@@ -7668,7 +7670,7 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7668
7670
|
e.preventDefault();
|
|
7669
7671
|
}
|
|
7670
7672
|
}
|
|
7671
|
-
setAutoFillSelection(currentValue) {
|
|
7673
|
+
setAutoFillSelection(currentValue, isKeyNavigate = false) {
|
|
7672
7674
|
const selection = this.getSelectionPoints();
|
|
7673
7675
|
const value = this.inputElement.value.substr(0, selection.start);
|
|
7674
7676
|
if (value && (value.toLowerCase() === currentValue.substr(0, selection.start).toLowerCase())) {
|
|
@@ -7676,7 +7678,7 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7676
7678
|
Input.setValue(inputValue, this.inputElement, this.floatLabelType, this.showClearButton);
|
|
7677
7679
|
this.inputElement.setSelectionRange(selection.start, this.inputElement.value.length);
|
|
7678
7680
|
}
|
|
7679
|
-
else {
|
|
7681
|
+
else if (isKeyNavigate) {
|
|
7680
7682
|
Input.setValue(currentValue, this.inputElement, this.floatLabelType, this.showClearButton);
|
|
7681
7683
|
this.inputElement.setSelectionRange(0, this.inputElement.value.length);
|
|
7682
7684
|
}
|
|
@@ -8293,7 +8295,9 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8293
8295
|
this.setScrollPosition(e);
|
|
8294
8296
|
if (this.autofill && this.isPopupOpen) {
|
|
8295
8297
|
this.preventAutoFill = false;
|
|
8296
|
-
|
|
8298
|
+
const isKeyNavigate = (e && e.action === 'down' || e.action === 'up' ||
|
|
8299
|
+
e.action === 'home' || e.action === 'end' || e.action === 'pageUp' || e.action === 'pageDown');
|
|
8300
|
+
super.setAutoFill(li, isKeyNavigate);
|
|
8297
8301
|
}
|
|
8298
8302
|
attributes(this.inputElement, { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
|
|
8299
8303
|
}
|
|
@@ -9186,7 +9190,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9186
9190
|
}
|
|
9187
9191
|
}
|
|
9188
9192
|
getValidLi() {
|
|
9189
|
-
|
|
9193
|
+
const liElement = this.ulElement.querySelector('li.' + dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')');
|
|
9190
9194
|
return (!isNullOrUndefined(liElement) ? liElement : this.liCollections[0]);
|
|
9191
9195
|
}
|
|
9192
9196
|
checkSelectAll() {
|
|
@@ -9284,7 +9288,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9284
9288
|
const list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;
|
|
9285
9289
|
if (this.backCommand) {
|
|
9286
9290
|
this.remoteCustomValue = false;
|
|
9287
|
-
if (this.allowCustomValue && list.querySelectorAll('li').length
|
|
9291
|
+
if (this.allowCustomValue && list.querySelectorAll('li').length === 0 && this.mainData.length > 0) {
|
|
9288
9292
|
this.mainData = [];
|
|
9289
9293
|
}
|
|
9290
9294
|
this.onActionComplete(list, this.mainData);
|
|
@@ -9676,10 +9680,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9676
9680
|
if (!isNullOrUndefined(focusedItem)) {
|
|
9677
9681
|
this.inputElement.setAttribute('aria-activedescendant', focusedItem.id);
|
|
9678
9682
|
if (this.allowFiltering) {
|
|
9679
|
-
|
|
9683
|
+
const filterInput = this.popupWrapper.querySelector('.' + FILTERINPUT);
|
|
9680
9684
|
filterInput && filterInput.setAttribute('aria-activedescendant', focusedItem.id);
|
|
9681
9685
|
}
|
|
9682
|
-
else if (this.mode
|
|
9686
|
+
else if (this.mode === 'CheckBox') {
|
|
9683
9687
|
this.overAllWrapper.setAttribute('aria-activedescendant', focusedItem.id);
|
|
9684
9688
|
}
|
|
9685
9689
|
}
|
|
@@ -10171,7 +10175,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
10171
10175
|
this.expandTextbox();
|
|
10172
10176
|
}
|
|
10173
10177
|
removeAllItems(value, eve, isClearAll, element, mainElement) {
|
|
10174
|
-
|
|
10178
|
+
const index = this.value.indexOf(value);
|
|
10175
10179
|
const removeVal = this.value.slice(0);
|
|
10176
10180
|
removeVal.splice(index, 1);
|
|
10177
10181
|
this.setProperties({ value: [].concat([], removeVal) }, true);
|
|
@@ -11084,9 +11088,14 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11084
11088
|
}
|
|
11085
11089
|
updateDataList() {
|
|
11086
11090
|
if (this.mainList && this.ulElement) {
|
|
11087
|
-
|
|
11088
|
-
|
|
11089
|
-
|
|
11091
|
+
const isDynamicGroupItemUpdate = this.mainList.childElementCount < this.ulElement.childElementCount;
|
|
11092
|
+
const isReactTemplateUpdate = ((this.ulElement.childElementCount > 0 &&
|
|
11093
|
+
this.ulElement.children[0].childElementCount > 0) &&
|
|
11094
|
+
(this.mainList.children[0].childElementCount < this.ulElement.children[0].childElementCount));
|
|
11095
|
+
const isAngularTemplateUpdate = this.itemTemplate && this.ulElement.childElementCount > 0
|
|
11096
|
+
&& !(this.ulElement.childElementCount < this.mainList.childElementCount)
|
|
11097
|
+
&& (this.ulElement.children[0].childElementCount > 0
|
|
11098
|
+
|| (this.fields.groupBy && this.ulElement.children[1] && this.ulElement.children[1].childElementCount > 0));
|
|
11090
11099
|
if (isDynamicGroupItemUpdate || isReactTemplateUpdate || isAngularTemplateUpdate) {
|
|
11091
11100
|
//EJ2-57748 - for this task, we prevent the ul element cloning ( this.mainList = this.ulElement.cloneNode ? <HTMLElement>this.ulElement.cloneNode(true) : this.ulElement;)
|
|
11092
11101
|
this.mainList = this.ulElement;
|
|
@@ -11494,7 +11503,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11494
11503
|
*/
|
|
11495
11504
|
showSpinner() {
|
|
11496
11505
|
if (isNullOrUndefined(this.spinnerElement)) {
|
|
11497
|
-
|
|
11506
|
+
const filterClear = this.filterParent && this.filterParent.querySelector('.e-clear-icon.e-icons');
|
|
11498
11507
|
if (this.overAllClear.style.display !== 'none' || filterClear) {
|
|
11499
11508
|
this.spinnerElement = filterClear ? filterClear : this.overAllClear;
|
|
11500
11509
|
}
|
|
@@ -11571,7 +11580,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11571
11580
|
const raminElement = this.createElement('span', {
|
|
11572
11581
|
className: REMAIN_WRAPPER$1
|
|
11573
11582
|
});
|
|
11574
|
-
|
|
11583
|
+
const remainCompildTemp = remainContent.replace('${count}', this.value.length.toString());
|
|
11575
11584
|
raminElement.innerText = remainCompildTemp;
|
|
11576
11585
|
this.viewWrapper.appendChild(raminElement);
|
|
11577
11586
|
this.renderReactTemplates();
|
|
@@ -11651,8 +11660,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11651
11660
|
viewWrapper.removeChild(viewWrapper.firstChild);
|
|
11652
11661
|
}
|
|
11653
11662
|
raminElement.innerHTML = '';
|
|
11654
|
-
|
|
11655
|
-
|
|
11663
|
+
const remainTemp = remainContent.replace('${count}', remaining.toString());
|
|
11664
|
+
const totalTemp = totalContent.replace('${count}', remaining.toString());
|
|
11656
11665
|
raminElement.innerText = (viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3) ? remainTemp : totalTemp;
|
|
11657
11666
|
if (viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3) {
|
|
11658
11667
|
viewWrapper.classList.remove(TOTAL_COUNT_WRAPPER$1);
|
|
@@ -11840,9 +11849,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11840
11849
|
else {
|
|
11841
11850
|
for (let i = 0; i < li.length && i < count; i++) {
|
|
11842
11851
|
this.removeHover();
|
|
11843
|
-
|
|
11844
|
-
|
|
11845
|
-
|
|
11852
|
+
const customVal = li[i].getAttribute('data-value');
|
|
11853
|
+
const value = this.getFormattedValue(customVal);
|
|
11854
|
+
const mainElement = this.mainList ? this.mainList.querySelectorAll(state ?
|
|
11846
11855
|
'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
|
|
11847
11856
|
'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)')[i] : null;
|
|
11848
11857
|
if (state) {
|
|
@@ -12105,7 +12114,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12105
12114
|
break;
|
|
12106
12115
|
case 'popupHeight':
|
|
12107
12116
|
if (this.popupObj) {
|
|
12108
|
-
|
|
12117
|
+
const overAllHeight = parseInt(this.popupHeight, 10);
|
|
12109
12118
|
if (this.popupHeight !== 'auto') {
|
|
12110
12119
|
this.list.style.maxHeight = formatUnit(overAllHeight);
|
|
12111
12120
|
this.popupWrapper.style.maxHeight = formatUnit(this.popupHeight);
|
|
@@ -12143,23 +12152,21 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12143
12152
|
this.renderPopup();
|
|
12144
12153
|
}
|
|
12145
12154
|
presentItemValue(ulElement) {
|
|
12146
|
-
|
|
12155
|
+
const valuecheck = [];
|
|
12147
12156
|
for (let i = 0; i < this.value.length; i++) {
|
|
12148
|
-
|
|
12157
|
+
const checkEle = this.findListElement(((this.allowFiltering && !isNullOrUndefined(this.mainList)) ? this.mainList : ulElement), 'li', 'data-value', this.value[i]);
|
|
12149
12158
|
if (!checkEle) {
|
|
12150
12159
|
valuecheck.push(this.value[i]);
|
|
12151
12160
|
}
|
|
12152
12161
|
}
|
|
12153
12162
|
return valuecheck;
|
|
12154
12163
|
}
|
|
12155
|
-
;
|
|
12156
12164
|
addNonPresentItems(valuecheck, ulElement, list, event) {
|
|
12157
12165
|
this.dataSource.executeQuery(this.getForQuery(valuecheck)).then((e) => {
|
|
12158
12166
|
this.addItem(e.result, list.length);
|
|
12159
12167
|
this.updateActionList(ulElement, list, event);
|
|
12160
12168
|
});
|
|
12161
12169
|
}
|
|
12162
|
-
;
|
|
12163
12170
|
updateVal(newProp, oldProp, prop) {
|
|
12164
12171
|
if (!this.list) {
|
|
12165
12172
|
this.onLoadSelect();
|
|
@@ -12172,7 +12179,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12172
12179
|
if (!isNullOrUndefined(this.value) && !this.allowCustomValue) {
|
|
12173
12180
|
valuecheck = this.presentItemValue(this.ulElement);
|
|
12174
12181
|
}
|
|
12175
|
-
if (prop
|
|
12182
|
+
if (prop === 'value' && valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
|
|
12176
12183
|
&& this.listData != null) {
|
|
12177
12184
|
this.mainData = null;
|
|
12178
12185
|
this.setDynValue = true;
|
|
@@ -13666,14 +13673,14 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
13666
13673
|
triggerDrag(args) {
|
|
13667
13674
|
let scrollParent;
|
|
13668
13675
|
let boundRect;
|
|
13669
|
-
|
|
13676
|
+
const scrollMoved = 36;
|
|
13670
13677
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13671
|
-
|
|
13678
|
+
const event = args.event;
|
|
13672
13679
|
let wrapper;
|
|
13673
|
-
if (args.target && (args.target.classList.contains(
|
|
13674
|
-
|| args.target.classList.contains(
|
|
13675
|
-
if (args.target.classList.contains(
|
|
13676
|
-
|| args.target.classList.contains(
|
|
13680
|
+
if (args.target && (args.target.classList.contains('e-listbox-wrapper') || args.target.classList.contains('e-list-item')
|
|
13681
|
+
|| args.target.classList.contains('e-filter-parent') || args.target.classList.contains('e-input-group'))) {
|
|
13682
|
+
if (args.target.classList.contains('e-list-item') || args.target.classList.contains('e-filter-parent')
|
|
13683
|
+
|| args.target.classList.contains('e-input-group')) {
|
|
13677
13684
|
wrapper = args.target.closest('.e-listbox-wrapper');
|
|
13678
13685
|
}
|
|
13679
13686
|
else {
|
|
@@ -13727,7 +13734,8 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
13727
13734
|
const getArgs = this.getDragArgs({ target: args.droppedElement }, true);
|
|
13728
13735
|
const sourceArgs = { previousData: this.dataSource };
|
|
13729
13736
|
const destArgs = { previousData: listObj.dataSource };
|
|
13730
|
-
let dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource },
|
|
13737
|
+
let dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource },
|
|
13738
|
+
previousIndex: args.previousIndex, currentIndex: args.currentIndex });
|
|
13731
13739
|
if (listObj !== this) {
|
|
13732
13740
|
const sourceArgs1 = extend(sourceArgs, { currentData: this.listData });
|
|
13733
13741
|
dragArgs = extend(dragArgs, { source: sourceArgs1, destination: destArgs });
|
|
@@ -13821,14 +13829,14 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
13821
13829
|
currIdx++;
|
|
13822
13830
|
});
|
|
13823
13831
|
if (this.fields.groupBy) {
|
|
13824
|
-
|
|
13832
|
+
const sourceElem = this.renderItems(this.listData, this.fields);
|
|
13825
13833
|
this.updateListItems(sourceElem, this.ulElement);
|
|
13826
13834
|
this.setSelection();
|
|
13827
13835
|
}
|
|
13828
13836
|
if (listObj.sortOrder !== 'None' || this.selectionSettings.showCheckbox
|
|
13829
13837
|
!== listObj.selectionSettings.showCheckbox || listObj.fields.groupBy || listObj.itemTemplate || this.itemTemplate) {
|
|
13830
13838
|
const sortable = getComponent(ul, 'sortable');
|
|
13831
|
-
|
|
13839
|
+
const sourceElem = listObj.renderItems(listData, listObj.fields);
|
|
13832
13840
|
listObj.updateListItems(sourceElem, ul);
|
|
13833
13841
|
this.setSelection();
|
|
13834
13842
|
if (sortable.placeHolderElement) {
|
|
@@ -13858,7 +13866,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
13858
13866
|
}
|
|
13859
13867
|
updateListItems(sourceElem, destElem) {
|
|
13860
13868
|
const i = 0;
|
|
13861
|
-
destElem.innerHTML =
|
|
13869
|
+
destElem.innerHTML = '';
|
|
13862
13870
|
while (i < sourceElem.childNodes.length) {
|
|
13863
13871
|
destElem.appendChild(sourceElem.childNodes[i]);
|
|
13864
13872
|
}
|
|
@@ -13918,7 +13926,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
13918
13926
|
enableItems(items, enable = true, isValue) {
|
|
13919
13927
|
let li;
|
|
13920
13928
|
items.forEach((item) => {
|
|
13921
|
-
|
|
13929
|
+
const text = item;
|
|
13922
13930
|
li = this.findListElement(this.list, 'li', 'data-value', isValue ? text : this.getValueByText(text));
|
|
13923
13931
|
if (!li) {
|
|
13924
13932
|
return;
|
|
@@ -14043,6 +14051,8 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14043
14051
|
if (this.listData.length === 0) {
|
|
14044
14052
|
this.l10nUpdate();
|
|
14045
14053
|
}
|
|
14054
|
+
this.value = null;
|
|
14055
|
+
this.updateToolBarState();
|
|
14046
14056
|
}
|
|
14047
14057
|
/**
|
|
14048
14058
|
* Gets the array of data Object that matches the given array of values.
|
|
@@ -14284,7 +14294,10 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14284
14294
|
let filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
|
|
14285
14295
|
if (this.allowFiltering) {
|
|
14286
14296
|
const filterType = this.inputString === '' ? 'contains' : this.filterType;
|
|
14287
|
-
|
|
14297
|
+
let dataType = this.typeOfData(this.dataSource).typeof;
|
|
14298
|
+
if (dataType === null) {
|
|
14299
|
+
dataType = this.typeOfData(this.jsonData).typeof;
|
|
14300
|
+
}
|
|
14288
14301
|
if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
|
|
14289
14302
|
filterQuery.where('', filterType, this.inputString, this.ignoreCase, this.ignoreAccent);
|
|
14290
14303
|
}
|
|
@@ -14644,7 +14657,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14644
14657
|
});
|
|
14645
14658
|
if (isRefresh) {
|
|
14646
14659
|
if (fListBox.fields.groupBy) {
|
|
14647
|
-
|
|
14660
|
+
const sourceElem = fListBox.renderItems(listData, fListBox.fields);
|
|
14648
14661
|
fListBox.updateListItems(sourceElem, fListBox.ulElement);
|
|
14649
14662
|
}
|
|
14650
14663
|
else {
|
|
@@ -14677,7 +14690,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14677
14690
|
tListBox.jsonData = tJsonData;
|
|
14678
14691
|
tListBox.sortedData = tSortData;
|
|
14679
14692
|
if (isRefresh) {
|
|
14680
|
-
|
|
14693
|
+
const sourceElem = tListBox.renderItems(tListData, tListBox.fields);
|
|
14681
14694
|
tListBox.updateListItems(sourceElem, tListBox.ulElement);
|
|
14682
14695
|
tListBox.setSelection();
|
|
14683
14696
|
fListBox.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
|
|
@@ -14766,7 +14779,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14766
14779
|
tListBox.jsonData = jsonData;
|
|
14767
14780
|
fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
|
|
14768
14781
|
if (isRefresh) {
|
|
14769
|
-
|
|
14782
|
+
const sourceElem = tListBox.renderItems(listData, tListBox.fields);
|
|
14770
14783
|
tListBox.updateListItems(sourceElem, tListBox.ulElement);
|
|
14771
14784
|
this.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
|
|
14772
14785
|
}
|
|
@@ -14874,7 +14887,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14874
14887
|
}
|
|
14875
14888
|
}
|
|
14876
14889
|
}
|
|
14877
|
-
else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !==
|
|
14890
|
+
else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !== 'KeyA') {
|
|
14878
14891
|
this.upDownKeyHandler(e);
|
|
14879
14892
|
}
|
|
14880
14893
|
}
|
|
@@ -14917,9 +14930,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14917
14930
|
this.selectHandler({ target: ul.children[fliIdx], ctrlKey: e.ctrlKey, shiftKey: e.shiftKey }, true);
|
|
14918
14931
|
}
|
|
14919
14932
|
if (this.selectionSettings.showCheckbox && e.ctrlKey && e.shiftKey && (e.keyCode === 36 || e.keyCode === 35)) {
|
|
14920
|
-
|
|
14921
|
-
|
|
14922
|
-
|
|
14933
|
+
const selectedidx = Array.prototype.indexOf.call(ul.children, fli);
|
|
14934
|
+
const sidx = e.code === 'Home' ? 0 : selectedidx;
|
|
14935
|
+
const eidx = e.code === 'Home' ? selectedidx : ul.children.length - 1;
|
|
14923
14936
|
for (let i = sidx; i <= eidx; i++) {
|
|
14924
14937
|
const item = ul.children[i];
|
|
14925
14938
|
this.notify('updatelist', { li: item, e: {
|