@syncfusion/ej2-dropdowns 29.2.11 → 30.1.39

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.
Files changed (39) hide show
  1. package/.eslintrc.json +2 -0
  2. package/dist/ej2-dropdowns.min.js +2 -2
  3. package/dist/ej2-dropdowns.umd.min.js +2 -2
  4. package/dist/ej2-dropdowns.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-dropdowns.es2015.js +88 -45
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +90 -48
  8. package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
  9. package/dist/global/ej2-dropdowns.min.js +2 -2
  10. package/dist/global/ej2-dropdowns.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/license +1 -1
  13. package/package.json +8 -8
  14. package/src/auto-complete/auto-complete.d.ts +1 -1
  15. package/src/auto-complete/auto-complete.js +22 -22
  16. package/src/combo-box/combo-box.js +1 -1
  17. package/src/common/incremental-search.js +1 -1
  18. package/src/drop-down-list/drop-down-list.d.ts +1 -0
  19. package/src/drop-down-list/drop-down-list.js +21 -4
  20. package/src/drop-down-tree/drop-down-tree-model.d.ts +1 -1
  21. package/src/drop-down-tree/drop-down-tree.d.ts +1 -0
  22. package/src/drop-down-tree/drop-down-tree.js +10 -2
  23. package/src/mention/mention.d.ts +0 -1
  24. package/src/mention/mention.js +13 -10
  25. package/src/multi-select/multi-select.js +23 -9
  26. package/styles/bootstrap5-dark-lite.css +1 -1
  27. package/styles/bootstrap5-dark.css +1 -1
  28. package/styles/bootstrap5-lite.css +1 -1
  29. package/styles/bootstrap5.css +1 -1
  30. package/styles/drop-down-tree/_bootstrap5-definition.scss +1 -1
  31. package/styles/drop-down-tree/_material3-definition.scss +2 -2
  32. package/styles/drop-down-tree/bootstrap5-dark.css +1 -1
  33. package/styles/drop-down-tree/bootstrap5.css +1 -1
  34. package/styles/drop-down-tree/material3-dark.css +4 -4
  35. package/styles/drop-down-tree/material3.css +4 -4
  36. package/styles/material3-dark-lite.css +3 -3
  37. package/styles/material3-dark.css +4 -4
  38. package/styles/material3-lite.css +3 -3
  39. package/styles/material3.css +4 -4
