@syncfusion/ej2-dropdowns 20.3.59 → 20.4.38

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +2 -36
  2. package/dist/ej2-dropdowns.min.js +2 -2
  3. package/dist/ej2-dropdowns.umd.min.js +2 -2
  4. package/dist/ej2-dropdowns.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-dropdowns.es2015.js +527 -336
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +520 -324
  8. package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
  9. package/dist/global/ej2-dropdowns.min.js +2 -2
  10. package/dist/global/ej2-dropdowns.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +11 -11
  13. package/src/auto-complete/auto-complete-model.d.ts +1 -0
  14. package/src/auto-complete/auto-complete.d.ts +4 -3
  15. package/src/auto-complete/auto-complete.js +6 -4
  16. package/src/combo-box/combo-box.d.ts +4 -4
  17. package/src/combo-box/combo-box.js +18 -12
  18. package/src/common/incremental-search.d.ts +3 -4
  19. package/src/common/incremental-search.js +22 -7
  20. package/src/drop-down-base/drop-down-base-model.d.ts +0 -18
  21. package/src/drop-down-base/drop-down-base.d.ts +1 -23
  22. package/src/drop-down-base/drop-down-base.js +43 -38
  23. package/src/drop-down-list/drop-down-list-model.d.ts +18 -0
  24. package/src/drop-down-list/drop-down-list.d.ts +25 -3
  25. package/src/drop-down-list/drop-down-list.js +100 -46
  26. package/src/drop-down-tree/drop-down-tree-model.d.ts +15 -1
  27. package/src/drop-down-tree/drop-down-tree.d.ts +13 -1
  28. package/src/drop-down-tree/drop-down-tree.js +22 -5
  29. package/src/list-box/list-box-model.d.ts +18 -0
  30. package/src/list-box/list-box.d.ts +22 -0
  31. package/src/list-box/list-box.js +27 -14
  32. package/src/mention/mention-model.d.ts +2 -2
  33. package/src/mention/mention.d.ts +4 -1
  34. package/src/mention/mention.js +66 -27
  35. package/src/multi-select/checkbox-selection.js +10 -8
  36. package/src/multi-select/multi-select.d.ts +4 -4
  37. package/src/multi-select/multi-select.js +207 -160
  38. package/styles/bootstrap5-dark.css +2 -2
  39. package/styles/bootstrap5.css +2 -2
  40. package/styles/drop-down-base/_bootstrap-dark-definition.scss +1 -0
  41. package/styles/drop-down-base/_bootstrap-definition.scss +1 -0
  42. package/styles/drop-down-base/_bootstrap4-definition.scss +1 -0
  43. package/styles/drop-down-base/_bootstrap5-definition.scss +1 -0
  44. package/styles/drop-down-base/_fabric-dark-definition.scss +1 -0
  45. package/styles/drop-down-base/_fabric-definition.scss +1 -0
  46. package/styles/drop-down-base/_fluent-definition.scss +1 -0
  47. package/styles/drop-down-base/_fusionnew-definition.scss +1 -0
  48. package/styles/drop-down-base/_highcontrast-definition.scss +1 -0
  49. package/styles/drop-down-base/_highcontrast-light-definition.scss +1 -0
  50. package/styles/drop-down-base/_layout.scss +1 -1
  51. package/styles/drop-down-base/_material-dark-definition.scss +1 -0
  52. package/styles/drop-down-base/_material-definition.scss +1 -0
  53. package/styles/drop-down-base/_material3-definition.scss +1 -0
  54. package/styles/drop-down-base/_tailwind-definition.scss +1 -0
  55. package/styles/drop-down-base/material-dark.css +1 -1
  56. package/styles/drop-down-tree/_layout.scss +3 -3
  57. package/styles/drop-down-tree/bootstrap5-dark.css +2 -2
  58. package/styles/drop-down-tree/bootstrap5.css +2 -2
  59. package/styles/material-dark.css +1 -1
  60. package/.eslintrc.json +0 -244
  61. package/tslint.json +0 -111
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 20.3.59
3
+ * version : 20.4.38
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@18.58.2",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-pwXw+I7D7g8FQSCdAPVJf3V9W+h0qIXytD3FKQHi7qQYrxdRhDIHH/CGEHQ7sxYgpNKJElYQjlpMrKoPZLIo9g==",
5
+ "_integrity": "sha512-vD4WNwAbimAx0XnFNgwoknAKaacI0KCvCj3iJZxia/Z5DIsH9/2PiwIfquOgHBPaq+Nu0NEa0XDk1rNyce9EZg==",
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-release/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-18.58.2.tgz",
37
+ "_shasum": "857b24b55c28406de45890a415c2b0e5c094e681",
38
38
  "_spec": "@syncfusion/ej2-dropdowns@*",
