@syncfusion/ej2-multicolumn-combobox 28.2.6 → 28.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 (76) hide show
  1. package/dist/ej2-multicolumn-combobox.umd.min.js +2 -2
  2. package/dist/ej2-multicolumn-combobox.umd.min.js.map +1 -1
  3. package/dist/es6/ej2-multicolumn-combobox.es2015.js +59 -14
  4. package/dist/es6/ej2-multicolumn-combobox.es2015.js.map +1 -1
  5. package/dist/es6/ej2-multicolumn-combobox.es5.js +60 -14
  6. package/dist/es6/ej2-multicolumn-combobox.es5.js.map +1 -1
  7. package/dist/global/ej2-multicolumn-combobox.min.js +2 -2
  8. package/dist/global/ej2-multicolumn-combobox.min.js.map +1 -1
  9. package/dist/global/index.d.ts +1 -1
  10. package/package.json +7 -7
  11. package/src/multicolumn-combobox/multi-column-combo-box.d.ts +2 -0
  12. package/src/multicolumn-combobox/multi-column-combo-box.js +59 -13
  13. package/styles/bds-lite.css +8 -0
  14. package/styles/bds.css +8 -0
  15. package/styles/bootstrap-dark-lite.css +8 -0
  16. package/styles/bootstrap-dark.css +8 -0
  17. package/styles/bootstrap-lite.css +8 -0
  18. package/styles/bootstrap.css +8 -0
  19. package/styles/bootstrap4-lite.css +8 -0
  20. package/styles/bootstrap4.css +8 -0
  21. package/styles/bootstrap5-dark-lite.css +8 -0
  22. package/styles/bootstrap5-dark.css +8 -0
  23. package/styles/bootstrap5-lite.css +8 -0
  24. package/styles/bootstrap5.3-lite.css +8 -0
  25. package/styles/bootstrap5.3.css +8 -0
  26. package/styles/bootstrap5.css +8 -0
  27. package/styles/fabric-dark-lite.css +8 -0
  28. package/styles/fabric-dark.css +8 -0
  29. package/styles/fabric-lite.css +8 -0
  30. package/styles/fabric.css +8 -0
  31. package/styles/fluent-dark-lite.css +8 -0
  32. package/styles/fluent-dark.css +8 -0
  33. package/styles/fluent-lite.css +8 -0
  34. package/styles/fluent.css +8 -0
  35. package/styles/fluent2-lite.css +8 -0
  36. package/styles/fluent2.css +8 -0
  37. package/styles/highcontrast-light-lite.css +8 -0
  38. package/styles/highcontrast-light.css +8 -0
  39. package/styles/highcontrast-lite.css +8 -0
  40. package/styles/highcontrast.css +8 -0
  41. package/styles/material-dark-lite.css +8 -0
  42. package/styles/material-dark.css +8 -0
  43. package/styles/material-lite.css +8 -0
  44. package/styles/material.css +8 -0
  45. package/styles/material3-dark-lite.css +8 -0
  46. package/styles/material3-dark.css +8 -0
  47. package/styles/material3-lite.css +8 -0
  48. package/styles/material3.css +8 -0
  49. package/styles/multicolumn-combobox/_layout.scss +7 -0
  50. package/styles/multicolumn-combobox/bds.css +8 -0
  51. package/styles/multicolumn-combobox/bootstrap-dark.css +8 -0
  52. package/styles/multicolumn-combobox/bootstrap.css +8 -0
  53. package/styles/multicolumn-combobox/bootstrap4.css +8 -0
  54. package/styles/multicolumn-combobox/bootstrap5-dark.css +8 -0
  55. package/styles/multicolumn-combobox/bootstrap5.3.css +8 -0
  56. package/styles/multicolumn-combobox/bootstrap5.css +8 -0
  57. package/styles/multicolumn-combobox/fabric-dark.css +8 -0
  58. package/styles/multicolumn-combobox/fabric.css +8 -0
  59. package/styles/multicolumn-combobox/fluent-dark.css +8 -0
  60. package/styles/multicolumn-combobox/fluent.css +8 -0
  61. package/styles/multicolumn-combobox/fluent2.css +8 -0
  62. package/styles/multicolumn-combobox/highcontrast-light.css +8 -0
  63. package/styles/multicolumn-combobox/highcontrast.css +8 -0
  64. package/styles/multicolumn-combobox/material-dark.css +8 -0
  65. package/styles/multicolumn-combobox/material.css +8 -0
  66. package/styles/multicolumn-combobox/material3-dark.css +8 -0
  67. package/styles/multicolumn-combobox/material3.css +8 -0
  68. package/styles/multicolumn-combobox/tailwind-dark.css +8 -0
  69. package/styles/multicolumn-combobox/tailwind.css +8 -0
  70. package/styles/multicolumn-combobox/tailwind3.css +8 -0
  71. package/styles/tailwind-dark-lite.css +8 -0
  72. package/styles/tailwind-dark.css +8 -0
  73. package/styles/tailwind-lite.css +8 -0
  74. package/styles/tailwind.css +8 -0
  75. package/styles/tailwind3-lite.css +8 -0
  76. package/styles/tailwind3.css +8 -0
