-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(lib): implemented mat-mini-fab-menu component
- Loading branch information
1 parent
11b56cf
commit abfbbaa
Showing
6 changed files
with
96 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...r-material-extensions/fab-menu/src/lib/mat-mini-fab-menu/mat-mini-fab-menu.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<div [fxLayout]="layout" class="container" fxLayoutAlign="center center" fxLayoutGap="16px"> | ||
<div fxLayoutAlign="center"> | ||
<button (click)="isActive = !isActive" | ||
[color]="color" [disabled]="disabled" | ||
type="button" | ||
[ngClass]="{ | ||
'mat-fab' : !isActive, | ||
'mat-mini-fab' : isActive | ||
}" | ||
mat-mini-fab> | ||
<mat-icon [@fabToggler]="{value: isActive}">{{icon}}</mat-icon> <!-- Animation here --> | ||
</button> | ||
</div> | ||
<div *ngIf="isActive" [@fabsStagger]="fabButtons.length" | ||
[fxLayout]="layout2" fxLayoutAlign="center center" fxLayoutGap="16px"> | ||
<button (click)="selectFabMenu(fab)" | ||
*ngFor="let fab of fabButtons" | ||
[color]="fab?.color" | ||
[matTooltip]="fab?.tooltip" | ||
[matTooltipPosition]="fab?.tooltipPosition" | ||
[ngClass]="{'fullSVG' : fab?.imgUrl}" | ||
type="button" | ||
mat-fab> | ||
<mat-icon *ngIf="fab?.icon" [color]="fab?.iconColor">{{fab?.icon}}</mat-icon> | ||
<img *ngIf="fab?.imgUrl" [src]="fab?.imgUrl" alt="icon"> | ||
</button> | ||
</div> | ||
</div> |
31 changes: 31 additions & 0 deletions
31
...r-material-extensions/fab-menu/src/lib/mat-mini-fab-menu/mat-mini-fab-menu.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
:host { | ||
display: block; | ||
} | ||
|
||
.fullSVG { | ||
img { | ||
width: 100%; | ||
} | ||
|
||
::ng-deep span.mat-button-wrapper { | ||
padding: 0; | ||
} | ||
} | ||
|
||
.container { | ||
//position: fixed; | ||
//bottom: 15px; | ||
//right: 15px; | ||
//z-index: 100; | ||
|
||
> div { | ||
//display: flex; | ||
//flex-direction: column-reverse; | ||
//align-items: center; | ||
margin-bottom: 5px; | ||
|
||
button { | ||
margin-bottom: 16px; | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...aterial-extensions/fab-menu/src/lib/mat-mini-fab-menu/mat-mini-fab-menu.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { MatMiniFabMenuComponent } from './mat-mini-fab-menu.component'; | ||
|
||
describe('MatMiniFabMenuComponent', () => { | ||
let component: MatMiniFabMenuComponent; | ||
let fixture: ComponentFixture<MatMiniFabMenuComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ MatMiniFabMenuComponent ] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(MatMiniFabMenuComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
11 changes: 11 additions & 0 deletions
11
...lar-material-extensions/fab-menu/src/lib/mat-mini-fab-menu/mat-mini-fab-menu.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Component } from '@angular/core'; | ||
import {MatFabMenuComponent} from '../mat-fab-menu.component'; | ||
|
||
@Component({ | ||
selector: 'mat-mini-fab-menu', | ||
templateUrl: './mat-mini-fab-menu.component.html', | ||
styleUrls: ['./mat-mini-fab-menu.component.scss'] | ||
}) | ||
export class MatMiniFabMenuComponent extends MatFabMenuComponent{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters