@@ -18,6 +18,21 @@ import {
1818} from "@angular/core" ;
1919import { DxcLinkIconComponent } from "./dxc-link-icon/dxc-link-icon.component" ;
2020
21+ type Space =
22+ | "xxsmall"
23+ | "xsmall"
24+ | "small"
25+ | "medium"
26+ | "large"
27+ | "xlarge"
28+ | "xxlarge" ;
29+ type Margin = {
30+ top ?: Space ;
31+ bottom ?: Space ;
32+ left ?: Space ;
33+ right ?: Space ;
34+ } ;
35+
2136@Component ( {
2237 selector : "dxc-link" ,
2338 templateUrl : "./dxc-link.component.html" ,
@@ -32,57 +47,86 @@ export class DxcLinkComponent {
3247 this . _underlined = coerceBooleanProperty ( value ) ;
3348 }
3449 private _underlined = true ;
50+ /**
51+ * If true, the color is inherited from parent.
52+ */
3553 @Input ( )
3654 get inheritColor ( ) : boolean {
3755 return this . _inheritColor ;
3856 }
3957 set inheritColor ( value : boolean ) {
4058 this . _inheritColor = coerceBooleanProperty ( value ) ;
4159 }
42- private _inheritColor ;
60+ private _inheritColor = false ;
61+ /**
62+ * If true, the link is disabled.
63+ */
4364 @Input ( )
4465 get disabled ( ) : boolean {
4566 return this . _disabled ;
4667 }
4768 set disabled ( value : boolean ) {
4869 this . _disabled = coerceBooleanProperty ( value ) ;
4970 }
50- private _disabled ;
71+ private _disabled = false ;
72+ /**
73+ * Link text.
74+ */
5175 @Input ( ) text : string ;
76+ /**
77+ * @Deprecated Source of the icon.
78+ */
5279 @Input ( ) iconSrc : string ;
80+ /**
81+ * Indicates the position of the icon in the component.
82+ */
5383 @Input ( ) iconPosition : string ;
84+ /**
85+ * Page to be opened when the user clicks on the link.
86+ */
5487 @Input ( ) href : string ;
88+ /**
89+ * If true, the page is opened in a new browser tab.
90+ */
5591 @Input ( )
5692 get newWindow ( ) : boolean {
5793 return this . _newWindow ;
5894 }
5995 set newWindow ( value : boolean ) {
6096 this . _newWindow = coerceBooleanProperty ( value ) ;
6197 }
62- private _newWindow ;
63- @Input ( ) margin : string ;
98+ private _newWindow = false ;
99+ /**
100+ * Size of the margin to be applied to the component
101+ * ('xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge').
102+ * You can pass an object with 'top', 'bottom', 'left' and 'right' properties
103+ * in order to specify different margin sizes.
104+ */
105+ @Input ( ) margin : Space | Margin ;
106+ /**
107+ * Value of the tabindex.
108+ */
64109 @Input ( )
65110 get tabIndexValue ( ) : number {
66111 return this . _tabIndexValue ;
67112 }
68113 set tabIndexValue ( value : number ) {
69114 this . _tabIndexValue = coerceNumberProperty ( value ) ;
70115 }
71- private _tabIndexValue ;
72-
116+ private _tabIndexValue = 0 ;
117+ /**
118+ * This event will emit in case the user clicks the component. If defined,
119+ * the link will be displayed as a button.
120+ */
73121 @Output ( ) onClick = new EventEmitter < any > ( ) ;
74122
75123 @HostBinding ( "class" ) className ;
76-
77- isClickDefined = false ;
78-
79124 @ContentChildren ( DxcLinkIconComponent )
80125 dxcLinkIcon : QueryList < DxcLinkIconComponent > ;
81-
82126 styledLink : string = css `
83127 display : inline;
84128 ` ;
85-
129+ isClickDefined = false ;
86130 styledButton : string ;
87131
88132 defaultInputs = new BehaviorSubject < any > ( {
0 commit comments