From 992769c2728431ef5b155cb013badc7c31c25f7f Mon Sep 17 00:00:00 2001 From: Edi Cziszter Date: Mon, 7 Feb 2022 15:14:54 +0200 Subject: [PATCH 1/3] added small chip component --- src/lib/common-ui.module.ts | 4 +++- src/lib/misc/small-chip/small-chip.component.html | 3 +++ src/lib/misc/small-chip/small-chip.component.scss | 5 +++++ src/lib/misc/small-chip/small-chip.component.ts | 11 +++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 src/lib/misc/small-chip/small-chip.component.html create mode 100644 src/lib/misc/small-chip/small-chip.component.scss create mode 100644 src/lib/misc/small-chip/small-chip.component.ts diff --git a/src/lib/common-ui.module.ts b/src/lib/common-ui.module.ts index 19d0947..b52230d 100644 --- a/src/lib/common-ui.module.ts +++ b/src/lib/common-ui.module.ts @@ -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], }) diff --git a/src/lib/misc/small-chip/small-chip.component.html b/src/lib/misc/small-chip/small-chip.component.html new file mode 100644 index 0000000..a777edf --- /dev/null +++ b/src/lib/misc/small-chip/small-chip.component.html @@ -0,0 +1,3 @@ + +
+
diff --git a/src/lib/misc/small-chip/small-chip.component.scss b/src/lib/misc/small-chip/small-chip.component.scss new file mode 100644 index 0000000..78bc3fb --- /dev/null +++ b/src/lib/misc/small-chip/small-chip.component.scss @@ -0,0 +1,5 @@ +.chip { + width: 12px; + height: 6px; + border-radius: 6px; +} diff --git a/src/lib/misc/small-chip/small-chip.component.ts b/src/lib/misc/small-chip/small-chip.component.ts new file mode 100644 index 0000000..072dff7 --- /dev/null +++ b/src/lib/misc/small-chip/small-chip.component.ts @@ -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; +} From 5a0e5accb76b8e4d2d2f5de64822a716c6572f37 Mon Sep 17 00:00:00 2001 From: Edi Cziszter Date: Mon, 14 Feb 2022 13:15:37 +0200 Subject: [PATCH 2/3] update small chip --- src/lib/common-ui.module.ts | 7 ++++--- src/lib/misc/small-chip/small-chip.component.html | 4 +--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/lib/common-ui.module.ts b/src/lib/common-ui.module.ts index b52230d..b39ab59 100644 --- a/src/lib/common-ui.module.ts +++ b/src/lib/common-ui.module.ts @@ -55,11 +55,12 @@ const components = [ ToastComponent, SmallChipComponent, ]; -const pipes = [SortByPipe, HumanizePipe, CapitalizePipe]; +const pipes = [SortByPipe, HumanizePipe, CapitalizePipe, LogPipe]; @NgModule({ - declarations: [...components, ...pipes, LogPipe, SmallChipComponent], + declarations: [...components, ...pipes], imports: [CommonModule, ...matModules, ...modules, FormsModule, ReactiveFormsModule, KeycloakAngularModule], exports: [...components, ...pipes, ...modules, LogPipe], }) -export class CommonUiModule {} +export class CommonUiModule { +} diff --git a/src/lib/misc/small-chip/small-chip.component.html b/src/lib/misc/small-chip/small-chip.component.html index a777edf..1644077 100644 --- a/src/lib/misc/small-chip/small-chip.component.html +++ b/src/lib/misc/small-chip/small-chip.component.html @@ -1,3 +1 @@ - -
-
+
From d4b1bb5c07594dbce9d78cf56d26f75334116aaf Mon Sep 17 00:00:00 2001 From: Edi Cziszter Date: Mon, 14 Feb 2022 14:01:26 +0200 Subject: [PATCH 3/3] removed undefined from color --- src/lib/misc/small-chip/small-chip.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/misc/small-chip/small-chip.component.ts b/src/lib/misc/small-chip/small-chip.component.ts index 072dff7..db9a6e5 100644 --- a/src/lib/misc/small-chip/small-chip.component.ts +++ b/src/lib/misc/small-chip/small-chip.component.ts @@ -7,5 +7,5 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; changeDetection: ChangeDetectionStrategy.OnPush, }) export class SmallChipComponent { - @Input() color: string | undefined; + @Input() color!: string; }