Skip to content

Commit

Permalink
working on nesting in tree view
Browse files Browse the repository at this point in the history
  • Loading branch information
chinonso098 committed Sep 23, 2024
1 parent a39c904 commit 595cb07
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,22 @@
display: block;
}


.root-caret-active{
position: 'relative';
transform: rotate(0deg);
}

.caret-active {
position: 'relative';
transform: rotate(90deg);
}

.root-caret-nested{
position: 'relative';
transform: rotate(270deg);
}

.caret-nested {
position: 'relative';
transform: rotate(0);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<!--down-chevron<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 512 512"><path d="M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"/></svg>
<!--down-chevron<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" viewBox="0 0 512 512">
<path d="M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"/>
</svg>
right-chevron<svg xmlns="http://www.w3.org/2000/svg" height="16" width="10" viewBox="0 0 320 512">
<path d="M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"/>
</svg> -->
Expand All @@ -14,7 +16,7 @@
<svg xmlns="http://www.w3.org/2000/svg" (click)="showChildren('qa-fileExplrTreeView')" (mouseenter)="colorChevron(negTen,negTen)" (mouseleave)="unColorChevron(negTen,negTen)" [style]="chevronBtnStyle"
height="10" width="10"
viewBox="0 0 512 512" id="qa-fileExplrTreeView-img-{{pid}}">
<path d="M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"/>
<path d="M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"/>
</svg>
</div>
</figure>
Expand All @@ -23,7 +25,7 @@
<div class="fxtreeview-tail"><p class="fxtreeview-nested-p"> {{quickAccess}}</p></div>
</div>

<ul class="ul-file-tree-view nested" id="qa-ul-{{pid}}">
<ul class="ul-file-tree-view" id="qa-ul-{{pid}}">
<ng-container *ngFor="let node of quickAccessData; let i = index">
<li class="li-file-tree-view" id="qa-li-{{pid}}-{{i}}">
<div class="tree-view-cntnr" *ngIf="node.isFolder" id="qa-fileExplrTreeView-{{pid}}-{{i}}" (click)="navigateToSelectedPath(node.name, node.path)"
Expand All @@ -38,8 +40,7 @@
node.name === 'Games' && node.path === '/Users/Games' ? 'osdrive/Cheetah/System/Imageres/games_folder_small.png' :
node.name === 'Music' && node.path === '/Users/Music' ? 'osdrive/Cheetah/System/Imageres/music_folder_small.png' :
node.name === 'Pictures' && node.path === '/Users/Pictures'? 'osdrive/Cheetah/System/Imageres/pictures_folder_small.png':
node.name === 'Videos' && node.path === '/Users/Videos' ? 'osdrive/Cheetah/System/Imageres/videos_folder_small.png':
node.name === 'OSDisk (C:)' && node.path === '/' ? 'osdrive/Cheetah/System/Imageres/os_disk.png': 'osdrive/Cheetah/System/Imageres/folder_folder_small.png'"/></figure></div>
node.name === 'Videos' && node.path === '/Users/Videos' ? 'osdrive/Cheetah/System/Imageres/videos_folder_small.png': 'osdrive/Cheetah/System/Imageres/folder_folder_small.png'"/></figure></div>
<div class="fxtreeview-tail"><p class="fxtreeview-nested-p">{{node.name}}</p></div>
</div>
</li>
Expand All @@ -53,8 +54,6 @@





<ul class="ul-file-tree-view" id="tp-fileExplrTreeView">
<li class="li-file-tree-view0" id="li-{{pid}}-{{level}}">
<ng-container *ngIf="showRoot">
Expand All @@ -66,27 +65,29 @@
<svg xmlns="http://www.w3.org/2000/svg" (click)="showChildren('tp-fileExplrTreeView')" (mouseenter)="colorChevron()" (mouseleave)="unColorChevron()" [style]="chevronBtnStyle"
height="10" width="10"
viewBox="0 0 512 512" id="tp-fileExplrTreeView-img-{{pid}}-{{level}}">
<path d="M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"/>
<path d="M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"/>
</svg>
</div>
</figure>
</div>
<div class="span fxtreeview-mid"><figure class="fxtreeview-figure1"><img class="fxtreeview-img1" [src]="'osdrive/Cheetah/System/Imageres/this_pc.png'"/></figure></div>
<div class="span fxtreeview-tail"><p class="fxtreeview-nested-p"> This PC</p></div>
<div class="span fxtreeview-tail"><p class="fxtreeview-nested-p">{{thisPC}}</p></div>
</div>
</ng-container>

<ul class="ul-file-tree-view nested" id="ul-{{pid}}-{{level}}">
<ul class="ul-file-tree-view" id="ul-{{pid}}-{{level}}">
<ng-container *ngFor="let node of treeData; let i = index">
<li class="li-file-tree-view" id="li-{{pid}}-{{level}}-{{i}}">
<div class="tree-view-cntnr" *ngIf="node.isFolder" id="tp-fileExplrTreeView-{{pid}}-{{level}}-{{i}}" (click)="navigateToSelectedPath(node.name, node.path)"
<!--here is the id-->
<div class="tree-view-cntnr" *ngIf="node.isFolder" id="tp-fileExplrTreeView-{{pid}}-{{level}}-{{i}}"
(click)="navigateToSelectedPath(node.name, node.path)"
(click)="onBtnClick('tp-fileExplrTreeView-'+pid+'-'+level+'-'+i)" (mouseenter)="onMouseEnter('tp-fileExplrTreeView-'+pid+'-'+level+'-'+i)" (mouseleave)="onMouseLeave('tp-fileExplrTreeView-'+pid+'-'+level+'-'+i)">
<div class="span fxtreeview-head">
<figure class="fxtreeview-figure">
<div class="fxtreeview-img" >
<svg xmlns="http://www.w3.org/2000/svg" (click)="showGrandChildren(node.path, i)" (mouseenter)="colorChevron(i)" (mouseleave)="unColorChevron(i)" [style]="chevronBtnStyle"
height="10" width="10"
viewBox="0 0 512 512" id="tp-fileExplrTreeView-img-{{pid}}-{{level}}-{{i}}">
viewBox="0 0 512 512" id="tp-fileExplrTreeView-img-{{pid}}-{{level}}-{{i}}"> <!--here is the id-->
<path d="M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"/>
</svg>
</div>
Expand All @@ -105,17 +106,20 @@
</div>

<ng-container *ngIf="node.children && node.children.length">
<ul class="ul-file-tree-view nested">
<ul class="ul-file-tree-view" id="ul-{{pid}}-{{level}}-{{i}}">

<ng-container *ngFor="let child of node.children; let j = index">
<li class="li-file-tree-view" id="li-{{pid}}-{{level}}-{{i}}-{{j}}">
<div class="tree-view-cntnr" *ngIf="child.isFolder" id="tp-fileExplrTreeView-{{pid}}-{{level}}-{{i}}-{{j}}" (click)="navigateToSelectedPath(child.name, child.path)"
<!--here is the id1-->
<div class="tree-view-cntnr" *ngIf="child.isFolder" id="tp-fileExplrTreeView-{{pid}}-{{level}}-{{i}}-{{j}}"
(click)="navigateToSelectedPath(child.name, child.path)"
(click)="onBtnClick('tp-fileExplrTreeView-'+pid+'-'+level+'-'+i+'-'+j)" (mouseenter)="onMouseEnter('tp-fileExplrTreeView-'+pid+'-'+level+'-'+i+'-'+j)" (mouseleave)="onMouseLeave('tp-fileExplrTreeView-'+pid+'-'+level+'-'+i+'-'+j)">
<div class="span fxtreeview-head">
<figure class="fxtreeview-figure">
<div class="fxtreeview-img" >
<svg xmlns="http://www.w3.org/2000/svg" (click)="showGreatGrandChildren(child.path, i, j)" (mouseenter)="colorChevron(i,j)" (mouseleave)="unColorChevron(i,j)" [style]="chevronBtnStyle"
height="10" width="10"
viewBox="0 0 512 512" id="tp-fileExplrTreeView-img-{{pid}}-{{level}}-{{i}}-{{j}}">
viewBox="0 0 512 512" id="tp-fileExplrTreeView-img-{{pid}}-{{level}}-{{i}}-{{j}}"> <!--here is the id1-->
<path d="M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"/>
</svg>
</div>
Expand Down
Loading

0 comments on commit 595cb07

Please sign in to comment.