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
25 lines
829 B
TypeScript
25 lines
829 B
TypeScript
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;
|
|
}
|
|
}
|