@syncfusion/ej2-dropdowns 20.3.59 → 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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 20.3.59
3
+ * version : 20.3.60
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-dropdowns@*",
3
- "_id": "@syncfusion/ej2-dropdowns@20.3.58",
3
+ "_id": "@syncfusion/ej2-dropdowns@20.3.59",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-pwXw+I7D7g8FQSCdAPVJf3V9W+h0qIXytD3FKQHi7qQYrxdRhDIHH/CGEHQ7sxYgpNKJElYQjlpMrKoPZLIo9g==",
5
+ "_integrity": "sha512-3KOrC1GdJj32XxkzIJxQd8zP9Dbp7L/0/AWOUu3LZF+4B+6Xther2bXQ6t1Gt4nstmFHbiXDrrTVE8YJbsYKUA==",
6
6
  "_location": "/@syncfusion/ej2-dropdowns",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -33,8 +33,8 @@
33
33
  "/@syncfusion/ej2-spreadsheet",
34
34
  "/@syncfusion/ej2-vue-dropdowns"
35
35
  ],
36
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-20.3.58.tgz",
37
- "_shasum": "a74ca36401f4774bd62c42f7c345de22e3e05e41",
36
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-20.3.59.tgz",
37
+ "_shasum": "9a67584709f1877eda262c63bf59a2c61d33f8de",
38
38
  "_spec": "@syncfusion/ej2-dropdowns@*",
39
39
  "_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
40
40
  "author": {
@@ -43,11 +43,11 @@
43
43
  "bundleDependencies": false,
44
44
  "dependencies": {
45
45
  "@syncfusion/ej2-base": "~20.3.56",
46
- "@syncfusion/ej2-data": "~20.3.56",
46
+ "@syncfusion/ej2-data": "~20.3.60",
47
47
  "@syncfusion/ej2-inputs": "~20.3.57",
48
48
  "@syncfusion/ej2-lists": "~20.3.56",
49
- "@syncfusion/ej2-navigations": "~20.3.58",
50
- "@syncfusion/ej2-popups": "~20.3.59"
49
+ "@syncfusion/ej2-navigations": "~20.3.60",
50
+ "@syncfusion/ej2-popups": "~20.3.60"
51
51
  },
52
52
  "deprecated": false,
53
53
  "description": "Essential JS 2 DropDown Components",
@@ -72,6 +72,6 @@
72
72
  "module": "./index.js",
73
73
  "name": "@syncfusion/ej2-dropdowns",
74
74
  "typings": "index.d.ts",
75
- "version": "20.3.59",
75
+ "version": "20.3.60",
76
76
  "sideEffects": false
77
77
  }
