@syncfusion/ej2-dropdowns 20.3.58 → 20.3.60
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 -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 +72 -45
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +79 -47
- 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 +8 -8
- package/src/auto-complete/auto-complete-model.d.ts +1 -0
- package/src/auto-complete/auto-complete.d.ts +4 -3
- package/src/auto-complete/auto-complete.js +6 -4
- package/src/combo-box/combo-box.d.ts +4 -4
- package/src/combo-box/combo-box.js +12 -8
- package/src/common/incremental-search.d.ts +3 -4
- package/src/common/incremental-search.js +22 -7
- package/src/drop-down-base/drop-down-base.d.ts +1 -1
- package/src/drop-down-base/drop-down-base.js +13 -11
- package/src/drop-down-list/drop-down-list.d.ts +3 -3
- package/src/drop-down-list/drop-down-list.js +5 -5
- package/src/list-box/list-box.js +17 -8
- package/src/multi-select/multi-select.d.ts +4 -4
- package/src/multi-select/multi-select.js +4 -4
|
@@ -6,9 +6,6 @@ import { Input, TextBox } from '@syncfusion/ej2-inputs';
|
|
|
6
6
|
import { Button, createCheckBox } from '@syncfusion/ej2-buttons';
|
|
7
7
|
import { TreeView } from '@syncfusion/ej2-navigations';
|
|
8
8
|
|
|
9
|
-
/**
|
|
10
|
-
* IncrementalSearch module file
|
|
11
|
-
*/
|
|
12
9
|
var queryString = '';
|
|
13
10
|
var prevString = '';
|
|
14
11
|
var matches$1 = [];
|
|
@@ -81,7 +78,7 @@ function incrementalSearch(keyCode, items, selectedIndex, ignoreCase, elementId)
|
|
|
81
78
|
* @param {boolean} ignoreCase - Specifies the case sensitive option for search operation.
|
|
82
79
|
* @returns {Element | number} Returns the search matched items.
|
|
83
80
|
*/
|
|
84
|
-
function Search(inputVal, items, searchType, ignoreCase) {
|
|
81
|
+
function Search(inputVal, items, searchType, ignoreCase, dataSource, fields, type) {
|
|
85
82
|
var listItems = items;
|
|
86
83
|
ignoreCase = ignoreCase !== undefined && ignoreCase !== null ? ignoreCase : true;
|
|
87
84
|
var itemData = { item: null, index: null };
|
|
@@ -89,14 +86,32 @@ function Search(inputVal, items, searchType, ignoreCase) {
|
|
|
89
86
|
var strLength = inputVal.length;
|
|
90
87
|
var queryStr = ignoreCase ? inputVal.toLocaleLowerCase() : inputVal;
|
|
91
88
|
queryStr = escapeCharRegExp(queryStr);
|
|
92
|
-
|
|
89
|
+
var _loop_1 = function (i, itemsData) {
|
|
93
90
|
var item = itemsData[i];
|
|
94
|
-
var text =
|
|
91
|
+
var text = void 0;
|
|
92
|
+
var filterValue;
|
|
93
|
+
if (items && dataSource) {
|
|
94
|
+
var checkField_1 = item;
|
|
95
|
+
var fieldValue_1 = fields.text.split('.');
|
|
96
|
+
dataSource.filter(function (data) {
|
|
97
|
+
Array.prototype.slice.call(fieldValue_1).forEach(function (value) {
|
|
98
|
+
if (type === 'object' && checkField_1.textContent.toString().indexOf(data[value]) !== -1 && checkField_1.getAttribute('data-value') === data[fields.value] || type === 'string' && checkField_1.textContent.toString().indexOf(data) !== -1) {
|
|
99
|
+
filterValue = type === 'object' ? data[value] : data;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
text = dataSource && filterValue ? (ignoreCase ? filterValue.toLocaleLowerCase() : filterValue).replace(/^\s+|\s+$/g, '') : (ignoreCase ? item.textContent.toLocaleLowerCase() : item.textContent).replace(/^\s+|\s+$/g, '');
|
|
95
105
|
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
106
|
itemData.item = item;
|
|
97
107
|
itemData.index = i;
|
|
98
|
-
return { item: item, index: i };
|
|
108
|
+
return { value: { item: item, index: i } };
|
|
99
109
|
}
|
|
110
|
+
};
|
|
111
|
+
for (var i = 0, itemsData = listItems; i < itemsData.length; i++) {
|
|
112
|
+
var state_1 = _loop_1(i, itemsData);
|
|
113
|
+
if (typeof state_1 === "object")
|
|
114
|
+
return state_1.value;
|
|
100
115
|
}
|
|
101
116
|
return itemData;
|
|
102
117
|
}
|
|
@@ -876,18 +891,20 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
876
891
|
return extend({}, options, fields, true);
|
|
877
892
|
};
|
|
878
893
|
DropDownBase.prototype.setFloatingHeader = function (e) {
|
|
879
|
-
if (isNullOrUndefined(this.
|
|
880
|
-
this.fixedHeaderElement
|
|
881
|
-
|
|
882
|
-
this.
|
|
894
|
+
if (!isNullOrUndefined(this.list) && !this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
895
|
+
if (isNullOrUndefined(this.fixedHeaderElement)) {
|
|
896
|
+
this.fixedHeaderElement = this.createElement('div', { className: dropDownBaseClasses.fixedHead });
|
|
897
|
+
if (!this.list.querySelector('li').classList.contains(dropDownBaseClasses.group)) {
|
|
898
|
+
this.fixedHeaderElement.style.display = 'none';
|
|
899
|
+
}
|
|
900
|
+
prepend([this.fixedHeaderElement], this.list);
|
|
901
|
+
this.setFixedHeader();
|
|
883
902
|
}
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
this.setFixedHeader();
|
|
903
|
+
if (!isNullOrUndefined(this.fixedHeaderElement) && this.fixedHeaderElement.style.zIndex === '0') {
|
|
904
|
+
this.setFixedHeader();
|
|
905
|
+
}
|
|
906
|
+
this.scrollStop(e);
|
|
889
907
|
}
|
|
890
|
-
this.scrollStop(e);
|
|
891
908
|
};
|
|
892
909
|
DropDownBase.prototype.scrollStop = function (e) {
|
|
893
910
|
var target = !isNullOrUndefined(e) ? e.target : this.list;
|
|
@@ -1210,7 +1227,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1210
1227
|
* Adds a new item to the popup list. By default, new item appends to the list as the last item,
|
|
1211
1228
|
* but you can insert based on the index parameter.
|
|
1212
1229
|
*
|
|
1213
|
-
* @param
|
|
1230
|
+
* @param { Object[] } items - Specifies an array of JSON data or a JSON data.
|
|
1214
1231
|
* @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
|
|
1215
1232
|
* @returns {void}
|
|
1216
1233
|
* @deprecated
|
|
@@ -2492,10 +2509,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2492
2509
|
attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id != '' ? this.inputElement.id : this.element.id });
|
|
2493
2510
|
this.targetElement().removeAttribute('aria-live');
|
|
2494
2511
|
}
|
|
2495
|
-
if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
|
|
2512
|
+
if (this.isPopupOpen && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
|
|
2496
2513
|
attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
|
|
2497
2514
|
}
|
|
2498
|
-
else if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
|
|
2515
|
+
else if (this.isPopupOpen && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
|
|
2499
2516
|
attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
|
|
2500
2517
|
}
|
|
2501
2518
|
};
|
|
@@ -2815,9 +2832,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2815
2832
|
/**
|
|
2816
2833
|
* To filter the data from given data source by using query
|
|
2817
2834
|
*
|
|
2818
|
-
* @param
|
|
2819
|
-
* @param
|
|
2820
|
-
* @param
|
|
2835
|
+
* @param {Object[] | DataManager } dataSource - Set the data source to filter.
|
|
2836
|
+
* @param {Query} query - Specify the query to filter the data.
|
|
2837
|
+
* @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
|
|
2821
2838
|
* @returns {void}
|
|
2822
2839
|
* @deprecated
|
|
2823
2840
|
*/
|
|
@@ -7688,7 +7705,9 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
7688
7705
|
if ((Browser.isDevice && !this.isDropDownClick || !Browser.isDevice) &&
|
|
7689
7706
|
!isNullOrUndefined(this.liCollections) && this.liCollections.length > 0) {
|
|
7690
7707
|
var inputValue = this.inputElement.value;
|
|
7691
|
-
var
|
|
7708
|
+
var dataSource = this.sortedData;
|
|
7709
|
+
var type = this.typeOfData(dataSource).typeof;
|
|
7710
|
+
var activeItem = Search(inputValue, this.liCollections, this.filterType, true, dataSource, this.fields, type);
|
|
7692
7711
|
var activeElement = activeItem.item;
|
|
7693
7712
|
if (!isNullOrUndefined(activeElement)) {
|
|
7694
7713
|
var count = this.getIndexByValue(activeElement.getAttribute('data-value')) - 1;
|
|
@@ -7729,7 +7748,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
7729
7748
|
this.itemData = this.getDataByValue(this.value);
|
|
7730
7749
|
var dataItem = this.getItemData();
|
|
7731
7750
|
if (!(this.allowCustom && isNullOrUndefined(dataItem.value) && isNullOrUndefined(dataItem.text))) {
|
|
7732
|
-
this.setProperties({ 'value': dataItem.value
|
|
7751
|
+
this.setProperties({ 'value': dataItem.value }, !this.allowCustom);
|
|
7733
7752
|
}
|
|
7734
7753
|
};
|
|
7735
7754
|
/**
|
|
@@ -8089,7 +8108,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
8089
8108
|
* Adds a new item to the combobox popup list. By default, new item appends to the list as the last item,
|
|
8090
8109
|
* but you can insert based on the index parameter.
|
|
8091
8110
|
*
|
|
8092
|
-
* @param
|
|
8111
|
+
* @param { Object[] } items - Specifies an array of JSON data or a JSON data.
|
|
8093
8112
|
* @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
|
|
8094
8113
|
* @returns {void}
|
|
8095
8114
|
* @deprecated
|
|
@@ -8100,9 +8119,9 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
8100
8119
|
/**
|
|
8101
8120
|
* To filter the data from given data source by using query
|
|
8102
8121
|
*
|
|
8103
|
-
* @param
|
|
8104
|
-
* @param
|
|
8105
|
-
* @param
|
|
8122
|
+
* @param {Object[] | DataManager } dataSource - Set the data source to filter.
|
|
8123
|
+
* @param {Query} query - Specify the query to filter the data.
|
|
8124
|
+
* @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
|
|
8106
8125
|
* @returns {void}
|
|
8107
8126
|
* @deprecated
|
|
8108
8127
|
*/
|
|
@@ -8149,10 +8168,12 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
8149
8168
|
return;
|
|
8150
8169
|
}
|
|
8151
8170
|
if (this.getModuleName() === 'combobox' && this.inputElement.value.trim() !== '') {
|
|
8152
|
-
var
|
|
8171
|
+
var dataSource = this.sortedData;
|
|
8172
|
+
var type = this.typeOfData(dataSource).typeof;
|
|
8173
|
+
var searchItem = Search(this.inputElement.value, this.liCollections, 'Equal', true, dataSource, this.fields, type);
|
|
8153
8174
|
this.selectedLI = searchItem.item;
|
|
8154
8175
|
if (isNullOrUndefined(searchItem.index)) {
|
|
8155
|
-
searchItem.index = Search(this.inputElement.value, this.liCollections, 'StartsWith', true).index;
|
|
8176
|
+
searchItem.index = Search(this.inputElement.value, this.liCollections, 'StartsWith', true, dataSource, this.fields, type).index;
|
|
8156
8177
|
}
|
|
8157
8178
|
this.activeIndex = searchItem.index;
|
|
8158
8179
|
if (!isNullOrUndefined(this.selectedLI)) {
|
|
@@ -8441,9 +8462,9 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8441
8462
|
/**
|
|
8442
8463
|
* To filter the data from given data source by using query
|
|
8443
8464
|
*
|
|
8444
|
-
* @param
|
|
8445
|
-
* @param
|
|
8446
|
-
* @param
|
|
8465
|
+
* @param {Object[] | DataManager } dataSource - Set the data source to filter.
|
|
8466
|
+
* @param {Query} query - Specify the query to filter the data.
|
|
8467
|
+
* @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
|
|
8447
8468
|
* @returns {void}
|
|
8448
8469
|
* @deprecated
|
|
8449
8470
|
*/
|
|
@@ -8483,7 +8504,9 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8483
8504
|
AutoComplete.prototype.postBackAction = function () {
|
|
8484
8505
|
if (this.autofill && !isNullOrUndefined(this.liCollections[0]) && this.searchList) {
|
|
8485
8506
|
var items = [this.liCollections[0]];
|
|
8486
|
-
var
|
|
8507
|
+
var dataSource = this.listData;
|
|
8508
|
+
var type = this.typeOfData(dataSource).typeof;
|
|
8509
|
+
var searchItem = Search(this.inputElement.value, items, 'StartsWith', this.ignoreCase, dataSource, this.fields, type);
|
|
8487
8510
|
this.searchList = false;
|
|
8488
8511
|
if (!isNullOrUndefined(searchItem.item)) {
|
|
8489
8512
|
_super.prototype.setAutoFill.call(this, this.liCollections[0], true);
|
|
@@ -9522,9 +9545,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9522
9545
|
/**
|
|
9523
9546
|
* To filter the multiselect data from given data source by using query
|
|
9524
9547
|
*
|
|
9525
|
-
* @param
|
|
9526
|
-
* @param
|
|
9527
|
-
* @param
|
|
9548
|
+
* @param {Object[] | DataManager } dataSource - Set the data source to filter.
|
|
9549
|
+
* @param {Query} query - Specify the query to filter the data.
|
|
9550
|
+
* @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
|
|
9528
9551
|
* @returns {void}
|
|
9529
9552
|
*/
|
|
9530
9553
|
MultiSelect.prototype.filter = function (dataSource, query, fields) {
|
|
@@ -12532,7 +12555,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12532
12555
|
* Adds a new item to the multiselect popup list. By default, new item appends to the list as the last item,
|
|
12533
12556
|
* but you can insert based on the index parameter.
|
|
12534
12557
|
*
|
|
12535
|
-
* @param
|
|
12558
|
+
* @param { Object[] } items - Specifies an array of JSON data or a JSON data.
|
|
12536
12559
|
* @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
|
|
12537
12560
|
* @returns {void}
|
|
12538
12561
|
*/
|
|
@@ -14744,12 +14767,12 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
14744
14767
|
if (li && li.parentElement) {
|
|
14745
14768
|
currSelIdx = [].slice.call(li.parentElement.children).indexOf(li);
|
|
14746
14769
|
if (!this.selectionSettings.showCheckbox) {
|
|
14747
|
-
if ((e.ctrlKey || Browser.isDevice) && this.isSelected(li)) {
|
|
14770
|
+
if ((e.ctrlKey || e.metaKey || Browser.isDevice) && this.isSelected(li)) {
|
|
14748
14771
|
li.classList.remove(cssClass.selected);
|
|
14749
14772
|
li.removeAttribute('aria-selected');
|
|
14750
14773
|
isSelect = false;
|
|
14751
14774
|
}
|
|
14752
|
-
else if (!(this.selectionSettings.mode === 'Multiple' && (e.ctrlKey || Browser.isDevice))) {
|
|
14775
|
+
else if (!(this.selectionSettings.mode === 'Multiple' && (e.ctrlKey || e.metaKey || Browser.isDevice))) {
|
|
14753
14776
|
this.getSelectedItems().forEach(function (ele) {
|
|
14754
14777
|
ele.removeAttribute('aria-selected');
|
|
14755
14778
|
});
|
|
@@ -15221,12 +15244,21 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
15221
15244
|
}
|
|
15222
15245
|
return listObj;
|
|
15223
15246
|
};
|
|
15224
|
-
ListBox.prototype.getGrabbedItems = function () {
|
|
15247
|
+
ListBox.prototype.getGrabbedItems = function (args) {
|
|
15248
|
+
var grabbItems = false;
|
|
15225
15249
|
for (var i = 0; i < this.value.length; i++) {
|
|
15226
|
-
|
|
15227
|
-
|
|
15228
|
-
|
|
15229
|
-
|
|
15250
|
+
if (this.value[i] === this.getFormattedValue(args.target.getAttribute('data-value'))) {
|
|
15251
|
+
grabbItems = true;
|
|
15252
|
+
break;
|
|
15253
|
+
}
|
|
15254
|
+
}
|
|
15255
|
+
if (grabbItems) {
|
|
15256
|
+
for (var i = 0; i < this.value.length; i++) {
|
|
15257
|
+
var liColl = this.list.querySelectorAll('[aria-selected="true"]');
|
|
15258
|
+
for (var j = 0; j < liColl.length; j++) {
|
|
15259
|
+
if (this.value[i] === this.getFormattedValue(liColl[j].getAttribute('data-value'))) {
|
|
15260
|
+
liColl[j].classList.add('e-grabbed');
|
|
15261
|
+
}
|
|
15230
15262
|
}
|
|
15231
15263
|
}
|
|
15232
15264
|
}
|
|
@@ -15240,7 +15272,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
15240
15272
|
return elems;
|
|
15241
15273
|
};
|
|
15242
15274
|
ListBox.prototype.getDragArgs = function (args, isDragEnd) {
|
|
15243
|
-
var elems = this.getGrabbedItems();
|
|
15275
|
+
var elems = this.getGrabbedItems(args);
|
|
15244
15276
|
if (elems.length) {
|
|
15245
15277
|
if (isDragEnd) {
|
|
15246
15278
|
elems.push(args.target);
|