@syncfusion/ej2-dropdowns 20.2.40 → 20.2.45

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.
@@ -485,7 +485,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
485
485
  *
486
486
  * @returns {void}
487
487
  */
488
- DropDownBase.prototype.initialize = function () {
488
+ DropDownBase.prototype.initialize = function (e) {
489
489
  this.bindEvent = true;
490
490
  this.actionFailureTemplateId = "" + this.element.id + ACTIONFAILURETEMPLATE_PROPERTY;
491
491
  if (this.element.tagName === 'UL') {
@@ -504,7 +504,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
504
504
  }
505
505
  }
506
506
  else {
507
- this.setListData(this.dataSource, this.fields, this.query);
507
+ this.setListData(this.dataSource, this.fields, this.query, e);
508
508
  }
509
509
  };
510
510
  /**
@@ -612,7 +612,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
612
612
  * @param {Query} query - Accepts the external Query that execute along with data processing.
613
613
  * @returns {void}
614
614
  */
615
- DropDownBase.prototype.setListData = function (dataSource, fields, query) {
615
+ DropDownBase.prototype.setListData = function (dataSource, fields, query, event) {
616
616
  var _this = this;
617
617
  fields = fields ? fields : this.fields;
618
618
  var ulElement;
@@ -659,7 +659,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
659
659
  _this.trigger('actionComplete', localDataArgs, function (localDataArgs) {
660
660
  if (!localDataArgs.cancel) {
661
661
  ulElement = _this.renderItems(localDataArgs.result, fields);
662
- _this.onActionComplete(ulElement, localDataArgs.result);
662
+ _this.onActionComplete(ulElement, localDataArgs.result, event);
663
663
  if (_this.groupTemplate) {
664
664
  _this.renderGroupTemplate(ulElement);
665
665
  }
@@ -1049,7 +1049,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1049
1049
  * @param {Query} query - Accepts the external Query that execute along with data processing.
1050
1050
  * @returns {void}
1051
1051
  */
1052
- DropDownBase.prototype.resetList = function (dataSource, fields, query) {
1052
+ DropDownBase.prototype.resetList = function (dataSource, fields, query, e) {
1053
1053
  if (this.list) {
1054
1054
  if ((this.element.tagName === 'SELECT' && this.element.options.length > 0)
1055
1055
  || (this.element.tagName === 'UL' && this.element.childNodes.length > 0)) {
@@ -1060,7 +1060,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1060
1060
  }
1061
1061
  }
1062
1062
  dataSource = this.getModuleName() === 'combobox' && this.selectData && dataSource instanceof Array && dataSource.length < this.selectData.length ? this.selectData : dataSource;
1063
- this.setListData(dataSource, fields, query);
1063
+ this.setListData(dataSource, fields, query, e);
1064
1064
  }
1065
1065
  };
1066
1066
  DropDownBase.prototype.updateSelectElementData = function (isFiltering) {
@@ -1152,7 +1152,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1152
1152
  * @private
1153
1153
  * @returns {void}
1154
1154
  */
1155
- DropDownBase.prototype.render = function (isEmptyData) {
1155
+ DropDownBase.prototype.render = function (e, isEmptyData) {
1156
1156
  this.list = this.createElement('div', { className: dropDownBaseClasses.content, attrs: { 'tabindex': '0' } });
1157
1157
  this.list.classList.add(dropDownBaseClasses.root);
1158
1158
  this.setFields();
@@ -1176,7 +1176,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1176
1176
  this.setEnableRtl();
1177
1177
  this.setEnabled();
1178
1178
  if (!isEmptyData) {
1179
- this.initialize();
1179
+ this.initialize(e);
1180
1180
  }
1181
1181
  };
1182
1182
  /**
@@ -1611,8 +1611,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
1611
1611
  this.popupObj.setProperties({ 'zIndex': this.zIndex });
1612
1612
  }
1613
1613
  };
1614
- DropDownList.prototype.renderList = function (isEmptyData) {
1615
- _super.prototype.render.call(this, isEmptyData);
1614
+ DropDownList.prototype.renderList = function (e, isEmptyData) {
1615
+ _super.prototype.render.call(this, e, isEmptyData);
1616
1616
  this.unWireListEvents();
1617
1617
  this.wireListEvents();
1618
1618
  };
@@ -2097,7 +2097,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2097
2097
  var isTabAction = e.action === 'tab' || e.action === 'close';
2098
2098
  if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape') {
2099
2099
  this.searchKeyEvent = e;
2100
- this.renderList();
2100
+ this.renderList(e);
2101
2101
  }
2102
2102
  if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&
2103
2103
  isNavigation && this.liCollections.length === 0) || this.isRequested) {
@@ -2136,7 +2136,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2136
2136
  }
2137
2137
  break;
2138
2138
  case 'open':
2139
- this.showPopup();
2139
+ this.showPopup(e);
2140
2140
  break;
2141
2141
  case 'hide':
2142
2142
  this.preventAltUp = this.isPopupOpen;
@@ -2328,7 +2328,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2328
2328
  }
2329
2329
  if (!this.readonly) {
2330
2330
  if (this.isPopupOpen) {
2331
- this.hidePopup();
2331
+ this.hidePopup(e);
2332
2332
  if (this.isFilterLayout()) {
2333
2333
  this.focusDropDown(e);
2334
2334
  }
@@ -2338,7 +2338,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2338
2338
  this.floatLabelChange();
2339
2339
  this.queryString = this.inputElement.value.trim() === '' ? null : this.inputElement.value;
2340
2340
  this.isDropDownClick = true;
2341
- this.showPopup();
2341
+ this.showPopup(e);
2342
2342
  }
2343
2343
  // eslint-disable-next-line @typescript-eslint/no-this-alias
2344
2344
  var proxy_1 = this;
@@ -2983,26 +2983,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
2983
2983
  }
2984
2984
  this.initial = false;
2985
2985
  }
2986
- else if (this.getModuleName() === 'autocomplete' && this.value && this.typedString === '' && !(this.dataSource instanceof DataManager)) {
2987
- var checkFields_1 = this.typeOfData(this.dataSource).typeof === 'string' ? '' : this.fields.value;
2988
- var checkValue = list.some(function (x) { return x[checkFields_1] === _this.value; });
2989
- var query = new Query();
2990
- if (!checkValue) {
2991
- new DataManager(this.dataSource).executeQuery(query.where(new Predicate(checkFields_1, 'equal', this.value)))
2992
- .then(function (e) {
2993
- if (e.result.length > 0) {
2994
- _this.value = checkFields_1 !== '' ? e.result[0][_this.fields.value].toString() : e.result[0].toString();
2995
- _this.addItem(e.result, list.length);
2996
- _this.updateValues();
2997
- }
2998
- else {
2999
- _this.updateValues();
3000
- }
3001
- });
3002
- }
3003
- else {
3004
- this.updateValues();
3005
- }
2986
+ else if (this.getModuleName() === 'autocomplete' && this.value) {
2987
+ this.setInputValue();
3006
2988
  }
3007
2989
  if (this.getModuleName() !== 'autocomplete' && this.isFiltering() && !this.isTyped) {
3008
2990
  if (!this.actionCompleteData.isUpdated || ((!this.isCustomFilter
@@ -3025,7 +3007,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3025
3007
  }
3026
3008
  }
3027
3009
  if (this.beforePopupOpen) {
3028
- this.renderPopup();
3010
+ this.renderPopup(e);
3029
3011
  }
3030
3012
  }
3031
3013
  };
@@ -3097,7 +3079,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3097
3079
  removeClass(highlightedItem, dropDownListClasses.focus);
3098
3080
  }
3099
3081
  };
3100
- DropDownList.prototype.renderPopup = function () {
3082
+ DropDownList.prototype.renderPopup = function (e) {
3101
3083
  var _this = this;
3102
3084
  if (this.popupObj && document.body.contains(this.popupObj.element)) {
3103
3085
  this.refreshPopup();
@@ -3200,7 +3182,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3200
3182
  var animModel = { name: 'FadeIn', duration: 100 };
3201
3183
  _this.beforePopupOpen = true;
3202
3184
  var popupInstance = _this.popupObj;
3203
- var eventArgs = { popup: popupInstance, cancel: false, animation: animModel };
3185
+ var eventArgs = { popup: popupInstance, event: e, cancel: false, animation: animModel };
3204
3186
  _this.trigger('open', eventArgs, function (eventArgs) {
3205
3187
  if (!eventArgs.cancel) {
3206
3188
  addClass([_this.inputWrapper.container], [dropDownListClasses.iconAnimation]);
@@ -3522,14 +3504,14 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3522
3504
  if (this.element.tagName === 'INPUT') {
3523
3505
  this.inputElement = this.element;
3524
3506
  if (isNullOrUndefined(this.inputElement.getAttribute('role'))) {
3525
- this.inputElement.setAttribute('role', 'textbox');
3507
+ this.inputElement.setAttribute('role', 'combobox');
3526
3508
  }
3527
3509
  if (isNullOrUndefined(this.inputElement.getAttribute('type'))) {
3528
3510
  this.inputElement.setAttribute('type', 'text');
3529
3511
  }
3530
3512
  }
3531
3513
  else {
3532
- this.inputElement = this.createElement('input', { attrs: { role: 'textbox', type: 'text' } });
3514
+ this.inputElement = this.createElement('input', { attrs: { role: 'combobox', type: 'text' } });
3533
3515
  if (this.element.tagName !== this.getNgDirective()) {
3534
3516
  this.element.style.display = 'none';
3535
3517
  }
@@ -3578,6 +3560,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3578
3560
  attributes(this.targetElement(), this.getAriaAttributes());
3579
3561
  this.updateDataAttribute(this.htmlAttributes);
3580
3562
  this.setHTMLAttributes();
3563
+ if (this.targetElement() === this.inputElement) {
3564
+ this.element.removeAttribute('aria-labelledby');
3565
+ }
3581
3566
  if (this.value !== null || this.activeIndex !== null || this.text !== null) {
3582
3567
  this.initValue();
3583
3568
  }
@@ -3613,7 +3598,12 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3613
3598
  DropDownList.prototype.setFooterTemplate = function (popupEle) {
3614
3599
  var compiledString;
3615
3600
  if (this.footer) {
3616
- this.footer.innerHTML = '';
3601
+ if (this.isReact) {
3602
+ this.clearTemplate(['footerTemplate']);
3603
+ }
3604
+ else {
3605
+ this.footer.innerHTML = '';
3606
+ }
3617
3607
  }
3618
3608
  else {
3619
3609
  this.footer = this.createElement('div');
@@ -3805,6 +3795,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3805
3795
  }
3806
3796
  });
3807
3797
  }
3798
+ else if (this_1.getModuleName() === 'autocomplete') {
3799
+ this_1.setInputValue(newProp, oldProp);
3800
+ }
3808
3801
  else {
3809
3802
  this_1.setOldText(oldProp.text);
3810
3803
  }
@@ -3846,6 +3839,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3846
3839
  }
3847
3840
  });
3848
3841
  }
3842
+ else if (this_1.getModuleName() === 'autocomplete') {
3843
+ this_1.setInputValue(newProp, oldProp);
3844
+ }
3849
3845
  else {
3850
3846
  this_1.setOldValue(oldProp.value);
3851
3847
  }
@@ -3964,6 +3960,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3964
3960
  removeClass([this.inputWrapper.container], ['e-readonly']);
3965
3961
  }
3966
3962
  };
3963
+ DropDownList.prototype.setInputValue = function (newProp, oldProp) {
3964
+ };
3967
3965
  DropDownList.prototype.setCssClass = function (newClass, oldClass) {
3968
3966
  if (!isNullOrUndefined(oldClass)) {
3969
3967
  oldClass = (oldClass.replace(/\s+/g, ' ')).trim();
@@ -3990,7 +3988,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3990
3988
  *
3991
3989
  * @returns {void}
3992
3990
  */
3993
- DropDownList.prototype.showPopup = function () {
3991
+ DropDownList.prototype.showPopup = function (e) {
3994
3992
  if (!this.enabled) {
3995
3993
  return;
3996
3994
  }
@@ -4010,11 +4008,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4010
4008
  }
4011
4009
  else if (isNullOrUndefined(this.list) || !isUndefined(this.list) && (this.list.classList.contains(dropDownBaseClasses.noData) ||
4012
4010
  this.list.querySelectorAll('.' + dropDownBaseClasses.li).length <= 0)) {
4013
- this.renderList();
4011
+ this.renderList(e);
4014
4012
  }
4015
- this.invokeRenderPopup();
4013
+ this.invokeRenderPopup(e);
4016
4014
  };
4017
- DropDownList.prototype.invokeRenderPopup = function () {
4015
+ DropDownList.prototype.invokeRenderPopup = function (e) {
4018
4016
  if (Browser.isDevice && this.isFilterLayout()) {
4019
4017
  // eslint-disable-next-line @typescript-eslint/no-this-alias
4020
4018
  var proxy_2 = this;
@@ -4024,7 +4022,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4024
4022
  history.pushState({}, '');
4025
4023
  }
4026
4024
  if (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData)) {
4027
- this.renderPopup();
4025
+ this.renderPopup(e);
4028
4026
  }
4029
4027
  attributes(this.targetElement(), { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
4030
4028
  };
@@ -7817,7 +7815,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
7817
7815
  }
7818
7816
  };
7819
7817
  ComboBox.prototype.incrementalSearch = function (e) {
7820
- this.showPopup();
7818
+ this.showPopup(e);
7821
7819
  if (!isNullOrUndefined(this.listData)) {
7822
7820
  this.inlineSearch(e);
7823
7821
  e.preventDefault();
@@ -8080,8 +8078,8 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
8080
8078
  * @returns {void}
8081
8079
  * @deprecated
8082
8080
  */
8083
- ComboBox.prototype.showPopup = function () {
8084
- _super.prototype.showPopup.call(this);
8081
+ ComboBox.prototype.showPopup = function (e) {
8082
+ _super.prototype.showPopup.call(this, e);
8085
8083
  };
8086
8084
  /* eslint-disable valid-jsdoc, jsdoc/require-param */
8087
8085
  /**
@@ -8318,10 +8316,10 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8318
8316
  * @private
8319
8317
  */
8320
8318
  function AutoComplete(options, element) {
8321
- var _this = _super.call(this, options, element) || this;
8322
- _this.isFiltered = false;
8323
- _this.searchList = false;
8324
- return _this;
8319
+ var _this_1 = _super.call(this, options, element) || this;
8320
+ _this_1.isFiltered = false;
8321
+ _this_1.searchList = false;
8322
+ return _this_1;
8325
8323
  }
8326
8324
  /**
8327
8325
  * Initialize the event handler
@@ -8369,17 +8367,17 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8369
8367
  return filterQuery;
8370
8368
  };
8371
8369
  AutoComplete.prototype.searchLists = function (e) {
8372
- var _this = this;
8370
+ var _this_1 = this;
8373
8371
  this.isTyped = true;
8374
8372
  this.isDataFetched = this.isSelectCustom = false;
8375
8373
  if (isNullOrUndefined(this.list)) {
8376
- _super.prototype.renderList.call(this, true);
8374
+ _super.prototype.renderList.call(this, e, true);
8377
8375
  }
8378
8376
  this.queryString = this.filterInput.value;
8379
8377
  if (e.type !== 'mousedown' && (e.keyCode === 40 || e.keyCode === 38)) {
8380
8378
  this.queryString = this.queryString === '' ? null : this.queryString;
8381
8379
  this.beforePopupOpen = true;
8382
- this.resetList(this.dataSource, this.fields);
8380
+ this.resetList(this.dataSource, this.fields, null, e);
8383
8381
  return;
8384
8382
  }
8385
8383
  this.isSelected = false;
@@ -8391,15 +8389,15 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8391
8389
  if (eventArgs.cancel) {
8392
8390
  return;
8393
8391
  }
8394
- _this.isFiltered = true;
8395
- _this.filterAction(dataSource, query, fields);
8392
+ _this_1.isFiltered = true;
8393
+ _this_1.filterAction(dataSource, query, fields);
8396
8394
  },
8397
8395
  cancel: false
8398
8396
  };
8399
8397
  this.trigger('filtering', eventArgs, function (eventArgs) {
8400
- if (!eventArgs.cancel && !_this.isFiltered && !eventArgs.preventDefaultAction) {
8401
- _this.searchList = true;
8402
- _this.filterAction(_this.dataSource, null, _this.fields);
8398
+ if (!eventArgs.cancel && !_this_1.isFiltered && !eventArgs.preventDefaultAction) {
8399
+ _this_1.searchList = true;
8400
+ _this_1.filterAction(_this_1.dataSource, null, _this_1.fields, e);
8403
8401
  }
8404
8402
  });
8405
8403
  };
@@ -8416,13 +8414,13 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8416
8414
  this.isFiltered = true;
8417
8415
  this.filterAction(dataSource, query, fields);
8418
8416
  };
8419
- AutoComplete.prototype.filterAction = function (dataSource, query, fields) {
8417
+ AutoComplete.prototype.filterAction = function (dataSource, query, fields, e) {
8420
8418
  this.beforePopupOpen = true;
8421
8419
  if (this.queryString !== '' && (this.queryString.length >= this.minLength)) {
8422
- this.resetList(dataSource, fields, query);
8420
+ this.resetList(dataSource, fields, query, e);
8423
8421
  }
8424
8422
  else {
8425
- this.hidePopup();
8423
+ this.hidePopup(e);
8426
8424
  this.beforePopupOpen = false;
8427
8425
  }
8428
8426
  this.renderReactTemplates();
@@ -8479,18 +8477,18 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8479
8477
  }
8480
8478
  };
8481
8479
  AutoComplete.prototype.listOption = function (dataSource, fieldsSettings) {
8482
- var _this = this;
8480
+ var _this_1 = this;
8483
8481
  var fields = _super.prototype.listOption.call(this, dataSource, fieldsSettings);
8484
8482
  if (isNullOrUndefined(fields.itemCreated)) {
8485
8483
  fields.itemCreated = function (e) {
8486
- if (_this.highlight) {
8487
- if (_this.element.tagName === _this.getNgDirective() && _this.itemTemplate) {
8484
+ if (_this_1.highlight) {
8485
+ if (_this_1.element.tagName === _this_1.getNgDirective() && _this_1.itemTemplate) {
8488
8486
  setTimeout(function () {
8489
- highlightSearch(e.item, _this.queryString, _this.ignoreCase, _this.filterType);
8487
+ highlightSearch(e.item, _this_1.queryString, _this_1.ignoreCase, _this_1.filterType);
8490
8488
  }, 0);
8491
8489
  }
8492
8490
  else {
8493
- highlightSearch(e.item, _this.queryString, _this.ignoreCase, _this.filterType);
8491
+ highlightSearch(e.item, _this_1.queryString, _this_1.ignoreCase, _this_1.filterType);
8494
8492
  }
8495
8493
  }
8496
8494
  };
@@ -8498,10 +8496,10 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8498
8496
  else {
8499
8497
  var itemCreated_1 = fields.itemCreated;
8500
8498
  fields.itemCreated = function (e) {
8501
- if (_this.highlight) {
8502
- highlightSearch(e.item, _this.queryString, _this.ignoreCase, _this.filterType);
8499
+ if (_this_1.highlight) {
8500
+ highlightSearch(e.item, _this_1.queryString, _this_1.ignoreCase, _this_1.filterType);
8503
8501
  }
8504
- itemCreated_1.apply(_this, [e]);
8502
+ itemCreated_1.apply(_this_1, [e]);
8505
8503
  };
8506
8504
  }
8507
8505
  return fields;
@@ -8509,9 +8507,9 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8509
8507
  AutoComplete.prototype.isFiltering = function () {
8510
8508
  return true;
8511
8509
  };
8512
- AutoComplete.prototype.renderPopup = function () {
8510
+ AutoComplete.prototype.renderPopup = function (e) {
8513
8511
  this.list.scrollTop = 0;
8514
- _super.prototype.renderPopup.call(this);
8512
+ _super.prototype.renderPopup.call(this, e);
8515
8513
  };
8516
8514
  AutoComplete.prototype.isEditTextBox = function () {
8517
8515
  return true && this.inputElement.value.trim() !== '';
@@ -8523,13 +8521,37 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8523
8521
  AutoComplete.prototype.isSelectFocusItem = function (element) {
8524
8522
  return false;
8525
8523
  };
8524
+ AutoComplete.prototype.setInputValue = function (newProp, oldProp) {
8525
+ var oldValue = oldProp && oldProp.text ? oldProp.text : oldProp ? oldProp.value : oldProp;
8526
+ var value = newProp && newProp.text ? newProp.text : newProp && newProp.value ? newProp.value : this.value;
8527
+ if (value && this.typedString === '' && !this.allowCustom && !(this.dataSource instanceof DataManager)) {
8528
+ var checkFields_1_1 = this.typeOfData(this.dataSource).typeof === 'string' ? '' : this.fields.value;
8529
+ var listLength_1 = this.getItems().length;
8530
+ var query = new Query();
8531
+ var _this_2 = this;
8532
+ new DataManager(this.dataSource).executeQuery(query.where(new Predicate(checkFields_1_1, 'equal', value)))
8533
+ .then(function (e) {
8534
+ if (e.result.length > 0) {
8535
+ _this_2.value = checkFields_1_1 !== '' ? e.result[0][_this_2.fields.value].toString() : e.result[0].toString();
8536
+ _this_2.addItem(e.result, listLength_1);
8537
+ _this_2.updateValues();
8538
+ }
8539
+ else {
8540
+ newProp && newProp.text ? _this_2.setOldText(oldValue) : newProp && newProp.value ? _this_2.setOldValue(oldValue) : _this_2.updateValues();
8541
+ }
8542
+ });
8543
+ }
8544
+ else if (newProp) {
8545
+ newProp.text ? this.setOldText(oldValue) : this.setOldValue(oldValue);
8546
+ }
8547
+ };
8526
8548
  /**
8527
8549
  * Search the entered text and show it in the suggestion list if available.
8528
8550
  *
8529
8551
  * @returns {void}
8530
8552
  * @deprecated
8531
8553
  */
8532
- AutoComplete.prototype.showPopup = function () {
8554
+ AutoComplete.prototype.showPopup = function (e) {
8533
8555
  if (!this.enabled) {
8534
8556
  return;
8535
8557
  }
@@ -8540,10 +8562,10 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
8540
8562
  this.beforePopupOpen = true;
8541
8563
  this.preventAutoFill = true;
8542
8564
  if (isNullOrUndefined(this.list)) {
8543
- this.renderList();
8565
+ this.renderList(e);
8544
8566
  }
8545
8567
  else {
8546
- this.resetList(this.dataSource, this.fields);
8568
+ this.resetList(this.dataSource, this.fields, null, e);
8547
8569
  }
8548
8570
  };
8549
8571
  /**
@@ -9045,7 +9067,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9045
9067
  }
9046
9068
  }
9047
9069
  };
9048
- MultiSelect.prototype.onPopupShown = function () {
9070
+ MultiSelect.prototype.onPopupShown = function (e) {
9049
9071
  var _this = this;
9050
9072
  if (Browser.isDevice && (this.mode === 'CheckBox' && this.allowFiltering)) {
9051
9073
  // eslint-disable-next-line @typescript-eslint/no-this-alias
@@ -9057,7 +9079,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9057
9079
  history.pushState({}, '');
9058
9080
  }
9059
9081
  var animModel = { name: 'FadeIn', duration: 100 };
9060
- var eventArgs = { popup: this.popupObj, cancel: false, animation: animModel };
9082
+ var eventArgs = { popup: this.popupObj, event: e, cancel: false, animation: animModel };
9061
9083
  this.trigger('open', eventArgs, function (eventArgs) {
9062
9084
  if (!eventArgs.cancel) {
9063
9085
  _this.focusAtFirstListItem();
@@ -9281,7 +9303,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9281
9303
  this.renderPopup();
9282
9304
  if (this.beforePopupOpen) {
9283
9305
  this.beforePopupOpen = false;
9284
- this.onPopupShown();
9306
+ this.onPopupShown(e);
9285
9307
  }
9286
9308
  };
9287
9309
  MultiSelect.prototype.refreshSelection = function () {
@@ -9573,7 +9595,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9573
9595
  }
9574
9596
  if (!this.isPopupOpen() &&
9575
9597
  (this.openOnClick || (this.showDropDownIcon && e.target && e.target.className === dropdownIcon))) {
9576
- this.showPopup();
9598
+ this.showPopup(e);
9577
9599
  }
9578
9600
  else {
9579
9601
  this.hidePopup(e);
@@ -9867,7 +9889,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
9867
9889
  break;
9868
9890
  case 40:
9869
9891
  if (!this.isPopupOpen()) {
9870
- this.showPopup();
9892
+ this.showPopup(e);
9871
9893
  e.preventDefault();
9872
9894
  }
9873
9895
  break;
@@ -11058,7 +11080,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11058
11080
  this.keyCode = e.keyCode;
11059
11081
  }
11060
11082
  if (!this.isPopupOpen() && this.openOnClick) {
11061
- this.showPopup();
11083
+ this.showPopup(e);
11062
11084
  }
11063
11085
  this.openClick(e);
11064
11086
  if (this.checkTextLength() && !this.allowFiltering && !isNullOrUndefined(e) && (e.keyCode !== 8)) {
@@ -11205,7 +11227,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11205
11227
  || this.list.querySelector('.e-ul') && this.list.querySelector('.e-ul').childElementCount === 0)) {
11206
11228
  isEmptyData = true;
11207
11229
  }
11208
- _super.prototype.render.call(this, isEmptyData);
11230
+ _super.prototype.render.call(this, null, isEmptyData);
11209
11231
  this.unwireListEvents();
11210
11232
  this.wireListEvents();
11211
11233
  };
@@ -12478,7 +12500,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12478
12500
  *
12479
12501
  * @returns {void}
12480
12502
  */
12481
- MultiSelect.prototype.showPopup = function () {
12503
+ MultiSelect.prototype.showPopup = function (e) {
12482
12504
  var _this = this;
12483
12505
  if (!this.enabled) {
12484
12506
  return;
@@ -12488,7 +12510,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12488
12510
  if (!args.cancel) {
12489
12511
  if (!_this.ulElement) {
12490
12512
  _this.beforePopupOpen = true;
12491
- _super.prototype.render.call(_this);
12513
+ _super.prototype.render.call(_this, e);
12492
12514
  if (_this.mode === 'CheckBox' && Browser.isDevice && _this.allowFiltering) {
12493
12515
  _this.notify('popupFullScreen', { module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox' });
12494
12516
  }
@@ -12504,7 +12526,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12504
12526
  _this.beforePopupOpen = false;
12505
12527
  return;
12506
12528
  }
12507
- _this.onPopupShown();
12529
+ _this.onPopupShown(e);
12508
12530
  }
12509
12531
  });
12510
12532
  };
@@ -12611,7 +12633,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12611
12633
  });
12612
12634
  if (this.mode === 'Default' || this.mode === 'Box') {
12613
12635
  this.inputElement.setAttribute('aria-describedby', this.chipCollectionWrapper.id);
12614
- this.inputElement.setAttribute('aria-labelledby', this.chipCollectionWrapper.id);
12615
12636
  }
12616
12637
  if (this.element.tagName !== this.getNgDirective()) {
12617
12638
  this.element.style.display = 'none';
@@ -13707,8 +13728,8 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
13707
13728
  });
13708
13729
  }
13709
13730
  };
13710
- ListBox.prototype.updateActionCompleteData = function (li, item) {
13711
- this.jsonData.push(item);
13731
+ ListBox.prototype.updateActionCompleteData = function (li, item, index) {
13732
+ this.jsonData.splice(index, 0, item);
13712
13733
  };
13713
13734
  ListBox.prototype.initToolbar = function () {
13714
13735
  var pos = this.toolbarSettings.position;
@@ -14253,7 +14274,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
14253
14274
  var objValue = void 0;
14254
14275
  var dupData = [];
14255
14276
  var itemIdx = void 0;
14256
- extend(dupData, [], this.listData);
14277
+ extend(dupData, [], this.jsonData);
14257
14278
  var removeIdxes = [];
14258
14279
  var removeLiIdxes = [];
14259
14280
  for (var j = 0; j < items.length; j++) {
@@ -15040,9 +15061,8 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
15040
15061
  fListBox.value = [];
15041
15062
  listData = listData
15042
15063
  .filter(function (data) { return data.isHeader !== true; });
15043
- tListBox.listData = listData;
15044
- tListBox.jsonData = jsonData;
15045
- if (this.listData.length == this.jsonData.length) {
15064
+ tListBox.listData = tListBox.jsonData = listData;
15065
+ if (fListBox.listData.length == fListBox.jsonData.length) {
15046
15066
  fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
15047
15067
  }
15048
15068
  else if (this.allowFiltering) {