@syncfusion/ej2-dropdowns 29.2.10 → 29.2.11

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 29.2.10
3
+ * version : 29.2.11
4
4
  * Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/license CHANGED
@@ -1,3 +1,3 @@
1
- Licensing information is available in the following link
1
+ Licensing information is available in the following link
2
2
 
3
3
  https://www.syncfusion.com/sales/licensing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-dropdowns",
3
- "version": "29.2.10",
3
+ "version": "29.2.11",
4
4
  "description": "Essential JS 2 DropDown Components",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -8,7 +8,7 @@
8
8
  "module": "./index.js",
9
9
  "es2015": "./dist/es6/ej2-dropdowns.es5.js",
10
10
  "dependencies": {
11
- "@syncfusion/ej2-base": "~29.2.4",
11
+ "@syncfusion/ej2-base": "~29.2.11",
12
12
  "@syncfusion/ej2-data": "~29.2.4",
13
13
  "@syncfusion/ej2-inputs": "~29.2.5",
14
14
  "@syncfusion/ej2-lists": "~29.2.4",
@@ -776,6 +776,7 @@ export declare class MultiSelect extends DropDownBase implements IInput {
776
776
  private chipClick;
777
777
  private removeChipSelection;
778
778
  private addChipSelection;
779
+ private getVirtualDataByValue;
779
780
  private onChipRemove;
780
781
  private makeTextBoxEmpty;
781
782
  private refreshPlaceHolder;
@@ -489,7 +489,8 @@ var MultiSelect = /** @class */ (function (_super) {
489
489
  if (!isNullOrUndefined(this.value)) {
490
490
  this.tempValues = this.allowObjectBinding ? this.value.slice() : this.value.slice();
491
491
  }
492
- var customValue = this.allowObjectBinding ?
492
+ var customValue = this.allowObjectBinding ? this.enableVirtualization ?
493
+ this.getVirtualDataByValue(this.getFormattedValue(value)) :
493
494
  this.getDataByValue(this.getFormattedValue(value)) : this.getFormattedValue(value);
494
495
  if (this.allowCustomValue && (value !== 'false' && customValue === false || (!isNullOrUndefined(customValue) &&
495
496
  customValue.toString() === 'NaN'))) {
@@ -911,9 +912,9 @@ var MultiSelect = /** @class */ (function (_super) {
911
912
  return this.virtualFilterQuery(filterQuery);
912
913
  }
913
914
  if (this.virtualSelectAll) {
914
- return query ? query.take(this.maximumSelectionLength).requiresCount() : this.query ?
915
- this.query.take(this.maximumSelectionLength).requiresCount() :
916
- new Query().take(this.maximumSelectionLength).requiresCount();
915
+ return query ? query.skip(0).take(this.maximumSelectionLength).requiresCount() : this.query ?
916
+ this.query.skip(0).take(this.maximumSelectionLength).requiresCount() :
917
+ new Query().skip(0).take(this.maximumSelectionLength).requiresCount();
917
918
  }
918
919
  return query ? query : this.query ? this.query : new Query();
919
920
  }
@@ -1893,6 +1894,15 @@ var MultiSelect = /** @class */ (function (_super) {
1893
1894
  var focuseElem = this.list.querySelector('li.' + dropDownBaseClasses.focus);
1894
1895
  this.focusFirstListItem = !isNullOrUndefined(this.liCollections[0]) ? this.liCollections[0].classList.contains('e-item-focus') :
1895
1896
  false;
1897
+ if (this.list && this.list.querySelector('.e-list-parent.e-ul.e-reorder')) {
1898
+ var elements = this.list.querySelectorAll('li.'
1899
+ + dropDownBaseClasses.li
1900
+ + ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)' + ':not(.e-virtual-list-end)');
1901
+ if (elements.length > 0) {
1902
+ this.focusFirstListItem = !isNullOrUndefined(elements[0]) ? elements[0].classList.contains('e-item-focus') :
1903
+ false;
1904
+ }
1905
+ }
1896
1906
  var index = Array.prototype.slice.call(list).indexOf(focuseElem);
1897
1907
  if (index <= 0 && (this.mode === 'CheckBox' && this.allowFiltering)) {
1898
1908
  this.keyAction = false;
@@ -2317,10 +2327,10 @@ var MultiSelect = /** @class */ (function (_super) {
2317
2327
  }
2318
2328
  else if (elements.length) {
2319
2329
  if (this.mode === 'CheckBox' && this.showSelectAll && !isNullOrUndefined(selectAllParent && position === -1)) {
2320
- if (!this.focusFirstListItem && selectAllParent.classList.contains('e-item-focus')) {
2330
+ if ((!this.focusFirstListItem || position === 1) && selectAllParent.classList.contains('e-item-focus')) {
2321
2331
  selectAllParent.classList.remove('e-item-focus');
2322
2332
  }
2323
- else if (this.focusFirstListItem && !selectAllParent.classList.contains('e-item-focus')) {
2333
+ else if (this.focusFirstListItem && !selectAllParent.classList.contains('e-item-focus') && !(position === 1 && this.list.querySelector('.e-item-focus'))) {
2324
2334
  selectAllParent.classList.add('e-item-focus');
2325
2335
  }
2326
2336
  }
@@ -2458,6 +2468,28 @@ var MultiSelect = /** @class */ (function (_super) {
2458
2468
  addClass([element], CHIP_SELECTED);
2459
2469
  this.trigger('chipSelection', e);
2460
2470
  };
2471
+ MultiSelect.prototype.getVirtualDataByValue = function (value) {
2472
+ if (!isNullOrUndefined(this.selectedListData)) {
2473
+ var type = this.typeOfData(this.selectedListData).typeof;
2474
+ if (type === 'string' || type === 'number' || type === 'boolean') {
2475
+ for (var _i = 0, _a = this.selectedListData; _i < _a.length; _i++) {
2476
+ var item = _a[_i];
2477
+ if (!isNullOrUndefined(item) && item === value) {
2478
+ return item;
2479
+ }
2480
+ }
2481
+ }
2482
+ else {
2483
+ for (var _b = 0, _c = this.selectedListData; _b < _c.length; _b++) {
2484
+ var item = _c[_b];
2485
+ if (!isNullOrUndefined(item) && getValue((this.fields.value ? this.fields.value : 'value'), item) === value) {
2486
+ return item;
2487
+ }
2488
+ }
2489
+ }
2490
+ }
2491
+ return null;
2492
+ };
2461
2493
  MultiSelect.prototype.onChipRemove = function (e) {
2462
2494
  if (e.which === 3 || e.button === 2) {
2463
2495
  return;
@@ -2465,7 +2497,8 @@ var MultiSelect = /** @class */ (function (_super) {
2465
2497
  if (this.enabled && !this.readonly) {
2466
2498
  var element = e.target.parentElement;
2467
2499
  var customVal = element.getAttribute('data-value');
2468
- var value = this.allowObjectBinding ?
2500
+ var value = this.allowObjectBinding ? this.enableVirtualization ?
2501
+ this.getVirtualDataByValue(this.getFormattedValue(customVal)) :
2469
2502
  this.getDataByValue(this.getFormattedValue(customVal)) : this.getFormattedValue(customVal);
2470
2503
  if (this.allowCustomValue && ((customVal !== 'false' && value === false) ||
2471
2504
  (!isNullOrUndefined(value) && value.toString() === 'NaN'))) {
@@ -2583,7 +2616,7 @@ var MultiSelect = /** @class */ (function (_super) {
2583
2616
  _this.virtualSelectAll = false;
2584
2617
  var removeVal = _this.value.slice(0);
2585
2618
  removeVal.splice(index, 1);
2586
- if (_this.enableVirtualization && _this.mode === 'CheckBox') {
2619
+ if (_this.enableVirtualization && _this.selectedListData) {
2587
2620
  _this.selectedListData.splice(index, 1);
2588
2621
  }
2589
2622
  _this.setProperties({ value: [].concat([], removeVal) }, true);
@@ -2848,7 +2881,7 @@ var MultiSelect = /** @class */ (function (_super) {
2848
2881
  value = _this.allowObjectBinding ? _this.getDataByValue(value) : value;
2849
2882
  if (_this.enableVirtualization) {
2850
2883
  if (isNullOrUndefined(_this.selectedListData)) {
2851
- _this.selectedListData = [(_this.getDataByValue(value))];
2884
+ _this.selectedListData = _this.allowObjectBinding ? [value] : [(_this.getDataByValue(value))];
2852
2885
  }
2853
2886
  else {
2854
2887
  if (dataValue) {
@@ -2861,10 +2894,12 @@ var MultiSelect = /** @class */ (function (_super) {
2861
2894
  }
2862
2895
  else {
2863
2896
  if (Array.isArray(_this.selectedListData)) {
2864
- _this.selectedListData.push((_this.getDataByValue(value)));
2897
+ _this.selectedListData.push(_this.allowObjectBinding ? value :
2898
+ (_this.getDataByValue(value)));
2865
2899
  }
2866
2900
  else {
2867
- _this.selectedListData = [_this.selectedListData, (_this.getDataByValue(value))];
2901
+ _this.selectedListData = [_this.selectedListData, _this.allowObjectBinding ? value :
2902
+ (_this.getDataByValue(value))];
2868
2903
  }
2869
2904
  }
2870
2905
  }
@@ -3877,11 +3912,14 @@ var MultiSelect = /** @class */ (function (_super) {
3877
3912
  this.selectedListData = [listItems[i]];
3878
3913
  }
3879
3914
  else {
3880
- if (Array.isArray(this.selectedListData)) {
3881
- this.selectedListData.push((listItems[i]));
3882
- }
3883
- else {
3884
- this.selectedListData = [this.selectedListData, (listItems[i])];
3915
+ if ((this.allowObjectBinding && !this.isObjectInArray(listItems[i], this.selectedListData)) ||
3916
+ !this.allowObjectBinding) {
3917
+ if (Array.isArray(this.selectedListData)) {
3918
+ this.selectedListData.push((listItems[i]));
3919
+ }
3920
+ else {
3921
+ this.selectedListData = [this.selectedListData, (listItems[i])];
3922
+ }
3885
3923
  }
3886
3924
  }
3887
3925
  }
@@ -4950,6 +4988,7 @@ var MultiSelect = /** @class */ (function (_super) {
4950
4988
  }
4951
4989
  this.updateHiddenElement();
4952
4990
  this.setProperties({ value: [] }, true);
4991
+ this.selectedListData = [];
4953
4992
  this.virtualSelectAll = false;
4954
4993
  if (!isNullOrUndefined(this.viewPortInfo.startIndex) && !isNullOrUndefined(this.viewPortInfo.endIndex)) {
4955
4994
  this.notify('setCurrentViewDataAsync', {
@@ -5466,6 +5505,7 @@ var MultiSelect = /** @class */ (function (_super) {
5466
5505
  this.onLoadSelect();
5467
5506
  if (this.enableVirtualization) {
5468
5507
  this.setProperties({ text: '' }, true);
5508
+ this.selectedListData = [];
5469
5509
  this.checkInitialValue();
5470
5510
  }
5471
5511
  }