@syncfusion/ej2-navigations 27.1.56 → 27.1.57
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 +75 -4
- package/dist/es6/ej2-navigations.es2015.js.map +1 -1
- package/dist/es6/ej2-navigations.es5.js +77 -4
- 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 +6 -6
- package/src/carousel/carousel.js +2 -1
- package/src/sidebar/sidebar.js +3 -0
- package/src/treeview/treeview.d.ts +11 -1
- package/src/treeview/treeview.js +72 -3
|
@@ -11095,13 +11095,31 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
|
|
|
11095
11095
|
var checkBoxEle = element.getElementsByClassName(CHECKBOXWRAP)[0];
|
|
11096
11096
|
var count = nodes.length;
|
|
11097
11097
|
var checkedCount = checkedNodes.length;
|
|
11098
|
+
var matchedChildNodes = [];
|
|
11099
|
+
var oldChildCount = [];
|
|
11098
11100
|
var dataUid_1 = element.getAttribute('data-uid');
|
|
11101
|
+
var rootNodeChecked_1 = true;
|
|
11102
|
+
var childNodeChecked_1 = false;
|
|
11103
|
+
nodes.forEach(function (childNode) {
|
|
11104
|
+
if (childNode instanceof HTMLElement) {
|
|
11105
|
+
var ariaChecked = childNode.getAttribute('aria-checked');
|
|
11106
|
+
if (ariaChecked === 'true') {
|
|
11107
|
+
childNodeChecked_1 = true;
|
|
11108
|
+
}
|
|
11109
|
+
else {
|
|
11110
|
+
rootNodeChecked_1 = false;
|
|
11111
|
+
}
|
|
11112
|
+
}
|
|
11113
|
+
});
|
|
11114
|
+
var parentNodeChecked = false;
|
|
11099
11115
|
if (this.element.classList.contains('e-filtering')) {
|
|
11100
11116
|
var oldCheckedNodes = new DataManager(this.OldCheckedData).executeLocal(new Query().where('parentID', 'equal', dataUid_1, true));
|
|
11101
11117
|
checkedCount = oldCheckedNodes.length;
|
|
11102
11118
|
var parentNode = new DataManager(this.OldCheckedData).executeLocal(new Query().where('hasChildren', 'equal', true, true));
|
|
11103
|
-
if (
|
|
11119
|
+
if (parentNode.length > 0
|
|
11120
|
+
&& (this.OldCheckedData.some(function (oldNode) { return oldNode.id === dataUid_1; }) && childNodeChecked_1)) {
|
|
11104
11121
|
checkedCount = parentNode.length;
|
|
11122
|
+
parentNodeChecked = true;
|
|
11105
11123
|
}
|
|
11106
11124
|
var childItems = [];
|
|
11107
11125
|
if (this.dataType === 1) {
|
|
@@ -11112,12 +11130,23 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
|
|
|
11112
11130
|
}
|
|
11113
11131
|
count = childItems.length;
|
|
11114
11132
|
}
|
|
11133
|
+
if (this.autoCheck && this.showCheckBox) {
|
|
11134
|
+
var selectedChildNodeDetails = this.getSelectedChildNodeDetails(dataUid_1);
|
|
11135
|
+
matchedChildNodes = selectedChildNodeDetails;
|
|
11136
|
+
oldChildCount = new DataManager(this.checkActionNodes)
|
|
11137
|
+
.executeLocal(new Query().where('parentID', 'equal', dataUid_1, true));
|
|
11138
|
+
}
|
|
11115
11139
|
if (count === 0 && checkedCount === 0) {
|
|
11116
11140
|
return;
|
|
11117
11141
|
}
|
|
11118
|
-
else if (count === checkedCount)
|
|
11142
|
+
else if (count === checkedCount || ((parentNodeChecked && count > 0) && (oldChildCount.length === matchedChildNodes.length)
|
|
11143
|
+
&& (oldChildCount.length !== 0 && matchedChildNodes.length !== 0) && rootNodeChecked_1
|
|
11144
|
+
&& (this.autoCheck && this.showCheckBox))) {
|
|
11119
11145
|
this.changeState(checkBoxEle, 'check', null, true, true);
|
|
11120
11146
|
}
|
|
11147
|
+
else if ((checkedCount > 0 && !parentNodeChecked && (this.autoCheck && this.showCheckBox))) {
|
|
11148
|
+
this.changeState(checkBoxEle, 'indeterminate', null, true, true);
|
|
11149
|
+
}
|
|
11121
11150
|
else if (checkedCount > 0 || indeterminateNodes.length > 0) {
|
|
11122
11151
|
this.changeState(checkBoxEle, 'indeterminate', null, true, true);
|
|
11123
11152
|
}
|
|
@@ -11131,6 +11160,21 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
|
|
|
11131
11160
|
}
|
|
11132
11161
|
}
|
|
11133
11162
|
};
|
|
11163
|
+
TreeView.prototype.getSelectedChildNodeDetails = function (dataUid) {
|
|
11164
|
+
var _this = this;
|
|
11165
|
+
return this.checkedNodes
|
|
11166
|
+
.map(function (checkedNodeId) {
|
|
11167
|
+
return new DataManager(_this.DDTTreeData)
|
|
11168
|
+
.executeLocal(new Query().where('id', 'equal', checkedNodeId, true))[0];
|
|
11169
|
+
})
|
|
11170
|
+
.filter(function (childNode) {
|
|
11171
|
+
if (childNode && typeof childNode === 'object' && 'pid' in childNode) {
|
|
11172
|
+
var childNodePid = childNode.pid;
|
|
11173
|
+
return childNodePid.toString() === dataUid;
|
|
11174
|
+
}
|
|
11175
|
+
return false;
|
|
11176
|
+
});
|
|
11177
|
+
};
|
|
11134
11178
|
TreeView.prototype.ensureChildCheckState = function (element, e, isFromExpandAll) {
|
|
11135
11179
|
if (!isNullOrUndefined(element)) {
|
|
11136
11180
|
var childElement = select('.' + PARENTITEM, element);
|
|
@@ -11762,6 +11806,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
|
|
|
11762
11806
|
this.trigger('nodeChecked', eventArgs);
|
|
11763
11807
|
};
|
|
11764
11808
|
TreeView.prototype.updateOldCheckedData = function (data) {
|
|
11809
|
+
var _this = this;
|
|
11765
11810
|
var dataManager = new DataManager(data);
|
|
11766
11811
|
var childItems = dataManager.executeLocal(new Query().where('isChecked', 'equal', 'true', true));
|
|
11767
11812
|
var uncheckedItems = dataManager.executeLocal(new Query().where('isChecked', 'equal', 'false', true));
|
|
@@ -11769,6 +11814,15 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
|
|
|
11769
11814
|
var index = this.OldCheckedData.findIndex(function (e) { return e['id'] === uncheckedItems[0]['id']; });
|
|
11770
11815
|
if (index !== -1) {
|
|
11771
11816
|
this.OldCheckedData.splice(index, 1);
|
|
11817
|
+
var childNodes = this.OldCheckedData.filter(function (e) { return e['parentID'] === uncheckedItems[0]['id']; });
|
|
11818
|
+
if (childNodes.length > 0) {
|
|
11819
|
+
childNodes.forEach(function (child) {
|
|
11820
|
+
var childIndex = _this.OldCheckedData.findIndex(function (e) { return e['id'] === child.id; });
|
|
11821
|
+
if (childIndex !== -1) {
|
|
11822
|
+
_this.OldCheckedData.splice(childIndex, 1);
|
|
11823
|
+
}
|
|
11824
|
+
});
|
|
11825
|
+
}
|
|
11772
11826
|
return;
|
|
11773
11827
|
}
|
|
11774
11828
|
}
|
|
@@ -15188,6 +15242,12 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
|
|
|
15188
15242
|
for (var i = 0; i < nodes.length; i++) {
|
|
15189
15243
|
var pid = getValue(this.fields.parentID, nodes[parseInt(i.toString(), 10)]);
|
|
15190
15244
|
dropLi = pid ? this.getElement(pid.toString()) : pid;
|
|
15245
|
+
if (!isNullOrUndefined(pid) && isNullOrUndefined(dropLi)) {
|
|
15246
|
+
this.preventExpand = false;
|
|
15247
|
+
this.ensureVisible(pid);
|
|
15248
|
+
this.preventExpand = preventTargetExpand;
|
|
15249
|
+
dropLi = this.getElement(pid.toString());
|
|
15250
|
+
}
|
|
15191
15251
|
this.addGivenNodes([nodes[parseInt(i.toString(), 10)]], dropLi, index);
|
|
15192
15252
|
}
|
|
15193
15253
|
}
|
|
@@ -15419,6 +15479,15 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
|
|
|
15419
15479
|
* @param {string | Element} target - Specifies the ID of TreeView node or TreeView node as target element.
|
|
15420
15480
|
* @param {Object[]} newData - Specifies the new data of TreeView node.
|
|
15421
15481
|
* @returns {void}
|
|
15482
|
+
* ```typescript
|
|
15483
|
+
* var treeObj = document.getElementById("treeview").ej2_instances[0];
|
|
15484
|
+
* var data = treeObj.getTreeData("01");
|
|
15485
|
+
* var newData = {
|
|
15486
|
+
* id: data[0].id,
|
|
15487
|
+
* name: "new Text",
|
|
15488
|
+
* };
|
|
15489
|
+
* treeObj.refreshNode("01", [newData]);
|
|
15490
|
+
* ```
|
|
15422
15491
|
*/
|
|
15423
15492
|
TreeView.prototype.refreshNode = function (target, newData) {
|
|
15424
15493
|
if (isNullOrUndefined(target) || isNullOrUndefined(newData)) {
|
|
@@ -15534,7 +15603,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
|
|
|
15534
15603
|
}
|
|
15535
15604
|
};
|
|
15536
15605
|
/**
|
|
15537
|
-
* Replaces the text of the TreeView node with the given text.
|
|
15606
|
+
* Replaces the text of the TreeView node with the given text only when the `allowEditing` property is enabled.
|
|
15538
15607
|
*
|
|
15539
15608
|
* @param {string | Element} target - Specifies ID of TreeView node/TreeView node as target element.
|
|
15540
15609
|
* @param {string} newText - Specifies the new text of TreeView node.
|
|
@@ -16119,6 +16188,9 @@ var Sidebar = /** @__PURE__ @class */ (function (_super) {
|
|
|
16119
16188
|
}
|
|
16120
16189
|
};
|
|
16121
16190
|
Sidebar.prototype.resize = function () {
|
|
16191
|
+
if (!isNullOrUndefined(this.width) && this.width !== 'auto' && typeof this.width === 'string' && !this.width.includes('px')) {
|
|
16192
|
+
this.setType(this.type);
|
|
16193
|
+
}
|
|
16122
16194
|
if (this.type === 'Auto') {
|
|
16123
16195
|
if (Browser.isDevice) {
|
|
16124
16196
|
addClass([this.element], OVER);
|
|
@@ -17855,7 +17927,8 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
|
|
|
17855
17927
|
this.applySlideInterval();
|
|
17856
17928
|
};
|
|
17857
17929
|
Carousel.prototype.autoSlideChange = function () {
|
|
17858
|
-
var activeSlide = this.element.querySelector("." + CLS_ACTIVE$2)
|
|
17930
|
+
var activeSlide = this.element.querySelector("." + CLS_ITEM$3 + "." + CLS_ACTIVE$2)
|
|
17931
|
+
|| this.element.querySelector("." + CLS_INDICATORS + " ." + CLS_ACTIVE$2);
|
|
17859
17932
|
if (isNullOrUndefined(activeSlide)) {
|
|
17860
17933
|
return;
|
|
17861
17934
|
}
|