@syncfusion/ej2-dropdowns 31.1.20 → 31.1.23

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 (60) hide show
  1. package/dist/ej2-dropdowns.min.js +3 -3
  2. package/dist/ej2-dropdowns.umd.min.js +3 -3
  3. package/dist/ej2-dropdowns.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-dropdowns.es2015.js +79 -11
  5. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  6. package/dist/es6/ej2-dropdowns.es5.js +106 -37
  7. package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
  8. package/dist/global/ej2-dropdowns.min.js +3 -3
  9. package/dist/global/ej2-dropdowns.min.js.map +1 -1
  10. package/dist/global/index.d.ts +2 -2
  11. package/package.json +4 -4
  12. package/src/combo-box/combo-box.js +1 -1
  13. package/src/drop-down-base/drop-down-base.js +10 -3
  14. package/src/drop-down-list/drop-down-list.js +45 -29
  15. package/src/drop-down-tree/drop-down-tree.js +11 -1
  16. package/src/multi-select/multi-select.d.ts +2 -0
  17. package/src/multi-select/multi-select.js +39 -3
  18. package/styles/bootstrap4-lite.css +1 -0
  19. package/styles/bootstrap4.css +5 -4
  20. package/styles/bootstrap5.3-lite.css +2 -0
  21. package/styles/bootstrap5.3.css +4 -2
  22. package/styles/fluent-dark.css +3 -3
  23. package/styles/fluent.css +3 -3
  24. package/styles/fluent2-lite.css +2 -0
  25. package/styles/fluent2.css +4 -2
  26. package/styles/highcontrast-light.css +0 -1
  27. package/styles/highcontrast-lite.css +1 -0
  28. package/styles/highcontrast.css +3 -3
  29. package/styles/material.css +2 -2
  30. package/styles/multi-select/_bigger.scss +4 -4
  31. package/styles/multi-select/_bootstrap4-definition.scss +1 -1
  32. package/styles/multi-select/_bootstrap5.3-definition.scss +1 -1
  33. package/styles/multi-select/_fluent-definition.scss +1 -1
  34. package/styles/multi-select/_fluent2-definition.scss +1 -1
  35. package/styles/multi-select/_highcontrast-definition.scss +1 -1
  36. package/styles/multi-select/_material-definition.scss +1 -1
  37. package/styles/multi-select/_tailwind-definition.scss +2 -2
  38. package/styles/multi-select/_tailwind3-definition.scss +1 -1
  39. package/styles/multi-select/bootstrap4.css +5 -4
  40. package/styles/multi-select/bootstrap5.3.css +4 -2
  41. package/styles/multi-select/fluent-dark.css +3 -3
  42. package/styles/multi-select/fluent.css +3 -3
  43. package/styles/multi-select/fluent2.css +4 -2
  44. package/styles/multi-select/highcontrast-light.css +0 -1
  45. package/styles/multi-select/highcontrast.css +3 -3
  46. package/styles/multi-select/icons/_bootstrap4.scss +1 -0
  47. package/styles/multi-select/icons/_bootstrap5.3.scss +2 -0
  48. package/styles/multi-select/icons/_fluent2.scss +2 -0
  49. package/styles/multi-select/icons/_highcontrast.scss +1 -0
  50. package/styles/multi-select/icons/_tailwind3.scss +2 -0
  51. package/styles/multi-select/material.css +2 -2
  52. package/styles/multi-select/tailwind-dark.css +5 -5
  53. package/styles/multi-select/tailwind.css +5 -5
  54. package/styles/multi-select/tailwind3.css +4 -2
  55. package/styles/tailwind-dark-lite.css +1 -1
  56. package/styles/tailwind-dark.css +5 -5
  57. package/styles/tailwind-lite.css +1 -1
  58. package/styles/tailwind.css +5 -5
  59. package/styles/tailwind3-lite.css +2 -0
  60. package/styles/tailwind3.css +4 -2
