@syncfusion/ej2-dropdowns 29.1.41 → 29.2.5

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 (42) hide show
  1. package/dist/ej2-dropdowns.min.js +2 -2
  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 +275 -128
  5. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  6. package/dist/es6/ej2-dropdowns.es5.js +283 -132
  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/package.json +12 -12
  12. package/src/auto-complete/auto-complete.d.ts +1 -0
  13. package/src/auto-complete/auto-complete.js +9 -1
  14. package/src/combo-box/combo-box-model.d.ts +1 -9
  15. package/src/combo-box/combo-box.d.ts +0 -7
  16. package/src/combo-box/combo-box.js +22 -17
  17. package/src/common/virtual-scroll.js +8 -3
  18. package/src/drop-down-base/drop-down-base.d.ts +5 -1
  19. package/src/drop-down-base/drop-down-base.js +71 -10
  20. package/src/drop-down-list/drop-down-list-model.d.ts +7 -0
  21. package/src/drop-down-list/drop-down-list.d.ts +7 -0
  22. package/src/drop-down-list/drop-down-list.js +42 -24
  23. package/src/drop-down-tree/drop-down-tree.d.ts +1 -0
  24. package/src/drop-down-tree/drop-down-tree.js +14 -11
  25. package/src/mention/mention-model.d.ts +7 -0
  26. package/src/mention/mention.d.ts +8 -0
  27. package/src/mention/mention.js +29 -16
  28. package/src/multi-select/multi-select-model.d.ts +7 -0
  29. package/src/multi-select/multi-select.d.ts +9 -0
  30. package/src/multi-select/multi-select.js +88 -50
  31. package/styles/bds-lite.css +1 -1
  32. package/styles/bds.css +1 -1
  33. package/styles/multi-select/_bds-definition.scss +1 -0
  34. package/styles/multi-select/_layout.scss +6 -1
  35. package/styles/multi-select/_tailwind-definition.scss +1 -0
  36. package/styles/multi-select/bds.css +1 -1
  37. package/styles/multi-select/tailwind-dark.css +1 -1
  38. package/styles/multi-select/tailwind.css +1 -1
  39. package/styles/tailwind-dark-lite.css +1 -1
  40. package/styles/tailwind-dark.css +1 -1
  41. package/styles/tailwind-lite.css +1 -1
  42. package/styles/tailwind.css +1 -1
@@ -497,6 +497,7 @@ class VirtualScroll {
497
497
  query = query.skip(this.parent.viewPortInfo.startIndex);
498
498
  }
499
499
  this.parent.setCurrentView = false;
500
+ this.parent.isPreventScrollAction = true;
500
501
  this.parent.resetList(this.parent.dataSource, this.parent.fields, query);
501
502
  isResetListCalled = true;
502
503
  break;
@@ -544,6 +545,7 @@ class VirtualScroll {
544
545
  }
545
546
  }
546
547
  this.parent.renderItems(currentData, this.parent.fields, this.component === 'multiselect' && this.parent.mode === 'CheckBox');
548
+ this.parent.updateSelectionList();
547
549
  }
548
550
  if (this.component === 'multiselect') {
549
551
  this.parent.updatevirtualizationList();
@@ -555,7 +557,8 @@ class VirtualScroll {
555
557
  (this.parent.totalItemCount <= this.parent.itemCount))) ? 0 : this.parent.skeletonCount;
556
558
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
557
559
  const virtualTrackElement = this.parent.list.getElementsByClassName('e-virtual-ddl')[0];
558
- if (virtualTrackElement) {
560
+ const preventAction = this.component !== 'multiselect' || (this.component === 'multiselect' && ((!(this.parent.dataSource instanceof DataManager))) || (this.parent.dataSource instanceof DataManager && !isResetListCalled));
561
+ if (virtualTrackElement && preventAction) {
559
562
  virtualTrackElement.style = this.parent.GetVirtualTrackHeight();
560
563
  }
561
564
  else if (!virtualTrackElement && this.parent.skeletonCount > 0 && this.parent.popupWrapper) {
@@ -564,11 +567,13 @@ class VirtualScroll {
564
567
  });
565
568
  this.parent.popupWrapper.querySelector('.e-dropdownbase').appendChild(virualElement);
566
569
  }
567
- this.parent.UpdateSkeleton();
570
+ if (this.component !== 'multiselect' || (this.component === 'multiselect' && ((!(this.parent.dataSource instanceof DataManager))) || (this.parent.dataSource instanceof DataManager && (!isResetListCalled || this.parent.viewPortInfo.startIndex === 0)))) {
571
+ this.parent.UpdateSkeleton();
572
+ }
568
573
  this.parent.liCollections = this.parent.list.querySelectorAll('.e-list-item');
569
574
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
570
575
  const virtualContentElement = this.parent.list.getElementsByClassName('e-virtual-ddl-content')[0];
