diff --git a/CHANGELOG.md b/CHANGELOG.md index e1ced0ceebf..a3250c99951 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## [`master`](https://github.com/elastic/eui/tree/master) - Improved a11y of `EuiNavDrawer` lock button state via `aria-pressed` ([#2643](https://github.com/elastic/eui/pull/2643)) +- Added exports for available types related to `EuiDataGrid` ([#2640](https://github.com/elastic/eui/pull/2640)) **Bug fixes** diff --git a/src/components/datagrid/data_grid.tsx b/src/components/datagrid/data_grid.tsx index de3cb1e2550..6ea248d0492 100644 --- a/src/components/datagrid/data_grid.tsx +++ b/src/components/datagrid/data_grid.tsx @@ -110,7 +110,7 @@ type CommonGridProps = CommonProps & // This structure forces either aria-label or aria-labelledby to be defined // making some type of label a requirement -type EuiDataGridProps = Omit< +export type EuiDataGridProps = Omit< CommonGridProps, 'aria-label' | 'aria-labelledby' > & diff --git a/src/components/datagrid/data_grid_body.tsx b/src/components/datagrid/data_grid_body.tsx index 846377a2ce9..7194d2e7df1 100644 --- a/src/components/datagrid/data_grid_body.tsx +++ b/src/components/datagrid/data_grid_body.tsx @@ -21,7 +21,7 @@ import { EuiDataGridSchemaDetector, } from './data_grid_schema'; -interface EuiDataGridBodyProps { +export interface EuiDataGridBodyProps { columnWidths: EuiDataGridColumnWidths; defaultColumnWidth?: number | null; columns: EuiDataGridColumn[]; diff --git a/src/components/datagrid/data_grid_cell.tsx b/src/components/datagrid/data_grid_cell.tsx index c5d6e31fcce..8adfc58b6eb 100644 --- a/src/components/datagrid/data_grid_cell.tsx +++ b/src/components/datagrid/data_grid_cell.tsx @@ -73,7 +73,7 @@ interface EuiDataGridCellState { popoverIsOpen: boolean; } -type EuiDataGridCellValueProps = Omit< +export type EuiDataGridCellValueProps = Omit< EuiDataGridCellProps, 'width' | 'isFocused' | 'interactiveCellId' | 'onCellFocus' | 'popoverContent' >; diff --git a/src/components/datagrid/data_grid_column_resizer.tsx b/src/components/datagrid/data_grid_column_resizer.tsx index a52441107bb..7003755cbea 100644 --- a/src/components/datagrid/data_grid_column_resizer.tsx +++ b/src/components/datagrid/data_grid_column_resizer.tsx @@ -2,7 +2,7 @@ import React, { Component } from 'react'; const MINIMUM_COLUMN_WIDTH = 40; -interface EuiDataGridColumnResizerProps { +export interface EuiDataGridColumnResizerProps { columnId: string; columnWidth: number; setColumnWidth: (columnId: string, width: number) => void; diff --git a/src/components/datagrid/data_grid_header_row.tsx b/src/components/datagrid/data_grid_header_row.tsx index 9e276fce7f4..6f22c19821f 100644 --- a/src/components/datagrid/data_grid_header_row.tsx +++ b/src/components/datagrid/data_grid_header_row.tsx @@ -34,11 +34,11 @@ interface EuiDataGridHeaderRowPropsSpecificProps { headerIsInteractive: boolean; } -type EuiDataGridHeaderRowProps = CommonProps & +export type EuiDataGridHeaderRowProps = CommonProps & HTMLAttributes & EuiDataGridHeaderRowPropsSpecificProps; -interface EuiDataGridHeaderCellProps +export interface EuiDataGridHeaderCellProps extends Omit { column: EuiDataGridColumn; index: number; diff --git a/src/components/datagrid/data_grid_inmemory_renderer.tsx b/src/components/datagrid/data_grid_inmemory_renderer.tsx index 59b7fef7029..9ba8b318124 100644 --- a/src/components/datagrid/data_grid_inmemory_renderer.tsx +++ b/src/components/datagrid/data_grid_inmemory_renderer.tsx @@ -14,7 +14,7 @@ import { import { EuiDataGridColumn, EuiDataGridInMemory } from './data_grid_types'; import { enqueueStateChange } from '../../services/react'; -interface EuiDataGridInMemoryRendererProps { +export interface EuiDataGridInMemoryRendererProps { inMemory: EuiDataGridInMemory; columns: EuiDataGridColumn[]; rowCount: number; diff --git a/src/components/datagrid/data_grid_schema.tsx b/src/components/datagrid/data_grid_schema.tsx index 254b3390bdd..6976074d215 100644 --- a/src/components/datagrid/data_grid_schema.tsx +++ b/src/components/datagrid/data_grid_schema.tsx @@ -241,7 +241,7 @@ export interface EuiDataGridSchema { [columnId: string]: { columnType: string | null }; } -interface SchemaTypeScore { +export interface SchemaTypeScore { type: string; score: number; } diff --git a/src/components/datagrid/index.ts b/src/components/datagrid/index.ts index 7da013fa837..338564da16f 100644 --- a/src/components/datagrid/index.ts +++ b/src/components/datagrid/index.ts @@ -1 +1,26 @@ -export { EuiDataGrid } from './data_grid'; +export { + EuiDataGridColumnSortingDraggableProps, +} from './column_sorting_draggable'; +export { EuiDataGrid, EuiDataGridProps } from './data_grid'; +export { EuiDataGridBodyProps } from './data_grid_body'; +export { + EuiDataGridCellProps, + EuiDataGridCellValueProps, + EuiDataGridCellValueElementProps, +} from './data_grid_cell'; +export { EuiDataGridColumnResizerProps } from './data_grid_column_resizer'; +export { EuiDataGridDataRowProps } from './data_grid_data_row'; +export { + EuiDataGridHeaderCellProps, + EuiDataGridHeaderRowProps, +} from './data_grid_header_row'; +export { + EuiDataGridInMemoryRendererProps, +} from './data_grid_inmemory_renderer'; +export { + EuiDataGridSchema, + EuiDataGridSchemaDetector, + SchemaTypeScore, +} from './data_grid_schema'; + +export * from './data_grid_types';