@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.
@@ -3262,6 +3262,9 @@ let DropDownList = class DropDownList extends DropDownBase {
3262
3262
  */
3263
3263
  constructor(options, element) {
3264
3264
  super(options, element);
3265
+ this.filterGeneration = null;
3266
+ this.pendingFilterRequests = 0;
3267
+ this.isStaleFilter = false;
3265
3268
  this.isListSearched = false;
3266
3269
  this.preventChange = false;
3267
3270
  this.isTouched = false;
@@ -3313,6 +3316,9 @@ let DropDownList = class DropDownList extends DropDownBase {
3313
3316
  this.preventAltUp = false;
3314
3317
  this.isCustomFilter = false;
3315
3318
  this.isSecondClick = false;
3319
+ this.filterGeneration = null;
3320
+ this.pendingFilterRequests = 0;
3321
+ this.isStaleFilter = false;
3316
3322
  this.previousValue = null;
3317
3323
  this.keyConfigure = {
3318
3324
  tab: 'tab',
@@ -3367,7 +3373,7 @@ let DropDownList = class DropDownList extends DropDownBase {
3367
3373
  floatLabelChange() {
3368
3374
  if (this.getModuleName() === 'dropdownlist' && this.floatLabelType === 'Auto') {
3369
3375
  let floatElement = this.inputWrapper.container.querySelector('.e-float-text');
3370
- if (floatElement && this.inputElement.value !== '' || this.isInteracted) {
3376
+ if (floatElement && (this.inputElement.value !== '' || this.isInteracted)) {
3371
3377
  classList(floatElement, ['e-label-top'], ['e-label-bottom']);
3372
3378
  }
3373
3379
  else if (floatElement) {
@@ -4726,6 +4732,10 @@ let DropDownList = class DropDownList extends DropDownBase {
4726
4732
  li = null;
4727
4733
  }
4728
4734
  selectEventCallback(li, e, preventSelect, selectedData, value) {
4735
+ if (this.getModuleName() === 'dropdownlist' && this.allowFiltering &&
4736
+ this.dataSource instanceof DataManager && this.filterGeneration) {
4737
+ this.isStaleFilter = true;
4738
+ }
4729
4739
  this.previousItemData = (!isNullOrUndefined(this.itemData)) ? this.itemData : null;
4730
4740
  if (this.itemData !== selectedData) {
4731
4741
  this.previousValue = (!isNullOrUndefined(this.itemData)) ? typeof this.itemData == 'object' &&
@@ -4772,7 +4782,11 @@ let DropDownList = class DropDownList extends DropDownBase {
4772
4782
  setValue(e, autofill) {
4773
4783
  const dataItem = this.getItemData();
4774
4784
  this.isTouched = !isNullOrUndefined(e);
4775
- if (dataItem.value === null) {
4785
+ if (dataItem.value === null && !isNullOrUndefined(this.item) &&
4786
+ this.item.getAttribute('data-value') === 'null') {
4787
+ Input.setValue('null', this.inputElement, this.floatLabelType, this.showClearButton);
4788
+ }
4789
+ else if (dataItem.value === null) {
4776
4790
  Input.setValue(null, this.inputElement, this.floatLabelType, this.showClearButton);
4777
4791
  }
4778
4792
  else {
@@ -4817,6 +4831,10 @@ let DropDownList = class DropDownList extends DropDownBase {
4817
4831
  }
4818
4832
  }
4819
4833
  setSelection(li, e) {
4834
+ if (this.getModuleName() === 'dropdownlist' && this.allowFiltering && this.dataSource instanceof DataManager &&
4835
+ this.pendingFilterRequests > 0 && this.isValidLI(li)) {
4836
+ this.isStaleFilter = true;
4837
+ }
4820
4838
  if (this.isValidLI(li) && (!li.classList.contains(dropDownBaseClasses.selected) || (this.isPopupOpen && this.isSelected
4821
4839
  && li.classList.contains(dropDownBaseClasses.selected)))) {
4822
4840
  this.updateSelectedItem(li, e, false, true);
@@ -5384,7 +5402,21 @@ let DropDownList = class DropDownList extends DropDownBase {
5384
5402
  this.previousStartIndex = 0;
5385
5403
  this.virtualListInfo = null;
5386
5404
  }
5405
+ if (this.getModuleName() === 'dropdownlist' && this.allowFiltering && dataSource instanceof DataManager) {
5406
+ this.filterGeneration = {
5407
+ value: this.value
5408
+ };
5409
+ this.pendingFilterRequests++;
5410
+ }
5387
5411
  this.resetList(dataSource, fields, query);
5412
+ if (this.getModuleName() === 'dropdownlist' && this.allowFiltering &&
5413
+ dataSource instanceof DataManager && !this.isRequesting) {
5414
+ this.pendingFilterRequests--;
5415
+ if (this.pendingFilterRequests === 0) {
5416
+ this.filterGeneration = null;
5417
+ this.isStaleFilter = false;
5418
+ }
5419
+ }
5388
5420
  if (this.getModuleName() === 'dropdownlist' && this.list.classList.contains(dropDownBaseClasses.noData)) {
5389
5421
  this.popupContentElement.setAttribute('role', 'status');
5390
5422
  this.popupContentElement.setAttribute('id', 'no-record');
@@ -5511,6 +5543,14 @@ let DropDownList = class DropDownList extends DropDownBase {
5511
5543
  });
5512
5544
  }
5513
5545
  onActionFailure(e) {
5546
+ if (this.getModuleName() === 'dropdownlist' && this.allowFiltering && this.dataSource instanceof DataManager &&
5547
+ this.pendingFilterRequests > 0) {
5548
+ this.pendingFilterRequests--;
5549
+ if (this.pendingFilterRequests === 0) {
5550
+ this.filterGeneration = null;
5551
+ this.isStaleFilter = false;
5552
+ }
5553
+ }
5514
5554
  super.onActionFailure(e);
5515
5555
  if (this.beforePopupOpen) {
5516
5556
  this.renderPopup();
@@ -5521,6 +5561,26 @@ let DropDownList = class DropDownList extends DropDownBase {
5521
5561
  }
5522
5562
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
5523
5563
  onActionComplete(ulElement, list, e, isUpdated) {
5564
+ if (this.getModuleName() === 'dropdownlist' && this.allowFiltering && this.dataSource instanceof DataManager &&
5565
+ !isNullOrUndefined(e) && this.pendingFilterRequests > 0) {
5566
+ this.pendingFilterRequests--;
5567
+ if (this.filterGeneration && (this.isStaleFilter || this.filterGeneration.value !== this.value)) {
5568
+ if (this.actionCompleteData.ulElement && this.actionCompleteData.list) {
5569
+ ulElement = this.actionCompleteData.ulElement.cloneNode(true);
5570
+ list = this.actionCompleteData.list;
5571
+ e = null;
5572
+ this.typedString = '';
5573
+ this.isTyped = false;
5574
+ if (this.filterInput) {
5575
+ this.filterInput.value = '';
5576
+ }
5577
+ }
5578
+ }
5579
+ if (this.pendingFilterRequests === 0) {
5580
+ this.filterGeneration = null;
5581
+ this.isStaleFilter = false;
5582
+ }
5583
+ }
5524
5584
  if (this.dataSource instanceof DataManager && !isNullOrUndefined(e) && !this.virtualGroupDataSource) {
5525
5585
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5526
5586
  this.totalItemCount = e.count;
@@ -5780,7 +5840,16 @@ let DropDownList = class DropDownList extends DropDownBase {
5780
5840
  return (((typeof data === 'string' || typeof data === 'number' || typeof data === 'boolean') && data === value) ||
5781
5841
  (getValue(this.fields.value, data) === value));
5782
5842
  });
5783
- if (!isExist) {
5843
+ const isRemoteFilteredDropDownList = this.getModuleName() === 'dropdownlist' && this.allowFiltering &&
5844
+ this.dataSource instanceof DataManager;
5845
+ const isExistInCachedList = Boolean(isRemoteFilteredDropDownList && this.actionCompleteData.list &&
5846
+ this.actionCompleteData.list.some((data) => {
5847
+ return (((typeof data === 'string' || typeof data === 'number' || typeof data === 'boolean') && data === value) ||
5848
+ (getValue(this.fields.value, data) === value));
5849
+ }));
5850
+ const isExistInCachedElement = Boolean(isRemoteFilteredDropDownList && this.actionCompleteData.ulElement &&
5851
+ Array.prototype.some.call(this.actionCompleteData.ulElement.querySelectorAll('li[data-value]'), (item) => item.getAttribute('data-value') === String(value)));
5852
+ if (!isExist && (!isRemoteFilteredDropDownList || (!isExistInCachedList && !isExistInCachedElement))) {
5784
5853
  this.addItem(this.itemData);
5785
5854
  }
5786
5855
  }
@@ -7128,6 +7197,47 @@ let DropDownList = class DropDownList extends DropDownBase {
7128
7197
  break;
7129
7198
  case 'placeholder':
7130
7199
  Input.setPlaceholder(newProp.placeholder, this.inputElement);
7200
+ if (this.getModuleName() === 'dropdownlist') {
7201
+ if (!newProp.placeholder || newProp.placeholder.trim() === '') {
7202
+ const label = this.inputWrapper.container.querySelector('.e-float-text');
7203
+ if (label) {
7204
+ label.remove();
7205
+ }
7206
+ this.inputElement.removeAttribute('aria-labelledby');
7207
+ }
7208
+ else if (this.floatLabelType !== 'Never' && !this.value) {
7209
+ let floatLabel = this.inputWrapper.container
7210
+ .querySelector('.e-float-text');
7211
+ if (!floatLabel) {
7212
+ floatLabel = this.createElement('label');
7213
+ floatLabel.classList.add('e-float-text');
7214
+ if (this.floatLabelType === 'Auto') {
7215
+ floatLabel.classList.add('e-label-bottom');
7216
+ }
7217
+ else if (this.floatLabelType === 'Always') {
7218
+ floatLabel.classList.add('e-label-top');
7219
+ }
7220
+ floatLabel.id = 'label_' + this.inputElement.id;
7221
+ floatLabel.setAttribute('for', this.inputElement.id);
7222
+ const floatLine = this.inputWrapper.container
7223
+ .querySelector('.e-float-line');
7224
+ const icon = this.inputWrapper.container
7225
+ .querySelector('.e-input-group-icon');
7226
+ if (floatLine) {
7227
+ floatLine.insertAdjacentElement('afterend', floatLabel);
7228
+ }
7229
+ else if (icon) {
7230
+ this.inputWrapper.container.insertBefore(floatLabel, icon);
7231
+ }
7232
+ else {
7233
+ this.inputWrapper.container.appendChild(floatLabel);
7234
+ }
7235
+ }
7236
+ floatLabel.style.width = this.inputElement.offsetWidth + 'px';
7237
+ floatLabel.textContent = newProp.placeholder;
7238
+ this.inputElement.setAttribute('aria-labelledby', floatLabel.id);
7239
+ }
7240
+ }
7131
7241
  break;
7132
7242
  case 'filterBarPlaceholder':
7133
7243
  if (this.filterInput) {
@@ -7444,6 +7554,10 @@ let DropDownList = class DropDownList extends DropDownBase {
7444
7554
  label.style.width = calculateWidth + 'px';
7445
7555
  }
7446
7556
  }
7557
+ if (label && this.getModuleName() === 'dropdownlist' && (!this.placeholder || this.placeholder.trim() === '')) {
7558
+ label.remove();
7559
+ this.inputElement.removeAttribute('aria-labelledby');
7560
+ }
7447
7561
  }
7448
7562
  /**
7449
7563
  * Return the module name of this component.
@@ -7708,6 +7822,9 @@ let DropDownList = class DropDownList extends DropDownBase {
7708
7822
  */
7709
7823
  destroy() {
7710
7824
  this.isActive = false;
7825
+ this.isStaleFilter = false;
7826
+ this.filterGeneration = null;
7827
+ this.pendingFilterRequests = 0;
7711
7828
  if (this.showClearButton) {
7712
7829
  this.clearButton = document.getElementsByClassName('e-clear-icon')[0];
7713
7830
  }
@@ -8175,6 +8292,7 @@ let DropDownTree = class DropDownTree extends Component {
8175
8292
  this.isFromFilterChange = false;
8176
8293
  this.fallbackValue = [];
8177
8294
  this.uncheckedNodeId = null;
8295
+ this.isTotalCountClicked = false;
8178
8296
  }
8179
8297
  /**
8180
8298
  * Get the properties to be maintained in the persisted state.
@@ -8314,7 +8432,7 @@ let DropDownTree = class DropDownTree extends Component {
8314
8432
  this.tree = this.createElement('div', { id: this.element.id + '_tree' });
8315
8433
  this.popupDiv.appendChild(this.tree);
8316
8434
  if (!this.destroyPopupOnHide) {
8317
- document.body.appendChild(this.popupDiv);
8435
+ this.getAppendToElement().appendChild(this.popupDiv);
8318
8436
  }
8319
8437
  this.wireTreeEvents();
8320
8438
  addClass([this.popupDiv], DDTHIDEICON);
@@ -8403,6 +8521,11 @@ let DropDownTree = class DropDownTree extends Component {
8403
8521
  this.hidePopup();
8404
8522
  }
8405
8523
  break;
8524
+ case 'tab':
8525
+ if (this.isPopupOpen && !isNullOrUndefined(this.popupDiv) && this.popupDiv.classList.contains('e-no-data')) {
8526
+ this.hidePopup();
8527
+ }
8528
+ break;
8406
8529
  case 'shiftTab':
8407
8530
  addClass([this.inputWrapper], [INPUTFOCUS]);
8408
8531
  break;
@@ -9787,7 +9910,7 @@ let DropDownTree = class DropDownTree extends Component {
9787
9910
  });
9788
9911
  this.popupEle.setAttribute('role', 'region');
9789
9912
  this.popupEle.setAttribute('aria-label', this.element.id);
9790
- document.body.appendChild(this.popupEle);
9913
+ this.getAppendToElement().appendChild(this.popupEle);
9791
9914
  this.createPopup(this.popupEle);
9792
9915
  }
9793
9916
  else {
@@ -9878,6 +10001,16 @@ let DropDownTree = class DropDownTree extends Component {
9878
10001
  }
9879
10002
  });
9880
10003
  }
10004
+ getAppendToElement() {
10005
+ if (this.isAngular) {
10006
+ const cdkPane = this.element && this.element.closest ? this.element.closest('.cdk-overlay-pane') : null;
10007
+ const popoverEl = this.element && this.element.closest ? this.element.closest('[popover]') : null;
10008
+ if (cdkPane && popoverEl) {
10009
+ return cdkPane;
10010
+ }
10011
+ }
10012
+ return document.body;
10013
+ }
9881
10014
  checkCollision(popupEle) {
9882
10015
  const collision = isCollide(popupEle);
9883
10016
  if (collision.length > 0) {
@@ -10000,6 +10133,12 @@ let DropDownTree = class DropDownTree extends Component {
10000
10133
  const isScroller = target.classList.contains(DROPDOWN) ? true :
10001
10134
  (matches$1(target, '.e-ddt .e-popup') || matches$1(target, '.e-ddt .e-treeview'));
10002
10135
  const isSelectAllArea = target.classList.contains('e-ripple-container');
10136
+ if (this.overFlowWrapper && !this.overFlowWrapper.classList.contains(HIDEICON) && !this.isPopupOpen) {
10137
+ this.isTotalCountClicked = true;
10138
+ }
10139
+ else {
10140
+ this.isTotalCountClicked = false;
10141
+ }
10003
10142
  if ((this.isPopupOpen && ((!isNullOrUndefined(this.inputWrapper) &&
10004
10143
  this.inputWrapper.contains(target)) || isTree || isScroller || isHeader || isFooter || isSelectAllArea)) ||
10005
10144
  ((this.allowMultiSelection || this.showCheckBox) && (this.isPopupOpen && target.classList.contains(CHIP_CLOSE) ||
@@ -11037,7 +11176,8 @@ let DropDownTree = class DropDownTree extends Component {
11037
11176
  }
11038
11177
  }
11039
11178
  removeChip(e) {
11040
- if (!this.enabled || this.readonly) {
11179
+ if (!this.enabled || this.readonly || this.isTotalCountClicked) {
11180
+ this.isTotalCountClicked = false;
11041
11181
  return;
11042
11182
  }
11043
11183
  if (e.target.classList.contains('e-chips-close') && !this.isPopupOpen) {
@@ -13593,7 +13733,7 @@ function createFloatLabel(overAllWrapper, searchWrapper, element, inputElement,
13593
13733
  searchWrapper.appendChild(floatLinelement);
13594
13734
  searchWrapper.appendChild(floatLabelElement);
13595
13735
  overAllWrapper.classList.add('e-float-input');
13596
- updateFloatLabelState(value, floatLabelElement);
13736
+ updateFloatLabelState(value, floatLabelElement, floatLabelType);
13597
13737
  if (floatLabelType === 'Always') {
13598
13738
  if (floatLabelElement.classList.contains(LABELBOTTOM)) {
13599
13739
  removeClass([floatLabelElement], LABELBOTTOM);
@@ -13606,9 +13746,13 @@ function createFloatLabel(overAllWrapper, searchWrapper, element, inputElement,
13606
13746
  *
13607
13747
  * @param {string[] | number[] | boolean[]} value - Value of the MultiSelect.
13608
13748
  * @param {HTMLElement} label - Float label element.
13749
+ * @param {FloatLabelType} floatlabeltype - specify the float label type.
13609
13750
  */
13610
- function updateFloatLabelState(value, label) {
13611
- if (value && value.length > 0) {
13751
+ function updateFloatLabelState(value, label, floatlabeltype) {
13752
+ const floatElement = label.closest('.e-float-input');
13753
+ const isFocused = floatElement &&
13754
+ floatElement.classList.contains('e-input-focus');
13755
+ if ((value && value.length > 0) || (isFocused && floatElement.closest('.e-multiselect') && floatlabeltype === 'Auto')) {
13612
13756
  addClass([label], LABELTOP);
13613
13757
  removeClass([label], LABELBOTTOM);
13614
13758
  }
@@ -13926,7 +14070,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13926
14070
  }
13927
14071
  }
13928
14072
  onPopupShown(e) {
13929
- this.sanitizeData();
13930
14073
  if (Browser.isDevice && (this.mode === 'CheckBox' && this.allowFiltering)) {
13931
14074
  // eslint-disable-next-line @typescript-eslint/no-this-alias
13932
14075
  const proxy = this;
@@ -15500,6 +15643,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
15500
15643
  }
15501
15644
  }
15502
15645
  showDelimWrapper() {
15646
+ if (!this.value || !this.value.length) {
15647
+ return;
15648
+ }
15503
15649
  if (this.mode === 'CheckBox') {
15504
15650
  this.viewWrapper.style.display = '';
15505
15651
  }
@@ -16628,14 +16774,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16628
16774
  this.selectedListData.splice(index, 1);
16629
16775
  }
16630
16776
  this.setProperties({ value: [].concat([], removeVal) }, true);
16631
- if (this.enableVirtualization) {
16632
- const currentText = index === 0 && this.text.split(this.delimiterChar) &&
16633
- this.text.split(this.delimiterChar).length === 1 ?
16634
- this.text.replace(this.text.split(this.delimiterChar)[index], '') :
16635
- index === 0 ? this.text.replace(this.text.split(this.delimiterChar)[index] +
16636
- this.delimiterChar, '') :
16637
- this.text.replace(this.delimiterChar + this.text.split(this.delimiterChar)[index], '');
16638
- this.setProperties({ text: currentText.toString() }, true);
16777
+ if (this.enableVirtualization && !isNullOrUndefined(this.text)) {
16778
+ const textItems = this.text.split(this.delimiterChar);
16779
+ const currentText = index === 0 && textItems.length === 1
16780
+ ? this.text.replace(textItems[index], '') : index === 0 ? this.text.replace(textItems[index]
16781
+ + this.delimiterChar, '') : this.text.replace(this.delimiterChar + textItems[index], '');
16782
+ this.setProperties({ text: currentText }, true);
16639
16783
  }
16640
16784
  if (element !== null) {
16641
16785
  const currentValue = this.allowObjectBinding ? getValue(((this.fields.value) ?
@@ -17748,7 +17892,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
17748
17892
  }
17749
17893
  this.preventSetCurrentData = false;
17750
17894
  this.initializeData();
17751
- this.sanitizeData();
17752
17895
  this.updateDataAttribute(this.htmlAttributes);
17753
17896
  super.preRender();
17754
17897
  }
@@ -17779,56 +17922,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
17779
17922
  endIndex: this.itemCount
17780
17923
  };
17781
17924
  }
17782
- sanitizeData() {
17783
- if (this.enableVirtualization && this.mode === 'CheckBox') {
17784
- if (this.dataSource && Array.isArray(this.dataSource) && !(this.dataSource instanceof DataManager)) {
17785
- const cleanedDataSource = [];
17786
- for (let i = 0; i < this.dataSource.length; i++) {
17787
- const item = this.dataSource[i];
17788
- if (item !== null && item !== undefined && item !== '') {
17789
- if (typeof item === 'object') {
17790
- const itemValue = getValue((this.fields.value ? this.fields.value : 'value'), item);
17791
- if (this.fields.value !== null) {
17792
- if (itemValue !== null && itemValue !== undefined && itemValue !== '') {
17793
- cleanedDataSource.push(item);
17794
- }
17795
- }
17796
- else {
17797
- cleanedDataSource.push(item);
17798
- }
17799
- }
17800
- else if (typeof item === 'string') {
17801
- if (item !== null && item !== undefined && item.trim() !== '') {
17802
- cleanedDataSource.push(item);
17803
- }
17804
- }
17805
- else {
17806
- cleanedDataSource.push(item);
17807
- }
17808
- }
17809
- }
17810
- if (cleanedDataSource.length !== this.dataSource.length) {
17811
- this.setProperties({ dataSource: cleanedDataSource }, true);
17812
- }
17813
- }
17814
- if (this.value && Array.isArray(this.value) && this.value.length > 0) {
17815
- const cleanedValue = [];
17816
- for (let i = 0; i < this.value.length; i++) {
17817
- const val = this.value[i];
17818
- if (val !== null && val !== undefined && val !== '') {
17819
- cleanedValue.push(val);
17820
- }
17821
- }
17822
- if (cleanedValue.length !== this.value.length) {
17823
- this.setProperties({ value: cleanedValue }, true);
17824
- }
17825
- }
17826
- return true;
17827
- }
17828
- else {
17829
- return false;
17830
- }
17831
- }
17832
17925
  updateData(delimiterChar, e, isInitialVirtualData) {
17833
17926
  let data = '';
17834
17927
  const delim = this.mode === 'Delimiter' || this.mode === 'CheckBox';
@@ -17867,7 +17960,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
17867
17960
  const value = this.allowObjectBinding ?
17868
17961
  getValue(((this.fields.value) ? this.fields.value : ''), this.value[this.value.length - 1]) :
17869
17962
  this.value[this.value.length - 1];
17870
- if (this.isRemoveSelection) {
17963
+ if (this.isRemoveSelection && this.text) {
17871
17964
  data = this.text.replace(/,/g, delimiterChar + ' ') + delimiterChar + ' ';
17872
17965
  text = this.text.split(delimiterChar);
17873
17966
  }
@@ -17971,7 +18064,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
17971
18064
  || this.list.querySelector('.e-ul') && this.list.querySelector('.e-ul').childElementCount === 0)) {
17972
18065
  isEmptyData = true;
17973
18066
  }
17974
- this.sanitizeData();
17975
18067
  super.render(null, isEmptyData);
17976
18068
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
17977
18069
  this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
@@ -19234,7 +19326,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
19234
19326
  : (this.fields.value ? obj[this.fields.value] : obj);
19235
19327
  const text = isPlainValue
19236
19328
  ? String(obj)
19237
- : (this.fields.text ? (obj[this.fields.text]).toString() : String(obj));
19329
+ : (this.fields.text && obj[this.fields.text] != null ? (obj[this.fields.text]).toString()
19330
+ : String(obj));
19238
19331
  if (this.value && value != null && Array.isArray(this.value) &&
19239
19332
  ((!this.allowObjectBinding && this.value.indexOf(value) < 0) ||
19240
19333
  (this.allowObjectBinding && !this.isObjectInArray(value, this.value)))) {
@@ -19894,7 +19987,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
19894
19987
  switch (prop) {
19895
19988
  case 'query':
19896
19989
  case 'dataSource':
19897
- this.sanitizeData();
19898
19990
  if (this.mode === 'CheckBox' && this.showSelectAll) {
19899
19991
  if (!isNullOrUndefined(this.popupObj) && !this.isDimColumnWithCustomStyle()) {
19900
19992
  this.popupObj.destroy();
@@ -19928,7 +20020,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
19928
20020
  this.updateVal(this.value, this.value, 'text');
19929
20021
  break;
19930
20022
  case 'value':
19931
- this.sanitizeData();
19932
20023
  if (this.fields.disabled) {
19933
20024
  this.removeDisabledItemsValue(this.value);
19934
20025
  }
@@ -20366,8 +20457,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
20366
20457
  }
20367
20458
  this.firstItem = this.dataSource && this.dataSource.length > 0 ? this.dataSource[0] : null;
20368
20459
  const args = { cancel: false };
20369
- const oldValue = extend([], this.value, [], true);
20370
- const oldData = extend([], this.dataSource, [], true);
20371
20460
  this.trigger('beforeOpen', args, (args) => {
20372
20461
  if (!args.cancel) {
20373
20462
  if (!this.ulElement) {
@@ -20379,50 +20468,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
20379
20468
  if (this.inputElement && this.mode !== 'CheckBox') {
20380
20469
  this.focusIn();
20381
20470
  }
20382
- if (this.enableVirtualization && this.mode === 'CheckBox') {
20383
- if (JSON.stringify(oldData) !== JSON.stringify(this.dataSource) && this.sanitizeData() && this.showSelectAll) {
20384
- this.renderPopup();
20385
- }
20386
- if (!isNullOrUndefined(oldValue) && !isNullOrUndefined(this.value) &&
20387
- JSON.stringify(oldValue) !== JSON.stringify(this.value) && this.sanitizeData()) {
20388
- if (this.fields.disabled) {
20389
- this.removeDisabledItemsValue(this.value);
20390
- }
20391
- if (!this.validateValues(this.value, oldValue)) {
20392
- return;
20393
- }
20394
- if (this.isVue && !this.changeOnBlur && !this.validateValues(this.value, oldValue)) {
20395
- return;
20396
- }
20397
- this.updateVal(this.value, oldValue, 'value', this.enableVirtualization);
20398
- this.addValidInputClass();
20399
- if (this.showSelectAll) {
20400
- this.renderPopup();
20401
- const totalCount = this.dataSource instanceof DataManager ? 0 :
20402
- this.dataSource.length;
20403
- const selectedCount = this.value ? this.value.length : 0;
20404
- if (selectedCount === totalCount) {
20405
- let frame = null;
20406
- if (this.popupObj) {
20407
- frame = this.popupObj.element.querySelector('.e-selectall-parent .e-frame');
20408
- }
20409
- if (frame) {
20410
- frame.classList.add('e-check');
20411
- frame.classList.remove('e-uncheck');
20412
- frame.classList.remove('e-stop');
20413
- }
20414
- }
20415
- }
20416
- if (!this.closePopupOnSelect && this.isPopupOpen()) {
20417
- this.refreshPopup();
20418
- }
20419
- if (this.isPopupOpen() && this.list && this.list.querySelector('.e-active.e-disable')) {
20420
- const activeItems = this.list.querySelectorAll('li.' + dropDownBaseClasses.li + '.e-active' + '.e-disable');
20421
- removeClass(activeItems, 'e-disable');
20422
- }
20423
- this.preventChange = this.isAngular && this.preventChange ? !this.preventChange : this.preventChange;
20424
- }
20425
- }
20426
20471
  return;
20427
20472
  }
20428
20473
  if (this.mode === 'CheckBox' && Browser.isDevice && this.allowFiltering && this.isDeviceFullScreen) {
@@ -20578,7 +20623,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
20578
20623
  // eslint-disable-next-line
20579
20624
  this.value = [...this.value];
20580
20625
  }
20581
- this.sanitizeData();
20582
20626
  this.setDynValue = this.initStatus = false;
20583
20627
  this.isSelectAll = false;
20584
20628
  this.selectAllEventEle = [];
@@ -21781,12 +21825,14 @@ class CheckBoxSelection {
21781
21825
  let target;
21782
21826
  if (!isNullOrUndefined(args.e)) {
21783
21827
  const frameElm = args.li.querySelector('.e-checkbox-wrapper .e-frame');
21784
- target = !isNullOrUndefined(args.e.target) ?
21785
- (args.e.target.classList.contains('e-frame')
21786
- && (!this.parent.showSelectAll
21787
- || (this.checkAllParent && !this.checkAllParent.contains(args.e.target)))) ?
21788
- args.e.target : args.li.querySelector('.e-checkbox-wrapper').childNodes[1]
21789
- : args.li.querySelector('.e-checkbox-wrapper').childNodes[1];
21828
+ const checkboxWrapper = args.li.querySelector('.e-checkbox-wrapper');
21829
+ target = !isNullOrUndefined(args.e.target)
21830
+ ? (args.e.target.classList.contains('e-frame') &&
21831
+ (!this.parent.showSelectAll ||
21832
+ (this.checkAllParent && !this.checkAllParent.contains(args.e.target))))
21833
+ ? args.e.target
21834
+ : (checkboxWrapper ? checkboxWrapper.childNodes[1] : null)
21835
+ : (checkboxWrapper ? checkboxWrapper.childNodes[1] : null);
21790
21836
  }
21791
21837
  else {
21792
21838
  const checkboxWrapper = args.li.querySelector('.e-checkbox-wrapper');