-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Derek Burgman
committed
Feb 1, 2022
1 parent
2adf092
commit 867ab31
Showing
32 changed files
with
564 additions
and
94 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 |
---|---|---|
@@ -1,9 +1,12 @@ | ||
@use './anchor/anchor'; | ||
@use './layout/anchor/anchor'; | ||
@use './layout/sidenav/sidenav'; | ||
|
||
@mixin all-router-typography($typography-config) { | ||
@include anchor.typography($typography-config); | ||
@include sidenav.typography($typography-config); | ||
} | ||
|
||
@mixin all-router-theme($theme-config) { | ||
@include anchor.theme($theme-config); | ||
@include sidenav.theme($theme-config); | ||
} |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export * from './anchor'; | ||
export * from './layout'; | ||
export * from './provider'; |
2 changes: 1 addition & 1 deletion
2
...bx-web/src/lib/router/anchor/_anchor.scss → ...src/lib/router/layout/anchor/_anchor.scss
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@use '../../style/theming'; | ||
@use '../../../style/theming'; | ||
|
||
@mixin typography($typography-config) { | ||
|
||
|
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ib/router/anchor/anchor.component.spec.ts → ...er/layout/anchor/anchor.component.spec.ts
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,2 @@ | ||
export * from './anchor'; | ||
export * from './sidenav'; |
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,9 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { DbxAnchorModule } from './anchor/anchor.module'; | ||
|
||
@NgModule({ | ||
exports: [ | ||
DbxAnchorModule | ||
] | ||
}) | ||
export class DbxRouterLayoutModule { } |
116 changes: 116 additions & 0 deletions
116
packages/dbx-web/src/lib/router/layout/sidenav/_sidenav.scss
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,116 @@ | ||
@use '../../../style/theming'; | ||
|
||
$side-nav-width: 220px; | ||
$side-nav-mobile-width: 80vw; | ||
$side-nav-icon-only-width: 64px; | ||
|
||
@mixin typography($typography-config) {} | ||
|
||
@mixin theme($theme-config) { | ||
@include theming.private-check-duplicate-theme-styles($theme-config, 'dbx-router-sidenav') { | ||
|
||
.dbx-sidenav { | ||
height: var(--vh100); | ||
|
||
mat-sidenav { | ||
width: $side-nav-width; | ||
} | ||
} | ||
|
||
/* | ||
.side-nav { | ||
// overflow hidden set on style.scss | ||
&.side-nav-mobile { | ||
mat-sidenav { | ||
width: $side-nav-mobile-width; | ||
} | ||
} | ||
&.side-nav-icon { | ||
mat-sidenav { | ||
width: $side-nav-icon-only-width; | ||
} | ||
mat-sidenav-content { | ||
margin-left: $side-nav-icon-only-width; | ||
} | ||
} | ||
&.side-nav-full { | ||
mat-sidenav { | ||
width: $side-nav-width; | ||
} | ||
mat-sidenav-content { | ||
margin-left: $side-nav-width; | ||
} | ||
} | ||
.side-nav-top-bar { | ||
.mat-toolbar { | ||
height: $side-nav-top-bar-top-navbar-height; | ||
} | ||
} | ||
} | ||
$active-border-left-width: 4px; | ||
.mat-list-base { | ||
padding-top: 0; | ||
} | ||
.mat-list-item { | ||
.mat-icon { | ||
padding-right: 18px; | ||
} | ||
} | ||
.active { | ||
&.mat-list-item { | ||
background-color: rgba(0, 0, 0, 0.1); | ||
border-left: $active-border-left-width solid $sidenav-active-color; | ||
} | ||
mat-icon { | ||
color: $sidenav-active-color; | ||
// Offset the added border by clearing the default padding width (4px) | ||
padding-left: 4px - $active-border-left-width; | ||
} | ||
} | ||
$app-side-nav-bar-padding: 14px; | ||
.app-side-nav-bar-title { | ||
// text-align: center; | ||
padding: $app-side-nav-bar-padding; | ||
.app-side-nav-bar-title-header { | ||
display: flex; | ||
>img { | ||
width: 32px; | ||
height: 32px; | ||
padding-left: 2px; | ||
padding-right: 16px; | ||
} | ||
span { | ||
@include mat-typography-level-to-styles($config, title); | ||
font-weight: 300; | ||
} | ||
} | ||
} | ||
.app-side-nav-bar-title-content { | ||
padding-top: $app-side-nav-bar-padding; | ||
} | ||
*/ | ||
|
||
} | ||
} |
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,5 @@ | ||
export * from './sidenav.component'; | ||
export * from './sidenav.module'; | ||
// export * from './side.item.component'; | ||
// export * from './side.title.component'; | ||
// export * from './side.title.content.component'; |
18 changes: 18 additions & 0 deletions
18
packages/dbx-web/src/lib/router/layout/sidenav/side.item.component.html
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,18 @@ | ||
<!-- Template is projected into other outlets. --> | ||
<ng-template #content> | ||
<mat-icon mat-list-icon>{{ anchor.icon }}</mat-icon> | ||
<div mat-line>{{ anchor.title }}</div> | ||
<mat-divider [inset]="true" *ngIf="!last"></mat-divider> | ||
</ng-template> | ||
<ng-container [ngSwitch]="type"> | ||
<!-- Click --> | ||
<a mat-list-item class="app-anchor app-anchor-click" [ngClass]="anchorClass" (click)="anchor.onClick($event)" | ||
*ngSwitchCase="1"> | ||
<ng-container *ngTemplateOutlet="content"></ng-container> | ||
</a> | ||
<!-- Sref --> | ||
<a mat-list-item class="app-anchor app-anchor-sref" [ngClass]="anchorClass" [uiSref]="anchor.ref" | ||
[uiParams]="anchor.refParams" uiSrefActive="active" [uiOptions]="anchor.refOptions" *ngSwitchCase="2"> | ||
<ng-container *ngTemplateOutlet="content"></ng-container> | ||
</a> | ||
</ng-container> |
15 changes: 15 additions & 0 deletions
15
packages/dbx-web/src/lib/router/layout/sidenav/side.item.component.ts
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,15 @@ | ||
import { Component, Input, ViewChild } from '@angular/core'; | ||
import { AbstractAnchorDirective } from '../anchor/anchor.directive'; | ||
import { ClickableAnchorLink } from '@/app/common/nav/anchor/anchor'; | ||
|
||
@Component({ | ||
selector: 'app-side-nav-bar-item', | ||
templateUrl: './side.item.component.html', | ||
styleUrls: ['./side.scss'] | ||
}) | ||
export class AppSideNavBarItemComponent extends AbstractAnchorDirective<ClickableAnchorLink> { | ||
|
||
@Input() | ||
last: boolean; | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
packages/dbx-web/src/lib/router/layout/sidenav/side.title.component.ts
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 { Component } from '@angular/core'; | ||
import { Input } from '@angular/core'; | ||
|
||
/** | ||
* Pre-styled top/title component. | ||
*/ | ||
@Component({ | ||
selector: 'app-side-nav-bar-title', | ||
template: ` | ||
<div class="app-side-nav-bar-title"> | ||
<div class="app-side-nav-bar-title-header"> | ||
<img src="assets/brand/icon.png"/> | ||
<span>{{ header }}</span> | ||
</div> | ||
<ng-content></ng-content> | ||
</div> | ||
`, | ||
styleUrls: ['./side.scss'] | ||
}) | ||
export class AppSideNavBarTitleComponent { | ||
|
||
@Input() | ||
header: string; | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
packages/dbx-web/src/lib/router/layout/sidenav/side.title.content.component.ts
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,12 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-side-nav-bar-title-content', | ||
template: ` | ||
<div class="app-side-nav-bar-title-content"> | ||
<ng-content></ng-content> | ||
</div> | ||
`, | ||
styleUrls: ['./side.scss'] | ||
}) | ||
export class AppSideNavBarTitleContentComponent { } |
19 changes: 19 additions & 0 deletions
19
packages/dbx-web/src/lib/router/layout/sidenav/sidenav.component.html
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,19 @@ | ||
<mat-sidenav-container class="dbx-sidenav"> | ||
<mat-sidenav [mode]="(drawer$ | async)!"> | ||
<ng-content select="[top]"></ng-content> | ||
<p>Side navigation</p> | ||
<mat-nav-list> | ||
<ng-container *ngFor="let anchor of anchors"> | ||
<dbx-anchor mat-list-item> | ||
<mat-icon mat-list-icon>{{ anchor.icon }}</mat-icon> | ||
<div mat-line>{{ anchor.title }}</div> | ||
</dbx-anchor> | ||
<!-- <mat-divider *ngIf="!last"></mat-divider> --> | ||
</ng-container> | ||
</mat-nav-list> | ||
<ng-content select="[bottom]"></ng-content> | ||
</mat-sidenav> | ||
<mat-sidenav-content> | ||
<ng-content></ng-content> | ||
</mat-sidenav-content> | ||
</mat-sidenav-container> |
Oops, something went wrong.