Skip to content

Commit

Permalink
fix: #7599, Tree: Incorrect props and types in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ANTONA09 committed Jan 14, 2025
1 parent 595fb24 commit 0047a7d
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion components/doc/common/apidoc/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -53645,7 +53645,7 @@
"description": "Whether the node is selectable when selection mode is enabled."
},
{
"name": "leaf",
"name": "isLeaf",
"optional": true,
"readonly": false,
"type": "boolean",
Expand Down
18 changes: 9 additions & 9 deletions components/doc/tree/lazydoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ export function LazyDoc(props) {
{
key: '0',
label: 'Node 0',
leaf: false
isLeaf: false
},
{
key: '1',
label: 'Node 1',
leaf: false
isLeaf: false
},
{
key: '2',
label: 'Node 2',
leaf: false
isLeaf: false
}
];
};
Expand Down Expand Up @@ -76,17 +76,17 @@ export default function LazyDemo() {
{
key: '0',
label: 'Node 0',
leaf: false
isLeaf: false
},
{
key: '1',
label: 'Node 1',
leaf: false
isLeaf: false
},
{
key: '2',
label: 'Node 2',
leaf: false
isLeaf: false
}
];
}
Expand Down Expand Up @@ -144,17 +144,17 @@ export default function LazyDemo() {
{
key: '0',
label: 'Node 0',
leaf: false
isLeaf: false
},
{
key: '1',
label: 'Node 1',
leaf: false
isLeaf: false
},
{
key: '2',
label: 'Node 2',
leaf: false
isLeaf: false
}
];
}
Expand Down
2 changes: 1 addition & 1 deletion components/doc/tree/theming/tailwinddoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const Tailwind = {
'text-blue-600 hover:bg-white/30': context.selected
},
{
hidden: context.leaf
hidden: context.isLeaf
}
)
}),
Expand Down
6 changes: 3 additions & 3 deletions components/doc/treetable/lazyloaddoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function LazyLoadDoc(props) {
size: Math.floor(Math.random() * 1000) + 1 + 'kb',
type: 'Type ' + (first + i)
},
leaf: false
isLeaf: false
};

nodes.push(node);
Expand Down Expand Up @@ -130,7 +130,7 @@ export default function LazyLoadDemo() {
size: Math.floor(Math.random() * 1000) + 1 + 'kb',
type: 'Type ' + (first + i)
},
leaf: false
isLeaf: false
};
nodes.push(node);
Expand Down Expand Up @@ -234,7 +234,7 @@ export default function LazyLoadDemo() {
size: Math.floor(Math.random() * 1000) + 1 + 'kb',
type: 'Type ' + (first + i)
},
leaf: false
isLeaf: false
};
nodes.push(node);
Expand Down
2 changes: 1 addition & 1 deletion components/lib/tree/Tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ export const Tree = React.memo(
};

const isNodeLeaf = (node) => {
return node.leaf === false ? false : !(node.children && node.children.length);
return node.isLeaf === false ? false : !(node.children && node.children.length);
};

const onFilterInputKeyDown = (event) => {
Expand Down
2 changes: 1 addition & 1 deletion components/lib/treenode/treenode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export interface TreeNode {
/**
* Specifies if the node has children. Used in lazy loading.
*/
leaf?: boolean | undefined;
isLeaf?: boolean | undefined;
/**
* Visibility of node.
*/
Expand Down
2 changes: 1 addition & 1 deletion components/lib/treetable/TreeTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ export const TreeTable = React.forwardRef((inProps, ref) => {
};

const isNodeLeaf = (node) => {
return node.leaf === false ? false : !(node.children && node.children.length);
return node.isLeaf === false ? false : !(node.children && node.children.length);
};

const processedData = (localState) => {
Expand Down

0 comments on commit 0047a7d

Please sign in to comment.