diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index f8172b7d7228..c29e4b80ff30 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -15,6 +15,62 @@ timeline: true --- +## 4.0.0-rc.3 + +`2020-01-27` + +- 🛠 Use native Date instead of moment to get timestamp in Countdown component. [#21108](https://github.com/ant-design/ant-design/pull/21108) [@morenyang](https://github.com/morenyang) +- 🐞 Fix Input `suffix / prefix` style issue with `addonBefore / addonAfter`. [#21105](https://github.com/ant-design/ant-design/pull/21105) [@zombieJ](https://github.com/zombieJ) +- 💄 Improved Timeline component style in RTL mode. [#21068](https://github.com/ant-design/ant-design/pull/21068) [@xrkffgg](https://github.com/xrkffgg) +- 💄 Update `clearfix` mixin to remove legacy `zoom` descriptor. [#21109](https://github.com/ant-design/ant-design/pull/21109) [@morenyang](https://github.com/morenyang) +- 💄Card component use `@font-size-base` instead of inline `14px`. [#21107](https://github.com/ant-design/ant-design/pull/21107) [@morenyang](https://github.com/morenyang) +- 💄 Adjust Layout component to let `className` get higher priority. [#21074](https://github.com/ant-design/ant-design/pull/21074) [@yoyo837](https://github.com/yoyo837) +- Typescript + - 🐞 Fix Tree wrong event type of AntTreeNodeMouseEvent. [#21102](https://github.com/ant-design/ant-design/pull/21102) [@Jirka-Lhotka](https://github.com/Jirka-Lhotka) + - 🐞 Fix Form.Item return type define. [#21067](https://github.com/ant-design/ant-design/pull/21067) [@zombieJ](https://github.com/zombieJ) + +## 4.0.0-rc.2 + +`2020-01-21` + +- 🛠 Refactor some demos to React hooks and TypeScript. [#21045](https://github.com/ant-design/ant-design/pull/21045) +- 🐞 Fixed Input/Select components align issue. [#20869](https://github.com/ant-design/ant-design/pull/20869) +- Dropdown + - 🆕 Support `buttonsRender` to customize buttons. [#20815](https://github.com/ant-design/ant-design/pull/20815) + - 🐞 Tooltip doesn't disappear on `disabled` Dropdown.Button in Chrome. [#20960](https://github.com/ant-design/ant-design/pull/20960) +- Input + - 🐞 Fixed Input `prefix` and `suffix` overlap with content issue. [#20872](https://github.com/ant-design/ant-design/pull/20872) + - 🐞 Fixed Input `placeholder` color in Firefox. [#20850](https://github.com/ant-design/ant-design/issues/20850) +- Table + - 🐞 Fixed `onChange` return cached fresh sorter & filter state. [#20858](https://github.com/ant-design/ant-design/pull/20858) + - 🐞 Fixed problem that all-checkbox is checked when all the checkboxes are disabled. [#20968](https://github.com/ant-design/ant-design/pull/20968) + - 🐞 Fixed `locale.emptyText` not working. [#21024](https://github.com/ant-design/ant-design/pull/21024) +- Select + - 🐞 Fixed `placeholder` wrap and align issue. [#20883](https://github.com/ant-design/ant-design/pull/20883) [#20884](https://github.com/ant-design/ant-design/pull/20884) + - 🐞 Fixed multiple Select left padding. [#20861](https://github.com/ant-design/ant-design/pull/20861) + - 🐞 Fixed multiple Select clean icon overlap issue. [#20914](https://github.com/ant-design/ant-design/pull/20914) +- Form + - 🆕 Added scroll options as `scrollToField` argument. [#20774](https://github.com/ant-design/ant-design/pull/20774) + - 🐞 Fixed Form.Item update `help` makes layout shake. [#20886](https://github.com/ant-design/ant-design/pull/20886) + - 🐞 Fixed unexpected extra rerender when Form.Item is not a real Field. [#20963](https://github.com/ant-design/ant-design/pull/20963) + - 🐞 Fixed Form.Item ignore `help=""` issue. [#21026](https://github.com/ant-design/ant-design/pull/21026) + - 🐞 Fixed Form.Item `label` align bug in small screen. [#20836](https://github.com/ant-design/ant-design/issues/20836) +- 🐞 Fixed message cut shadow issue. [#20856](https://github.com/ant-design/ant-design/issues/20856) +- 🐞 Fixed Tooltip hidden when `title` is `0`. [#20894](https://github.com/ant-design/ant-design/pull/20894) +- 🐞 Fixed List `actions` inconsistent position. [#20897](https://github.com/ant-design/ant-design/pull/20897) +- 🆕 Add a visual list example for Tree. [#20911](https://github.com/ant-design/ant-design/pull/20911) +- 🐞 Fixed AutoComplete example styling issue. [#20946](https://github.com/ant-design/ant-design/pull/20946) +- 🗑 Removed AutoComplete useless `labelInValue`. [#20967](https://github.com/ant-design/ant-design/pull/20967) +- 🐞 Fixed Drawer `footerStyle` prop cause react warning. [#20983](https://github.com/ant-design/ant-design/pull/20983) +- 🐞 Fixed Breadcrumb style in `rtl` mode. [#21054](https://github.com/ant-design/ant-design/pull/21054) +- 💄 Tweak Layout `className` order to end. [#21041](https://github.com/ant-design/ant-design/pull/21041) +- TypeScript + - 🐞 Export DatePicker related interface. [#20900](https://github.com/ant-design/ant-design/pull/20900) +- Less variables + - 🆕 Readded `@border-radius-sm`. [#20818](https://github.com/ant-design/ant-design/pull/20818) + - 🆕 Added `@timeline-item-padding-bottom`. [#21013](https://github.com/ant-design/ant-design/pull/21013) + - 🆕 Added `@layout-header-color`. [#21033](https://github.com/ant-design/ant-design/pull/21033) + ## 4.0.0-rc.1 `2020-01-11` diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index 5aeed36b9f96..a6ca6f330f4c 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -15,6 +15,63 @@ timeline: true --- +## 4.0.0-rc.3 + +`2020-01-27` + +- 🛠 移除 Countdown 组件的 `moment` 依赖。[#21108](https://github.com/ant-design/ant-design/pull/21108) [@morenyang](https://github.com/morenyang) +- 🐞 修复 Input `suffix / prefix` 样式与 `addonBefore / addonAfter` 冲突的问题。[#21105](https://github.com/ant-design/ant-design/pull/21105) [@zombieJ](https://github.com/zombieJ) +- 💄 完善 Timeline 组件 RTL 模式下样式。[#21068](https://github.com/ant-design/ant-design/pull/21068) [@xrkffgg](https://github.com/xrkffgg) +- 💄 更新基本样式 `clearfix` 移除过时的 `zoom` 属性。[#21109](https://github.com/ant-design/ant-design/pull/21109) [@morenyang](https://github.com/morenyang) +- 💄Card 组件使用 `@font-size-base` 变量以代替固定的 `14px`。[#21107](https://github.com/ant-design/ant-design/pull/21107) [@morenyang](https://github.com/morenyang) +- 💄 调整 Layout 组件传入的 `className` 到最后以提高其优先级。[#21074](https://github.com/ant-design/ant-design/pull/21074) [@yoyo837](https://github.com/yoyo837) + +- Typescript + - 🐞 修复 Tree 中 AntTreeNodeMouseEvent 的定义问题。[#21102](https://github.com/ant-design/ant-design/pull/21102) [@Jirka-Lhotka](https://github.com/Jirka-Lhotka) + - 🐞 修复 Form.Item 返回的类型定义。[#21067](https://github.com/ant-design/ant-design/pull/21067) [@zombieJ](https://github.com/zombieJ) + +## 4.0.0-rc.2 + +`2020-01-21` + +- 🛠 部分演示改写成 React hooks 和 TypeScript。[#21045](https://github.com/ant-design/ant-design/pull/21045) +- 🐞 修复 Input/Select 等组件的 `1px` 对齐问题。[#20869](https://github.com/ant-design/ant-design/pull/20869) +- Dropdown + - 🆕 新增 `buttonsRender` 用于定制按钮,如给左侧按钮增加 Tooltip。[#20815](https://github.com/ant-design/ant-design/pull/20815) + - 🐞 修复禁用的 Dropdown.Button 在 Chrome 下 Tooltip 不会消失的问题。[#20960](https://github.com/ant-design/ant-design/pull/20960) +- Input + - 🐞 修复 Input `prefix` 和 `suffix` 和输入内容重叠的问题。[#20872](https://github.com/ant-design/ant-design/pull/20872) + - 🐞 修复 Input `placeholder` 在 Firefox 下的颜色问题。[#20850](https://github.com/ant-design/ant-design/issues/20850) +- Table + - 🐞 修复 `onChange` 返回缓存排序、过滤状态的问题。[#20858](https://github.com/ant-design/ant-design/pull/20858) + - 🐞 修复全选在所有选项为禁用时为勾选状态的问题。[#20968](https://github.com/ant-design/ant-design/pull/20968) + - 🐞 修复 `locale.emptyText` 不生效的问题。[#21024](https://github.com/ant-design/ant-design/pull/21024) +- Select + - 🐞 修复 `placeholder` 的换行和对齐问题。[#20883](https://github.com/ant-design/ant-design/pull/20883) [#20884](https://github.com/ant-design/ant-design/pull/20884) + - 🐞 修复多选 Select 的左边距。[#20861](https://github.com/ant-design/ant-design/pull/20861) + - 🐞 修复多选 Select 清除按钮和选项重叠的问题。[#20914](https://github.com/ant-design/ant-design/pull/20914) +- Form + - 🆕 `scrollToField` 方法支持传入滚动相关参数。[#20774](https://github.com/ant-design/ant-design/pull/20774) + - 🐞 修复 Form.Item 改变 `help` 会导致布局闪动的问题。[#20886](https://github.com/ant-design/ant-design/pull/20886) + - 🐞 修复 Form.Item 即便不是一个真正的 Field 也会触发重新渲染的问题。[#20963](https://github.com/ant-design/ant-design/pull/20963) + - 🐞 修复 Form.Item 不处理 `help=""` 的问题。[#21026](https://github.com/ant-design/ant-design/pull/21026) + - 🐞 修复 Form.Item `label` 在屏幕小于 xs 并且 `span` 不是 24 的时候对齐不正确。[#20836](https://github.com/ant-design/ant-design/issues/20836) +- 🐞 修复 message 隐藏时阴影切边的问题。[#20856](https://github.com/ant-design/ant-design/issues/20856) +- 🐞 修复 Tooltip `title` 为 `0` 时没有显示问题。[#20894](https://github.com/ant-design/ant-design/pull/20894) +- 🐞 修复 List `actions` 位置不在右边的问题。[#20897](https://github.com/ant-design/ant-design/pull/20897) +- 🆕 新增一个 Tree 的虚拟滚动演示。[#20911](https://github.com/ant-design/ant-design/pull/20911) +- 🐞 修复 AutoComplete 演示样式错位的问题。[#20946](https://github.com/ant-design/ant-design/pull/20946) +- 🗑 移除掉 AutoComplete 中无用的 `labelInValue` 定义。[#20967](https://github.com/ant-design/ant-design/pull/20967) +- 🐞 修复 Drawer 组件添加 `footerStyle` 属性后控制台报错。[#20983](https://github.com/ant-design/ant-design/pull/20983) +- 🐞 修复 Breadcrumb 在 `rtl` 模式下的样式问题。[#21054](https://github.com/ant-design/ant-design/pull/21054) +- 💄 调整 Layout `className` 的顺序到最后。[#21041](https://github.com/ant-design/ant-design/pull/21041) +- TypeScript + - 🐞 开放 DatePicker 的相关接口定义。[#20900](https://github.com/ant-design/ant-design/pull/20900) +- Less 变量 + - 🆕 重新加回 `@border-radius-sm` 变量。[#20818](https://github.com/ant-design/ant-design/pull/20818) + - 🆕 新增 `@timeline-item-padding-bottom` 变量。[#21013](https://github.com/ant-design/ant-design/pull/21013) + - 🆕 新增 `@layout-header-color` 变量。[#21033](https://github.com/ant-design/ant-design/pull/21033) + ## 4.0.0-rc.1 `2020-01-11` diff --git a/README-pt_BR.md b/README-pt_BR.md new file mode 100644 index 000000000000..8f2065fb86b3 --- /dev/null +++ b/README-pt_BR.md @@ -0,0 +1,137 @@ +

