@syncfusion/ej2-dropdowns 24.2.8 → 25.1.35

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 (110) hide show
  1. package/CHANGELOG.md +23 -150
  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 +2049 -528
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +2072 -533
  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 +13 -13
  13. package/src/auto-complete/auto-complete-model.d.ts +3 -1
  14. package/src/auto-complete/auto-complete.d.ts +2 -0
  15. package/src/auto-complete/auto-complete.js +51 -6
  16. package/src/combo-box/combo-box-model.d.ts +11 -2
  17. package/src/combo-box/combo-box.d.ts +10 -2
  18. package/src/combo-box/combo-box.js +75 -16
  19. package/src/common/interface.d.ts +32 -0
  20. package/src/common/virtual-scroll.d.ts +1 -3
  21. package/src/common/virtual-scroll.js +157 -27
  22. package/src/drop-down-base/drop-down-base-model.d.ts +1 -1
  23. package/src/drop-down-base/drop-down-base.d.ts +65 -5
  24. package/src/drop-down-base/drop-down-base.js +242 -25
  25. package/src/drop-down-list/drop-down-list-model.d.ts +10 -1
  26. package/src/drop-down-list/drop-down-list.d.ts +16 -51
  27. package/src/drop-down-list/drop-down-list.js +180 -217
  28. package/src/drop-down-tree/drop-down-tree-model.d.ts +16 -12
  29. package/src/drop-down-tree/drop-down-tree.d.ts +13 -3
  30. package/src/drop-down-tree/drop-down-tree.js +55 -49
  31. package/src/global.js +1 -1
  32. package/src/list-box/list-box.js +9 -4
  33. package/src/mention/mention.d.ts +2 -0
  34. package/src/mention/mention.js +21 -9
  35. package/src/multi-select/checkbox-selection.js +8 -2
  36. package/src/multi-select/float-label.d.ts +5 -5
  37. package/src/multi-select/index.d.ts +1 -0
  38. package/src/multi-select/index.js +1 -0
  39. package/src/multi-select/interface.d.ts +1 -0
  40. package/src/multi-select/multi-select-model.d.ts +17 -2
  41. package/src/multi-select/multi-select.d.ts +34 -4
  42. package/src/multi-select/multi-select.js +1271 -173
  43. package/styles/auto-complete/_bds-definition.scss +2 -0
  44. package/styles/bootstrap-dark.css +8 -2
  45. package/styles/bootstrap.css +8 -2
  46. package/styles/bootstrap4.css +3 -2
  47. package/styles/bootstrap5-dark.css +3 -2
  48. package/styles/bootstrap5.css +3 -2
  49. package/styles/combo-box/_bds-definition.scss +2 -0
  50. package/styles/drop-down-base/_bds-definition.scss +134 -0
  51. package/styles/drop-down-list/_bds-definition.scss +134 -0
  52. package/styles/drop-down-list/_layout.scss +1 -1
  53. package/styles/drop-down-list/bootstrap-dark.css +1 -1
  54. package/styles/drop-down-list/bootstrap.css +1 -1
  55. package/styles/drop-down-list/bootstrap4.css +1 -1
  56. package/styles/drop-down-list/bootstrap5-dark.css +1 -1
  57. package/styles/drop-down-list/bootstrap5.css +1 -1
  58. package/styles/drop-down-list/fabric-dark.css +1 -1
  59. package/styles/drop-down-list/fabric.css +1 -1
  60. package/styles/drop-down-list/fluent-dark.css +1 -1
  61. package/styles/drop-down-list/fluent.css +1 -1
  62. package/styles/drop-down-list/highcontrast-light.css +1 -1
  63. package/styles/drop-down-list/highcontrast.css +1 -1
  64. package/styles/drop-down-list/icons/_bds.scss +14 -0
  65. package/styles/drop-down-list/material-dark.css +1 -1
  66. package/styles/drop-down-list/material.css +1 -1
  67. package/styles/drop-down-list/material3-dark.css +1 -1
  68. package/styles/drop-down-list/material3.css +1 -1
  69. package/styles/drop-down-list/tailwind-dark.css +1 -1
  70. package/styles/drop-down-list/tailwind.css +1 -1
  71. package/styles/drop-down-tree/_bds-definition.scss +61 -0
  72. package/styles/drop-down-tree/icons/_bds.scss +11 -0
  73. package/styles/fabric-dark.css +4 -2
  74. package/styles/fabric.css +4 -2
  75. package/styles/fluent-dark.css +8 -2
  76. package/styles/fluent.css +8 -2
  77. package/styles/highcontrast-light.css +4 -2
  78. package/styles/highcontrast.css +4 -2
  79. package/styles/list-box/_bds-definition.scss +136 -0
  80. package/styles/list-box/icons/_bds.scss +25 -0
  81. package/styles/material-dark.css +3 -2
  82. package/styles/material.css +3 -2
  83. package/styles/material3-dark.css +3 -2
  84. package/styles/material3.css +3 -2
  85. package/styles/mention/_bds-definition.scss +1 -0
  86. package/styles/multi-select/_bds-definition.scss +235 -0
  87. package/styles/multi-select/_bootstrap-dark-definition.scss +4 -0
  88. package/styles/multi-select/_bootstrap-definition.scss +4 -0
  89. package/styles/multi-select/_fluent-definition.scss +5 -0
  90. package/styles/multi-select/_layout.scss +8 -1
  91. package/styles/multi-select/bootstrap-dark.css +7 -1
  92. package/styles/multi-select/bootstrap.css +7 -1
  93. package/styles/multi-select/bootstrap4.css +2 -1
  94. package/styles/multi-select/bootstrap5-dark.css +2 -1
  95. package/styles/multi-select/bootstrap5.css +2 -1
  96. package/styles/multi-select/fabric-dark.css +3 -1
  97. package/styles/multi-select/fabric.css +3 -1
  98. package/styles/multi-select/fluent-dark.css +7 -1
  99. package/styles/multi-select/fluent.css +7 -1
  100. package/styles/multi-select/highcontrast-light.css +3 -1
  101. package/styles/multi-select/highcontrast.css +3 -1
  102. package/styles/multi-select/icons/_bds.scss +26 -0
  103. package/styles/multi-select/material-dark.css +2 -1
  104. package/styles/multi-select/material.css +2 -1
  105. package/styles/multi-select/material3-dark.css +2 -1
  106. package/styles/multi-select/material3.css +2 -1
  107. package/styles/multi-select/tailwind-dark.css +2 -1
  108. package/styles/multi-select/tailwind.css +2 -1
  109. package/styles/tailwind-dark.css +3 -2
  110. package/styles/tailwind.css +3 -2
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 24.2.8
3
+ * version : 25.1.35
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. 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@24.2.7",
3
+ "_id": "@syncfusion/ej2-dropdowns@18.66.23",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-cuO9ubsNievpbwKBvHyByYZ65QLkYTPCd+sectppRBcHHO92eiRpKI83AnRbcgb1NvLgni2Um1f5gsf5a6uK+Q==",
5
+ "_integrity": "sha512-ATUs2n/OfHPBOZTOz019wmibQIF/WpeSgQUQ8e078Lj1tWx+q7fJmH1wh0/kTbBhsmi1bQLbpxetN60PDoHsxQ==",
6
6
  "_location": "/@syncfusion/ej2-dropdowns",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -34,22 +34,22 @@