571
- if (virtualContentElement) {
576
+ if (virtualContentElement && preventAction) {
572
577
  (virtualContentElement).style = this.parent.getTransformValues();
573
578
  }
574
579
  if (this.parent.fields.groupBy) {
@@ -911,6 +916,7 @@ let DropDownBase = class DropDownBase extends Component {
911
916
  this.isDynamicData = false;
912
917
  this.isPrimitiveData = false;
913
918
  this.isCustomFiltering = false;
919
+ this.debounceTimer = null;
914
920
  this.virtualListInfo = {
915
921
  currentPageNumber: null,
916
922
  direction: null,
@@ -1269,6 +1275,29 @@ let DropDownBase = class DropDownBase extends Component {
1269
1275
  isContainSkeleton.firstChild.insertBefore(liElement, isContainSkeleton.firstChild.children[0]);
1270
1276
  }
1271
1277
  }
1278
+ if (this.getModuleName() === 'multiselect') {
1279
+ for (let i = 0; i < totalSkeletonCount && this.totalItemCount !== this.viewPortInfo.endIndex; i++) {
1280
+ const liElement = this.createElement('li', { className: `${dropDownBaseClasses.virtualList} e-virtual-list-end`, styles: 'overflow: inherit' });
1281
+ if (this.isVirtualizationEnabled && this.itemTemplate) {
1282
+ liElement.style.height = (this.listItemHeight - parseInt(window.getComputedStyle(this.getItems()[1]).marginBottom, 10)) + 'px';
1283
+ }
1284
+ const skeleton = new Skeleton({
1285
+ shape: 'Text',
1286
+ height: '10px',
1287
+ width: '95%',
1288
+ cssClass: 'e-skeleton-text-end'
1289
+ });
1290
+ skeleton.appendTo(this.createElement('div'));
1291
+ liElement.appendChild(skeleton.element);
1292
+ if (isContainSkeleton.firstChild) {
1293
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1294
+ isContainSkeleton.firstChild.appendChild(liElement);
1295
+ }
1296
+ }
1297
+ if (this.totalItemCount === this.viewPortInfo.endIndex) {
1298
+ isContainSkeleton.querySelectorAll('.e-virtual-list-end').forEach((el) => el.remove());
1299
+ }
1300
+ }
1272
1301
  }
1273
1302
  }
1274
1303
  getLocaleName() {
@@ -1546,7 +1575,9 @@ let DropDownBase = class DropDownBase extends Component {
1546
1575
  this.preventPopupOpen = false;
1547
1576
  return;
1548
1577
  }
1578
+ let isSetCurrentcall = false;
1549
1579
  if (this.isVirtualizationEnabled && this.setCurrentView) {
1580
+ isSetCurrentcall = true;
1550
1581
  this.notify('setCurrentViewDataAsync', {
1551
1582
  module: 'VirtualScroll'
1552
1583
  });
@@ -1554,7 +1585,8 @@ let DropDownBase = class DropDownBase extends Component {
1554
1585
  if (this.keyboardEvent != null) {
1555
1586
  this.handleVirtualKeyboardActions(this.keyboardEvent, this.pageCount);
1556
1587
  }
1557
- if (this.isVirtualizationEnabled) {
1588
+ const preventSkeleton = this.getModuleName() !== 'multiselect' || (this.getModuleName() === 'multiselect' && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && !isSetCurrentcall)));
1589
+ if (this.isVirtualizationEnabled && preventSkeleton) {
1558
1590
  this.getFilteringSkeletonCount();
1559
1591
  this.updatePopupPosition();
1560
1592
  }
@@ -1784,6 +1816,13 @@ let DropDownBase = class DropDownBase extends Component {
1784
1816
  }
1785
1817
  }
1786
1818
  }
1819
+ if (this.getModuleName() === 'multiselect' && this.isAngular && this.ngEle) {
1820
+ const popupHolder = this.list;
1821
+ if (popupHolder) {
1822
+ const prevHeight = popupHolder.offsetHeight + 'px';
1823
+ popupHolder.style.height = prevHeight;
1824
+ }
1825
+ }
1787
1826
  if (!isNullOrUndefined(this.list)) {
1788
1827
  if (!this.isVirtualizationEnabled) {
1789
1828
  this.list.innerHTML = '';
@@ -1793,15 +1832,26 @@ let DropDownBase = class DropDownBase extends Component {
1793
1832
  this.postRender(this.list, list, this.bindEvent);
1794
1833
  }
1795
1834
  }
1835
+ if (this.getModuleName() === 'multiselect' && this.isAngular && this.ngEle) {
1836
+ const popupHolder = this.list;
1837
+ if (popupHolder) {
1838
+ setTimeout(() => {
1839
+ popupHolder.style.height = '';
1840
+ this.refreshPopup();
1841
+ }, 0);
1842
+ }
1843
+ }
1796
1844
  }
1797
1845
  /* eslint-disable @typescript-eslint/no-unused-vars */
1798
1846
  postRender(listElement, list, bindEvent) {
1799
1847
  if (this.fields.disabled) {
1800
1848
  const liCollections = listElement.querySelectorAll('.' + dropDownBaseClasses.li);
1849
+ const data = this.sortOrder !== 'None' ? !isNullOrUndefined(this.fields.groupBy) ?
1850
+ this.sortedData.filter((item) => !('isHeader' in item) || item.isHeader !== true) : this.sortedData : this.listData;
1801
1851
  for (let index = 0; index < liCollections.length; index++) {
1802
- if (JSON.parse(JSON.stringify(this.listData[index]))[this.fields.disabled]) {
1852
+ if (JSON.parse(JSON.stringify(data[index]))[this.fields.disabled]) {
1803
1853
  if (!isNullOrUndefined(this.fields.groupBy)) {
1804
- const item = this.listData[index];
1854
+ const item = data[index];
1805
1855
  const value = getValue((this.fields.value ? this.fields.value : 'value'), item);
1806
1856
  const li = listElement.querySelector('li[data-value="' + value + '"]');
1807
1857
  if (!isNullOrUndefined(li)) {
@@ -1843,6 +1893,17 @@ let DropDownBase = class DropDownBase extends Component {
1843
1893
  getQuery(query) {
1844
1894
  return query ? query : this.query ? this.query : new Query();
1845
1895
  }
1896
+ performFiltering(e) {
1897
+ // this is for component wise
1898
+ }
1899
+ debouncedFiltering(e, debounceDelay) {
1900
+ if (this.debounceTimer !== null) {
1901
+ clearTimeout(this.debounceTimer);
1902
+ }
1903
+ this.debounceTimer = setTimeout(() => {
1904
+ this.performFiltering(e);
1905
+ }, debounceDelay);
1906
+ }
1846
1907
  updateVirtualizationProperties(itemCount, filtering, isCheckbox) {
1847
1908
  this.isVirtualizationEnabled = true;
1848
1909
  this.virtualizedItemsCount = itemCount;
@@ -2016,9 +2077,10 @@ let DropDownBase = class DropDownBase extends Component {
2016
2077
  * @param {object[]} listData - Specifies the list of array of data.
2017
2078
  * @param {FieldSettingsModel} fields - Maps the columns of the data table and binds the data to the component.
2018
2079
  * @param {boolean} isCheckBoxUpdate - Specifies whether the list item is updated with checkbox.
2080
+ * @param {boolean} isClearAll - Specifies whether the current action is clearAll.
2019
2081
  * @returns {HTMLElement} Return the list items.
2020
2082
  */
2021
- renderItems(listData, fields, isCheckBoxUpdate) {
2083
+ renderItems(listData, fields, isCheckBoxUpdate, isClearAll) {
2022
2084
  let ulElement;
2023
2085
  if (this.itemTemplate && listData) {
2024
2086
  if (this.getModuleName() === 'multiselect' && this.virtualSelectAll) {
@@ -2072,7 +2134,7 @@ let DropDownBase = class DropDownBase extends Component {
2072
2134
  }
2073
2135
  }
2074
2136
  else {
2075
- if (this.getModuleName() === 'multiselect' && this.virtualSelectAll) {
2137
+ if (this.getModuleName() === 'multiselect' && (this.virtualSelectAll && !isClearAll)) {
2076
2138
  this.virtualSelectAllData = listData;
2077
2139
  listData = listData.slice(this.virtualItemStartIndex, this.virtualItemEndIndex);
2078
2140
  }
@@ -2091,11 +2153,13 @@ let DropDownBase = class DropDownBase extends Component {
2091
2153
  oldUlElement = this.list.querySelector('.e-list-parent' + '.e-reorder');
2092
2154
  }
2093
2155
  if ((listData.length >= this.virtualizedItemsCount && oldUlElement && virtualUlElement) || (oldUlElement && virtualUlElement && this.isAllowFiltering) || (oldUlElement && virtualUlElement && (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'multiselect')) || isRemovedUlelement) {
2094
- if (!this.appendUncheckList) {
2095
- virtualUlElement.replaceChild(ulElement, oldUlElement);
2096
- }
2097
- else {
2098
- virtualUlElement.appendChild(ulElement);
2156
+ if (this.getModuleName() !== 'multiselect' || (this.getModuleName() === 'multiselect' && (!(this.dataSource instanceof DataManager) || (this.dataSource instanceof DataManager && !this.setCurrentView)))) {
2157
+ if (!this.appendUncheckList) {
2158
+ virtualUlElement.replaceChild(ulElement, oldUlElement);
2159
+ }
2160
+ else {
2161
+ virtualUlElement.appendChild(ulElement);
2162
+ }
2099
2163
  }
2100
2164
  this.updateListElements(listData);
2101
2165
  }
@@ -4240,7 +4304,8 @@ let DropDownList = class DropDownList extends DropDownBase {
4240
4304
  // eslint-disable-next-line @typescript-eslint/no-this-alias
4241
4305
  const proxy = this;
4242
4306
  // eslint-disable-next-line max-len
4243
- const duration = (this.element.tagName === this.getNgDirective() && this.itemTemplate) ? 500 : 100;
4307
+ const duration = ((this.dataSource instanceof DataManager) && this.groupTemplate) ? 700 :
4308
+ (this.element.tagName === this.getNgDirective() && this.itemTemplate) ? 500 : 100;
4244
4309
  if (!this.isSecondClick) {
4245
4310
  setTimeout(() => {
4246
4311
  proxy.cloneElements();
@@ -4838,6 +4903,29 @@ let DropDownList = class DropDownList extends DropDownBase {
4838
4903
  const input = this.inputElement;
4839
4904
  return { start: Math.abs(input.selectionStart), end: Math.abs(input.selectionEnd) };
4840
4905
  }
4906
+ performFiltering(e) {
4907
+ this.checkAndResetCache();
4908
+ this.isRequesting = false;
4909
+ const eventArgs = {
4910
+ preventDefaultAction: false,
4911
+ text: this.filterInput.value,
4912
+ updateData: (dataSource, query, fields) => {
4913
+ if (eventArgs.cancel) {
4914
+ return;
4915
+ }
4916
+ this.isCustomFilter = true;
4917
+ this.customFilterQuery = query ? query.clone() : query;
4918
+ this.filteringAction(dataSource, query, fields);
4919
+ },
4920
+ baseEventArgs: e,
4921
+ cancel: false
4922
+ };
4923
+ this.trigger('filtering', eventArgs, (eventArgs) => {
4924
+ if (!eventArgs.cancel && !this.isCustomFilter && !eventArgs.preventDefaultAction) {
4925
+ this.filteringAction(this.dataSource, null, this.fields);
4926
+ }
4927
+ });
4928
+ }
4841
4929
  searchLists(e) {
4842
4930
  this.isTyped = true;
4843
4931
  this.activeIndex = null;
@@ -4848,27 +4936,12 @@ let DropDownList = class DropDownList extends DropDownBase {
4848
4936
  }
4849
4937
  this.isDataFetched = false;
4850
4938
  if (this.isFiltering()) {
4851
- this.checkAndResetCache();
4852
- this.isRequesting = false;
4853
- const eventArgs = {
4854
- preventDefaultAction: false,
4855
- text: this.filterInput.value,
4856
- updateData: (dataSource, query, fields) => {
4857
- if (eventArgs.cancel) {
4858
- return;
4859
- }
4860
- this.isCustomFilter = true;
4861
- this.customFilterQuery = query ? query.clone() : query;
4862
- this.filteringAction(dataSource, query, fields);
4863
- },
4864
- baseEventArgs: e,
4865
- cancel: false
4866
- };
4867
- this.trigger('filtering', eventArgs, (eventArgs) => {
4868
- if (!eventArgs.cancel && !this.isCustomFilter && !eventArgs.preventDefaultAction) {
4869
- this.filteringAction(this.dataSource, null, this.fields);
4870
- }
4871
- });
4939
+ if (this.typedString !== '' && this.debounceDelay > 0) {
4940
+ this.debouncedFiltering(e, this.debounceDelay);
4941
+ }
4942
+ else {
4943
+ this.performFiltering(e);
4944
+ }
4872
4945
  }
4873
4946
  }
4874
4947
  /**
@@ -5132,7 +5205,9 @@ let DropDownList = class DropDownList extends DropDownBase {
5132
5205
  this.dataSource.executeQuery(this.getQuery(this.query).where(new Predicate(checkField, 'equal', value)))
5133
5206
  .then((e) => {
5134
5207
  if (e.result.length > 0) {
5135
- this.addItem(e.result, list.length);
5208
+ if (!this.enableVirtualization) {
5209
+ this.addItem(e.result, list.length);
5210
+ }
5136
5211
  this.updateValues();
5137
5212
  }
5138
5213
  else {
@@ -6808,6 +6883,9 @@ let DropDownList = class DropDownList extends DropDownBase {
6808
6883
  if (!this.enabled) {
6809
6884
  return;
6810
6885
  }
6886
+ if (this.getModuleName() === 'dropdownlist' && this.beforePopupOpen && !this.isPopupOpen) {
6887
+ this.beforePopupOpen = false;
6888
+ }
6811
6889
  this.firstItem = this.dataSource && this.dataSource.length > 0 ? this.dataSource[0] : null;
6812
6890
  if (this.isReact && this.getModuleName() === 'combobox' && this.itemTemplate && this.isCustomFilter && this.isAddNewItemTemplate) {
6813
6891
  this.renderList();
@@ -7076,6 +7154,7 @@ let DropDownList = class DropDownList extends DropDownBase {
7076
7154
  this.inputElement.classList.remove('e-input');
7077
7155
  Input.setValue('', this.inputElement, this.floatLabelType, this.showClearButton);
7078
7156
  }
7157
+ this.element.removeAttribute('tabindex');
7079
7158
  this.element.style.display = 'block';
7080
7159
  if (this.inputWrapper.container && this.inputWrapper.container.parentElement) {
7081
7160
  if (this.inputWrapper.container.parentElement.tagName === this.getNgDirective()) {
@@ -7196,6 +7275,9 @@ __decorate$1([
7196
7275
  __decorate$1([
7197
7276
  Property(false)
7198
7277
  ], DropDownList.prototype, "allowFiltering", void 0);
7278
+ __decorate$1([
7279
+ Property(300)
7280
+ ], DropDownList.prototype, "debounceDelay", void 0);
7199
7281
  __decorate$1([
7200
7282
  Property(true)
7201
7283
  ], DropDownList.prototype, "isDeviceFullScreen", void 0);
@@ -7864,6 +7946,9 @@ let DropDownTree = class DropDownTree extends Component {
7864
7946
  }
7865
7947
  /* To wire events for the dropdown tree */
7866
7948
  wireEvents() {
7949
+ if (Browser.isIos) {
7950
+ EventHandler.add(this.inputWrapper, 'touchstart', this.handleIosTouch, this);
7951
+ }
7867
7952
  EventHandler.add(this.inputWrapper, 'mouseup', this.dropDownClick, this);
7868
7953
  EventHandler.add(this.inputWrapper, 'focus', this.focusIn, this);
7869
7954
  EventHandler.add(this.inputWrapper, 'blur', this.focusOut, this);
@@ -7897,6 +7982,9 @@ let DropDownTree = class DropDownTree extends Component {
7897
7982
  }
7898
7983
  /* To unwire events for the dropdown tree */
7899
7984
  unWireEvents() {
7985
+ if (Browser.isIos) {
7986
+ EventHandler.remove(this.inputWrapper, 'touchstart', this.handleIosTouch);
7987
+ }
7900
7988
  EventHandler.remove(this.inputWrapper, 'mouseup', this.dropDownClick);
7901
7989
  EventHandler.remove(this.inputWrapper, 'focus', this.focusIn);
7902
7990
  EventHandler.remove(this.inputWrapper, 'blur', this.focusOut);
@@ -7914,6 +8002,11 @@ let DropDownTree = class DropDownTree extends Component {
7914
8002
  }
7915
8003
  document.removeEventListener('mousedown', this.documentClickContext);
7916
8004
  }
8005
+ /* Handles touch events specifically for iOS devices */
8006
+ handleIosTouch(e) {
8007
+ e.preventDefault();
8008
+ this.dropDownClick(e);
8009
+ }
7917
8010
  /* Trigger when the dropdown is clicked */
7918
8011
  dropDownClick(e) {
7919
8012
  if (!this.enabled || this.readonly) {
@@ -8827,7 +8920,8 @@ let DropDownTree = class DropDownTree extends Component {
8827
8920
  loadOnDemand: this.treeSettings.loadOnDemand,
8828
8921
  nodeSelecting: this.onBeforeSelect.bind(this),
8829
8922
  nodeTemplate: this.itemTemplate,
8830
- checkDisabledChildren: this.treeSettings.checkDisabledChildren
8923
+ checkDisabledChildren: this.treeSettings.checkDisabledChildren,
8924
+ checkOnClick: true
8831
8925
  });
8832
8926
  this.treeObj.root = this.root ? this.root : this;
8833
8927
  this.treeObj.appendTo(this.tree);
@@ -8905,7 +8999,7 @@ let DropDownTree = class DropDownTree extends Component {
8905
8999
  this.popupObj.refreshPosition();
8906
9000
  if (!(this.showSelectAll || this.allowFiltering) && (!this.popupDiv.classList.contains(NODATA)
8907
9001
  && this.treeItems.length > 0)) {
8908
- let focusedElement = this.value != null && this.text != null ? this.treeObj.element.querySelector('[data-uid="' + this.value[0] + '"]') : null;
9002
+ let focusedElement = this.value != null && this.text != null ? this.treeObj.element.querySelector('[data-uid="' + this.value[this.value.length - 1] + '"]') : null;
8909
9003
  if (focusedElement) {
8910
9004
  this.treeObj.element.querySelector('li').setAttribute('tabindex', '-1');
8911
9005
  focusedElement.setAttribute('tabindex', '0');
@@ -9351,15 +9445,6 @@ let DropDownTree = class DropDownTree extends Component {
9351
9445
  }
9352
9446
  const target = args.event.target;
9353
9447
  if ((target.classList.contains('e-fullrow') || target.classList.contains('e-list-text')) && this.showCheckBox) {
9354
- this.isClicked = true;
9355
- const getNodeDetails = this.treeObj.getNode(args.node);
9356
- if (getNodeDetails.isChecked === 'true') {
9357
- this.treeObj.uncheckAll([args.node]);
9358
- }
9359
- else {
9360
- this.treeObj.checkAll([args.node]);
9361
- }
9362
- this.isClicked = false;
9363
9448
  this.setMultiSelect();
9364
9449
  this.ensurePlaceHolder();
9365
9450
  }
@@ -10946,19 +11031,22 @@ let ComboBox = class ComboBox extends DropDownList {
10946
11031
  const fields = (this.fields.value) ? this.fields.value : '';
10947
11032
  const currentValue = this.allowObjectBinding && !isNullOrUndefined(this.value) ? getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
10948
11033
  if (this.dataSource instanceof DataManager) {
10949
- const getItem = new DataManager(this.virtualGroupDataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', currentValue)));
10950
- if (getItem && getItem.length > 0) {
10951
- this.itemData = getItem[0];
10952
- doesItemExist = true;
10953
- const dataItem = this.getItemData();
10954
- const value = this.allowObjectBinding
10955
- ? this.getDataByValue(dataItem.value)
10956
- : dataItem.value;
10957
- if ((this.value === dataItem.value && this.text !== dataItem.text)
10958
- || (this.value !== dataItem.value && this.text === dataItem.text)) {
10959
- this.setProperties({ 'text': dataItem.text ? dataItem.text.toString() : dataItem.text, 'value': value });
11034
+ this.dataSource.executeQuery(new Query().where(new Predicate(fields, 'equal', currentValue)))
11035
+ .then((e) => {
11036
+ if (e.result.length > 0) {
11037
+ this.itemData = e.result[0];
11038
+ const dataItem = this.getItemData();
11039
+ const value = this.allowObjectBinding ?
11040
+ this.getDataByValue(dataItem.value) : dataItem.value;
11041
+ if ((this.value === dataItem.value && this.text !== dataItem.text) ||
11042
+ (this.value !== dataItem.value && this.text === dataItem.text)) {
11043
+ this.setProperties({ 'text': dataItem.text ? dataItem.text.toString() : dataItem.text, 'value': value });
11044
+ }
10960
11045
  }
10961
- }
11046
+ else {
11047
+ this.valueMuteChange(null);
11048
+ }
11049
+ });
10962
11050
  }
10963
11051
  else {
10964
11052
  const getItem = new DataManager(this.dataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', currentValue)));
@@ -10986,7 +11074,8 @@ let ComboBox = class ComboBox extends DropDownList {
10986
11074
  (this.allowCustom && this.enableVirtualization && !doesItemExist)) {
10987
11075
  this.valueMuteChange(this.value);
10988
11076
  }
10989
- else if (!this.enableVirtualization || (this.enableVirtualization && !doesItemExist)) {
11077
+ else if (!this.enableVirtualization || (this.enableVirtualization && !(this.dataSource instanceof DataManager)
11078
+ && !doesItemExist)) {
10990
11079
  this.valueMuteChange(null);
10991
11080
  }
10992
11081
  }
@@ -11149,7 +11238,10 @@ let ComboBox = class ComboBox extends DropDownList {
11149
11238
  }
11150
11239
  }
11151
11240
  const activeElement = activeItem.item;
11152
- if (!isNullOrUndefined(activeElement)) {
11241
+ const dataItem = this.getItemData();
11242
+ if ((!isNullOrUndefined(activeElement) && !this.enableVirtualization) || (this.enableVirtualization &&
11243
+ this.isTyped && isNullOrUndefined(dataItem) && isNullOrUndefined(dataItem.value) &&
11244
+ dataItem.value.toString() === activeElement.getAttribute('data-value').toString())) {
11153
11245
  const count = this.getIndexByValue(activeElement.getAttribute('data-value')) - 1;
11154
11246
  const height = parseInt(getComputedStyle(this.liCollections[0], null).getPropertyValue('height'), 10);
11155
11247
  if (!isNaN(height) && this.getModuleName() !== 'autocomplete') {
@@ -11771,9 +11863,6 @@ __decorate$3([
11771
11863
  __decorate$3([
11772
11864
  Property(true)
11773
11865
  ], ComboBox.prototype, "showClearButton", void 0);
11774
- __decorate$3([
11775
- Property(false)
11776
- ], ComboBox.prototype, "enableRtl", void 0);
11777
11866
  __decorate$3([
11778
11867
  Event()
11779
11868
  ], ComboBox.prototype, "customValueSpecifier", void 0);
@@ -11981,6 +12070,14 @@ let AutoComplete = class AutoComplete extends ComboBox {
11981
12070
  this.isSelected = false;
11982
12071
  this.activeIndex = null;
11983
12072
  this.isRequesting = false;
12073
+ if (this.queryString !== '' && this.debounceDelay > 0) {
12074
+ this.debouncedFiltering(e, this.debounceDelay);
12075
+ }
12076
+ else {
12077
+ this.performFiltering(e);
12078
+ }
12079
+ }
12080
+ performFiltering(e) {
11984
12081
  const eventArgs = {
11985
12082
  preventDefaultAction: false,
11986
12083
  text: this.filterInput.value,
@@ -13111,7 +13208,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13111
13208
  valuecheck = this.presentItemValue(this.ulElement);
13112
13209
  }
13113
13210
  if (valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
13114
- && this.listData != null) {
13211
+ && this.listData != null && !(valuecheck.length === 1 && valuecheck[0] == null)) {
13115
13212
  this.isaddNonPresentItems = true;
13116
13213
  this.addNonPresentItems(valuecheck, this.ulElement, this.listData);
13117
13214
  this.isaddNonPresentItems = false;
@@ -13730,13 +13827,18 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13730
13827
  this.checkAndScrollParent();
13731
13828
  }
13732
13829
  checkAndScrollParent() {
13733
- const parentElement = this.overAllWrapper ? this.overAllWrapper.parentElement : null;
13734
- if (parentElement) {
13735
- const wrapperHeight = parseFloat(getComputedStyle(this.overAllWrapper).height);
13736
- const parentMaxHeight = parseFloat(getComputedStyle(parentElement).maxHeight);
13737
- if (!isNaN(parentMaxHeight) && wrapperHeight > parentMaxHeight) {
13738
- parentElement.scrollTop = parentElement.scrollHeight;
13830
+ let scrollElement = this.overAllWrapper ? this.overAllWrapper.parentElement : null;
13831
+ while (scrollElement) {
13832
+ const scrollElementStyle = getComputedStyle(scrollElement);
13833
+ const scrollElmentHeight = parseFloat(scrollElementStyle.maxHeight) || parseFloat(scrollElementStyle.height);
13834
+ if (!isNaN(scrollElmentHeight)) {
13835
+ const overflowY = scrollElementStyle.overflowY;
13836
+ if (overflowY === 'auto' || overflowY === 'scroll') {
13837
+ scrollElement.scrollTop = scrollElement.scrollHeight;
13838
+ return;
13839
+ }
13739
13840
  }
13841
+ scrollElement = scrollElement.parentElement;
13740
13842
  }
13741
13843
  }
13742
13844
  enable(state) {
@@ -13986,7 +14088,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13986
14088
  pageDownSelection(steps, isVirtualKeyAction) {
13987
14089
  const list = this.getItems();
13988
14090
  const collection = this.list.querySelectorAll('li.'
13989
- + dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');
14091
+ + dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)' + ':not(.e-virtual-list-end)');
13990
14092
  let previousItem = steps <= collection.length ? collection[steps - 1] : collection[collection.length - 1];
13991
14093
  if (this.fields.disabled && previousItem && !this.enableVirtualization) {
13992
14094
  while (previousItem && (previousItem.classList.contains('e-disabled') || previousItem.classList.contains(HIDE_LIST) ||
@@ -14003,6 +14105,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14003
14105
  if (this.enableVirtualization && isVirtualKeyAction) {
14004
14106
  previousItem = steps <= list.length ? this.liCollections[steps] : this.liCollections[list.length - 1];
14005
14107
  }
14108
+ if (this.enableVirtualization && previousItem && previousItem.classList.contains('e-virtual-list-end')) {
14109
+ previousItem = collection[collection.length - 1];
14110
+ }
14006
14111
  this.isKeyBoardAction = true;
14007
14112
  this.addListFocus(previousItem);
14008
14113
  this.previousFocusItem = previousItem;
@@ -14483,9 +14588,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14483
14588
  const selectedListMargin = selectedLI && !isNaN(parseInt(window.getComputedStyle(selectedLI).marginBottom, 10)) ?
14484
14589
  parseInt(window.getComputedStyle(selectedLI).marginBottom, 10) : 0;
14485
14590
  this.isUpwardScrolling = false;
14486
- const virtualListCount = this.list.querySelectorAll('.e-virtual-list').length;
14487
- const lastElementValue = this.list.querySelector('li:last-of-type') ?
14488
- this.list.querySelector('li:last-of-type').getAttribute('data-value') : null;
14591
+ const virtualListCount = this.list.querySelectorAll('.e-virtual-list:not(.e-virtual-list-end)').length;
14592
+ const liItems = this.list.querySelectorAll('li:not(.e-virtual-list-end)');
14593
+ const lastElementValue = liItems && liItems.length > 0 && liItems[liItems.length - 1] ?
14594
+ liItems[liItems.length - 1].getAttribute('data-value') : null;
14489
14595
  const selectedLiOffsetTop = this.virtualListInfo && this.virtualListInfo.startIndex ?
14490
14596
  selectedLI.offsetTop + (this.virtualListInfo.startIndex * (selectedLI.offsetHeight + selectedListMargin))
14491
14597
  : selectedLI.offsetTop;
@@ -14538,7 +14644,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14538
14644
  this.isKeyBoardAction = isScrollerCHanged;
14539
14645
  }
14540
14646
  scrollTop(selectedLI, activeIndex, keyCode = null) {
14541
- const virtualListCount = this.list.querySelectorAll('.e-virtual-list').length;
14647
+ const virtualListCount = this.list.querySelectorAll('.e-virtual-list:not(.e-virtual-list-end)').length;
14542
14648
  const selectedListMargin = selectedLI && !isNaN(parseInt(window.getComputedStyle(selectedLI).marginBottom, 10)) ?
14543
14649
  parseInt(window.getComputedStyle(selectedLI).marginBottom, 10) : 0;
14544
14650
  const selectedLiOffsetTop = (this.virtualListInfo && this.virtualListInfo.startIndex) ?
@@ -14767,11 +14873,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14767
14873
  if (this.list) {
14768
14874
  let elements = this.list.querySelectorAll('li.'
14769
14875
  + dropDownBaseClasses.li
14770
- + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');
14876
+ + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)' + ':not(.e-virtual-list-end)');
14771
14877
  if (this.mode === 'CheckBox' && this.enableGroupCheckBox && !isNullOrUndefined(this.fields.groupBy)) {
14772
14878
  elements = this.list.querySelectorAll('li.'
14773
14879
  + dropDownBaseClasses.li + ',li.' + dropDownBaseClasses.group
14774
- + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');
14880
+ + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)' + ':not(.e-virtual-list-end)');
14775
14881
  }
14776
14882
  let selectedElem = this.list.querySelector('li.' + dropDownBaseClasses.focus);
14777
14883
  if (this.enableVirtualization && isVirtualKeyAction && !isNullOrUndefined(this.currentFocuedListElement)) {
@@ -15461,7 +15567,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
15461
15567
  const inputWidth = (this.componentWrapper.offsetWidth) * parseFloat(width) / 100;
15462
15568
  width = inputWidth.toString() + 'px';
15463
15569
  }
15464
- return width;
15570
+ return (this.allowResize && this.resizeWidth) ? this.resizeWidth + 'px' : width;
15465
15571
  }
15466
15572
  mouseIn() {
15467
15573
  if (this.enabled && !this.readonly) {
@@ -15735,7 +15841,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
15735
15841
  updateInitialData() {
15736
15842
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
15737
15843
  const currentData = this.selectData;
15738
- const ulElement = this.renderItems(currentData, this.fields);
15844
+ const ulElement = this.renderItems(currentData, this.fields, false, this.isClearAllAction);
15739
15845
  this.list.scrollTop = 0;
15740
15846
  this.virtualListInfo = {
15741
15847
  currentPageNumber: null,
@@ -15955,6 +16061,38 @@ let MultiSelect = class MultiSelect extends DropDownBase {
15955
16061
  this.search(event);
15956
16062
  });
15957
16063
  }
16064
+ performFiltering(e) {
16065
+ const eventArgs = {
16066
+ preventDefaultAction: false,
16067
+ text: this.targetElement(),
16068
+ updateData: (dataSource, query, fields) => {
16069
+ if (eventArgs.cancel) {
16070
+ return;
16071
+ }
16072
+ this.isFiltered = true;
16073
+ this.customFilterQuery = query;
16074
+ this.remoteFilterAction = true;
16075
+ this.isCustomFiltering = true;
16076
+ this.dataUpdater(dataSource, query, fields);
16077
+ },
16078
+ event: e,
16079
+ cancel: false
16080
+ };
16081
+ this.trigger('filtering', eventArgs, (eventArgs) => {
16082
+ this.isFilterPrevented = eventArgs.cancel;
16083
+ if (!eventArgs.cancel) {
16084
+ if (!this.isFiltered && !eventArgs.preventDefaultAction) {
16085
+ this.filterAction = true;
16086
+ this.isFilteringAction = true;
16087
+ if (this.dataSource instanceof DataManager && this.allowCustomValue) {
16088
+ this.isCustomRendered = false;
16089
+ }
16090
+ this.dataUpdater(this.dataSource, null, this.fields);
16091
+ this.isFilteringAction = false;
16092
+ }
16093
+ }
16094
+ });
16095
+ }
15958
16096
  search(e) {
15959
16097
  this.preventSetCurrentData = false;
15960
16098
  this.firstItem = this.dataSource && this.dataSource.length > 0 ? this.dataSource[0] : null;
@@ -15976,36 +16114,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
15976
16114
  }
15977
16115
  this.checkAndResetCache();
15978
16116
  this.isRequesting = false;
15979
- const eventArgs = {
15980
- preventDefaultAction: false,
15981
- text: this.targetElement(),
15982
- updateData: (dataSource, query, fields) => {
15983
- if (eventArgs.cancel) {
15984
- return;
15985
- }
15986
- this.isFiltered = true;
15987
- this.customFilterQuery = query;
15988
- this.remoteFilterAction = true;
15989
- this.isCustomFiltering = true;
15990
- this.dataUpdater(dataSource, query, fields);
15991
- },
15992
- event: e,
15993
- cancel: false
15994
- };
15995
- this.trigger('filtering', eventArgs, (eventArgs) => {
15996
- this.isFilterPrevented = eventArgs.cancel;
15997
- if (!eventArgs.cancel) {
15998
- if (!this.isFiltered && !eventArgs.preventDefaultAction) {
15999
- this.filterAction = true;
16000
- this.isFilteringAction = true;
16001
- if (this.dataSource instanceof DataManager && this.allowCustomValue) {
16002
- this.isCustomRendered = false;
16003
- }
16004
- this.dataUpdater(this.dataSource, null, this.fields);
16005
- this.isFilteringAction = false;
16006
- }
16007
- }
16008
- });
16117
+ if (this.targetElement() !== '' && this.debounceDelay > 0) {
16118
+ this.debouncedFiltering(e, this.debounceDelay);
16119
+ }
16120
+ else {
16121
+ this.performFiltering(e);
16122
+ }
16009
16123
  }
16010
16124
  else if (this.allowCustomValue) {
16011
16125
  let query = new Query();
@@ -17109,7 +17223,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
17109
17223
  }
17110
17224
  checkClearIconWidth() {
17111
17225
  if (this.showClearButton) {
17112
- this.clearIconWidth = parseInt(window.getComputedStyle(this.overAllClear).width, 10);
17226
+ this.clearIconWidth = parseInt(window.getComputedStyle(this.overAllClear).width, 10) || this.overAllClear.offsetWidth;
17113
17227
  }
17114
17228
  }
17115
17229
  updateRemainWidth(viewWrapper, totalWidth) {
@@ -18021,7 +18135,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
18021
18135
  this.list.parentElement.style.paddingBottom = '';
18022
18136
  const overAllHeight = parseInt(this.popupHeight, 10);
18023
18137
  this.list.style.maxHeight = formatUnit(overAllHeight);
18024
- this.list.parentElement.style.height = formatUnit(this.popupHeight);
18138
+ if (this.popupHeight.toString().toLowerCase() !== 'auto' && this.initialPopupHeight >= (parseInt(this.popupHeight.toString(), 10) - 2)) {
18139
+ this.list.parentElement.style.height = formatUnit(this.popupHeight);
18140
+ }
18025
18141
  this.list.parentElement.style.maxHeight = formatUnit(this.popupHeight);
18026
18142
  }
18027
18143
  if (this.resizer) {
@@ -18346,7 +18462,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
18346
18462
  }
18347
18463
  if (this.list && this.list.parentElement) {
18348
18464
  this.list.parentElement.classList.add('e-resize');
18349
- if (this.popupHeight.toString().toLowerCase() !== 'auto') {
18465
+ this.initialPopupHeight = this.list.parentElement.clientHeight;
18466
+ if (this.popupHeight.toString().toLowerCase() !== 'auto' && this.initialPopupHeight >= (parseInt(this.popupHeight.toString(), 10) - 2)) {
18350
18467
  this.list.parentElement.style.height = '100%';
18351
18468
  }
18352
18469
  this.list.parentElement.style.boxSizing = 'border-box'; // Ensures padding doesn't affect element size
@@ -18357,6 +18474,18 @@ let MultiSelect = class MultiSelect extends DropDownBase {
18357
18474
  this.list.parentElement.style.height = this.resizeHeight + 'px';
18358
18475
  this.list.parentElement.style.maxHeight = this.resizeHeight + 'px';
18359
18476
  this.list.style.maxHeight = `${this.resizeHeight}px`;
18477
+ if (this.headerTemplate) {
18478
+ const headerElem = this.list.parentElement.querySelector('.e-ddl-header');
18479
+ if (headerElem && headerElem.offsetHeight) {
18480
+ this.headerTemplateHeight = headerElem.offsetHeight;
18481
+ }
18482
+ if (this.resizeHeight) {
18483
+ this.list.style.maxHeight = `${this.resizeHeight - this.headerTemplateHeight - 16}px`;
18484
+ }
18485
+ else {
18486
+ this.list.style.maxHeight = `${parseInt(this.list.style.maxHeight, 10) - 16}px`;
18487
+ }
18488
+ }
18360
18489
  }
18361
18490
  if (this.resizer) {
18362
18491
  EventHandler.add(this.resizer, 'mousedown', this.startResizing, this);
@@ -18411,6 +18540,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
18411
18540
  this.list.parentElement.style.height = `${this.resizeHeight}px`;
18412
18541
  this.list.parentElement.style.maxHeight = `${this.resizeHeight}px`;
18413
18542
  this.list.style.maxHeight = `${this.resizeHeight}px`;
18543
+ if (this.headerTemplate) {
18544
+ this.list.style.maxHeight = `${this.resizeHeight - this.headerTemplateHeight - 16}px`;
18545
+ }
18414
18546
  if (this.fixedHeaderElement && this.ulElement) {
18415
18547
  this.fixedHeaderElement.style.width = `${this.ulElement.offsetWidth}px`;
18416
18548
  }
@@ -18909,6 +19041,9 @@ __decorate$5([
18909
19041
  __decorate$5([
18910
19042
  Property(null)
18911
19043
  ], MultiSelect.prototype, "allowFiltering", void 0);
19044
+ __decorate$5([
19045
+ Property(300)
19046
+ ], MultiSelect.prototype, "debounceDelay", void 0);
18912
19047
  __decorate$5([
18913
19048
  Property(true)
18914
19049
  ], MultiSelect.prototype, "isDeviceFullScreen", void 0);
@@ -22200,6 +22335,7 @@ let Mention = class Mention extends DropDownBase {
22200
22335
  */
22201
22336
  constructor(options, element) {
22202
22337
  super(options, element);
22338
+ this.debounceTimer = null;
22203
22339
  }
22204
22340
  /**
22205
22341
  * When property value changes happened, then onPropertyChanged method will execute the respective changes in this component.
@@ -22633,21 +22769,7 @@ let Mention = class Mention extends DropDownBase {
22633
22769
  this.range = this.inputElement.ownerDocument.getSelection().getRangeAt(0);
22634
22770
  return this.range;
22635
22771
  }
22636
- searchLists(e) {
22637
- this.isDataFetched = false;
22638
- if (isNullOrUndefined(this.list)) {
22639
- super.render();
22640
- this.unWireListEvents();
22641
- this.wireListEvents();
22642
- }
22643
- if (e.type !== 'mousedown' && (e.keyCode === 40 || e.keyCode === 38)) {
22644
- this.queryString = this.queryString === '' ? null : this.queryString;
22645
- this.beforePopupOpen = true;
22646
- this.resetList(this.dataSource, this.fields);
22647
- return;
22648
- }
22649
- this.isSelected = false;
22650
- this.activeIndex = null;
22772
+ performFiltering(e) {
22651
22773
  const eventArgs = {
22652
22774
  preventDefaultAction: false,
22653
22775
  text: this.queryString,
@@ -22666,6 +22788,28 @@ let Mention = class Mention extends DropDownBase {
22666
22788
  }
22667
22789
  });
22668
22790
  }
22791
+ searchLists(e) {
22792
+ this.isDataFetched = false;
22793
+ if (isNullOrUndefined(this.list)) {
22794
+ super.render();
22795
+ this.unWireListEvents();
22796
+ this.wireListEvents();
22797
+ }
22798
+ if (e.type !== 'mousedown' && (e.keyCode === 40 || e.keyCode === 38)) {
22799
+ this.queryString = this.queryString === '' ? null : this.queryString;
22800
+ this.beforePopupOpen = true;
22801
+ this.resetList(this.dataSource, this.fields);
22802
+ return;
22803
+ }
22804
+ this.isSelected = false;
22805
+ this.activeIndex = null;
22806
+ if (this.queryString !== '' && this.debounceDelay > 0) {
22807
+ this.debouncedFiltering(e, this.debounceDelay);
22808
+ }
22809
+ else {
22810
+ this.performFiltering(e);
22811
+ }
22812
+ }
22669
22813
  filterAction(dataSource, query, fields) {
22670
22814
  this.beforePopupOpen = true;
22671
22815
  if (this.queryString.length >= this.minLength) {
@@ -23857,6 +24001,9 @@ __decorate$7([
23857
24001
  __decorate$7([
23858
24002
  Property('300px')
23859
24003
  ], Mention.prototype, "popupHeight", void 0);
24004
+ __decorate$7([
24005
+ Property(300)
24006
+ ], Mention.prototype, "debounceDelay", void 0);
23860
24007
  __decorate$7([
23861
24008
  Property(null)
23862
24009
  ], Mention.prototype, "displayTemplate", void 0);