@syncfusion/ej2-dropdowns 28.1.39 → 28.2.3

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 : 28.1.39
3
+ * version : 28.2.3
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/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-dropdowns@*",
3
- "_id": "@syncfusion/ej2-dropdowns@28.1.38",
3
+ "_id": "@syncfusion/ej2-dropdowns@28.1.41",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-FGCpdclni6qQ3LeUi4ZYQp/ziJ/TarJpuufjvLID6+Emm8qvjpqsXHRpBBx7ySxGBqSv9EvFvwwX3tlEU7Q9uw==",
5
+ "_integrity": "sha512-XHQSq89yLShgV5vMeiTTFCUt2tQ+wyqf7v3t/paW5IDkCrxAlfiU56sTuv5XyuZ3rBECWpmlDmIDP6kPz2bPMw==",
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-28.1.38.tgz",
40
- "_shasum": "5d383cb4f7b3f08fbaff11b8bb86a5c3320adbab",
39
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-28.1.41.tgz",
40
+ "_shasum": "1d5b644c7717243d23cd17fa544fb0a9810b7b99",
41
41
  "_spec": "@syncfusion/ej2-dropdowns@*",
42
42
  "_where": "/jenkins/workspace/elease-automation_release_28.1.1/packages/included",
43
43
  "author": {
@@ -45,13 +45,13 @@
45
45
  },
46
46
  "bundleDependencies": false,
47
47
  "dependencies": {
48
- "@syncfusion/ej2-base": "~28.1.33",
49
- "@syncfusion/ej2-data": "~28.1.33",
50
- "@syncfusion/ej2-inputs": "~28.1.37",
51
- "@syncfusion/ej2-lists": "~28.1.37",
52
- "@syncfusion/ej2-navigations": "~28.1.39",
53
- "@syncfusion/ej2-notifications": "~28.1.33",
54
- "@syncfusion/ej2-popups": "~28.1.39"
48
+ "@syncfusion/ej2-base": "~28.2.3",
49
+ "@syncfusion/ej2-data": "~28.2.3",
50
+ "@syncfusion/ej2-inputs": "~28.2.3",
51
+ "@syncfusion/ej2-lists": "~28.2.3",
52
+ "@syncfusion/ej2-navigations": "~28.2.3",
53
+ "@syncfusion/ej2-notifications": "~28.2.3",
54
+ "@syncfusion/ej2-popups": "~28.2.3"
55
55
  },
56
56
  "deprecated": false,
57
57
  "description": "Essential JS 2 DropDown Components",
@@ -76,7 +76,7 @@
76
76
  "module": "./index.js",
77
77
  "name": "@syncfusion/ej2-dropdowns",
78
78
  "typings": "index.d.ts",
79
- "version": "28.1.39",
79
+ "version": "28.2.3",
80
80
  "sideEffects": false,
81
81
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
82
82
  }
@@ -111,4 +111,5 @@ export interface IDropdownlist extends Component<HTMLElement> {
111
111
  findListElement(list: HTMLElement, findNode: string, attribute: string, value: string | boolean | number): HTMLElement;
112
112
  scrollStop(e?: Event): void;
113
113
  targetElement(): string;
114
+ checkMaxSelection(): void;
114
115
  }
