@syncfusion/ej2-dropdowns 35.1.46 → 35.2.12

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.
@@ -1467,6 +1467,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1467
1467
  return 'drop-down-base';
1468
1468
  };
1469
1469
  DropDownBase.prototype.getTextByValue = function (value) {
1470
+ if (this.getModuleName() === 'multiselect' && (value === null || value === undefined)) {
1471
+ return 'null';
1472
+ }
1470
1473
  var text = this.checkValueCase(value, false, false, true);
1471
1474
  return text;
1472
1475
  };
@@ -3158,7 +3161,8 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
3158
3161
  if (type === 'string' || type === 'number' || type === 'boolean') {
3159
3162
  for (var _i = 0, _a = this.listData; _i < _a.length; _i++) {
3160
3163
  var item = _a[_i];
3161
- if (!isNullOrUndefined(item) && item === value) {
3164
+ if (((this.getModuleName() === 'multiselect') && item === value) ||
3165
+ ((this.getModuleName() !== 'multiselect') && !isNullOrUndefined(item) && item === value)) {
3162
3166
  return item;
3163
3167
  }
3164
3168
  }
@@ -3381,6 +3385,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3381
3385
  _this.isUpdateHeaderHeight = false;
3382
3386
  _this.isUpdateFooterHeight = false;
3383
3387
  _this.isReactTemplateUpdate = false;
3388
+ _this.popupPositionObserver = null;
3389
+ _this.popupPositionRefreshTimer = null;
3384
3390
  return _this;
3385
3391
  }
3386
3392
  /**
@@ -6267,6 +6273,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
6267
6273
  if (!isNullOrUndefined(_this.popupObj)) {
6268
6274
  _this.popupObj.show(new Animation(eventArgs.animation), (_this.zIndex === 1000) ? _this.element : null);
6269
6275
  _this.isPopupRender = true;
6276
+ _this.setupPopupPositionObserver();
6270
6277
  }
6271
6278
  if (_this.isReact) {
6272
6279
  setTimeout(function () {
@@ -6935,10 +6942,51 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
6935
6942
  }
6936
6943
  ulElement = null;
6937
6944
  };
6945
+ DropDownList.prototype.setupPopupPositionObserver = function () {
6946
+ var _this = this;
6947
+ if (!this.isAngular) {
6948
+ return;
6949
+ }
6950
+ if (!isNullOrUndefined(this.popupPositionObserver)) {
6951
+ this.popupPositionObserver.disconnect();
6952
+ }
6953
+ var observerTarget = this.inputWrapper && this.inputWrapper.container
6954
+ ? this.inputWrapper.container.parentElement
6955
+ : this.element.parentElement;
6956
+ if (isNullOrUndefined(observerTarget)) {
6957
+ return;
6958
+ }
6959
+ this.popupPositionObserver = new MutationObserver(function () {
6960
+ clearTimeout(_this.popupPositionRefreshTimer);
6961
+ _this.popupPositionRefreshTimer = setTimeout(function () {
6962
+ if (!isNullOrUndefined(_this.popupObj) &&
6963
+ !isNullOrUndefined(_this.inputWrapper)) {
6964
+ _this.popupObj.refreshPosition(_this.inputWrapper.container);
6965
+ }
6966
+ }, 0);
6967
+ });
6968
+ this.popupPositionObserver.observe(observerTarget, {
6969
+ childList: true,
6970
+ subtree: true,
6971
+ attributes: true,
6972
+ attributeFilter: ['style', 'class']
6973
+ });
6974
+ };
6975
+ DropDownList.prototype.destroyPopupPositionObserver = function () {
6976
+ if (this.popupPositionRefreshTimer) {
6977
+ clearTimeout(this.popupPositionRefreshTimer);
6978
+ this.popupPositionRefreshTimer = null;
6979
+ }
6980
+ if (this.popupPositionObserver) {
6981
+ this.popupPositionObserver.disconnect();
6982
+ this.popupPositionObserver = null;
6983
+ }
6984
+ };
6938
6985
  DropDownList.prototype.destroyPopup = function () {
6939
6986
  this.isPopupOpen = false;
6940
6987
  this.isFilterFocus = false;
6941
6988
  this.inputElement.removeAttribute('aria-controls');
6989
+ this.destroyPopupPositionObserver();
6942
6990
  if (this.popupObj) {
6943
6991
  if (this.resizer) {
6944
6992
  EventHandler.remove(this.resizer, 'mousedown', this.startResizing);
@@ -7845,6 +7893,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
7845
7893
  */
7846
7894
  DropDownList.prototype.hidePopup = function (e) {
7847
7895
  /* eslint-enable valid-jsdoc, jsdoc/require-param */
7896
+ this.destroyPopupPositionObserver();
7848
7897
  if (this.isEscapeKey && this.getModuleName() === 'dropdownlist') {
7849
7898
  if (!isNullOrUndefined(this.inputElement)) {
7850
7899
  Input.setValue(this.text, this.inputElement, this.floatLabelType, this.showClearButton);
@@ -7998,6 +8047,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
7998
8047
  * @returns {void}
7999
8048
  */
8000
8049
  DropDownList.prototype.destroy = function () {
8050
+ this.destroyPopupPositionObserver();
8001
8051
  this.isActive = false;
8002
8052
  this.isStaleFilter = false;
8003
8053
  this.filterGeneration = null;
@@ -14167,6 +14217,7 @@ var CHIP_CLOSE$1 = 'e-chips-close';
14167
14217
  var CHIP_SELECTED = 'e-chip-selected';
14168
14218
  var SEARCHBOX_WRAPPER = 'e-searcher';
14169
14219
  var DELIMITER_VIEW_WRAPPER = 'e-delimiter';
14220
+ var NULL_CHIP = 'e-chip-null';
14170
14221
  var ZERO_SIZE = 'e-zero-size';
14171
14222
  var REMAIN_WRAPPER$1 = 'e-remain';
14172
14223
  var CLOSEICON_CLASS$1 = 'e-chips-close e-close-hooker';
@@ -14631,16 +14682,24 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
14631
14682
  return;
14632
14683
  }
14633
14684
  var elements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP$1);
14634
- var value = elements[elements.length - 1].getAttribute('data-value');
14685
+ var lastElement = elements[elements.length - 1];
14686
+ var isNullChip = lastElement.classList.contains(NULL_CHIP);
14687
+ var customValue = null;
14635
14688
  if (!isNullOrUndefined(this.value)) {
14636
14689
  this.tempValues = this.allowObjectBinding ? this.value.slice() : this.value.slice();
14637
14690
  }
14638
- var customValue = this.allowObjectBinding ? this.enableVirtualization ?
14639
- this.getVirtualDataByValue(this.getFormattedValue(value)) :
14640
- this.getDataByValue(this.getFormattedValue(value)) : this.getFormattedValue(value);
14641
- if (this.allowCustomValue && (value !== 'false' && customValue === false || (!isNullOrUndefined(customValue) &&
14642
- customValue.toString() === 'NaN'))) {
14643
- customValue = value;
14691
+ if (isNullChip) {
14692
+ customValue = null;
14693
+ }
14694
+ else {
14695
+ var value = lastElement.getAttribute('data-value');
14696
+ customValue = this.allowObjectBinding ? this.enableVirtualization ?
14697
+ this.getVirtualDataByValue(this.getFormattedValue(value)) :
14698
+ this.getDataByValue(this.getFormattedValue(value)) : this.getFormattedValue(value);
14699
+ if (this.allowCustomValue && (value !== 'false' && customValue === false || (!isNullOrUndefined(customValue) &&
14700
+ customValue.toString() === 'NaN'))) {
14701
+ customValue = value;
14702
+ }
14644
14703
  }
14645
14704
  this.removeValue(customValue, e);
14646
14705
  this.removeChipSelection();
@@ -14981,48 +15040,54 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
14981
15040
  HIDE_LIST :
14982
15041
  dropDownBaseClasses.selected;
14983
15042
  if (!isNullOrUndefined(this.value)) {
14984
- for (var index = 0; !isNullOrUndefined(this.value[index]); index++) {
14985
- value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', this.value[index]) :
14986
- this.value[index];
14987
- element = this.findListElement(this.list, 'li', 'data-value', value);
14988
- if (element) {
14989
- addClass([element], className);
14990
- if (this.hideSelectedItem && element.previousSibling
14991
- && element.previousElementSibling.classList.contains(dropDownBaseClasses.group)
14992
- && (!element.nextElementSibling ||
14993
- element.nextElementSibling.classList.contains(dropDownBaseClasses.group))) {
14994
- addClass([element.previousElementSibling], className);
14995
- }
14996
- if (this.hideSelectedItem && this.fields.groupBy && !element.previousElementSibling.classList.contains(HIDE_LIST)) {
14997
- this.hideGroupItem(value);
14998
- }
14999
- if (this.hideSelectedItem && element.classList.contains(dropDownBaseClasses.focus)) {
15000
- removeClass([element], dropDownBaseClasses.focus);
15001
- var listEle = element.parentElement.querySelectorAll('.' +
15002
- dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')' + ':not(.' + DISABLED$1 + ')');
15003
- if (listEle.length > 0) {
15004
- addClass([listEle[0]], dropDownBaseClasses.focus);
15005
- this.updateAriaActiveDescendant();
15043
+ var isOnlyNull = this.isValueOnlyNull();
15044
+ if (!isOnlyNull) {
15045
+ for (var index = 0; index < this.value.length; index++) {
15046
+ value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', this.value[index]) :
15047
+ this.value[index];
15048
+ if (isNullOrUndefined(value)) {
15049
+ continue;
15050
+ }
15051
+ element = this.findListElement(this.list, 'li', 'data-value', value);
15052
+ if (element) {
15053
+ addClass([element], className);
15054
+ if (this.hideSelectedItem && element.previousSibling
15055
+ && element.previousElementSibling.classList.contains(dropDownBaseClasses.group)
15056
+ && (!element.nextElementSibling ||
15057
+ element.nextElementSibling.classList.contains(dropDownBaseClasses.group))) {
15058
+ addClass([element.previousElementSibling], className);
15006
15059
  }
15007
- else {
15008
- //EJ2-57588 - for this task, we prevent the ul element cloning ( this.ulElement = this.ulElement.cloneNode ? <HTMLElement>this.ulElement.cloneNode(true) : this.ulElement;)
15009
- if (!(this.list && this.list.querySelectorAll('.' + dropDownBaseClasses.li).length > 0)) {
15010
- this.l10nUpdate();
15011
- addClass([this.list], dropDownBaseClasses.noData);
15060
+ if (this.hideSelectedItem && this.fields.groupBy && !element.previousElementSibling.classList.contains(HIDE_LIST)) {
15061
+ this.hideGroupItem(value);
15062
+ }
15063
+ if (this.hideSelectedItem && element.classList.contains(dropDownBaseClasses.focus)) {
15064
+ removeClass([element], dropDownBaseClasses.focus);
15065
+ var listEle = element.parentElement.querySelectorAll('.' +
15066
+ dropDownBaseClasses.li + ':not(.' + HIDE_LIST + ')' + ':not(.' + DISABLED$1 + ')');
15067
+ if (listEle.length > 0) {
15068
+ addClass([listEle[0]], dropDownBaseClasses.focus);
15069
+ this.updateAriaActiveDescendant();
15070
+ }
15071
+ else {
15072
+ //EJ2-57588 - for this task, we prevent the ul element cloning ( this.ulElement = this.ulElement.cloneNode ? <HTMLElement>this.ulElement.cloneNode(true) : this.ulElement;)
15073
+ if (!(this.list && this.list.querySelectorAll('.' + dropDownBaseClasses.li).length > 0)) {
15074
+ this.l10nUpdate();
15075
+ addClass([this.list], dropDownBaseClasses.noData);
15076
+ }
15012
15077
  }
15013
15078
  }
15014
- }
15015
- element.setAttribute('aria-selected', 'true');
15016
- if (this.mode === 'CheckBox' && element.classList.contains('e-active')) {
15017
- var ariaValue = element.getElementsByClassName('e-check').length;
15018
- if (ariaValue === 0) {
15019
- var args = {
15020
- module: 'CheckBoxSelection',
15021
- enable: this.mode === 'CheckBox',
15022
- li: element,
15023
- e: null
15024
- };
15025
- this.notify('updatelist', args);
15079
+ element.setAttribute('aria-selected', 'true');
15080
+ if (this.mode === 'CheckBox' && element.classList.contains('e-active')) {
15081
+ var ariaValue = element.getElementsByClassName('e-check').length;
15082
+ if (ariaValue === 0) {
15083
+ var args = {
15084
+ module: 'CheckBoxSelection',
15085
+ enable: this.mode === 'CheckBox',
15086
+ li: element,
15087
+ e: null
15088
+ };
15089
+ this.notify('updatelist', args);
15090
+ }
15026
15091
  }
15027
15092
  }
15028
15093
  }
@@ -15810,13 +15875,26 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
15810
15875
  var activeItem = !isNullOrUndefined(this.ulElement)
15811
15876
  ? this.ulElement.getElementsByClassName('e-item-focus')[0]
15812
15877
  : null;
15878
+ var filterInput = this.allowFiltering && !isNullOrUndefined(this.popupWrapper)
15879
+ ? this.popupWrapper.querySelector('.' + FILTERINPUT)
15880
+ : null;
15813
15881
  if (!isNullOrUndefined(activeItem) && this.isPopupOpen()) {
15814
15882
  attributes(this.inputElement, {
15815
15883
  'aria-activedescendant': activeItem.id
15816
15884
  });
15885
+ if (filterInput) {
15886
+ attributes(filterInput, {
15887
+ 'aria-activedescendant': activeItem.id
15888
+ });
15889
+ }
15817
15890
  }
15818
- else if (!isNullOrUndefined(this.inputElement)) {
15819
- this.inputElement.removeAttribute('aria-activedescendant');
15891
+ else {
15892
+ if (!isNullOrUndefined(this.inputElement)) {
15893
+ this.inputElement.removeAttribute('aria-activedescendant');
15894
+ }
15895
+ if (filterInput) {
15896
+ filterInput.removeAttribute('aria-activedescendant');
15897
+ }
15820
15898
  }
15821
15899
  };
15822
15900
  MultiSelect.prototype.pageUpSelection = function (steps, isVirtualKeyAction) {
@@ -16645,9 +16723,16 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16645
16723
  this.removeChipSelection();
16646
16724
  this.addChipSelection(temp, e);
16647
16725
  }
16648
- var currentChip = this.allowObjectBinding ?
16649
- this.getDataByValue(this.getFormattedValue(selectedElem.getAttribute('data-value'))) :
16650
- selectedElem.getAttribute('data-value');
16726
+ var isNullChip = selectedElem.classList.contains(NULL_CHIP);
16727
+ var currentChip = void 0;
16728
+ if (isNullChip) {
16729
+ currentChip = null;
16730
+ }
16731
+ else {
16732
+ currentChip = this.allowObjectBinding ?
16733
+ this.getDataByValue(this.getFormattedValue(selectedElem.getAttribute('data-value'))) :
16734
+ selectedElem.getAttribute('data-value');
16735
+ }
16651
16736
  this.removeValue(currentChip, e);
16652
16737
  this.updateDelimeter(this.delimiterChar, e);
16653
16738
  this.makeTextBoxEmpty();
@@ -16905,7 +16990,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16905
16990
  if (type === 'string' || type === 'number' || type === 'boolean') {
16906
16991
  for (var _i = 0, _a = this.selectedListData; _i < _a.length; _i++) {
16907
16992
  var item = _a[_i];
16908
- if (!isNullOrUndefined(item) && item === value) {
16993
+ if (item === value || (isNullOrUndefined(item) && value === null)) {
16909
16994
  return item;
16910
16995
  }
16911
16996
  }
@@ -16913,8 +16998,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16913
16998
  else {
16914
16999
  for (var _b = 0, _c = this.selectedListData; _b < _c.length; _b++) {
16915
17000
  var item = _c[_b];
16916
- if (!isNullOrUndefined(item) && getValue((this.fields.value ? this.fields.value : 'value'), item) === value) {
16917
- return item;
17001
+ if (item !== undefined) {
17002
+ var itemValue = getValue((this.fields.value ? this.fields.value : 'value'), item);
17003
+ if (itemValue === value || (isNullOrUndefined(itemValue) && value === null)) {
17004
+ return item;
17005
+ }
16918
17006
  }
16919
17007
  }
16920
17008
  }
@@ -16927,13 +17015,21 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16927
17015
  }
16928
17016
  if (this.enabled && !this.readonly) {
16929
17017
  var element = e.target.parentElement;
16930
- var customVal = element.getAttribute('data-value');
16931
- var value = this.allowObjectBinding ? this.enableVirtualization ?
16932
- this.getVirtualDataByValue(this.getFormattedValue(customVal)) :
16933
- this.getDataByValue(this.getFormattedValue(customVal)) : this.getFormattedValue(customVal);
16934
- if (this.allowCustomValue && ((customVal !== 'false' && value === false) ||
16935
- (!isNullOrUndefined(value) && value.toString() === 'NaN'))) {
16936
- value = customVal;
17018
+ var isNullChip = element.classList.contains(NULL_CHIP);
17019
+ var value = void 0;
17020
+ if (isNullChip) {
17021
+ value = null;
17022
+ }
17023
+ else {
17024
+ var customVal = element.getAttribute('data-value');
17025
+ var formattedVal = this.getFormattedValue(customVal);
17026
+ value = this.allowObjectBinding ? this.enableVirtualization ?
17027
+ this.getVirtualDataByValue(formattedVal) :
17028
+ this.getDataByValue(formattedVal) : formattedVal;
17029
+ if (this.allowCustomValue && ((customVal !== 'false' && value === false) ||
17030
+ (!isNullOrUndefined(value) && value.toString() === 'NaN'))) {
17031
+ value = customVal;
17032
+ }
16937
17033
  }
16938
17034
  if (this.isPopupOpen() && this.mode !== 'CheckBox') {
16939
17035
  this.hidePopup(e);
@@ -16942,6 +17038,14 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16942
17038
  this.inputElement.focus();
16943
17039
  }
16944
17040
  this.removeValue(value, e);
17041
+ if (!isNullChip) {
17042
+ var findValue = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', value) : value;
17043
+ if (isNullOrUndefined(this.findListElement(this.list, 'li', 'data-value', findValue)) &&
17044
+ this.mainList && this.listData) {
17045
+ var list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;
17046
+ this.onActionComplete(list, this.mainData);
17047
+ }
17048
+ }
16945
17049
  value = this.allowObjectBinding ? getValue((this.fields.value) ? this.fields.value : '', value) : value;
16946
17050
  if (isNullOrUndefined(this.findListElement(this.list, 'li', 'data-value', value)) &&
16947
17051
  this.mainList && this.listData) {
@@ -17020,8 +17124,17 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
17020
17124
  };
17021
17125
  MultiSelect.prototype.removeValue = function (value, eve, length, isClearAll) {
17022
17126
  var _this = this;
17023
- var index = this.allowObjectBinding ? this.indexOfObjectInArray(value, this.value) :
17024
- this.value.indexOf(this.getFormattedValue(value));
17127
+ var index = -1;
17128
+ if (value === null) {
17129
+ index = this.value.indexOf(null);
17130
+ }
17131
+ else if (this.allowObjectBinding) {
17132
+ index = this.indexOfObjectInArray(value, this.value);
17133
+ }
17134
+ else {
17135
+ var formattedValue = this.getFormattedValue(value);
17136
+ index = this.value.indexOf(formattedValue);
17137
+ }
17025
17138
  if (index === -1 && this.allowCustomValue && !isNullOrUndefined(value)) {
17026
17139
  index = this.allowObjectBinding ? this.indexOfObjectInArray(value, this.value) :
17027
17140
  this.value.indexOf(value.toString());
@@ -17207,7 +17320,13 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
17207
17320
  MultiSelect.prototype.removeChip = function (value, isClearAll) {
17208
17321
  if (this.chipCollectionWrapper) {
17209
17322
  if (!(this.enableVirtualization && isClearAll)) {
17210
- var element = this.findListElement(this.chipCollectionWrapper, 'span', 'data-value', value);
17323
+ var element = void 0;
17324
+ if (value === null) {
17325
+ element = this.chipCollectionWrapper.querySelector('span.' + NULL_CHIP);
17326
+ }
17327
+ else {
17328
+ element = this.findListElement(this.chipCollectionWrapper, 'span', 'data-value', value);
17329
+ }
17211
17330
  if (element) {
17212
17331
  remove(element);
17213
17332
  }
@@ -17225,7 +17344,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
17225
17344
  }
17226
17345
  };
17227
17346
  MultiSelect.prototype.updateChipStatus = function () {
17228
- if (this.value && this.value.length) {
17347
+ var showChips = this.value && this.value.length && !this.isValueOnlyNull();
17348
+ if (showChips) {
17229
17349
  if (!isNullOrUndefined(this.chipCollectionWrapper)) {
17230
17350
  (this.chipCollectionWrapper.style.display = '');
17231
17351
  }
@@ -17459,10 +17579,21 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
17459
17579
  MultiSelect.prototype.getChip = function (data, value, e) {
17460
17580
  var _this = this;
17461
17581
  var itemData = { text: value, value: value };
17582
+ var isNullValue = value === null;
17583
+ var chipAttrs = { 'title': data, 'role': 'option', 'aria-selected': 'true' };
17584
+ if (isNullValue) {
17585
+ chipAttrs['data-value'] = 'null';
17586
+ }
17587
+ else {
17588
+ chipAttrs['data-value'] = value;
17589
+ }
17462
17590
  var chip = this.createElement('span', {
17463
- className: CHIP$1,
17464
- attrs: { 'data-value': value, 'title': data, 'role': 'option', 'aria-selected': 'true' }
17591
+ className: CHIP$1 + (isNullValue ? ' ' + NULL_CHIP : ''),
17592
+ attrs: chipAttrs
17465
17593
  });
17594
+ if (isNullValue) {
17595
+ addClass([chip], NULL_CHIP);
17596
+ }
17466
17597
  var compiledString;
17467
17598
  var chipContent = this.createElement('span', { className: CHIP_CONTENT$1 });
17468
17599
  var chipClose = this.createElement('span', { className: CHIP_CLOSE$1, attrs: { 'aria-hidden': 'true' } });
@@ -17484,7 +17615,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
17484
17615
  this.renderReactTemplates();
17485
17616
  }
17486
17617
  else if (this.enableHtmlSanitizer) {
17487
- chipContent.innerText = data;
17618
+ var displayText = (data === 'null' || data === 'undefined') ? 'null' : data;
17619
+ chipContent.innerText = displayText;
17488
17620
  }
17489
17621
  else {
17490
17622
  chipContent.innerHTML = this.encodeHtmlEntities(data.toString());
@@ -18289,6 +18421,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
18289
18421
  var value = this_1.allowObjectBinding ?
18290
18422
  getValue(((this_1.fields.value) ? this_1.fields.value : ''), this_1.value[this_1.value.length - 1]) :
18291
18423
  this_1.value[this_1.value.length - 1];
18424
+ if (value === null && this_1.value.length === 1) {
18425
+ return out_index_1 = index, "break";
18426
+ }
18292
18427
  if (this_1.isRemoveSelection && this_1.text) {
18293
18428
  data = this_1.text.replace(/,/g, delimiterChar + ' ') + delimiterChar + ' ';
18294
18429
  text = this_1.text.split(delimiterChar);
@@ -18434,6 +18569,18 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
18434
18569
  }
18435
18570
  return null;
18436
18571
  };
18572
+ MultiSelect.prototype.isValueOnlyNull = function () {
18573
+ if (!this.value || this.value.length === 0) {
18574
+ return false;
18575
+ }
18576
+ return this.value.every(function (v) { return v === null || v === undefined; });
18577
+ };
18578
+ MultiSelect.prototype.getTextByValue = function (value) {
18579
+ if (value === null || value === undefined) {
18580
+ return 'null';
18581
+ }
18582
+ return _super.prototype.getTextByValue.call(this, value);
18583
+ };
18437
18584
  MultiSelect.prototype.initialValueUpdate = function (listItems, isInitialVirtualData, isInitialRender) {
18438
18585
  var _this = this;
18439
18586
  if (this.list) {
@@ -18446,7 +18593,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
18446
18593
  this.removeListSelection();
18447
18594
  var formElement = closest(this.inputElement, 'form');
18448
18595
  if (!isNullOrUndefined(this.value)) {
18449
- for (var index = 0; !isNullOrUndefined(this.value[index]); index++) {
18596
+ for (var index = 0; index < this.value.length; index++) {
18597
+ if (this.isValueOnlyNull()) {
18598
+ continue;
18599
+ }
18450
18600
  value_2 = this.allowObjectBinding ?
18451
18601
  getValue(((this.fields.value) ? this.fields.value : ''), this.value[index]) :
18452
18602
  this.value[index];
@@ -18498,10 +18648,15 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
18498
18648
  ((!(this.dataSource instanceof DataManager)) ||
18499
18649
  (this.dataSource instanceof DataManager && isInitialVirtualData)) && (!this.isAngular || !isInitialRender ||
18500
18650
  (isNullOrUndefined(formElement) && listItems && listItems.length > 0))
18501
- && !(this.mode === 'CheckBox' && this.enableVirtualization && this.value.length > this.getSummaryTagThreshold())) {
18651
+ && !(this.mode === 'CheckBox' && this.enableVirtualization && this.value.length > this.getSummaryTagThreshold())
18652
+ && value_2 !== null) {
18502
18653
  this.value.splice(index, 1);
18503
18654
  index -= 1;
18504
18655
  }
18656
+ if (value_2 === null && isNullOrUndefined(text)) {
18657
+ text = this.getTextByValue(value_2);
18658
+ isCustomData = true;
18659
+ }
18505
18660
  }
18506
18661
  else {
18507
18662
  text = this.getTextByValue(value_2);
@@ -18512,20 +18667,23 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
18512
18667
  this.listData = savedListData;
18513
18668
  }
18514
18669
  }
18515
- if (((element && (element.getAttribute('aria-selected') !== 'true')) ||
18670
+ var shouldDisplayNull = (value_2 === null && this.value.length > 1);
18671
+ var shouldProcessElement = ((element && (element.getAttribute('aria-selected') !== 'true')) ||
18516
18672
  (element && (element.getAttribute('aria-selected') === 'true' && this.hideSelectedItem) &&
18517
- (this.mode === 'Box' || this.mode === 'Default'))) ||
18518
- (this.enableVirtualization && value_2 != null && text != null && !isCustomData)) {
18673
+ (this.mode === 'Box' || this.mode === 'Default'))) || (this.enableVirtualization && (text != null ||
18674
+ shouldDisplayNull) && !isCustomData && (value_2 != null || this.value.length > 1));
18675
+ if (shouldProcessElement) {
18519
18676
  var currentText = [];
18520
- var textValues = this.isDynamicRemoteVirtualData && text != null && text !== '' && index === 0 ? text : this.text != null && this.text !== '' && !this.text.includes(text) ? this.text + this.delimiterChar + text : text;
18677
+ var displayText = value_2 === null && (text === null || text === undefined) ? 'null' : text;
18678
+ var textValues = this.isDynamicRemoteVirtualData && displayText != null && displayText !== '' && index === 0 ? displayText : this.text != null && this.text !== '' && !this.text.includes(displayText) ? this.text + this.delimiterChar + displayText : displayText;
18521
18679
  currentText.push(textValues);
18522
18680
  this.setProperties({ text: currentText.toString() }, true);
18523
- this.addChip(text, value_2);
18681
+ this.addChip(displayText, value_2);
18524
18682
  this.addListSelection(element);
18525
18683
  }
18526
- else if ((!this.enableVirtualization && value_2 && this.allowCustomValue) ||
18684
+ else if ((!this.enableVirtualization && (value_2 || this.value.length > 1) && this.allowCustomValue) ||
18527
18685
  (this.enableVirtualization &&
18528
- value_2 &&
18686
+ (value_2 || this.value.length > 1) &&
18529
18687
  this.allowCustomValue &&
18530
18688
  ((!(this.dataSource instanceof DataManager)) ||
18531
18689
  (this.dataSource instanceof DataManager && isInitialVirtualData)))) {
@@ -18562,10 +18720,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
18562
18720
  this.wireListEvents();
18563
18721
  }
18564
18722
  var currentText = [];
18565
- var textValues = this.text != null && this.text !== '' ? this.text + this.delimiterChar + text : text;
18723
+ var displayText = value_2 === null && (text === null || text === undefined) ? 'null' : text;
18724
+ var textValues = this.text != null && this.text !== '' ? this.text + this.delimiterChar + displayText : displayText;
18566
18725
  currentText.push(textValues);
18567
18726
  this.setProperties({ text: currentText.toString() }, true);
18568
- this.addChip(text, value_2);
18727
+ this.addChip(displayText, value_2);
18569
18728
  this.addListSelection(element);
18570
18729
  }
18571
18730
  }
@@ -18639,11 +18798,13 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
18639
18798
  };
18640
18799
  MultiSelect.prototype.updateListSelection = function (li, e, length) {
18641
18800
  var customVal = li.getAttribute('data-value');
18801
+ var actualVal = customVal === 'null' ? null : customVal;
18642
18802
  var value = this.allowObjectBinding ?
18643
- this.getDataByValue(this.getFormattedValue(customVal)) : this.getFormattedValue(customVal);
18803
+ this.getDataByValue(this.getFormattedValue(actualVal))
18804
+ : this.getFormattedValue(actualVal);
18644
18805
  if (this.allowCustomValue && ((customVal !== 'false' && value === false) ||
18645
18806
  (!isNullOrUndefined(value) && value.toString() === 'NaN'))) {
18646
- value = customVal;
18807
+ value = actualVal;
18647
18808
  }
18648
18809
  this.removeHover();
18649
18810
  if (!this.value || ((!this.allowObjectBinding && this.value.indexOf(value) === -1) ||
@@ -19288,7 +19449,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
19288
19449
  }
19289
19450
  this.checkClearIconWidth();
19290
19451
  if (!isNullOrUndefined(this.value) && (this.allowCustomValue || (this.listData && this.listData.length > 0))) {
19291
- for (var index = 0; !isNullOrUndefined(this.value[index]); index++) {
19452
+ for (var index = 0; index < this.value.length; index++) {
19453
+ if (this.isValueOnlyNull()) {
19454
+ continue;
19455
+ }
19292
19456
  var items = this.text && this.text.split(this.delimiterChar);
19293
19457
  if (!this.enableVirtualization) {
19294
19458
  data += (index === 0) ? '' : this.delimiterChar + ' ';