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:
Erik Tiekstra
2021-10-28 12:08:07 +02:00
parent b2ff020edf
commit f857b1ae20
10 changed files with 104 additions and 6 deletions

View 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;
}
}