@syncfusion/ej2-dropdowns 26.2.5 → 26.2.8

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.
@@ -10069,10 +10069,41 @@ let ComboBox = class ComboBox extends DropDownList {
10069
10069
  value = this.allowObjectBinding && !isNullOrUndefined(value) ? getValue((this.fields.value) ? this.fields.value : '', value) : value;
10070
10070
  const inputValue = isNullOrUndefined(value) ? null : value.toString();
10071
10071
  Input.setValue(inputValue, this.inputElement, this.floatLabelType, this.showClearButton);
10072
+ let changeData = {};
10072
10073
  if (this.allowObjectBinding) {
10073
10074
  value = this.getDataByValue(value);
10075
+ if (isNullOrUndefined(value)) {
10076
+ const fields = this.fields;
10077
+ let isvalidTextField = false;
10078
+ let isValidValue = false;
10079
+ if (this.allowObjectBinding) {
10080
+ let keys = Object.keys(this.value);
10081
+ keys.forEach((key) => {
10082
+ if (key === fields.value) {
10083
+ isValidValue = true;
10084
+ return;
10085
+ }
10086
+ });
10087
+ keys.forEach((key) => {
10088
+ if (key === fields.text) {
10089
+ isvalidTextField = true;
10090
+ return;
10091
+ }
10092
+ });
10093
+ }
10094
+ changeData = {
10095
+ text: isValidValue ? isvalidTextField ? getValue(fields.text, this.value) : getValue(fields.value, this.value) : null,
10096
+ value: isValidValue ? this.value : null,
10097
+ index: null
10098
+ };
10099
+ }
10100
+ }
10101
+ if (this.allowObjectBinding) {
10102
+ this.setProperties(changeData, true);
10103
+ }
10104
+ else {
10105
+ this.setProperties({ value: value, text: value, index: null }, true);
10074
10106
  }
10075
- this.setProperties({ value: value, text: value, index: null }, true);
10076
10107
  this.activeIndex = this.index;
10077
10108
  const fields = this.fields;
10078
10109
  const dataItem = {};
@@ -10609,7 +10640,7 @@ let ComboBox = class ComboBox extends DropDownList {
10609
10640
  }
10610
10641
  }
10611
10642
  }
10612
- else if (this.allowCustom) {
10643
+ else if (this.allowCustom && this.isInteracted) {
10613
10644
  this.isSelectCustom = true;
10614
10645
  }
10615
10646
  }
