Merge remote-tracking branch 'upstream/develop-1.0.0' into develop-1.0.0

This commit is contained in:
qubaoming 2016-04-15 14:22:12 +08:00
commit bf1ee0b1c8
6 changed files with 14 additions and 14 deletions

View File

@ -9,7 +9,7 @@ title: 自动切换
import { Carousel } from 'antd';
ReactDOM.render(
<Carousel autoplay="true">
<Carousel autoplay>
<div><h3>1</h3></div>
<div><h3>2</h3></div>
<div><h3>3</h3></div>
@ -17,4 +17,3 @@ ReactDOM.render(
</Carousel>
, mountNode);
````

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

@ -20,17 +20,15 @@ english: TreeSelect
| value | 指定当前选中的条目 | 通常: String/Array<String>. 设置labelInValue: {value:String,label:React.Node}/Array<{value,label}>. 设置treeCheckStrictly(halfChecked默认为false): {value:String,label:React.Node, halfChecked}/Array<{value,label,halfChecked}>. | 无 |
| labelInValue | 是否把 label 嵌入到 value 里,设置后参考以上 value 类型写法 | boolean | false |
| defaultValue | 指定默认选中的条目 | string/Array<String> | 无 |
| multiple | 支持多选 | boolean | false |
| tags | 可以把随意输入的条目作为 tag输入项不需要与下拉选项匹配 | boolean |false |
| multiple | 支持多选(当设置 treeCheckable 时自动变为true | boolean | false |
| onSelect | 被选中时调用,参数为选中项的 value 值 | function(value, node, extra) | 无 |
| onChange | 选中树节点或input的value变化(combobox 模式下)时,调用此函数 | function(value, label, extra) | 无 |
| onChange | 选中树节点或input的value变化时调用此函数 | function(value, label, extra) | 无 |
| allowClear | 显示清除按钮 | boolean | false |
| onSearch | 文本框值变化时回调 | function(value: String) | |
| placeholder | 选择框默认文字 | string | 无 |
| searchPlaceholder | 搜索框默认文字 | string | 无 |
| dropdownStyle | 下拉菜单的样式 | object | 无 |
| dropdownMatchSelectWidth | 下拉菜单和选择器同宽 | boolean | true |
| combobox | 输入框自动提示模式 | boolean | false |
| size | 选择框大小,可选 `large` `small` | String | default |
| showSearch | 在下拉中显示搜索框 | boolean | false |
| disabled | 是否禁用 | boolean | false |

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;