@syncfusion/ej2-dropdowns 24.2.9 → 25.1.37

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 (95) hide show
  1. package/CHANGELOG.md +27 -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 +2014 -514
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +2030 -513
  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 +10 -1
  17. package/src/combo-box/combo-box.d.ts +10 -2
  18. package/src/combo-box/combo-box.js +55 -23
  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 +64 -5
  24. package/src/drop-down-base/drop-down-base.js +241 -24
  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 -50
  27. package/src/drop-down-list/drop-down-list.js +150 -196
  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 +16 -8
  35. package/src/multi-select/checkbox-selection.d.ts +2 -0
  36. package/src/multi-select/checkbox-selection.js +16 -3
  37. package/src/multi-select/float-label.d.ts +5 -5
  38. package/src/multi-select/index.d.ts +1 -0
  39. package/src/multi-select/index.js +1 -0
  40. package/src/multi-select/interface.d.ts +1 -0
  41. package/src/multi-select/multi-select-model.d.ts +17 -2
  42. package/src/multi-select/multi-select.d.ts +35 -4
  43. package/src/multi-select/multi-select.js +1282 -174
  44. package/styles/auto-complete/_bds-definition.scss +2 -0
  45. package/styles/bootstrap-dark.css +7 -1
  46. package/styles/bootstrap.css +7 -1
  47. package/styles/bootstrap4.css +2 -1
  48. package/styles/bootstrap5-dark.css +2 -1
  49. package/styles/bootstrap5.css +2 -1
  50. package/styles/combo-box/_bds-definition.scss +2 -0
  51. package/styles/drop-down-base/_bds-definition.scss +134 -0
  52. package/styles/drop-down-list/_bds-definition.scss +134 -0
  53. package/styles/drop-down-list/icons/_bds.scss +14 -0
  54. package/styles/drop-down-tree/_bds-definition.scss +61 -0
  55. package/styles/drop-down-tree/icons/_bds.scss +11 -0
  56. package/styles/fabric-dark.css +3 -1
  57. package/styles/fabric.css +3 -1
  58. package/styles/fluent-dark.css +7 -1
  59. package/styles/fluent.css +7 -1
  60. package/styles/highcontrast-light.css +3 -1
  61. package/styles/highcontrast.css +3 -1
  62. package/styles/list-box/_bds-definition.scss +136 -0
  63. package/styles/list-box/icons/_bds.scss +25 -0
  64. package/styles/material-dark.css +11 -1
  65. package/styles/material.css +11 -1
  66. package/styles/material3-dark.css +2 -1
  67. package/styles/material3.css +2 -1
  68. package/styles/mention/_bds-definition.scss +1 -0
  69. package/styles/multi-select/_bds-definition.scss +235 -0
  70. package/styles/multi-select/_bootstrap-dark-definition.scss +4 -0
  71. package/styles/multi-select/_bootstrap-definition.scss +4 -0
  72. package/styles/multi-select/_fluent-definition.scss +5 -0
  73. package/styles/multi-select/_layout.scss +8 -1
  74. package/styles/multi-select/_material-dark-definition.scss +11 -0
  75. package/styles/multi-select/_material-definition.scss +11 -0
  76. package/styles/multi-select/bootstrap-dark.css +7 -1
  77. package/styles/multi-select/bootstrap.css +7 -1
  78. package/styles/multi-select/bootstrap4.css +2 -1
  79. package/styles/multi-select/bootstrap5-dark.css +2 -1
  80. package/styles/multi-select/bootstrap5.css +2 -1
  81. package/styles/multi-select/fabric-dark.css +3 -1
  82. package/styles/multi-select/fabric.css +3 -1
  83. package/styles/multi-select/fluent-dark.css +7 -1
  84. package/styles/multi-select/fluent.css +7 -1
  85. package/styles/multi-select/highcontrast-light.css +3 -1
  86. package/styles/multi-select/highcontrast.css +3 -1
  87. package/styles/multi-select/icons/_bds.scss +26 -0
  88. package/styles/multi-select/material-dark.css +11 -1
  89. package/styles/multi-select/material.css +11 -1
  90. package/styles/multi-select/material3-dark.css +2 -1
  91. package/styles/multi-select/material3.css +2 -1
  92. package/styles/multi-select/tailwind-dark.css +2 -1
  93. package/styles/multi-select/tailwind.css +2 -1
  94. package/styles/tailwind-dark.css +2 -1
  95. package/styles/tailwind.css +2 -1
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 24.2.9
3
+ * version : 25.1.37
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.8",
3
+ "_id": "@syncfusion/ej2-dropdowns@25.1.35",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-1A5QIAOOlqg4IJjwTgMqNV6xiPutc4FoqN7uskqXelOBGeTgCx4jEpZhh+X9dDCxKXV2iPNOEw2CSFyKTIc2Iw==",
5
+ "_integrity": "sha512-o2qsZbMu76zBnvXhSDdsN7R18mJhycMuJ9jXY5rrsQtS0S1XucOAXQA/RjxFP72CCbcmWOrvk9nVpZUhFEZ4+Q==",
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.8.tgz",
38
- "_shasum": "7f4577968b80659bca4fea10937d125be58ad1a3",
37
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-25.1.35.tgz",
38
+ "_shasum": "1c83db7b666f57c583f0a5f82bc2930514811f9d",
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.9",
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.9"
46
+ "@syncfusion/ej2-base": "~25.1.35",
47
+ "@syncfusion/ej2-data": "~25.1.35",
48
+ "@syncfusion/ej2-inputs": "~25.1.37",
49
+ "@syncfusion/ej2-lists": "~25.1.35",
50
+ "@syncfusion/ej2-navigations": "~25.1.37",
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.9",
77
+ "version": "25.1.37",
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
  }
