@syncfusion/ej2-dropdowns 24.2.3 → 24.2.5

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.
@@ -924,7 +924,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
924
924
  }
925
925
  }
926
926
  else {
927
- if (noDataElement[i] instanceof HTMLElement) {
927
+ if (noDataElement[i] instanceof HTMLElement || noDataElement[i] instanceof Text) {
928
928
  ele.appendChild(noDataElement[i]);
929
929
  }
930
930
  }
@@ -3445,6 +3445,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3445
3445
  if (this.inputWrapper.container.classList.contains(dropDownListClasses.inputFocus) || this.isPopupOpen) {
3446
3446
  this.isDocumentClick = true;
3447
3447
  var isActive = this.isRequested;
3448
+ if (this.getModuleName() === 'combobox' && this.isTyped) {
3449
+ this.isInteracted = false;
3450
+ }
3448
3451
  this.hidePopup(e);
3449
3452
  this.isInteracted = false;
3450
3453
  if (!isActive) {
@@ -4133,6 +4136,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4133
4136
  this.virtualListInfo = null;
4134
4137
  }
4135
4138
  this.resetList(dataSource, fields, query);
4139
+ if (this.getModuleName() === 'dropdownlist' && this.list.classList.contains(dropDownBaseClasses.noData)) {
4140
+ this.popupContentElement.setAttribute('role', 'status');
4141
+ this.popupContentElement.setAttribute('id', 'no-record');
4142
+ attributes(this.filterInputObj.container, { 'aria-activedescendant': 'no-record' });
4143
+ }
4136
4144
  if (this.enableVirtualization && isNoData && !this.list.classList.contains(dropDownBaseClasses.noData)) {
4137
4145
  if (!this.list.querySelector('.e-virtual-ddl-content')) {
4138
4146
  this.list.appendChild(this.createElement('div', {
@@ -4681,6 +4689,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4681
4689
  }, 5);
4682
4690
  }
4683
4691
  attributes(_this.targetElement(), { 'aria-expanded': 'true', 'aria-owns': _this.element.id + '_popup', 'aria-controls': _this.element.id });
4692
+ if (_this.getModuleName() !== 'dropdownlist' && _this.list.classList.contains('e-nodata')) {
4693
+ attributes(_this.targetElement(), { 'aria-activedescendant': 'no-record' });
4694
+ _this.popupContentElement.setAttribute('role', 'status');
4695
+ _this.popupContentElement.setAttribute('id', 'no-record');
4696
+ }
4684
4697
  _this.inputElement.setAttribute('aria-expanded', 'true');
4685
4698
  _this.inputElement.setAttribute('aria-controls', _this.element.id);
4686
4699
  var inputParent = _this.isFiltering() ? _this.filterInput.parentElement : _this.inputWrapper.container;
@@ -5981,6 +5994,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5981
5994
  this.clearTemplate();
5982
5995
  }
5983
5996
  this.hidePopup();
5997
+ if (this.popupObj) {
5998
+ this.popupObj.hide();
5999
+ }
5984
6000
  this.unWireEvent();
5985
6001
  if (this.list) {
5986
6002
  this.unWireListEvents();
@@ -8094,9 +8110,6 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
8094
8110
  if (this.value === null) {
8095
8111
  this.setProperties({ value: [] }, true);
8096
8112
  }
8097
- if (args.node.classList.contains("e-active")) {
8098
- this.hidePopup();
8099
- }
8100
8113
  }
8101
8114
  };
8102
8115
  DropDownTree.prototype.updateHiddenValue = function () {
@@ -11375,6 +11388,11 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11375
11388
  }
11376
11389
  };
11377
11390
  MultiSelect.prototype.removelastSelection = function (e) {
11391
+ var selectedElem = this.chipCollectionWrapper.querySelector('span.' + CHIP_SELECTED);
11392
+ if (selectedElem !== null) {
11393
+ this.removeSelectedChip(e);
11394
+ return;
11395
+ }
11378
11396
  var elements = this.chipCollectionWrapper.querySelectorAll('span.' + CHIP$1);
11379
11397
  var value = elements[elements.length - 1].getAttribute('data-value');
11380
11398
  if (!isNullOrUndefined(this.value)) {
@@ -11451,6 +11469,12 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11451
11469
  else {
11452
11470
  this.updateActionList(ulElement, list, e);
11453
11471
  }
11472
+ if (this.dataSource instanceof DataManager && this.allowCustomValue && !this.isCustomRendered && this.inputElement.value && this.inputElement.value !== '') {
11473
+ var query = new Query();
11474
+ query = this.allowFiltering ? query.where(this.fields.text, 'startswith', this.inputElement.value, this.ignoreCase, this.ignoreAccent) : query;
11475
+ this.checkForCustomValue(query, this.fields);
11476
+ this.isCustomRendered = true;
11477
+ }
11454
11478
  if (this.dataSource instanceof DataManager && this.mode === 'CheckBox' && this.allowFiltering) {
11455
11479
  this.removeFocus();
11456
11480
  }
@@ -11472,7 +11496,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11472
11496
  if ((this.remoteCustomValue || list.length <= 0) && this.allowCustomValue && this.inputFocus && this.allowFiltering &&
11473
11497
  this.inputElement.value && this.inputElement.value !== '') {
11474
11498
  this.checkForCustomValue(this.tempQuery, this.fields);
11475
- return;
11499
+ if (this.isCustomRendered) {
11500
+ return;
11501
+ }
11476
11502
  }
11477
11503
  if (this.value && this.value.length && ((this.mode !== 'CheckBox' && !isNullOrUndefined(this.inputElement) && this.inputElement.value.trim() !== '') ||
11478
11504
  this.mode === 'CheckBox' || ((this.keyCode === 8 || this.keyCode === 46) && this.allowFiltering &&
@@ -11739,12 +11765,12 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11739
11765
  };
11740
11766
  MultiSelect.prototype.checkForCustomValue = function (query, fields) {
11741
11767
  var dataChecks = !this.getValueByText(this.inputElement.value, this.ignoreCase);
11768
+ var field = fields ? fields : this.fields;
11742
11769
  if (this.allowCustomValue && dataChecks) {
11743
11770
  var value = this.inputElement.value;
11744
- var field = fields ? fields : this.fields;
11745
11771
  var customData = (!isNullOrUndefined(this.mainData) && this.mainData.length > 0) ?
11746
11772
  this.mainData[0] : this.mainData;
11747
- if (typeof (customData) !== 'string' && typeof (customData) !== 'number' && typeof (customData) !== 'boolean') {
11773
+ if (customData && typeof (customData) !== 'string' && typeof (customData) !== 'number' && typeof (customData) !== 'boolean') {
11748
11774
  var dataItem = {};
11749
11775
  setValue(field.text, value, dataItem);
11750
11776
  if (typeof getValue((this.fields.value ? this.fields.value : 'value'), customData)
@@ -11758,7 +11784,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11758
11784
  tempData.splice(0, 0, dataItem);
11759
11785
  this.resetList(tempData, field, query);
11760
11786
  }
11761
- else {
11787
+ else if (this.listData) {
11762
11788
  var tempData = JSON.parse(JSON.stringify(this.listData));
11763
11789
  tempData.splice(0, 0, this.inputElement.value);
11764
11790
  tempData[0] = (typeof customData === 'number' && !isNaN(parseFloat(tempData[0]))) ?
@@ -11768,6 +11794,19 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
11768
11794
  this.resetList(tempData, field);
11769
11795
  }
11770
11796
  }
11797
+ else if (this.listData && this.mainData && !dataChecks && this.allowCustomValue) {
11798
+ if (this.allowFiltering && this.isRemoteSelection && this.remoteCustomValue) {
11799
+ this.isRemoteSelection = false;
11800
+ this.resetList(this.listData, field, query);
11801
+ }
11802
+ else if (!this.allowFiltering && this.list) {
11803
+ var liCollections = this.list.querySelectorAll('li.' + dropDownBaseClasses.li + ':not(.e-hide-listitem)');
11804
+ var activeElement = Search(this.targetElement(), liCollections, 'StartsWith', this.ignoreCase);
11805
+ if (activeElement && activeElement.item !== null) {
11806
+ this.addListFocus(activeElement.item);
11807
+ }
11808
+ }
11809
+ }
11771
11810
  if (this.value && this.value.length) {
11772
11811
  this.refreshSelection();
11773
11812
  }
@@ -13395,6 +13434,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
13395
13434
  else {
13396
13435
  var text = this.targetElement();
13397
13436
  if (this.allowFiltering) {
13437
+ if (this.allowCustomValue) {
13438
+ this.isRemoteSelection = true;
13439
+ }
13398
13440
  var eventArgs_1 = {
13399
13441
  preventDefaultAction: false,
13400
13442
  text: this.targetElement(),
@@ -13420,7 +13462,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
13420
13462
  }
13421
13463
  else if (this.allowCustomValue) {
13422
13464
  var query = new Query();
13423
- query = (text !== '') ? query.where(this.fields.text, 'startswith', text, this.ignoreCase, this.ignoreAccent) : query;
13465
+ query = this.allowFiltering && (text !== '') ? query.where(this.fields.text, 'startswith', text, this.ignoreCase, this.ignoreAccent) : query;
13424
13466
  this.dataUpdater(this.mainData, query, this.fields);
13425
13467
  }
13426
13468
  else {
@@ -13462,6 +13504,8 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
13462
13504
  this.focused = true;
13463
13505
  this.initial = true;
13464
13506
  this.backCommand = true;
13507
+ this.isCustomRendered = false;
13508
+ this.isRemoteSelection = false;
13465
13509
  };
13466
13510
  MultiSelect.prototype.updateData = function (delimiterChar, e) {
13467
13511
  var data = '';
@@ -13504,7 +13548,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
13504
13548
  if (delim) {
13505
13549
  this.updateWrapperText(this.delimiterWrapper, data);
13506
13550
  this.delimiterWrapper.setAttribute('id', getUniqueID('delim_val'));
13507
- this.inputElement.setAttribute('aria-labelledby', this.delimiterWrapper.id);
13551
+ this.inputElement.setAttribute('aria-describedby', this.delimiterWrapper.id);
13508
13552
  }
13509
13553
  var targetEle = e && e.target;
13510
13554
  var isClearAll = (targetEle && targetEle.classList.contains('e-close-hooker')) ? true : null;
@@ -14478,7 +14522,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
14478
14522
  this.hiddenElement.innerHTML = hiddenValue;
14479
14523
  this.updateWrapperText(this.delimiterWrapper, wrapperText);
14480
14524
  this.delimiterWrapper.setAttribute('id', getUniqueID('delim_val'));
14481
- this.inputElement.setAttribute('aria-labelledby', this.delimiterWrapper.id);
14525
+ this.inputElement.setAttribute('aria-describedby', this.delimiterWrapper.id);
14482
14526
  this.setProperties({ text: text.toString() }, true);
14483
14527
  this.refreshInputHight();
14484
14528
  this.refreshPlaceHolder();
@@ -14994,7 +15038,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
14994
15038
  }
14995
15039
  });
14996
15040
  if (this.mode === 'Default' || this.mode === 'Box') {
14997
- this.inputElement.setAttribute('aria-labelledby', this.chipCollectionWrapper.id);
15041
+ this.inputElement.setAttribute('aria-describedby', this.chipCollectionWrapper.id);
14998
15042
  }
14999
15043
  if (this.element.tagName !== this.getNgDirective()) {
15000
15044
  this.element.style.display = 'none';
@@ -15243,7 +15287,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
15243
15287
  Property(true)
15244
15288
  ], MultiSelect.prototype, "enabled", void 0);
15245
15289
  __decorate$5([
15246
- Property(false)
15290
+ Property(true)
15247
15291
  ], MultiSelect.prototype, "enableHtmlSanitizer", void 0);
15248
15292
  __decorate$5([
15249
15293
  Property([])
@@ -16041,6 +16085,13 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
16041
16085
  * @returns {void}
16042
16086
  */
16043
16087
  ListBox.prototype.render = function () {
16088
+ if (this.isAngular && this.allowFiltering) {
16089
+ var originalElement = this.element;
16090
+ var clonedElement = originalElement.cloneNode(true);
16091
+ originalElement.parentNode.replaceChild(clonedElement, originalElement);
16092
+ this.element = clonedElement;
16093
+ setValue('ej2_instances', [this], this.element);
16094
+ }
16044
16095
  this.inputString = '';
16045
16096
  this.initLoad = true;
16046
16097
  this.isCustomFiltering = false;
@@ -18755,7 +18806,9 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
18755
18806
  }
18756
18807
  return;
18757
18808
  }
18758
- this.queryString = lastWordRange.replace(this.mentionChar, '');
18809
+ if (lastWordRange.includes(this.mentionChar)) {
18810
+ this.queryString = lastWordRange.replace(this.mentionChar, '');
18811
+ }
18759
18812
  if (this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0) &&
18760
18813
  this.queryString !== '' && e.keyCode !== 38 && e.keyCode !== 40 && !this.lineBreak) {
18761
18814
  this.searchLists(e);
@@ -19103,6 +19156,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
19103
19156
  _this.inputElement.parentElement.parentElement.classList.contains('e-richtexteditor')) {
19104
19157
  if (popupEle_1.firstElementChild && popupEle_1.firstElementChild.childElementCount > 0) {
19105
19158
  popupEle_1.firstElementChild.setAttribute('aria-owns', _this.inputElement.parentElement.parentElement.id);
19159
+ addClass([popupEle_1], 'e-rte-elements');
19106
19160
  }
19107
19161
  }
19108
19162
  if ((!_this.popupObj || !document.body.contains(_this.popupObj.element)) ||