@syncfusion/ej2-dropdowns 34.2.2 → 34.2.4

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 : 34.2.2
3
+ * version : 34.2.4
4
4
  * Copyright Syncfusion Inc. 2001 - 2025. 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": "34.2.2",
3
+ "version": "34.2.4",
4
4
  "description": "Essential JS 2 DropDown Components",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -8,13 +8,13 @@
8
8
  "module": "./index.js",
9
9
  "es2015": "./dist/es6/ej2-dropdowns.es5.js",
10
10
  "dependencies": {
11
- "@syncfusion/ej2-base": "~34.2.2",
11
+ "@syncfusion/ej2-base": "~34.2.4",
12
12
  "@syncfusion/ej2-data": "~34.2.2",
13
13
  "@syncfusion/ej2-inputs": "~34.2.2",
14
14
  "@syncfusion/ej2-lists": "~34.2.2",
15
- "@syncfusion/ej2-navigations": "~34.2.2",
15
+ "@syncfusion/ej2-navigations": "~34.2.4",
16
16
  "@syncfusion/ej2-notifications": "~34.2.2",
17
- "@syncfusion/ej2-popups": "~34.2.2"
17
+ "@syncfusion/ej2-popups": "~34.2.4"
18
18
  },
19
19
  "devDependencies": {},
