Skip to content

Commit

Permalink
fix: fix tree hierarchical relationship (#484)
Browse files Browse the repository at this point in the history
Co-authored-by: JounQin <admin@1stg.me>
  • Loading branch information
yinshuxun and JounQin authored Jul 18, 2023
1 parent 3973cd4 commit bda1860
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/slow-brooms-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@alauda/ui": patch
---

fix: fix tree hierarchical relationship
3 changes: 2 additions & 1 deletion src/tree-select/tree-node.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
[icon]="'spinner'"
></aui-icon>
<aui-icon
*ngIf="nodeData.children && !nodeData.loading"
*ngIf="!nodeData.loading"
class="aui-tree-node__indicator"
[class.isVisible]="nodeData.children"
margin="left"
size="16"
[icon]="nodeData.expanded ? 'angle_down' : 'angle_right'"
Expand Down
4 changes: 4 additions & 0 deletions src/tree-select/tree-node.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
}

&__indicator {
&:not(.isVisible) {
visibility: hidden;
}

&:hover {
color: use-rgb(primary);
}
Expand Down
20 changes: 19 additions & 1 deletion stories/tree-select/tree-select.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,34 @@ export default class TreeSelectComponent {
icon: 'folder',
expandedIcon: 'folder_open',
children: [
{
label: 'c-0',
value: 'c-0',
icon: 'folder',
children: [
{
label: 'c-0-1',
value: 'c-0-1',
icon: 'file',
},
{
label: 'c-0-2',
value: 'c-0-2',
icon: 'file',
},
],
},
{
label: 'c-1',
value: 'c-1',
icon: 'file',
icon: 'folder',
},
{
label: 'c-2',
value: 'c-2',
icon: 'file',
},

],
},
{
Expand Down

0 comments on commit bda1860

Please sign in to comment.