@@ -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;
@@ -125,8 +125,12 @@ var ComboBox = /** @class */ (function (_super) {
125
125
  this.setHiddenValue();
126
126
  };
127
127
  ComboBox.prototype.valueMuteChange = function (value) {
128
+ value = this.allowObjectBinding && !isNullOrUndefined(value) ? getValue((this.fields.value) ? this.fields.value : '', value) : value;
128
129
  var inputValue = isNullOrUndefined(value) ? null : value.toString();
129
130
  Input.setValue(inputValue, this.inputElement, this.floatLabelType, this.showClearButton);
131
+ if (this.allowObjectBinding) {
132
+ value = this.getDataByValue(value);
133
+ }
130
134
  this.setProperties({ value: value, text: value, index: null }, true);
131
135
  this.activeIndex = this.index;
132
136
  var fields = this.fields;
@@ -135,35 +139,39 @@ var ComboBox = /** @class */ (function (_super) {
135
139
  dataItem[fields.value] = isNullOrUndefined(value) ? null : value.toString();
136
140
  this.itemData = dataItem;
137
141
  this.item = null;
138
- 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]))) {
139
143
  this.detachChangeEvent(null);
140
144
  }
141
145
  };
142
146
  ComboBox.prototype.updateValues = function () {
143
147
  if (!isNullOrUndefined(this.value)) {
144
- var li = this.getElementByValue(this.value);
145
- var isExistItem = !isNullOrUndefined(li) ? true : false;
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;
146
151
  if (this.enableVirtualization && this.value) {
147
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;
148
154
  if (this.dataSource instanceof DataManager && this.virtualGroupDataSource) {
149
- var getItem = new DataManager(this.virtualGroupDataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', this.value)));
155
+ var getItem = new DataManager(this.virtualGroupDataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', currentValue_1)));
150
156
  if (getItem && getItem.length > 0) {
151
157
  this.itemData = getItem[0];
152
- isExistItem = true;
158
+ doesItemExist = true;
153
159
  var dataItem = this.getItemData();
160
+ var value = this.allowObjectBinding ? this.getDataByValue(dataItem.value) : dataItem.value;
154
161
  if ((this.value === dataItem.value && this.text !== dataItem.text) || (this.value !== dataItem.value && this.text === dataItem.text)) {
155
- this.setProperties({ 'text': dataItem.text, 'value': dataItem.value });
162
+ this.setProperties({ 'text': dataItem.text, 'value': value });
156
163
  }
157
164
  }
158
165
  }
159
166
  else {
160
- var getItem = new DataManager(this.dataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', this.value)));
167
+ var getItem = new DataManager(this.dataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', currentValue_1)));
161
168
  if (getItem && getItem.length > 0) {
162
169
  this.itemData = getItem[0];
163
- isExistItem = true;
170
+ doesItemExist = true;
164
171
  var dataItem = this.getItemData();
172
+ var value = this.allowObjectBinding ? this.getDataByValue(dataItem.value) : dataItem.value;
165
173
  if ((this.value === dataItem.value && this.text !== dataItem.text) || (this.value !== dataItem.value && this.text === dataItem.text)) {
166
- this.setProperties({ 'text': dataItem.text, 'value': dataItem.value });
174
+ this.setProperties({ 'text': dataItem.text, 'value': value });
167
175
  }
168
176
  }
169
177
  }
@@ -171,10 +179,10 @@ var ComboBox = /** @class */ (function (_super) {
171
179
  if (li) {
172
180
  this.setSelection(li, null);
173
181
  }
174
- else if ((!this.enableVirtualization && this.allowCustom) || (this.allowCustom && this.enableVirtualization && !isExistItem)) {
182
+ else if ((!this.enableVirtualization && this.allowCustom) || (this.allowCustom && this.enableVirtualization && !doesItemExist)) {
175
183
  this.valueMuteChange(this.value);
176
184
  }
177
- else if (!this.enableVirtualization || (this.enableVirtualization && !isExistItem)) {
185
+ else if (!this.enableVirtualization || (this.enableVirtualization && !doesItemExist)) {
178
186
  this.valueMuteChange(null);
179
187
  }
180
188
  }
@@ -284,7 +292,7 @@ var ComboBox = /** @class */ (function (_super) {
284
292
  this.updateIncrementalView(0, this.itemCount);
285
293
  }
286
294
  activeItem = Search(inputValue, this.incrementalLiCollections, this.filterType, true, dataSource, this.fields, type);
287
- while (isNullOrUndefined(activeItem) && this.incrementalEndIndex < this.totalItemCount) {
295
+ while (isNullOrUndefined(activeItem.item) && this.incrementalEndIndex < this.totalItemCount) {
288
296
  this.incrementalStartIndex = this.incrementalEndIndex;
289
297
  this.incrementalEndIndex = this.incrementalEndIndex + 100 > this.totalItemCount ? this.totalItemCount : this.incrementalEndIndex + 100;
290
298
  this.updateIncrementalInfo(this.incrementalStartIndex, this.incrementalEndIndex);
@@ -294,6 +302,7 @@ var ComboBox = /** @class */ (function (_super) {
294
302
  }
295
303
  activeItem = Search(inputValue, this.incrementalLiCollections, this.filterType, true, dataSource, this.fields, type);
296
304
  if (!isNullOrUndefined(activeItem)) {
305
+ activeItem.index = activeItem.index + this.incrementalStartIndex;
297
306
  break;
298
307
  }
299
308
  if (isNullOrUndefined(activeItem) && this.incrementalEndIndex >= this.totalItemCount) {
@@ -379,10 +388,12 @@ var ComboBox = /** @class */ (function (_super) {
379
388
  }
380
389
  };
381
390
  ComboBox.prototype.checkCustomValue = function () {
382
- 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);
383
393
  var dataItem = this.getItemData();
394
+ var setValue = this.allowObjectBinding ? this.itemData : dataItem.value;
384
395
  if (!(this.allowCustom && isNullOrUndefined(dataItem.value) && isNullOrUndefined(dataItem.text))) {
385
- this.setProperties({ 'value': dataItem.value }, !this.allowCustom);
396
+ this.setProperties({ 'value': setValue }, !this.allowCustom);
386
397
  }
387
398
  };
388
399
  /**
@@ -432,10 +443,10 @@ var ComboBox = /** @class */ (function (_super) {
432
443
  var currentValue = this.getTextByValue(activeElement.getAttribute('data-value')).toString();
433
444
  var currentFillValue = this.getFormattedValue(activeElement.getAttribute('data-value'));
434
445
  if (this.getModuleName() === 'combobox') {
435
- 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)]))) {
436
447
  this.updateSelectedItem(activeElement, null);
437
448
  this.isSelected = true;
438
- 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'));
439
450
  }
440
451
  else {
441
452
  this.updateSelectedItem(activeElement, null, true);
@@ -610,11 +621,13 @@ var ComboBox = /** @class */ (function (_super) {
610
621
  if (!this.allowCustom && this.inputElement.value !== '') {
611
622
  var previousValue = this.previousValue;
612
623
  var currentValue = this.value;
624
+ value = this.allowObjectBinding ? this.getDataByValue(value) : value;
613
625
  this.setProperties({ value: value });
614
626
  if (isNullOrUndefined(this.value)) {
615
627
  Input.setValue('', this.inputElement, this.floatLabelType, this.showClearButton);
616
628
  }
617
- 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])))) {
618
631
  this.onChangeEvent(null);
619
632
  }
620
633
  }
@@ -624,6 +637,7 @@ var ComboBox = /** @class */ (function (_super) {
624
637
  var value_1 = this.inputElement.value === '' ? null : this.inputElement.value;
625
638
  // eslint-disable-next-line max-len
626
639
  var eventArgs = { text: value_1, item: {} };
640
+ this.isObjectCustomValue = true;
627
641
  if (!this.initial) {
628
642
  this.trigger('customValueSpecifier', eventArgs, function (eventArgs) {
629
643
  _this.updateCustomValueCallback(value_1, eventArgs, previousValue_1, e);
@@ -635,8 +649,9 @@ var ComboBox = /** @class */ (function (_super) {
635
649
  }
636
650
  else {
637
651
  this.isSelectCustom = false;
652
+ value = this.allowObjectBinding ? this.getDataByValue(value) : value;
638
653
  this.setProperties({ value: value });
639
- 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]))) {
640
655
  this.onChangeEvent(e);
641
656
  }
642
657
  }
@@ -646,6 +661,7 @@ var ComboBox = /** @class */ (function (_super) {
646
661
  }
647
662
  };
648
663
  ComboBox.prototype.updateCustomValueCallback = function (value, eventArgs, previousValue, e) {
664
+ var _this = this;
649
665
  var fields = this.fields;
650
666
  var item = eventArgs.item;
651
667
  var dataItem = {};
@@ -657,16 +673,28 @@ var ComboBox = /** @class */ (function (_super) {
657
673
  setValue(fields.value, value, dataItem);
658
674
  }
659
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
+ }
660
687
  var changeData = {
661
688
  text: getValue(fields.text, this.itemData),
662
- value: getValue(fields.value, this.itemData),
689
+ value: this.allowObjectBinding ? emptyObject : getValue(fields.value, this.itemData),
663
690
  index: null
664
691
  };
665
692
  this.setProperties(changeData, true);
666
693
  this.setSelection(null, null);
667
694
  this.isSelectCustom = true;
668
- if (previousValue !== this.value) {
669
- 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);
670
698
  }
671
699
  };
672
700
  /**
@@ -680,7 +708,7 @@ var ComboBox = /** @class */ (function (_super) {
680
708
  ComboBox.prototype.onPropertyChanged = function (newProp, oldProp) {
681
709
  if (this.getModuleName() === 'combobox') {
682
710
  this.checkData(newProp);
683
- this.setUpdateInitial(['fields', 'query', 'dataSource'], newProp);
711
+ this.setUpdateInitial(['fields', 'query', 'dataSource'], newProp, oldProp);
684
712
  }
685
713
  for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
686
714
  var prop = _a[_i];
@@ -829,7 +857,8 @@ var ComboBox = /** @class */ (function (_super) {
829
857
  this.customValue(e);
830
858
  }
831
859
  }
832
- 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) {
833
862
  this.customValue();
834
863
  }
835
864
  _super.prototype.hidePopup.call(this, e);
@@ -961,6 +990,9 @@ var ComboBox = /** @class */ (function (_super) {
961
990
  __decorate([
962
991
  Property(null)
963
992
  ], ComboBox.prototype, "value", void 0);
993
+ __decorate([
994
+ Property(false)
995
+ ], ComboBox.prototype, "allowObjectBinding", void 0);
964
996
  ComboBox = __decorate([
965
997
  NotifyPropertyChanges
966
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;