@syncfusion/ej2-dropdowns 33.1.49 → 33.2.4

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.
@@ -8577,9 +8577,6 @@ let DropDownTree = class DropDownTree extends Component {
8577
8577
  if (formElement) {
8578
8578
  EventHandler.add(formElement, 'reset', this.resetValueHandler, this);
8579
8579
  }
8580
- if (this.keyboardModule && typeof this.keyboardModule.destroy === 'function') {
8581
- this.keyboardModule.destroy();
8582
- }
8583
8580
  this.keyboardModule = new KeyboardEvents(this.inputWrapper, {
8584
8581
  keyAction: this.keyActionHandler.bind(this),
8585
8582
  keyConfigs: this.keyConfigs,
@@ -8587,9 +8584,6 @@ let DropDownTree = class DropDownTree extends Component {
8587
8584
  });
8588
8585
  }
8589
8586
  wireTreeEvents() {
8590
- if (this.keyboardModule && typeof this.keyboardModule.destroy === 'function') {
8591
- this.keyboardModule.destroy();
8592
- }
8593
8587
  this.keyboardModule = new KeyboardEvents(this.tree, {
8594
8588
  keyAction: this.treeAction.bind(this),
8595
8589
  keyConfigs: this.keyConfigs,
@@ -9820,6 +9814,9 @@ let DropDownTree = class DropDownTree extends Component {
9820
9814
  removeClass([this.popupDiv], NODATA);
9821
9815
  this.hideCheckAll(false);
9822
9816
  }
9817
+ else {
9818
+ this.hideCheckAll(this.treeItems.length <= 1);
9819
+ }
9823
9820
  if (!this.isFilteredData) {
9824
9821
  this.treeDataType = this.getTreeDataType(this.treeItems, this.fields);
9825
9822
  }
@@ -11226,6 +11223,9 @@ let DropDownTree = class DropDownTree extends Component {
11226
11223
  EventHandler.remove(element, 'mouseup', this.removeChip);
11227
11224
  }
11228
11225
  }
11226
+ if (this.keyboardModule) {
11227
+ this.keyboardModule.destroy();
11228
+ }
11229
11229
  this.chipWrapper = null;
11230
11230
  this.chipCollection = null;
11231
11231
  this.checkAllParent = null;
@@ -19772,7 +19772,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
19772
19772
  });
19773
19773
  }
19774
19774
  else {
19775
- listItems = new DataManager(this.dataSource).executeLocal(new Query().where(predicate));
19775
+ listItems = this.executeLocalForLargeSelection(this.dataSource, this.value, {
19776
+ fields: this.fields,
19777
+ allowObjectBinding: this.allowObjectBinding,
19778
+ isPrimitiveData: this.isPrimitiveData
19779
+ });
19776
19780
  }
19777
19781
  }
19778
19782
  if (!(this.dataSource instanceof DataManager)) {
@@ -19801,6 +19805,55 @@ let MultiSelect = class MultiSelect extends DropDownBase {
19801
19805
  this.element.setAttribute('data-initial-value', this.text);
19802
19806
  }
19803
19807
  }
19808
+ executeLocalForLargeSelection(dataSource, values, options) {
19809
+ if (!dataSource || !dataSource.length || !values || !values.length) {
19810
+ return [];
19811
+ }
19812
+ const { fields, allowObjectBinding, isPrimitiveData, predicateChunkSize = 100 } = options;
19813
+ if (values.length === dataSource.length) {
19814
+ return dataSource.slice();
19815
+ }
19816
+ const field = isPrimitiveData ? '' : fields.value;
19817
+ const allResults = [];
19818
+ let predicate = null;
19819
+ let count = 0;
19820
+ const flushPredicate = () => {
19821
+ if (!predicate) {
19822
+ return;
19823
+ }
19824
+ const query = new Query().where(predicate);
19825
+ const result = new DataManager(dataSource).executeLocal(query);
19826
+ allResults.push(...result);
19827
+ predicate = null;
19828
+ count = 0;
19829
+ };
19830
+ for (let i = 0; i < values.length; i++) {
19831
+ const value = allowObjectBinding
19832
+ ? getValue(fields.value || '', values[i])
19833
+ : values[i];
19834
+ predicate = predicate
19835
+ ? predicate.or(field, 'equal', value)
19836
+ : new Predicate(field, 'equal', value);
19837
+ count++;
19838
+ if (count === predicateChunkSize) {
19839
+ flushPredicate();
19840
+ }
19841
+ }
19842
+ flushPredicate();
19843
+ const uniqueMap = {};
19844
+ const resultArray = [];
19845
+ for (let i = 0; i < allResults.length; i++) {
19846
+ const item = allResults[i];
19847
+ const key = isPrimitiveData
19848
+ ? item.toString()
19849
+ : getValue(fields.value, item);
19850
+ if (!uniqueMap.hasOwnProperty(key)) {
19851
+ uniqueMap[key] = item;
19852
+ resultArray.push(item);
19853
+ }
19854
+ }
19855
+ return resultArray;
19856
+ }
19804
19857
  checkAutoFocus() {
19805
19858
  if (this.element.hasAttribute('autofocus')) {
19806
19859
  this.inputElement.focus();
@@ -23974,7 +24027,7 @@ let Mention = class Mention extends DropDownBase {
23974
24027
  }
23975
24028
  else if (this.allowSpaces && this.queryString !== '' && currentRange && currentRange.trim() !== '' && currentRange.replace('\u00a0', ' ').lastIndexOf(' ') < currentRange.length - 1 &&
23976
24029
  e.keyCode !== 38 && e.keyCode !== 40 && e.keyCode !== 8 && (this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0) ||
23977
- (this.liCollections && this.liCollections.length > 0))) {
24030
+ ((this.liCollections && this.liCollections.length > 0) || (this.isPopupOpen && this.list && this.list.classList.contains('e-nodata'))))) {
23978
24031
  this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
23979
24032
  this.searchLists(e);
23980
24033
  }