@syncfusion/ej2-dropdowns 19.3.55 → 19.4.41

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 (97) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +1 -1
  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 +101 -40
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +103 -40
  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/package.json +11 -11
  13. package/src/combo-box/combo-box.js +2 -2
  14. package/src/common/incremental-search.d.ts +1 -1
  15. package/src/common/incremental-search.js +1 -1
  16. package/src/drop-down-base/drop-down-base.js +17 -0
  17. package/src/drop-down-tree/drop-down-tree.js +15 -5
  18. package/src/list-box/list-box.d.ts +0 -4
  19. package/src/list-box/list-box.js +0 -3
  20. package/src/multi-select/multi-select-model.d.ts +1 -1
  21. package/src/multi-select/multi-select.d.ts +2 -0
  22. package/src/multi-select/multi-select.js +68 -29
  23. package/styles/auto-complete/_fluent-definition.scss +2 -0
  24. package/styles/auto-complete/bootstrap5-dark.css +0 -1
  25. package/styles/auto-complete/bootstrap5.css +0 -1
  26. package/styles/bootstrap-dark.css +5 -0
  27. package/styles/bootstrap.css +5 -0
  28. package/styles/bootstrap4.css +5 -0
  29. package/styles/bootstrap5-dark.css +17 -6
  30. package/styles/bootstrap5.css +17 -6
  31. package/styles/combo-box/_fluent-definition.scss +2 -0
  32. package/styles/combo-box/bootstrap5-dark.css +0 -1
  33. package/styles/combo-box/bootstrap5.css +0 -1
  34. package/styles/drop-down-base/_fluent-definition.scss +109 -0
  35. package/styles/drop-down-list/_bootstrap5-definition.scss +0 -1
  36. package/styles/drop-down-list/_fluent-definition.scss +193 -0
  37. package/styles/drop-down-list/bootstrap5-dark.css +0 -1
  38. package/styles/drop-down-list/bootstrap5.css +0 -1
  39. package/styles/drop-down-list/icons/_bootstrap5.scss +0 -1
  40. package/styles/drop-down-list/icons/_fluent.scss +14 -0
  41. package/styles/drop-down-tree/_bootstrap5-definition.scss +59 -58
  42. package/styles/drop-down-tree/_fluent-definition.scss +71 -0
  43. package/styles/drop-down-tree/_layout.scss +12 -4
  44. package/styles/drop-down-tree/_tailwind-definition.scss +1 -0
  45. package/styles/drop-down-tree/bootstrap5-dark.css +11 -4
  46. package/styles/drop-down-tree/bootstrap5.css +11 -4
  47. package/styles/drop-down-tree/icons/_bootstrap5.scss +11 -11
  48. package/styles/drop-down-tree/icons/_fluent.scss +11 -0
  49. package/styles/drop-down-tree/icons/_tailwind-dark.scss +11 -11
  50. package/styles/drop-down-tree/tailwind-dark.css +1 -0
  51. package/styles/drop-down-tree/tailwind.css +1 -0
  52. package/styles/fabric-dark.css +5 -0
  53. package/styles/fabric.css +5 -0
  54. package/styles/highcontrast-light.css +5 -0
  55. package/styles/highcontrast.css +5 -0
  56. package/styles/list-box/_bootstrap5-definition.scss +2 -2
  57. package/styles/list-box/_fluent-definition.scss +115 -0
  58. package/styles/list-box/_layout.scss +1 -6
  59. package/styles/list-box/bootstrap5-dark.css +1 -1
  60. package/styles/list-box/bootstrap5.css +1 -1
  61. package/styles/list-box/icons/_fluent.scss +25 -0
  62. package/styles/list-box/icons/_tailwind-dark.scss +2 -2
  63. package/styles/list-box/tailwind-dark.css +3 -3
  64. package/styles/list-box/tailwind.css +1 -1
  65. package/styles/material-dark.css +5 -94
  66. package/styles/material.css +5 -94
  67. package/styles/multi-select/_bootstrap-dark-definition.scss +1 -0
  68. package/styles/multi-select/_bootstrap-definition.scss +1 -0
  69. package/styles/multi-select/_bootstrap4-definition.scss +1 -0
  70. package/styles/multi-select/_bootstrap5-definition.scss +1 -0
  71. package/styles/multi-select/_fabric-dark-definition.scss +1 -0
  72. package/styles/multi-select/_fabric-definition.scss +1 -0
  73. package/styles/multi-select/_fluent-definition.scss +215 -0
  74. package/styles/multi-select/_highcontrast-definition.scss +1 -0
  75. package/styles/multi-select/_highcontrast-light-definition.scss +1 -0
  76. package/styles/multi-select/_layout.scss +0 -116
  77. package/styles/multi-select/_material-dark-definition.scss +1 -22
  78. package/styles/multi-select/_material-definition.scss +1 -22
  79. package/styles/multi-select/_tailwind-definition.scss +1 -0
  80. package/styles/multi-select/_theme.scss +5 -0
  81. package/styles/multi-select/bootstrap-dark.css +5 -0
  82. package/styles/multi-select/bootstrap.css +5 -0
  83. package/styles/multi-select/bootstrap4.css +5 -0
  84. package/styles/multi-select/bootstrap5-dark.css +5 -0
  85. package/styles/multi-select/bootstrap5.css +5 -0
  86. package/styles/multi-select/fabric-dark.css +5 -0
  87. package/styles/multi-select/fabric.css +5 -0
  88. package/styles/multi-select/highcontrast-light.css +5 -0
  89. package/styles/multi-select/highcontrast.css +5 -0
  90. package/styles/multi-select/icons/_fluent.scss +27 -0
  91. package/styles/multi-select/material-dark.css +5 -94
  92. package/styles/multi-select/material.css +5 -94
  93. package/styles/multi-select/tailwind-dark.css +5 -0
  94. package/styles/multi-select/tailwind.css +5 -0
  95. package/styles/tailwind-dark.css +9 -3
  96. package/styles/tailwind.css +7 -1
  97. package/styles/_all.scss +0 -3
