From d597a6d63188cb2c19443185b43db96732f92044 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 18 Mar 2016 15:19:42 +0800 Subject: [PATCH 01/32] update deploy log --- webpack.deploy.config.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/webpack.deploy.config.js b/webpack.deploy.config.js index 0118df97cc..5f281b448c 100644 --- a/webpack.deploy.config.js +++ b/webpack.deploy.config.js @@ -8,6 +8,9 @@ config.plugins = [config.plugins[0], new webpack.optimize.UglifyJsPlugin({ sourceMap: false, output: { ascii_only: true + }, + compress: { + warnings: false } })]; From e1c2e3f1a35e3c66f95e804fecec9610ddf39ad0 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 18 Mar 2016 16:23:05 +0800 Subject: [PATCH 02/32] bump 0.12.12 --- CHANGELOG.md | 8 ++++++++ package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85ce26fd92..55cc72cd25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ --- +## 0.12.12 + +`2016-03-18` + +- [设计资源](http://ant.design/docs/resource/download)文件更新。 +- 修复 Popover 和 Popconfirm 箭头消失的问题。 +- 修复一个 Table 切换分页长度时的页码溢出的问题。 + ## 0.12.11 `2016-03-16` diff --git a/package.json b/package.json index 277b54be43..1c8ecacd5e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "antd", - "version": "0.12.11", + "version": "0.12.12", "title": "Ant Design", "description": "一个 UI 设计语言", "homepage": "http://ant.design/", From 9a937100e869dabf9be6c34ca5d63c6a99873b6a Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 19 Mar 2016 01:54:46 +0800 Subject: [PATCH 03/32] fix(docs): close #1230 --- 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 4367d24822..71f2250eff 100644 --- a/docs/pattern/navigation.md +++ b/docs/pattern/navigation.md @@ -31,8 +31,8 @@ 总结 - 一般适用在浏览性强、门户性质的网站,以及一些比较前台化的应用。 适用在操作性强、中后台管理性质的应用。 + 一般适用在浏览性强、门户性质的网站,以及一些比较前台化的应用。 From 77783d8c9bf0c0c0d80158f91c32f2a3225754c7 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 19 Mar 2016 13:54:38 +0800 Subject: [PATCH 04/32] rollback for es3ify, #858 --- docs/react/getting-started.md | 7 ++++++- webpack.config.js | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/react/getting-started.md b/docs/react/getting-started.md index 6dec916da8..992bb51367 100644 --- a/docs/react/getting-started.md +++ b/docs/react/getting-started.md @@ -102,12 +102,13 @@ Ant Design React 支持所有的现代浏览器和 IE8+。 @@ -130,6 +131,10 @@ Ant Design React 支持所有的现代浏览器和 IE8+。 ``` +另外,由于 `babel@6.x` 对 IE8 的支持不佳,你可能会遇到类似 [#28](https://github.com/ant-tool/atool-build/issues/28) 和 [#858](https://github.com/ant-design/ant-design/issues/858) 的 default 报错的问题。 + +[antd-init](http://github.com/ant-design/antd-init) 脚手架已经解决了这个问题,你也可以参照这个 [webpack 配置](https://github.com/ant-design/antd-init/blob/f5fb9479ca973fade51fd6754e50f8b3fafbb1df/boilerplate/webpack.config.js#L4-L8)。 + > 更多 IE8 下使用 React 的相关问题可以参考:https://github.com/xcatliu/react-ie8 ## 自行构建 diff --git a/webpack.config.js b/webpack.config.js index ef21c5af4e..cdf3aebe04 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -27,6 +27,10 @@ module.exports = { module: { loaders: [{ + test: /\.jsx?$/, + exclude: /node_modules/, + loader: 'es3ify' + }, { test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel', From e5a014d3a642f4654791120b4dcdcef50c94bfe8 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 19 Mar 2016 15:28:48 +0800 Subject: [PATCH 05/32] Fix combobox select error style, close #1227 --- style/components/form.less | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/style/components/form.less b/style/components/form.less index ce0c7c73ca..0e7d4ad6f3 100644 --- a/style/components/form.less +++ b/style/components/form.less @@ -391,6 +391,10 @@ form { } } + .@{select-prefix-cls}-combobox .@{select-prefix-cls}-search__field:focus { + box-shadow: none; + } + // ant-datepicker .@{calendar-prefix-cls}-picker-icon:after { color: @error-color; From 959a190d3ac81a10b66979ec572c78baaf5d4987 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 20 Mar 2016 16:25:14 +0800 Subject: [PATCH 06/32] update layout --- site/templates/layout.html | 4 ++-- webpack.config.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/site/templates/layout.html b/site/templates/layout.html index 1629b3cb0d..2b8a86f7cf 100644 --- a/site/templates/layout.html +++ b/site/templates/layout.html @@ -12,7 +12,7 @@ {% block styles %}{% endblock %} - + - + {% block scripts %}{% endblock %} diff --git a/webpack.config.js b/webpack.config.js index cdf3aebe04..c1d081a166 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -67,5 +67,5 @@ module.exports = { new webpack.NoErrorsPlugin() ], - devtool: 'source-map' + devtool: 'cheap-module-source-map' }; From 7bf88306ff14c6c200cdcfccf82a0dcaf3d1a793 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 21 Mar 2016 18:14:05 +0800 Subject: [PATCH 07/32] fix form demo --- components/form/demo/form-controls.md | 48 +++++++++++++-------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/components/form/demo/form-controls.md b/components/form/demo/form-controls.md index d616e0ede6..0a643d9725 100644 --- a/components/form/demo/form-controls.md +++ b/components/form/demo/form-controls.md @@ -53,42 +53,42 @@ ReactDOM.render( label="Checkbox 多选框:" labelCol={{ span: 6 }} wrapperCol={{ span: 18 }} > - - - + + + - - - + + + - - A - B - C - D - + + A + B + C + D + , mountNode); From 5b1005e2430a0dc972df549acdcb8796033b1e9e Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 21 Mar 2016 18:53:57 +0800 Subject: [PATCH 08/32] improve radio animation --- style/components/radio.less | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/style/components/radio.less b/style/components/radio.less index d90e3aa81f..7dc3a9f686 100644 --- a/style/components/radio.less +++ b/style/components/radio.less @@ -1,7 +1,7 @@ @radio-group-prefix-cls: ant-radio-group; @radio-prefix-cls: ant-radio; @radio-inner-prefix-cls: ~"@{radio-prefix-cls}-inner"; -@radio-duration: .3s; +@radio-duration: .2s; .@{radio-group-prefix-cls} { display: inline-block; @@ -38,7 +38,8 @@ content: ' '; background-color: @primary-color; opacity: 0; - transition: transform @radio-duration @ease-in-out-circ, opacity @radio-duration @ease-in-out-circ, background-color @radio-duration @ease-in-out-circ; + transform: scale(0); + transition: all @radio-duration @ease-in-out-circ; } position: relative; @@ -52,7 +53,7 @@ border-radius: 14px; border-color: @border-color-base; background-color: #fff; - transition: border-color @radio-duration @ease-in-out-circ, background-color @radio-duration @ease-in-out-circ; + transition: all @radio-duration @ease-in-out-circ; } &-input { @@ -74,7 +75,7 @@ &:after { transform: scale(1); opacity: 1; - transition: transform @radio-duration @ease-out-back, opacity @radio-duration @ease-in-out-circ, background-color @radio-duration @ease-in-out-circ; + transition: all @radio-duration @ease-in-out-circ; } } } From 8fa7f9aec429b2a960c27a5e4ddcd84107e4bef9 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 22 Mar 2016 00:22:35 +0800 Subject: [PATCH 09/32] update docs --- docs/react/getting-started.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/react/getting-started.md b/docs/react/getting-started.md index 992bb51367..a69377929b 100644 --- a/docs/react/getting-started.md +++ b/docs/react/getting-started.md @@ -141,6 +141,8 @@ Ant Design React 支持所有的现代浏览器和 IE8+。 如果想自己维护工作流,我们推荐使用 [webpack](http://webpack.github.io/) 进行构建和调试。理论上你可以利用 React 生态圈中的 [各种脚手架](https://github.com/enaqx/awesome-react#boilerplates) 进行开发,如果遇到问题可参考我们所使用的 [webpack 配置](https://github.com/ant-tool/atool-build/blob/master/src/getWebpackCommonConfig.js) 进行 [定制](http://ant-tool.github.io/webpack-config.htm)。 +目前社区也有很多基于 antd 定制的[脚手架](https://github.com/ant-design/ant-design/issues/129),欢迎进行试用和贡献。 + ### 改变主色系 - [配置代码示例](https://github.com/ant-design/antd-init/tree/master/examples/customize-antd-theme) From 54a878873c9f6cf2640ce79d58e4869e2ce6f666 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 22 Mar 2016 00:26:33 +0800 Subject: [PATCH 10/32] fix whitespace --- docs/react/getting-started.md | 2 +- docs/react/introduce.md | 2 +- docs/spec/introduce.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/react/getting-started.md b/docs/react/getting-started.md index a69377929b..c17731410f 100644 --- a/docs/react/getting-started.md +++ b/docs/react/getting-started.md @@ -141,7 +141,7 @@ Ant Design React 支持所有的现代浏览器和 IE8+。 如果想自己维护工作流,我们推荐使用 [webpack](http://webpack.github.io/) 进行构建和调试。理论上你可以利用 React 生态圈中的 [各种脚手架](https://github.com/enaqx/awesome-react#boilerplates) 进行开发,如果遇到问题可参考我们所使用的 [webpack 配置](https://github.com/ant-tool/atool-build/blob/master/src/getWebpackCommonConfig.js) 进行 [定制](http://ant-tool.github.io/webpack-config.htm)。 -目前社区也有很多基于 antd 定制的[脚手架](https://github.com/ant-design/ant-design/issues/129),欢迎进行试用和贡献。 +目前社区也有很多基于 antd 定制的 [脚手架](https://github.com/ant-design/ant-design/issues/129),欢迎进行试用和贡献。 ### 改变主色系 diff --git a/docs/react/introduce.md b/docs/react/introduce.md index 4360c5f993..14561eac24 100644 --- a/docs/react/introduce.md +++ b/docs/react/introduce.md @@ -86,4 +86,4 @@ import 'antd/lib/index.css'; // or 'antd/style/index.less' ## 如何贡献 -在任何形式的参与前,请先阅读 [贡献者文档](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)。 +在任何形式的参与前,请先阅读 [贡献者文档](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)。 diff --git a/docs/spec/introduce.md b/docs/spec/introduce.md index d324f45cd4..e1546d7a35 100644 --- a/docs/spec/introduce.md +++ b/docs/spec/introduce.md @@ -32,4 +32,4 @@ Ant Design 是一个致力于提升『用户』和『设计者』使用体验的 ## 如何贡献 -我们欢迎任何形式的贡献,有任何建议或意见您可以进行 [Pull Request](https://github.com/ant-design/ant-design/pulls),或者给我们[提问](https://github.com/ant-design/ant-design/issues)。 +我们欢迎任何形式的贡献,有任何建议或意见您可以进行 [Pull Request](https://github.com/ant-design/ant-design/pulls),或者给我们 [提问](https://github.com/ant-design/ant-design/issues)。 From 1e2576aeba8aa0f2f6978afa0c5bef3313d15413 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 22 Mar 2016 00:28:51 +0800 Subject: [PATCH 11/32] Add antd-ember --- docs/spec/introduce.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/spec/introduce.md b/docs/spec/introduce.md index e1546d7a35..455db6cd35 100644 --- a/docs/spec/introduce.md +++ b/docs/spec/introduce.md @@ -29,6 +29,7 @@ Ant Design 是一个致力于提升『用户』和『设计者』使用体验的 - [Ant Design of React](/docs/react/introduce)(官方实现) - [vue-antd](https://github.com/okoala/vue-antd) +- [antd-ember](https://github.com/idcos/antd-ember) ## 如何贡献 From aaeb925de1f80b2439e28c538c5efb7b0e9d8089 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 22 Mar 2016 16:21:23 +0800 Subject: [PATCH 12/32] fix(cascader): can not scroll menu in Chrome 49 --- style/components/cascader.less | 1 - 1 file changed, 1 deletion(-) diff --git a/style/components/cascader.less b/style/components/cascader.less index 584e1164b0..f02ed13c27 100644 --- a/style/components/cascader.less +++ b/style/components/cascader.less @@ -65,7 +65,6 @@ } &-menus { font-size: 12px; - overflow: hidden; background: #fff; position: absolute; border: 1px solid @border-color-base; From e4c355f6a4a6d8d901091c649fee19d1026c688a Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 22 Mar 2016 16:42:18 +0800 Subject: [PATCH 13/32] fix cascader height --- style/components/cascader.less | 1 - 1 file changed, 1 deletion(-) diff --git a/style/components/cascader.less b/style/components/cascader.less index f02ed13c27..7981521e76 100644 --- a/style/components/cascader.less +++ b/style/components/cascader.less @@ -71,7 +71,6 @@ border-radius: @border-radius-base; box-shadow: @box-shadow-base; white-space: nowrap; - height: 180px; &-empty, &-hidden { display: none; From 02807a69ad51a8d7658409ad857459424bbc05f1 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 22 Mar 2016 19:24:47 +0800 Subject: [PATCH 14/32] update some basic style --- site/static/style.less | 1 + style/components/menu.less | 1 - style/core/base.less | 9 +++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/site/static/style.less b/site/static/style.less index 4479f40205..4004406ee2 100644 --- a/site/static/style.less +++ b/site/static/style.less @@ -59,6 +59,7 @@ a:hover { background: #2db7f5; color: #fff; } + ::-moz-selection { background: #2db7f5; color: #fff; diff --git a/style/components/menu.less b/style/components/menu.less index 95c05cad64..36bd114d5b 100644 --- a/style/components/menu.less +++ b/style/components/menu.less @@ -29,7 +29,6 @@ } &-item, - &-submenu, &-submenu-title { cursor: pointer; transition: all 0.3s ease; diff --git a/style/core/base.less b/style/core/base.less index 8cb73a4fbd..977ceb302a 100644 --- a/style/core/base.less +++ b/style/core/base.less @@ -46,6 +46,14 @@ input::-ms-clear, input::-ms-reveal { display: none; } +::selection { + background: @primary-color; +} + +::-moz-selection { + background: @primary-color; +} + // Links // -- TODO -- a { @@ -54,6 +62,7 @@ a { text-decoration: none; outline: none; cursor: pointer; + transition: color .3s ease; &:hover { color: @link-hover-color; From 4614f4068f8e0f3bb418e36fa4e8ca803b64ff60 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 22 Mar 2016 20:43:57 +0800 Subject: [PATCH 15/32] update some basic style --- style/components/menu.less | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/style/components/menu.less b/style/components/menu.less index 36bd114d5b..08663df8b4 100644 --- a/style/components/menu.less +++ b/style/components/menu.less @@ -29,11 +29,16 @@ } &-item, + &-submenu, &-submenu-title { cursor: pointer; transition: all 0.3s ease; } + &-submenu &-sub { + cursor: initial; + } + &-item > a { display: block; color: @text-color; From 99a44e9b5eacd00daf9be63f9e61e062011d3345 Mon Sep 17 00:00:00 2001 From: "fanzheng.fz" Date: Wed, 23 Mar 2016 00:26:22 +0800 Subject: [PATCH 16/32] always concat paths wether there's a breadcrumbName or not --- components/breadcrumb/index.jsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/components/breadcrumb/index.jsx b/components/breadcrumb/index.jsx index f9e0f8bd23..593d8f3769 100644 --- a/components/breadcrumb/index.jsx +++ b/components/breadcrumb/index.jsx @@ -52,14 +52,6 @@ const Breadcrumb = React.createClass({ if (routes && routes.length > 0) { const paths = []; crumbs = routes.map((route, i) => { - if (!route.breadcrumbName) { - return null; - } - const name = route.breadcrumbName.replace(/\:(.*)/g, (replacement, key) => { - return params[key] || replacement; - }); - - let link; let path = route.path.replace(/^\//, ''); Object.keys(params).forEach(key => { path = path.replace(`:${key}`, params[key]); @@ -68,6 +60,14 @@ const Breadcrumb = React.createClass({ paths.push(path); } + if (!route.breadcrumbName) { + return null; + } + const name = route.breadcrumbName.replace(/\:(.*)/g, (replacement, key) => { + return params[key] || replacement; + }); + + let link; if (i === routes.length - 1) { link = {name}; } else { From 6d122fa5b12ce853bff9707160fa804a70feb961 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 23 Mar 2016 15:41:29 +0800 Subject: [PATCH 17/32] remove DatePicker auto hidden when open --- style/components/datepicker/Picker.less | 5 ----- 1 file changed, 5 deletions(-) diff --git a/style/components/datepicker/Picker.less b/style/components/datepicker/Picker.less index 0e539d613b..00ccb5f37a 100644 --- a/style/components/datepicker/Picker.less +++ b/style/components/datepicker/Picker.less @@ -38,11 +38,6 @@ outline: none; } - &-open > span:first-child { - transition: opacity 0.3s ease; - opacity: 0; - } - &-icon { position: absolute; user-select: none; From 20211d448c9af98a4bf3e27a480f9ffe9d177b11 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 23 Mar 2016 15:58:46 +0800 Subject: [PATCH 18/32] Add default width for showTime DatePicker --- components/date-picker/demo/time.md | 2 +- components/date-picker/index.jsx | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/components/date-picker/demo/time.md b/components/date-picker/demo/time.md index 81de2d224c..e7de19c240 100644 --- a/components/date-picker/demo/time.md +++ b/components/date-picker/demo/time.md @@ -14,6 +14,6 @@ function onChange(value) { } ReactDOM.render( - + , mountNode); ```` diff --git a/components/date-picker/index.jsx b/components/date-picker/index.jsx index b6dd9fb69a..9c45da4898 100644 --- a/components/date-picker/index.jsx +++ b/components/date-picker/index.jsx @@ -114,8 +114,15 @@ function createPicker(TheCalendar, defaultFormat) { if (this.state.open) { pickerClass += ' ant-calendar-picker-open'; } + + // default width for showTime + const pickerStyle = {}; + if (this.props.showTime) { + pickerStyle.width = 180; + } + return ( - + Date: Wed, 23 Mar 2016 16:25:06 +0800 Subject: [PATCH 19/32] fix undefined className --- components/time-picker/index.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/time-picker/index.jsx b/components/time-picker/index.jsx index aecc2e727f..d67dee8157 100644 --- a/components/time-picker/index.jsx +++ b/components/time-picker/index.jsx @@ -86,7 +86,7 @@ const AntTimePicker = React.createClass({ } let className = classNames({ [props.className]: !!props.className, - [`${props.prefixCls}-${props.size}`]: true, + [`${props.prefixCls}-${props.size}`]: !!props.size, }); if (props.format.indexOf('ss') < 0) { props.showSecond = false; From 7faeab678e77446e5b46c46c39fb19c233f1a231 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 23 Mar 2016 16:41:16 +0800 Subject: [PATCH 20/32] fix th text-align in IE --- style/components/table.less | 1 + 1 file changed, 1 insertion(+) diff --git a/style/components/table.less b/style/components/table.less index 9369b54eb3..42b933a947 100644 --- a/style/components/table.less +++ b/style/components/table.less @@ -26,6 +26,7 @@ font-weight: bold; transition: background .3s ease; position: relative; + text-align: left; .anticon-filter { margin-left: 4px; From fff4e01f14e99506ee28de5265f05c344ef3601a Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 23 Mar 2016 18:35:35 +0800 Subject: [PATCH 21/32] remove JSON format limit, close #1248 --- components/upload/index.jsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/components/upload/index.jsx b/components/upload/index.jsx index 60fc2a168a..7f7487c5f0 100644 --- a/components/upload/index.jsx +++ b/components/upload/index.jsx @@ -112,16 +112,11 @@ const AntUpload = React.createClass({ onSuccess(response, file) { this.clearProgressTimer(); - // 服务器端需要返回标准 json 字符串 - // 否则视为失败 try { if (typeof response === 'string') { - JSON.parse(response); + response = JSON.parse(response); } - } catch (e) { - this.onError(new Error('No response'), response, file); - return; - } + } catch (e) {/* do nothing */} let fileList = this.state.fileList; let targetItem = getFileItem(file, fileList); // 之前已经删除 From d2d82bcd5d35c8d9999a57598f5142dbadc45abf Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 23 Mar 2016 18:52:27 +0800 Subject: [PATCH 22/32] chore for style --- .gitignore | 3 ++- style/core/base.less | 6 +----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 16d51bb2c5..f22afe06b9 100644 --- a/.gitignore +++ b/.gitignore @@ -21,7 +21,8 @@ node_modules/ npm-debug.log nohup.out _site +_data dist lib elasticsearch-* -config/base.yaml \ No newline at end of file +config/base.yaml diff --git a/style/core/base.less b/style/core/base.less index 977ceb302a..6d9e756ee2 100644 --- a/style/core/base.less +++ b/style/core/base.less @@ -48,14 +48,10 @@ input::-ms-clear, input::-ms-reveal { ::selection { background: @primary-color; -} - -::-moz-selection { - background: @primary-color; + color: #fff; } // Links -// -- TODO -- a { color: @link-color; background: transparent; From ae44ce6d31e9196ed93d76c58f9675d0e0d545fb Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 24 Mar 2016 11:25:23 +0800 Subject: [PATCH 23/32] update some docs --- components/popconfirm/index.md | 4 ++-- components/popover/demo/basic.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/popconfirm/index.md b/components/popconfirm/index.md index 9cfd85810c..5198031111 100644 --- a/components/popconfirm/index.md +++ b/components/popconfirm/index.md @@ -20,9 +20,9 @@ | 参数 | 说明 | 类型 | 默认值 | |-----------|------------------------------------------|---------------|--------| | placement | 气泡框位置,可选 `top/left/right/bottom` `topLeft/topRight/bottomLeft/bottomRight` `leftTop/leftBottom/rightTop/rightBottom` | string | top | -| title | 确认框的描述 | string | 无 | +| title | 确认框的描述 | React.Element | 无 | | onConfirm | 点击确认的回调 | function | 无 | -| onCancel | 卡片内容 | function | 无 | +| onCancel | 点击取消的回调 | function | 无 | | onVisibleChange | 显示隐藏的回调 | function(visible) | 无 | | okText | 确认按钮文字 | String | 确定 | | cancelText| 取消按钮文字 | String | 取消 | diff --git a/components/popover/demo/basic.md b/components/popover/demo/basic.md index cee2bbf698..2540f89301 100644 --- a/components/popover/demo/basic.md +++ b/components/popover/demo/basic.md @@ -2,7 +2,7 @@ - order: 0 -最简单的用法。 +最简单的用法,浮层的大小由内容区域决定。 --- From 963d073f1d73d6e5416c615ec99820f6e83ef071 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 24 Mar 2016 21:30:33 +0800 Subject: [PATCH 24/32] improve api table style --- components/table/index.md | 62 +++++++++++++++++++-------------------- site/static/style.less | 5 ++++ 2 files changed, 36 insertions(+), 31 deletions(-) diff --git a/components/table/index.md b/components/table/index.md index 2a6292dbf5..259832a47e 100644 --- a/components/table/index.md +++ b/components/table/index.md @@ -54,43 +54,43 @@ const columns = [{ ### Table -| 参数 | 说明 | 类型 | 可选值 | 默认值 | -|---------------|--------------------------|-----------------|---------------------|---------| -| rowSelection | 列表项是否可选择 | Object | [配置项](#rowSelection) | null | -| pagination | 分页器 | Object | 配置项参考 [pagination](/components/pagination),设为 false 时不显示分页 | | -| size | 正常或迷你类型 | String | `default` or `small`| default | -| dataSource | 数据数组 | Array | | | -| columns | 表格列的配置描述,具体项见下表 | 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) | -| indentSize | 展示树形数据时,每层缩进的宽度,以 px 为单位 | Number | | 15 | -| onRowClick | 处理行点击事件 | Function(record, index) | | 无 | -| useFixedHeader | 是否固定表头 | Boolean | | false | -| bordered | 是否展示外边框和列边框 | Boolean | | false | -| showHeader | 是否显示表头 | Boolean | | true | -| footer | 表格底部自定义渲染函数 | Function(currentPageData) | | | +| 参数 | 说明 | 类型 | 默认值 | +|---------------|--------------------------|-----------------|---------| +| rowSelection | 列表项是否可选择,[配置项](#rowSelection) | Object | null | +| pagination | 分页器,配置项参考 [pagination](/components/pagination),设为 false 时不显示分页 | Object | | +| size | 正常或迷你类型,`default` or `small` | String | default | +| dataSource | 数据数组 | Array | | +| columns | 表格列的配置描述,具体项见下表 | 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) | +| indentSize | 展示树形数据时,每层缩进的宽度,以 px 为单位 | Number | 15 | +| onRowClick | 处理行点击事件 | Function(record, index) | - | +| useFixedHeader | 是否固定表头 | Boolean | false | +| bordered | 是否展示外边框和列边框 | Boolean | false | +| showHeader | 是否显示表头 | Boolean | true | +| footer | 表格底部自定义渲染函数 | Function(currentPageData) | | ### Column 列描述数据对象,是 columns 中的一项。 -| 参数 | 说明 | 类型 | 可选值 | 默认值 | +| 参数 | 说明 | 类型 | 默认值 | |------------|----------------------------|-----------------|---------------------|---------| -| title | 列头显示文字 | String or React.Element | | | -| key | React 需要的 key,建议设置 | String | | | -| dataIndex | 列数据在数据项中对应的 key | String | | | -| render | 生成复杂数据的渲染函数,参数分别为当前列的值,当前列数据,列索引,@return里面可以设置表格[行/列合并](#demo-colspan-rowspan) | Function(text, record, index) {} | | | -| filters | 表头的筛选菜单项 | Array | | | -| onFilter | 本地模式下,确定筛选的运行函数 | Function | | | -| filterMultiple | 是否多选 | Boolean | | true | -| sorter | 排序函数,本地排序使用一个函数,需要服务端排序可设为 true | Function or Boolean | | 无 | -| colSpan | 表头列合并,设置为 0 时,不渲染 | Number | | | -| width | 列宽度 | String or Number | | 无 | -| className | 列的 className | String | | 无 | +| title | 列头显示文字 | String or React.Element | | +| key | React 需要的 key,建议设置 | String | | +| dataIndex | 列数据在数据项中对应的 key | String | | +| render | 生成复杂数据的渲染函数,参数分别为当前列的值,当前列数据,列索引,@return里面可以设置表格[行/列合并](#demo-colspan-rowspan) | Function(text, record, index) {} | | +| filters | 表头的筛选菜单项 | Array | | +| onFilter | 本地模式下,确定筛选的运行函数 | Function | | +| filterMultiple | 是否多选 | Boolean | true | +| sorter | 排序函数,本地排序使用一个函数,需要服务端排序可设为 true | Function or Boolean | - | +| colSpan | 表头列合并,设置为 0 时,不渲染 | Number | | +| width | 列宽度 | String or Number | - | +| className | 列的 className | String | - | ### rowSelection diff --git a/site/static/style.less b/site/static/style.less index 4004406ee2..afab714618 100644 --- a/site/static/style.less +++ b/site/static/style.less @@ -668,6 +668,11 @@ footer ul li > a { margin-left: 0.5em; } +.api-container table { + font-family: consolas; + font-size: 13px; +} + .prev-next-nav { position: absolute; bottom: 0; From 68c7d3cdaa7d958dbecb84ee62e46054136f9523 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 25 Mar 2016 14:24:04 +0800 Subject: [PATCH 25/32] update form doc --- components/form/index.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/form/index.md b/components/form/index.md index 7b6bebe9fb..18283267f3 100644 --- a/components/form/index.md +++ b/components/form/index.md @@ -81,7 +81,7 @@ CustomizedForm = Form.create({})(CustomizedForm); | getFieldError | 获取某个输入控件的 Error | Function(name) | | | | isFieldValidating | 判断一个输入控件是否在校验状态 | Function(name) | | | | resetFields | 重置一组输入控件的值与状态,如不传入参数,则重置所有组件 | Function([names: string[]]) | | | -| getFieldProps 详见下面描述 | | | | | +| getFieldProps | 用于和表单进行双向绑定,详见下方描述 | | | | #### this.props.form.getFieldProps(id, options) @@ -130,8 +130,9 @@ CustomizedForm = Form.create({})(CustomizedForm); #### Input.Group ```html - // 样式类名前缀,默认是 ant-input-group,通常您不需要设置。 - {children} + + + ``` From 52ca8c1279298c8f872475ac726180c0668ecc34 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 25 Mar 2016 15:13:39 +0800 Subject: [PATCH 26/32] fix req.path error in webpack/webpack-dev-middleware#79 --- nico.js | 1 + 1 file changed, 1 insertion(+) diff --git a/nico.js b/nico.js index 4b1358eb46..9a8fa63a4f 100644 --- a/nico.js +++ b/nico.js @@ -93,6 +93,7 @@ exports.middlewares = [ name: 'webpackDevMiddleware', filter: /\.(js|css|json)(\.map)?(\?.*)?$/, handle: function(req, res, next) { + req.path = req.path || req.url; handler = handler || webpackMiddleware(webpackCompiler, { publicPath: webpackConfig.output.publicPath, lazy: false, From b0827e2d8fbd9d8069b7871af43936529ad74ced Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 25 Mar 2016 15:41:05 +0800 Subject: [PATCH 27/32] Add TimePicker locale change doc, close #1270 --- CHANGELOG.md | 1 + components/time-picker/index.md | 2 +- docs/react/upgrade-notes.md | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55cc72cd25..bf5b4b5347 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -291,6 +291,7 @@ - 移除 `animation` 属性,并在 `tabPosition="top|bottom"` 时默认启用切换动画。 - Timepicker - **重命名为 TimePicker。** + - 国际化属性 `locale` 结构发生了 [变化](https://github.com/ant-design/ant-design/issues/1270#issuecomment-201181384)。 - 新增 `value` 属性。 - 新增属性 `disabledHours` `disabledMinutes` `disabledSeconds`。[演示](http://ant.design/components/time-picker/#picker-demo-disable-options) - 移除 `hourOptions` `minuteOptions` `secondOptions`,新增 `hideDisabled` 属性用于替代。 diff --git a/components/time-picker/index.md b/components/time-picker/index.md index 42014b1eb0..b22cc60c81 100644 --- a/components/time-picker/index.md +++ b/components/time-picker/index.md @@ -34,6 +34,6 @@ API | disabledMinutes | 禁止选择部分分钟选项 | function(selectedHour) | 无 | | disabledSeconds | 禁止选择部分秒选项 | function(selectedHour, selectedMinute) | 无 | | hideDisabledOptions | 隐藏禁止选择的选项 | boolean | false | -| locale | 国际化配置 | Object | [默认配置](https://github.com/ant-design/ant-design/issues/424) | +| locale | 国际化配置 | Object | [默认配置](https://github.com/ant-design/ant-design/issues/1270#issuecomment-201181384) | diff --git a/docs/react/upgrade-notes.md b/docs/react/upgrade-notes.md index 52ba919de1..c498a3f986 100644 --- a/docs/react/upgrade-notes.md +++ b/docs/react/upgrade-notes.md @@ -77,6 +77,10 @@ import 'antd/style/index.less'; 如果无法理解受控组件,只须在发现在选中日期后 `Datepicker` 显示的值不变的情况后,把其 `value` 属性改为 `defaultValue` 即可。 +### TimePicker locale 结构改变 + +属性 `locale` 结构发生了 [变化](https://github.com/ant-design/ant-design/commit/fd1312803fd49586ded9af39d923457540c515cc#diff-fe4bfc98d91fc3dab8f391e3258622d4L1),需要将原有的属性改为现有的[结构](https://github.com/ant-design/ant-design/issues/1270#issuecomment-201181384)。 + ### 其他 - Alert 组件默认不展示样式,可以用 `showIcon` 属性添加图标。 From c4df6b940ccaf2d340d592c0e63b372e4c6e219e Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 25 Mar 2016 15:42:08 +0800 Subject: [PATCH 28/32] update docs --- docs/react/upgrade-notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/react/upgrade-notes.md b/docs/react/upgrade-notes.md index c498a3f986..592b5e3ad3 100644 --- a/docs/react/upgrade-notes.md +++ b/docs/react/upgrade-notes.md @@ -5,7 +5,7 @@ --- -这里只列出升级中的不兼容改动,其他改动见 [Changelog](/changelog)。 +此处着重列出升级中的不兼容变化和推荐改动。所有变动请见 [Changelog](/changelog)。 ## 0.11 => 0.12 From 8d3537d18615e7f8c4e34d56b3decf614bc0fc55 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 25 Mar 2016 16:00:32 +0800 Subject: [PATCH 29/32] fix chrome table border-radius, close #1271 --- style/components/table.less | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/style/components/table.less b/style/components/table.less index 42b933a947..9a17f1a8c6 100644 --- a/style/components/table.less +++ b/style/components/table.less @@ -7,6 +7,8 @@ .@{table-prefix-cls} { font-size: @font-size-base; color: @text-color; + border-radius: @border-radius-base @border-radius-base 0 0; + overflow: hidden; &-body { transition: opacity 0.3s ease; @@ -17,15 +19,12 @@ max-width: 100%; border-collapse: separate; text-align: left; - border-radius: @border-radius-base; - overflow: hidden; } th { background: @table-head-background-color; font-weight: bold; transition: background .3s ease; - position: relative; text-align: left; .anticon-filter { @@ -352,6 +351,9 @@ &-column-hidden { display: none; } + th&-column-has-prev { + position: relative; + } th&-column-has-prev, td&-column-has-prev { padding-left: 24px; From cbfb9109732e7d5c32de4d05421e14d93ef669c3 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 25 Mar 2016 19:58:57 +0800 Subject: [PATCH 30/32] fix search-input style of large size --- components/form/demo/search-input.md | 4 ++-- style/components/form.less | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/components/form/demo/search-input.md b/components/form/demo/search-input.md index 9efbada08f..8935567d3a 100644 --- a/components/form/demo/search-input.md +++ b/components/form/demo/search-input.md @@ -16,7 +16,7 @@ const SearchInput = React.createClass({ getInitialState() { return { value: '', - focus: false + focus: false, }; }, handleInputChange(e) { @@ -48,7 +48,7 @@ const SearchInput = React.createClass({
-
diff --git a/style/components/form.less b/style/components/form.less index 0e7d4ad6f3..78fe4e65d1 100644 --- a/style/components/form.less +++ b/style/components/form.less @@ -204,7 +204,8 @@ form { .ant-search-btn { .btn-default; border-radius: 0 @border-radius-base - 1 @border-radius-base - 1 0; - margin-left: -30px; + margin-left: -100%; + left: -1px; position: relative; border-width: 0 0 0 1px; z-index: 2; From 009c20530ed3e6319ad3148b8e6ffa6c11a4966d Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 28 Mar 2016 11:29:20 +0800 Subject: [PATCH 31/32] slow down tabs effect speed --- style/components/tabs.less | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/style/components/tabs.less b/style/components/tabs.less index f47ce3481d..8b9d841cbe 100644 --- a/style/components/tabs.less +++ b/style/components/tabs.less @@ -1,7 +1,5 @@ @tab-prefix-cls: ant-tabs; -@effect-duration: .3s; - .@{tab-prefix-cls} { box-sizing: border-box; position: relative; @@ -223,6 +221,7 @@ animation-play-state: paused; animation-timing-function: @ease-in-out-quint; opacity: 0; + animation-duration: 0.4s; } &-slide-horizontal-backward-enter&-slide-horizontal-backward-enter-active { @@ -240,6 +239,7 @@ .motion-common(); animation-play-state: paused; animation-timing-function: @ease-in-out-quint; + animation-duration: 0.4s; } &-slide-horizontal-backward-leave&-slide-horizontal-backward-leave-active { @@ -253,6 +253,7 @@ animation-play-state: paused; animation-timing-function: @ease-in-out-quint; opacity: 0; + animation-duration: 0.4s; } &-slide-horizontal-forward-enter&-slide-horizontal-forward-enter-active { @@ -268,6 +269,7 @@ left: 0; bottom: 0; .motion-common(); + animation-duration: 0.4s; animation-play-state: paused; animation-timing-function: @ease-in-out-quint; } From 127f893619222dba9e7721833c7f65077d39ab86 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 28 Mar 2016 13:44:50 +0800 Subject: [PATCH 32/32] Add Table rowClassName into document --- components/table/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/components/table/index.md b/components/table/index.md index 259832a47e..7d99433577 100644 --- a/components/table/index.md +++ b/components/table/index.md @@ -62,6 +62,7 @@ const columns = [{ | dataSource | 数据数组 | Array | | | columns | 表格列的配置描述,具体项见下表 | Array | - | | rowKey | 表格行 key 的取值 | Function(record, index):string | record.key | +| rowClassName | 表格行的类名 | Function(record, index):string | - | | expandedRowRender | 额外的展开行 | Function | - | | defaultExpandedRowKeys | 默认展开的行 | Array | - | | onChange | 分页、排序、筛选变化时触发 | Function(pagination, filters, sorter) | |