@syncfusion/ej2-dropdowns 30.1.39 → 30.1.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.
@@ -1564,10 +1564,15 @@ let DropDownBase = class DropDownBase extends Component {
1564
1564
  this.totalItemCount = !this.virtualSelectAll ? e.count : this.totalItemCount;
1565
1565
  ulElement = this.renderItems(listItems, fields);
1566
1566
  this.appendUncheckList = false;
1567
+ this.isUpdateGroupTemplate = false;
1567
1568
  this.onActionComplete(ulElement, listItems, e);
1568
1569
  if (this.groupTemplate) {
1570
+ if (this.isAngular && this.getModuleName() === 'multiselect') {
1571
+ this.updateGroupHeaderItems(ulElement);
1572
+ }
1569
1573
  this.renderGroupTemplate(ulElement);
1570
1574
  }
1575
+ this.isUpdateGroupTemplate = true;
1571
1576
  this.isRequested = false;
1572
1577
  this.bindChildItems(listItems, ulElement, fields, e);
1573
1578
  if (this.getInitialData) {
@@ -1670,10 +1675,15 @@ let DropDownBase = class DropDownBase extends Component {
1670
1675
  }
1671
1676
  if (!localDataArgs.cancel) {
1672
1677
  ulElement = this.renderItems(localDataArgs.result, fields);
1678
+ this.isUpdateGroupTemplate = false;
1673
1679
  this.onActionComplete(ulElement, localDataArgs.result, event);
1674
1680
  if (this.groupTemplate) {
1681
+ if (this.isAngular && this.getModuleName() === 'multiselect') {
1682
+ this.updateGroupHeaderItems(ulElement);
1683
+ }
1675
1684
  this.renderGroupTemplate(ulElement);
1676
1685
  }
1686
+ this.isUpdateGroupTemplate = true;
1677
1687
  this.bindChildItems(localDataArgs.result, ulElement, fields);
1678
1688
  if (this.getInitialData) {
1679
1689
  this.getInitialData = false;
@@ -1692,6 +1702,20 @@ let DropDownBase = class DropDownBase extends Component {
1692
1702
  });
1693
1703
  }
1694
1704
  }
1705
+ updateGroupHeaderItems(ulElement) {
1706
+ const headerElements = ulElement.querySelectorAll('.' + dropDownBaseClasses.group);
1707
+ const clonedHeaders = [];
1708
+ for (let i = 0; i < headerElements.length; i++) {
1709
+ clonedHeaders.push(headerElements[i].cloneNode ? headerElements[i].cloneNode(true) :
1710
+ headerElements[i]);
1711
+ }
1712
+ if (!this.isFilterAction) {
1713
+ this.groupHeaderItems = clonedHeaders;
1714
+ }
1715
+ else {
1716
+ this.fiteredGroupHeaderItems = clonedHeaders;
1717
+ }
1718
+ }
1695
1719
  handleVirtualKeyboardActions(e, pageCount) {
1696
1720
  // Used this method in component side.
1697
1721
  }
@@ -1826,6 +1850,21 @@ let DropDownBase = class DropDownBase extends Component {
1826
1850
  if (!isNullOrUndefined(this.list)) {
1827
1851
  if (!this.isVirtualizationEnabled) {
1828
1852
  this.list.innerHTML = '';
1853
+ if (this.isUpdateGroupTemplate && this.isAngular && this.groupTemplate && this.getModuleName() === 'multiselect') {
1854
+ const headerItems = ulElement.querySelectorAll('.' + dropDownBaseClasses.group);
1855
+ if (headerItems.length > 0 && this.groupHeaderItems.length > 0) {
1856
+ const groupHeaderMap = {};
1857
+ for (let i = 0; i < this.groupHeaderItems.length; i++) {
1858
+ groupHeaderMap[this.groupHeaderItems[i].id] = this.groupHeaderItems[i].innerHTML;
1859
+ }
1860
+ for (let i = 0; i < headerItems.length; i++) {
1861
+ if (Object.prototype.hasOwnProperty.call(groupHeaderMap, headerItems[i].id)) {
1862
+ headerItems[i].innerHTML = groupHeaderMap[headerItems[i].id];
1863
+ }
1864
+ }
1865
+ }
1866
+ this.renderGroupTemplate(ulElement);
1867
+ }
1829
1868
  this.list.appendChild(ulElement);
1830
1869
  this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
1831
1870
  this.ulElement = this.list.querySelector('ul');
@@ -1920,7 +1959,9 @@ let DropDownBase = class DropDownBase extends Component {
1920
1959
  if (this.fields.groupBy !== null && this.dataSource || this.element.querySelector('.' + dropDownBaseClasses.group)) {
1921
1960
  const dataSource = this.dataSource;
1922
1961
  const option = { groupTemplateID: this.groupTemplateId, isStringTemplate: this.isStringTemplate };
1923
- const headerItems = listEle.querySelectorAll('.' + dropDownBaseClasses.group);
1962
+ const headerItems = this.isAngular && this.getModuleName() === 'multiselect' && !isNullOrUndefined(listEle) &&
1963
+ listEle.classList.contains(dropDownBaseClasses.fixedHead) ? [listEle] :
1964
+ listEle.querySelectorAll('.' + dropDownBaseClasses.group);
1924
1965
  const groupcheck = this.templateCompiler(this.groupTemplate);
1925
1966
  if (typeof this.groupTemplate !== 'function' && groupcheck) {
1926
1967
  const groupValue = select(this.groupTemplate, document).innerHTML.trim();
@@ -2055,10 +2096,38 @@ let DropDownBase = class DropDownBase extends Component {
2055
2096
  return false;
2056
2097
  }
2057
2098
  }
2099
+ updateFixedGroupTemplateHader(element) {
2100
+ const groupData = element.cloneNode ? element.cloneNode(true) : element;
2101
+ let isGroupDataUpdated = false;
2102
+ if (this.groupHeaderItems && this.groupHeaderItems.length > 0) {
2103
+ for (let i = 0; i < this.groupHeaderItems.length; i++) {
2104
+ if (groupData.id === this.groupHeaderItems[i].id) {
2105
+ groupData.innerHTML = this.groupHeaderItems[i].innerHTML;
2106
+ isGroupDataUpdated = true;
2107
+ break;
2108
+ }
2109
+ }
2110
+ }
2111
+ if (!isGroupDataUpdated && this.fiteredGroupHeaderItems && this.fiteredGroupHeaderItems.length > 0) {
2112
+ for (let i = 0; i < this.fiteredGroupHeaderItems.length; i++) {
2113
+ if (groupData.id === this.fiteredGroupHeaderItems[i].id) {
2114
+ groupData.innerHTML = this.fiteredGroupHeaderItems[i].innerHTML;
2115
+ break;
2116
+ }
2117
+ }
2118
+ }
2119
+ this.fixedHeaderElement.innerHTML = groupData.innerHTML;
2120
+ this.renderGroupTemplate(this.fixedHeaderElement);
2121
+ }
2058
2122
  updateGroupFixedHeader(element, target) {
2059
2123
  if (this.fixedHeaderElement) {
2060
2124
  if (!isNullOrUndefined(element.innerHTML)) {
2061
- this.fixedHeaderElement.innerHTML = element.innerHTML;
2125
+ if (this.groupTemplate && this.isAngular && this.getModuleName() === 'multiselect') {
2126
+ this.updateFixedGroupTemplateHader(element);
2127
+ }
2128
+ else {
2129
+ this.fixedHeaderElement.innerHTML = element.innerHTML;
2130
+ }
2062
2131
  }
2063
2132
  this.fixedHeaderElement.style.position = 'fixed';
2064
2133
  this.fixedHeaderElement.style.top = (this.list.parentElement.offsetTop + this.list.offsetTop) - window.scrollY + 'px';
@@ -2248,7 +2317,12 @@ let DropDownBase = class DropDownBase extends Component {
2248
2317
  setStyleAttribute(this.fixedHeaderElement, { zIndex: 10 });
2249
2318
  const firstLi = this.ulElement.querySelector('.' + dropDownBaseClasses.group + ':not(.e-hide-listitem)');
2250
2319
  if (!isNullOrUndefined(firstLi)) {
2251
- this.fixedHeaderElement.innerHTML = firstLi.innerHTML;
2320
+ if (this.groupTemplate && this.isAngular && this.getModuleName() === 'multiselect') {
2321
+ this.updateFixedGroupTemplateHader(firstLi);
2322
+ }
2323
+ else {
2324
+ this.fixedHeaderElement.innerHTML = firstLi.innerHTML;
2325
+ }
2252
2326
  }
2253
2327
  }
2254
2328
  getSortedDataSource(dataSource) {
@@ -2801,6 +2875,8 @@ let DropDownBase = class DropDownBase extends Component {
2801
2875
  this.ulElement = null;
2802
2876
  this.list = null;
2803
2877
  this.enableRtlElements = null;
2878
+ this.groupHeaderItems = null;
2879
+ this.fiteredGroupHeaderItems = null;
2804
2880
  this.rippleFun = null;
2805
2881
  super.destroy();
2806
2882
  }
@@ -5159,7 +5235,14 @@ let DropDownList = class DropDownList extends DropDownBase {
5159
5235
  return;
5160
5236
  }
5161
5237
  if (this.getInitialData) {
5162
- this.updateActionCompleteDataValues(ulElement, list);
5238
+ if (this.itemTemplate && this.element.tagName === 'EJS-COMBOBOX' && this.allowFiltering) {
5239
+ setTimeout(() => {
5240
+ this.updateActionCompleteDataValues(ulElement, list);
5241
+ }, 0);
5242
+ }
5243
+ else {
5244
+ this.updateActionCompleteDataValues(ulElement, list);
5245
+ }
5163
5246
  if (this.enableVirtualization) {
5164
5247
  this.updateSelectElementData(this.allowFiltering);
5165
5248
  }
@@ -13517,7 +13600,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13517
13600
  return filterQuery;
13518
13601
  }
13519
13602
  }
13520
- if (this.filterAction) {
13603
+ if (this.isFilterAction) {
13521
13604
  if ((this.targetElement() !== null && !this.enableVirtualization) || (this.enableVirtualization &&
13522
13605
  this.targetElement() !== null && this.targetElement().trim() !== '')) {
13523
13606
  const dataType = this.typeOfData(this.dataSource).typeof;
@@ -13802,6 +13885,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13802
13885
  tempData[0] = (typeof customData === 'boolean') ?
13803
13886
  (tempData[0] === 'true' ? true : (tempData[0] === 'false' ? false : tempData[0])) : tempData[0];
13804
13887
  this.resetList(tempData, field);
13888
+ this.focusAtLastListItem(value);
13805
13889
  }
13806
13890
  }
13807
13891
  else if (this.listData && this.mainData && !dataChecks && this.allowCustomValue) {
@@ -13980,7 +14064,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
13980
14064
  this.ulElement = this.mainList;
13981
14065
  }
13982
14066
  this.checkPlaceholderSize();
13983
- Input.createSpanElement(this.overAllWrapper, this.createElement);
14067
+ if (this.element.querySelector('.e-multiselect .e-float-text-content') === null) {
14068
+ Input.createSpanElement(this.overAllWrapper, this.createElement);
14069
+ }
13984
14070
  this.calculateWidth();
13985
14071
  if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] &&
13986
14072
  this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
@@ -15162,6 +15248,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
15162
15248
  }
15163
15249
  else {
15164
15250
  this.setFloatLabelType();
15251
+ if (this.element.querySelector('.e-multiselect .e-float-text-content') === null) {
15252
+ Input.createSpanElement(this.overAllWrapper, this.createElement);
15253
+ }
15165
15254
  }
15166
15255
  this.expandTextbox();
15167
15256
  }
@@ -16003,7 +16092,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16003
16092
  this.clearAllCallback(e);
16004
16093
  }
16005
16094
  this.checkAndResetCache();
16006
- Input.createSpanElement(this.overAllWrapper, this.createElement);
16095
+ if (this.element.querySelector('.e-multiselect .e-float-text-content') === null) {
16096
+ Input.createSpanElement(this.overAllWrapper, this.createElement);
16097
+ }
16007
16098
  this.calculateWidth();
16008
16099
  if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
16009
16100
  this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
@@ -16157,7 +16248,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16157
16248
  this.isFilterPrevented = eventArgs.cancel;
16158
16249
  if (!eventArgs.cancel) {
16159
16250
  if (!this.isFiltered && !eventArgs.preventDefaultAction) {
16160
- this.filterAction = true;
16251
+ this.isFilterAction = true;
16161
16252
  this.isFilteringAction = true;
16162
16253
  if (this.dataSource instanceof DataManager && this.allowCustomValue) {
16163
16254
  this.isCustomRendered = false;
@@ -16313,7 +16404,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16313
16404
  initializeData() {
16314
16405
  this.mainListCollection = [];
16315
16406
  this.beforePopupOpen = false;
16316
- this.filterAction = false;
16407
+ this.isFilterAction = false;
16317
16408
  this.remoteFilterAction = false;
16318
16409
  this.isFirstClick = false;
16319
16410
  this.mobFilter = true;
@@ -16639,7 +16730,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
16639
16730
  }
16640
16731
  }
16641
16732
  updateDataList() {
16642
- if (this.mainList && this.ulElement && !(this.isFiltered || this.filterAction || this.targetElement().trim())) {
16733
+ if (this.mainList && this.ulElement && !(this.isFiltered || this.isFilterAction || this.targetElement().trim())) {
16643
16734
  const isDynamicGroupItemUpdate = this.mainList.childElementCount < this.ulElement.childElementCount;
16644
16735
  const isReactTemplateUpdate = ((this.ulElement.childElementCount > 0 &&
16645
16736
  this.ulElement.children[0].childElementCount > 0) &&
@@ -17872,7 +17963,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
17872
17963
  this.isDynamicDataChange = true;
17873
17964
  }
17874
17965
  if (this.getModuleName() === 'multiselect') {
17875
- this.filterAction = false;
17966
+ this.isFilterAction = false;
17876
17967
  this.setUpdateInitial(['fields', 'query', 'dataSource'], newProp);
17877
17968
  }
17878
17969
  for (const prop of Object.keys(newProp)) {
@@ -17977,7 +18068,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
17977
18068
  case 'floatLabelType':
17978
18069
  this.setFloatLabelType();
17979
18070
  this.addValidInputClass();
17980
- Input.createSpanElement(this.overAllWrapper, this.createElement);
18071
+ if (this.element.querySelector('.e-multiselect .e-float-text-content') === null) {
18072
+ Input.createSpanElement(this.overAllWrapper, this.createElement);
18073
+ }
17981
18074
  this.calculateWidth();
17982
18075
  if (!isNullOrUndefined(this.overAllWrapper) &&
17983
18076
  !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] &&
@@ -18566,7 +18659,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
18566
18659
  if (this.element.hasAttribute('data-val')) {
18567
18660
  this.element.setAttribute('data-val', 'false');
18568
18661
  }
18569
- Input.createSpanElement(this.overAllWrapper, this.createElement);
18662
+ if (this.element.querySelector('.e-multiselect .e-float-text-content') === null) {
18663
+ Input.createSpanElement(this.overAllWrapper, this.createElement);
18664
+ }
18570
18665
  this.calculateWidth();
18571
18666
  if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] &&
18572
18667
  this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
@@ -20056,6 +20151,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
20056
20151
  this.tBListBox = getComponent(document.getElementById(scope), this.getModuleName());
20057
20152
  this.tBListBox.updateToolBarState();
20058
20153
  }
20154
+ else if (this.refreshing) {
20155
+ this.updateToolBarState();
20156
+ }
20059
20157
  }
20060
20158
  createButtons(toolElem) {
20061
20159
  let btn;
@@ -21062,7 +21160,6 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
21062
21160
  }
21063
21161
  this.inputString = this.filterInput.value;
21064
21162
  this.filterWireEvents();
21065
- this.ulElement.style.setProperty('height', 'calc(100% - ' + (this.filterParent.offsetHeight) + 'px)', 'important');
21066
21163
  return filterInputObj;
21067
21164
  }
21068
21165
  }