1- import { ChangeDetectionStrategy , Component , EventEmitter , Input , OnChanges , OnInit , Output } from '@angular/core' ;
1+ import {
2+ ChangeDetectionStrategy ,
3+ Component ,
4+ EventEmitter ,
5+ Input ,
6+ OnChanges ,
7+ OnInit ,
8+ Output ,
9+ TemplateRef ,
10+ ViewChild
11+ } from '@angular/core' ;
212import { IconType } from '@hypertrace/assets-library' ;
313import { TypedSimpleChanges } from '@hypertrace/common' ;
414import { InFilterModalComponent , InFilterModalData } from '../../filtering/filter-modal/in-filter-modal.component' ;
@@ -22,7 +32,7 @@ import { TableColumnConfigExtended } from '../table.service';
2232 <div
2333 *ngIf="this.columnConfig"
2434 [ngClass]="this.classes"
25- [htTooltip]="this.columnConfig.titleTooltip || this.columnConfig.title"
35+ [htTooltip]="this.getTooltip(this. columnConfig.titleTooltip, this.columnConfig.title) "
2636 class="table-header-cell-renderer"
2737 >
2838 <ng-container *ngIf="this.leftAlignFilterButton">
@@ -64,6 +74,10 @@ import { TableColumnConfigExtended } from '../table.service';
6474 </div>
6575 </ht-popover-content>
6676 </ht-popover>
77+
78+ <ng-template #htmlTooltip>
79+ <div [innerHTML]="this.columnConfig?.titleTooltip"></div>
80+ </ng-template>
6781 </ng-template>
6882 </div>
6983 `
@@ -102,6 +116,10 @@ export class TableHeaderCellRendererComponent implements OnInit, OnChanges {
102116
103117 public isFilterable : boolean = false ;
104118
119+ @ViewChild ( 'htmlTooltip' )
120+ public htmlTooltipTemplate ?: TemplateRef < unknown > ;
121+ public sanitizedHtmlForTooltip ?: string ;
122+
105123 public constructor (
106124 private readonly modalService : ModalService ,
107125 private readonly filterParserLookupService : FilterParserLookupService
@@ -144,6 +162,17 @@ export class TableHeaderCellRendererComponent implements OnInit, OnChanges {
144162 this . sortChange . emit ( direction ?? this . getNextSortDirection ( this . sort ) ) ;
145163 }
146164
165+ public getTooltip (
166+ titleTooltip : string | undefined ,
167+ title : string | undefined
168+ ) : string | TemplateRef < unknown > | undefined {
169+ if ( titleTooltip === undefined ) {
170+ return title ;
171+ }
172+
173+ return this . htmlTooltipTemplate ;
174+ }
175+
147176 private isAttributeFilterable ( ) : boolean {
148177 return (
149178 this . metadata !== undefined &&
0 commit comments