@syncfusion/ej2-dropdowns 27.1.48 → 27.1.50

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 +38 -32
  5. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  6. package/dist/es6/ej2-dropdowns.es5.js +37 -31
  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 +12 -13
  12. package/src/drop-down-base/drop-down-base.d.ts +1 -0
  13. package/src/drop-down-base/drop-down-base.js +1 -2
  14. package/src/drop-down-list/drop-down-list.js +4 -1
  15. package/src/drop-down-tree/drop-down-tree.js +1 -1
  16. package/src/list-box/list-box.js +31 -27
  17. package/styles/bootstrap-dark-lite.css +4 -1
  18. package/styles/bootstrap-dark.css +4 -1
  19. package/styles/bootstrap-lite.css +4 -1
  20. package/styles/bootstrap.css +4 -1
  21. package/styles/bootstrap4-lite.css +3 -1
  22. package/styles/bootstrap4.css +3 -1
  23. package/styles/bootstrap5-dark-lite.css +6 -1
  24. package/styles/bootstrap5-dark.css +6 -1
  25. package/styles/bootstrap5-lite.css +6 -1
  26. package/styles/bootstrap5.3-lite.css +6 -1
  27. package/styles/bootstrap5.3.css +6 -1
  28. package/styles/bootstrap5.css +6 -1
  29. package/styles/drop-down-list/_theme.scss +1 -3
  30. package/styles/drop-down-list/bootstrap-dark.css +1 -0
  31. package/styles/drop-down-list/bootstrap.css +1 -0
  32. package/styles/drop-down-list/fabric-dark.css +1 -0
  33. package/styles/drop-down-list/fabric.css +1 -0
  34. package/styles/drop-down-list/fluent-dark.css +1 -0
  35. package/styles/drop-down-list/fluent.css +1 -0
  36. package/styles/drop-down-list/fluent2.css +1 -0
  37. package/styles/drop-down-list/highcontrast-light.css +1 -0
  38. package/styles/drop-down-list/material-dark.css +1 -0
  39. package/styles/drop-down-list/material.css +1 -0
  40. package/styles/drop-down-list/material3-dark.css +1 -0
  41. package/styles/drop-down-list/material3.css +1 -0
  42. package/styles/drop-down-list/tailwind-dark.css +1 -0
  43. package/styles/drop-down-list/tailwind.css +1 -0
  44. package/styles/drop-down-tree/_theme.scss +5 -0
  45. package/styles/drop-down-tree/bootstrap5-dark.css +3 -0
  46. package/styles/drop-down-tree/bootstrap5.3.css +3 -0
  47. package/styles/drop-down-tree/bootstrap5.css +3 -0
  48. package/styles/fabric-dark-lite.css +4 -1
  49. package/styles/fabric-dark.css +4 -1
  50. package/styles/fabric-lite.css +4 -1
  51. package/styles/fabric.css +4 -1
  52. package/styles/fluent-dark-lite.css +4 -1
  53. package/styles/fluent-dark.css +4 -1
  54. package/styles/fluent-lite.css +4 -1
  55. package/styles/fluent.css +4 -1
  56. package/styles/fluent2-lite.css +4 -1
  57. package/styles/fluent2.css +4 -1
  58. package/styles/highcontrast-light-lite.css +4 -1
  59. package/styles/highcontrast-light.css +4 -1
  60. package/styles/highcontrast-lite.css +3 -1
  61. package/styles/highcontrast.css +3 -1
  62. package/styles/list-box/_layout.scss +1 -0
  63. package/styles/list-box/bootstrap-dark.css +3 -1
  64. package/styles/list-box/bootstrap.css +3 -1
  65. package/styles/list-box/bootstrap4.css +3 -1
  66. package/styles/list-box/bootstrap5-dark.css +3 -1
  67. package/styles/list-box/bootstrap5.3.css +3 -1
  68. package/styles/list-box/bootstrap5.css +3 -1
  69. package/styles/list-box/fabric-dark.css +3 -1
  70. package/styles/list-box/fabric.css +3 -1
  71. package/styles/list-box/fluent-dark.css +3 -1
  72. package/styles/list-box/fluent.css +3 -1
  73. package/styles/list-box/fluent2.css +3 -1
  74. package/styles/list-box/highcontrast-light.css +3 -1
  75. package/styles/list-box/highcontrast.css +3 -1
  76. package/styles/list-box/material-dark.css +3 -1
  77. package/styles/list-box/material.css +3 -1
  78. package/styles/list-box/material3-dark.css +3 -1
  79. package/styles/list-box/material3.css +3 -1
  80. package/styles/list-box/tailwind-dark.css +3 -1
  81. package/styles/list-box/tailwind.css +3 -1
  82. package/styles/material-dark-lite.css +4 -1
  83. package/styles/material-dark.css +4 -1
  84. package/styles/material-lite.css +4 -1
  85. package/styles/material.css +4 -1
  86. package/styles/material3-dark-lite.css +4 -1
  87. package/styles/material3-dark.css +4 -1
  88. package/styles/material3-lite.css +4 -1
  89. package/styles/material3.css +4 -1
  90. package/styles/tailwind-dark-lite.css +4 -1
  91. package/styles/tailwind-dark.css +4 -1
  92. package/styles/tailwind-lite.css +4 -1
  93. package/styles/tailwind.css +4 -1
