Merge branch 'master' of github.com:ant-design/ant-design

This commit is contained in:
yiminghe 2015-07-21 19:12:27 +08:00
commit aacf593c24
16 changed files with 56 additions and 6275 deletions

View File

View File

@ -53,7 +53,7 @@ $ npm start
然后访问 http://127.0.0.1:8000 。
#### 部署到 ant.design
#### [网站](http://ant.design)部署
```bash
$ npm run deploy

View File

@ -75,11 +75,11 @@ React.render(
<div className="ant-form-item ant-form-item-compact">
<label className="col-6">ant-radio</label>
<div className="col-18">
<RadioGroup>
<Radio value="a" value={true}>A</Radio>
<Radio value="b" >B</Radio>
<Radio value="c" >C</Radio>
<Radio value="d">D</Radio>
<RadioGroup value={"b"}>
<Radio value="a">A</Radio>
<Radio value="b">B</Radio>
<Radio value="c">C</Radio>
<Radio value="d">D</Radio>
</RadioGroup>
</div>
</div>

View File

@ -34,8 +34,8 @@ React.render(
<div className="ant-form-item ant-form-item-compact">
<label className="col-6" required>您的性别:</label>
<div className="col-14">
<RadioGroup>
<Radio value="male" checked={true}>男的</Radio>
<RadioGroup value="male">
<Radio value="male">男的</Radio>
<Radio value="female">女的</Radio>
</RadioGroup>
</div>

View File

@ -19,7 +19,7 @@ React.render(
<label for="password">密码:</label>
<input className="ant-input" type="password" id="password" placeholder="请输入密码" />
</div>
<div className="ant-checkbox-inline">
<div className="ant-form-item">
<label className="ant-checkbox-inline">
<Checkbox /> 记住我
</label>

View File

@ -9,5 +9,6 @@
````jsx
var Radio = antd.Radio;
React.render(<Radio >Radio</Radio>, document.getElementById('components-radio-demo-basic'));
React.render(<Radio>Radio</Radio>
, document.getElementById('components-radio-demo-basic'));
````

View File

@ -13,24 +13,24 @@ var RadioGroup = antd.RadioGroup;
var App = React.createClass({
getInitialState: function () {
return {
value:"a"
value: 'a'
};
},
onChange(ev) {
console.log('radio checked:' + ev.target.value);
onChange(e) {
console.log('radio checked:' + e.target.value);
this.setState({
value:ev.target.value
})
value: e.target.value
});
},
render() {
return<div>
<RadioGroup onChange={this.onChange} value={this.state.value}>
<Radio value="a">A</Radio>
<Radio value="b" >B</Radio>
<Radio value="c" >C</Radio>
<Radio value="d" disabled={true}>D</Radio>
<Radio value="b">B</Radio>
<Radio value="c">C</Radio>
<Radio value="d">D</Radio>
</RadioGroup>
你选中的:&nbsp;&nbsp;{this.state.value}
<div style={{marginTop: 20}}>你选中的: {this.state.value}</div>
</div>
}
});

View File

@ -283,8 +283,15 @@ let AntTable = React.createClass({
});
} else {
let data = this.props.dataSource;
let pageSize = this.state.pagination.pageSize;
let current = this.state.pagination.current;
let current, pageSize;
//
if (this.state.pagination === false) {
pageSize = Number.POSITIVE_INFINITY;
current = 1;
} else {
pageSize = this.state.pagination.pageSize;
current = this.state.pagination.current;
}
//
if (this.state.sortOrder && this.state.sorter) {
data = data.sort(this.state.sorter);

View File

@ -59,7 +59,7 @@ var dataSource = {
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---------------|--------------------------|-----------------|---------------------|---------|
| rowSelection | 列表项是否可选择 | Object | | false |
| pagenation | 分页器 | React.Element | 参考 [pagination](/components/pagination),设为 false 时不显示分页 | |
| pagination | 分页器 | React.Element | 参考 [pagination](/components/pagination),设为 false 时不显示分页 | |
| size | 正常或迷你类型 | string | `normal` or `small` | normal |
| dataSource | 数据源,可以为数组(本地模式)或一个数据源描述对象(远程模式) | Array or Object | | |
| columns | 表格列的配置描述,具体项见下表 | Array | | 无 |

View File

@ -9,21 +9,29 @@
## 直接下载
- **稳定版** <span class="versions" id="stable-version"></span>
<a id="stable-link" href="" target="_blank">下载</a>
- **开发版** <span class="versions" id="latest-version"></span>
开发版并不稳定,随时可能变更。
<ul id="latest-links">
<li>
<a href="http://ant.design/dist/antd.js">antd.js</a>
</li>
<li>
<a href="http://ant.design/dist/antd.min.js">antd.min.js</a>
</li>
<li>
<a href="http://ant.design/dist/antd.css">antd.css</a>
</li>
<li>
<a href="http://ant.design/dist/antd.min.css">antd.min.css</a>
</li>
</ul>
- **稳定版** <span class="versions" id="stable-version"></span>
<a id="stable-link" href="" target="_blank">下载</a>
- **历史版本**https://github.com/ant-design/ant-design/releases
## npm

View File

@ -79,10 +79,10 @@
"release": "npm run clean && webpack --config webpack.config.production.js && webpack --config webpack.config.min.js && zip dist/${npm_package_name}-${npm_package_version}.zip -j dist dist/*",
"start": "npm run clean && nico server --watch",
"clean": "rm -rf _site dist",
"deploy": "rm -rf node_modules && node scripts/install.js && npm run clean && webpack --optimize-minimize && nico build && node scripts/deploy.js",
"deploy": "rm -rf node_modules && node scripts/install.js && npm run clean && webpack && webpack --config webpack.config.min.js && nico build && node scripts/deploy.js",
"lint": "eslint components index.js --ext '.js,.jsx'",
"test": "webpack && npm run lint",
"prepublish": "npm run babel && rm -rf dist && webpack && node scripts/prenpm.js"
"prepublish": "npm run babel && rm -rf dist && webpack --config webpack.config.production.js && node scripts/prenpm.js"
},
"precommit": [
"lint"

View File

@ -1,11 +1,16 @@
var fs = require('fs');
var cwd = process.cwd();
var path = require('path');
var pkg = require('../package');
var originalIndex = fs.readFileSync(path.join(cwd, 'index.js'), 'utf-8');
var newIndex = originalIndex
.replace(/\/components\//g, '/')
.replace("require('./package.json').version", "'" + require('../package.json').version + "'")
.replace("require('./style/index.less')", "require('./index.css')");
fs.writeFileSync(path.join(cwd, 'lib/index.js'), newIndex, 'utf-8');
fs.createReadStream(path.join(cwd, 'dist/antd.css')).pipe(fs.createWriteStream(path.join(cwd, 'lib/index.css')));
console.log('prenpm done');
var antdCss = path.join(cwd, 'dist/' + pkg.name + '-' + pkg.version + '.css');
fs.createReadStream(antdCss)
.pipe(fs.createWriteStream(path.join(cwd, 'lib/index.css')));
console.log('prenpm done');

View File

@ -11,6 +11,10 @@
}
.@{confirmPrefixCls}-body {
.@{confirmPrefixCls}-title {
color: @text-color;
}
.@{confirmPrefixCls}-content {
margin-left: 37px;
font-size: 12px;

View File

@ -19,7 +19,7 @@
right: 50%;
padding: 8px 16px;
border-radius: @border-radius-base;
border: 1px solid #e9e9e9;
border: 1px solid #d9d9d9;
box-shadow: 0 0 4px rgba(0,0,0,0.16);
background: #fff;
display: block;

File diff suppressed because it is too large Load Diff

View File

@ -5,9 +5,6 @@ var webpack = require("webpack");
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var config = require("./webpack.config.js");
config.plugins = [
new ExtractTextPlugin('[name].css')
];
delete config.entry.demo;
delete config.entry[pkg.name];