@syncfusion/ej2-dropdowns 32.1.25 → 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.
@@ -5418,30 +5418,7 @@ let DropDownList = class DropDownList extends DropDownBase {
5418
5418
  const checkField = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
5419
5419
  const value = this.allowObjectBinding && !isNullOrUndefined(this.value) ?
5420
5420
  getValue(checkField, this.value) : this.value;
5421
- const fieldValue = this.fields.value.split('.');
5422
- let checkVal = list.some((x) => isNullOrUndefined(x[checkField]) && fieldValue.length > 1 ?
5423
- this.checkFieldValue(x, fieldValue) === value : x[checkField] === value);
5424
- if (this.enableVirtualization && this.virtualGroupDataSource) {
5425
- checkVal = this.virtualGroupDataSource.some((x) => isNullOrUndefined(x[checkField]) && fieldValue.length > 1 ?
5426
- this.checkFieldValue(x, fieldValue) === value : x[checkField] === value);
5427
- }
5428
- if (!checkVal && !this.enableVirtualization) {
5429
- this.dataSource.executeQuery(this.getQuery(this.query).where(new Predicate(checkField, 'equal', value)))
5430
- .then((e) => {
5431
- if (e.result.length > 0) {
5432
- if (!this.enableVirtualization) {
5433
- this.addItem(e.result, list.length);
5434
- }
5435
- this.updateValues();
5436
- }
5437
- else {
5438
- this.updateValues();
5439
- }
5440
- });
5441
- }
5442
- else {
5443
- this.updateValues();
5444
- }
5421
+ this.checkAndFetchItemData(list, value, checkField);
5445
5422
  }
5446
5423
  else {
5447
5424
  this.updateValues();
@@ -5549,6 +5526,41 @@ let DropDownList = class DropDownList extends DropDownBase {
5549
5526
  });
5550
5527
  return checkField;
5551
5528
  }
5529
+ checkAndFetchItemData(list, value, checkField) {
5530
+ const fieldValue = this.fields.value.split('.');
5531
+ let checkVal = list.some((x) => isNullOrUndefined(x[checkField]) && fieldValue.length > 1 ?
5532
+ this.checkFieldValue(x, fieldValue) === value : x[checkField] === value);
5533
+ if (this.enableVirtualization && this.virtualGroupDataSource) {
5534
+ checkVal = this.virtualGroupDataSource.some((x) => isNullOrUndefined(x[checkField]) && fieldValue.length > 1 ?
5535
+ this.checkFieldValue(x, fieldValue) === value : x[checkField] === value);
5536
+ }
5537
+ if (!checkVal && this.dataSource instanceof DataManager) {
5538
+ (this.dataSource).executeQuery(this.getQuery(this.query).where(new Predicate(checkField, 'equal', value)))
5539
+ .then((e) => {
5540
+ if (e.result.length > 0) {
5541
+ if (!this.enableVirtualization) {
5542
+ this.addItem(e.result, list.length);
5543
+ }
5544
+ else {
5545
+ this.itemData = e.result[0];
5546
+ const dataItem = this.getItemData();
5547
+ if ((this.value === dataItem.value && this.text !== dataItem.text) ||
5548
+ (this.value !== dataItem.value && this.text === dataItem.text)) {
5549
+ this.setProperties({ text: dataItem.text.toString() });
5550
+ Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
5551
+ }
5552
+ }
5553
+ this.updateValues();
5554
+ }
5555
+ else {
5556
+ this.updateValues();
5557
+ }
5558
+ });
5559
+ }
5560
+ else {
5561
+ this.updateValues();
5562
+ }
5563
+ }
5552
5564
  updateActionCompleteDataValues(ulElement, list) {
5553
5565
  this.actionCompleteData = { ulElement: ulElement.cloneNode(true), list: list, isUpdated: true };
5554
5566
  if (this.actionData.list !== this.actionCompleteData.list && this.actionCompleteData.ulElement && this.actionCompleteData.list) {
@@ -6962,6 +6974,12 @@ let DropDownList = class DropDownList extends DropDownBase {
6962
6974
  return;
6963
6975
  }
6964
6976
  if (this.enableVirtualization) {
6977
+ if (newProp.value && this.dataSource instanceof DataManager) {
6978
+ const checkField = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
6979
+ const value = this.allowObjectBinding && !isNullOrUndefined(newProp.value) ?
6980
+ getValue(checkField, newProp.value) : newProp.value;
6981
+ this.checkAndFetchItemData(this.listData, value, checkField);
6982
+ }
6965
6983
  this.updateValues();
6966
6984
  this.updateInputFields();
6967
6985
  this.notify('setCurrentViewDataAsync', {
@@ -16959,7 +16977,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16959
16977
  this.unwireListEvents();
16960
16978
  this.wireListEvents();
16961
16979
  }
16962
- initialValueUpdate(listItems, isInitialVirtualData) {
16980
+ initialValueUpdate(listItems, isInitialVirtualData, isInitialRender) {
16963
16981
  if (this.list) {
16964
16982
  let text;
16965
16983
  let element;
@@ -16968,6 +16986,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16968
16986
  this.chipCollectionWrapper.innerHTML = '';
16969
16987
  }
16970
16988
  this.removeListSelection();
16989
+ const formElement = closest(this.inputElement, 'form');
16971
16990
  if (!isNullOrUndefined(this.value)) {
16972
16991
  for (let index = 0; !isNullOrUndefined(this.value[index]); index++) {
16973
16992
  value = this.allowObjectBinding ?
@@ -17012,7 +17031,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
17012
17031
  }
17013
17032
  else if ((isNullOrUndefined(text) && !this.allowCustomValue) &&
17014
17033
  ((!(this.dataSource instanceof DataManager)) ||
17015
- (this.dataSource instanceof DataManager && isInitialVirtualData))) {
17034
+ (this.dataSource instanceof DataManager && isInitialVirtualData)) && (!this.isAngular || !isInitialRender ||
17035
+ (isNullOrUndefined(formElement) && listItems && listItems.length > 0))) {
17016
17036
  this.value.splice(index, 1);
17017
17037
  index -= 1;
17018
17038
  }
@@ -19105,7 +19125,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
19105
19125
  this.viewPortInfo.startIndex = this.virtualItemStartIndex = 0;
19106
19126
  this.viewPortInfo.endIndex = this.virtualItemEndIndex = this.viewPortInfo.startIndex > 0 ?
19107
19127
  this.viewPortInfo.endIndex : this.itemCount;
19108
- this.checkInitialValue();
19128
+ this.checkInitialValue(true);
19109
19129
  if (this.element.hasAttribute('data-val')) {
19110
19130
  this.element.setAttribute('data-val', 'false');
19111
19131
  }
@@ -19284,7 +19304,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
19284
19304
  this.value = data.length > 0 ? data : null;
19285
19305
  }
19286
19306
  }
19287
- checkInitialValue() {
19307
+ checkInitialValue(isInitialRender) {
19288
19308
  if (this.fields.disabled) {
19289
19309
  this.removeDisabledItemsValue(this.value);
19290
19310
  }
@@ -19370,7 +19390,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
19370
19390
  }
19371
19391
  }
19372
19392
  if (!(this.dataSource instanceof DataManager)) {
19373
- this.initialValueUpdate(listItems, true);
19393
+ this.initialValueUpdate(listItems, true, isInitialRender);
19374
19394
  this.initialUpdate();
19375
19395
  }
19376
19396
  else {