@syncfusion/ej2-dropdowns 20.1.51 → 20.1.56
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 +26 -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 +90 -69
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +54 -32
- 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 +11 -11
- 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 +10 -2
- 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
- package/styles/auto-complete/bootstrap-dark.css +5 -14
- package/styles/auto-complete/bootstrap.css +5 -14
- package/styles/auto-complete/bootstrap4.css +5 -13
- package/styles/auto-complete/bootstrap5-dark.css +5 -13
- package/styles/auto-complete/bootstrap5.css +5 -13
- package/styles/auto-complete/fabric-dark.css +5 -12
- package/styles/auto-complete/fabric.css +5 -12
- package/styles/auto-complete/fluent-dark.css +4 -11
- package/styles/auto-complete/fluent.css +4 -11
- package/styles/auto-complete/highcontrast-light.css +3 -23
- package/styles/auto-complete/highcontrast.css +3 -23
- package/styles/auto-complete/material-dark.css +1 -1
- package/styles/auto-complete/material.css +1 -1
- package/styles/auto-complete/tailwind-dark.css +1 -1
- package/styles/auto-complete/tailwind.css +1 -1
- package/styles/bootstrap-dark.css +62 -337
- package/styles/bootstrap.css +62 -337
- package/styles/bootstrap4.css +62 -343
- package/styles/bootstrap5-dark.css +63 -343
- package/styles/bootstrap5.css +63 -343
- package/styles/combo-box/bootstrap-dark.css +5 -14
- package/styles/combo-box/bootstrap.css +5 -14
- package/styles/combo-box/bootstrap4.css +5 -13
- package/styles/combo-box/bootstrap5-dark.css +5 -13
- package/styles/combo-box/bootstrap5.css +5 -13
- package/styles/combo-box/fabric-dark.css +5 -12
- package/styles/combo-box/fabric.css +5 -12
- package/styles/combo-box/fluent-dark.css +4 -11
- package/styles/combo-box/fluent.css +4 -11
- package/styles/combo-box/highcontrast-light.css +3 -23
- package/styles/combo-box/highcontrast.css +3 -23
- package/styles/combo-box/material-dark.css +1 -1
- package/styles/combo-box/material.css +1 -1
- package/styles/combo-box/tailwind-dark.css +1 -1
- package/styles/combo-box/tailwind.css +1 -1
- package/styles/drop-down-base/bootstrap-dark.css +8 -22
- package/styles/drop-down-base/bootstrap.css +8 -22
- package/styles/drop-down-base/bootstrap4.css +8 -22
- package/styles/drop-down-base/bootstrap5-dark.css +8 -22
- package/styles/drop-down-base/bootstrap5.css +8 -22
- package/styles/drop-down-base/fabric-dark.css +8 -22
- package/styles/drop-down-base/fabric.css +8 -22
- package/styles/drop-down-base/fluent-dark.css +8 -22
- package/styles/drop-down-base/fluent.css +8 -22
- package/styles/drop-down-base/highcontrast-light.css +8 -27
- package/styles/drop-down-base/highcontrast.css +8 -27
- package/styles/drop-down-base/material-dark.css +8 -22
- package/styles/drop-down-base/material.css +8 -22
- package/styles/drop-down-base/tailwind-dark.css +12 -34
- package/styles/drop-down-base/tailwind.css +12 -34
- package/styles/drop-down-list/bootstrap-dark.css +15 -44
- package/styles/drop-down-list/bootstrap.css +15 -44
- package/styles/drop-down-list/bootstrap4.css +14 -38
- package/styles/drop-down-list/bootstrap5-dark.css +14 -38
- package/styles/drop-down-list/bootstrap5.css +14 -38
- package/styles/drop-down-list/fabric-dark.css +15 -42
- package/styles/drop-down-list/fabric.css +15 -42
- package/styles/drop-down-list/fluent-dark.css +13 -36
- package/styles/drop-down-list/fluent.css +13 -36
- package/styles/drop-down-list/highcontrast-light.css +13 -58
- package/styles/drop-down-list/highcontrast.css +13 -58
- package/styles/drop-down-list/material-dark.css +11 -32
- package/styles/drop-down-list/material.css +11 -33
- package/styles/drop-down-list/tailwind-dark.css +10 -24
- package/styles/drop-down-list/tailwind.css +10 -24
- package/styles/drop-down-tree/bootstrap-dark.css +4 -92
- package/styles/drop-down-tree/bootstrap.css +4 -92
- package/styles/drop-down-tree/bootstrap4.css +5 -99
- package/styles/drop-down-tree/bootstrap5-dark.css +5 -103
- package/styles/drop-down-tree/bootstrap5.css +5 -103
- package/styles/drop-down-tree/fabric-dark.css +4 -92
- package/styles/drop-down-tree/fabric.css +4 -92
- package/styles/drop-down-tree/fluent-dark.css +5 -105
- package/styles/drop-down-tree/fluent.css +5 -105
- package/styles/drop-down-tree/highcontrast-light.css +4 -97
- package/styles/drop-down-tree/highcontrast.css +4 -98
- package/styles/drop-down-tree/material-dark.css +11 -182
- package/styles/drop-down-tree/material.css +11 -184
- package/styles/drop-down-tree/tailwind-dark.css +4 -107
- package/styles/drop-down-tree/tailwind.css +4 -107
- package/styles/fabric-dark.css +62 -335
- package/styles/fabric.css +62 -335
- package/styles/fluent-dark.css +62 -342
- package/styles/fluent.css +62 -342
- package/styles/highcontrast-light.css +63 -375
- package/styles/highcontrast.css +63 -376
- package/styles/list-box/bootstrap-dark.css +11 -115
- package/styles/list-box/bootstrap.css +11 -115
- package/styles/list-box/bootstrap4.css +11 -120
- package/styles/list-box/bootstrap5-dark.css +11 -115
- package/styles/list-box/bootstrap5.css +11 -115
- package/styles/list-box/fabric-dark.css +11 -115
- package/styles/list-box/fabric.css +11 -115
- package/styles/list-box/fluent-dark.css +11 -115
- package/styles/list-box/fluent.css +11 -115
- package/styles/list-box/highcontrast-light.css +11 -120
- package/styles/list-box/highcontrast.css +11 -120
- package/styles/list-box/material-dark.css +11 -115
- package/styles/list-box/material.css +11 -115
- package/styles/list-box/tailwind-dark.css +12 -118
- package/styles/list-box/tailwind.css +12 -118
- package/styles/material-dark.css +103 -462
- package/styles/material.css +103 -466
- package/styles/multi-select/bootstrap-dark.css +28 -68
- package/styles/multi-select/bootstrap.css +28 -68
- package/styles/multi-select/bootstrap4.css +28 -68
- package/styles/multi-select/bootstrap5-dark.css +29 -69
- package/styles/multi-select/bootstrap5.css +29 -69
- package/styles/multi-select/fabric-dark.css +28 -68
- package/styles/multi-select/fabric.css +28 -68
- package/styles/multi-select/fluent-dark.css +29 -68
- package/styles/multi-select/fluent.css +29 -68
- package/styles/multi-select/highcontrast-light.css +31 -97
- package/styles/multi-select/highcontrast.css +31 -97
- package/styles/multi-select/material-dark.css +66 -115
- package/styles/multi-select/material.css +66 -116
- package/styles/multi-select/tailwind-dark.css +29 -69
- package/styles/multi-select/tailwind.css +29 -69
- package/styles/tailwind-dark.css +63 -348
- package/styles/tailwind.css +63 -348
|
@@ -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
|
}
|
|
@@ -2902,7 +2904,6 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2902
2904
|
if (this.initRemoteRender) {
|
|
2903
2905
|
this.initial = true;
|
|
2904
2906
|
this.activeIndex = this.index;
|
|
2905
|
-
this.updateValues();
|
|
2906
2907
|
this.initRemoteRender = false;
|
|
2907
2908
|
this.initial = false;
|
|
2908
2909
|
if (this.value && this.dataSource instanceof DataManager) {
|
|
@@ -2915,8 +2916,17 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2915
2916
|
this.addItem(e.result, list.length);
|
|
2916
2917
|
this.updateValues();
|
|
2917
2918
|
}
|
|
2919
|
+
else {
|
|
2920
|
+
this.updateValues();
|
|
2921
|
+
}
|
|
2918
2922
|
});
|
|
2919
2923
|
}
|
|
2924
|
+
else {
|
|
2925
|
+
this.updateValues();
|
|
2926
|
+
}
|
|
2927
|
+
}
|
|
2928
|
+
else {
|
|
2929
|
+
this.updateValues();
|
|
2920
2930
|
}
|
|
2921
2931
|
}
|
|
2922
2932
|
if (this.getModuleName() !== 'autocomplete' && this.isFiltering() && !this.isTyped) {
|
|
@@ -3895,7 +3905,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3895
3905
|
if (!this.enabled) {
|
|
3896
3906
|
return;
|
|
3897
3907
|
}
|
|
3898
|
-
if (this.isFiltering() && this.dataSource instanceof DataManager && (this.actionData.list
|
|
3908
|
+
if (this.isFiltering() && this.dataSource instanceof DataManager && (this.actionData.list !== this.actionCompleteData.list) &&
|
|
3899
3909
|
this.actionData.list && this.actionData.ulElement) {
|
|
3900
3910
|
this.actionCompleteData = this.actionData;
|
|
3901
3911
|
this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list, null, true);
|
|
@@ -5490,7 +5500,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
5490
5500
|
}
|
|
5491
5501
|
else {
|
|
5492
5502
|
if (this.showCheckBox) {
|
|
5493
|
-
|
|
5503
|
+
const difference = this.value.filter((e) => {
|
|
5494
5504
|
return this.treeObj.checkedNodes.indexOf(e) === -1;
|
|
5495
5505
|
});
|
|
5496
5506
|
if (difference.length > 0 || this.treeSettings.autoCheck) {
|
|
@@ -6253,7 +6263,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
6253
6263
|
}
|
|
6254
6264
|
else if (this.treeDataType === 1) {
|
|
6255
6265
|
for (let i = 0, objlen = this.treeItems.length; i < objlen; i++) {
|
|
6256
|
-
|
|
6266
|
+
const dataId = getValue(this.fields.value, this.treeItems[i]);
|
|
6257
6267
|
if (!isNullOrUndefined(this.treeItems[i]) && !isNullOrUndefined(dataId) && dataId.toString() === id) {
|
|
6258
6268
|
return this.treeItems[i];
|
|
6259
6269
|
}
|
|
@@ -6270,19 +6280,19 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
6270
6280
|
return newChildItems;
|
|
6271
6281
|
}
|
|
6272
6282
|
for (let i = 0, objlen = obj.length; i < objlen; i++) {
|
|
6273
|
-
|
|
6283
|
+
const dataValue = getValue(mapper.value, obj[i]);
|
|
6274
6284
|
if (obj[i] && dataValue && dataValue.toString() === id) {
|
|
6275
6285
|
return obj[i];
|
|
6276
6286
|
}
|
|
6277
6287
|
else if (typeof mapper.child === 'string' && !isNullOrUndefined(getValue(mapper.child, obj[i]))) {
|
|
6278
|
-
|
|
6288
|
+
const childNodeData = getValue(mapper.child, obj[i]);
|
|
6279
6289
|
newChildItems = this.getChildNodeData(childNodeData, this.getChildMapperFields(mapper), id);
|
|
6280
6290
|
if (newChildItems !== undefined) {
|
|
6281
6291
|
break;
|
|
6282
6292
|
}
|
|
6283
6293
|
}
|
|
6284
6294
|
else if (this.fields.dataSource instanceof DataManager && !isNullOrUndefined(getValue('child', obj[i]))) {
|
|
6285
|
-
|
|
6295
|
+
const child = 'child';
|
|
6286
6296
|
newChildItems = this.getChildNodeData(getValue(child, obj[i]), this.getChildMapperFields(mapper), id);
|
|
6287
6297
|
if (newChildItems !== undefined) {
|
|
6288
6298
|
break;
|
|
@@ -6401,7 +6411,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
6401
6411
|
addClass([this.inputWrapper], SHOW_CHIP);
|
|
6402
6412
|
}
|
|
6403
6413
|
const chip = this.createElement('span', {
|
|
6404
|
-
className: CHIP
|
|
6414
|
+
className: CHIP
|
|
6405
6415
|
});
|
|
6406
6416
|
if (!this.inputEle.classList.contains(CHIP_INPUT)) {
|
|
6407
6417
|
addClass([this.inputEle], CHIP_INPUT);
|
|
@@ -6537,7 +6547,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
6537
6547
|
this.ensurePlaceHolder();
|
|
6538
6548
|
}
|
|
6539
6549
|
resetValue(isDynamicChange) {
|
|
6540
|
-
if (this.value
|
|
6550
|
+
if (this.value === [] && this.text === null) {
|
|
6541
6551
|
return;
|
|
6542
6552
|
}
|
|
6543
6553
|
Input.setValue(null, this.inputEle, this.floatLabelType);
|
|
@@ -6918,10 +6928,10 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
6918
6928
|
this.updateTreeSettings(newProp);
|
|
6919
6929
|
break;
|
|
6920
6930
|
case 'customTemplate':
|
|
6921
|
-
if (this.mode !==
|
|
6931
|
+
if (this.mode !== 'Custom') {
|
|
6922
6932
|
return;
|
|
6923
6933
|
}
|
|
6924
|
-
this.chipCollection.innerHTML =
|
|
6934
|
+
this.chipCollection.innerHTML = '';
|
|
6925
6935
|
this.setTagValues();
|
|
6926
6936
|
break;
|
|
6927
6937
|
case 'sortOrder':
|
|
@@ -7139,7 +7149,7 @@ __decorate$2([
|
|
|
7139
7149
|
Property('')
|
|
7140
7150
|
], DropDownTree.prototype, "cssClass", void 0);
|
|
7141
7151
|
__decorate$2([
|
|
7142
|
-
Property(
|
|
7152
|
+
Property('${value.length} item(s) selected')
|
|
7143
7153
|
], DropDownTree.prototype, "customTemplate", void 0);
|
|
7144
7154
|
__decorate$2([
|
|
7145
7155
|
Property(',')
|
|
@@ -7600,7 +7610,7 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7600
7610
|
}
|
|
7601
7611
|
}
|
|
7602
7612
|
if (!this.isAndroidAutoFill(currentValue)) {
|
|
7603
|
-
this.setAutoFillSelection(currentValue);
|
|
7613
|
+
this.setAutoFillSelection(currentValue, isHover);
|
|
7604
7614
|
}
|
|
7605
7615
|
}
|
|
7606
7616
|
}
|
|
@@ -7668,7 +7678,7 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7668
7678
|
e.preventDefault();
|
|
7669
7679
|
}
|
|
7670
7680
|
}
|
|
7671
|
-
setAutoFillSelection(currentValue) {
|
|
7681
|
+
setAutoFillSelection(currentValue, isKeyNavigate = false) {
|
|
7672
7682
|
const selection = this.getSelectionPoints();
|
|
7673
7683
|
const value = this.inputElement.value.substr(0, selection.start);
|
|
7674
7684
|
if (value && (value.toLowerCase() === currentValue.substr(0, selection.start).toLowerCase())) {
|
|
@@ -7676,7 +7686,7 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7676
7686
|
Input.setValue(inputValue, this.inputElement, this.floatLabelType, this.showClearButton);
|
|
7677
7687
|
this.inputElement.setSelectionRange(selection.start, this.inputElement.value.length);
|
|
7678
7688
|
}
|
|
7679
|
-
else {
|
|
7689
|
+
else if (isKeyNavigate) {
|
|
7680
7690
|
Input.setValue(currentValue, this.inputElement, this.floatLabelType, this.showClearButton);
|
|
7681
7691
|
this.inputElement.setSelectionRange(0, this.inputElement.value.length);
|
|
7682
7692
|
}
|
|
@@ -8293,7 +8303,9 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8293
8303
|
this.setScrollPosition(e);
|
|
8294
8304
|
if (this.autofill && this.isPopupOpen) {
|
|
8295
8305
|
this.preventAutoFill = false;
|
|
8296
|
-
|
|
8306
|
+
const isKeyNavigate = (e && e.action === 'down' || e.action === 'up' ||
|
|
8307
|
+
e.action === 'home' || e.action === 'end' || e.action === 'pageUp' || e.action === 'pageDown');
|
|
8308
|
+
super.setAutoFill(li, isKeyNavigate);
|
|
8297
8309
|
}
|
|
8298
8310
|
attributes(this.inputElement, { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
|
|
8299
8311
|
}
|
|
@@ -9186,7 +9198,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9186
9198
|
}
|
|
9187
9199
|
}
|
|
9188
9200
|
getValidLi() {
|
|
9189
|
-
|
|
9201
|
+
const liElement = this.ulElement.querySelector('li.' + dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')');
|
|
9190
9202
|
return (!isNullOrUndefined(liElement) ? liElement : this.liCollections[0]);
|
|
9191
9203
|
}
|
|
9192
9204
|
checkSelectAll() {
|
|
@@ -9284,7 +9296,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9284
9296
|
const list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;
|
|
9285
9297
|
if (this.backCommand) {
|
|
9286
9298
|
this.remoteCustomValue = false;
|
|
9287
|
-
if (this.allowCustomValue && list.querySelectorAll('li').length
|
|
9299
|
+
if (this.allowCustomValue && list.querySelectorAll('li').length === 0 && this.mainData.length > 0) {
|
|
9288
9300
|
this.mainData = [];
|
|
9289
9301
|
}
|
|
9290
9302
|
this.onActionComplete(list, this.mainData);
|
|
@@ -9676,10 +9688,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9676
9688
|
if (!isNullOrUndefined(focusedItem)) {
|
|
9677
9689
|
this.inputElement.setAttribute('aria-activedescendant', focusedItem.id);
|
|
9678
9690
|
if (this.allowFiltering) {
|
|
9679
|
-
|
|
9691
|
+
const filterInput = this.popupWrapper.querySelector('.' + FILTERINPUT);
|
|
9680
9692
|
filterInput && filterInput.setAttribute('aria-activedescendant', focusedItem.id);
|
|
9681
9693
|
}
|
|
9682
|
-
else if (this.mode
|
|
9694
|
+
else if (this.mode === 'CheckBox') {
|
|
9683
9695
|
this.overAllWrapper.setAttribute('aria-activedescendant', focusedItem.id);
|
|
9684
9696
|
}
|
|
9685
9697
|
}
|
|
@@ -10171,7 +10183,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
10171
10183
|
this.expandTextbox();
|
|
10172
10184
|
}
|
|
10173
10185
|
removeAllItems(value, eve, isClearAll, element, mainElement) {
|
|
10174
|
-
|
|
10186
|
+
const index = this.value.indexOf(value);
|
|
10175
10187
|
const removeVal = this.value.slice(0);
|
|
10176
10188
|
removeVal.splice(index, 1);
|
|
10177
10189
|
this.setProperties({ value: [].concat([], removeVal) }, true);
|
|
@@ -11084,9 +11096,14 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11084
11096
|
}
|
|
11085
11097
|
updateDataList() {
|
|
11086
11098
|
if (this.mainList && this.ulElement) {
|
|
11087
|
-
|
|
11088
|
-
|
|
11089
|
-
|
|
11099
|
+
const isDynamicGroupItemUpdate = this.mainList.childElementCount < this.ulElement.childElementCount;
|
|
11100
|
+
const isReactTemplateUpdate = ((this.ulElement.childElementCount > 0 &&
|
|
11101
|
+
this.ulElement.children[0].childElementCount > 0) &&
|
|
11102
|
+
(this.mainList.children[0].childElementCount < this.ulElement.children[0].childElementCount));
|
|
11103
|
+
const isAngularTemplateUpdate = this.itemTemplate && this.ulElement.childElementCount > 0
|
|
11104
|
+
&& !(this.ulElement.childElementCount < this.mainList.childElementCount)
|
|
11105
|
+
&& (this.ulElement.children[0].childElementCount > 0
|
|
11106
|
+
|| (this.fields.groupBy && this.ulElement.children[1] && this.ulElement.children[1].childElementCount > 0));
|
|
11090
11107
|
if (isDynamicGroupItemUpdate || isReactTemplateUpdate || isAngularTemplateUpdate) {
|
|
11091
11108
|
//EJ2-57748 - for this task, we prevent the ul element cloning ( this.mainList = this.ulElement.cloneNode ? <HTMLElement>this.ulElement.cloneNode(true) : this.ulElement;)
|
|
11092
11109
|
this.mainList = this.ulElement;
|
|
@@ -11494,7 +11511,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11494
11511
|
*/
|
|
11495
11512
|
showSpinner() {
|
|
11496
11513
|
if (isNullOrUndefined(this.spinnerElement)) {
|
|
11497
|
-
|
|
11514
|
+
const filterClear = this.filterParent && this.filterParent.querySelector('.e-clear-icon.e-icons');
|
|
11498
11515
|
if (this.overAllClear.style.display !== 'none' || filterClear) {
|
|
11499
11516
|
this.spinnerElement = filterClear ? filterClear : this.overAllClear;
|
|
11500
11517
|
}
|
|
@@ -11571,7 +11588,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11571
11588
|
const raminElement = this.createElement('span', {
|
|
11572
11589
|
className: REMAIN_WRAPPER$1
|
|
11573
11590
|
});
|
|
11574
|
-
|
|
11591
|
+
const remainCompildTemp = remainContent.replace('${count}', this.value.length.toString());
|
|
11575
11592
|
raminElement.innerText = remainCompildTemp;
|
|
11576
11593
|
this.viewWrapper.appendChild(raminElement);
|
|
11577
11594
|
this.renderReactTemplates();
|
|
@@ -11651,8 +11668,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11651
11668
|
viewWrapper.removeChild(viewWrapper.firstChild);
|
|
11652
11669
|
}
|
|
11653
11670
|
raminElement.innerHTML = '';
|
|
11654
|
-
|
|
11655
|
-
|
|
11671
|
+
const remainTemp = remainContent.replace('${count}', remaining.toString());
|
|
11672
|
+
const totalTemp = totalContent.replace('${count}', remaining.toString());
|
|
11656
11673
|
raminElement.innerText = (viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3) ? remainTemp : totalTemp;
|
|
11657
11674
|
if (viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3) {
|
|
11658
11675
|
viewWrapper.classList.remove(TOTAL_COUNT_WRAPPER$1);
|
|
@@ -11840,9 +11857,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11840
11857
|
else {
|
|
11841
11858
|
for (let i = 0; i < li.length && i < count; i++) {
|
|
11842
11859
|
this.removeHover();
|
|
11843
|
-
|
|
11844
|
-
|
|
11845
|
-
|
|
11860
|
+
const customVal = li[i].getAttribute('data-value');
|
|
11861
|
+
const value = this.getFormattedValue(customVal);
|
|
11862
|
+
const mainElement = this.mainList ? this.mainList.querySelectorAll(state ?
|
|
11846
11863
|
'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
|
|
11847
11864
|
'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)')[i] : null;
|
|
11848
11865
|
if (state) {
|
|
@@ -12105,7 +12122,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12105
12122
|
break;
|
|
12106
12123
|
case 'popupHeight':
|
|
12107
12124
|
if (this.popupObj) {
|
|
12108
|
-
|
|
12125
|
+
const overAllHeight = parseInt(this.popupHeight, 10);
|
|
12109
12126
|
if (this.popupHeight !== 'auto') {
|
|
12110
12127
|
this.list.style.maxHeight = formatUnit(overAllHeight);
|
|
12111
12128
|
this.popupWrapper.style.maxHeight = formatUnit(this.popupHeight);
|
|
@@ -12143,23 +12160,21 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12143
12160
|
this.renderPopup();
|
|
12144
12161
|
}
|
|
12145
12162
|
presentItemValue(ulElement) {
|
|
12146
|
-
|
|
12163
|
+
const valuecheck = [];
|
|
12147
12164
|
for (let i = 0; i < this.value.length; i++) {
|
|
12148
|
-
|
|
12165
|
+
const checkEle = this.findListElement(((this.allowFiltering && !isNullOrUndefined(this.mainList)) ? this.mainList : ulElement), 'li', 'data-value', this.value[i]);
|
|
12149
12166
|
if (!checkEle) {
|
|
12150
12167
|
valuecheck.push(this.value[i]);
|
|
12151
12168
|
}
|
|
12152
12169
|
}
|
|
12153
12170
|
return valuecheck;
|
|
12154
12171
|
}
|
|
12155
|
-
;
|
|
12156
12172
|
addNonPresentItems(valuecheck, ulElement, list, event) {
|
|
12157
12173
|
this.dataSource.executeQuery(this.getForQuery(valuecheck)).then((e) => {
|
|
12158
12174
|
this.addItem(e.result, list.length);
|
|
12159
12175
|
this.updateActionList(ulElement, list, event);
|
|
12160
12176
|
});
|
|
12161
12177
|
}
|
|
12162
|
-
;
|
|
12163
12178
|
updateVal(newProp, oldProp, prop) {
|
|
12164
12179
|
if (!this.list) {
|
|
12165
12180
|
this.onLoadSelect();
|
|
@@ -12172,7 +12187,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12172
12187
|
if (!isNullOrUndefined(this.value) && !this.allowCustomValue) {
|
|
12173
12188
|
valuecheck = this.presentItemValue(this.ulElement);
|
|
12174
12189
|
}
|
|
12175
|
-
if (prop
|
|
12190
|
+
if (prop === 'value' && valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
|
|
12176
12191
|
&& this.listData != null) {
|
|
12177
12192
|
this.mainData = null;
|
|
12178
12193
|
this.setDynValue = true;
|
|
@@ -13666,14 +13681,14 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
13666
13681
|
triggerDrag(args) {
|
|
13667
13682
|
let scrollParent;
|
|
13668
13683
|
let boundRect;
|
|
13669
|
-
|
|
13684
|
+
const scrollMoved = 36;
|
|
13670
13685
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13671
|
-
|
|
13686
|
+
const event = args.event;
|
|
13672
13687
|
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(
|
|
13688
|
+
if (args.target && (args.target.classList.contains('e-listbox-wrapper') || args.target.classList.contains('e-list-item')
|
|
13689
|
+
|| args.target.classList.contains('e-filter-parent') || args.target.classList.contains('e-input-group'))) {
|
|
13690
|
+
if (args.target.classList.contains('e-list-item') || args.target.classList.contains('e-filter-parent')
|
|
13691
|
+
|| args.target.classList.contains('e-input-group')) {
|
|
13677
13692
|
wrapper = args.target.closest('.e-listbox-wrapper');
|
|
13678
13693
|
}
|
|
13679
13694
|
else {
|
|
@@ -13727,7 +13742,8 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
13727
13742
|
const getArgs = this.getDragArgs({ target: args.droppedElement }, true);
|
|
13728
13743
|
const sourceArgs = { previousData: this.dataSource };
|
|
13729
13744
|
const destArgs = { previousData: listObj.dataSource };
|
|
13730
|
-
let dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource },
|
|
13745
|
+
let dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource },
|
|
13746
|
+
previousIndex: args.previousIndex, currentIndex: args.currentIndex });
|
|
13731
13747
|
if (listObj !== this) {
|
|
13732
13748
|
const sourceArgs1 = extend(sourceArgs, { currentData: this.listData });
|
|
13733
13749
|
dragArgs = extend(dragArgs, { source: sourceArgs1, destination: destArgs });
|
|
@@ -13821,14 +13837,14 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
13821
13837
|
currIdx++;
|
|
13822
13838
|
});
|
|
13823
13839
|
if (this.fields.groupBy) {
|
|
13824
|
-
|
|
13840
|
+
const sourceElem = this.renderItems(this.listData, this.fields);
|
|
13825
13841
|
this.updateListItems(sourceElem, this.ulElement);
|
|
13826
13842
|
this.setSelection();
|
|
13827
13843
|
}
|
|
13828
13844
|
if (listObj.sortOrder !== 'None' || this.selectionSettings.showCheckbox
|
|
13829
13845
|
!== listObj.selectionSettings.showCheckbox || listObj.fields.groupBy || listObj.itemTemplate || this.itemTemplate) {
|
|
13830
13846
|
const sortable = getComponent(ul, 'sortable');
|
|
13831
|
-
|
|
13847
|
+
const sourceElem = listObj.renderItems(listData, listObj.fields);
|
|
13832
13848
|
listObj.updateListItems(sourceElem, ul);
|
|
13833
13849
|
this.setSelection();
|
|
13834
13850
|
if (sortable.placeHolderElement) {
|
|
@@ -13858,7 +13874,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
13858
13874
|
}
|
|
13859
13875
|
updateListItems(sourceElem, destElem) {
|
|
13860
13876
|
const i = 0;
|
|
13861
|
-
destElem.innerHTML =
|
|
13877
|
+
destElem.innerHTML = '';
|
|
13862
13878
|
while (i < sourceElem.childNodes.length) {
|
|
13863
13879
|
destElem.appendChild(sourceElem.childNodes[i]);
|
|
13864
13880
|
}
|
|
@@ -13918,7 +13934,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
13918
13934
|
enableItems(items, enable = true, isValue) {
|
|
13919
13935
|
let li;
|
|
13920
13936
|
items.forEach((item) => {
|
|
13921
|
-
|
|
13937
|
+
const text = item;
|
|
13922
13938
|
li = this.findListElement(this.list, 'li', 'data-value', isValue ? text : this.getValueByText(text));
|
|
13923
13939
|
if (!li) {
|
|
13924
13940
|
return;
|
|
@@ -14043,6 +14059,8 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14043
14059
|
if (this.listData.length === 0) {
|
|
14044
14060
|
this.l10nUpdate();
|
|
14045
14061
|
}
|
|
14062
|
+
this.value = null;
|
|
14063
|
+
this.updateToolBarState();
|
|
14046
14064
|
}
|
|
14047
14065
|
/**
|
|
14048
14066
|
* Gets the array of data Object that matches the given array of values.
|
|
@@ -14284,7 +14302,10 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14284
14302
|
let filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
|
|
14285
14303
|
if (this.allowFiltering) {
|
|
14286
14304
|
const filterType = this.inputString === '' ? 'contains' : this.filterType;
|
|
14287
|
-
|
|
14305
|
+
let dataType = this.typeOfData(this.dataSource).typeof;
|
|
14306
|
+
if (dataType === null) {
|
|
14307
|
+
dataType = this.typeOfData(this.jsonData).typeof;
|
|
14308
|
+
}
|
|
14288
14309
|
if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
|
|
14289
14310
|
filterQuery.where('', filterType, this.inputString, this.ignoreCase, this.ignoreAccent);
|
|
14290
14311
|
}
|
|
@@ -14644,7 +14665,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14644
14665
|
});
|
|
14645
14666
|
if (isRefresh) {
|
|
14646
14667
|
if (fListBox.fields.groupBy) {
|
|
14647
|
-
|
|
14668
|
+
const sourceElem = fListBox.renderItems(listData, fListBox.fields);
|
|
14648
14669
|
fListBox.updateListItems(sourceElem, fListBox.ulElement);
|
|
14649
14670
|
}
|
|
14650
14671
|
else {
|
|
@@ -14677,7 +14698,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14677
14698
|
tListBox.jsonData = tJsonData;
|
|
14678
14699
|
tListBox.sortedData = tSortData;
|
|
14679
14700
|
if (isRefresh) {
|
|
14680
|
-
|
|
14701
|
+
const sourceElem = tListBox.renderItems(tListData, tListBox.fields);
|
|
14681
14702
|
tListBox.updateListItems(sourceElem, tListBox.ulElement);
|
|
14682
14703
|
tListBox.setSelection();
|
|
14683
14704
|
fListBox.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
|
|
@@ -14766,7 +14787,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14766
14787
|
tListBox.jsonData = jsonData;
|
|
14767
14788
|
fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
|
|
14768
14789
|
if (isRefresh) {
|
|
14769
|
-
|
|
14790
|
+
const sourceElem = tListBox.renderItems(listData, tListBox.fields);
|
|
14770
14791
|
tListBox.updateListItems(sourceElem, tListBox.ulElement);
|
|
14771
14792
|
this.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
|
|
14772
14793
|
}
|
|
@@ -14874,7 +14895,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14874
14895
|
}
|
|
14875
14896
|
}
|
|
14876
14897
|
}
|
|
14877
|
-
else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !==
|
|
14898
|
+
else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !== 'KeyA') {
|
|
14878
14899
|
this.upDownKeyHandler(e);
|
|
14879
14900
|
}
|
|
14880
14901
|
}
|
|
@@ -14917,9 +14938,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14917
14938
|
this.selectHandler({ target: ul.children[fliIdx], ctrlKey: e.ctrlKey, shiftKey: e.shiftKey }, true);
|
|
14918
14939
|
}
|
|
14919
14940
|
if (this.selectionSettings.showCheckbox && e.ctrlKey && e.shiftKey && (e.keyCode === 36 || e.keyCode === 35)) {
|
|
14920
|
-
|
|
14921
|
-
|
|
14922
|
-
|
|
14941
|
+
const selectedidx = Array.prototype.indexOf.call(ul.children, fli);
|
|
14942
|
+
const sidx = e.code === 'Home' ? 0 : selectedidx;
|
|
14943
|
+
const eidx = e.code === 'Home' ? selectedidx : ul.children.length - 1;
|
|
14923
14944
|
for (let i = sidx; i <= eidx; i++) {
|
|
14924
14945
|
const item = ul.children[i];
|
|
14925
14946
|
this.notify('updatelist', { li: item, e: {
|