added small chip component
This commit is contained in:
parent
77e2275823
commit
992769c272
@ -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],
|
||||
})
|
||||
|
||||
3
src/lib/misc/small-chip/small-chip.component.html
Normal file
3
src/lib/misc/small-chip/small-chip.component.html
Normal file
@ -0,0 +1,3 @@
|
||||
<ng-container *ngIf="color">
|
||||
<div [style.background-color]="color" class="chip"></div>
|
||||
</ng-container>
|
||||
5
src/lib/misc/small-chip/small-chip.component.scss
Normal file
5
src/lib/misc/small-chip/small-chip.component.scss
Normal file
@ -0,0 +1,5 @@
|
||||
.chip {
|
||||
width: 12px;
|
||||
height: 6px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
11
src/lib/misc/small-chip/small-chip.component.ts
Normal file
11
src/lib/misc/small-chip/small-chip.component.ts
Normal 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;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user