|
@ -8,6 +8,7 @@ import Pagination from '../pagination'; |
|
|
import Icon from '../icon'; |
|
|
import Icon from '../icon'; |
|
|
import objectAssign from 'object-assign'; |
|
|
import objectAssign from 'object-assign'; |
|
|
import Spin from '../spin'; |
|
|
import Spin from '../spin'; |
|
|
|
|
|
import classNames from 'classnames'; |
|
|
|
|
|
|
|
|
function noop() { |
|
|
function noop() { |
|
|
} |
|
|
} |
|
@ -72,7 +73,7 @@ let AntTable = React.createClass({ |
|
|
useFixedHeader: false, |
|
|
useFixedHeader: false, |
|
|
rowSelection: null, |
|
|
rowSelection: null, |
|
|
className: '', |
|
|
className: '', |
|
|
size: 'default', |
|
|
size: 'large', |
|
|
loading: false, |
|
|
loading: false, |
|
|
bordered: false, |
|
|
bordered: false, |
|
|
onChange: noop, |
|
|
onChange: noop, |
|
@ -461,10 +462,10 @@ let AntTable = React.createClass({ |
|
|
if (!this.hasPagination()) { |
|
|
if (!this.hasPagination()) { |
|
|
return null; |
|
|
return null; |
|
|
} |
|
|
} |
|
|
let classString = 'ant-table-pagination'; |
|
|
let classString = classNames({ |
|
|
if (this.props.size === 'small') { |
|
|
'ant-table-pagination': true, |
|
|
classString += ' mini'; |
|
|
'mini': this.props.size === 'middle' || this.props.size === 'small', |
|
|
} |
|
|
}); |
|
|
let total = this.state.pagination.total; |
|
|
let total = this.state.pagination.total; |
|
|
if (!total && this.isLocalDataSource()) { |
|
|
if (!total && this.isLocalDataSource()) { |
|
|
total = this.getLocalData().length; |
|
|
total = this.getLocalData().length; |
|
@ -613,14 +614,14 @@ let AntTable = React.createClass({ |
|
|
render() { |
|
|
render() { |
|
|
let data = this.getCurrentPageData(); |
|
|
let data = this.getCurrentPageData(); |
|
|
let columns = this.renderRowSelection(); |
|
|
let columns = this.renderRowSelection(); |
|
|
let classString = this.props.className; |
|
|
|
|
|
let expandIconAsCell = this.props.expandedRowRender && this.props.expandIconAsCell !== false; |
|
|
let expandIconAsCell = this.props.expandedRowRender && this.props.expandIconAsCell !== false; |
|
|
if (this.props.size === 'small') { |
|
|
|
|
|
classString += ' ant-table-small'; |
|
|
let classString = classNames({ |
|
|
} |
|
|
[`ant-table-${this.props.size}`]: true, |
|
|
if (this.props.bordered) { |
|
|
'ant-table-bordered': this.props.bordered, |
|
|
classString += ' ant-table-bordered'; |
|
|
[this.props.className]: !!this.props.className, |
|
|
} |
|
|
}); |
|
|
|
|
|
|
|
|
columns = this.renderColumnsDropdown(columns); |
|
|
columns = this.renderColumnsDropdown(columns); |
|
|
columns = columns.map((column, i) => { |
|
|
columns = columns.map((column, i) => { |
|
|
column.key = column.dataIndex || i; |
|
|
column.key = column.dataIndex || i; |
|
|