feature(digi-ng-migrering: Flyttat digi-button till vår egen kod (TV-865)

Merge in TEA/mina-sidor-fa-web from feature/TV-865-link-button to develop

Squashed commit of the following:

commit 45f3795aff7883c66302f27faf4b63ebf37f6041
Author: Daniel Appelgren <daniel.appelgren@arbetsformedlingen.se>
Date:   Fri Nov 19 11:13:33 2021 +0100

    Update _buttons.scss

commit 586e84e689719c0be5a675a262b12fdb075fe6af
Author: Daniel Appelgren <daniel.appelgren@arbetsformedlingen.se>
Date:   Fri Nov 19 11:05:01 2021 +0100

    wip

commit 62bf98e55a83d2bae91ddaa7ce9c95a8db725c20
Author: Daniel Appelgren <daniel.appelgren@arbetsformedlingen.se>
Date:   Fri Nov 19 10:54:34 2021 +0100

    simplify backlink class

commit a7d230b246b175f18c8aa156ec4bb90078618987
Merge: 0792de12 c6bbfb1b
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date:   Thu Nov 18 14:33:49 2021 +0100

    Merged develop and fixed conflicts

commit 0792de125e6d74d2f56674ec757033634b3d2fcc
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date:   Thu Nov 18 11:24:06 2021 +0100

    Added support for service-style link-buttons and replaced digi-ng-link-button

commit 3e9136806a4fc71b1ebcf75163698a9c3a5c7601
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date:   Thu Nov 18 09:29:33 2021 +0100

    Removed unused imports inside modules

commit c1c93e405c545d033c7f8904fae21721b8b1d7ae
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date:   Thu Nov 18 09:18:51 2021 +0100

    Added back-link component inside ui-libs

commit 4dd32d2b4b981d5e3337b19b8d144994a5f60468
Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se>
Date:   Thu Nov 18 06:56:32 2021 +0100

    changed links styled as button to link-button component
This commit is contained in:
Daniel Appelgren
2021-11-19 11:19:40 +01:00
parent fbd04112fb
commit 86e3d533c2
63 changed files with 292 additions and 221 deletions

View File

@@ -9,7 +9,6 @@ import { UiLinkButtonType } from './link-button-type.enum';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class LinkButtonComponent {
private readonly _defaultClass = 'ui-link-button';
@Input() uiType: UiLinkButtonType = UiLinkButtonType.PRIMARY;
@Input() uiSize: 's' | 'm' | 'l' = 'm';
@Input() uiFullWidth = false;
@@ -17,15 +16,25 @@ export class LinkButtonComponent {
@Input() uiHref: string;
@Input() uiQueryParams: Params = null;
roundedButtonTypes: UiLinkButtonType[] = [
UiLinkButtonType.ROUNDED_PRIMARY,
UiLinkButtonType.ROUNDED_PRIMARY_ALT,
UiLinkButtonType.ROUNDED_SECONDARY,
UiLinkButtonType.ROUNDED_SECONDARY_ALT,
];
get linkButtonClass(): string {
let currentClass = `${this._defaultClass} ${this._defaultClass}--${this.uiSize}`;
const defaultClass = this.isRoundedButtonType ? 'ui-link-rounded-button' : 'ui-link-button';
let currentClass = `${defaultClass} ${defaultClass}--${this.uiSize} ${defaultClass}--${this.uiType}`;
if (this.uiFullWidth) {
currentClass = `${currentClass} ${this._defaultClass}--full-width`;
}
if (this.uiType) {
currentClass = `${currentClass} ${this._defaultClass}--${this.uiType as string}`;
currentClass = `${currentClass} ${defaultClass}--full-width`;
}
return currentClass;
}
get isRoundedButtonType(): boolean {
return this.roundedButtonTypes.includes(this.uiType);
}
}