@@ -1,4 +1,4 @@
1
- import { ChildProperty, Property, Event, Component, getUniqueID, isNullOrUndefined, addClass, removeClass, formatUnit, getValue, attributes, prepend, Browser, append, L10n, select, compile, EventHandler, KeyboardEvents, closest, Animation, detach, Complex, Collection, NotifyPropertyChanges } from '@syncfusion/ej2-base';
1
+ import { ChildProperty, Property, Event, Component, getUniqueID, isNullOrUndefined, addClass, removeClass, prepend, formatUnit, getValue, attributes, Browser, append, L10n, select, compile, EventHandler, KeyboardEvents, closest, Animation, detach, Complex, Collection, NotifyPropertyChanges } from '@syncfusion/ej2-base';
2
2
  import { Input } from '@syncfusion/ej2-inputs';
3
3
  import { DataManager, Query } from '@syncfusion/ej2-data';
4
4
  import { Popup } from '@syncfusion/ej2-popups';
@@ -25,6 +25,7 @@ const NODATA = 'e-nodata';
25
25
  const DISABLED = 'e-disabled';
26
26
  const INPUTFOCUS = 'e-input-focus';
27
27
  const MULTICOLUMNLIST = 'e-multicolumn-list';
28
+ const HIDDENELEMENT = 'e-multicolumn-list-hidden';
28
29
  const MULTICOLUMNGRID = 'e-multicolumn-grid';
