@syncfusion/ej2-dropdowns 24.2.8 → 24.2.9

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 (54) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/ej2-dropdowns.min.js +2 -2
  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 +66 -28
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +67 -28
  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 +7 -7
  13. package/src/combo-box/combo-box-model.d.ts +1 -1
  14. package/src/combo-box/combo-box.js +29 -2
  15. package/src/drop-down-base/drop-down-base.d.ts +1 -0
  16. package/src/drop-down-base/drop-down-base.js +1 -1
  17. package/src/drop-down-list/drop-down-list.d.ts +0 -1
  18. package/src/drop-down-list/drop-down-list.js +33 -24
  19. package/src/mention/mention.js +5 -1
  20. package/styles/bootstrap-dark.css +1 -1
  21. package/styles/bootstrap.css +1 -1
  22. package/styles/bootstrap4.css +1 -1
  23. package/styles/bootstrap5-dark.css +1 -1
  24. package/styles/bootstrap5.css +1 -1
  25. package/styles/drop-down-list/_layout.scss +1 -1
  26. package/styles/drop-down-list/bootstrap-dark.css +1 -1
  27. package/styles/drop-down-list/bootstrap.css +1 -1
  28. package/styles/drop-down-list/bootstrap4.css +1 -1
  29. package/styles/drop-down-list/bootstrap5-dark.css +1 -1
  30. package/styles/drop-down-list/bootstrap5.css +1 -1
  31. package/styles/drop-down-list/fabric-dark.css +1 -1
  32. package/styles/drop-down-list/fabric.css +1 -1
  33. package/styles/drop-down-list/fluent-dark.css +1 -1
  34. package/styles/drop-down-list/fluent.css +1 -1
  35. package/styles/drop-down-list/highcontrast-light.css +1 -1
  36. package/styles/drop-down-list/highcontrast.css +1 -1
  37. package/styles/drop-down-list/material-dark.css +1 -1
  38. package/styles/drop-down-list/material.css +1 -1
  39. package/styles/drop-down-list/material3-dark.css +1 -1
  40. package/styles/drop-down-list/material3.css +1 -1
  41. package/styles/drop-down-list/tailwind-dark.css +1 -1
  42. package/styles/drop-down-list/tailwind.css +1 -1
  43. package/styles/fabric-dark.css +1 -1
  44. package/styles/fabric.css +1 -1
  45. package/styles/fluent-dark.css +1 -1
  46. package/styles/fluent.css +1 -1
  47. package/styles/highcontrast-light.css +1 -1
  48. package/styles/highcontrast.css +1 -1
  49. package/styles/material-dark.css +1 -1
  50. package/styles/material.css +1 -1
  51. package/styles/material3-dark.css +1 -1
  52. package/styles/material3.css +1 -1
  53. package/styles/tailwind-dark.css +1 -1
  54. package/styles/tailwind.css +1 -1
