@syncfusion/ej2-dropdowns 23.1.42 → 23.1.43
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 +16 -2
- 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 +58 -6
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +61 -9
- 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 +10 -10
- package/src/drop-down-base/drop-down-base.d.ts +7 -0
- package/src/drop-down-base/drop-down-base.js +17 -0
- package/src/drop-down-list/drop-down-list.js +35 -5
- package/src/drop-down-tree/drop-down-tree.js +3 -3
- package/src/mention/mention.js +6 -1
|
@@ -1424,6 +1424,23 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1424
1424
|
}
|
|
1425
1425
|
return dataSource;
|
|
1426
1426
|
}
|
|
1427
|
+
/**
|
|
1428
|
+
* Return the index of item which matched with given value in data source
|
|
1429
|
+
*
|
|
1430
|
+
* @param {string | number | boolean} value - Specifies given value.
|
|
1431
|
+
* @returns {number} Returns the index of the item.
|
|
1432
|
+
*/
|
|
1433
|
+
getIndexByValueFilter(value) {
|
|
1434
|
+
let index;
|
|
1435
|
+
const listItems = this.renderItems(this.selectData, this.fields);
|
|
1436
|
+
for (let i = 0; i < listItems.children.length; i++) {
|
|
1437
|
+
if (!isNullOrUndefined(value) && listItems.children[i].getAttribute('data-value') === value.toString()) {
|
|
1438
|
+
index = i;
|
|
1439
|
+
break;
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
return index;
|
|
1443
|
+
}
|
|
1427
1444
|
/**
|
|
1428
1445
|
* Return the index of item which matched with given value in data source
|
|
1429
1446
|
*
|
|
@@ -2692,6 +2709,13 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2692
2709
|
}
|
|
2693
2710
|
}
|
|
2694
2711
|
updateUpDownAction(e, isVirtualKeyAction) {
|
|
2712
|
+
if (this.allowFiltering && !this.enableVirtualization && this.getModuleName() !== 'autocomplete') {
|
|
2713
|
+
let value = this.getItemData().value;
|
|
2714
|
+
let filterIndex = this.getIndexByValue(value);
|
|
2715
|
+
if (!isNullOrUndefined(filterIndex)) {
|
|
2716
|
+
this.activeIndex = filterIndex;
|
|
2717
|
+
}
|
|
2718
|
+
}
|
|
2695
2719
|
const focusEle = this.list.querySelector('.' + dropDownListClasses.focus);
|
|
2696
2720
|
if (this.isSelectFocusItem(focusEle) && !isVirtualKeyAction) {
|
|
2697
2721
|
this.setSelection(focusEle, e);
|
|
@@ -2736,6 +2760,13 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2736
2760
|
this.setSelection(nextItem, e);
|
|
2737
2761
|
}
|
|
2738
2762
|
}
|
|
2763
|
+
if (this.allowFiltering && !this.enableVirtualization && this.getModuleName() !== 'autocomplete') {
|
|
2764
|
+
let value = this.getItemData().value;
|
|
2765
|
+
let filterIndex = this.getIndexByValueFilter(value);
|
|
2766
|
+
if (!isNullOrUndefined(filterIndex)) {
|
|
2767
|
+
this.activeIndex = filterIndex;
|
|
2768
|
+
}
|
|
2769
|
+
}
|
|
2739
2770
|
e.preventDefault();
|
|
2740
2771
|
}
|
|
2741
2772
|
updateHomeEndAction(e, isVirtualKeyAction) {
|
|
@@ -3036,7 +3067,18 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3036
3067
|
if (isNullOrUndefined(value)) {
|
|
3037
3068
|
value = 'null';
|
|
3038
3069
|
}
|
|
3039
|
-
this.
|
|
3070
|
+
if (this.allowFiltering && !this.enableVirtualization && this.getModuleName() !== 'autocomplete') {
|
|
3071
|
+
let filterIndex = this.getIndexByValueFilter(value);
|
|
3072
|
+
if (!isNullOrUndefined(filterIndex)) {
|
|
3073
|
+
this.activeIndex = filterIndex;
|
|
3074
|
+
}
|
|
3075
|
+
else {
|
|
3076
|
+
this.activeIndex = this.getIndexByValue(value);
|
|
3077
|
+
}
|
|
3078
|
+
}
|
|
3079
|
+
else {
|
|
3080
|
+
this.activeIndex = this.getIndexByValue(value);
|
|
3081
|
+
}
|
|
3040
3082
|
}
|
|
3041
3083
|
activeItem(li) {
|
|
3042
3084
|
if (this.isValidLI(li) && !li.classList.contains(dropDownBaseClasses.selected)) {
|
|
@@ -3062,6 +3104,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3062
3104
|
detach(this.valueTempElement);
|
|
3063
3105
|
this.inputElement.style.display = 'block';
|
|
3064
3106
|
}
|
|
3107
|
+
if (!isNullOrUndefined(dataItem.value) && !this.enableVirtualization && this.allowFiltering) {
|
|
3108
|
+
this.activeIndex = this.getIndexByValueFilter(dataItem.value);
|
|
3109
|
+
}
|
|
3065
3110
|
const clearIcon = dropDownListClasses.clearIcon;
|
|
3066
3111
|
const isFilterElement = this.isFiltering() && this.filterInput && (this.getModuleName() === 'combobox');
|
|
3067
3112
|
const clearElement = isFilterElement && this.filterInput.parentElement.querySelector('.' + clearIcon);
|
|
@@ -4538,7 +4583,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4538
4583
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4539
4584
|
this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
|
|
4540
4585
|
}
|
|
4541
|
-
this.
|
|
4586
|
+
if (this.getModuleName() !== 'autocomplete' && this.totalItemCount != 0 && this.totalItemCount > (this.itemCount * 2)) {
|
|
4587
|
+
this.getSkeletonCount();
|
|
4588
|
+
}
|
|
4542
4589
|
this.UpdateSkeleton();
|
|
4543
4590
|
this.listData = currentData;
|
|
4544
4591
|
this.updateActionCompleteDataValues(ulElement, currentData);
|
|
@@ -7395,12 +7442,12 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
7395
7442
|
const nodes = this.treeObj.element.querySelectorAll('li');
|
|
7396
7443
|
const checkedNodes = this.treeObj.element.querySelectorAll('li .e-checkbox-wrapper[aria-checked=true]');
|
|
7397
7444
|
const wrap = closest(this.checkBoxElement, '.' + CHECKBOXWRAP);
|
|
7398
|
-
if (wrap && args.action === 'uncheck' && (args.isInteracted || checkedNodes.length === 0 || args.data[0].isChecked
|
|
7445
|
+
if (wrap && args.action === 'uncheck' && (args.isInteracted || checkedNodes.length === 0 || (!isNullOrUndefined(args.data[0]) && args.data[0].isChecked === 'false'))) {
|
|
7399
7446
|
this.isReverseUpdate = true;
|
|
7400
7447
|
this.changeState(wrap, 'uncheck');
|
|
7401
7448
|
this.isReverseUpdate = false;
|
|
7402
7449
|
}
|
|
7403
|
-
else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length && (args.isInteracted || this.isCheckAllCalled || args.data[0].isChecked
|
|
7450
|
+
else if (wrap && args.action === 'check' && checkedNodes.length === nodes.length && (args.isInteracted || this.isCheckAllCalled || (!isNullOrUndefined(args.data[0]) && args.data[0].isChecked === 'true'))) {
|
|
7404
7451
|
this.isReverseUpdate = true;
|
|
7405
7452
|
this.isCheckAllCalled = false;
|
|
7406
7453
|
this.changeState(wrap, 'check');
|
|
@@ -8363,7 +8410,6 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
8363
8410
|
this.clearTemplate();
|
|
8364
8411
|
this.unWireEvents();
|
|
8365
8412
|
this.setCssClass(null, this.cssClass);
|
|
8366
|
-
this.setProperties({ value: [] }, true);
|
|
8367
8413
|
this.setProperties({ text: null }, true);
|
|
8368
8414
|
this.treeObj.destroy();
|
|
8369
8415
|
this.destroyFilter();
|
|
@@ -8406,6 +8452,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
8406
8452
|
this.overFlowWrapper = null;
|
|
8407
8453
|
this.keyboardModule = null;
|
|
8408
8454
|
super.destroy();
|
|
8455
|
+
this.setProperties({ value: [] }, true);
|
|
8409
8456
|
}
|
|
8410
8457
|
destroyFilter() {
|
|
8411
8458
|
if (this.filterObj) {
|
|
@@ -18534,7 +18581,12 @@ let Mention = class Mention extends DropDownBase {
|
|
|
18534
18581
|
value = this.displayTempElement.innerHTML;
|
|
18535
18582
|
}
|
|
18536
18583
|
if (this.isContentEditable(this.inputElement)) {
|
|
18537
|
-
|
|
18584
|
+
if (Browser.isAndroid) {
|
|
18585
|
+
return '<span contenteditable="true" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
|
|
18586
|
+
}
|
|
18587
|
+
else {
|
|
18588
|
+
return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
|
|
18589
|
+
}
|
|
18538
18590
|
}
|
|
18539
18591
|
else {
|
|
18540
18592
|
return showChar + value;
|