@syncfusion/ej2-navigations 31.2.2 → 31.2.3
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/dist/ej2-navigations.min.js +2 -2
- package/dist/ej2-navigations.umd.min.js +2 -2
- package/dist/ej2-navigations.umd.min.js.map +1 -1
- package/dist/es6/ej2-navigations.es2015.js +43 -5
- package/dist/es6/ej2-navigations.es2015.js.map +1 -1
- package/dist/es6/ej2-navigations.es5.js +44 -5
- package/dist/es6/ej2-navigations.es5.js.map +1 -1
- package/dist/global/ej2-navigations.min.js +2 -2
- package/dist/global/ej2-navigations.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +3 -3
- package/src/breadcrumb/breadcrumb.js +4 -3
- package/src/treeview/treeview.d.ts +1 -0
- package/src/treeview/treeview.js +40 -2
|
@@ -11247,7 +11247,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
|
|
|
11247
11247
|
}
|
|
11248
11248
|
this.changeState(node, 'check', null, true, true);
|
|
11249
11249
|
}
|
|
11250
|
-
else if (count === 0 && this.checkedNodes.length === 0) {
|
|
11250
|
+
else if (count === 0 && this.checkedNodes.length === 0 && indeterminate.length === 0) {
|
|
11251
11251
|
this.changeState(node, 'uncheck', null, true, true);
|
|
11252
11252
|
}
|
|
11253
11253
|
}
|
|
@@ -11517,6 +11517,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
|
|
|
11517
11517
|
}
|
|
11518
11518
|
};
|
|
11519
11519
|
TreeView.prototype.ensureParentCheckState = function (element) {
|
|
11520
|
+
var _this = this;
|
|
11520
11521
|
if (!isNullOrUndefined(element)) {
|
|
11521
11522
|
if (element.classList.contains(ROOT)) {
|
|
11522
11523
|
return;
|
|
@@ -11536,6 +11537,8 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
|
|
|
11536
11537
|
var dataUid_1 = element.getAttribute('data-uid');
|
|
11537
11538
|
var rootNodeChecked_1 = true;
|
|
11538
11539
|
var childNodeChecked_1 = false;
|
|
11540
|
+
var ChildNodeData = this.getAllChildNodes(this.DDTTreeData, dataUid_1);
|
|
11541
|
+
var selectedChildren_1 = 0;
|
|
11539
11542
|
nodes.forEach(function (childNode) {
|
|
11540
11543
|
if (childNode instanceof HTMLElement) {
|
|
11541
11544
|
var ariaChecked = childNode.getAttribute('aria-checked');
|
|
@@ -11565,6 +11568,13 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
|
|
|
11565
11568
|
childItems = this.getChildNodes(this.DDTTreeData, dataUid_1);
|
|
11566
11569
|
}
|
|
11567
11570
|
count = childItems.length;
|
|
11571
|
+
ChildNodeData.forEach(function (child) {
|
|
11572
|
+
var childKey = String(child[_this.fields.id]);
|
|
11573
|
+
if (_this.checkedNodes.indexOf(childKey) !== -1 ||
|
|
11574
|
+
_this.OldCheckedData.some(function (oldNode) { return oldNode['parentID'] === childKey; })) {
|
|
11575
|
+
selectedChildren_1++;
|
|
11576
|
+
}
|
|
11577
|
+
});
|
|
11568
11578
|
}
|
|
11569
11579
|
if (this.autoCheck && this.showCheckBox && !(this.fields.dataSource instanceof DataManager)) {
|
|
11570
11580
|
var selectedChildNodeDetails = this.getSelectedChildNodeDetails(dataUid_1);
|
|
@@ -11584,7 +11594,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
|
|
|
11584
11594
|
else if ((checkedCount > 0 && !parentNodeChecked && (this.autoCheck && this.showCheckBox))) {
|
|
11585
11595
|
this.changeState(checkBoxEle, 'indeterminate', null, true, true);
|
|
11586
11596
|
}
|
|
11587
|
-
else if (checkedCount > 0 || indeterminateNodes.length > 0) {
|
|
11597
|
+
else if (checkedCount > 0 || indeterminateNodes.length > 0 || selectedChildren_1 > 0) {
|
|
11588
11598
|
this.changeState(checkBoxEle, 'indeterminate', null, true, true);
|
|
11589
11599
|
}
|
|
11590
11600
|
else if (checkedCount === 0) {
|
|
@@ -11631,6 +11641,34 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
|
|
|
11631
11641
|
return false;
|
|
11632
11642
|
});
|
|
11633
11643
|
};
|
|
11644
|
+
TreeView.prototype.getAllChildNodes = function (data, parentId) {
|
|
11645
|
+
if (isNullOrUndefined(data) || isNullOrUndefined(parentId)) {
|
|
11646
|
+
return [];
|
|
11647
|
+
}
|
|
11648
|
+
if (this.dataType === 1) {
|
|
11649
|
+
var pidField_1 = this.fields.parentID;
|
|
11650
|
+
var target_1 = parentId.toString();
|
|
11651
|
+
return data.filter(function (item) {
|
|
11652
|
+
var pidVal = getValue(pidField_1, item);
|
|
11653
|
+
return !isNullOrUndefined(pidVal) && pidVal.toString() === target_1;
|
|
11654
|
+
});
|
|
11655
|
+
}
|
|
11656
|
+
if (this.dataType === 2) {
|
|
11657
|
+
var parentFieldId_1 = this.fields.id;
|
|
11658
|
+
var childField = this.fields.child.toString();
|
|
11659
|
+
var target_2 = parentId.toString();
|
|
11660
|
+
var node = data.find(function (n) {
|
|
11661
|
+
var idVal = getValue(parentFieldId_1, n);
|
|
11662
|
+
return !isNullOrUndefined(idVal) && idVal.toString() === target_2;
|
|
11663
|
+
});
|
|
11664
|
+
if (!node) {
|
|
11665
|
+
return [];
|
|
11666
|
+
}
|
|
11667
|
+
var children = getValue(childField, node);
|
|
11668
|
+
return Array.isArray(children) ? children : [];
|
|
11669
|
+
}
|
|
11670
|
+
return [];
|
|
11671
|
+
};
|
|
11634
11672
|
TreeView.prototype.ensureChildCheckState = function (element, e, isFromExpandAll) {
|
|
11635
11673
|
var _this = this;
|
|
11636
11674
|
if (!isNullOrUndefined(element)) {
|
|
@@ -17410,6 +17448,10 @@ var Breadcrumb = /** @__PURE__ @class */ (function (_super) {
|
|
|
17410
17448
|
args.item.removeAttribute('role');
|
|
17411
17449
|
if (isLastItem) {
|
|
17412
17450
|
args.item.setAttribute('data-active-item', '');
|
|
17451
|
+
args.item.setAttribute('aria-current', 'page');
|
|
17452
|
+
}
|
|
17453
|
+
else {
|
|
17454
|
+
args.item.removeAttribute('aria-current');
|
|
17413
17455
|
}
|
|
17414
17456
|
if (!_this.itemTemplate) {
|
|
17415
17457
|
_this.beforeItemRenderChanges(args.curData, eventArgs.item, args.item, containsRightIcon);
|
|
@@ -17601,9 +17643,6 @@ var Breadcrumb = /** @__PURE__ @class */ (function (_super) {
|
|
|
17601
17643
|
};
|
|
17602
17644
|
Breadcrumb.prototype.beforeItemRenderChanges = function (prevItem, currItem, elem, isRightIcon) {
|
|
17603
17645
|
var wrapElem = elem.querySelector('.e-anchor-wrap');
|
|
17604
|
-
if (wrapElem) {
|
|
17605
|
-
wrapElem.parentElement.setAttribute('aria-label', 'home');
|
|
17606
|
-
}
|
|
17607
17646
|
if (currItem.text !== prevItem.text && wrapElem) {
|
|
17608
17647
|
wrapElem.childNodes.forEach(function (child) {
|
|
17609
17648
|
if (child.nodeType === Node.TEXT_NODE) {
|