Skip to content

Commit

Permalink
feat(MdDrawer): create all kinds of drawers
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosmoura committed Jul 10, 2017
1 parent fb1c253 commit 53a9d98
Show file tree
Hide file tree
Showing 9 changed files with 504 additions and 62 deletions.
24 changes: 21 additions & 3 deletions docs/app/pages/Components/Drawer/Drawer.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<example src="./examples/Sidenav.vue" />
<example src="./examples/Temporary.vue" />
<example src="./examples/PermanentFull.vue" />
<example src="./examples/PermanentClipped.vue" />
<example src="./examples/PermanentCard.vue" />
<example src="./examples/Persistent.vue" />

<template>
<page-container centered :title="$t('pages.drawer.title')">
Expand All @@ -7,9 +11,23 @@
</div>

<div class="page-container-section">
<h2>Navigation Drawer</h2>
<h2>Permanent</h2>

<code-example title="Side Nav" :component="examples['sidenav']" />
<code-example title="Full Height" :component="examples['permanent-full']" />
<code-example title="Clipped" :component="examples['permanent-clipped']" />
<code-example title="Card" :component="examples['permanent-card']" />
</div>

<div class="page-container-section">
<h2>Persistent</h2>

<code-example title="Push page content" :component="examples['persistent']" />
</div>

<div class="page-container-section">
<h2>Temporary</h2>

<code-example title="Side Nav" :component="examples['temporary']" />
</div>
</page-container>
</template>
Expand Down
57 changes: 57 additions & 0 deletions docs/app/pages/Components/Drawer/examples/PermanentCard.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<template>
<div class="page-container">
<md-toolbar class="md-primary">
<span class="md-title">My Title</span>
</md-toolbar>

<main class="page-wrapper md-layout-row">
<md-drawer md-permanent="card">
<md-list>
<md-list-item>
<md-icon>move_to_inbox</md-icon>
<span class="md-list-item-text">Inbox</span>
</md-list-item>

<md-list-item>
<md-icon>send</md-icon>
<span class="md-list-item-text">Sent Mail</span>
</md-list-item>

<md-list-item>
<md-icon>delete</md-icon>
<span class="md-list-item-text">Trash</span>
</md-list-item>

<md-list-item>
<md-icon>error</md-icon>
<span class="md-list-item-text">Spam</span>
</md-list-item>
</md-list>
</md-drawer>

<div class="page-content md-flex">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error quibusdam, non molestias et! Earum magnam, similique, quo recusandae placeat dicta asperiores modi sint ea repudiandae maxime? Quae non explicabo, neque.</div>
</main>
</div>
</template>

