@syncfusion/ej2-dropdowns 35.1.39 → 35.1.41

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.
@@ -3368,6 +3368,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3368
3368
  */
3369
3369
  function DropDownList(options, element) {
3370
3370
  var _this = _super.call(this, options, element) || this;
3371
+ _this.filterGeneration = null;
3372
+ _this.pendingFilterRequests = 0;
3373
+ _this.isStaleFilter = false;
3371
3374
  _this.isListSearched = false;
3372
3375
  _this.preventChange = false;
3373
3376
  _this.isTouched = false;
@@ -3420,6 +3423,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3420
3423
  this.preventAltUp = false;
3421
3424
  this.isCustomFilter = false;
3422
3425
  this.isSecondClick = false;
3426
+ this.filterGeneration = null;
3427
+ this.pendingFilterRequests = 0;
3428
+ this.isStaleFilter = false;
3423
3429
  this.previousValue = null;
3424
3430
  this.keyConfigure = {
3425
3431
  tab: 'tab',
@@ -3474,7 +3480,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3474
3480
  DropDownList.prototype.floatLabelChange = function () {
3475
3481
  if (this.getModuleName() === 'dropdownlist' && this.floatLabelType === 'Auto') {
3476
3482
  var floatElement = this.inputWrapper.container.querySelector('.e-float-text');
3477
- if (floatElement && this.inputElement.value !== '' || this.isInteracted) {
3483
+ if (floatElement && (this.inputElement.value !== '' || this.isInteracted)) {
3478
3484
  classList(floatElement, ['e-label-top'], ['e-label-bottom']);
3479
3485
  }
3480
3486
  else if (floatElement) {
@@ -4836,6 +4842,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4836
4842
  li = null;
4837
4843
  };
4838
4844
  DropDownList.prototype.selectEventCallback = function (li, e, preventSelect, selectedData, value) {
4845
+ if (this.getModuleName() === 'dropdownlist' && this.allowFiltering &&
4846
+ this.dataSource instanceof DataManager && this.filterGeneration) {
4847
+ this.isStaleFilter = true;
4848
+ }
4839
4849
  this.previousItemData = (!isNullOrUndefined(this.itemData)) ? this.itemData : null;
4840
4850
  if (this.itemData !== selectedData) {
4841
4851
  this.previousValue = (!isNullOrUndefined(this.itemData)) ? typeof this.itemData == 'object' &&
@@ -4882,7 +4892,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4882
4892
  DropDownList.prototype.setValue = function (e, autofill) {
4883
4893
  var dataItem = this.getItemData();
4884
4894
  this.isTouched = !isNullOrUndefined(e);
4885
- if (dataItem.value === null) {
4895
+ if (dataItem.value === null && !isNullOrUndefined(this.item) &&
4896
+ this.item.getAttribute('data-value') === 'null') {
4897
+ Input.setValue('null', this.inputElement, this.floatLabelType, this.showClearButton);
4898
+ }
4899
+ else if (dataItem.value === null) {
4886
4900
  Input.setValue(null, this.inputElement, this.floatLabelType, this.showClearButton);
4887
4901
  }
4888
4902
  else {
@@ -4927,6 +4941,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4927
4941
  }
4928
4942
  };
4929
4943
  DropDownList.prototype.setSelection = function (li, e) {
4944
+ if (this.getModuleName() === 'dropdownlist' && this.allowFiltering && this.dataSource instanceof DataManager &&
4945
+ this.pendingFilterRequests > 0 && this.isValidLI(li)) {
4946
+ this.isStaleFilter = true;
4947
+ }
4930
4948
  if (this.isValidLI(li) && (!li.classList.contains(dropDownBaseClasses.selected) || (this.isPopupOpen && this.isSelected
4931
4949
  && li.classList.contains(dropDownBaseClasses.selected)))) {
4932
4950
  this.updateSelectedItem(li, e, false, true);
@@ -5499,7 +5517,21 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5499
5517
  this.previousStartIndex = 0;
5500
5518
  this.virtualListInfo = null;
5501
5519
  }
5520
+ if (this.getModuleName() === 'dropdownlist' && this.allowFiltering && dataSource instanceof DataManager) {
5521
+ this.filterGeneration = {
5522
+ value: this.value
5523
+ };
5524
+ this.pendingFilterRequests++;
5525
+ }
5502
5526
  this.resetList(dataSource, fields, query);
5527
+ if (this.getModuleName() === 'dropdownlist' && this.allowFiltering &&
5528
+ dataSource instanceof DataManager && !this.isRequesting) {
5529
+ this.pendingFilterRequests--;
5530
+ if (this.pendingFilterRequests === 0) {
5531
+ this.filterGeneration = null;
5532
+ this.isStaleFilter = false;
5533
+ }
5534
+ }
5503
5535
  if (this.getModuleName() === 'dropdownlist' && this.list.classList.contains(dropDownBaseClasses.noData)) {
5504
5536
  this.popupContentElement.setAttribute('role', 'status');
5505
5537
  this.popupContentElement.setAttribute('id', 'no-record');
@@ -5627,6 +5659,14 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5627
5659
  });
5628
5660
  };
5629
5661
  DropDownList.prototype.onActionFailure = function (e) {
5662
+ if (this.getModuleName() === 'dropdownlist' && this.allowFiltering && this.dataSource instanceof DataManager &&
5663
+ this.pendingFilterRequests > 0) {
5664
+ this.pendingFilterRequests--;
5665
+ if (this.pendingFilterRequests === 0) {
5666
+ this.filterGeneration = null;
5667
+ this.isStaleFilter = false;
5668
+ }
5669
+ }
5630
5670
  _super.prototype.onActionFailure.call(this, e);
5631
5671
  if (this.beforePopupOpen) {
5632
5672
  this.renderPopup();
@@ -5638,6 +5678,26 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5638
5678
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
5639
5679
  DropDownList.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
5640
5680
  var _this = this;
5681
+ if (this.getModuleName() === 'dropdownlist' && this.allowFiltering && this.dataSource instanceof DataManager &&
5682
+ !isNullOrUndefined(e) && this.pendingFilterRequests > 0) {
5683
+ this.pendingFilterRequests--;
5684
+ if (this.filterGeneration && (this.isStaleFilter || this.filterGeneration.value !== this.value)) {
5685
+ if (this.actionCompleteData.ulElement && this.actionCompleteData.list) {
5686
+ ulElement = this.actionCompleteData.ulElement.cloneNode(true);
5687
+ list = this.actionCompleteData.list;
5688
+ e = null;
5689
+ this.typedString = '';
5690
+ this.isTyped = false;
5691
+ if (this.filterInput) {
5692
+ this.filterInput.value = '';
5693
+ }
5694
+ }
5695
+ }
5696
+ if (this.pendingFilterRequests === 0) {
5697
+ this.filterGeneration = null;
5698
+ this.isStaleFilter = false;
5699
+ }
5700
+ }
5641
5701
  if (this.dataSource instanceof DataManager && !isNullOrUndefined(e) && !this.virtualGroupDataSource) {
5642
5702
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5643
5703
  this.totalItemCount = e.count;
@@ -5905,7 +5965,16 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5905
5965
  return (((typeof data === 'string' || typeof data === 'number' || typeof data === 'boolean') && data === value_1) ||
5906
5966
  (getValue(_this.fields.value, data) === value_1));
5907
5967
  });
5908
- if (!isExist) {
5968
+ var isRemoteFilteredDropDownList = this.getModuleName() === 'dropdownlist' && this.allowFiltering &&
5969
+ this.dataSource instanceof DataManager;
5970
+ var isExistInCachedList = Boolean(isRemoteFilteredDropDownList && this.actionCompleteData.list &&
5971
+ this.actionCompleteData.list.some(function (data) {
5972
+ return (((typeof data === 'string' || typeof data === 'number' || typeof data === 'boolean') && data === value_1) ||
5973
+ (getValue(_this.fields.value, data) === value_1));
5974
+ }));
5975
+ var isExistInCachedElement = Boolean(isRemoteFilteredDropDownList && this.actionCompleteData.ulElement &&
5976
+ Array.prototype.some.call(this.actionCompleteData.ulElement.querySelectorAll('li[data-value]'), function (item) { return item.getAttribute('data-value') === String(value_1); }));
5977
+ if (!isExist && (!isRemoteFilteredDropDownList || (!isExistInCachedList && !isExistInCachedElement))) {
5909
5978
  this.addItem(this.itemData);
5910
5979
  }
5911
5980
  }
@@ -7264,6 +7333,47 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
7264
7333
  break;
7265
7334
  case 'placeholder':
7266
7335
  Input.setPlaceholder(newProp.placeholder, this_1.inputElement);
7336
+ if (this_1.getModuleName() === 'dropdownlist') {
7337
+ if (!newProp.placeholder || newProp.placeholder.trim() === '') {
7338
+ var label = this_1.inputWrapper.container.querySelector('.e-float-text');
7339
+ if (label) {
7340
+ label.remove();
7341
+ }
7342
+ this_1.inputElement.removeAttribute('aria-labelledby');
7343
+ }
7344
+ else if (this_1.floatLabelType !== 'Never' && !this_1.value) {
7345
+ var floatLabel = this_1.inputWrapper.container
7346
+ .querySelector('.e-float-text');
7347
+ if (!floatLabel) {
7348
+ floatLabel = this_1.createElement('label');
7349
+ floatLabel.classList.add('e-float-text');
7350
+ if (this_1.floatLabelType === 'Auto') {
7351
+ floatLabel.classList.add('e-label-bottom');
7352
+ }
7353
+ else if (this_1.floatLabelType === 'Always') {
7354
+ floatLabel.classList.add('e-label-top');
7355
+ }
7356
+ floatLabel.id = 'label_' + this_1.inputElement.id;
7357
+ floatLabel.setAttribute('for', this_1.inputElement.id);
7358
+ var floatLine = this_1.inputWrapper.container
7359
+ .querySelector('.e-float-line');
7360
+ var icon = this_1.inputWrapper.container
7361
+ .querySelector('.e-input-group-icon');
7362
+ if (floatLine) {
7363
+ floatLine.insertAdjacentElement('afterend', floatLabel);
7364
+ }
7365
+ else if (icon) {
7366
+ this_1.inputWrapper.container.insertBefore(floatLabel, icon);
7367
+ }
7368
+ else {
7369
+ this_1.inputWrapper.container.appendChild(floatLabel);
7370
+ }
7371
+ }
7372
+ floatLabel.style.width = this_1.inputElement.offsetWidth + 'px';
7373
+ floatLabel.textContent = newProp.placeholder;
7374
+ this_1.inputElement.setAttribute('aria-labelledby', floatLabel.id);
7375
+ }
7376
+ }
7267
7377
  break;
7268
7378
  case 'filterBarPlaceholder':
7269
7379
  if (this_1.filterInput) {
@@ -7588,6 +7698,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
7588
7698
  label.style.width = calculateWidth + 'px';
7589
7699
  }
7590
7700
  }
7701
+ if (label && this.getModuleName() === 'dropdownlist' && (!this.placeholder || this.placeholder.trim() === '')) {
7702
+ label.remove();
7703
+ this.inputElement.removeAttribute('aria-labelledby');
7704
+ }
7591
7705
  };
7592
7706
  /**
7593
7707
  * Return the module name of this component.
@@ -7852,6 +7966,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
7852
7966
  */
7853
7967
  DropDownList.prototype.destroy = function () {
7854
7968
  this.isActive = false;
7969
+ this.isStaleFilter = false;
7970
+ this.filterGeneration = null;
7971
+ this.pendingFilterRequests = 0;
7855
7972
  if (this.showClearButton) {
7856
7973
  this.clearButton = document.getElementsByClassName('e-clear-icon')[0];
7857
7974
  }
@@ -8344,6 +8461,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
8344
8461
  _this.isFromFilterChange = false;
8345
8462
  _this.fallbackValue = [];
8346
8463
  _this.uncheckedNodeId = null;
8464
+ _this.isTotalCountClicked = false;
8347
8465
  return _this;
8348
8466
  }
8349
8467
  /**
@@ -8484,7 +8602,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
8484
8602
  this.tree = this.createElement('div', { id: this.element.id + '_tree' });
8485
8603
  this.popupDiv.appendChild(this.tree);
8486
8604
  if (!this.destroyPopupOnHide) {
8487
- document.body.appendChild(this.popupDiv);
8605
+ this.getAppendToElement().appendChild(this.popupDiv);
8488
8606
  }
8489
8607
  this.wireTreeEvents();
8490
8608
  addClass([this.popupDiv], DDTHIDEICON);
@@ -8574,6 +8692,11 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
8574
8692
  _this.hidePopup();
8575
8693
  }
8576
8694
  break;
8695
+ case 'tab':
8696
+ if (_this.isPopupOpen && !isNullOrUndefined(_this.popupDiv) && _this.popupDiv.classList.contains('e-no-data')) {
8697
+ _this.hidePopup();
8698
+ }
8699
+ break;
8577
8700
  case 'shiftTab':
8578
8701
  addClass([_this.inputWrapper], [INPUTFOCUS]);
8579
8702
  break;
@@ -9976,7 +10099,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
9976
10099
  });
9977
10100
  _this.popupEle.setAttribute('role', 'region');
9978
10101
  _this.popupEle.setAttribute('aria-label', _this.element.id);
9979
- document.body.appendChild(_this.popupEle);
10102
+ _this.getAppendToElement().appendChild(_this.popupEle);
9980
10103
  _this.createPopup(_this.popupEle);
9981
10104
  }
9982
10105
  else {
@@ -10069,6 +10192,16 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
10069
10192
  }
10070
10193
  });
10071
10194
  };
10195
+ DropDownTree.prototype.getAppendToElement = function () {
10196
+ if (this.isAngular) {
10197
+ var cdkPane = this.element && this.element.closest ? this.element.closest('.cdk-overlay-pane') : null;
10198
+ var popoverEl = this.element && this.element.closest ? this.element.closest('[popover]') : null;
10199
+ if (cdkPane && popoverEl) {
10200
+ return cdkPane;
10201
+ }
10202
+ }
10203
+ return document.body;
10204
+ };
10072
10205
  DropDownTree.prototype.checkCollision = function (popupEle) {
10073
10206
  var collision = isCollide(popupEle);
10074
10207
  if (collision.length > 0) {
@@ -10192,6 +10325,12 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
10192
10325
  var isScroller = target.classList.contains(DROPDOWN) ? true :
10193
10326
  (matches$1(target, '.e-ddt .e-popup') || matches$1(target, '.e-ddt .e-treeview'));
10194
10327
  var isSelectAllArea = target.classList.contains('e-ripple-container');
10328
+ if (this.overFlowWrapper && !this.overFlowWrapper.classList.contains(HIDEICON) && !this.isPopupOpen) {
10329
+ this.isTotalCountClicked = true;
10330
+ }
10331
+ else {
10332
+ this.isTotalCountClicked = false;
10333
+ }
10195
10334
  if ((this.isPopupOpen && ((!isNullOrUndefined(this.inputWrapper) &&
10196
10335
  this.inputWrapper.contains(target)) || isTree || isScroller || isHeader || isFooter || isSelectAllArea)) ||
10197
10336
  ((this.allowMultiSelection || this.showCheckBox) && (this.isPopupOpen && target.classList.contains(CHIP_CLOSE) ||
@@ -11239,7 +11378,8 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
11239
11378
  }
11240
11379
  };
11241
11380
  DropDownTree.prototype.removeChip = function (e) {
11242
- if (!this.enabled || this.readonly) {
11381
+ if (!this.enabled || this.readonly || this.isTotalCountClicked) {
11382
+ this.isTotalCountClicked = false;
11243
11383
  return;
11244
11384
  }
11245
11385
  if (e.target.classList.contains('e-chips-close') && !this.isPopupOpen) {
@@ -13840,7 +13980,7 @@ function createFloatLabel(overAllWrapper, searchWrapper, element, inputElement,
13840
13980
  searchWrapper.appendChild(floatLinelement);
13841
13981
  searchWrapper.appendChild(floatLabelElement);
13842
13982
  overAllWrapper.classList.add('e-float-input');
13843
- updateFloatLabelState(value, floatLabelElement);
13983
+ updateFloatLabelState(value, floatLabelElement, floatLabelType);
13844
13984
  if (floatLabelType === 'Always') {
13845
13985
  if (floatLabelElement.classList.contains(LABELBOTTOM)) {
13846
13986
  removeClass([floatLabelElement], LABELBOTTOM);
@@ -13853,9 +13993,13 @@ function createFloatLabel(overAllWrapper, searchWrapper, element, inputElement,
13853
13993
  *
13854
13994
  * @param {string[] | number[] | boolean[]} value - Value of the MultiSelect.
13855
13995
  * @param {HTMLElement} label - Float label element.
13996
+ * @param {FloatLabelType} floatlabeltype - specify the float label type.
13856
13997
  */
13857
- function updateFloatLabelState(value, label) {
13858
- if (value && value.length > 0) {
13998
+ function updateFloatLabelState(value, label, floatlabeltype) {
13999
+ var floatElement = label.closest('.e-float-input');
14000
+ var isFocused = floatElement &&
14001
+ floatElement.classList.contains('e-input-focus');
14002
+ if ((value && value.length > 0) || (isFocused && floatElement.closest('.e-multiselect') && floatlabeltype === 'Auto')) {
13859
14003
  addClass([label], LABELTOP);
13860
14004
  removeClass([label], LABELBOTTOM);
13861
14005
  }
@@ -14190,7 +14334,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
14190
14334
  };
14191
14335
  MultiSelect.prototype.onPopupShown = function (e) {
14192
14336
  var _this = this;
14193
- this.sanitizeData();
14194
14337
  if (Browser.isDevice && (this.mode === 'CheckBox' && this.allowFiltering)) {
14195
14338
  // eslint-disable-next-line @typescript-eslint/no-this-alias
14196
14339
  var proxy_1 = this;
@@ -15766,6 +15909,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
15766
15909
  }
15767
15910
  };
15768
15911
  MultiSelect.prototype.showDelimWrapper = function () {
15912
+ if (!this.value || !this.value.length) {
15913
+ return;
15914
+ }
15769
15915
  if (this.mode === 'CheckBox') {
15770
15916
  this.viewWrapper.style.display = '';
15771
15917
  }
@@ -16903,14 +17049,12 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16903
17049
  _this.selectedListData.splice(index, 1);
16904
17050
  }
16905
17051
  _this.setProperties({ value: [].concat([], removeVal) }, true);
16906
- if (_this.enableVirtualization) {
16907
- var currentText = index === 0 && _this.text.split(_this.delimiterChar) &&
16908
- _this.text.split(_this.delimiterChar).length === 1 ?
16909
- _this.text.replace(_this.text.split(_this.delimiterChar)[index], '') :
16910
- index === 0 ? _this.text.replace(_this.text.split(_this.delimiterChar)[index] +
16911
- _this.delimiterChar, '') :
16912
- _this.text.replace(_this.delimiterChar + _this.text.split(_this.delimiterChar)[index], '');
16913
- _this.setProperties({ text: currentText.toString() }, true);
17052
+ if (_this.enableVirtualization && !isNullOrUndefined(_this.text)) {
17053
+ var textItems = _this.text.split(_this.delimiterChar);
17054
+ var currentText = index === 0 && textItems.length === 1
17055
+ ? _this.text.replace(textItems[index], '') : index === 0 ? _this.text.replace(textItems[index]
17056
+ + _this.delimiterChar, '') : _this.text.replace(_this.delimiterChar + textItems[index], '');
17057
+ _this.setProperties({ text: currentText }, true);
16914
17058
  }
16915
17059
  if (element_1 !== null) {
16916
17060
  var currentValue_1 = _this.allowObjectBinding ? getValue(((_this.fields.value) ?
@@ -18033,7 +18177,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
18033
18177
  }
18034
18178
  this.preventSetCurrentData = false;
18035
18179
  this.initializeData();
18036
- this.sanitizeData();
18037
18180
  this.updateDataAttribute(this.htmlAttributes);
18038
18181
  _super.prototype.preRender.call(this);
18039
18182
  };
@@ -18064,56 +18207,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
18064
18207
  endIndex: this.itemCount
18065
18208
  };
18066
18209
  };
18067
- MultiSelect.prototype.sanitizeData = function () {
18068
- if (this.enableVirtualization && this.mode === 'CheckBox') {
18069
- if (this.dataSource && Array.isArray(this.dataSource) && !(this.dataSource instanceof DataManager)) {
18070
- var cleanedDataSource = [];
18071
- for (var i = 0; i < this.dataSource.length; i++) {
18072
- var item = this.dataSource[i];
18073
- if (item !== null && item !== undefined && item !== '') {
18074
- if (typeof item === 'object') {
18075
- var itemValue = getValue((this.fields.value ? this.fields.value : 'value'), item);
18076
- if (this.fields.value !== null) {
18077
- if (itemValue !== null && itemValue !== undefined && itemValue !== '') {
18078
- cleanedDataSource.push(item);
18079
- }
18080
- }
18081
- else {
18082
- cleanedDataSource.push(item);
18083
- }
18084
- }
18085
- else if (typeof item === 'string') {
18086
- if (item !== null && item !== undefined && item.trim() !== '') {
18087
- cleanedDataSource.push(item);
18088
- }
18089
- }
18090
- else {
18091
- cleanedDataSource.push(item);
18092
- }
18093
- }
18094
- }
18095
- if (cleanedDataSource.length !== this.dataSource.length) {
18096
- this.setProperties({ dataSource: cleanedDataSource }, true);
18097
- }
18098
- }
18099
- if (this.value && Array.isArray(this.value) && this.value.length > 0) {
18100
- var cleanedValue = [];
18101
- for (var i = 0; i < this.value.length; i++) {
18102
- var val = this.value[i];
18103
- if (val !== null && val !== undefined && val !== '') {
18104
- cleanedValue.push(val);
18105
- }
18106
- }
18107
- if (cleanedValue.length !== this.value.length) {
18108
- this.setProperties({ value: cleanedValue }, true);
18109
- }
18110
- }
18111
- return true;
18112
- }
18113
- else {
18114
- return false;
18115
- }
18116
- };
18117
18210
  MultiSelect.prototype.updateData = function (delimiterChar, e, isInitialVirtualData) {
18118
18211
  var data = '';
18119
18212
  var delim = this.mode === 'Delimiter' || this.mode === 'CheckBox';
@@ -18152,7 +18245,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
18152
18245
  var value = this_1.allowObjectBinding ?
18153
18246
  getValue(((this_1.fields.value) ? this_1.fields.value : ''), this_1.value[this_1.value.length - 1]) :
18154
18247
  this_1.value[this_1.value.length - 1];
18155
- if (this_1.isRemoveSelection) {
18248
+ if (this_1.isRemoveSelection && this_1.text) {
18156
18249
  data = this_1.text.replace(/,/g, delimiterChar + ' ') + delimiterChar + ' ';
18157
18250
  text = this_1.text.split(delimiterChar);
18158
18251
  }
@@ -18264,7 +18357,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
18264
18357
  || this.list.querySelector('.e-ul') && this.list.querySelector('.e-ul').childElementCount === 0)) {
18265
18358
  isEmptyData = true;
18266
18359
  }
18267
- this.sanitizeData();
18268
18360
  _super.prototype.render.call(this, null, isEmptyData);
18269
18361
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
18270
18362
  this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
@@ -19531,7 +19623,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
19531
19623
  : (_this.fields.value ? obj[_this.fields.value] : obj);
19532
19624
  var text = isPlainValue
19533
19625
  ? String(obj)
19534
- : (_this.fields.text ? (obj[_this.fields.text]).toString() : String(obj));
19626
+ : (_this.fields.text && obj[_this.fields.text] != null ? (obj[_this.fields.text]).toString()
19627
+ : String(obj));
19535
19628
  if (_this.value && value != null && Array.isArray(_this.value) &&
19536
19629
  ((!_this.allowObjectBinding && _this.value.indexOf(value) < 0) ||
19537
19630
  (_this.allowObjectBinding && !_this.isObjectInArray(value, _this.value)))) {
@@ -20195,7 +20288,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
20195
20288
  switch (prop) {
20196
20289
  case 'query':
20197
20290
  case 'dataSource':
20198
- this.sanitizeData();
20199
20291
  if (this.mode === 'CheckBox' && this.showSelectAll) {
20200
20292
  if (!isNullOrUndefined(this.popupObj) && !this.isDimColumnWithCustomStyle()) {
20201
20293
  this.popupObj.destroy();
@@ -20229,7 +20321,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
20229
20321
  this.updateVal(this.value, this.value, 'text');
20230
20322
  break;
20231
20323
  case 'value':
20232
- this.sanitizeData();
20233
20324
  if (this.fields.disabled) {
20234
20325
  this.removeDisabledItemsValue(this.value);
20235
20326
  }
@@ -20672,8 +20763,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
20672
20763
  }
20673
20764
  this.firstItem = this.dataSource && this.dataSource.length > 0 ? this.dataSource[0] : null;
20674
20765
  var args = { cancel: false };
20675
- var oldValue = extend([], this.value, [], true);
20676
- var oldData = extend([], this.dataSource, [], true);
20677
20766
  this.trigger('beforeOpen', args, function (args) {
20678
20767
  if (!args.cancel) {
20679
20768
  if (!_this.ulElement) {
@@ -20685,50 +20774,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
20685
20774
  if (_this.inputElement && _this.mode !== 'CheckBox') {
20686
20775
  _this.focusIn();
20687
20776
  }
20688
- if (_this.enableVirtualization && _this.mode === 'CheckBox') {
20689
- if (JSON.stringify(oldData) !== JSON.stringify(_this.dataSource) && _this.sanitizeData() && _this.showSelectAll) {
20690
- _this.renderPopup();
20691
- }
20692
- if (!isNullOrUndefined(oldValue) && !isNullOrUndefined(_this.value) &&
20693
- JSON.stringify(oldValue) !== JSON.stringify(_this.value) && _this.sanitizeData()) {
20694
- if (_this.fields.disabled) {
20695
- _this.removeDisabledItemsValue(_this.value);
20696
- }
20697
- if (!_this.validateValues(_this.value, oldValue)) {
20698
- return;
20699
- }
20700
- if (_this.isVue && !_this.changeOnBlur && !_this.validateValues(_this.value, oldValue)) {
20701
- return;
20702
- }
20703
- _this.updateVal(_this.value, oldValue, 'value', _this.enableVirtualization);
20704
- _this.addValidInputClass();
20705
- if (_this.showSelectAll) {
20706
- _this.renderPopup();
20707
- var totalCount = _this.dataSource instanceof DataManager ? 0 :
20708
- _this.dataSource.length;
20709
- var selectedCount = _this.value ? _this.value.length : 0;
20710
- if (selectedCount === totalCount) {
20711
- var frame = null;
20712
- if (_this.popupObj) {
20713
- frame = _this.popupObj.element.querySelector('.e-selectall-parent .e-frame');
20714
- }
20715
- if (frame) {
20716
- frame.classList.add('e-check');
20717
- frame.classList.remove('e-uncheck');
20718
- frame.classList.remove('e-stop');
20719
- }
20720
- }
20721
- }
20722
- if (!_this.closePopupOnSelect && _this.isPopupOpen()) {
20723
- _this.refreshPopup();
20724
- }
20725
- if (_this.isPopupOpen() && _this.list && _this.list.querySelector('.e-active.e-disable')) {
20726
- var activeItems = _this.list.querySelectorAll('li.' + dropDownBaseClasses.li + '.e-active' + '.e-disable');
20727
- removeClass(activeItems, 'e-disable');
20728
- }
20729
- _this.preventChange = _this.isAngular && _this.preventChange ? !_this.preventChange : _this.preventChange;
20730
- }
20731
- }
20732
20777
  return;
20733
20778
  }
20734
20779
  if (_this.mode === 'CheckBox' && Browser.isDevice && _this.allowFiltering && _this.isDeviceFullScreen) {
@@ -20886,7 +20931,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
20886
20931
  // eslint-disable-next-line
20887
20932
  this.value = this.value.slice();
20888
20933
  }
20889
- this.sanitizeData();
20890
20934
  this.setDynValue = this.initStatus = false;
20891
20935
  this.isSelectAll = false;
20892
20936
  this.selectAllEventEle = [];
@@ -22094,12 +22138,14 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
22094
22138
  var target;
22095
22139
  if (!isNullOrUndefined(args.e)) {
22096
22140
  var frameElm = args.li.querySelector('.e-checkbox-wrapper .e-frame');
22097
- target = !isNullOrUndefined(args.e.target) ?
22098
- (args.e.target.classList.contains('e-frame')
22099
- && (!this.parent.showSelectAll
22100
- || (this.checkAllParent && !this.checkAllParent.contains(args.e.target)))) ?
22101
- args.e.target : args.li.querySelector('.e-checkbox-wrapper').childNodes[1]
22102
- : args.li.querySelector('.e-checkbox-wrapper').childNodes[1];
22141
+ var checkboxWrapper = args.li.querySelector('.e-checkbox-wrapper');
22142
+ target = !isNullOrUndefined(args.e.target)
22143
+ ? (args.e.target.classList.contains('e-frame') &&
22144
+ (!this.parent.showSelectAll ||
22145
+ (this.checkAllParent && !this.checkAllParent.contains(args.e.target))))
22146
+ ? args.e.target
22147
+ : (checkboxWrapper ? checkboxWrapper.childNodes[1] : null)
22148
+ : (checkboxWrapper ? checkboxWrapper.childNodes[1] : null);
22103
22149
  }
22104
22150
  else {
22105
22151
  var checkboxWrapper = args.li.querySelector('.e-checkbox-wrapper');