diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index f7c3a3ccef..bf7b9bbc2f 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -17,6 +17,27 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi --- +## 2.12.6 + +`2017-08-11` + +- Fix Collapse arrow position in IE9/10/11. [af9dc73](https://github.com/ant-design/ant-design/commit/af9dc73eef2aac3e68fdfc99f9231153437f5068) +- Fix empty Table scrollBar's position. [#7142](https://github.com/ant-design/ant-design/issues/7142) +- Fix RangePicker Input's style of height. [47c5de2](https://github.com/ant-design/ant-design/commit/47c5de29f370a77fc19a6a8eda8ac57476f312a6) +- Card + - Improve Card.Grid style of collapse border. [807b573](https://github.com/ant-design/ant-design/commit/807b573bff43bc71115afeb086f565561807a32d) + - Fix the `no-animation` type's className. [#7185](https://github.com/ant-design/ant-design/issues/7185) +- Fix Input Safari text align. [#7135](https://github.com/ant-design/ant-design/issues/7135) +- Layout + - Fix stretched layout by content. [500b222](https://github.com/ant-design/ant-design/commit/500b2225567f03397d9faec5f4e60a8f35fc4d28) + - Fix the collapse trigger's position. [f689ede](https://github.com/ant-design/ant-design/commit/f689ede0fa836dd0d99f4e4d96e0c43d0ff19742) +- Fix Upload doesn't handle some error scenarios which response is not a string. [#6818](https://github.com/ant-design/ant-design/issues/6818) +- Form + - Add `validateFirst` prop of docs. [#6959](https://github.com/ant-design/ant-design/issues/6959) + - Fix `wrappedComponentRef`. [#6545](https://github.com/ant-design/ant-design/issues/6545) + - Add FormCreateOption's generic type. [#7119](https://github.com/ant-design/ant-design/pull/7119) [@djyde](https://github.com/djyde) + - Fix `square` font size to `@form-feedback-icon-size`. [9bcde59](https://github.com/ant-design/ant-design/commit/9bcde590015855a12fdee851cf4e4836d0195cd7) + ## 2.12.5 `2017-08-07` diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index 3e23a3a8b0..c972904cb3 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -17,6 +17,27 @@ timeline: true --- +## 2.12.6 + +`2017-08-11` + +- 修复了在 IE9/10/11 下 Collapse 的箭头位置不正确的问题。[af9dc73](https://github.com/ant-design/ant-design/commit/af9dc73eef2aac3e68fdfc99f9231153437f5068) +- 修复了 Table 为空表格时滚动条展示位置不正确的问题。[#7142](https://github.com/ant-design/ant-design/issues/7142) +- 修复了 RangePicker Input 的高度。[47c5de2](https://github.com/ant-design/ant-design/commit/47c5de29f370a77fc19a6a8eda8ac57476f312a6) +- Card + - 优化了 Card.Grid 边框覆盖的样式。[807b573](https://github.com/ant-design/ant-design/commit/807b573bff43bc71115afeb086f565561807a32d) + - 修复了对应 `no-animation` 类型的 className。[#7185](https://github.com/ant-design/ant-design/issues/7185) +- 修复了 Input Safari 下文本对齐的问题。[#7135](https://github.com/ant-design/ant-design/issues/7135) +- Layout + - 修复了组件的拉伸展示问题。[500b222](https://github.com/ant-design/ant-design/commit/500b2225567f03397d9faec5f4e60a8f35fc4d28) + - 修复了折叠箭头的位置。[f689ede](https://github.com/ant-design/ant-design/commit/f689ede0fa836dd0d99f4e4d96e0c43d0ff19742) +- 修复了 Upload 的 response 不是 string 的情况下没有处理错误提示信息的问题。[#6818](https://github.com/ant-design/ant-design/issues/6818) +- Form + - 补充了文档中缺少的 `validateFirst` 属性描述。[#6959](https://github.com/ant-design/ant-design/issues/6959) + - 修复了 `wrappedComponentRef`。[#6545](https://github.com/ant-design/ant-design/issues/6545) + - 补充了 FormCreateOption 的 `generic type`。[#7119](https://github.com/ant-design/ant-design/pull/7119) [@djyde](https://github.com/djyde) + - 修改了 `square` 的字体大小为 `@form-feedback-icon-size`。[9bcde59](https://github.com/ant-design/ant-design/commit/9bcde590015855a12fdee851cf4e4836d0195cd7) + ## 2.12.5 `2017-08-07` diff --git a/README-zh_CN.md b/README-zh_CN.md index 453cc10bc8..57e764012d 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -56,7 +56,7 @@ ReactDOM.render(, mountNode); import 'antd/dist/antd.css'; // or 'antd/dist/antd.less' ``` -按需加载可通过此写法 `import DatePicker from 'antd/lib/date-picker'` 或使用插件 [babel-plugin-import](https://github.com/ant-design/babel-plugin-import)。 +按需加载可通过此写法 `import DatePicker from 'antd/lib/date-picker'` 或使用 Babel 插件 [babel-plugin-import](https://github.com/ant-design/babel-plugin-import),或使用 TypeScript 插件 [ts-import-plugin](https://github.com/Brooooooklyn/ts-import-plugin)。 ## TypeScript diff --git a/README.md b/README.md index 0dfead0d00..fd73de833f 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ An enterprise-class UI design language and React-based implementation. ## Let's build a better antd together [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) -`antd` is an open source project, improvements are welcomed. If you are interested in contributing to `antd`, you can watch this repository, join in [discussion](https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3ADiscussion), or try to implement some [features which have been accepted](https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3A%22PR+welcome%22). Actually, there are [many ways](https://opensource.guide/how-to-contribute/) to contribute. And we are always happy to [offer collaborator permission](https://github.com/ant-design/ant-design/issues/3222) for some active contributors. +`antd` is an open source project; improvements are welcomed. If you are interested in contributing to `antd`, you can watch this repository, join in [discussion](https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3ADiscussion), or try to implement some [features which have been accepted](https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3A%22PR+welcome%22). Actually, there are [many ways](https://opensource.guide/how-to-contribute/) to contribute. And we are always happy to [offer collaborator permission](https://github.com/ant-design/ant-design/issues/3222) for some active contributors. ## Install @@ -101,6 +101,19 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less' > - set `allowSyntheticDefaultImports` to prevent `error TS1192: Module 'react' has no default export`. > - Don't use @types/antd, antd provide a built-in ts definition already. +#### Use [ts-import-plugin](https://github.com/Brooooooklyn/ts-import-plugin) with modularized antd + + ```js + { + loader: "ts-loader", // or awesome-typescript-loader + options { + getCustomTransformers: () => ({ + before: [ tsImportPluginFactory({ libraryName: "antd", style: "css" }) ] + }) + } + } + ``` + ## Internationalization See [i18n](http://ant.design/docs/react/i18n). @@ -135,4 +148,4 @@ Open your browser and visit http://127.0.0.1:8001 , see more at https://github.c ## Contributing -We welcome all contributions, please read our [CONTRIBUTING.md](https://github.com/ant-design/ant-design/blob/master/.github/CONTRIBUTING.md) first. You can submit any ideas as [pull requests](https://github.com/ant-design/ant-design/pulls) or as [GitHub issues](https://github.com/ant-design/ant-design/issues). If you'd like to improve code, check out the [Development Instructions](https://github.com/ant-design/ant-design/wiki/Development) and have a good time! :) +We welcome all contributions. Please read our [CONTRIBUTING.md](https://github.com/ant-design/ant-design/blob/master/.github/CONTRIBUTING.md) first. You can submit any ideas as [pull requests](https://github.com/ant-design/ant-design/pulls) or as [GitHub issues](https://github.com/ant-design/ant-design/issues). If you'd like to improve code, check out the [Development Instructions](https://github.com/ant-design/ant-design/wiki/Development) and have a good time! :) diff --git a/components/button/button.tsx b/components/button/button.tsx index 340c1fb921..a4d300ecb3 100644 --- a/components/button/button.tsx +++ b/components/button/button.tsx @@ -122,13 +122,6 @@ export default class Button extends React.Component { } } - // Handle auto focus when click button in Chrome - handleMouseUp = (e: React.MouseEvent) => { - if (this.props.onMouseUp) { - this.props.onMouseUp(e); - } - } - render() { const { type, shape, size = '', className, htmlType, children, icon, prefixCls, ghost, ...others, @@ -169,7 +162,6 @@ export default class Button extends React.Component { {...omit(others, ['loading', 'clicked'])} type={htmlType || 'button'} className={classes} - onMouseUp={this.handleMouseUp} onClick={this.handleClick} > {iconNode}{kids} diff --git a/components/card/index.tsx b/components/card/index.tsx index f317082271..6a4ec4b59b 100644 --- a/components/card/index.tsx +++ b/components/card/index.tsx @@ -33,7 +33,7 @@ export interface CardProps { onTabChange?: (key: string) => void; } -export default class Card extends Component { +export default class Card extends Component { static Grid: typeof Grid = Grid; static Meta: typeof Meta = Meta; container: HTMLDivElement; diff --git a/components/carousel/__tests__/index.test.js b/components/carousel/__tests__/index.test.js new file mode 100644 index 0000000000..356c4412b2 --- /dev/null +++ b/components/carousel/__tests__/index.test.js @@ -0,0 +1,13 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import Carousel from '..'; + +describe('Carousel', () => { + it('should has innerSlider', () => { + const wrapper = mount(
); + const innerSlider = wrapper.node.innerSlider; + const innerSliderFromRefs = wrapper.node.refs.slick.innerSlider; + expect(innerSlider).toBe(innerSliderFromRefs); + expect(typeof innerSlider.slickNext).toBe('function'); + }); +}); diff --git a/components/carousel/index.tsx b/components/carousel/index.tsx index aa3a8436f5..7af5d59928 100644 --- a/components/carousel/index.tsx +++ b/components/carousel/index.tsx @@ -75,6 +75,8 @@ export default class Carousel extends React.Component { slick: any, }; + innerSlider: any; + constructor() { super(); this.onWindowResized = debounce(this.onWindowResized, 500, { @@ -87,6 +89,9 @@ export default class Carousel extends React.Component { if (autoplay) { window.addEventListener('resize', this.onWindowResized); } + const { slick } = this.refs; + // https://github.com/ant-design/ant-design/issues/7191 + this.innerSlider = slick && slick.innerSlider; } componentWillUnmount() { diff --git a/components/cascader/index.en-US.md b/components/cascader/index.en-US.md index af9f0aae83..44128ce488 100644 --- a/components/cascader/index.en-US.md +++ b/components/cascader/index.en-US.md @@ -25,6 +25,7 @@ Cascade selection box. | defaultValue | initial selected value | [CascaderOptionType](https://git.io/vMMoK)[] |[] | | value | selected value | [CascaderOptionType](https://git.io/vMMoK)[] | - | | onChange | callback when finishing cascader select | `(value, selectedOptions) => void` | - | +| onPopupVisibleChange | callback when popup shown or hidden | `(value) => void` | - | | displayRender | render function of displaying selected options | `(label, selectedOptions) => ReactNode` | `label => label.join(' / ')` | | style | additional style | string | - | | className | additional css class | string | - | diff --git a/components/cascader/index.zh-CN.md b/components/cascader/index.zh-CN.md index fc822144d8..c9350cca90 100644 --- a/components/cascader/index.zh-CN.md +++ b/components/cascader/index.zh-CN.md @@ -26,6 +26,7 @@ subtitle: 级联选择 | defaultValue | 默认的选中项 | [CascaderOptionType](https://git.io/vMMoK)[] |[] | | value | 指定选中项 | [CascaderOptionType](https://git.io/vMMoK)[] | - | | onChange | 选择完成后的回调 | `(value, selectedOptions) => void` | - | +| onPopupVisibleChange | 显示/隐藏浮层的回调 | `(value) => void` | - | | displayRender | 选择后展示的渲染函数 | `(label, selectedOptions) => ReactNode` | `label => label.join(' / ')` | | style | 自定义样式 | string | - | | className | 自定义类名 | string | - | diff --git a/components/collapse/style/index.less b/components/collapse/style/index.less index 11e15dd4c7..10c36c02f2 100644 --- a/components/collapse/style/index.less +++ b/components/collapse/style/index.less @@ -49,10 +49,6 @@ transition: transform 0.24s; top: 0; left: 16px; - /* stylelint-disable declaration-block-no-duplicate-properties */ - top: ~"16px \9"; - left: ~"0 \9"; - /* stylelint-enable declaration-block-no-duplicate-properties */ &:before { content: "\E61F"; } diff --git a/components/grid/index.en-US.md b/components/grid/index.en-US.md index bd370715d2..565e32d2a4 100644 --- a/components/grid/index.en-US.md +++ b/components/grid/index.en-US.md @@ -110,4 +110,4 @@ Ant Design layout component if it can not meet your needs, you can use the excel | lg | `≥1200px`, could be a `span` value or a object contain above props | number\|object | - | | xl | `≥1600px`, could be a `span` value or a object contain above props | number\|object | - | -The breakpoints of responsive grid follow [BootStrap 3 media queries rules](http://getbootstrap.com/css/#grid-media-queries)(not contain `occasionally part`). +The breakpoints of responsive grid follow [BootStrap 3 media queries rules](https://getbootstrap.com/docs/3.3/css/#responsive-utilities-classes)(not contain `occasionally part`). diff --git a/components/grid/index.zh-CN.md b/components/grid/index.zh-CN.md index c36896cb3e..56d2316464 100644 --- a/components/grid/index.zh-CN.md +++ b/components/grid/index.zh-CN.md @@ -109,4 +109,4 @@ Ant Design 的布局组件若不能满足你的需求,你也可以直接使用 | lg | `≥1200px` 响应式栅格,可为栅格数或一个包含其他属性的对象 | number\|object | - | | xl | `≥1600px` 响应式栅格,可为栅格数或一个包含其他属性的对象 | number\|object | - | -响应式栅格的断点遵循了 [BootStrap 3 的规则](http://getbootstrap.com/css/#grid-media-queries)(不包含链接里 `occasionally` 的部分)。 +响应式栅格的断点遵循了 [BootStrap 3 的规则](https://getbootstrap.com/docs/3.3/css/#responsive-utilities-classes)(不包含链接里 `occasionally` 的部分)。 diff --git a/components/layout/Sider.tsx b/components/layout/Sider.tsx index 52745aefd7..f0b4d11895 100644 --- a/components/layout/Sider.tsx +++ b/components/layout/Sider.tsx @@ -161,7 +161,7 @@ export default class Sider extends React.Component { const triggerDom = ( trigger !== null ? zeroWidthTrigger || ( -
+
{trigger || defaultTrigger}
) : null diff --git a/components/layout/__tests__/__snapshots__/demo.test.js.snap b/components/layout/__tests__/__snapshots__/demo.test.js.snap index ccca8cead3..55ea4ecb1c 100644 --- a/components/layout/__tests__/__snapshots__/demo.test.js.snap +++ b/components/layout/__tests__/__snapshots__/demo.test.js.snap @@ -785,6 +785,7 @@ exports[`renders ./components/layout/demo/side.md correctly 1`] = `
Team 1 Team 2 - + File diff --git a/components/layout/style/index.less b/components/layout/style/index.less index ff8ecc1d84..c268d1411a 100644 --- a/components/layout/style/index.less +++ b/components/layout/style/index.less @@ -56,15 +56,15 @@ } &-trigger { - position: absolute; + position: fixed; text-align: center; - width: 100%; bottom: 0; cursor: pointer; height: @layout-trigger-height; line-height: @layout-trigger-height; - background: @layout-trigger-background; color: @layout-trigger-color; + background: fade(@layout-trigger-background, 100); + z-index: 1; } &-zero-width { diff --git a/components/select/__tests__/__snapshots__/demo.test.js.snap b/components/select/__tests__/__snapshots__/demo.test.js.snap index 1c815a38a5..229a90729c 100644 --- a/components/select/__tests__/__snapshots__/demo.test.js.snap +++ b/components/select/__tests__/__snapshots__/demo.test.js.snap @@ -848,6 +848,13 @@ exports[`renders ./components/select/demo/tags.md correctly 1`] = `
+
+ 标签模式 +