@@ -26,6 +26,8 @@ import {
2626 RIGHT_ALIGNMENT ,
2727 SortDirection ,
2828 RenderWithEuiTheme ,
29+ OverrideCopiedTabularContent ,
30+ tabularCopyMarkers ,
2931} from '../../services' ;
3032import { CommonProps } from '../common' ;
3133import { isFunction } from '../../services/predicate' ;
@@ -547,18 +549,20 @@ export class EuiBasicTable<T extends object = any> extends Component<
547549 { this . renderSelectAll ( true ) }
548550 { this . renderTableMobileSort ( ) }
549551 </ EuiTableHeaderMobile >
550- < EuiTable
551- id = { this . tableId }
552- tableLayout = { tableLayout }
553- responsiveBreakpoint = { responsiveBreakpoint }
554- compressed = { compressed }
555- css = { loading && safariLoadingWorkaround }
556- >
557- { this . renderTableCaption ( ) }
558- { this . renderTableHead ( ) }
559- { this . renderTableBody ( ) }
560- { this . renderTableFooter ( ) }
561- </ EuiTable >
552+ < OverrideCopiedTabularContent >
553+ < EuiTable
554+ id = { this . tableId }
555+ tableLayout = { tableLayout }
556+ responsiveBreakpoint = { responsiveBreakpoint }
557+ compressed = { compressed }
558+ css = { loading && safariLoadingWorkaround }
559+ >
560+ { this . renderTableCaption ( ) }
561+ { this . renderTableHead ( ) }
562+ { this . renderTableBody ( ) }
563+ { this . renderTableFooter ( ) }
564+ </ EuiTable >
565+ </ OverrideCopiedTabularContent >
562566 </ >
563567 ) ;
564568 }
@@ -664,7 +668,9 @@ export class EuiBasicTable<T extends object = any> extends Component<
664668 return (
665669 < EuiScreenReaderOnly >
666670 < caption css = { euiTableCaptionStyles } className = "euiTableCaption" >
671+ { tabularCopyMarkers . ariaHiddenNoCopyBoundary }
667672 < EuiDelayRender > { captionElement } </ EuiDelayRender >
673+ { tabularCopyMarkers . ariaHiddenNoCopyBoundary }
668674 </ caption >
669675 </ EuiScreenReaderOnly >
670676 ) ;
@@ -733,7 +739,10 @@ export class EuiBasicTable<T extends object = any> extends Component<
733739
734740 if ( selection ) {
735741 headers . push (
736- < EuiTableHeaderCellCheckbox key = "_selection_column_h" >
742+ < EuiTableHeaderCellCheckbox
743+ key = "_selection_column_h"
744+ append = { this . renderCopyChar ( - 1 ) }
745+ >
737746 { this . renderSelectAll ( false ) }
738747 </ EuiTableHeaderCellCheckbox >
739748 ) ;
@@ -754,15 +763,21 @@ export class EuiBasicTable<T extends object = any> extends Component<
754763
755764 const columnAlign = align || this . getAlignForDataType ( dataType ) ;
756765
766+ const sharedProps = {
767+ width,
768+ description,
769+ mobileOptions,
770+ align : columnAlign ,
771+ append : this . renderCopyChar ( index ) ,
772+ } ;
773+
757774 // actions column
758775 if ( ( column as EuiTableActionsColumnType < T > ) . actions ) {
759776 headers . push (
760777 < EuiTableHeaderCell
778+ { ...sharedProps }
761779 key = { `_actions_h_${ index } ` }
762780 align = "right"
763- width = { width }
764- description = { description }
765- mobileOptions = { mobileOptions }
766781 >
767782 { name }
768783 </ EuiTableHeaderCell >
@@ -785,14 +800,11 @@ export class EuiBasicTable<T extends object = any> extends Component<
785800 }
786801 headers . push (
787802 < EuiTableHeaderCell
803+ { ...sharedProps }
788804 key = { `_computed_column_h_${ index } ` }
789- align = { columnAlign }
790- width = { width }
791- mobileOptions = { mobileOptions }
792805 data-test-subj = { `tableHeaderCell_${
793806 typeof name === 'string' ? name : ''
794807 } _${ index } `}
795- description = { description }
796808 { ...sorting }
797809 >
798810 { name }
@@ -829,12 +841,9 @@ export class EuiBasicTable<T extends object = any> extends Component<
829841 }
830842 headers . push (
831843 < EuiTableHeaderCell
844+ { ...sharedProps }
832845 key = { `_data_h_${ String ( field ) } _${ index } ` }
833- align = { columnAlign }
834- width = { width }
835- mobileOptions = { mobileOptions }
836846 data-test-subj = { `tableHeaderCell_${ String ( field ) } _${ index } ` }
837- description = { description }
838847 { ...sorting }
839848 >
840849 { name }
@@ -1056,7 +1065,11 @@ export class EuiBasicTable<T extends object = any> extends Component<
10561065 isExpandedRow = { true }
10571066 hasSelection = { ! ! selection }
10581067 >
1059- < EuiTableRowCell colSpan = { expandedRowColSpan } textOnly = { false } >
1068+ < EuiTableRowCell
1069+ colSpan = { expandedRowColSpan }
1070+ textOnly = { false }
1071+ append = { tabularCopyMarkers . hiddenNewline }
1072+ >
10601073 { itemIdToExpandedRowMap ! [ itemId ] }
10611074 </ EuiTableRowCell >
10621075 </ EuiTableRow >
@@ -1115,7 +1128,7 @@ export class EuiBasicTable<T extends object = any> extends Component<
11151128 }
11161129 } ;
11171130 return [
1118- < EuiTableRowCellCheckbox key = { key } >
1131+ < EuiTableRowCellCheckbox key = { key } append = { this . renderCopyChar ( - 1 ) } >
11191132 < EuiI18n
11201133 token = "euiBasicTable.selectThisRow"
11211134 default = "Select row {index}"
@@ -1196,6 +1209,7 @@ export class EuiBasicTable<T extends object = any> extends Component<
11961209 align = "right"
11971210 textOnly = { false }
11981211 hasActions = { hasCustomActions ? 'custom' : true }
1212+ append = { this . renderCopyChar ( columnIndex ) }
11991213 >
12001214 < ExpandedItemActions
12011215 actions = { actualActions }
@@ -1221,7 +1235,14 @@ export class EuiBasicTable<T extends object = any> extends Component<
12211235 const value = get ( item , field as string ) ;
12221236 const content = contentRenderer ( value , item ) ;
12231237
1224- return this . renderItemCell ( item , column , key , content , setScopeRow ) ;
1238+ return this . renderItemCell (
1239+ item ,
1240+ column ,
1241+ columnIndex ,
1242+ key ,
1243+ content ,
1244+ setScopeRow
1245+ ) ;
12251246 }
12261247
12271248 renderItemComputedCell (
@@ -1236,12 +1257,13 @@ export class EuiBasicTable<T extends object = any> extends Component<
12361257 const contentRenderer = render || this . getRendererForDataType ( ) ;
12371258 const content = contentRenderer ( item ) ;
12381259
1239- return this . renderItemCell ( item , column , key , content , false ) ;
1260+ return this . renderItemCell ( item , column , columnIndex , key , content , false ) ;
12401261 }
12411262
12421263 renderItemCell (
12431264 item : T ,
12441265 column : EuiBasicTableColumn < T > ,
1266+ columnIndex : number ,
12451267 key : string | number ,
12461268 content : ReactNode ,
12471269 setScopeRow : boolean
@@ -1277,19 +1299,26 @@ export class EuiBasicTable<T extends object = any> extends Component<
12771299 setScopeRow = { setScopeRow }
12781300 mobileOptions = { {
12791301 ...mobileOptions ,
1280- render :
1281- mobileOptions && mobileOptions . render && mobileOptions . render ( item ) ,
1282- header :
1283- mobileOptions && mobileOptions . header === false ? false : name ,
1302+ render : mobileOptions ?. render ?.( item ) ,
1303+ header : mobileOptions ?. header ?? name ,
12841304 } }
12851305 { ...cellProps }
12861306 { ...rest }
1307+ append = { this . renderCopyChar ( columnIndex ) }
12871308 >
12881309 { content }
12891310 </ EuiTableRowCell >
12901311 ) ;
12911312 }
12921313
1314+ renderCopyChar = ( columnIndex : number ) => {
1315+ const isLastColumn = columnIndex === this . props . columns . length - 1 ;
1316+
1317+ return isLastColumn
1318+ ? tabularCopyMarkers . hiddenNewline
1319+ : tabularCopyMarkers . hiddenTab ;
1320+ } ;
1321+
12931322 resolveColumnSortDirection = ( column : EuiBasicTableColumn < T > ) => {
12941323 const { sorting } = this . props ;
12951324 const { sortable, field, name } = column as EuiTableFieldDataColumnType < T > ;
0 commit comments