@@ -91,7 +91,7 @@ function Search(inputVal, items, searchType, ignoreCase) {
91
91
  for (let i = 0, itemsData = listItems; i < itemsData.length; i++) {
92
92
  const item = itemsData[i];
93
93
  const text = (ignoreCase ? item.textContent.toLocaleLowerCase() : item.textContent).replace(/^\s+|\s+$/g, '');
94
- if ((searchType === 'Equal' && text === queryStr) || (searchType === 'StartsWith' && text.substr(0, strLength) === queryStr)) {
94
+ if ((searchType === 'Equal' && text === queryStr) || (searchType === 'StartsWith' && text.substr(0, strLength) === queryStr) || (searchType === 'EndsWith' && text.substr(text.length - queryStr.length) === queryStr) || (searchType === 'Contains' && new RegExp(queryStr, "g").test(text))) {
95
95
  itemData.item = item;
96
96
  itemData.index = i;
97
97
  return { item: item, index: i };
@@ -635,6 +635,11 @@ let DropDownBase = class DropDownBase extends Component {
635
635
  this.renderGroupTemplate(ulElement);
636
636
  }
637
637
  this.bindChildItems(localDataArgs.result, ulElement, fields);
638
+ setTimeout(() => {
639
+ if (this.getModuleName() === 'multiselect' && this.itemTemplate != null && (ulElement.childElementCount > 0 && ulElement.children[0].childElementCount > 0)) {
640
+ this.updateDataList();
641
+ }
642
+ });
638
643
  }
639
644
  });
640
645
  }
@@ -765,10 +770,22 @@ let DropDownBase = class DropDownBase extends Component {
765
770
  const groupValue = select(this.groupTemplate, document).innerHTML.trim();
766
771
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
767
772
  const tempHeaders = ListBase.renderGroupTemplate(groupValue, dataSource, this.fields.properties, headerItems, option, this);
773
+ //EJ2-55168- Group checkbox is not working with group template
774
+ if (this.isGroupChecking) {
775
+ for (var i = 0; i < tempHeaders.length; i++) {
776
+ this.notify('addItem', { module: 'CheckBoxSelection', item: tempHeaders[i] });
777
+ }
778
+ }
768
779
  }
769
780
  else {
770
781
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
771
782
  const tempHeaders = ListBase.renderGroupTemplate(this.groupTemplate, dataSource, this.fields.properties, headerItems, option, this);
783
+ //EJ2-55168- Group checkbox is not working with group template
784
+ if (this.isGroupChecking) {
785
+ for (var i = 0; i < tempHeaders.length; i++) {
786
+ this.notify('addItem', { module: 'CheckBoxSelection', item: tempHeaders[i] });
787
+ }
788
+ }
772
789
  }
773
790
  this.renderReactTemplates();
774
791
  }
@@ -5433,9 +5450,14 @@ let DropDownTree = class DropDownTree extends Component {
5433
5450
  }
