From bad547c3bb9d13ffeb1e18501217b42b5eed3017 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 19 Apr 2016 16:58:39 +0800 Subject: [PATCH 01/14] Fix #1321 in 0.12.x pick 28b36d5 manully --- components/input/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/input/index.jsx b/components/input/index.jsx index ce007e3462..35cd22f7a8 100644 --- a/components/input/index.jsx +++ b/components/input/index.jsx @@ -3,7 +3,7 @@ import assign from 'object-assign'; import classNames from 'classnames'; function ieGT9() { - if (typeof document === undefined) { + if (typeof document === 'undefined') { return false; } const documentMode = document.documentMode || 0; From 6dc187e5f40bfb7a1f7d5b073e3106b2ce7c9432 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 20 Apr 2016 12:14:57 +0800 Subject: [PATCH 02/14] Not focus it when click button https://github.com/google/material-design-lite/commit/91117c0faaf258d720bc35318926f2a21a9f92cf#diff-39f43a348016e3a62dc9c315917c402bR108 --- components/button/button.jsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/button/button.jsx b/components/button/button.jsx index 7ea7ea6bfd..053dd6fbe7 100644 --- a/components/button/button.jsx +++ b/components/button/button.jsx @@ -39,6 +39,13 @@ export default class Button extends React.Component { this.props.onClick(...args); } + // Handle auto focus when click button in Chrome + handleMouseUp(e) { + findDOMNode(this).blur(); + if (this.props.onMouseUp) { + this.props.onMouseUp(e); + } + } render() { const props = this.props; const { type, shape, size, className, htmlType, children, ...others } = props; @@ -65,6 +72,7 @@ export default class Button extends React.Component { From 504409335f6cf9af3afbc338e6c0bba75b50336d Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 20 Apr 2016 18:59:01 +0800 Subject: [PATCH 03/14] upgrade collapse for perfermance problem and close ##1451 --- package.json | 4 ++-- style/components/collapse.less | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index aef1a5f8d2..0e93f3c876 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "dependencies": { "array-tree-filter": "~1.0.0", "classnames": "~2.2.0", - "css-animation": "~1.1.0", + "css-animation": "~1.2.3", "gregorian-calendar": "~4.1.0", "gregorian-calendar-format": "~4.1.0", "object-assign": "~4.0.1", @@ -42,7 +42,7 @@ "rc-calendar": "~5.4.0", "rc-cascader": "~0.9.0", "rc-checkbox": "~1.3.0", - "rc-collapse": "~1.4.4", + "rc-collapse": "~1.6.0", "rc-dialog": "~5.4.0", "rc-dropdown": "~1.4.3", "rc-form": "~0.14.0", diff --git a/style/components/collapse.less b/style/components/collapse.less index bc8a6b6483..28ad62448e 100644 --- a/style/components/collapse.less +++ b/style/components/collapse.less @@ -49,19 +49,19 @@ } &-content { - display: none; overflow: hidden; color: @text-color; padding: 0 16px; background-color: #fff; + transition: height .2s @ease-out; & > &-box { padding-top: 16px; padding-bottom: 16px; } - &-active { - display: block; + &-inactive { + display: none; } } From d0f99aea507b7d235e7a5ec51c942a7252c79c9e Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 20 Apr 2016 19:02:25 +0800 Subject: [PATCH 04/14] Fix radio-button in IE8, close #1459 --- style/components/radio.less | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/style/components/radio.less b/style/components/radio.less index 7dc3a9f686..6de93ff73b 100644 --- a/style/components/radio.less +++ b/style/components/radio.less @@ -123,7 +123,9 @@ span.@{radio-prefix-cls} + * { > span.@{radio-prefix-cls}-button { margin-left: 0; - display: none; + display: block; + width: 0; + height: 0; } .@{radio-group-prefix-cls}-large & { From 6e8bccdf4e7c40eefc7341e8d3eeb0b8103f248c Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 21 Apr 2016 12:15:22 +0800 Subject: [PATCH 05/14] fix #1464 --- style/components/menu.less | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/style/components/menu.less b/style/components/menu.less index 86f3571592..2f334fbc0b 100644 --- a/style/components/menu.less +++ b/style/components/menu.less @@ -104,6 +104,10 @@ z-index: @zindex-dropdown; } + &-submenu-vertical { + z-index: 1; + } + &-submenu-vertical > & { top: 0; left: 100%; From 8d3bfae8eeb2c30d50cf3212f7b6fa281f1c2a7b Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 21 Apr 2016 12:17:37 +0800 Subject: [PATCH 06/14] fix doc (#1455) --- components/select/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/select/index.md b/components/select/index.md index e5af9007e9..7abe180f70 100644 --- a/components/select/index.md +++ b/components/select/index.md @@ -31,7 +31,7 @@ | filterOption | 是否根据输入项进行筛选,可为一个函数,返回满足要求的 option 即可 | boolean or function(inputValue, option) | true | | tags | 可以把随意输入的条目作为 tag,输入项不需要与下拉选项匹配 | boolean |false | | onSelect | 被选中时调用,参数为选中项的 value 值 | function(value, option) | 无 | -| onDeselect | 取消选中时调用,参数为选中项的 option value 值,仅在 multiple 或 tags 模式下生效 | function(value, option) | 无 | +| onDeselect | 取消选中时调用,参数为选中项的 option value 值,仅在 multiple 或 tags 模式下生效 | function(value) | 无 | | onChange | 选中option,或input的value变化(combobox 模式下)时,调用此函数 | function(value, label) | 无 | | onSearch | 文本框值变化时回调 | function(value: String) | | | placeholder | 选择框默认文字 | string | 无 | From 69f7c4507a72472a0a8501dedf245710703df753 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 21 Apr 2016 12:34:10 +0800 Subject: [PATCH 07/14] bump 0.12.15 --- CHANGELOG.md | 12 ++++++++++++ package.json | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8eddb2c8d8..010a7ce0c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ --- +## 0.12.15 + +- 升级 rc-collapse 修复一个性能问题。 +- 修复一个 Collapse 内嵌 Tabs 的选中项样式问题。[#1451](https://github.com/ant-design/ant-design/issues/1451) +- 修复 Input 组件服务端渲染报错的问题。[#1321](https://github.com/ant-design/ant-design/issues/1321) +- 修复 Tag 组件调用了两次 afterClose 的问题。[#1435](https://github.com/ant-design/ant-design/issues/1435) +- 修复一个 Table 控制模式的问题。[#1434](https://github.com/ant-design/ant-design/issues/1434) +- 修复一个 Tabs 相互嵌套的样式问题。[#1435](https://github.com/ant-design/ant-design/issues/1435) +- 修复 Dropdown.Button 点击右边也触发 onClick 的问题。 +- 修复 Radio.Button 在 IE8 下无法选择的问题。[#1459](https://github.com/ant-design/ant-design/issues/1459) +- 优化了 Button 点击后仍然有 focus 效果的问题。 + ## 0.12.14 `2016-04-13` diff --git a/package.json b/package.json index 0e93f3c876..9224247153 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "antd", - "version": "0.12.14", + "version": "0.12.15", "title": "Ant Design", "description": "一个 UI 设计语言", "homepage": "http://ant.design/", From 255c0b81d0c635040b74fef2f0fe632f247590a9 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 24 Apr 2016 15:29:12 +0800 Subject: [PATCH 08/14] Fix Collapse animation of safari, close #1494 --- style/components/collapse.less | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/style/components/collapse.less b/style/components/collapse.less index 28ad62448e..6a5cce230b 100644 --- a/style/components/collapse.less +++ b/style/components/collapse.less @@ -48,12 +48,15 @@ } } + &-anim-active { + transition: height .2s @ease-out; + } + &-content { overflow: hidden; color: @text-color; padding: 0 16px; background-color: #fff; - transition: height .2s @ease-out; & > &-box { padding-top: 16px; From d7ee4bffa17a848ab8edc7040b9afdd83afcf607 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 25 Apr 2016 13:47:08 +0800 Subject: [PATCH 09/14] Fix initial selectedRowKeys, close #1501 --- components/table/demo/row-selection.md | 2 +- components/table/index.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/table/demo/row-selection.md b/components/table/demo/row-selection.md index 88cd4b68d1..5f5780c5b5 100644 --- a/components/table/demo/row-selection.md +++ b/components/table/demo/row-selection.md @@ -49,7 +49,7 @@ const rowSelection = { }, onSelectAll(selected, selectedRows, changeRows) { console.log(selected, selectedRows, changeRows); - } + }, }; ReactDOM.render( diff --git a/components/table/index.jsx b/components/table/index.jsx index 72d7c96755..8c18f77f1b 100644 --- a/components/table/index.jsx +++ b/components/table/index.jsx @@ -31,7 +31,7 @@ let AntTable = React.createClass({ getInitialState() { return { // 减少状态 - selectedRowKeys: this.props.selectedRowKeys || [], + selectedRowKeys: (this.props.rowSelection || {}).selectedRowKeys || [], filters: {}, selectionDirty: false, sortColumn: '', From 112317e0ea9dbd4aaa6b2492d3d927d2eeb98331 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 25 Apr 2016 15:03:34 +0800 Subject: [PATCH 10/14] upgrade iconfont url for export icon --- style/themes/default/custom.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/style/themes/default/custom.less b/style/themes/default/custom.less index 9871a70bca..836d30aa81 100644 --- a/style/themes/default/custom.less +++ b/style/themes/default/custom.less @@ -22,7 +22,7 @@ // ICONFONT @iconfont-css-prefix : anticon; -@icon-url : "//at.alicdn.com/t/font_1457169990_5499172"; +@icon-url : "//at.alicdn.com/t/font_1461567603_8950496"; // LINK @link-color : #2db7f5; From 287c45292de6fc2bc244aaa9717d7f718232fc41 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 25 Apr 2016 16:25:57 +0800 Subject: [PATCH 11/14] fix color of form help text --- components/form/FormItem.jsx | 7 ++++++- style/components/form.less | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/components/form/FormItem.jsx b/components/form/FormItem.jsx index 52d41e801b..05a2ce98dc 100644 --- a/components/form/FormItem.jsx +++ b/components/form/FormItem.jsx @@ -47,6 +47,11 @@ class FormItem extends React.Component { ); } + renderExtra() { + const { prefixCls, extra } = this.props; + return
{extra}
; + } + getValidateStatus() { const { isFieldValidating, getFieldError, getFieldValue } = this.context.form; const field = this.getId(); @@ -142,7 +147,7 @@ class FormItem extends React.Component { this.renderValidateWrapper( children, this.renderHelp(), - props.extra + this.renderExtra(), ) ), ]; diff --git a/style/components/form.less b/style/components/form.less index 37c85b98df..9943c88341 100644 --- a/style/components/form.less +++ b/style/components/form.less @@ -102,6 +102,11 @@ input[type="checkbox"] { margin-top: 3px; } +.@{css-prefix}form-explain, +.@{css-prefix}form-extra { + color: #999; +} + .@{css-prefix}form-text { display: inline-block; padding-right: 8px; From 3789fda6ee4a81caa5c757532fa04d8152b01b07 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 25 Apr 2016 16:31:32 +0800 Subject: [PATCH 12/14] fix lint --- components/form/FormItem.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/form/FormItem.jsx b/components/form/FormItem.jsx index 05a2ce98dc..dc5480b30a 100644 --- a/components/form/FormItem.jsx +++ b/components/form/FormItem.jsx @@ -147,7 +147,7 @@ class FormItem extends React.Component { this.renderValidateWrapper( children, this.renderHelp(), - this.renderExtra(), + this.renderExtra() ) ), ]; From 14f857b7ace56a40a09409d7fbc74a147e1b125b Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 25 Apr 2016 17:55:45 +0800 Subject: [PATCH 13/14] prevent propagation of Table rowSelection controls, close #1470, close #1507 --- components/table/index.jsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/components/table/index.jsx b/components/table/index.jsx index 8c18f77f1b..1dbf5c03ad 100644 --- a/components/table/index.jsx +++ b/components/table/index.jsx @@ -13,6 +13,11 @@ import { flatArray } from './util'; function noop() { } +function stopPropagation(e) { + e.stopPropagation(); + e.nativeEvent.stopImmediatePropagation(); +} + const defaultLocale = { filterTitle: '筛选', filterConfirm: '确定', @@ -305,7 +310,7 @@ let AntTable = React.createClass({ this.getDefaultSelection().indexOf(rowIndex) >= 0); } return ( - ); @@ -325,7 +330,7 @@ let AntTable = React.createClass({ props = this.props.rowSelection.getCheckboxProps.call(this, record); } return ( - ); }, From 0805d4365d69108f823cd0cdb5e18abb57bb9ac4 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 25 Apr 2016 19:27:02 +0800 Subject: [PATCH 14/14] update locale demo --- components/date-picker/demo/locale.md | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/components/date-picker/demo/locale.md b/components/date-picker/demo/locale.md index 3dc6764871..8e0f493f6d 100644 --- a/components/date-picker/demo/locale.md +++ b/components/date-picker/demo/locale.md @@ -2,30 +2,24 @@ - order: 10 -通过 `locale` 配置时区、语言等, 默认支持 en_US, zh_CN +通过 `locale` 配置时区、语言等, 默认支持 `en_US`,`zh_CN`。 --- ````jsx import { DatePicker } from 'antd'; import enUS from 'antd/lib/date-picker/locale/en_US'; -import assign from 'object-assign'; const App = React.createClass({ - getInitialState() { - return { - locale: assign({}, enUS, { - timezoneOffset: 0 * 60, - firstDayOfWeek: 0, - minimalDaysInFirstWeek: 1, - }) - }; - }, render() { - return ; + const customLocale = { + timezoneOffset: 0 * 60, + firstDayOfWeek: 0, + minimalDaysInFirstWeek: 1, + }; + return ; } }); ReactDOM.render(, mountNode); ```` -