Skip to content

Commit 3874d8a

Browse files
committed
feat(lib): support of tooltip position
1 parent 2674aba commit 3874d8a

File tree

10 files changed

+96
-11
lines changed

10 files changed

+96
-11
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,20 @@ Other modules in your application like for lazy loading import ` MatSelectCountr
133133
Important interfaces or type
134134

135135
```typescript
136-
type MatFabMenuDirection = 'top' | 'bottom' | 'left' | 'right';
136+
137+
import {ThemePalette, TooltipPosition} from '@angular/material';
137138

138139
interface MatFabMenu {
139-
id: number;
140+
id: string | number;
140141
icon?: string; // please use either icon or imgUrl
142+
iconColor?: ThemePalette;
141143
imgUrl?: string; // please use either icon or imgUrl
142-
tooltip?: string; // coming soon
144+
tooltip?: string;
145+
tooltipPosition?: TooltipPosition;
143146
color?: ThemePalette;
144-
iconColor?: ThemePalette;
145147
}
148+
149+
type MatFabMenuDirection = 'top' | 'bottom' | 'left' | 'right';
146150
```
147151

148152

49 KB
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
DO’s
2+
----
3+
4+
* Do use the logos to link to JetBrains website: https://www.jetbrains.com
5+
* Do use the logos to advertise that your product has built-in integration with a JetBrains product
6+
* Do use the graphics in printed or online materials, but respect the minimum size of the logo: 7.5mm in print and 50px on screen/digital.
7+
8+
9+
Don’ts
10+
------
11+
12+
* Don’t change the colors of the logos
13+
* Don’t change the aspect ratio of the logos when resizing
14+
* Don’t crop the logos
15+
* Don’t use the black square without the beam or the product name
16+
* Don’t add any text on the logo
17+
* Don’t sell our logos
18+
19+
If in doubt, please contact [email protected]
20+
21+
--
22+
23+
Thank you!
24+
The JetBrains Team
122 KB
Loading
Lines changed: 43 additions & 0 deletions
Loading

projects/angular-material-extensions/fab-menu/src/lib/mat-fab-menu.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
<button (click)="onFabMenuItemSelected.emit(fab.id)"
1616
*ngFor="let fab of fabButtons"
1717
[color]="fab?.color"
18+
[matTooltip]="fab?.tooltip"
19+
[matTooltipPosition]="fab?.tooltipPosition"
1820
[ngClass]="{'fullSVG' : fab?.imgUrl}"
1921
mat-fab>
2022
<mat-icon *ngIf="fab?.icon" [color]="fab?.iconColor">{{fab?.icon}}</mat-icon>

projects/angular-material-extensions/fab-menu/src/lib/mat-fab-menu.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import {Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges} from '@angular/core';
22
import {speedDialFabAnimations} from './mat-fab-menu.animations';
3-
import {ThemePalette} from '@angular/material';
3+
import {ThemePalette, TooltipPosition} from '@angular/material';
44

55
export interface MatFabMenu {
66
id: string | number;
77
icon?: string; // please use either icon or imgUrl
8+
iconColor?: ThemePalette;
89
imgUrl?: string; // please use either icon or imgUrl
910
tooltip?: string;
11+
tooltipPosition?: TooltipPosition;
1012
color?: ThemePalette;
11-
iconColor?: ThemePalette;
1213
}
1314

1415
export type MatFabMenuDirection = 'top' | 'bottom' | 'left' | 'right';

projects/angular-material-extensions/fab-menu/src/lib/mat-fab-menu.module.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import {NgModule} from '@angular/core';
22
import {MatFabMenuComponent} from './mat-fab-menu.component';
33
import {MatButtonModule} from '@angular/material/button';
44
import {CommonModule} from '@angular/common';
5-
import {MatIconModule} from '@angular/material';
5+
import {MatIconModule} from '@angular/material/icon';
6+
import {MatTooltipModule} from '@angular/material/tooltip';
67
import {FlexLayoutModule} from '@angular/flex-layout';
78

89
@NgModule({
@@ -11,6 +12,7 @@ import {FlexLayoutModule} from '@angular/flex-layout';
1112
CommonModule,
1213
MatButtonModule,
1314
MatIconModule,
15+
MatTooltipModule,
1416
FlexLayoutModule
1517
],
1618
exports: [MatFabMenuComponent]

src/app/app.component.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,27 @@ export class AppComponent implements OnInit {
5858
fabCountries: MatFabMenu[] = [
5959
{
6060
id: 1,
61-
imgUrl: 'assets/countrys-flags/svg/canada.svg'
61+
imgUrl: 'assets/countrys-flags/svg/canada.svg',
62+
tooltip: 'canada',
63+
tooltipPosition: 'before'
6264
},
6365
{
6466
id: 2,
65-
imgUrl: 'assets/countrys-flags/svg/germany.svg'
67+
imgUrl: 'assets/countrys-flags/svg/germany.svg',
68+
tooltip: 'germany',
69+
tooltipPosition: 'before'
6670
},
6771
{
6872
id: 3,
69-
imgUrl: 'assets/countrys-flags/svg/france.svg'
73+
imgUrl: 'assets/countrys-flags/svg/france.svg',
74+
tooltip: 'france',
75+
tooltipPosition: 'before'
7076
},
7177
{
7278
id: 4,
73-
imgUrl: 'assets/countrys-flags/svg/lebanon.svg'
79+
imgUrl: 'assets/countrys-flags/svg/lebanon.svg',
80+
tooltip: 'lebanon',
81+
tooltipPosition: 'before'
7482
},
7583
];
7684

0 commit comments

Comments
 (0)