@syncfusion/ej2-navigations 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-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 +164 -7
- package/dist/es6/ej2-navigations.es2015.js.map +1 -1
- package/dist/es6/ej2-navigations.es5.js +167 -10
- 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 +8 -8
- package/src/toolbar/toolbar.d.ts +2 -0
- package/src/toolbar/toolbar.js +16 -0
- package/src/treeview/treeview.d.ts +3 -0
- package/src/treeview/treeview.js +151 -10
|
@@ -3955,6 +3955,7 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
|
|
|
3955
3955
|
var _this = _super.call(this, options, element) || this;
|
|
3956
3956
|
_this.resizeContext = _this.resize.bind(_this);
|
|
3957
3957
|
_this.orientationChangeContext = _this.orientationChange.bind(_this);
|
|
3958
|
+
_this.lastObservedWidth = 0;
|
|
3958
3959
|
/**
|
|
3959
3960
|
* Contains the keyboard configuration of the Toolbar.
|
|
3960
3961
|
*/
|
|
@@ -3988,6 +3989,10 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
|
|
|
3988
3989
|
}
|
|
3989
3990
|
});
|
|
3990
3991
|
this.unwireEvents();
|
|
3992
|
+
this.lastObservedWidth = 0;
|
|
3993
|
+
if (this.resizeObserver && this.element.closest('.e-splitter')) {
|
|
3994
|
+
this.resizeObserver.disconnect();
|
|
3995
|
+
}
|
|
3991
3996
|
this.tempId.forEach(function (ele) {
|
|
3992
3997
|
if (!isNullOrUndefined(_this.element.querySelector(ele))) {
|
|
3993
3998
|
document.body.appendChild(_this.element.querySelector(ele)).style.display = 'none';
|
|
@@ -4572,6 +4577,17 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
|
|
|
4572
4577
|
this.scrollEvent = this.docEvent.bind(this);
|
|
4573
4578
|
this.renderControl();
|
|
4574
4579
|
this.wireEvents();
|
|
4580
|
+
if (this.element.closest('.e-splitter')) {
|
|
4581
|
+
this.lastObservedWidth = this.element.offsetWidth;
|
|
4582
|
+
this.resizeObserver = new window.ResizeObserver(function () {
|
|
4583
|
+
if (_this.element.offsetWidth === _this.lastObservedWidth) {
|
|
4584
|
+
return;
|
|
4585
|
+
}
|
|
4586
|
+
_this.lastObservedWidth = _this.element.offsetWidth;
|
|
4587
|
+
_this.refreshOverflow();
|
|
4588
|
+
});
|
|
4589
|
+
this.resizeObserver.observe(this.element);
|
|
4590
|
+
}
|
|
4575
4591
|
this.renderComplete();
|
|
4576
4592
|
if (this.isReact && this.portals && this.portals.length > 0) {
|
|
4577
4593
|
this.renderReactTemplates(function () {
|
|
@@ -11044,6 +11060,8 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
|
|
|
11044
11060
|
_this.virtualTreeDirty = false;
|
|
11045
11061
|
_this.virtualFocusedId = null;
|
|
11046
11062
|
_this.virtualSkipNextScrollRender = false;
|
|
11063
|
+
_this.filterCheckedNodes = [];
|
|
11064
|
+
_this.filterIndeterminateNodes = [];
|
|
11047
11065
|
return _this;
|
|
11048
11066
|
}
|
|
11049
11067
|
TreeView_1 = TreeView;
|
|
@@ -11344,6 +11362,11 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
|
|
|
11344
11362
|
return false;
|
|
11345
11363
|
}
|
|
11346
11364
|
};
|
|
11365
|
+
TreeView.prototype.isRemoteDataLoadOnDemand = function () {
|
|
11366
|
+
var remoteDataSource = (this.fields.dataSource instanceof DataManager) ||
|
|
11367
|
+
(this.fields.child && this.fields.child.dataSource instanceof DataManager ? true : false);
|
|
11368
|
+
return !remoteDataSource && !this.loadOnDemand;
|
|
11369
|
+
};
|
|
11347
11370
|
TreeView.prototype.renderItems = function (isSorted) {
|
|
11348
11371
|
if (this.enableVirtualization && !isNullOrUndefined(this.height)) {
|
|
11349
11372
|
this.ulElement = this.createElement('ul', {
|
|
@@ -11532,7 +11555,9 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
|
|
|
11532
11555
|
if (this_1.checkedNodes.indexOf(childId) !== -1) {
|
|
11533
11556
|
count++;
|
|
11534
11557
|
}
|
|
11535
|
-
else if (this_1.element.classList.contains('e-filtering') &&
|
|
11558
|
+
else if (this_1.element.classList.contains('e-filtering') && (this_1.isRemoteDataLoadOnDemand() ?
|
|
11559
|
+
this_1.filterCheckedNodes.findIndex(function (id) { return id === childId; }) !== -1 :
|
|
11560
|
+
OldCheckedNodes.findIndex(function (e) { return e['id'] === childId; }) !== -1)) {
|
|
11536
11561
|
count++;
|
|
11537
11562
|
}
|
|
11538
11563
|
};
|
|
@@ -11851,6 +11876,23 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
|
|
|
11851
11876
|
}
|
|
11852
11877
|
});
|
|
11853
11878
|
var parentNodeChecked = false;
|
|
11879
|
+
if (this.isRemoteDataLoadOnDemand() && this.element.classList.contains('e-filtering') && this.autoCheck) {
|
|
11880
|
+
if (this.filterCheckedNodes.indexOf(dataUid_1) !== -1) {
|
|
11881
|
+
this.changeState(checkBoxEle, 'check', null, true, true);
|
|
11882
|
+
}
|
|
11883
|
+
else if (this.filterIndeterminateNodes.indexOf(dataUid_1) !== -1) {
|
|
11884
|
+
this.changeState(checkBoxEle, 'indeterminate', null, true, true);
|
|
11885
|
+
}
|
|
11886
|
+
else {
|
|
11887
|
+
this.changeState(checkBoxEle, 'uncheck', null, true, true);
|
|
11888
|
+
}
|
|
11889
|
+
var parentUL_1 = closest(element, '.' + PARENTITEM);
|
|
11890
|
+
if (!isNullOrUndefined(parentUL_1)) {
|
|
11891
|
+
var currentParent = closest(parentUL_1, '.' + LISTITEM);
|
|
11892
|
+
this.ensureParentCheckState(currentParent);
|
|
11893
|
+
}
|
|
11894
|
+
return;
|
|
11895
|
+
}
|
|
11854
11896
|
if (this.element.classList.contains('e-filtering')) {
|
|
11855
11897
|
var oldCheckedNodes = new DataManager(this.OldCheckedData).executeLocal(new Query().where('parentID', 'equal', dataUid_1, true));
|
|
11856
11898
|
checkedCount = oldCheckedNodes.length;
|
|
@@ -11958,7 +12000,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
|
|
|
11958
12000
|
}
|
|
11959
12001
|
});
|
|
11960
12002
|
};
|
|
11961
|
-
TreeView.prototype.getAllChildNodes = function (data, parentId) {
|
|
12003
|
+
TreeView.prototype.getAllChildNodes = function (data, parentId, includeAllDescendants) {
|
|
11962
12004
|
if (isNullOrUndefined(data) || isNullOrUndefined(parentId)) {
|
|
11963
12005
|
return [];
|
|
11964
12006
|
}
|
|
@@ -11975,17 +12017,55 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
|
|
|
11975
12017
|
}
|
|
11976
12018
|
if (this.dataType === 2) {
|
|
11977
12019
|
var parentFieldId_1 = this.fields.id;
|
|
11978
|
-
var
|
|
11979
|
-
var
|
|
11980
|
-
var
|
|
11981
|
-
|
|
11982
|
-
|
|
11983
|
-
|
|
12020
|
+
var childField_1 = this.fields.child.toString();
|
|
12021
|
+
var target = parentId.toString();
|
|
12022
|
+
var findNodeInTree_1 = function (nodes, id) {
|
|
12023
|
+
if (!Array.isArray(nodes)) {
|
|
12024
|
+
return undefined;
|
|
12025
|
+
}
|
|
12026
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
12027
|
+
var n = nodes[parseInt(i.toString(), 10)];
|
|
12028
|
+
var idVal = getValue(parentFieldId_1, n);
|
|
12029
|
+
if (!isNullOrUndefined(idVal) && idVal.toString() === id) {
|
|
12030
|
+
return n;
|
|
12031
|
+
}
|
|
12032
|
+
var subs = getValue(childField_1, n);
|
|
12033
|
+
var found = findNodeInTree_1(subs, id);
|
|
12034
|
+
if (found) {
|
|
12035
|
+
return found;
|
|
12036
|
+
}
|
|
12037
|
+
}
|
|
12038
|
+
return undefined;
|
|
12039
|
+
};
|
|
12040
|
+
var node = findNodeInTree_1(data, target);
|
|
11984
12041
|
if (!node) {
|
|
11985
12042
|
return [];
|
|
11986
12043
|
}
|
|
11987
|
-
var children = getValue(
|
|
11988
|
-
|
|
12044
|
+
var children = getValue(childField_1, node);
|
|
12045
|
+
if (!Array.isArray(children)) {
|
|
12046
|
+
return [];
|
|
12047
|
+
}
|
|
12048
|
+
if (!includeAllDescendants) {
|
|
12049
|
+
return children;
|
|
12050
|
+
}
|
|
12051
|
+
var result_1 = children.slice();
|
|
12052
|
+
var collectNested_1 = function (nodes) {
|
|
12053
|
+
if (!Array.isArray(nodes)) {
|
|
12054
|
+
return;
|
|
12055
|
+
}
|
|
12056
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
12057
|
+
var n = nodes[parseInt(i.toString(), 10)];
|
|
12058
|
+
var grandChildren = getValue(childField_1, n);
|
|
12059
|
+
if (Array.isArray(grandChildren) && grandChildren.length) {
|
|
12060
|
+
for (var j = 0; j < grandChildren.length; j++) {
|
|
12061
|
+
result_1.push(grandChildren[parseInt(j.toString(), 10)]);
|
|
12062
|
+
}
|
|
12063
|
+
collectNested_1(grandChildren);
|
|
12064
|
+
}
|
|
12065
|
+
}
|
|
12066
|
+
};
|
|
12067
|
+
collectNested_1(children);
|
|
12068
|
+
return result_1;
|
|
11989
12069
|
}
|
|
11990
12070
|
return [];
|
|
11991
12071
|
};
|
|
@@ -13730,6 +13810,83 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
|
|
|
13730
13810
|
}
|
|
13731
13811
|
}
|
|
13732
13812
|
}
|
|
13813
|
+
if (this.isRemoteDataLoadOnDemand() && this.element.classList.contains('e-filtering') && this.autoCheck) {
|
|
13814
|
+
var nodeUid = li.getAttribute('data-uid');
|
|
13815
|
+
if (isNullOrUndefined(nodeUid)) {
|
|
13816
|
+
return;
|
|
13817
|
+
}
|
|
13818
|
+
var checkedIndex = this.filterCheckedNodes.indexOf(nodeUid);
|
|
13819
|
+
var indeterminateIndex = this.filterIndeterminateNodes.indexOf(nodeUid);
|
|
13820
|
+
var shouldCheck = !isCheck;
|
|
13821
|
+
if (shouldCheck) {
|
|
13822
|
+
if (checkedIndex === -1) {
|
|
13823
|
+
this.filterCheckedNodes.push(nodeUid);
|
|
13824
|
+
}
|
|
13825
|
+
if (indeterminateIndex !== -1) {
|
|
13826
|
+
this.filterIndeterminateNodes.splice(indeterminateIndex, 1);
|
|
13827
|
+
}
|
|
13828
|
+
}
|
|
13829
|
+
else {
|
|
13830
|
+
if (checkedIndex !== -1) {
|
|
13831
|
+
this.filterCheckedNodes.splice(checkedIndex, 1);
|
|
13832
|
+
}
|
|
13833
|
+
}
|
|
13834
|
+
var parentLi = closest(closest(li, '.' + PARENTITEM), '.' + LISTITEM);
|
|
13835
|
+
while (!isNullOrUndefined(parentLi)) {
|
|
13836
|
+
var parentUid = parentLi.getAttribute('data-uid');
|
|
13837
|
+
if (!isNullOrUndefined(parentUid)) {
|
|
13838
|
+
var parentChildren = this.getAllChildNodes(this.DDTTreeData, parentUid, true);
|
|
13839
|
+
if (parentChildren && parentChildren.length > 0) {
|
|
13840
|
+
var firstChildState = void 0;
|
|
13841
|
+
var mismatchFound = false;
|
|
13842
|
+
for (var i = 0; i < parentChildren.length; i++) {
|
|
13843
|
+
var childData = parentChildren[parseInt(i.toString(), 10)];
|
|
13844
|
+
var childId = childData && childData[this.fields.id]
|
|
13845
|
+
? childData[this.fields.id].toString()
|
|
13846
|
+
: null;
|
|
13847
|
+
if (isNullOrUndefined(childId)) {
|
|
13848
|
+
continue;
|
|
13849
|
+
}
|
|
13850
|
+
var childCheckedState = this.filterIndeterminateNodes.indexOf(childId) !== -1
|
|
13851
|
+
? null
|
|
13852
|
+
: this.filterCheckedNodes.indexOf(childId) !== -1;
|
|
13853
|
+
if (firstChildState === void 0) {
|
|
13854
|
+
firstChildState = childCheckedState;
|
|
13855
|
+
}
|
|
13856
|
+
else if (childCheckedState !== firstChildState) {
|
|
13857
|
+
mismatchFound = true;
|
|
13858
|
+
break;
|
|
13859
|
+
}
|
|
13860
|
+
}
|
|
13861
|
+
if (mismatchFound || firstChildState === null) {
|
|
13862
|
+
if (this.filterIndeterminateNodes.indexOf(parentUid) === -1) {
|
|
13863
|
+
this.filterIndeterminateNodes.push(parentUid);
|
|
13864
|
+
}
|
|
13865
|
+
var parentCheckedIndex = this.filterCheckedNodes.indexOf(parentUid);
|
|
13866
|
+
if (parentCheckedIndex !== -1) {
|
|
13867
|
+
this.filterCheckedNodes.splice(parentCheckedIndex, 1);
|
|
13868
|
+
}
|
|
13869
|
+
}
|
|
13870
|
+
else {
|
|
13871
|
+
var parentIndeterminateIndex = this.filterIndeterminateNodes.indexOf(parentUid);
|
|
13872
|
+
if (parentIndeterminateIndex !== -1) {
|
|
13873
|
+
this.filterIndeterminateNodes.splice(parentIndeterminateIndex, 1);
|
|
13874
|
+
}
|
|
13875
|
+
var parentCheckedIndex = this.filterCheckedNodes.indexOf(parentUid);
|
|
13876
|
+
if (firstChildState === true) {
|
|
13877
|
+
if (parentCheckedIndex === -1) {
|
|
13878
|
+
this.filterCheckedNodes.push(parentUid);
|
|
13879
|
+
}
|
|
13880
|
+
}
|
|
13881
|
+
else if (parentCheckedIndex !== -1) {
|
|
13882
|
+
this.filterCheckedNodes.splice(parentCheckedIndex, 1);
|
|
13883
|
+
}
|
|
13884
|
+
}
|
|
13885
|
+
}
|
|
13886
|
+
}
|
|
13887
|
+
parentLi = closest(closest(parentLi, '.' + PARENTITEM), '.' + LISTITEM);
|
|
13888
|
+
}
|
|
13889
|
+
}
|
|
13733
13890
|
this.changeState(checkWrap, isCheck ? 'uncheck' : 'check', e, true);
|
|
13734
13891
|
this.updateActiveClass(li, isCheck);
|
|
13735
13892
|
if (this.autoCheck) {
|