@syncfusion/ej2-dropdowns 30.1.40 → 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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 30.1.40
3
+ * version : 30.1.41
4
4
  * Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-dropdowns",
3
- "version": "30.1.40",
3
+ "version": "30.1.41",
4
4
  "description": "Essential JS 2 DropDown Components",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -11,8 +11,8 @@
11
11
  "@syncfusion/ej2-base": "~30.1.38",
12
12
  "@syncfusion/ej2-data": "~30.1.40",
13
13
  "@syncfusion/ej2-inputs": "~30.1.40",
14
- "@syncfusion/ej2-lists": "~30.1.37",
15
- "@syncfusion/ej2-navigations": "~30.1.39",
14
+ "@syncfusion/ej2-lists": "~30.1.41",
15
+ "@syncfusion/ej2-navigations": "~30.1.41",
16
16
  "@syncfusion/ej2-notifications": "~30.1.37",
17
17
  "@syncfusion/ej2-popups": "~30.1.40"
18
18
  },
@@ -197,6 +197,10 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
197
197
  private scrollTimer;
198
198
  protected list: HTMLElement;
199
199
  protected fixedHeaderElement: HTMLElement;
200
+ protected isFilterAction: boolean;
201
+ private isUpdateGroupTemplate;
202
+ private groupHeaderItems;
203
+ private fiteredGroupHeaderItems;
200
204
  protected keyboardModule: KeyboardEvents;
201
205
  protected enableRtlElements: HTMLElement[];
202
206
  protected rippleFun: Function;
@@ -578,6 +582,7 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
578
582
  * @returns {void}
579
583
  */
580
584
  private setListData;
585
+ private updateGroupHeaderItems;
581
586
  protected handleVirtualKeyboardActions(e: KeyboardEventArgs, pageCount: number): void;
582
587
  protected updatePopupState(): void;
583
588
  protected updatePopupPosition(): void;
@@ -633,6 +638,7 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
633
638
  protected scrollStop(e?: Event, isDownkey?: boolean): void;
634
639
  protected getPageCount(returnExactCount?: boolean): number;
635
640
  private updateGroupHeader;
641
+ private updateFixedGroupTemplateHader;
636
642
  private updateGroupFixedHeader;
637
643
  protected getValidLi(): HTMLElement;
