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

This commit is contained in:
偏右 2016-03-03 11:42:02 +08:00
commit b346949e97
6 changed files with 76 additions and 12 deletions

54
AUTHORS.txt Normal file
View File

@ -0,0 +1,54 @@
Benjy Cui <benjytrys@gmail.com>
Bozhao <yubz86@gmail.com>
Cam Song <neosoyn@gmail.com>
Cee Cirno <i@cee.moe>
Daqi Song <dqaria@gmail.com>
Emma <sima.zhang1990@gmail.com>
Eward Song <eward.song@gmail.com>
Guan Hao <raptium@gmail.com>
Haibin Yu <haibin.yu@oceanwing.com>
Hanai <ihanai1991@gmail.com>
James <james@schoolshape.com>
KgTong <kgtong1992@gmail.com>
Leon Shi <superRaytin@163.com>
MG12 <wuzhao.mail@gmail.com>
Neverland <chenjiahan@buaa.edu.cn>
Pyiner <lijiuyang1992@gmail.com>
RaoHai <surgesoft@gmail.com>
SimaQ <sima.zhang1990@gmail.com>
The Gitter Badger <badger@gitter.im>
Yuwei Ba <i@xiaoba.me>
Zap <a124116186@qq.com>
afc163 <afc163@gmail.com>
chencheng (云谦) <sorrycc@gmail.com>
elrrrrrrr <elrrrrrrr@gmail.com>
genie <genie88@163.com>
haoxin <coderhaoxin@outlook.com>
ioldfish <fish.wangl@gmail.com>
jiang <155259966@qq.com>
kasinooya <kasinooya@gmail.com>
leon.shi <superRaytin@163.com>
lgmcolin <gengmin.lgm@gmail.com>
lgmcolin <lgmcolin@gmail.com>
pizn <pizner@gmail.com>
popomore <sakura9515@gmail.com>
shelwin <wxfans@gmail.com>
shouyong <enlangs@163.com>
simaQ <sima.zhang1990@gmail.com>
sorrycc <sorrycc@gmail.com>
tom <caolvchong@gmail.com>
ustccjw <317713370@qq.com>
warmhug <hualei5280@gmail.com>
xiaoshuai <tangshuaiji@tangshuaijideMacBook-Pro.local>
yiminghe <yiminghe@gmail.com>
yubozhao <yubz86@gmail.com>
yuche <i@yuche.me>
zhangpc <zhangpc@tenxcloud.com>
zhujun24 <zhujun87654321@gmail.com>
zilong <jzlxiaohei@163.com>
zinkey <yaya@uloveit.com.cn>
低位 <zhujun87654321@gmail.com>
偏右 <afc163@gmail.com>
唐帅佶 <tangshuaiji@tangshuaijideMacBook-Pro.local>
白羊座小葛 <abeyuhang@gmail.com>
逸达 <dqaria@gmail.com>

View File

@ -4,6 +4,12 @@
--- ---
## 0.12.7
`2016-03-03`
- 修正 Table 的 `rowSelect.onSelectAll` 的第三个参数 `deselectedRows``changeRows`,记录每次变化的列。
## 0.12.6 ## 0.12.6
`2016-03-02` `2016-03-02`

View File

@ -47,8 +47,8 @@ const rowSelection = {
onSelect(record, selected, selectedRows) { onSelect(record, selected, selectedRows) {
console.log(record, selected, selectedRows); console.log(record, selected, selectedRows);
}, },
onSelectAll(selected, selectedRows, deselectedRowKeys) { onSelectAll(selected, selectedRows, changeRows) {
console.log(selected, selectedRows, deselectedRowKeys); console.log(selected, selectedRows, changeRows);
} }
}; };

View File