+ + + +

+ +

Ant Design

+ +
+ +Uma solução empresarial de design e biblioteca UI para React. + +[![CircleCI branch](https://img.shields.io/circleci/project/github/ant-design/ant-design/master.svg?style=flat-square)](https://circleci.com/gh/ant-design/ant-design) ![CI Status](https://github.com/ant-design/ant-design/workflows/test/badge.svg) [![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) [![](https://flat.badgen.net/npm/v/antd?icon=npm)](https://www.npmjs.com/package/antd) [![](https://badgen.net/npm/v/antd/next)](https://www.npmjs.com/package/antd) [![NPM downloads](http://img.shields.io/npm/dm/antd.svg?style=flat-square)](http://npmjs.com/antd) + +[![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) + +
+ +[![](https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*Yl83RJhUE7kAAAAAAAAAAABkARQnAQ)](http://ant.design) + +[English](./README.md) | Português | [简体中文](./README-zh_CN.md) + +## ✨ Funcionalidades + +- 🌈 Design empresarial de interface para aplicações web. +- 📦 Um conjunto de alta qualidade, componentes React prontos para uso. +- 🛡 Escrito em TypeScript com tipos previsíveis. +- ⚙️ Pacote completo de recursos de design e ferramentas de desenvolvimento. +- 🌍 Suporte de internacionalização para dezenas de idiomas. +- 🎨 Personalização poderosa do tema em todos os detalhes. + +## 🖥 Suporte aos ambientes + +- Navegadores modernos e Internet Explorer 9+ (com [polyfills](https://ant.design/docs/react/getting-started#Compatibility)) +- Renderização no lado do servidor (server-side) +- [Electron](http://electron.atom.io/) + +| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | [Opera](http://godban.github.io/browsers-support-badges/)
Opera | [Electron](http://godban.github.io/browsers-support-badges/)
Electron | +| --- | --- | --- | --- | --- | --- | +| IE11, Edge | últimas 2 versões | últimas 2 versões | últimas 2 versões | últimas 2 versões | últimas 2 versões | + +## 📦 Instalação + +```bash +npm install antd +``` + +```bash +yarn add antd +``` + +## 🔨 Uso + +```jsx +import { Button, DatePicker } from 'antd'; + +const App = () => ( + <> + + + +); +``` + +Importe o estilo manualmente: + +```jsx +import 'antd/dist/antd.css'; // ou 'antd/dist/antd.less' +``` + +Ou use [babel-plugin-import](https://ant.design/docs/react/getting-started#Import-on-Demand). + +### TypeScript + +Veja [Uso no Typescript](https://ant.design/docs/react/use-in-typescript). + +## 🌍 Internacionalização + +Veja [i18n](http://ant.design/docs/react/i18n). + +## 🔗 Links + +- [Página inicial](http://ant.design/) +- [Componentes](http://ant.design/docs/react/introduce) +- [Ant Design Pro](http://pro.ant.design/) +- [Change Log](CHANGELOG.en-US.md) +- [rc-components](http://react-component.github.io/) +- [Mobile UI](http://mobile.ant.design) +- [Ant Design Icones](https://github.com/ant-design/ant-design-icons) +- [Ant Design Cores](https://github.com/ant-design/ant-design-colors) +- [Ant Design Pro Layout](https://github.com/ant-design/ant-design-pro-layout) +- [Ant Design Pro Blocks](https://github.com/ant-design/pro-blocks) +- [Tema escuro](https://github.com/ant-design/ant-design-dark-theme) +- [Página de aterrissagem](https://landing.ant.design) +- [Motion](https://motion.ant.design) +- [Mercado de páginas](http://scaffold.ant.design) +- [Instruções ao desenvolvedor](https://github.com/ant-design/ant-design/wiki/Development) +- [Versionando as notas de atualização](https://github.com/ant-design/ant-design/wiki/%E8%BD%AE%E5%80%BC%E8%A7%84%E5%88%99%E5%92%8C%E7%89%88%E6%9C%AC%E5%8F%91%E5%B8%83%E6%B5%81%E7%A8%8B) +- [FAQ](https://ant.design/docs/react/faq) +- [CodeSandbox Template](https://u.ant.design/codesandbox-repro) para relatório de erros +- [Awesome Ant Design](https://github.com/websemantics/awesome-ant-design) +- [Customize Theme](http://ant.design/docs/react/customize-theme) + +## ⌨️ Desenvolvimento + +Use Gitpod, um ambiente de desenvolvimento online para GitHub. + +[![Abrir no Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/ant-design/ant-design) + +Ou clone localmente: + +```bash +$ git clone git@github.com:ant-design/ant-design.git +$ cd ant-design +$ npm install +$ npm start +``` + +Abra seu navegador e visite http://127.0.0.1:8001, veja mais em [Desenvolvimento](https://github.com/ant-design/ant-design/wiki/Development). + +## 🤝 Contribuição [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) + +Leia nosso [guia de contribução](https://ant.design/docs/react/contributing) e vamos contruir um melhor antd juntos. + +Nós saudamos todas as contribuições. Por favor, leia nosso [CONTRIBUTING.md](https://github.com/ant-design/ant-design/blob/master/.github/CONTRIBUTING.md) primeiro. Você pode submeter todas as ideias como [Pull Requests](https://github.com/ant-design/ant-design/pulls) ou como [GitHub issues](https://github.com/ant-design/ant-design/issues). Se você quiser melhorar o código, verifique [instruções ao desenvolvedor](https://github.com/ant-design/ant-design/wiki/Development) e divirta-se! :) + +Se você é um colaborador, por favor siga nossa [Pull Request princípio](https://github.com/ant-design/ant-design/wiki/PR-principle) para criar um Pull Request através do [template do colaborador](https://github.com/ant-design/ant-design/compare?expand=1&template=collaborator.md). + +[![Let's fund issues in this repository](https://issuehunt.io/static/embed/issuehunt-button-v1.svg)](https://issuehunt.io/repos/34526884) + +## ❤️ Patrocionadores e Apoiadores [![](https://opencollective.com/ant-design/tiers/sponsors/badge.svg?label=Sponsors&color=brightgreen)](https://opencollective.com/ant-design#support) [![](https://opencollective.com/ant-design/tiers/backers/badge.svg?label=Backers&color=brightgreen)](https://opencollective.com/ant-design#support) + +[![](https://opencollective.com/ant-design/tiers/sponsors.svg?avatarHeight=36)](https://opencollective.com/ant-design#support) + +[![](https://opencollective.com/ant-design/tiers/backers.svg?avatarHeight=36)](https://opencollective.com/ant-design#support) diff --git a/README-zh_CN.md b/README-zh_CN.md index b53f2dc05853..5b0301e8fcd2 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -20,7 +20,7 @@ [![](https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*Ey3wTo-5__QAAAAAAAAAAABkARQnAQ)](http://ant.design/index-cn) -[English](./README.md) | 简体中文 +[English](./README.md) | [Português](./README-pt_BR.md) | 简体中文 ## ✨ 特性 diff --git a/README.md b/README.md index 3d8a1ff7f9a8..1ec8b10227a6 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ An enterprise-class UI design language and React UI library. [![](https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*Yl83RJhUE7kAAAAAAAAAAABkARQnAQ)](http://ant.design) -English | [简体中文](./README-zh_CN.md) +English | [Português](./README-pt_BR.md) | [简体中文](./README-zh_CN.md) ## ✨ Features diff --git a/components/affix/demo/basic.md b/components/affix/demo/basic.md index 8876586f6ed9..18e8725c2d0d 100644 --- a/components/affix/demo/basic.md +++ b/components/affix/demo/basic.md @@ -14,10 +14,10 @@ title: The simplest usage. ```tsx -import React, { useState, FC } from 'react'; +import React, { useState } from 'react'; import { Affix, Button } from 'antd'; -const Demo: FC = () => { +const Demo: React.FC = () => { const [top, setTop] = useState(10); const [bottom, setBottom] = useState(10); diff --git a/components/affix/demo/debug.md b/components/affix/demo/debug.md index 43c15121fbba..abb3c0ebb156 100644 --- a/components/affix/demo/debug.md +++ b/components/affix/demo/debug.md @@ -15,10 +15,10 @@ DEBUG DEBUG ```tsx -import React, { useState, FC } from 'react'; +import React, { useState } from 'react'; import { Affix, Button } from 'antd'; -const Demo: FC = () => { +const Demo: React.FC = () => { const [top, setTop] = useState(10); return (
diff --git a/components/affix/demo/on-change.md b/components/affix/demo/on-change.md index 92c2804f1502..acbdd7d3c18f 100644 --- a/components/affix/demo/on-change.md +++ b/components/affix/demo/on-change.md @@ -13,7 +13,7 @@ title: Callback with affixed state. -```jsx +```tsx import { Affix, Button } from 'antd'; ReactDOM.render( diff --git a/components/affix/demo/target.md b/components/affix/demo/target.md index 3a703162c603..9b1f206d3574 100644 --- a/components/affix/demo/target.md +++ b/components/affix/demo/target.md @@ -14,10 +14,10 @@ title: Set a `target` for 'Affix', which is listen to scroll event of target element (default is `window`). ```tsx -import React, { useState, FC } from 'react'; +import React, { useState } from 'react'; import { Affix, Button } from 'antd'; -const Demo: FC = () => { +const Demo: React.FC = () => { const [container, setContainer] = useState(null); return (
diff --git a/components/alert/demo/banner.md b/components/alert/demo/banner.md index e7590b643110..63d093a3ebdb 100644 --- a/components/alert/demo/banner.md +++ b/components/alert/demo/banner.md @@ -14,7 +14,7 @@ title: Display Alert as a banner at top of page. -```jsx +```tsx import { Alert } from 'antd'; ReactDOM.render( diff --git a/components/alert/demo/basic.md b/components/alert/demo/basic.md index fc15a669cf95..27d5d43f51d7 100644 --- a/components/alert/demo/basic.md +++ b/components/alert/demo/basic.md @@ -13,7 +13,7 @@ title: The simplest usage for short messages. -```jsx +```tsx import { Alert } from 'antd'; ReactDOM.render(, mountNode); diff --git a/components/alert/demo/closable.md b/components/alert/demo/closable.md index 4ee221df6884..0a091e95a6bb 100644 --- a/components/alert/demo/closable.md +++ b/components/alert/demo/closable.md @@ -13,10 +13,10 @@ title: To show close button. -```jsx +```tsx import { Alert } from 'antd'; -const onClose = e => { +const onClose = (e: React.MouseEvent) => { console.log(e, 'I was closed.'); }; diff --git a/components/alert/demo/close-text.md b/components/alert/demo/close-text.md index 6428ccc21a3f..80adff22cd7a 100644 --- a/components/alert/demo/close-text.md +++ b/components/alert/demo/close-text.md @@ -13,7 +13,7 @@ title: Replace the default icon with customized text. -```jsx +```tsx import { Alert } from 'antd'; ReactDOM.render(, mountNode); diff --git a/components/alert/demo/custom-icon.md b/components/alert/demo/custom-icon.md index 9af18eea60dd..ec5446cdc86f 100644 --- a/components/alert/demo/custom-icon.md +++ b/components/alert/demo/custom-icon.md @@ -14,7 +14,7 @@ title: A relevant icon makes information clearer and more friendly. -```jsx +```tsx import { Alert } from 'antd'; import { SmileOutlined } from '@ant-design/icons'; diff --git a/components/alert/demo/description.md b/components/alert/demo/description.md index 88ba60d07ad4..81f7d9d7688b 100644 --- a/components/alert/demo/description.md +++ b/components/alert/demo/description.md @@ -13,7 +13,7 @@ title: Additional description for alert message. -```jsx +```tsx import { Alert } from 'antd'; ReactDOM.render( diff --git a/components/alert/demo/error-boundary.md b/components/alert/demo/error-boundary.md index 5da6035733df..556f151f1a61 100644 --- a/components/alert/demo/error-boundary.md +++ b/components/alert/demo/error-boundary.md @@ -13,34 +13,26 @@ title: ErrorBoundary Component for making error handling easier in [React](https://reactjs.org/blog/2017/07/26/error-handling-in-react-16.html). -```jsx +```tsx +import React, { useState } from 'react'; import { Button, Alert } from 'antd'; const { ErrorBoundary } = Alert; - -class ThrowError extends React.Component { - state = { - error: null, - }; - - onClick = () => { - this.setState({ - error: new Error('An Uncaught Error'), - }); +const ThrowError: React.FC = () => { + const [error, setError] = useState(); + const onClick = () => { + setError(new Error('An Uncaught Error')); }; - render() { - const { error } = this.state; - if (error) { - throw error; - } - return ( - - ); + if (error) { + throw error; } -} + return ( + + ); +}; ReactDOM.render( diff --git a/components/alert/demo/icon.md b/components/alert/demo/icon.md index 2e3b2b8ae1f9..d0b06da85bd2 100644 --- a/components/alert/demo/icon.md +++ b/components/alert/demo/icon.md @@ -13,7 +13,7 @@ title: A relevant icon will make information clearer and more friendly. -```jsx +```tsx import { Alert } from 'antd'; ReactDOM.render( diff --git a/components/alert/demo/smooth-closed.md b/components/alert/demo/smooth-closed.md index 9d901a75d3be..42d0ea863cb7 100644 --- a/components/alert/demo/smooth-closed.md +++ b/components/alert/demo/smooth-closed.md @@ -13,34 +13,24 @@ title: Smoothly unmount Alert upon close. -```jsx +```tsx +import React, { useState } from 'react'; import { Alert } from 'antd'; -class App extends React.Component { - state = { - visible: true, +const App: React.FC = () => { + const [visible, setVisible] = useState(true); + const handleClose = () => { + setVisible(false); }; - - handleClose = () => { - this.setState({ visible: false }); - }; - - render() { - return ( -
- {this.state.visible ? ( - - ) : null} -

placeholder text here

-
- ); - } -} + return ( +
+ {visible ? ( + + ) : null} +

placeholder text here

+
+ ); +}; ReactDOM.render(, mountNode); ``` diff --git a/components/alert/demo/style.md b/components/alert/demo/style.md index 33a2b03ded4d..0571c4892917 100644 --- a/components/alert/demo/style.md +++ b/components/alert/demo/style.md @@ -13,7 +13,7 @@ title: There are 4 types of Alert: `success`, `info`, `warning`, `error`. -```jsx +```tsx import { Alert } from 'antd'; ReactDOM.render( diff --git a/components/anchor/demo/basic.md b/components/anchor/demo/basic.md index ce559a4ae17b..30c53cb3eacc 100644 --- a/components/anchor/demo/basic.md +++ b/components/anchor/demo/basic.md @@ -13,7 +13,7 @@ title: The simplest usage. -```jsx +```tsx import { Anchor } from 'antd'; const { Link } = Anchor; diff --git a/components/anchor/demo/customizeHighlight.md b/components/anchor/demo/customizeHighlight.md index 8718a5edd0e8..525e3af833c9 100644 --- a/components/anchor/demo/customizeHighlight.md +++ b/components/anchor/demo/customizeHighlight.md @@ -13,7 +13,7 @@ title: Customize the anchor highlight. -```jsx +```tsx import { Anchor } from 'antd'; const { Link } = Anchor; diff --git a/components/anchor/demo/onChange.md b/components/anchor/demo/onChange.md index 6b27705352ad..8fae7d651777 100644 --- a/components/anchor/demo/onChange.md +++ b/components/anchor/demo/onChange.md @@ -13,12 +13,12 @@ title: Listening for anchor link change. -```jsx +```tsx import { Anchor } from 'antd'; const { Link } = Anchor; -const onChange = link => { +const onChange = (link: string) => { console.log('Anchor:OnChange', link); }; diff --git a/components/anchor/demo/onClick.md b/components/anchor/demo/onClick.md index 547d07167b5b..4bff4f76a85b 100644 --- a/components/anchor/demo/onClick.md +++ b/components/anchor/demo/onClick.md @@ -13,14 +13,20 @@ title: Clicking on an anchor does not record history. -```jsx +```tsx import { Anchor } from 'antd'; const { Link } = Anchor; -const handleClick = (e, link) => { - e.preventDefault(); - console.log(link); +const handleClick = ( + e: React.MouseEvent, + link: { + title: React.ReactNode; + href: string; + }, + ) => { + e.preventDefault(); + console.log(link); }; ReactDOM.render( diff --git a/components/anchor/demo/static.md b/components/anchor/demo/static.md index 9a6326cdd702..3295dd7c7e0c 100644 --- a/components/anchor/demo/static.md +++ b/components/anchor/demo/static.md @@ -13,7 +13,7 @@ title: Do not change state when page is scrolling. -```jsx +```tsx import { Anchor } from 'antd'; const { Link } = Anchor; diff --git a/components/anchor/demo/targetOffset.md b/components/anchor/demo/targetOffset.md index bcd1aa7d92c2..4bfe76f89ca1 100644 --- a/components/anchor/demo/targetOffset.md +++ b/components/anchor/demo/targetOffset.md @@ -13,35 +13,28 @@ title: Anchor target scroll to screen center. -```jsx +```tsx +import React, { useState, useEffect } from 'react'; import { Anchor } from 'antd'; const { Link } = Anchor; -class AnchorExample extends React.Component { - state = { - targetOffset: undefined, - }; - - componentDidMount() { - this.setState({ - targetOffset: window.innerHeight / 2, - }); - } - - render() { - return ( - - - - - - - - - ); - } -} +const AnchorExample: React.FC = () => { + const [targetOffset, setTargetOffset] = useState(undefined); + useEffect(() => { + setTargetOffset(window.innerHeight / 2); + }, []); + return ( + + + + + + + + + ); +}; ReactDOM.render(, mountNode); ``` diff --git a/components/auto-complete/__tests__/__snapshots__/demo.test.js.snap b/components/auto-complete/__tests__/__snapshots__/demo.test.js.snap index a32493f62a7f..da3e1e19b8e7 100644 --- a/components/auto-complete/__tests__/__snapshots__/demo.test.js.snap +++ b/components/auto-complete/__tests__/__snapshots__/demo.test.js.snap @@ -67,65 +67,61 @@ exports[`renders ./components/auto-complete/demo/basic.md correctly 1`] = ` exports[`renders ./components/auto-complete/demo/certain-category.md correctly 1`] = `
`; @@ -986,21 +982,20 @@ exports[`renders ./components/auto-complete/demo/options.md correctly 1`] = ` exports[`renders ./components/auto-complete/demo/uncertain-category.md correctly 1`] = `
`; diff --git a/components/auto-complete/demo/basic.md b/components/auto-complete/demo/basic.md index 63da432bc0b2..1ab5a39b6cd9 100644 --- a/components/auto-complete/demo/basic.md +++ b/components/auto-complete/demo/basic.md @@ -14,63 +14,51 @@ title: Basic Usage, set data source of autocomplete with `options` property. ```tsx +import React, { useState } from 'react'; import { AutoComplete } from 'antd'; -function onSelect(value) { - console.log('onSelect', value); -} - -function mockVal(str: string, repeat: number = 1) { +const mockVal = (str: string, repeat: number = 1) => { return { value: str.repeat(repeat), }; -} - -class Complete extends React.Component { - state = { - value: '', - options: [], +}; +const Complete: React.FC = () => { + const [value, setValue] = useState(''); + const [options, setOptions] = useState<{ value: string }[]>([]); + const onSearch = (searchText: string) => { + setOptions( + !searchText ? [] : [mockVal(searchText), mockVal(searchText, 2), mockVal(searchText, 3)], + ); }; - - onSearch = searchText => { - this.setState({ - options: !searchText - ? [] - : [mockVal(searchText), mockVal(searchText, 2), mockVal(searchText, 3)], - }); + const onSelect = (data: string) => { + console.log('onSelect', data); }; - - onChange = value => { - this.setState({ value }); + const onChange = (data: string) => { + setValue(data); }; - - render() { - const { options, value } = this.state; - - return ( -
- -
-
- -
- ); - } -} + return ( +
+ +
+
+ +
+ ); +}; ReactDOM.render(, mountNode); ``` diff --git a/components/auto-complete/demo/certain-category.md b/components/auto-complete/demo/certain-category.md index f457197619be..0b7269473d22 100644 --- a/components/auto-complete/demo/certain-category.md +++ b/components/auto-complete/demo/certain-category.md @@ -15,11 +15,9 @@ Demonstration of [Lookup Patterns: Certain Category](https://ant.design/docs/spe ```tsx import { Input, AutoComplete } from 'antd'; -import { SearchOutlined, UserOutlined } from '@ant-design/icons'; +import { UserOutlined } from '@ant-design/icons'; -const { Option, OptGroup } = AutoComplete; - -function renderTitle(title: string) { +const renderTitle = (title: string) => { return ( {title} @@ -33,21 +31,26 @@ function renderTitle(title: string) { ); -} +}; -function renderItem(title: string, count: number) { +const renderItem = (title: string, count: number) => { return { value: title, label: ( - <> +
{title} - + {count} - +
), }; -} +}; const options = [ { @@ -64,34 +67,23 @@ const options = [ }, ]; -function Complete() { +const Complete: React.FC = () => { return ( -
- - } - placeholder="input here" - /> - -
+ + + ); -} +}; ReactDOM.render(, mountNode); ``` ```css -.certain-category-search.ant-select-auto-complete .ant-input-affix-wrapper .ant-input-suffix { - right: 12px; -} - .certain-category-search-dropdown .ant-select-dropdown-menu-item-group-title { color: #666; font-weight: bold; @@ -113,20 +105,4 @@ ReactDOM.render(, mountNode); .certain-category-search-dropdown .ant-select-dropdown-menu { max-height: 300px; } - -.certain-search-item-count { - position: absolute; - color: #999; - right: 16px; -} - -.certain-category-search.ant-select-focused .certain-category-icon { - color: #108ee9; -} - -.certain-category-icon { - color: #6e6e6e; - transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); - font-size: 16px; -} ``` diff --git a/components/auto-complete/demo/custom.md b/components/auto-complete/demo/custom.md index e3dd5e1ee1d6..6345e9071854 100644 --- a/components/auto-complete/demo/custom.md +++ b/components/auto-complete/demo/custom.md @@ -13,51 +13,44 @@ title: Customize Input Component -```jsx +```tsx +import React, { useState } from 'react'; import { AutoComplete, Input } from 'antd'; const { TextArea } = Input; -function onSelect(value) { - console.log('onSelect', value); -} - -class Complete extends React.Component { - state = { - options: [], +const Complete: React.FC = () => { + const [options, setOptions] = useState<{ value: string }[]>([]); + const handleSearch = (value: string) => { + setOptions( + !value ? [] : [{ value }, { value: value + value }, { value: value + value + value }], + ); }; - handleSearch = value => { - this.setState({ - options: !value - ? [] - : [{ value }, { value: value + value }, { value: value + value + value }], - }); + const handleKeyPress = (ev: React.KeyboardEvent) => { + console.log('handleKeyPress', ev); }; - handleKeyPress = ev => { - console.log('handleKeyPress', ev); + const onSelect = (value: string) => { + console.log('onSelect', value); }; - render() { - const { options } = this.state; - return ( - -