34
34
  "/@syncfusion/ej2-spreadsheet",
35
35
  "/@syncfusion/ej2-vue-dropdowns"
36
36
  ],
37
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-24.2.7.tgz",
38
- "_shasum": "06363d306cbb179c9c3cf51f38d08098267f2b0c",
37
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-release/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-18.66.23.tgz",
38
+ "_shasum": "c913d1cfaa53ad097cd8da189c693a8bfdde8d27",
39
39
  "_spec": "@syncfusion/ej2-dropdowns@*",
40
- "_where": "/jenkins/workspace/elease-automation_release_24.1.1/packages/included",
40
+ "_where": "/jenkins/workspace/elease-automation_release_25.1.1/packages/included",
41
41
  "author": {
42
42
  "name": "Syncfusion Inc."
43
43
  },
44
44
  "bundleDependencies": false,
45
45
  "dependencies": {
46
- "@syncfusion/ej2-base": "~24.2.7",
47
- "@syncfusion/ej2-data": "~24.2.3",
48
- "@syncfusion/ej2-inputs": "~24.2.7",
49
- "@syncfusion/ej2-lists": "~24.2.8",
50
- "@syncfusion/ej2-navigations": "~24.2.8",
51
- "@syncfusion/ej2-notifications": "~24.2.4",
52
- "@syncfusion/ej2-popups": "~24.2.8"
46
+ "@syncfusion/ej2-base": "~25.1.35",
47
+ "@syncfusion/ej2-data": "~25.1.35",
48
+ "@syncfusion/ej2-inputs": "~25.1.35",
49
+ "@syncfusion/ej2-lists": "~25.1.35",
50
+ "@syncfusion/ej2-navigations": "~25.1.35",
51
+ "@syncfusion/ej2-notifications": "~25.1.35",
52
+ "@syncfusion/ej2-popups": "~25.1.35"
53
53
  },
54
54
  "deprecated": false,
55
55
  "description": "Essential JS 2 DropDown Components",
@@ -74,7 +74,7 @@
74
74
  "module": "./index.js",
75
75
  "name": "@syncfusion/ej2-dropdowns",
76
76
  "typings": "index.d.ts",
77
- "version": "24.2.8",
77
+ "version": "25.1.35",
78
78
  "sideEffects": false,
79
79
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
80
80
  }
