@syncfusion/ej2-dropdowns 29.1.38 → 29.1.40

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 (93) hide show
  1. package/dist/ej2-dropdowns.min.js +2 -2
  2. package/dist/ej2-dropdowns.umd.min.js +2 -2
  3. package/dist/ej2-dropdowns.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-dropdowns.es2015.js +54 -9
  5. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  6. package/dist/es6/ej2-dropdowns.es5.js +60 -15
  7. package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
  8. package/dist/global/ej2-dropdowns.min.js +2 -2
  9. package/dist/global/ej2-dropdowns.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +8 -8
  12. package/src/common/incremental-search.js +1 -1
  13. package/src/common/virtual-scroll.js +14 -6
  14. package/src/drop-down-base/drop-down-base.d.ts +2 -0
  15. package/src/drop-down-base/drop-down-base.js +27 -4
  16. package/src/mention/mention.js +6 -1
  17. package/src/multi-select/multi-select.d.ts +0 -1
  18. package/src/multi-select/multi-select.js +12 -3
  19. package/styles/bds-lite.css +5 -0
  20. package/styles/bds.css +5 -0
  21. package/styles/bootstrap-dark-lite.css +5 -0
  22. package/styles/bootstrap-dark.css +5 -0
  23. package/styles/bootstrap-lite.css +12 -0
  24. package/styles/bootstrap.css +12 -0
  25. package/styles/bootstrap4-lite.css +12 -0
  26. package/styles/bootstrap4.css +12 -0
  27. package/styles/bootstrap5-dark-lite.css +12 -0
  28. package/styles/bootstrap5-dark.css +12 -0
  29. package/styles/bootstrap5-lite.css +12 -0
  30. package/styles/bootstrap5.3-lite.css +12 -0
  31. package/styles/bootstrap5.3.css +12 -0
  32. package/styles/bootstrap5.css +12 -0
  33. package/styles/drop-down-list/_bootstrap-dark-definition.scss +1 -0
  34. package/styles/drop-down-list/_bootstrap-definition.scss +1 -0
  35. package/styles/drop-down-list/_bootstrap4-definition.scss +1 -0
  36. package/styles/drop-down-list/_bootstrap5-definition.scss +1 -0
  37. package/styles/drop-down-list/_bootstrap5.3-definition.scss +1 -0
  38. package/styles/drop-down-list/_fabric-dark-definition.scss +1 -0
  39. package/styles/drop-down-list/_fabric-definition.scss +1 -0
  40. package/styles/drop-down-list/_highcontrast-definition.scss +1 -0
  41. package/styles/drop-down-list/_highcontrast-light-definition.scss +1 -0
  42. package/styles/drop-down-list/_layout.scss +20 -0
  43. package/styles/drop-down-list/bds.css +5 -0
  44. package/styles/drop-down-list/bootstrap-dark.css +5 -0
  45. package/styles/drop-down-list/bootstrap.css +12 -0
  46. package/styles/drop-down-list/bootstrap4.css +12 -0
  47. package/styles/drop-down-list/bootstrap5-dark.css +12 -0
  48. package/styles/drop-down-list/bootstrap5.3.css +12 -0
  49. package/styles/drop-down-list/bootstrap5.css +12 -0
  50. package/styles/drop-down-list/fabric-dark.css +5 -0
  51. package/styles/drop-down-list/fabric.css +10 -0
  52. package/styles/drop-down-list/fluent-dark.css +5 -0
  53. package/styles/drop-down-list/fluent.css +5 -0
  54. package/styles/drop-down-list/fluent2.css +5 -0
  55. package/styles/drop-down-list/highcontrast-light.css +5 -0
  56. package/styles/drop-down-list/highcontrast.css +10 -0
  57. package/styles/drop-down-list/material-dark.css +5 -0
  58. package/styles/drop-down-list/material.css +5 -0
  59. package/styles/drop-down-list/material3-dark.css +5 -0
  60. package/styles/drop-down-list/material3.css +5 -0
  61. package/styles/drop-down-list/tailwind-dark.css +5 -0
  62. package/styles/drop-down-list/tailwind.css +5 -0
  63. package/styles/drop-down-list/tailwind3.css +5 -0
  64. package/styles/fabric-dark-lite.css +5 -0
  65. package/styles/fabric-dark.css +5 -0
  66. package/styles/fabric-lite.css +10 -0
  67. package/styles/fabric.css +10 -0
  68. package/styles/fluent-dark-lite.css +5 -0
  69. package/styles/fluent-dark.css +5 -0
  70. package/styles/fluent-lite.css +5 -0
  71. package/styles/fluent.css +5 -0
  72. package/styles/fluent2-lite.css +5 -0
  73. package/styles/fluent2.css +5 -0
  74. package/styles/highcontrast-light-lite.css +5 -0
  75. package/styles/highcontrast-light.css +5 -0
  76. package/styles/highcontrast-lite.css +10 -0
  77. package/styles/highcontrast.css +10 -0
  78. package/styles/material-dark-lite.css +5 -0
  79. package/styles/material-dark.css +5 -0
  80. package/styles/material-lite.css +14 -0
  81. package/styles/material.css +14 -0
  82. package/styles/material3-dark-lite.css +5 -0
  83. package/styles/material3-dark.css +5 -0
  84. package/styles/material3-lite.css +5 -0
  85. package/styles/material3.css +5 -0
  86. package/styles/multi-select/_material-definition.scss +9 -0
  87. package/styles/multi-select/material.css +9 -0
  88. package/styles/tailwind-dark-lite.css +5 -0
  89. package/styles/tailwind-dark.css +5 -0
  90. package/styles/tailwind-lite.css +5 -0
  91. package/styles/tailwind.css +5 -0
  92. package/styles/tailwind3-lite.css +5 -0
  93. package/styles/tailwind3.css +5 -0