5434
5451
  else {
5435
5452
  if (this.showCheckBox) {
5436
- this.treeObj.checkedNodes = this.value.slice();
5437
- this.treeObj.dataBind();
5438
- this.setMultiSelect();
5453
+ let difference = this.value.filter((e) => {
5454
+ return this.treeObj.checkedNodes.indexOf(e) === -1;
5455
+ });
5456
+ if (difference.length > 0 || this.treeSettings.autoCheck) {
5457
+ this.treeObj.checkedNodes = this.value.slice();
5458
+ this.treeObj.dataBind();
5459
+ this.setMultiSelect();
5460
+ }
5439
5461
  }
5440
5462
  else {
5441
5463
  this.treeObj.selectedNodes = this.value.slice();
@@ -6471,6 +6493,9 @@ let DropDownTree = class DropDownTree extends Component {
6471
6493
  this.ensurePlaceHolder();
6472
6494
  }
6473
6495
  resetValue(isDynamicChange) {
6496
+ if (this.value == [] && this.text == null) {
6497
+ return;
6498
+ }
6474
6499
  Input.setValue(null, this.inputEle, this.floatLabelType);
6475
6500
  if (!isDynamicChange) {
6476
6501
  this.oldValue = this.value;
@@ -6482,7 +6507,8 @@ let DropDownTree = class DropDownTree extends Component {
6482
6507
  setValue('selectedNodes', [], this.treeObj);
6483
6508
  this.hiddenElement.innerHTML = '';
6484
6509
  if (this.showCheckBox) {
6485
- this.treeObj.uncheckAll();
6510
+ this.treeObj.checkedNodes = [];
6511
+ this.treeObj.dataBind();
6486
6512
  this.setMultiSelect();
6487
6513
  this.clearCheckAll();
6488
6514
  }
@@ -6859,8 +6885,8 @@ let DropDownTree = class DropDownTree extends Component {
6859
6885
  this.updateTemplate();
6860
6886
  }
6861
6887
  this.treeObj.sortOrder = newProp.sortOrder;
6862
- this.updateValue(this.value);
6863
6888
  this.treeObj.dataBind();
6889
+ this.updateValue(this.value);
6864
6890
  break;
6865
6891
  case 'showDropDownIcon':
6866
6892
  this.updateDropDownIconState(newProp.showDropDownIcon);
@@ -7427,7 +7453,7 @@ let ComboBox = class ComboBox extends DropDownList {
7427
7453
  if ((Browser.isDevice && !this.isDropDownClick || !Browser.isDevice) &&
7428
7454
  !isNullOrUndefined(this.liCollections) && this.liCollections.length > 0) {
7429
7455
  const inputValue = this.inputElement.value;
7430
- const activeItem = Search(inputValue, this.liCollections, 'StartsWith', true);
7456
+ const activeItem = Search(inputValue, this.liCollections, this.filterType, true);
7431
7457
  const activeElement = activeItem.item;
7432
7458
  if (!isNullOrUndefined(activeElement)) {
7433
7459
  const count = this.getIndexByValue(activeElement.getAttribute('data-value')) - 1;
@@ -7584,7 +7610,7 @@ let ComboBox = class ComboBox extends DropDownList {
7584
7610
  else {
7585
7611
  this.activeIndex = null;
7586
7612
  this.removeSelection();
7587
- if (this.liCollections && this.liCollections.length < 0) {
7613
+ if (this.liCollections && this.liCollections.length > 0 && !this.isCustomFilter) {
7588
7614
  this.removeFocus();
7589
7615
  }
7590
7616
  }
@@ -8973,7 +8999,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
8973
8999
  this.mainData = list;
8974
9000
  this.mainListCollection = this.liCollections;
8975
9001
  }
8976
- else if (!isNullOrUndefined(this.mainData) && this.mainData.length === 0) {
9002
+ else if (isNullOrUndefined(this.mainData) || this.mainData.length === 0) {
8977
9003
  this.mainData = list;
8978
9004
  }
8979
9005
  if ((this.remoteCustomValue || list.length <= 0) && this.allowCustomValue && this.inputFocus && this.allowFiltering &&
@@ -9601,6 +9627,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9601
9627
  const focusedItem = this.list.querySelector('.' + dropDownBaseClasses.focus);
9602
9628
  if (!isNullOrUndefined(focusedItem)) {
9603
9629
  this.inputElement.setAttribute('aria-activedescendant', focusedItem.id);
9630
+ if (this.allowFiltering) {
9631
+ var filterInput = this.popupWrapper.querySelector('.' + FILTERINPUT);
9632
+ filterInput && filterInput.setAttribute('aria-activedescendant', focusedItem.id);
9633
+ }
9634
+ else if (this.mode == "CheckBox") {
9635
+ this.overAllWrapper.setAttribute('aria-activedescendant', focusedItem.id);
9636
+ }
9604
9637
  }
9605
9638
  }
9606
9639
  homeNavigation(isHome) {
@@ -9716,7 +9749,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
9716
9749
  this.keyAction = true;
9717
9750
  if (document.activeElement.classList.contains(FILTERINPUT)
9718
9751
  || (this.mode === 'CheckBox' && !this.allowFiltering && document.activeElement !== this.list)) {
9719
- this.list.focus();
9720
9752
  EventHandler.add(this.list, 'keydown', this.onKeyDown, this);
9721
9753
  }
9722
9754
  this.updateAriaAttribute();
@@ -10735,7 +10767,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10735
10767
  EventHandler.add(this.inputElement, 'input', this.onInput, this);
10736
10768
  }
10737
10769
  EventHandler.add(this.inputElement, 'blur', this.onBlurHandler, this);
10738
- EventHandler.add(this.componentWrapper, 'mousemove', this.mouseIn, this);
10770
+ EventHandler.add(this.componentWrapper, 'mouseover', this.mouseIn, this);
10739
10771
  const formElement = closest(this.inputElement, 'form');
10740
10772
  if (formElement) {
10741
10773
  EventHandler.add(formElement, 'reset', this.resetValueHandler, this);
@@ -10983,7 +11015,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
10983
11015
  updateActionCompleteData(li, item) {
10984
11016
  if (this.value && this.value.indexOf(li.getAttribute('data-value')) > -1) {
10985
11017
  this.mainList = this.ulElement;
10986
- addClass([li], HIDE_LIST);
11018
+ if (this.hideSelectedItem) {
11019
+ addClass([li], HIDE_LIST);
11020
+ }
10987
11021
  }
10988
11022
  }
10989
11023
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -11001,7 +11035,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11001
11035
  }
11002
11036
  }
11003
11037
  updateDataList() {
11004
- if (this.mainList && this.ulElement && this.mainList.childElementCount < this.ulElement.childElementCount) {
11038
+ if (this.mainList && this.ulElement && (this.mainList.childElementCount < this.ulElement.childElementCount || ((this.ulElement.childElementCount > 0 && this.ulElement.children[0].childElementCount > 0) && (this.mainList.children[0].childElementCount < this.ulElement.children[0].childElementCount)))) {
11005
11039
  this.mainList = this.ulElement.cloneNode ? this.ulElement.cloneNode(true) : this.ulElement;
11006
11040
  }
11007
11041
  }
@@ -11627,7 +11661,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11627
11661
  EventHandler.remove(formElement, 'reset', this.resetValueHandler);
11628
11662
  }
11629
11663
  EventHandler.remove(this.inputElement, 'blur', this.onBlurHandler);
11630
- EventHandler.remove(this.componentWrapper, 'mousemove', this.mouseIn);
11664
+ EventHandler.remove(this.componentWrapper, 'mouseover', this.mouseIn);
11631
11665
  EventHandler.remove(this.componentWrapper, 'mouseout', this.mouseOut);
11632
11666
  EventHandler.remove(this.overAllClear, 'mousedown', this.clearAll);
11633
11667
  EventHandler.remove(this.inputElement, 'paste', this.pasteHandler);
@@ -11644,7 +11678,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
11644
11678
  'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)');
11645
11679
  }
11646
11680
  if (this.enableGroupCheckBox && this.mode === 'CheckBox' && !isNullOrUndefined(this.fields.groupBy)) {
11647
- let target = (event ? event.target : null);
11681
+ let target = (event ? (this.groupTemplate ? closest(event.target, '.e-list-group-item') : event.target) : null);
11648
11682
  target = (event && event.keyCode === 32) ? list : target;
11649
11683
  target = (target && target.classList.contains('e-frame')) ? target.parentElement.parentElement : target;
11650
11684
  if (target && target.classList.contains('e-list-group-item')) {
@@ -12041,6 +12075,24 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12041
12075
  }
12042
12076
  this.renderPopup();
12043
12077
  }
12078
+ presentItemValue(ulElement) {
12079
+ let valuecheck = [];
12080
+ for (let i = 0; i < this.value.length; i++) {
12081
+ let checkEle = this.findListElement(((this.allowFiltering && !isNullOrUndefined(this.mainList)) ? this.mainList : ulElement), 'li', 'data-value', this.value[i]);
12082
+ if (!checkEle) {
12083
+ valuecheck.push(this.value[i]);
12084
+ }
12085
+ }
12086
+ return valuecheck;
12087
+ }
12088
+ ;
12089
+ addNonPresentItems(valuecheck, ulElement, list, event) {
12090
+ this.dataSource.executeQuery(this.getForQuery(valuecheck)).then((e) => {
12091
+ this.addItem(e.result, list.length);
12092
+ this.updateActionList(ulElement, list, event);
12093
+ });
12094
+ }
12095
+ ;
12044
12096
  updateVal(newProp, oldProp, prop) {
12045
12097
  if (!this.list) {
12046
12098
  this.onLoadSelect();
@@ -12049,31 +12101,43 @@ let MultiSelect = class MultiSelect extends DropDownBase {
12049
12101
  this.onLoadSelect();
12050
12102
  }
12051
12103
  else {
12052
- if (prop === 'text') {
12053
- this.initialTextUpdate();
12054
- newProp = this.value;
12104
+ let valuecheck = [];
12105
+ if (!isNullOrUndefined(this.value) && !this.allowCustomValue) {
12106
+ valuecheck = this.presentItemValue(this.ulElement);
12055
12107
  }
12056
- if (isNullOrUndefined(this.value) || this.value.length === 0) {
12057
- this.tempValues = oldProp;
12108
+ if (prop == 'value' && valuecheck.length > 0 && this.dataSource instanceof DataManager && !isNullOrUndefined(this.value)
12109
+ && this.listData != null) {
12110
+ this.mainData = null;
12111
+ this.setDynValue = true;
12112
+ this.addNonPresentItems(valuecheck, this.ulElement, this.listData);
12058
12113
  }
12059
- // eslint-disable-next-line
12060
- if (this.allowCustomValue && (this.mode === 'Default' || this.mode === 'Box') && this.isReact && this.inputFocus
12061
- && this.isPopupOpen() && this.mainData !== this.listData) {
12062
- const list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;
12063
- this.onActionComplete(list, this.mainData);
12064
- }
12065
- this.initialValueUpdate();
12066
- if (this.mode !== 'Box' && !this.inputFocus) {
12067
- this.updateDelimView();
12068
- }
12069
- if (!this.inputFocus) {
12070
- this.refreshInputHight();
12071
- }
12072
- this.refreshPlaceHolder();
12073
- if (this.mode !== 'CheckBox' && this.changeOnBlur) {
12074
- this.updateValueState(null, newProp, oldProp);
12114
+ else {
12115
+ if (prop === 'text') {
12116
+ this.initialTextUpdate();
12117
+ newProp = this.value;
12118
+ }
12119
+ if (isNullOrUndefined(this.value) || this.value.length === 0) {
12120
+ this.tempValues = oldProp;
12121
+ }
12122
+ // eslint-disable-next-line
12123
+ if (this.allowCustomValue && (this.mode === 'Default' || this.mode === 'Box') && this.isReact && this.inputFocus
12124
+ && this.isPopupOpen() && this.mainData !== this.listData) {
12125
+ const list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;
12126
+ this.onActionComplete(list, this.mainData);
12127
+ }
12128
+ this.initialValueUpdate();
12129
+ if (this.mode !== 'Box' && !this.inputFocus) {
12130
+ this.updateDelimView();
12131
+ }
12132
+ if (!this.inputFocus) {
12133
+ this.refreshInputHight();
12134
+ }
12135
+ this.refreshPlaceHolder();
12136
+ if (this.mode !== 'CheckBox' && this.changeOnBlur) {
12137
+ this.updateValueState(null, newProp, oldProp);
12138
+ }
12139
+ this.checkPlaceholderSize();
12075
12140
  }
12076
- this.checkPlaceholderSize();
12077
12141
  }
12078
12142
  if (!this.changeOnBlur) {
12079
12143
  this.updateValueState(null, newProp, oldProp);
@@ -13550,9 +13614,6 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
13550
13614
  args.items = this.getDataByValues([dragValue]);
13551
13615
  }
13552
13616
  this.trigger('beforeDrop', args);
13553
- if (args.isDragAll !== null) {
13554
- this.allowDragAll = args.isDragAll;
13555
- }
13556
13617
  }
13557
13618
  dragEnd(args) {
13558
13619
  let listData;