@@ -136,7 +136,7 @@ function Search(inputVal, items, searchType, ignoreCase, dataSource, fields, typ
136
136
  var listItems = items;
137
137
  ignoreCase = ignoreCase !== undefined && ignoreCase !== null ? ignoreCase : true;
138
138
  var itemData = { item: null, index: null };
139
- if (inputVal && inputVal.length) {
139
+ if (inputVal && inputVal.length && items) {
140
140
  var strLength = inputVal.length;
141
141
  var queryStr = ignoreCase ? inputVal.toLocaleLowerCase() : inputVal;
142
142
  queryStr = escapeCharRegExp(queryStr);
@@ -3064,6 +3064,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
3064
3064
  DropDownList.prototype.initializeData = function () {
3065
3065
  this.isPopupOpen = false;
3066
3066
  this.isDocumentClick = false;
3067
+ this.isPopupRender = false;
3067
3068
  this.isInteracted = false;
3068
3069
  this.isFilterFocus = false;
3069
3070
  this.beforePopupOpen = false;
@@ -4396,7 +4397,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4396
4397
  e.preventDefault();
4397
4398
  }
4398
4399
  if (!this.readonly) {
4399
- if (this.isPopupOpen) {
4400
+ if (this.isPopupOpen || (this.popupObj && document.body.contains(this.popupObj.element) &&
4401
+ this.beforePopupOpen && this.isPopupRender)) {
4400
4402
  this.hidePopup(e);
4401
4403
  if (this.isFilterLayout()) {
4402
4404
  this.focusDropDown(e);
@@ -5279,6 +5281,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5279
5281
  }
5280
5282
  this.getInitialData = false;
5281
5283
  this.isReactTemplateUpdate = true;
5284
+ this.typedString = this.filterInput.value;
5282
5285
  this.searchLists(this.filterArgs);
5283
5286
  return;
5284
5287
  }
@@ -5560,10 +5563,21 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5560
5563
  document.body.appendChild(popupEle);
5561
5564
  popupEle.style.top = '0px';
5562
5565
  initialPopupHeight = popupEle.clientHeight;
5563
- if (_this.enableVirtualization && _this.itemTemplate) {
5566
+ if (_this.enableVirtualization && (_this.itemTemplate || _this.isAngular)) {
5564
5567
  var listitems = popupEle.querySelectorAll('li.e-list-item:not(.e-virtual-list)');
5565
- _this.listItemHeight = listitems.length > 0 ? Math.ceil(listitems[0].getBoundingClientRect().height) +
5566
- parseInt(window.getComputedStyle(listitems[0]).marginBottom, 10) : 0;
5568
+ var virtualListitems = popupEle.querySelectorAll('li.e-virtual-list');
5569
+ var listitemsHeight = listitems && listitems.length > 0 ?
5570
+ Math.ceil(listitems[0].getBoundingClientRect().height) +
5571
+ parseInt(window.getComputedStyle(listitems[0]).marginBottom, 10) : 0;
5572
+ var VirtualLiHeight = virtualListitems && virtualListitems.length > 0 ?
5573
+ Math.ceil(virtualListitems[0].getBoundingClientRect().height) +
5574
+ parseInt(window.getComputedStyle(virtualListitems[0]).marginBottom, 10) : 0;
5575
+ if (listitemsHeight !== VirtualLiHeight && virtualListitems && virtualListitems.length > 0) {
5576
+ virtualListitems.forEach(function (item) {
5577
+ item.parentNode.removeChild(item);
5578
+ });
5579
+ }
5580
+ _this.listItemHeight = listitemsHeight;
5567
5581
  }
5568
5582
  if (_this.enableVirtualization && !_this.list.classList.contains(dropDownBaseClasses.noData)) {
5569
5583
  _this.getSkeletonCount();
@@ -5726,6 +5740,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
5726
5740
  }
5727
5741
  if (!isNullOrUndefined(_this.popupObj)) {
5728
5742
  _this.popupObj.show(new Animation(eventArgs.animation), (_this.zIndex === 1000) ? _this.element : null);
5743
+ _this.isPopupRender = true;
5729
5744
  }
5730
5745
  if (_this.isReact) {
5731
5746
  setTimeout(function () {
@@ -6261,6 +6276,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
6261
6276
  _this.rippleFun();
6262
6277
  }
6263
6278
  if (_this.isPopupOpen) {
6279
+ _this.isPopupRender = false;
6264
6280
  _this.popupObj.hide(new Animation(eventArgs.animation));
6265
6281
  }
6266
6282
  else {
@@ -7278,6 +7294,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
7278
7294
  }
7279
7295
  this.hidePopup();
7280
7296
  if (this.popupObj) {
7297
+ this.isPopupRender = false;
7281
7298
  this.popupObj.hide();
7282
7299
  }
7283
7300
  this.unWireEvent();
@@ -8202,7 +8219,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
8202
8219
  if (this.isPopupOpen) {
8203
8220
  this.hidePopup();
8204
8221
  }
8205
- else {
8222
+ else if (!(e instanceof TouchEvent) && e.button !== 2) {
8206
8223
  this.focusIn(e);
8207
8224
  this.renderPopup();
8208
8225
  }
@@ -9193,6 +9210,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
9193
9210
  removeClass([_this.popupEle], DDTHIDEICON);
9194
9211
  _this.updatePopupHeight();
9195
9212
  _this.popupObj.refreshPosition();
9213
+ _this.checkCollision(_this.popupEle);
9196
9214
  if (!(_this.showSelectAll || _this.allowFiltering) && (!_this.popupDiv.classList.contains(NODATA)
9197
9215
  && _this.treeItems.length > 0)) {
9198
9216
  var focusedElement = _this.value != null && _this.text != null ? _this.treeObj.element.querySelector('[data-uid="' + _this.value[_this.value.length - 1] + '"]') : null;
@@ -9236,6 +9254,13 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
9236
9254
  }
9237
9255
  });
9238
9256
  };
9257
+ DropDownTree.prototype.checkCollision = function (popupEle) {
9258
+ var collision = isCollide(popupEle);
9259
+ if (collision.length > 0) {
9260
+ popupEle.style.marginTop = -parseInt(getComputedStyle(popupEle).marginTop, 10) + 'px';
9261
+ }
9262
+ this.popupObj.resolveCollision();
9263
+ };
9239
9264
  DropDownTree.prototype.removeFocus = function (focusedElement, oldFocusedElement) {
9240
9265
  if (oldFocusedElement && oldFocusedElement !== focusedElement) {
9241
9266
  oldFocusedElement.setAttribute('tabindex', '-1');
@@ -11969,7 +11994,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
11969
11994
  this.removeFillSelection();
11970
11995
  }
11971
11996
  var dataItem = this.isSelectCustom ? { text: '' } : this.getItemData();
11972
- var text = !isNullOrUndefined(dataItem.text) ? dataItem.text.replace(/\r\n|\n|\r/g, '') : dataItem.text;
11997
+ var text = !isNullOrUndefined(dataItem.text) ? dataItem.text.toString().replace(/\r\n|\n|\r/g, '') : dataItem.text;
11973
11998
  var selected = !isNullOrUndefined(this.list) ? this.list.querySelector('.' + dropDownListClasses.selected) : null;
11974
11999
  if (this.inputElement && text === this.inputElement.value && !isNullOrUndefined(selected)) {
11975
12000
  if (this.isSelected) {
@@ -12294,6 +12319,28 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
12294
12319
  }
12295
12320
  return filterQuery;
12296
12321
  };
12322
+ AutoComplete.prototype.performFiltering = function (e) {
12323
+ var _this_1 = this;
12324
+ var eventArgs = {
12325
+ preventDefaultAction: false,
12326
+ text: this.filterInput ? this.filterInput.value : null,
12327
+ updateData: function (dataSource, query, fields) {
12328
+ if (eventArgs.cancel) {
12329
+ return;
12330
+ }
12331
+ _this_1.isFiltered = true;
12332
+ _this_1.customFilterQuery = query;
12333
+ _this_1.filterAction(dataSource, query, fields);
12334
+ },
12335
+ cancel: false
12336
+ };
12337
+ this.trigger('filtering', eventArgs, function (eventArgs) {
12338
+ if (!eventArgs.cancel && !_this_1.isFiltered && !eventArgs.preventDefaultAction) {
12339
+ _this_1.searchList = true;
12340
+ _this_1.filterAction(_this_1.dataSource, null, _this_1.fields, e);
12341
+ }
12342
+ });
12343
+ };
12297
12344
  AutoComplete.prototype.searchLists = function (e) {
12298
12345
  this.isTyped = true;
12299
12346
  this.isDataFetched = this.isSelectCustom = false;
@@ -12319,28 +12366,6 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
12319
12366
  this.performFiltering(e);
12320
12367
  }
12321
12368
  };
12322
- AutoComplete.prototype.performFiltering = function (e) {
12323
- var _this_1 = this;
12324
- var eventArgs = {
12325
- preventDefaultAction: false,
12326
- text: this.filterInput.value,
12327
- updateData: function (dataSource, query, fields) {
12328
- if (eventArgs.cancel) {
12329
- return;
12330
- }
12331
- _this_1.isFiltered = true;
12332
- _this_1.customFilterQuery = query;
12333
- _this_1.filterAction(dataSource, query, fields);
12334
- },
12335
- cancel: false
12336
- };
12337
- this.trigger('filtering', eventArgs, function (eventArgs) {
12338
- if (!eventArgs.cancel && !_this_1.isFiltered && !eventArgs.preventDefaultAction) {
12339
- _this_1.searchList = true;
12340
- _this_1.filterAction(_this_1.dataSource, null, _this_1.fields, e);
12341
- }
12342
- });
12343
- };
12344
12369
  /**
12345
12370
  * To filter the data from given data source by using query
12346
12371
  *
@@ -13372,7 +13397,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
13372
13397
  if (this.mode === 'CheckBox' && this.allowFiltering) {
13373
13398
  this.notify('targetElement', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
13374
13399
  }
13375
- return this.targetInputElement.value;
13400
+ return this.targetInputElement ? this.targetInputElement.value : null;
13376
13401
  };
13377
13402
  MultiSelect.prototype.getForQuery = function (valuecheck, isCheckbox) {
13378
13403
  var predicate;
@@ -13537,11 +13562,16 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
13537
13562
  if (!isNullOrUndefined(this.text) && (isNullOrUndefined(this.value) || this.value.length === 0)) {
13538
13563
  this.initialTextUpdate();
13539
13564
  }
13540
- if (!this.enableVirtualization || (this.enableVirtualization && (!(this.dataSource instanceof DataManager)))) {
13541
- this.initialValueUpdate();
13565
+ if (!this.enableVirtualization) {
13566
+ if (!this.isRemoveSelection) {
13567
+ this.initialValueUpdate(this.listData, true);
13568
+ }
13569
+ else {
13570
+ this.initialValueUpdate();
13571
+ }
13542
13572
  }
13543
- else if (!this.isRemoveSelection) {
13544
- this.initialValueUpdate(this.listData, true);
13573
+ else if (!(this.dataSource instanceof DataManager)) {
13574
+ this.initialValueUpdate();
13545
13575
  }
13546
13576
  this.initialUpdate();
13547
13577
  this.refreshPlaceHolder();
@@ -15700,7 +15730,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
15700
15730
  MultiSelect.prototype.dispatchSelect = function (value, eve, element, isNotTrigger, length, dataValue, text) {
15701
15731
  var _this = this;
15702
15732
  var list = this.listData;
15703
- if (this.initStatus && !isNotTrigger) {
15733
+ if (this.initStatus && !isNotTrigger && (!this.allowObjectBinding || (this.allowObjectBinding && value))) {
15704
15734
  value = this.allowObjectBinding ? getValue(((this.fields.value) ? this.fields.value : ''), value) : value;
15705
15735
  var val_2 = dataValue ? dataValue : this.getDataByValue(value);
15706
15736
  var eventArgs = {
@@ -16609,7 +16639,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16609
16639
  else {
16610
16640
  if (this_1.listData) {
16611
16641
  if (this_1.enableVirtualization) {
16612
- if (delim && !this_1.isDynamicRemoteVirtualData) {
16642
+ if (delim && !this_1.isDynamicRemoteVirtualData && !isInitialVirtualData) {
16613
16643
  data = this_1.delimiterWrapper && this_1.delimiterWrapper.innerHTML === '' ? data :
16614
16644
  this_1.delimiterWrapper.innerHTML;
16615
16645
  }
@@ -16621,7 +16651,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16621
16651
  text = this_1.text.split(delimiterChar);
16622
16652
  }
16623
16653
  else {
16624
- temp = isInitialVirtualData && delim ? this_1.text : this_1.getTextByValue(value);
16654
+ temp = isInitialVirtualData && delim ? this_1.text.replace(/,/g, delimiterChar + ' ') : this_1.getTextByValue(value);
16625
16655
  var textValues = this_1.isDynamicRemoteVirtualData && value != null && value !== '' && !isInitialVirtualData ?
16626
16656
  this_1.getTextByValue(value) : isInitialVirtualData ? this_1.text : (this_1.text && this_1.text !== '' ? this_1.text + this_1.delimiterChar + temp : temp);
16627
16657
  data += temp + delimiterChar + ' ';
@@ -16785,6 +16815,12 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
16785
16815
  text = this.getTextByValue(value);
16786
16816
  isCustomData = true;
16787
16817
  }
16818
+ else if ((isNullOrUndefined(text) && !this.allowCustomValue) &&
16819
+ ((!(this.dataSource instanceof DataManager)) ||
16820
+ (this.dataSource instanceof DataManager && isInitialVirtualData))) {
16821
+ this.value.splice(index, 1);
16822
+ index -= 1;
16823
+ }
16788
16824
  }
16789
16825
  else {
16790
16826
  text = this.getTextByValue(value);
@@ -18379,6 +18415,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
18379
18415
  this.isaddNonPresentItems = false;
18380
18416
  }
18381
18417
  else {
18418
+ this.selectedListData = [];
18382
18419
  if (prop === 'text') {
18383
18420
  this.initialTextUpdate();
18384
18421
  newProp = this.value;
@@ -18422,7 +18459,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
18422
18459
  setTimeout(function () {
18423
18460
  _this.initialValueUpdate(listItems_2, true);
18424
18461
  _this.isDynamicRemoteVirtualData = false;
18425
- _this.initialUpdate();
18462
+ if (!_this.inputFocus || (_this.inputFocus && _this.mode !== 'Default')) {
18463
+ _this.initialUpdate();
18464
+ }
18426
18465
  }, 100);
18427
18466
  }
18428
18467
  });
@@ -22802,9 +22841,7 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
22802
22841
  * @private
22803
22842
  */
22804
22843
  function Mention(options, element) {
22805
- var _this = _super.call(this, options, element) || this;
22806
- _this.debounceTimer = null;
22807
- return _this;
22844
+ return _super.call(this, options, element) || this;
22808
22845
  }
22809
22846
  /**
22810
22847
  * When property value changes happened, then onPropertyChanged method will execute the respective changes in this component.
@@ -23134,12 +23171,16 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
23134
23171
  var isValid = currentRange && mentionRegex.test(currentRange) ? false : true;
23135
23172
  var lastWordRange = this.getLastLetter(currentRange);
23136
23173
  var previousChar = currentRange ? currentRange.charAt(Math.max(0, currentRange.indexOf(this.mentionChar) - 1)) : '';
23137
- if (isValid && this.allowSpaces && currentRange && currentRange.includes(this.mentionChar) && currentRange.split(this.mentionChar).pop() !== ''
23138
- && (!this.requireLeadingSpace || (this.requireLeadingSpace && (previousChar === ' ' || currentRange.indexOf(this.mentionChar) === 0)))) {
23139
- lastWordRange = this.mentionChar + currentRange.split(this.mentionChar).pop();
23140
- }
23141
- if (!this.requireLeadingSpace && lastWordRange && lastWordRange.includes(this.mentionChar)) {
23142
- lastWordRange = this.mentionChar + lastWordRange.split(this.mentionChar).pop();
23174
+ if (!this.allowSpaces) {
23175
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
23176
+ if (isValid && currentRange && currentRange.includes(this.mentionChar) && currentRange.split(this.mentionChar).pop() !== ''
23177
+ && (!this.requireLeadingSpace || (this.requireLeadingSpace && (previousChar === ' ' || currentRange.indexOf(this.mentionChar) === 0)))) {
23178
+ lastWordRange = this.mentionChar + currentRange.split(this.mentionChar).pop();
23179
+ }
23180
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
23181
+ if (!this.requireLeadingSpace && lastWordRange && lastWordRange.includes(this.mentionChar)) {
23182
+ lastWordRange = this.mentionChar + lastWordRange.split(this.mentionChar).pop();
23183
+ }
23143
23184
  }
23144
23185
  var lastTwoLetters = this.mentionChar.toString() + this.mentionChar.toString();
23145
23186
  // eslint-disable-next-line security/detect-non-literal-regexp
@@ -23152,7 +23193,8 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
23152
23193
  this.hidePopup();
23153
23194
  return;
23154
23195
  }
23155
- if (((!currentRange || !lastWordRange) || (!lastWordRange.includes(this.mentionChar) && !this.requireLeadingSpace)) || e.code === 'Enter' || e.keyCode === 27 ||
23196
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
23197
+ if (((!currentRange || !lastWordRange) || (!lastWordRange.includes(this.mentionChar) && !this.requireLeadingSpace && !this.allowSpaces)) || e.code === 'Enter' || e.keyCode === 27 ||
23156
23198
  (lastWordRange.match(Regex) && lastWordRange.match(Regex).length > 1) ||
23157
23199
  (this.isContentEditable(this.inputElement) && this.range.startContainer &&
23158
23200
  this.range.startContainer.previousElementSibling && this.range.startContainer.previousElementSibling.tagName !== 'BR' && this.range.startContainer.textContent.split('').length > 0 &&