@@ -1068,7 +1068,7 @@ let DropDownBase = class DropDownBase extends Component {
1068
1068
  this.trigger('actionComplete', e, (e) => {
1069
1069
  if (!this.virtualGroupDataSource && this.isVirtualizationEnabled) {
1070
1070
  this.isRemoteDataUpdated = true;
1071
- if ((this.getModuleName() === 'combobox' && this.isAllowFiltering && this.isVirtualizationEnabled && e.result)) {
1071
+ if ((this.getModuleName() === 'combobox' && !this.initialRemoteRender && this.isAllowFiltering && this.isVirtualizationEnabled && e.result)) {
1072
1072
  e.result = e.result.result;
1073
1073
  }
1074
1074
  if (e.result.length > 0) {
@@ -2263,7 +2263,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2263
2263
  this.isFilterFocus = false;
2264
2264
  this.beforePopupOpen = false;
2265
2265
  this.initial = true;
2266
- this.initRemoteRender = false;
2266
+ this.initialRemoteRender = false;
2267
2267
  this.isNotSearchList = false;
2268
2268
  this.isTyped = false;
2269
2269
  this.isSelected = false;
@@ -2552,7 +2552,7 @@ let DropDownList = class DropDownList extends DropDownBase {
2552
2552
  this.viewPortInfo.endIndex = this.virtualItemEndIndex = this.itemCount;
2553
2553
  this.renderList();
2554
2554
  if (this.dataSource instanceof DataManager) {
2555
- this.initRemoteRender = true;
2555
+ this.initialRemoteRender = true;
2556
2556
  }
2557
2557
  else {
2558
2558
  this.updateValues();
@@ -3538,17 +3538,15 @@ let DropDownList = class DropDownList extends DropDownBase {
3538
3538
  this.setSelectOptions(li, e);
3539
3539
  if (this.enableVirtualization) {
3540
3540
  const fields = (this.fields.value) ? this.fields.value : '';
3541
- if (this.dataSource instanceof DataManager) {
3542
- this.dataSource.executeQuery(new Query().where(new Predicate(fields, 'equal', this.value)))
3543
- .then((e) => {
3544
- if (e.result.length > 0) {
3545
- this.itemData = e.result[0];
3546
- const dataItem = this.getItemData();
3547
- if ((this.value === dataItem.value && this.text !== dataItem.text) || (this.value !== dataItem.value && this.text === dataItem.text)) {
3548
- this.setProperties({ 'text': dataItem.text, 'value': dataItem.value });
3549
- }
3541
+ if (this.dataSource instanceof DataManager && this.virtualGroupDataSource) {
3542
+ const getItem = new DataManager(this.virtualGroupDataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', this.value)));
3543
+ if (getItem && getItem.length > 0) {
3544
+ this.itemData = getItem[0];
3545
+ const dataItem = this.getItemData();
3546
+ if ((this.value === dataItem.value && this.text !== dataItem.text) || (this.value !== dataItem.value && this.text === dataItem.text)) {
3547
+ this.setProperties({ 'text': dataItem.text, 'value': dataItem.value });
3550
3548
  }
3551
- });
3549
+ }
3552
3550
  }
3553
3551
  else {
3554
3552
  const getItem = new DataManager(this.dataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', this.value)));
@@ -4202,15 +4200,19 @@ let DropDownList = class DropDownList extends DropDownBase {
4202
4200
  if (!isNullOrUndefined(ulElement)) {
4203
4201
  attributes(ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false', 'aria-label': 'listbox' });
4204
4202
  }
4205
- if (this.initRemoteRender) {
4203
+ if (this.initialRemoteRender) {
4206
4204
  this.initial = true;
4207
4205
  this.activeIndex = this.index;
4208
- this.initRemoteRender = false;
4206
+ this.initialRemoteRender = false;
4209
4207
  if (this.value && this.dataSource instanceof DataManager) {
4210
4208
  const checkField = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
4211
4209
  const fieldValue = this.fields.value.split('.');
4212
- const checkVal = list.some((x) => isNullOrUndefined(x[checkField]) && fieldValue.length > 1 ?
4210
+ let checkVal = list.some((x) => isNullOrUndefined(x[checkField]) && fieldValue.length > 1 ?
4213
4211
  this.checkFieldValue(x, fieldValue) === this.value : x[checkField] === this.value);
4212
+ if (this.enableVirtualization && this.virtualGroupDataSource) {
4213
+ checkVal = this.virtualGroupDataSource.some((x) => isNullOrUndefined(x[checkField]) && fieldValue.length > 1 ?
4214
+ this.checkFieldValue(x, fieldValue) === this.value : x[checkField] === this.value);
4215
+ }
4214
4216
  if (!checkVal) {
4215
4217
  this.dataSource.executeQuery(this.getQuery(this.query).where(new Predicate(checkField, 'equal', this.value)))
4216
4218
  .then((e) => {
@@ -4524,6 +4526,9 @@ let DropDownList = class DropDownList extends DropDownBase {
4524
4526
  this.getFocusElement();
4525
4527
  this.checkCollision(popupEle);
4526
4528
  if (Browser.isDevice) {
4529
+ if ((parseInt(this.popupWidth.toString(), 10) > window.outerWidth) && !(this.getModuleName() === 'dropdownlist' && this.allowFiltering)) {
4530
+ this.popupObj.element.classList.add('e-wide-popup');
4531
+ }
4527
4532
  this.popupObj.element.classList.add(dropDownListClasses.device);
4528
4533
  if (this.getModuleName() === 'dropdownlist' || (this.getModuleName() === 'combobox'
4529
4534
  && !this.allowFiltering && this.isDropDownClick)) {
@@ -5030,8 +5035,8 @@ let DropDownList = class DropDownList extends DropDownBase {
5030
5035
  }
5031
5036
  }
5032
5037
  });
5033
- if (this.isReact && this.isFiltering() && this.itemTemplate != null) {
5034
- this.actionCompleteData.ulElement = this.ulElement.cloneNode(true);
5038
+ if (Browser.isDevice && !eventArgs.cancel && this.popupObj.element.classList.contains('e-wide-popup')) {
5039
+ this.popupObj.element.classList.remove('e-wide-popup');
5035
5040
  }
5036
5041
  let dataSourceCount;
5037
5042
  if (this.dataSource instanceof DataManager) {
@@ -5458,11 +5463,11 @@ let DropDownList = class DropDownList extends DropDownBase {
5458
5463
  }
5459
5464
  if (!this.list) {
5460
5465
  if (this.dataSource instanceof DataManager) {
5461
- this.initRemoteRender = true;
5466
+ this.initialRemoteRender = true;
5462
5467
  }
5463
5468
  this.renderList();
5464
5469
  }
5465
- if (!this.initRemoteRender) {
5470
+ if (!this.initialRemoteRender) {
5466
5471
  const li = this.getElementByText(newProp.text);
5467
5472
  if (!this.checkValidLi(li)) {
5468
5473
  if (this.liCollections && this.liCollections.length === 100 &&
@@ -5511,11 +5516,11 @@ let DropDownList = class DropDownList extends DropDownBase {
5511
5516
  this.notify('beforeValueChange', { newProp: newProp }); // gird component value type change
5512
5517
  if (!this.list) {
5513
5518
  if (this.dataSource instanceof DataManager) {
5514
- this.initRemoteRender = true;
5519
+ this.initialRemoteRender = true;
5515
5520
  }
5516
5521
  this.renderList();
5517
5522
  }
5518
- if (!this.initRemoteRender) {
5523
+ if (!this.initialRemoteRender) {
5519
5524
  const item = this.getElementByValue(newProp.value);
5520
5525
  if (!this.checkValidLi(item)) {
5521
5526
  if (this.liCollections && this.liCollections.length === 100 &&
@@ -5555,11 +5560,11 @@ let DropDownList = class DropDownList extends DropDownBase {
5555
5560
  }
5556
5561
  if (!this.list) {
5557
5562
  if (this.dataSource instanceof DataManager) {
5558
- this.initRemoteRender = true;
5563
+ this.initialRemoteRender = true;
5559
5564
  }
5560
5565
  this.renderList();
5561
5566
  }
5562
- if (!this.initRemoteRender && this.liCollections) {
5567
+ if (!this.initialRemoteRender && this.liCollections) {
5563
5568
  const element = this.liCollections[newProp.index];
5564
5569
  if (!this.checkValidLi(element)) {
5565
5570
  if (this.liCollections && this.liCollections.length === 100 &&
@@ -5720,6 +5725,9 @@ let DropDownList = class DropDownList extends DropDownBase {
5720
5725
  }
5721
5726
  else if (isNullOrUndefined(this.list) || !isUndefined(this.list) && (this.list.classList.contains(dropDownBaseClasses.noData) ||
5722
5727
  this.list.querySelectorAll('.' + dropDownBaseClasses.li).length <= 0)) {
5728
+ if (this.isReact && this.isFiltering() && this.itemTemplate != null) {
5729
+ this.isSecondClick = false;
5730
+ }
5723
5731
  this.renderList(e);
5724
5732
  }
5725
5733
  if (this.enableVirtualization && this.listData && this.listData.length) {
@@ -5926,7 +5934,7 @@ let DropDownList = class DropDownList extends DropDownBase {
5926
5934
  getItems() {
5927
5935
  if (!this.list) {
5928
5936
  if (this.dataSource instanceof DataManager) {
5929
- this.initRemoteRender = true;
5937
+ this.initialRemoteRender = true;
5930
5938
  }
5931
5939
  this.renderList();
5932
5940
  }
@@ -9411,13 +9419,39 @@ let ComboBox = class ComboBox extends DropDownList {
9411
9419
  updateValues() {
9412
9420
  if (!isNullOrUndefined(this.value)) {
9413
9421
  const li = this.getElementByValue(this.value);
9422
+ let isExistItem = !isNullOrUndefined(li) ? true : false;
9423
+ if (this.enableVirtualization && this.value) {
9424
+ const fields = (this.fields.value) ? this.fields.value : '';
9425
+ if (this.dataSource instanceof DataManager && this.virtualGroupDataSource) {
9426
+ const getItem = new DataManager(this.virtualGroupDataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', this.value)));
9427
+ if (getItem && getItem.length > 0) {
9428
+ this.itemData = getItem[0];
9429
+ isExistItem = true;
9430
+ const dataItem = this.getItemData();
9431
+ if ((this.value === dataItem.value && this.text !== dataItem.text) || (this.value !== dataItem.value && this.text === dataItem.text)) {
9432
+ this.setProperties({ 'text': dataItem.text, 'value': dataItem.value });
9433
+ }
9434
+ }
9435
+ }
9436
+ else {
9437
+ const getItem = new DataManager(this.dataSource).executeLocal(new Query().where(new Predicate(fields, 'equal', this.value)));
9438
+ if (getItem && getItem.length > 0) {
9439
+ this.itemData = getItem[0];
9440
+ isExistItem = true;
9441
+ const dataItem = this.getItemData();
9442
+ if ((this.value === dataItem.value && this.text !== dataItem.text) || (this.value !== dataItem.value && this.text === dataItem.text)) {
9443
+ this.setProperties({ 'text': dataItem.text, 'value': dataItem.value });
9444
+ }
9445
+ }
9446
+ }
9447
+ }
9414
9448
  if (li) {
9415
9449
  this.setSelection(li, null);
9416
9450
  }
9417
- else if (this.allowCustom) {
9451
+ else if ((!this.enableVirtualization && this.allowCustom) || (this.allowCustom && this.enableVirtualization && !isExistItem)) {
9418
9452
  this.valueMuteChange(this.value);
9419
9453
  }
9420
- else {
9454
+ else if (!this.enableVirtualization || (this.enableVirtualization && !isExistItem)) {
9421
9455
  this.valueMuteChange(null);
9422
9456
  }
9423
9457
  }
@@ -18499,7 +18533,7 @@ let Mention = class Mention extends DropDownBase {
18499
18533
  this.range.startContainer.previousElementSibling && this.range.startContainer.previousElementSibling.tagName !== 'BR' && this.range.startContainer.textContent.split('').length > 0 &&
18500
18534
  (rangetextContent.length === 1 || rangetextContent[rangetextContent.length - 2].indexOf('') === -1 ||
18501
18535
  this.range.startContainer.nodeType === 1))) {
18502
- if (this.allowSpaces && currentRange && currentRange.trim() !== '' && charRegex.test(currentRange) && currentRange.indexOf(this.mentionChar) !== -1
18536
+ if (this.isPopupOpen && this.allowSpaces && currentRange && currentRange.trim() !== '' && charRegex.test(currentRange) && currentRange.indexOf(this.mentionChar) !== -1
18503
18537
  && !this.isMatchedText() && (currentRange.length > 1 && currentRange.replace(/\u00A0/g, ' ').charAt(currentRange.length - 2) !== ' ') &&
18504
18538
  (this.list && this.list.querySelectorAll('ul').length > 0)) {
18505
18539
  this.queryString = currentRange.substring(currentRange.lastIndexOf(this.mentionChar) + 1).replace('\u00a0', ' ');
@@ -19002,6 +19036,9 @@ let Mention = class Mention extends DropDownBase {
19002
19036
  this.popupObj.element.removeAttribute('style');
19003
19037
  this.popupObj.element.removeAttribute('aria-disabled');
19004
19038
  }
19039
+ if (this.list.classList.contains('e-nodata')) {
19040
+ this.list = null;
19041
+ }
19005
19042
  }
19006
19043
  onDocumentClick(e) {
19007
19044
  const target = e.target;
@@ -19112,6 +19149,7 @@ let Mention = class Mention extends DropDownBase {
19112
19149
  return coordinates;
19113
19150
  }
19114
19151
  initValue() {
19152
+ this.isDataFetched = false;
19115
19153
  this.renderList();
19116
19154
  if (this.dataSource instanceof DataManager) {
19117
19155
  this.initRemoteRender = true;