import { ChangeDetectionStrategy, Component, Input, TemplateRef } from '@angular/core'; import { Required } from '../../utils'; import { FilterService } from '../../filtering'; import { EntitiesService, ListingService } from '../services'; import { IListable, ListingMode, ListingModes, TableColumnConfig } from '../models'; import { Id } from '../models/trackable'; @Component({ selector: 'iqser-table-header', templateUrl: './table-header.component.html', styleUrls: ['./table-header.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) export class TableHeaderComponent, PrimaryKey extends Id = T['id']> { readonly listingModes = ListingModes; @Input() @Required() tableHeaderLabel!: string; @Input() @Required() tableColumnConfigs!: readonly TableColumnConfig[]; @Input() hasEmptyColumn = false; @Input() selectionEnabled = false; @Input() listingMode: ListingMode = ListingModes.table; @Input() totalSize?: number; @Input() bulkActions?: TemplateRef; readonly quickFilters$ = this.filterService.getFilterModels$('quickFilters'); constructor( readonly entitiesService: EntitiesService, readonly listingService: ListingService, readonly filterService: FilterService, ) {} }