mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
expose icon color property (#4248)
This commit is contained in:
@@ -29,6 +29,7 @@ Provides a universal way of rendering registered and named icons.
|
|||||||
| Name | Type | Default value | Description |
|
| Name | Type | Default value | Description |
|
||||||
| ---- | ---- | ------------- | ----------- |
|
| ---- | ---- | ------------- | ----------- |
|
||||||
| value | `string` | | Icon value, which can be either a ligature name or a custom icon in the format `[namespace]:[name]`. |
|
| value | `string` | | Icon value, which can be either a ligature name or a custom icon in the format `[namespace]:[name]`. |
|
||||||
|
| color | ThemePalette | |Theme color palette for the component. |
|
||||||
|
|
||||||
## Details
|
## Details
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<ng-container *ngIf="isCustom; else: default">
|
<ng-container *ngIf="isCustom; else: default">
|
||||||
<mat-icon [svgIcon]="value"></mat-icon>
|
<mat-icon [color]="color" [svgIcon]="value"></mat-icon>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-template #default>
|
<ng-template #default>
|
||||||
<mat-icon>{{ value }}</mat-icon>
|
<mat-icon [color]="color">{{ value }}</mat-icon>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
@@ -22,6 +22,7 @@ import {
|
|||||||
ChangeDetectionStrategy
|
ChangeDetectionStrategy
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { ThumbnailService } from '../services/thumbnail.service';
|
import { ThumbnailService } from '../services/thumbnail.service';
|
||||||
|
import { ThemePalette } from '@angular/material';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-icon',
|
selector: 'adf-icon',
|
||||||
@@ -35,6 +36,9 @@ export class IconComponent {
|
|||||||
private _value = '';
|
private _value = '';
|
||||||
private _isCustom = false;
|
private _isCustom = false;
|
||||||
|
|
||||||
|
@Input()
|
||||||
|
color: ThemePalette;
|
||||||
|
|
||||||
get value(): string {
|
get value(): string {
|
||||||
return this._value;
|
return this._value;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user