From 1d12cc2cde7c519b5777d3c137eac1290efbb140 Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Tue, 23 Feb 2016 10:43:57 +0800 Subject: [PATCH 1/2] chore: add AUTHORS.txt --- AUTHORS.txt | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 AUTHORS.txt diff --git a/AUTHORS.txt b/AUTHORS.txt new file mode 100644 index 0000000000..b9f602e5d8 --- /dev/null +++ b/AUTHORS.txt @@ -0,0 +1,54 @@ +Benjy Cui +Bozhao +Cam Song +Cee Cirno +Daqi Song +Emma +Eward Song +Guan Hao +Haibin Yu +Hanai +James +KgTong +Leon Shi +MG12 +Neverland +Pyiner +RaoHai +SimaQ +The Gitter Badger +Yuwei Ba +Zap +afc163 +chencheng (云谦) +elrrrrrrr +genie +haoxin +ioldfish +jiang <155259966@qq.com> +kasinooya +leon.shi +lgmcolin +lgmcolin +pizn +popomore +shelwin +shouyong +simaQ +sorrycc +tom +ustccjw <317713370@qq.com> +warmhug +xiaoshuai +yiminghe +yubozhao +yuche +zhangpc +zhujun24 +zilong +zinkey +低位 +偏右 +唐帅佶 +白羊座小葛 +逸达 diff --git a/package.json b/package.json index 5ca7c16992..81720fa1df 100644 --- a/package.json +++ b/package.json @@ -137,7 +137,8 @@ "jest": "jest", "pub": "sh ./scripts/publish.sh", "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": { "testRunner": "/node_modules/jest-cli/src/testRunners/jasmine/jasmine2", From 7d151514e3872177eeebc07bbb2662920c2dcaee Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 2 Mar 2016 23:42:44 +0800 Subject: [PATCH 2/2] Fix rowSelection.onSelectAll, bump 0.12.7, ref #1105 --- CHANGELOG.md | 6 ++++++ components/table/demo/row-selection.md | 4 ++-- components/table/index.jsx | 17 ++++++++++------- components/table/index.md | 2 +- package.json | 2 +- 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cbae317d0..48c30c9e3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ --- +## 0.12.7 + +`2016-03-03` + +- 修正 Table 的 `rowSelect.onSelectAll` 的第三个参数 `deselectedRows` 为 `changeRows`,记录每次变化的列。 + ## 0.12.6 `2016-03-02` diff --git a/components/table/demo/row-selection.md b/components/table/demo/row-selection.md index 7ceb0b5cc3..88cd4b68d1 100644 --- a/components/table/demo/row-selection.md +++ b/components/table/demo/row-selection.md @@ -47,8 +47,8 @@ const rowSelection = { onSelect(record, selected, selectedRows) { console.log(record, selected, selectedRows); }, - onSelectAll(selected, selectedRows, deselectedRowKeys) { - console.log(selected, selectedRows, deselectedRowKeys); + onSelectAll(selected, selectedRows, changeRows) { + console.log(selected, selectedRows, changeRows); } }; diff --git a/components/table/index.jsx b/components/table/index.jsx index b31336663a..32ffc4d205 100644 --- a/components/table/index.jsx +++ b/components/table/index.jsx @@ -233,16 +233,21 @@ let AntTable = React.createClass({ !this.props.rowSelection.getCheckboxProps || !this.props.rowSelection.getCheckboxProps(item).disabled ).map((item, i) => this.getRecordKey(item, i)); + + // 记录变化的列 + const changeRowKeys = []; if (checked) { changableRowKeys.forEach(key => { if (selectedRowKeys.indexOf(key) < 0) { selectedRowKeys.push(key); + changeRowKeys.push(key); } }); } else { changableRowKeys.forEach(key => { if (selectedRowKeys.indexOf(key) >= 0) { selectedRowKeys.splice(selectedRowKeys.indexOf(key), 1); + changeRowKeys.push(key); } }); } @@ -251,13 +256,11 @@ let AntTable = React.createClass({ }); this.setSelectedRowKeys(selectedRowKeys); if (this.props.rowSelection.onSelectAll) { - const selectedRows = data.filter((row, i) => { - return selectedRowKeys.indexOf(this.getRecordKey(row, i)) >= 0; - }); - const deselectedRows = checked ? [] : data.filter((row, i) => { - return changableRowKeys.indexOf(this.getRecordKey(row, i)) >= 0; - }); - this.props.rowSelection.onSelectAll(checked, selectedRows, deselectedRows); + const selectedRows = data.filter((row, i) => + selectedRowKeys.indexOf(this.getRecordKey(row, i)) >= 0); + const changeRows = data.filter((row, i) => + changeRowKeys.indexOf(this.getRecordKey(row, i)) >= 0); + this.props.rowSelection.onSelectAll(checked, selectedRows, changeRows); } }, diff --git a/components/table/index.md b/components/table/index.md index 38d6f3eaa1..7f5bdac424 100644 --- a/components/table/index.md +++ b/components/table/index.md @@ -100,7 +100,7 @@ const columns = [{ | onChange | 选中项发生变化的时的回调 | Function(selectedRowKeys, selectedRows) | - | | getCheckboxProps | 选择框的默认属性配置 | Function(record) | - | | onSelect | 用户手动选择/取消选择某列的回调 | Function(record, selected, selectedRows) | - | -| onSelectAll | 用户手动选择/取消选择所有列的回调 | Function(selected, selectedRows, deselectedRows) | - | +| onSelectAll | 用户手动选择/取消选择所有列的回调 | Function(selected, selectedRows, changeRows) | - | ## 注意 diff --git a/package.json b/package.json index ba7ee76737..8962aa8bca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "antd", - "version": "0.12.6", + "version": "0.12.7", "title": "Ant Design", "description": "一个 UI 设计语言", "homepage": "http://ant.design/",