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
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,27 @@
<img src="{{ dxcLogoPath }}" />
</dxc-tag-icon>
</dxc-tag>

<dxc-tag
margin="xsmall"
label="DXC TECHNOLOGY"
disabled="true"
linkHref="www.google.es"
>
<dxc-tag-icon>
<img src="{{ dxcLogoPath }}" />
</dxc-tag-icon>
</dxc-tag>

<dxc-tag
margin="xsmall"
label="DXC TECHNOLOGY"
(onClick)="onClick()"
disabled="true"
>
<dxc-tag-icon>
<img src="{{ dxcLogoPath }}" />
</dxc-tag-icon>
</dxc-tag>
</tbuilder-component-mode>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ export class TagPreviewComponent implements OnInit {

ngOnInit(): void {}

onClick() {}
onClick() {
console.log("click");
}
}
20 changes: 12 additions & 8 deletions projects/dxc-ngx-cdk/src/lib/dxc-tag/dxc-tag.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ export class DxcTagComponent implements OnInit {
};

public onClickHandler($event: any): void {
this.onClick.emit($event);
if (!this.disabled) {
this.onClick.emit($event);
}
}

getShadowDepth(): string {
Expand Down Expand Up @@ -236,17 +238,17 @@ export class DxcTagComponent implements OnInit {
getDynamicStyle(inputs) {
return css`
display: inline-flex;
${inputs.disabled
${!this.isClickDefined &&
(this.linkHref === null || this.linkHref === undefined)
? css`
cursor: not-allowed;
cursor: unset;
`
: this.isClickDefined ||
(this.linkHref !== null && this.linkHref !== undefined)
: this.disabled
? css`
cursor: pointer;
cursor: not-allowed;
`
: css`
cursor: unset;
cursor: pointer;
`};
${this.utils.getMargins(inputs.margin)};
dxc-box {
Expand Down Expand Up @@ -317,12 +319,14 @@ export class DxcTagComponent implements OnInit {
background: none;
border: none;
padding: 0;
cursor: pointer;
cursor: ${!this.disabled ? "pointer" : "not-allowed"};
outline: 0;
}
.styledLink {
text-decoration: none;
outline: none;
cursor: ${!this.disabled ? "pointer" : "not-allowed"};
${this.disabled ? "pointer-events: none;" : ""}
}
${this.setActionStyle(inputs)};
`;
Expand Down