import { Component, Input } from '@angular/core'; //Models import { ITooltipList } from './models'; import { CommonModule } from '@angular/common'; //Pipes import { FormatCurrencyPipe } from '../../pipes/format-currency.pipe'; import { NFormatterPipe } from '../../pipes/n-formatter.pipe'; import { TruncatePipe } from '../../pipes/truncate-string.pipe'; //Constants import { CaTooltipListConstants } from './utils/constants'; @Component({ selector: 'app-ca-tooltip-list', templateUrl: './ca-tooltip-list.component.html', styleUrls: ['./ca-tooltip-list.component.scss'], imports: [CommonModule, NFormatterPipe, FormatCurrencyPipe, TruncatePipe] }) export class CaTooltipListComponent { @Input() tooltipList: ITooltipList | null = null; public constants = CaTooltipListConstants; public truncateLength: number = 18; get isSingleItemSelected(): boolean { return this.tooltipList?.selectedItems?.length === 1; } get isLessThanFourItemsSelected(): boolean { return ( !this.tooltipList?.selectedItems || this.tooltipList?.selectedItems?.length < 4 ); } }