|
|
@ -5,6 +5,7 @@ import Checkbox from '../checkbox'; |
|
|
|
import FilterDropdown from './filterDropdown'; |
|
|
|
import Pagination from '../pagination'; |
|
|
|
import objectAssign from 'object-assign'; |
|
|
|
import Spin from '../spin'; |
|
|
|
|
|
|
|
function noop() { |
|
|
|
} |
|
|
@ -468,9 +469,6 @@ let AntTable = React.createClass({ |
|
|
|
let columns = this.renderRowSelection(); |
|
|
|
let classString = ''; |
|
|
|
let expandIconAsCell = this.props.expandedRowRender && this.props.expandIconAsCell !== false; |
|
|
|
if (this.state.loading && !this.isLocalDataSource()) { |
|
|
|
classString += ' ant-table-loading'; |
|
|
|
} |
|
|
|
if (this.props.size === 'small') { |
|
|
|
classString += ' ant-table-small'; |
|
|
|
} |
|
|
@ -490,7 +488,23 @@ let AntTable = React.createClass({ |
|
|
|
</div>; |
|
|
|
emptyClass = ' ant-table-empty'; |
|
|
|
} |
|
|
|
return <div className={'clearfix' + emptyClass}> |
|
|
|
// spin holder |
|
|
|
let spinEl; |
|
|
|
let spinWrapperClass = ''; |
|
|
|
if (this.state.loading && !this.isLocalDataSource()) { |
|
|
|
// if there is no pagination or no data, the height of spin should decrease by half of pagination |
|
|
|
let paginationPatchClass = (this.hasPagination() && data && data.length !== 0) |
|
|
|
? 'ant-table-with-pagination' |
|
|
|
: 'ant-table-without-pagination'; |
|
|
|
let spinClass = `${paginationPatchClass} ant-table-spin-holder`; |
|
|
|
|
|
|
|
spinEl = <div className={spinClass}> |
|
|
|
<Spin size="md" type="primary"/> |
|
|
|
</div>; |
|
|
|
|
|
|
|
spinWrapperClass = ' ant-table-loading'; |
|
|
|
} |
|
|
|
return <div className={'clearfix' + emptyClass + spinWrapperClass}> |
|
|
|
<Table |
|
|
|
{...this.props} |
|
|
|
data={data} |
|
|
@ -499,6 +513,7 @@ let AntTable = React.createClass({ |
|
|
|
expandIconAsCell={expandIconAsCell} |
|
|
|
/> |
|
|
|
{emptyText} |
|
|
|
{spinEl} |
|
|
|
{this.renderPagination()} |
|
|
|
</div>; |
|
|
|
} |
|
|
|