@@ -984,7 +984,14 @@ let DropDownBase = class DropDownBase extends Component {
984
984
  for (const item of dataSource) {
985
985
  if (!isNullOrUndefined(item)) {
986
986
  if (ignoreAccent) {
987
- value = this.checkingAccent(String(item), text, ignoreCase);
987
+ if (ignoreCase) {
988
+ if (this.checkIgnoreCase(String(item), text)) {
989
+ value = this.checkingAccent(String(item), text, ignoreCase);
990
+ }
991
+ }
992
+ else {
993
+ value = this.checkingAccent(String(item), text, ignoreCase);
994
+ }
988
995
  }
989
996
  else {
990
997
  if (ignoreCase) {
@@ -1454,9 +1461,9 @@ let DropDownBase = class DropDownBase extends Component {
1454
1461
  getJSONfromOption(items, options, fields, category = null) {
1455
1462
  for (const option of options) {
1456
1463
  const json = {};
1457
- json[fields.text] = option.innerText;
1464
+ json[fields.text] = option.innerHTML;
1458
1465
  json[fields.value] = !isNullOrUndefined(option.getAttribute(fields.value)) ?
1459
- option.getAttribute(fields.value) : option.innerText;
1466
+ option.getAttribute(fields.value) : option.innerHTML;
1460
1467
  if (!isNullOrUndefined(category)) {
1461
1468
  json[fields.groupBy] = category;
1462
1469
  }
@@ -3210,10 +3217,10 @@ let DropDownList = class DropDownList extends DropDownBase {
3210
3217
  floatLabelChange() {
3211
3218
  if (this.getModuleName() === 'dropdownlist' && this.floatLabelType === 'Auto') {
3212
3219
  const floatElement = this.inputWrapper.container.querySelector('.e-float-text');
3213
- if (this.inputElement.value !== '' || this.isInteracted) {
3220
+ if (floatElement && this.inputElement.value !== '' || this.isInteracted) {
3214
3221
  classList(floatElement, ['e-label-top'], ['e-label-bottom']);
3215
3222
  }
3216
- else {
3223
+ else if (floatElement) {
3217
3224
  classList(floatElement, ['e-label-bottom'], ['e-label-top']);
3218
3225
  }
3219
3226
  }
@@ -5846,8 +5853,24 @@ let DropDownList = class DropDownList extends DropDownBase {
5846
5853
  this.list.parentElement.style.height = '100%';
5847
5854
  }
5848
5855
  this.list.parentElement.style.paddingBottom = (this.getModuleName() === 'dropdownlist' && this.allowFiltering && this.searchBoxHeight) ? (this.searchBoxHeight + resizePaddingBottom).toString() + 'px' : resizePaddingBottom.toString() + 'px';
5849
- if (this.header || this.footer || this.itemTemplate) {
5850
- this.list.parentElement.style.paddingBottom = ((parseInt(this.list.parentElement.style.maxHeight, 10) - parseInt(this.list.style.maxHeight, 10)) + resizePaddingBottom).toString() + 'px';
5856
+ if (this.isReact && this.footer) {
5857
+ let listMaxHeight = this.list.style.maxHeight;
5858
+ const listParentElementMaxHeight = this.list.parentElement.style.maxHeight;
5859
+ let containerHeight = this.listContainerHeight;
5860
+ setTimeout(() => {
5861
+ this.footer = this.footer ? this.footer : popupEle.querySelector('.e-ddl-footer');
5862
+ const height = Math.round(this.footer.getBoundingClientRect().height);
5863
+ if (height > 0) {
5864
+ containerHeight = (parseInt(containerHeight, 10) - height).toString() + 'px';
5865
+ listMaxHeight = (parseInt(containerHeight, 10) - 2).toString() + 'px';
5866
+ this.list.parentElement.style.paddingBottom = ((parseInt(listParentElementMaxHeight, 10) - parseInt(listMaxHeight, 10)) + resizePaddingBottom).toString() + 'px';
5867
+ }
5868
+ }, 1);
5869
+ }
5870
+ else {
5871
+ if (this.header || this.footer || this.itemTemplate) {
5872
+ this.list.parentElement.style.paddingBottom = ((parseInt(this.list.parentElement.style.maxHeight, 10) - parseInt(this.list.style.maxHeight, 10)) + resizePaddingBottom).toString() + 'px';
5873
+ }
5851
5874
  }
5852
5875
  this.list.parentElement.appendChild(this.resizer);
5853
5876
  //hold the popup resize
@@ -8679,8 +8702,14 @@ let DropDownTree = class DropDownTree extends Component {
8679
8702
  return remainElement;
8680
8703
  }
8681
8704
  getOverflowVal(index) {
8705
+ let textSelected;
8682
8706
  const selectedData = this.getSelectedData(this.value[parseInt(index.toString(), 10)]);
8683
- return getValue(this.treeSettings.loadOnDemand ? this.fields.text : 'text', selectedData);
8707
+ const node = this.treeObj.getNode(this.value[index]);
8708
+ textSelected = getValue(this.treeSettings.loadOnDemand ? this.fields.text : 'text', selectedData);
8709
+ if (isNullOrUndefined(textSelected) && !isNullOrUndefined(node.text)) {
8710
+ textSelected = node.text.toString();
8711
+ }
8712
+ return textSelected;
8684
8713
  }
8685
8714
  updateDelimMode() {
8686
8715
  if (this.mode !== 'Box') {
@@ -10024,7 +10053,11 @@ let DropDownTree = class DropDownTree extends Component {
10024
10053
  const compiledString = this.initializeValueTemplate();
10025
10054
  for (let i = 0, len = this.value.length; i < len; i++) {
10026
10055
  selectedData = this.getSelectedData(this.value[i]);
10056
+ const node = this.treeObj.getNode(this.value[i]);
10027
10057
  text = getValue(this.treeSettings.loadOnDemand ? this.fields.text : 'text', selectedData);
10058
+ if (isNullOrUndefined(text) && !isNullOrUndefined(node.text)) {
10059
+ text = node.text.toString();
10060
+ }
10028
10061
  this.selectedText.push(text);
10029
10062
  temp = this.selectedText[this.selectedText.length - 1];
10030
10063
  if (this.selectedText.length > 1) {
@@ -11697,7 +11730,7 @@ let ComboBox = class ComboBox extends DropDownList {
11697
11730
  }
11698
11731
  }
11699
11732
  getValueByText(text) {
11700
- return super.getValueByText(text, true, this.ignoreAccent);
11733
+ return super.getValueByText(text, this.ignoreCase, this.ignoreAccent);
11701
11734
  }
11702
11735
  unWireEvent() {
11703
11736
  if (this.getModuleName() === 'combobox') {
@@ -13945,6 +13978,11 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13945
13978
  this.removeFocus();
13946
13979
  }
13947
13980
  }
13981
+ secureRandom() {
13982
+ const array = new Uint32Array(1);
13983
+ window.crypto.getRandomValues(array);
13984
+ return array[0] / (0xFFFFFFFF + 1);
13985
+ }
13948
13986
  checkForCustomValue(query, fields) {
13949
13987
  const dataChecks = !this.getValueByText(this.inputElement.value, this.ignoreCase);
13950
13988
  const field = fields ? fields : this.fields;
@@ -13958,7 +13996,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13958
13996
  setValue(field.text, value, dataItem);
13959
13997
  if (typeof getValue((this.fields.value ? this.fields.value : 'value'), customData)
13960
13998
  === 'number' && this.fields.value !== this.fields.text) {
13961
- setValue(field.value, Math.random(), dataItem);
13999
+ setValue(field.value, this.secureRandom(), dataItem);
13962
14000
  }
13963
14001
  else {
13964
14002
  setValue(field.value, value, dataItem);
@@ -14079,6 +14117,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14079
14117
  e.preventDefault();
14080
14118
  }
14081
14119
  this.checkAndScrollParent();
14120
+ if (this.maximumSelectionLength === 0) {
14121
+ this.checkMaxSelection();
14122
+ }
14082
14123
  }
14083
14124
  checkAndScrollParent() {
14084
14125
  let scrollElement = this.overAllWrapper ? this.overAllWrapper.parentElement : null;
@@ -15672,8 +15713,21 @@ let MultiSelect = class MultiSelect extends DropDownBase {
15672
15713
  this.updateChipStatus();
15673
15714
  this.checkMaxSelection();
15674
15715
  }
15716
+ updateListItemsState(list) {
15717
+ const activeItems = list.querySelectorAll('li.' + dropDownBaseClasses.li + '.e-active');
15718
+ removeClass(activeItems, 'e-disable');
15719
+ const inactiveItems = list.querySelectorAll('li.' + dropDownBaseClasses.li + ':not(.e-active)');
15720
+ addClass(inactiveItems, 'e-disable');
15721
+ }
15675
15722
  checkMaxSelection() {
15676
15723
  const limit = this.value && this.value.length ? this.value.length : 0;
15724
+ if (this.maximumSelectionLength === 0) {
15725
+ this.updateListItemsState(this.list);
15726
+ if (this.mainList) {
15727
+ this.updateListItemsState(this.mainList);
15728
+ }
15729
+ return;
15730
+ }
15677
15731
  if (limit === this.maximumSelectionLength) {
15678
15732
  const activeItems = this.list.querySelectorAll('li.'
15679
15733
  + dropDownBaseClasses.li + '.e-active');
@@ -18851,7 +18905,21 @@ let MultiSelect = class MultiSelect extends DropDownBase {
18851
18905
  }
18852
18906
  this.list.parentElement.style.boxSizing = 'border-box'; // Ensures padding doesn't affect element size
18853
18907
  const paddingBottom = this.mode === 'CheckBox' && this.searchBoxHeight ? this.searchBoxHeight + resizePaddingBottom + (this.showSelectAll ? this.storedSelectAllHeight : 0) : resizePaddingBottom;
18854
- this.list.parentElement.style.paddingBottom = `${paddingBottom}px`;
18908
+ if (this.footer) {
18909
+ let listMaxHeight = this.list.style.maxHeight;
18910
+ const listParentElementMaxHeight = this.list.parentElement.style.maxHeight;
18911
+ setTimeout(() => {
18912
+ const height = Math.round(this.footer.getBoundingClientRect().height);
18913
+ const containerHeight = (parseInt(listParentElementMaxHeight, 10) - height).toString() + 'px';
18914
+ listMaxHeight = (parseInt(containerHeight, 10) - 2).toString() + 'px';
18915
+ if (height > 0) {
18916
+ this.list.parentElement.style.paddingBottom = ((parseInt(listParentElementMaxHeight, 10) - parseInt(listMaxHeight, 10)) + paddingBottom).toString() + 'px';
18917
+ }
18918
+ }, 1);
18919
+ }
18920
+ else {
18921
+ this.list.parentElement.style.paddingBottom = `${paddingBottom}px`;
18922
+ }
18855
18923
  this.list.parentElement.appendChild(this.resizer);
18856
18924
  this.list.parentElement.style.width = this.resizeWidth + 'px';
18857
18925
  this.list.parentElement.style.height = this.resizeHeight + 'px';