Merge branch 'master' into develop-0.11.0

This commit is contained in:
afc163 2015-11-27 17:28:46 +08:00
commit 5e8aa0cafd
9 changed files with 28 additions and 6 deletions

View File

@ -1,5 +1,6 @@
import React, { createElement } from 'react'; import React, { createElement } from 'react';
import assign from 'object-assign'; import assign from 'object-assign';
import { isCssAnimationSupported } from 'css-animation';
function getNumberArray(num) { function getNumberArray(num) {
return num ? return num ?
@ -98,7 +99,8 @@ class AntScrollNumber extends React.Component {
const props = assign({}, this.props, { const props = assign({}, this.props, {
className: `${this.props.prefixCls} ${this.props.className}` className: `${this.props.prefixCls} ${this.props.className}`
}); });
if (typeof document !== 'undefined' && typeof window !== 'undefined') { const isBrowser = (typeof document !== 'undefined' && typeof window !== 'undefined');
if (isBrowser && isCssAnimationSupported) {
return createElement( return createElement(
this.props.component, this.props.component,
props, props,

View File

@ -19,7 +19,7 @@ ReactDOM.render(<div>
<div> <div>
<RadioGroup onChange={onChange} defaultValue="a"> <RadioGroup onChange={onChange} defaultValue="a">
<RadioButton value="a">杭州</RadioButton> <RadioButton value="a">杭州</RadioButton>
<RadioButton value="b">上海</RadioButton> <RadioButton value="b" disabled>上海</RadioButton>
<RadioButton value="c">北京</RadioButton> <RadioButton value="c">北京</RadioButton>
<RadioButton value="d">成都</RadioButton> <RadioButton value="d">成都</RadioButton>
</RadioGroup> </RadioGroup>

View File

@ -42,7 +42,7 @@ export default React.createClass({
{...radio.props} {...radio.props}
onChange={this.onRadioChange} onChange={this.onRadioChange}
checked={this.state.value === radio.props.value} checked={this.state.value === radio.props.value}
disabled={this.props.disabled} disabled={radio.props.disabled || this.props.disabled}
/>; />;
} }
return radio; return radio;

View File

@ -102,3 +102,19 @@ var dataSource = new Table.DataSource({
| resolve | 获得数据的解析函数,接收参数为远程数据返回的 result | Function | | | | resolve | 获得数据的解析函数,接收参数为远程数据返回的 result | Function | | |
| getPagination | 和后台接口返回的分页数据进行适配的函数,返回值会传给表格中的分页器 | Function | | | | getPagination | 和后台接口返回的分页数据进行适配的函数,返回值会传给表格中的分页器 | Function | | |
| getParams | 和后台接口接收的参数进行适配,返回值会作为请求的参数发送 | Function | | 无 | | getParams | 和后台接口接收的参数进行适配,返回值会作为请求的参数发送 | Function | | 无 |
## 注意
按照 React 的[规范](http://facebook.github.io/react/docs/multiple-components.html#dynamic-children),所有的组件数组必须绑定 key。在 Table 中,默认将每列数据的 `key` 属性作为唯一的标识。
如果你的数据没有这个属性,务必使用 `rowKey` 来指定数据列的主键。若没有指定,控制台会出现以下的提示,表格组件也会出现各类奇怪的错误。
![](https://os.alipayobjects.com/rmsportal/luLdLvhPOiRpyss.png)
```jsx
const rowKey = function(record) {
return record.uid; // 比如你的数据主键是 uid
};
return <Table rowKey={rowKey} />;
```

View File

@ -116,7 +116,7 @@ Ant Design React 支持所有的现代浏览器和 IE8+。
<!-- 引入样式 --> <!-- 引入样式 -->
<link rel="stylesheet" href="/index.css"> <link rel="stylesheet" href="/index.css">
<!-- Polyfills --> <!-- Polyfills -->
<script src="https://as.alipayobjects.com/component/??console-polyfill/0.2.2/index.js,es5-shim/4.1.14/es5-shim.min.js,es5-shim/4.1.14/es5-sham.min.js,html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://as.alipayobjects.com/??component/console-polyfill/0.2.2/index.js,component/es5-shim/4.1.14/es5-shim.min.js,component/es5-shim/4.1.14/es5-sham.min.js,component/html5shiv/3.7.2/html5shiv.min.js,g/component/media-match/2.0.2/media.match.min.js"></script>
</head> </head>
<body> <body>
</body> </body>

View File

@ -1,6 +1,5 @@
window['css-animation'] = require('css-animation'); window['css-animation'] = require('css-animation');
window['react-router'] = require('react-router'); window['react-router'] = require('react-router');
window.Clipboard = require('clipboard');
window.Clip = require('./clip'); window.Clip = require('./clip');
var antd = require('../index'); var antd = require('../index');
var React = require('react'); var React = require('react');

View File

@ -509,6 +509,7 @@ footer ul li > a {
.markdown img { .markdown img {
vertical-align: middle; vertical-align: middle;
max-width: 100%;
} }
.markdown h1 { .markdown h1 {

View File

@ -18,7 +18,7 @@
<!--[if IE 8]> <!--[if IE 8]>
<script src="https://t.alipayobjects.com/images/rmsweb/T1q8JiXftaXXXXXXXX.js"></script> <script src="https://t.alipayobjects.com/images/rmsweb/T1q8JiXftaXXXXXXXX.js"></script>
<![endif]--> <![endif]-->
<script src="https://as.alipayobjects.com/component/??console-polyfill/0.2.2/index.js,es5-shim/4.1.14/es5-shim.min.js,es5-shim/4.1.14/es5-sham.min.js,html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://as.alipayobjects.com/??component/console-polyfill/0.2.2/index.js,component/es5-shim/4.1.14/es5-shim.min.js,component/es5-shim/4.1.14/es5-sham.min.js,component/html5shiv/3.7.2/html5shiv.min.js,g/component/media-match/2.0.2/media.match.min.js"></script>
<script src="https://a.alipayobjects.com/??bluebird/2.9.30/bluebird.js,jquery/jquery/1.11.1/jquery.js"></script> <script src="https://a.alipayobjects.com/??bluebird/2.9.30/bluebird.js,jquery/jquery/1.11.1/jquery.js"></script>
<script> <script>
(function() { (function() {

View File

@ -235,6 +235,10 @@
display: inline-block; display: inline-block;
text-align: center; text-align: center;
margin: 0 0 0 8px; margin: 0 0 0 8px;
&-disabled {
color: #ccc;
cursor: not-allowed;
}
} }
.@{calendar-prefix-cls}-clear-btn { .@{calendar-prefix-cls}-clear-btn {