@@ -149,7 +149,7 @@ function Search(inputVal, items, searchType, ignoreCase, dataSource, fields, typ
149
149
  dataSource.filter(function (data) {
150
150
  Array.prototype.slice.call(fieldValue_1).forEach(function (value) {
151
151
  /* eslint-disable security/detect-object-injection */
152
- if ((type === 'object' && !data.isHeader && checkField_1.textContent.toString().indexOf(data[value]) !== -1 && checkField_1.getAttribute('data-value') === data[fields.value].toString()) ||
152
+ if ((type === 'object' && !data.isHeader && checkField_1.textContent.toString().indexOf(data[value]) !== -1 && data[fields.value] != null && checkField_1.getAttribute('data-value') === data[fields.value].toString()) ||
153
153
  (type === 'string' && checkField_1.textContent.toString().indexOf(data) !== -1)) {
154
154
  filterValue = type === 'object' ? data[value] : data;
155
155
  }
@@ -448,11 +448,15 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
448
448
  if (this.parent.viewPortInfo.startIndex < this.parent.value.length) {
449
449
  endIndex = this.parent.viewPortInfo.endIndex - this.parent.value.length;
450
450
  if (this.parent.viewPortInfo.startIndex === 0) {
451
+ var oldUlElement = this.parent.list.querySelector('.e-list-parent' + ':not(.e-reorder)');
452
+ if (oldUlElement) {
453
+ this.parent.list.querySelector('.e-virtual-ddl-content').removeChild(oldUlElement);
454
+ }
451
455
  this.parent.updateVirtualReOrderList(true);
452
456
  if (this.parent.value.length < this.parent.itemCount && this.parent.value.length !== this.parent.totalItemCount) {
453
- var oldUlElement = this.parent.list.querySelector('.e-list-parent' + ':not(.e-reorder)');
454
- if (oldUlElement) {
455
- this.parent.list.querySelector('.e-virtual-ddl-content').removeChild(oldUlElement);
457
+ var oldUlElement_1 = this.parent.list.querySelector('.e-list-parent' + ':not(.e-reorder)');
458
+ if (oldUlElement_1) {
459
+ this.parent.list.querySelector('.e-virtual-ddl-content').removeChild(oldUlElement_1);
456
460
  }
457
461
  var query = this.parent.getForQuery(this.parent.value).clone();
458
462
  query = query.skip(0)
@@ -466,9 +470,9 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
466
470
  isListUpdated = false;
467
471
  }
468
472
  else {
469
- var oldUlElement = this.parent.list.querySelector('.e-list-parent' + ':not(.e-reorder)');
470
- if (oldUlElement) {
471
- this.parent.list.querySelector('.e-virtual-ddl-content').removeChild(oldUlElement);
473
+ var oldUlElement_2 = this.parent.list.querySelector('.e-list-parent' + ':not(.e-reorder)');
474
+ if (oldUlElement_2) {
475
+ this.parent.list.querySelector('.e-virtual-ddl-content').removeChild(oldUlElement_2);
472
476
  }
473
477
  }
474
478
  isListUpdated = false;
@@ -488,6 +492,10 @@ var VirtualScroll = /** @__PURE__ @class */ (function () {
488
492
  query = query.skip(0).take(this.parent.itemCount - (this.parent.value.length - this.parent.viewPortInfo.startIndex));
489
493
  this.parent.appendUncheckList = true;
490
494
  this.parent.setCurrentView = false;
495
+ var oldUlElement = this.parent.list.querySelector('.e-list-parent' + ':not(.e-reorder)');
496
+ if (oldUlElement) {
497
+ this.parent.list.querySelector('.e-virtual-ddl-content').removeChild(oldUlElement);
498
+ }
491
499
  this.parent.resetList(this.parent.dataSource, this.parent.fields, query);
492
500
  isListUpdated = false;
493
501
  this.parent.appendUncheckList = this.parent.dataSource instanceof DataManager ? this.parent.appendUncheckList : false;
@@ -967,6 +975,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
967
975
  _this.skeletonCount = 32;
968
976
  _this.isVirtualTrackHeight = false;
969
977
  _this.virtualSelectAll = false;
978
+ _this.isVirtualReorder = false;
970
979
  _this.incrementalQueryString = '';
971
980
  _this.incrementalEndIndex = 0;
972
981
  _this.incrementalStartIndex = 0;
@@ -1665,7 +1674,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1665
1674
  var newQuery = _this.getQuery(eventArgs.query);
1666
1675
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1667
1676
  if (_this.isVirtualizationEnabled && (listItems.count !== 0 &&
1668
- listItems.count < (_this.itemCount * 2))) {
1677
+ listItems.count < (_this.itemCount * 2)) && !_this.appendUncheckList) {
1669
1678
  if (newQuery) {
1670
1679
  for (var queryElements = 0; queryElements < newQuery.queries.length; queryElements++) {
1671
1680
  if (newQuery.queries[queryElements].fn === 'onTake') {
@@ -2163,7 +2172,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
2163
2172
  var oldUlElement = this.list.querySelector('.e-list-parent' + ':not(.e-reorder)');
2164
2173
  var virtualUlElement = this.list.querySelector('.e-virtual-ddl-content');
2165
2174
  var isRemovedUlelement = false;
2166
- if (!oldUlElement && this.list.querySelector('.e-list-parent' + '.e-reorder')) {
2175
+ if ((!oldUlElement && this.list.querySelector('.e-list-parent' + '.e-reorder')) || (oldUlElement && this.isVirtualReorder && this.list.querySelector('.e-list-parent' + '.e-reorder'))) {
2167
2176
  oldUlElement = this.list.querySelector('.e-list-parent' + '.e-reorder');
2168
2177
  }
2169
2178
  if ((listData.length >= this.virtualizedItemsCount && oldUlElement && virtualUlElement) || (oldUlElement && virtualUlElement && this.isAllowFiltering) || (oldUlElement && virtualUlElement && (this.getModuleName() === 'autocomplete' || this.getModuleName() === 'multiselect')) || isRemovedUlelement) {
@@ -2259,7 +2268,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
2259
2268
  }
2260
2269
  setStyleAttribute(this.fixedHeaderElement, { zIndex: 10 });
2261
2270
  var firstLi = this.ulElement.querySelector('.' + dropDownBaseClasses.group + ':not(.e-hide-listitem)');
2262
- this.fixedHeaderElement.innerHTML = firstLi.innerHTML;
2271
+ if (!isNullOrUndefined(firstLi)) {
2272
+ this.fixedHeaderElement.innerHTML = firstLi.innerHTML;
2273
+ }
2263
2274
  };
2264
2275
  DropDownBase.prototype.getSortedDataSource = function (dataSource) {
2265
2276
  if (dataSource && this.sortOrder !== 'None') {
@@ -2485,7 +2496,11 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
2485
2496
  var group = this.element.querySelector('select>optgroup');
2486
2497
  if ((this.fields.groupBy || !isNullOrUndefined(group)) && !this.isGroupChecking) {
2487
2498
  EventHandler.add(this.list, 'scroll', this.setFloatingHeader, this);
2488
- EventHandler.add(document, 'scroll', this.updateGroupFixedHeader, this);
2499
+ var elements = this.getScrollableParent();
2500
+ for (var i = 0; i < elements.length; i++) {
2501
+ var ele = elements[i];
2502
+ EventHandler.add(ele, 'scroll', this.updateGroupFixedHeader, this);
2503
+ }
2489
2504
  }
2490
2505
  if (this.getModuleName() === 'dropdownbase') {
2491
2506
  if (this.element.getAttribute('tabindex')) {
@@ -2503,6 +2518,22 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
2503
2518
  this.initialize(e);
2504
2519
  }
2505
2520
  };
2521
+ DropDownBase.prototype.getScrollableParent = function () {
2522
+ var eleStyle = getComputedStyle(this.element);
2523
+ var scrollParents = [];
2524
+ var overflowRegex = /(auto|scroll)/;
2525
+ var parent = this.element.parentElement;
2526
+ while (parent && parent.tagName !== 'HTML') {
2527
+ var parentStyle = getComputedStyle(parent);
2528
+ if (!(eleStyle.position === 'absolute' && parentStyle.position === 'static')
2529
+ && overflowRegex.test(parentStyle.overflow + parentStyle.overflowY + parentStyle.overflowX)) {
2530
+ scrollParents.push(parent);
2531
+ }
2532
+ parent = parent.parentElement;
2533
+ }
2534
+ scrollParents.push(document);
2535
+ return scrollParents;
2536
+ };
2506
2537
  DropDownBase.prototype.removeScrollEvent = function () {
2507
2538
  if (this.list) {
2508
2539
  EventHandler.remove(this.list, 'scroll', this.setFloatingHeader);
@@ -12823,7 +12854,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
12823
12854
  _this.isBlurDispatching = false;
12824
12855
  _this.isFilterPrevented = false;
12825
12856
  _this.isFilteringAction = false;
12826
- _this.isVirtualReorder = false;
12827
12857
  _this.isValidKey = false;
12828
12858
  _this.selectAllEventData = [];
12829
12859
  _this.selectAllEventEle = [];
@@ -13677,7 +13707,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
13677
13707
  }
13678
13708
  }
13679
13709
  }
13680
- if ((this.allowFiltering && isSkip) || !isReOrder || (!this.allowFiltering && isSkip) && !this.isVirtualReorder) {
13710
+ if (((this.allowFiltering && isSkip) || !isReOrder || (!this.allowFiltering && isSkip)) && !this.isVirtualReorder) {
13681
13711
  if (!isReOrder) {
13682
13712
  filterQuery.skip(this.viewPortInfo.startIndex);
13683
13713
  }
@@ -13841,10 +13871,13 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
13841
13871
  if (this.allowObjectBinding) {
13842
13872
  var keys = this.listData && this.listData.length > 0 ? Object.keys(this.listData[0]) : this.firstItem ?
13843
13873
  Object.keys(this.firstItem) : Object.keys(dataItem_1);
13874
+ var isNumberType_1 = (typeof getValue((this.fields.value ? this.fields.value : 'value'), customData)
13875
+ === 'number' && this.fields.value !== this.fields.text);
13844
13876
  // Create an empty object with predefined keys
13845
13877
  keys.forEach(function (key) {
13846
13878
  emptyObject_1[key] = ((key === fields.value) || (key === fields.text)) ?
13847
- getValue(fields.value, dataItem_1) : null;
13879
+ ((key === fields.text) && isNumberType_1) ? getValue(fields.text, dataItem_1) :
13880
+ getValue(fields.value, dataItem_1) : null;
13848
13881
  });
13849
13882
  }
13850
13883
  dataItem_1 = this.allowObjectBinding ? emptyObject_1 : dataItem_1;
@@ -14139,6 +14172,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
14139
14172
  else {
14140
14173
  this.trigger('change', eventArgs);
14141
14174
  }
14175
+ if (this.enableVirtualization && this.enableSelectionOrder && this.mode === 'CheckBox') {
14176
+ this.preventSetCurrentData = false;
14177
+ }
14142
14178
  this.updateTempValue();
14143
14179
  if (!this.changeOnBlur) {
14144
14180
  this.dispatchEvent(this.hiddenElement, 'change');
@@ -14671,6 +14707,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
14671
14707
  if (this.value && this.validateValues(this.value, temp)) {
14672
14708
  if (this.mode !== 'CheckBox') {
14673
14709
  this.value = temp;
14710
+ if (this.allowFiltering || this.allowCustomValue) {
14711
+ this.refreshListItems(null);
14712
+ }
14674
14713
  this.initialValueUpdate();
14675
14714
  }
14676
14715
  if (this.mode !== 'Delimiter' && this.mode !== 'CheckBox') {
@@ -17843,6 +17882,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
17843
17882
  };
17844
17883
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
17845
17884
  MultiSelect.prototype.updateDataSource = function (prop) {
17885
+ this.checkAndResetCache();
17846
17886
  if (isNullOrUndefined(this.list)) {
17847
17887
  this.renderPopup();
17848
17888
  }
@@ -23820,7 +23860,12 @@ var Mention = /** @__PURE__ @class */ (function (_super) {
23820
23860
  if (lastNode) {
23821
23861
  range = range.cloneRange();
23822
23862
  if (this.isRTE) {
23823
- range.setStart(lastNode, lastNode.textContent.length);
23863
+ if (lastNode.nodeType === 3) {
23864
+ range.setStart(lastNode, lastNode.textContent.length);
23865
+ }
23866
+ else {
23867
+ range.setStartAfter(lastNode);
23868
+ }
23824
23869
  }
23825
23870
  else {
23826
23871
  range.setStartAfter(lastNode);