@syncfusion/ej2-dropdowns 26.2.7 → 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.
@@ -10265,10 +10265,41 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
10265
10265
  value = this.allowObjectBinding && !isNullOrUndefined(value) ? getValue((this.fields.value) ? this.fields.value : '', value) : value;
10266
10266
  var inputValue = isNullOrUndefined(value) ? null : value.toString();
10267
10267
  Input.setValue(inputValue, this.inputElement, this.floatLabelType, this.showClearButton);
10268
+ var changeData = {};
10268
10269
  if (this.allowObjectBinding) {
10269
10270
  value = this.getDataByValue(value);
10271
+ if (isNullOrUndefined(value)) {
10272
+ var fields_1 = this.fields;
10273
+ var isvalidTextField_1 = false;
10274
+ var isValidValue_1 = false;
10275
+ if (this.allowObjectBinding) {
10276
+ var keys = Object.keys(this.value);
10277
+ keys.forEach(function (key) {
10278
+ if (key === fields_1.value) {
10279
+ isValidValue_1 = true;
10280
+ return;
10281
+ }
10282
+ });
10283
+ keys.forEach(function (key) {
10284
+ if (key === fields_1.text) {
10285
+ isvalidTextField_1 = true;
10286
+ return;
10287
+ }
10288
+ });
10289
+ }
10290
+ changeData = {
10291
+ text: isValidValue_1 ? isvalidTextField_1 ? getValue(fields_1.text, this.value) : getValue(fields_1.value, this.value) : null,
10292
+ value: isValidValue_1 ? this.value : null,
10293
+ index: null
10294
+ };
10295
+ }
10296
+ }
10297
+ if (this.allowObjectBinding) {
10298
+ this.setProperties(changeData, true);
10299
+ }
10300
+ else {
10301
+ this.setProperties({ value: value, text: value, index: null }, true);
10270
10302
  }
10271
- this.setProperties({ value: value, text: value, index: null }, true);
10272
10303
  this.activeIndex = this.index;
10273
10304
  var fields = this.fields;
10274
10305
  var dataItem = {};
@@ -10808,7 +10839,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
10808
10839
  }
10809
10840
  }
10810
10841
  }
10811
- else if (this.allowCustom) {
10842
+ else if (this.allowCustom && this.isInteracted) {
10812
10843
  this.isSelectCustom = true;
10813
10844
  }
10814
10845
  };
