import { TableHeader } from './table_header/table_header' ; import { getServices } from '../../../../opensearch_dashboards_services' ; import { SORT_DEFAULT_ORDER_SETTING , DOC_HIDE_TIME_COLUMN_SETTING } from '../../../../../common' ; import { UI_SETTINGS } from '../../../../../../data/public' ; export function createTableHeaderDirective ( reactDirective ) { const { uiSettings : config } = getServices ( ) ; return reactDirective ( TableHeader , [ [ 'columns' , { watchDepth : 'collection' } ] , [ 'hideTimeColumn' , { watchDepth : 'value' } ] , [ 'indexPattern' , { watchDepth : 'reference' } ] , [ 'isShortDots' , { watchDepth : 'value' } ] , [ 'onChangeSortOrder' , { watchDepth : 'reference' } ] , [ 'onMoveColumn' , { watchDepth : 'reference' } ] , [ 'onRemoveColumn' , { watchDepth : 'reference' } ] , [ 'sortOrder' , { watchDepth : 'collection' } ] , ] , { restrict : 'A' } , { hideTimeColumn : config . get ( DOC_HIDE_TIME_COLUMN_SETTING , false ) , isShortDots : config . get ( UI_SETTINGS . SHORT_DOTS_ENABLE ) , defaultSortOrder : config . get ( SORT_DEFAULT_ORDER_SETTING , 'desc' ) , } ) ; }