Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions projects/dxc-ngx-cdk/src/lib/dxc-link/dxc-link.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,7 @@ import {
QueryList,
} from "@angular/core";
import { DxcLinkIconComponent } from "./dxc-link-icon/dxc-link-icon.component";

type Space =
| "xxsmall"
| "xsmall"
| "small"
| "medium"
| "large"
| "xlarge"
| "xxlarge";
type Margin = {
top?: Space;
bottom?: Space;
left?: Space;
right?: Space;
};
import { LinkProperties, Space, Spacing } from "./dxc-link.types";

@Component({
selector: "dxc-link",
Expand Down Expand Up @@ -102,7 +88,7 @@ export class DxcLinkComponent {
* You can pass an object with 'top', 'bottom', 'left' and 'right' properties
* in order to specify different margin sizes.
*/
@Input() margin: Space | Margin;
@Input() margin: Space | Spacing;
/**
* Value of the tabindex.
*/
Expand All @@ -129,7 +115,7 @@ export class DxcLinkComponent {
isClickDefined = false;
styledButton: string;

defaultInputs = new BehaviorSubject<any>({
defaultInputs = new BehaviorSubject<LinkProperties>({
underlined: false,
inheritColor: false,
disabled: false,
Expand Down
28 changes: 28 additions & 0 deletions projects/dxc-ngx-cdk/src/lib/dxc-link/dxc-link.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
export interface LinkProperties {
margin?: Space | Spacing;
underlined?: boolean;
inheritColor?: boolean;
disabled?: boolean;
text: string;
iconSrc?: string;
iconPosition?: string;
href: string;
newWindow?: boolean;
tabIndexValue?: number;
}

export type Space =
| "xxsmall"
| "xsmall"
| "small"
| "medium"
| "large"
| "xlarge"
| "xxlarge";

export type Spacing = {
top?: Space;
bottom?: Space;
left?: Space;
right?: Space;
};