Skip to content

Commit

Permalink
Adjust formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamhency committed Jun 22, 2020
1 parent acdaccf commit e7fa0ae
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
19 changes: 11 additions & 8 deletions projects/go-lib/src/lib/components/go-tree/go-tree.component.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
<ng-template #nodeTemplate let-node="node" let-isChildNode="isChildNode">
<ng-template
#nodeTemplate
let-node="node"
let-isChildNode="isChildNode">
<div [ngClass]="{ 'go-tree-node-item__child-offset': isChildNode }">
<go-icon
class="go-tree-node-item__expander"
[icon]="node.expanded ? 'expand_more' : 'expand_less'"
(click)="node.expanded = !node.expanded"
*ngIf="node?.children"
></go-icon>
class="go-tree-node-item__expander"
[icon]="node.expanded ? 'expand_more' : 'expand_less'"
(click)="node.expanded = !node.expanded"
*ngIf="node?.children">
</go-icon>
{{ node.name }}
<div [@treeAnimation]="node.expanded ? 'open' : 'close'">
<ng-container *ngFor="let node of node?.children">
<ng-container *ngTemplateOutlet="nodeTemplate; context:{node: node, isChildNode: true}"></ng-container>
<ng-container *ngTemplateOutlet="nodeTemplate; context:{ node: node, isChildNode: true }"></ng-container>
</ng-container>
</div>
</div>
</ng-template>

<ng-container *ngFor="let node of nodeConfig">
<ng-container *ngTemplateOutlet="nodeTemplate; context:{node: node}"></ng-container>
<ng-container *ngTemplateOutlet="nodeTemplate; context:{ node: node }"></ng-container>
</ng-container>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<header class="go-page-title">
<h1 class="go-heading-1">{{ pageTitle }}</h1>
<h1 class="go-heading-1">Tree</h1>
</header>

<section class="go-container">
Expand Down Expand Up @@ -39,14 +39,14 @@ <h2 class="go-heading-2">Default</h2>
</header>
<div go-card-content>
<div class="go-container">
<div class="go-column go-column--50">
<h4 class="go-heading-4 go-heading--underlined">Code</h4>
<code [highlight]="exampleDefaultTreeDataHtml"></code>
</div>
<div class="go-column go-column--50">
<h4 class="go-heading-4 go-heading--underlined">View</h4>
<go-tree [nodeConfig]="exampleDefaultTreeData"></go-tree>
</div>
<div class="go-column go-column--50">
<h4 class="go-heading-4 go-heading--underlined">Code</h4>
<code [highlight]="exampleDefaultTreeDataHtml"></code>
</div>
</div>
</div>
</go-card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { GoTreeNodeConfig } from 'projects/go-lib/src/public_api';
templateUrl: './tree-docs.component.html'
})
export class TreeDocsComponent {
readonly pageTitle: string = 'Tree';

readonly componentBindings: string = `
@Input() nodeConfig: GoTreeNodeConfig[];
Expand Down

0 comments on commit e7fa0ae

Please sign in to comment.