feat(ui): Added link-button to ui-libs. (TV-855)
Squashed commit of the following: commit 1aab96d7f243c77adbd806196f76b931f4445976 Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se> Date: Thu Oct 28 11:38:05 2021 +0200 Added digi-link component to ui lib
This commit is contained in:
24
libs/ui/link-button/link-button.component.ts
Normal file
24
libs/ui/link-button/link-button.component.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
||||
import { Params } from '@angular/router';
|
||||
import { UiLinkButtonType } from './link-button-type.enum';
|
||||
|
||||
@Component({
|
||||
selector: 'ui-link-button',
|
||||
templateUrl: './link-button.component.html',
|
||||
styleUrls: ['./link-button.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class LinkButtonComponent {
|
||||
private readonly _defaultClass = 'ui-link-button';
|
||||
@Input() uiType: UiLinkButtonType = UiLinkButtonType.PRIMARY;
|
||||
@Input() uiSize: 's' | 'm' = 'm';
|
||||
@Input() uiRouterLink: string | string[];
|
||||
@Input() uiQueryParams: Params = null;
|
||||
|
||||
get linkButtonClass(): string {
|
||||
if (this.uiType) {
|
||||
return `${this._defaultClass} ${this._defaultClass}--${this.uiType as string}`;
|
||||
}
|
||||
return this._defaultClass;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user