<style lang="scss" scoped>
.page-container {
border: 1px solid rgba(#000, .12);
}
// Demo purposes only
.md-drawer {
width: 230px;
max-width: calc(100vw - 125px);
}
.page-content {
padding: 16px 0;
}
</style>

<script>
export default {
name: 'PermanentCard'
}
</script>
58 changes: 58 additions & 0 deletions docs/app/pages/Components/Drawer/examples/PermanentClipped.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<template>
<div class="page-container">
<md-toolbar class="md-primary">
<span class="md-title">My Title</span>
</md-toolbar>

<main class="page-wrapper md-layout-row">
<md-drawer md-permanent="clipped">
<md-list>
<md-list-item>
<md-icon>move_to_inbox</md-icon>
<span class="md-list-item-text">Inbox</span>
</md-list-item>

<md-list-item>
<md-icon>send</md-icon>
<span class="md-list-item-text">Sent Mail</span>
</md-list-item>

<md-list-item>
<md-icon>delete</md-icon>
<span class="md-list-item-text">Trash</span>
</md-list-item>

<md-list-item>
<md-icon>error</md-icon>
<span class="md-list-item-text">Spam</span>
</md-list-item>
</md-list>
</md-drawer>

<div class="page-content md-flex">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error quibusdam, non molestias et! Earum magnam, similique, quo recusandae placeat dicta asperiores modi sint ea repudiandae maxime? Quae non explicabo, neque.</div>
</main>
</div>
</template>

<style lang="scss" scoped>
.page-container {
border: 1px solid rgba(#000, .12);
}
// Demo purposes only
.md-drawer {
width: 230px;
max-width: calc(100vw - 125px);
}
.page-content {
padding: 16px;
border-left: 1px solid rgba(#000, .12);
}
</style>

<script>
export default {
name: 'PermanentClipped'
}
</script>
62 changes: 62 additions & 0 deletions docs/app/pages/Components/Drawer/examples/PermanentFull.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<template>
<div class="page-container md-layout-row">
<md-drawer md-permanent="full">
<md-toolbar class="md-transparent" md-elevation="0">
Navigation
</md-toolbar>

<md-list>
<md-list-item>
<md-icon>move_to_inbox</md-icon>
<span class="md-list-item-text">Inbox</span>
</md-list-item>

<md-list-item>
<md-icon>send</md-icon>
<span class="md-list-item-text">Sent Mail</span>
</md-list-item>

<md-list-item>
<md-icon>delete</md-icon>
<span class="md-list-item-text">Trash</span>
</md-list-item>

<md-list-item>
<md-icon>error</md-icon>
<span class="md-list-item-text">Spam</span>
</md-list-item>
</md-list>
</md-drawer>

<main class="page-wrapper md-flex md-layout-column">
<md-toolbar class="md-primary">
<span class="md-title">My Title</span>
</md-toolbar>

<div class="page-content md-flex">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error quibusdam, non molestias et! Earum magnam, similique, quo recusandae placeat dicta asperiores modi sint ea repudiandae maxime? Quae non explicabo, neque.</div>
</main>
</div>
</template>

<style lang="scss" scoped>
.page-container {
border: 1px solid rgba(#000, .12);
}
// Demo purposes only
.md-drawer {
width: 230px;
max-width: calc(100vw - 125px);
}
.page-content {
padding: 16px;
border-left: 1px solid rgba(#000, .12);
}
</style>

<script>
export default {
name: 'PermanentFull'
}
</script>
80 changes: 80 additions & 0 deletions docs/app/pages/Components/Drawer/examples/Persistent.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<template>
<div class="page-container md-layout-row">
<md-drawer :md-visible.sync="menuVisible" md-persistent>
<md-toolbar class="md-transparent" md-elevation="0">
<span>Navigation</span>

<div class="md-toolbar-section-end">
<md-button class="md-icon-button md-dense" @click="toggleMenu">
<md-icon>keyboard_arrow_left</md-icon>
</md-button>
</div>
</md-toolbar>

<md-list>
<md-list-item>
<md-icon>move_to_inbox</md-icon>
<span class="md-list-item-text">Inbox</span>
</md-list-item>

<md-list-item>
<md-icon>send</md-icon>
<span class="md-list-item-text">Sent Mail</span>
</md-list-item>

<md-list-item>
<md-icon>delete</md-icon>
<span class="md-list-item-text">Trash</span>
</md-list-item>

<md-list-item>
<md-icon>error</md-icon>
<span class="md-list-item-text">Spam</span>
</md-list-item>
</md-list>
</md-drawer>

<main class="page-wrapper md-flex md-layout-column">
<md-toolbar class="md-primary">
<md-button class="md-icon-button" @click="toggleMenu" v-if="!menuVisible">
<md-icon>menu</md-icon>
</md-button>
<span class="md-title">My Title</span>
</md-toolbar>

<div class="page-content md-flex">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error quibusdam, non molestias et! Earum magnam, similique, quo recusandae placeat dicta asperiores modi sint ea repudiandae maxime? Quae non explicabo, neque.</div>
</main>
</div>
</template>

<style lang="scss" scoped>
.page-container {
overflow: hidden;
border: 1px solid rgba(#000, .12);
}
// Demo purposes only
.md-drawer {
width: 230px;
max-width: calc(100vw - 125px);
}
.page-content {
padding: 16px;
border-left: 1px solid rgba(#000, .12);
}
</style>

<script>
export default {
name: 'Persistent',
data: () => ({
menuVisible: false
}),
methods: {
toggleMenu () {
this.menuVisible = !this.menuVisible
}
}
}
</script>
38 changes: 0 additions & 38 deletions docs/app/pages/Components/Drawer/examples/Sidenav.vue

This file was deleted.

Loading

0 comments on commit 53a9d98

Please sign in to comment.