@@ -1,4 +1,4 @@
1
- import { Property, EventHandler, KeyboardEventArgs, isNullOrUndefined, detach } from '@syncfusion/ej2-base';import { Event, EmitType, Complex } from '@syncfusion/ej2-base';import { removeClass, attributes, NotifyPropertyChanges } from '@syncfusion/ej2-base';import { dropDownListClasses } from '../drop-down-list/drop-down-list';import { ComboBox } from '../combo-box/combo-box';import { highlightSearch, revertHighlightSearch } from '../common/highlight-search';import { Search } from '../common/incremental-search';import { FieldSettingsModel } from '../drop-down-base/drop-down-base-model';import { FieldSettings, FilteringEventArgs, FilterType, ResultData } from '../drop-down-base/drop-down-base';import { FloatLabelType, Input } from '@syncfusion/ej2-inputs';import { DataManager, Predicate, Query } from '@syncfusion/ej2-data';
1
+ import { Property, EventHandler, KeyboardEventArgs, isNullOrUndefined, detach, getValue } from '@syncfusion/ej2-base';import { Event, EmitType, Complex } from '@syncfusion/ej2-base';import { removeClass, attributes, NotifyPropertyChanges } from '@syncfusion/ej2-base';import { dropDownListClasses } from '../drop-down-list/drop-down-list';import { ComboBox } from '../combo-box/combo-box';import { highlightSearch, revertHighlightSearch } from '../common/highlight-search';import { Search } from '../common/incremental-search';import { FieldSettingsModel } from '../drop-down-base/drop-down-base-model';import { FieldSettings, FilteringEventArgs, FilterType, ResultData } from '../drop-down-base/drop-down-base';import { FloatLabelType, Input } from '@syncfusion/ej2-inputs';import { DataManager, Predicate, Query } from '@syncfusion/ej2-data';
2
2
  import {ComboBoxModel} from "../combo-box/combo-box-model";
3
3
 
4
4
  /**
@@ -135,6 +135,7 @@ export interface AutoCompleteModel extends ComboBoxModel{
135
135
  * Not applicable to this component.
136
136
  *
137
137
  * @default null
138
+ * @aspType double
138
139
  * @private
139
140
 
140
141
  */
