mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 19:09:21 +08:00
Compare commits
47 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2268c7aa88 | ||
|
|
d4874fc0b3 | ||
|
|
8b514406e3 | ||
|
|
a820046130 | ||
|
|
9924bbf838 | ||
|
|
04ad7236e4 | ||
|
|
a83143bbbc | ||
|
|
188e5630b3 | ||
|
|
8497e54e39 | ||
|
|
9f633bc002 | ||
|
|
159d42fda8 | ||
|
|
850b670862 | ||
|
|
610807ebf9 | ||
|
|
f90702cd0c | ||
|
|
0cd0ebe7dc | ||
|
|
9559754b5b | ||
|
|
2afab58ac8 | ||
|
|
be0c654fff | ||
|
|
2e284aa017 | ||
|
|
4aa1b62659 | ||
|
|
bb4f0da50e | ||
|
|
5d9d45b597 | ||
|
|
4f1605949e | ||
|
|
217723d321 | ||
|
|
586c7f5218 | ||
|
|
fd7c942403 | ||
|
|
c463b2cc35 | ||
|
|
5e5ec80d04 | ||
|
|
9d03db0503 | ||
|
|
6093f11cf0 | ||
|
|
50e33768a9 | ||
|
|
e15be10faf | ||
|
|
b73e84da9b | ||
|
|
34c2fad636 | ||
|
|
90a36eed0b | ||
|
|
f7e00f645e | ||
|
|
31ba421268 | ||
|
|
227233268d | ||
|
|
08c63d1e23 | ||
|
|
731505813a | ||
|
|
c19685e0ea | ||
|
|
64d151aa81 | ||
|
|
82d709676a | ||
|
|
49f5ed7764 | ||
|
|
fdcbfc909d | ||
|
|
ce36d3e2fe | ||
|
|
9a6ad0edb9 |
@@ -1,11 +0,0 @@
|
||||
---
|
||||
name: '⚠️ Please use new-issue.ant.design ⚠️'
|
||||
about: The issue which is not created via http://new-issue.ant.design will be closed immediately.
|
||||
labels:
|
||||
---
|
||||
|
||||
The issue which is not created via http://new-issue.ant.design will be closed immediately.
|
||||
|
||||
---
|
||||
|
||||
注意:不是用 http://new-issue.ant.design 创建的 issue 会被立即关闭。
|
||||
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Create new issue
|
||||
url: http://new-issue.ant.design
|
||||
about: The issue which is not created via http://new-issue.ant.design will be closed immediately.
|
||||
9
.github/PULL_REQUEST_TEMPLATE.md
vendored
9
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -4,17 +4,20 @@ First of all, thank you for your contribution! 😄
|
||||
New feature please send pull request to feature branch, and rest to master branch.
|
||||
Pull request will be merged after one of collaborators approve.
|
||||
Please makes sure that these form are filled before submitting your pull request, thank you!
|
||||
-->
|
||||
|
||||
[[中文版模板 / Chinese template](https://github.com/ant-design/ant-design/blob/master/.github/PULL_REQUEST_TEMPLATE/pr_cn.md)]
|
||||
-->
|
||||
|
||||
### 🤔 This is a ...
|
||||
|
||||
- [ ] New feature
|
||||
- [ ] Bug fix
|
||||
- [ ] Site / document update
|
||||
- [ ] Site / documentation update
|
||||
- [ ] Demo update
|
||||
- [ ] Component style update
|
||||
- [ ] TypeScript definition update
|
||||
- [ ] Bundle size optimization
|
||||
- [ ] Perfermance optimization
|
||||
- [ ] Refactoring
|
||||
- [ ] Code style optimization
|
||||
- [ ] Test Case
|
||||
@@ -48,7 +51,7 @@ Describe changes from userside, and list all potential break changes or other ri
|
||||
|
||||
### ☑️ Self Check before Merge
|
||||
|
||||
⚠️ Please check all items below before review. ⚠️
|
||||
⚠️ Please check all items below before review. ⚠️
|
||||
|
||||
- [ ] Doc is updated/provided or not needed
|
||||
- [ ] Demo is updated/provided or not needed
|
||||
|
||||
5
.github/PULL_REQUEST_TEMPLATE/pr_cn.md
vendored
5
.github/PULL_REQUEST_TEMPLATE/pr_cn.md
vendored
@@ -13,8 +13,11 @@
|
||||
- [ ] 新特性提交
|
||||
- [ ] 日常 bug 修复
|
||||
- [ ] 站点、文档改进
|
||||
- [ ] 演示代码改进
|
||||
- [ ] 组件样式改进
|
||||
- [ ] TypeScript 定义更新
|
||||
- [ ] 包体积优化
|
||||
- [ ] 性能优化
|
||||
- [ ] 重构
|
||||
- [ ] 代码风格优化
|
||||
- [ ] 测试用例
|
||||
@@ -48,7 +51,7 @@
|
||||
|
||||
### ☑️ 请求合并前的自查清单
|
||||
|
||||
⚠️ 请自检并全部**勾选全部选项**。⚠️
|
||||
⚠️ 请自检并全部**勾选全部选项**。⚠️
|
||||
|
||||
- [ ] 文档已补充或无须补充
|
||||
- [ ] 代码演示已提供或无须提供
|
||||
|
||||
9
.github/workflows/rebase.yml
vendored
9
.github/workflows/rebase.yml
vendored
@@ -1,20 +1,17 @@
|
||||
name: Automatic Rebase
|
||||
# https://github.com/marketplace/actions/automatic-rebase
|
||||
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
|
||||
name: Automatic Rebase
|
||||
jobs:
|
||||
rebase:
|
||||
name: Rebase
|
||||
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@master
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Automatic Rebase
|
||||
uses: cirrus-actions/rebase@1.2
|
||||
uses: cirrus-actions/rebase@1.3
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -1010,7 +1010,6 @@ zytjs <yitongzhao@163.com>
|
||||
郭延豪(708674) <gyh9457@163.com>
|
||||
愚指导-TZ <yutingzhao1991@sina.com>
|
||||
杨小事er <Uiryzd@163.com>
|
||||
杨小事er <uiryzd@163.com>
|
||||
超能刚哥 <margox@foxmail.com>
|
||||
马金花儿 <o.o@mug.dog>
|
||||
रोहन मल्होत्रा <rohan.malhotra@adwyze.com>
|
||||
|
||||
@@ -15,6 +15,42 @@ timeline: true
|
||||
|
||||
---
|
||||
|
||||
## 4.2.3
|
||||
|
||||
`2020-05-16`
|
||||
|
||||
- 🐞 Refactor `rc-progress` to resolve `h3g is not defined` error in `<script src="antd.min.js" />`. [#24127](https://github.com/ant-design/ant-design/pull/24127)
|
||||
- 📖 Rewrote [Use in create-react-app](https://ant.design/docs/react/use-with-create-react-app). [#24184](https://github.com/ant-design/ant-design/pull/24184)
|
||||
- Drawer
|
||||
- 🐞 Fix Drawer `getContainer={false}` height overflow issue. [#24082](https://github.com/ant-design/ant-design/pull/24082)
|
||||
- 🐞 Fix Drawer `mask={false}` animation not working. [#24082](https://github.com/ant-design/ant-design/pull/24082)
|
||||
- BackTop
|
||||
- 🛠 Refactor BackTop with hooks. [#23575](https://github.com/ant-design/ant-design/pull/23575)
|
||||
- 🐞 Fix BackTop not working in iframe of Chrome. [#24194](https://github.com/ant-design/ant-design/pull/24194)
|
||||
- DatePicker
|
||||
- 🐞 Fix DatePicker with `showToday` not working with `disabledDate`. [#24190](https://github.com/ant-design/ant-design/pull/24190)
|
||||
- 🐞 Fix DatePicker `renderExtraFooter` with long content exceed content width. [#24145](https://github.com/ant-design/ant-design/pull/24145)
|
||||
- Button
|
||||
- 🐞 Fix small Button align issue when customize theme. [#24097](https://github.com/ant-design/ant-design/pull/24097)
|
||||
- 🐞 Fix Button children not working with Tooltip. [#24095](https://github.com/ant-design/ant-design/pull/24095)
|
||||
- 🛠 Refactor Tooltip with hooks. [#23699](https://github.com/ant-design/ant-design/pull/23699)
|
||||
- 🐞 Avoid `disabled` Upload.Dragger being triggered by clicking Form `label`. [#24202](https://github.com/ant-design/ant-design/pull/24202)
|
||||
- 🐞 Fix Select selected option not interactive (such as `title` not working). [#24170](https://github.com/ant-design/ant-design/pull/24170)
|
||||
- 🐞 Fix Switch shake in Safari and iOS Chrome. [#24122](https://github.com/ant-design/ant-design/pull/24122) [@lexlexa](https://github.com/lexlexa)
|
||||
- 🐞 Carousel upgrade to `react-slick@0.26.1` to resolve some problems. [#24067](https://github.com/ant-design/ant-design/pull/24067)
|
||||
- 🐞 Cascader will display `defaultValue` instead of empty string when no matched options. [#24058](https://github.com/ant-design/ant-design/pull/24058) [@Kermit-Xuan](https://github.com/Kermit-Xuan)
|
||||
- 🌎 Improve `zh_TW` localisations. [#24065](https://github.com/ant-design/ant-design/pull/24065) [@wx1322](https://github.com/wx1322)
|
||||
- 🐞 Fix Table `onChange` pagination type. [#24114](https://github.com/ant-design/ant-design/pull/24114) [@sorteam](https://github.com/sorteam)
|
||||
- 💄 Add less variable `@card-head-extra-color`. [#24189](https://github.com/ant-design/ant-design/pull/24189)
|
||||
- 💄 Adjust Pagination simple mode background to transparent. [#24152](https://github.com/ant-design/ant-design/pull/24152)
|
||||
- 💄 Fix dark Menu link color. [#24110](https://github.com/ant-design/ant-design/pull/24110)
|
||||
- RTL
|
||||
- 💄 Fix Dropdown.Button default menu placement in RTL. [#24150](https://github.com/ant-design/ant-design/pull/24150)
|
||||
- 💄 Fix Menu `border` in RTL. [#24101](https://github.com/ant-design/ant-design/pull/24101)
|
||||
- 💄 Optimize Select multiple tag style in RTL. [#24112](https://github.com/ant-design/ant-design/pull/24112)
|
||||
- 💄 Optimize Typography `expand` style in RTL. [#24084](https://github.com/ant-design/ant-design/pull/24084)
|
||||
- 💄 Optimize Pagination slash style in RTL. [#24154](https://github.com/ant-design/ant-design/pull/24154)
|
||||
|
||||
## 4.2.2
|
||||
|
||||
`2020-05-11`
|
||||
@@ -52,8 +88,8 @@ timeline: true
|
||||
- 🐞 Fix Slider `marks` selected problem when dragging. [#23773](https://github.com/ant-design/ant-design/pull/23773)
|
||||
- 🛠 Timeline refactors with React Hooks. [#23631](https://github.com/ant-design/ant-design/pull/23631) [@hengkx](https://github.com/hengkx)
|
||||
- 🌎 Localization
|
||||
- 🌐 Add Farsi `fa_IR` default locale template localisations. [#23926](https://github.com/ant-design/ant-design/pull/23926) [@NarimanMov](https://github.com/NarimanMov)
|
||||
- 🌐 Add default `en` default locale template localisations for Form. [#23859](https://github.com/ant-design/ant-design/pull/23859) [@mjfwebb](https://github.com/mjfwebb)
|
||||
- 🇮🇷 Add Farsi `fa_IR` default locale template localisations. [#23926](https://github.com/ant-design/ant-design/pull/23926) [@NarimanMov](https://github.com/NarimanMov)
|
||||
- 🇺🇸 Add default `en` default locale template localisations for Form. [#23859](https://github.com/ant-design/ant-design/pull/23859) [@mjfwebb](https://github.com/mjfwebb)
|
||||
- 📦 Reduce bundle size
|
||||
- 🗑 Reduce bundle size via removing `react-lifecycles-compat`. [#23969](https://github.com/ant-design/ant-design/pull/23969)
|
||||
- 🛠 Reduce bundle size via excluding `package.json` from source code. [#23957](https://github.com/ant-design/ant-design/pull/23957)
|
||||
|
||||
@@ -15,6 +15,42 @@ timeline: true
|
||||
|
||||
---
|
||||
|
||||
## 4.2.3
|
||||
|
||||
`2020-05-16`
|
||||
|
||||
- 🐞 重构 `rc-progress` 以解决 `<script src="antd.min.js" />` 会抛出 `h3g is not defined` 的问题。[#24127](https://github.com/ant-design/ant-design/pull/24127)
|
||||
- 📖 重写了 [在 create-react-app 中使用](https://ant.design/docs/react/use-with-create-react-app-cn)。[#24184](https://github.com/ant-design/ant-design/pull/24184)
|
||||
- Drawer
|
||||
- 🐞 修复 Drawer `getContainer={false}` 时的高度问题。[#24082](https://github.com/ant-design/ant-design/pull/24082)
|
||||
- 🐞 修复 Drawer `mask={false}` 时隐藏动画不生效的问题。[#24082](https://github.com/ant-design/ant-design/pull/24082)
|
||||
- BackTop
|
||||
- 🛠 BackTop 使用 hooks 重构。[#23575](https://github.com/ant-design/ant-design/pull/23575)
|
||||
- 🐞 修复 BackTop 在 Chrome 的 iframe 里不生效的问题。[#24194](https://github.com/ant-design/ant-design/pull/24194)
|
||||
- DatePicker
|
||||
- 🐞 修复 DatePicker `disabledDate` 不会作用到 `showToday` 上的问题。[#24190](https://github.com/ant-design/ant-design/pull/24190)
|
||||
- 🐞 修复 DatePicker `renderExtraFooter` 内容过长超出容器宽度的问题。[#24145](https://github.com/ant-design/ant-design/pull/24145)
|
||||
- Button
|
||||
- 🐞 修复 Button 内图标无法使用 Tooltip 的问题。[#24095](https://github.com/ant-design/ant-design/pull/24095)
|
||||
- 🐞 修复定制主题时小号 Button 错位的问题。[#24097](https://github.com/ant-design/ant-design/pull/24097)
|
||||
- 🛠 Tooltip 使用 hooks 重构。[#23699](https://github.com/ant-design/ant-design/pull/23699)
|
||||
- 🐞 修复 Upload.Dragger 禁用时依然会被 Form `label` 触发的问题。[#24202](https://github.com/ant-design/ant-design/pull/24202)
|
||||
- 🐞 修复 Select 回填选项无法进行交互的问题(如 `title` 不生效)。[#24170](https://github.com/ant-design/ant-design/pull/24170)
|
||||
- 🐞 修复 Switch 在 Safari 和 iOS Chrome 上点击时错位的问题。[#24122](https://github.com/ant-design/ant-design/pull/24122) [@lexlexa](https://github.com/lexlexa)
|
||||
- 🐞 Carousel 更新依赖到 `react-slick@0.26.1` 以修正一些问题。[#24067](https://github.com/ant-design/ant-design/pull/24067)
|
||||
- 🐞 Cascader 没有匹配任何选项时展示 `defaultValue` 而不是空字符串。[#24058](https://github.com/ant-design/ant-design/pull/24058) [@Kermit-Xuan](https://github.com/Kermit-Xuan)
|
||||
- 🌎 完善繁体中文国际化。[#24065](https://github.com/ant-design/ant-design/pull/24065) [@wx1322](https://github.com/wx1322)
|
||||
- 🐞 修复 Table `onChange` pagination 参数定义。[#24114](https://github.com/ant-design/ant-design/pull/24114) [@sorteam](https://github.com/sorteam)
|
||||
- 💄 新增 less 变量 `@card-head-extra-color`。[#24189](https://github.com/ant-design/ant-design/pull/24189)
|
||||
- 💄 调整 Pagination 简洁模式下按钮的背景色为透明。[#24152](https://github.com/ant-design/ant-design/pull/24152)
|
||||
- 💄 修复暗色 Menu 内的链接颜色。[#24110](https://github.com/ant-design/ant-design/pull/24110)
|
||||
- RTL
|
||||
- 💄 修复 Dropdown.Button 下拉框在 RTL 模式下默认位置。[#24150](https://github.com/ant-design/ant-design/pull/24150)
|
||||
- 💄 优化 Pagination 分隔符在 RTL 下的样式。[#24154](https://github.com/ant-design/ant-design/pull/24154)
|
||||
- 💄 修复 Menu 在 RTL 下的 `border` 样式。[#24101](https://github.com/ant-design/ant-design/pull/24101)
|
||||
- 💄 优化 Select 多选项在 RTL 模式下样式。[#24112](https://github.com/ant-design/ant-design/pull/24112)
|
||||
- 💄 优化 Typography `expand` 在 RTL 下的样式。[#24084](https://github.com/ant-design/ant-design/pull/24084)
|
||||
|
||||
## 4.2.2
|
||||
|
||||
`2020-05-11`
|
||||
@@ -52,8 +88,8 @@ timeline: true
|
||||
- 🐞 修复 Slider 拖拽中选中 `marks` 文本的问题。[#23773](https://github.com/ant-design/ant-design/pull/23773)
|
||||
- 🛠 Timeline 使用 React Hooks 重构。[#23631](https://github.com/ant-design/ant-design/pull/23631) [@hengkx](https://github.com/hengkx)
|
||||
- 🌎 国际化
|
||||
- 🌐 增加波斯语 `fa_IR` 国际化默认提示模板。[#23926](https://github.com/ant-design/ant-design/pull/23926) [@NarimanMov](https://github.com/NarimanMov)
|
||||
- 🌐 增加 Form `en` 国际化默认提示模板[#23859](https://github.com/ant-design/ant-design/pull/23859) [@mjfwebb](https://github.com/mjfwebb)
|
||||
- 🇮🇷 增加波斯语 `fa_IR` 国际化默认提示模板。[#23926](https://github.com/ant-design/ant-design/pull/23926) [@NarimanMov](https://github.com/NarimanMov)
|
||||
- 🇺🇸 增加 Form `en` 国际化默认提示模板[#23859](https://github.com/ant-design/ant-design/pull/23859) [@mjfwebb](https://github.com/mjfwebb)
|
||||
- 📦 包体积优化
|
||||
- 🗑 移除 `react-lifecycles-compat` 依赖以优化包体积。[#23969](https://github.com/ant-design/ant-design/pull/23969)
|
||||
- 🛠 源码中不再引用 `package.json` 从而优化了一点包体积。[#23957](https://github.com/ant-design/ant-design/pull/23957)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<p align="center">
|
||||
<a href="http://ant.design">
|
||||
<a href="https://ant.design">
|
||||
<img width="200" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg">
|
||||
</a>
|
||||
</p>
|
||||
@@ -10,15 +10,44 @@
|
||||
|
||||
Uma solução empresarial de design e biblioteca UI para React.
|
||||
|
||||
[](https://circleci.com/gh/ant-design/ant-design)  [](https://codecov.io/gh/ant-design/ant-design/branch/master) [](https://www.npmjs.com/package/antd) [](http://npmjs.com/antd)
|
||||
[![CircleCI status][circleci-image]][circleci-url] [![CI status][github-action-image]][github-action-url] [![codecov][codecov-image]][codecov-url] [![NPM version][npm-image]][npm-url] [![NPM downloads][download-image]][download-url]
|
||||
|
||||
[](https://david-dm.org/ant-design/ant-design) [](https://david-dm.org/ant-design/ant-design?type=dev) [](https://lgtm.com/projects/g/ant-design/ant-design/alerts/) [](https://app.fossa.io/projects/git%2Bgithub.com%2Fant-design%2Fant-design?ref=badge_shield) [](https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)
|
||||
[![david deps][david-image]][david-url] [![david devDeps][david-dev-image]][david-dev-url] [![Total alerts][lgtm-image]][lgtm-url] [![FOSSA Status][fossa-image]][fossa-url] [![Issues need help][help-wanted-image]][help-wanted-url]
|
||||
|
||||
[](https://twitter.com/AntDesignUI) [](https://gitter.im/ant-design/ant-design-english?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [](https://gitter.im/ant-design/ant-design?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[![Follow Twitter][twitter-image]][twitter-url] [![Gitter][gitter-english-image]][gitter-english-url] [![Gitter][gitter-chinese-image]][gitter-chinese-url] [![[SemVer stability]][semver-stability-image]][semver-stability-url]
|
||||
|
||||
[npm-image]: http://img.shields.io/npm/v/antd.svg?style=flat-square
|
||||
[npm-url]: http://npmjs.org/package/antd
|
||||
[circleci-image]: https://img.shields.io/travis/com/ant-design/ant-design.svg?style=flat-square
|
||||
[circleci-url]: https://travis-ci.com/ant-design/ant-design
|
||||
[github-action-image]: https://github.com/ant-design/ant-design/workflows/test/badge.svg
|
||||
[github-action-url]: https://github.com/ant-design/ant-design/actions?query=workflow%3Atest
|
||||
[codecov-image]: https://img.shields.io/codecov/c/github/ant-design/ant-design/master.svg?style=flat-square
|
||||
[codecov-url]: https://codecov.io/gh/ant-design/ant-design/branch/master
|
||||
[david-image]: https://img.shields.io/david/ant-design/ant-design?style=flat-square
|
||||
[david-dev-url]: https://david-dm.org/ant-design/ant-design?type=dev
|
||||
[david-dev-image]: https://img.shields.io/david/dev/ant-design/ant-design?style=flat-square
|
||||
[david-url]: https://david-dm.org/ant-design/ant-design
|
||||
[download-image]: https://img.shields.io/npm/dm/antd.svg?style=flat-square
|
||||
[download-url]: https://npmjs.org/package/antd
|
||||
[lgtm-image]: https://flat.badgen.net/lgtm/alerts/g/ant-design/ant-design
|
||||
[lgtm-url]: https://lgtm.com/projects/g/ant-design/ant-design/alerts/
|
||||
[fossa-image]: https://app.fossa.io/api/projects/git%2Bgithub.com%2Fant-design%2Fant-design.svg?type=shield
|
||||
[fossa-url]: https://app.fossa.io/projects/git%2Bgithub.com%2Fant-design%2Fant-design?ref=badge_shield
|
||||
[help-wanted-image]: https://flat.badgen.net/github/label-issues/ant-design/ant-design/help%20wanted/open
|
||||
[help-wanted-url]: https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22
|
||||
[twitter-image]: https://img.shields.io/twitter/follow/AntDesignUI.svg?label=Ant%20Design&style=social
|
||||
[twitter-url]: https://twitter.com/AntDesignUI
|
||||
[gitter-english-image]: https://img.shields.io/gitter/room/ant-design/ant-design-english.svg?style=flat-square&logoWidth=18&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjEyMzUiIGhlaWdodD0iNjUwIiB2aWV3Qm94PSIwIDAgNzQxMCAzOTAwIj4NCjxyZWN0IHdpZHRoPSI3NDEwIiBoZWlnaHQ9IjM5MDAiIGZpbGw9IiNiMjIyMzQiLz4NCjxwYXRoIGQ9Ik0wLDQ1MEg3NDEwbTAsNjAwSDBtMCw2MDBINzQxMG0wLDYwMEgwbTAsNjAwSDc0MTBtMCw2MDBIMCIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjMwMCIvPg0KPHJlY3Qgd2lkdGg9IjI5NjQiIGhlaWdodD0iMjEwMCIgZmlsbD0iIzNjM2I2ZSIvPg0KPGcgZmlsbD0iI2ZmZiI%2BDQo8ZyBpZD0iczE4Ij4NCjxnIGlkPSJzOSI%2BDQo8ZyBpZD0iczUiPg0KPGcgaWQ9InM0Ij4NCjxwYXRoIGlkPSJzIiBkPSJNMjQ3LDkwIDMxNy41MzQyMzAsMzA3LjA4MjAzOSAxMzIuODczMjE4LDE3Mi45MTc5NjFIMzYxLjEyNjc4MkwxNzYuNDY1NzcwLDMwNy4wODIwMzl6Ii8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB5PSI0MjAiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHk9Ijg0MCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTI2MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTY4MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjczQiIHg9IjI0NyIgeT0iMjEwIi8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzOSIgeD0iNDk0Ii8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzMTgiIHg9Ijk4OCIvPg0KPHVzZSB4bGluazpocmVmPSIjczkiIHg9IjE5NzYiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3M1IiB4PSIyNDcwIi8%2BDQo8L2c%2BDQo8L3N2Zz4%3D
|
||||
[gitter-english-url]: https://gitter.im/ant-design/ant-design-english?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge
|
||||
[gitter-chinese-image]: https://img.shields.io/gitter/room/ant-design/ant-design.svg?style=flat-square&logoWidth=18&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjkwMCIgaGVpZ2h0PSI2MDAiIHZpZXdCb3g9IjAgMCAzMCAyMCI%2BDQo8ZGVmcz4NCjxwYXRoIGlkPSJzIiBkPSJNMCwtMSAwLjU4Nzc4NSwwLjgwOTAxNyAtMC45NTEwNTcsLTAuMzA5MDE3SDAuOTUxMDU3TC0wLjU4Nzc4NSwwLjgwOTAxN3oiIGZpbGw9IiNmZmRlMDAiLz4NCjwvZGVmcz4NCjxyZWN0IHdpZHRoPSIzMCIgaGVpZ2h0PSIyMCIgZmlsbD0iI2RlMjkxMCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNSw1KSBzY2FsZSgzKSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsMikgcm90YXRlKDIzLjAzNjI0MykiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEyLDQpIHJvdGF0ZSg0NS44Njk4OTgpIi8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMiw3KSByb3RhdGUoNjkuOTQ1Mzk2KSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsOSkgcm90YXRlKDIwLjY1OTgwOCkiLz4NCjwvc3ZnPg%3D%3D
|
||||
[gitter-chinese-url]: https://gitter.im/ant-design/ant-design?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
|
||||
[semver-stability-url]: https://dependabot.com/compatibility-score.html/?dependency-name=antd&package-manager=npm_and_yarn&new-version=latest
|
||||
[semver-stability-image]: https://api.dependabot.com/badges/compatibility_score?dependency-name=antd&package-manager=npm_and_yarn&target-version=latest&version-scheme=semver
|
||||
|
||||
</div>
|
||||
|
||||
[](http://ant.design)
|
||||
[](https://ant.design)
|
||||
|
||||
[English](./README.md) | Português | [简体中文](./README-zh_CN.md)
|
||||
|
||||
@@ -70,20 +99,18 @@ Importe o estilo manualmente:
|
||||
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).
|
||||
Veja [i18n](https://ant.design/docs/react/i18n).
|
||||
|
||||
## 🔗 Links
|
||||
|
||||
- [Página inicial](http://ant.design/)
|
||||
- [Componentes](http://ant.design/docs/react/introduce)
|
||||
- [Página inicial](https://ant.design/)
|
||||
- [Componentes](https://ant.design/components/button)
|
||||
- [Ant Design Pro](http://pro.ant.design/)
|
||||
- [Change Log](CHANGELOG.en-US.md)
|
||||
- [rc-components](http://react-component.github.io/)
|
||||
@@ -101,7 +128,7 @@ Veja [i18n](http://ant.design/docs/react/i18n).
|
||||
- [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)
|
||||
- [Customize Theme](https://ant.design/docs/react/customize-theme)
|
||||
- [How to Apply for Being A Collaborator](https://github.com/ant-design/ant-design/wiki/Collaborators#how-to-apply-for-being-a-collaborator)
|
||||
|
||||
## ⌨️ Desenvolvimento
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<p align="center">
|
||||
<a href="http://ant.design">
|
||||
<a href="https://ant.design">
|
||||
<img width="200" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg">
|
||||
</a>
|
||||
</p>
|
||||
@@ -10,15 +10,44 @@
|
||||
|
||||
一套企业级 UI 设计语言和 React 组件库。
|
||||
|
||||
[](https://circleci.com/gh/ant-design/ant-design)  [](https://codecov.io/gh/ant-design/ant-design/branch/master) [](https://www.npmjs.com/package/antd) [](http://npmjs.com/antd)
|
||||
[![CircleCI status][circleci-image]][circleci-url] [![CI status][github-action-image]][github-action-url] [![codecov][codecov-image]][codecov-url] [![NPM version][npm-image]][npm-url] [![NPM downloads][download-image]][download-url]
|
||||
|
||||
[](https://david-dm.org/ant-design/ant-design) [](https://david-dm.org/ant-design/ant-design?type=dev) [](https://lgtm.com/projects/g/ant-design/ant-design/alerts/) [](https://app.fossa.io/projects/git%2Bgithub.com%2Fant-design%2Fant-design?ref=badge_shield) [](https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)
|
||||
[![david deps][david-image]][david-url] [![david devDeps][david-dev-image]][david-dev-url] [![Total alerts][lgtm-image]][lgtm-url] [![FOSSA Status][fossa-image]][fossa-url] [![Issues need help][help-wanted-image]][help-wanted-url]
|
||||
|
||||
[](https://twitter.com/AntDesignUI) [](https://gitter.im/ant-design/ant-design-english?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [](https://gitter.im/ant-design/ant-design?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[![Follow Twitter][twitter-image]][twitter-url] [![Gitter][gitter-english-image]][gitter-english-url] [![Gitter][gitter-chinese-image]][gitter-chinese-url] [![[SemVer stability]][semver-stability-image]][semver-stability-url]
|
||||
|
||||
[npm-image]: http://img.shields.io/npm/v/antd.svg?style=flat-square
|
||||
[npm-url]: http://npmjs.org/package/antd
|
||||
[circleci-image]: https://img.shields.io/travis/com/ant-design/ant-design.svg?style=flat-square
|
||||
[circleci-url]: https://travis-ci.com/ant-design/ant-design
|
||||
[github-action-image]: https://github.com/ant-design/ant-design/workflows/test/badge.svg
|
||||
[github-action-url]: https://github.com/ant-design/ant-design/actions?query=workflow%3Atest
|
||||
[codecov-image]: https://img.shields.io/codecov/c/github/ant-design/ant-design/master.svg?style=flat-square
|
||||
[codecov-url]: https://codecov.io/gh/ant-design/ant-design/branch/master
|
||||
[david-image]: https://img.shields.io/david/ant-design/ant-design?style=flat-square
|
||||
[david-dev-url]: https://david-dm.org/ant-design/ant-design?type=dev
|
||||
[david-dev-image]: https://img.shields.io/david/dev/ant-design/ant-design?style=flat-square
|
||||
[david-url]: https://david-dm.org/ant-design/ant-design
|
||||
[download-image]: https://img.shields.io/npm/dm/antd.svg?style=flat-square
|
||||
[download-url]: https://npmjs.org/package/antd
|
||||
[lgtm-image]: https://flat.badgen.net/lgtm/alerts/g/ant-design/ant-design
|
||||
[lgtm-url]: https://lgtm.com/projects/g/ant-design/ant-design/alerts/
|
||||
[fossa-image]: https://app.fossa.io/api/projects/git%2Bgithub.com%2Fant-design%2Fant-design.svg?type=shield
|
||||
[fossa-url]: https://app.fossa.io/projects/git%2Bgithub.com%2Fant-design%2Fant-design?ref=badge_shield
|
||||
[help-wanted-image]: https://flat.badgen.net/github/label-issues/ant-design/ant-design/help%20wanted/open
|
||||
[help-wanted-url]: https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22
|
||||
[twitter-image]: https://img.shields.io/twitter/follow/AntDesignUI.svg?label=Ant%20Design&style=social
|
||||
[twitter-url]: https://twitter.com/AntDesignUI
|
||||
[gitter-english-image]: https://img.shields.io/gitter/room/ant-design/ant-design-english.svg?style=flat-square&logoWidth=18&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjEyMzUiIGhlaWdodD0iNjUwIiB2aWV3Qm94PSIwIDAgNzQxMCAzOTAwIj4NCjxyZWN0IHdpZHRoPSI3NDEwIiBoZWlnaHQ9IjM5MDAiIGZpbGw9IiNiMjIyMzQiLz4NCjxwYXRoIGQ9Ik0wLDQ1MEg3NDEwbTAsNjAwSDBtMCw2MDBINzQxMG0wLDYwMEgwbTAsNjAwSDc0MTBtMCw2MDBIMCIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjMwMCIvPg0KPHJlY3Qgd2lkdGg9IjI5NjQiIGhlaWdodD0iMjEwMCIgZmlsbD0iIzNjM2I2ZSIvPg0KPGcgZmlsbD0iI2ZmZiI%2BDQo8ZyBpZD0iczE4Ij4NCjxnIGlkPSJzOSI%2BDQo8ZyBpZD0iczUiPg0KPGcgaWQ9InM0Ij4NCjxwYXRoIGlkPSJzIiBkPSJNMjQ3LDkwIDMxNy41MzQyMzAsMzA3LjA4MjAzOSAxMzIuODczMjE4LDE3Mi45MTc5NjFIMzYxLjEyNjc4MkwxNzYuNDY1NzcwLDMwNy4wODIwMzl6Ii8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB5PSI0MjAiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHk9Ijg0MCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTI2MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTY4MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjczQiIHg9IjI0NyIgeT0iMjEwIi8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzOSIgeD0iNDk0Ii8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzMTgiIHg9Ijk4OCIvPg0KPHVzZSB4bGluazpocmVmPSIjczkiIHg9IjE5NzYiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3M1IiB4PSIyNDcwIi8%2BDQo8L2c%2BDQo8L3N2Zz4%3D
|
||||
[gitter-english-url]: https://gitter.im/ant-design/ant-design-english?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge
|
||||
[gitter-chinese-image]: https://img.shields.io/gitter/room/ant-design/ant-design.svg?style=flat-square&logoWidth=18&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjkwMCIgaGVpZ2h0PSI2MDAiIHZpZXdCb3g9IjAgMCAzMCAyMCI%2BDQo8ZGVmcz4NCjxwYXRoIGlkPSJzIiBkPSJNMCwtMSAwLjU4Nzc4NSwwLjgwOTAxNyAtMC45NTEwNTcsLTAuMzA5MDE3SDAuOTUxMDU3TC0wLjU4Nzc4NSwwLjgwOTAxN3oiIGZpbGw9IiNmZmRlMDAiLz4NCjwvZGVmcz4NCjxyZWN0IHdpZHRoPSIzMCIgaGVpZ2h0PSIyMCIgZmlsbD0iI2RlMjkxMCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNSw1KSBzY2FsZSgzKSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsMikgcm90YXRlKDIzLjAzNjI0MykiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEyLDQpIHJvdGF0ZSg0NS44Njk4OTgpIi8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMiw3KSByb3RhdGUoNjkuOTQ1Mzk2KSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsOSkgcm90YXRlKDIwLjY1OTgwOCkiLz4NCjwvc3ZnPg%3D%3D
|
||||
[gitter-chinese-url]: https://gitter.im/ant-design/ant-design?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
|
||||
[semver-stability-url]: https://dependabot.com/compatibility-score.html/?dependency-name=antd&package-manager=npm_and_yarn&new-version=latest
|
||||
[semver-stability-image]: https://api.dependabot.com/badges/compatibility_score?dependency-name=antd&package-manager=npm_and_yarn&target-version=latest&version-scheme=semver
|
||||
|
||||
</div>
|
||||
|
||||
[](http://ant.design/index-cn)
|
||||
[](https://ant.design/index-cn)
|
||||
|
||||
[English](./README.md) | [Português](./README-pt_BR.md) | 简体中文
|
||||
|
||||
@@ -31,7 +60,7 @@
|
||||
- 🌍 数十个国际化语言支持。
|
||||
- 🎨 深入每个细节的主题定制能力。
|
||||
|
||||
## 🖥 支持环境
|
||||
## 🖥 兼容环境
|
||||
|
||||
- 现代浏览器和 IE11(需要 [polyfills](https://ant.design/docs/react/getting-started-cn#兼容性))。
|
||||
- 支持服务端渲染。
|
||||
@@ -70,8 +99,6 @@ const App = () => (
|
||||
import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
|
||||
```
|
||||
|
||||
你也可以使用 [babel-plugin-import](https://ant.design/docs/react/getting-started-cn#按需加载)。
|
||||
|
||||
### 🌈 定制主题
|
||||
|
||||
参考 [定制主题](https://ant.design/docs/react/customize-theme-cn) 文档。
|
||||
@@ -82,12 +109,12 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
|
||||
|
||||
## 🌍 国际化
|
||||
|
||||
参考 [国际化文档](http://ant.design/docs/react/i18n-cn)。
|
||||
参考 [国际化文档](https://ant.design/docs/react/i18n-cn)。
|
||||
|
||||
## 🔗 链接
|
||||
|
||||
- [首页](http://ant.design/)
|
||||
- [组件库](http://ant.design/docs/react/introduce)
|
||||
- [首页](https://ant.design/)
|
||||
- [组件库](https://ant.design/docs/react/introduce)
|
||||
- [Ant Design Pro](http://pro.ant.design/)
|
||||
- [更新日志](CHANGELOG.en-US.md)
|
||||
- [React 底层基础组件](http://react-component.github.io/)
|
||||
@@ -106,7 +133,7 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
|
||||
- [常见问题](https://ant.design/docs/react/faq-cn)
|
||||
- [CodeSandbox 模板](https://u.ant.design/codesandbox-repro) for bug reports
|
||||
- [Awesome Ant Design](https://github.com/websemantics/awesome-ant-design)
|
||||
- [定制主题](http://ant.design/docs/react/customize-theme-cn)
|
||||
- [定制主题](https://ant.design/docs/react/customize-theme-cn)
|
||||
- [成为社区协作成员](https://github.com/ant-design/ant-design/wiki/Collaborators#how-to-apply-for-being-a-collaborator)
|
||||
|
||||
## ⌨️ 本地开发
|
||||
|
||||
16
README.md
16
README.md
@@ -1,5 +1,5 @@
|
||||
<p align="center">
|
||||
<a href="http://ant.design">
|
||||
<a href="https://ant.design">
|
||||
<img width="200" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg">
|
||||
</a>
|
||||
</p>
|
||||
@@ -47,7 +47,7 @@ An enterprise-class UI design language and React UI library.
|
||||
|
||||
</div>
|
||||
|
||||
[](http://ant.design)
|
||||
[](https://ant.design)
|
||||
|
||||
English | [Português](./README-pt_BR.md) | [简体中文](./README-zh_CN.md)
|
||||
|
||||
@@ -88,7 +88,7 @@ import { Button, DatePicker } from 'antd';
|
||||
const App = () => (
|
||||
<>
|
||||
<Button type="primary">PRESS ME</Button>
|
||||
<DatePicker />
|
||||
<DatePicker placeholder="select date" />
|
||||
</>
|
||||
);
|
||||
```
|
||||
@@ -99,19 +99,17 @@ And import style manually:
|
||||
import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
|
||||
```
|
||||
|
||||
Or use [babel-plugin-import](https://ant.design/docs/react/getting-started#Import-on-Demand).
|
||||
|
||||
### TypeScript
|
||||
|
||||
See [Use in TypeScript](https://ant.design/docs/react/use-in-typescript).
|
||||
`antd` is written in TypeScript with complete definitions, check [Use in TypeScript](https://ant.design/docs/react/use-in-typescript) to getting started.
|
||||
|
||||
## 🌍 Internationalization
|
||||
|
||||
See [i18n](http://ant.design/docs/react/i18n).
|
||||
Dozens of languages supported in `antd`, see [i18n](https://ant.design/docs/react/i18n).
|
||||
|
||||
## 🔗 Links
|
||||
|
||||
- [Home page](http://ant.design/)
|
||||
- [Home page](https://ant.design/)
|
||||
- [Components](https://ant.design/components/button/)
|
||||
- [Ant Design Pro](http://pro.ant.design/)
|
||||
- [Change Log](CHANGELOG.en-US.md)
|
||||
@@ -130,7 +128,7 @@ See [i18n](http://ant.design/docs/react/i18n).
|
||||
- [FAQ](https://ant.design/docs/react/faq)
|
||||
- [CodeSandbox Template](https://u.ant.design/codesandbox-repro) for bug reports
|
||||
- [Awesome Ant Design](https://github.com/websemantics/awesome-ant-design)
|
||||
- [Customize Theme](http://ant.design/docs/react/customize-theme)
|
||||
- [Customize Theme](https://ant.design/docs/react/customize-theme)
|
||||
- [How to Apply for Being A Collaborator](https://github.com/ant-design/ant-design/wiki/Collaborators#how-to-apply-for-being-a-collaborator)
|
||||
|
||||
## ⌨️ Development
|
||||
|
||||
@@ -1,11 +1,57 @@
|
||||
/**
|
||||
* @jest-environment node
|
||||
*/
|
||||
import getScroll from '../getScroll';
|
||||
|
||||
describe('getScroll', () => {
|
||||
it('getScroll return 0 in node envioronment', async () => {
|
||||
it('getScroll target null', async () => {
|
||||
expect(getScroll(null, true)).toBe(0);
|
||||
expect(getScroll(null, false)).toBe(0);
|
||||
});
|
||||
|
||||
it('getScroll window', async () => {
|
||||
const scrollToSpy = jest.spyOn(window, 'scrollTo').mockImplementation((x, y) => {
|
||||
window.pageXOffset = x;
|
||||
window.pageYOffset = y;
|
||||
});
|
||||
window.scrollTo(200, 400);
|
||||
expect(getScroll(window, true)).toBe(400);
|
||||
expect(getScroll(window, false)).toBe(200);
|
||||
scrollToSpy.mockRestore();
|
||||
});
|
||||
|
||||
it('getScroll document', async () => {
|
||||
const scrollToSpy = jest.spyOn(window, 'scrollTo').mockImplementation((x, y) => {
|
||||
document.documentElement.scrollLeft = x;
|
||||
document.documentElement.scrollTop = y;
|
||||
});
|
||||
window.scrollTo(200, 400);
|
||||
expect(getScroll(document, true)).toBe(400);
|
||||
expect(getScroll(document, false)).toBe(200);
|
||||
scrollToSpy.mockRestore();
|
||||
});
|
||||
|
||||
it('getScroll div', async () => {
|
||||
const div = document.createElement('div');
|
||||
const scrollToSpy = jest.spyOn(window, 'scrollTo').mockImplementation((x, y) => {
|
||||
div.scrollLeft = x;
|
||||
div.scrollTop = y;
|
||||
});
|
||||
window.scrollTo(200, 400);
|
||||
expect(getScroll(div, true)).toBe(400);
|
||||
expect(getScroll(div, false)).toBe(200);
|
||||
scrollToSpy.mockRestore();
|
||||
});
|
||||
|
||||
it('getScroll documentElement', async () => {
|
||||
const div = {};
|
||||
const scrollToSpy = jest.spyOn(window, 'scrollTo').mockImplementation((x, y) => {
|
||||
div.scrollLeft = null;
|
||||
div.scrollTop = null;
|
||||
div.documentElement = {};
|
||||
div.documentElement.scrollLeft = x;
|
||||
div.documentElement.scrollTop = y;
|
||||
});
|
||||
window.scrollTo(200, 400);
|
||||
expect(getScroll(div, true)).toBe(400);
|
||||
expect(getScroll(div, false)).toBe(200);
|
||||
scrollToSpy.mockRestore();
|
||||
});
|
||||
});
|
||||
|
||||
11
components/_util/__tests__/getScrollNode.test.ts
Normal file
11
components/_util/__tests__/getScrollNode.test.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* @jest-environment node
|
||||
*/
|
||||
import getScroll from '../getScroll';
|
||||
|
||||
describe('getScroll node', () => {
|
||||
it('getScroll return 0 in node environment', async () => {
|
||||
expect(getScroll(null, true)).toBe(0);
|
||||
expect(getScroll(null, false)).toBe(0);
|
||||
});
|
||||
});
|
||||
@@ -46,4 +46,21 @@ describe('Test ScrollTo function', () => {
|
||||
await sleep(20);
|
||||
expect(div.scrollTop).toBe(1000);
|
||||
});
|
||||
|
||||
it('test getContainer document - option', async () => {
|
||||
scrollTo(1000, {
|
||||
getContainer: () => document,
|
||||
});
|
||||
await sleep(20);
|
||||
expect(document.documentElement.scrollTop).toBe(1000);
|
||||
});
|
||||
|
||||
it('test duration - option', async () => {
|
||||
scrollTo(1000, {
|
||||
duration: 1100,
|
||||
getContainer: () => document,
|
||||
});
|
||||
await sleep(20);
|
||||
expect(document.documentElement.scrollTop).toBe(1000);
|
||||
});
|
||||
});
|
||||
|
||||
7
components/_util/devWarning.ts
Normal file
7
components/_util/devWarning.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import devWarning, { resetWarned } from 'rc-util/lib/warning';
|
||||
|
||||
export { resetWarned };
|
||||
|
||||
export default (valid: boolean, component: string, message: string): void => {
|
||||
devWarning(valid, `[antd: ${component}] ${message}`);
|
||||
};
|
||||
@@ -1,8 +1,17 @@
|
||||
import * as React from 'react';
|
||||
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export function cloneElement(element: React.ReactNode, ...restArgs: any[]) {
|
||||
if (!React.isValidElement(element)) return element;
|
||||
export const isValidElement = React.isValidElement;
|
||||
|
||||
return React.cloneElement(element, ...restArgs);
|
||||
export function replaceElement(
|
||||
element: React.ReactNode,
|
||||
replacement: React.ReactNode,
|
||||
props: any,
|
||||
): React.ReactNode {
|
||||
if (!isValidElement(element)) return replacement;
|
||||
|
||||
return React.cloneElement(element, typeof props === 'function' ? props() : props);
|
||||
}
|
||||
|
||||
export function cloneElement(element: React.ReactNode, props?: any): React.ReactElement {
|
||||
return replaceElement(element, element, props) as React.ReactElement;
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@ export default function scrollTo(y: number, options: ScrollToOptions = {}) {
|
||||
const nextScrollTop = easeInOutCubic(time > duration ? duration : time, scrollTop, y, duration);
|
||||
if (isWindow(container)) {
|
||||
(container as Window).scrollTo(window.pageXOffset, nextScrollTop);
|
||||
} else if (container instanceof Document) {
|
||||
container.documentElement.scrollTop = nextScrollTop;
|
||||
} else if (container instanceof HTMLDocument || container.constructor.name === 'HTMLDocument') {
|
||||
(container as HTMLDocument).documentElement.scrollTop = nextScrollTop;
|
||||
} else {
|
||||
(container as HTMLElement).scrollTop = nextScrollTop;
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
import warning, { resetWarned } from 'rc-util/lib/warning';
|
||||
|
||||
export { resetWarned };
|
||||
|
||||
export default (valid: boolean, component: string, message: string): void => {
|
||||
warning(valid, `[antd: ${component}] ${message}`);
|
||||
};
|
||||
@@ -74,9 +74,10 @@ describe('Alert', () => {
|
||||
});
|
||||
|
||||
it('could be used with Tooltip', async () => {
|
||||
const ref = React.createRef<any>();
|
||||
jest.useRealTimers();
|
||||
const wrapper = mount(
|
||||
<Tooltip title="xxx" mouseEnterDelay={0}>
|
||||
<Tooltip title="xxx" mouseEnterDelay={0} ref={ref}>
|
||||
<Alert
|
||||
message="Warning Text Warning Text Warning TextW arning Text Warning Text Warning TextWarning Text"
|
||||
type="warning"
|
||||
@@ -85,7 +86,7 @@ describe('Alert', () => {
|
||||
);
|
||||
wrapper.find('.ant-alert').simulate('mouseenter');
|
||||
await sleep(0);
|
||||
expect(wrapper.find<Tooltip>(Tooltip).instance().getPopupDomNode()).toBeTruthy();
|
||||
expect(ref.current.getPopupDomNode()).toBeTruthy();
|
||||
jest.useFakeTimers();
|
||||
});
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ import classNames from 'classnames';
|
||||
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||
import getDataOrAriaProps from '../_util/getDataOrAriaProps';
|
||||
import ErrorBoundary from './ErrorBoundary';
|
||||
import { replaceElement } from '../_util/reactNode';
|
||||
|
||||
export interface AlertProps {
|
||||
/**
|
||||
@@ -127,15 +128,11 @@ export default class Alert extends React.Component<AlertProps, AlertState> {
|
||||
const { icon } = this.props;
|
||||
const iconType = this.getIconType();
|
||||
if (icon) {
|
||||
return React.isValidElement<{ className?: string }>(icon) ? (
|
||||
React.cloneElement(icon, {
|
||||
className: classNames(`${prefixCls}-icon`, {
|
||||
[icon.props.className as string]: icon.props.className,
|
||||
}),
|
||||
})
|
||||
) : (
|
||||
<span className={`${prefixCls}-icon`}>{icon}</span>
|
||||
);
|
||||
return replaceElement(icon, <span className={`${prefixCls}-icon`}>{icon}</span>, () => ({
|
||||
className: classNames(`${prefixCls}-icon`, {
|
||||
[(icon as any).props.className]: (icon as any).props.className,
|
||||
}),
|
||||
}));
|
||||
}
|
||||
return React.createElement(iconType, { className: `${prefixCls}-icon` });
|
||||
}
|
||||
|
||||
@@ -256,6 +256,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -341,6 +342,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -534,6 +536,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -675,6 +678,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -817,6 +821,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
|
||||
@@ -12,7 +12,8 @@ import classNames from 'classnames';
|
||||
import omit from 'omit.js';
|
||||
import Select, { InternalSelectProps, OptionType } from '../select';
|
||||
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||
import warning from '../_util/warning';
|
||||
import devWarning from '../_util/devWarning';
|
||||
import { isValidElement } from '../_util/reactNode';
|
||||
|
||||
const { Option } = Select;
|
||||
|
||||
@@ -25,7 +26,10 @@ export interface DataSourceItemObject {
|
||||
export type DataSourceItemType = string | DataSourceItemObject;
|
||||
|
||||
export interface AutoCompleteProps
|
||||
extends Omit<InternalSelectProps<string>, 'inputIcon' | 'loading' | 'mode' | 'optionLabelProp' | 'labelInValue'> {
|
||||
extends Omit<
|
||||
InternalSelectProps<string>,
|
||||
'inputIcon' | 'loading' | 'mode' | 'optionLabelProp' | 'labelInValue'
|
||||
> {
|
||||
dataSource?: DataSourceItemType[];
|
||||
}
|
||||
|
||||
@@ -46,7 +50,7 @@ const AutoComplete: React.RefForwardingComponent<Select, AutoCompleteProps> = (p
|
||||
|
||||
if (
|
||||
childNodes.length === 1 &&
|
||||
React.isValidElement(childNodes[0]) &&
|
||||
isValidElement(childNodes[0]) &&
|
||||
!isSelectOptionOrSelectOptGroup(childNodes[0])
|
||||
) {
|
||||
customizeInput = childNodes[0];
|
||||
@@ -63,7 +67,7 @@ const AutoComplete: React.RefForwardingComponent<Select, AutoCompleteProps> = (p
|
||||
} else {
|
||||
optionChildren = dataSource
|
||||
? dataSource.map(item => {
|
||||
if (React.isValidElement(item)) {
|
||||
if (isValidElement(item)) {
|
||||
return item;
|
||||
}
|
||||
switch (typeof item) {
|
||||
@@ -90,13 +94,13 @@ const AutoComplete: React.RefForwardingComponent<Select, AutoCompleteProps> = (p
|
||||
|
||||
// ============================ Warning ============================
|
||||
React.useEffect(() => {
|
||||
warning(
|
||||
devWarning(
|
||||
!('dataSource' in props),
|
||||
'AutoComplete',
|
||||
'`dataSource` is deprecated, please use `options` instead.',
|
||||
);
|
||||
|
||||
warning(
|
||||
devWarning(
|
||||
!customizeInput || !('size' in props),
|
||||
'AutoComplete',
|
||||
'You need to control style self instead of setting `size` when using customize input.',
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
|
||||
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||
import warning from '../_util/warning';
|
||||
import devWarning from '../_util/devWarning';
|
||||
|
||||
export interface AvatarProps {
|
||||
/** Shape of avatar, options:`circle`, `square` */
|
||||
@@ -109,7 +109,7 @@ export default class Avatar extends React.Component<AvatarProps, AvatarState> {
|
||||
...others
|
||||
} = this.props;
|
||||
|
||||
warning(
|
||||
devWarning(
|
||||
!(typeof icon === 'string' && icon.length > 2),
|
||||
'Avatar',
|
||||
`\`icon\` is using ReactNode instead of string naming in v4. Please check \`${icon}\` at https://ant.design/components/icon`,
|
||||
|
||||
@@ -18,9 +18,6 @@ describe('BackTop', () => {
|
||||
});
|
||||
window.scrollTo(0, 400);
|
||||
expect(document.documentElement.scrollTop).toBe(400);
|
||||
// trigger scroll manually
|
||||
wrapper.instance().handleScroll();
|
||||
await sleep();
|
||||
wrapper.find('.ant-back-top').simulate('click');
|
||||
await sleep(500);
|
||||
expect(document.documentElement.scrollTop).toBe(0);
|
||||
@@ -36,34 +33,16 @@ describe('BackTop', () => {
|
||||
});
|
||||
document.dispatchEvent(new Event('scroll'));
|
||||
window.scrollTo(0, 400);
|
||||
// trigger scroll manually
|
||||
wrapper.instance().handleScroll();
|
||||
await sleep();
|
||||
wrapper.find('.ant-back-top').simulate('click');
|
||||
expect(onClick).toHaveBeenCalled();
|
||||
scrollToSpy.mockRestore();
|
||||
});
|
||||
|
||||
it('should be able to update target', async () => {
|
||||
const wrapper = mount(<BackTop />);
|
||||
wrapper.instance().handleScroll = jest.fn();
|
||||
const container = document.createElement('div');
|
||||
wrapper.setProps({ target: () => container });
|
||||
expect(wrapper.instance().handleScroll).toHaveBeenLastCalledWith({
|
||||
target: container,
|
||||
});
|
||||
container.dispatchEvent(new Event('scroll'));
|
||||
expect(wrapper.instance().handleScroll).toHaveBeenLastCalledWith(
|
||||
expect.objectContaining({
|
||||
currentTarget: container,
|
||||
target: container,
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('invalid target', async () => {
|
||||
const onClick = jest.fn();
|
||||
const wrapper = mount(<BackTop onClick={onClick} target={() => ({ documentElement: {} })} />);
|
||||
const wrapper = mount(
|
||||
<BackTop onClick={onClick} visible target={() => ({ documentElement: {} })} />,
|
||||
);
|
||||
wrapper.find('.ant-back-top').simulate('click');
|
||||
expect(onClick).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
168
components/back-top/index.tsx
Executable file → Normal file
168
components/back-top/index.tsx
Executable file → Normal file
@@ -3,8 +3,8 @@ import Animate from 'rc-animate';
|
||||
import addEventListener from 'rc-util/lib/Dom/addEventListener';
|
||||
import classNames from 'classnames';
|
||||
import omit from 'omit.js';
|
||||
import { throttleByAnimationFrameDecorator } from '../_util/throttleByAnimationFrame';
|
||||
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||
import throttleByAnimationFrame from '../_util/throttleByAnimationFrame';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import getScroll from '../_util/getScroll';
|
||||
import scrollTo from '../_util/scrollTo';
|
||||
|
||||
@@ -18,88 +18,65 @@ export interface BackTopProps {
|
||||
visible?: boolean; // Only for test. Don't use it.
|
||||
}
|
||||
|
||||
export default class BackTop extends React.Component<BackTopProps, any> {
|
||||
static defaultProps = {
|
||||
visibilityHeight: 400,
|
||||
const BackTop: React.FC<BackTopProps> = props => {
|
||||
const [visible, setVisible] = React.useState(false);
|
||||
|
||||
const ref = React.createRef<HTMLDivElement>();
|
||||
const scrollEvent = React.useRef<any>();
|
||||
|
||||
const getDefaultTarget = () => {
|
||||
return ref.current && ref.current.ownerDocument ? ref.current.ownerDocument : window;
|
||||
};
|
||||
|
||||
state = {
|
||||
visible: false,
|
||||
};
|
||||
const handleScroll = throttleByAnimationFrame(
|
||||
(e: React.UIEvent<HTMLElement> | { target: any }) => {
|
||||
const { visibilityHeight } = props;
|
||||
const scrollTop = getScroll(e.target, true);
|
||||
setVisible(scrollTop > visibilityHeight!);
|
||||
},
|
||||
);
|
||||
|
||||
scrollEvent: any;
|
||||
|
||||
node: HTMLDivElement;
|
||||
|
||||
componentDidMount() {
|
||||
this.bindScrollEvent();
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps: BackTopProps) {
|
||||
const { target } = this.props;
|
||||
if (prevProps.target !== target) {
|
||||
this.bindScrollEvent();
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
if (this.scrollEvent) {
|
||||
this.scrollEvent.remove();
|
||||
}
|
||||
(this.handleScroll as any).cancel();
|
||||
}
|
||||
|
||||
bindScrollEvent() {
|
||||
if (this.scrollEvent) {
|
||||
this.scrollEvent.remove();
|
||||
}
|
||||
const { target } = this.props;
|
||||
const getTarget = target || this.getDefaultTarget;
|
||||
const bindScrollEvent = () => {
|
||||
const { target } = props;
|
||||
const getTarget = target || getDefaultTarget;
|
||||
const container = getTarget();
|
||||
this.scrollEvent = addEventListener(container, 'scroll', (e: React.UIEvent<HTMLElement>) => {
|
||||
this.handleScroll(e);
|
||||
scrollEvent.current = addEventListener(container, 'scroll', (e: React.UIEvent<HTMLElement>) => {
|
||||
handleScroll(e);
|
||||
});
|
||||
this.handleScroll({
|
||||
handleScroll({
|
||||
target: container,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
getVisible() {
|
||||
if ('visible' in this.props) {
|
||||
return this.props.visible;
|
||||
React.useEffect(() => {
|
||||
bindScrollEvent();
|
||||
return () => {
|
||||
if (scrollEvent.current) {
|
||||
scrollEvent.current.remove();
|
||||
}
|
||||
(handleScroll as any).cancel();
|
||||
};
|
||||
}, [props.target]);
|
||||
|
||||
const getVisible = () => {
|
||||
if ('visible' in props) {
|
||||
return props.visible;
|
||||
}
|
||||
return this.state.visible;
|
||||
}
|
||||
|
||||
getDefaultTarget = () => {
|
||||
return this.node && this.node.ownerDocument ? this.node.ownerDocument : window;
|
||||
return visible;
|
||||
};
|
||||
|
||||
saveDivRef = (node: HTMLDivElement) => {
|
||||
this.node = node;
|
||||
};
|
||||
|
||||
scrollToTop = (e: React.MouseEvent<HTMLDivElement>) => {
|
||||
const { onClick, target } = this.props;
|
||||
const scrollToTop = (e: React.MouseEvent<HTMLDivElement>) => {
|
||||
const { onClick, target } = props;
|
||||
scrollTo(0, {
|
||||
getContainer: target || this.getDefaultTarget,
|
||||
getContainer: target || getDefaultTarget,
|
||||
});
|
||||
if (typeof onClick === 'function') {
|
||||
onClick(e);
|
||||
}
|
||||
};
|
||||
|
||||
@throttleByAnimationFrameDecorator()
|
||||
handleScroll(e: React.UIEvent<HTMLElement> | { target: any }) {
|
||||
const { visibilityHeight = 0 } = this.props;
|
||||
const scrollTop = getScroll(e.target, true);
|
||||
this.setState({
|
||||
visible: scrollTop > visibilityHeight,
|
||||
});
|
||||
}
|
||||
|
||||
renderChildren({ prefixCls }: { prefixCls: string }) {
|
||||
const { children } = this.props;
|
||||
const renderChildren = ({ prefixCls }: { prefixCls: string }) => {
|
||||
const { children } = props;
|
||||
const defaultElement = (
|
||||
<div className={`${prefixCls}-content`}>
|
||||
<div className={`${prefixCls}-icon`} />
|
||||
@@ -107,36 +84,37 @@ export default class BackTop extends React.Component<BackTopProps, any> {
|
||||
);
|
||||
return (
|
||||
<Animate component="" transitionName="fade">
|
||||
{this.getVisible() ? <div>{children || defaultElement}</div> : null}
|
||||
{getVisible() ? <div>{children || defaultElement}</div> : null}
|
||||
</Animate>
|
||||
);
|
||||
}
|
||||
|
||||
renderBackTop = ({ getPrefixCls, direction }: ConfigConsumerProps) => {
|
||||
const { prefixCls: customizePrefixCls, className = '' } = this.props;
|
||||
const prefixCls = getPrefixCls('back-top', customizePrefixCls);
|
||||
const classString = classNames(prefixCls, className, {
|
||||
[`${prefixCls}-rtl`]: direction === 'rtl',
|
||||
});
|
||||
|
||||
// fix https://fb.me/react-unknown-prop
|
||||
const divProps = omit(this.props, [
|
||||
'prefixCls',
|
||||
'className',
|
||||
'children',
|
||||
'visibilityHeight',
|
||||
'target',
|
||||
'visible',
|
||||
]);
|
||||
|
||||
return (
|
||||
<div {...divProps} className={classString} onClick={this.scrollToTop} ref={this.saveDivRef}>
|
||||
{this.renderChildren({ prefixCls })}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
render() {
|
||||
return <ConfigConsumer>{this.renderBackTop}</ConfigConsumer>;
|
||||
}
|
||||
}
|
||||
const { getPrefixCls, direction } = React.useContext(ConfigContext);
|
||||
const { prefixCls: customizePrefixCls, className = '' } = props;
|
||||
const prefixCls = getPrefixCls('back-top', customizePrefixCls);
|
||||
const classString = classNames(prefixCls, className, {
|
||||
[`${prefixCls}-rtl`]: direction === 'rtl',
|
||||
});
|
||||
|
||||
// fix https://fb.me/react-unknown-prop
|
||||
const divProps = omit(props, [
|
||||
'prefixCls',
|
||||
'className',
|
||||
'children',
|
||||
'visibilityHeight',
|
||||
'target',
|
||||
'visible',
|
||||
]);
|
||||
|
||||
return (
|
||||
<div {...divProps} className={classString} onClick={scrollToTop} ref={ref}>
|
||||
{renderChildren({ prefixCls })}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
BackTop.defaultProps = {
|
||||
visibilityHeight: 400,
|
||||
};
|
||||
|
||||
export default React.memo(BackTop);
|
||||
|
||||
@@ -2,6 +2,7 @@ import * as React from 'react';
|
||||
import omit from 'omit.js';
|
||||
import classNames from 'classnames';
|
||||
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||
import { cloneElement } from '../_util/reactNode';
|
||||
|
||||
function getNumberArray(num: string | number | undefined | null) {
|
||||
return num
|
||||
@@ -175,7 +176,7 @@ const ScrollNumber: React.FC<ScrollNumberProps> = props => {
|
||||
};
|
||||
}
|
||||
if (displayComponent) {
|
||||
return React.cloneElement(displayComponent, {
|
||||
return cloneElement(displayComponent, {
|
||||
className: classNames(
|
||||
`${prefixCls}-custom-component`,
|
||||
displayComponent.props && displayComponent.props.className,
|
||||
|
||||
@@ -38,23 +38,21 @@ describe('Badge', () => {
|
||||
it('should have an overriden title attribute', () => {
|
||||
const badge = mount(<Badge count={10} title="Custom title" />);
|
||||
expect(
|
||||
badge
|
||||
.find('.ant-scroll-number')
|
||||
.getDOMNode()
|
||||
.attributes.getNamedItem('title').value,
|
||||
badge.find('.ant-scroll-number').getDOMNode().attributes.getNamedItem('title').value,
|
||||
).toEqual('Custom title');
|
||||
});
|
||||
|
||||
// https://github.com/ant-design/ant-design/issues/10626
|
||||
it('should be composable with Tooltip', () => {
|
||||
const ref = React.createRef();
|
||||
const wrapper = mount(
|
||||
<Tooltip title="Fix the error">
|
||||
<Tooltip title="Fix the error" ref={ref}>
|
||||
<Badge status="error" />
|
||||
</Tooltip>,
|
||||
);
|
||||
wrapper.find('Badge').simulate('mouseenter');
|
||||
jest.runAllTimers();
|
||||
expect(wrapper.instance().tooltip.props.visible).toBe(true);
|
||||
expect(ref.current.props.visible).toBe(true);
|
||||
});
|
||||
|
||||
it('should render when count is changed', () => {
|
||||
|
||||
@@ -6,6 +6,7 @@ import ScrollNumber from './ScrollNumber';
|
||||
import { PresetColorTypes, PresetColorType, PresetStatusColorType } from '../_util/colors';
|
||||
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||
import { LiteralUnion } from '../_util/type';
|
||||
import { cloneElement } from '../_util/reactNode';
|
||||
|
||||
export { ScrollNumberProps } from './ScrollNumber';
|
||||
|
||||
@@ -110,7 +111,7 @@ const Badge: React.FC<BadgeProps> = props => {
|
||||
if (!customNode || typeof customNode !== 'object') {
|
||||
return undefined;
|
||||
}
|
||||
return React.cloneElement(customNode, {
|
||||
return cloneElement(customNode, {
|
||||
style: {
|
||||
...getStyleWithOffset(),
|
||||
...(customNode.props && customNode.props.style),
|
||||
|
||||
@@ -6,8 +6,9 @@ import BreadcrumbItem from './BreadcrumbItem';
|
||||
import BreadcrumbSeparator from './BreadcrumbSeparator';
|
||||
import Menu from '../menu';
|
||||
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||
import warning from '../_util/warning';
|
||||
import devWarning from '../_util/devWarning';
|
||||
import { Omit } from '../_util/type';
|
||||
import { cloneElement } from '../_util/reactNode';
|
||||
|
||||
export interface Route {
|
||||
path: string;
|
||||
@@ -130,7 +131,7 @@ export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
|
||||
return element;
|
||||
}
|
||||
|
||||
warning(
|
||||
devWarning(
|
||||
element.type &&
|
||||
(element.type.__ANT_BREADCRUMB_ITEM === true ||
|
||||
element.type.__ANT_BREADCRUMB_SEPARATOR === true),
|
||||
@@ -138,9 +139,9 @@ export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
|
||||
"Only accepts Breadcrumb.Item and Breadcrumb.Separator as it's children",
|
||||
);
|
||||
|
||||
return React.cloneElement(element, {
|
||||
return cloneElement(element, {
|
||||
separator,
|
||||
key: index, // eslint-disable-line react/no-array-index-key
|
||||
key: index,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ exports[`Button should render empty button without errors 1`] = `
|
||||
exports[`Button should support link button 1`] = `
|
||||
<a
|
||||
class="ant-btn"
|
||||
href="http://ant.design"
|
||||
href="https://ant.design"
|
||||
target="_blank"
|
||||
>
|
||||
<span>
|
||||
|
||||
@@ -175,7 +175,7 @@ describe('Button', () => {
|
||||
|
||||
it('should support link button', () => {
|
||||
const wrapper = mount(
|
||||
<Button target="_blank" href="http://ant.design">
|
||||
<Button target="_blank" href="https://ant.design">
|
||||
link button
|
||||
</Button>,
|
||||
);
|
||||
|
||||
@@ -7,9 +7,10 @@ import Group from './button-group';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import Wave from '../_util/wave';
|
||||
import { Omit, tuple } from '../_util/type';
|
||||
import warning from '../_util/warning';
|
||||
import devWarning from '../_util/devWarning';
|
||||
import SizeContext, { SizeType } from '../config-provider/SizeContext';
|
||||
import LoadingIcon from './LoadingIcon';
|
||||
import { cloneElement } from '../_util/reactNode';
|
||||
|
||||
const rxTwoCNChar = /^[\u4e00-\u9fa5]{2}$/;
|
||||
const isTwoCNChar = rxTwoCNChar.test.bind(rxTwoCNChar);
|
||||
@@ -31,7 +32,9 @@ function insertSpace(child: React.ReactChild, needInserted: boolean) {
|
||||
isString(child.type) &&
|
||||
isTwoCNChar(child.props.children)
|
||||
) {
|
||||
return React.cloneElement(child, {}, child.props.children.split('').join(SPACE));
|
||||
return cloneElement(child, {
|
||||
children: child.props.children.split('').join(SPACE),
|
||||
});
|
||||
}
|
||||
if (typeof child === 'string') {
|
||||
if (isTwoCNChar(child)) {
|
||||
@@ -186,7 +189,7 @@ const InternalButton: React.ForwardRefRenderFunction<unknown, ButtonProps> = (pr
|
||||
...rest
|
||||
} = props;
|
||||
|
||||
warning(
|
||||
devWarning(
|
||||
!(typeof icon === 'string' && icon.length > 2),
|
||||
'Button',
|
||||
`\`icon\` is using ReactNode instead of string naming in v4. Please check \`${icon}\` at https://ant.design/components/icon`,
|
||||
|
||||
@@ -22,13 +22,6 @@
|
||||
line-height: @line-height-base;
|
||||
.btn;
|
||||
.btn-default;
|
||||
// Make sure that the target of Button's click event always be `button`
|
||||
// Ref: https://github.com/ant-design/ant-design/issues/7034
|
||||
> i,
|
||||
> span {
|
||||
display: inline-block;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
&-primary {
|
||||
.btn-primary;
|
||||
|
||||
@@ -254,7 +254,6 @@
|
||||
.button-size(
|
||||
@btn-height-sm; @btn-padding-horizontal-sm; @btn-font-size-sm; @btn-border-radius-sm
|
||||
);
|
||||
line-height: @btn-height-sm - 2px;
|
||||
}
|
||||
}
|
||||
// primary button style
|
||||
|
||||
@@ -27,6 +27,7 @@ exports[`renders ./components/calendar/demo/basic.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -84,6 +85,7 @@ exports[`renders ./components/calendar/demo/basic.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -968,6 +970,7 @@ exports[`renders ./components/calendar/demo/card.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -1025,6 +1028,7 @@ exports[`renders ./components/calendar/demo/card.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -1971,6 +1975,7 @@ exports[`renders ./components/calendar/demo/customize-header.md correctly 1`] =
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -2033,6 +2038,7 @@ exports[`renders ./components/calendar/demo/customize-header.md correctly 1`] =
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -2874,6 +2880,7 @@ exports[`renders ./components/calendar/demo/notice-calendar.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -2931,6 +2938,7 @@ exports[`renders ./components/calendar/demo/notice-calendar.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -4223,6 +4231,7 @@ exports[`renders ./components/calendar/demo/select.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -4280,6 +4289,7 @@ exports[`renders ./components/calendar/demo/select.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
|
||||
@@ -28,6 +28,7 @@ exports[`Calendar Calendar should support locale 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity: 0;"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -86,6 +87,7 @@ exports[`Calendar Calendar should support locale 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity: 0;"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -967,6 +969,7 @@ exports[`Calendar rtl render component should be rendered correctly in RTL direc
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -1024,6 +1027,7 @@ exports[`Calendar rtl render component should be rendered correctly in RTL direc
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
// https://stackoverflow.com/a/22429853/3040605
|
||||
margin-left: auto;
|
||||
padding: @card-head-padding 0;
|
||||
color: @text-color;
|
||||
color: @card-head-extra-color;
|
||||
font-weight: normal;
|
||||
font-size: @font-size-base;
|
||||
|
||||
|
||||
@@ -53,14 +53,7 @@ describe('Cascader', () => {
|
||||
|
||||
it('popup correctly when panel is hidden', () => {
|
||||
const wrapper = mount(<Cascader options={options} />);
|
||||
expect(
|
||||
render(
|
||||
wrapper
|
||||
.find('Trigger')
|
||||
.instance()
|
||||
.getComponent(),
|
||||
),
|
||||
).toMatchSnapshot();
|
||||
expect(render(wrapper.find('Trigger').instance().getComponent())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('popup correctly when panel is open', () => {
|
||||
@@ -69,14 +62,7 @@ describe('Cascader', () => {
|
||||
<Cascader options={options} onPopupVisibleChange={onPopupVisibleChange} />,
|
||||
);
|
||||
wrapper.find('input').simulate('click');
|
||||
expect(
|
||||
render(
|
||||
wrapper
|
||||
.find('Trigger')
|
||||
.instance()
|
||||
.getComponent(),
|
||||
),
|
||||
).toMatchSnapshot();
|
||||
expect(render(wrapper.find('Trigger').instance().getComponent())).toMatchSnapshot();
|
||||
expect(onPopupVisibleChange).toHaveBeenCalledWith(true);
|
||||
});
|
||||
|
||||
@@ -91,97 +77,44 @@ describe('Cascader', () => {
|
||||
it('popup correctly with defaultValue', () => {
|
||||
const wrapper = mount(<Cascader options={options} defaultValue={['zhejiang', 'hangzhou']} />);
|
||||
wrapper.find('input').simulate('click');
|
||||
expect(
|
||||
render(
|
||||
wrapper
|
||||
.find('Trigger')
|
||||
.instance()
|
||||
.getComponent(),
|
||||
),
|
||||
).toMatchSnapshot();
|
||||
expect(render(wrapper.find('Trigger').instance().getComponent())).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('should support popupVisible', () => {
|
||||
const wrapper = mount(<Cascader options={options} defaultValue={['zhejiang', 'hangzhou']} />);
|
||||
expect(
|
||||
wrapper
|
||||
.find('Trigger')
|
||||
.instance()
|
||||
.getComponent().props.visible,
|
||||
).toBe(false);
|
||||
expect(wrapper.find('Trigger').instance().getComponent().props.visible).toBe(false);
|
||||
wrapper.setProps({ popupVisible: true });
|
||||
expect(
|
||||
wrapper
|
||||
.find('Trigger')
|
||||
.instance()
|
||||
.getComponent().props.visible,
|
||||
).toBe(true);
|
||||
expect(wrapper.find('Trigger').instance().getComponent().props.visible).toBe(true);
|
||||
});
|
||||
|
||||
it('can be selected', () => {
|
||||
const onChange = jest.fn();
|
||||
const wrapper = mount(<Cascader options={options} onChange={onChange} />);
|
||||
wrapper.find('input').simulate('click');
|
||||
let popupWrapper = mount(
|
||||
wrapper
|
||||
.find('Trigger')
|
||||
.instance()
|
||||
.getComponent(),
|
||||
);
|
||||
let popupWrapper = mount(wrapper.find('Trigger').instance().getComponent());
|
||||
popupWrapper
|
||||
.find('.ant-cascader-menu')
|
||||
.at(0)
|
||||
.find('.ant-cascader-menu-item')
|
||||
.at(0)
|
||||
.simulate('click');
|
||||
expect(
|
||||
render(
|
||||
wrapper
|
||||
.find('Trigger')
|
||||
.instance()
|
||||
.getComponent(),
|
||||
),
|
||||
).toMatchSnapshot();
|
||||
popupWrapper = mount(
|
||||
wrapper
|
||||
.find('Trigger')
|
||||
.instance()
|
||||
.getComponent(),
|
||||
);
|
||||
expect(render(wrapper.find('Trigger').instance().getComponent())).toMatchSnapshot();
|
||||
popupWrapper = mount(wrapper.find('Trigger').instance().getComponent());
|
||||
popupWrapper
|
||||
.find('.ant-cascader-menu')
|
||||
.at(1)
|
||||
.find('.ant-cascader-menu-item')
|
||||
.at(0)
|
||||
.simulate('click');
|
||||
expect(
|
||||
render(
|
||||
wrapper
|
||||
.find('Trigger')
|
||||
.instance()
|
||||
.getComponent(),
|
||||
),
|
||||
).toMatchSnapshot();
|
||||
popupWrapper = mount(
|
||||
wrapper
|
||||
.find('Trigger')
|
||||
.instance()
|
||||
.getComponent(),
|
||||
);
|
||||
expect(render(wrapper.find('Trigger').instance().getComponent())).toMatchSnapshot();
|
||||
popupWrapper = mount(wrapper.find('Trigger').instance().getComponent());
|
||||
popupWrapper
|
||||
.find('.ant-cascader-menu')
|
||||
.at(2)
|
||||
.find('.ant-cascader-menu-item')
|
||||
.at(0)
|
||||
.simulate('click');
|
||||
expect(
|
||||
render(
|
||||
wrapper
|
||||
.find('Trigger')
|
||||
.instance()
|
||||
.getComponent(),
|
||||
),
|
||||
).toMatchSnapshot();
|
||||
expect(render(wrapper.find('Trigger').instance().getComponent())).toMatchSnapshot();
|
||||
expect(onChange).toHaveBeenCalledWith(['zhejiang', 'hangzhou', 'xihu'], expect.anything());
|
||||
});
|
||||
|
||||
@@ -199,12 +132,7 @@ describe('Cascader', () => {
|
||||
wrapper.find('input').simulate('click');
|
||||
wrapper.find('input').simulate('change', { target: { value: 'z' } });
|
||||
expect(wrapper.state('inputValue')).toBe('z');
|
||||
const popupWrapper = mount(
|
||||
wrapper
|
||||
.find('Trigger')
|
||||
.instance()
|
||||
.getComponent(),
|
||||
);
|
||||
const popupWrapper = mount(wrapper.find('Trigger').instance().getComponent());
|
||||
expect(popupWrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
@@ -245,12 +173,7 @@ describe('Cascader', () => {
|
||||
wrapper.find('input').simulate('click');
|
||||
wrapper.find('input').simulate('change', { target: { value: 'z' } });
|
||||
expect(wrapper.state('inputValue')).toBe('z');
|
||||
const popupWrapper = mount(
|
||||
wrapper
|
||||
.find('Trigger')
|
||||
.instance()
|
||||
.getComponent(),
|
||||
);
|
||||
const popupWrapper = mount(wrapper.find('Trigger').instance().getComponent());
|
||||
expect(popupWrapper.render()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
@@ -259,22 +182,14 @@ describe('Cascader', () => {
|
||||
wrapper.find('input').simulate('click');
|
||||
wrapper.find('input').simulate('change', { target: { value: '__notfoundkeyword__' } });
|
||||
expect(wrapper.state('inputValue')).toBe('__notfoundkeyword__');
|
||||
const popupWrapper = mount(
|
||||
wrapper
|
||||
.find('Trigger')
|
||||
.instance()
|
||||
.getComponent(),
|
||||
);
|
||||
const popupWrapper = mount(wrapper.find('Trigger').instance().getComponent());
|
||||
expect(popupWrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('should support to clear selection', () => {
|
||||
const wrapper = mount(<Cascader options={options} defaultValue={['zhejiang', 'hangzhou']} />);
|
||||
expect(wrapper.find('.ant-cascader-picker-label').text()).toBe('Zhejiang / Hangzhou');
|
||||
wrapper
|
||||
.find('.ant-cascader-picker-clear')
|
||||
.at(0)
|
||||
.simulate('click');
|
||||
wrapper.find('.ant-cascader-picker-clear').at(0).simulate('click');
|
||||
expect(wrapper.find('.ant-cascader-picker-label').text()).toBe('');
|
||||
});
|
||||
|
||||
@@ -288,10 +203,7 @@ describe('Cascader', () => {
|
||||
onPopupVisibleChange={onPopupVisibleChange}
|
||||
/>,
|
||||
);
|
||||
wrapper
|
||||
.find('.ant-cascader-picker-clear')
|
||||
.at(0)
|
||||
.simulate('click');
|
||||
wrapper.find('.ant-cascader-picker-clear').at(0).simulate('click');
|
||||
expect(onPopupVisibleChange).toHaveBeenCalledWith(false);
|
||||
});
|
||||
|
||||
@@ -302,10 +214,7 @@ describe('Cascader', () => {
|
||||
wrapper.find('input').simulate('click');
|
||||
wrapper.find('input').simulate('change', { target: { value: 'xxx' } });
|
||||
expect(wrapper.state('inputValue')).toBe('xxx');
|
||||
wrapper
|
||||
.find('.ant-cascader-picker-clear')
|
||||
.at(0)
|
||||
.simulate('click');
|
||||
wrapper.find('.ant-cascader-picker-clear').at(0).simulate('click');
|
||||
expect(wrapper.state('inputValue')).toBe('');
|
||||
});
|
||||
|
||||
@@ -393,24 +302,14 @@ describe('Cascader', () => {
|
||||
/>,
|
||||
);
|
||||
wrapper.instance().handleChange(['zhejiang', 'hangzhou', 'xihu'], customerOptions);
|
||||
expect(
|
||||
wrapper
|
||||
.find('.ant-cascader-picker-label')
|
||||
.text()
|
||||
.split('/').length,
|
||||
).toBe(3);
|
||||
expect(wrapper.find('.ant-cascader-picker-label').text().split('/').length).toBe(3);
|
||||
});
|
||||
|
||||
it('should show not found content when options.length is 0', () => {
|
||||
const customerOptions = [];
|
||||
const wrapper = mount(<Cascader options={customerOptions} />);
|
||||
wrapper.find('input').simulate('click');
|
||||
const popupWrapper = mount(
|
||||
wrapper
|
||||
.find('Trigger')
|
||||
.instance()
|
||||
.getComponent(),
|
||||
);
|
||||
const popupWrapper = mount(wrapper.find('Trigger').instance().getComponent());
|
||||
expect(popupWrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
@@ -484,12 +383,7 @@ describe('Cascader', () => {
|
||||
fieldNames={{ label: 'name', value: 'code', children: 'items' }}
|
||||
/>,
|
||||
);
|
||||
const popupWrapper = mount(
|
||||
wrapper
|
||||
.find('Trigger')
|
||||
.instance()
|
||||
.getComponent(),
|
||||
);
|
||||
const popupWrapper = mount(wrapper.find('Trigger').instance().getComponent());
|
||||
expect(popupWrapper.render()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
@@ -510,18 +404,9 @@ describe('Cascader', () => {
|
||||
<Cascader options={options} defaultValue={['zhejiang', 'hangzhou']} />
|
||||
</ConfigProvider>,
|
||||
);
|
||||
wrapper
|
||||
.find('Cascader')
|
||||
.find('input')
|
||||
.simulate('click');
|
||||
wrapper.find('Cascader').find('input').simulate('click');
|
||||
expect(
|
||||
render(
|
||||
wrapper
|
||||
.find('Cascader')
|
||||
.find('Trigger')
|
||||
.instance()
|
||||
.getComponent(),
|
||||
),
|
||||
render(wrapper.find('Cascader').find('Trigger').instance().getComponent()),
|
||||
).toMatchSnapshot();
|
||||
});
|
||||
|
||||
@@ -572,17 +457,8 @@ describe('Cascader', () => {
|
||||
</ConfigProvider>,
|
||||
);
|
||||
|
||||
wrapper
|
||||
.find('Cascader')
|
||||
.find('input')
|
||||
.simulate('click');
|
||||
let popupWrapper = mount(
|
||||
wrapper
|
||||
.find('Cascader')
|
||||
.find('Trigger')
|
||||
.instance()
|
||||
.getComponent(),
|
||||
);
|
||||
wrapper.find('Cascader').find('input').simulate('click');
|
||||
let popupWrapper = mount(wrapper.find('Cascader').find('Trigger').instance().getComponent());
|
||||
popupWrapper
|
||||
.find('.ant-cascader-menu')
|
||||
.at(0)
|
||||
@@ -590,21 +466,9 @@ describe('Cascader', () => {
|
||||
.at(0)
|
||||
.simulate('click');
|
||||
expect(
|
||||
render(
|
||||
wrapper
|
||||
.find('Cascader')
|
||||
.find('Trigger')
|
||||
.instance()
|
||||
.getComponent(),
|
||||
),
|
||||
render(wrapper.find('Cascader').find('Trigger').instance().getComponent()),
|
||||
).toMatchSnapshot();
|
||||
popupWrapper = mount(
|
||||
wrapper
|
||||
.find('Cascader')
|
||||
.find('Trigger')
|
||||
.instance()
|
||||
.getComponent(),
|
||||
);
|
||||
popupWrapper = mount(wrapper.find('Cascader').find('Trigger').instance().getComponent());
|
||||
popupWrapper
|
||||
.find('.ant-cascader-menu')
|
||||
.at(1)
|
||||
@@ -612,21 +476,9 @@ describe('Cascader', () => {
|
||||
.at(0)
|
||||
.simulate('click');
|
||||
expect(
|
||||
render(
|
||||
wrapper
|
||||
.find('Cascader')
|
||||
.find('Trigger')
|
||||
.instance()
|
||||
.getComponent(),
|
||||
),
|
||||
render(wrapper.find('Cascader').find('Trigger').instance().getComponent()),
|
||||
).toMatchSnapshot();
|
||||
popupWrapper = mount(
|
||||
wrapper
|
||||
.find('Cascader')
|
||||
.find('Trigger')
|
||||
.instance()
|
||||
.getComponent(),
|
||||
);
|
||||
popupWrapper = mount(wrapper.find('Cascader').find('Trigger').instance().getComponent());
|
||||
popupWrapper
|
||||
.find('.ant-cascader-menu')
|
||||
.at(2)
|
||||
@@ -635,4 +487,9 @@ describe('Cascader', () => {
|
||||
.simulate('click');
|
||||
expect(onChange).toHaveBeenCalledWith(['zhejiang', 'hangzhou', 'xihu'], expect.anything());
|
||||
});
|
||||
|
||||
it('defaultValue works correctly when no match options', () => {
|
||||
const wrapper = mount(<Cascader options={options} defaultValue={['options1', 'options2']} />);
|
||||
expect(wrapper.find('.ant-cascader-picker-label').text()).toBe('options1 / options2');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -14,8 +14,9 @@ import LeftOutlined from '@ant-design/icons/LeftOutlined';
|
||||
import Input from '../input';
|
||||
import { ConfigConsumer, ConfigConsumerProps, RenderEmptyHandler } from '../config-provider';
|
||||
import LocaleReceiver from '../locale-provider/LocaleReceiver';
|
||||
import warning from '../_util/warning';
|
||||
import devWarning from '../_util/devWarning';
|
||||
import SizeContext, { SizeType } from '../config-provider/SizeContext';
|
||||
import { replaceElement } from '../_util/reactNode';
|
||||
|
||||
export interface CascaderOptionType {
|
||||
value?: string;
|
||||
@@ -211,7 +212,7 @@ const defaultDisplayRender = (label: string[]) => label.join(' / ');
|
||||
function warningValueNotExist(list: CascaderOptionType[], fieldNames: FieldNamesType = {}) {
|
||||
(list || []).forEach(item => {
|
||||
const valueFieldName = fieldNames.value || 'value';
|
||||
warning(valueFieldName in item, 'Cascader', 'Not found `value` in `options`.');
|
||||
devWarning(valueFieldName in item, 'Cascader', 'Not found `value` in `options`.');
|
||||
warningValueNotExist(item[fieldNames.children || 'children'], fieldNames);
|
||||
});
|
||||
}
|
||||
@@ -283,7 +284,7 @@ class Cascader extends React.Component<CascaderProps, CascaderState> {
|
||||
(o: CascaderOptionType, level: number) => o[names.value] === unwrappedValue[level],
|
||||
{ childrenKeyName: names.children },
|
||||
);
|
||||
const label = selectedOptions.map(o => o[names.label]);
|
||||
const label = selectedOptions.length ? selectedOptions.map(o => o[names.label]) : value;
|
||||
return displayRender(label, selectedOptions);
|
||||
}
|
||||
|
||||
@@ -384,7 +385,7 @@ class Cascader extends React.Component<CascaderProps, CascaderState> {
|
||||
return matchCount >= limit;
|
||||
});
|
||||
} else {
|
||||
warning(
|
||||
devWarning(
|
||||
typeof limit !== 'number',
|
||||
'Cascader',
|
||||
"'limit' of showSearch should be positive number or false.",
|
||||
@@ -522,8 +523,10 @@ class Cascader extends React.Component<CascaderProps, CascaderState> {
|
||||
const names: FilledFieldNamesType = getFilledFieldNames(this.props);
|
||||
if (options && options.length > 0) {
|
||||
if (state.inputValue) {
|
||||
const filteredOptions = this.generateFilteredOptions(prefixCls, renderEmpty);
|
||||
options = isEqual(filteredOptions, this.cachedOptions) ? this.cachedOptions : filteredOptions;
|
||||
const filteredOptions = this.generateFilteredOptions(prefixCls, renderEmpty);
|
||||
options = isEqual(filteredOptions, this.cachedOptions)
|
||||
? this.cachedOptions
|
||||
: filteredOptions;
|
||||
}
|
||||
} else {
|
||||
options = [
|
||||
@@ -552,17 +555,21 @@ class Cascader extends React.Component<CascaderProps, CascaderState> {
|
||||
dropdownMenuColumnStyle.width = this.input.input.offsetWidth;
|
||||
}
|
||||
|
||||
const inputIcon = (suffixIcon &&
|
||||
(React.isValidElement<{ className?: string }>(suffixIcon) ? (
|
||||
React.cloneElement(suffixIcon, {
|
||||
let inputIcon: React.ReactNode;
|
||||
if (suffixIcon) {
|
||||
inputIcon = replaceElement(
|
||||
suffixIcon,
|
||||
<span className={`${prefixCls}-picker-arrow`}>{suffixIcon}</span>,
|
||||
() => ({
|
||||
className: classNames({
|
||||
[suffixIcon.props.className!]: suffixIcon.props.className,
|
||||
[(suffixIcon as any).props.className!]: (suffixIcon as any).props.className,
|
||||
[`${prefixCls}-picker-arrow`]: true,
|
||||
}),
|
||||
})
|
||||
) : (
|
||||
<span className={`${prefixCls}-picker-arrow`}>{suffixIcon}</span>
|
||||
))) || <DownOutlined className={arrowCls} />;
|
||||
}),
|
||||
);
|
||||
} else {
|
||||
inputIcon = <DownOutlined className={arrowCls} />;
|
||||
}
|
||||
|
||||
const input = children || (
|
||||
<span style={style} className={pickerCls}>
|
||||
|
||||
@@ -3,7 +3,7 @@ import classNames from 'classnames';
|
||||
import RcCheckbox from 'rc-checkbox';
|
||||
import CheckboxGroup, { GroupContext } from './Group';
|
||||
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||
import warning from '../_util/warning';
|
||||
import devWarning from '../_util/devWarning';
|
||||
|
||||
export interface AbstractCheckboxProps<T> {
|
||||
prefixCls?: string;
|
||||
@@ -60,7 +60,7 @@ class Checkbox extends React.PureComponent<CheckboxProps, {}> {
|
||||
const { value } = this.props;
|
||||
this.context?.registerValue(value);
|
||||
|
||||
warning(
|
||||
devWarning(
|
||||
'checked' in this.props || this.context || !('value' in this.props),
|
||||
'Checkbox',
|
||||
'`value` is not a valid prop, do you mean `checked`?',
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import Checkbox from '..';
|
||||
import focusTest from '../../../tests/shared/focusTest';
|
||||
import { resetWarned } from '../../_util/warning';
|
||||
import { resetWarned } from '../../_util/devWarning';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import RightOutlined from '@ant-design/icons/RightOutlined';
|
||||
import CollapsePanel from './CollapsePanel';
|
||||
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||
import animation from '../_util/openAnimation';
|
||||
import { cloneElement } from '../_util/reactNode';
|
||||
|
||||
export type ExpandIconPosition = 'left' | 'right' | undefined;
|
||||
|
||||
@@ -58,11 +59,9 @@ export default class Collapse extends React.Component<CollapseProps, any> {
|
||||
<RightOutlined rotate={panelProps.isActive ? 90 : undefined} />
|
||||
)) as React.ReactNode;
|
||||
|
||||
return React.isValidElement(icon)
|
||||
? React.cloneElement(icon as any, {
|
||||
className: classNames(icon.props.className, `${prefixCls}-arrow`),
|
||||
})
|
||||
: icon;
|
||||
return cloneElement(icon, () => ({
|
||||
className: classNames((icon as any).props.className, `${prefixCls}-arrow`),
|
||||
}));
|
||||
};
|
||||
|
||||
renderCollapse = ({ getPrefixCls, direction }: ConfigConsumerProps) => {
|
||||
|
||||
@@ -677,6 +677,7 @@ exports[`renders ./components/collapse/demo/extra.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
|
||||
@@ -1788,6 +1788,7 @@ exports[`ConfigProvider components Calendar configProvider 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -1845,6 +1846,7 @@ exports[`ConfigProvider components Calendar configProvider 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -2723,6 +2725,7 @@ exports[`ConfigProvider components Calendar configProvider 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -3067,6 +3070,7 @@ exports[`ConfigProvider components Calendar configProvider componentSize large 1
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -3124,6 +3128,7 @@ exports[`ConfigProvider components Calendar configProvider componentSize large 1
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -4002,6 +4007,7 @@ exports[`ConfigProvider components Calendar configProvider componentSize large 1
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -4346,6 +4352,7 @@ exports[`ConfigProvider components Calendar configProvider componentSize middle
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -4403,6 +4410,7 @@ exports[`ConfigProvider components Calendar configProvider componentSize middle
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -5281,6 +5289,7 @@ exports[`ConfigProvider components Calendar configProvider componentSize middle
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -5625,6 +5634,7 @@ exports[`ConfigProvider components Calendar normal 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -5682,6 +5692,7 @@ exports[`ConfigProvider components Calendar normal 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -6560,6 +6571,7 @@ exports[`ConfigProvider components Calendar normal 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -6904,6 +6916,7 @@ exports[`ConfigProvider components Calendar prefixCls 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -6961,6 +6974,7 @@ exports[`ConfigProvider components Calendar prefixCls 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -7839,6 +7853,7 @@ exports[`ConfigProvider components Calendar prefixCls 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -9654,6 +9669,7 @@ exports[`ConfigProvider components DatePicker DatePicker configProvider 1`] = `
|
||||
class="config-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -9698,6 +9714,7 @@ exports[`ConfigProvider components DatePicker DatePicker configProvider componen
|
||||
class="config-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -9742,6 +9759,7 @@ exports[`ConfigProvider components DatePicker DatePicker configProvider componen
|
||||
class="config-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -9786,6 +9804,7 @@ exports[`ConfigProvider components DatePicker DatePicker normal 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -9830,6 +9849,7 @@ exports[`ConfigProvider components DatePicker DatePicker prefixCls 1`] = `
|
||||
class="prefix-DatePicker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -9874,6 +9894,7 @@ exports[`ConfigProvider components DatePicker MonthPicker configProvider 1`] = `
|
||||
class="config-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select month"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -9918,6 +9939,7 @@ exports[`ConfigProvider components DatePicker MonthPicker configProvider compone
|
||||
class="config-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select month"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -9962,6 +9984,7 @@ exports[`ConfigProvider components DatePicker MonthPicker configProvider compone
|
||||
class="config-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select month"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -10006,6 +10029,7 @@ exports[`ConfigProvider components DatePicker MonthPicker normal 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select month"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -10050,6 +10074,7 @@ exports[`ConfigProvider components DatePicker MonthPicker prefixCls 1`] = `
|
||||
class="prefix-MonthPicker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select month"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -10094,6 +10119,7 @@ exports[`ConfigProvider components DatePicker RangePicker configProvider 1`] = `
|
||||
class="config-picker-input config-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -10133,6 +10159,7 @@ exports[`ConfigProvider components DatePicker RangePicker configProvider 1`] = `
|
||||
class="config-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -10180,6 +10207,7 @@ exports[`ConfigProvider components DatePicker RangePicker configProvider compone
|
||||
class="config-picker-input config-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -10219,6 +10247,7 @@ exports[`ConfigProvider components DatePicker RangePicker configProvider compone
|
||||
class="config-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -10266,6 +10295,7 @@ exports[`ConfigProvider components DatePicker RangePicker configProvider compone
|
||||
class="config-picker-input config-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -10305,6 +10335,7 @@ exports[`ConfigProvider components DatePicker RangePicker configProvider compone
|
||||
class="config-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -10352,6 +10383,7 @@ exports[`ConfigProvider components DatePicker RangePicker normal 1`] = `
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -10391,6 +10423,7 @@ exports[`ConfigProvider components DatePicker RangePicker normal 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -10438,6 +10471,7 @@ exports[`ConfigProvider components DatePicker RangePicker prefixCls 1`] = `
|
||||
class="prefix-RangePicker-input prefix-RangePicker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -10477,6 +10511,7 @@ exports[`ConfigProvider components DatePicker RangePicker prefixCls 1`] = `
|
||||
class="prefix-RangePicker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -10524,6 +10559,7 @@ exports[`ConfigProvider components DatePicker WeekPicker configProvider 1`] = `
|
||||
class="config-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select week"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -10568,6 +10604,7 @@ exports[`ConfigProvider components DatePicker WeekPicker configProvider componen
|
||||
class="config-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select week"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -10612,6 +10649,7 @@ exports[`ConfigProvider components DatePicker WeekPicker configProvider componen
|
||||
class="config-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select week"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -10656,6 +10694,7 @@ exports[`ConfigProvider components DatePicker WeekPicker normal 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select week"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -10700,6 +10739,7 @@ exports[`ConfigProvider components DatePicker WeekPicker prefixCls 1`] = `
|
||||
class="prefix-WeekPicker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select week"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -14060,6 +14100,7 @@ exports[`ConfigProvider components Pagination configProvider 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -14206,6 +14247,7 @@ exports[`ConfigProvider components Pagination configProvider 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -14357,6 +14399,7 @@ exports[`ConfigProvider components Pagination configProvider componentSize large
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -14503,6 +14546,7 @@ exports[`ConfigProvider components Pagination configProvider componentSize large
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -14654,6 +14698,7 @@ exports[`ConfigProvider components Pagination configProvider componentSize middl
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -14800,6 +14845,7 @@ exports[`ConfigProvider components Pagination configProvider componentSize middl
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -14951,6 +14997,7 @@ exports[`ConfigProvider components Pagination normal 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -15097,6 +15144,7 @@ exports[`ConfigProvider components Pagination normal 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -15248,6 +15296,7 @@ exports[`ConfigProvider components Pagination prefixCls 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -15394,6 +15443,7 @@ exports[`ConfigProvider components Pagination prefixCls 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -17952,6 +18002,7 @@ exports[`ConfigProvider components Select configProvider 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -18071,6 +18122,7 @@ exports[`ConfigProvider components Select configProvider componentSize large 1`]
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -18190,6 +18242,7 @@ exports[`ConfigProvider components Select configProvider componentSize middle 1`
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -18309,6 +18362,7 @@ exports[`ConfigProvider components Select normal 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -18428,6 +18482,7 @@ exports[`ConfigProvider components Select prefixCls 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -21429,6 +21484,7 @@ Array [
|
||||
class="config-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select time"
|
||||
readonly=""
|
||||
size="10"
|
||||
@@ -22840,6 +22896,7 @@ Array [
|
||||
class="config-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select time"
|
||||
readonly=""
|
||||
size="10"
|
||||
@@ -24251,6 +24308,7 @@ Array [
|
||||
class="config-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select time"
|
||||
readonly=""
|
||||
size="10"
|
||||
@@ -25662,6 +25720,7 @@ Array [
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select time"
|
||||
readonly=""
|
||||
size="10"
|
||||
@@ -27073,6 +27132,7 @@ Array [
|
||||
class="prefix-TimePicker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select time"
|
||||
readonly=""
|
||||
size="10"
|
||||
@@ -30497,6 +30557,7 @@ exports[`ConfigProvider components TreeSelect configProvider 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -30609,6 +30670,7 @@ exports[`ConfigProvider components TreeSelect configProvider componentSize large
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -30721,6 +30783,7 @@ exports[`ConfigProvider components TreeSelect configProvider componentSize middl
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -30833,6 +30896,7 @@ exports[`ConfigProvider components TreeSelect normal 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -30945,6 +31009,7 @@ exports[`ConfigProvider components TreeSelect prefixCls 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
|
||||
@@ -9,6 +9,7 @@ Array [
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -586,7 +587,8 @@ Array [
|
||||
class="ant-picker-footer"
|
||||
>
|
||||
<a
|
||||
class="ant-picker-today-btn"
|
||||
aria-disabled="true"
|
||||
class="ant-picker-today-btn ant-picker-today-btn-disabled"
|
||||
>
|
||||
Today
|
||||
</a>
|
||||
@@ -607,6 +609,7 @@ Array [
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Избери дата"
|
||||
readonly=""
|
||||
size="12"
|
||||
|
||||
@@ -8,6 +8,7 @@ exports[`RangePicker customize separator 1`] = `
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -23,6 +24,7 @@ exports[`RangePicker customize separator 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -69,6 +71,7 @@ Array [
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -108,6 +111,7 @@ Array [
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="12"
|
||||
|
||||
@@ -9,6 +9,7 @@ exports[`WeekPicker should support style prop 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select week"
|
||||
readonly=""
|
||||
size="12"
|
||||
|
||||
@@ -9,6 +9,7 @@ exports[`renders ./components/date-picker/demo/basic.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -49,6 +50,7 @@ exports[`renders ./components/date-picker/demo/basic.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select week"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -89,6 +91,7 @@ exports[`renders ./components/date-picker/demo/basic.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select month"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -129,6 +132,7 @@ exports[`renders ./components/date-picker/demo/basic.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select quarter"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -169,6 +173,7 @@ exports[`renders ./components/date-picker/demo/basic.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select year"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -213,6 +218,7 @@ exports[`renders ./components/date-picker/demo/bordered.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -253,6 +259,7 @@ exports[`renders ./components/date-picker/demo/bordered.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select week"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -293,6 +300,7 @@ exports[`renders ./components/date-picker/demo/bordered.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select month"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -333,6 +341,7 @@ exports[`renders ./components/date-picker/demo/bordered.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select year"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -373,6 +382,7 @@ exports[`renders ./components/date-picker/demo/bordered.md correctly 1`] = `
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -412,6 +422,7 @@ exports[`renders ./components/date-picker/demo/bordered.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -455,6 +466,7 @@ exports[`renders ./components/date-picker/demo/bordered.md correctly 1`] = `
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start week"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -494,6 +506,7 @@ exports[`renders ./components/date-picker/demo/bordered.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End week"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -537,6 +550,7 @@ exports[`renders ./components/date-picker/demo/bordered.md correctly 1`] = `
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start month"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -576,6 +590,7 @@ exports[`renders ./components/date-picker/demo/bordered.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End month"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -619,6 +634,7 @@ exports[`renders ./components/date-picker/demo/bordered.md correctly 1`] = `
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start year"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -658,6 +674,7 @@ exports[`renders ./components/date-picker/demo/bordered.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End year"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -705,6 +722,7 @@ exports[`renders ./components/date-picker/demo/date-render.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -744,6 +762,7 @@ exports[`renders ./components/date-picker/demo/date-render.md correctly 1`] = `
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -783,6 +802,7 @@ exports[`renders ./components/date-picker/demo/date-render.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -830,6 +850,7 @@ exports[`renders ./components/date-picker/demo/disabled.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
disabled=""
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
@@ -871,6 +892,7 @@ exports[`renders ./components/date-picker/demo/disabled.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
disabled=""
|
||||
placeholder="Select month"
|
||||
readonly=""
|
||||
@@ -912,6 +934,7 @@ exports[`renders ./components/date-picker/demo/disabled.md correctly 1`] = `
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
disabled=""
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
@@ -952,6 +975,7 @@ exports[`renders ./components/date-picker/demo/disabled.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
disabled=""
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
@@ -996,6 +1020,7 @@ exports[`renders ./components/date-picker/demo/disabled.md correctly 1`] = `
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -1035,6 +1060,7 @@ exports[`renders ./components/date-picker/demo/disabled.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
disabled=""
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
@@ -1107,6 +1133,7 @@ exports[`renders ./components/date-picker/demo/disabled-date.md correctly 1`] =
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="21"
|
||||
@@ -1147,6 +1174,7 @@ exports[`renders ./components/date-picker/demo/disabled-date.md correctly 1`] =
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select month"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -1187,6 +1215,7 @@ exports[`renders ./components/date-picker/demo/disabled-date.md correctly 1`] =
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -1226,6 +1255,7 @@ exports[`renders ./components/date-picker/demo/disabled-date.md correctly 1`] =
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -1268,6 +1298,7 @@ exports[`renders ./components/date-picker/demo/disabled-date.md correctly 1`] =
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="21"
|
||||
@@ -1307,6 +1338,7 @@ exports[`renders ./components/date-picker/demo/disabled-date.md correctly 1`] =
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="21"
|
||||
@@ -1354,6 +1386,7 @@ exports[`renders ./components/date-picker/demo/extra-footer.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -1394,6 +1427,7 @@ exports[`renders ./components/date-picker/demo/extra-footer.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="21"
|
||||
@@ -1434,6 +1468,7 @@ exports[`renders ./components/date-picker/demo/extra-footer.md correctly 1`] = `
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -1473,6 +1508,7 @@ exports[`renders ./components/date-picker/demo/extra-footer.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -1516,6 +1552,7 @@ exports[`renders ./components/date-picker/demo/extra-footer.md correctly 1`] = `
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="21"
|
||||
@@ -1555,6 +1592,7 @@ exports[`renders ./components/date-picker/demo/extra-footer.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="21"
|
||||
@@ -1598,6 +1636,7 @@ exports[`renders ./components/date-picker/demo/extra-footer.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select month"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -1642,6 +1681,7 @@ exports[`renders ./components/date-picker/demo/format.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -1706,6 +1746,7 @@ exports[`renders ./components/date-picker/demo/format.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -1770,6 +1811,7 @@ exports[`renders ./components/date-picker/demo/format.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select month"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -1834,6 +1876,7 @@ exports[`renders ./components/date-picker/demo/format.md correctly 1`] = `
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -1873,6 +1916,7 @@ exports[`renders ./components/date-picker/demo/format.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -1944,6 +1988,7 @@ exports[`renders ./components/date-picker/demo/mode.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="21"
|
||||
@@ -1984,6 +2029,7 @@ exports[`renders ./components/date-picker/demo/mode.md correctly 1`] = `
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start month"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -2023,6 +2069,7 @@ exports[`renders ./components/date-picker/demo/mode.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End month"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -2070,6 +2117,7 @@ exports[`renders ./components/date-picker/demo/presetted-ranges.md correctly 1`]
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -2109,6 +2157,7 @@ exports[`renders ./components/date-picker/demo/presetted-ranges.md correctly 1`]
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -2152,6 +2201,7 @@ exports[`renders ./components/date-picker/demo/presetted-ranges.md correctly 1`]
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="21"
|
||||
@@ -2191,6 +2241,7 @@ exports[`renders ./components/date-picker/demo/presetted-ranges.md correctly 1`]
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="21"
|
||||
@@ -2238,6 +2289,7 @@ exports[`renders ./components/date-picker/demo/range-picker.md correctly 1`] = `
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -2277,6 +2329,7 @@ exports[`renders ./components/date-picker/demo/range-picker.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -2320,6 +2373,7 @@ exports[`renders ./components/date-picker/demo/range-picker.md correctly 1`] = `
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="21"
|
||||
@@ -2359,6 +2413,7 @@ exports[`renders ./components/date-picker/demo/range-picker.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="21"
|
||||
@@ -2402,6 +2457,7 @@ exports[`renders ./components/date-picker/demo/range-picker.md correctly 1`] = `
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start week"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -2441,6 +2497,7 @@ exports[`renders ./components/date-picker/demo/range-picker.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End week"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -2484,6 +2541,7 @@ exports[`renders ./components/date-picker/demo/range-picker.md correctly 1`] = `
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start month"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -2523,6 +2581,7 @@ exports[`renders ./components/date-picker/demo/range-picker.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End month"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -2566,6 +2625,7 @@ exports[`renders ./components/date-picker/demo/range-picker.md correctly 1`] = `
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start year"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -2605,6 +2665,7 @@ exports[`renders ./components/date-picker/demo/range-picker.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End year"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -2651,6 +2712,7 @@ exports[`renders ./components/date-picker/demo/select-in-range.md correctly 1`]
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -2690,6 +2752,7 @@ exports[`renders ./components/date-picker/demo/select-in-range.md correctly 1`]
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -2800,6 +2863,7 @@ exports[`renders ./components/date-picker/demo/size.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -2840,6 +2904,7 @@ exports[`renders ./components/date-picker/demo/size.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select month"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -2880,6 +2945,7 @@ exports[`renders ./components/date-picker/demo/size.md correctly 1`] = `
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -2919,6 +2985,7 @@ exports[`renders ./components/date-picker/demo/size.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -2962,6 +3029,7 @@ exports[`renders ./components/date-picker/demo/size.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select week"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -3006,6 +3074,7 @@ exports[`renders ./components/date-picker/demo/start-end.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start"
|
||||
readonly=""
|
||||
size="21"
|
||||
@@ -3045,6 +3114,7 @@ exports[`renders ./components/date-picker/demo/start-end.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End"
|
||||
readonly=""
|
||||
size="21"
|
||||
@@ -3089,6 +3159,7 @@ exports[`renders ./components/date-picker/demo/suffix.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -3129,6 +3200,7 @@ exports[`renders ./components/date-picker/demo/suffix.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select month"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -3169,6 +3241,7 @@ exports[`renders ./components/date-picker/demo/suffix.md correctly 1`] = `
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -3208,6 +3281,7 @@ exports[`renders ./components/date-picker/demo/suffix.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -3251,6 +3325,7 @@ exports[`renders ./components/date-picker/demo/suffix.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select week"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -3291,6 +3366,7 @@ exports[`renders ./components/date-picker/demo/suffix.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -3312,6 +3388,7 @@ exports[`renders ./components/date-picker/demo/suffix.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select month"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -3333,6 +3410,7 @@ exports[`renders ./components/date-picker/demo/suffix.md correctly 1`] = `
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -3372,6 +3450,7 @@ exports[`renders ./components/date-picker/demo/suffix.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -3396,6 +3475,7 @@ exports[`renders ./components/date-picker/demo/suffix.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select week"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -3421,6 +3501,7 @@ exports[`renders ./components/date-picker/demo/time.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="21"
|
||||
@@ -3461,6 +3542,7 @@ exports[`renders ./components/date-picker/demo/time.md correctly 1`] = `
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="18"
|
||||
@@ -3500,6 +3582,7 @@ exports[`renders ./components/date-picker/demo/time.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="18"
|
||||
|
||||
@@ -8,6 +8,7 @@ exports[`mount rtl render component should be rendered correctly in RTL directio
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -50,6 +51,7 @@ exports[`mount rtl render component should be rendered correctly in RTL directio
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select month"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -92,6 +94,7 @@ exports[`mount rtl render component should be rendered correctly in RTL directio
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select week"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -134,6 +137,7 @@ exports[`mount rtl render component should be rendered correctly in RTL directio
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -173,6 +177,7 @@ exports[`mount rtl render component should be rendered correctly in RTL directio
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="12"
|
||||
|
||||
@@ -788,6 +788,7 @@ exports[`Picker format by locale date 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="请选择日期"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -854,6 +855,7 @@ exports[`Picker format by locale dateTime 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="请选择日期"
|
||||
readonly=""
|
||||
size="21"
|
||||
@@ -920,6 +922,7 @@ exports[`Picker format by locale month 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="请选择月份"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -986,6 +989,7 @@ exports[`Picker format by locale week 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="请选择周"
|
||||
readonly=""
|
||||
size="12"
|
||||
|
||||
@@ -23,7 +23,7 @@ There are five kinds of picker:
|
||||
|
||||
### Localization
|
||||
|
||||
The default locale is en-US, if you need to use other languages, recommend to use internationalized components provided by us at the entrance. Look at: [ConfigProvider](http://ant.design/components/config-provider/).
|
||||
The default locale is en-US, if you need to use other languages, recommend to use internationalized components provided by us at the entrance. Look at: [ConfigProvider](https://ant.design/components/config-provider/).
|
||||
|
||||
If there are special needs (only modifying single component language), Please use the property: local. Example: [default](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json).
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ subtitle: 日期选择框
|
||||
|
||||
### 国际化配置
|
||||
|
||||
默认配置为 en-US,如果你需要设置其他语言,推荐在入口处使用我们提供的国际化组件,详见:[ConfigProvider 国际化](http://ant.design/components/config-provider-cn/)。
|
||||
默认配置为 en-US,如果你需要设置其他语言,推荐在入口处使用我们提供的国际化组件,详见:[ConfigProvider 国际化](https://ant.design/components/config-provider-cn/)。
|
||||
|
||||
如有特殊需求(仅修改单一组件的语言),请使用 locale 参数,参考:[默认配置](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json)。
|
||||
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
.@{calendar-prefix-cls}-decade-panel {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: @zindex-picker-panel;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: @calendar-bg;
|
||||
border-radius: @border-radius-base;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.@{calendar-prefix-cls}-decade-panel-hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.@{calendar-prefix-cls}-decade-panel-header {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.@{calendar-prefix-cls}-decade-panel-body {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.@{calendar-prefix-cls}-decade-panel-footer {
|
||||
border-top: @border-width-base @border-style-base @border-color-split;
|
||||
.@{calendar-prefix-cls}-footer-extra {
|
||||
padding: 0 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.@{calendar-prefix-cls}-decade-panel-table {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
table-layout: fixed;
|
||||
border-collapse: separate;
|
||||
}
|
||||
|
||||
.@{calendar-prefix-cls}-decade-panel-cell {
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.@{calendar-prefix-cls}-decade-panel-decade {
|
||||
display: inline-block;
|
||||
height: 24px;
|
||||
margin: 0 auto;
|
||||
padding: 0 6px;
|
||||
color: @text-color;
|
||||
line-height: 24px;
|
||||
text-align: center;
|
||||
background: transparent;
|
||||
border-radius: @border-radius-base;
|
||||
transition: background 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
background: @item-hover-bg;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.@{calendar-prefix-cls}-decade-panel-selected-cell .@{calendar-prefix-cls}-decade-panel-decade {
|
||||
color: @text-color-inverse;
|
||||
background: @primary-color;
|
||||
|
||||
&:hover {
|
||||
color: @text-color-inverse;
|
||||
background: @primary-color;
|
||||
}
|
||||
}
|
||||
|
||||
.@{calendar-prefix-cls}-decade-panel-last-century-cell,
|
||||
.@{calendar-prefix-cls}-decade-panel-next-century-cell {
|
||||
.@{calendar-prefix-cls}-decade-panel-decade {
|
||||
color: @disabled-color;
|
||||
user-select: none;
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,8 @@
|
||||
@picker-panel-width: @picker-panel-cell-width * 7 + @padding-sm * 2 + 4;
|
||||
|
||||
&-panel {
|
||||
display: inline-block;
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
background: @calendar-bg;
|
||||
border: @border-width-base @border-style-base @picker-border-color;
|
||||
@@ -400,6 +401,8 @@
|
||||
|
||||
// ======================== Footer ========================
|
||||
&-footer {
|
||||
width: min-content;
|
||||
min-width: 100%;
|
||||
line-height: @picker-text-height - 2 * @border-width-base;
|
||||
text-align: center;
|
||||
border-bottom: @border-width-base @border-style-base transparent;
|
||||
@@ -433,6 +436,11 @@
|
||||
&:active {
|
||||
color: @link-active-color;
|
||||
}
|
||||
|
||||
&&-disabled {
|
||||
color: @disabled-color;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
|
||||
// ========================================================
|
||||
|
||||
@@ -3,7 +3,7 @@ import MockDate from 'mockdate';
|
||||
import { mount } from 'enzyme';
|
||||
import Descriptions from '..';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import { resetWarned } from '../../_util/warning';
|
||||
import { resetWarned } from '../../_util/devWarning';
|
||||
|
||||
describe('Descriptions', () => {
|
||||
mountTest(Descriptions);
|
||||
|
||||
@@ -7,10 +7,11 @@ import ResponsiveObserve, {
|
||||
ScreenMap,
|
||||
responsiveArray,
|
||||
} from '../_util/responsiveObserve';
|
||||
import warning from '../_util/warning';
|
||||
import devWarning from '../_util/devWarning';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import Row from './Row';
|
||||
import DescriptionsItem from './Item';
|
||||
import { cloneElement } from '../_util/reactNode';
|
||||
|
||||
const DEFAULT_COLUMN_MAP: Record<Breakpoint, number> = {
|
||||
xxl: 3,
|
||||
@@ -46,10 +47,10 @@ function getFilledItem(
|
||||
let clone = node;
|
||||
|
||||
if (span === undefined || span > rowRestCol) {
|
||||
clone = React.cloneElement(node, {
|
||||
clone = cloneElement(node, {
|
||||
span: rowRestCol,
|
||||
});
|
||||
warning(
|
||||
devWarning(
|
||||
span === undefined,
|
||||
'Descriptions',
|
||||
'Sum of column `span` in a line not match `column` of Descriptions.',
|
||||
|
||||
@@ -136,12 +136,27 @@ class Drawer extends React.Component<DrawerProps & ConfigConsumerProps, IDrawerS
|
||||
}
|
||||
};
|
||||
|
||||
getOffsetStyle() {
|
||||
const { placement, width, height } = this.props;
|
||||
const offsetStyle: any = {};
|
||||
if (placement === 'left' || placement === 'right') {
|
||||
offsetStyle.width = width;
|
||||
} else {
|
||||
offsetStyle.height = height;
|
||||
}
|
||||
return offsetStyle;
|
||||
}
|
||||
|
||||
getRcDrawerStyle = () => {
|
||||
const { zIndex, placement, style } = this.props;
|
||||
const { zIndex, placement, mask, style } = this.props;
|
||||
const { push } = this.state;
|
||||
// 当无 mask 时,将 width 应用到外层容器上
|
||||
// 解决 https://github.com/ant-design/ant-design/issues/12401 的问题
|
||||
const offsetStyle = mask ? {} : this.getOffsetStyle();
|
||||
return {
|
||||
zIndex,
|
||||
transform: push ? this.getPushTransform(placement) : undefined,
|
||||
...offsetStyle,
|
||||
...style,
|
||||
};
|
||||
};
|
||||
@@ -234,18 +249,14 @@ class Drawer extends React.Component<DrawerProps & ConfigConsumerProps, IDrawerS
|
||||
|
||||
// render Provider for Multi-level drawer
|
||||
renderProvider = (value: Drawer) => {
|
||||
const { prefixCls, placement, className, width, height, mask, direction, ...rest } = this.props;
|
||||
const haveMask = mask ? '' : 'no-mask';
|
||||
const { prefixCls, placement, className, mask, direction, visible, ...rest } = this.props;
|
||||
this.parentDrawer = value;
|
||||
const offsetStyle: any = {};
|
||||
if (placement === 'left' || placement === 'right') {
|
||||
offsetStyle.width = width;
|
||||
} else {
|
||||
offsetStyle.height = height;
|
||||
}
|
||||
const drawerClassName = classNames(className, haveMask, {
|
||||
const drawerClassName = classNames(className, {
|
||||
'no-mask': !mask,
|
||||
[`${prefixCls}-rtl`]: direction === 'rtl',
|
||||
});
|
||||
const offsetStyle = mask ? this.getOffsetStyle() : {};
|
||||
|
||||
return (
|
||||
<DrawerContext.Provider value={this}>
|
||||
<RcDrawer
|
||||
@@ -271,10 +282,12 @@ class Drawer extends React.Component<DrawerProps & ConfigConsumerProps, IDrawerS
|
||||
'csp',
|
||||
'pageHeader',
|
||||
'autoInsertSpaceInButton',
|
||||
'width',
|
||||
'height',
|
||||
])}
|
||||
{...offsetStyle}
|
||||
prefixCls={prefixCls}
|
||||
open={this.props.visible}
|
||||
open={visible}
|
||||
showMask={mask}
|
||||
placement={placement}
|
||||
style={this.getRcDrawerStyle()}
|
||||
|
||||
@@ -19,7 +19,10 @@
|
||||
|
||||
&-content-wrapper {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.@{drawer-prefix-cls}-content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
@@ -37,13 +40,6 @@
|
||||
width: 100%;
|
||||
transition: transform @animation-duration-slow @ease-base-out;
|
||||
}
|
||||
&.@{drawer-prefix-cls}-open.no-mask {
|
||||
height: 0%;
|
||||
|
||||
.@{drawer-prefix-cls}-content-wrapper {
|
||||
height: 100vh;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-left {
|
||||
@@ -95,13 +91,6 @@
|
||||
height: 100%;
|
||||
transition: transform @animation-duration-slow @ease-base-out;
|
||||
}
|
||||
&.@{drawer-prefix-cls}-open.no-mask {
|
||||
width: 0%;
|
||||
|
||||
.@{drawer-prefix-cls}-content-wrapper {
|
||||
width: 100vw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-top {
|
||||
|
||||
@@ -46,7 +46,7 @@ ReactDOM.render(
|
||||
<Dropdown.Button onClick={handleButtonClick} overlay={menu}>
|
||||
Dropdown
|
||||
</Dropdown.Button>
|
||||
<Dropdown.Button overlay={menu} icon={<UserOutlined />}>
|
||||
<Dropdown.Button overlay={menu} placement="bottomCenter" icon={<UserOutlined />}>
|
||||
Dropdown
|
||||
</Dropdown.Button>
|
||||
<Dropdown.Button onClick={handleButtonClick} overlay={menu} disabled>
|
||||
|
||||
@@ -28,7 +28,6 @@ export default class DropdownButton extends React.Component<DropdownButtonProps,
|
||||
static __ANT_BUTTON = true;
|
||||
|
||||
static defaultProps = {
|
||||
placement: 'bottomRight' as DropDownProps['placement'],
|
||||
type: 'default' as DropdownButtonType,
|
||||
buttonsRender: (buttons: React.ReactNode[]) => buttons,
|
||||
};
|
||||
@@ -36,6 +35,7 @@ export default class DropdownButton extends React.Component<DropdownButtonProps,
|
||||
renderButton = ({
|
||||
getPopupContainer: getContextPopupContainer,
|
||||
getPrefixCls,
|
||||
direction,
|
||||
}: ConfigConsumerProps) => {
|
||||
const {
|
||||
prefixCls: customizePrefixCls,
|
||||
@@ -66,7 +66,6 @@ export default class DropdownButton extends React.Component<DropdownButtonProps,
|
||||
disabled,
|
||||
trigger: disabled ? [] : trigger,
|
||||
onVisibleChange,
|
||||
placement,
|
||||
getPopupContainer: getPopupContainer || getContextPopupContainer,
|
||||
} as DropDownProps;
|
||||
|
||||
@@ -74,6 +73,12 @@ export default class DropdownButton extends React.Component<DropdownButtonProps,
|
||||
dropdownProps.visible = visible;
|
||||
}
|
||||
|
||||
if ('placement' in this.props) {
|
||||
dropdownProps.placement = placement;
|
||||
} else {
|
||||
dropdownProps.placement = direction === 'rtl' ? 'bottomLeft' : 'bottomRight';
|
||||
}
|
||||
|
||||
const leftButton = (
|
||||
<Button
|
||||
type={type}
|
||||
|
||||
@@ -5,8 +5,9 @@ import RightOutlined from '@ant-design/icons/RightOutlined';
|
||||
|
||||
import DropdownButton from './dropdown-button';
|
||||
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||
import warning from '../_util/warning';
|
||||
import devWarning from '../_util/devWarning';
|
||||
import { tuple } from '../_util/type';
|
||||
import { cloneElement } from '../_util/reactNode';
|
||||
|
||||
const Placements = tuple(
|
||||
'topLeft',
|
||||
@@ -88,7 +89,7 @@ export default class Dropdown extends React.Component<DropDownProps, any> {
|
||||
const overlayProps = overlayNode.props;
|
||||
|
||||
// Warning if use other mode
|
||||
warning(
|
||||
devWarning(
|
||||
!overlayProps.mode || overlayProps.mode === 'vertical',
|
||||
'Dropdown',
|
||||
`mode="${overlayProps.mode}" is not supported for Dropdown's Menu.`,
|
||||
@@ -107,7 +108,7 @@ export default class Dropdown extends React.Component<DropDownProps, any> {
|
||||
const fixedModeOverlay =
|
||||
typeof overlayNode.type === 'string'
|
||||
? overlay
|
||||
: React.cloneElement(overlayNode, {
|
||||
: cloneElement(overlayNode, {
|
||||
mode: 'vertical',
|
||||
selectable,
|
||||
focusable,
|
||||
@@ -142,7 +143,7 @@ export default class Dropdown extends React.Component<DropDownProps, any> {
|
||||
const prefixCls = getPrefixCls('dropdown', customizePrefixCls);
|
||||
const child = React.Children.only(children) as React.ReactElement<any>;
|
||||
|
||||
const dropdownTrigger = React.cloneElement(child, {
|
||||
const dropdownTrigger = cloneElement(child, {
|
||||
className: classNames(child.props.className, `${prefixCls}-trigger`, {
|
||||
[`${prefixCls}-rtl`]: direction === 'rtl',
|
||||
}),
|
||||
|
||||
@@ -120,6 +120,7 @@ exports[`renders ./components/empty/demo/config-provider.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -179,6 +180,7 @@ exports[`renders ./components/empty/demo/config-provider.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
|
||||
@@ -8,11 +8,12 @@ import omit from 'omit.js';
|
||||
import Row from '../grid/row';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import { tuple } from '../_util/type';
|
||||
import warning from '../_util/warning';
|
||||
import devWarning from '../_util/devWarning';
|
||||
import FormItemLabel, { FormItemLabelProps } from './FormItemLabel';
|
||||
import FormItemInput, { FormItemInputProps } from './FormItemInput';
|
||||
import { FormContext, FormItemContext } from './context';
|
||||
import { toArray, getFieldId, useFrameState } from './util';
|
||||
import { cloneElement, isValidElement } from '../_util/reactNode';
|
||||
|
||||
const ValidateStatuses = tuple('success', 'warning', 'error', 'validating', '');
|
||||
export type ValidateStatus = typeof ValidateStatuses[number];
|
||||
@@ -51,7 +52,7 @@ export interface FormItemProps extends FormItemLabelProps, FormItemInputProps, R
|
||||
|
||||
function hasValidName(name?: NamePath): Boolean {
|
||||
if (name === null) {
|
||||
warning(false, 'Form.Item', '`null` is passed as `name` property');
|
||||
devWarning(false, 'Form.Item', '`null` is passed as `name` property');
|
||||
}
|
||||
return !(name === undefined || name === null);
|
||||
}
|
||||
@@ -285,27 +286,27 @@ function FormItem(props: FormItemProps): React.ReactElement {
|
||||
|
||||
let childNode: React.ReactNode = null;
|
||||
if (Array.isArray(children) && hasName) {
|
||||
warning(false, 'Form.Item', '`children` is array of render props cannot have `name`.');
|
||||
devWarning(false, 'Form.Item', '`children` is array of render props cannot have `name`.');
|
||||
childNode = children;
|
||||
} else if (isRenderProps && (!shouldUpdate || hasName)) {
|
||||
warning(
|
||||
devWarning(
|
||||
!!shouldUpdate,
|
||||
'Form.Item',
|
||||
'`children` of render props only work with `shouldUpdate`.',
|
||||
);
|
||||
warning(
|
||||
devWarning(
|
||||
!hasName,
|
||||
'Form.Item',
|
||||
"Do not use `name` with `children` of render props since it's not a field.",
|
||||
);
|
||||
} else if (dependencies && !isRenderProps && !hasName) {
|
||||
warning(
|
||||
devWarning(
|
||||
false,
|
||||
'Form.Item',
|
||||
'Must set `name` or use render props when `dependencies` is set.',
|
||||
);
|
||||
} else if (React.isValidElement(children)) {
|
||||
warning(
|
||||
} else if (isValidElement(children)) {
|
||||
devWarning(
|
||||
children.props.defaultValue === undefined,
|
||||
'Form.Item',
|
||||
'`defaultValue` will not work on controlled Field. You should use `initialValues` of Form instead.',
|
||||
@@ -328,13 +329,13 @@ function FormItem(props: FormItemProps): React.ReactElement {
|
||||
value={mergedControl[props.valuePropName || 'value']}
|
||||
update={updateRef.current}
|
||||
>
|
||||
{React.cloneElement(children, childProps)}
|
||||
{cloneElement(children, childProps)}
|
||||
</MemoInput>
|
||||
);
|
||||
} else if (isRenderProps && shouldUpdate && !hasName) {
|
||||
childNode = (children as RenderChildren)(context);
|
||||
} else {
|
||||
warning(
|
||||
devWarning(
|
||||
!mergedName.length,
|
||||
'Form.Item',
|
||||
'`name` is only used for validate React element. If you are using Form.Item as layout display, please remove `name` instead.',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as React from 'react';
|
||||
import { List } from 'rc-field-form';
|
||||
import { StoreValue } from 'rc-field-form/lib/interface';
|
||||
import warning from '../_util/warning';
|
||||
import devWarning from '../_util/devWarning';
|
||||
|
||||
interface FieldData {
|
||||
name: number;
|
||||
@@ -21,12 +21,15 @@ interface FormListProps {
|
||||
}
|
||||
|
||||
const FormList: React.FC<FormListProps> = ({ children, ...props }) => {
|
||||
warning(!!props.name, 'Form.List', 'Miss `name` prop.');
|
||||
devWarning(!!props.name, 'Form.List', 'Miss `name` prop.');
|
||||
|
||||
return (
|
||||
<List {...props}>
|
||||
{(fields, operation) => {
|
||||
return children(fields.map(field => ({ ...field, fieldKey: field.key })), operation);
|
||||
return children(
|
||||
fields.map(field => ({ ...field, fieldKey: field.key })),
|
||||
operation,
|
||||
);
|
||||
}}
|
||||
</List>
|
||||
);
|
||||
|
||||
@@ -554,6 +554,7 @@ exports[`renders ./components/form/demo/control-hooks.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -720,6 +721,7 @@ exports[`renders ./components/form/demo/control-ref.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -860,6 +862,7 @@ exports[`renders ./components/form/demo/customized-form-controls.md correctly 1`
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -2480,6 +2483,7 @@ exports[`renders ./components/form/demo/register.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -2882,6 +2886,7 @@ exports[`renders ./components/form/demo/size.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -2963,6 +2968,7 @@ exports[`renders ./components/form/demo/size.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -3094,6 +3100,7 @@ exports[`renders ./components/form/demo/size.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -3340,6 +3347,7 @@ exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] =
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
id="time_related_controls_date-picker"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
@@ -3407,6 +3415,7 @@ exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] =
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
id="time_related_controls_date-time-picker"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
@@ -3474,6 +3483,7 @@ exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] =
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
id="time_related_controls_month-picker"
|
||||
placeholder="Select month"
|
||||
readonly=""
|
||||
@@ -3541,6 +3551,7 @@ exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] =
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
id="time_related_controls_range-picker"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
@@ -3581,6 +3592,7 @@ exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] =
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -3650,6 +3662,7 @@ exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] =
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
id="time_related_controls_range-time-picker"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
@@ -3690,6 +3703,7 @@ exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] =
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="21"
|
||||
@@ -3759,6 +3773,7 @@ exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] =
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
id="time_related_controls_time-picker"
|
||||
placeholder="Select time"
|
||||
readonly=""
|
||||
@@ -3906,6 +3921,7 @@ exports[`renders ./components/form/demo/validate-other.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -3992,6 +4008,7 @@ exports[`renders ./components/form/demo/validate-other.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
<span
|
||||
@@ -5542,6 +5559,7 @@ exports[`renders ./components/form/demo/validate-static.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -5632,6 +5650,7 @@ exports[`renders ./components/form/demo/validate-static.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select time"
|
||||
readonly=""
|
||||
size="10"
|
||||
@@ -5737,6 +5756,7 @@ exports[`renders ./components/form/demo/validate-static.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -5937,6 +5957,7 @@ exports[`renders ./components/form/demo/validate-static.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -6005,6 +6026,7 @@ exports[`renders ./components/form/demo/validate-static.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="12"
|
||||
|
||||
@@ -85,7 +85,7 @@ describe('Form', () => {
|
||||
|
||||
await change(wrapper, 1, '');
|
||||
wrapper.update();
|
||||
await sleep(100);
|
||||
await sleep(300);
|
||||
expect(wrapper.find('.ant-form-item-explain').length).toBe(1);
|
||||
|
||||
await operate('.remove');
|
||||
|
||||
@@ -9,15 +9,15 @@ title:
|
||||
|
||||
自定义或第三方的表单控件,也可以与 Form 组件一起使用。只要该组件遵循以下的约定:
|
||||
|
||||
> - 提供受控属性 `value` 或其它与 [`valuePropName`](http://ant.design/components/form/#getFieldDecorator-参数) 的值同名的属性。
|
||||
> - 提供 `onChange` 事件或 [`trigger`](http://ant.design/components/form/#getFieldDecorator-参数) 的值同名的事件。
|
||||
> - 提供受控属性 `value` 或其它与 [`valuePropName`](https://ant.design/components/form/#getFieldDecorator-参数) 的值同名的属性。
|
||||
> - 提供 `onChange` 事件或 [`trigger`](https://ant.design/components/form/#getFieldDecorator-参数) 的值同名的事件。
|
||||
|
||||
## en-US
|
||||
|
||||
Customized or third-party form controls can be used in Form, too. Controls must follow these conventions:
|
||||
|
||||
> - It has a controlled property `value` or other name which is equal to the value of [`valuePropName`](http://ant.design/components/form/?locale=en-US#getFieldDecorator's-parameters).
|
||||
> - It has event `onChange` or an event which name is equal to the value of [`trigger`](http://ant.design/components/form/?locale=en-US#getFieldDecorator's-parameters).
|
||||
> - It has a controlled property `value` or other name which is equal to the value of [`valuePropName`](https://ant.design/components/form/?locale=en-US#getFieldDecorator's-parameters).
|
||||
> - It has event `onChange` or an event which name is equal to the value of [`trigger`](https://ant.design/components/form/?locale=en-US#getFieldDecorator's-parameters).
|
||||
|
||||
```tsx
|
||||
import React, { useState } from 'react';
|
||||
|
||||
@@ -3,7 +3,7 @@ import InternalForm, { useForm, FormInstance, FormProps } from './Form';
|
||||
import Item, { FormItemProps } from './FormItem';
|
||||
import List from './FormList';
|
||||
import { FormProvider } from './context';
|
||||
import warning from '../_util/warning';
|
||||
import devWarning from '../_util/devWarning';
|
||||
|
||||
type InternalForm = typeof InternalForm;
|
||||
interface Form extends InternalForm {
|
||||
@@ -23,7 +23,7 @@ Form.List = List;
|
||||
Form.useForm = useForm;
|
||||
Form.Provider = FormProvider;
|
||||
Form.create = () => {
|
||||
warning(
|
||||
devWarning(
|
||||
false,
|
||||
'Form',
|
||||
'antd v4 removed `Form.create`. Please remove or use `@ant-design/compatible` instead.',
|
||||
|
||||
@@ -248,7 +248,7 @@ validateFields()
|
||||
|
||||
#### Rule
|
||||
|
||||
Rule 支持接收 object 进行配置,也支持 function 来动态获取 from 的数据:
|
||||
Rule 支持接收 object 进行配置,也支持 function 来动态获取 form 的数据:
|
||||
|
||||
```tsx
|
||||
type Rule = RuleConfig | ((form: FormInstance) => RuleConfig);
|
||||
|
||||
@@ -144,6 +144,8 @@ You can import SVG icon as a react component by using `webpack` and [`@svgr/webp
|
||||
```jsx
|
||||
import Icon from '@ant-design/icons';
|
||||
import MessageSvg from 'path/to/message.svg'; // path to your '*.svg' file.
|
||||
// in create-react-app:
|
||||
// import { ReactComponent as MessageSvg } from 'path/to/message.svg';
|
||||
|
||||
ReactDOM.render(<Icon component={MessageSvg} />, mountNode);
|
||||
```
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import warning from '../_util/warning';
|
||||
import devWarning from '../_util/devWarning';
|
||||
|
||||
const Icon = () => {
|
||||
warning(false, 'Icon', 'Empty Icon');
|
||||
devWarning(false, 'Icon', 'Empty Icon');
|
||||
return null;
|
||||
};
|
||||
|
||||
|
||||
@@ -139,6 +139,8 @@ ReactDOM.render(<MyIcon type="icon-example" />, mountedNode);
|
||||
```jsx
|
||||
import Icon from '@ant-design/icons';
|
||||
import MessageSvg from 'path/to/message.svg'; // path to your '*.svg' file.
|
||||
// in create-react-app:
|
||||
// import { ReactComponent as MessageSvg } from 'path/to/message.svg';
|
||||
|
||||
ReactDOM.render(<Icon component={MessageSvg} />, mountNode);
|
||||
```
|
||||
|
||||
@@ -4,6 +4,7 @@ import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled';
|
||||
import { tuple } from '../_util/type';
|
||||
import { InputProps, getInputClassName } from './Input';
|
||||
import { SizeType } from '../config-provider/SizeContext';
|
||||
import { cloneElement } from '../_util/reactNode';
|
||||
|
||||
const ClearableInputType = tuple('text', 'input');
|
||||
|
||||
@@ -103,7 +104,7 @@ class ClearableLabeledInput extends React.Component<ClearableInputProps> {
|
||||
} = this.props;
|
||||
const suffixNode = this.renderSuffix(prefixCls);
|
||||
if (!hasPrefixSuffix(this.props)) {
|
||||
return React.cloneElement(element, {
|
||||
return cloneElement(element, {
|
||||
value,
|
||||
});
|
||||
}
|
||||
@@ -126,7 +127,7 @@ class ClearableLabeledInput extends React.Component<ClearableInputProps> {
|
||||
onMouseUp={this.onInputMouseUp}
|
||||
>
|
||||
{prefixNode}
|
||||
{React.cloneElement(element, {
|
||||
{cloneElement(element, {
|
||||
style: null,
|
||||
value,
|
||||
className: getInputClassName(prefixCls, size, disabled),
|
||||
@@ -167,7 +168,7 @@ class ClearableLabeledInput extends React.Component<ClearableInputProps> {
|
||||
<span className={mergedGroupClassName} style={style}>
|
||||
<span className={mergedWrapperClassName}>
|
||||
{addonBeforeNode}
|
||||
{React.cloneElement(labeledElement, { style: null })}
|
||||
{cloneElement(labeledElement, { style: null })}
|
||||
{addonAfterNode}
|
||||
</span>
|
||||
</span>
|
||||
@@ -177,7 +178,7 @@ class ClearableLabeledInput extends React.Component<ClearableInputProps> {
|
||||
renderTextAreaWithClearIcon(prefixCls: string, element: React.ReactElement<any>) {
|
||||
const { value, allowClear, className, style, direction } = this.props;
|
||||
if (!allowClear) {
|
||||
return React.cloneElement(element, {
|
||||
return cloneElement(element, {
|
||||
value,
|
||||
});
|
||||
}
|
||||
@@ -189,7 +190,7 @@ class ClearableLabeledInput extends React.Component<ClearableInputProps> {
|
||||
);
|
||||
return (
|
||||
<span className={affixWrapperCls} style={style}>
|
||||
{React.cloneElement(element, {
|
||||
{cloneElement(element, {
|
||||
style: null,
|
||||
value,
|
||||
})}
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Omit, LiteralUnion } from '../_util/type';
|
||||
import ClearableLabeledInput, { hasPrefixSuffix } from './ClearableLabeledInput';
|
||||
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||
import SizeContext, { SizeType } from '../config-provider/SizeContext';
|
||||
import warning from '../_util/warning';
|
||||
import devWarning from '../_util/devWarning';
|
||||
|
||||
export interface InputProps
|
||||
extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix' | 'type'> {
|
||||
@@ -153,7 +153,7 @@ class Input extends React.Component<InputProps, InputState> {
|
||||
|
||||
getSnapshotBeforeUpdate(prevProps: InputProps) {
|
||||
if (hasPrefixSuffix(prevProps) !== hasPrefixSuffix(this.props)) {
|
||||
warning(
|
||||
devWarning(
|
||||
this.input !== document.activeElement,
|
||||
'Input',
|
||||
`When Input is focused, dynamic add or remove prefix / suffix will make it lose focus caused by dom structure change. Read more: https://ant.design/components/input/#FAQ`,
|
||||
|
||||
@@ -6,6 +6,7 @@ import Input, { InputProps } from './Input';
|
||||
import Button from '../button';
|
||||
import SizeContext, { SizeType } from '../config-provider/SizeContext';
|
||||
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||
import { replaceElement, cloneElement } from '../_util/reactNode';
|
||||
|
||||
export interface SearchProps extends InputProps {
|
||||
inputPrefixCls?: string;
|
||||
@@ -97,11 +98,9 @@ export default class Search extends React.Component<SearchProps, any> {
|
||||
|
||||
if (suffix) {
|
||||
return [
|
||||
React.isValidElement(suffix)
|
||||
? React.cloneElement(suffix, {
|
||||
key: 'suffix',
|
||||
})
|
||||
: null,
|
||||
replaceElement(suffix, null, {
|
||||
key: 'suffix',
|
||||
}),
|
||||
icon,
|
||||
];
|
||||
}
|
||||
@@ -125,7 +124,7 @@ export default class Search extends React.Component<SearchProps, any> {
|
||||
enterButtonAsElement.type &&
|
||||
(enterButtonAsElement.type as typeof Button).__ANT_BUTTON === true;
|
||||
if (isAntdButton || enterButtonAsElement.type === 'button') {
|
||||
button = React.cloneElement(enterButtonAsElement, {
|
||||
button = cloneElement(enterButtonAsElement, {
|
||||
onMouseDown: this.onMouseDown,
|
||||
onClick: this.onSearch,
|
||||
key: 'enterButton',
|
||||
@@ -155,11 +154,9 @@ export default class Search extends React.Component<SearchProps, any> {
|
||||
if (addonAfter) {
|
||||
return [
|
||||
button,
|
||||
React.isValidElement(addonAfter)
|
||||
? React.cloneElement(addonAfter, {
|
||||
key: 'addonAfter',
|
||||
})
|
||||
: null,
|
||||
replaceElement(addonAfter, null, {
|
||||
key: 'addonAfter',
|
||||
}),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@ Array [
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -127,6 +128,7 @@ Array [
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -433,6 +435,7 @@ Array [
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -473,6 +476,7 @@ Array [
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select time"
|
||||
readonly=""
|
||||
size="10"
|
||||
@@ -529,6 +533,7 @@ Array [
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -587,6 +592,7 @@ Array [
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -688,6 +694,7 @@ Array [
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -727,6 +734,7 @@ Array [
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -769,6 +777,7 @@ Array [
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select month"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -1122,6 +1131,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -1236,6 +1246,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -1373,6 +1384,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -1424,6 +1436,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = `
|
||||
class="ant-picker-input ant-picker-input-active"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="Start date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -1463,6 +1476,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = `
|
||||
class="ant-picker-input"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
placeholder="End date"
|
||||
readonly=""
|
||||
size="12"
|
||||
@@ -1523,6 +1537,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -1580,6 +1595,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -1642,6 +1658,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -1727,6 +1744,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -1819,6 +1837,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
|
||||
@@ -7,7 +7,7 @@ describe('List Item Layout', () => {
|
||||
const data = [
|
||||
{
|
||||
key: 1,
|
||||
href: 'http://ant.design',
|
||||
href: 'https://ant.design',
|
||||
title: `ant design`,
|
||||
avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
|
||||
description:
|
||||
@@ -29,12 +29,7 @@ describe('List Item Layout', () => {
|
||||
)}
|
||||
/>,
|
||||
);
|
||||
expect(
|
||||
wrapper
|
||||
.find('.ant-list-item')
|
||||
.at(0)
|
||||
.hasClass('ant-list-item-no-flex'),
|
||||
).toBe(true);
|
||||
expect(wrapper.find('.ant-list-item').at(0).hasClass('ant-list-item-no-flex')).toBe(true);
|
||||
});
|
||||
|
||||
it('horizontal itemLayout List should be flex container defaultly', () => {
|
||||
@@ -51,12 +46,7 @@ describe('List Item Layout', () => {
|
||||
)}
|
||||
/>,
|
||||
);
|
||||
expect(
|
||||
wrapper
|
||||
.find('.ant-list-item')
|
||||
.at(0)
|
||||
.hasClass('ant-list-item-no-flex'),
|
||||
).toBe(false);
|
||||
expect(wrapper.find('.ant-list-item').at(0).hasClass('ant-list-item-no-flex')).toBe(false);
|
||||
});
|
||||
|
||||
it('vertical itemLayout List should be flex container when there is extra node', () => {
|
||||
@@ -74,12 +64,7 @@ describe('List Item Layout', () => {
|
||||
)}
|
||||
/>,
|
||||
);
|
||||
expect(
|
||||
wrapper
|
||||
.find('.ant-list-item')
|
||||
.at(0)
|
||||
.hasClass('ant-list-item-no-flex'),
|
||||
).toBe(false);
|
||||
expect(wrapper.find('.ant-list-item').at(0).hasClass('ant-list-item-no-flex')).toBe(false);
|
||||
});
|
||||
|
||||
it('vertical itemLayout List should not be flex container when there is not extra node', () => {
|
||||
@@ -97,12 +82,7 @@ describe('List Item Layout', () => {
|
||||
)}
|
||||
/>,
|
||||
);
|
||||
expect(
|
||||
wrapper
|
||||
.find('.ant-list-item')
|
||||
.at(0)
|
||||
.hasClass('ant-list-item-no-flex'),
|
||||
).toBe(true);
|
||||
expect(wrapper.find('.ant-list-item').at(0).hasClass('ant-list-item-no-flex')).toBe(true);
|
||||
});
|
||||
|
||||
it('horizontal itemLayout List should accept extra node', () => {
|
||||
|
||||
@@ -26,7 +26,7 @@ exports[`List Item Layout horizontal itemLayout List should accept extra node 1`
|
||||
class="ant-list-item-meta-title"
|
||||
>
|
||||
<a
|
||||
href="http://ant.design"
|
||||
href="https://ant.design"
|
||||
>
|
||||
ant design
|
||||
</a>
|
||||
@@ -83,7 +83,7 @@ exports[`List Item Layout should render in RTL direction 1`] = `
|
||||
class="ant-list-item-meta-title"
|
||||
>
|
||||
<a
|
||||
href="http://ant.design"
|
||||
href="https://ant.design"
|
||||
>
|
||||
ant design
|
||||
</a>
|
||||
|
||||
@@ -917,7 +917,7 @@ exports[`renders ./components/list/demo/vertical.md correctly 1`] = `
|
||||
class="ant-list-item-meta-title"
|
||||
>
|
||||
<a
|
||||
href="http://ant.design"
|
||||
href="https://ant.design"
|
||||
>
|
||||
ant design part 0
|
||||
</a>
|
||||
@@ -1086,7 +1086,7 @@ exports[`renders ./components/list/demo/vertical.md correctly 1`] = `
|
||||
class="ant-list-item-meta-title"
|
||||
>
|
||||
<a
|
||||
href="http://ant.design"
|
||||
href="https://ant.design"
|
||||
>
|
||||
ant design part 1
|
||||
</a>
|
||||
@@ -1255,7 +1255,7 @@ exports[`renders ./components/list/demo/vertical.md correctly 1`] = `
|
||||
class="ant-list-item-meta-title"
|
||||
>
|
||||
<a
|
||||
href="http://ant.design"
|
||||
href="https://ant.design"
|
||||
>
|
||||
ant design part 2
|
||||
</a>
|
||||
|
||||
@@ -218,6 +218,7 @@ exports[`List.pagination should change page size work 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity: 0;"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -360,6 +361,7 @@ exports[`List.pagination should change page size work 2`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity: 0;"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -630,6 +632,7 @@ exports[`List.pagination should default work 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity: 0;"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
|
||||
@@ -20,7 +20,7 @@ import { MessageOutlined, LikeOutlined, StarOutlined } from '@ant-design/icons';
|
||||
const listData = [];
|
||||
for (let i = 0; i < 23; i++) {
|
||||
listData.push({
|
||||
href: 'http://ant.design',
|
||||
href: 'https://ant.design',
|
||||
title: `ant design part ${i}`,
|
||||
avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
|
||||
description:
|
||||
|
||||
@@ -8,6 +8,7 @@ import { RenderEmptyHandler, ConfigContext } from '../config-provider';
|
||||
import Pagination, { PaginationConfig } from '../pagination';
|
||||
import { Row } from '../grid';
|
||||
import Item from './Item';
|
||||
import { cloneElement } from '../_util/reactNode';
|
||||
|
||||
export { ListItemProps, ListItemMetaProps } from './Item';
|
||||
|
||||
@@ -247,7 +248,7 @@ function List<T>({ pagination, ...props }: ListProps<T>) {
|
||||
if (splitDataSource.length > 0) {
|
||||
const items = splitDataSource.map((item: any, index: number) => renderItem(item, index));
|
||||
const childrenList = React.Children.map(items, (child: any, index) =>
|
||||
React.cloneElement(child, {
|
||||
cloneElement(child, {
|
||||
key: keys[index],
|
||||
colStyle,
|
||||
}),
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -220,7 +220,7 @@ describe('Locale Provider', () => {
|
||||
'.ant-btn:not(.ant-btn-primary) span',
|
||||
)[0].innerHTML;
|
||||
let okButtonText = currentConfirmNode.querySelectorAll('.ant-btn-primary span')[0].innerHTML;
|
||||
if (locale.locale === 'zh-cn') {
|
||||
if (locale.locale.indexOf('zh-') === 0) {
|
||||
cancelButtonText = cancelButtonText.replace(' ', '');
|
||||
okButtonText = okButtonText.replace(' ', '');
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import { ValidateMessages } from 'rc-field-form/lib/interface';
|
||||
import warning from '../_util/warning';
|
||||
import devWarning from '../_util/devWarning';
|
||||
|
||||
import { ModalLocale, changeConfirmLocale } from '../modal/locale';
|
||||
import { TransferLocale as TransferLocaleForEmpty } from '../empty';
|
||||
@@ -51,7 +51,7 @@ export default class LocaleProvider extends React.Component<LocaleProviderProps,
|
||||
super(props);
|
||||
changeConfirmLocale(props.locale && props.locale.Modal);
|
||||
|
||||
warning(
|
||||
devWarning(
|
||||
props._ANT_MARK__ === ANT_MARK,
|
||||
'LocaleProvider',
|
||||
'`LocaleProvider` is deprecated. Please use `locale` with `ConfigProvider` instead: http://u.ant.design/locale',
|
||||
|
||||
@@ -1,30 +1,43 @@
|
||||
/* eslint-disable no-template-curly-in-string */
|
||||
import Pagination from 'rc-pagination/lib/locale/zh_TW';
|
||||
import DatePicker from '../date-picker/locale/zh_TW';
|
||||
import TimePicker from '../time-picker/locale/zh_TW';
|
||||
import Calendar from '../calendar/locale/zh_TW';
|
||||
import { Locale } from '../locale-provider';
|
||||
|
||||
const typeTemplate = '${label}不是一個有效的${type}';
|
||||
|
||||
const localeValues: Locale = {
|
||||
locale: 'zh-tw',
|
||||
Pagination,
|
||||
DatePicker,
|
||||
TimePicker,
|
||||
Calendar,
|
||||
global: {
|
||||
placeholder: '請選擇',
|
||||
},
|
||||
Table: {
|
||||
filterTitle: '篩選器',
|
||||
filterConfirm: '確 定',
|
||||
filterReset: '重 置',
|
||||
filterConfirm: '確定',
|
||||
filterReset: '重置',
|
||||
selectAll: '全部選取',
|
||||
selectInvert: '反向選取',
|
||||
selectionAll: '全選所有',
|
||||
sortTitle: '排序',
|
||||
expand: '展開行',
|
||||
collapse: '關閉行',
|
||||
triggerDesc: '點擊降序',
|
||||
triggerAsc: '點擊升序',
|
||||
cancelSort: '取消排序',
|
||||
},
|
||||
Modal: {
|
||||
okText: '確 定',
|
||||
cancelText: '取 消',
|
||||
justOkText: 'OK',
|
||||
okText: '確定',
|
||||
cancelText: '取消',
|
||||
justOkText: '知道了',
|
||||
},
|
||||
Popconfirm: {
|
||||
okText: '確 定',
|
||||
cancelText: '取 消',
|
||||
okText: '確定',
|
||||
cancelText: '取消',
|
||||
},
|
||||
Transfer: {
|
||||
searchPlaceholder: '搜尋資料',
|
||||
@@ -41,9 +54,67 @@ const localeValues: Locale = {
|
||||
Empty: {
|
||||
description: '無此資料',
|
||||
},
|
||||
Icon: {
|
||||
icon: '圖標',
|
||||
},
|
||||
Text: {
|
||||
edit: '編輯',
|
||||
copy: '複製',
|
||||
copied: '複製成功',
|
||||
expand: '展開',
|
||||
},
|
||||
PageHeader: {
|
||||
back: '返回',
|
||||
},
|
||||
Form: {
|
||||
defaultValidateMessages: {
|
||||
default: '字段驗證錯誤${label}',
|
||||
required: '請輸入${label}',
|
||||
enum: '${label}必須是其中一個[${enum}]',
|
||||
whitespace: '${label}不能為空字符',
|
||||
date: {
|
||||
format: '${label}日期格式無效',
|
||||
parse: '${label}不能轉換為日期',
|
||||
invalid: '${label}是一個無效日期',
|
||||
},
|
||||
types: {
|
||||
string: typeTemplate,
|
||||
method: typeTemplate,
|
||||
array: typeTemplate,
|
||||
object: typeTemplate,
|
||||
number: typeTemplate,
|
||||
date: typeTemplate,
|
||||
boolean: typeTemplate,
|
||||
integer: typeTemplate,
|
||||
float: typeTemplate,
|
||||
regexp: typeTemplate,
|
||||
email: typeTemplate,
|
||||
url: typeTemplate,
|
||||
hex: typeTemplate,
|
||||
},
|
||||
string: {
|
||||
len: '${label}須為${len}個字符',
|
||||
min: '${label}最少${min}個字符',
|
||||
max: '${label}最多${max}個字符',
|
||||
range: '${label}須在${min}-${max}字符之間',
|
||||
},
|
||||
number: {
|
||||
len: '${label}必須等於${len}',
|
||||
min: '${label}最小值為${min}',
|
||||
max: '${label}最大值為${max}',
|
||||
range: '${label}須在${min}-${max}之間',
|
||||
},
|
||||
array: {
|
||||
len: '須為${len}個${label}',
|
||||
min: '最少${min}個${label}',
|
||||
max: '最多${max}個${label}',
|
||||
range: '${label}數量須在${min}-${max}之間',
|
||||
},
|
||||
pattern: {
|
||||
mismatch: '${label}與模式不匹配${pattern}',
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default localeValues;
|
||||
|
||||
@@ -6,6 +6,7 @@ import { ClickParam } from '.';
|
||||
import MenuContext, { MenuContextProps } from './MenuContext';
|
||||
import Tooltip, { TooltipProps } from '../tooltip';
|
||||
import { SiderContext, SiderContextProps } from '../layout/Sider';
|
||||
import { isValidElement } from '../_util/reactNode';
|
||||
|
||||
export interface MenuItemProps
|
||||
extends Omit<
|
||||
@@ -42,7 +43,7 @@ export default class MenuItem extends React.Component<MenuItemProps> {
|
||||
const { icon, children } = this.props;
|
||||
// inline-collapsed.md demo 依赖 span 来隐藏文字,有 icon 属性,则内部包裹一个 span
|
||||
// ref: https://github.com/ant-design/ant-design/pull/23456
|
||||
if (!icon || (React.isValidElement(children) && children.type === 'span')) {
|
||||
if (!icon || (isValidElement(children) && children.type === 'span')) {
|
||||
return children;
|
||||
}
|
||||
return <span>{children}</span>;
|
||||
|
||||
@@ -4,6 +4,7 @@ import { SubMenu as RcSubMenu } from 'rc-menu';
|
||||
import classNames from 'classnames';
|
||||
import omit from 'omit.js';
|
||||
import MenuContext, { MenuContextProps } from './MenuContext';
|
||||
import { isValidElement } from '../_util/reactNode';
|
||||
|
||||
interface TitleEventEntity {
|
||||
key: string;
|
||||
@@ -49,7 +50,7 @@ class SubMenu extends React.Component<SubMenuProps, any> {
|
||||
}
|
||||
// inline-collapsed.md demo 依赖 span 来隐藏文字,有 icon 属性,则内部包裹一个 span
|
||||
// ref: https://github.com/ant-design/ant-design/pull/23456
|
||||
const titleIsSpan = React.isValidElement(title) && title.type === 'span';
|
||||
const titleIsSpan = isValidElement(title) && title.type === 'span';
|
||||
return (
|
||||
<>
|
||||
{icon}
|
||||
|
||||
@@ -12,7 +12,7 @@ import Layout from '../../layout';
|
||||
import Tooltip from '../../tooltip';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
import { resetWarned } from '../../_util/warning';
|
||||
import { resetWarned } from '../../_util/devWarning';
|
||||
|
||||
const { SubMenu } = Menu;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import omit from 'omit.js';
|
||||
import SubMenu from './SubMenu';
|
||||
import Item from './MenuItem';
|
||||
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||
import warning from '../_util/warning';
|
||||
import devWarning from '../_util/devWarning';
|
||||
import { SiderContext, SiderContextProps } from '../layout/Sider';
|
||||
import raf from '../_util/raf';
|
||||
import collapseMotion from '../_util/motion';
|
||||
@@ -120,13 +120,13 @@ class InternalMenu extends React.Component<InternalMenuProps, MenuState> {
|
||||
constructor(props: InternalMenuProps) {
|
||||
super(props);
|
||||
|
||||
warning(
|
||||
devWarning(
|
||||
!('inlineCollapsed' in props && props.mode !== 'inline'),
|
||||
'Menu',
|
||||
'`inlineCollapsed` should only be used when `mode` is inline.',
|
||||
);
|
||||
|
||||
warning(
|
||||
devWarning(
|
||||
!(props.siderCollapsed !== undefined && 'inlineCollapsed' in props),
|
||||
'Menu',
|
||||
'`inlineCollapsed` not control Menu under Sider. Should set `collapsed` on Sider instead.',
|
||||
@@ -197,7 +197,7 @@ class InternalMenu extends React.Component<InternalMenuProps, MenuState> {
|
||||
}
|
||||
|
||||
if (openAnimation) {
|
||||
warning(
|
||||
devWarning(
|
||||
typeof openAnimation === 'string',
|
||||
'Menu',
|
||||
'`openAnimation` do not support object. Please use `motion` instead.',
|
||||
|
||||
@@ -40,7 +40,8 @@
|
||||
|
||||
&-dark &-item,
|
||||
&-dark &-item-group-title,
|
||||
&-dark &-item > a {
|
||||
&-dark &-item > a,
|
||||
&-dark &-item > span > a {
|
||||
color: @menu-dark-color;
|
||||
}
|
||||
|
||||
@@ -76,7 +77,8 @@
|
||||
&-dark &-submenu-title:hover {
|
||||
color: @menu-dark-highlight-color;
|
||||
background-color: transparent;
|
||||
> a {
|
||||
> a,
|
||||
> span > a {
|
||||
color: @menu-dark-highlight-color;
|
||||
}
|
||||
> .@{menu-prefix-cls}-submenu-title,
|
||||
@@ -105,7 +107,9 @@
|
||||
border-right: 0;
|
||||
}
|
||||
> a,
|
||||
> a:hover {
|
||||
> span > a,
|
||||
> a:hover,
|
||||
> span > a:hover {
|
||||
color: @menu-dark-highlight-color;
|
||||
}
|
||||
.@{iconfont-css-prefix} {
|
||||
@@ -125,7 +129,8 @@
|
||||
&-dark &-item-disabled,
|
||||
&-dark &-submenu-disabled {
|
||||
&,
|
||||
> a {
|
||||
> a,
|
||||
> span > a {
|
||||
color: @disabled-color-dark !important;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
@@ -22,12 +22,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
&-dark {
|
||||
.@{menu-prefix-cls}-inline,
|
||||
.@{menu-prefix-cls}-vertical {
|
||||
.@{menu-prefix-cls}-rtl& {
|
||||
border-left: none;
|
||||
}
|
||||
|
||||
&-dark&-inline,
|
||||
&-dark&-vertical {
|
||||
.@{menu-prefix-cls}-rtl& {
|
||||
border-left: none;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,6 +151,7 @@
|
||||
}
|
||||
|
||||
&-sub&-inline {
|
||||
border: 0;
|
||||
& .@{menu-prefix-cls}-item-group-title {
|
||||
.@{menu-prefix-cls}-rtl& {
|
||||
padding-right: 32px;
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import Dialog, { ModalFuncProps } from './Modal';
|
||||
import ActionButton from './ActionButton';
|
||||
import warning from '../_util/warning';
|
||||
import devWarning from '../_util/devWarning';
|
||||
|
||||
interface ConfirmDialogProps extends ModalFuncProps {
|
||||
afterClose?: () => void;
|
||||
@@ -29,7 +29,7 @@ const ConfirmDialog = (props: ConfirmDialogProps) => {
|
||||
cancelButtonProps,
|
||||
} = props;
|
||||
|
||||
warning(
|
||||
devWarning(
|
||||
!(typeof icon === 'string' && icon.length > 2),
|
||||
'Modal',
|
||||
`\`icon\` is using ReactNode instead of string naming in v4. Please check \`${icon}\` at https://ant.design/components/icon`,
|
||||
|
||||
@@ -189,6 +189,7 @@ exports[`renders ./components/pagination/demo/all.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -539,6 +540,7 @@ exports[`renders ./components/pagination/demo/changer.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -763,6 +765,7 @@ exports[`renders ./components/pagination/demo/changer.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -1062,6 +1065,7 @@ exports[`renders ./components/pagination/demo/itemRender.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -1287,6 +1291,7 @@ exports[`renders ./components/pagination/demo/jump.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -1520,6 +1525,7 @@ exports[`renders ./components/pagination/demo/jump.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -1820,6 +1826,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -2219,6 +2226,7 @@ exports[`renders ./components/pagination/demo/more.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -2486,6 +2494,7 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -2665,6 +2674,7 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
|
||||
@@ -252,6 +252,7 @@
|
||||
vertical-align: top;
|
||||
.@{pagination-prefix-cls}-item-link {
|
||||
height: @pagination-item-size-sm;
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
&::after {
|
||||
height: @pagination-item-size-sm;
|
||||
|
||||
@@ -32,6 +32,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
&-slash {
|
||||
.@{pagination-prefix-cls}-rtl & {
|
||||
margin: 0 5px 0 10px;
|
||||
}
|
||||
}
|
||||
|
||||
&-options {
|
||||
.@{pagination-prefix-cls}-rtl & {
|
||||
margin-right: 16px;
|
||||
|
||||
@@ -10,7 +10,7 @@ exports[`renders ./components/progress/demo/circle.md correctly 1`] = `
|
||||
style="width:120px;height:120px;font-size:24px"
|
||||
>
|
||||
<svg
|
||||
class="ant-progress-circle "
|
||||
class="ant-progress-circle"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<path
|
||||
@@ -52,7 +52,7 @@ exports[`renders ./components/progress/demo/circle.md correctly 1`] = `
|
||||
style="width:120px;height:120px;font-size:24px"
|
||||
>
|
||||
<svg
|
||||
class="ant-progress-circle "
|
||||
class="ant-progress-circle"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<path
|
||||
@@ -112,7 +112,7 @@ exports[`renders ./components/progress/demo/circle.md correctly 1`] = `
|
||||
style="width:120px;height:120px;font-size:24px"
|
||||
>
|
||||
<svg
|
||||
class="ant-progress-circle "
|
||||
class="ant-progress-circle"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<path
|
||||
@@ -177,7 +177,7 @@ exports[`renders ./components/progress/demo/circle-dynamic.md correctly 1`] = `
|
||||
style="width:120px;height:120px;font-size:24px"
|
||||
>
|
||||
<svg
|
||||
class="ant-progress-circle "
|
||||
class="ant-progress-circle"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<path
|
||||
@@ -282,7 +282,7 @@ exports[`renders ./components/progress/demo/circle-mini.md correctly 1`] = `
|
||||
style="width:80px;height:80px;font-size:18px"
|
||||
>
|
||||
<svg
|
||||
class="ant-progress-circle "
|
||||
class="ant-progress-circle"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<path
|
||||
@@ -324,7 +324,7 @@ exports[`renders ./components/progress/demo/circle-mini.md correctly 1`] = `
|
||||
style="width:80px;height:80px;font-size:18px"
|
||||
>
|
||||
<svg
|
||||
class="ant-progress-circle "
|
||||
class="ant-progress-circle"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<path
|
||||
@@ -384,7 +384,7 @@ exports[`renders ./components/progress/demo/circle-mini.md correctly 1`] = `
|
||||
style="width:80px;height:80px;font-size:18px"
|
||||
>
|
||||
<svg
|
||||
class="ant-progress-circle "
|
||||
class="ant-progress-circle"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<path
|
||||
@@ -449,7 +449,7 @@ exports[`renders ./components/progress/demo/dashboard.md correctly 1`] = `
|
||||
style="width:120px;height:120px;font-size:24px"
|
||||
>
|
||||
<svg
|
||||
class="ant-progress-circle "
|
||||
class="ant-progress-circle"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<path
|
||||
@@ -491,7 +491,7 @@ exports[`renders ./components/progress/demo/dashboard.md correctly 1`] = `
|
||||
style="width:120px;height:120px;font-size:24px"
|
||||
>
|
||||
<svg
|
||||
class="ant-progress-circle "
|
||||
class="ant-progress-circle"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<path
|
||||
@@ -623,7 +623,7 @@ exports[`renders ./components/progress/demo/format.md correctly 1`] = `
|
||||
style="width:120px;height:120px;font-size:24px"
|
||||
>
|
||||
<svg
|
||||
class="ant-progress-circle "
|
||||
class="ant-progress-circle"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<path
|
||||
@@ -665,7 +665,7 @@ exports[`renders ./components/progress/demo/format.md correctly 1`] = `
|
||||
style="width:120px;height:120px;font-size:24px"
|
||||
>
|
||||
<svg
|
||||
class="ant-progress-circle "
|
||||
class="ant-progress-circle"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<path
|
||||
@@ -756,67 +756,7 @@ exports[`renders ./components/progress/demo/gradient-line.md correctly 1`] = `
|
||||
style="width:120px;height:120px;font-size:24px"
|
||||
>
|
||||
<svg
|
||||
class="ant-progress-circle "
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<defs>
|
||||
<linearGradient
|
||||
id="ant-progress-gradient-11"
|
||||
x1="100%"
|
||||
x2="0%"
|
||||
y1="0%"
|
||||
y2="0%"
|
||||
>
|
||||
<stop
|
||||
offset="0%"
|
||||
stop-color="#108ee9"
|
||||
/>
|
||||
<stop
|
||||
offset="100%"
|
||||
stop-color="#87d068"
|
||||
/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<path
|
||||
class="ant-progress-circle-trail"
|
||||
d="M 50,50 m 0,-47
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94"
|
||||
fill-opacity="0"
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
style="stroke-dasharray:295.3097094374406px 295.3097094374406px;stroke-dashoffset:-0px;transition:stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"
|
||||
/>
|
||||
<path
|
||||
class="ant-progress-circle-path"
|
||||
d="M 50,50 m 0,-47
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94"
|
||||
fill-opacity="0"
|
||||
opacity="1"
|
||||
stroke="url(#ant-progress-gradient-11)"
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
style="stroke:[object Object];stroke-dasharray:265.77873849369655px 295.3097094374406px;stroke-dashoffset:-0px;transition:stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"
|
||||
/>
|
||||
</svg>
|
||||
<span
|
||||
class="ant-progress-text"
|
||||
title="90%"
|
||||
>
|
||||
90%
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-progress ant-progress-circle ant-progress-status-success ant-progress-show-info ant-progress-default"
|
||||
>
|
||||
<div
|
||||
class="ant-progress-inner ant-progress-circle-gradient"
|
||||
style="width:120px;height:120px;font-size:24px"
|
||||
>
|
||||
<svg
|
||||
class="ant-progress-circle "
|
||||
class="ant-progress-circle"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<defs>
|
||||
@@ -857,6 +797,66 @@ exports[`renders ./components/progress/demo/gradient-line.md correctly 1`] = `
|
||||
stroke="url(#ant-progress-gradient-12)"
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
style="stroke:[object Object];stroke-dasharray:265.77873849369655px 295.3097094374406px;stroke-dashoffset:-0px;transition:stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"
|
||||
/>
|
||||
</svg>
|
||||
<span
|
||||
class="ant-progress-text"
|
||||
title="90%"
|
||||
>
|
||||
90%
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-progress ant-progress-circle ant-progress-status-success ant-progress-show-info ant-progress-default"
|
||||
>
|
||||
<div
|
||||
class="ant-progress-inner ant-progress-circle-gradient"
|
||||
style="width:120px;height:120px;font-size:24px"
|
||||
>
|
||||
<svg
|
||||
class="ant-progress-circle"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<defs>
|
||||
<linearGradient
|
||||
id="ant-progress-gradient-13"
|
||||
x1="100%"
|
||||
x2="0%"
|
||||
y1="0%"
|
||||
y2="0%"
|
||||
>
|
||||
<stop
|
||||
offset="0%"
|
||||
stop-color="#108ee9"
|
||||
/>
|
||||
<stop
|
||||
offset="100%"
|
||||
stop-color="#87d068"
|
||||
/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<path
|
||||
class="ant-progress-circle-trail"
|
||||
d="M 50,50 m 0,-47
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94"
|
||||
fill-opacity="0"
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
style="stroke-dasharray:295.3097094374406px 295.3097094374406px;stroke-dashoffset:-0px;transition:stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"
|
||||
/>
|
||||
<path
|
||||
class="ant-progress-circle-path"
|
||||
d="M 50,50 m 0,-47
|
||||
a 47,47 0 1 1 0,94
|
||||
a 47,47 0 1 1 0,-94"
|
||||
fill-opacity="0"
|
||||
opacity="1"
|
||||
stroke="url(#ant-progress-gradient-13)"
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
style="stroke:[object Object];stroke-dasharray:295.3097094374406px 295.3097094374406px;stroke-dashoffset:-0px;transition:stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"
|
||||
/>
|
||||
</svg>
|
||||
@@ -1197,7 +1197,7 @@ exports[`renders ./components/progress/demo/linecap.md correctly 1`] = `
|
||||
style="width:120px;height:120px;font-size:24px"
|
||||
>
|
||||
<svg
|
||||
class="ant-progress-circle "
|
||||
class="ant-progress-circle"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<path
|
||||
@@ -1239,7 +1239,7 @@ exports[`renders ./components/progress/demo/linecap.md correctly 1`] = `
|
||||
style="width:120px;height:120px;font-size:24px"
|
||||
>
|
||||
<svg
|
||||
class="ant-progress-circle "
|
||||
class="ant-progress-circle"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<path
|
||||
@@ -1312,7 +1312,7 @@ exports[`renders ./components/progress/demo/segment.md correctly 1`] = `
|
||||
style="width:120px;height:120px;font-size:24px"
|
||||
>
|
||||
<svg
|
||||
class="ant-progress-circle "
|
||||
class="ant-progress-circle"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<path
|
||||
@@ -1366,7 +1366,7 @@ exports[`renders ./components/progress/demo/segment.md correctly 1`] = `
|
||||
style="width:120px;height:120px;font-size:24px"
|
||||
>
|
||||
<svg
|
||||
class="ant-progress-circle "
|
||||
class="ant-progress-circle"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<path
|
||||
|
||||
@@ -9,7 +9,7 @@ exports[`Progress render dashboard 295 gapDegree 1`] = `
|
||||
style="width: 120px; height: 120px; font-size: 24px;"
|
||||
>
|
||||
<svg
|
||||
class="ant-progress-circle "
|
||||
class="ant-progress-circle"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<path
|
||||
@@ -32,7 +32,7 @@ exports[`Progress render dashboard 295 gapDegree 1`] = `
|
||||
stroke=""
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
style="stroke-dasharray: 0px 295.3097094374406px; stroke-dashoffset: -147.5px; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s;"
|
||||
style="stroke-dasharray: 0px 295.3097094374406px; stroke-dashoffset: -147.5px; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s; transition-duration: .3s, .3s, .3s, .06s;"
|
||||
/>
|
||||
</svg>
|
||||
<span
|
||||
@@ -54,7 +54,7 @@ exports[`Progress render dashboard 296 gapDegree 1`] = `
|
||||
style="width: 120px; height: 120px; font-size: 24px;"
|
||||
>
|
||||
<svg
|
||||
class="ant-progress-circle "
|
||||
class="ant-progress-circle"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<path
|
||||
@@ -77,7 +77,7 @@ exports[`Progress render dashboard 296 gapDegree 1`] = `
|
||||
stroke=""
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
style="stroke-dasharray: 0px 295.3097094374406px; stroke-dashoffset: -148px; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s;"
|
||||
style="stroke-dasharray: 0px 295.3097094374406px; stroke-dashoffset: -148px; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s; transition-duration: .3s, .3s, .3s, .06s;"
|
||||
/>
|
||||
</svg>
|
||||
<span
|
||||
@@ -99,7 +99,7 @@ exports[`Progress render dashboard zero gapDegree 1`] = `
|
||||
style="width: 120px; height: 120px; font-size: 24px;"
|
||||
>
|
||||
<svg
|
||||
class="ant-progress-circle "
|
||||
class="ant-progress-circle"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<path
|
||||
@@ -122,7 +122,7 @@ exports[`Progress render dashboard zero gapDegree 1`] = `
|
||||
stroke=""
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
style="stroke-dasharray: 0px 295.3097094374406px; stroke-dashoffset: -0px; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s;"
|
||||
style="stroke-dasharray: 0px 295.3097094374406px; stroke-dashoffset: -0px; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s; transition-duration: .3s, .3s, .3s, .06s;"
|
||||
/>
|
||||
</svg>
|
||||
<span
|
||||
@@ -338,7 +338,7 @@ exports[`Progress render strokeColor 1`] = `
|
||||
style="width: 120px; height: 120px; font-size: 24px;"
|
||||
>
|
||||
<svg
|
||||
class="ant-progress-circle "
|
||||
class="ant-progress-circle"
|
||||
viewBox="0 0 100 100"
|
||||
>
|
||||
<path
|
||||
@@ -361,7 +361,7 @@ exports[`Progress render strokeColor 1`] = `
|
||||
stroke=""
|
||||
stroke-linecap="round"
|
||||
stroke-width="6"
|
||||
style="stroke: red; stroke-dasharray: 147.6548547187203px 295.3097094374406px; stroke-dashoffset: -0px; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s;"
|
||||
style="stroke: red; stroke-dasharray: 147.6548547187203px 295.3097094374406px; stroke-dashoffset: -0px; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s; transition-duration: .3s, .3s, .3s, .06s;"
|
||||
/>
|
||||
</svg>
|
||||
<span
|
||||
|
||||
@@ -6,7 +6,7 @@ import ExclamationCircleFilled from '@ant-design/icons/ExclamationCircleFilled';
|
||||
import WarningFilled from '@ant-design/icons/WarningFilled';
|
||||
|
||||
import { ConfigConsumerProps, ConfigConsumer } from '../config-provider';
|
||||
import warning from '../_util/warning';
|
||||
import devWarning from '../_util/devWarning';
|
||||
|
||||
import noFound from './noFound';
|
||||
import serverError from './serverError';
|
||||
@@ -52,7 +52,7 @@ const ExceptionStatus = Object.keys(ExceptionMap);
|
||||
const renderIcon = (prefixCls: string, { status, icon }: ResultProps) => {
|
||||
const className = classnames(`${prefixCls}-icon`);
|
||||
|
||||
warning(
|
||||
devWarning(
|
||||
!(typeof icon === 'string' && icon.length > 2),
|
||||
'Result',
|
||||
`\`icon\` is using ReactNode instead of string naming in v4. Please check \`${icon}\` at https://ant.design/components/icon`,
|
||||
|
||||
@@ -60,6 +60,7 @@ Array [
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -120,6 +121,7 @@ Array [
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -178,6 +180,7 @@ Array [
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -236,6 +239,7 @@ Array [
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -382,6 +386,7 @@ Array [
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
<span
|
||||
@@ -433,6 +438,7 @@ Array [
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -493,6 +499,7 @@ Array [
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -556,6 +563,7 @@ Array [
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -614,6 +622,7 @@ Array [
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -676,6 +685,7 @@ exports[`renders ./components/select/demo/custom-dropdown-menu.md correctly 1`]
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -796,6 +806,7 @@ exports[`renders ./components/select/demo/custom-tag-render.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
<span
|
||||
@@ -840,6 +851,7 @@ exports[`renders ./components/select/demo/debug.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -935,6 +947,7 @@ exports[`renders ./components/select/demo/debug.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
<span
|
||||
@@ -985,6 +998,7 @@ exports[`renders ./components/select/demo/hide-selected.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
<span
|
||||
@@ -1025,6 +1039,7 @@ exports[`renders ./components/select/demo/label-in-value.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -1159,6 +1174,7 @@ exports[`renders ./components/select/demo/multiple.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
<span
|
||||
@@ -1194,6 +1210,7 @@ exports[`renders ./components/select/demo/optgroup.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -1292,6 +1309,7 @@ exports[`renders ./components/select/demo/option-label-prop.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
<span
|
||||
@@ -1327,6 +1345,7 @@ exports[`renders ./components/select/demo/search.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -1388,6 +1407,7 @@ exports[`renders ./components/select/demo/search-box.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -1423,6 +1443,7 @@ exports[`renders ./components/select/demo/select-users.md correctly 1`] = `
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
<span
|
||||
@@ -1528,6 +1549,7 @@ Array [
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -1660,6 +1682,7 @@ Array [
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
<span
|
||||
@@ -1801,6 +1824,7 @@ Array [
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
@@ -1861,6 +1885,7 @@ Array [
|
||||
readonly=""
|
||||
role="combobox"
|
||||
style="opacity:0"
|
||||
unselectable="on"
|
||||
value=""
|
||||
/>
|
||||
</span>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user