Skip to content

Commit

Permalink
Merge branch 'main' into feat/error-animation
Browse files Browse the repository at this point in the history
  • Loading branch information
adisreyaj committed Dec 11, 2023
2 parents d6a825f + 9215cb3 commit 624aab6
Showing 1 changed file with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { TableCellAlignmentType } from '../../types/table-cell-alignment-type';
<div
[ngClass]="{ clickable: this.clickable, 'first-column': this.isFirstColumn }"
class="text-cell"
[htTooltip]="this.value"
[htTooltip]="this.tooltip"
>
{{ this.value | htDisplayString }}
</div>
Expand All @@ -24,4 +24,20 @@ import { TableCellAlignmentType } from '../../types/table-cell-alignment-type';
alignment: TableCellAlignmentType.Left,
parser: CoreTableCellParserType.String,
})
export class TextTableCellRendererComponent extends TableCellRendererBase<string> {}
export class TextTableCellRendererComponent extends TableCellRendererBase<
string,
string,
TextTableCellRendererOptions
> {
public get tooltip(): string {
if (typeof this.columnConfigOptions?.tooltip === 'function') {
return this.columnConfigOptions.tooltip(this.value);
}

return this.columnConfigOptions?.tooltip ?? this.value;
}
}

export interface TextTableCellRendererOptions {
tooltip?: string | ((value: string) => string);
}

0 comments on commit 624aab6

Please sign in to comment.