From 59253bef91c354cb85ddd9f1d9622ec76241d13e Mon Sep 17 00:00:00 2001 From: Kyle Ledbetter Date: Wed, 28 Dec 2016 16:59:49 -0600 Subject: [PATCH] feature(layout): sticky footer (and footer-inner) (#212) * feature(layout): sticky footer (and footer-inner) * removed extra space from selector name * fixed example in nav-list * fixed manage-list example * remove inner footer in layout demos * update(footer): disable lint for multiple selectors --- src/app/components/home/home.component.html | 13 ++--- .../card-over/card-over.component.html | 14 ++++++ .../manage-list/manage-list.component.html | 22 ++++++++ .../layouts/nav-list/nav-list.component.html | 22 ++++++++ .../layouts/nav-view/nav-view.component.html | 14 ++++++ src/platform/core/layout/_layout-theme.scss | 7 +++ .../layout-footer.component.html | 3 ++ .../layout-footer.component.scss | 6 +++ .../layout-footer/layout-footer.component.ts | 11 ++++ .../layout-manage-list.component.html | 1 + .../layout-nav-list.component.html | 50 +++++++++++-------- .../layout-nav/layout-nav.component.html | 1 + src/platform/core/layout/layout.module.ts | 5 +- 13 files changed, 140 insertions(+), 29 deletions(-) create mode 100644 src/platform/core/layout/layout-footer/layout-footer.component.html create mode 100644 src/platform/core/layout/layout-footer/layout-footer.component.scss create mode 100644 src/platform/core/layout/layout-footer/layout-footer.component.ts diff --git a/src/app/components/home/home.component.html b/src/app/components/home/home.component.html index a3f1f2de7e..86d882a959 100644 --- a/src/app/components/home/home.component.html +++ b/src/app/components/home/home.component.html @@ -193,12 +193,13 @@

Feature Requests & Bugs

- -
- Copyright © 2016 Teradata. All rights reserved - - -
+ +
+ Copyright © 2016 Teradata. All rights reserved + + +
+
diff --git a/src/app/components/layouts/card-over/card-over.component.html b/src/app/components/layouts/card-over/card-over.component.html index 32f9087c13..34b257fd69 100644 --- a/src/app/components/layouts/card-over/card-over.component.html +++ b/src/app/components/layouts/card-over/card-over.component.html @@ -98,6 +98,14 @@

]]>

+ + + +

]]>

+

Optional footer

+
+
+
@@ -115,6 +123,9 @@

HTML

+ + Optional footer + ]]> @@ -151,4 +162,7 @@

TypeScript routes for sidenav

Manage List + + Optional footer + diff --git a/src/app/components/layouts/manage-list/manage-list.component.html b/src/app/components/layouts/manage-list/manage-list.component.html index 80533fdc9c..ee97a78d74 100644 --- a/src/app/components/layouts/manage-list/manage-list.component.html +++ b/src/app/components/layouts/manage-list/manage-list.component.html @@ -148,6 +148,19 @@

+ + + +

]]>

+

Optional footer before ]]>

+
+ + +

]]>

+

Optional inner footer before ]]>

+
+
+

@@ -180,7 +193,13 @@

HTML

+ + Optional inner footer + + + Optional footer + ]]> @@ -222,4 +241,7 @@

TypeScript routes for sidenav

+ + Optional footer + diff --git a/src/app/components/layouts/nav-list/nav-list.component.html b/src/app/components/layouts/nav-list/nav-list.component.html index d4180a53b7..96db9cd83a 100644 --- a/src/app/components/layouts/nav-list/nav-list.component.html +++ b/src/app/components/layouts/nav-list/nav-list.component.html @@ -103,6 +103,19 @@

]]>

+ + + +

]]>

+

Optional footer

+
+ + +

]]>

+

Optional inner footer

+
+
+
@@ -131,6 +144,12 @@

{ {item.title} }

Page Title
+ + Optional inner footer + + + Optional footer + ]]> @@ -173,4 +192,7 @@

TypeScript routes for sidenav

Card Over + + Optional footer + diff --git a/src/app/components/layouts/nav-view/nav-view.component.html b/src/app/components/layouts/nav-view/nav-view.component.html index b1b428ce40..1f11fbee89 100644 --- a/src/app/components/layouts/nav-view/nav-view.component.html +++ b/src/app/components/layouts/nav-view/nav-view.component.html @@ -75,6 +75,14 @@

]]>

+ + + +

]]>

+

Optional footer

+
+
+
@@ -90,6 +98,9 @@

HTML

+ + Optional footer + ]]> @@ -127,4 +138,7 @@

TypeScript routes for sidenav

