mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-01-10 04:25:08 +00:00
Keys pipe, some workin on the mail app..
This commit is contained in:
parent
ac870a9613
commit
4563931090
|
@ -19,7 +19,7 @@ import { UIPageLayoutsModule } from './main/ui/page-layouts/page-layouts.module'
|
||||||
import { FuseLayoutModule } from './core/components/layout/layout.module';
|
import { FuseLayoutModule } from './core/components/layout/layout.module';
|
||||||
import { PerfectScrollbarConfigInterface, PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
|
import { PerfectScrollbarConfigInterface, PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
|
||||||
import { AngularFireModule } from 'angularfire2';
|
import { AngularFireModule } from 'angularfire2';
|
||||||
import { environment } from "environments/environment";
|
import { environment } from 'environments/environment';
|
||||||
import { AngularFireDatabaseModule } from 'angularfire2/database';
|
import { AngularFireDatabaseModule } from 'angularfire2/database';
|
||||||
import { MailListComponent } from './main/apps/mail/mail-list/mail-list.component';
|
import { MailListComponent } from './main/apps/mail/mail-list/mail-list.component';
|
||||||
import { MailDetailsComponent } from './main/apps/mail/mail-details/mail-details.component';
|
import { MailDetailsComponent } from './main/apps/mail/mail-details/mail-details.component';
|
||||||
|
|
|
@ -8,11 +8,13 @@ import {
|
||||||
FuseMdSidenavTogglerDirective
|
FuseMdSidenavTogglerDirective
|
||||||
} from '../directives/md-sidenav-helper/md-sidenav-helper.directive';
|
} from '../directives/md-sidenav-helper/md-sidenav-helper.directive';
|
||||||
import {PerfectScrollbarModule} from 'ngx-perfect-scrollbar';
|
import {PerfectScrollbarModule} from 'ngx-perfect-scrollbar';
|
||||||
|
import {KeysPipe} from '../pipes/keys';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
FuseMdSidenavHelperDirective,
|
FuseMdSidenavHelperDirective,
|
||||||
FuseMdSidenavTogglerDirective
|
FuseMdSidenavTogglerDirective,
|
||||||
|
KeysPipe
|
||||||
],
|
],
|
||||||
imports : [
|
imports : [
|
||||||
FlexLayoutModule,
|
FlexLayoutModule,
|
||||||
|
@ -28,7 +30,8 @@ import {PerfectScrollbarModule} from 'ngx-perfect-scrollbar';
|
||||||
FormsModule,
|
FormsModule,
|
||||||
FuseMdSidenavHelperDirective,
|
FuseMdSidenavHelperDirective,
|
||||||
FuseMdSidenavTogglerDirective,
|
FuseMdSidenavTogglerDirective,
|
||||||
PerfectScrollbarModule
|
PerfectScrollbarModule,
|
||||||
|
KeysPipe
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
15
src/app/core/pipes/keys.ts
Normal file
15
src/app/core/pipes/keys.ts
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
import {Pipe, PipeTransform} from '@angular/core';
|
||||||
|
|
||||||
|
@Pipe({name: 'keys'})
|
||||||
|
export class KeysPipe implements PipeTransform
|
||||||
|
{
|
||||||
|
transform(value: any, args: string[]): any
|
||||||
|
{
|
||||||
|
let keys: any[] = [];
|
||||||
|
for ( let key in value )
|
||||||
|
{
|
||||||
|
keys.push({key: key, value: value[key]});
|
||||||
|
}
|
||||||
|
return keys;
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,21 +9,7 @@
|
||||||
<!-- SIDENAV -->
|
<!-- SIDENAV -->
|
||||||
<md-sidenav class="sidenav mat-sidenav-opened" align="start" opened="true" mode="side"
|
<md-sidenav class="sidenav mat-sidenav-opened" align="start" opened="true" mode="side"
|
||||||
fuseMdSidenavHelper="carded-left-sidenav" md-is-locked-open="gt-md">
|
fuseMdSidenavHelper="carded-left-sidenav" md-is-locked-open="gt-md">
|
||||||
|
<fuse-mail-main-sidenav></fuse-mail-main-sidenav>
|
||||||
<!-- SIDENAV HEADER -->
|
|
||||||
<div class="header">
|
|
||||||
<span>Sidenav header</span>
|
|
||||||
</div>
|
|
||||||
<!-- / SIDENAV HEADER -->
|
|
||||||
|
|
||||||
<!-- SIDENAV CONTENT -->
|
|
||||||
<div class="content" perfect-scrollbar>
|
|
||||||
|
|
||||||
Sidenav
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<!-- / SIDENAV CONTENT -->
|
|
||||||
|
|
||||||
</md-sidenav>
|
</md-sidenav>
|
||||||
<!-- / SIDENAV -->
|
<!-- / SIDENAV -->
|
||||||
|
|
||||||
|
@ -31,8 +17,22 @@
|
||||||
<div class="center">
|
<div class="center">
|
||||||
|
|
||||||
<!-- CONTENT HEADER -->
|
<!-- CONTENT HEADER -->
|
||||||
<div class="header">
|
<div class="header" fxLayout="row" fxLayoutAlign="start center">
|
||||||
<h2>Left sidenav with content scroll</h2>
|
|
||||||
|
<div class="search-wrapper" fxFlex fxLayout="row" fxLayoutAlign="start center">
|
||||||
|
|
||||||
|
<button md-button class="mat-icon-button sidenav-toggle"
|
||||||
|
fuseMdSidenavToggler="carded-left-sidenav"
|
||||||
|
fxHide.gt-md aria-label="Toggle Sidenav">
|
||||||
|
<md-icon>menu</md-icon>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div class="search" flex fxLayout="row" fxLayoutAlign="start center">
|
||||||
|
<md-icon>search</md-icon>
|
||||||
|
<input fxFlex type="text" placeholder="Search for an e-mail or contact">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- / CONTENT HEADER -->
|
<!-- / CONTENT HEADER -->
|
||||||
|
|
||||||
|
@ -41,11 +41,6 @@
|
||||||
|
|
||||||
<!-- CONTENT TOOLBAR -->
|
<!-- CONTENT TOOLBAR -->
|
||||||
<div class="toolbar">
|
<div class="toolbar">
|
||||||
<button md-button class="mat-icon-button sidenav-toggle"
|
|
||||||
fuseMdSidenavToggler="carded-left-sidenav"
|
|
||||||
fxHide.gt-md>
|
|
||||||
<md-icon>menu</md-icon>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<span>Content toolbar</span>
|
<span>Content toolbar</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -69,4 +64,4 @@
|
||||||
|
|
||||||
</md-sidenav-container>
|
</md-sidenav-container>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,43 @@
|
||||||
|
@import "src/app/core/scss/fuse";
|
||||||
|
|
||||||
:host, #mail {
|
:host, #mail {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
|
.center {
|
||||||
|
|
||||||
|
.header {
|
||||||
|
padding: 0 !important;
|
||||||
|
|
||||||
|
.search-wrapper {
|
||||||
|
@include mat-elevation(7);
|
||||||
|
|
||||||
|
.sidenav-toggle {
|
||||||
|
margin: 0;
|
||||||
|
width: 56px;
|
||||||
|
height: 56px;
|
||||||
|
background: #FFF;
|
||||||
|
border-radius: 0;
|
||||||
|
border-right: 1px solid rgba(0, 0, 0, .12);
|
||||||
|
}
|
||||||
|
|
||||||
|
.search {
|
||||||
|
width: 100%;
|
||||||
|
height: 56px;
|
||||||
|
line-height: 56px;
|
||||||
|
padding: 18px;
|
||||||
|
background: #FFFFFF;
|
||||||
|
|
||||||
|
input {
|
||||||
|
height: 56px;
|
||||||
|
padding-left: 16px;
|
||||||
|
color: rgba(0, 0, 0, 0.54);
|
||||||
|
border: none;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,38 @@
|
||||||
|
<!-- SIDENAV HEADER -->
|
||||||
|
<div class="header" fxLayout="column" fxLayoutAlign="space-between start">
|
||||||
|
<div class="logo" fxFlex fxLayout="row" fxLayoutAlign="start center">
|
||||||
|
<md-icon class="logo-icon">mail</md-icon>
|
||||||
|
<span class="logo-text">Mailbox</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="account" fxLayout="column">
|
||||||
|
<div class="title">John Doe</div>
|
||||||
|
<md-select class="account-selection" placeholder="Mail Selection"
|
||||||
|
floatPlaceholder="never"
|
||||||
|
[ngModel]="selectedAccount">
|
||||||
|
<md-option *ngFor="let account of (accounts | keys)" [value]="account.key">
|
||||||
|
{{account.value}}
|
||||||
|
</md-option>
|
||||||
|
</md-select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- / SIDENAV HEADER -->
|
||||||
|
|
||||||
|
<!-- SIDENAV CONTENT -->
|
||||||
|
<div class="content" perfect-scrollbar>
|
||||||
|
|
||||||
|
Sidenav
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- / SIDENAV CONTENT -->
|
||||||
|
|
||||||
|
<!-- SIDENAV HEADER -->
|
||||||
|
<div class="header" layout="column" layout-align="space-between start">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- / SIDENAV HEADER -->
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
main sidenav
|
main sidenav
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
:host {
|
||||||
|
.header {
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
|
||||||
|
.logo-icon {
|
||||||
|
margin: 0 16px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo-text {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.account {
|
||||||
|
width: 100%;
|
||||||
|
.account-selection {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,8 +7,17 @@ import {Component, OnInit} from '@angular/core';
|
||||||
})
|
})
|
||||||
export class MainSidenavComponent implements OnInit
|
export class MainSidenavComponent implements OnInit
|
||||||
{
|
{
|
||||||
|
accounts: object;
|
||||||
|
selectedAccount: string;
|
||||||
|
|
||||||
constructor()
|
constructor()
|
||||||
{
|
{
|
||||||
|
// Data
|
||||||
|
this.accounts = {
|
||||||
|
'creapond' : 'johndoe@creapond.com',
|
||||||
|
'withinpixels': 'johndoe@withinpixels.com'
|
||||||
|
};
|
||||||
|
this.selectedAccount = 'creapond';
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit()
|
ngOnInit()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user