diff --git a/README.md b/README.md index cdcd1101f3c6..e93c206ea3e0 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ High level stuff planned for Q4 2018 (October - Dec): | Feature | Status | Docs | Issue | |------------------|-------------------------------------|--------------|----------------| -| fab speed-dial | Not started, not planned | - | [#860][0860] | +| fab speed-dial | PR in progress | - | [#860][0860] | | fab toolbar | Not started, not planned | - | - | | bottom-nav | Not started, not planned | - | [#408][0408] | diff --git a/src/dev-app/button/button-demo-module.ts b/src/dev-app/button/button-demo-module.ts index 351c52b98cb4..312eb5f2b188 100644 --- a/src/dev-app/button/button-demo-module.ts +++ b/src/dev-app/button/button-demo-module.ts @@ -7,14 +7,28 @@ */ import {NgModule} from '@angular/core'; -import {MatButtonModule, MatIconModule} from '@angular/material'; +import {FormsModule} from '@angular/forms'; +import { + MatButtonModule, + MatFormFieldModule, + MatIconModule, + MatInputModule, + MatSelectModule, + MatSlideToggleModule +} from '@angular/material'; import {RouterModule} from '@angular/router'; + import {ButtonDemo} from './button-demo'; @NgModule({ imports: [ MatButtonModule, MatIconModule, + MatFormFieldModule, + MatInputModule, + MatSelectModule, + FormsModule, + MatSlideToggleModule, RouterModule.forChild([{path: '', component: ButtonDemo}]), ], declarations: [ButtonDemo], diff --git a/src/dev-app/button/button-demo.html b/src/dev-app/button/button-demo.html index e88d06475acf..0b1ab30b8100 100644 --- a/src/dev-app/button/button-demo.html +++ b/src/dev-app/button/button-demo.html @@ -1,115 +1,200 @@
-

Buttons

-
- - - - - - -
- -

Anchors

-
- SEARCH - SEARCH - SEARCH - SEARCH - check - check -
- -

Text Buttons [mat-button]

-
- - - - -
- -

Raised Buttons [mat-raised-button]

-
- - - - -
- -

Stroked Buttons [mat-stroked-button]

-
- - - - -
- -

Flat Buttons [mat-flat-button]

-
- - - - -
- -

Icon Buttons [mat-icon-button]

-
- - - - -
- -

Fab Buttons [mat-fab]

-
- - - - -
- -

Mini Fab Buttons [mat-mini-fab]

-
- - - - -
- -

Interaction/State

-
-
-

isDisabled: {{isDisabled}}

-

Button 1 as been clicked {{clickCounter}} times

- - - - - -
-
- - - - Button 3 - - - - -
-
+

Buttons

+
+ + + + + + +
+ +

Anchors

+
+ SEARCH + SEARCH + SEARCH + SEARCH + + check + + + check + +
+ +

Text Buttons [mat-button]

+
+ + + + +
+ +

Raised Buttons [mat-raised-button]

+
+ + + + +
+ +

Stroked Buttons [mat-stroked-button]

+
+ + + + +
+ +

Flat Buttons [mat-flat-button]

+
+ + + + +
+ +

Icon Buttons [mat-icon-button]

+
+ + + + +
+ +

Fab Buttons [mat-fab]

+
+ + + + +
+ +

Mini Fab Buttons [mat-mini-fab]

+
+ + + + +
+ +

Interaction/State

+
+
+

isDisabled: {{isDisabled}}

+

Button 1 as been clicked {{clickCounter}} times

+ + + + + +
+
+ + + + Button 3 + + + + +
+
+ +

Speed dial Fab Button [mat-fab-dial]

+
+
+
+ + Colors + + + + + + Disabled + + + + direction + + + + + Placement + + + +
+ +
+ + + + + + + +
diff --git a/src/dev-app/button/button-demo.scss b/src/dev-app/button/button-demo.scss index 74bd52e8046a..8caef30c6455 100644 --- a/src/dev-app/button/button-demo.scss +++ b/src/dev-app/button/button-demo.scss @@ -23,3 +23,10 @@ display: block; } } + +.demo-section-fab-dial { + min-height: 10vh; + mat-form-field { + margin: 0.5rem 1rem; + } +} diff --git a/src/dev-app/button/button-demo.ts b/src/dev-app/button/button-demo.ts index c10962c132c9..4fdb83d939f5 100644 --- a/src/dev-app/button/button-demo.ts +++ b/src/dev-app/button/button-demo.ts @@ -7,6 +7,7 @@ */ import {Component} from '@angular/core'; +import {ThemePalette} from '@angular/material'; @Component({ @@ -19,4 +20,15 @@ export class ButtonDemo { isDisabled: boolean = false; clickCounter: number = 0; toggleDisable: boolean = false; + + _colorFab: ThemePalette = 'primary'; + get colorFab(): ThemePalette { + return this._colorFab; + } + set colorFab(value: ThemePalette) { + this._colorFab = value; + } + disableFab: boolean = false; + directionFab: 'horizontal'|'vertical' = 'vertical'; + placementFab: 'top'|'bottom' = 'bottom'; } diff --git a/src/lib/button/_button-base.scss b/src/lib/button/_button-base.scss index dc9377d45d78..42554525b97d 100644 --- a/src/lib/button/_button-base.scss +++ b/src/lib/button/_button-base.scss @@ -11,7 +11,7 @@ $mat-button-margin: 0 !default; $mat-button-line-height: 36px !default; $mat-button-border-radius: 4px !default; $mat-button-focus-transition: opacity 200ms $swift-ease-in-out-timing-function, - background-color 200ms $swift-ease-in-out-timing-function !default; +background-color 200ms $swift-ease-in-out-timing-function !default; // Stroked button padding is 1px less horizontally than default/flat/raised // button's padding. @@ -32,77 +32,81 @@ $mat-fab-padding: 16px !default; $mat-mini-fab-size: 40px !default; $mat-mini-fab-padding: 8px !default; +// Fab Speed Dial +$mat-fab-dial-margin: 32px !default; + // Applies base styles to all button types. @mixin mat-button-base { - box-sizing: border-box; - position: relative; - - // Reset browser + + + `, + styleUrls: ['button.css'], + encapsulation: ViewEncapsulation.None, + changeDetection: ChangeDetectionStrategy.OnPush, +}) +export class MatDialButton extends _MatDialMixinBase implements CanDisable, CanColor, + CanDisableRipple { + /** Tabindex of the button. */ + @Input() tabIndex: number; + + @Input() + get open(): boolean { + return this._open; + } + set open(value: boolean) { + this._open = value; + } + _open: boolean; + + @Input() + get icon(): string { + return this._icon; + } + set icon(value: string) { + this._icon = value || 'add'; + } + _icon: string = 'add'; + + @Input() + get direction(): 'vertical'|'horizontal' { + return this._direction; + } + set direction(value: 'vertical'|'horizontal') { + this._direction = value || 'vertical'; + } + _direction: 'vertical'|'horizontal'; + + constructor(elementRef: ElementRef, changeDetectorRef: ChangeDetectorRef) { + super(elementRef, changeDetectorRef); + } + + _toggleDial(): void { + if (this.disabled) { + return; + } + this.open = !this.open; + } +} + +/** + * Material design action button list. + */ +@Component({ + moduleId: module.id, + selector: 'mat-fab-dial-list', + template: ``, + exportAs: 'matFabDialList', + styleUrls: ['button.css'], + encapsulation: ViewEncapsulation.None, + changeDetection: ChangeDetectionStrategy.OnPush, +}) +export class MatFabDialList { +} diff --git a/src/material-examples/button-types/button-types-example.html b/src/material-examples/button-types/button-types-example.html index 829fd13f94d7..c07bbf640345 100644 --- a/src/material-examples/button-types/button-types-example.html +++ b/src/material-examples/button-types/button-types-example.html @@ -82,3 +82,14 @@

Mini Fab Buttons

Link + + +

Speed Dial Fab Button

+
+ + + + + + +
\ No newline at end of file