@syncfusion/ej2-dropdowns 33.2.5 → 33.2.7

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.
@@ -3033,7 +3033,8 @@ let DropDownBase = class DropDownBase extends Component {
3033
3033
  }
3034
3034
  else {
3035
3035
  for (const item of this.listData) {
3036
- if (!isNullOrUndefined(item) && getValue((this.fields.value ? this.fields.value : 'value'), item) === value) {
3036
+ if (!isNullOrUndefined(item) && (getValue((this.fields.value ? this.fields.value : 'value'), item) === value
3037
+ || this.getModuleName() === 'multiselect' && this.isVirtualizationEnabled && this.properties.allowCustomValue && getValue((this.fields.value ? this.fields.value : 'value'), item) === value.toString())) {
3037
3038
  return item;
3038
3039
  }
3039
3040
  }
@@ -5587,7 +5588,7 @@ let DropDownList = class DropDownList extends DropDownBase {
5587
5588
  }
5588
5589
  else if (this.enableVirtualization && this.getModuleName() !== 'autocomplete' && !this.isFiltering()) {
5589
5590
  const value = this.getItemData().value;
5590
- this.activeIndex = this.getIndexByValue(value);
5591
+ this.activeIndex = !isNullOrUndefined(value) ? this.getIndexByValue(value) : this.activeIndex;
5591
5592
  let element = this.findListElement(this.list, 'li', 'data-value', value);
5592
5593
  this.selectedLI = element;
5593
5594
  element = null;
@@ -6807,14 +6808,16 @@ let DropDownList = class DropDownList extends DropDownBase {
6807
6808
  if (this.enableVirtualization) {
6808
6809
  this.listItemHeight = this.getListHeight();
6809
6810
  this.getSkeletonCount();
6811
+ this.skeletonCount = this.totalItemCount < (this.itemCount * 2) && ((!(this.dataSource instanceof DataManager)) ||
6812
+ ((this.dataSource instanceof DataManager) && (this.totalItemCount <= this.itemCount))) ? 0 : this.skeletonCount;
6810
6813
  this.updateVirtualizationProperties(this.itemCount, this.allowFiltering);
6811
- if (this.index !== null) {
6812
- this.activeIndex = this.index + this.skeletonCount;
6813
- }
6814
6814
  }
6815
6815
  this.initValue();
6816
6816
  this.selectedValueInfo = this.viewPortInfo;
6817
6817
  if (this.enableVirtualization) {
6818
+ if (this.index !== null) {
6819
+ this.activeIndex = this.index + this.skeletonCount;
6820
+ }
6818
6821
  this.activeIndex = this.activeIndex + this.skeletonCount;
6819
6822
  }
6820
6823
  }
@@ -8105,6 +8108,7 @@ let DropDownTree = class DropDownTree extends Component {
8105
8108
  // Specifies if the checkAll method has been called
8106
8109
  this.isCheckAllCalled = false;
8107
8110
  this.isFromFilterChange = false;
8111
+ this.fallbackValue = [];
8108
8112
  }
8109
8113
  /**
8110
8114
  * Get the properties to be maintained in the persisted state.
@@ -9340,6 +9344,10 @@ let DropDownTree = class DropDownTree extends Component {
9340
9344
  }
9341
9345
  setTreeValue() {
9342
9346
  if (this.value !== null && this.value.length !== 0) {
9347
+ const dataReady = this.treeItems && this.treeItems.length > 0;
9348
+ if (!dataReady && this.fallbackValue.length === 0) {
9349
+ this.fallbackValue = this.value.slice();
9350
+ }
9343
9351
  let data;
9344
9352
  if (this.showCheckBox || this.allowMultiSelection) {
9345
9353
  for (let i = this.value.length - 1; i >= 0; i--) {
@@ -10999,6 +11007,13 @@ let DropDownTree = class DropDownTree extends Component {
10999
11007
  break;
11000
11008
  case 'fields':
11001
11009
  this.setFields();
11010
+ setTimeout(() => {
11011
+ if (this.value.length === 0 && this.fallbackValue.length > 0) {
11012
+ this.value = this.fallbackValue;
11013
+ this.updateValue(this.fallbackValue);
11014
+ this.fallbackValue = [];
11015
+ }
11016
+ }, 1);
11002
11017
  break;
11003
11018
  case 'readonly':
11004
11019
  Input.setReadonly(newProp.readonly, this.inputEle);
@@ -13929,7 +13944,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13929
13944
  else {
13930
13945
  this.updateActionList(ulElement, list, e);
13931
13946
  }
13932
- if (this.dataSource instanceof DataManager && this.allowCustomValue && !this.isCustomRendered &&
13947
+ if (this.dataSource instanceof DataManager && this.allowCustomValue && (!this.isCustomRendered || this.enableVirtualization) &&
13933
13948
  this.inputElement.value && this.inputElement.value !== '') {
13934
13949
  let query = new Query();
13935
13950
  query = this.allowFiltering ? query.where(this.fields.text, 'startswith', this.inputElement.value, this.ignoreCase, this.ignoreAccent) : query;
@@ -14453,7 +14468,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14453
14468
  if (this.enableVirtualization) {
14454
14469
  this.virtualCustomData = dataItem;
14455
14470
  const tempData = this.dataSource instanceof DataManager ?
14456
- JSON.parse(JSON.stringify(this.listData)) : JSON.parse(JSON.stringify(this.dataSource));
14471
+ JSON.parse(JSON.stringify(this.mainData)) : JSON.parse(JSON.stringify(this.dataSource));
14457
14472
  let totalData = [];
14458
14473
  if (this.virtualCustomSelectData && this.virtualCustomSelectData.length > 0) {
14459
14474
  totalData = tempData.concat(this.virtualCustomSelectData);
@@ -17351,7 +17366,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
17351
17366
  this.allowCustomValue &&
17352
17367
  ((!(this.dataSource instanceof DataManager)) ||
17353
17368
  (this.dataSource instanceof DataManager && isInitialVirtualData)))) {
17354
- const indexItem = this.listData.length;
17369
+ const indexItem = this.dataSource instanceof DataManager ? this.totalItemCount : this.listData.length;
17355
17370
  let newValue = {};
17356
17371
  setValue(this.fields.text, value, newValue);
17357
17372
  setValue(this.fields.value, value, newValue);
@@ -18840,6 +18855,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
18840
18855
  if (this.fields.disabled) {
18841
18856
  this.removeDisabledItemsValue(this.value);
18842
18857
  }
18858
+ if (this.enableVirtualization && !isNullOrUndefined(oldProp.value) && !isNullOrUndefined(newProp.value)
18859
+ && !this.validateValues(newProp.value, oldProp.value)) {
18860
+ return;
18861
+ }
18843
18862
  this.updateVal(this.value, oldProp.value, 'value', this.enableVirtualization);
18844
18863
  this.addValidInputClass();
18845
18864
  if (!this.closePopupOnSelect && this.isPopupOpen()) {
@@ -19810,6 +19829,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
19810
19829
  }, 100);
19811
19830
  this.initStatus = true;
19812
19831
  }
19832
+ else {
19833
+ this.initialValueUpdate(this.value, true, isInitialRender);
19834
+ this.initialUpdate();
19835
+ }
19813
19836
  });
19814
19837
  }
19815
19838
  else {
@@ -21056,7 +21079,6 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
21056
21079
  this.list.classList.add('e-wrapper');
21057
21080
  this.list.classList.add('e-lib');
21058
21081
  if (this.element.tagName === 'EJS-LISTBOX') {
21059
- this.element.setAttribute('tabindex', '0');
21060
21082
  if (this.initLoad) {
21061
21083
  this.element.appendChild(this.list);
21062
21084
  }