29
30
  class MultiColumnGrid {
30
31
  /**
@@ -272,6 +273,24 @@ let MultiColumnComboBox = class MultiColumnComboBox extends Component {
272
273
  this.renderPopup();
273
274
  this.wireEvents();
274
275
  }
276
+ setHiddenValue() {
277
+ if (isNullOrUndefined(this.value)) {
278
+ this.hiddenElement.innerHTML = '';
279
+ return;
280
+ }
281
+ const existingOption = this.hiddenElement.querySelector('option');
282
+ if (!isNullOrUndefined(existingOption)) {
283
+ existingOption.textContent = this.text;
284
+ existingOption.setAttribute('value', this.value.toString());
285
+ }
286
+ else if (!isNullOrUndefined(this.hiddenElement)) {
287
+ const newOption = document.createElement('option');
288
+ newOption.text = this.text;
289
+ newOption.setAttribute('value', this.value.toString());
290
+ newOption.setAttribute('selected', '');
291
+ this.hiddenElement.appendChild(newOption);
292
+ }
293
+ }
275
294
  renderGrid() {
276
295
  const gridColumns = this.getGridColumns();
277
296
  const sortOrder = this.sortOrder.toString().toLowerCase();
@@ -331,6 +350,18 @@ let MultiColumnComboBox = class MultiColumnComboBox extends Component {
331
350
  if (args.requestType === 'sorting') {
332
351
  this.updateRowSelection(args);
333
352
  }
353
+ if (Array.isArray(args.rows) && this.isDataFiltered) {
354
+ const rows = args.rows;
355
+ let rowHeight = 0;
356
+ rows.forEach((row) => {
357
+ const rowElement = this.gridObj.getRowElementByUID(row.uid);
358
+ if (rowElement) {
359
+ rowHeight += rowElement.getBoundingClientRect().height;
360
+ }
361
+ });
362
+ this.popupRowHeight = rowHeight || parseFloat(this.popupHeight);
363
+ this.updateGridHeight(true, true);
364
+ }
334
365
  this.popupObj.refreshPosition();
335
366
  this.gridObj.element.querySelector('.e-content').scrollTop = 0;
336
367
  }
@@ -519,6 +550,20 @@ let MultiColumnComboBox = class MultiColumnComboBox extends Component {
519
550
  this.inputWrapper = this.inputObj.container;
520
551
  this.inputWrapper.classList.add(MULTICOLUMNLIST);
521
552
  this.inputWrapper.setAttribute('spellcheck', 'false');
553
+ this.hiddenElement = this.createElement('select', {
554
+ attrs: {
555
+ 'aria-hidden': 'true',
556
+ 'tabindex': '-1',
557
+ 'class': HIDDENELEMENT
558
+ }
559
+ });
560
+ prepend([this.hiddenElement], this.inputWrapper);
561
+ const name = this.inputEle.getAttribute('name') ? this.inputEle.getAttribute('name') : this.inputEle.getAttribute('id');
562
+ this.hiddenElement.setAttribute('name', name);
563
+ this.inputEle.removeAttribute('name');
564
+ if (!this.hiddenElement.hasAttribute('aria-label')) {
565
+ this.hiddenElement.setAttribute('aria-label', this.getModuleName());
566
+ }
522
567
  if (this.element.tagName === this.getDirective()) {
523
568
  this.element.appendChild(this.inputWrapper);
524
569
  }
@@ -561,7 +606,11 @@ let MultiColumnComboBox = class MultiColumnComboBox extends Component {
561
606
  break;
562
607
  default: {
563
608
  const defaultAttr = ['title', 'id', 'placeholder', 'role', 'autocomplete', 'autocapitalize', 'spellcheck', 'minlength', 'maxlength'];
564
- if (defaultAttr.indexOf(htmlAttr) > -1) {
609
+ const validateAttr = ['name', 'required'];
610
+ if (validateAttr.indexOf(htmlAttr) > -1 || htmlAttr.indexOf('data') === 0) {
611
+ this.hiddenElement.setAttribute(htmlAttr, this.htmlAttributes[`${htmlAttr}`]);
612
+ }
613
+ else if (defaultAttr.indexOf(htmlAttr) > -1) {
565
614
  if (htmlAttr === 'placeholder') {
566
615
  Input.setPlaceholder(htmlAttributes[htmlAttr], inputEle);
567
616
  }
@@ -735,7 +784,6 @@ let MultiColumnComboBox = class MultiColumnComboBox extends Component {
735
784
  let popupHeight = this.getSize(false);
736
785
  this.popupEle.style.maxHeight = popupHeight;
737
786
  if (this.footerTemplate) {
738
- this.footer = this.footer ? this.footer : this.popupEle.querySelector('.e-popup-footer');
739
787
  const height = Math.round(this.footer.getBoundingClientRect().height);
740
788
  popupHeight = formatUnit(parseInt(popupHeight, 10) - height + 'px');
741
789
  }
@@ -744,16 +792,15 @@ let MultiColumnComboBox = class MultiColumnComboBox extends Component {
744
792
  this.popupEle.style.visibility = 'hidden';
745
793
  this.isInitialRender = true;
746
794
  }
747
- updateGridHeight(isFilter, autoHeight, dataSourceCount) {
795
+ updateGridHeight(isFilter, autoHeight) {
748
796
  let height;
749
797
  if (isFilter) {
750
798
  const gridContentEle = this.gridObj.getContent().querySelector('.e-content');
751
799
  const scrollBarHeight = gridContentEle.offsetHeight - gridContentEle.clientHeight;
752
- let totalRowHeight = dataSourceCount * this.popupRowHeight;
753
800
  if (this.fields.groupBy !== '' && !isNullOrUndefined(this.fields.groupBy)) {
754
- totalRowHeight += this.popupRowHeight;
801
+ this.popupRowHeight += this.popupRowHeight;
755
802
  }
756
- height = autoHeight ? (totalRowHeight < this.prevGridHeight ? (totalRowHeight + scrollBarHeight) + 'px' : this.prevGridHeight + 'px') : this.prevGridHeight + 'px';
803
+ height = autoHeight ? (this.popupRowHeight < this.prevGridHeight ? (this.popupRowHeight + scrollBarHeight) + 'px' : this.prevGridHeight + 'px') : this.prevGridHeight + 'px';
757
804
  }
758
805
  else {
759
806
  this.prevGridHeight = this.popupDiv.getBoundingClientRect().height - this.popupDiv.querySelector('.e-gridheader').getBoundingClientRect().height;
@@ -908,6 +955,7 @@ let MultiColumnComboBox = class MultiColumnComboBox extends Component {
908
955
  this.updateValues(selectedRecords ? dataValue : '', selectedRecords ? dataText : '', this.gridObj.selectedRowIndex, ChangeEventArgs);
909
956
  }
910
957
  Input.setValue(selectedRecords ? dataText : '', this.inputEle, this.floatLabelType, this.showClearButton);
958
+ this.setHiddenValue();
911
959
  if (!isKeyNav || (isKeyNav && isUpdateVal)) {
912
960
  this.hidePopup(e);
913
961
  }
@@ -922,6 +970,7 @@ let MultiColumnComboBox = class MultiColumnComboBox extends Component {
922
970
  this.value = value || this.value;
923
971
  this.index = this.selectedRowIndex = !isNullOrUndefined(index) ? index : this.index;
924
972
  this.isProtectedOnChange = prevOnChange;
973
+ this.setHiddenValue();
925
974
  if (!isInitial) {
926
975
  this.triggerChangeEvent(eventArgs);
927
976
  }
@@ -1036,7 +1085,7 @@ let MultiColumnComboBox = class MultiColumnComboBox extends Component {
1036
1085
  const dataLists = e.result;
1037
1086
  const dataLength = dataLists.length;
1038
1087
  filteredData = dataLists.filter((item) => this.filterData(item, filterType, inputValue, fields));
1039
- this.updateGridDataSource(filteredData, dataLength);
1088
+ this.updateGridDataSource(filteredData);
1040
1089
  });
1041
1090
  }
1042
1091
  filterData(item, filterType, inputValue, fields) {
@@ -1053,12 +1102,8 @@ let MultiColumnComboBox = class MultiColumnComboBox extends Component {
1053
1102
  return false;
1054
1103
  }
1055
1104
  }
1056
- updateGridDataSource(dataSource, dataLength) {
1057
- let autoHeight = true;
1105
+ updateGridDataSource(dataSource) {
1058
1106
  if (dataSource.length > 0) {
1059
- const length = this.dataSource instanceof DataManager ? dataLength
1060
- : this.dataSource.length;
1061
- autoHeight = length !== dataSource.length;
1062
1107
  removeClass([this.popupDiv], [NODATA]);
1063
1108
  const noRecordEle = this.popupDiv.querySelector('.e-no-records');
1064
1109
  if (noRecordEle) {
@@ -1071,7 +1116,6 @@ let MultiColumnComboBox = class MultiColumnComboBox extends Component {
1071
1116
  this.l10nUpdate();
1072
1117
  addClass([this.popupDiv], [NODATA]);
1073
1118
  }
1074
- this.updateGridHeight(true, autoHeight, dataSource.length);
1075
1119
  }
1076
1120
  wireEvents() {
1077
1121
  if (!isNullOrUndefined(this.inputObj.buttons[0])) {
@@ -1584,6 +1628,7 @@ let MultiColumnComboBox = class MultiColumnComboBox extends Component {
1584
1628
  this.popupEle = null;
1585
1629
  this.footer = null;
1586
1630
  this.noRecord = null;
1631
+ this.hiddenElement = null;
1587
1632
  super.destroy();
1588
1633
  }
1589
1634
  /**