@@ -190,7 +190,7 @@ var VirtualScroll = /** @class */ (function () {
190
190
  endIndex = this.parent.viewPortInfo.endIndex - this.parent.value.length;
191
191
  if (this.parent.viewPortInfo.startIndex === 0) {
192
192
  this.parent.updateVirtualReOrderList(true);
193
- if (this.parent.value.length < this.parent.itemCount) {
193
+ if (this.parent.value.length < this.parent.itemCount && this.parent.value.length !== this.parent.totalItemCount) {
194
194
  var oldUlElement = this.parent.list.querySelector('.e-list-parent' + ':not(.e-reorder)');
195
195
  if (oldUlElement) {
196
196
  this.parent.list.querySelector('.e-virtual-ddl-content').removeChild(oldUlElement);
@@ -253,6 +253,12 @@ var VirtualScroll = /** @class */ (function () {
253
253
  if (isListUpdated) {
254
254
  for (var i = this.parent.viewPortInfo.startIndex; i < endIndex; i++) {
255
255
  var index = i;
256
+ if (this.component === 'multiselect' && this.parent.mode === 'CheckBox') {
257
+ var oldUlElement = this.parent.list.querySelector('.e-list-parent' + '.e-reorder');
258
+ if (oldUlElement) {
259
+ this.parent.list.querySelector('.e-virtual-ddl-content').removeChild(oldUlElement);
260
+ }
261
+ }
256
262
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
257
263
  var alreadyAddedData = this.parent.generatedDataObject[index];
258
264
  if (this.component === 'multiselect' && this.parent.hideSelectedItem) {
@@ -322,6 +328,7 @@ var VirtualScroll = /** @class */ (function () {
322
328
  }
323
329
  if (this.component === 'multiselect') {
324
330
  this.parent.updatevirtualizationList();
331
+ this.parent.checkMaxSelection();
325
332
  }
326
333
  this.parent.getSkeletonCount();
327
334
  this.parent.skeletonCount = this.parent.totalItemCount !== 0 && this.parent.totalItemCount < this.parent.itemCount * 2 &&
@@ -358,7 +358,9 @@ var DropDownList = /** @class */ (function (_super) {
358
358
  };
359
359
  };
360
360
  DropDownList.prototype.setEnableRtl = function () {
361
- Input.setEnableRtl(this.enableRtl, [this.inputElement.parentElement]);
361
+ if (!isNullOrUndefined(this.inputElement) && !isNullOrUndefined(this.inputElement.parentElement)) {
362
+ Input.setEnableRtl(this.enableRtl, [this.inputElement.parentElement]);
363
+ }
362
364
  if (this.popupObj) {
363
365
  this.popupObj.enableRtl = this.enableRtl;
364
366
  this.popupObj.dataBind();
@@ -3309,6 +3311,9 @@ var DropDownList = /** @class */ (function (_super) {
3309
3311
  };
3310
3312
  DropDownList.prototype.updateInitialData = function () {
3311
3313
  var currentData = this.selectData;
3314
+ if (isNullOrUndefined(currentData)) {
3315
+ return;
3316
+ }
3312
3317
  var ulElement = this.renderItems(currentData, this.fields);
3313
3318
  this.list.scrollTop = 0;
3314
3319
  this.virtualListInfo = {
@@ -3341,7 +3346,7 @@ var DropDownList = /** @class */ (function (_super) {
3341
3346
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3342
3347
  this.list.getElementsByClassName('e-virtual-ddl')[0].style = this.GetVirtualTrackHeight();
3343
3348
  }
3344
- else if (!this.list.querySelector('.e-virtual-ddl')) {
3349
+ else if (!this.list.querySelector('.e-virtual-ddl') && this.list.parentElement) {
3345
3350
  var virualElement = this.createElement('div', {
3346
3351
  id: this.element.id + '_popup', className: 'e-virtual-ddl', styles: this.GetVirtualTrackHeight()
3347
3352
  });
@@ -4099,7 +4104,7 @@ var DropDownList = /** @class */ (function (_super) {
4099
4104
  if (this.isReact && this.isFiltering() && this.itemTemplate != null) {
4100
4105
  setTimeout(function () {
4101
4106
  proxy.cloneElements();
4102
- proxy.isSecondClick = true;
4107
+ proxy.isSecondClick = proxy.isReact && proxy.isFiltering() && proxy.dataSource instanceof DataManager && !proxy.list.querySelector('ul') ? false : true;
4103
4108
  }, duration);
4104
4109
  }
4105
4110
  };
@@ -878,6 +878,7 @@ export declare class DropDownTree extends Component<HTMLElement> implements INot
878
878
  private removeChip;
879
879
  private resetValue;
880
880
  private clearCheckAll;
881
+ private setOldValue;
881
882
  private selectAllItems;
882
883
  private updateTreeSettings;
883
884
  private updateCheckBoxState;
@@ -347,7 +347,7 @@ var DropDownTree = /** @class */ (function (_super) {
347
347
  if (firstUl && firstUl.getAttribute('aria-multiselectable')) {
348
348
  firstUl.removeAttribute('aria-multiselectable');
349
349
  }
350
- this.oldValue = this.value;
350
+ this.setOldValue();
351
351
  if (!this.isRemoteData) {
352
352
  this.isInitialized = true;
353
353
  }
@@ -775,7 +775,7 @@ var DropDownTree = /** @class */ (function (_super) {
775
775
  this.triggerChangeEvent(event);
776
776
  }
777
777
  this.removeValue = false;
778
- this.oldValue = this.value;
778
+ this.setOldValue();
779
779
  this.trigger('blur');
780
780
  };
781
781
  DropDownTree.prototype.updateView = function () {
@@ -808,7 +808,7 @@ var DropDownTree = /** @class */ (function (_super) {
808
808
  element: this.element
809
809
  };
810
810
  this.trigger('change', eventArgs);
811
- this.oldValue = this.value;
811
+ this.setOldValue();
812
812
  }
813
813
  };
814
814
  DropDownTree.prototype.ddtCompareValues = function (oldValue, newValue) {
@@ -1297,6 +1297,7 @@ var DropDownTree = /** @class */ (function (_super) {
1297
1297
  frameSpan.classList.add(CHECK);
1298
1298
  ariaState = 'true';
1299
1299
  if (!this.isReverseUpdate) {
1300
+ this.setOldValue();
1300
1301
  this.isCheckAllCalled = true;
1301
1302
  this.treeObj.checkAll();
1302
1303
  if (!this.changeOnBlur) {
@@ -1461,7 +1462,7 @@ var DropDownTree = /** @class */ (function (_super) {
1461
1462
  }
1462
1463
  }
1463
1464
  if (valArr.length !== 0) {
1464
- this.oldValue = this.value;
1465
+ this.setOldValue();
1465
1466
  this.setProperties({ value: valArr }, true);
1466
1467
  this.setValidValue();
1467
1468
  }
@@ -1472,7 +1473,7 @@ var DropDownTree = /** @class */ (function (_super) {
1472
1473
  else {
1473
1474
  data = this.getItems(this.text);
1474
1475
  if (!isNOU(data)) {
1475
- this.oldValue = this.value;
1476
+ this.setOldValue();
1476
1477
  this.setProperties({ value: [data[this.fields.value].toString()] }, true);
1477
1478
  this.setValidValue();
1478
1479
  }
@@ -1487,7 +1488,7 @@ var DropDownTree = /** @class */ (function (_super) {
1487
1488
  return;
1488
1489
  }
1489
1490
  if (!this.isInitialized) {
1490
- this.oldValue = this.value;
1491
+ this.setOldValue();
1491
1492
  if (this.treeObj.selectedNodes.length > 0 && !this.showCheckBox) {
1492
1493
  this.setProperties({ value: this.treeObj.selectedNodes }, true);
1493
1494
  if (this.allowMultiSelection) {
@@ -2080,7 +2081,7 @@ var DropDownTree = /** @class */ (function (_super) {
2080
2081
  };
2081
2082
  DropDownTree.prototype.onBeforeSelect = function (args) {
2082
2083
  if (args.isInteracted) {
2083
- this.oldValue = this.value ? this.value.slice() : this.value;
2084
+ this.setOldValue();
2084
2085
  if (this.value === null) {
2085
2086
  this.setProperties({ value: [] }, true);
2086
2087
  }
@@ -2201,7 +2202,7 @@ var DropDownTree = /** @class */ (function (_super) {
2201
2202
  };
2202
2203
  DropDownTree.prototype.beforeCheck = function (args) {
2203
2204
  if (args.isInteracted) {
2204
- this.oldValue = this.value ? this.value.slice() : this.value;
2205
+ this.setOldValue();
2205
2206
  }
2206
2207
  };
2207
2208
  DropDownTree.prototype.onNodeExpanded = function () {
@@ -2752,7 +2753,7 @@ var DropDownTree = /** @class */ (function (_super) {
2752
2753
  }
2753
2754
  Input.setValue(null, this.inputEle, this.floatLabelType);
2754
2755
  if (!isDynamicChange) {
2755
- this.oldValue = this.value;
2756
+ this.setOldValue();
2756
2757
  this.setProperties({ value: [] }, true);
2757
2758
  this.showOrHideValueTemplate(false);
2758
2759
  }
@@ -2788,6 +2789,9 @@ var DropDownTree = /** @class */ (function (_super) {
2788
2789
  this.setLocale(false);
2789
2790
  }
2790
2791
  };
2792
+ DropDownTree.prototype.setOldValue = function () {
2793
+ this.oldValue = Array.isArray(this.value) ? this.value.slice() : this.value;
2794
+ };
2791
2795
  DropDownTree.prototype.selectAllItems = function (state) {
2792
2796
  if (this.showCheckBox) {
2793
2797
  if (state) {
@@ -72,6 +72,7 @@ export declare class MultiSelect extends DropDownBase implements IInput {
72
72
  private isUpdateFooterHeight;
73
73
  private isBlurDispatching;
74
74
  private isFilterPrevented;
75
+ private isFilteringAction;
75
76
  /**
76
77
  * The `fields` property maps the columns of the data table and binds the data to the component.
77
78
  * * text - Maps the text column from data table for each list item.
@@ -646,6 +647,8 @@ export declare class MultiSelect extends DropDownBase implements IInput {
646
647
  private header;
647
648
  private footer;
648
649
  private initStatus;
650
+ private isInitRemoteVirtualData;
651
+ private isDynamicRemoteVirtualData;
649
652
  private popupWrapper;
650
653
  private keyCode;
651
654
  private beforePopupOpen;
@@ -656,8 +659,6 @@ export declare class MultiSelect extends DropDownBase implements IInput {
656
659
  private selectAllEventEle;
657
660
  private filterParent;
658
661
  private removeIndex;
659
- private resetMainList;
660
- private resetFilteredData;
661
662
  private preventSetCurrentData;
662
663
  private virtualCustomData;
663
664
  private isSelectAllLoop;
@@ -105,11 +105,10 @@ var MultiSelect = /** @class */ (function (_super) {
105
105
  _this.isUpdateFooterHeight = false;
106
106
  _this.isBlurDispatching = false;
107
107
  _this.isFilterPrevented = false;
108
+ _this.isFilteringAction = false;
108
109
  _this.isValidKey = false;
109
110
  _this.selectAllEventData = [];
110
111
  _this.selectAllEventEle = [];
111
- _this.resetMainList = null;
112
- _this.resetFilteredData = false;
113
112
  _this.preventSetCurrentData = false;
114
113
  _this.isSelectAllLoop = false;
115
114
  _this.scrollFocusStatus = false;
@@ -568,7 +567,7 @@ var MultiSelect = /** @class */ (function (_super) {
568
567
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
569
568
  this.totalItemCount = e.count;
570
569
  }
571
- if (this.value && list && list.length > 0 && this.allowFiltering && this.mode !== 'CheckBox' && !this.enableVirtualization && !this.isFilterPrevented && !this.allowCustomValue) {
570
+ if (this.value && list && list.length > 0 && this.allowFiltering && this.mode !== 'CheckBox' && !this.enableVirtualization && !this.isFilterPrevented && !this.allowCustomValue && this.isFilteringAction) {
572
571
  var allItemsInValue = list.every(function (item) {
573
572
  var itemValue = getValue((_this.fields.value) ? _this.fields.value : '', item);
574
573
  return _this.value.some(function (val) {
@@ -670,6 +669,9 @@ var MultiSelect = /** @class */ (function (_super) {
670
669
  if (!this.enableVirtualization || (this.enableVirtualization && (!(this.dataSource instanceof DataManager)))) {
671
670
  this.initialValueUpdate();
672
671
  }
672
+ else {
673
+ this.initialValueUpdate(this.listData, true);
674
+ }
673
675
  this.initialUpdate();
674
676
  this.refreshPlaceHolder();
675
677
  if (this.mode !== 'CheckBox' && this.changeOnBlur) {
@@ -1281,10 +1283,6 @@ var MultiSelect = /** @class */ (function (_super) {
1281
1283
  }
1282
1284
  }
1283
1285
  this.updateDataList();
1284
- if (this.resetMainList) {
1285
- this.mainList = this.resetMainList;
1286
- this.resetMainList = null;
1287
- }
1288
1286
  this.refreshListItems(null);
1289
1287
  if (this.mode !== 'Box' && this.mode !== 'CheckBox') {
1290
1288
  this.updateDelimView();
@@ -3243,6 +3241,9 @@ var MultiSelect = /** @class */ (function (_super) {
3243
3241
  this.totalItemCount = this.value && this.value.length ? this.totalItemCount - this.value.length : this.totalItemCount;
3244
3242
  }
3245
3243
  this.getSkeletonCount();
3244
+ this.skeletonCount = this.totalItemCount !== 0 && this.totalItemCount < this.itemCount * 2 &&
3245
+ ((!(this.dataSource instanceof DataManager)) || ((this.dataSource instanceof DataManager) &&
3246
+ (this.totalItemCount <= this.itemCount))) ? 0 : this.skeletonCount;
3246
3247
  this.UpdateSkeleton();
3247
3248
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
3248
3249
  if (this.list.getElementsByClassName('e-virtual-ddl')[0]) {
@@ -3433,7 +3434,6 @@ var MultiSelect = /** @class */ (function (_super) {
3433
3434
  };
3434
3435
  MultiSelect.prototype.search = function (e) {
3435
3436
  var _this = this;
3436
- this.resetFilteredData = true;
3437
3437
  this.preventSetCurrentData = false;
3438
3438
  this.firstItem = this.dataSource && this.dataSource.length > 0 ? this.dataSource[0] : null;
3439
3439
  if (!isNullOrUndefined(e)) {
@@ -3474,10 +3474,12 @@ var MultiSelect = /** @class */ (function (_super) {
3474
3474
  if (!eventArgs.cancel) {
3475
3475
  if (!_this.isFiltered && !eventArgs.preventDefaultAction) {
3476
3476
  _this.filterAction = true;
3477
+ _this.isFilteringAction = true;
3477
3478
  if (_this.dataSource instanceof DataManager && _this.allowCustomValue) {
3478
3479
  _this.isCustomRendered = false;
3479
3480
  }
3480
3481
  _this.dataUpdater(_this.dataSource, null, _this.fields);
3482
+ _this.isFilteringAction = false;
3481
3483
  }
3482
3484
  }
3483
3485
  });
@@ -3650,7 +3652,7 @@ var MultiSelect = /** @class */ (function (_super) {
3650
3652
  else {
3651
3653
  if (this_1.listData) {
3652
3654
  if (this_1.enableVirtualization) {
3653
- if (delim) {
3655
+ if (delim && !this_1.isDynamicRemoteVirtualData) {
3654
3656
  data = this_1.delimiterWrapper && this_1.delimiterWrapper.innerHTML === '' ? data :
3655
3657
  this_1.delimiterWrapper.innerHTML;
3656
3658
  }
@@ -3663,7 +3665,7 @@ var MultiSelect = /** @class */ (function (_super) {
3663
3665
  }
3664
3666
  else {
3665
3667
  temp = isInitialVirtualData && delim ? this_1.text : this_1.getTextByValue(value);
3666
- var textValues = isInitialVirtualData ? this_1.text : (this_1.text && this_1.text !== '' ? this_1.text + this_1.delimiterChar + temp : temp);
3668
+ var textValues = this_1.isDynamicRemoteVirtualData && value != null && value !== '' ? this_1.getTextByValue(value) : isInitialVirtualData ? this_1.text : (this_1.text && this_1.text !== '' ? this_1.text + this_1.delimiterChar + temp : temp);
3667
3669
  data += temp + delimiterChar + ' ';
3668
3670
  text.push(textValues);
3669
3671
  hiddenElementContent = this_1.hiddenElement.innerHTML;
@@ -3831,7 +3833,7 @@ var MultiSelect = /** @class */ (function (_super) {
3831
3833
  (this.mode === 'Box' || this.mode === 'Default'))) ||
3832
3834
  (this.enableVirtualization && value != null && text != null && !isCustomData)) {
3833
3835
  var currentText = [];
3834
- var textValues = this.text != null && this.text !== '' ? this.text + this.delimiterChar + text : text;
3836
+ var textValues = this.isDynamicRemoteVirtualData && text != null && text !== '' ? text : this.text != null && this.text !== '' ? this.text + this.delimiterChar + text : text;
3835
3837
  currentText.push(textValues);
3836
3838
  this.setProperties({ text: currentText.toString() }, true);
3837
3839
  this.addChip(text, value);
@@ -5145,11 +5147,6 @@ var MultiSelect = /** @class */ (function (_super) {
5145
5147
  MultiSelect.prototype.onPropertyChanged = function (newProp, oldProp) {
5146
5148
  if (newProp.dataSource && !isNullOrUndefined(Object.keys(newProp.dataSource))
5147
5149
  || newProp.query && !isNullOrUndefined(Object.keys(newProp.query))) {
5148
- if (this.resetFilteredData) {
5149
- // The filtered data is not being reset in the component after the user focuses out.
5150
- this.resetMainList = !this.resetMainList ? this.mainList : this.resetMainList;
5151
- this.resetFilteredData = false;
5152
- }
5153
5150
  this.mainList = null;
5154
5151
  this.mainData = null;
5155
5152
  this.isFirstClick = false;
@@ -5418,6 +5415,12 @@ var MultiSelect = /** @class */ (function (_super) {
5418
5415
  if (!this.enableVirtualization || (this.enableVirtualization && (!(this.dataSource instanceof DataManager)))) {
5419
5416
  this.initialValueUpdate();
5420
5417
  }
5418
+ else if (!this.isInitRemoteVirtualData) {
5419
+ this.isDynamicRemoteVirtualData = true;
5420
+ this.initialValueUpdate(this.listData, true);
5421
+ this.isDynamicRemoteVirtualData = false;
5422
+ this.initialUpdate();
5423
+ }
5421
5424
  if (this.mode !== 'Box' && !this.inputFocus) {
5422
5425
  this.updateDelimView();
5423
5426
  }
@@ -6015,9 +6018,11 @@ var MultiSelect = /** @class */ (function (_super) {
6015
6018
  if (e.result.length > 0) {
6016
6019
  listItems_2 = e.result;
6017
6020
  _this.initStatus = false;
6021
+ _this.isInitRemoteVirtualData = true;
6018
6022
  setTimeout(function () {
6019
6023
  _this.initialValueUpdate(listItems_2, true);
6020
6024
  _this.initialUpdate();
6025
+ _this.isInitRemoteVirtualData = false;
6021
6026
  }, 100);
6022
6027
  _this.initStatus = true;
6023
6028
  }