import { Component , EventEmitter , Input , Output } from '@angular/core' ; import { Column } from '../../table.types' ; @ Component ( { selector : 'table-column-toggle' , templateUrl : './table-column-toggle.component.html' , styleUrls : [ './table-column-toggle.component.scss' ] } ) export class TableColumnToggleComponent { /**
     * Column definitions from the table.
     */ @ Input ( ) public columns : Array < Column > = [ ] ; /**
     * Visibility change emitter.
     */ @ Output ( ) public columnVisibilityChange : EventEmitter < Column > = new EventEmitter < Column > ( ) ; /**
     * Visibility change emitter.
     */ @ Output ( ) public columnsReset : EventEmitter < void > = new EventEmitter < void > ( ) ; param c param event public toggleColumn ( c , event ) { event . stopPropagation ( ) ; c . hidden = ! c . hidden ; this . columnVisibilityChange . emit ( c ) ; return c ; } }