Browse Source

Merge branch 'master' into develop-0.11.0

pull/618/merge
afc163 9 years ago
parent
commit
5e8aa0cafd
  1. 4
      components/badge/ScrollNumber.jsx
  2. 2
      components/radio/demo/radiobutton.md
  3. 2
      components/radio/group.jsx
  4. 16
      components/table/index.md
  5. 2
      docs/getting-started.md
  6. 1
      scripts/demo.js
  7. 1
      site/static/style.css
  8. 2
      site/templates/layout.html
  9. 4
      style/components/datepicker/Calendar.less

4
components/badge/ScrollNumber.jsx

@ -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,

2
components/radio/demo/radiobutton.md

@ -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>

2
components/radio/group.jsx

@ -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;

16
components/table/index.md

@ -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} />;
```

2
docs/getting-started.md

@ -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>

1
scripts/demo.js

@ -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');

1
site/static/style.css

@ -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 {

2
site/templates/layout.html

@ -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() {

4
style/components/datepicker/Calendar.less

@ -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 {

Loading…
Cancel
Save