@@ -14,6 +14,7 @@ export interface AutoCompleteModel extends ComboBoxModel{
14
14
  * * groupBy - Group the list items with it's related items by mapping groupBy field
15
15
  *
16
16
  * {% codeBlock src='autocomplete/fields/index.md' %}{% endcodeBlock %}
17
+ *
17
18
  * > For more details about the field mapping refer to [`Data binding`](../../auto-complete/data-binding) documentation.
18
19
  *
19
20
  * @default { value: null, iconCss: null, groupBy: null}
@@ -29,6 +29,7 @@ export declare class AutoComplete extends ComboBox {
29
29
  * * groupBy - Group the list items with it's related items by mapping groupBy field
30
30
  *
31
31
  * {% codeBlock src='autocomplete/fields/index.md' %}{% endcodeBlock %}
32
+ *
32
33
  * > For more details about the field mapping refer to [`Data binding`](../../auto-complete/data-binding) documentation.
33
34
  *
34
35
  * @default { value: null, iconCss: null, groupBy: null}
@@ -216,9 +217,9 @@ export declare class AutoComplete extends ComboBox {
216
217
  /**
217
218
  * To filter the data from given data source by using query
218
219
  *
219
- * @param {Object[] | DataManager } dataSource - Set the data source to filter.
220
- * @param {Query} query - Specify the query to filter the data.
221
- * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
220
+ * @param {Object[] | DataManager } dataSource - Set the data source to filter.
221
+ * @param {Query} query - Specify the query to filter the data.
222
+ * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
222
223
  * @returns {void}
223
224
 
224
225
  */
@@ -140,9 +140,9 @@ var AutoComplete = /** @class */ (function (_super) {
140
140
  /**
141
141
  * To filter the data from given data source by using query
142
142
  *
143
- * @param {Object[] | DataManager } dataSource - Set the data source to filter.
144
- * @param {Query} query - Specify the query to filter the data.
145
- * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
143
+ * @param {Object[] | DataManager } dataSource - Set the data source to filter.
144
+ * @param {Query} query - Specify the query to filter the data.
145
+ * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
146
146
  * @returns {void}
147
147
 
148
148
  */
@@ -182,7 +182,9 @@ var AutoComplete = /** @class */ (function (_super) {
182
182
  AutoComplete.prototype.postBackAction = function () {
183
183
  if (this.autofill && !isNullOrUndefined(this.liCollections[0]) && this.searchList) {
184
184
  var items = [this.liCollections[0]];
185
- var searchItem = Search(this.inputElement.value, items, 'StartsWith', this.ignoreCase);
185
+ var dataSource = this.listData;
186
+ var type = this.typeOfData(dataSource).typeof;
187
+ var searchItem = Search(this.inputElement.value, items, 'StartsWith', this.ignoreCase, dataSource, this.fields, type);
186
188
  this.searchList = false;
187
189
  if (!isNullOrUndefined(searchItem.item)) {
188
190
  _super.prototype.setAutoFill.call(this, this.liCollections[0], true);
@@ -318,7 +318,7 @@ export declare class ComboBox extends DropDownList {
318
318
  * Adds a new item to the combobox popup list. By default, new item appends to the list as the last item,
319
319
  * but you can insert based on the index parameter.
320
320
  *
321
- * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
321
+ * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
322
322
  * @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
323
323
  * @returns {void}
324
324
 
@@ -331,9 +331,9 @@ export declare class ComboBox extends DropDownList {
331
331
  /**
332
332
  * To filter the data from given data source by using query
333
333
  *
334
- * @param {Object[] | DataManager } dataSource - Set the data source to filter.
335
- * @param {Query} query - Specify the query to filter the data.
336
- * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
334
+ * @param {Object[] | DataManager } dataSource - Set the data source to filter.
335
+ * @param {Query} query - Specify the query to filter the data.
336
+ * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
337
337
  * @returns {void}
338
338
 
339
339
  */
@@ -234,7 +234,9 @@ var ComboBox = /** @class */ (function (_super) {
234
234
  if ((Browser.isDevice && !this.isDropDownClick || !Browser.isDevice) &&
235
235
  !isNullOrUndefined(this.liCollections) && this.liCollections.length > 0) {
236
236
  var inputValue = this.inputElement.value;
237
- var activeItem = Search(inputValue, this.liCollections, this.filterType, true);
237
+ var dataSource = this.sortedData;
238
+ var type = this.typeOfData(dataSource).typeof;
239
+ var activeItem = Search(inputValue, this.liCollections, this.filterType, true, dataSource, this.fields, type);
238
240
  var activeElement = activeItem.item;
239
241
  if (!isNullOrUndefined(activeElement)) {
240
242
  var count = this.getIndexByValue(activeElement.getAttribute('data-value')) - 1;
@@ -635,7 +637,7 @@ var ComboBox = /** @class */ (function (_super) {
635
637
  * Adds a new item to the combobox popup list. By default, new item appends to the list as the last item,
636
638
  * but you can insert based on the index parameter.
637
639
  *
638
- * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
640
+ * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
639
641
  * @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
640
642
  * @returns {void}
641
643
 
@@ -646,9 +648,9 @@ var ComboBox = /** @class */ (function (_super) {
646
648
  /**
647
649
  * To filter the data from given data source by using query
648
650
  *
649
- * @param {Object[] | DataManager } dataSource - Set the data source to filter.
650
- * @param {Query} query - Specify the query to filter the data.
651
- * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
651
+ * @param {Object[] | DataManager } dataSource - Set the data source to filter.
652
+ * @param {Query} query - Specify the query to filter the data.
653
+ * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
652
654
  * @returns {void}
653
655
 
654
656
  */
@@ -695,10 +697,12 @@ var ComboBox = /** @class */ (function (_super) {
695
697
  return;
696
698
  }
697
699
  if (this.getModuleName() === 'combobox' && this.inputElement.value.trim() !== '') {
698
- var searchItem = Search(this.inputElement.value, this.liCollections, 'Equal', true);
700
+ var dataSource = this.sortedData;
701
+ var type = this.typeOfData(dataSource).typeof;
702
+ var searchItem = Search(this.inputElement.value, this.liCollections, 'Equal', true, dataSource, this.fields, type);
699
703
  this.selectedLI = searchItem.item;
700
704
  if (isNullOrUndefined(searchItem.index)) {
701
- searchItem.index = Search(this.inputElement.value, this.liCollections, 'StartsWith', true).index;
705
+ searchItem.index = Search(this.inputElement.value, this.liCollections, 'StartsWith', true, dataSource, this.fields, type).index;
702
706
  }
703
707
  this.activeIndex = searchItem.index;
704
708
  if (!isNullOrUndefined(this.selectedLI)) {
@@ -1,6 +1,3 @@
1
- /**
2
- * IncrementalSearch module file
3
- */
4
1
  export declare type SearchType = 'StartsWith' | 'Equal' | 'EndsWith' | 'Contains';
5
2
  /**
6
3
  * Search and focus the list item based on key code matches with list text content
@@ -23,7 +20,9 @@ export declare function incrementalSearch(keyCode: number, items: HTMLElement[],
23
20
  * @param {boolean} ignoreCase - Specifies the case sensitive option for search operation.
24
21
  * @returns {Element | number} Returns the search matched items.
25
22
  */
26
- export declare function Search(inputVal: string, items: HTMLElement[], searchType: SearchType, ignoreCase?: boolean): {
23
+ export declare function Search(inputVal: string, items: HTMLElement[], searchType: SearchType, ignoreCase?: boolean, dataSource?: string[] | number[] | boolean[] | {
24
+ [key: string]: Object;
25
+ }[], fields?: any, type?: string): {
27
26
  [key: string]: Element | number;
28
27
  };
29
28
  export declare function escapeCharRegExp(value: string): string;
@@ -1,6 +1,3 @@
1
- /**
2
- * IncrementalSearch module file
3
- */
4
1
  var queryString = '';
5
2
  var prevString = '';
6
3
  var matches = [];
@@ -73,7 +70,7 @@ export function incrementalSearch(keyCode, items, selectedIndex, ignoreCase, ele
73
70
  * @param {boolean} ignoreCase - Specifies the case sensitive option for search operation.
74
71
  * @returns {Element | number} Returns the search matched items.
75
72
  */
76
- export function Search(inputVal, items, searchType, ignoreCase) {
73
+ export function Search(inputVal, items, searchType, ignoreCase, dataSource, fields, type) {
77
74
  var listItems = items;
78
75
  ignoreCase = ignoreCase !== undefined && ignoreCase !== null ? ignoreCase : true;
79
76
  var itemData = { item: null, index: null };
@@ -81,14 +78,32 @@ export function Search(inputVal, items, searchType, ignoreCase) {
81
78
  var strLength = inputVal.length;
82
79
  var queryStr = ignoreCase ? inputVal.toLocaleLowerCase() : inputVal;
83
80
  queryStr = escapeCharRegExp(queryStr);
84
- for (var i = 0, itemsData = listItems; i < itemsData.length; i++) {
81
+ var _loop_1 = function (i, itemsData) {
85
82
  var item = itemsData[i];
86
- var text = (ignoreCase ? item.textContent.toLocaleLowerCase() : item.textContent).replace(/^\s+|\s+$/g, '');
83
+ var text = void 0;
84
+ var filterValue;
85
+ if (items && dataSource) {
86
+ var checkField_1 = item;
87
+ var fieldValue_1 = fields.text.split('.');
88
+ dataSource.filter(function (data) {
89
+ Array.prototype.slice.call(fieldValue_1).forEach(function (value) {
90
+ 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) {
91
+ filterValue = type === 'object' ? data[value] : data;
92
+ }
93
+ });
94
+ });
95
+ }
96
+ text = dataSource && filterValue ? (ignoreCase ? filterValue.toLocaleLowerCase() : filterValue).replace(/^\s+|\s+$/g, '') : (ignoreCase ? item.textContent.toLocaleLowerCase() : item.textContent).replace(/^\s+|\s+$/g, '');
87
97
  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))) {
88
98
  itemData.item = item;
89
99
  itemData.index = i;
90
- return { item: item, index: i };
100
+ return { value: { item: item, index: i } };
91
101
  }
102
+ };
103
+ for (var i = 0, itemsData = listItems; i < itemsData.length; i++) {
104
+ var state_1 = _loop_1(i, itemsData);
105
+ if (typeof state_1 === "object")
106
+ return state_1.value;
92
107
  }
93
108
  return itemData;
94
109
  }
@@ -637,7 +637,7 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
637
637
  * Adds a new item to the popup list. By default, new item appends to the list as the last item,
638
638
  * but you can insert based on the index parameter.
639
639
  *
640
- * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
640
+ * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
641
641
  * @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
642
642
  * @returns {void}
643
643
 
@@ -1041,7 +1041,7 @@ var DropDownBase = /** @class */ (function (_super) {
1041
1041
  * Adds a new item to the popup list. By default, new item appends to the list as the last item,
1042
1042
  * but you can insert based on the index parameter.
1043
1043
  *
1044
- * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
1044
+ * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
1045
1045
  * @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
1046
1046
  * @returns {void}
1047
1047
 
@@ -453,9 +453,9 @@ export declare class DropDownList extends DropDownBase implements IInput {
453
453
  /**
454
454
  * To filter the data from given data source by using query
455
455
  *
456
- * @param {Object[] | DataManager } dataSource - Set the data source to filter.
457
- * @param {Query} query - Specify the query to filter the data.
458
- * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
456
+ * @param {Object[] | DataManager } dataSource - Set the data source to filter.
457
+ * @param {Query} query - Specify the query to filter the data.
458
+ * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
459
459
  * @returns {void}
460
460
 
461
461
  */
@@ -1022,10 +1022,10 @@ var DropDownList = /** @class */ (function (_super) {
1022
1022
  attributes(this.targetElement(), { 'aria-describedby': this.inputElement.id != '' ? this.inputElement.id : this.element.id });
1023
1023
  this.targetElement().removeAttribute('aria-live');
1024
1024
  }
1025
- if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
1025
+ if (this.isPopupOpen && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-item-focus')[0])) {
1026
1026
  attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-item-focus')[0].id });
1027
1027
  }
1028
- else if (!isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
1028
+ else if (this.isPopupOpen && !isNullOrUndefined(this.ulElement) && !isNullOrUndefined(this.ulElement.getElementsByClassName('e-active')[0])) {
1029
1029
  attributes(this.targetElement(), { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
1030
1030
  }
1031
1031
  };
@@ -1345,9 +1345,9 @@ var DropDownList = /** @class */ (function (_super) {
1345
1345
  /**
1346
1346
  * To filter the data from given data source by using query
1347
1347
  *
1348
- * @param {Object[] | DataManager } dataSource - Set the data source to filter.
1349
- * @param {Query} query - Specify the query to filter the data.
1350
- * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
1348
+ * @param {Object[] | DataManager } dataSource - Set the data source to filter.
1349
+ * @param {Query} query - Specify the query to filter the data.
1350
+ * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
1351
1351
  * @returns {void}
1352
1352
 
1353
1353
  */
@@ -611,9 +611,9 @@ export declare class MultiSelect extends DropDownBase implements IInput {
611
611
  /**
612
612
  * To filter the multiselect data from given data source by using query
613
613
  *
614
- * @param {Object[] | DataManager } dataSource - Set the data source to filter.
615
- * @param {Query} query - Specify the query to filter the data.
616
- * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
614
+ * @param {Object[] | DataManager } dataSource - Set the data source to filter.
615
+ * @param {Query} query - Specify the query to filter the data.
616
+ * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
617
617
  * @returns {void}
618
618
  */
619
619
  filter(dataSource: {
@@ -805,7 +805,7 @@ export declare class MultiSelect extends DropDownBase implements IInput {
805
805
  * Adds a new item to the multiselect popup list. By default, new item appends to the list as the last item,
806
806
  * but you can insert based on the index parameter.
807
807
  *
808
- * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
808
+ * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
809
809
  * @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
810
810
  * @returns {void}
811
811
  */
@@ -637,9 +637,9 @@ var MultiSelect = /** @class */ (function (_super) {
637
637
  /**
638
638
  * To filter the multiselect data from given data source by using query
639
639
  *
640
- * @param {Object[] | DataManager } dataSource - Set the data source to filter.
641
- * @param {Query} query - Specify the query to filter the data.
642
- * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
640
+ * @param {Object[] | DataManager } dataSource - Set the data source to filter.
641
+ * @param {Query} query - Specify the query to filter the data.
642
+ * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
643
643
  * @returns {void}
644
644
  */
645
645
  MultiSelect.prototype.filter = function (dataSource, query, fields) {
@@ -3647,7 +3647,7 @@ var MultiSelect = /** @class */ (function (_super) {
3647
3647
  * Adds a new item to the multiselect popup list. By default, new item appends to the list as the last item,
3648
3648
  * but you can insert based on the index parameter.
3649
3649
  *
3650
- * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
3650
+ * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
3651
3651
  * @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
3652
3652
  * @returns {void}
3653
3653
  */