()
| 141 | } |
| 142 | |
| 143 | render() { |
| 144 | const { |
| 145 | columns, |
| 146 | children, |
| 147 | selectable, |
| 148 | selectionColumnProps, |
| 149 | ...rest |
| 150 | } = this.props |
| 151 | const { selectedRowKeys } = this.state |
| 152 | |
| 153 | // you'd better memoize this operation |
| 154 | let _columns = columns || normalizeColumns(children) |
| 155 | if (selectable) { |
| 156 | const selectionColumn = { |
| 157 | width: 40, |
| 158 | flexShrink: 0, |
| 159 | resizable: false, |
| 160 | frozen: Column.FrozenDirection.LEFT, |
| 161 | cellRenderer: SelectionCell, |
| 162 | ...selectionColumnProps, |
| 163 | key: '__selection__', |
| 164 | rowKey: this.props.rowKey, |
| 165 | selectedRowKeys: selectedRowKeys, |
| 166 | onChange: this._handleSelectChange, |
| 167 | } |
| 168 | _columns = [selectionColumn, ..._columns] |
| 169 | } |
| 170 | |
| 171 | return ( |
| 172 | <StyledTable |
| 173 | {...rest} |
| 174 | columns={_columns} |
| 175 | rowClassName={this._rowClassName} |
| 176 | /> |
| 177 | ) |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | SelectableTable.defaultProps = { |
nothing calls this directly
no test coverage detected