File tree Expand file tree Collapse file tree 6 files changed +96
-1
lines changed Expand file tree Collapse file tree 6 files changed +96
-1
lines changed Original file line number Diff line number Diff line change @@ -5,9 +5,10 @@ import {MatIconModule} from '@angular/material/icon';
5
5
import { FlexLayoutModule } from '@angular/flex-layout' ;
6
6
import { MatTooltipModule } from '@angular/material/tooltip' ;
7
7
import { MatButtonModule } from '@angular/material/button' ;
8
+ import { MatMiniFabMenuComponent } from './mat-mini-fab-menu/mat-mini-fab-menu.component' ;
8
9
9
10
@NgModule ( {
10
- declarations : [ MatFabMenuComponent ] ,
11
+ declarations : [ MatFabMenuComponent , MatMiniFabMenuComponent , MatMiniFabMenuComponent ] ,
11
12
imports : [
12
13
CommonModule ,
13
14
MatButtonModule ,
Original file line number Diff line number Diff line change
1
+ < div [fxLayout] ="layout " class ="container " fxLayoutAlign ="center center " fxLayoutGap ="16px ">
2
+ < div fxLayoutAlign ="center ">
3
+ < button (click) ="isActive = !isActive "
4
+ [color] ="color " [disabled] ="disabled "
5
+ type ="button "
6
+ [ngClass] ="{
7
+ 'mat-fab' : !isActive,
8
+ 'mat-mini-fab' : isActive
9
+ } "
10
+ mat-mini-fab >
11
+ < mat-icon [@fabToggler] ="{value: isActive} "> {{icon}}</ mat-icon > <!-- Animation here -->
12
+ </ button >
13
+ </ div >
14
+ < div *ngIf ="isActive " [@fabsStagger] ="fabButtons.length "
15
+ [fxLayout] ="layout2 " fxLayoutAlign ="center center " fxLayoutGap ="16px ">
16
+ < button (click) ="selectFabMenu(fab) "
17
+ *ngFor ="let fab of fabButtons "
18
+ [color] ="fab?.color "
19
+ [matTooltip] ="fab?.tooltip "
20
+ [matTooltipPosition] ="fab?.tooltipPosition "
21
+ [ngClass] ="{'fullSVG' : fab?.imgUrl} "
22
+ type ="button "
23
+ mat-fab >
24
+ < mat-icon *ngIf ="fab?.icon " [color] ="fab?.iconColor "> {{fab?.icon}}</ mat-icon >
25
+ < img *ngIf ="fab?.imgUrl " [src] ="fab?.imgUrl " alt ="icon ">
26
+ </ button >
27
+ </ div >
28
+ </ div >
Original file line number Diff line number Diff line change
1
+ :host {
2
+ display : block ;
3
+ }
4
+
5
+ .fullSVG {
6
+ img {
7
+ width : 100% ;
8
+ }
9
+
10
+ ::ng- deep span .mat- button- wrapper {
11
+ padding : 0 ;
12
+ }
13
+ }
14
+
15
+ .container {
16
+ // position: fixed;
17
+ // bottom: 15px;
18
+ // right: 15px;
19
+ // z-index: 100;
20
+
21
+ > div {
22
+ // display: flex;
23
+ // flex-direction: column-reverse;
24
+ // align-items: center;
25
+ margin-bottom : 5px ;
26
+
27
+ button {
28
+ margin-bottom : 16px ;
29
+ }
30
+ }
31
+ }
Original file line number Diff line number Diff line change
1
+ import { ComponentFixture , TestBed } from '@angular/core/testing' ;
2
+
3
+ import { MatMiniFabMenuComponent } from './mat-mini-fab-menu.component' ;
4
+
5
+ describe ( 'MatMiniFabMenuComponent' , ( ) => {
6
+ let component : MatMiniFabMenuComponent ;
7
+ let fixture : ComponentFixture < MatMiniFabMenuComponent > ;
8
+
9
+ beforeEach ( async ( ) => {
10
+ await TestBed . configureTestingModule ( {
11
+ declarations : [ MatMiniFabMenuComponent ]
12
+ } )
13
+ . compileComponents ( ) ;
14
+
15
+ fixture = TestBed . createComponent ( MatMiniFabMenuComponent ) ;
16
+ component = fixture . componentInstance ;
17
+ fixture . detectChanges ( ) ;
18
+ } ) ;
19
+
20
+ it ( 'should create' , ( ) => {
21
+ expect ( component ) . toBeTruthy ( ) ;
22
+ } ) ;
23
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import { Component } from '@angular/core' ;
2
+ import { MatFabMenuComponent } from '../mat-fab-menu.component' ;
3
+
4
+ @Component ( {
5
+ selector : 'mat-mini-fab-menu' ,
6
+ templateUrl : './mat-mini-fab-menu.component.html' ,
7
+ styleUrls : [ './mat-mini-fab-menu.component.scss' ]
8
+ } )
9
+ export class MatMiniFabMenuComponent extends MatFabMenuComponent {
10
+
11
+ }
Original file line number Diff line number Diff line change 3
3
*/
4
4
5
5
export * from './lib/mat-fab-menu.component' ;
6
+ export * from './lib/mat-mini-fab-menu/mat-mini-fab-menu.component' ;
6
7
export * from './lib/mat-fab-menu.module' ;
You can’t perform that action at this time.
0 commit comments