+ + Optional footer + diff --git a/src/platform/core/layout/_layout-theme.scss b/src/platform/core/layout/_layout-theme.scss index c2b8b046ab..1262af72f4 100644 --- a/src/platform/core/layout/_layout-theme.scss +++ b/src/platform/core/layout/_layout-theme.scss @@ -3,6 +3,8 @@ @mixin td-layout-theme($theme) { $background: map-get($theme, background); + $foreground: map-get($theme, foreground); + .md-sidenav-container { background-color: md-color($background, status-bar); } @@ -12,4 +14,9 @@ z-index: 1; } } + .td-layout-footer { + background: md-color($background, app-bar); + color: md-color($foreground, text); + @include md-elevation(2); + } } \ No newline at end of file diff --git a/src/platform/core/layout/layout-footer/layout-footer.component.html b/src/platform/core/layout/layout-footer/layout-footer.component.html new file mode 100644 index 0000000000..ca5f777d98 --- /dev/null +++ b/src/platform/core/layout/layout-footer/layout-footer.component.html @@ -0,0 +1,3 @@ + diff --git a/src/platform/core/layout/layout-footer/layout-footer.component.scss b/src/platform/core/layout/layout-footer/layout-footer.component.scss new file mode 100644 index 0000000000..9a14b0c4d8 --- /dev/null +++ b/src/platform/core/layout/layout-footer/layout-footer.component.scss @@ -0,0 +1,6 @@ +:host { + display: block; +} +.td-layout-footer { + padding: 10px 16px; +} diff --git a/src/platform/core/layout/layout-footer/layout-footer.component.ts b/src/platform/core/layout/layout-footer/layout-footer.component.ts new file mode 100644 index 0000000000..a74c928fdc --- /dev/null +++ b/src/platform/core/layout/layout-footer/layout-footer.component.ts @@ -0,0 +1,11 @@ +import { Component } from '@angular/core'; + +@Component({ + /* tslint:disable-next-line */ + selector: 'td-layout-footer,td-layout-footer-inner', + styleUrls: ['./layout-footer.component.scss' ], + templateUrl: './layout-footer.component.html', +}) +export class TdLayoutFooterComponent { + +} diff --git a/src/platform/core/layout/layout-manage-list/layout-manage-list.component.html b/src/platform/core/layout/layout-manage-list/layout-manage-list.component.html index 307da858ee..89e1752cdd 100644 --- a/src/platform/core/layout/layout-manage-list/layout-manage-list.component.html +++ b/src/platform/core/layout/layout-manage-list/layout-manage-list.component.html @@ -12,5 +12,6 @@
+ diff --git a/src/platform/core/layout/layout-nav-list/layout-nav-list.component.html b/src/platform/core/layout/layout-nav-list/layout-nav-list.component.html index 24dbe2f964..d228d629d2 100644 --- a/src/platform/core/layout/layout-nav-list/layout-nav-list.component.html +++ b/src/platform/core/layout/layout-nav-list/layout-nav-list.component.html @@ -1,23 +1,29 @@ - - - - - {{icon}} - - {{toolbarTitle}} - - -
- -
-
-
- - - - -
- -
+
+
+ + + + + {{icon}} + + {{toolbarTitle}} + + +
+ +
+
+
+ + + + +
+ +
+ +
+
- + +
\ No newline at end of file diff --git a/src/platform/core/layout/layout-nav/layout-nav.component.html b/src/platform/core/layout/layout-nav/layout-nav.component.html index 17c79ddf09..8d4964982c 100644 --- a/src/platform/core/layout/layout-nav/layout-nav.component.html +++ b/src/platform/core/layout/layout-nav/layout-nav.component.html @@ -9,4 +9,5 @@
+
diff --git a/src/platform/core/layout/layout.module.ts b/src/platform/core/layout/layout.module.ts index cce2d72aae..6e80a66df9 100644 --- a/src/platform/core/layout/layout.module.ts +++ b/src/platform/core/layout/layout.module.ts @@ -9,6 +9,7 @@ import { TdLayoutNavComponent } from './layout-nav/layout-nav.component'; import { TdLayoutNavListComponent } from './layout-nav-list/layout-nav-list.component'; import { TdLayoutCardOverComponent } from './layout-card-over/layout-card-over.component'; import { TdLayoutManageListComponent } from './layout-manage-list/layout-manage-list.component'; +import { TdLayoutFooterComponent } from './layout-footer/layout-footer.component'; import { TdLayoutService } from './services/layout.service'; const TD_LAYOUTS: Type[] = [ @@ -17,10 +18,12 @@ const TD_LAYOUTS: Type[] = [ TdLayoutNavListComponent, TdLayoutCardOverComponent, TdLayoutManageListComponent, + TdLayoutFooterComponent, ]; export { TdLayoutComponent, TdLayoutNavComponent, TdLayoutNavListComponent, - TdLayoutCardOverComponent, TdLayoutManageListComponent }; + TdLayoutCardOverComponent, TdLayoutManageListComponent, + TdLayoutFooterComponent }; @NgModule({ imports: [