@syncfusion/ej2-dropdowns 27.2.3 → 27.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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 27.2.3
3
+ * version : 27.2.4
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. 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/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-dropdowns@*",
3
- "_id": "@syncfusion/ej2-dropdowns@27.2.2",
3
+ "_id": "@syncfusion/ej2-dropdowns@27.2.3",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-KEah4nyZTCzRus/gHRWw7zF9TEAIT9SnG9x4XIP2E1cfFQDN21nO9HCfxqUMu3LNPebyoEe0zwu6bPJWfCftiA==",
5
+ "_integrity": "sha512-LHpRyFlnkppjWgXxKv8CQL3l5jIDMYlI7EiDyuTovWdECbc2hckibuK1sZcSLpWob+2rKkhzvmo+CXuTB8ffbw==",
6
6
  "_location": "/@syncfusion/ej2-dropdowns",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -36,8 +36,8 @@
36
36
  "/@syncfusion/ej2-spreadsheet",
37
37
  "/@syncfusion/ej2-vue-dropdowns"
38
38
  ],
39
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-27.2.2.tgz",
40
- "_shasum": "592523614fba82ab61656defe92cb443f39de771",
39
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-27.2.3.tgz",
40
+ "_shasum": "d86eb63395912d970396ea24c9e74a626db22c46",
41
41
  "_spec": "@syncfusion/ej2-dropdowns@*",
42
42
  "_where": "/jenkins/workspace/elease-automation_release_27.1.1/packages/included",
43
43
  "author": {
@@ -47,10 +47,10 @@
47
47
  "dependencies": {
48
48
  "@syncfusion/ej2-base": "~27.2.2",
49
49
  "@syncfusion/ej2-data": "~27.2.2",
50
- "@syncfusion/ej2-inputs": "~27.2.2",
50
+ "@syncfusion/ej2-inputs": "~27.2.4",
51
51
  "@syncfusion/ej2-lists": "~27.2.3",
52
- "@syncfusion/ej2-navigations": "~27.2.3",
53
- "@syncfusion/ej2-notifications": "~27.2.2",
52
+ "@syncfusion/ej2-navigations": "~27.2.4",
53
+ "@syncfusion/ej2-notifications": "~27.2.4",
54
54
  "@syncfusion/ej2-popups": "~27.2.2"
55
55
  },
56
56
  "deprecated": false,
@@ -76,7 +76,7 @@
76
76
  "module": "./index.js",
77
77
  "name": "@syncfusion/ej2-dropdowns",
78
78
  "typings": "index.d.ts",
79
- "version": "27.2.3",
79
+ "version": "27.2.4",
80
80
  "sideEffects": false,
81
81
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
82
82
  }
@@ -110,4 +110,5 @@ export interface IDropdownlist extends Component<HTMLElement> {
110
110
  }[] | DataManager | string[] | number[] | boolean[], fields?: FieldSettingsModel, query?: Query, e?: MouseEvent | KeyboardEventArgs | TouchEvent): void;
111
111
  findListElement(list: HTMLElement, findNode: string, attribute: string, value: string | boolean | number): HTMLElement;
112
112
  scrollStop(e?: Event): void;
113
+ targetElement(): string;
113
114
  }
