mempool/frontend/src/app/shared/components/truncate/truncate.component.html

19 lines
835 B
HTML
Raw Normal View History

2023-07-09 01:15:05 -04:00
<span class="truncate" [style.max-width]="maxWidth ? maxWidth + 'px' : null" [style.justify-content]="textAlign" [class.inline]="inline">
<ng-container *ngIf="link">
<a [routerLink]="link" class="truncate-link">
<ng-container *ngIf="rtl; then rtlTruncated; else ltrTruncated;"></ng-container>
</a>
2023-01-15 09:23:41 -06:00
</ng-container>
<ng-container *ngIf="!link">
<ng-container *ngIf="rtl; then rtlTruncated; else ltrTruncated;"></ng-container>
2023-01-15 09:23:41 -06:00
</ng-container>
2023-01-05 11:16:14 -06:00
<ng-content></ng-content>
2023-01-05 11:00:08 -06:00
</span>
<ng-template #ltrTruncated>
<span class="first">{{text.slice(0,-lastChars)}}</span><span class="last-four">{{text.slice(-lastChars)}}</span>
</ng-template>
<ng-template #rtlTruncated>
<span class="first">{{text.slice(lastChars)}}</span><span class="last-four">{{text.slice(0,lastChars)}}</span>
</ng-template>