Rollback #4869 for better loading animation, close #4934

This commit is contained in:
afc163 2017-02-18 14:58:47 +08:00
parent 8dc73f4601
commit bd6bc70302
6 changed files with 7621 additions and 7466 deletions

View File

@ -1147,6 +1147,10 @@ exports[`test renders ./components/locale-provider/demo/all.md correctly 1`] = `
class="example">
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-large ant-table-empty ant-table-scroll-position-left">
<div
@ -1198,6 +1202,8 @@ exports[`test renders ./components/locale-provider/demo/all.md correctly 1`] = `
</div>
</div>
</div>
</div>
</div>
`;
exports[`test renders ./components/locale-provider/demo/basic.md correctly 1`] = `

View File

@ -875,16 +875,15 @@ export default class Table<T> extends React.Component<TableProps<T>, any> {
const paginationPatchClass = (this.hasPagination() && data && data.length !== 0)
? `${prefixCls}-with-pagination` : `${prefixCls}-without-pagination`;
const tableWithSpin = loading ? (
<Spin className={loading ? `${paginationPatchClass} ${prefixCls}-spin-holder` : ''}>
return (
<div className={className} style={style}>
<Spin
spinning={loading}
className={loading ? `${paginationPatchClass} ${prefixCls}-spin-holder` : ''}
>
{table}
{this.renderPagination()}
</Spin>
) : [table, this.renderPagination()];
return (
<div className={className} style={style}>
{tableWithSpin}
</div>
);
}

View File

@ -15,6 +15,10 @@ exports[`Table.filter renders custom content correctly 1`] = `
exports[`Table.filter renders filter correctly 1`] = `
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-large ant-table-scroll-position-left">
<div
@ -93,6 +97,8 @@ exports[`Table.filter renders filter correctly 1`] = `
</div>
</div>
</div>
</div>
</div>
`;
exports[`Table.filter renders menu correctly 1`] = `

View File

@ -1,6 +1,10 @@
exports[`Table.pagination renders pagination correctly 1`] = `
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-large ant-table-scroll-position-left">
<div
@ -84,4 +88,6 @@ exports[`Table.pagination renders pagination correctly 1`] = `
</li>
</ul>
</div>
</div>
</div>
`;

View File

@ -1,6 +1,10 @@
exports[`Table renders JSX correctly 1`] = `
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-large ant-table-scroll-position-left">
<div
@ -96,4 +100,6 @@ exports[`Table renders JSX correctly 1`] = `
</div>
</div>
</div>
</div>
</div>
`;

View File

@ -1,6 +1,10 @@
exports[`test renders ./components/table/demo/ajax.md correctly 1`] = `
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-large ant-table-empty ant-table-scroll-position-left">
<div
@ -77,11 +81,17 @@ exports[`test renders ./components/table/demo/ajax.md correctly 1`] = `
</div>
</div>
</div>
</div>
</div>
`;
exports[`test renders ./components/table/demo/basic.md correctly 1`] = `
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-large ant-table-scroll-position-left">
<div
@ -294,11 +304,17 @@ exports[`test renders ./components/table/demo/basic.md correctly 1`] = `
</li>
</ul>
</div>
</div>
</div>
`;
exports[`test renders ./components/table/demo/bordered.md correctly 1`] = `
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-large ant-table-bordered ant-table-scroll-position-left">
<div
@ -440,11 +456,17 @@ exports[`test renders ./components/table/demo/bordered.md correctly 1`] = `
</li>
</ul>
</div>
</div>
</div>
`;
exports[`test renders ./components/table/demo/colspan-rowspan.md correctly 1`] = `
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-large ant-table-bordered ant-table-scroll-position-left">
<div
@ -651,11 +673,17 @@ exports[`test renders ./components/table/demo/colspan-rowspan.md correctly 1`] =
</li>
</ul>
</div>
</div>
</div>
`;
exports[`test renders ./components/table/demo/custom-filter-panel.md correctly 1`] = `
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-large ant-table-scroll-position-left">
<div
@ -801,6 +829,8 @@ exports[`test renders ./components/table/demo/custom-filter-panel.md correctly 1
</li>
</ul>
</div>
</div>
</div>
`;
exports[`test renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
@ -1079,6 +1109,10 @@ exports[`test renders ./components/table/demo/dynamic-settings.md correctly 1`]
</div>
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-default ant-table-scroll-position-left">
<div
@ -1821,6 +1855,8 @@ exports[`test renders ./components/table/demo/dynamic-settings.md correctly 1`]
</ul>
</div>
</div>
</div>
</div>
`;
exports[`test renders ./components/table/demo/edit-cell.md correctly 1`] = `
@ -1834,6 +1870,10 @@ exports[`test renders ./components/table/demo/edit-cell.md correctly 1`] = `
</button>
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-large ant-table-bordered ant-table-scroll-position-left">
<div
@ -1979,11 +2019,17 @@ exports[`test renders ./components/table/demo/edit-cell.md correctly 1`] = `
</ul>
</div>
</div>
</div>
</div>
`;
exports[`test renders ./components/table/demo/edit-row.md correctly 1`] = `
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-large ant-table-bordered ant-table-scroll-position-left">
<div
@ -2103,11 +2149,17 @@ exports[`test renders ./components/table/demo/edit-row.md correctly 1`] = `
</li>
</ul>
</div>
</div>
</div>
`;
exports[`test renders ./components/table/demo/expand.md correctly 1`] = `
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-large ant-table-scroll-position-left">
<div
@ -2272,11 +2324,17 @@ exports[`test renders ./components/table/demo/expand.md correctly 1`] = `
</li>
</ul>
</div>
</div>
</div>
`;
exports[`test renders ./components/table/demo/expand-children.md correctly 1`] = `
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-large ant-table-scroll-position-left">
<div
@ -2697,11 +2755,17 @@ exports[`test renders ./components/table/demo/expand-children.md correctly 1`] =
</li>
</ul>
</div>
</div>
</div>
`;
exports[`test renders ./components/table/demo/fixed-columns.md correctly 1`] = `
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-large ant-table-scroll-position-left">
<div
@ -3059,11 +3123,17 @@ exports[`test renders ./components/table/demo/fixed-columns.md correctly 1`] = `
</li>
</ul>
</div>
</div>
</div>
`;
exports[`test renders ./components/table/demo/fixed-columns-header.md correctly 1`] = `
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-large ant-table-fixed-header ant-table-scroll-position-left">
<div
@ -4138,11 +4208,17 @@ exports[`test renders ./components/table/demo/fixed-columns-header.md correctly
</li>
</ul>
</div>
</div>
</div>
`;
exports[`test renders ./components/table/demo/fixed-header.md correctly 1`] = `
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-large ant-table-fixed-header ant-table-scroll-position-left">
<div
@ -5136,11 +5212,17 @@ exports[`test renders ./components/table/demo/fixed-header.md correctly 1`] = `
</li>
</ul>
</div>
</div>
</div>
`;
exports[`test renders ./components/table/demo/grouping-columns.md correctly 1`] = `
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-middle ant-table-bordered ant-table-fixed-header ant-table-scroll-position-left">
<div
@ -6020,11 +6102,17 @@ exports[`test renders ./components/table/demo/grouping-columns.md correctly 1`]
</li>
</ul>
</div>
</div>
</div>
`;
exports[`test renders ./components/table/demo/head.md correctly 1`] = `
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-large ant-table-scroll-position-left">
<div
@ -6218,11 +6306,17 @@ exports[`test renders ./components/table/demo/head.md correctly 1`] = `
</li>
</ul>
</div>
</div>
</div>
`;
exports[`test renders ./components/table/demo/jsx.md correctly 1`] = `
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-large ant-table-scroll-position-left">
<div
@ -6457,11 +6551,17 @@ exports[`test renders ./components/table/demo/jsx.md correctly 1`] = `
</li>
</ul>
</div>
</div>
</div>
`;
exports[`test renders ./components/table/demo/nested-table.md correctly 1`] = `
<div
class="components-table-demo-nested">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-large ant-table-scroll-position-left">
<div
@ -6683,6 +6783,8 @@ exports[`test renders ./components/table/demo/nested-table.md correctly 1`] = `
</li>
</ul>
</div>
</div>
</div>
`;
exports[`test renders ./components/table/demo/reset-filter.md correctly 1`] = `
@ -6713,6 +6815,10 @@ exports[`test renders ./components/table/demo/reset-filter.md correctly 1`] = `
</div>
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-large ant-table-scroll-position-left">
<div
@ -6907,11 +7013,17 @@ exports[`test renders ./components/table/demo/reset-filter.md correctly 1`] = `
</ul>
</div>
</div>
</div>
</div>
`;
exports[`test renders ./components/table/demo/row-selection.md correctly 1`] = `
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-large ant-table-scroll-position-left">
<div
@ -7148,6 +7260,8 @@ exports[`test renders ./components/table/demo/row-selection.md correctly 1`] = `
</li>
</ul>
</div>
</div>
</div>
`;
exports[`test renders ./components/table/demo/row-selection-and-operation.md correctly 1`] = `
@ -7167,6 +7281,10 @@ exports[`test renders ./components/table/demo/row-selection-and-operation.md cor
</div>
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-large ant-table-scroll-position-left">
<div
@ -7623,6 +7741,8 @@ exports[`test renders ./components/table/demo/row-selection-and-operation.md cor
</ul>
</div>
</div>
</div>
</div>
`;
exports[`test renders ./components/table/demo/size.md correctly 1`] = `
@ -7632,6 +7752,10 @@ exports[`test renders ./components/table/demo/size.md correctly 1`] = `
</h4>
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-middle ant-table-scroll-position-left">
<div
@ -7756,11 +7880,17 @@ exports[`test renders ./components/table/demo/size.md correctly 1`] = `
</li>
</ul>
</div>
</div>
</div>
<h4>
Small size table
</h4>
<div
class="">
<div
class="ant-spin-nested-loading">
<div
class="ant-spin-container">
<div
class="ant-table ant-table-small ant-table-scroll-position-left">
<div
@ -7886,4 +8016,6 @@ exports[`test renders ./components/table/demo/size.md correctly 1`] = `
</ul>
</div>
</div>
</div>
</div>
`;