@syncfusion/ej2-dropdowns 20.1.61 → 20.2.39

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.
Files changed (95) hide show
  1. package/CHANGELOG.md +3 -77
  2. package/dist/ej2-dropdowns.umd.min.js +2 -2
  3. package/dist/ej2-dropdowns.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-dropdowns.es2015.js +95 -96
  5. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  6. package/dist/es6/ej2-dropdowns.es5.js +58 -59
  7. package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
  8. package/dist/global/ej2-dropdowns.min.js +2 -2
  9. package/dist/global/ej2-dropdowns.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/helpers/e2e/autocomplete.js +59 -43
  12. package/helpers/e2e/combobox.js +62 -46
  13. package/helpers/e2e/dropdownlist.js +71 -55
  14. package/helpers/e2e/index.js +11 -9
  15. package/helpers/e2e/listboxHelper.js +55 -38
  16. package/helpers/e2e/multiselect.js +104 -88
  17. package/package.json +11 -11
  18. package/src/common/incremental-search.js +1 -1
  19. package/src/drop-down-base/drop-down-base-model.d.ts +1 -1
  20. package/src/drop-down-base/drop-down-base.d.ts +5 -1
  21. package/src/drop-down-base/drop-down-base.js +3 -5
  22. package/src/drop-down-list/drop-down-list.js +8 -8
  23. package/src/drop-down-tree/drop-down-tree-model.d.ts +2 -2
  24. package/src/drop-down-tree/drop-down-tree.js +5 -5
  25. package/src/list-box/list-box.d.ts +1 -1
  26. package/src/list-box/list-box.js +13 -14
  27. package/src/multi-select/multi-select-model.d.ts +1 -1
  28. package/src/multi-select/multi-select.d.ts +2 -1
  29. package/src/multi-select/multi-select.js +28 -26
  30. package/styles/auto-complete/_fusionnew-definition.scss +2 -0
  31. package/styles/auto-complete/_material3-definition.scss +2 -0
  32. package/styles/bootstrap-dark.css +69 -11
  33. package/styles/bootstrap.css +69 -11
  34. package/styles/bootstrap4.css +69 -11
  35. package/styles/bootstrap5-dark.css +70 -12
  36. package/styles/bootstrap5.css +70 -12
  37. package/styles/combo-box/_fusionnew-definition.scss +2 -0
  38. package/styles/combo-box/_material3-definition.scss +2 -0
  39. package/styles/drop-down-base/_fusionnew-definition.scss +111 -0
  40. package/styles/drop-down-base/_material3-definition.scss +111 -0
  41. package/styles/drop-down-list/_fusionnew-definition.scss +201 -0
  42. package/styles/drop-down-list/_material3-definition.scss +201 -0
  43. package/styles/drop-down-list/icons/_fusionnew.scss +14 -0
  44. package/styles/drop-down-list/icons/_material3.scss +14 -0
  45. package/styles/drop-down-tree/_fusionnew-definition.scss +60 -0
  46. package/styles/drop-down-tree/_material3-definition.scss +60 -0
  47. package/styles/drop-down-tree/icons/_fusionnew.scss +11 -0
  48. package/styles/drop-down-tree/icons/_material3.scss +11 -0
  49. package/styles/fabric-dark.css +69 -11
  50. package/styles/fabric.css +69 -11
  51. package/styles/fluent-dark.css +73 -15
  52. package/styles/fluent.css +70 -12
  53. package/styles/highcontrast-light.css +69 -11
  54. package/styles/highcontrast.css +69 -11
  55. package/styles/list-box/_bootstrap-dark-definition.scss +5 -1
  56. package/styles/list-box/_bootstrap-definition.scss +5 -1
  57. package/styles/list-box/_bootstrap4-definition.scss +5 -1
  58. package/styles/list-box/_bootstrap5-definition.scss +7 -2
  59. package/styles/list-box/_fabric-dark-definition.scss +5 -1
  60. package/styles/list-box/_fabric-definition.scss +5 -1
  61. package/styles/list-box/_fluent-definition.scss +7 -2
  62. package/styles/list-box/_fusionnew-definition.scss +113 -0
  63. package/styles/list-box/_highcontrast-definition.scss +5 -1
  64. package/styles/list-box/_highcontrast-light-definition.scss +5 -1
  65. package/styles/list-box/_layout.scss +45 -1
  66. package/styles/list-box/_material-dark-definition.scss +6 -2
  67. package/styles/list-box/_material-definition.scss +6 -2
  68. package/styles/list-box/_material3-definition.scss +119 -0
  69. package/styles/list-box/_tailwind-definition.scss +6 -2
  70. package/styles/list-box/_theme.scss +40 -8
  71. package/styles/list-box/bootstrap-dark.css +59 -11
  72. package/styles/list-box/bootstrap.css +69 -11
  73. package/styles/list-box/bootstrap4.css +69 -11
  74. package/styles/list-box/bootstrap5-dark.css +70 -12
  75. package/styles/list-box/bootstrap5.css +70 -12
  76. package/styles/list-box/fabric-dark.css +59 -11
  77. package/styles/list-box/fabric.css +69 -11
  78. package/styles/list-box/fluent-dark.css +73 -15
  79. package/styles/list-box/fluent.css +70 -12
  80. package/styles/list-box/highcontrast-light.css +59 -11
  81. package/styles/list-box/highcontrast.css +69 -11
  82. package/styles/list-box/icons/_fusionnew.scss +25 -0
  83. package/styles/list-box/icons/_material3.scss +25 -0
  84. package/styles/list-box/material-dark.css +60 -12
  85. package/styles/list-box/material.css +70 -12
  86. package/styles/list-box/tailwind-dark.css +70 -12
  87. package/styles/list-box/tailwind.css +70 -12
  88. package/styles/material-dark.css +70 -12
  89. package/styles/material.css +70 -12
  90. package/styles/multi-select/_fusionnew-definition.scss +219 -0
  91. package/styles/multi-select/_material3-definition.scss +219 -0
  92. package/styles/multi-select/icons/_fusionnew.scss +27 -0
  93. package/styles/multi-select/icons/_material3.scss +27 -0
  94. package/styles/tailwind-dark.css +70 -12
  95. package/styles/tailwind.css +70 -12
