()
| 5 | class TableFooter extends Component { |
| 6 | |
| 7 | render() { |
| 8 | const { hideSelectColumn, expandColumnVisible } = this.props; |
| 9 | const containerClasses = classSet('react-bs-container-footer', 'table-footer-wrapper'); |
| 10 | const tableClasses = classSet('table', 'table-hover', { |
| 11 | 'table-bordered': this.props.bordered, |
| 12 | 'table-condensed': this.props.condensed |
| 13 | }, this.props.tableFooterClass); |
| 14 | return ( |
| 15 | <div |
| 16 | ref={ node => this.container = node } |
| 17 | className={ containerClasses } |
| 18 | style={ this.props.style } > |
| 19 | { |
| 20 | this.props.children.map((footerItem, footerItemIndex) => { |
| 21 | return ( |
| 22 | <span key={ footerItemIndex }> |
| 23 | <table className={ tableClasses }> |
| 24 | { React.cloneElement(this.props.colGroups) } |
| 25 | <tfoot> |
| 26 | <tr ref={ node => this.footer = node }> |
| 27 | { hideSelectColumn ? null : this.renderSelectionOrExpandCol() } |
| 28 | { !expandColumnVisible ? null : this.renderSelectionOrExpandCol() } |
| 29 | { |
| 30 | this.props.columns.map((columnItem, colIndex) => { |
| 31 | if ( !columnItem.hidden ) { |
| 32 | const footerObj = footerItem.filter((item) => { |
| 33 | return item.columnIndex === colIndex; |
| 34 | }); |
| 35 | let footerData; |
| 36 | let thAlignment = 'left'; |
| 37 | if (footerObj.length) { |
| 38 | thAlignment = footerObj[0].align; |
| 39 | if (footerObj[0].formatter) { |
| 40 | footerData = footerObj[0].formatter( |
| 41 | this.props.footerFormatterReturnData |
| 42 | ); |
| 43 | } else { |
| 44 | footerData = footerObj[0].label; |
| 45 | } |
| 46 | } else { |
| 47 | footerData = ''; |
| 48 | } |
| 49 | return ( |
| 50 | <th |
| 51 | key={ colIndex } |
| 52 | style={ { |
| 53 | minWidth: `${this.props.columns[colIndex].width}px`, |
| 54 | textAlign: thAlignment |
| 55 | } }> |
| 56 | { |
| 57 | footerData |
| 58 | } |
| 59 | </th> |
| 60 | ); |
| 61 | } |
| 62 | }) |
| 63 | } |
| 64 | </tr> |
nothing calls this directly
no test coverage detected