20
20
  "keywords": [
@@ -894,6 +894,7 @@ export declare class DropDownTree extends Component<HTMLElement> implements INot
894
894
  private getFilteredTreeData;
895
895
  private getChildren;
896
896
  private getDirectChildren;
897
+ private restoreRootParentValues;
897
898
  private updateFilteredAutoCheckValues;
898
899
  private updateSelectedValues;
899
900
  private setChipValues;
@@ -2264,6 +2264,17 @@ var DropDownTree = /** @class */ (function (_super) {
2264
2264
  this.triggerChangeEvent(this.keyEventArgs);
2265
2265
  this.isValueChange = false;
2266
2266
  }
2267
+ var treeData = this.treeObj.getTreeData();
2268
+ if (this.showCheckBox && this.treeSettings.autoCheck && treeData.length > 0 && this.treeData && this.treeData.length > 0) {
2269
+ for (var i = 0; i < treeData.length; i++) {
2270
+ for (var j = 0; j < this.treeData.length; j++) {
2271
+ if (treeData[i].id === this.treeData[j].id) {
2272
+ this.treeData[j].selected = treeData[i].selected !== undefined ?
2273
+ treeData[i].selected : false;
2274
+ }
2275
+ }
2276
+ }
2277
+ }
2267
2278
  };
2268
2279
  DropDownTree.prototype.beforeCheck = function (args) {
2269
2280
  if (args.isInteracted) {
@@ -2580,9 +2591,35 @@ var DropDownTree = /** @class */ (function (_super) {
2580
2591
  })
2581
2592
  .map(function (childNode) { return childNode.id.toString(); });
2582
2593
  };
2594
+ DropDownTree.prototype.restoreRootParentValues = function () {
2595
+ var _this = this;
2596
+ var treeData = this.getFilteredTreeData();
2597
+ treeData.forEach(function (node) {
2598
+ if (isNOU(node) || isNOU(node.id)) {
2599
+ return;
2600
+ }
2601
+ if (isNOU(node.pid)) {
2602
+ var rootId = node.id.toString();
2603
+ var currentValues_1 = _this.value.map(function (item) {
2604
+ return item.toString();
2605
+ });
2606
+ if (currentValues_1.indexOf(rootId) === -1) {
2607
+ var childValues = [];
2608
+ _this.getChildren(rootId, childValues);
2609
+ var hasSelectedChild = childValues.some(function (childId) { return currentValues_1.indexOf(childId) !== -1; });
2610
+ if (hasSelectedChild) {
2611
+ _this.value.push(rootId);
2612
+ }
2613
+ }
2614
+ }
2615
+ });
2616
+ };
2583
2617
  DropDownTree.prototype.updateFilteredAutoCheckValues = function () {
2584
2618
  var _this = this;
2585
2619
  var treeData = this.getFilteredTreeData();
2620
+ if (!this.isNodeChecked && Array.isArray(this.value) && this.value.length > 0 && this.showCheckBox) {
2621
+ this.restoreRootParentValues();
2622
+ }
2586
2623
  var currentValues = Array.isArray(this.value) ? this.value.map(function (item) { return item.toString(); }) : [];
2587
2624
  var removeParent = function (parentId) {
2588
2625
  _this.value = _this.value.filter(function (value) { return value.toString() !== parentId; });
@@ -2673,26 +2710,44 @@ var DropDownTree = /** @class */ (function (_super) {
2673
2710
  this.value = this.value.filter(function (value) { return removeValues.indexOf(value.toString()) === -1; });
2674
2711
  currentValues = this.value.map(function (item) { return item.toString(); });
2675
2712
  }
2676
- treeData.forEach(function (node) {
2677
- if (isNOU(node) || isNOU(node.id)) {
2678
- return;
2679
- }
2680
- if (!node.haschild) {
2681
- return;
2682
- }
2683
- var parentId = node.id.toString();
2684
- if (currentValues.indexOf(parentId) === -1) {
2685
- return;
2686
- }
2687
- var hasDirectChild = treeData.some(function (childNode) {
2688
- return !isNOU(childNode) && !isNOU(childNode.pid) && !isNOU(childNode.id) && childNode.pid.toString() === parentId &&
2689
- currentValues.indexOf(childNode.id.toString()) !== -1;
2713
+ var stabilized = false;
2714
+ var valueBeforeReconciliation = this.value.slice();
2715
+ var iterationCount = 0;
2716
+ var maxIterations = treeData.length + 1;
2717
+ while (!stabilized && iterationCount < maxIterations) {
2718
+ stabilized = true;
2719
+ iterationCount++;
2720
+ treeData.forEach(function (node) {
2721
+ if (isNOU(node) || isNOU(node.id)) {
2722
+ return;
2723
+ }
2724
+ if (!node.haschild) {
2725
+ return;
2726
+ }
2727
+ var parentId = node.id.toString();
2728
+ var directChildren = _this.getDirectChildren(parentId);
2729
+ if (!directChildren.length) {
2730
+ return;
2731
+ }
2732
+ var allDirectChildrenChecked = directChildren.every(function (childId) { return currentValues.indexOf(childId) !== -1; });
2733
+ if (allDirectChildrenChecked) {
2734
+ if (currentValues.indexOf(parentId) === -1) {
2735
+ _this.value.push(parentId);
2736
+ currentValues = _this.value.map(function (item) { return item.toString(); });
2737
+ stabilized = false;
2738
+ }
2739
+ }
2740
+ else if (currentValues.indexOf(parentId) !== -1) {
2741
+ removeParent(parentId);
2742
+ currentValues = _this.value.map(function (item) { return item.toString(); });
2743
+ stabilized = false;
2744
+ }
2690
2745
  });
2691
- if (!hasDirectChild) {
2692
- removeParent(parentId);
2693
- currentValues = _this.value.map(function (item) { return item.toString(); });
2694
- }
2695
- });
2746
+ }
2747
+ if ((valueBeforeReconciliation.length > 0 && this.value.length === 0) ||
2748
+ iterationCount >= maxIterations) {
2749
+ this.value = valueBeforeReconciliation;
2750
+ }
2696
2751
  };
2697
2752
  DropDownTree.prototype.updateSelectedValues = function () {
2698
2753
  var _this = this;
@@ -2094,15 +2094,17 @@ var ListBox = /** @class */ (function (_super) {
2094
2094
  };
2095
2095
  ListBox.prototype.KeyUp = function (e) {
2096
2096
  var _this = this;
2097
- if (this.allowFiltering && e.ctrlKey && e.keyCode === 65) {
2097
+ if (this.allowFiltering && ((e.ctrlKey && e.keyCode === 65) || e.keyCode === 16)) {
2098
2098
  e.preventDefault();
2099
2099
  return;
2100
2100
  }
2101
2101
  var isSpecialKey = e.keyCode >= 186 && e.keyCode <= 192;
2102
+ var isBracketKey = e.keyCode === 219 || e.keyCode === 220 || e.keyCode === 221 || e.keyCode === 222;
2102
2103
  var isNumericKeyPadSpecialKey = e.keyCode === 107 || e.keyCode === 109 || e.keyCode === 111;
2103
2104
  var isWordCharacter = e.key && e.key.match(/\w/);
2104
- var isWordAccentCharacter = e.key && e.key.match(/[A-Za-z0-9\u00C0-\u024F ,>/:;\-+=]/);
2105
- if (!isNullOrUndefined(isWordCharacter) || !isNullOrUndefined(isWordAccentCharacter) || isSpecialKey || isNumericKeyPadSpecialKey) {
2105
+ var isWordAccentCharacter = e.key && e.key.match(/[A-Za-z0-9\u00C0-\u024F ,>/:;\-+=[\]\\ '@!#$%^&*()]/);
2106
+ if (!isNullOrUndefined(isWordCharacter) || !isNullOrUndefined(isWordAccentCharacter)
2107
+ || isSpecialKey || isBracketKey || isNumericKeyPadSpecialKey) {
2106
2108
  this.isValidKey = true;
2107
2109
  }
2108
2110
  this.isBackSpace = e.keyCode === 8;
@@ -1432,11 +1432,12 @@ var Mention = /** @class */ (function (_super) {
1432
1432
  value = this.displayTempElement.innerHTML;
1433
1433
  }
1434
1434
  if (this.isContentEditable(this.inputElement)) {
1435
- var defaultSuffix = this.isRTE ? '&#8203;' : '';
1435
+ var isMozilla = Browser.info.name === 'mozilla';
1436
+ var defaultSuffix = this.isRTE || isMozilla ? '&#8203;' : '';
1436
1437
  if (Browser.isAndroid) {
1437
1438
  return '<span contenteditable="true" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : defaultSuffix);
1438
1439
  }
1439
- else if (Browser.info.name === 'mozilla') {
1440
+ else if (isMozilla) {
1440
1441
  return '<span>&#65279;<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>&#65279;</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : defaultSuffix);
1441
1442
  }
1442
1443
  else {
@@ -706,6 +706,7 @@ export declare class MultiSelect extends DropDownBase implements IInput {
706
706
  [key: string]: Object;
707
707
  }[] | number[] | boolean[] | string[], e?: Object, isUpdated?: boolean): void;
708
708
  private updateActionList;
709
+ protected getAppendToElement(): HTMLElement;
709
710
  private refreshSelection;
710
711
  private hideGroupItem;
711
712
  protected getValidLi(): HTMLElement;
@@ -258,7 +258,8 @@ var MultiSelect = /** @class */ (function (_super) {
258
258
  if (!eventArgs.cancel) {
259
259
  _this.focusAtFirstListItem(true);
260
260
  if (_this.popupObj) {
261
- document.body.appendChild(_this.popupObj.element);
261
+ var appendToElement = _this.getAppendToElement();
262
+ appendToElement.appendChild(_this.popupObj.element);
262
263
  }
263
264
  if (_this.mode === 'CheckBox' && _this.enableGroupCheckBox && !isNullOrUndefined(_this.fields.groupBy)) {
264
265
  _this.updateListItems(_this.list.querySelectorAll('li.e-list-item'), _this.mainList.querySelectorAll('li.e-list-item'));
@@ -836,6 +837,16 @@ var MultiSelect = /** @class */ (function (_super) {
836
837
  this.onPopupShown(e);
837
838
  }
838
839
  };
840
+ MultiSelect.prototype.getAppendToElement = function () {
841
+ if (this.isAngular) {
842
+ var cdkPane = this.element && this.element.closest ? this.element.closest('.cdk-overlay-pane') : null;
843
+ var popoverEl = this.element && this.element.closest ? this.element.closest('[popover]') : null;
844
+ if (cdkPane && popoverEl) {
845
+ return cdkPane;
846
+ }
847
+ }
848
+ return document.body;
849
+ };
839
850
  MultiSelect.prototype.refreshSelection = function () {
840
851
  var value;
841
852
  var element;
@@ -2422,7 +2433,7 @@ var MultiSelect = /** @class */ (function (_super) {
2422
2433
  else {
2423
2434
  var listUl = this.list && this.list.querySelector('ul');
2424
2435
  var isFullList = this.isReact && this.itemTemplate && listUl != null &&
2425
- listUl.querySelectorAll('.e-list-item').length === this.mainData.length && !this.groupTemplate;
2436
+ listUl.querySelectorAll('.e-list-item').length === this.mainData.length && !this.groupTemplate && this.mode !== 'CheckBox';
2426
2437
  this.onActionComplete(isFullList ? listUl : list, this.mainData);
2427
2438
  }
2428
2439
  this.focusAtLastListItem(data);
@@ -3333,7 +3344,8 @@ var MultiSelect = /** @class */ (function (_super) {
3333
3344
  }
3334
3345
  if (!this.popupObj) {
3335
3346
  if (!isNullOrUndefined(this.popupWrapper)) {
3336
- document.body.appendChild(this.popupWrapper);
3347
+ var appendToElement = this.getAppendToElement();
3348
+ appendToElement.appendChild(this.popupWrapper);
3337
3349
  var checkboxFilter = this.popupWrapper.querySelector('.' + FILTERPARENT);
3338
3350
  if (this.mode === 'CheckBox' && !this.allowFiltering && checkboxFilter && this.filterParent) {
3339
3351
  checkboxFilter.remove();
@@ -6378,8 +6390,11 @@ var MultiSelect = /** @class */ (function (_super) {
6378
6390
  var mainLiLength = _this.ulElement.querySelectorAll('li.' + 'e-list-item').length;
6379
6391
  var liLength = _this.ulElement.querySelectorAll('li.'
6380
6392
  + dropDownBaseClasses.li + '.' + HIDE_LIST).length;
6393
+ var isFilterText = _this.allowFiltering && !isNullOrUndefined(_this.inputElement) &&
6394
+ _this.inputElement.value.trim() !== '';
6395
+ var isRemoteData = _this.dataSource instanceof DataManager;
6381
6396
  if (mainLiLength > 0 && (mainLiLength === liLength) && (liLength === _this.mainData.length) &&
6382
- !(_this.targetElement() !== '' && _this.allowCustomValue)) {
6397
+ !(_this.targetElement() !== '' && _this.allowCustomValue) && (!isRemoteData || !isFilterText)) {
6383
6398
  _this.beforePopupOpen = false;
6384
6399
  return;
6385
6400
  }
@@ -6807,7 +6822,8 @@ var MultiSelect = /** @class */ (function (_super) {
6807
6822
  var listParentHeight = formatUnit(this.popupHeight);
6808
6823
  listParent.style.height = (parseInt(listParentHeight, 10)).toString() + 'px';
6809
6824
  listParent.appendChild(item);
6810
- document.body.appendChild(listParent);
6825
+ var appendToElement = this.getAppendToElement();
6826
+ appendToElement.appendChild(listParent);
6811
6827
  this.virtualListHeight = listParent.getBoundingClientRect().height;
6812
6828
  var listItemHeight = Math.ceil(item.getBoundingClientRect().height) +
6813
6829
  parseInt(window.getComputedStyle(item).marginBottom, 10);
@@ -178,3 +178,7 @@ $list-border: 1px !default;
178
178
  $zero-border: 0 !default;
179
179
  $zero-width: 0% !default;
180
180
  $list-box-tool-tail-radius: $radius-8 !default;
181
+
182
+ .e-listbox-wrapper.e-wrapper li.e-list-item.e-focused {
183
+ background-color: $listbox-item-hover-bg;
184
+ }
@@ -72,6 +72,10 @@
72
72
  /* 5em */
73
73
 
74
74
 
75
+ .e-listbox-wrapper.e-wrapper li.e-list-item.e-focused {
76
+ background-color: var(--color-sf-content-bg-color-hover);
77
+ }
78
+
75
79
  .e-listbox-tool .e-moveup::before {
76
80
  content: "\e776";
77
81
  }
@@ -2114,6 +2114,10 @@ ejs-multiselect {
2114
2114
  color: var(--color-sf-content-text-color-alt1);
2115
2115
  }
2116
2116
 
2117
+ .e-listbox-wrapper.e-wrapper li.e-list-item.e-focused {
2118
+ background-color: var(--color-sf-content-bg-color-hover);
2119
+ }
2120
+
2117
2121
  .e-listbox-tool .e-moveup::before {
2118
2122
  content: "\e776";
2119
2123
  }
@@ -2652,6 +2652,10 @@ ejs-multiselect {
2652
2652
  height: 30px;
2653
2653
  }
2654
2654
 
2655
+ .e-listbox-wrapper.e-wrapper li.e-list-item.e-focused {
2656
+ background-color: var(--color-sf-content-bg-color-hover);
2657
+ }
2658
+
2655
2659
  .e-listbox-tool .e-moveup::before {
2656
2660
  content: "\e776";
2657
2661
  }