mirror of
https://github.com/Retropex/mempool.git
synced 2025-05-13 02:30:41 +02:00
29 lines
861 B
TypeScript
29 lines
861 B
TypeScript
import { Component, Input, Inject, LOCALE_ID, ChangeDetectionStrategy } from '@angular/core';
|
|
|
|
@Component({
|
|
selector: 'app-truncate',
|
|
templateUrl: './truncate.component.html',
|
|
styleUrls: ['./truncate.component.scss'],
|
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
})
|
|
export class TruncateComponent {
|
|
@Input() text: string;
|
|
@Input() link: any = null;
|
|
@Input() external: boolean = false;
|
|
@Input() queryParams: any = undefined;
|
|
@Input() lastChars: number = 4;
|
|
@Input() maxWidth: number = null;
|
|
@Input() inline: boolean = false;
|
|
@Input() textAlign: 'start' | 'end' = 'start';
|
|
@Input() disabled: boolean = false;
|
|
rtl: boolean;
|
|
|
|
constructor(
|
|
@Inject(LOCALE_ID) private locale: string,
|
|
) {
|
|
if (this.locale.startsWith('ar') || this.locale.startsWith('fa') || this.locale.startsWith('he')) {
|
|
this.rtl = true;
|
|
}
|
|
}
|
|
}
|