From 010e92da79c268061456cca05cbe7dbfce6b8213 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 26 Apr 2016 15:25:25 +0800 Subject: [PATCH 01/14] fix a form warning style problem --- style/components/form.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/style/components/form.less b/style/components/form.less index 9943c88341..9b9ea7890f 100644 --- a/style/components/form.less +++ b/style/components/form.less @@ -367,7 +367,7 @@ form { } // ant-timepicker - .@{timepicker-prefix-cls}-picker-icon:after { + .@{timepicker-prefix-cls}-icon:after { color: @warning-color; } From 48f74fd5bda4e73d1bb3a6766eb417aa7410c540 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 27 Apr 2016 11:23:18 +0800 Subject: [PATCH 02/14] fix missing Option (#1521) --- components/calendar/Header.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/components/calendar/Header.jsx b/components/calendar/Header.jsx index ae67307108..696a98b49a 100644 --- a/components/calendar/Header.jsx +++ b/components/calendar/Header.jsx @@ -2,6 +2,7 @@ import React, { PropTypes, Component } from 'react'; import { PREFIX_CLS } from './Constants'; import Select from '../select'; import { Group, Button } from '../radio'; +const Option = Select.Option; function noop() {} From 5228c421150d85eab6665cc910d6d184b69ad3ca Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 27 Apr 2016 15:25:57 +0800 Subject: [PATCH 03/14] fix vertical sub menu border --- style/components/menu.less | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/style/components/menu.less b/style/components/menu.less index 2f334fbc0b..4faa00a32b 100644 --- a/style/components/menu.less +++ b/style/components/menu.less @@ -87,6 +87,13 @@ } } + &-vertical &-sub { + border-right: 0; + .@{menu-prefix-cls}-item { + border-right: 0; + } + } + &-inline { .@{menu-prefix-cls}-selected, .@{menu-prefix-cls}-item-selected { From 85ec9a87434628e84c132ecd54e475da74290029 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 27 Apr 2016 15:26:03 +0800 Subject: [PATCH 04/14] Fix Menu switch mode behavious MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 切换菜单模式时,子菜单有异常的表现 --- components/common/openAnimation.js | 1 + components/menu/demo/switch-mode.md | 65 +++++++++++++++++++++++++++++ components/menu/index.jsx | 15 ++++++- 3 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 components/menu/demo/switch-mode.md diff --git a/components/common/openAnimation.js b/components/common/openAnimation.js index 80d857a055..84e2b75fff 100644 --- a/components/common/openAnimation.js +++ b/components/common/openAnimation.js @@ -9,6 +9,7 @@ function animate(node, show, transitionName, done) { function complete() { if (!ok) { ok = true; + node.style.display = ''; done(); } } diff --git a/components/menu/demo/switch-mode.md b/components/menu/demo/switch-mode.md new file mode 100644 index 0000000000..75170f34e1 --- /dev/null +++ b/components/menu/demo/switch-mode.md @@ -0,0 +1,65 @@ +# 切换 + +- order: 5 + +展示动态切换模式。 + +--- + +````jsx +import { Menu, Icon, Switch } from 'antd'; +const SubMenu = Menu.SubMenu; +const MenuItemGroup = Menu.ItemGroup; + +const Sider = React.createClass({ + getInitialState() { + return { + mode: 'inline', + }; + }, + changeMode(value) { + this.setState({ + mode: value ? 'vertical' : 'inline', + }); + }, + render() { + return ( +
+ +
+
+ + 导航一}> + + 选项1 + 选项2 + + + 选项3 + 选项4 + + + 导航二}> + 选项5 + 选项6 + + 选项7 + 选项8 + + + 导航三}> + 选项9 + 选项10 + 选项11 + 选项12 + + +
+ ); + } +}); +ReactDOM.render(, mountNode); +```` diff --git a/components/menu/index.jsx b/components/menu/index.jsx index 341810ca51..118edef81e 100644 --- a/components/menu/index.jsx +++ b/components/menu/index.jsx @@ -21,6 +21,12 @@ const AntMenu = React.createClass({ openKeys: [] }; }, + componentWillReceiveProps(nextProps) { + if (this.props.mode === 'inline' && + nextProps.mode !== 'inline') { + this.switchModeFromInline = true; + } + }, handleClick(e) { this.setState({ openKeys: [] @@ -47,7 +53,14 @@ const AntMenu = React.createClass({ openAnimation = 'slide-up'; break; case 'vertical': - openAnimation = 'zoom-big'; + // When mode switch from inline + // submenu should hide without animation + if (this.switchModeFromInline) { + openAnimation = ''; + this.switchModeFromInline = false; + } else { + openAnimation = 'zoom-big'; + } break; case 'inline': openAnimation = animation; From 1d72c8abcc534bacfbf5f462d456568fa20fb017 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 27 Apr 2016 17:01:55 +0800 Subject: [PATCH 05/14] update menu doc --- components/menu/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/menu/index.md b/components/menu/index.md index ab108f256a..2d3ac5441c 100644 --- a/components/menu/index.md +++ b/components/menu/index.md @@ -31,7 +31,7 @@ | 参数 | 说明 | 类型 | 默认值 | |----------|----------------|----------|--------------| | theme | 主题颜色 | enum: `light` `dark` | 'light' | -| mode | 菜单类型 | enum: `vertical` `horizontal` `inline` | vertical | +| mode | 菜单类型,现在支持垂直、水平、和内嵌模式三种 | enum: `vertical` `horizontal` `inline` | vertical | | selectedKeys | 当前选中的菜单项 key 数组 | | | | defaultSelectedKeys | 初始选中的菜单项 key 数组 | | | | openKeys | 当前展开的菜单项 key 数组 | | | From 0858413691d57a8384a1e19e7b86766b0710a8a5 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 27 Apr 2016 17:02:50 +0800 Subject: [PATCH 06/14] fix FormItem help and extra render --- components/form/FormItem.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/form/FormItem.jsx b/components/form/FormItem.jsx index dc5480b30a..e1af709d21 100644 --- a/components/form/FormItem.jsx +++ b/components/form/FormItem.jsx @@ -40,16 +40,16 @@ class FormItem extends React.Component { const props = this.props; const prefixCls = props.prefixCls; const help = this.getHelpMsg(); - return ( -
- { help } + return help ? ( +
+ {help}
- ); + ) : null; } renderExtra() { const { prefixCls, extra } = this.props; - return
{extra}
; + return {extra}; } getValidateStatus() { From affda966e5009287d0c7c061452b174c9625804b Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 27 Apr 2016 17:15:05 +0800 Subject: [PATCH 07/14] fix #1528 --- components/button/button.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/button/button.jsx b/components/button/button.jsx index 053dd6fbe7..193f9050cc 100644 --- a/components/button/button.jsx +++ b/components/button/button.jsx @@ -83,7 +83,7 @@ export default class Button extends React.Component { Button.propTypes = { type: React.PropTypes.oneOf(['primary', 'ghost', 'dashed']), shape: React.PropTypes.oneOf(['circle', 'circle-outline']), - size: React.PropTypes.oneOf(['large', 'small']), + size: React.PropTypes.oneOf(['large', 'default', 'small']), htmlType: React.PropTypes.oneOf(['submit', 'button', 'reset']), onClick: React.PropTypes.func, loading: React.PropTypes.bool, From b988dd940bc2d5d0949c329cf4cabb057482f008 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 27 Apr 2016 17:25:35 +0800 Subject: [PATCH 08/14] bump 0.12.16 --- CHANGELOG.md | 10 ++++++++++ package.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 010a7ce0c2..af67228786 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ --- +## 0.12.16 + +- 修复 Collapse 在 safari 中切换动画异常的问题。[#1494](https://github.com/ant-design/ant-design/issues/1494) +- 修复 Table 的 selectedRowKeys 在初次渲染时失效的问题。[#1501](https://github.com/ant-design/ant-design/issues/1501) +- Table 现在点击选择框时将不再触发 `onRowClick`。[#1470](https://github.com/ant-design/ant-design/issues/1470) +- 修复一个 Calender 服务端渲染时提示 `Option is not defined` 的问题。[#1521](https://github.com/ant-design/ant-design/issues/1521) +- 修复 Menu 动态切换模式时的一些细节问题。 +- 优化了 export 导出图标。 +- 修复 Form 的一些样式细节。 + ## 0.12.15 - 升级 rc-collapse 修复一个性能问题。 diff --git a/package.json b/package.json index 9224247153..1d5a4d4a5a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "antd", - "version": "0.12.15", + "version": "0.12.16", "title": "Ant Design", "description": "一个 UI 设计语言", "homepage": "http://ant.design/", From 93faa0d7b8a3c76a2ddd051591e4038d3e4811ce Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 29 Apr 2016 15:00:41 +0800 Subject: [PATCH 09/14] update (#1543) --- components/upload/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/upload/index.md b/components/upload/index.md index a81217d52c..9900da49b1 100644 --- a/components/upload/index.md +++ b/components/upload/index.md @@ -22,7 +22,7 @@ |------------|--------------------------------------------------------------| ----------- |-------| | name | 可选参数, 上传的文件 | String | file | | action | 必选参数, 上传的地址 | String | 无 | -| data | 可选参数, 上传所需参数 | Object | 无 | +| data | 可选参数, 上传所需参数 | Object/Function(file) | 无 | | headers | 可选参数, 设置上传的请求头部,IE10 以上有效 | Object | 无 | | showUploadList | 可选参数, 是否展示 uploadList, 默认开启 | Boolean | true | | multiple | 可选参数, 是否支持多选文件,`ie10+` 支持。开启后按住 ctrl 可选择多个文件。 | Boolean | false | From 0e96c4ef964131e54ba84f9e4750e4dd15a7714e Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 29 Apr 2016 17:24:48 +0800 Subject: [PATCH 10/14] fix FormItem margin-bottom, close #1557 --- style/components/form.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/style/components/form.less b/style/components/form.less index 9b9ea7890f..080179528a 100644 --- a/style/components/form.less +++ b/style/components/form.less @@ -77,7 +77,7 @@ input[type="checkbox"] { } &.@{css-prefix}form-item-with-help { - margin-bottom: @form-item-margin-bottom - @font-size-base * @line-height-base; + margin-bottom: @form-item-margin-bottom - @font-size-base * @line-height-base - 3; } > label { From e111e52231083f0812fcef3379992ccb8a9b9816 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 29 Apr 2016 23:44:33 +0800 Subject: [PATCH 11/14] fix link, close #1554 --- docs/pattern/navigation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pattern/navigation.md b/docs/pattern/navigation.md index 71f2250eff..43fea1ffc2 100644 --- a/docs/pattern/navigation.md +++ b/docs/pattern/navigation.md @@ -38,7 +38,7 @@ 我们将常见的导航模式分为:侧栏导航和顶部导航,两者各有优缺点,设计者可以根据各自的业务需求进行选择。 -前端实现代码可以参考 [常用布局](/docs/spec/layout#layout-demo-top)。 +前端实现代码可以参考 [常用布局](/docs/spec/layout/#layout-demo-top)。 ## 侧栏导航 From 05b1e5d964e13de71d1719834b2398a07585488b Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 5 May 2016 15:09:53 +0800 Subject: [PATCH 12/14] revert update API (#1543) --- components/upload/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/upload/index.md b/components/upload/index.md index 9900da49b1..a81217d52c 100644 --- a/components/upload/index.md +++ b/components/upload/index.md @@ -22,7 +22,7 @@ |------------|--------------------------------------------------------------| ----------- |-------| | name | 可选参数, 上传的文件 | String | file | | action | 必选参数, 上传的地址 | String | 无 | -| data | 可选参数, 上传所需参数 | Object/Function(file) | 无 | +| data | 可选参数, 上传所需参数 | Object | 无 | | headers | 可选参数, 设置上传的请求头部,IE10 以上有效 | Object | 无 | | showUploadList | 可选参数, 是否展示 uploadList, 默认开启 | Boolean | true | | multiple | 可选参数, 是否支持多选文件,`ie10+` 支持。开启后按住 ctrl 可选择多个文件。 | Boolean | false | From 0cc03e942787f9a2358580d0ad9af710fe15661a Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 5 May 2016 15:49:00 +0800 Subject: [PATCH 13/14] fix table bordered style --- package.json | 2 +- style/components/table.less | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 1d5a4d4a5a..beb0c37e76 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "rc-slider": "~3.3.0", "rc-steps": "~1.4.1", "rc-switch": "~1.3.2", - "rc-table": "~3.11.1", + "rc-table": "~3.11.4", "rc-tabs": "~5.8.0", "rc-time-picker": "~1.1.0", "rc-tooltip": "~3.3.1", diff --git a/style/components/table.less b/style/components/table.less index d750a1d2c2..382171e974 100644 --- a/style/components/table.less +++ b/style/components/table.less @@ -19,6 +19,8 @@ max-width: 100%; border-collapse: separate; text-align: left; + border-radius: @border-radius-base; + overflow: hidden; } th { @@ -71,6 +73,10 @@ } } + &.@{table-prefix-cls}-bordered tfoot tr { + top: 0; + } + tr.@{table-prefix-cls}-row-selected { background: #fafafa; } From b0774a7d189a5ea60e58498ac75bd9fd2ddbc359 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 5 May 2016 15:52:18 +0800 Subject: [PATCH 14/14] 0.12.17 --- CHANGELOG.md | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af67228786..f83fb62596 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ --- +## 0.12.17 + +- 修复 FormItem 校验时表单项高度跳动的问题。[#1557](https://github.com/ant-design/ant-design/issues/1557) +- 修复一个 Table 圆角样式的小问题。 + ## 0.12.16 - 修复 Collapse 在 safari 中切换动画异常的问题。[#1494](https://github.com/ant-design/ant-design/issues/1494) diff --git a/package.json b/package.json index beb0c37e76..f80be918e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "antd", - "version": "0.12.16", + "version": "0.12.17", "title": "Ant Design", "description": "一个 UI 设计语言", "homepage": "http://ant.design/",