638
644
  /**
@@ -792,10 +792,15 @@ var DropDownBase = /** @class */ (function (_super) {
792
792
  _this.totalItemCount = !_this.virtualSelectAll ? e.count : _this.totalItemCount;
793
793
  ulElement = _this.renderItems(listItems, fields);
794
794
  _this.appendUncheckList = false;
795
+ _this.isUpdateGroupTemplate = false;
795
796
  _this.onActionComplete(ulElement, listItems, e);
796
797
  if (_this.groupTemplate) {
798
+ if (_this.isAngular && _this.getModuleName() === 'multiselect') {
799
+ _this.updateGroupHeaderItems(ulElement);
800
+ }
797
801
  _this.renderGroupTemplate(ulElement);
798
802
  }
803
+ _this.isUpdateGroupTemplate = true;
799
804
  _this.isRequested = false;
800
805
  _this.bindChildItems(listItems, ulElement, fields, e);
801
806
  if (_this.getInitialData) {
@@ -898,10 +903,15 @@ var DropDownBase = /** @class */ (function (_super) {
898
903
  }
899
904
  if (!localDataArgs.cancel) {
900
905
  ulElement = _this.renderItems(localDataArgs.result, fields);
906
+ _this.isUpdateGroupTemplate = false;
901
907
  _this.onActionComplete(ulElement, localDataArgs.result, event);
902
908
  if (_this.groupTemplate) {
909
+ if (_this.isAngular && _this.getModuleName() === 'multiselect') {
910
+ _this.updateGroupHeaderItems(ulElement);
911
+ }
903
912
  _this.renderGroupTemplate(ulElement);
904
913
  }
914
+ _this.isUpdateGroupTemplate = true;
905
915
  _this.bindChildItems(localDataArgs.result, ulElement, fields);
906
916
  if (_this.getInitialData) {
907
917
  _this.getInitialData = false;
@@ -920,6 +930,20 @@ var DropDownBase = /** @class */ (function (_super) {
920
930
  });
921
931
  }
922
932
  };
933
+ DropDownBase.prototype.updateGroupHeaderItems = function (ulElement) {
934
+ var headerElements = ulElement.querySelectorAll('.' + dropDownBaseClasses.group);
935
+ var clonedHeaders = [];
936
+ for (var i = 0; i < headerElements.length; i++) {
937
+ clonedHeaders.push(headerElements[i].cloneNode ? headerElements[i].cloneNode(true) :
938
+ headerElements[i]);
939
+ }
940
+ if (!this.isFilterAction) {
941
+ this.groupHeaderItems = clonedHeaders;
942
+ }
943
+ else {
944
+ this.fiteredGroupHeaderItems = clonedHeaders;
945
+ }
946
+ };
923
947
  DropDownBase.prototype.handleVirtualKeyboardActions = function (e, pageCount) {
924
948
  // Used this method in component side.
925
949
  };
@@ -1056,6 +1080,21 @@ var DropDownBase = /** @class */ (function (_super) {
1056
1080
  if (!isNullOrUndefined(this.list)) {
1057
1081
  if (!this.isVirtualizationEnabled) {
1058
1082
  this.list.innerHTML = '';
1083
+ if (this.isUpdateGroupTemplate && this.isAngular && this.groupTemplate && this.getModuleName() === 'multiselect') {
1084
+ var headerItems = ulElement.querySelectorAll('.' + dropDownBaseClasses.group);
1085
+ if (headerItems.length > 0 && this.groupHeaderItems.length > 0) {
1086
+ var groupHeaderMap = {};
1087
+ for (var i = 0; i < this.groupHeaderItems.length; i++) {
1088
+ groupHeaderMap[this.groupHeaderItems[i].id] = this.groupHeaderItems[i].innerHTML;
1089
+ }
1090
+ for (var i = 0; i < headerItems.length; i++) {
1091
+ if (Object.prototype.hasOwnProperty.call(groupHeaderMap, headerItems[i].id)) {
1092
+ headerItems[i].innerHTML = groupHeaderMap[headerItems[i].id];
1093
+ }
1094
+ }
1095
+ }
1096
+ this.renderGroupTemplate(ulElement);
1097
+ }
1059
1098
  this.list.appendChild(ulElement);
1060
1099
  this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
1061
1100
  this.ulElement = this.list.querySelector('ul');
@@ -1151,7 +1190,9 @@ var DropDownBase = /** @class */ (function (_super) {
1151
1190
  if (this.fields.groupBy !== null && this.dataSource || this.element.querySelector('.' + dropDownBaseClasses.group)) {
1152
1191
  var dataSource = this.dataSource;
1153
1192
  var option = { groupTemplateID: this.groupTemplateId, isStringTemplate: this.isStringTemplate };
1154
- var headerItems = listEle.querySelectorAll('.' + dropDownBaseClasses.group);
1193
+ var headerItems = this.isAngular && this.getModuleName() === 'multiselect' && !isNullOrUndefined(listEle) &&
1194
+ listEle.classList.contains(dropDownBaseClasses.fixedHead) ? [listEle] :
1195
+ listEle.querySelectorAll('.' + dropDownBaseClasses.group);
1155
1196
  var groupcheck = this.templateCompiler(this.groupTemplate);
1156
1197
  if (typeof this.groupTemplate !== 'function' && groupcheck) {
1157
1198
  var groupValue = select(this.groupTemplate, document).innerHTML.trim();
@@ -1294,10 +1335,38 @@ var DropDownBase = /** @class */ (function (_super) {
1294
1335
  return false;
1295
1336
  }
1296
1337
  };
1338
+ DropDownBase.prototype.updateFixedGroupTemplateHader = function (element) {
1339
+ var groupData = element.cloneNode ? element.cloneNode(true) : element;
1340
+ var isGroupDataUpdated = false;
1341
+ if (this.groupHeaderItems && this.groupHeaderItems.length > 0) {
1342
+ for (var i = 0; i < this.groupHeaderItems.length; i++) {
1343
+ if (groupData.id === this.groupHeaderItems[i].id) {
1344
+ groupData.innerHTML = this.groupHeaderItems[i].innerHTML;
1345
+ isGroupDataUpdated = true;
1346
+ break;
1347
+ }
1348
+ }
1349
+ }
1350
+ if (!isGroupDataUpdated && this.fiteredGroupHeaderItems && this.fiteredGroupHeaderItems.length > 0) {
1351
+ for (var i = 0; i < this.fiteredGroupHeaderItems.length; i++) {
1352
+ if (groupData.id === this.fiteredGroupHeaderItems[i].id) {
1353
+ groupData.innerHTML = this.fiteredGroupHeaderItems[i].innerHTML;
1354
+ break;
1355
+ }
1356
+ }
1357
+ }
1358
+ this.fixedHeaderElement.innerHTML = groupData.innerHTML;
1359
+ this.renderGroupTemplate(this.fixedHeaderElement);
1360
+ };
1297
1361
  DropDownBase.prototype.updateGroupFixedHeader = function (element, target) {
1298
1362
  if (this.fixedHeaderElement) {
1299
1363
  if (!isNullOrUndefined(element.innerHTML)) {
1300
- this.fixedHeaderElement.innerHTML = element.innerHTML;
1364
+ if (this.groupTemplate && this.isAngular && this.getModuleName() === 'multiselect') {
1365
+ this.updateFixedGroupTemplateHader(element);
1366
+ }
1367
+ else {
1368
+ this.fixedHeaderElement.innerHTML = element.innerHTML;
1369
+ }
1301
1370
  }
1302
1371
  this.fixedHeaderElement.style.position = 'fixed';
1303
1372
  this.fixedHeaderElement.style.top = (this.list.parentElement.offsetTop + this.list.offsetTop) - window.scrollY + 'px';
@@ -1487,7 +1556,12 @@ var DropDownBase = /** @class */ (function (_super) {
1487
1556
  setStyleAttribute(this.fixedHeaderElement, { zIndex: 10 });
1488
1557
  var firstLi = this.ulElement.querySelector('.' + dropDownBaseClasses.group + ':not(.e-hide-listitem)');
1489
1558
  if (!isNullOrUndefined(firstLi)) {
1490
- this.fixedHeaderElement.innerHTML = firstLi.innerHTML;
1559
+ if (this.groupTemplate && this.isAngular && this.getModuleName() === 'multiselect') {
1560
+ this.updateFixedGroupTemplateHader(firstLi);
1561
+ }
1562
+ else {
1563
+ this.fixedHeaderElement.innerHTML = firstLi.innerHTML;
1564
+ }
1491
1565
  }
1492
1566
  };
1493
1567
  DropDownBase.prototype.getSortedDataSource = function (dataSource) {
@@ -2043,6 +2117,8 @@ var DropDownBase = /** @class */ (function (_super) {
2043
2117
  this.ulElement = null;
2044
2118
  this.list = null;
2045
2119
  this.enableRtlElements = null;
2120
+ this.groupHeaderItems = null;
2121
+ this.fiteredGroupHeaderItems = null;
2046
2122
  this.rippleFun = null;
2047
2123
  _super.prototype.destroy.call(this);
2048
2124
  };
@@ -2324,7 +2324,14 @@ var DropDownList = /** @class */ (function (_super) {
2324
2324
  return;
2325
2325
  }
2326
2326
  if (this.getInitialData) {
2327
- this.updateActionCompleteDataValues(ulElement, list);
2327
+ if (this.itemTemplate && this.element.tagName === 'EJS-COMBOBOX' && this.allowFiltering) {
2328
+ setTimeout(function () {
2329
+ _this.updateActionCompleteDataValues(ulElement, list);
2330
+ }, 0);
2331
+ }
2332
+ else {
2333
+ this.updateActionCompleteDataValues(ulElement, list);
2334
+ }
2328
2335
  if (this.enableVirtualization) {
2329
2336
  this.updateSelectElementData(this.allowFiltering);
2330
2337
  }
@@ -194,9 +194,6 @@ var ListBox = /** @class */ (function (_super) {
194
194
  this.unSelectAllText = l10nSelect.getConstant('unSelectAllText');
195
195
  this.popupWrapper = this.list;
196
196
  this.checkBoxSelectionModule.checkAllParent = null;
197
- if (this.filterParent) {
198
- this.filterParent = null;
199
- }
200
197
  this.notify('selectAll', {});
201
198
  }
202
199
  };
@@ -661,7 +661,6 @@ export declare class MultiSelect extends DropDownBase implements IInput {
661
661
  private keyCode;
662
662
  private beforePopupOpen;
663
663
  private remoteCustomValue;
664
- private filterAction;
665
664
  private remoteFilterAction;
666
665
  private selectAllEventData;
667
666
  private selectAllEventEle;
@@ -890,7 +890,7 @@ var MultiSelect = /** @class */ (function (_super) {
890
890
  return filterQuery;
891
891
  }
892
892
  }
893
- if (this.filterAction) {
893
+ if (this.isFilterAction) {
894
894
  if ((this.targetElement() !== null && !this.enableVirtualization) || (this.enableVirtualization &&
895
895
  this.targetElement() !== null && this.targetElement().trim() !== '')) {
896
896
  var dataType = this.typeOfData(this.dataSource).typeof;
@@ -1357,7 +1357,9 @@ var MultiSelect = /** @class */ (function (_super) {
1357
1357
  this.ulElement = this.mainList;
1358
1358
  }
1359
1359
  this.checkPlaceholderSize();
1360
- Input.createSpanElement(this.overAllWrapper, this.createElement);
1360
+ if (this.element.querySelector('.e-multiselect .e-float-text-content') === null) {
1361
+ Input.createSpanElement(this.overAllWrapper, this.createElement);
1362
+ }
1361
1363
  this.calculateWidth();
1362
1364
  if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] &&
1363
1365
  this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
@@ -2549,7 +2551,9 @@ var MultiSelect = /** @class */ (function (_super) {
2549
2551
  }
2550
2552
  else {
2551
2553
  this.setFloatLabelType();
2552
- Input.createSpanElement(this.overAllWrapper, this.createElement);
2554
+ if (this.element.querySelector('.e-multiselect .e-float-text-content') === null) {
2555
+ Input.createSpanElement(this.overAllWrapper, this.createElement);
2556
+ }
2553
2557
  }
2554
2558
  this.expandTextbox();
2555
2559
  };
@@ -3400,7 +3404,9 @@ var MultiSelect = /** @class */ (function (_super) {
3400
3404
  this.clearAllCallback(e);
3401
3405
  }
3402
3406
  this.checkAndResetCache();
3403
- Input.createSpanElement(this.overAllWrapper, this.createElement);
3407
+ if (this.element.querySelector('.e-multiselect .e-float-text-content') === null) {
3408
+ Input.createSpanElement(this.overAllWrapper, this.createElement);
3409
+ }
3404
3410
  this.calculateWidth();
3405
3411
  if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] && this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {
3406
3412
  this.overAllWrapper.getElementsByClassName('e-float-text-content')[0].classList.add('e-icon');
@@ -3556,7 +3562,7 @@ var MultiSelect = /** @class */ (function (_super) {
3556
3562
  _this.isFilterPrevented = eventArgs.cancel;
3557
3563
  if (!eventArgs.cancel) {
3558
3564
  if (!_this.isFiltered && !eventArgs.preventDefaultAction) {
3559
- _this.filterAction = true;
3565
+ _this.isFilterAction = true;
3560
3566
  _this.isFilteringAction = true;
3561
3567
  if (_this.dataSource instanceof DataManager && _this.allowCustomValue) {
3562
3568
  _this.isCustomRendered = false;
@@ -3712,7 +3718,7 @@ var MultiSelect = /** @class */ (function (_super) {
3712
3718
  MultiSelect.prototype.initializeData = function () {
3713
3719
  this.mainListCollection = [];
3714
3720
  this.beforePopupOpen = false;
3715
- this.filterAction = false;
3721
+ this.isFilterAction = false;
3716
3722
  this.remoteFilterAction = false;
3717
3723
  this.isFirstClick = false;
3718
3724
  this.mobFilter = true;
@@ -4046,7 +4052,7 @@ var MultiSelect = /** @class */ (function (_super) {
4046
4052
  }
4047
4053
  };
4048
4054
  MultiSelect.prototype.updateDataList = function () {
4049
- if (this.mainList && this.ulElement && !(this.isFiltered || this.filterAction || this.targetElement().trim())) {
4055
+ if (this.mainList && this.ulElement && !(this.isFiltered || this.isFilterAction || this.targetElement().trim())) {
4050
4056
  var isDynamicGroupItemUpdate = this.mainList.childElementCount < this.ulElement.childElementCount;
4051
4057
  var isReactTemplateUpdate = ((this.ulElement.childElementCount > 0 &&
4052
4058
  this.ulElement.children[0].childElementCount > 0) &&
@@ -5285,7 +5291,7 @@ var MultiSelect = /** @class */ (function (_super) {
5285
5291
  this.isDynamicDataChange = true;
5286
5292
  }
5287
5293
  if (this.getModuleName() === 'multiselect') {
5288
- this.filterAction = false;
5294
+ this.isFilterAction = false;
5289
5295
  this.setUpdateInitial(['fields', 'query', 'dataSource'], newProp);
5290
5296
  }
5291
5297
  for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
@@ -5391,7 +5397,9 @@ var MultiSelect = /** @class */ (function (_super) {
5391
5397
  case 'floatLabelType':
5392
5398
  this.setFloatLabelType();
5393
5399
  this.addValidInputClass();
5394
- Input.createSpanElement(this.overAllWrapper, this.createElement);
5400
+ if (this.element.querySelector('.e-multiselect .e-float-text-content') === null) {
5401
+ Input.createSpanElement(this.overAllWrapper, this.createElement);
5402
+ }
5395
5403
  this.calculateWidth();
5396
5404
  if (!isNullOrUndefined(this.overAllWrapper) &&
5397
5405
  !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] &&
@@ -5986,7 +5994,9 @@ var MultiSelect = /** @class */ (function (_super) {
5986
5994
  if (this.element.hasAttribute('data-val')) {
5987
5995
  this.element.setAttribute('data-val', 'false');
5988
5996
  }
5989
- Input.createSpanElement(this.overAllWrapper, this.createElement);
5997
+ if (this.element.querySelector('.e-multiselect .e-float-text-content') === null) {
5998
+ Input.createSpanElement(this.overAllWrapper, this.createElement);
5999
+ }
5990
6000
  this.calculateWidth();
5991
6001
  if (!isNullOrUndefined(this.overAllWrapper) && !isNullOrUndefined(this.overAllWrapper.getElementsByClassName('e-ddl-icon')[0] &&
5992
6002
  this.overAllWrapper.getElementsByClassName('e-float-text-content')[0] && this.floatLabelType !== 'Never')) {