@@ -190,6 +191,7 @@ export interface AutoCompleteModel extends ComboBoxModel{
190
191
  * Not applicable to this component.
191
192
  *
192
193
  * @default null
194
+ * @aspType string
193
195
  * @private
194
196
 
195
197
  */
@@ -142,6 +142,7 @@ export declare class AutoComplete extends ComboBox {
142
142
  * Not applicable to this component.
143
143
  *
144
144
  * @default null
145
+ * @aspType double
145
146
  * @private
146
147
 
147
148
  */
@@ -192,6 +193,7 @@ export declare class AutoComplete extends ComboBox {
192
193
  * Not applicable to this component.
193
194
  *
194
195
  * @default null
196
+ * @aspType string
195
197
  * @private
196
198
 
197
199
  */
@@ -19,7 +19,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
19
19
  };
20
20
  // eslint-disable-next-line @typescript-eslint/triple-slash-reference
21
21
  /// <reference path='../combo-box/combo-box-model.d.ts'/>
22
- import { Property, EventHandler, isNullOrUndefined, detach } from '@syncfusion/ej2-base';
22
+ import { Property, EventHandler, isNullOrUndefined, detach, getValue } from '@syncfusion/ej2-base';
23
23
  import { Event, Complex } from '@syncfusion/ej2-base';
24
24
  import { removeClass, NotifyPropertyChanges } from '@syncfusion/ej2-base';
25
25
  import { dropDownListClasses } from '../drop-down-list/drop-down-list';
@@ -74,8 +74,9 @@ var AutoComplete = /** @class */ (function (_super) {
74
74
  };
75
75
  AutoComplete.prototype.getQuery = function (query) {
76
76
  var filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
77
- var filterType = (this.queryString === '' && !isNullOrUndefined(this.value)) ? 'equal' : this.filterType;
78
- var queryString = (this.queryString === '' && !isNullOrUndefined(this.value)) ? this.value : this.queryString;
77
+ var value = this.allowObjectBinding && !isNullOrUndefined(this.value) ? getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
78
+ var filterType = (this.queryString === '' && !isNullOrUndefined(value)) ? 'equal' : this.filterType;
79
+ var queryString = (this.queryString === '' && !isNullOrUndefined(value)) ? value : this.queryString;
79
80
  if (this.isFiltered) {
80
81
  return filterQuery;
81
82
  }
@@ -101,9 +102,48 @@ var AutoComplete = /** @class */ (function (_super) {
101
102
  filterQuery.take(this.suggestionCount);
102
103
  }
103
104
  if (this.enableVirtualization && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && this.virtualGroupDataSource))) {
105
+ var queryTakeValue = 0;
106
+ var querySkipValue = 0;
107
+ if (this.query && this.query.queries.length > 0) {
108
+ for (var queryElements = 0; queryElements < this.query.queries.length; queryElements++) {
109
+ if (this.query.queries[queryElements].fn === 'onSkip') {
110
+ querySkipValue = this.query.queries[queryElements].e.nos;
111
+ }
112
+ if (this.query.queries[queryElements].fn === 'onTake') {
113
+ queryTakeValue = takeValue <= this.query.queries[queryElements].e.nos ? this.query.queries[queryElements].e.nos : takeValue;
114
+ }
115
+ }
116
+ }
117
+ var skipExists = false;
118
+ var takeExists = false;
119
+ if (filterQuery && filterQuery.queries.length > 0) {
120
+ for (var queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
121
+ if (filterQuery.queries[queryElements].fn === 'onSkip') {
122
+ skipExists = true;
123
+ }
124
+ if (filterQuery.queries[queryElements].fn === 'onTake') {
125
+ takeExists = true;
126
+ filterQuery.queries[queryElements].e.nos = filterQuery.queries[queryElements].e.nos <= queryTakeValue ? queryTakeValue : filterQuery.queries[queryElements].e.nos;
127
+ }
128
+ }
129
+ }
104
130
  var takeValue = this.getTakeValue();
105
- filterQuery.skip(this.virtualItemStartIndex);
106
- filterQuery.take(takeValue);
131
+ if (!skipExists) {
132
+ if (querySkipValue > 0 && this.virtualItemStartIndex <= querySkipValue) {
133
+ filterQuery.skip(querySkipValue);
134
+ }
135
+ else {
136
+ filterQuery.skip(this.virtualItemStartIndex);
137
+ }
138
+ }
139
+ if (!takeExists) {
140
+ if (queryTakeValue > 0 && takeValue <= queryTakeValue) {
141
+ filterQuery.take(queryTakeValue);
142
+ }
143
+ else {
144
+ filterQuery.take(takeValue);
145
+ }
146
+ }
107
147
  filterQuery.requiresCount();
108
148
  }
109
149
  return filterQuery;
@@ -112,6 +152,7 @@ var AutoComplete = /** @class */ (function (_super) {
112
152
  var _this_1 = this;
113
153
  this.isTyped = true;
114
154
  this.isDataFetched = this.isSelectCustom = false;
155
+ this.firstItem = this.dataSource && this.dataSource.length > 0 ? this.dataSource[0] : null;
115
156
  this.checkAndResetCache();
116
157
  if (isNullOrUndefined(this.list)) {
117
158
  _super.prototype.renderList.call(this, e, true);
@@ -305,6 +346,10 @@ var AutoComplete = /** @class */ (function (_super) {
305
346
  AutoComplete.prototype.setInputValue = function (newProp, oldProp) {
306
347
  var oldValue = oldProp && oldProp.text ? oldProp.text : oldProp ? oldProp.value : oldProp;
307
348
  var value = newProp && newProp.text ? newProp.text : newProp && newProp.value ? newProp.value : this.value;
349
+ if (this.allowObjectBinding) {
350
+ oldValue = !isNullOrUndefined(oldValue) ? getValue((this.fields.value) ? this.fields.value : '', oldValue) : oldValue;
351
+ value = !isNullOrUndefined(value) ? getValue((this.fields.value) ? this.fields.value : '', value) : value;
352
+ }
308
353
  if (value && this.typedString === '' && !this.allowCustom && !(this.dataSource instanceof DataManager)) {
309
354
  var checkFields_1_1 = this.typeOfData(this.dataSource).typeof === 'string' ? '' : this.fields.value;
310
355
  var listLength_1 = this.getItems().length;
@@ -313,7 +358,7 @@ var AutoComplete = /** @class */ (function (_super) {
313
358
  new DataManager(this.dataSource).executeQuery(query.where(new Predicate(checkFields_1_1, 'equal', value)))
314
359
  .then(function (e) {
315
360
  if (e.result.length > 0) {
316
- _this_2.value = checkFields_1_1 !== '' ? e.result[0][_this_2.fields.value].toString() : e.result[0].toString();
361
+ _this_2.value = checkFields_1_1 !== '' ? _this_2.allowObjectBinding ? e.result[0] : e.result[0][_this_2.fields.value].toString() : e.result[0].toString();
317
362
  _this_2.addItem(e.result, listLength_1);
318
363
  _this_2.updateValues();
319
364
  }
@@ -1,4 +1,4 @@
1
- import { EventHandler, Property, Event, EmitType, addClass, Browser, KeyboardEventArgs, removeClass, detach } from '@syncfusion/ej2-base';import { isNullOrUndefined, NotifyPropertyChanges, getValue, setValue } from '@syncfusion/ej2-base';import { DropDownList, dropDownListClasses } from '../drop-down-list/drop-down-list';import { FilteringEventArgs } from '../drop-down-base/drop-down-base';import { FieldSettingsModel } from '../drop-down-base/drop-down-base-model';import { Search } from '../common/incremental-search';import { createSpinner, showSpinner, hideSpinner } from '@syncfusion/ej2-popups';import { Input, InputObject, FloatLabelType } from '@syncfusion/ej2-inputs';import { DataManager, Query } from '@syncfusion/ej2-data';
1
+ import { EventHandler, Property, Event, EmitType, addClass, Browser, KeyboardEventArgs, removeClass, detach } from '@syncfusion/ej2-base';import { isNullOrUndefined, NotifyPropertyChanges, getValue, setValue } from '@syncfusion/ej2-base';import { DropDownList, dropDownListClasses } from '../drop-down-list/drop-down-list';import { FilteringEventArgs } from '../drop-down-base/drop-down-base';import { FieldSettingsModel } from '../drop-down-base/drop-down-base-model';import { Search } from '../common/incremental-search';import { createSpinner, showSpinner, hideSpinner } from '@syncfusion/ej2-popups';import { Input, InputObject, FloatLabelType } from '@syncfusion/ej2-inputs';import { DataManager, DataOptions, Predicate, Query } from '@syncfusion/ej2-data';
2
2
  import {CustomValueSpecifierEventArgs} from "./combo-box";
3
3
  import {DropDownListModel} from "../drop-down-list/drop-down-list-model";
4
4
 
@@ -66,6 +66,7 @@ export interface ComboBoxModel extends DropDownListModel{
66
66
  * {% codeBlock src="combobox/index-api/index.html" %}{% endcodeBlock %}
67
67
  *
68
68
  * @default null
69
+ * @aspType double
69
70
 
70
71
  */
71
72
  index?: number | null;
@@ -219,6 +220,7 @@ export interface ComboBoxModel extends DropDownListModel{
219
220
  * Gets or sets the display text of the selected item in the component.
220
221
  *
221
222
  * @default null
223
+ * @aspType string
222
224
 
223
225
  */
224
226
  text?: string | null;
@@ -230,6 +232,13 @@ export interface ComboBoxModel extends DropDownListModel{
230
232
  * @isGenericType true
231
233
 
232
234
  */
233
- value?: number | string | boolean | null;
235
+ value?: number | string | boolean | object | null;
236
+
237
+ /**
238
+ * Defines whether the object binding is allowed or not in the component.
239
+ *
240
+ * @default false
241
+ */
242
+ allowObjectBinding?: boolean;
234
243
 
235
244
  }
@@ -79,6 +79,7 @@ export declare class ComboBox extends DropDownList {
79
79
  * {% codeBlock src="combobox/index-api/index.html" %}{% endcodeBlock %}
80
80
  *
81
81
  * @default null
82
+ * @aspType double
82
83
 
83
84
  */
84
85
  index: number | null;
@@ -216,6 +217,7 @@ export declare class ComboBox extends DropDownList {
216
217
  * Gets or sets the display text of the selected item in the component.
217
218
  *
218
219
  * @default null
220
+ * @aspType string
219
221
 
220
222
  */
221
223
  text: string | null;
@@ -226,7 +228,13 @@ export declare class ComboBox extends DropDownList {
226
228
  * @isGenericType true
227
229
 
228
230
  */
229
- value: number | string | boolean | null;
231
+ value: number | string | boolean | object | null;
232
+ /**
233
+ * Defines whether the object binding is allowed or not in the component.
234
+ *
235
+ * @default false
236
+ */
237
+ allowObjectBinding: boolean;
230
238
  /**
231
239
  * *Constructor for creating the component
232
240
  *
@@ -248,7 +256,7 @@ export declare class ComboBox extends DropDownList {
248
256
  protected onBlurHandler(e: MouseEvent): void;
249
257
  protected targetElement(): HTMLElement | HTMLInputElement;
250
258
  protected setOldText(text: string): void;
251
- protected setOldValue(value: string | number): void;
259
+ protected setOldValue(value: string | number | object): void;
252
260
  private valueMuteChange;
253
261
  protected updateValues(): void;
254
262
  protected updateIconState(): void;
@@ -25,6 +25,7 @@ import { DropDownList, dropDownListClasses } from '../drop-down-list/drop-down-l
25
25
  import { Search } from '../common/incremental-search';
26
26
  import { createSpinner, showSpinner, hideSpinner } from '@syncfusion/ej2-popups';
27
27
  import { Input } from '@syncfusion/ej2-inputs';
28
+ import { DataManager, Predicate, Query } from '@syncfusion/ej2-data';
28
29
  var SPINNER_CLASS = 'e-atc-spinner-icon';
29
30
  dropDownListClasses.root = 'e-combobox';
30
31
  var inputObject = {
@@ -124,8 +125,12 @@ var ComboBox = /** @class */ (function (_super) {
124
125
  this.setHiddenValue();
125
126
  };
126
127
  ComboBox.prototype.valueMuteChange = function (value) {
128
+ value = this.allowObjectBinding && !isNullOrUndefined(value) ? getValue((this.fields.value) ? this.fields.value : '', value) : value;
127
129
  var inputValue = isNullOrUndefined(value) ? null : value.toString();
128
130
  Input.setValue(inputValue, this.inputElement, this.floatLabelType, this.showClearButton);
131
+ if (this.allowObjectBinding) {
132
+ value = this.getDataByValue(value);
133
+ }
129
134
  this.setProperties({ value: value, text: value, index: null }, true);
130
135
  this.activeIndex = this.index;
131
136
  var fields = this.fields;
@@ -134,20 +139,50 @@ var ComboBox = /** @class */ (function (_super) {
134
139
  dataItem[fields.value] = isNullOrUndefined(value) ? null : value.toString();
135
140
  this.itemData = dataItem;
136
141
  this.item = null;
137
- if (this.previousValue !== this.value) {
142
+ if ((!this.allowObjectBinding && (this.previousValue !== this.value)) || (this.allowObjectBinding && this.previousValue && this.value && !this.isObjectInArray(this.previousValue, [this.value]))) {
138
143
  this.detachChangeEvent(null);
139
144
  }
140
145
  };
141
146
  ComboBox.prototype.updateValues = function () {
142
147
  if (!isNullOrUndefined(this.value)) {
143
- var li = this.getElementByValue(this.value);
148
+ var currentValue = this.allowObjectBinding && !isNullOrUndefined(this.value) ? getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
149
+ var li = this.getElementByValue(currentValue);
150
+ var doesItemExist = !isNullOrUndefined(li) ? true : false;
151
+ if (this.enableVirtualization && this.value) {
152
+ var fields = (this.fields.value) ? this.fields.value : '';
153
+ var currentValue_1 = this.allowObjectBinding && !isNullOrUndefined(this.value) ? getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
154
+ if (this.dataSource instanceof DataManager && this.virtualGroupDataSource) {
155
+ var getItem = new DataManager(this.virtualGroupDataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', currentValue_1)));
156
+ if (getItem && getItem.length > 0) {
157
+ this.itemData = getItem[0];
158
+ doesItemExist = true;
159
+ var dataItem = this.getItemData();
160
+ var value = this.allowObjectBinding ? this.getDataByValue(dataItem.value) : dataItem.value;
161
+ if ((this.value === dataItem.value && this.text !== dataItem.text) || (this.value !== dataItem.value && this.text === dataItem.text)) {
162
+ this.setProperties({ 'text': dataItem.text, 'value': value });
163
+ }
164
+ }
165
+ }
166
+ else {
167
+ var getItem = new DataManager(this.dataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', currentValue_1)));
168
+ if (getItem && getItem.length > 0) {
169
+ this.itemData = getItem[0];
170
+ doesItemExist = true;
171
+ var dataItem = this.getItemData();
172
+ var value = this.allowObjectBinding ? this.getDataByValue(dataItem.value) : dataItem.value;
173
+ if ((this.value === dataItem.value && this.text !== dataItem.text) || (this.value !== dataItem.value && this.text === dataItem.text)) {
174
+ this.setProperties({ 'text': dataItem.text, 'value': value });
175
+ }
176
+ }
177
+ }
178
+ }
144
179
  if (li) {
145
180
  this.setSelection(li, null);
146
181
  }
147
- else if (this.allowCustom) {
182
+ else if ((!this.enableVirtualization && this.allowCustom) || (this.allowCustom && this.enableVirtualization && !doesItemExist)) {
148
183
  this.valueMuteChange(this.value);
149
184
  }
150
- else {
185
+ else if (!this.enableVirtualization || (this.enableVirtualization && !doesItemExist)) {
151
186
  this.valueMuteChange(null);
152
187
  }
153
188
  }
@@ -257,7 +292,7 @@ var ComboBox = /** @class */ (function (_super) {
257
292
  this.updateIncrementalView(0, this.itemCount);
258
293
  }
259
294
  activeItem = Search(inputValue, this.incrementalLiCollections, this.filterType, true, dataSource, this.fields, type);
260
- while (isNullOrUndefined(activeItem) && this.incrementalEndIndex < this.totalItemCount) {
295
+ while (isNullOrUndefined(activeItem.item) && this.incrementalEndIndex < this.totalItemCount) {
261
296
  this.incrementalStartIndex = this.incrementalEndIndex;
262
297
  this.incrementalEndIndex = this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100;
263
298
  this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
@@ -267,6 +302,7 @@ var ComboBox = /** @class */ (function (_super) {
267
302
  }
268
303
  activeItem = Search(inputValue, this.incrementalLiCollections, this.filterType, true, dataSource, this.fields, type);
269
304
  if (!isNullOrUndefined(activeItem)) {
305
+ activeItem.index = activeItem.index + this.incrementalStartIndex;
270
306
  break;
271
307
  }
272
308
  if (isNullOrUndefined(activeItem) && this.incrementalEndIndex >= this.totalItemCount) {
@@ -352,10 +388,12 @@ var ComboBox = /** @class */ (function (_super) {
352
388
  }
353
389
  };
354
390
  ComboBox.prototype.checkCustomValue = function () {
355
- this.itemData = this.getDataByValue(this.value);
391
+ var value = this.allowObjectBinding && !isNullOrUndefined(this.value) ? getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
392
+ this.itemData = this.getDataByValue(value);
356
393
  var dataItem = this.getItemData();
394
+ var setValue = this.allowObjectBinding ? this.itemData : dataItem.value;
357
395
  if (!(this.allowCustom && isNullOrUndefined(dataItem.value) && isNullOrUndefined(dataItem.text))) {
358
- this.setProperties({ 'value': dataItem.value }, !this.allowCustom);
396
+ this.setProperties({ 'value': setValue }, !this.allowCustom);
359
397
  }
360
398
  };
361
399
  /**
@@ -405,10 +443,10 @@ var ComboBox = /** @class */ (function (_super) {
405
443
  var currentValue = this.getTextByValue(activeElement.getAttribute('data-value')).toString();
406
444
  var currentFillValue = this.getFormattedValue(activeElement.getAttribute('data-value'));
407
445
  if (this.getModuleName() === 'combobox') {
408
- if (!this.isSelected && this.previousValue !== currentFillValue) {
446
+ if (!this.isSelected && ((!this.allowObjectBinding && this.previousValue !== currentFillValue)) || (this.allowObjectBinding && this.previousValue && currentFillValue && !this.isObjectInArray(this.previousValue, [this.getDataByValue(currentFillValue)]))) {
409
447
  this.updateSelectedItem(activeElement, null);
410
448
  this.isSelected = true;
411
- this.previousValue = this.getFormattedValue(activeElement.getAttribute('data-value'));
449
+ this.previousValue = this.allowObjectBinding ? this.getDataByValue(this.getFormattedValue(activeElement.getAttribute('data-value'))) : this.getFormattedValue(activeElement.getAttribute('data-value'));
412
450
  }
413
451
  else {
414
452
  this.updateSelectedItem(activeElement, null, true);
@@ -583,11 +621,13 @@ var ComboBox = /** @class */ (function (_super) {
583
621
  if (!this.allowCustom && this.inputElement.value !== '') {
584
622
  var previousValue = this.previousValue;
585
623
  var currentValue = this.value;
624
+ value = this.allowObjectBinding ? this.getDataByValue(value) : value;
586
625
  this.setProperties({ value: value });
587
626
  if (isNullOrUndefined(this.value)) {
588
627
  Input.setValue('', this.inputElement, this.floatLabelType, this.showClearButton);
589
628
  }
590
- if (this.autofill && previousValue === this.value && currentValue !== this.value) {
629
+ var newValue = this.allowObjectBinding && !isNullOrUndefined(this.value) ? getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
630
+ if (this.autofill && ((!this.allowObjectBinding && previousValue === this.value) || (this.allowObjectBinding && previousValue && this.isObjectInArray(previousValue, [this.value]))) && ((!this.allowObjectBinding && currentValue !== this.value) || (this.allowObjectBinding && currentValue && !this.isObjectInArray(currentValue, [this.value])))) {
591
631
  this.onChangeEvent(null);
592
632
  }
593
633
  }
@@ -597,6 +637,7 @@ var ComboBox = /** @class */ (function (_super) {
597
637
  var value_1 = this.inputElement.value === '' ? null : this.inputElement.value;
598
638
  // eslint-disable-next-line max-len
599
639
  var eventArgs = { text: value_1, item: {} };
640
+ this.isObjectCustomValue = true;
600
641
  if (!this.initial) {
601
642
  this.trigger('customValueSpecifier', eventArgs, function (eventArgs) {
602
643
  _this.updateCustomValueCallback(value_1, eventArgs, previousValue_1, e);
@@ -608,8 +649,9 @@ var ComboBox = /** @class */ (function (_super) {
608
649
  }
609
650
  else {
610
651
  this.isSelectCustom = false;
652
+ value = this.allowObjectBinding ? this.getDataByValue(value) : value;
611
653
  this.setProperties({ value: value });
612
- if (previousValue_1 !== this.value) {
654
+ if ((!this.allowObjectBinding && previousValue_1 !== this.value) || (this.allowObjectBinding && previousValue_1 && this.value && !this.isObjectInArray(previousValue_1, [this.value]))) {
613
655
  this.onChangeEvent(e);
614
656
  }
615
657
  }
@@ -619,6 +661,7 @@ var ComboBox = /** @class */ (function (_super) {
619
661
  }
620
662
  };
621
663
  ComboBox.prototype.updateCustomValueCallback = function (value, eventArgs, previousValue, e) {
664
+ var _this = this;
622
665
  var fields = this.fields;
623
666
  var item = eventArgs.item;
624
667
  var dataItem = {};
@@ -630,16 +673,28 @@ var ComboBox = /** @class */ (function (_super) {
630
673
  setValue(fields.value, value, dataItem);
631
674
  }
632
675
  this.itemData = dataItem;
676
+ var emptyObject = {};
677
+ if (this.allowObjectBinding) {
678
+ var keys = this.listData && this.listData.length > 0 ? Object.keys(this.listData[0]) : Object.keys(this.itemData);
679
+ if ((!(this.listData && this.listData.length > 0)) && (this.getModuleName() === 'autocomplete' || (this.getModuleName() === 'combobox' && this.allowFiltering))) {
680
+ keys = this.firstItem ? Object.keys(this.firstItem) : Object.keys(this.itemData);
681
+ }
682
+ // Create an empty object with predefined keys
683
+ keys.forEach(function (key) {
684
+ emptyObject[key] = ((key === fields.value) || (key === fields.text)) ? getValue(fields.value, _this.itemData) : null;
685
+ });
686
+ }
633
687
  var changeData = {
634
688
  text: getValue(fields.text, this.itemData),
635
- value: getValue(fields.value, this.itemData),
689
+ value: this.allowObjectBinding ? emptyObject : getValue(fields.value, this.itemData),
636
690
  index: null
637
691
  };
638
692
  this.setProperties(changeData, true);
639
693
  this.setSelection(null, null);
640
694
  this.isSelectCustom = true;
641
- if (previousValue !== this.value) {
642
- this.onChangeEvent(e);
695
+ this.isObjectCustomValue = false;
696
+ if ((!this.allowObjectBinding && (previousValue !== this.value)) || (this.allowObjectBinding && ((previousValue == null && this.value !== null) || (previousValue && !this.isObjectInArray(previousValue, [this.value]))))) {
697
+ this.onChangeEvent(e, true);
643
698
  }
644
699
  };
645
700
  /**
@@ -653,7 +708,7 @@ var ComboBox = /** @class */ (function (_super) {
653
708
  ComboBox.prototype.onPropertyChanged = function (newProp, oldProp) {
654
709
  if (this.getModuleName() === 'combobox') {
655
710
  this.checkData(newProp);
656
- this.setUpdateInitial(['fields', 'query', 'dataSource'], newProp);
711
+ this.setUpdateInitial(['fields', 'query', 'dataSource'], newProp, oldProp);
657
712
  }
658
713
  for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
659
714
  var prop = _a[_i];
@@ -802,7 +857,8 @@ var ComboBox = /** @class */ (function (_super) {
802
857
  this.customValue(e);
803
858
  }
804
859
  }
805
- if (isNullOrUndefined(this.listData) && this.allowCustom && !isNullOrUndefined(inputValue) && inputValue !== this.value) {
860
+ var value = this.allowObjectBinding && !isNullOrUndefined(this.value) ? getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
861
+ if (isNullOrUndefined(this.listData) && this.allowCustom && !isNullOrUndefined(inputValue) && inputValue !== value) {
806
862
  this.customValue();
807
863
  }
808
864
  _super.prototype.hidePopup.call(this, e);
@@ -934,6 +990,9 @@ var ComboBox = /** @class */ (function (_super) {
934
990
  __decorate([
935
991
  Property(null)
936
992
  ], ComboBox.prototype, "value", void 0);
993
+ __decorate([
994
+ Property(false)
995
+ ], ComboBox.prototype, "allowObjectBinding", void 0);
937
996
  ComboBox = __decorate([
938
997
  NotifyPropertyChanges
939
998
  ], ComboBox);
@@ -4,6 +4,7 @@ import { VirtualInfo } from '../common/virtual-scroll';
4
4
  import { DataManager, Query } from '@syncfusion/ej2-data';
5
5
  import { FieldSettingsModel } from '../drop-down-base/drop-down-base-model';
6
6
  import { GeneratedData } from '../drop-down-list/drop-down-list';
7
+ import { visualMode } from '../multi-select';
7
8
  /**
8
9
  * Specifies virtual scroll interfaces.
9
10
  *
@@ -57,13 +58,44 @@ export interface IDropdownlist extends Component<HTMLElement> {
57
58
  listData: {
58
59
  [key: string]: Object;
59
60
  }[] | string[] | boolean[] | number[];
61
+ hideSelectedItem: boolean;
62
+ closePopupOnSelect: boolean;
63
+ mode: visualMode;
64
+ isVirtualTrackHeight: boolean;
65
+ virtualCustomData: {
66
+ [key: string]: string | Object;
67
+ };
68
+ virtualCustomSelectData: {
69
+ [key: string]: Object;
70
+ }[] | string[] | number[] | boolean[];
71
+ allowCustomValue: boolean;
72
+ enableSelectionOrder: boolean;
73
+ popupWrapper: HTMLDivElement;
74
+ currentFocuedListElement: HTMLElement;
75
+ isScrollChanged: boolean;
76
+ appendUncheckList: boolean;
77
+ keyCode: number;
78
+ preventSetCurrentData: boolean;
79
+ virtualGroupDataSource: {
80
+ [key: string]: Object;
81
+ }[] | DataManager | string[] | number[] | boolean[];
82
+ updatevirtualizationList(): void;
83
+ scrollTop(selectedLI: HTMLElement, activeIndex: number, keyCode: number | null): void;
84
+ renderItems(listData: {
85
+ [key: string]: Object;
86
+ }[], fields: FieldSettingsModel, isCheckBoxUpdate?: boolean): HTMLElement;
87
+ updateVirtualReOrderList(isCheckBoxUpdate?: boolean): void;
88
+ getForQuery(valuecheck: string[] | number[] | boolean[]): Query;
60
89
  skeletonCount: number;
90
+ getElementByValue(value: string | number | boolean): Element;
61
91
  getSkeletonCount(retainSkeleton?: boolean): void;
62
92
  getItems(): HTMLElement[];
63
93
  getQuery(query: Query): Query;
64
94
  getTransformValues(): string;
95
+ addListFocus(element: HTMLElement): void;
65
96
  UpdateSkeleton(): void;
66
97
  updateSelectionList(): void;
98
+ totalItemsCount(): void;
67
99
  GetVirtualTrackHeight(): string;
68
100
  getPageCount(returnExactCount?: boolean): number;
69
101
  handleVirtualKeyboardActions(e: KeyboardEventArgs, pageCount: number): void;
@@ -48,13 +48,11 @@ export declare class VirtualScroll {
48
48
  private setGeneratedData;
49
49
  private generateAndExecuteQueryAsync;
50
50
  private removeSkipAndTakeEvents;
51
- setCurrentViewDataAsync(): void;
51
+ setCurrentViewDataAsync(component?: object): void;
52
52
  private generateQueryAndSetQueryIndexAsync;
53
53
  private dataProcessAsync;
54
54
  private virtualScrollRefreshAsync;
55
55
  scrollListener(scrollArgs: ScrollArg): void;
56
- private getPageCount;
57
- private getRowHeight;
58
56
  private getInfoFromView;
59
57
  private sentinelInfo;
60
58
  private virtualScrollHandler;