@ -233,16 +233,21 @@ let AntTable = React.createClass({
!this.props.rowSelection.getCheckboxProps || !this.props.rowSelection.getCheckboxProps ||
!this.props.rowSelection.getCheckboxProps(item).disabled !this.props.rowSelection.getCheckboxProps(item).disabled
).map((item, i) => this.getRecordKey(item, i)); ).map((item, i) => this.getRecordKey(item, i));
//
const changeRowKeys = [];
if (checked) { if (checked) {
changableRowKeys.forEach(key => { changableRowKeys.forEach(key => {
if (selectedRowKeys.indexOf(key) < 0) { if (selectedRowKeys.indexOf(key) < 0) {
selectedRowKeys.push(key); selectedRowKeys.push(key);
changeRowKeys.push(key);
} }
}); });
} else { } else {
changableRowKeys.forEach(key => { changableRowKeys.forEach(key => {
if (selectedRowKeys.indexOf(key) >= 0) { if (selectedRowKeys.indexOf(key) >= 0) {
selectedRowKeys.splice(selectedRowKeys.indexOf(key), 1); selectedRowKeys.splice(selectedRowKeys.indexOf(key), 1);
changeRowKeys.push(key);
} }
}); });
} }
@ -251,13 +256,11 @@ let AntTable = React.createClass({
}); });
this.setSelectedRowKeys(selectedRowKeys); this.setSelectedRowKeys(selectedRowKeys);
if (this.props.rowSelection.onSelectAll) { if (this.props.rowSelection.onSelectAll) {
const selectedRows = data.filter((row, i) => { const selectedRows = data.filter((row, i) =>
return selectedRowKeys.indexOf(this.getRecordKey(row, i)) >= 0; selectedRowKeys.indexOf(this.getRecordKey(row, i)) >= 0);
}); const changeRows = data.filter((row, i) =>
const deselectedRows = checked ? [] : data.filter((row, i) => { changeRowKeys.indexOf(this.getRecordKey(row, i)) >= 0);
return changableRowKeys.indexOf(this.getRecordKey(row, i)) >= 0; this.props.rowSelection.onSelectAll(checked, selectedRows, changeRows);
});
this.props.rowSelection.onSelectAll(checked, selectedRows, deselectedRows);
} }
}, },

View File

@ -100,7 +100,7 @@ const columns = [{
| onChange | 选中项发生变化的时的回调 | Function(selectedRowKeys, selectedRows) | - | | onChange | 选中项发生变化的时的回调 | Function(selectedRowKeys, selectedRows) | - |
| getCheckboxProps | 选择框的默认属性配置 | Function(record) | - | | getCheckboxProps | 选择框的默认属性配置 | Function(record) | - |
| onSelect | 用户手动选择/取消选择某列的回调 | Function(record, selected, selectedRows) | - | | onSelect | 用户手动选择/取消选择某列的回调 | Function(record, selected, selectedRows) | - |
| onSelectAll | 用户手动选择/取消选择所有列的回调 | Function(selected, selectedRows, deselectedRows) | - | | onSelectAll | 用户手动选择/取消选择所有列的回调 | Function(selected, selectedRows, changeRows) | - |
## 注意 ## 注意

View File

@ -1,6 +1,6 @@
{ {
"name": "antd", "name": "antd",
"version": "0.12.6", "version": "0.12.7",
"title": "Ant Design", "title": "Ant Design",
"description": "一个 UI 设计语言", "description": "一个 UI 设计语言",
"homepage": "http://ant.design/", "homepage": "http://ant.design/",
@ -139,7 +139,8 @@
"jest": "jest", "jest": "jest",
"pub": "sh ./scripts/publish.sh", "pub": "sh ./scripts/publish.sh",
"webpack": "webpack", "webpack": "webpack",
"beta": "sh ./scripts/publish.sh --tag beta" "beta": "sh ./scripts/publish.sh --tag beta",
"authors": "git log --format='%aN <%aE>' | sort -u | grep -v 'users.noreply.github.com' | grep -v 'alibaba-inc.com' | grep -v 'alipay.com' | grep -v 'taobao.com' > AUTHORS.txt"
}, },
"jest": { "jest": {
"testRunner": "<rootDir>/node_modules/jest-cli/src/testRunners/jasmine/jasmine2", "testRunner": "<rootDir>/node_modules/jest-cli/src/testRunners/jasmine/jasmine2",