39
39
  "_where": "/jenkins/workspace/ease-automation_release_19.1.0.1/packages/included",
40
40
  "author": {
@@ -42,12 +42,12 @@
42
42
  },
43
43
  "bundleDependencies": false,
44
44
  "dependencies": {
45
- "@syncfusion/ej2-base": "~20.3.56",
46
- "@syncfusion/ej2-data": "~20.3.56",
47
- "@syncfusion/ej2-inputs": "~20.3.57",
48
- "@syncfusion/ej2-lists": "~20.3.56",
49
- "@syncfusion/ej2-navigations": "~20.3.58",
50
- "@syncfusion/ej2-popups": "~20.3.59"
45
+ "@syncfusion/ej2-base": "~20.4.38",
46
+ "@syncfusion/ej2-data": "~20.4.38",
47
+ "@syncfusion/ej2-inputs": "~20.4.38",
48
+ "@syncfusion/ej2-lists": "~20.4.38",
49
+ "@syncfusion/ej2-navigations": "~20.4.38",
50
+ "@syncfusion/ej2-popups": "~20.4.38"
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.4.38",
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
  */
@@ -226,7 +226,7 @@ var ComboBox = /** @class */ (function (_super) {
226
226
  };
227
227
  ComboBox.prototype.getFocusElement = function () {
228
228
  var dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
229
- var selected = this.list.querySelector('.' + dropDownListClasses.selected);
229
+ var selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : this.list;
230
230
  var isSelected = dataItem.text === this.inputElement.value && !isNullOrUndefined(selected);
231
231
  if (isSelected) {
232
232
  return selected;
@@ -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;
@@ -384,9 +386,11 @@ var ComboBox = /** @class */ (function (_super) {
384
386
  }
385
387
  else if (this.inputElement.value === '') {
386
388
  this.activeIndex = null;
387
- this.list.scrollTop = 0;
388
- var focusItem = this.list.querySelector('.' + dropDownListClasses.li);
389
- this.setHoverList(focusItem);
389
+ if (!isNullOrUndefined(this.list)) {
390
+ this.list.scrollTop = 0;
391
+ var focusItem = this.list.querySelector('.' + dropDownListClasses.li);
392
+ this.setHoverList(focusItem);
393
+ }
390
394
  }
391
395
  else {
392
396
  this.activeIndex = null;
@@ -635,7 +639,7 @@ var ComboBox = /** @class */ (function (_super) {
635
639
  * Adds a new item to the combobox popup list. By default, new item appends to the list as the last item,
636
640
  * but you can insert based on the index parameter.
637
641
  *
638
- * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
642
+ * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
639
643
  * @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
640
644
  * @returns {void}
641
645
 
@@ -646,9 +650,9 @@ var ComboBox = /** @class */ (function (_super) {
646
650
  /**
647
651
  * To filter the data from given data source by using query
648
652
  *
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.
653
+ * @param {Object[] | DataManager } dataSource - Set the data source to filter.
654
+ * @param {Query} query - Specify the query to filter the data.
655
+ * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
652
656
  * @returns {void}
653
657
 
654
658
  */
@@ -685,7 +689,7 @@ var ComboBox = /** @class */ (function (_super) {
685
689
  this.removeFillSelection();
686
690
  }
687
691
  var dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
688
- var selected = this.list.querySelector('.' + dropDownListClasses.selected);
692
+ var selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : null;
689
693
  if (this.inputElement && dataItem.text === this.inputElement.value && !isNullOrUndefined(selected)) {
690
694
  if (this.isSelected) {
691
695
  this.onChangeEvent(e);
@@ -695,10 +699,12 @@ var ComboBox = /** @class */ (function (_super) {
695
699
  return;
696
700
  }
697
701
  if (this.getModuleName() === 'combobox' && this.inputElement.value.trim() !== '') {
698
- var searchItem = Search(this.inputElement.value, this.liCollections, 'Equal', true);
702
+ var dataSource = this.sortedData;
703
+ var type = this.typeOfData(dataSource).typeof;
704
+ var searchItem = Search(this.inputElement.value, this.liCollections, 'Equal', true, dataSource, this.fields, type);
699
705
  this.selectedLI = searchItem.item;
700
706
  if (isNullOrUndefined(searchItem.index)) {
701
- searchItem.index = Search(this.inputElement.value, this.liCollections, 'StartsWith', true).index;
707
+ searchItem.index = Search(this.inputElement.value, this.liCollections, 'StartsWith', true, dataSource, this.fields, type).index;
702
708
  }
703
709
  this.activeIndex = searchItem.index;
704
710
  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
  }
@@ -74,16 +74,6 @@ export interface DropDownBaseModel extends ComponentModel{
74
74
  */
75
75
  fields?: FieldSettingsModel;
76
76
 
77
- /**
78
- * Enable or disable persisting component's state between page reloads.
79
- * If enabled, following list of states will be persisted.
80
- * 1. value
81
- *
82
- * @default false
83
-
84
- */
85
- enablePersistence?: boolean;
86
-
87
77
  /**
88
78
  * Accepts the template design and assigns it to each list item present in the popup.
89
79
  * We have built-in `template engine`
@@ -135,14 +125,6 @@ export interface DropDownBaseModel extends ComponentModel{
135
125
  */
136
126
  sortOrder?: SortOrder;
137
127
 
138
- /**
139
- * Specifies a value that indicates whether the component is enabled or not.
140
- *
141
- * @default true
142
-
143
- */
144
- enabled?: boolean;
145
-
146
128
  /**
147
129
  * Accepts the list items either through local or remote service and binds it to the component.
148
130
  * It can be an array of JSON Objects or an instance of
@@ -239,15 +239,6 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
239
239
 
240
240
  */
241
241
  fields: FieldSettingsModel;
242
- /**
243
- * Enable or disable persisting component's state between page reloads.
244
- * If enabled, following list of states will be persisted.
245
- * 1. value
246
- *
247
- * @default false
248
-
249
- */
250
- enablePersistence: boolean;
251
242
  /**
252
243
  * Accepts the template design and assigns it to each list item present in the popup.
253
244
  * We have built-in `template engine`
@@ -294,13 +285,6 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
294
285
 
295
286
  */
296
287
  sortOrder: SortOrder;
297
- /**
298
- * Specifies a value that indicates whether the component is enabled or not.
299
- *
300
- * @default true
301
-
302
- */
303
- enabled: boolean;
304
288
  /**
305
289
  * Accepts the list items either through local or remote service and binds it to the component.
306
290
  * It can be an array of JSON Objects or an instance of
@@ -467,12 +451,6 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
467
451
  * @returns {string} Returns the persisted data of the component.
468
452
  */
469
453
  protected getPersistData(): string;
470
- /**
471
- * Sets the enabled state to DropDownBase.
472
- *
473
- * @returns {void}
474
- */
475
- protected setEnabled(): void;
476
454
  /**
477
455
  * Sets the enabled state to DropDownBase.
478
456
  *
@@ -637,7 +615,7 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
637
615
  * Adds a new item to the popup list. By default, new item appends to the list as the last item,
638
616
  * but you can insert based on the index parameter.
639
617
  *
640
- * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
618
+ * @param { Object[] } items - Specifies an array of JSON data or a JSON data.
641
619
  * @param { number } itemIndex - Specifies the index to place the newly added item in the popup list.
642
620
  * @returns {void}
643
621
 
@@ -273,7 +273,9 @@ var DropDownBase = /** @class */ (function (_super) {
273
273
  liElem.setAttribute('role', 'option');
274
274
  }
275
275
  else {
276
- ele.innerHTML = content;
276
+ if (!isNullOrUndefined(ele)) {
277
+ ele.innerHTML = content;
278
+ }
277
279
  }
278
280
  }
279
281
  };
@@ -304,14 +306,16 @@ var DropDownBase = /** @class */ (function (_super) {
304
306
  * @returns {void}
305
307
  */
306
308
  DropDownBase.prototype.setEnableRtl = function () {
307
- if (this.list) {
308
- this.enableRtlElements.push(this.list);
309
- }
310
- if (this.enableRtl) {
311
- addClass(this.enableRtlElements, dropDownBaseClasses.rtl);
312
- }
313
- else {
314
- removeClass(this.enableRtlElements, dropDownBaseClasses.rtl);
309
+ if (!isNullOrUndefined(this.enableRtlElements)) {
310
+ if (this.list) {
311
+ this.enableRtlElements.push(this.list);
312
+ }
313
+ if (this.enableRtl) {
314
+ addClass(this.enableRtlElements, dropDownBaseClasses.rtl);
315
+ }
316
+ else {
317
+ removeClass(this.enableRtlElements, dropDownBaseClasses.rtl);
318
+ }
315
319
  }
316
320
  };
317
321
  /**
@@ -349,14 +353,6 @@ var DropDownBase = /** @class */ (function (_super) {
349
353
  DropDownBase.prototype.getPersistData = function () {
350
354
  return this.addOnPersist([]);
351
355
  };
352
- /**
353
- * Sets the enabled state to DropDownBase.
354
- *
355
- * @returns {void}
356
- */
357
- DropDownBase.prototype.setEnabled = function () {
358
- this.element.setAttribute('aria-disabled', (this.enabled) ? 'false' : 'true');
359
- };
360
356
  /**
361
357
  * Sets the enabled state to DropDownBase.
362
358
  *
@@ -578,7 +574,9 @@ var DropDownBase = /** @class */ (function (_super) {
578
574
  this.liCollections = [];
579
575
  this.trigger('actionFailure', e);
580
576
  this.l10nUpdate(true);
581
- addClass([this.list], dropDownBaseClasses.noData);
577
+ if (!isNullOrUndefined(this.list)) {
578
+ addClass([this.list], dropDownBaseClasses.noData);
579
+ }
582
580
  };
583
581
  /* eslint-disable @typescript-eslint/no-unused-vars */
584
582
  DropDownBase.prototype.onActionComplete = function (ulElement, list, e) {
@@ -708,10 +706,12 @@ var DropDownBase = /** @class */ (function (_super) {
708
706
  if (!isNullOrUndefined(this.list) && !this.list.classList.contains(dropDownBaseClasses.noData)) {
709
707
  if (isNullOrUndefined(this.fixedHeaderElement)) {
710
708
  this.fixedHeaderElement = this.createElement('div', { className: dropDownBaseClasses.fixedHead });
711
- if (!this.list.querySelector('li').classList.contains(dropDownBaseClasses.group)) {
709
+ if (!isNullOrUndefined(this.list) && !this.list.querySelector('li').classList.contains(dropDownBaseClasses.group)) {
712
710
  this.fixedHeaderElement.style.display = 'none';
713
711
  }
714
- prepend([this.fixedHeaderElement], this.list);
712
+ if (!isNullOrUndefined(this.fixedHeaderElement) && !isNullOrUndefined(this.list)) {
713
+ prepend([this.fixedHeaderElement], this.list);
714
+ }
715
715
  this.setFixedHeader();
716
716
  }
717
717
  if (!isNullOrUndefined(this.fixedHeaderElement) && this.fixedHeaderElement.style.zIndex === '0') {
@@ -802,7 +802,9 @@ var DropDownBase = /** @class */ (function (_super) {
802
802
  return item;
803
803
  };
804
804
  DropDownBase.prototype.setFixedHeader = function () {
805
- this.list.parentElement.style.display = 'block';
805
+ if (!isNullOrUndefined(this.list)) {
806
+ this.list.parentElement.style.display = 'block';
807
+ }
806
808
  var borderWidth = 0;
807
809
  if (this.list && this.list.parentElement) {
808
810
  borderWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-width'), 10);
@@ -817,8 +819,10 @@ var DropDownBase = /** @class */ (function (_super) {
817
819
  borderWidth = (borderTopWidth + borderBottomWidth + borderLeftWidth + borderRightWidth);
818
820
  }
819
821
  }
820
- var liWidth = this.getValidLi().offsetWidth - borderWidth;
821
- this.fixedHeaderElement.style.width = liWidth.toString() + 'px';
822
+ if (!isNullOrUndefined(this.liCollections)) {
823
+ var liWidth = this.getValidLi().offsetWidth - borderWidth;
824
+ this.fixedHeaderElement.style.width = liWidth.toString() + 'px';
825
+ }
822
826
  setStyleAttribute(this.fixedHeaderElement, { zIndex: 10 });
823
827
  var firstLi = this.ulElement.querySelector('.' + dropDownBaseClasses.group + ':not(.e-hide-listitem)');
824
828
  this.fixedHeaderElement.innerHTML = firstLi.innerHTML;
@@ -962,9 +966,6 @@ var DropDownBase = /** @class */ (function (_super) {
962
966
  case 'enableRtl':
963
967
  this.setEnableRtl();
964
968
  break;
965
- case 'enabled':
966
- this.setEnabled();
967
- break;
968
969
  case 'groupTemplate':
969
970
  this.renderGroupTemplate(this.list);
970
971
  if (this.ulElement && this.fixedHeaderElement) {
@@ -1013,7 +1014,6 @@ var DropDownBase = /** @class */ (function (_super) {
1013
1014
  wrapperElement.appendChild(this.list);
1014
1015
  }
1015
1016
  this.setEnableRtl();
1016
- this.setEnabled();
1017
1017
  if (!isEmptyData) {
1018
1018
  this.initialize(e);
1019
1019
  }
@@ -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
 
@@ -1105,11 +1105,17 @@ var DropDownBase = /** @class */ (function (_super) {
1105
1105
  this.trigger('beforeItemRender', { element: li, item: item });
1106
1106
  }
1107
1107
  if (itemsCount === 0 && isNullOrUndefined(this.list.querySelector('ul'))) {
1108
- this.list.innerHTML = '';
1109
- this.list.classList.remove(dropDownBaseClasses.noData);
1110
- this.list.appendChild(this.ulElement);
1108
+ if (!isNullOrUndefined(this.list)) {
1109
+ this.list.innerHTML = '';
1110
+ this.list.classList.remove(dropDownBaseClasses.noData);
1111
+ if (!isNullOrUndefined(this.ulElement)) {
1112
+ this.list.appendChild(this.ulElement);
1113
+ }
1114
+ }
1111
1115
  this.liCollections = liCollections;
1112
- append(liCollections, this.ulElement);
1116
+ if (!isNullOrUndefined(liCollections) && !isNullOrUndefined(this.ulElement)) {
1117
+ append(liCollections, this.ulElement);
1118
+ }
1113
1119
  this.updateAddItemList(this.list, itemsCount);
1114
1120
  }
1115
1121
  else {
@@ -1230,14 +1236,16 @@ var DropDownBase = /** @class */ (function (_super) {
1230
1236
  }
1231
1237
  detach(this.list);
1232
1238
  }
1239
+ this.liCollections = null;
1240
+ this.ulElement = null;
1241
+ this.list = null;
1242
+ this.enableRtlElements = null;
1243
+ this.rippleFun = null;
1233
1244
  _super.prototype.destroy.call(this);
1234
1245
  };
1235
1246
  __decorate([
1236
1247
  Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)
1237
1248
  ], DropDownBase.prototype, "fields", void 0);
1238
- __decorate([
1239
- Property(false)
1240
- ], DropDownBase.prototype, "enablePersistence", void 0);
1241
1249
  __decorate([
1242
1250
  Property(null)
1243
1251
  ], DropDownBase.prototype, "itemTemplate", void 0);
@@ -1253,9 +1261,6 @@ var DropDownBase = /** @class */ (function (_super) {
1253
1261
  __decorate([
1254
1262
  Property('None')
1255
1263
  ], DropDownBase.prototype, "sortOrder", void 0);
1256
- __decorate([
1257
- Property(true)
1258
- ], DropDownBase.prototype, "enabled", void 0);
1259
1264
  __decorate([
1260
1265
  Property([])
1261
1266
  ], DropDownBase.prototype, "dataSource", void 0);
@@ -23,6 +23,24 @@ export interface DropDownListModel extends DropDownBaseModel{
23
23
  */
24
24
  width?: string | number;
25
25
 
26
+ /**
27
+ * Specifies a value that indicates whether the component is enabled or not.
28
+ *
29
+ * @default true
30
+
31
+ */
32
+ enabled?: boolean;
33
+
34
+ /**
35
+ * Enable or disable persisting component's state between page reloads.
36
+ * If enabled, following list of states will be persisted.
37
+ * 1. value
38
+ *
39
+ * @default false
40
+
41
+ */
42
+ enablePersistence?: boolean;
43
+
26
44
  /**
27
45
  * Specifies the height of the popup list.
28
46
  * > For more details about the popup configuration refer to
@@ -119,6 +119,22 @@ export declare class DropDownList extends DropDownBase implements IInput {
119
119
  * @aspType string
120
120
  */
121
121
  width: string | number;
122
+ /**
123
+ * Specifies a value that indicates whether the component is enabled or not.
124
+ *
125
+ * @default true
126
+
127
+ */
128
+ enabled: boolean;
129
+ /**
130
+ * Enable or disable persisting component's state between page reloads.
131
+ * If enabled, following list of states will be persisted.
132
+ * 1. value
133
+ *
134
+ * @default false
135
+
136
+ */
137
+ enablePersistence: boolean;
122
138
  /**
123
139
  * Specifies the height of the popup list.
124
140
  * > For more details about the popup configuration refer to
@@ -453,9 +469,9 @@ export declare class DropDownList extends DropDownBase implements IInput {
453
469
  /**
454
470
  * To filter the data from given data source by using query
455
471
  *
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.
472
+ * @param {Object[] | DataManager } dataSource - Set the data source to filter.
473
+ * @param {Query} query - Specify the query to filter the data.
474
+ * @param {FieldSettingsModel} fields - Specify the fields to map the column in the data table.
459
475
  * @returns {void}
460
476
 
461
477
  */
@@ -511,6 +527,12 @@ export declare class DropDownList extends DropDownBase implements IInput {
511
527
  render(): void;
512
528
  private setFooterTemplate;
513
529
  private setHeaderTemplate;
530
+ /**
531
+ * Sets the enabled state to DropDownBase.
532
+ *
533
+ * @returns {void}
534
+ */
535
+ protected setEnabled(): void;
514
536
  protected setOldText(text: string): void;
515
537
  protected setOldValue(value: string | number | boolean): void;
516
538
  protected refreshPopup(): void;