@@ -13223,7 +13254,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
13223
13254
  MultiSelect.prototype.expandTextbox = function () {
13224
13255
  var size = 5;
13225
13256
  if (this.placeholder) {
13226
- size = size > this.inputElement.placeholder.length ? size : this.inputElement.placeholder.length;
13257
+ var codePoint = this.placeholder.charCodeAt(0);
13258
+ var sizeMultiplier = (0xAC00 <= codePoint && codePoint <= 0xD7AF) ? 1.5 : (0x4E00 <= codePoint && codePoint <= 0x9FFF) ? 2 : 1;
13259
+ size = size > this.inputElement.placeholder.length ? size : this.inputElement.placeholder.length * sizeMultiplier;
13227
13260
  }
13228
13261
  if (this.inputElement.value.length > size) {
13229
13262
  this.inputElement.size = this.inputElement.value.length;
@@ -14902,7 +14935,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
14902
14935
  if (this.mode === 'CheckBox') {
14903
14936
  this.refreshPlaceHolder();
14904
14937
  this.refreshInputHight();
14905
- if (!this.changeOnBlur && isClearAll && (isNullOrUndefined(this.value) || this.value.length === 0)) {
14938
+ if (this.changeOnBlur && isClearAll && (isNullOrUndefined(this.value) || this.value.length === 0)) {
14906
14939
  this.updateValueState(e, this.value, this.tempValues);
14907
14940
  }
14908
14941
  }
@@ -16621,6 +16654,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16621
16654
  if (!this.closePopupOnSelect && this.isPopupOpen()) {
16622
16655
  this.refreshPopup();
16623
16656
  }
16657
+ if (this.isPopupOpen() && this.mode === 'CheckBox' && this.list && this.list.querySelector('.e-active.e-disable')) {
16658
+ var activeItems = this.list.querySelectorAll('li.' + dropDownBaseClasses.li + '.e-active' + '.e-disable');
16659
+ removeClass(activeItems, 'e-disable');
16660
+ }
16624
16661
  this.preventChange = this.isAngular && this.preventChange ? !this.preventChange : this.preventChange;
16625
16662
  break;
16626
16663
  case 'width':
@@ -18197,7 +18234,9 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
18197
18234
  if (l10n.getConstant('selectAllText') === '') {
18198
18235
  l10n = new L10n('dropdowns', l10nLocale, this.parent.locale);
18199
18236
  }
18200
- this.selectAllSpan.textContent = unSelect ? l10n.getConstant('unSelectAllText') : l10n.getConstant('selectAllText');
18237
+ if (!isNullOrUndefined(this.selectAllSpan)) {
18238
+ this.selectAllSpan.textContent = unSelect ? l10n.getConstant('unSelectAllText') : l10n.getConstant('selectAllText');
18239
+ }
18201
18240
  }
18202
18241
  };
18203
18242
  CheckBoxSelection.prototype.getActiveList = function (args) {
@@ -18409,7 +18448,6 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
18409
18448
  this.list.setAttribute('role', 'listbox');
18410
18449
  attributes(this.list, { 'role': 'listbox', 'aria-label': 'listbox', 'aria-multiselectable': this.selectionSettings.mode === 'Multiple' ? 'true' : 'false' });
18411
18450
  this.updateSelectionSettings();
18412
- this.resizeHandler();
18413
18451
  };
18414
18452
  ListBox.prototype.updateSelectionSettings = function () {
18415
18453
  if (this.selectionSettings.showCheckbox && this.selectionSettings.showSelectAll && this.liCollections.length) {
@@ -18657,7 +18695,9 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
18657
18695
  filterElem = this.list.getElementsByClassName('e-input-filter')[0];
18658
18696
  filterElem.selectionStart = txtLength;
18659
18697
  filterElem.selectionEnd = txtLength;
18660
- filterElem.focus();
18698
+ if (filterElem.value !== '') {
18699
+ filterElem.focus();
18700
+ }
18661
18701
  }
18662
18702
  }
18663
18703
  if (this.toolbarSettings.items.length && this.scope && this.scope.indexOf('#') > -1 && !isNullOrUndefined(e)) {
@@ -19108,33 +19148,22 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
19108
19148
  items = (items instanceof Array ? items : [items]);
19109
19149
  var fields = this.fields;
19110
19150
  var dataValue = void 0;
19111
- var objValue = void 0;
19151
+ var objValue = {};
19112
19152
  var dupData = [];
19113
- var itemIdx = void 0;
19114
19153
  extend(dupData, [], this.jsonData);
19115
19154
  var removeIdxes = [];
19116
19155
  var removeLiIdxes = [];
19156
+ for (var i = 0; i < dupData.length; i++) {
19157
+ var value = (dupData[i] instanceof Object) ? dupData[i][fields.value] : dupData[i].toString();
19158
+ objValue[value] = i;
19159
+ }
19117
19160
  for (var j = 0; j < items.length; j++) {
19118
- if (items[j] instanceof Object) {
19119
- dataValue = getValue(fields.value, items[j]);
19120
- }
19121
- else {
19122
- dataValue = items[j].toString();
19123
- }
19124
- for (var i = 0, len = dupData.length; i < len; i++) {
19125
- if (dupData[i] instanceof Object) {
19126
- objValue = getValue(fields.value, dupData[i]);
19127
- }
19128
- else {
19129
- objValue = dupData[i].toString();
19130
- }
19131
- if (objValue === dataValue) {
19132
- itemIdx = this.getIndexByValue(dataValue);
19133
- var idx = itemIdx === i ? itemIdx : i;
19134
- liCollections.push(liElement[idx]);
19135
- removeIdxes.push(idx);
19136
- removeLiIdxes.push(idx);
19137
- }
19161
+ dataValue = (items[j] instanceof Object) ? items[j][fields.value] : items[j].toString();
19162
+ if (objValue.hasOwnProperty(dataValue)) {
19163
+ var idx = objValue[dataValue];
19164
+ liCollections.push(liElement[idx]);
19165
+ removeIdxes.push(idx);
19166
+ removeLiIdxes.push(idx);
19138
19167
  }
19139
19168
  }
19140
19169
  for (var k = removeIdxes.length - 1; k >= 0; k--) {
@@ -22144,10 +22173,10 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
22144
22173
  }
22145
22174
  if (this.isContentEditable(this.inputElement)) {
22146
22175
  if (Browser.isAndroid) {
22147
- return '<span contenteditable="true" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
22176
+ return '<span contenteditable="true" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : '&#8203;');
22148
22177
  }
22149
22178
  else {
22150
- return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
22179
+ return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : '&#8203;');
22151
22180
  }
22152
22181
  }
22153
22182
  else {