@syncfusion/ej2-dropdowns 34.2.4 → 34.2.6
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.
- package/README.md +11 -0
- package/dist/ej2-dropdowns.min.js +2 -2
- package/dist/ej2-dropdowns.umd.min.js +2 -2
- package/dist/ej2-dropdowns.umd.min.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es2015.js +280 -65
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +279 -68
- package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
- package/dist/global/ej2-dropdowns.min.js +2 -2
- package/dist/global/ej2-dropdowns.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +8 -8
- package/src/drop-down-list/drop-down-list.js +1 -0
- package/src/drop-down-tree/drop-down-tree.d.ts +2 -2
- package/src/drop-down-tree/drop-down-tree.js +169 -66
- package/src/mention/mention.js +1 -1
- package/src/multi-select/multi-select.d.ts +1 -0
- package/src/multi-select/multi-select.js +108 -1
- package/.eslintrc.json +0 -263
- package/aceconfig.js +0 -17
- package/tslint.json +0 -111
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 34.2.
|
|
3
|
+
* version : 34.2.6
|
|
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.
|
|
3
|
+
"version": "34.2.6",
|
|
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.
|
|
12
|
-
"@syncfusion/ej2-data": "~34.2.
|
|
13
|
-
"@syncfusion/ej2-inputs": "~34.2.
|
|
14
|
-
"@syncfusion/ej2-lists": "~34.2.
|
|
15
|
-
"@syncfusion/ej2-navigations": "~34.2.
|
|
16
|
-
"@syncfusion/ej2-notifications": "~34.2.
|
|
17
|
-
"@syncfusion/ej2-popups": "~34.2.
|
|
11
|
+
"@syncfusion/ej2-base": "~34.2.6",
|
|
12
|
+
"@syncfusion/ej2-data": "~34.2.6",
|
|
13
|
+
"@syncfusion/ej2-inputs": "~34.2.6",
|
|
14
|
+
"@syncfusion/ej2-lists": "~34.2.6",
|
|
15
|
+
"@syncfusion/ej2-navigations": "~34.2.6",
|
|
16
|
+
"@syncfusion/ej2-notifications": "~34.2.6",
|
|
17
|
+
"@syncfusion/ej2-popups": "~34.2.6"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {},
|
|
20
20
|
"keywords": [
|
|
@@ -624,6 +624,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
624
624
|
this.bindClearEvent();
|
|
625
625
|
};
|
|
626
626
|
DropDownList.prototype.windowResize = function () {
|
|
627
|
+
this.updateFloatLabelOverflowWidth();
|
|
627
628
|
if (this.isPopupOpen) {
|
|
628
629
|
this.popupObj.refreshPosition(this.inputWrapper.container);
|
|
629
630
|
}
|
|
@@ -344,6 +344,7 @@ export declare class DropDownTree extends Component<HTMLElement> implements INot
|
|
|
344
344
|
private valueTemplateContainer;
|
|
345
345
|
private previousFilterText;
|
|
346
346
|
private fallbackValue;
|
|
347
|
+
private uncheckedNodeId;
|
|
347
348
|
/**
|
|
348
349
|
* Specifies the template that renders to the popup list content of the
|
|
349
350
|
* Dropdown Tree component when the data fetch request from the remote server fails.
|
|
@@ -846,6 +847,7 @@ export declare class DropDownTree extends Component<HTMLElement> implements INot
|
|
|
846
847
|
private getNestedItems;
|
|
847
848
|
private getChildType;
|
|
848
849
|
private renderTree;
|
|
850
|
+
private updateIndeterminateNodes;
|
|
849
851
|
private renderPopup;
|
|
850
852
|
private checkCollision;
|
|
851
853
|
private removeFocus;
|
|
@@ -891,10 +893,8 @@ export declare class DropDownTree extends Component<HTMLElement> implements INot
|
|
|
891
893
|
private removeSelectedData;
|
|
892
894
|
private initializeValueTemplate;
|
|
893
895
|
private showOrHideValueTemplate;
|
|
894
|
-
private getFilteredTreeData;
|
|
895
896
|
private getChildren;
|
|
896
897
|
private getDirectChildren;
|
|
897
|
-
private restoreRootParentValues;
|
|
898
898
|
private updateFilteredAutoCheckValues;
|
|
899
899
|
private updateSelectedValues;
|
|
900
900
|
private setChipValues;
|
|
@@ -178,6 +178,7 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
178
178
|
_this.isNodeChecked = false;
|
|
179
179
|
_this.isFromFilterChange = false;
|
|
180
180
|
_this.fallbackValue = [];
|
|
181
|
+
_this.uncheckedNodeId = null;
|
|
181
182
|
return _this;
|
|
182
183
|
}
|
|
183
184
|
/**
|
|
@@ -1680,8 +1681,129 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
1680
1681
|
checkOnClick: true
|
|
1681
1682
|
});
|
|
1682
1683
|
this.treeObj.root = this.root ? this.root : this;
|
|
1684
|
+
this.treeObj.filterIndeterminateNodes = [];
|
|
1685
|
+
this.treeObj.filterCheckedNodes = [];
|
|
1683
1686
|
this.treeObj.appendTo(this.tree);
|
|
1684
1687
|
};
|
|
1688
|
+
DropDownTree.prototype.updateIndeterminateNodes = function () {
|
|
1689
|
+
if (!(this.allowFiltering && this.treeSettings.autoCheck) || (this.isRemoteData || this.treeSettings.loadOnDemand)) {
|
|
1690
|
+
return;
|
|
1691
|
+
}
|
|
1692
|
+
var checkedNodes = Array.isArray(this.value) ? this.value.slice() : [];
|
|
1693
|
+
var checkedSet = {};
|
|
1694
|
+
for (var i = 0; i < checkedNodes.length; i++) {
|
|
1695
|
+
checkedSet[checkedNodes[i]] = true;
|
|
1696
|
+
}
|
|
1697
|
+
var treeData = this.treeObj.element.classList.contains('e-filtering') ? this.treeData : this.treeItems;
|
|
1698
|
+
var valueField = this.fields.value;
|
|
1699
|
+
var parentValueField = this.fields.parentValue;
|
|
1700
|
+
var hasChildrenField = this.fields.hasChildren;
|
|
1701
|
+
var childField = this.fields.child;
|
|
1702
|
+
var indeterminateNodes = [];
|
|
1703
|
+
var childrenMap = {};
|
|
1704
|
+
for (var i = 0; i < treeData.length; i++) {
|
|
1705
|
+
var node = treeData[i];
|
|
1706
|
+
var nodeId = getValue(valueField, node);
|
|
1707
|
+
var nodePid = getValue(parentValueField, node);
|
|
1708
|
+
if (isNOU(node) || isNOU(nodeId) || isNOU(nodePid)) {
|
|
1709
|
+
continue;
|
|
1710
|
+
}
|
|
1711
|
+
var parentId = nodePid.toString();
|
|
1712
|
+
if (!childrenMap[parentId]) {
|
|
1713
|
+
childrenMap[parentId] = [];
|
|
1714
|
+
}
|
|
1715
|
+
childrenMap[parentId].push(nodeId.toString());
|
|
1716
|
+
}
|
|
1717
|
+
var allNodes = treeData.slice();
|
|
1718
|
+
if (!isNOU(childField)) {
|
|
1719
|
+
var collectNestedChildren_1 = function (nodes, fields) {
|
|
1720
|
+
if (!nodes) {
|
|
1721
|
+
return;
|
|
1722
|
+
}
|
|
1723
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
1724
|
+
var node = nodes[i];
|
|
1725
|
+
if (isNOU(node)) {
|
|
1726
|
+
continue;
|
|
1727
|
+
}
|
|
1728
|
+
var nodeId = getValue(fields.value, node);
|
|
1729
|
+
if (isNOU(nodeId)) {
|
|
1730
|
+
continue;
|
|
1731
|
+
}
|
|
1732
|
+
allNodes.push(node);
|
|
1733
|
+
var childMapper = fields.child;
|
|
1734
|
+
var childrenArr = void 0;
|
|
1735
|
+
if (typeof childMapper === 'string') {
|
|
1736
|
+
childrenArr = node[childMapper];
|
|
1737
|
+
}
|
|
1738
|
+
else if (!isNOU(childMapper)) {
|
|
1739
|
+
childrenArr = node[childMapper.value];
|
|
1740
|
+
}
|
|
1741
|
+
else {
|
|
1742
|
+
childrenArr = null;
|
|
1743
|
+
}
|
|
1744
|
+
if (!isNOU(childrenArr) && Array.isArray(childrenArr) && childrenArr.length) {
|
|
1745
|
+
var parentId = nodeId.toString();
|
|
1746
|
+
if (!childrenMap[parentId]) {
|
|
1747
|
+
childrenMap[parentId] = [];
|
|
1748
|
+
}
|
|
1749
|
+
for (var k = 0; k < childrenArr.length; k++) {
|
|
1750
|
+
var childId = getValue(fields.value, childrenArr[k]);
|
|
1751
|
+
if (!isNOU(childId) && childrenMap[parentId].indexOf(childId.toString()) === -1) {
|
|
1752
|
+
childrenMap[parentId].push(childId.toString());
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
var nextFields = (typeof childMapper !== 'string' && !isNOU(childMapper)) ?
|
|
1756
|
+
childMapper : fields;
|
|
1757
|
+
collectNestedChildren_1(childrenArr, nextFields);
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
};
|
|
1761
|
+
collectNestedChildren_1(treeData, this.fields);
|
|
1762
|
+
}
|
|
1763
|
+
for (var i = 0; i < allNodes.length; i++) {
|
|
1764
|
+
var node = allNodes[i];
|
|
1765
|
+
var nodeId = getValue(valueField, node);
|
|
1766
|
+
if (isNOU(node) || isNOU(nodeId)) {
|
|
1767
|
+
continue;
|
|
1768
|
+
}
|
|
1769
|
+
var nodeIdStr = nodeId.toString();
|
|
1770
|
+
if (hasChildrenField && getValue(hasChildrenField, node) === false) {
|
|
1771
|
+
continue;
|
|
1772
|
+
}
|
|
1773
|
+
if (checkedSet[nodeIdStr]) {
|
|
1774
|
+
continue;
|
|
1775
|
+
}
|
|
1776
|
+
var descendants = [];
|
|
1777
|
+
var queue = childrenMap[nodeIdStr] ? childrenMap[nodeIdStr].slice() : [];
|
|
1778
|
+
var head = 0;
|
|
1779
|
+
while (head < queue.length) {
|
|
1780
|
+
var current = queue[head];
|
|
1781
|
+
head++;
|
|
1782
|
+
descendants.push(current);
|
|
1783
|
+
var kids = childrenMap[current];
|
|
1784
|
+
if (kids) {
|
|
1785
|
+
for (var j = 0; j < kids.length; j++) {
|
|
1786
|
+
queue.push(kids[j]);
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
if (descendants.length === 0) {
|
|
1791
|
+
continue;
|
|
1792
|
+
}
|
|
1793
|
+
var checkedDescendantCount = 0;
|
|
1794
|
+
for (var j = 0; j < descendants.length; j++) {
|
|
1795
|
+
if (checkedSet[descendants[j]]) {
|
|
1796
|
+
checkedDescendantCount++;
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
if (checkedDescendantCount > 0 && checkedDescendantCount < descendants.length &&
|
|
1800
|
+
indeterminateNodes.indexOf(nodeIdStr) === -1) {
|
|
1801
|
+
indeterminateNodes.push(nodeIdStr);
|
|
1802
|
+
}
|
|
1803
|
+
}
|
|
1804
|
+
this.treeObj.filterCheckedNodes = checkedNodes;
|
|
1805
|
+
this.treeObj.filterIndeterminateNodes = indeterminateNodes;
|
|
1806
|
+
};
|
|
1685
1807
|
/* To render the popup element */
|
|
1686
1808
|
DropDownTree.prototype.renderPopup = function () {
|
|
1687
1809
|
var _this = this;
|
|
@@ -1982,6 +2104,7 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
1982
2104
|
this.isFilterRestore = false;
|
|
1983
2105
|
}
|
|
1984
2106
|
}
|
|
2107
|
+
this.updateIndeterminateNodes();
|
|
1985
2108
|
};
|
|
1986
2109
|
DropDownTree.prototype.restoreFilterSelection = function () {
|
|
1987
2110
|
if (this.treeObj.checkedNodes) {
|
|
@@ -2232,6 +2355,8 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
2232
2355
|
var eventArgs = this.getEventArgs(args);
|
|
2233
2356
|
this.trigger('select', eventArgs);
|
|
2234
2357
|
this.isNodeChecked = args.action === 'check';
|
|
2358
|
+
this.uncheckedNodeId = args.action === 'uncheck' && !isNOU(args.data[0]) ?
|
|
2359
|
+
getValue('id', args.data[0]).toString() : null;
|
|
2235
2360
|
if (this.isFilteredData && args.action === 'uncheck') {
|
|
2236
2361
|
var id = getValue('id', args.data[0]).toString();
|
|
2237
2362
|
this.removeSelectedData(id, true);
|
|
@@ -2264,17 +2389,8 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
2264
2389
|
this.triggerChangeEvent(this.keyEventArgs);
|
|
2265
2390
|
this.isValueChange = false;
|
|
2266
2391
|
}
|
|
2267
|
-
|
|
2268
|
-
|
|
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
|
-
}
|
|
2392
|
+
this.updateIndeterminateNodes();
|
|
2393
|
+
this.uncheckedNodeId = null;
|
|
2278
2394
|
};
|
|
2279
2395
|
DropDownTree.prototype.beforeCheck = function (args) {
|
|
2280
2396
|
if (args.isInteracted) {
|
|
@@ -2568,15 +2684,13 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
2568
2684
|
}
|
|
2569
2685
|
}
|
|
2570
2686
|
};
|
|
2571
|
-
DropDownTree.prototype.getFilteredTreeData = function () {
|
|
2572
|
-
return this.treeData;
|
|
2573
|
-
};
|
|
2574
2687
|
DropDownTree.prototype.getChildren = function (parentId, result) {
|
|
2575
2688
|
var _this = this;
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2689
|
+
this.treeData.forEach(function (item) {
|
|
2690
|
+
var itemId = !isNOU(item) ? getValue(_this.fields.value, item) : null;
|
|
2691
|
+
var itemPid = !isNOU(item) ? getValue(_this.fields.parentValue, item) : null;
|
|
2692
|
+
if (!isNOU(itemId) && !isNOU(itemPid) && itemPid.toString() === parentId.toString()) {
|
|
2693
|
+
var childId = itemId.toString();
|
|
2580
2694
|
if (result.indexOf(childId) === -1) {
|
|
2581
2695
|
result.push(childId);
|
|
2582
2696
|
_this.getChildren(childId, result);
|
|
@@ -2585,41 +2699,17 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
2585
2699
|
});
|
|
2586
2700
|
};
|
|
2587
2701
|
DropDownTree.prototype.getDirectChildren = function (parentId) {
|
|
2588
|
-
|
|
2702
|
+
var _this = this;
|
|
2703
|
+
return this.treeData
|
|
2589
2704
|
.filter(function (childNode) {
|
|
2590
|
-
|
|
2705
|
+
var childId = !isNOU(childNode) ? getValue(_this.fields.value, childNode) : null;
|
|
2706
|
+
var childPid = !isNOU(childNode) ? getValue(_this.fields.parentValue, childNode) : null;
|
|
2707
|
+
return !isNOU(childId) && !isNOU(childPid) && childPid.toString() === parentId;
|
|
2591
2708
|
})
|
|
2592
|
-
.map(function (childNode) { return childNode.
|
|
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
|
-
});
|
|
2709
|
+
.map(function (childNode) { return getValue(_this.fields.value, childNode).toString(); });
|
|
2616
2710
|
};
|
|
2617
2711
|
DropDownTree.prototype.updateFilteredAutoCheckValues = function () {
|
|
2618
2712
|
var _this = this;
|
|
2619
|
-
var treeData = this.getFilteredTreeData();
|
|
2620
|
-
if (!this.isNodeChecked && Array.isArray(this.value) && this.value.length > 0 && this.showCheckBox) {
|
|
2621
|
-
this.restoreRootParentValues();
|
|
2622
|
-
}
|
|
2623
2713
|
var currentValues = Array.isArray(this.value) ? this.value.map(function (item) { return item.toString(); }) : [];
|
|
2624
2714
|
var removeParent = function (parentId) {
|
|
2625
2715
|
_this.value = _this.value.filter(function (value) { return value.toString() !== parentId; });
|
|
@@ -2630,12 +2720,14 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
2630
2720
|
_this.value.push(value);
|
|
2631
2721
|
}
|
|
2632
2722
|
});
|
|
2633
|
-
treeData.forEach(function (node) {
|
|
2634
|
-
|
|
2723
|
+
this.treeData.forEach(function (node) {
|
|
2724
|
+
var nodeId = isNOU(node) ? null : getValue(_this.fields.value, node);
|
|
2725
|
+
var nodeHasChild = !isNOU(node) && !!_this.fields.hasChildren && getValue(_this.fields.hasChildren, node) === true;
|
|
2726
|
+
if (isNOU(nodeId)) {
|
|
2635
2727
|
return;
|
|
2636
2728
|
}
|
|
2637
|
-
var parentId =
|
|
2638
|
-
if (
|
|
2729
|
+
var parentId = nodeId.toString();
|
|
2730
|
+
if (nodeHasChild && _this.value.indexOf(parentId) !== -1) {
|
|
2639
2731
|
var childValues = [];
|
|
2640
2732
|
_this.getChildren(parentId, childValues);
|
|
2641
2733
|
if (_this.value.indexOf(parentId) === -1) {
|
|
@@ -2649,14 +2741,16 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
2649
2741
|
}
|
|
2650
2742
|
currentValues = _this.value.map(function (item) { return item.toString(); });
|
|
2651
2743
|
});
|
|
2652
|
-
treeData.forEach(function (node) {
|
|
2653
|
-
|
|
2744
|
+
this.treeData.forEach(function (node) {
|
|
2745
|
+
var nodeId = isNOU(node) ? null : getValue(_this.fields.value, node);
|
|
2746
|
+
var nodeHasChild = !isNOU(node) && !!_this.fields.hasChildren && getValue(_this.fields.hasChildren, node) === true;
|
|
2747
|
+
if (isNOU(nodeId)) {
|
|
2654
2748
|
return;
|
|
2655
2749
|
}
|
|
2656
|
-
if (!
|
|
2750
|
+
if (!nodeHasChild) {
|
|
2657
2751
|
return;
|
|
2658
2752
|
}
|
|
2659
|
-
var parentId =
|
|
2753
|
+
var parentId = nodeId.toString();
|
|
2660
2754
|
var directChildren = _this.getDirectChildren(parentId);
|
|
2661
2755
|
if (!directChildren.length) {
|
|
2662
2756
|
return;
|
|
@@ -2690,14 +2784,19 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
2690
2784
|
return;
|
|
2691
2785
|
}
|
|
2692
2786
|
var removeValues = [];
|
|
2693
|
-
treeData.forEach(function (node) {
|
|
2694
|
-
|
|
2787
|
+
this.treeData.forEach(function (node) {
|
|
2788
|
+
var nodeId = isNOU(node) ? null : getValue(_this.fields.value, node);
|
|
2789
|
+
var nodeHasChild = !isNOU(node) && !!_this.fields.hasChildren && getValue(_this.fields.hasChildren, node) === true;
|
|
2790
|
+
if (isNOU(nodeId)) {
|
|
2791
|
+
return;
|
|
2792
|
+
}
|
|
2793
|
+
if (!nodeHasChild) {
|
|
2695
2794
|
return;
|
|
2696
2795
|
}
|
|
2697
|
-
|
|
2796
|
+
var parentId = nodeId.toString();
|
|
2797
|
+
if (parentId !== _this.uncheckedNodeId) {
|
|
2698
2798
|
return;
|
|
2699
2799
|
}
|
|
2700
|
-
var parentId = node.id.toString();
|
|
2701
2800
|
if (currentValues.indexOf(parentId) === -1) {
|
|
2702
2801
|
var childValues = [];
|
|
2703
2802
|
_this.getChildren(parentId, childValues);
|
|
@@ -2713,18 +2812,20 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
2713
2812
|
var stabilized = false;
|
|
2714
2813
|
var valueBeforeReconciliation = this.value.slice();
|
|
2715
2814
|
var iterationCount = 0;
|
|
2716
|
-
var maxIterations = treeData.length + 1;
|
|
2815
|
+
var maxIterations = this.treeData.length + 1;
|
|
2717
2816
|
while (!stabilized && iterationCount < maxIterations) {
|
|
2718
2817
|
stabilized = true;
|
|
2719
2818
|
iterationCount++;
|
|
2720
|
-
treeData.forEach(function (node) {
|
|
2721
|
-
|
|
2819
|
+
this.treeData.forEach(function (node) {
|
|
2820
|
+
var nodeId = isNOU(node) ? null : getValue(_this.fields.value, node);
|
|
2821
|
+
var nodeHasChild = !isNOU(node) && !!_this.fields.hasChildren && getValue(_this.fields.hasChildren, node) === true;
|
|
2822
|
+
if (isNOU(nodeId)) {
|
|
2722
2823
|
return;
|
|
2723
2824
|
}
|
|
2724
|
-
if (!
|
|
2825
|
+
if (!nodeHasChild) {
|
|
2725
2826
|
return;
|
|
2726
2827
|
}
|
|
2727
|
-
var parentId =
|
|
2828
|
+
var parentId = nodeId.toString();
|
|
2728
2829
|
var directChildren = _this.getDirectChildren(parentId);
|
|
2729
2830
|
if (!directChildren.length) {
|
|
2730
2831
|
return;
|
|
@@ -2764,7 +2865,8 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
2764
2865
|
if (!this.isFilteredData) {
|
|
2765
2866
|
this.selectedData = [];
|
|
2766
2867
|
}
|
|
2767
|
-
if (this.
|
|
2868
|
+
if (!this.isRemoteData && !this.treeSettings.loadOnDemand && this.treeSettings.autoCheck &&
|
|
2869
|
+
this.isFilteredData && !isNOU(this.value)) {
|
|
2768
2870
|
this.updateFilteredAutoCheckValues();
|
|
2769
2871
|
}
|
|
2770
2872
|
if (!isNOU(this.value)) {
|
|
@@ -2843,6 +2945,7 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
2843
2945
|
else {
|
|
2844
2946
|
this.inputWrapper.setAttribute('aria-label', this.getModuleName());
|
|
2845
2947
|
}
|
|
2948
|
+
this.updateIndeterminateNodes();
|
|
2846
2949
|
};
|
|
2847
2950
|
DropDownTree.prototype.setChipValues = function (text, value) {
|
|
2848
2951
|
if (!this.inputWrapper.contains(this.chipWrapper)) {
|
package/src/mention/mention.js
CHANGED
|
@@ -456,7 +456,7 @@ var Mention = /** @class */ (function (_super) {
|
|
|
456
456
|
? lastWordRange.substring(lastWordRange.lastIndexOf(this.mentionChar) + 1).trim()
|
|
457
457
|
: lastWordRange.replace(this.mentionChar, '');
|
|
458
458
|
}
|
|
459
|
-
if (this.queryString !== '' && e.keyCode === 8 && lastWordRange.includes(this.mentionChar) && !this.isPopupOpen &&
|
|
459
|
+
if (this.queryString !== '' && e.keyCode === 8 && lastWordRange.includes(this.mentionChar) && !this.isPopupOpen && !isNullOrUndefined(this.displayTemplate) &&
|
|
460
460
|
((typeof this.displayTemplate === 'function' ? this.displayTemplate() : this.displayTemplate)).includes(this.mentionChar)) {
|
|
461
461
|
this.queryString = '';
|
|
462
462
|
}
|
|
@@ -837,6 +837,7 @@ export declare class MultiSelect extends DropDownBase implements IInput {
|
|
|
837
837
|
protected preRender(): void;
|
|
838
838
|
protected getLocaleName(): string;
|
|
839
839
|
private initializeData;
|
|
840
|
+
private sanitizeData;
|
|
840
841
|
private updateData;
|
|
841
842
|
private initialTextUpdate;
|
|
842
843
|
protected renderList(isEmptyData?: boolean): void;
|
|
@@ -243,6 +243,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
243
243
|
};
|
|
244
244
|
MultiSelect.prototype.onPopupShown = function (e) {
|
|
245
245
|
var _this = this;
|
|
246
|
+
this.sanitizeData();
|
|
246
247
|
if (Browser.isDevice && (this.mode === 'CheckBox' && this.allowFiltering)) {
|
|
247
248
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
248
249
|
var proxy_1 = this;
|
|
@@ -1870,7 +1871,10 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
1870
1871
|
}
|
|
1871
1872
|
}
|
|
1872
1873
|
this.UpdateSkeleton();
|
|
1873
|
-
var
|
|
1874
|
+
var hasOnlyVirtualItems = this.ulElement && this.ulElement.querySelector('li.e-virtual-list') &&
|
|
1875
|
+
this.ulElement.querySelectorAll('li:not(.e-virtual-list)').length === 0;
|
|
1876
|
+
var targetElement = hasOnlyVirtualItems ? this.list : this.ulElement;
|
|
1877
|
+
var scrollEle = targetElement.querySelectorAll('li.' + dropDownBaseClasses.li
|
|
1874
1878
|
+ ':not(.' + HIDE_LIST + ')' + ':not(.e-reorder-hide)');
|
|
1875
1879
|
if (scrollEle.length > 0) {
|
|
1876
1880
|
var element = scrollEle[(isHome) ? 0 : (scrollEle.length - 1)];
|
|
@@ -3766,6 +3770,8 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
3766
3770
|
};
|
|
3767
3771
|
MultiSelect.prototype.windowResize = function () {
|
|
3768
3772
|
this.refreshPopup();
|
|
3773
|
+
this.calculateWidth();
|
|
3774
|
+
this.updateFloatLabelOverflowWidth();
|
|
3769
3775
|
if ((!this.inputFocus || this.mode === 'CheckBox') && this.viewWrapper && this.viewWrapper.parentElement) {
|
|
3770
3776
|
this.updateDelimView();
|
|
3771
3777
|
}
|
|
@@ -3995,6 +4001,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
3995
4001
|
}
|
|
3996
4002
|
this.preventSetCurrentData = false;
|
|
3997
4003
|
this.initializeData();
|
|
4004
|
+
this.sanitizeData();
|
|
3998
4005
|
this.updateDataAttribute(this.htmlAttributes);
|
|
3999
4006
|
_super.prototype.preRender.call(this);
|
|
4000
4007
|
};
|
|
@@ -4025,6 +4032,56 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
4025
4032
|
endIndex: this.itemCount
|
|
4026
4033
|
};
|
|
4027
4034
|
};
|
|
4035
|
+
MultiSelect.prototype.sanitizeData = function () {
|
|
4036
|
+
if (this.enableVirtualization && this.mode === 'CheckBox') {
|
|
4037
|
+
if (this.dataSource && Array.isArray(this.dataSource) && !(this.dataSource instanceof DataManager)) {
|
|
4038
|
+
var cleanedDataSource = [];
|
|
4039
|
+
for (var i = 0; i < this.dataSource.length; i++) {
|
|
4040
|
+
var item = this.dataSource[i];
|
|
4041
|
+
if (item !== null && item !== undefined && item !== '') {
|
|
4042
|
+
if (typeof item === 'object') {
|
|
4043
|
+
var itemValue = getValue((this.fields.value ? this.fields.value : 'value'), item);
|
|
4044
|
+
if (this.fields.value !== null) {
|
|
4045
|
+
if (itemValue !== null && itemValue !== undefined && itemValue !== '') {
|
|
4046
|
+
cleanedDataSource.push(item);
|
|
4047
|
+
}
|
|
4048
|
+
}
|
|
4049
|
+
else {
|
|
4050
|
+
cleanedDataSource.push(item);
|
|
4051
|
+
}
|
|
4052
|
+
}
|
|
4053
|
+
else if (typeof item === 'string') {
|
|
4054
|
+
if (item !== null && item !== undefined && item.trim() !== '') {
|
|
4055
|
+
cleanedDataSource.push(item);
|
|
4056
|
+
}
|
|
4057
|
+
}
|
|
4058
|
+
else {
|
|
4059
|
+
cleanedDataSource.push(item);
|
|
4060
|
+
}
|
|
4061
|
+
}
|
|
4062
|
+
}
|
|
4063
|
+
if (cleanedDataSource.length !== this.dataSource.length) {
|
|
4064
|
+
this.setProperties({ dataSource: cleanedDataSource }, true);
|
|
4065
|
+
}
|
|
4066
|
+
}
|
|
4067
|
+
if (this.value && Array.isArray(this.value) && this.value.length > 0) {
|
|
4068
|
+
var cleanedValue = [];
|
|
4069
|
+
for (var i = 0; i < this.value.length; i++) {
|
|
4070
|
+
var val = this.value[i];
|
|
4071
|
+
if (val !== null && val !== undefined && val !== '') {
|
|
4072
|
+
cleanedValue.push(val);
|
|
4073
|
+
}
|
|
4074
|
+
}
|
|
4075
|
+
if (cleanedValue.length !== this.value.length) {
|
|
4076
|
+
this.setProperties({ value: cleanedValue }, true);
|
|
4077
|
+
}
|
|
4078
|
+
}
|
|
4079
|
+
return true;
|
|
4080
|
+
}
|
|
4081
|
+
else {
|
|
4082
|
+
return false;
|
|
4083
|
+
}
|
|
4084
|
+
};
|
|
4028
4085
|
MultiSelect.prototype.updateData = function (delimiterChar, e, isInitialVirtualData) {
|
|
4029
4086
|
var data = '';
|
|
4030
4087
|
var delim = this.mode === 'Delimiter' || this.mode === 'CheckBox';
|
|
@@ -4175,6 +4232,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
4175
4232
|
|| this.list.querySelector('.e-ul') && this.list.querySelector('.e-ul').childElementCount === 0)) {
|
|
4176
4233
|
isEmptyData = true;
|
|
4177
4234
|
}
|
|
4235
|
+
this.sanitizeData();
|
|
4178
4236
|
_super.prototype.render.call(this, null, isEmptyData);
|
|
4179
4237
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4180
4238
|
this.totalItemCount = this.dataSource && this.dataSource.length ? this.dataSource.length : 0;
|
|
@@ -5913,6 +5971,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
5913
5971
|
switch (prop) {
|
|
5914
5972
|
case 'query':
|
|
5915
5973
|
case 'dataSource':
|
|
5974
|
+
this.sanitizeData();
|
|
5916
5975
|
if (this.mode === 'CheckBox' && this.showSelectAll) {
|
|
5917
5976
|
if (!isNullOrUndefined(this.popupObj)) {
|
|
5918
5977
|
this.popupObj.destroy();
|
|
@@ -5935,6 +5994,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
5935
5994
|
this.updateVal(this.value, this.value, 'text');
|
|
5936
5995
|
break;
|
|
5937
5996
|
case 'value':
|
|
5997
|
+
this.sanitizeData();
|
|
5938
5998
|
if (this.fields.disabled) {
|
|
5939
5999
|
this.removeDisabledItemsValue(this.value);
|
|
5940
6000
|
}
|
|
@@ -6371,6 +6431,8 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
6371
6431
|
}
|
|
6372
6432
|
this.firstItem = this.dataSource && this.dataSource.length > 0 ? this.dataSource[0] : null;
|
|
6373
6433
|
var args = { cancel: false };
|
|
6434
|
+
var oldValue = extend([], this.value, [], true);
|
|
6435
|
+
var oldData = extend([], this.dataSource, [], true);
|
|
6374
6436
|
this.trigger('beforeOpen', args, function (args) {
|
|
6375
6437
|
if (!args.cancel) {
|
|
6376
6438
|
if (!_this.ulElement) {
|
|
@@ -6382,6 +6444,50 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
6382
6444
|
if (_this.inputElement && _this.mode !== 'CheckBox') {
|
|
6383
6445
|
_this.focusIn();
|
|
6384
6446
|
}
|
|
6447
|
+
if (_this.enableVirtualization && _this.mode === 'CheckBox') {
|
|
6448
|
+
if (JSON.stringify(oldData) !== JSON.stringify(_this.dataSource) && _this.sanitizeData() && _this.showSelectAll) {
|
|
6449
|
+
_this.renderPopup();
|
|
6450
|
+
}
|
|
6451
|
+
if (!isNullOrUndefined(oldValue) && !isNullOrUndefined(_this.value) &&
|
|
6452
|
+
JSON.stringify(oldValue) !== JSON.stringify(_this.value) && _this.sanitizeData()) {
|
|
6453
|
+
if (_this.fields.disabled) {
|
|
6454
|
+
_this.removeDisabledItemsValue(_this.value);
|
|
6455
|
+
}
|
|
6456
|
+
if (!_this.validateValues(_this.value, oldValue)) {
|
|
6457
|
+
return;
|
|
6458
|
+
}
|
|
6459
|
+
if (_this.isVue && !_this.changeOnBlur && !_this.validateValues(_this.value, oldValue)) {
|
|
6460
|
+
return;
|
|
6461
|
+
}
|
|
6462
|
+
_this.updateVal(_this.value, oldValue, 'value', _this.enableVirtualization);
|
|
6463
|
+
_this.addValidInputClass();
|
|
6464
|
+
if (_this.showSelectAll) {
|
|
6465
|
+
_this.renderPopup();
|
|
6466
|
+
var totalCount = _this.dataSource instanceof DataManager ? 0 :
|
|
6467
|
+
_this.dataSource.length;
|
|
6468
|
+
var selectedCount = _this.value ? _this.value.length : 0;
|
|
6469
|
+
if (selectedCount === totalCount) {
|
|
6470
|
+
var frame = null;
|
|
6471
|
+
if (_this.popupObj) {
|
|
6472
|
+
frame = _this.popupObj.element.querySelector('.e-selectall-parent .e-frame');
|
|
6473
|
+
}
|
|
6474
|
+
if (frame) {
|
|
6475
|
+
frame.classList.add('e-check');
|
|
6476
|
+
frame.classList.remove('e-uncheck');
|
|
6477
|
+
frame.classList.remove('e-stop');
|
|
6478
|
+
}
|
|
6479
|
+
}
|
|
6480
|
+
}
|
|
6481
|
+
if (!_this.closePopupOnSelect && _this.isPopupOpen()) {
|
|
6482
|
+
_this.refreshPopup();
|
|
6483
|
+
}
|
|
6484
|
+
if (_this.isPopupOpen() && _this.list && _this.list.querySelector('.e-active.e-disable')) {
|
|
6485
|
+
var activeItems = _this.list.querySelectorAll('li.' + dropDownBaseClasses.li + '.e-active' + '.e-disable');
|
|
6486
|
+
removeClass(activeItems, 'e-disable');
|
|
6487
|
+
}
|
|
6488
|
+
_this.preventChange = _this.isAngular && _this.preventChange ? !_this.preventChange : _this.preventChange;
|
|
6489
|
+
}
|
|
6490
|
+
}
|
|
6385
6491
|
return;
|
|
6386
6492
|
}
|
|
6387
6493
|
if (_this.mode === 'CheckBox' && Browser.isDevice && _this.allowFiltering && _this.isDeviceFullScreen) {
|
|
@@ -6538,6 +6644,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
6538
6644
|
// eslint-disable-next-line
|
|
6539
6645
|
this.value = this.value.slice();
|
|
6540
6646
|
}
|
|
6647
|
+
this.sanitizeData();
|
|
6541
6648
|
this.setDynValue = this.initStatus = false;
|
|
6542
6649
|
this.isSelectAll = false;
|
|
6543
6650
|
this.selectAllEventEle = [];
|