@@ -92,7 +92,7 @@ function Search(inputVal, items, searchType, ignoreCase) {
92
92
  for (var i = 0, itemsData = listItems; i < itemsData.length; i++) {
93
93
  var item = itemsData[i];
94
94
  var text = (ignoreCase ? item.textContent.toLocaleLowerCase() : item.textContent).replace(/^\s+|\s+$/g, '');
95
- if ((searchType === 'Equal' && text === queryStr) || (searchType === 'StartsWith' && text.substr(0, strLength) === queryStr) || (searchType === 'EndsWith' && text.substr(text.length - queryStr.length) === queryStr) || (searchType === 'Contains' && new RegExp(queryStr, 'g').test(text))) {
95
+ if ((searchType === 'Equal' && text === queryStr) || (searchType === 'StartsWith' && text.substr(0, strLength) === queryStr) || (searchType === 'EndsWith' && text.substr(text.length - queryStr.length) === queryStr) || (searchType === 'Contains' && new RegExp(queryStr, "g").test(text))) {
96
96
  itemData.item = item;
97
97
  itemData.index = i;
98
98
  return { item: item, index: i };
@@ -330,8 +330,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
330
330
  compareValue_1 = value;
331
331
  dataSource.filter(function (item) {
332
332
  var itemValue = getValue(fields.value, item);
333
- if (!isNullOrUndefined(itemValue) && !isNullOrUndefined(value)
334
- && itemValue.toString() === compareValue_1.toString()) {
333
+ if (!isNullOrUndefined(itemValue) && !isNullOrUndefined(value) && itemValue.toString() === compareValue_1.toString()) {
335
334
  value = getValue(fields.text, item);
336
335
  }
337
336
  });
@@ -757,7 +756,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
757
756
  if (this.getModuleName() === 'multiselect' && this.properties.allowCustomValue && this.fields.groupBy) {
758
757
  for (var i = 0; i < ulElement.childElementCount; i++) {
759
758
  if (ulElement.children[i].classList.contains('e-list-group-item')) {
760
- if (isNullOrUndefined(ulElement.children[i].innerHTML) || ulElement.children[i].innerHTML === '') {
759
+ if (isNullOrUndefined(ulElement.children[i].innerHTML) || ulElement.children[i].innerHTML == "") {
761
760
  addClass([ulElement.children[i]], HIDE_GROUPLIST);
762
761
  }
763
762
  }
@@ -1244,8 +1243,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1244
1243
  }
1245
1244
  if (this.itemTemplate && !isHeader) {
1246
1245
  var itemCheck = this.templateCompiler(this.itemTemplate);
1247
- var compiledString = itemCheck ?
1248
- compile(select(this.itemTemplate, document).innerHTML.trim()) : compile(this.itemTemplate);
1246
+ var compiledString = itemCheck ? compile(select(this.itemTemplate, document).innerHTML.trim()) : compile(this.itemTemplate);
1249
1247
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1250
1248
  var addItemTemplate = compiledString(item, this, 'itemTemplate', this.itemTemplateId, this.isStringTemplate, null, li);
1251
1249
  if (addItemTemplate) {
@@ -1749,7 +1747,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1749
1747
  return {
1750
1748
  'aria-disabled': 'false',
1751
1749
  'aria-owns': this.element.id + '_options',
1752
- 'role': 'listbox',
1750
+ 'role': 'combobox',
1753
1751
  'aria-haspopup': 'true',
1754
1752
  'aria-expanded': 'false',
1755
1753
  'aria-activedescendant': 'null',
@@ -2015,7 +2013,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2015
2013
  }
2016
2014
  else {
2017
2015
  var delay = 100;
2018
- this.closePopup(delay);
2016
+ this.closePopup(delay, e);
2019
2017
  }
2020
2018
  };
2021
2019
  DropDownList.prototype.onMouseOver = function (e) {
@@ -2239,7 +2237,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2239
2237
  this.isSelectCustom = false;
2240
2238
  this.onChangeEvent(e);
2241
2239
  }
2242
- this.hidePopup();
2240
+ this.hidePopup(e);
2243
2241
  this.focusDropDown(e);
2244
2242
  }
2245
2243
  else {
@@ -2961,7 +2959,6 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2961
2959
  this.initial = true;
2962
2960
  this.activeIndex = this.index;
2963
2961
  this.initRemoteRender = false;
2964
- this.initial = false;
2965
2962
  if (this.value && this.dataSource instanceof DataManager) {
2966
2963
  var checkField_1 = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
2967
2964
  var checkVal = list.some(function (x) { return x[checkField_1] === _this.value; });
@@ -2984,6 +2981,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2984
2981
  else {
2985
2982
  this.updateValues();
2986
2983
  }
2984
+ this.initial = false;
2987
2985
  }
2988
2986
  if (this.getModuleName() !== 'autocomplete' && this.isFiltering() && !this.isTyped) {
2989
2987
  if (!this.actionCompleteData.isUpdated || ((!this.isCustomFilter
@@ -3412,7 +3410,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3412
3410
  }
3413
3411
  }
3414
3412
  };
3415
- DropDownList.prototype.closePopup = function (delay) {
3413
+ DropDownList.prototype.closePopup = function (delay, e) {
3416
3414
  var _this = this;
3417
3415
  this.isTyped = false;
3418
3416
  if (!(this.popupObj && document.body.contains(this.popupObj.element) && this.beforePopupOpen)) {
@@ -3462,7 +3460,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3462
3460
  delay: delay ? delay : 0
3463
3461
  };
3464
3462
  var popupInstance = this.popupObj;
3465
- var eventArgs = { popup: popupInstance, cancel: false, animation: animModel };
3463
+ var eventArgs = { popup: popupInstance, cancel: false, animation: animModel, event: e || null };
3466
3464
  this.trigger('close', eventArgs, function (eventArgs) {
3467
3465
  if (!isNullOrUndefined(_this.popupObj) &&
3468
3466
  !isNullOrUndefined(_this.popupObj.element.querySelector('.e-fixed-head'))) {
@@ -3975,7 +3973,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3975
3973
  if (!this.enabled) {
3976
3974
  return;
3977
3975
  }
3978
- if (this.isFiltering() && this.dataSource instanceof DataManager && (this.actionData.list !== this.actionCompleteData.list) &&
3976
+ if (this.isFiltering() && this.dataSource instanceof DataManager && (this.actionData.list != this.actionCompleteData.list) &&
3979
3977
  this.actionData.list && this.actionData.ulElement) {
3980
3978
  this.actionCompleteData = this.actionData;
3981
3979
  this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list, null, true);
@@ -4037,7 +4035,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4037
4035
  this.resetSelection();
4038
4036
  }
4039
4037
  }
4040
- this.closePopup();
4038
+ this.closePopup(0, e);
4041
4039
  var dataItem = this.getItemData();
4042
4040
  var isSelectVal = !isNullOrUndefined(this.selectedLI);
4043
4041
  if (this.inputElement && this.inputElement.value.trim() === '' && !this.isInteracted && (this.isSelectCustom ||
@@ -6519,7 +6517,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6519
6517
  addClass([this.inputWrapper], SHOW_CHIP);
6520
6518
  }
6521
6519
  var chip = this.createElement('span', {
6522
- className: CHIP
6520
+ className: CHIP,
6523
6521
  });
6524
6522
  if (!this.inputEle.classList.contains(CHIP_INPUT)) {
6525
6523
  addClass([this.inputEle], CHIP_INPUT);
@@ -6655,7 +6653,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
6655
6653
  this.ensurePlaceHolder();
6656
6654
  };
6657
6655
  DropDownTree.prototype.resetValue = function (isDynamicChange) {
6658
- if (this.value === [] && this.text === null) {
6656
+ if (this.value == [] && this.text == null) {
6659
6657
  return;
6660
6658
  }
6661
6659
  Input.setValue(null, this.inputEle, this.floatLabelType);
@@ -7037,10 +7035,10 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
7037
7035
  this.updateTreeSettings(newProp);
7038
7036
  break;
7039
7037
  case 'customTemplate':
7040
- if (this.mode !== 'Custom') {
7038
+ if (this.mode !== "Custom") {
7041
7039
  return;
7042
7040
  }
7043
- this.chipCollection.innerHTML = '';
7041
+ this.chipCollection.innerHTML = "";
7044
7042
  this.setTagValues();
7045
7043
  break;
7046
7044
  case 'sortOrder':
@@ -7257,7 +7255,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
7257
7255
  Property('')
7258
7256
  ], DropDownTree.prototype, "cssClass", void 0);
7259
7257
  __decorate$2([
7260
- Property('${value.length} item(s) selected')
7258
+ Property("${value.length} item(s) selected")
7261
7259
  ], DropDownTree.prototype, "customTemplate", void 0);
7262
7260
  __decorate$2([
7263
7261
  Property(',')
@@ -8898,6 +8896,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
8898
8896
  function MultiSelect(option, element) {
8899
8897
  var _this = _super.call(this, option, element) || this;
8900
8898
  _this.clearIconWidth = 0;
8899
+ _this.previousFilterText = '';
8901
8900
  _this.isValidKey = false;
8902
8901
  _this.selectAllEventData = [];
8903
8902
  _this.selectAllEventEle = [];
@@ -9395,7 +9394,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9395
9394
  this.showPopup();
9396
9395
  }
9397
9396
  else {
9398
- this.hidePopup();
9397
+ this.hidePopup(e);
9399
9398
  }
9400
9399
  }
9401
9400
  else if (!this.openOnClick && this.mode === 'CheckBox' && !this.isPopupOpen()) {
@@ -9464,7 +9463,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9464
9463
  var list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;
9465
9464
  if (this.backCommand) {
9466
9465
  this.remoteCustomValue = false;
9467
- if (this.allowCustomValue && list.querySelectorAll('li').length === 0 && this.mainData.length > 0) {
9466
+ if (this.allowCustomValue && list.querySelectorAll('li').length == 0 && this.mainData.length > 0) {
9468
9467
  this.mainData = [];
9469
9468
  }
9470
9469
  this.onActionComplete(list, this.mainData);
@@ -9555,7 +9554,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9555
9554
  this.showPopup();
9556
9555
  }
9557
9556
  else {
9558
- this.hidePopup();
9557
+ this.hidePopup(e);
9559
9558
  if (this.mode === 'CheckBox') {
9560
9559
  this.showOverAllClear();
9561
9560
  this.inputFocus = true;
@@ -9633,6 +9632,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9633
9632
  }
9634
9633
  }
9635
9634
  }
9635
+ this.updateDataList();
9636
9636
  this.refreshListItems(null);
9637
9637
  if (this.mode !== 'Box' && this.mode !== 'CheckBox') {
9638
9638
  this.updateDelimView();
@@ -9643,7 +9643,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9643
9643
  }
9644
9644
  this.overAllClear.style.display = 'none';
9645
9645
  if (this.isPopupOpen()) {
9646
- this.hidePopup();
9646
+ this.hidePopup(eve);
9647
9647
  }
9648
9648
  this.makeTextBoxEmpty();
9649
9649
  this.trigger('blur');
@@ -9837,7 +9837,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9837
9837
  MultiSelect.prototype.popupKeyActions = function (e) {
9838
9838
  switch (e.keyCode) {
9839
9839
  case 38:
9840
- this.hidePopup();
9840
+ this.hidePopup(e);
9841
9841
  if (this.mode === 'CheckBox') {
9842
9842
  this.inputElement.focus();
9843
9843
  }
@@ -9859,7 +9859,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9859
9859
  var filterInput = this.popupWrapper.querySelector('.' + FILTERINPUT);
9860
9860
  filterInput && filterInput.setAttribute('aria-activedescendant', focusedItem.id);
9861
9861
  }
9862
- else if (this.mode === 'CheckBox') {
9862
+ else if (this.mode == "CheckBox") {
9863
9863
  this.overAllWrapper.setAttribute('aria-activedescendant', focusedItem.id);
9864
9864
  }
9865
9865
  }
@@ -9919,7 +9919,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9919
9919
  break;
9920
9920
  case 27:
9921
9921
  e.preventDefault();
9922
- this.hidePopup();
9922
+ this.hidePopup(e);
9923
9923
  if (this.mode === 'CheckBox') {
9924
9924
  this.inputElement.focus();
9925
9925
  }
@@ -9936,7 +9936,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9936
9936
  return;
9937
9937
  case 9:
9938
9938
  e.preventDefault();
9939
- this.hidePopup();
9939
+ this.hidePopup(e);
9940
9940
  this.inputElement.focus();
9941
9941
  this.overAllWrapper.classList.add(FOCUS);
9942
9942
  }
@@ -9964,6 +9964,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9964
9964
  this.keyNavigation(e);
9965
9965
  }
9966
9966
  if (this.mode === 'CheckBox' && this.enableSelectionOrder) {
9967
+ if (this.allowFiltering) {
9968
+ this.previousFilterText = this.targetElement();
9969
+ }
9967
9970
  this.checkBackCommand(e);
9968
9971
  }
9969
9972
  this.expandTextbox();
@@ -10012,7 +10015,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10012
10015
  this.checkPlaceholderSize();
10013
10016
  };
10014
10017
  MultiSelect.prototype.checkBackCommand = function (e) {
10015
- if (e.keyCode === 8 && this.targetElement() === '') {
10018
+ if (e.keyCode === 8 && this.allowFiltering ? this.targetElement() !== this.previousFilterText : this.targetElement() === '') {
10016
10019
  this.backCommand = false;
10017
10020
  }
10018
10021
  else {
@@ -10158,7 +10161,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10158
10161
  }
10159
10162
  this.refreshSelection();
10160
10163
  if (this.closePopupOnSelect) {
10161
- this.hidePopup();
10164
+ this.hidePopup(e);
10162
10165
  }
10163
10166
  }
10164
10167
  this.refreshPlaceHolder();
@@ -10190,7 +10193,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10190
10193
  this.makeTextBoxEmpty();
10191
10194
  }
10192
10195
  if (this.closePopupOnSelect) {
10193
- this.hidePopup();
10196
+ this.hidePopup(e);
10194
10197
  }
10195
10198
  this.checkPlaceholderSize();
10196
10199
  };
@@ -10310,7 +10313,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10310
10313
  value = customVal;
10311
10314
  }
10312
10315
  if (this.isPopupOpen() && this.mode !== 'CheckBox') {
10313
- this.hidePopup();
10316
+ this.hidePopup(e);
10314
10317
  }
10315
10318
  if (!this.inputFocus) {
10316
10319
  this.inputElement.focus();
@@ -10424,7 +10427,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
10424
10427
  });
10425
10428
  _this.invokeCheckboxSelection(element_1, eve, isClearAll);
10426
10429
  }
10427
- if (_this.hideSelectedItem && _this.fields.groupBy) {
10430
+ if (_this.hideSelectedItem && _this.fields.groupBy && element_1) {
10428
10431
  _this.hideGroupItem(value);
10429
10432
  }
10430
10433
  if (_this.hideSelectedItem && _this.fixedHeaderElement && _this.fields.groupBy && _this.mode !== 'CheckBox' &&
@@ -11268,15 +11271,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11268
11271
  }
11269
11272
  };
11270
11273
  MultiSelect.prototype.updateDataList = function () {
11271
- if (this.mainList && this.ulElement) {
11274
+ if (this.mainList && this.ulElement && !(this.isFiltered || this.filterAction)) {
11272
11275
  var isDynamicGroupItemUpdate = this.mainList.childElementCount < this.ulElement.childElementCount;
11273
- var isReactTemplateUpdate = ((this.ulElement.childElementCount > 0 &&
11274
- this.ulElement.children[0].childElementCount > 0) &&
11275
- (this.mainList.children[0].childElementCount < this.ulElement.children[0].childElementCount));
11276
- var isAngularTemplateUpdate = this.itemTemplate && this.ulElement.childElementCount > 0
11277
- && !(this.ulElement.childElementCount < this.mainList.childElementCount)
11278
- && (this.ulElement.children[0].childElementCount > 0
11279
- || (this.fields.groupBy && this.ulElement.children[1] && this.ulElement.children[1].childElementCount > 0));
11276
+ var isReactTemplateUpdate = ((this.ulElement.childElementCount > 0 && this.ulElement.children[0].childElementCount > 0) && (this.mainList.children[0].childElementCount < this.ulElement.children[0].childElementCount));
11277
+ var isAngularTemplateUpdate = this.itemTemplate && this.ulElement.childElementCount > 0 && !(this.ulElement.childElementCount < this.mainList.childElementCount) && (this.ulElement.children[0].childElementCount > 0 || (this.fields.groupBy && this.ulElement.children[1] && this.ulElement.children[1].childElementCount > 0));
11280
11278
  if (isDynamicGroupItemUpdate || isReactTemplateUpdate || isAngularTemplateUpdate) {
11281
11279
  //EJ2-57748 - for this task, we prevent the ul element cloning ( this.mainList = this.ulElement.cloneNode ? <HTMLElement>this.ulElement.cloneNode(true) : this.ulElement;)
11282
11280
  this.mainList = this.ulElement;
@@ -11495,7 +11493,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11495
11493
  this.focusAtFirstListItem();
11496
11494
  }
11497
11495
  if (this.closePopupOnSelect) {
11498
- this.hidePopup();
11496
+ this.hidePopup(e);
11499
11497
  }
11500
11498
  else {
11501
11499
  e.preventDefault();
@@ -12348,6 +12346,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12348
12346
  }
12349
12347
  return valuecheck;
12350
12348
  };
12349
+
12351
12350
  MultiSelect.prototype.addNonPresentItems = function (valuecheck, ulElement, list, event) {
12352
12351
  var _this = this;
12353
12352
  this.dataSource.executeQuery(this.getForQuery(valuecheck)).then(function (e) {
@@ -12355,6 +12354,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12355
12354
  _this.updateActionList(ulElement, list, event);
12356
12355
  });
12357
12356
  };
12357
+
12358
12358
  MultiSelect.prototype.updateVal = function (newProp, oldProp, prop) {
12359
12359
  if (!this.list) {
12360
12360
  this.onLoadSelect();
@@ -12367,7 +12367,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12367
12367
  if (!isNullOrUndefined(this.value) && !this.allowCustomValue) {
12368
12368
  valuecheck = this.presentItemValue(this.ulElement);
12369
12369
  }
12370
- if (prop === 'value' && valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
12370
+ if (prop == 'value' && valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
12371
12371
  && this.listData != null) {
12372
12372
  this.mainData = null;
12373
12373
  this.setDynValue = true;
@@ -12421,7 +12421,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12421
12421
  *
12422
12422
  * @returns {void}
12423
12423
  */
12424
- MultiSelect.prototype.hidePopup = function () {
12424
+ MultiSelect.prototype.hidePopup = function (e) {
12425
12425
  var _this = this;
12426
12426
  var delay = 100;
12427
12427
  if (this.isPopupOpen()) {
@@ -12430,7 +12430,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12430
12430
  duration: 100,
12431
12431
  delay: delay ? delay : 0
12432
12432
  };
12433
- var eventArgs = { popup: this.popupObj, cancel: false, animation: animModel };
12433
+ var eventArgs = { popup: this.popupObj, cancel: false, animation: animModel, event: e || null };
12434
12434
  this.trigger('close', eventArgs, function (eventArgs) {
12435
12435
  if (!eventArgs.cancel) {
12436
12436
  if (_this.fields.groupBy && _this.mode !== 'CheckBox' && _this.fixedHeaderElement) {
@@ -12478,7 +12478,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12478
12478
  var mainLiLength = _this.ulElement.querySelectorAll('li.' + 'e-list-item').length;
12479
12479
  var liLength = _this.ulElement.querySelectorAll('li.'
12480
12480
  + dropDownBaseClasses.li + '.' + HIDE_LIST).length;
12481
- if (mainLiLength > 0 && (mainLiLength === liLength) && (liLength === _this.mainData.length)) {
12481
+ if (mainLiLength > 0 && (mainLiLength === liLength) && (liLength === _this.mainData.length) && !(_this.targetElement() !== '' && _this.allowCustomValue)) {
12482
12482
  _this.beforePopupOpen = false;
12483
12483
  return;
12484
12484
  }
@@ -13685,8 +13685,8 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
13685
13685
  });
13686
13686
  }
13687
13687
  };
13688
- ListBox.prototype.updateActionCompleteData = function (li, item) {
13689
- this.jsonData.push(item);
13688
+ ListBox.prototype.updateActionCompleteData = function (li, item, index) {
13689
+ this.jsonData.splice(index, 0, item);
13690
13690
  };
13691
13691
  ListBox.prototype.initToolbar = function () {
13692
13692
  var pos = this.toolbarSettings.position;
@@ -13902,10 +13902,10 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
13902
13902
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13903
13903
  var event = args.event;
13904
13904
  var wrapper;
13905
- if (args.target && (args.target.classList.contains('e-listbox-wrapper') || args.target.classList.contains('e-list-item')
13906
- || args.target.classList.contains('e-filter-parent') || args.target.classList.contains('e-input-group'))) {
13907
- if (args.target.classList.contains('e-list-item') || args.target.classList.contains('e-filter-parent')
13908
- || args.target.classList.contains('e-input-group')) {
13905
+ if (args.target && (args.target.classList.contains("e-listbox-wrapper") || args.target.classList.contains("e-list-item")
13906
+ || args.target.classList.contains("e-filter-parent") || args.target.classList.contains("e-input-group"))) {
13907
+ if (args.target.classList.contains("e-list-item") || args.target.classList.contains("e-filter-parent")
13908
+ || args.target.classList.contains("e-input-group")) {
13909
13909
  wrapper = args.target.closest('.e-listbox-wrapper');
13910
13910
  }
13911
13911
  else {
@@ -13960,8 +13960,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
13960
13960
  var getArgs = this.getDragArgs({ target: args.droppedElement }, true);
13961
13961
  var sourceArgs = { previousData: this.dataSource };
13962
13962
  var destArgs = { previousData: listObj.dataSource };
13963
- var dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource },
13964
- previousIndex: args.previousIndex, currentIndex: args.currentIndex });
13963
+ var dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource }, previousIndex: args.previousIndex, currentIndex: args.currentIndex });
13965
13964
  if (listObj !== this) {
13966
13965
  var sourceArgs1 = extend(sourceArgs, { currentData: this.listData });
13967
13966
  dragArgs = extend(dragArgs, { source: sourceArgs1, destination: destArgs });
@@ -14092,7 +14091,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14092
14091
  };
14093
14092
  ListBox.prototype.updateListItems = function (sourceElem, destElem) {
14094
14093
  var i = 0;
14095
- destElem.innerHTML = '';
14094
+ destElem.innerHTML = "";
14096
14095
  while (i < sourceElem.childNodes.length) {
14097
14096
  destElem.appendChild(sourceElem.childNodes[i]);
14098
14097
  }
@@ -14232,7 +14231,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14232
14231
  var objValue = void 0;
14233
14232
  var dupData = [];
14234
14233
  var itemIdx = void 0;
14235
- extend(dupData, [], this.listData);
14234
+ extend(dupData, [], this.jsonData);
14236
14235
  var removeIdxes = [];
14237
14236
  var removeLiIdxes = [];
14238
14237
  for (var j = 0; j < items.length; j++) {
@@ -15085,7 +15084,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
15085
15084
  break;
15086
15085
  }
15087
15086
  }
15088
- var elems = Array.prototype.slice.call(this.element.nextElementSibling.querySelectorAll('.e-grabbed'));
15087
+ var elems = Array.prototype.slice.call(this.element.querySelectorAll('.e-grabbed'));
15089
15088
  return elems;
15090
15089
  };
15091
15090
  ListBox.prototype.getDragArgs = function (args, isDragEnd) {
@@ -15141,7 +15140,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
15141
15140
  }
15142
15141
  }
15143
15142
  }
15144
- else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !== 'KeyA') {
15143
+ else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !== "KeyA") {
15145
15144
  this.upDownKeyHandler(e);
15146
15145
  }
15147
15146
  }
@@ -15185,8 +15184,8 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
15185
15184
  }
15186
15185
  if (this.selectionSettings.showCheckbox && e.ctrlKey && e.shiftKey && (e.keyCode === 36 || e.keyCode === 35)) {
15187
15186
  var selectedidx = Array.prototype.indexOf.call(ul.children, fli);
15188
- var sidx = e.code === 'Home' ? 0 : selectedidx;
15189
- var eidx = e.code === 'Home' ? selectedidx : ul.children.length - 1;
15187
+ var sidx = e.code === "Home" ? 0 : selectedidx;
15188
+ var eidx = e.code === "Home" ? selectedidx : ul.children.length - 1;
15190
15189
  for (var i = sidx; i <= eidx; i++) {
15191
15190
  var item = ul.children[i];
15192
15191
  this.notify('updatelist', { li: item, e: {