Skip to content

Commit 07aefc9

Browse files
author
duckaxe
committed
Add custom icon to <tooltip-text-icon> component
1 parent a10e206 commit 07aefc9

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

main/http_server/axe-os/src/app/components/tooltip-icon/tooltip-icon.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ import { Component, Input, HostListener } from '@angular/core';
88
export class TooltipIconComponent {
99
@Input() tooltip: string = '';
1010
@Input() size: string = 'xs';
11+
@Input() icon: string = '';
1112

1213
showMobileTooltip = false;
13-
tooltipIconClass = `pi pi-question-circle text-${this.size} pl-1 pr-2 tooltip-icon`;
1414
isMobile = ('ontouchstart' in window) || (navigator.maxTouchPoints > 0);
15+
16+
get tooltipIconClass(): string {
17+
return `pi ${this.icon} text-${this.size} pl-1 pr-2 tooltip-icon`;
18+
}
1519
}

main/http_server/axe-os/src/app/components/tooltip-text-icon/tooltip-text-icon.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
<span *ngIf="preLastWords">{{ preLastWords }}&nbsp;</span>
44

55
<span class="white-space-nowrap">
6-
{{ lastWord }}<tooltip-icon [tooltip]="tooltip" />
6+
{{ lastWord }}<tooltip-icon [tooltip]="tooltip" [icon]="icon" />
77
</span>
88
</ng-container>
99

1010
<ng-template #noSplit>
1111
<span class="white-space-nowrap">
12-
{{ text }}<tooltip-icon [tooltip]="tooltip" />
12+
{{ text }}<tooltip-icon [tooltip]="tooltip" [icon]="icon" />
1313
</span>
1414
</ng-template>
1515
</ng-container>

main/http_server/axe-os/src/app/components/tooltip-text-icon/tooltip-text-icon.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Component, Input, OnChanges, SimpleChanges } from '@angular/core';
66
})
77
export class TooltipTextIconComponent implements OnChanges {
88
@Input() tooltip: string | null = '';
9+
@Input() icon: string = 'pi-question-circle';
910
@Input() text: string | null = '';
1011
@Input() split: boolean = true;
1112

0 commit comments

Comments
 (0)