@syncfusion/ej2-dropdowns 32.2.3 → 32.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 32.2.3
3
+ * version : 32.2.4
4
4
  * Copyright Syncfusion Inc. 2001 - 2025. 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,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-dropdowns",
3
- "version": "32.2.3",
3
+ "version": "32.2.4",
4
4
  "description": "Essential JS 2 DropDown Components",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -14,7 +14,7 @@
14
14
  "@syncfusion/ej2-lists": "~32.2.3",
15
15
  "@syncfusion/ej2-navigations": "~32.2.3",
16
16
  "@syncfusion/ej2-notifications": "~32.2.3",
17
- "@syncfusion/ej2-popups": "~32.2.3"
17
+ "@syncfusion/ej2-popups": "~32.2.4"
18
18
  },
19
19
  "devDependencies": {},
20
20
  "keywords": [
@@ -591,6 +591,7 @@ export declare class DropDownList extends DropDownBase implements IInput {
591
591
  }[], e?: Object, isUpdated?: boolean): void;
592
592
  private isValueInList;
593
593
  private checkFieldValue;
594
+ private checkAndFetchItemData;
594
595
  private updateActionCompleteDataValues;
595
596
  private addNewItem;
596
597
  protected updateActionCompleteData(li: HTMLElement, item: {
@@ -2382,37 +2382,10 @@ var DropDownList = /** @class */ (function (_super) {
2382
2382
  this.activeIndex = this.index;
2383
2383
  this.initialRemoteRender = false;
2384
2384
  if (this.value && this.dataSource instanceof DataManager) {
2385
- var checkField_1 = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
2386
- var value_1 = this.allowObjectBinding && !isNullOrUndefined(this.value) ?
2387
- getValue(checkField_1, this.value) : this.value;
2388
- var fieldValue_1 = this.fields.value.split('.');
2389
- var checkVal = list.some(function (x) {
2390
- return isNullOrUndefined(x[checkField_1]) && fieldValue_1.length > 1 ?
2391
- _this.checkFieldValue(x, fieldValue_1) === value_1 : x[checkField_1] === value_1;
2392
- });
2393
- if (this.enableVirtualization && this.virtualGroupDataSource) {
2394
- checkVal = this.virtualGroupDataSource.some(function (x) {
2395
- return isNullOrUndefined(x[checkField_1]) && fieldValue_1.length > 1 ?
2396
- _this.checkFieldValue(x, fieldValue_1) === value_1 : x[checkField_1] === value_1;
2397
- });
2398
- }
2399
- if (!checkVal && !this.enableVirtualization) {
2400
- this.dataSource.executeQuery(this.getQuery(this.query).where(new Predicate(checkField_1, 'equal', value_1)))
2401
- .then(function (e) {
2402
- if (e.result.length > 0) {
2403
- if (!_this.enableVirtualization) {
2404
- _this.addItem(e.result, list.length);
2405
- }
2406
- _this.updateValues();
2407
- }
2408
- else {
2409
- _this.updateValues();
2410
- }
2411
- });
2412
- }
2413
- else {
2414
- this.updateValues();
2415
- }
2385
+ var checkField = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
2386
+ var value = this.allowObjectBinding && !isNullOrUndefined(this.value) ?
2387
+ getValue(checkField, this.value) : this.value;
2388
+ this.checkAndFetchItemData(list, value, checkField);
2416
2389
  }
2417
2390
  else {
2418
2391
  this.updateValues();
@@ -2520,6 +2493,46 @@ var DropDownList = /** @class */ (function (_super) {
2520
2493
  });
2521
2494
  return checkField;
2522
2495
  };
2496
+ DropDownList.prototype.checkAndFetchItemData = function (list, value, checkField) {
2497
+ var _this = this;
2498
+ var fieldValue = this.fields.value.split('.');
2499
+ var checkVal = list.some(function (x) {
2500
+ return isNullOrUndefined(x[checkField]) && fieldValue.length > 1 ?
2501
+ _this.checkFieldValue(x, fieldValue) === value : x[checkField] === value;
2502
+ });
2503
+ if (this.enableVirtualization && this.virtualGroupDataSource) {
2504
+ checkVal = this.virtualGroupDataSource.some(function (x) {
2505
+ return isNullOrUndefined(x[checkField]) && fieldValue.length > 1 ?
2506
+ _this.checkFieldValue(x, fieldValue) === value : x[checkField] === value;
2507
+ });
2508
+ }
2509
+ if (!checkVal && this.dataSource instanceof DataManager) {
2510
+ (this.dataSource).executeQuery(this.getQuery(this.query).where(new Predicate(checkField, 'equal', value)))
2511
+ .then(function (e) {
2512
+ if (e.result.length > 0) {
2513
+ if (!_this.enableVirtualization) {
2514
+ _this.addItem(e.result, list.length);
2515
+ }
2516
+ else {
2517
+ _this.itemData = e.result[0];
2518
+ var dataItem = _this.getItemData();
2519
+ if ((_this.value === dataItem.value && _this.text !== dataItem.text) ||
2520
+ (_this.value !== dataItem.value && _this.text === dataItem.text)) {
2521
+ _this.setProperties({ text: dataItem.text.toString() });
2522
+ Input.setValue(_this.text, _this.inputElement, _this.floatLabelType, _this.showClearButton);
2523
+ }
2524
+ }
2525
+ _this.updateValues();
2526
+ }
2527
+ else {
2528
+ _this.updateValues();
2529
+ }
2530
+ });
2531
+ }
2532
+ else {
2533
+ this.updateValues();
2534
+ }
2535
+ };
2523
2536
  DropDownList.prototype.updateActionCompleteDataValues = function (ulElement, list) {
2524
2537
  this.actionCompleteData = { ulElement: ulElement.cloneNode(true), list: list, isUpdated: true };
2525
2538
  if (this.actionData.list !== this.actionCompleteData.list && this.actionCompleteData.ulElement && this.actionCompleteData.list) {
@@ -2529,10 +2542,10 @@ var DropDownList = /** @class */ (function (_super) {
2529
2542
  DropDownList.prototype.addNewItem = function (listData, newElement) {
2530
2543
  var _this = this;
2531
2544
  if (!isNullOrUndefined(this.itemData) && !isNullOrUndefined(newElement)) {
2532
- var value_2 = this.getItemData().value;
2545
+ var value_1 = this.getItemData().value;
2533
2546
  var isExist = listData.some(function (data) {
2534
- return (((typeof data === 'string' || typeof data === 'number' || typeof data === 'boolean') && data === value_2) ||
2535
- (getValue(_this.fields.value, data) === value_2));
2547
+ return (((typeof data === 'string' || typeof data === 'number' || typeof data === 'boolean') && data === value_1) ||
2548
+ (getValue(_this.fields.value, data) === value_1));
2536
2549
  });
2537
2550
  if (!isExist) {
2538
2551
  this.addItem(this.itemData);
@@ -3947,6 +3960,12 @@ var DropDownList = /** @class */ (function (_super) {
3947
3960
  return { value: void 0 };
3948
3961
  }
3949
3962
  if (this_1.enableVirtualization) {
3963
+ if (newProp.value && this_1.dataSource instanceof DataManager) {
3964
+ var checkField = isNullOrUndefined(this_1.fields.value) ? this_1.fields.text : this_1.fields.value;
3965
+ var value = this_1.allowObjectBinding && !isNullOrUndefined(newProp.value) ?
3966
+ getValue(checkField, newProp.value) : newProp.value;
3967
+ this_1.checkAndFetchItemData(this_1.listData, value, checkField);
3968
+ }
3950
3969
  this_1.updateValues();
3951
3970
  this_1.updateInputFields();
3952
3971
  this_1.notify('setCurrentViewDataAsync', {
@@ -3975,9 +3994,9 @@ var DropDownList = /** @class */ (function (_super) {
3975
3994
  var listLength_2 = this_1.getItems().length;
3976
3995
  var checkField = isNullOrUndefined(this_1.fields.value) ? this_1.fields.text : this_1.fields.value;
3977
3996
  this_1.typedString = '';
3978
- var value_3 = this_1.allowObjectBinding && !isNullOrUndefined(newProp.value) ?
3997
+ var value_2 = this_1.allowObjectBinding && !isNullOrUndefined(newProp.value) ?
3979
3998
  getValue(checkField, newProp.value) : newProp.value;
3980
- this_1.dataSource.executeQuery(this_1.getQuery(this_1.query).where(new Predicate(checkField, 'equal', value_3)))
3999
+ this_1.dataSource.executeQuery(this_1.getQuery(this_1.query).where(new Predicate(checkField, 'equal', value_2)))
3981
4000
  .then(function (e) {
3982
4001
  if (e.result.length > 0) {
3983
4002
  _this.addItem(e.result, listLength_2);