-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(design): implement tree in left nav
- Loading branch information
1 parent
177474e
commit f62f228
Showing
7 changed files
with
304 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
|
||
&__sidebar { | ||
--daff-sidebar-side-fixed-top-shift: 64px; | ||
padding: 24px; | ||
} | ||
|
||
&__content { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<ul daff-tree [tree]="tree" *ngIf="tree$ | async as tree"> | ||
<ng-template #daffTreeItemWithChildrenTpl let-node> | ||
<button daffTreeItem [node]="node">{{ node.title }} </button> | ||
</ng-template> | ||
|
||
<ng-template #daffTreeItemTpl let-node> | ||
<a daffTreeItem [node]="node" [routerLink]="node.url">{{ node.title }}</a> | ||
</ng-template> | ||
</ul> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { HttpClient } from '@angular/common/http'; | ||
import { | ||
ChangeDetectionStrategy, | ||
Component, | ||
Input, | ||
OnInit, | ||
} from '@angular/core'; | ||
import { Observable } from 'rxjs'; | ||
|
||
import { DaffTreeData } from '@daffodil/design/tree'; | ||
|
||
@Component({ | ||
selector: 'design-land-nav', | ||
templateUrl: './nav.component.html', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class DesignLandNavComponent implements OnInit { | ||
tree$: Observable<DaffTreeData<unknown>>; | ||
|
||
constructor(private http: HttpClient){} | ||
|
||
ngOnInit() { | ||
this.tree$ = this.http.get<DaffTreeData<unknown>>('/assets/nav.json'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule } from '@angular/router'; | ||
|
||
import { DaffTreeModule } from '@daffodil/design/tree'; | ||
|
||
import { DesignLandNavComponent } from './nav.component'; | ||
|
||
@NgModule({ | ||
declarations: [ | ||
DesignLandNavComponent, | ||
], | ||
exports: [ | ||
DesignLandNavComponent, | ||
], | ||
imports: [ | ||
CommonModule, | ||
RouterModule, | ||
DaffTreeModule, | ||
], | ||
}) | ||
export class DesignLandNavModule { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,244 @@ | ||
{ | ||
"title": "", | ||
"url": "/", | ||
"id": "root", | ||
"items": [ | ||
{ | ||
"title": "Foundations", | ||
"url": "/", | ||
"id": "foundations", | ||
"items": [ | ||
{ | ||
"title": "Color", | ||
"url": "color", | ||
"id": "color", | ||
"items": [], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Typography", | ||
"url": "typography", | ||
"id": "typography", | ||
"items": [], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Variables", | ||
"url": "variables", | ||
"id": "variables", | ||
"items": [], | ||
"data": {} | ||
} | ||
], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Atoms", | ||
"url": "/", | ||
"id": "atoms", | ||
"items": [ | ||
{ | ||
"title": "Button", | ||
"url": "button", | ||
"id": "button", | ||
"items": [], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Checkbox", | ||
"url": "checkbox", | ||
"id": "checkbox", | ||
"items": [], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Loading Icon", | ||
"url": "loading-icon", | ||
"id": "loading-icon", | ||
"items": [], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Image", | ||
"url": "image", | ||
"id": "image", | ||
"items": [], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Form", | ||
"url": "/", | ||
"id": "form", | ||
"items": [ | ||
{ | ||
"title": "Input", | ||
"url": "input", | ||
"id": "input", | ||
"items": [], | ||
"data": {} | ||
} | ||
], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Progress Indicator", | ||
"url": "progress-indicator", | ||
"id": "progress-indicator", | ||
"items": [], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Radio", | ||
"url": "radio", | ||
"id": "radio", | ||
"items": [], | ||
"data": {} | ||
} | ||
], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Molecules", | ||
"url": "/", | ||
"id": "molecules", | ||
"items": [ | ||
{ | ||
"title": "Accordion", | ||
"url": "accordion", | ||
"id": "accordion", | ||
"items": [], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Article", | ||
"url": "article", | ||
"id": "article", | ||
"items": [], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Callout", | ||
"url": "callout", | ||
"id": "callout", | ||
"items": [], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Card", | ||
"url": "card", | ||
"id": "card", | ||
"items": [], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Container", | ||
"url": "container", | ||
"id": "container", | ||
"items": [], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Feature", | ||
"url": "feature", | ||
"id": "feature", | ||
"items": [], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Form", | ||
"url": "form", | ||
"id": "form", | ||
"items": [ | ||
{ | ||
"title": "Quantity Field", | ||
"url": "quantity-field", | ||
"id": "quantity-field", | ||
"items": [], | ||
"data": {} | ||
} | ||
], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Hero", | ||
"url": "hero", | ||
"id": "hero", | ||
"items": [], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Image Gallery", | ||
"url": "image-gallery", | ||
"id": "image-gallery", | ||
"items": [], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Link Set", | ||
"url": "link-set", | ||
"id": "link-set", | ||
"items": [], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "List", | ||
"url": "list", | ||
"id": "list", | ||
"items": [], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Navbar", | ||
"url": "navbar", | ||
"id": "navbar", | ||
"items": [], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Media Gallery", | ||
"url": "media-gallery", | ||
"id": "media-gallery", | ||
"items": [], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Menu", | ||
"url": "menu", | ||
"id": "menu", | ||
"items": [], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Modal", | ||
"url": "modal", | ||
"id": "modal", | ||
"items": [], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Paginator", | ||
"url": "paginator", | ||
"id": "paginator", | ||
"items": [], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Quantity Dropdown", | ||
"url": "qty-dropdown", | ||
"id": "qty-dropdown", | ||
"items": [], | ||
"data": {} | ||
}, | ||
{ | ||
"title": "Sidebar", | ||
"url": "sidebar", | ||
"id": "sidebar", | ||
"items": [], | ||
"data": {} | ||
} | ||
], | ||
"data": {} | ||
} | ||
], | ||
"data": {} | ||
} |