@@ -1928,7 +1928,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
1928
1928
  }
1929
1929
  addClass([this.list], dropDownBaseClasses.grouping);
1930
1930
  }
1931
- else {
1931
+ else if (this.getModuleName() !== 'listbox' || (this.getModuleName() === 'listbox' && !this.preventDefActionFilter)) {
1932
1932
  dataSource = this.getSortedDataSource(dataSource);
1933
1933
  }
1934
1934
  var options = this.listOption(dataSource, fields);
@@ -2526,7 +2526,6 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
2526
2526
  }
2527
2527
  if (this.getModuleName() === 'listbox') {
2528
2528
  this.updateActionCompleteData(li, item, isListboxEmpty ? null : index + i);
2529
- isListboxEmpty = true;
2530
2529
  }
2531
2530
  else {
2532
2531
  this.updateActionCompleteData(li, item, index);
@@ -4506,7 +4505,10 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
4506
4505
  }
4507
4506
  else {
4508
4507
  if (!isNullOrUndefined(this.hiddenElement)) {
4509
- this.hiddenElement.innerHTML = '<option selected>' + this.text + '</option>';
4508
+ var option = document.createElement('option');
4509
+ option.text = this.text;
4510
+ option.setAttribute('selected', '');
4511
+ this.hiddenElement.appendChild(option);
4510
4512
  var selectedElement = this.hiddenElement.querySelector('option');
4511
4513
  selectedElement.setAttribute('value', value.toString());
4512
4514
  }
@@ -8726,7 +8728,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
8726
8728
  addClass([focusedElement], ['e-node-focus']);
8727
8729
  }
8728
8730
  }
8729
- if (_this.treeObj.checkedNodes.length > 0) {
8731
+ if (_this.treeObj.checkedNodes.length > 0 && !_this.isFilterRestore) {
8730
8732
  var nodes = _this.treeObj.element.querySelectorAll('li');
8731
8733
  var checkedNodes = _this.treeObj.element.querySelectorAll('li[aria-checked=true]');
8732
8734
  if ((checkedNodes.length === nodes.length || _this.checkSelectAll) && _this.checkBoxElement) {
@@ -19383,7 +19385,9 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
19383
19385
  }
19384
19386
  filterElem.selectionStart = txtLength;
19385
19387
  filterElem.selectionEnd = txtLength;
19386
- filterElem.focus();
19388
+ if (filterElem.value !== '') {
19389
+ filterElem.focus();
19390
+ }
19387
19391
  }
19388
19392
  }