@@ -185,7 +185,7 @@ var VirtualScroll = /** @class */ (function () {
185
185
  this.component = component.component;
186
186
  }
187
187
  var endIndex = this.parent.viewPortInfo.endIndex;
188
- if (this.component === 'multiselect' && this.parent.mode === 'CheckBox' && this.parent.value && Array.isArray(this.parent.value) && this.parent.value.length > 0 && this.parent.enableSelectionOrder) {
188
+ if (this.component === 'multiselect' && this.parent.mode === 'CheckBox' && this.parent.value && Array.isArray(this.parent.value) && this.parent.value.length > 0 && this.parent.enableSelectionOrder && this.parent.targetElement().trim() === '') {
189
189
  if (this.parent.viewPortInfo.startIndex < this.parent.value.length) {
190
190
  endIndex = this.parent.viewPortInfo.endIndex - this.parent.value.length;
191
191
  if (this.parent.viewPortInfo.startIndex === 0) {
@@ -283,7 +283,8 @@ var VirtualScroll = /** @class */ (function () {
283
283
  if (index === endIndex - 1) {
284
284
  if (currentData.length !== this.parent.itemCount) {
285
285
  if (this.parent.hideSelectedItem) {
286
- var query = this.parent.getForQuery(this.parent.value).clone();
286
+ var query = this.parent.value && this.parent.value.length > 0 ?
287
+ this.parent.getForQuery(this.parent.value).clone() : new Query;
287
288
  if (this.parent.viewPortInfo.endIndex === this.parent.totalItemCount + this.parent.value.length &&
288
289
  this.parent.hideSelectedItem) {
289
290
  query = query.skip(this.parent.totalItemCount - this.parent.itemCount);
@@ -293,6 +293,7 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
293
293
  protected firstItem: string | number | boolean | object;
294
294
  protected preventDefActionFilter: boolean;
295
295
  protected isDynamicData: boolean;
296
+ protected isPrimitiveData: boolean;
296
297
  protected virtualListInfo: VirtualInfo;
297
298
  protected viewPortInfo: VirtualInfo;
298
299
  protected selectedValueInfo: VirtualInfo;
@@ -135,6 +135,7 @@ var DropDownBase = /** @class */ (function (_super) {
135
135
  _this.virtualSelectAllState = false;
136
136
  _this.CurrentEvent = null;
137
137
  _this.isDynamicData = false;
138
+ _this.isPrimitiveData = false;
138
139
  _this.virtualListInfo = {
139
140
  currentPageNumber: null,
140
141
  direction: null,
@@ -1472,6 +1473,7 @@ var DropDownBase = /** @class */ (function (_super) {
1472
1473
  this.updateFields(this.fields.text, this.fields.text);
1473
1474
  }
1474
1475
  else if (!this.fields.value && !this.fields.text) {
1476
+ this.isPrimitiveData = true;
1475
1477
  this.updateFields('text', 'text');
1476
1478
  }
1477
1479
  };
@@ -1519,6 +1521,7 @@ var DropDownBase = /** @class */ (function (_super) {
1519
1521
  };
1520
1522
  DropDownBase.prototype.setUpdateInitial = function (props, newProp, oldProp) {
1521
1523
  this.isDataFetched = false;
1524
+ this.isPrimitiveData = false;
1522
1525
  var updateData = {};
1523
1526
  for (var j = 0; props.length > j; j++) {
1524
1527
  if (newProp[props[j]] && props[j] === 'fields') {
@@ -1498,7 +1498,7 @@ var DropDownList = /** @class */ (function (_super) {
1498
1498
  else {
1499
1499
  this.setSelectOptions(li, e);
1500
1500
  if (this.enableVirtualization && this.value) {
1501
- var fields = (this.fields.value) ? this.fields.value : '';
1501
+ var fields = !this.isPrimitiveData ? this.fields.value : '';
1502
1502
  var currentValue = this.allowObjectBinding && !isNullOrUndefined(this.value) ?
1503
1503
  getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
1504
1504
  if (this.dataSource instanceof DataManager) {
@@ -317,7 +317,10 @@ var CheckBoxSelection = /** @class */ (function () {
317
317
  this.parent.refreshPopup();
318
318
  this.clearIconElement.style.visibility = 'hidden';
319
319
  this.filterInput.focus();
320
- this.setReorder(e);
320
+ if (!this.parent.enableVirtualization || (this.parent.enableVirtualization && (isNullOrUndefined(this.parent.value)
321
+ || (this.parent.value && this.parent.value.length === 0)))) {
322
+ this.setReorder(e);
323
+ }
321
324
  this.boundPreventListSelection = this.preventListSelection.bind(this);
322
325
  this.parent.popupWrapper.addEventListener('mouseup', this.boundPreventListSelection, true);
323
326
  e.preventDefault();
@@ -484,7 +484,7 @@ var MultiSelect = /** @class */ (function (_super) {
484
484
  };
485
485
  MultiSelect.prototype.getForQuery = function (valuecheck, isCheckbox) {
486
486
  var predicate;
487
- var field = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
487
+ var field = this.isPrimitiveData ? '' : this.fields.value;
488
488
  if (this.enableVirtualization && valuecheck) {
489
489
  if (isCheckbox) {
490
490
  for (var i = 0; i < valuecheck.length; i++) {
@@ -927,32 +927,48 @@ var MultiSelect = /** @class */ (function (_super) {
927
927
  if (this.targetElement().trim() === '') {
928
928
  var list = this.enableVirtualization ? this.list.cloneNode(true) : this.mainList.cloneNode ?
929
929
  this.mainList.cloneNode(true) : this.mainList;
930
- if (this.backCommand) {
930
+ if (this.backCommand || (this.enableVirtualization && this.mode === 'CheckBox' && this.value && this.value.length > 0)) {
931
931
  this.remoteCustomValue = false;
932
+ var isReordered = false;
932
933
  if (this.allowCustomValue && list.querySelectorAll('li').length === 0 && this.mainData.length > 0) {
933
934
  this.mainData = [];
934
935
  }
935
936
  if (this.enableVirtualization) {
936
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
937
- this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
938
- this.resetList(dataSource, fields, query);
939
- if (this.mode !== 'CheckBox') {
940
- this.totalItemCount = this.value && this.value.length ? this.totalItemCount - this.value.length :
941
- this.totalItemCount;
937
+ if (this.allowFiltering) {
938
+ this.isPreventScrollAction = true;
939
+ this.list.scrollTop = 0;
940
+ this.previousStartIndex = 0;
941
+ this.virtualListInfo = null;
942
942
  }
943
- this.UpdateSkeleton();
944
- if ((isNoData || this.allowCustomValue) && !this.list.classList.contains(dropDownBaseClasses.noData)) {
945
- if (!this.list.querySelector('.e-virtual-ddl-content')) {
946
- this.list.appendChild(this.createElement('div', {
947
- className: 'e-virtual-ddl-content',
948
- styles: this.getTransformValues()
949
- })).appendChild(this.list.querySelector('.e-list-parent'));
943
+ if (this.value && this.value.length > 0 && this.mode === 'CheckBox') {
944
+ this.notify('setCurrentViewDataAsync', {
945
+ component: this.getModuleName(),
946
+ module: 'VirtualScroll'
947
+ });
948
+ isReordered = true;
949
+ }
950
+ else {
951
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
952
+ this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
953
+ this.resetList(dataSource, fields, query);
954
+ if (this.mode !== 'CheckBox') {
955
+ this.totalItemCount = this.value && this.value.length ? this.totalItemCount - this.value.length :
956
+ this.totalItemCount;
950
957
  }
951
- if (!this.list.querySelector('.e-virtual-ddl')) {
952
- var virualElement = this.createElement('div', {
953
- id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
954
- });
955
- document.getElementsByClassName('e-multi-select-list-wrapper')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
958
+ this.UpdateSkeleton();
959
+ if ((isNoData || this.allowCustomValue) && !this.list.classList.contains(dropDownBaseClasses.noData)) {
960
+ if (!this.list.querySelector('.e-virtual-ddl-content')) {
961
+ this.list.appendChild(this.createElement('div', {
962
+ className: 'e-virtual-ddl-content',
963
+ styles: this.getTransformValues()
964
+ })).appendChild(this.list.querySelector('.e-list-parent'));
965
+ }
966
+ if (!this.list.querySelector('.e-virtual-ddl')) {
967
+ var virualElement = this.createElement('div', {
968
+ id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
969
+ });
970
+ document.getElementsByClassName('e-multi-select-list-wrapper')[0].querySelector('.e-dropdownbase').appendChild(virualElement);
971
+ }
956
972
  }
957
973
  }
958
974
  }
@@ -963,7 +979,9 @@ var MultiSelect = /** @class */ (function (_super) {
963
979
  if (this.keyCode !== 8) {
964
980
  this.focusAtFirstListItem();
965
981
  }
966
- this.notify('reOrder', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', e: this });
982
+ if (!isReordered) {
983
+ this.notify('reOrder', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', e: this });
984
+ }
967
985
  }
968
986
  }
969
987
  else {
@@ -972,6 +990,9 @@ var MultiSelect = /** @class */ (function (_super) {
972
990
  this.list.scrollTop = 0;
973
991
  this.previousStartIndex = 0;
974
992
  this.virtualListInfo = null;
993
+ if (this.list.querySelector('.e-list-parent' + '.e-reorder')) {
994
+ this.list.querySelector('.e-list-parent' + '.e-reorder').remove();
995
+ }
975
996
  }
976
997
  this.resetList(dataSource, fields, query);
977
998
  if (this.enableVirtualization && (isNoData || this.allowCustomValue) &&
@@ -3490,7 +3511,7 @@ var MultiSelect = /** @class */ (function (_super) {
3490
3511
  endIndex: this.itemCount
3491
3512
  };
3492
3513
  };
3493
- MultiSelect.prototype.updateData = function (delimiterChar, e) {
3514
+ MultiSelect.prototype.updateData = function (delimiterChar, e, isInitialVirtualData) {
3494
3515
  var data = '';
3495
3516
  var delim = this.mode === 'Delimiter' || this.mode === 'CheckBox';
3496
3517
  var text = [];
@@ -3533,8 +3554,8 @@ var MultiSelect = /** @class */ (function (_super) {
3533
3554
  text = this_1.text.split(delimiterChar);
3534
3555
  }
3535
3556
  else {
3536
- temp = this_1.getTextByValue(value);
3537
- var textValues = this_1.text != null && this_1.text !== '' ? this_1.text + ',' + temp : temp;
3557
+ temp = isInitialVirtualData && delim ? this_1.text : this_1.getTextByValue(value);
3558
+ var textValues = isInitialVirtualData ? this_1.text : (this_1.text && this_1.text !== '' ? this_1.text + ',' + temp : temp);
3538
3559
  data += temp + delimiterChar + ' ';
3539
3560
  text.push(textValues);
3540
3561
  hiddenElementContent = this_1.hiddenElement.innerHTML;
@@ -3665,8 +3686,11 @@ var MultiSelect = /** @class */ (function (_super) {
3665
3686
  text = null;
3666
3687
  if (listItems != null && listItems.length > 0) {
3667
3688
  for (var i = 0; i < listItems.length; i++) {
3668
- if (getValue((this.fields.value ? this.fields.value : 'value'), listItems[i]) === value) {
3669
- text = getValue(this.fields.text, listItems[i]);
3689
+ if ((this.isPrimitiveData && listItems[i] === value) || (!this.isPrimitiveData
3690
+ && getValue((this.fields.value ? this.fields.value :
3691
+ 'value'), listItems[i]) === value)) {
3692
+ text = this.isPrimitiveData ? listItems[i] :
3693
+ getValue(this.fields.text, listItems[i]);
3670
3694
  if (this.enableVirtualization) {
3671
3695
  if (isNullOrUndefined(this.selectedListData)) {
3672
3696
  this.selectedListData = [listItems[i]];
@@ -3752,7 +3776,7 @@ var MultiSelect = /** @class */ (function (_super) {
3752
3776
  this.refreshInputHight();
3753
3777
  }
3754
3778
  else {
3755
- this.updateDelimeter(this.delimiterChar);
3779
+ this.updateDelimeter(this.delimiterChar, null, isInitialVirtualData);
3756
3780
  }
3757
3781
  if (this.mode === 'CheckBox' && this.showSelectAll && (isNullOrUndefined(this.value) || !this.value.length)) {
3758
3782
  this.notify('checkSelectAll', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox', value: 'uncheck' });
@@ -3964,8 +3988,8 @@ var MultiSelect = /** @class */ (function (_super) {
3964
3988
  this.selectedElementID = element.id;
3965
3989
  }
3966
3990
  };
3967
- MultiSelect.prototype.updateDelimeter = function (delimChar, e) {
3968
- this.updateData(delimChar, e);
3991
+ MultiSelect.prototype.updateDelimeter = function (delimChar, e, isInitialVirtualData) {
3992
+ this.updateData(delimChar, e, isInitialVirtualData);
3969
3993
  };
3970
3994
  MultiSelect.prototype.onMouseClick = function (e) {
3971
3995
  var _this = this;
@@ -5714,7 +5738,7 @@ var MultiSelect = /** @class */ (function (_super) {
5714
5738
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5715
5739
  var listItems_2;
5716
5740
  if (this.enableVirtualization) {
5717
- var fields = (this.fields.value) ? this.fields.value : '';
5741
+ var fields = !this.isPrimitiveData ? this.fields.value : '';
5718
5742
  var predicate = void 0;
5719
5743
  for (var i = 0; i < this.value.length; i++) {
5720
5744
  var value = this.allowObjectBinding ?
@@ -5746,7 +5770,7 @@ var MultiSelect = /** @class */ (function (_super) {
5746
5770
  }
5747
5771
  }
5748
5772
  if (!(this.dataSource instanceof DataManager)) {
5749
- this.initialValueUpdate(listItems_2);
5773
+ this.initialValueUpdate(listItems_2, true);
5750
5774
  this.initialUpdate();
5751
5775
  }
5752
5776
  else {