@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
|
let queryString = '';
|
|
13
10
|
let prevString = '';
|
|
14
11
|
let 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
|
const listItems = items;
|
|
86
83
|
ignoreCase = ignoreCase !== undefined && ignoreCase !== null ? ignoreCase : true;
|
|
87
84
|
const itemData = { item: null, index: null };
|
|
@@ -91,7 +88,20 @@ function Search(inputVal, items, searchType, ignoreCase) {
|
|
|
91
88
|
queryStr = escapeCharRegExp(queryStr);
|
|
92
89
|
for (let i = 0, itemsData = listItems; i < itemsData.length; i++) {
|
|
93
90
|
const item = itemsData[i];
|
|
94
|
-
|
|
91
|
+
let text;
|
|
92
|
+
let filterValue;
|
|
93
|
+
if (items && dataSource) {
|
|
94
|
+
let checkField = item;
|
|
95
|
+
let fieldValue = fields.text.split('.');
|
|
96
|
+
dataSource.filter(function (data) {
|
|
97
|
+
Array.prototype.slice.call(fieldValue).forEach(function (value) {
|
|
98
|
+
if (type === 'object' && checkField.textContent.toString().indexOf(data[value]) !== -1 && checkField.getAttribute('data-value') === data[fields.value] || type === 'string' && checkField.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;
|
|
@@ -851,18 +861,20 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
851
861
|
return extend({}, options, fields, true);
|
|
852
862
|
}
|
|
853
863
|
setFloatingHeader(e) {
|
|
854
|
-
if (isNullOrUndefined(this.
|
|
855
|
-
this.fixedHeaderElement
|
|
856
|
-
|
|
857
|
-
this.
|
|
864
|
+
if (!isNullOrUndefined(this.list) && !this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
865
|
+
if (isNullOrUndefined(this.fixedHeaderElement)) {
|
|
866
|
+
this.fixedHeaderElement = this.createElement('div', { className: dropDownBaseClasses.fixedHead });
|
|
867
|
+
if (!this.list.querySelector('li').classList.contains(dropDownBaseClasses.group)) {
|
|
868
|
+
this.fixedHeaderElement.style.display = 'none';
|
|
869
|
+
}
|
|
870
|
+
prepend([this.fixedHeaderElement], this.list);
|
|
871
|
+
this.setFixedHeader();
|
|
858
872
|
}
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
this.setFixedHeader();
|
|
873
|
+
if (!isNullOrUndefined(this.fixedHeaderElement) && this.fixedHeaderElement.style.zIndex === '0') {
|
|
874
|
+
this.setFixedHeader();
|
|
875
|
+
}
|
|
876
|
+
this.scrollStop(e);
|
|
864
877
|
}
|
|
865
|
-
this.scrollStop(e);
|
|
866
878
|
}
|
|
867
879
|
scrollStop(e) {
|
|
868
880
|
let target = !isNullOrUndefined(e) ? e.target : this.list;
|
|
@@ -1184,7 +1196,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1184
1196
|
* Adds a new item to the popup list. By default, new item appends to the list as the last item,
|
|
1185
1197
|
* but you can insert based on the index parameter.
|
|
1186
1198
|
*
|
|
1187
|
-
* @param
|
|
1199
|
+
* @param { Object[] } items - Specifies an array of JSON data or a JSON data.
|
|
1188
1200
|
* @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
|
|
1189
1201
|
* @returns {void}
|
|
1190
1202
|
* @deprecated
|
|
@@ -2445,10 +2457,10 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2445
2457
|
attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id != '' ? this.inputElement.id : this.element.id });
|
|
2446
2458
|
this.targetElement().removeAttribute('aria-live');
|
|
2447
2459
|
}
|
|
2448
|
-
if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
|
|
2460
|
+
if (this.isPopupOpen && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
|
|
2449
2461
|
attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
|
|
2450
2462
|
}
|
|
2451
|
-
else if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
|
|
2463
|
+
else if (this.isPopupOpen && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
|
|
2452
2464
|
attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
|
|
2453
2465
|
}
|
|
2454
2466
|
}
|
|
@@ -2767,9 +2779,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2767
2779
|
/**
|
|
2768
2780
|
* To filter the data from given data source by using query
|
|
2769
2781
|
*
|
|
2770
|
-
* @param
|
|
2771
|
-
* @param
|
|
2772
|
-
* @param
|
|
2782
|
+
* @param {Object[] | DataManager } dataSource - Set the data source to filter.
|
|
2783
|
+
* @param {Query} query - Specify the query to filter the data.
|
|
2784
|
+
* @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
|
|
2773
2785
|
* @returns {void}
|
|
2774
2786
|
* @deprecated
|
|
2775
2787
|
*/
|
|
@@ -7571,7 +7583,9 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7571
7583
|
if ((Browser.isDevice && !this.isDropDownClick || !Browser.isDevice) &&
|
|
7572
7584
|
!isNullOrUndefined(this.liCollections) && this.liCollections.length > 0) {
|
|
7573
7585
|
const inputValue = this.inputElement.value;
|
|
7574
|
-
const
|
|
7586
|
+
const dataSource = this.sortedData;
|
|
7587
|
+
const type = this.typeOfData(dataSource).typeof;
|
|
7588
|
+
const activeItem = Search(inputValue, this.liCollections, this.filterType, true, dataSource, this.fields, type);
|
|
7575
7589
|
const activeElement = activeItem.item;
|
|
7576
7590
|
if (!isNullOrUndefined(activeElement)) {
|
|
7577
7591
|
const count = this.getIndexByValue(activeElement.getAttribute('data-value')) - 1;
|
|
@@ -7612,7 +7626,7 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7612
7626
|
this.itemData = this.getDataByValue(this.value);
|
|
7613
7627
|
const dataItem = this.getItemData();
|
|
7614
7628
|
if (!(this.allowCustom && isNullOrUndefined(dataItem.value) && isNullOrUndefined(dataItem.text))) {
|
|
7615
|
-
this.setProperties({ 'value': dataItem.value
|
|
7629
|
+
this.setProperties({ 'value': dataItem.value }, !this.allowCustom);
|
|
7616
7630
|
}
|
|
7617
7631
|
}
|
|
7618
7632
|
/**
|
|
@@ -7969,7 +7983,7 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7969
7983
|
* Adds a new item to the combobox popup list. By default, new item appends to the list as the last item,
|
|
7970
7984
|
* but you can insert based on the index parameter.
|
|
7971
7985
|
*
|
|
7972
|
-
* @param
|
|
7986
|
+
* @param { Object[] } items - Specifies an array of JSON data or a JSON data.
|
|
7973
7987
|
* @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
|
|
7974
7988
|
* @returns {void}
|
|
7975
7989
|
* @deprecated
|
|
@@ -7980,9 +7994,9 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7980
7994
|
/**
|
|
7981
7995
|
* To filter the data from given data source by using query
|
|
7982
7996
|
*
|
|
7983
|
-
* @param
|
|
7984
|
-
* @param
|
|
7985
|
-
* @param
|
|
7997
|
+
* @param {Object[] | DataManager } dataSource - Set the data source to filter.
|
|
7998
|
+
* @param {Query} query - Specify the query to filter the data.
|
|
7999
|
+
* @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
|
|
7986
8000
|
* @returns {void}
|
|
7987
8001
|
* @deprecated
|
|
7988
8002
|
*/
|
|
@@ -8029,10 +8043,12 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
8029
8043
|
return;
|
|
8030
8044
|
}
|
|
8031
8045
|
if (this.getModuleName() === 'combobox' && this.inputElement.value.trim() !== '') {
|
|
8032
|
-
const
|
|
8046
|
+
const dataSource = this.sortedData;
|
|
8047
|
+
const type = this.typeOfData(dataSource).typeof;
|
|
8048
|
+
const searchItem = Search(this.inputElement.value, this.liCollections, 'Equal', true, dataSource, this.fields, type);
|
|
8033
8049
|
this.selectedLI = searchItem.item;
|
|
8034
8050
|
if (isNullOrUndefined(searchItem.index)) {
|
|
8035
|
-
searchItem.index = Search(this.inputElement.value, this.liCollections, 'StartsWith', true).index;
|
|
8051
|
+
searchItem.index = Search(this.inputElement.value, this.liCollections, 'StartsWith', true, dataSource, this.fields, type).index;
|
|
8036
8052
|
}
|
|
8037
8053
|
this.activeIndex = searchItem.index;
|
|
8038
8054
|
if (!isNullOrUndefined(this.selectedLI)) {
|
|
@@ -8304,9 +8320,9 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8304
8320
|
/**
|
|
8305
8321
|
* To filter the data from given data source by using query
|
|
8306
8322
|
*
|
|
8307
|
-
* @param
|
|
8308
|
-
* @param
|
|
8309
|
-
* @param
|
|
8323
|
+
* @param {Object[] | DataManager } dataSource - Set the data source to filter.
|
|
8324
|
+
* @param {Query} query - Specify the query to filter the data.
|
|
8325
|
+
* @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
|
|
8310
8326
|
* @returns {void}
|
|
8311
8327
|
* @deprecated
|
|
8312
8328
|
*/
|
|
@@ -8346,7 +8362,9 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8346
8362
|
postBackAction() {
|
|
8347
8363
|
if (this.autofill && !isNullOrUndefined(this.liCollections[0]) && this.searchList) {
|
|
8348
8364
|
const items = [this.liCollections[0]];
|
|
8349
|
-
const
|
|
8365
|
+
const dataSource = this.listData;
|
|
8366
|
+
const type = this.typeOfData(dataSource).typeof;
|
|
8367
|
+
const searchItem = Search(this.inputElement.value, items, 'StartsWith', this.ignoreCase, dataSource, this.fields, type);
|
|
8350
8368
|
this.searchList = false;
|
|
8351
8369
|
if (!isNullOrUndefined(searchItem.item)) {
|
|
8352
8370
|
super.setAutoFill(this.liCollections[0], true);
|
|
@@ -9365,9 +9383,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9365
9383
|
/**
|
|
9366
9384
|
* To filter the multiselect data from given data source by using query
|
|
9367
9385
|
*
|
|
9368
|
-
* @param
|
|
9369
|
-
* @param
|
|
9370
|
-
* @param
|
|
9386
|
+
* @param {Object[] | DataManager } dataSource - Set the data source to filter.
|
|
9387
|
+
* @param {Query} query - Specify the query to filter the data.
|
|
9388
|
+
* @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
|
|
9371
9389
|
* @returns {void}
|
|
9372
9390
|
*/
|
|
9373
9391
|
filter(dataSource, query, fields) {
|
|
@@ -12362,7 +12380,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12362
12380
|
* Adds a new item to the multiselect popup list. By default, new item appends to the list as the last item,
|
|
12363
12381
|
* but you can insert based on the index parameter.
|
|
12364
12382
|
*
|
|
12365
|
-
* @param
|
|
12383
|
+
* @param { Object[] } items - Specifies an array of JSON data or a JSON data.
|
|
12366
12384
|
* @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
|
|
12367
12385
|
* @returns {void}
|
|
12368
12386
|
*/
|
|
@@ -14524,12 +14542,12 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14524
14542
|
if (li && li.parentElement) {
|
|
14525
14543
|
currSelIdx = [].slice.call(li.parentElement.children).indexOf(li);
|
|
14526
14544
|
if (!this.selectionSettings.showCheckbox) {
|
|
14527
|
-
if ((e.ctrlKey || Browser.isDevice) && this.isSelected(li)) {
|
|
14545
|
+
if ((e.ctrlKey || e.metaKey || Browser.isDevice) && this.isSelected(li)) {
|
|
14528
14546
|
li.classList.remove(cssClass.selected);
|
|
14529
14547
|
li.removeAttribute('aria-selected');
|
|
14530
14548
|
isSelect = false;
|
|
14531
14549
|
}
|
|
14532
|
-
else if (!(this.selectionSettings.mode === 'Multiple' && (e.ctrlKey || Browser.isDevice))) {
|
|
14550
|
+
else if (!(this.selectionSettings.mode === 'Multiple' && (e.ctrlKey || e.metaKey || Browser.isDevice))) {
|
|
14533
14551
|
this.getSelectedItems().forEach((ele) => {
|
|
14534
14552
|
ele.removeAttribute('aria-selected');
|
|
14535
14553
|
});
|
|
@@ -14995,12 +15013,21 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14995
15013
|
}
|
|
14996
15014
|
return listObj;
|
|
14997
15015
|
}
|
|
14998
|
-
getGrabbedItems() {
|
|
15016
|
+
getGrabbedItems(args) {
|
|
15017
|
+
let grabbItems = false;
|
|
14999
15018
|
for (let i = 0; i < this.value.length; i++) {
|
|
15000
|
-
|
|
15001
|
-
|
|
15002
|
-
|
|
15003
|
-
|
|
15019
|
+
if (this.value[i] === this.getFormattedValue(args.target.getAttribute('data-value'))) {
|
|
15020
|
+
grabbItems = true;
|
|
15021
|
+
break;
|
|
15022
|
+
}
|
|
15023
|
+
}
|
|
15024
|
+
if (grabbItems) {
|
|
15025
|
+
for (let i = 0; i < this.value.length; i++) {
|
|
15026
|
+
const liColl = this.list.querySelectorAll('[aria-selected="true"]');
|
|
15027
|
+
for (let j = 0; j < liColl.length; j++) {
|
|
15028
|
+
if (this.value[i] === this.getFormattedValue(liColl[j].getAttribute('data-value'))) {
|
|
15029
|
+
liColl[j].classList.add('e-grabbed');
|
|
15030
|
+
}
|
|
15004
15031
|
}
|
|
15005
15032
|
}
|
|
15006
15033
|
}
|
|
@@ -15014,7 +15041,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
15014
15041
|
return elems;
|
|
15015
15042
|
}
|
|
15016
15043
|
getDragArgs(args, isDragEnd) {
|
|
15017
|
-
let elems = this.getGrabbedItems();
|
|
15044
|
+
let elems = this.getGrabbedItems(args);
|
|
15018
15045
|
if (elems.length) {
|
|
15019
15046
|
if (isDragEnd) {
|
|
15020
15047
|
elems.push(args.target);
|