@syncfusion/ej2-dropdowns 33.2.6 → 33.2.8

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 (33) hide show
  1. package/dist/ej2-dropdowns.min.js +1 -10
  2. package/dist/ej2-dropdowns.umd.min.js +1 -10
  3. package/dist/ej2-dropdowns.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-dropdowns.es2015.js +46 -6
  5. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  6. package/dist/es6/ej2-dropdowns.es5.js +47 -6
  7. package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
  8. package/dist/global/ej2-dropdowns.min.js +1 -10
  9. package/dist/global/ej2-dropdowns.min.js.map +1 -1
  10. package/dist/global/index.d.ts +0 -9
  11. package/package.json +4 -4
  12. package/src/drop-down-base/drop-down-base.js +2 -1
  13. package/src/drop-down-list/drop-down-list.js +3 -0
  14. package/src/drop-down-tree/drop-down-tree.d.ts +1 -0
  15. package/src/drop-down-tree/drop-down-tree.js +13 -0
  16. package/src/mention/mention.js +5 -1
  17. package/src/multi-select/multi-select.d.ts +1 -0
  18. package/src/multi-select/multi-select.js +24 -4
  19. package/styles/bds-lite.css +2 -2
  20. package/styles/bds.css +4 -4
  21. package/styles/drop-down-tree/_bigger.scss +25 -4
  22. package/styles/drop-down-tree/_layout.scss +18 -3
  23. package/styles/drop-down-tree/_material3-dark-definition.scss +2 -0
  24. package/styles/drop-down-tree/_material3-definition.scss +2 -0
  25. package/styles/drop-down-tree/_theme.scss +9 -1
  26. package/styles/drop-down-tree/material3-dark.css +244 -1
  27. package/styles/drop-down-tree/material3.css +244 -1
  28. package/styles/material3-dark-lite.css +106 -1
  29. package/styles/material3-dark.css +244 -1
  30. package/styles/material3-lite.css +106 -1
  31. package/styles/material3.css +244 -1
  32. package/styles/multi-select/_bds-definition.scss +4 -4
  33. package/styles/multi-select/bds.css +4 -4
@@ -3033,7 +3033,8 @@ let DropDownBase = class DropDownBase extends Component {
3033
3033
  }
