From 3e9a5afa90c78fd8e03a32490c8a281689dc7418 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 3 Mar 2016 12:08:53 +0800 Subject: [PATCH 01/37] docs: table locale, ref #1110 --- components/table/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/table/index.md b/components/table/index.md index 7f5bdac424..484c2fb372 100644 --- a/components/table/index.md +++ b/components/table/index.md @@ -66,7 +66,7 @@ const columns = [{ | defaultExpandedRowKeys | 默认展开的列 | Array | | - | | onChange | 分页、排序、筛选变化时触发 | Function(pagination, filters, sorter) | | | | loading | 页面是否加载中 | Boolean | | false | -| locale | 设置排序、过滤按钮的文字或 `title` | Object | | [默认值](https://github.com/ant-design/ant-design/issues/575#issuecomment-159169511) | +| locale | 默认文案设置,目前包括排序、过滤、空数据文案 | Object | | `{ filterConfirm: '确定', filterReset: '重置', emptyText: '暂无数据' }` [默认值](https://github.com/ant-design/ant-design/issues/575#issuecomment-159169511) | | indentSize | 展示树形数据时,每层缩进的宽度,以 px 为单位 | Number | | 15 | | onRowClick | 处理行点击事件 | Function(record, index) | | 无 | | useFixedHeader | 是否固定表头 | Boolean | | false | From 30238a759ceea9a532b990d9f33b676e96d7dacd Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 3 Mar 2016 12:16:25 +0800 Subject: [PATCH 02/37] Fix Tag nested bug, close #1111 --- components/tag/index.jsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/components/tag/index.jsx b/components/tag/index.jsx index 29ee35cb65..2f195c849e 100644 --- a/components/tag/index.jsx +++ b/components/tag/index.jsx @@ -36,12 +36,13 @@ class AntTag extends React.Component { } render() { - const { prefixCls, closable, color, ...restProps } = this.props; + const { prefixCls, closable, color, className, children, ...restProps } = this.props; const close = closable ? : ''; - const className = classNames({ + const classString = classNames({ [prefixCls]: true, [`${prefixCls}-${color}`]: !!color, [`${prefixCls}-close`]: this.state.closing, + [className]: !!className, }); return ( {this.state.closed ? null : ( -
- +
+ {children} {close}
)} From a3c6a70996b6757765170d9c1fc73331ec0be8eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=84=B6=E5=88=99?= Date: Thu, 3 Mar 2016 13:23:22 +0800 Subject: [PATCH 03/37] up rc-tree-select version --- components/tree-select/demo/checkable.md | 1 - package.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/components/tree-select/demo/checkable.md b/components/tree-select/demo/checkable.md index 9fdea15367..154b0fb90e 100644 --- a/components/tree-select/demo/checkable.md +++ b/components/tree-select/demo/checkable.md @@ -55,7 +55,6 @@ const Demo = React.createClass({ multiple: true, treeCheckable: true, searchPlaceholder: '请选择', - treeDefaultExpandAll: true, style: { width: 300, }, diff --git a/package.json b/package.json index eb888795c9..dde1e2def0 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "rc-time-picker": "~1.1.0", "rc-tooltip": "~3.3.1", "rc-tree": "~1.1.0", - "rc-tree-select": "~1.1.1", + "rc-tree-select": "~1.2.2", "rc-trigger": "~1.2.0", "rc-upload": "~1.8.0", "rc-util": "~3.1.2", From d10d92c45575a9f28159882e06bf7de05bf19583 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 3 Mar 2016 14:57:26 +0800 Subject: [PATCH 04/37] Fix cascader onChange bug in IE --- components/cascader/index.jsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/cascader/index.jsx b/components/cascader/index.jsx index cbd4b46c10..6017d3a015 100644 --- a/components/cascader/index.jsx +++ b/components/cascader/index.jsx @@ -70,6 +70,10 @@ class AntCascader extends React.Component { [`${prefixCls}-picker`]: true, [`${prefixCls}-picker-disabled`]: disabled, }); + + // Fix bug of https://github.com/facebook/react/pull/5004 + delete otherProps.onChange; + return ( Date: Thu, 3 Mar 2016 15:24:51 +0800 Subject: [PATCH 05/37] Fix radio style --- style/components/radio.less | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/style/components/radio.less b/style/components/radio.less index 0006d32a94..d74f8886a7 100644 --- a/style/components/radio.less +++ b/style/components/radio.less @@ -98,7 +98,7 @@ } } -.@{radio-prefix-cls} + span { +span.@{radio-prefix-cls} + * { margin-left: 8px; } @@ -116,6 +116,10 @@ border: 1px solid @border-color-base; border-left: 0; + a { + color: #666; + } + > span.@{radio-prefix-cls}-button { margin-left: 0; display: none; From 8daabfced8faa444be94c16e180a322fbcc6777a Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 3 Mar 2016 15:32:16 +0800 Subject: [PATCH 06/37] docs: update table --- components/table/index.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/components/table/index.md b/components/table/index.md index 484c2fb372..5c454621f9 100644 --- a/components/table/index.md +++ b/components/table/index.md @@ -112,9 +112,6 @@ const columns = [{ ![](https://os.alipayobjects.com/rmsportal/luLdLvhPOiRpyss.png) ```jsx -const rowKey = function(record) { - return record.uid; // 比如你的数据主键是 uid -}; - -return ; +// 比如你的数据主键是 uid +return
record.uid} />; ``` From 91d553d0448157e33b4c5a190e0860a7468feaf4 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 3 Mar 2016 15:36:33 +0800 Subject: [PATCH 07/37] docs: fix link --- docs/react/introduce.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/react/introduce.md b/docs/react/introduce.md index 945b54b5a3..f0cdb0b2d1 100644 --- a/docs/react/introduce.md +++ b/docs/react/introduce.md @@ -84,4 +84,4 @@ import 'antd/lib/index.css'; // or 'antd/style/index.less' ## 如何贡献 -在任何形式的参与前,请先阅读 [贡献者文档](https://github.com/ant-design/ant-design/blob/master/CONTRIBUTING.md)。有任何建议或意见您可以 [Pull Request](https://github.com/ant-design/ant-design/pulls),给我们 [报告 Bug](http://dwz.cn/2AF9ao) 或 [提问](https://github.com/ant-design/ant-design/issues)。 +在任何形式的参与前,请先阅读 [贡献者文档](https://github.com/ant-design/ant-design/blob/master/.github/CONTRIBUTING.md)。有任何建议或意见您可以 [Pull Request](https://github.com/ant-design/ant-design/pulls),给我们 [报告 Bug](http://dwz.cn/2AF9ao) 或 [提问](https://github.com/ant-design/ant-design/issues)。 From e88213fa33aadf682136dafe5663b8d7456e3bc2 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Thu, 3 Mar 2016 15:52:12 +0800 Subject: [PATCH 08/37] test: add test on node 5 --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index e97c27a401..ac4e4ca10b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,7 @@ +sudo: false + language: node_js node_js: - "4" + - "5" From f7fb5b29f99d8e44d0ff816c50d2bacfd79afcbb Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 3 Mar 2016 21:33:02 +0800 Subject: [PATCH 09/37] Fix click effect in Popconfirm button --- components/button/button.jsx | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/components/button/button.jsx b/components/button/button.jsx index 28c582c2b9..f139d96059 100644 --- a/components/button/button.jsx +++ b/components/button/button.jsx @@ -24,13 +24,19 @@ function insertSpace(child) { return child; } +function clearButton(button) { + button.className = button.className.replace(`${prefix}clicked`, ''); +} + export default class Button extends React.Component { handleClick(...args) { + // Add click effect const buttonNode = findDOMNode(this); - buttonNode.className = buttonNode.className.replace(`${prefix}clicked`, ''); - setTimeout(() => { - buttonNode.className += ` ${prefix}clicked`; - }, 10); + clearButton(buttonNode); + setTimeout(() => buttonNode.className += ` ${prefix}clicked`, 10); + clearTimeout(this.timeout); + this.timeout = setTimeout(() => clearButton(buttonNode), 500); + this.props.onClick(...args); } render() { @@ -50,13 +56,16 @@ export default class Button extends React.Component { [prefix + shape]: shape, [prefix + sizeCls]: sizeCls, [`${prefix}loading`]: ('loading' in props && props.loading !== false), - [className]: className + [className]: className, }); const kids = React.Children.map(children, insertSpace); return ( - ); From 9cdee3434aae71a3295b3f6da6a92e4b3fff5f88 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 4 Mar 2016 11:39:58 +0800 Subject: [PATCH 10/37] typo fix #1113 --- components/table/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/table/index.md b/components/table/index.md index 5c454621f9..6b70ce7618 100644 --- a/components/table/index.md +++ b/components/table/index.md @@ -61,9 +61,9 @@ const columns = [{ | size | 正常或迷你类型 | String | `default` or `small`| default | | dataSource | 数据数组 | Array | | | | columns | 表格列的配置描述,具体项见下表 | Array | | 无 | -| rowKey | 表格列 key 的取值 | Function(record, index):string | | record.key | -| expandedRowRender | 额外的列展开元素 | Function | | - | -| defaultExpandedRowKeys | 默认展开的列 | Array | | - | +| rowKey | 表格行 key 的取值 | Function(record, index):string | | record.key | +| expandedRowRender | 额外的展开行 | Function | | - | +| defaultExpandedRowKeys | 默认展开的行 | Array | | - | | onChange | 分页、排序、筛选变化时触发 | Function(pagination, filters, sorter) | | | | loading | 页面是否加载中 | Boolean | | false | | locale | 默认文案设置,目前包括排序、过滤、空数据文案 | Object | | `{ filterConfirm: '确定', filterReset: '重置', emptyText: '暂无数据' }` [默认值](https://github.com/ant-design/ant-design/issues/575#issuecomment-159169511) | From 958a74e028dfcbb6184c4b68079af4d716bc8477 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 4 Mar 2016 11:46:24 +0800 Subject: [PATCH 11/37] update docs --- components/steps/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/steps/index.md b/components/steps/index.md index 19e4ecaa5e..eee1a96c8a 100644 --- a/components/steps/index.md +++ b/components/steps/index.md @@ -17,9 +17,9 @@ ```jsx - - - + + + ``` From a45ed7ee4c1d50dcfea0dd5746860b69e3c8b18c Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 4 Mar 2016 12:07:17 +0800 Subject: [PATCH 12/37] Fix radio style prop --- components/radio/demo/radiogroup.md | 19 +++++++++---------- components/radio/radio.jsx | 6 +++--- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/components/radio/demo/radiogroup.md b/components/radio/demo/radiogroup.md index eadfb117f8..c94ec67f88 100644 --- a/components/radio/demo/radiogroup.md +++ b/components/radio/demo/radiogroup.md @@ -13,27 +13,26 @@ const RadioGroup = Radio.Group; const App = React.createClass({ getInitialState() { return { - value: 1 + value: 1, }; }, onChange(e) { console.log('radio checked', e.target.value); this.setState({ - value: e.target.value + value: e.target.value, }); }, render() { return ( -
- - A - B - C - D - -
+ + A + B + C + D + ); } }); + ReactDOM.render(, mountNode); ```` diff --git a/components/radio/radio.jsx b/components/radio/radio.jsx index 70d0c19745..7c5ccfd202 100644 --- a/components/radio/radio.jsx +++ b/components/radio/radio.jsx @@ -9,7 +9,7 @@ const AntRadio = React.createClass({ }; }, render() { - const { prefixCls, children, checked, disabled, className } = this.props; + const { prefixCls, children, checked, disabled, className, style } = this.props; const classString = classNames({ [prefixCls]: true, [`${prefixCls}-checked`]: checked, @@ -17,8 +17,8 @@ const AntRadio = React.createClass({ [className]: !!className, }); return ( -