diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000000..00e889fe0e --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,8 @@ +ports: +- port: 8001 + onOpen: open-preview +tasks: +- before: > + export DEV_HOST=$(gp url 8001) + init: npm install + command: npm start diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 439b68f337..50b99de29e 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -15,6 +15,14 @@ timeline: true --- +## 3.13.2 + +`2019-02-07` + +- 🐞 Fix Table ajax render only display data on first page. [#14724](https://github.com/ant-design/ant-design/pull/14724) [@imhele](https://github.com/imhele) +- 🐞 Adjust font style to fix display issue in IE. [#14708](https://github.com/ant-design/ant-design/pull/14708) [@ashearer](https://github.com/ashearer) +- 🐞 Fix Input not hide clear button when value is `null`. [#14733](https://github.com/ant-design/ant-design/pull/14733) [@thilo-behnke](https://github.com/thilo-behnke) + ## 3.13.1 `2019-02-04` @@ -34,7 +42,7 @@ timeline: true - 🐞 Fix when being triggered by label even upload button don't display. [#14619](https://github.com/ant-design/ant-design/pull/14619) [#14298](https://github.com/ant-design/ant-design/issues/14298) - 🐞 Fix Dropdown pseudo class style which causes the overlay non-clickable. [#14604](https://github.com/ant-design/ant-design/pull/14604) [@shawtung](https://github.com/shawtung) - 💄 Improve Checkbox the style for check don't align center in some cases. [#14619](https://github.com/ant-design/ant-design/pull/14619) [#14271](https://github.com/ant-design/ant-design/issues/14271) -- 🐞 Fix Avatar change `src` not trigger reload if prev image load failed. [#14606](https://github.com/ant-design/ant-design/pull/14606) [@AhmedAlSammany](https://github.com/AhmedAlSammany) +- 🐞 Fix Avatar change `src` not trigger reload if previous image load failed. [#14606](https://github.com/ant-design/ant-design/pull/14606) [@AhmedAlSammany](https://github.com/AhmedAlSammany) - 🐞 Fix Modal `destroy` logic not process correctly. [#14600](https://github.com/ant-design/ant-design/pull/14600) [@xu-snow](https://github.com/xu-snow) - 🐞 Fix Tooltip arrow not align when the content of `title` is less. [#14667](https://github.com/ant-design/ant-design/pull/14667) [@Yangzhedi](https://github.com/Yangzhedi) - Calendar @@ -60,7 +68,7 @@ timeline: true - 🌟 Add `expandIcon` to allow customization of Collapse icon. [#14060](https://github.com/ant-design/ant-design/pull/14060) - ConfigProvider - 🌟 Support Content Security Policy (CSP) config. [#14222](https://github.com/ant-design/ant-design/pull/14222) - - 🌟 Support `autoInsertSpaceInButton` to remove space between 2 chinese characters on Button. [#14230](https://github.com/ant-design/ant-design/pull/14230) + - 🌟 Support `autoInsertSpaceInButton` to remove space between 2 Chinese characters on Button. [#14230](https://github.com/ant-design/ant-design/pull/14230) - DatePicker - 🌟 Will read format as default format in locale if provided. [#14340](https://github.com/ant-design/ant-design/pull/14340) - Tabs diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index b6adc314a0..0ea5110a3a 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -15,6 +15,14 @@ timeline: true --- +## 3.13.2 + +`2019-02-07` + +- 🐞 修复 Table 异步时只有第一页能展示数据的问题。[#14724](https://github.com/ant-design/ant-design/pull/14724) [@imhele](https://github.com/imhele) +- 🐞 调整字体样式以适配旧版 IE 下的展示问题。[#14708](https://github.com/ant-design/ant-design/pull/14708) [@ashearer](https://github.com/ashearer) +- 🐞 修复 Input 值为 `null` 时,清除按钮不消失的问题。[#14733](https://github.com/ant-design/ant-design/pull/14733) [@thilo-behnke](https://github.com/thilo-behnke) + ## 3.13.1 `2019-02-04` diff --git a/README-zh_CN.md b/README-zh_CN.md index cd64639203..4b0a17a7cc 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -15,12 +15,14 @@ [![Codecov](https://img.shields.io/codecov/c/github/ant-design/ant-design/master.svg?style=flat-square)](https://codecov.io/gh/ant-design/ant-design/branch/master) [![npm package](https://img.shields.io/npm/v/antd.svg?style=flat-square)](https://www.npmjs.org/package/antd) [![NPM downloads](http://img.shields.io/npm/dm/antd.svg?style=flat-square)](http://npmjs.com/antd) -[![Issues need help](https://flat.badgen.net/github/label-issues/ant-design/ant-design/help%20wanted/open)](https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) [![Dependencies](https://img.shields.io/david/ant-design/ant-design.svg?style=flat-square)](https://david-dm.org/ant-design/ant-design) [![DevDependencies](https://img.shields.io/david/dev/ant-design/ant-design.svg?style=flat-square)](https://david-dm.org/ant-design/ant-design?type=dev) [![Total alerts](https://flat.badgen.net/lgtm/alerts/g/ant-design/ant-design)](https://lgtm.com/projects/g/ant-design/ant-design/alerts/) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fant-design%2Fant-design.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fant-design%2Fant-design?ref=badge_shield) +[![Issues need help](https://flat.badgen.net/github/label-issues/ant-design/ant-design/help%20wanted/open)](https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) + +[![](https://img.shields.io/twitter/follow/AntDesignUI.svg?label=Ant%20Design&style=social)](https://twitter.com/AntDesignUI) [![Gitter](https://img.shields.io/gitter/room/ant-design/ant-design-english.svg?style=flat-square&logoWidth=20&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjEyMzUiIGhlaWdodD0iNjUwIiB2aWV3Qm94PSIwIDAgNzQxMCAzOTAwIj4NCjxyZWN0IHdpZHRoPSI3NDEwIiBoZWlnaHQ9IjM5MDAiIGZpbGw9IiNiMjIyMzQiLz4NCjxwYXRoIGQ9Ik0wLDQ1MEg3NDEwbTAsNjAwSDBtMCw2MDBINzQxMG0wLDYwMEgwbTAsNjAwSDc0MTBtMCw2MDBIMCIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjMwMCIvPg0KPHJlY3Qgd2lkdGg9IjI5NjQiIGhlaWdodD0iMjEwMCIgZmlsbD0iIzNjM2I2ZSIvPg0KPGcgZmlsbD0iI2ZmZiI%2BDQo8ZyBpZD0iczE4Ij4NCjxnIGlkPSJzOSI%2BDQo8ZyBpZD0iczUiPg0KPGcgaWQ9InM0Ij4NCjxwYXRoIGlkPSJzIiBkPSJNMjQ3LDkwIDMxNy41MzQyMzAsMzA3LjA4MjAzOSAxMzIuODczMjE4LDE3Mi45MTc5NjFIMzYxLjEyNjc4MkwxNzYuNDY1NzcwLDMwNy4wODIwMzl6Ii8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB5PSI0MjAiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHk9Ijg0MCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTI2MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTY4MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjczQiIHg9IjI0NyIgeT0iMjEwIi8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzOSIgeD0iNDk0Ii8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzMTgiIHg9Ijk4OCIvPg0KPHVzZSB4bGluazpocmVmPSIjczkiIHg9IjE5NzYiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3M1IiB4PSIyNDcwIi8%2BDQo8L2c%2BDQo8L3N2Zz4%3D)](https://gitter.im/ant-design/ant-design-english?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Join the chat at https://gitter.im/ant-design/ant-design](https://img.shields.io/gitter/room/ant-design/ant-design.svg?style=flat-square&logoWidth=20&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjkwMCIgaGVpZ2h0PSI2MDAiIHZpZXdCb3g9IjAgMCAzMCAyMCI%2BDQo8ZGVmcz4NCjxwYXRoIGlkPSJzIiBkPSJNMCwtMSAwLjU4Nzc4NSwwLjgwOTAxNyAtMC45NTEwNTcsLTAuMzA5MDE3SDAuOTUxMDU3TC0wLjU4Nzc4NSwwLjgwOTAxN3oiIGZpbGw9IiNmZmRlMDAiLz4NCjwvZGVmcz4NCjxyZWN0IHdpZHRoPSIzMCIgaGVpZ2h0PSIyMCIgZmlsbD0iI2RlMjkxMCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNSw1KSBzY2FsZSgzKSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsMikgcm90YXRlKDIzLjAzNjI0MykiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEyLDQpIHJvdGF0ZSg0NS44Njk4OTgpIi8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMiw3KSByb3RhdGUoNjkuOTQ1Mzk2KSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsOSkgcm90YXRlKDIwLjY1OTgwOCkiLz4NCjwvc3ZnPg%3D%3D)](https://gitter.im/ant-design/ant-design?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) @@ -101,6 +103,12 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less' ## ⌨️ 本地开发 +你可以使用 Gitpod 进行在线开发: + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/ant-design/ant-design) + +或者克隆到本地开发: + ```bash $ git clone git@github.com:ant-design/ant-design.git $ cd ant-design diff --git a/README.md b/README.md index 5e97a53468..961ce94125 100644 --- a/README.md +++ b/README.md @@ -15,12 +15,14 @@ An enterprise-class UI design language and React implementation. [![Codecov](https://img.shields.io/codecov/c/github/ant-design/ant-design/master.svg?style=flat-square)](https://codecov.io/gh/ant-design/ant-design/branch/master) [![npm package](https://img.shields.io/npm/v/antd.svg?style=flat-square)](https://www.npmjs.org/package/antd) [![NPM downloads](http://img.shields.io/npm/dm/antd.svg?style=flat-square)](http://npmjs.com/antd) -[![Issues need help](https://flat.badgen.net/github/label-issues/ant-design/ant-design/help%20wanted/open)](https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) [![Dependencies](https://img.shields.io/david/ant-design/ant-design.svg?style=flat-square)](https://david-dm.org/ant-design/ant-design) [![DevDependencies](https://img.shields.io/david/dev/ant-design/ant-design.svg?style=flat-square)](https://david-dm.org/ant-design/ant-design?type=dev) [![Total alerts](https://flat.badgen.net/lgtm/alerts/g/ant-design/ant-design)](https://lgtm.com/projects/g/ant-design/ant-design/alerts/) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fant-design%2Fant-design.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fant-design%2Fant-design?ref=badge_shield) +[![Issues need help](https://flat.badgen.net/github/label-issues/ant-design/ant-design/help%20wanted/open)](https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) + +[![](https://img.shields.io/twitter/follow/AntDesignUI.svg?label=Ant%20Design&style=social)](https://twitter.com/AntDesignUI) [![Gitter](https://img.shields.io/gitter/room/ant-design/ant-design-english.svg?style=flat-square&logoWidth=20&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjEyMzUiIGhlaWdodD0iNjUwIiB2aWV3Qm94PSIwIDAgNzQxMCAzOTAwIj4NCjxyZWN0IHdpZHRoPSI3NDEwIiBoZWlnaHQ9IjM5MDAiIGZpbGw9IiNiMjIyMzQiLz4NCjxwYXRoIGQ9Ik0wLDQ1MEg3NDEwbTAsNjAwSDBtMCw2MDBINzQxMG0wLDYwMEgwbTAsNjAwSDc0MTBtMCw2MDBIMCIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjMwMCIvPg0KPHJlY3Qgd2lkdGg9IjI5NjQiIGhlaWdodD0iMjEwMCIgZmlsbD0iIzNjM2I2ZSIvPg0KPGcgZmlsbD0iI2ZmZiI%2BDQo8ZyBpZD0iczE4Ij4NCjxnIGlkPSJzOSI%2BDQo8ZyBpZD0iczUiPg0KPGcgaWQ9InM0Ij4NCjxwYXRoIGlkPSJzIiBkPSJNMjQ3LDkwIDMxNy41MzQyMzAsMzA3LjA4MjAzOSAxMzIuODczMjE4LDE3Mi45MTc5NjFIMzYxLjEyNjc4MkwxNzYuNDY1NzcwLDMwNy4wODIwMzl6Ii8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB5PSI0MjAiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHk9Ijg0MCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTI2MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTY4MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjczQiIHg9IjI0NyIgeT0iMjEwIi8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzOSIgeD0iNDk0Ii8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzMTgiIHg9Ijk4OCIvPg0KPHVzZSB4bGluazpocmVmPSIjczkiIHg9IjE5NzYiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3M1IiB4PSIyNDcwIi8%2BDQo8L2c%2BDQo8L3N2Zz4%3D)](https://gitter.im/ant-design/ant-design-english?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Join the chat at https://gitter.im/ant-design/ant-design](https://img.shields.io/gitter/room/ant-design/ant-design.svg?style=flat-square&logoWidth=20&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjkwMCIgaGVpZ2h0PSI2MDAiIHZpZXdCb3g9IjAgMCAzMCAyMCI%2BDQo8ZGVmcz4NCjxwYXRoIGlkPSJzIiBkPSJNMCwtMSAwLjU4Nzc4NSwwLjgwOTAxNyAtMC45NTEwNTcsLTAuMzA5MDE3SDAuOTUxMDU3TC0wLjU4Nzc4NSwwLjgwOTAxN3oiIGZpbGw9IiNmZmRlMDAiLz4NCjwvZGVmcz4NCjxyZWN0IHdpZHRoPSIzMCIgaGVpZ2h0PSIyMCIgZmlsbD0iI2RlMjkxMCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNSw1KSBzY2FsZSgzKSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsMikgcm90YXRlKDIzLjAzNjI0MykiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEyLDQpIHJvdGF0ZSg0NS44Njk4OTgpIi8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMiw3KSByb3RhdGUoNjkuOTQ1Mzk2KSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsOSkgcm90YXRlKDIwLjY1OTgwOCkiLz4NCjwvc3ZnPg%3D%3D)](https://gitter.im/ant-design/ant-design?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) @@ -100,6 +102,12 @@ See [i18n](http://ant.design/docs/react/i18n). ## ⌨️ Development +Use Gitpod, a free online dev environment for GitHub. + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/ant-design/ant-design) + +Or clone locally: + ```bash $ git clone git@github.com:ant-design/ant-design.git $ cd ant-design diff --git a/components/avatar/index.en-US.md b/components/avatar/index.en-US.md index 263f143540..7a08346079 100644 --- a/components/avatar/index.en-US.md +++ b/components/avatar/index.en-US.md @@ -16,4 +16,4 @@ Avatars can be used to represent people or objects. It supports images, `Icon`s, | src | the address of the image for an image avatar | string | - | | srcSet | a list of sources to use for different screen resolutions | string | - | | alt | This attribute defines the alternative text describing the image | string | - | -| onError | handler when img load error,return false to prevent default fallback behavior | () => boolean | - | +| onError | handler when img load error, return false to prevent default fallback behavior | () => boolean | - | diff --git a/components/checkbox/Checkbox.tsx b/components/checkbox/Checkbox.tsx index f621a1a384..333831edf0 100644 --- a/components/checkbox/Checkbox.tsx +++ b/components/checkbox/Checkbox.tsx @@ -14,6 +14,7 @@ export interface AbstractCheckboxProps { style?: React.CSSProperties; disabled?: boolean; onChange?: (e: T) => void; + onClick?: React.MouseEventHandler; onMouseEnter?: React.MouseEventHandler; onMouseLeave?: React.MouseEventHandler; onKeyPress?: React.KeyboardEventHandler; diff --git a/components/form/__tests__/__snapshots__/demo.test.js.snap b/components/form/__tests__/__snapshots__/demo.test.js.snap index 94c0b169e4..bda91a61c5 100644 --- a/components/form/__tests__/__snapshots__/demo.test.js.snap +++ b/components/form/__tests__/__snapshots__/demo.test.js.snap @@ -2925,37 +2925,37 @@ exports[`renders ./components/form/demo/validate-other.md correctly 1`] = ` > A B C D E F diff --git a/components/form/index.en-US.md b/components/form/index.en-US.md index 82b54d9784..259877fbbe 100644 --- a/components/form/index.en-US.md +++ b/components/form/index.en-US.md @@ -152,7 +152,7 @@ To mark the returned fields data in `mapPropsToFields`, [demo](#components-form- ### this.props.form.getFieldDecorator(id, options) -After wrapped by `getFieldDecorator`, `value`(or other property defined by `valuePropName`) `onChange`(or other property defined by `trigger`) props will be added to form controls,the flow of form data will be handled by Form which will cause: +After wrapped by `getFieldDecorator`, `value`(or other property defined by `valuePropName`) `onChange`(or other property defined by `trigger`) props will be added to form controls, the flow of form data will be handled by Form which will cause: 1. You shouldn't use `onChange` to collect data, but you still can listen to `onChange`(and so on) events. 2. You cannot set value of form control via `value` `defaultValue` prop, and you should set default value with `initialValue` in `getFieldDecorator` instead. diff --git a/components/grid/__tests__/__snapshots__/demo.test.js.snap b/components/grid/__tests__/__snapshots__/demo.test.js.snap index 8c2c86ea52..0a039ed26c 100644 --- a/components/grid/__tests__/__snapshots__/demo.test.js.snap +++ b/components/grid/__tests__/__snapshots__/demo.test.js.snap @@ -525,37 +525,37 @@ exports[`renders ./components/grid/demo/playground.md correctly 1`] = ` > 8 16 24 32 40 48 @@ -623,37 +623,37 @@ exports[`renders ./components/grid/demo/playground.md correctly 1`] = ` > 2 3 4 6 8 12 diff --git a/components/input/Input.tsx b/components/input/Input.tsx index 969a0780b5..4c081ad277 100644 --- a/components/input/Input.tsx +++ b/components/input/Input.tsx @@ -157,7 +157,7 @@ class Input extends React.Component { renderClearIcon(prefixCls: string) { const { allowClear } = this.props; const { value } = this.state; - if (!allowClear || value === undefined || value === '') { + if (!allowClear || value === undefined || value === null || value === '') { return null; } return ( diff --git a/components/input/__tests__/__snapshots__/index.test.js.snap b/components/input/__tests__/__snapshots__/index.test.js.snap index dd83ff4501..0eb020d68f 100644 --- a/components/input/__tests__/__snapshots__/index.test.js.snap +++ b/components/input/__tests__/__snapshots__/index.test.js.snap @@ -95,6 +95,172 @@ exports[`Input allowClear should change type when click 2`] = ` `; +exports[`Input allowClear should not show icon if defaultValue is undefined, null or empty string 1`] = ` + + + + + + + + +`; + +exports[`Input allowClear should not show icon if defaultValue is undefined, null or empty string 2`] = ` + + + + + + + + +`; + +exports[`Input allowClear should not show icon if defaultValue is undefined, null or empty string 3`] = ` + + + + + + + + +`; + +exports[`Input allowClear should not show icon if value is undefined, null or empty string 1`] = ` + + + + + + + + +`; + +exports[`Input allowClear should not show icon if value is undefined, null or empty string 2`] = ` + + + + + + + + +`; + +exports[`Input allowClear should not show icon if value is undefined, null or empty string 3`] = ` + + + + + + + + +`; + exports[`Input should support maxLength 1`] = ` { expect(wrapper.find('input').getDOMNode().value).toEqual(''); }); + it('should not show icon if value is undefined, null or empty string', () => { + const wrappers = [null, undefined, ''].map(val => mount()); + wrappers.forEach(wrapper => { + expect(wrapper.find('input').getDOMNode().value).toEqual(''); + expect(wrapper.find('.ant-input-clear-icon').exists()).toEqual(false); + expect(wrapper).toMatchSnapshot(); + }); + }); + + it('should not show icon if defaultValue is undefined, null or empty string', () => { + const wrappers = [null, undefined, ''].map(val => + mount(), + ); + wrappers.forEach(wrapper => { + expect(wrapper.find('input').getDOMNode().value).toEqual(''); + expect(wrapper.find('.ant-input-clear-icon').exists()).toEqual(false); + expect(wrapper).toMatchSnapshot(); + }); + }); + it('should trigger event correctly', () => { let argumentEventObject; let argumentEventObjectValue; diff --git a/components/input/demo/size.md b/components/input/demo/size.md index f9b2fe04cc..40a4822e2b 100644 --- a/components/input/demo/size.md +++ b/components/input/demo/size.md @@ -11,7 +11,7 @@ title: ## en-US -There are three sizes of an Input box: `large` (40px)、`default` (32px) and `small` (24px). +There are three sizes of an Input box: `large` (40px), `default` (32px) and `small` (24px). ````jsx import { Input } from 'antd'; diff --git a/components/layout/index.en-US.md b/components/layout/index.en-US.md index b10bc6aa8e..f2aefaf443 100644 --- a/components/layout/index.en-US.md +++ b/components/layout/index.en-US.md @@ -43,7 +43,7 @@ The first level navigation is inclined left near a logo, and the secondary menu - **Enlarge the size of the font** - `12px`、`14px` is a standard font size of navigations,`14px` is used for the first and the second level of the navigation. You can choose an appropriate font size regarding the level of your navigation. + `12px`, `14px` is a standard font size of navigations, `14px` is used for the first and the second level of the navigation. You can choose an appropriate font size regarding the level of your navigation. ## Component Overview diff --git a/components/list/style/index.less b/components/list/style/index.less index 0c6ec6c031..9e80dcc4ef 100644 --- a/components/list/style/index.less +++ b/components/list/style/index.less @@ -44,7 +44,7 @@ margin-right: @list-item-meta-avatar-margin-right; } &-content { - flex: 1 0 auto; + flex: 1 0; } &-title { color: @text-color; diff --git a/components/mention/index.en-US.md b/components/mention/index.en-US.md index e9718506f6..1f2c4c3482 100644 --- a/components/mention/index.en-US.md +++ b/components/mention/index.en-US.md @@ -64,4 +64,4 @@ When need to mention someone or something. | Property | Description | Type | Default | | -------- | ----------- | ---- | ------- | | children | suggestion content | object | {} | -| value | value of suggestion,the value will insert into input filed while selected | string | "" | +| value | value of suggestion, the value will insert into input filed while selected | string | "" | diff --git a/components/menu/MenuItem.tsx b/components/menu/MenuItem.tsx index 1046859b57..974e68e29f 100644 --- a/components/menu/MenuItem.tsx +++ b/components/menu/MenuItem.tsx @@ -13,8 +13,8 @@ interface MenuItemProps { className?: string; style?: React.CSSProperties; onClick?: (param: ClickParam) => void; - onMouseEnter?: (event: string, e: MouseEvent) => void; - onMouseLeave?: (event: string, e: MouseEvent) => void; + onMouseEnter?: (e: { key: string; domEvent: MouseEvent }) => void; + onMouseLeave?: (e: { key: string; domEvent: MouseEvent }) => void; } class MenuItem extends React.Component { diff --git a/components/progress/__tests__/index.test.js b/components/progress/__tests__/index.test.js index 327d6b6634..c856927597 100644 --- a/components/progress/__tests__/index.test.js +++ b/components/progress/__tests__/index.test.js @@ -9,6 +9,9 @@ describe('Progress', () => { wrapper.setProps({ percent: 50, successPercent: 100 }); expect(wrapper.find('.ant-progress-status-success')).toHaveLength(1); + + wrapper.setProps({ percent: 100, successPercent: 0 }); + expect(wrapper.find('.ant-progress-status-success')).toHaveLength(0); }); it('render out-of-range progress', () => { diff --git a/components/progress/index.en-US.md b/components/progress/index.en-US.md index d10707fa1b..02f26a662d 100644 --- a/components/progress/index.en-US.md +++ b/components/progress/index.en-US.md @@ -30,15 +30,21 @@ Properties that shared by all types. ### `type="line"` +| Property | Description | Type | Default | +| -------- | ----------- | ---- | ------- | | strokeWidth | to set the width of the progress bar, unit: `px` | number | 10 | ### `type="circle"` +| Property | Description | Type | Default | +| -------- | ----------- | ---- | ------- | | width | to set the canvas width of the circular progress, unit: `px` | number | 132 | | strokeWidth | to set the width of the circular progress, unit: percentage of the canvas width | number | 6 | ### `type="dashboard"` +| Property | Description | Type | Default | +| -------- | ----------- | ---- | ------- | | width | to set the canvas width of the dashboard progress, unit: `px` | number | 132 | | strokeWidth | to set the width of the dashboard progress, unit: percentage of the canvas width | number | 6 | | gapDegree | the gap degree of half circle, 0 ~ 360 | number | 0 | diff --git a/components/progress/index.zh-CN.md b/components/progress/index.zh-CN.md index 95246fb059..cc2039b0a1 100644 --- a/components/progress/index.zh-CN.md +++ b/components/progress/index.zh-CN.md @@ -31,15 +31,21 @@ title: Progress ### `type="line"` +| 属性 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | | strokeWidth | 进度条线的宽度,单位 px | number | 10 | ### `type="circle"` +| 属性 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | | width | 圆形进度条画布宽度,单位 px | number | 132 | | strokeWidth | 圆形进度条线的宽度,单位是进度条画布宽度的百分比 | number | 6 | ### `type="dashboard"` +| 属性 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | | width | 仪表盘进度条画布宽度,单位 px | number | 132 | | strokeWidth | 仪表盘进度条线的宽度,单位是进度条画布宽度的百分比 | number | 6 | | gapDegree | 仪表盘进度条缺口角度,可取值 0 ~ 360 | number | 0 | diff --git a/components/progress/progress.tsx b/components/progress/progress.tsx index d73bcd4362..5d763bf564 100644 --- a/components/progress/progress.tsx +++ b/components/progress/progress.tsx @@ -103,8 +103,8 @@ export default class Progress extends React.Component { } = props; const prefixCls = getPrefixCls('progress', customizePrefixCls); const progressStatus = - parseInt(successPercent ? successPercent.toString() : percent.toString(), 10) >= 100 && - !('status' in props) + parseInt(successPercent !== undefined ? successPercent.toString() : percent.toString(), 10) >= + 100 && !('status' in props) ? 'success' : status || 'normal'; let progress; diff --git a/components/slider/__tests__/__snapshots__/demo.test.js.snap b/components/slider/__tests__/__snapshots__/demo.test.js.snap index bcfce57b5e..4c80bc72ab 100644 --- a/components/slider/__tests__/__snapshots__/demo.test.js.snap +++ b/components/slider/__tests__/__snapshots__/demo.test.js.snap @@ -508,25 +508,25 @@ exports[`renders ./components/slider/demo/mark.md correctly 1`] = ` > 0°C 26°C 37°C 100°C @@ -589,25 +589,25 @@ exports[`renders ./components/slider/demo/mark.md correctly 1`] = ` > 0°C 26°C 37°C 100°C @@ -659,25 +659,25 @@ exports[`renders ./components/slider/demo/mark.md correctly 1`] = ` > 0°C 26°C 37°C 100°C @@ -733,25 +733,25 @@ exports[`renders ./components/slider/demo/mark.md correctly 1`] = ` > 0°C 26°C 37°C 100°C @@ -807,25 +807,25 @@ exports[`renders ./components/slider/demo/mark.md correctly 1`] = ` > 0°C 26°C 37°C 100°C diff --git a/components/slider/index.en-US.md b/components/slider/index.en-US.md index 439dc3e49f..29d8fb50ff 100644 --- a/components/slider/index.en-US.md +++ b/components/slider/index.en-US.md @@ -18,8 +18,8 @@ To input a value in a range. | defaultValue | The default value of slider. When `range` is `false`, use `number`, otherwise, use `[number, number]` | number\|number\[] | 0 or \[0, 0] | | disabled | If true, the slider will not be interactable. | boolean | false | | dots | Whether the thumb can drag over tick only. | boolean | false | -| included | Make effect when `marks` not null,`true` means containment and `false` means coordinative | boolean | true | -| marks | Tick mark of Slider, type of key must be `number`, and must in closed interval \[min, max] ,each mark can declare its own style. | object | { number: string\|ReactNode } or { number: { style: object, label: string\|ReactNode } } | +| included | Make effect when `marks` not null, `true` means containment and `false` means coordinative | boolean | true | +| marks | Tick mark of Slider, type of key must be `number`, and must in closed interval \[min, max], each mark can declare its own style. | object | { number: string\|ReactNode } or { number: { style: object, label: string\|ReactNode } } | | max | The maximum value the slider can slide to | number | 100 | | min | The minimum value the slider can slide to. | number | 0 | | range | dual thumb mode | boolean | false | diff --git a/components/statistic/Countdown.tsx b/components/statistic/Countdown.tsx index 0c48fc0959..8870d37685 100644 --- a/components/statistic/Countdown.tsx +++ b/components/statistic/Countdown.tsx @@ -17,7 +17,7 @@ class Countdown extends React.Component { format: 'HH:mm:ss', }; - countdownId?: number = undefined; + countdownId?: number; componentDidMount() { this.syncTimer(); diff --git a/components/switch/index.tsx b/components/switch/index.tsx index bdd42438a5..705c58034d 100755 --- a/components/switch/index.tsx +++ b/components/switch/index.tsx @@ -13,7 +13,8 @@ export interface SwitchProps { className?: string; checked?: boolean; defaultChecked?: boolean; - onChange?: (checked: boolean) => any; + onChange?: (checked: boolean, event: MouseEvent) => any; + onClick?: (checked: boolean, event: MouseEvent) => any; checkedChildren?: React.ReactNode; unCheckedChildren?: React.ReactNode; disabled?: boolean; diff --git a/components/switch/style/index.less b/components/switch/style/index.less index 08f97bf056..dfdbb84fed 100644 --- a/components/switch/style/index.less +++ b/components/switch/style/index.less @@ -158,6 +158,10 @@ * { cursor: not-allowed; } + &:before, + &:after { + cursor: not-allowed; + } } } diff --git a/components/table/Table.tsx b/components/table/Table.tsx index 43e0dd1913..c2b5b0a42b 100755 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -208,6 +208,10 @@ export default class Table extends React.Component, TableState< this.store.setState({ selectedRowKeys: nextProps.rowSelection.selectedRowKeys || [], }); + } else if (this.props.rowSelection && !nextProps.rowSelection) { + this.store.setState({ + selectedRowKeys: [], + }); } if ('dataSource' in nextProps && nextProps.dataSource !== this.props.dataSource) { this.store.setState({ @@ -477,7 +481,7 @@ export default class Table extends React.Component, TableState< } // Controlled current prop will not respond user interaction - if (typeof props.pagination === 'object' && 'current' in (props.pagination as Object)) { + if (typeof props.pagination === 'object' && 'current' in props.pagination) { newState.pagination = { ...pagination, current: this.state.pagination.current, @@ -670,11 +674,7 @@ export default class Table extends React.Component, TableState< pagination, }; // Controlled current prop will not respond user interaction - if ( - props.pagination && - typeof props.pagination === 'object' && - 'current' in (props.pagination as Object) - ) { + if (props.pagination && typeof props.pagination === 'object' && 'current' in props.pagination) { newState.pagination = { ...pagination, current: this.state.pagination.current, @@ -727,7 +727,7 @@ export default class Table extends React.Component, TableState< getRecordKey = (record: T, index: number) => { const { rowKey } = this.props; const recordKey = - typeof rowKey === 'function' ? rowKey(record, index) : (record as any)[rowKey as string]; + typeof rowKey === 'function' ? rowKey(record, index) : (record as any)[rowKey!]; warning( recordKey !== undefined, 'Each record in dataSource of table should have a unique `key` prop, ' + @@ -956,7 +956,7 @@ export default class Table extends React.Component, TableState< const { pagination } = this.state; if (pagination.size) { size = pagination.size; - } else if ((this.props.size as string) === 'middle' || this.props.size === 'small') { + } else if (this.props.size === 'middle' || this.props.size === 'small') { size = 'small'; } const position = pagination.position || 'bottom'; @@ -1012,6 +1012,7 @@ export default class Table extends React.Component, TableState< let current: number; let pageSize: number; const state = this.state; + const pagination = this.props.pagination || {}; // 如果没有分页的话,默认全部展示 if (!this.hasPagination()) { pageSize = Number.MAX_VALUE; @@ -1028,7 +1029,7 @@ export default class Table extends React.Component, TableState< if ( data.length > pageSize || pageSize === Number.MAX_VALUE || - current * pageSize > data.length + (pagination.current === undefined && current * pageSize > data.length) ) { data = data.filter((_, i) => { return i >= (current - 1) * pageSize && i < current * pageSize; diff --git a/components/table/__tests__/Table.pagination.test.js b/components/table/__tests__/Table.pagination.test.js index 3ac28909cf..7222ea8ed5 100644 --- a/components/table/__tests__/Table.pagination.test.js +++ b/components/table/__tests__/Table.pagination.test.js @@ -190,5 +190,9 @@ describe('Table.pagination', () => { expect(renderedNames(wrapper)[0]).toEqual('Jack'); wrapper.find('.ant-pagination-item-2').simulate('click'); expect(renderedNames(wrapper)).toEqual([]); + wrapper.setProps({ pagination: { current: 1, pageSize: 10, total: 100 } }); + expect(renderedNames(wrapper)[0]).toEqual('Jack'); + wrapper.setProps({ pagination: { current: 2, pageSize: 10, total: 100 } }); + expect(renderedNames(wrapper)).toHaveLength(4); }); }); diff --git a/components/table/__tests__/Table.rowSelection.test.js b/components/table/__tests__/Table.rowSelection.test.js index 35a2f89255..74dd25ebdb 100644 --- a/components/table/__tests__/Table.rowSelection.test.js +++ b/components/table/__tests__/Table.rowSelection.test.js @@ -651,4 +651,17 @@ describe('Table.rowSelection', () => { checkboxes.at(2).simulate('change', { target: { checked: true } }); expect(checkboxAll.instance().state).toEqual({ indeterminate: false, checked: true }); }); + + it('clear selection className when remove `rowSelection`', () => { + const dataSource = [{ id: 1, name: 'Hello', age: 10 }, { id: 2, name: 'World', age: 30 }]; + + const wrapper = mount(); + const checkboxes = wrapper.find('input'); + checkboxes.at(1).simulate('change', { target: { checked: true } }); + + expect(wrapper.find('.ant-table-row-selected').length).toBe(1); + + wrapper.setProps({ rowSelection: null }); + expect(wrapper.find('.ant-table-row-selected').length).toBe(0); + }); }); diff --git a/components/table/demo/drag-sorting.md b/components/table/demo/drag-sorting.md index 28ac643a65..6b638bd328 100644 --- a/components/table/demo/drag-sorting.md +++ b/components/table/demo/drag-sorting.md @@ -19,22 +19,7 @@ import { DragDropContext, DragSource, DropTarget } from 'react-dnd'; import HTML5Backend from 'react-dnd-html5-backend'; import update from 'immutability-helper'; -function dragDirection( - dragIndex, - hoverIndex, - initialClientOffset, - clientOffset, - sourceClientOffset, -) { - const hoverMiddleY = (initialClientOffset.y - sourceClientOffset.y) / 2; - const hoverClientY = clientOffset.y - sourceClientOffset.y; - if (dragIndex < hoverIndex && hoverClientY > hoverMiddleY) { - return 'downward'; - } - if (dragIndex > hoverIndex && hoverClientY < hoverMiddleY) { - return 'upward'; - } -} +let dragingIndex = -1; class BodyRow extends React.Component { render() { @@ -43,27 +28,16 @@ class BodyRow extends React.Component { connectDragSource, connectDropTarget, moveRow, - dragRow, - clientOffset, - sourceClientOffset, - initialClientOffset, ...restProps } = this.props; const style = { ...restProps.style, cursor: 'move' }; let className = restProps.className; - if (isOver && initialClientOffset) { - const direction = dragDirection( - dragRow.index, - restProps.index, - initialClientOffset, - clientOffset, - sourceClientOffset - ); - if (direction === 'downward') { + if (isOver) { + if (restProps.index > dragingIndex) { className += ' drop-over-downward'; } - if (direction === 'upward') { + if (restProps.index < dragingIndex) { className += ' drop-over-upward'; } } @@ -82,6 +56,7 @@ class BodyRow extends React.Component { const rowSource = { beginDrag(props) { + dragingIndex = props.index; return { index: props.index, }; @@ -109,17 +84,21 @@ const rowTarget = { }, }; -const DragableBodyRow = DropTarget('row', rowTarget, (connect, monitor) => ({ - connectDropTarget: connect.dropTarget(), - isOver: monitor.isOver(), - sourceClientOffset: monitor.getSourceClientOffset(), -}))( - DragSource('row', rowSource, (connect, monitor) => ({ - connectDragSource: connect.dragSource(), - dragRow: monitor.getItem(), - clientOffset: monitor.getClientOffset(), - initialClientOffset: monitor.getInitialClientOffset(), - }))(BodyRow) +const DragableBodyRow = DropTarget( + 'row', + rowTarget, + (connect, monitor) => ({ + connectDropTarget: connect.dropTarget(), + isOver: monitor.isOver(), + }), +)( + DragSource( + 'row', + rowSource, + (connect) => ({ + connectDragSource: connect.dragSource(), + }), + )(BodyRow), ); const columns = [{ diff --git a/components/table/index.en-US.md b/components/table/index.en-US.md index 4e3bd26fe1..e88aecdc34 100644 --- a/components/table/index.en-US.md +++ b/components/table/index.en-US.md @@ -113,7 +113,7 @@ One of the Table `columns` prop for describing the table's columns, Column has t | align | specify how content is aligned | 'left' \| 'right' \| 'center' | 'left' | | className | className of this column | string | - | | colSpan | Span of this column's title | number | | -| dataIndex | Display field of the data record, could be set like `a.b.c`、`a[0].b.c[1]` | string | - | +| dataIndex | Display field of the data record, could be set like `a.b.c`, `a[0].b.c[1]` | string | - | | defaultSortOrder | Default order of sorted values | 'ascend' \| 'descend' | - | | filterDropdown | Customized filter overlay | ReactNode | - | | filterDropdownVisible | Whether `filterDropdown` is visible | boolean | - | diff --git a/components/upload/Upload.tsx b/components/upload/Upload.tsx index 3a8cee6205..9b6c921241 100644 --- a/components/upload/Upload.tsx +++ b/components/upload/Upload.tsx @@ -316,11 +316,17 @@ class Upload extends React.Component { [`${prefixCls}-disabled`]: disabled, }); - const uploadButton = children ? ( -
+ // Remove id to avoid open by label when trigger is hidden + // https://github.com/ant-design/ant-design/issues/14298 + if (!children) { + delete rcUploadProps.id; + } + + const uploadButton = ( +
- ) : null; + ); if (listType === 'picture-card') { return ( diff --git a/components/upload/__tests__/upload.test.js b/components/upload/__tests__/upload.test.js index 9e66e54b12..a7466cbad9 100644 --- a/components/upload/__tests__/upload.test.js +++ b/components/upload/__tests__/upload.test.js @@ -188,6 +188,19 @@ describe('Upload', () => { }); }); + // https://github.com/ant-design/ant-design/issues/14779 + it('should contain input file control if upload button is hidden', () => { + const wrapper = mount( + + + , + ); + + expect(wrapper.find('input[type="file"]').length).toBe(1); + wrapper.setProps({ children: null }); + expect(wrapper.find('input[type="file"]').length).toBe(1); + }); + it('should be controlled by fileList', () => { const fileList = [ { diff --git a/components/upload/index.en-US.md b/components/upload/index.en-US.md index 1ac8664679..57da565962 100644 --- a/components/upload/index.en-US.md +++ b/components/upload/index.en-US.md @@ -57,7 +57,7 @@ When uploading state change, it returns: ```js { - uid: 'uid', // unique identifier,negative is recommend,to prevent interference with internal generated id + uid: 'uid', // unique identifier, negative is recommend, to prevent interference with internal generated id name: 'xx.png' // file name status: 'done', // options:uploading, done, error, removed response: '{"status": "success"}', // response from server diff --git a/components/upload/interface.tsx b/components/upload/interface.tsx index bd51ee8ae2..bc372c713b 100755 --- a/components/upload/interface.tsx +++ b/components/upload/interface.tsx @@ -76,6 +76,7 @@ export interface UploadProps { withCredentials?: boolean; openFileDialogOnClick?: boolean; locale?: UploadLocale; + id?: string; } export interface UploadState { diff --git a/docs/react/customize-theme.en-US.md b/docs/react/customize-theme.en-US.md index 9ba1727580..169db390a1 100644 --- a/docs/react/customize-theme.en-US.md +++ b/docs/react/customize-theme.en-US.md @@ -69,7 +69,7 @@ Note that do not exclude antd package in node_modules when using less-loader. ### Customize in roadhog or Umi -You can easily use `theme` field in [.webpackrc](https://github.com/ant-design/ant-design-pro/blob/b7e7983661eb5e53dc807452e9653e93e74276d4/.webpackrc.js#L18) (roadhog) or [config/config.js](https://github.com/ant-design/ant-design-pro/blob/56e648ec14bdb9f6724169fd64830447e224ccb1/config/config.js#L45) (Umi) file of your project root directory if you are using [roadhog](https://github.com/sorrycc/roadhog) or [Umi](http://umijs.org/),which could be a object or a javascript file path. +You can easily use `theme` field in [.webpackrc](https://github.com/ant-design/ant-design-pro/blob/b7e7983661eb5e53dc807452e9653e93e74276d4/.webpackrc.js#L18) (roadhog) or [config/config.js](https://github.com/ant-design/ant-design-pro/blob/56e648ec14bdb9f6724169fd64830447e224ccb1/config/config.js#L45) (Umi) file of your project root directory if you are using [roadhog](https://github.com/sorrycc/roadhog) or [Umi](http://umijs.org/), which could be a object or a javascript file path. ```js "theme": { diff --git a/docs/react/introduce.en-US.md b/docs/react/introduce.en-US.md index 60767ed334..05f4e67a28 100644 --- a/docs/react/introduce.en-US.md +++ b/docs/react/introduce.en-US.md @@ -48,7 +48,7 @@ You can subscribe to this feed for new version notifications: https://github.com ### Using npm or yarn -**We recommend using npm or yarn to install**,it not only makes development easier,but also allow you to take advantage of the rich ecosystem of Javascript packages and tooling. +**We recommend using npm or yarn to install**, it not only makes development easier, but also allow you to take advantage of the rich ecosystem of Javascript packages and tooling. ```bash $ npm install antd --save @@ -58,7 +58,7 @@ $ npm install antd --save $ yarn add antd ``` -If you are in a bad network environment,you can try other registries and tools like [cnpm](https://github.com/cnpm/cnpm). +If you are in a bad network environment, you can try other registries and tools like [cnpm](https://github.com/cnpm/cnpm). ### Import in Browser diff --git a/docs/react/use-in-typescript.en-US.md b/docs/react/use-in-typescript.en-US.md index e2050872f1..416c81854d 100644 --- a/docs/react/use-in-typescript.en-US.md +++ b/docs/react/use-in-typescript.en-US.md @@ -79,10 +79,10 @@ For instance, we actually import all styles of components in the project which m Now we need to customize the default webpack config. We can achieve that by using [react-app-rewired](https://github.com/timarney/react-app-rewired) which is one of create-react-app's custom config solutions. -Import react-app-rewired and modify the `scripts` field in package.json. +Import react-app-rewired and modify the `scripts` field in package.json. Due to new [react-app-rewired@2.x](https://github.com/timarney/react-app-rewired#alternatives) issue, you shall need [customize-cra](https://github.com/arackaf/customize-cra) along with react-app-rewired. ``` -$ yarn add react-app-rewired +$ yarn add react-app-rewired customize-cra ``` ```diff diff --git a/docs/react/use-in-typescript.zh-CN.md b/docs/react/use-in-typescript.zh-CN.md index baaf42a43b..b83b9ab6f9 100644 --- a/docs/react/use-in-typescript.zh-CN.md +++ b/docs/react/use-in-typescript.zh-CN.md @@ -78,10 +78,10 @@ export default App; 此时我们需要对 create-react-app 的默认配置进行自定义,这里我们使用 [react-app-rewired](https://github.com/timarney/react-app-rewired) (一个对 create-react-app 进行自定义配置的社区解决方案)。 -引入 react-app-rewired 并修改 package.json 里的启动配置。 +引入 react-app-rewired 并修改 package.json 里的启动配置。由于新的 [react-app-rewired@2.x](https://github.com/timarney/react-app-rewired#alternatives) 版本的关系,你需要还需要安装 [customize-cra](https://github.com/arackaf/customize-cra)。 ``` -$ yarn add react-app-rewired +$ yarn add react-app-rewired customize-cra ``` ```diff diff --git a/docs/react/use-with-create-react-app.en-US.md b/docs/react/use-with-create-react-app.en-US.md index d164cf8860..6568ca6f37 100644 --- a/docs/react/use-with-create-react-app.en-US.md +++ b/docs/react/use-with-create-react-app.en-US.md @@ -95,7 +95,7 @@ For instance, we actually import all styles of components in the project which m Now we need to customize the default webpack config. We can achieve that by using [react-app-rewired](https://github.com/timarney/react-app-rewired) which is one of create-react-app's custom config solutions. -Import react-app-rewired and modify the `scripts` field in package.json. Due to new `react-app-rewired@2.x` versions, you have to install customize-cra along with react-app-rewired. +Import react-app-rewired and modify the `scripts` field in package.json. Due to new [react-app-rewired@2.x](https://github.com/timarney/react-app-rewired#alternatives) issue, you shall need [customize-cra](https://github.com/arackaf/customize-cra) along with react-app-rewired. ``` $ yarn add react-app-rewired customize-cra diff --git a/docs/react/use-with-create-react-app.zh-CN.md b/docs/react/use-with-create-react-app.zh-CN.md index 92fb20fdf2..ad8eec2b2b 100644 --- a/docs/react/use-with-create-react-app.zh-CN.md +++ b/docs/react/use-with-create-react-app.zh-CN.md @@ -90,9 +90,9 @@ export default App; 我们现在已经把组件成功运行起来了,但是在实际开发过程中还有很多问题,例如上面的例子实际上加载了全部的 antd 组件的样式(对前端性能是个隐患)。 -此时我们需要对 create-react-app 的默认配置进行自定义,这里我们使用 [react-app-rewired](https://github.com/timarney/react-app-rewired) (一个对 create-react-app 进行自定义配置的社区解决方案)。由于新的 `react-app-rewired@2.x` 版本的关系,你必须安装 customize-cra 以及 react-app-rewired 。 +此时我们需要对 create-react-app 的默认配置进行自定义,这里我们使用 [react-app-rewired](https://github.com/timarney/react-app-rewired) (一个对 create-react-app 进行自定义配置的社区解决方案)。 -引入 react-app-rewired 并修改 package.json 里的启动配置。 +引入 react-app-rewired 并修改 package.json 里的启动配置。由于新的 [react-app-rewired@2.x](https://github.com/timarney/react-app-rewired#alternatives) 版本的关系,你需要还需要安装 [customize-cra](https://github.com/arackaf/customize-cra)。 ``` $ yarn add react-app-rewired customize-cra diff --git a/docs/spec/alignment.en-US.md b/docs/spec/alignment.en-US.md index c4e8c5d42a..319a4cd9ef 100644 --- a/docs/spec/alignment.en-US.md +++ b/docs/spec/alignment.en-US.md @@ -4,7 +4,7 @@ order: 2 title: Alignment --- -As is described in the Law of Continuity of Gestalt psychology, in the perceptual process, people usually tend to understand the object in the way that it is firstly perceived, to let the straight lines be straight and let the curve lines be curve. In the design of interface, aligning the elements meets users’ perception, also delivers the information to users in a more smooth way. +As is described in the Law of Continuity of Gestalt psychology, in the perceptual process, people usually tend to understand the object in the way that it is firstly perceived, to let the straight lines be straight and let the curve lines be curve. In the design of interface, aligning the elements meets users' perception, also delivers the information to users in a more smooth way. > ** Gestalt psychology or gestaltism(German:Gestalttheorie)** :Gestalttheorie is an important genre of psychology. It rose in the beginning of the 20 century in Germany.The central principle of gestalt psychology is that the mind forms a global whole with self-organizing tendencies.『The whole is other than the sum of the parts.』--Quote from Wikipedia @@ -32,4 +32,4 @@ Colon alignment(right-align) can encircle the content into a certain range. User good example bad example -To compare the numbers faster, we suggest that all numbers should keep the same digit numbers after decimal point; meanwhile all numbers should be right-aligned. 。 +To compare the numbers faster, we suggest that all numbers should keep the same digit numbers after decimal point; meanwhile all numbers should be right-aligned. diff --git a/docs/spec/contrast.en-US.md b/docs/spec/contrast.en-US.md index a5071a02a4..e74d249ea2 100644 --- a/docs/spec/contrast.en-US.md +++ b/docs/spec/contrast.en-US.md @@ -15,7 +15,7 @@ Contrast is one of the effective ways to add visual interest to your page, and t good example bad example -In order to help user make a quick operation (something like the form,modal), a more important operation or a operation with higher frequency would be emphasized. +In order to help user make a quick operation (something like the form, modal), a more important operation or a operation with higher frequency would be emphasized. > Notes: ways of emphasizing are not just to intensify the key item. It could also weaken the other items. @@ -23,7 +23,7 @@ In order to help user make a quick operation (something like the form,modal), Example of ignoring the primary and secondary sequence -When there’s something needs users to make decision prudently, the system should remain neutral. It shouldn’t make the decision for users or lead them to make judgement. +When there's something needs users to make decision prudently, the system should remain neutral. It shouldn't make the decision for users or lead them to make judgement. --- @@ -41,7 +41,7 @@ Taking advantage of changing the typesetting, the typeface and the size, we high Example of static contrast -Example of dynamic contrast +Example of dynamic contrast Taking advantage of changing colors and adding assistant shapes, we realize the comparison of state relation, which could help users differentiate various information better diff --git a/docs/spec/direct.en-US.md b/docs/spec/direct.en-US.md index 2be20429e1..3fa5404961 100644 --- a/docs/spec/direct.en-US.md +++ b/docs/spec/direct.en-US.md @@ -29,7 +29,7 @@ If the priority is given to 『readability』 and the 『editability』 of opera Multi-Field Inline Edit ->Note:In『Multi-Field Inline Edit』,there are huge different between the content and required field,So it is more needed to use the [『Explain What Just Happened』](../docs/spec/transition#解释刚刚发生了什么) in 『Use Transition』to eliminate this visual effects. +>Note:In『Multi-Field Inline Edit』, there are huge different between the content and required field, So it is more needed to use the [『Explain What Just Happened』](../docs/spec/transition#解释刚刚发生了什么) in 『Use Transition』to eliminate this visual effects.
@@ -38,7 +38,7 @@ Multi-Field Inline Edit ## Drag and Drop -Example of Drag and Drop List +Example of Drag and Drop List Drag and Drop List diff --git a/docs/spec/icon.en-US.md b/docs/spec/icon.en-US.md index 0298483586..b53730975c 100644 --- a/docs/spec/icon.en-US.md +++ b/docs/spec/icon.en-US.md @@ -13,7 +13,7 @@ An icon is a graphical representation of meaning. Icons can be used to express a ## System Icons - +System Icons System icons are often used to represent commonly used operations, such as: save, edit, delete. Ant Design also includes icons to represent file types and state. @@ -21,7 +21,7 @@ System icons are often used to represent commonly used operations, such as: save ### Key Contour Lines -Ant Design's grid and key contour lines +Ant Design's grid and key contour lines Contour lines play an important role in making various icons with the same visual effect. @@ -67,13 +67,13 @@ Always keep a simple, flat style. Icons should not have a sense of depth nor a l ### Naming Conventions - +Naming Conventions Uniform naming conventions make finding icons faster and easier. For example, icons with a surrounding outline have a uniform "-o" suffix. ### Icon Sizing - +Icon Sizing Icons should be scaled according to the text size, according to the Ant Design specification. @@ -81,7 +81,7 @@ For example, icons inline with 12pt font should be 12px in size with 8px of spac ### Color - +Color The color of the icon should be consistent the color of the surrounding copy, unless the icon is being used to express state (in which case it should be colored accordingly). @@ -89,7 +89,7 @@ The color of the icon should be consistent the color of the surrounding copy, un ## Business Icons - +Business Icons Business icons, unlike system icons, do not themselves have functional operations, but rather an abstraction that assists with copywriting. Compared to the system icon, the business icon is more rich in the details of the design, the size of the use of relatively large. @@ -97,12 +97,12 @@ Business icons, unlike system icons, do not themselves have functional operation ### Icon Sizing - +Icon Sizing In normal use, there are 32px (minimum size), 48px and 64px (maximum size) three options. ### Color - +Color There are two kinds of business icon, single-color (neutral color) and double-color (neutral color + primary color), the area of primary color does not exceed 40% of the entire icon. diff --git a/docs/spec/icon.zh-CN.md b/docs/spec/icon.zh-CN.md index 84642909f4..6aa675346e 100644 --- a/docs/spec/icon.zh-CN.md +++ b/docs/spec/icon.zh-CN.md @@ -30,13 +30,13 @@ Ant Design 的图标设计原则源自"确定"和"自然",落实到图标设 - **Artboard:** Ant Design 的系统图标都是按照 1024 x 1024 的画板进行制作的:
- +设计规格
- **出血位:** 在图标的设计过程中预留出血位的做法,可以预防某些造型的图标在具体应用时出现边缘被切掉的风险;同时在设计过程中,也为设计师把握图标间平衡留下了进退的余地。新版的设计规格在图形的外围预留了 64px 的出血位,多数的图标在设计中我们都不建议超过这个区域。
- +出血位
## 分层 @@ -44,7 +44,7 @@ Ant Design 的图标设计原则源自"确定"和"自然",落实到图标设 Ant Design 的图标设计对于设计稿的分层也有一定的要求,其目的除了让设计师实现有序的文档管理之外,更多的是便于团队间文档的传递,统一的设计框架像是无形的共识,可以让彼此间的理解得到进一步的提升。
- +分层
## 轮廓线与模版 @@ -52,7 +52,7 @@ Ant Design 的图标设计对于设计稿的分层也有一定的要求,其目 我们对设计模版进行了优化,根据出血位的尺寸,调整轮廓线的宽高,同时增加两个等边三角形和一个圆,这些都是图标设计中最常用的基本形式,设计师可以快速的调用并在此基础上做变形。
- +轮廓线与模版
## 图标设计指引 @@ -64,7 +64,7 @@ Ant Design 的图标设计对于设计稿的分层也有一定的要求,其目 形式,是构成一个图形最初始的结构。Ant Design 整套基础图标基本上都是由圆、方、三角这样的图形演变而成的。追求图形初始结构的理性,而非直觉式的设计,是秩序之美的第一步。
- +形式
### 2、韵律 @@ -76,31 +76,31 @@ Ant Design 图标的韵律感通过两个方面来体现:元素的韵律和构 - **点:** 点是很多图形中都会出现的元素。Ant Design 会在一套图标中挖掘同一元素的规律,同时对其进行克制的运用。我们对于点的尺寸选择上会保持 16 的倍数这一原则。比如,在点的选择中,新版的图标最常用的是四种尺寸的点,分别为 80、96、112、128。当出现特殊尺寸的需求时,会按照 16 的倍数进行延展。
- +点
- **线:** 线条也是非常通用的元素之一。新版图标在线条之间的关系采用 8 倍数原则,从小到大以 8 的规律递增。常用的规格也是 4 种,分别为 56、64、72、80。
- +线
- **圆角:** 圆角的规格采取的也是 8 倍数原则,最常用的是 3 种,分别是 8,16、32,它们之间是两倍数的关系。而图标内部空间的圆角则保持直角的处理方式。
- +圆角
- **三角:** 新版图标的角度受到美式战斗机 F-14 tomcat 的启发,将常用的角度定在约 76 度。在日常设计中,多数系统图标的角度都可以从 76 度这个数值出发,根据实际情况进行灵活的应用。
- +三角
除了定义角度,我们对新图标中实心箭头的规格也做了收敛,在顶角大约保持 76 度的基础上,最常用的为 4 种,他们的宽度保持 8 倍数的原则,间隔为 24 :
- +实心箭头
基本元素在使用上的规格可以用下面的表格来总结,建议设计师在一套图标的设计中尽量保持克制的态度。 @@ -121,13 +121,13 @@ Ant Design 图标的韵律感通过两个方面来体现:元素的韵律和构 - 保持类似图标在构造上的一致性也是建立图标体系节奏感的一种方法。
- +节奏感
- 此外,在单个图标的设计过程中,也建议适当理性的看待各元素间的比例关系,而非直觉式的开展绘制。
- +元素间的比例关系
### 3、平衡 @@ -137,19 +137,19 @@ Ant Design 图标的韵律感通过两个方面来体现:元素的韵律和构 - **弯曲的线条会比竖直的线条看起来细**。 因此在圆形的外边框上我们会适当的对 72px 的规格进行 4 px 的微调。
- + 弯曲的线条会比竖直的线条看起来细
- **倾斜的线条也会比竖直的线条看起来细**。 因此倾斜的线条也会进行 4 px 的微调。
- + 倾斜的线条也会比竖直的线条看起来细
- **图形的留白空间也是值得推敲的课题**。 当某些图形的留白不足时,可以通过调节线条的粗细来达到视觉重量上的平衡。
- + 图形的留白空间也是值得推敲的课题
### 4、辨识 @@ -159,13 +159,13 @@ Ant Design 图标的韵律感通过两个方面来体现:元素的韵律和构 - **让科技有温度:** 通过对于图形圆角的定义,将过于圆润的圆角(72)调整至(32),在视觉效果上令图标看起来更为坚硬和理性(对应科技感),但又不至于太过尖锐(有温度)。
- +让科技有温度
- **让图形有生命:** 在部分图标设计中,会适度的注入拟人化的元素,令图标具备生命力。
- +让图形有生命
## 给设计师的一些建议 @@ -175,25 +175,25 @@ Ant Design 图标的韵律感通过两个方面来体现:元素的韵律和构 - 干掉多余的节点,保持图形的整洁。
- +保持图形的整洁
- 合并图形,便于输出。
- +合并图形
- 对小数点以及奇数进行最后一遍的走查与修正。
- +走查与修正
- 整洁的图层管理。
- +图层管理
## 写在最后 diff --git a/docs/spec/layout.en-US.md b/docs/spec/layout.en-US.md index 09ded95588..c1040f1ca2 100644 --- a/docs/spec/layout.en-US.md +++ b/docs/spec/layout.en-US.md @@ -54,7 +54,7 @@ Ant Design's designers keep the following 4 things in mind in the communication 1. Clear definition of dynamic layout area 2. Try to always use even numbers -3. Delivery of critical numbers (Gutter、Column) +3. Delivery of critical numbers (Gutter, Column) 4. Always use beginning column and ending column to define blocks. ## Common Scales diff --git a/docs/spec/lightweight.en-US.md b/docs/spec/lightweight.en-US.md index 60a4819d4b..49ba15deba 100644 --- a/docs/spec/lightweight.en-US.md +++ b/docs/spec/lightweight.en-US.md @@ -4,7 +4,7 @@ order: 7 title: Keep it Lightweight --- -Fitts’s Law is an ergonomic principle that ties the size of a target and its contextual proximity to ease of use.In other words, if a tool is close at hand and large enough to target, then we can improve the user’s interaction. Putting tools in context makes for lightweight interaction. +Fitts's Law is an ergonomic principle that ties the size of a target and its contextual proximity to ease of use.In other words, if a tool is close at hand and large enough to target, then we can improve the user's interaction. Putting tools in context makes for lightweight interaction. > diff --git a/docs/spec/proximity.en-US.md b/docs/spec/proximity.en-US.md index 3ad16f40f7..01740cdaba 100644 --- a/docs/spec/proximity.en-US.md +++ b/docs/spec/proximity.en-US.md @@ -20,7 +20,7 @@ Divide the hierarchy of information through three formats:『small spacing』, In the case that the three formats are applicable, the hierarchy of information can be separated clearly through adding or cutting down the multiple of 『basic spacing』, or adding elements. -> Note: in Ant Design, y=8+8*n, among which,n>=0,y stands for the vertical spacing and 8 represents 『basic spacing』. +> Note: in Ant Design, y = 8 + 8 * n, among which, n >= 0, y stands for the vertical spacing and 8 represents 『basic spacing』. --- diff --git a/docs/spec/proximity.zh-CN.md b/docs/spec/proximity.zh-CN.md index 69f162d1ce..2fb4013280 100644 --- a/docs/spec/proximity.zh-CN.md +++ b/docs/spec/proximity.zh-CN.md @@ -20,7 +20,7 @@ title: 亲密性 在这三种规格不适用的情况下,可以通过加减『基础间距』的倍数,或者增加元素来拉开信息层次。 -> 注:在 Ant Design 中,`y=8+8*n`。其中,`n>=0`,y 是纵向间距,8 是『基础间距』。 +> 注:在 Ant Design 中,`y = 8 + 8 * n`。其中,`n >= 0`,y 是纵向间距,8 是『基础间距』。 --- diff --git a/docs/spec/reaction.en-US.md b/docs/spec/reaction.en-US.md index b0f9634f0d..7bdbca3c88 100644 --- a/docs/spec/reaction.en-US.md +++ b/docs/spec/reaction.en-US.md @@ -4,13 +4,13 @@ order: 10 title: React Immediately --- -Invitations are powerful because they directly address discoverability and provide feedback before an interaction happens. Transitions are useful because they provide visual feedback during an interaction. But another class of feedback exists. It is the feedback that happens immediately after each interaction with the system, an immediate reaction paired with the user’s action. +Invitations are powerful because they directly address discoverability and provide feedback before an interaction happens. Transitions are useful because they provide visual feedback during an interaction. But another class of feedback exists. It is the feedback that happens immediately after each interaction with the system, an immediate reaction paired with the user's action. -While we can’t literally extend Newton’s law to the world of user interfaces, we certainly can apply this principle to the way we should interact with users. When users click on a button, they expect the button to depress. When they type in a field, they expect to see characters show up in the text box. When they make a mistake, they want the application to tell them where they goofed. +While we can't literally extend Newton's law to the world of user interfaces, we certainly can apply this principle to the way we should interact with users. When users click on a button, they expect the button to depress. When they type in a field, they expect to see characters show up in the text box. When they make a mistake, they want the application to tell them where they goofed. While there is a possibility of too much feedback (or, more accurately, too much of the wrong feedback—a concept we will discuss in the upcoming chapters), a system with little or no feedback feels sluggish and thickheaded. -> ** Newton’s Third Law of Motion **: For every action, there is an equal and opposite reaction, from Wikipedia. +> ** Newton's Third Law of Motion **: For every action, there is an equal and opposite reaction, from Wikipedia. --- diff --git a/docs/spec/repetition.en-US.md b/docs/spec/repetition.en-US.md index a9025c2e42..a680087cdb 100644 --- a/docs/spec/repetition.en-US.md +++ b/docs/spec/repetition.en-US.md @@ -4,7 +4,7 @@ order: 4 title: Repetition --- -The same elements keep repeating in the whole interface, which not only could lower the user’s learning cost effectively, but also help user recognize the relevance between these elements. +The same elements keep repeating in the whole interface, which not only could lower the user's learning cost effectively, but also help user recognize the relevance between these elements. --- @@ -16,4 +16,4 @@ The same elements keep repeating in the whole interface, which not only could lo Example of repetitive of formats -The repetitive element may be a thick rule(line), a wireframe, color, design elements, particular format, spatial relationships, etc. +The repetitive element may be a thick rule(line), a wireframe, color, design elements, particular format, spatial relationships, etc. diff --git a/docs/spec/stay.en-US.md b/docs/spec/stay.en-US.md index 776fb43ac2..7fc4232fd6 100644 --- a/docs/spec/stay.en-US.md +++ b/docs/spec/stay.en-US.md @@ -4,9 +4,9 @@ order: 6 title: Stay on the Page --- -Solve most of problems on the same page and avoid a new one, because the page refresh and forwarding can lead to change blindness, in addition to disrupting the user’s mental flow. +Solve most of problems on the same page and avoid a new one, because the page refresh and forwarding can lead to change blindness, in addition to disrupting the user's mental flow. -> ** Change Blindness** is a surprising perceptual phenomenon that occurs when a change in a visual stimulus is introduced and the observer does not notice it. People's poor ability to detect changes has been argued to reflect fundamental limitations of human attention,from the term of Change blindness, Wikipedia. +> ** Change Blindness** is a surprising perceptual phenomenon that occurs when a change in a visual stimulus is introduced and the observer does not notice it. People's poor ability to detect changes has been argued to reflect fundamental limitations of human attention, from the term of Change blindness, Wikipedia. > ** Flow**, also known as the zone, is the mental state of operation in which a person performing an activity is fully immersed in a feeling of energized focus, full involvement, and enjoyment in the process of the activity, from the term of Flow, Wikipedia @@ -19,7 +19,7 @@ Solve most of problems on the same page and avoid a new one, because the page re good example (special case) bad example +Abusing the Modal can neither bring the context into the popup, which is prone to interrupt the user's flow, nor allow the user to undo the change." src="https://gw.alipayobjects.com/zos/rmsportal/cGqkngXLMBlmMyoHtgFs.png" bad> Double-confirm overlay: Using the Modal to double confirm should be avoided, while affording an opportunity to undo is preferred. @@ -86,5 +86,5 @@ Configurator Process: Provides a configurator that allows users to help them acc example of Dialog Overlay Process -Dialog Overlay Process: Any page switch is an interruption to the user’s mental flow. In addition, any context switch is a chance for a user to leave the site. But sometimes the step-by-step flow is necessary. +Dialog Overlay Process: Any page switch is an interruption to the user's mental flow. In addition, any context switch is a chance for a user to leave the site. But sometimes the step-by-step flow is necessary. diff --git a/docs/spec/transition.en-US.md b/docs/spec/transition.en-US.md index 66105617d9..be1c6f3b75 100644 --- a/docs/spec/transition.en-US.md +++ b/docs/spec/transition.en-US.md @@ -63,7 +63,7 @@ Calling out an Object: Click the page element and call out a new object. ## Improve Perceived Performance -If actual performance can hardly improved, there is a difference between actual performance and perceived performance. Diverting the user’s attention is a good way to improve the perceived time an operation takes. +If actual performance can hardly improved, there is a difference between actual performance and perceived performance. Diverting the user's attention is a good way to improve the perceived time an operation takes. --- diff --git a/package.json b/package.json index 97b6e25869..98e8d2ae99 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "antd", - "version": "3.13.1", + "version": "3.13.2", "title": "Ant Design", "description": "An enterprise-class UI design language and React-based implementation", "homepage": "http://ant.design/", @@ -71,7 +71,7 @@ "rc-progress": "~2.3.0", "rc-rate": "~2.5.0", "rc-select": "~8.8.0", - "rc-slider": "~8.6.3", + "rc-slider": "~8.6.5", "rc-steps": "~3.3.0", "rc-switch": "~1.9.0", "rc-table": "~6.4.0", @@ -103,7 +103,7 @@ "@yesmeck/offline-plugin": "^5.0.5", "ansi-styles": "^3.2.1", "antd-theme-generator": "^1.1.4", - "antd-tools": "^7.0.0", + "antd-tools": "^7.0.1", "babel-eslint": "^10.0.1", "bisheng": "^1.1.0", "bisheng-plugin-antd": "^1.0.0", diff --git a/site/bisheng.config.js b/site/bisheng.config.js index 17cf4b2106..28dd3550c4 100644 --- a/site/bisheng.config.js +++ b/site/bisheng.config.js @@ -123,6 +123,11 @@ module.exports = { return config; }, + devServerConfig: { + public: process.env.DEV_HOST || 'localhost', + disableHostCheck: !!process.env.DEV_HOST, + }, + htmlTemplateExtraData: { isDev, usePreact, diff --git a/site/theme/static/home.less b/site/theme/static/home.less index e99a442fa2..b7b95f1383 100644 --- a/site/theme/static/home.less +++ b/site/theme/static/home.less @@ -112,7 +112,6 @@ display: inline-block; height: 40px; text-align: center; - margin-right: 16px; text-decoration: none; border: 1px solid #2f54eb; font-family: @font-family; diff --git a/site/theme/static/responsive.less b/site/theme/static/responsive.less index 0a56aece89..c4874435aa 100644 --- a/site/theme/static/responsive.less +++ b/site/theme/static/responsive.less @@ -45,6 +45,10 @@ text-align: center; #logo { float: initial; + + img:last-child { + margin-right: 0; + } } } #search-box { diff --git a/site/theme/template/Home/Banner.jsx b/site/theme/template/Home/Banner.jsx index b78abc397e..7e78caff36 100644 --- a/site/theme/template/Home/Banner.jsx +++ b/site/theme/template/Home/Banner.jsx @@ -73,13 +73,17 @@ class Banner extends React.PureComponent { - + {!isMobile && (