3034
3034
  else {
3035
3035
  for (const item of this.listData) {
3036
- if (!isNullOrUndefined(item) && getValue((this.fields.value ? this.fields.value : 'value'), item) === value) {
3036
+ if (!isNullOrUndefined(item) && (getValue((this.fields.value ? this.fields.value : 'value'), item) === value
3037
+ || this.getModuleName() === 'multiselect' && this.isVirtualizationEnabled && this.properties.allowCustomValue && getValue((this.fields.value ? this.fields.value : 'value'), item) === value.toString())) {
3037
3038
  return item;
3038
3039
  }
3039
3040
  }
@@ -4753,6 +4754,9 @@ let DropDownList = class DropDownList extends DropDownBase {
4753
4754
  (this.previousValue != null && this.isObjectInArray(this.previousValue, [this.allowCustom &&
4754
4755
  this.isObjectCustomValue ? this.value ? this.value : dataItem : dataItem.value ?
4755
4756
  this.getDataByValue(dataItem.value) : dataItem])))) {
4757
+ if (this.getModuleName() === 'combobox' && this.autoFill && e && (e.type === 'click' || e.action === 'enter')) {
4758
+ return false;
4759
+ }
4756
4760
  this.isSelected = false;
4757
4761
  return true;
4758
4762
  }
@@ -8107,6 +8111,7 @@ let DropDownTree = class DropDownTree extends Component {
8107
8111
  // Specifies if the checkAll method has been called
8108
8112
  this.isCheckAllCalled = false;
8109
8113
  this.isFromFilterChange = false;
8114
+ this.fallbackValue = [];
8110
8115
  }
8111
8116
  /**
8112
8117
  * Get the properties to be maintained in the persisted state.
@@ -9342,6 +9347,10 @@ let DropDownTree = class DropDownTree extends Component {
9342
9347
  }
9343
9348
  setTreeValue() {
9344
9349
  if (this.value !== null && this.value.length !== 0) {
9350
+ const dataReady = this.treeItems && this.treeItems.length > 0;
9351
+ if (!dataReady && this.fallbackValue.length === 0) {
9352
+ this.fallbackValue = this.value.slice();
9353
+ }
9345
9354
  let data;
9346
9355
  if (this.showCheckBox || this.allowMultiSelection) {
9347
9356
  for (let i = this.value.length - 1; i >= 0; i--) {
@@ -11001,6 +11010,13 @@ let DropDownTree = class DropDownTree extends Component {
11001
11010
  break;
11002
11011
  case 'fields':
11003
11012
  this.setFields();
11013
+ setTimeout(() => {
11014
+ if (this.value.length === 0 && this.fallbackValue.length > 0) {
11015
+ this.value = this.fallbackValue;
11016
+ this.updateValue(this.fallbackValue);
11017
+ this.fallbackValue = [];
11018
+ }
11019
+ }, 1);
11004
11020
  break;
11005
11021
  case 'readonly':
11006
11022
  Input.setReadonly(newProp.readonly, this.inputEle);
@@ -13931,7 +13947,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13931
13947
  else {
13932
13948
  this.updateActionList(ulElement, list, e);
13933
13949
  }
13934
- if (this.dataSource instanceof DataManager && this.allowCustomValue && !this.isCustomRendered &&
13950
+ if (this.dataSource instanceof DataManager && this.allowCustomValue && (!this.isCustomRendered || this.enableVirtualization) &&
13935
13951
  this.inputElement.value && this.inputElement.value !== '') {
13936
13952
  let query = new Query();
13937
13953
  query = this.allowFiltering ? query.where(this.fields.text, 'startswith', this.inputElement.value, this.ignoreCase, this.ignoreAccent) : query;
@@ -14420,8 +14436,12 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14420
14436
  window.crypto.getRandomValues(array);
14421
14437
  return array[0] / (0xFFFFFFFF + 1);
14422
14438
  }
14439
+ isInvalidString(value) {
14440
+ return !value || value.trim().length === 0;
14441
+ }
14423
14442
  checkForCustomValue(query, fields) {
14424
- const dataChecks = !this.getValueByText(this.inputElement.value, this.ignoreCase);
14443
+ const dataChecks = !this.getValueByText(this.inputElement.value, this.ignoreCase) &&
14444
+ !this.isInvalidString(this.inputElement.value);
14425
14445
  const field = fields ? fields : this.fields;
14426
14446
  this.isCustomReset = true;
14427
14447
  if (this.allowCustomValue && dataChecks) {
@@ -14455,7 +14475,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
14455
14475
  if (this.enableVirtualization) {
14456
14476
  this.virtualCustomData = dataItem;
14457
14477
  const tempData = this.dataSource instanceof DataManager ?
14458
- JSON.parse(JSON.stringify(this.listData)) : JSON.parse(JSON.stringify(this.dataSource));
14478
+ JSON.parse(JSON.stringify(this.mainData)) : JSON.parse(JSON.stringify(this.dataSource));
14459
14479
  let totalData = [];
14460
14480
  if (this.virtualCustomSelectData && this.virtualCustomSelectData.length > 0) {
14461
14481
  totalData = tempData.concat(this.virtualCustomSelectData);
@@ -17353,7 +17373,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
17353
17373
  this.allowCustomValue &&
17354
17374
  ((!(this.dataSource instanceof DataManager)) ||
17355
17375
  (this.dataSource instanceof DataManager && isInitialVirtualData)))) {
17356
- const indexItem = this.listData.length;
17376
+ const indexItem = this.dataSource instanceof DataManager ? this.totalItemCount : this.listData.length;
17357
17377
  let newValue = {};
17358
17378
  setValue(this.fields.text, value, newValue);
17359
17379
  setValue(this.fields.value, value, newValue);
@@ -18068,12 +18088,24 @@ let MultiSelect = class MultiSelect extends DropDownBase {
18068
18088
  temp = this.viewWrapper.innerHTML;
18069
18089
  this.updateWrapperText(this.viewWrapper, data);
18070
18090
  }
18091
+ let display;
18092
+ let topElement;
18093
+ if (this.componentWrapper.offsetWidth === 0 && this.componentWrapper.parentElement) {
18094
+ topElement = this.componentWrapper.parentElement.parentElement;
18095
+ if (!isNullOrUndefined(topElement) && topElement.style.display === 'none') {
18096
+ display = topElement.style.display;
18097
+ topElement.style.display = 'block';
18098
+ }
18099
+ }
18071
18100
  wrapperleng = this.viewWrapper.offsetWidth +
18072
18101
  parseInt(window.getComputedStyle(this.viewWrapper).paddingRight, 10) +
18073
18102
  parseInt(window.getComputedStyle(this.viewWrapper).paddingLeft, 10);
18074
18103
  overAllContainer = this.componentWrapper.offsetWidth -
18075
18104
  parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft, 10) -
18076
18105
  parseInt(window.getComputedStyle(this.componentWrapper).paddingRight, 10);
18106
+ if (!isNullOrUndefined(display) && display === 'none' && !isNullOrUndefined(topElement)) {
18107
+ topElement.style.display = 'none';
18108
+ }
18077
18109
  if ((wrapperleng + downIconWidth + this.clearIconWidth) > overAllContainer) {
18078
18110
  if (tempData !== undefined && tempData !== '') {
18079
18111
  temp = tempData;
@@ -19816,6 +19848,10 @@ let MultiSelect = class MultiSelect extends DropDownBase {
19816
19848
  }, 100);
19817
19849
  this.initStatus = true;
19818
19850
  }
19851
+ else {
19852
+ this.initialValueUpdate(this.value, true, isInitialRender);
19853
+ this.initialUpdate();
19854
+ }
19819
19855
  });
19820
19856
  }
19821
19857
  else {
@@ -24039,8 +24075,12 @@ let Mention = class Mention extends DropDownBase {
24039
24075
  ? lastWordRange.substring(lastWordRange.lastIndexOf(this.mentionChar) + 1).trim()
24040
24076
  : lastWordRange.replace(this.mentionChar, '');
24041
24077
  }
24078
+ if (this.queryString !== '' && e.keyCode === 8 && lastWordRange.includes(this.mentionChar) && !this.isPopupOpen &&
24079
+ ((typeof this.displayTemplate === 'function' ? this.displayTemplate() : this.displayTemplate)).includes(this.mentionChar)) {
24080
+ this.queryString = '';
24081
+ }
24042
24082
  if (this.mentionChar.charCodeAt(0) === lastWordRange.charCodeAt(0) &&
24043
- this.queryString !== '' && e.keyCode !== 38 && e.keyCode !== 40 && e.keyCode !== 8 && !this.lineBreak) {
24083
+ this.queryString !== '' && e.keyCode !== 38 && e.keyCode !== 40 && !this.lineBreak) {
24044
24084
  this.searchLists(e);
24045
24085
  if (!this.isPopupOpen && this.queryString.length >= this.minLength) {
24046
24086
  if (!this.isContentEditable(this.inputElement)) {