@syncfusion/ej2-navigations 27.2.2 → 27.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.
- 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 +73 -13
- package/dist/es6/ej2-navigations.es2015.js.map +1 -1
- package/dist/es6/ej2-navigations.es5.js +75 -11
- 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/common/menu-base.js +4 -0
- package/src/tab/tab.js +2 -0
- package/src/treeview/treeview.d.ts +12 -0
- package/src/treeview/treeview.js +69 -11
|
@@ -3208,6 +3208,10 @@ let MenuBase = class MenuBase extends Component {
|
|
|
3208
3208
|
li = this.createItems(iitems).children[idx];
|
|
3209
3209
|
const ul = this.isMenu ? select('.e-menu-parent', uls[navIdx.length]) : uls[navIdx.length];
|
|
3210
3210
|
ul.insertBefore(li, ul.children[idx]);
|
|
3211
|
+
if (i === items.length - 1 && !this.isMenu && ul.style.display === 'block') {
|
|
3212
|
+
this.setPosition(null, ul, parseFloat(ul.style.top), parseFloat(ul.style.left));
|
|
3213
|
+
ul.style.display = 'block';
|
|
3214
|
+
}
|
|
3211
3215
|
}
|
|
3212
3216
|
}
|
|
3213
3217
|
}
|
|
@@ -9115,11 +9119,13 @@ let Tab = class Tab extends Component {
|
|
|
9115
9119
|
else {
|
|
9116
9120
|
this.dragItem.querySelector('.' + CLS_WRAP).style.visibility = '';
|
|
9117
9121
|
removeClass([this.tbItems.querySelector('.' + CLS_INDICATOR)], CLS_HIDDEN$1);
|
|
9122
|
+
this.droppedIndex = isNullOrUndefined(this.droppedIndex) ? this.getEleIndex(this.dragItem) : this.droppedIndex;
|
|
9118
9123
|
this.selectTab(this.droppedIndex, null, true);
|
|
9119
9124
|
}
|
|
9120
9125
|
}
|
|
9121
9126
|
});
|
|
9122
9127
|
this.dragItem = null;
|
|
9128
|
+
this.droppedIndex = null;
|
|
9123
9129
|
}
|
|
9124
9130
|
/**
|
|
9125
9131
|
* Enables or disables the specified Tab item. On passing value as `false`, the item will be disabled.
|
|
@@ -10864,7 +10870,9 @@ let TreeView = TreeView_1 = class TreeView extends Component {
|
|
|
10864
10870
|
.filter((childNode) => {
|
|
10865
10871
|
if (childNode && typeof childNode === 'object' && 'pid' in childNode) {
|
|
10866
10872
|
const childNodePid = childNode.pid;
|
|
10867
|
-
|
|
10873
|
+
if (!isNullOrUndefined(childNodePid)) {
|
|
10874
|
+
return childNodePid.toString() === dataUid;
|
|
10875
|
+
}
|
|
10868
10876
|
}
|
|
10869
10877
|
return false;
|
|
10870
10878
|
});
|
|
@@ -10874,10 +10882,24 @@ let TreeView = TreeView_1 = class TreeView extends Component {
|
|
|
10874
10882
|
const childElement = select('.' + PARENTITEM, element);
|
|
10875
10883
|
let checkBoxes;
|
|
10876
10884
|
if (!isNullOrUndefined(childElement)) {
|
|
10885
|
+
let childCheck = Array.from(childElement.querySelectorAll('li'));
|
|
10877
10886
|
checkBoxes = selectAll('.' + CHECKBOXWRAP, childElement);
|
|
10887
|
+
if (this.isFilter) {
|
|
10888
|
+
checkBoxes = Array.from(checkBoxes).filter((checkbox) => {
|
|
10889
|
+
const dataUID = checkbox.closest('li').getAttribute('data-uid');
|
|
10890
|
+
return dataUID !== null && this.checkedNodes.indexOf(dataUID) !== -1;
|
|
10891
|
+
});
|
|
10892
|
+
childCheck = Array.from(childCheck).filter((li) => {
|
|
10893
|
+
const childIds = li.getAttribute('data-uid');
|
|
10894
|
+
return childIds !== null && this.checkedNodes.indexOf(childIds) !== -1;
|
|
10895
|
+
});
|
|
10896
|
+
if (checkBoxes.length === 0) {
|
|
10897
|
+
checkBoxes = selectAll('.' + CHECKBOXWRAP, childElement);
|
|
10898
|
+
childCheck = Array.from(childElement.querySelectorAll('li'));
|
|
10899
|
+
}
|
|
10900
|
+
}
|
|
10878
10901
|
const isChecked = element.getElementsByClassName(CHECKBOXFRAME)[0].classList.contains(CHECK);
|
|
10879
10902
|
const parentCheck = element.getElementsByClassName(CHECKBOXFRAME)[0].classList.contains(INDETERMINATE);
|
|
10880
|
-
const childCheck = childElement.querySelectorAll('li');
|
|
10881
10903
|
let checkedState;
|
|
10882
10904
|
for (let index = 0; index < checkBoxes.length; index++) {
|
|
10883
10905
|
const childId = childCheck[parseInt(index.toString(), 10)].getAttribute('data-uid');
|
|
@@ -10940,7 +10962,7 @@ let TreeView = TreeView_1 = class TreeView extends Component {
|
|
|
10940
10962
|
? nodes[parseInt(len.toString(), 10)].toString()
|
|
10941
10963
|
: null;
|
|
10942
10964
|
if (node !== '' && doCheck && node) {
|
|
10943
|
-
this.setValidCheckedNode(node);
|
|
10965
|
+
this.setValidCheckedNode(node, nodes);
|
|
10944
10966
|
this.dynamicCheckState(node, doCheck);
|
|
10945
10967
|
}
|
|
10946
10968
|
else if (this.checkedNodes.indexOf(node) !== -1 && node !== '' && !doCheck) {
|
|
@@ -12390,7 +12412,15 @@ let TreeView = TreeView_1 = class TreeView extends Component {
|
|
|
12390
12412
|
const parentIndex = li.getAttribute('data-uid');
|
|
12391
12413
|
const mapper = this.fields;
|
|
12392
12414
|
if (this.dataType === 1 && this.autoCheck) {
|
|
12393
|
-
|
|
12415
|
+
let resultData = new DataManager(this.treeData).executeLocal(new Query().where(mapper.parentID, 'equal', parentIndex, true));
|
|
12416
|
+
const childMatchesCheckedNodes = resultData.filter((item) => {
|
|
12417
|
+
return this.checkedNodes.indexOf(item[mapper.id].toString()) !== -1;
|
|
12418
|
+
}, this);
|
|
12419
|
+
if (this.checkedNodes.indexOf(parentIndex) !== -1 && childMatchesCheckedNodes.length !== resultData.length && this.isFilter) {
|
|
12420
|
+
if (childMatchesCheckedNodes.length > 0) {
|
|
12421
|
+
resultData = childMatchesCheckedNodes;
|
|
12422
|
+
}
|
|
12423
|
+
}
|
|
12394
12424
|
for (let i = 0; i < resultData.length; i++) {
|
|
12395
12425
|
const resultId = resultData[parseInt(i.toString(), 10)][this.fields.id]
|
|
12396
12426
|
? resultData[parseInt(i.toString(), 10)][this.fields.id].toString()
|
|
@@ -12453,8 +12483,15 @@ let TreeView = TreeView_1 = class TreeView extends Component {
|
|
|
12453
12483
|
}
|
|
12454
12484
|
}
|
|
12455
12485
|
else {
|
|
12456
|
-
|
|
12486
|
+
let childItems = this.getChildNodes(this.treeData, parentIndex);
|
|
12457
12487
|
if (childItems) {
|
|
12488
|
+
const filteredChildItems = childItems.filter((item) => {
|
|
12489
|
+
const itemValue = String(item[Object.keys(item)[0]]);
|
|
12490
|
+
return this.checkedNodes.indexOf(itemValue) !== -1;
|
|
12491
|
+
});
|
|
12492
|
+
if (filteredChildItems.length > 0 && childItems.length && this.isFilter) {
|
|
12493
|
+
childItems = filteredChildItems;
|
|
12494
|
+
}
|
|
12458
12495
|
this.childStateChange(childItems, parentIndex, childElement, doCheck);
|
|
12459
12496
|
}
|
|
12460
12497
|
}
|
|
@@ -12648,6 +12685,12 @@ let TreeView = TreeView_1 = class TreeView extends Component {
|
|
|
12648
12685
|
getFocusedNode() {
|
|
12649
12686
|
let selectedItem;
|
|
12650
12687
|
const fNode = select('.' + LISTITEM + '[tabindex="0"]', this.element);
|
|
12688
|
+
if (!isNullOrUndefined(fNode)) {
|
|
12689
|
+
const ariaChecked = fNode.getAttribute('aria-checked');
|
|
12690
|
+
if (ariaChecked === 'mixed' || ariaChecked === 'false') {
|
|
12691
|
+
this.isFilter = false;
|
|
12692
|
+
}
|
|
12693
|
+
}
|
|
12651
12694
|
if (isNullOrUndefined(fNode)) {
|
|
12652
12695
|
selectedItem = select('.' + LISTITEM, this.element);
|
|
12653
12696
|
}
|
|
@@ -13514,7 +13557,7 @@ let TreeView = TreeView_1 = class TreeView extends Component {
|
|
|
13514
13557
|
}
|
|
13515
13558
|
}
|
|
13516
13559
|
expandParent(dropLi) {
|
|
13517
|
-
const dropIcon = select('div.' +
|
|
13560
|
+
const dropIcon = select('div.' + EXPANDABLE + ', div.' + COLLAPSIBLE, dropLi);
|
|
13518
13561
|
if (dropIcon && dropIcon.classList.contains(EXPANDABLE) && this.preventExpand !== true) {
|
|
13519
13562
|
this.expandAction(dropLi, dropIcon, null);
|
|
13520
13563
|
}
|
|
@@ -14386,6 +14429,9 @@ let TreeView = TreeView_1 = class TreeView extends Component {
|
|
|
14386
14429
|
}
|
|
14387
14430
|
setCheckedNodes(nodes) {
|
|
14388
14431
|
nodes = JSON.parse(JSON.stringify(nodes));
|
|
14432
|
+
if (nodes.length > 1 && typeof this.nodeChecked === 'function' && this.nodeChecked.length > 0) {
|
|
14433
|
+
this.isFilter = true;
|
|
14434
|
+
}
|
|
14389
14435
|
this.uncheckAll(this.checkedNodes);
|
|
14390
14436
|
this.setIndeterminate(nodes);
|
|
14391
14437
|
if (nodes.length > 0) {
|
|
@@ -14396,15 +14442,16 @@ let TreeView = TreeView_1 = class TreeView extends Component {
|
|
|
14396
14442
|
* Checks whether the checkedNodes entered are valid and sets the valid checkedNodes while changing via setmodel
|
|
14397
14443
|
*
|
|
14398
14444
|
* @param {string} node - The unique identifier of the node.
|
|
14445
|
+
* @param {string[]} [nodes=[]] - The list of node IDs to check.
|
|
14399
14446
|
* @returns {void}
|
|
14400
14447
|
* @private
|
|
14401
14448
|
*/
|
|
14402
|
-
setValidCheckedNode(node) {
|
|
14449
|
+
setValidCheckedNode(node, nodes = []) {
|
|
14403
14450
|
if (this.dataType === 1) {
|
|
14404
14451
|
const mapper = this.fields;
|
|
14405
14452
|
const resultData = new DataManager(this.treeData).executeLocal(new Query().where(mapper.id, 'equal', node, true));
|
|
14406
14453
|
if (resultData[0]) {
|
|
14407
|
-
this.setChildCheckState(resultData, node, resultData[0]);
|
|
14454
|
+
this.setChildCheckState(resultData, node, resultData[0], nodes);
|
|
14408
14455
|
if (this.autoCheck) {
|
|
14409
14456
|
const parent = resultData[0][this.fields.parentID] ? resultData[0][this.fields.parentID].toString() : null;
|
|
14410
14457
|
const childNodes = this.getChildNodes(this.treeData, parent);
|
|
@@ -14430,7 +14477,7 @@ let TreeView = TreeView_1 = class TreeView extends Component {
|
|
|
14430
14477
|
}
|
|
14431
14478
|
const childItems = getValue(this.fields.child.toString(), this.treeData[parseInt(a.toString(), 10)]);
|
|
14432
14479
|
if (childItems) {
|
|
14433
|
-
this.setChildCheckState(childItems, node, this.treeData[parseInt(a.toString(), 10)]);
|
|
14480
|
+
this.setChildCheckState(childItems, node, this.treeData[parseInt(a.toString(), 10)], nodes);
|
|
14434
14481
|
}
|
|
14435
14482
|
}
|
|
14436
14483
|
}
|
|
@@ -14444,7 +14491,17 @@ let TreeView = TreeView_1 = class TreeView extends Component {
|
|
|
14444
14491
|
* @returns {void}
|
|
14445
14492
|
* @private
|
|
14446
14493
|
*/
|
|
14447
|
-
|
|
14494
|
+
/**
|
|
14495
|
+
* Checks whether the checkedNodes entered are valid and sets the valid checkedNodes while changing via setmodel(for hierarchical DS)
|
|
14496
|
+
*
|
|
14497
|
+
* @param {Object[]} childItems - The child items to check.
|
|
14498
|
+
* @param {string} node - The node to set the check state for.
|
|
14499
|
+
* @param {Object} [treeData] - The optional tree data.
|
|
14500
|
+
* @param {string[]} [nodes=[]] - The list of node IDs to check.
|
|
14501
|
+
* @returns {void}
|
|
14502
|
+
* @private
|
|
14503
|
+
*/
|
|
14504
|
+
setChildCheckState(childItems, node, treeData, nodes = []) {
|
|
14448
14505
|
let checkedParent;
|
|
14449
14506
|
let count = 0;
|
|
14450
14507
|
if (this.dataType === 1) {
|
|
@@ -14464,7 +14521,8 @@ let TreeView = TreeView_1 = class TreeView extends Component {
|
|
|
14464
14521
|
this.checkDisabledState(node);
|
|
14465
14522
|
}
|
|
14466
14523
|
const subChildItems = this.getChildNodes(this.treeData, checkNode);
|
|
14467
|
-
|
|
14524
|
+
const isParentNodeCheck = (nodes.length === 1 && nodes[0] === checkNode);
|
|
14525
|
+
if (subChildItems.length === node.length || isParentNodeCheck) {
|
|
14468
14526
|
this.setChildCheckState(subChildItems, node, treeData);
|
|
14469
14527
|
}
|
|
14470
14528
|
}
|
|
@@ -14475,8 +14533,10 @@ let TreeView = TreeView_1 = class TreeView extends Component {
|
|
|
14475
14533
|
}
|
|
14476
14534
|
for (let index = 0; index < childItems.length; index++) {
|
|
14477
14535
|
const checkedChild = childItems[parseInt(index.toString(), 10)][this.fields.id] ? childItems[parseInt(index.toString(), 10)][this.fields.id].toString() : '';
|
|
14536
|
+
const isParentNodeCheck = ([node].length === 1 && nodes.length === 0);
|
|
14478
14537
|
if (treeData && checkedParent && this.autoCheck) {
|
|
14479
|
-
if (this.checkedNodes.indexOf(checkedParent) !== -1 && this.checkedNodes.indexOf(checkedChild) === -1
|
|
14538
|
+
if (this.checkedNodes.indexOf(checkedParent) !== -1 && this.checkedNodes.indexOf(checkedChild) === -1
|
|
14539
|
+
&& (checkedChild === node || isParentNodeCheck)) {
|
|
14480
14540
|
this.checkDisabledState(checkedChild, childItems[index]);
|
|
14481
14541
|
}
|
|
14482
14542
|
}
|
|
@@ -14498,7 +14558,7 @@ let TreeView = TreeView_1 = class TreeView extends Component {
|
|
|
14498
14558
|
}
|
|
14499
14559
|
setIndeterminate(nodes) {
|
|
14500
14560
|
for (let i = 0; i < nodes.length; i++) {
|
|
14501
|
-
this.setValidCheckedNode(nodes[parseInt(i.toString(), 10)]);
|
|
14561
|
+
this.setValidCheckedNode(nodes[parseInt(i.toString(), 10)], nodes);
|
|
14502
14562
|
}
|
|
14503
14563
|
}
|
|
14504
14564
|
updatePosition(id, newData, isRefreshChild, childValue) {
|