added small chip component

This commit is contained in:
Edi Cziszter 2022-02-07 15:14:54 +02:00
parent 77e2275823
commit 992769c272
4 changed files with 22 additions and 1 deletions

View File

@ -29,6 +29,7 @@ import { MatButtonModule } from '@angular/material/button';
import { MatDialogModule } from '@angular/material/dialog';
import { CapitalizePipe } from './utils/pipes/capitalize.pipe';
import { KeycloakAngularModule } from 'keycloak-angular';
import { SmallChipComponent } from './misc/small-chip/small-chip.component';
const matModules = [MatIconModule, MatProgressSpinnerModule, MatButtonModule, MatDialogModule];
const modules = [
@ -52,11 +53,12 @@ const components = [
ConfirmationDialogComponent,
SideNavComponent,
ToastComponent,
SmallChipComponent,
];
const pipes = [SortByPipe, HumanizePipe, CapitalizePipe];
@NgModule({
declarations: [...components, ...pipes, LogPipe],
declarations: [...components, ...pipes, LogPipe, SmallChipComponent],
imports: [CommonModule, ...matModules, ...modules, FormsModule, ReactiveFormsModule, KeycloakAngularModule],
exports: [...components, ...pipes, ...modules, LogPipe],
})

View File

@ -0,0 +1,3 @@
<ng-container *ngIf="color">
<div [style.background-color]="color" class="chip"></div>
</ng-container>

View File

@ -0,0 +1,5 @@
.chip {
width: 12px;
height: 6px;
border-radius: 6px;
}

View File

@ -0,0 +1,11 @@
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
@Component({
selector: 'redaction-small-chip [color]',
templateUrl: './small-chip.component.html',
styleUrls: ['./small-chip.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class SmallChipComponent {
@Input() color: string | undefined;
}