Merge branch 'wizawu-develop-1.0.0' into develop-1.0.0

This commit is contained in:
afc163 2016-04-15 11:53:11 +08:00
commit c8df93466b
4 changed files with 11 additions and 8 deletions

View File

@ -27,7 +27,7 @@ const Card = React.createClass({
);
return (
<div>
<Spin spining={this.state.loading}>{container}</Spin>
<Spin spinning={this.state.loading}>{container}</Spin>
切换加载状态:<Switch checked={this.state.loading} onChange={this.toggle} />
</div>
);

View File

@ -2,11 +2,12 @@ import React from 'react';
import { findDOMNode } from 'react-dom';
import classNames from 'classnames';
import { isCssAnimationSupported } from 'css-animation';
import warning from 'warning';
export default class Spin extends React.Component {
static defaultProps = {
prefixCls: 'ant-spin',
spining: true,
spinning: true,
}
static propTypes = {
@ -19,6 +20,7 @@ export default class Spin extends React.Component {
}
componentDidMount() {
warning(!('spining' in this.props), '`spining` property of Popover is a spell mistake, use `spinning` instead.');
if (!isCssAnimationSupported) {
// Show text in IE8/9
findDOMNode(this).className += ` ${this.props.prefixCls}-show-text`;
@ -26,14 +28,15 @@ export default class Spin extends React.Component {
}
render() {
const { className, size, prefixCls, tip } = this.props;
const { className, size, prefixCls, tip, spining = true } = this.props;
const spinning = this.props.spinning && spining; // Backwards support
let spinClassName = classNames({
const spinClassName = classNames({
[prefixCls]: true,
[`${prefixCls}-sm`]: size === 'small',
[`${prefixCls}-lg`]: size === 'large',
[className]: !!className,
[`${prefixCls}-spining`]: this.props.spining,
[`${prefixCls}-spinning`]: spinning,
[`${prefixCls}-show-text`]: !!this.props.tip,
});
@ -48,7 +51,7 @@ export default class Spin extends React.Component {
if (this.isNestedPattern()) {
return (
<div className={this.props.spining ? (`${prefixCls}-nested-loading`) : ''}>
<div className={spinning ? (`${prefixCls}-nested-loading`) : ''}>
{spinElement}
<div className={`${prefixCls}-container`}>
{this.props.children}

View File

@ -18,5 +18,5 @@ english: Spin
| 参数 | 类型 | 默认值 | 说明 |
|------------|----------------|-------------|--------------|
| size | enum | default | spin组件中点的大小可选值为 small default large |
| spining | boolean | true | 用于内嵌其他组件的模式,可以关闭 loading 效果 |
| spinning | boolean | true | 用于内嵌其他组件的模式,可以关闭 loading 效果 |
| tip | string | 无 | 自定义描述文案 |

View File

@ -18,7 +18,7 @@
transition: opacity 0.3s @ease-in-out-circ;
font-size: @font-size-base;
&-spining {
&-spinning {
opacity: 1;
position: static;
visibility: visible;