import { ChangeDetectionStrategy, Component, Input, Optional } from '@angular/core'; import { SortingOrders, SortingService } from '../../sorting'; import { KeysOf, Required } from '../../utils'; import { IListable } from '../models'; const ifHasRightIcon = (thisArg: TableColumnNameComponent) => !!thisArg.rightIcon; @Component({ selector: 'iqser-table-column-name', templateUrl: './table-column-name.component.html', styleUrls: ['./table-column-name.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) export class TableColumnNameComponent { readonly sortingOrders = SortingOrders; @Input() @Required() label!: string; @Input() sortByKey?: KeysOf; @Input() class?: string; @Input() leftIcon?: string; @Input() rightIcon?: string; @Input() @Required(ifHasRightIcon) rightIconTooltip?: string; constructor(@Optional() readonly sortingService: SortingService) {} }