@syncfusion/ej2-dropdowns 20.1.47 → 20.1.52

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.
@@ -87,11 +87,12 @@ function Search(inputVal, items, searchType, ignoreCase) {
87
87
  const itemData = { item: null, index: null };
88
88
  if (inputVal && inputVal.length) {
89
89
  const strLength = inputVal.length;
90
- const queryStr = ignoreCase ? inputVal.toLocaleLowerCase() : inputVal;
90
+ let queryStr = ignoreCase ? inputVal.toLocaleLowerCase() : inputVal;
91
+ queryStr = escapeCharRegExp(queryStr);
91
92
  for (let i = 0, itemsData = listItems; i < itemsData.length; i++) {
92
93
  const item = itemsData[i];
93
94
  const text = (ignoreCase ? item.textContent.toLocaleLowerCase() : item.textContent).replace(/^\s+|\s+$/g, '');
94
- 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))) {
95
96
  itemData.item = item;
96
97
  itemData.index = i;
97
98
  return { item: item, index: i };
@@ -101,6 +102,9 @@ function Search(inputVal, items, searchType, ignoreCase) {
101
102
  }
102
103
  return itemData;
103
104
  }
105
+ function escapeCharRegExp(value) {
106
+ return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
107
+ }
104
108
  function resetIncrementalSearchValues(elementId) {
105
109
  if (prevElementId === elementId) {
106
110
  prevElementId = '';
@@ -304,7 +308,8 @@ let DropDownBase = class DropDownBase extends Component {
304
308
  compareValue = value;
305
309
  dataSource.filter((item) => {
306
310
  const itemValue = getValue(fields.value, item);
307
- if (!isNullOrUndefined(itemValue) && !isNullOrUndefined(value) && itemValue.toString() === compareValue.toString()) {
311
+ if (!isNullOrUndefined(itemValue) && !isNullOrUndefined(value)
312
+ && itemValue.toString() === compareValue.toString()) {
308
313
  value = getValue(fields.text, item);
309
314
  }
310
315
  });
@@ -727,7 +732,7 @@ let DropDownBase = class DropDownBase extends Component {
727
732
  if (this.getModuleName() === 'multiselect' && this.properties.allowCustomValue && this.fields.groupBy) {
728
733
  for (let i = 0; i < ulElement.childElementCount; i++) {
729
734
  if (ulElement.children[i].classList.contains('e-list-group-item')) {
730
- if (isNullOrUndefined(ulElement.children[i].innerHTML) || ulElement.children[i].innerHTML == "") {
735
+ if (isNullOrUndefined(ulElement.children[i].innerHTML) || ulElement.children[i].innerHTML === '') {
731
736
  addClass([ulElement.children[i]], HIDE_GROUPLIST);
732
737
  }
733
738
  }
@@ -854,8 +859,8 @@ let DropDownBase = class DropDownBase extends Component {
854
859
  this.scrollStop(e);
855
860
  }
856
861
  scrollStop(e) {
857
- let target = !isNullOrUndefined(e) ? e.target : this.list;
858
- let liHeight = parseInt(getComputedStyle(this.getValidLi(), null).getPropertyValue('height'), 10);
862
+ const target = !isNullOrUndefined(e) ? e.target : this.list;
863
+ const liHeight = parseInt(getComputedStyle(this.getValidLi(), null).getPropertyValue('height'), 10);
859
864
  const topIndex = Math.round(target.scrollTop / liHeight);
860
865
  const liCollections = this.list.querySelectorAll('li' + ':not(.e-hide-listitem)');
861
866
  for (let i = topIndex; i > -1; i--) {
@@ -943,10 +948,10 @@ let DropDownBase = class DropDownBase extends Component {
943
948
  Refer bug report https://bugzilla.mozilla.org/show_bug.cgi?id=137688
944
949
  Refer alternate solution https://stackoverflow.com/a/41696234/9133493*/
945
950
  if (isNaN(borderWidth)) {
946
- let borderTopWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-top-width'), 10);
947
- let borderBottomWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-bottom-width'), 10);
948
- let borderLeftWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-left-width'), 10);
949
- let borderRightWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-right-width'), 10);
951
+ const borderTopWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-top-width'), 10);
952
+ const borderBottomWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-bottom-width'), 10);
953
+ const borderLeftWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-left-width'), 10);
954
+ const borderRightWidth = parseInt(document.defaultView.getComputedStyle(this.list.parentElement, null).getPropertyValue('border-right-width'), 10);
950
955
  borderWidth = (borderTopWidth + borderBottomWidth + borderLeftWidth + borderRightWidth);
951
956
  }
952
957
  }
@@ -1030,6 +1035,7 @@ let DropDownBase = class DropDownBase extends Component {
1030
1035
  dataSource = this.selectData;
1031
1036
  }
1032
1037
  }
1038
+ dataSource = this.getModuleName() === 'combobox' && this.selectData && dataSource instanceof Array && dataSource.length < this.selectData.length ? this.selectData : dataSource;
1033
1039
  this.setListData(dataSource, fields, query);
1034
1040
  }
1035
1041
  }
@@ -1212,7 +1218,8 @@ let DropDownBase = class DropDownBase extends Component {
1212
1218
  }
1213
1219
  if (this.itemTemplate && !isHeader) {
1214
1220
  const itemCheck = this.templateCompiler(this.itemTemplate);
1215
- const compiledString = itemCheck ? compile(select(this.itemTemplate, document).innerHTML.trim()) : compile(this.itemTemplate);
1221
+ const compiledString = itemCheck ?
1222
+ compile(select(this.itemTemplate, document).innerHTML.trim()) : compile(this.itemTemplate);
1216
1223
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1217
1224
  const addItemTemplate = compiledString(item, this, 'itemTemplate', this.itemTemplateId, this.isStringTemplate, null, li);
1218
1225
  if (addItemTemplate) {
@@ -2383,9 +2390,9 @@ let DropDownList = class DropDownList extends DropDownBase {
2383
2390
  detach(this.valueTempElement);
2384
2391
  this.inputElement.style.display = 'block';
2385
2392
  }
2386
- let clearIcon = dropDownListClasses.clearIcon;
2387
- let isFilterElement = this.isFiltering() && this.filterInput && (this.getModuleName() === 'combobox');
2388
- let clearElement = isFilterElement && this.filterInput.parentElement.querySelector('.' + clearIcon);
2393
+ const clearIcon = dropDownListClasses.clearIcon;
2394
+ const isFilterElement = this.isFiltering() && this.filterInput && (this.getModuleName() === 'combobox');
2395
+ const clearElement = isFilterElement && this.filterInput.parentElement.querySelector('.' + clearIcon);
2389
2396
  if (this.isFiltering() && clearElement) {
2390
2397
  clearElement.style.removeProperty('visibility');
2391
2398
  }
@@ -3890,7 +3897,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3890
3897
  if (!this.enabled) {
3891
3898
  return;
3892
3899
  }
3893
- if (this.isFiltering() && this.dataSource instanceof DataManager && (this.actionData.list != this.actionCompleteData.list) &&
3900
+ if (this.isFiltering() && this.dataSource instanceof DataManager && (this.actionData.list !== this.actionCompleteData.list) &&
3894
3901
  this.actionData.list && this.actionData.ulElement) {
3895
3902
  this.actionCompleteData = this.actionData;
3896
3903
  this.onActionComplete(this.actionCompleteData.ulElement, this.actionCompleteData.list, null, true);
@@ -5485,7 +5492,7 @@ let DropDownTree = class DropDownTree extends Component {
5485
5492
  }
5486
5493
  else {
5487
5494
  if (this.showCheckBox) {
5488
- let difference = this.value.filter((e) => {
5495
+ const difference = this.value.filter((e) => {
5489
5496
  return this.treeObj.checkedNodes.indexOf(e) === -1;
5490
5497
  });
5491
5498
  if (difference.length > 0 || this.treeSettings.autoCheck) {
@@ -6248,7 +6255,7 @@ let DropDownTree = class DropDownTree extends Component {
6248
6255
  }
6249
6256
  else if (this.treeDataType === 1) {
6250
6257
  for (let i = 0, objlen = this.treeItems.length; i < objlen; i++) {
6251
- let dataId = getValue(this.fields.value, this.treeItems[i]);
6258
+ const dataId = getValue(this.fields.value, this.treeItems[i]);
6252
6259
  if (!isNullOrUndefined(this.treeItems[i]) && !isNullOrUndefined(dataId) && dataId.toString() === id) {
6253
6260
  return this.treeItems[i];
6254
6261
  }
@@ -6265,19 +6272,19 @@ let DropDownTree = class DropDownTree extends Component {
6265
6272
  return newChildItems;
6266
6273
  }
6267
6274
  for (let i = 0, objlen = obj.length; i < objlen; i++) {
6268
- let dataValue = getValue(mapper.value, obj[i]);
6275
+ const dataValue = getValue(mapper.value, obj[i]);
6269
6276
  if (obj[i] && dataValue && dataValue.toString() === id) {
6270
6277
  return obj[i];
6271
6278
  }
6272
6279
  else if (typeof mapper.child === 'string' && !isNullOrUndefined(getValue(mapper.child, obj[i]))) {
6273
- let childNodeData = getValue(mapper.child, obj[i]);
6280
+ const childNodeData = getValue(mapper.child, obj[i]);
6274
6281
  newChildItems = this.getChildNodeData(childNodeData, this.getChildMapperFields(mapper), id);
6275
6282
  if (newChildItems !== undefined) {
6276
6283
  break;
6277
6284
  }
6278
6285
  }
6279
6286
  else if (this.fields.dataSource instanceof DataManager && !isNullOrUndefined(getValue('child', obj[i]))) {
6280
- let child = 'child';
6287
+ const child = 'child';
6281
6288
  newChildItems = this.getChildNodeData(getValue(child, obj[i]), this.getChildMapperFields(mapper), id);
6282
6289
  if (newChildItems !== undefined) {
6283
6290
  break;
@@ -6396,7 +6403,7 @@ let DropDownTree = class DropDownTree extends Component {
6396
6403
  addClass([this.inputWrapper], SHOW_CHIP);
6397
6404
  }
6398
6405
  const chip = this.createElement('span', {
6399
- className: CHIP,
6406
+ className: CHIP
6400
6407
  });
6401
6408
  if (!this.inputEle.classList.contains(CHIP_INPUT)) {
6402
6409
  addClass([this.inputEle], CHIP_INPUT);
@@ -6532,7 +6539,7 @@ let DropDownTree = class DropDownTree extends Component {
6532
6539
  this.ensurePlaceHolder();
6533
6540
  }
6534
6541
  resetValue(isDynamicChange) {
6535
- if (this.value == [] && this.text == null) {
6542
+ if (this.value === [] && this.text === null) {
6536
6543
  return;
6537
6544
  }
6538
6545
  Input.setValue(null, this.inputEle, this.floatLabelType);
@@ -6913,10 +6920,10 @@ let DropDownTree = class DropDownTree extends Component {
6913
6920
  this.updateTreeSettings(newProp);
6914
6921
  break;
6915
6922
  case 'customTemplate':
6916
- if (this.mode !== "Custom") {
6923
+ if (this.mode !== 'Custom') {
6917
6924
  return;
6918
6925
  }
6919
- this.chipCollection.innerHTML = "";
6926
+ this.chipCollection.innerHTML = '';
6920
6927
  this.setTagValues();
6921
6928
  break;
6922
6929
  case 'sortOrder':
@@ -7134,7 +7141,7 @@ __decorate$2([
7134
7141
  Property('')
7135
7142
  ], DropDownTree.prototype, "cssClass", void 0);
7136
7143
  __decorate$2([
7137
- Property("${value.length} item(s) selected")
7144
+ Property('${value.length} item(s) selected')
7138
7145
  ], DropDownTree.prototype, "customTemplate", void 0);
7139
7146
  __decorate$2([
7140
7147
  Property(',')
@@ -7595,7 +7602,7 @@ let ComboBox = class ComboBox extends DropDownList {
7595
7602
  }
7596
7603
  }
7597
7604
  if (!this.isAndroidAutoFill(currentValue)) {
7598
- this.setAutoFillSelection(currentValue);
7605
+ this.setAutoFillSelection(currentValue, isHover);
7599
7606
  }
7600
7607
  }
7601
7608
  }
@@ -7663,7 +7670,7 @@ let ComboBox = class ComboBox extends DropDownList {
7663
7670
  e.preventDefault();
7664
7671
  }
7665
7672
  }
7666
- setAutoFillSelection(currentValue) {
7673
+ setAutoFillSelection(currentValue, isKeyNavigate = false) {
7667
7674
  const selection = this.getSelectionPoints();
7668
7675
  const value = this.inputElement.value.substr(0, selection.start);
7669
7676
  if (value && (value.toLowerCase() === currentValue.substr(0, selection.start).toLowerCase())) {
@@ -7671,7 +7678,7 @@ let ComboBox = class ComboBox extends DropDownList {
7671
7678
  Input.setValue(inputValue, this.inputElement, this.floatLabelType, this.showClearButton);
7672
7679
  this.inputElement.setSelectionRange(selection.start, this.inputElement.value.length);
7673
7680
  }
7674
- else {
7681
+ else if (isKeyNavigate) {
7675
7682
  Input.setValue(currentValue, this.inputElement, this.floatLabelType, this.showClearButton);
7676
7683
  this.inputElement.setSelectionRange(0, this.inputElement.value.length);
7677
7684
  }
@@ -8288,7 +8295,9 @@ let AutoComplete = class AutoComplete extends ComboBox {
8288
8295
  this.setScrollPosition(e);
8289
8296
  if (this.autofill && this.isPopupOpen) {
8290
8297
  this.preventAutoFill = false;
8291
- super.setAutoFill(li);
8298
+ const isKeyNavigate = (e && e.action === 'down' || e.action === 'up' ||
8299
+ e.action === 'home' || e.action === 'end' || e.action === 'pageUp' || e.action === 'pageDown');
8300
+ super.setAutoFill(li, isKeyNavigate);
8292
8301
  }
8293
8302
  attributes(this.inputElement, { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
8294
8303
  }
@@ -9181,7 +9190,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9181
9190
  }
9182
9191
  }
9183
9192
  getValidLi() {
9184
- let liElement = this.ulElement.querySelector('li.' + dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')');
9193
+ const liElement = this.ulElement.querySelector('li.' + dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')');
9185
9194
  return (!isNullOrUndefined(liElement) ? liElement : this.liCollections[0]);
9186
9195
  }
9187
9196
  checkSelectAll() {
@@ -9279,7 +9288,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9279
9288
  const list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;
9280
9289
  if (this.backCommand) {
9281
9290
  this.remoteCustomValue = false;
9282
- if (this.allowCustomValue && list.querySelectorAll('li').length == 0 && this.mainData.length > 0) {
9291
+ if (this.allowCustomValue && list.querySelectorAll('li').length === 0 && this.mainData.length > 0) {
9283
9292
  this.mainData = [];
9284
9293
  }
9285
9294
  this.onActionComplete(list, this.mainData);
@@ -9671,10 +9680,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9671
9680
  if (!isNullOrUndefined(focusedItem)) {
9672
9681
  this.inputElement.setAttribute('aria-activedescendant', focusedItem.id);
9673
9682
  if (this.allowFiltering) {
9674
- var filterInput = this.popupWrapper.querySelector('.' + FILTERINPUT);
9683
+ const filterInput = this.popupWrapper.querySelector('.' + FILTERINPUT);
9675
9684
  filterInput && filterInput.setAttribute('aria-activedescendant', focusedItem.id);
9676
9685
  }
9677
- else if (this.mode == "CheckBox") {
9686
+ else if (this.mode === 'CheckBox') {
9678
9687
  this.overAllWrapper.setAttribute('aria-activedescendant', focusedItem.id);
9679
9688
  }
9680
9689
  }
@@ -10166,7 +10175,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10166
10175
  this.expandTextbox();
10167
10176
  }
10168
10177
  removeAllItems(value, eve, isClearAll, element, mainElement) {
10169
- let index = this.value.indexOf(value);
10178
+ const index = this.value.indexOf(value);
10170
10179
  const removeVal = this.value.slice(0);
10171
10180
  removeVal.splice(index, 1);
10172
10181
  this.setProperties({ value: [].concat([], removeVal) }, true);
@@ -11079,9 +11088,14 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11079
11088
  }
11080
11089
  updateDataList() {
11081
11090
  if (this.mainList && this.ulElement) {
11082
- let isDynamicGroupItemUpdate = this.mainList.childElementCount < this.ulElement.childElementCount;
11083
- let isReactTemplateUpdate = ((this.ulElement.childElementCount > 0 && this.ulElement.children[0].childElementCount > 0) && (this.mainList.children[0].childElementCount < this.ulElement.children[0].childElementCount));
11084
- let isAngularTemplateUpdate = this.itemTemplate && this.ulElement.childElementCount > 0 && (this.ulElement.children[0].childElementCount > 0 || (this.fields.groupBy && this.ulElement.children[1] && this.ulElement.children[1].childElementCount > 0));
11091
+ const isDynamicGroupItemUpdate = this.mainList.childElementCount < this.ulElement.childElementCount;
11092
+ const isReactTemplateUpdate = ((this.ulElement.childElementCount > 0 &&
11093
+ this.ulElement.children[0].childElementCount > 0) &&
11094
+ (this.mainList.children[0].childElementCount < this.ulElement.children[0].childElementCount));
11095
+ const isAngularTemplateUpdate = this.itemTemplate && this.ulElement.childElementCount > 0
11096
+ && !(this.ulElement.childElementCount < this.mainList.childElementCount)
11097
+ && (this.ulElement.children[0].childElementCount > 0
11098
+ || (this.fields.groupBy && this.ulElement.children[1] && this.ulElement.children[1].childElementCount > 0));
11085
11099
  if (isDynamicGroupItemUpdate || isReactTemplateUpdate || isAngularTemplateUpdate) {
11086
11100
  //EJ2-57748 - for this task, we prevent the ul element cloning ( this.mainList = this.ulElement.cloneNode ? <HTMLElement>this.ulElement.cloneNode(true) : this.ulElement;)
11087
11101
  this.mainList = this.ulElement;
@@ -11489,7 +11503,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11489
11503
  */
11490
11504
  showSpinner() {
11491
11505
  if (isNullOrUndefined(this.spinnerElement)) {
11492
- let filterClear = this.filterParent && this.filterParent.querySelector('.e-clear-icon.e-icons');
11506
+ const filterClear = this.filterParent && this.filterParent.querySelector('.e-clear-icon.e-icons');
11493
11507
  if (this.overAllClear.style.display !== 'none' || filterClear) {
11494
11508
  this.spinnerElement = filterClear ? filterClear : this.overAllClear;
11495
11509
  }
@@ -11566,7 +11580,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11566
11580
  const raminElement = this.createElement('span', {
11567
11581
  className: REMAIN_WRAPPER$1
11568
11582
  });
11569
- let remainCompildTemp = remainContent.replace('${count}', this.value.length.toString());
11583
+ const remainCompildTemp = remainContent.replace('${count}', this.value.length.toString());
11570
11584
  raminElement.innerText = remainCompildTemp;
11571
11585
  this.viewWrapper.appendChild(raminElement);
11572
11586
  this.renderReactTemplates();
@@ -11646,8 +11660,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11646
11660
  viewWrapper.removeChild(viewWrapper.firstChild);
11647
11661
  }
11648
11662
  raminElement.innerHTML = '';
11649
- let remainTemp = remainContent.replace('${count}', remaining.toString());
11650
- let totalTemp = totalContent.replace('${count}', remaining.toString());
11663
+ const remainTemp = remainContent.replace('${count}', remaining.toString());
11664
+ const totalTemp = totalContent.replace('${count}', remaining.toString());
11651
11665
  raminElement.innerText = (viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3) ? remainTemp : totalTemp;
11652
11666
  if (viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3) {
11653
11667
  viewWrapper.classList.remove(TOTAL_COUNT_WRAPPER$1);
@@ -11835,9 +11849,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11835
11849
  else {
11836
11850
  for (let i = 0; i < li.length && i < count; i++) {
11837
11851
  this.removeHover();
11838
- let customVal = li[i].getAttribute('data-value');
11839
- let value = this.getFormattedValue(customVal);
11840
- let mainElement = this.mainList ? this.mainList.querySelectorAll(state ?
11852
+ const customVal = li[i].getAttribute('data-value');
11853
+ const value = this.getFormattedValue(customVal);
11854
+ const mainElement = this.mainList ? this.mainList.querySelectorAll(state ?
11841
11855
  'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)' :
11842
11856
  'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)')[i] : null;
11843
11857
  if (state) {
@@ -12100,7 +12114,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12100
12114
  break;
12101
12115
  case 'popupHeight':
12102
12116
  if (this.popupObj) {
12103
- let overAllHeight = parseInt(this.popupHeight, 10);
12117
+ const overAllHeight = parseInt(this.popupHeight, 10);
12104
12118
  if (this.popupHeight !== 'auto') {
12105
12119
  this.list.style.maxHeight = formatUnit(overAllHeight);
12106
12120
  this.popupWrapper.style.maxHeight = formatUnit(this.popupHeight);
@@ -12138,23 +12152,21 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12138
12152
  this.renderPopup();
12139
12153
  }
12140
12154
  presentItemValue(ulElement) {
12141
- let valuecheck = [];
12155
+ const valuecheck = [];
12142
12156
  for (let i = 0; i < this.value.length; i++) {
12143
- let checkEle = this.findListElement(((this.allowFiltering && !isNullOrUndefined(this.mainList)) ? this.mainList : ulElement), 'li', 'data-value', this.value[i]);
12157
+ const checkEle = this.findListElement(((this.allowFiltering && !isNullOrUndefined(this.mainList)) ? this.mainList : ulElement), 'li', 'data-value', this.value[i]);
12144
12158
  if (!checkEle) {
12145
12159
  valuecheck.push(this.value[i]);
12146
12160
  }
12147
12161
  }
12148
12162
  return valuecheck;
12149
12163
  }
12150
- ;
12151
12164
  addNonPresentItems(valuecheck, ulElement, list, event) {
12152
12165
  this.dataSource.executeQuery(this.getForQuery(valuecheck)).then((e) => {
12153
12166
  this.addItem(e.result, list.length);
12154
12167
  this.updateActionList(ulElement, list, event);
12155
12168
  });
12156
12169
  }
12157
- ;
12158
12170
  updateVal(newProp, oldProp, prop) {
12159
12171
  if (!this.list) {
12160
12172
  this.onLoadSelect();
@@ -12167,7 +12179,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12167
12179
  if (!isNullOrUndefined(this.value) && !this.allowCustomValue) {
12168
12180
  valuecheck = this.presentItemValue(this.ulElement);
12169
12181
  }
12170
- if (prop == 'value' && valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
12182
+ if (prop === 'value' && valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
12171
12183
  && this.listData != null) {
12172
12184
  this.mainData = null;
12173
12185
  this.setDynValue = true;
@@ -13661,14 +13673,14 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
13661
13673
  triggerDrag(args) {
13662
13674
  let scrollParent;
13663
13675
  let boundRect;
13664
- let scrollMoved = 36;
13676
+ const scrollMoved = 36;
13665
13677
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13666
- let event = args.event;
13678
+ const event = args.event;
13667
13679
  let wrapper;
13668
- if (args.target && (args.target.classList.contains("e-listbox-wrapper") || args.target.classList.contains("e-list-item")
13669
- || args.target.classList.contains("e-filter-parent") || args.target.classList.contains("e-input-group"))) {
13670
- if (args.target.classList.contains("e-list-item") || args.target.classList.contains("e-filter-parent")
13671
- || args.target.classList.contains("e-input-group")) {
13680
+ if (args.target && (args.target.classList.contains('e-listbox-wrapper') || args.target.classList.contains('e-list-item')
13681
+ || args.target.classList.contains('e-filter-parent') || args.target.classList.contains('e-input-group'))) {
13682
+ if (args.target.classList.contains('e-list-item') || args.target.classList.contains('e-filter-parent')
13683
+ || args.target.classList.contains('e-input-group')) {
13672
13684
  wrapper = args.target.closest('.e-listbox-wrapper');
13673
13685
  }
13674
13686
  else {
@@ -13722,7 +13734,8 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
13722
13734
  const getArgs = this.getDragArgs({ target: args.droppedElement }, true);
13723
13735
  const sourceArgs = { previousData: this.dataSource };
13724
13736
  const destArgs = { previousData: listObj.dataSource };
13725
- let dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource }, previousIndex: args.previousIndex, currentIndex: args.currentIndex });
13737
+ let dragArgs = extend({}, getArgs, { target: args.target, source: { previousData: this.dataSource },
13738
+ previousIndex: args.previousIndex, currentIndex: args.currentIndex });
13726
13739
  if (listObj !== this) {
13727
13740
  const sourceArgs1 = extend(sourceArgs, { currentData: this.listData });
13728
13741
  dragArgs = extend(dragArgs, { source: sourceArgs1, destination: destArgs });
@@ -13816,14 +13829,14 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
13816
13829
  currIdx++;
13817
13830
  });
13818
13831
  if (this.fields.groupBy) {
13819
- let sourceElem = this.renderItems(this.listData, this.fields);
13832
+ const sourceElem = this.renderItems(this.listData, this.fields);
13820
13833
  this.updateListItems(sourceElem, this.ulElement);
13821
13834
  this.setSelection();
13822
13835
  }
13823
13836
  if (listObj.sortOrder !== 'None' || this.selectionSettings.showCheckbox
13824
13837
  !== listObj.selectionSettings.showCheckbox || listObj.fields.groupBy || listObj.itemTemplate || this.itemTemplate) {
13825
13838
  const sortable = getComponent(ul, 'sortable');
13826
- let sourceElem = listObj.renderItems(listData, listObj.fields);
13839
+ const sourceElem = listObj.renderItems(listData, listObj.fields);
13827
13840
  listObj.updateListItems(sourceElem, ul);
13828
13841
  this.setSelection();
13829
13842
  if (sortable.placeHolderElement) {
@@ -13853,7 +13866,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
13853
13866
  }
13854
13867
  updateListItems(sourceElem, destElem) {
13855
13868
  const i = 0;
13856
- destElem.innerHTML = "";
13869
+ destElem.innerHTML = '';
13857
13870
  while (i < sourceElem.childNodes.length) {
13858
13871
  destElem.appendChild(sourceElem.childNodes[i]);
13859
13872
  }
@@ -13913,7 +13926,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
13913
13926
  enableItems(items, enable = true, isValue) {
13914
13927
  let li;
13915
13928
  items.forEach((item) => {
13916
- let text = item;
13929
+ const text = item;
13917
13930
  li = this.findListElement(this.list, 'li', 'data-value', isValue ? text : this.getValueByText(text));
13918
13931
  if (!li) {
13919
13932
  return;
@@ -14038,6 +14051,8 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14038
14051
  if (this.listData.length === 0) {
14039
14052
  this.l10nUpdate();
14040
14053
  }
14054
+ this.value = null;
14055
+ this.updateToolBarState();
14041
14056
  }
14042
14057
  /**
14043
14058
  * Gets the array of data Object that matches the given array of values.
@@ -14279,7 +14294,10 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14279
14294
  let filterQuery = query ? query.clone() : this.query ? this.query.clone() : new Query();
14280
14295
  if (this.allowFiltering) {
14281
14296
  const filterType = this.inputString === '' ? 'contains' : this.filterType;
14282
- const dataType = this.typeOfData(this.dataSource).typeof;
14297
+ let dataType = this.typeOfData(this.dataSource).typeof;
14298
+ if (dataType === null) {
14299
+ dataType = this.typeOfData(this.jsonData).typeof;
14300
+ }
14283
14301
  if (!(this.dataSource instanceof DataManager) && dataType === 'string' || dataType === 'number') {
14284
14302
  filterQuery.where('', filterType, this.inputString, this.ignoreCase, this.ignoreAccent);
14285
14303
  }
@@ -14639,7 +14657,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14639
14657
  });
14640
14658
  if (isRefresh) {
14641
14659
  if (fListBox.fields.groupBy) {
14642
- let sourceElem = fListBox.renderItems(listData, fListBox.fields);
14660
+ const sourceElem = fListBox.renderItems(listData, fListBox.fields);
14643
14661
  fListBox.updateListItems(sourceElem, fListBox.ulElement);
14644
14662
  }
14645
14663
  else {
@@ -14672,7 +14690,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14672
14690
  tListBox.jsonData = tJsonData;
14673
14691
  tListBox.sortedData = tSortData;
14674
14692
  if (isRefresh) {
14675
- let sourceElem = tListBox.renderItems(tListData, tListBox.fields);
14693
+ const sourceElem = tListBox.renderItems(tListData, tListBox.fields);
14676
14694
  tListBox.updateListItems(sourceElem, tListBox.ulElement);
14677
14695
  tListBox.setSelection();
14678
14696
  fListBox.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
@@ -14761,7 +14779,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14761
14779
  tListBox.jsonData = jsonData;
14762
14780
  fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
14763
14781
  if (isRefresh) {
14764
- let sourceElem = tListBox.renderItems(listData, tListBox.fields);
14782
+ const sourceElem = tListBox.renderItems(listData, tListBox.fields);
14765
14783
  tListBox.updateListItems(sourceElem, tListBox.ulElement);
14766
14784
  this.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
14767
14785
  }
@@ -14869,7 +14887,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14869
14887
  }
14870
14888
  }
14871
14889
  }
14872
- else if (e.keyCode !== 37 && e.keyCode !== 39) {
14890
+ else if (e.keyCode !== 37 && e.keyCode !== 39 && e.code !== 'KeyA') {
14873
14891
  this.upDownKeyHandler(e);
14874
14892
  }
14875
14893
  }
@@ -14898,9 +14916,6 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14898
14916
  }
14899
14917
  }
14900
14918
  removeClass([fli], 'e-focused');
14901
- if (e.ctrlKey && !e.shiftKey && !this.selectionSettings.showCheckbox) {
14902
- removeClass([fli], 'e-selected');
14903
- }
14904
14919
  }
14905
14920
  const cli = ul.children[fliIdx];
14906
14921
  if (cli) {
@@ -14915,9 +14930,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
14915
14930
  this.selectHandler({ target: ul.children[fliIdx], ctrlKey: e.ctrlKey, shiftKey: e.shiftKey }, true);
14916
14931
  }
14917
14932
  if (this.selectionSettings.showCheckbox && e.ctrlKey && e.shiftKey && (e.keyCode === 36 || e.keyCode === 35)) {
14918
- let selectedidx = Array.prototype.indexOf.call(ul.children, fli);
14919
- let sidx = e.code === "Home" ? 0 : selectedidx;
14920
- let eidx = e.code === "Home" ? selectedidx : ul.children.length - 1;
14933
+ const selectedidx = Array.prototype.indexOf.call(ul.children, fli);
14934
+ const sidx = e.code === 'Home' ? 0 : selectedidx;
14935
+ const eidx = e.code === 'Home' ? selectedidx : ul.children.length - 1;
14921
14936
  for (let i = sidx; i <= eidx; i++) {
14922
14937
  const item = ul.children[i];
14923
14938
  this.notify('updatelist', { li: item, e: {
@@ -15492,5 +15507,5 @@ const listBoxClasses = {
15492
15507
  * export all modules from current location
15493
15508
  */
15494
15509
 
15495
- export { incrementalSearch, Search, resetIncrementalSearchValues, highlightSearch, revertHighlightSearch, FieldSettings, dropDownBaseClasses, DropDownBase, dropDownListClasses, DropDownList, Fields, TreeSettings, DropDownTree, ComboBox, AutoComplete, MultiSelect, CheckBoxSelection, createFloatLabel, updateFloatLabelState, removeFloating, setPlaceHolder, floatLabelFocus, floatLabelBlur, encodePlaceholder, SelectionSettings, ToolbarSettings, ListBox };
15510
+ export { incrementalSearch, Search, escapeCharRegExp, resetIncrementalSearchValues, highlightSearch, revertHighlightSearch, FieldSettings, dropDownBaseClasses, DropDownBase, dropDownListClasses, DropDownList, Fields, TreeSettings, DropDownTree, ComboBox, AutoComplete, MultiSelect, CheckBoxSelection, createFloatLabel, updateFloatLabelState, removeFloating, setPlaceHolder, floatLabelFocus, floatLabelBlur, encodePlaceholder, SelectionSettings, ToolbarSettings, ListBox };
15496
15511
  //# sourceMappingURL=ej2-dropdowns.es2015.js.map