19389
19393
  if (this.toolbarSettings.items.length && this.scope && this.scope.indexOf('#') > -1 && !isNullOrUndefined(e)) {
@@ -19835,33 +19839,24 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
19835
19839
  items = (items instanceof Array ? items : [items]);
19836
19840
  var fields = this.fields;
19837
19841
  var dataValue = void 0;
19838
- var objValue = void 0;
19842
+ var objValue = {};
19839
19843
  var dupData = [];
19840
- var itemIdx = void 0;
19841
19844
  extend(dupData, [], this.jsonData);
19842
19845
  var removeIdxes = [];
19843
19846
  var removeLiIdxes = [];
19847
+ for (var i = 0; i < dupData.length; i++) {
19848
+ var value = (dupData[i] instanceof Object) ? dupData[i][fields.value] :
19849
+ dupData[i].toString();
19850
+ objValue[value] = i;
19851
+ }
19844
19852
  for (var j = 0; j < items.length; j++) {
19845
- if (items[j] instanceof Object) {
19846
- dataValue = getValue(fields.value, items[j]);
19847
- }
19848
- else {
19849
- dataValue = items[j].toString();
19850
- }
19851
- for (var i = 0, len = dupData.length; i < len; i++) {
19852
- if (dupData[i] instanceof Object) {
19853
- objValue = getValue(fields.value, dupData[i]);
19854
- }
19855
- else {
19856
- objValue = dupData[i].toString();
19857
- }
19858
- if (objValue === dataValue) {
19859
- itemIdx = this.getIndexByValue(dataValue);
19860
- var idx = itemIdx === i ? itemIdx : i;
19861
- liCollections.push(liElement[idx]);
19862
- removeIdxes.push(idx);
19863
- removeLiIdxes.push(idx);
19864
- }
19853
+ dataValue = (items[j] instanceof Object) ? items[j][fields.value] :
19854
+ items[j].toString();
19855
+ if (Object.prototype.hasOwnProperty.call(objValue, dataValue)) {
19856
+ var idx = objValue[dataValue];
19857
+ liCollections.push(liElement[idx]);
19858
+ removeIdxes.push(idx);
19859
+ removeLiIdxes.push(idx);
19865
19860
  }
19866
19861
  }
19867
19862
  var validRemoveIdxes = removeIdxes.sort(function (a, b) { return b - a; });
@@ -20695,7 +20690,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
20695
20690
  }
20696
20691
  flistboxarray = newFlistboxArray;
20697
20692
  moveTo(fListBox.ulElement, tListBox.ulElement, flistboxarray, index);
20698
- this.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
20693
+ fListBox.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
20699
20694
  if (isKey) {
20700
20695
  this.list.focus();
20701
20696
  }
@@ -20744,8 +20739,8 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
20744
20739
  fListBox.listData = fListBox.sortedData = fListBox.jsonData = tempData;
20745
20740
  }
20746
20741
  else if (fListBox.allowFiltering) {
20742
+ var disabledData_1 = [];
20747
20743
  if (tempLiColl.length > 0) {
20748
- var disabledData_1 = [];
20749
20744
  for (var i = 0; i < tempLiColl.length; i++) {
20750
20745
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
20751
20746
  disabledData_1.push(this.getDataByValue(tempLiColl[i].getAttribute('data-value')));
@@ -20762,7 +20757,13 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
20762
20757
  }
20763
20758
  }
20764
20759
  }
20765
- fListBox.listData = fListBox.sortedData = [];
20760
+ if (tempLiColl.length > 0) {
20761
+ fListBox.listData = disabledData_1;
20762
+ fListBox.sortedData = [];
20763
+ }
20764
+ else {
20765
+ fListBox.listData = fListBox.sortedData = [];
20766
+ }
20766
20767
  }
20767
20768
  if (isRefresh) {
20768
20769
  var sourceElem = tListBox.renderItems(listData, tListBox.fields);
@@ -20986,7 +20987,9 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
20986
20987
  }
20987
20988
  _this.isFiltered = true;
20988
20989
  _this.remoteFilterAction = true;
20990
+ _this.preventDefActionFilter = eventArgsData_1.preventDefaultAction;
20989
20991
  _this.dataUpdater(dataSource, query, fields);
20992
+ _this.preventDefActionFilter = false;
20990
20993
  },
20991
20994
  event: e,
20992
20995
  cancel: false
@@ -20996,6 +20999,7 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
20996
20999
  if (args.cancel || (_this.filterInput.value !== '' && _this.isFiltered)) {
20997
21000
  return;
20998
21001
  }
21002
+ _this.preventDefActionFilter = false;
20999
21003
  if (!args.cancel && !_this.isCustomFiltering && !args.preventDefaultAction) {
21000
21004
  _this.inputString = _this.filterInput.value;
21001
21005
  _this.filteringAction(_this.jsonData, new Query(), _this.fields);
@@ -21405,7 +21409,9 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
21405
21409
  this.initDraggable();
21406
21410
  }
21407
21411
  else {
21408
- getComponent(this.ulElement, 'sortable').destroy();
21412
+ if (this.ulElement.classList.contains('e-sortable')) {
21413
+ getComponent(this.ulElement, 'sortable').destroy();
21414
+ }
21409
21415
  }
21410
21416
  break;
21411
21417
  case 'allowFiltering':