@@ -12984,7 +13015,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12984
13015
  expandTextbox() {
12985
13016
  let size = 5;
12986
13017
  if (this.placeholder) {
12987
- size = size > this.inputElement.placeholder.length ? size : this.inputElement.placeholder.length;
13018
+ let codePoint = this.placeholder.charCodeAt(0);
13019
+ let sizeMultiplier = (0xAC00 <= codePoint && codePoint <= 0xD7AF) ? 1.5 : (0x4E00 <= codePoint && codePoint <= 0x9FFF) ? 2 : 1;
13020
+ size = size > this.inputElement.placeholder.length ? size : this.inputElement.placeholder.length * sizeMultiplier;
12988
13021
  }
12989
13022
  if (this.inputElement.value.length > size) {
12990
13023
  this.inputElement.size = this.inputElement.value.length;
@@ -14650,7 +14683,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14650
14683
  if (this.mode === 'CheckBox') {
14651
14684
  this.refreshPlaceHolder();
14652
14685
  this.refreshInputHight();
14653
- if (!this.changeOnBlur && isClearAll && (isNullOrUndefined(this.value) || this.value.length === 0)) {
14686
+ if (this.changeOnBlur && isClearAll && (isNullOrUndefined(this.value) || this.value.length === 0)) {
14654
14687
  this.updateValueState(e, this.value, this.tempValues);
14655
14688
  }
14656
14689
  }
@@ -16360,6 +16393,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16360
16393
  if (!this.closePopupOnSelect && this.isPopupOpen()) {
16361
16394
  this.refreshPopup();
16362
16395
  }
16396
+ if (this.isPopupOpen() && this.mode === 'CheckBox' && this.list && this.list.querySelector('.e-active.e-disable')) {
16397
+ const activeItems = this.list.querySelectorAll('li.' + dropDownBaseClasses.li + '.e-active' + '.e-disable');
16398
+ removeClass(activeItems, 'e-disable');
16399
+ }
16363
16400
  this.preventChange = this.isAngular && this.preventChange ? !this.preventChange : this.preventChange;
16364
16401
  break;
16365
16402
  case 'width':
@@ -17928,7 +17965,9 @@ class CheckBoxSelection {
17928
17965
  if (l10n.getConstant('selectAllText') === '') {
17929
17966
  l10n = new L10n('dropdowns', l10nLocale, this.parent.locale);
17930
17967
  }
17931
- this.selectAllSpan.textContent = unSelect ? l10n.getConstant('unSelectAllText') : l10n.getConstant('selectAllText');
17968
+ if (!isNullOrUndefined(this.selectAllSpan)) {
17969
+ this.selectAllSpan.textContent = unSelect ? l10n.getConstant('unSelectAllText') : l10n.getConstant('selectAllText');
17970
+ }
17932
17971
  }
17933
17972
  }
17934
17973
  getActiveList(args) {
@@ -18114,7 +18153,6 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
18114
18153
  this.list.setAttribute('role', 'listbox');
18115
18154
  attributes(this.list, { 'role': 'listbox', 'aria-label': 'listbox', 'aria-multiselectable': this.selectionSettings.mode === 'Multiple' ? 'true' : 'false' });
18116
18155
  this.updateSelectionSettings();
18117
- this.resizeHandler();
18118
18156
  }
18119
18157
  updateSelectionSettings() {
18120
18158
  if (this.selectionSettings.showCheckbox && this.selectionSettings.showSelectAll && this.liCollections.length) {
@@ -18360,7 +18398,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
18360
18398
  filterElem = this.list.getElementsByClassName('e-input-filter')[0];
18361
18399
  filterElem.selectionStart = txtLength;
18362
18400
  filterElem.selectionEnd = txtLength;
18363
- filterElem.focus();
18401
+ if (filterElem.value !== '') {
18402
+ filterElem.focus();
18403
+ }
18364
18404
  }
18365
18405
  }
18366
18406
  if (this.toolbarSettings.items.length && this.scope && this.scope.indexOf('#') > -1 && !isNullOrUndefined(e)) {
@@ -18804,33 +18844,22 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
18804
18844
  items = (items instanceof Array ? items : [items]);
18805
18845
  const fields = this.fields;
18806
18846
  let dataValue;
18807
- let objValue;
18847
+ let objValue = {};
18808
18848
  const dupData = [];
18809
- let itemIdx;
18810
18849
  extend(dupData, [], this.jsonData);
18811
18850
  const removeIdxes = [];
18812
18851
  const removeLiIdxes = [];
18852
+ for (let i = 0; i < dupData.length; i++) {
18853
+ const value = (dupData[i] instanceof Object) ? dupData[i][fields.value] : dupData[i].toString();
18854
+ objValue[value] = i;
18855
+ }
18813
18856
  for (let j = 0; j < items.length; j++) {
18814
- if (items[j] instanceof Object) {
18815
- dataValue = getValue(fields.value, items[j]);
18816
- }
18817
- else {
18818
- dataValue = items[j].toString();
18819
- }
18820
- for (let i = 0, len = dupData.length; i < len; i++) {
18821
- if (dupData[i] instanceof Object) {
18822
- objValue = getValue(fields.value, dupData[i]);
18823
- }
18824
- else {
18825
- objValue = dupData[i].toString();
18826
- }
18827
- if (objValue === dataValue) {
18828
- itemIdx = this.getIndexByValue(dataValue);
18829
- const idx = itemIdx === i ? itemIdx : i;
18830
- liCollections.push(liElement[idx]);
18831
- removeIdxes.push(idx);
18832
- removeLiIdxes.push(idx);
18833
- }
18857
+ dataValue = (items[j] instanceof Object) ? items[j][fields.value] : items[j].toString();
18858
+ if (objValue.hasOwnProperty(dataValue)) {
18859
+ const idx = objValue[dataValue];
18860
+ liCollections.push(liElement[idx]);
18861
+ removeIdxes.push(idx);
18862
+ removeLiIdxes.push(idx);
18834
18863
  }
18835
18864
  }
18836
18865
  for (let k = removeIdxes.length - 1; k >= 0; k--) {
@@ -21790,10 +21819,10 @@ let Mention = class Mention extends DropDownBase {
21790
21819
  }
21791
21820
  if (this.isContentEditable(this.inputElement)) {
21792
21821
  if (Browser.isAndroid) {
21793
- return '<span contenteditable="true" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
21822
+ return '<span contenteditable="true" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : '&#8203;');
21794
21823
  }
21795
21824
  else {
21796
- return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
21825
+ return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : '&#8203;');
21797
21826
  }
21798
21827
  }
21799
21828
  else {