diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000000..10f81b3670c8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +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. + - name: 🆕 创建一个新 Issue + url: http://new-issue.ant.design + about: 不是用 http://new-issue.ant.design 创建的 issue 会被机器人自动关闭。另外『如何使用...』类问题建议使用讨论区 https://github.com/ant-design/ant-design/discussions diff --git a/.github/ISSUE_TEMPLATE/template-1-bug-report.yml.close b/.github/ISSUE_TEMPLATE/template-1-bug-report.yml.close new file mode 100644 index 000000000000..005df9e64953 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/template-1-bug-report.yml.close @@ -0,0 +1,99 @@ +name: 🇨🇳 报告缺陷(beta) +description: 使用中文 Bug 报告模板提交一个缺陷,当然你也可以用 https://new-issue.ant.design +title: "[Bug] 请替换成合适的标题" +labels: ["🐛+Bug"] +body: + - type: markdown + attributes: + value: | + 除了此表单,你也可以使用 [Ant Design Issue Helper](https://new-issue.ant.design/) 来新建 issue。 + + Ant Design 的 issue 列表只接受 [Bug 报告](https://github.com/ant-design/ant-design/issues/new?assignees=&labels=%F0%9F%90%9B+Bug&template=template-1-bug-report.yml&title=%5BBug%5D+) 或是 [新功能请求](https://github.com/ant-design/ant-design/issues/new?assignees=&labels=%F0%9F%92%A1%2BFeature%2BRequest&template=template-2-feature-request.yml&title=%5BFeature+Request%5D+) (Feature Request)。这意味着我们不接受用法问题(How to 类问题)。如果你开的 issue 不符合规定,它将会被立刻关闭。[为什么要这么严格?](https://github.com/ant-design/antd-issue-helper/blob/master/src/locales/zh/introModal.md) + + 对于使用中遇到的问题,请使用以下资源: + + - 将用法类问题发到 [GitHub 讨论区](https://github.com/ant-design/ant-design/discussions) 而不是 Issue。 + - 仔细阅读 [使用文档](https://ant.design/docs/react/introduce-cn) 和 [组件文档](https://ant.design/components/overview-cn/)。 + - 提问前确保你在 [常见问题](https://ant.design/docs/react/faq-cn) 和 [更新日志](https://ant.design/changelog-cn) 中搜索过。 + - 在 [StackOverflow](https://stackoverflow.com/questions/tagged/antd) (英文) 或是 [SegmentFault](https://segmentfault.com/t/antd)(中文)搜索和提问。 + + 最后,在开 issue 前,可以先搜索一下以往的旧 issue - 你遇到的问题可能已经有人提了,也可能已经在最新版本中被修正。注意:如果你发现一个已经关闭的旧 issue 在最新版本中仍然存在,请不要在旧 issue 下面留言,而应该用下面的表单开一个新的 issue。 + + --- + - type: input + id: reproduce + attributes: + label: 重现链接 + description: 请提供一个尽可能精简的 [codesandbox](https://u.ant.design/codesandbox-repro) 或 [GitHub 仓库](https://github.com/ant-design/create-react-app-antd/) 的链接。[什么是最小化重现,为什么这是必需的?](https://github.com/ant-design/antd-issue-helper/blob/master/src/locales/zh/reproModal.md) + validations: + required: true + - type: input + id: version + attributes: + label: antd 版本 + description: 你正在使用的 antd 版本是多少?(注意不是 package.json 里的版本,而是 node_modules/antd 里实际安装的版本) + placeholder: 如 4.16.13 + validations: + required: true + - type: textarea + id: reproduce-steps + attributes: + label: 重现步骤 + description: 请提供一个傻瓜式的操作步骤,方便我们无脑重现问题。 + placeholder: | + 比如: + 1. 点击重现链接里的主按钮 + 2. 等待五秒钟 + 3. 观察按钮的边框 + validations: + required: true + - type: textarea + id: expected + attributes: + label: 期望的结果是什么? + placeholder: 比如:按钮样式正常,边框一直存在 + validations: + required: true + - type: textarea + id: reality + attributes: + label: 实际的结果是什么? + placeholder: 比如:按钮样式异常,边框突然丢失 + validations: + required: true + - type: dropdown + id: browsers + attributes: + label: 浏览器 + description: 在哪些浏览器上能重现这个问题? + multiple: true + options: + - Firefox + - Chrome + - Safari + - Edge + - Internet Explorer + - Others + - type: input + id: browsers-version + attributes: + label: 浏览器版本 + placeholder: 如:版本 95.0.4638.69(正式版本) (x86_64) + - type: dropdown + id: os + attributes: + label: 操作系统 + description: 使用的操作系统是? + options: + - Windows + - MacOS + - iOS + - Android + - Others + - type: input + id: hidden-tag + attributes: + label: 其他 + description: 不要删除预填内容,否则 issue 会被自动关闭。 + value: + diff --git a/.github/ISSUE_TEMPLATE/template-2-feature-request.yml.close b/.github/ISSUE_TEMPLATE/template-2-feature-request.yml.close new file mode 100644 index 000000000000..b9e18c2028aa --- /dev/null +++ b/.github/ISSUE_TEMPLATE/template-2-feature-request.yml.close @@ -0,0 +1,50 @@ +name: 🇨🇳 功能需求(beta) +description: 使用中文 Bug 报告模板提交一个功能需求,当然你也可以用 https://new-issue.ant.design +title: "[Feature Request] 请替换成合适的标题" +labels: ["💡+Feature+Request"] +body: + - type: markdown + attributes: + value: | + 除了此表单,你也可以使用 [Ant Design Issue Helper](https://new-issue.ant.design/) 来新建 issue。 + + Ant Design 的 issue 列表只接受 [Bug 报告](https://github.com/ant-design/ant-design/issues/new?assignees=&labels=%F0%9F%90%9B+Bug&template=template-1-bug-report.yml&title=%5BBug%5D+) 或是 [新功能请求](https://github.com/ant-design/ant-design/issues/new?assignees=&labels=%F0%9F%92%A1%2BFeature%2BRequest&template=template-2-feature-request.yml&title=%5BFeature+Request%5D+) (Feature Request)。这意味着我们不接受用法问题(How to 类问题)。如果你开的 issue 不符合规定,它将会被立刻关闭。[为什么要这么严格?](https://github.com/ant-design/antd-issue-helper/blob/master/src/locales/zh/introModal.md) + + 对于使用中遇到的问题,请使用以下资源: + + - 将用法类问题发到 [GitHub 讨论区](https://github.com/ant-design/ant-design/discussions) 而不是 Issue。 + - 仔细阅读 [使用文档](https://ant.design/docs/react/introduce-cn) 和 [组件文档](https://ant.design/components/overview-cn/)。 + - 提问前确保你在 [常见问题](https://ant.design/docs/react/faq-cn) 和 [更新日志](https://ant.design/changelog-cn) 中搜索过。 + - 在 [StackOverflow](https://stackoverflow.com/questions/tagged/antd) (英文) 或是 [SegmentFault](https://segmentfault.com/t/antd)(中文)搜索和提问。 + + 最后,在开 issue 前,可以先搜索一下以往的旧 issue - 你遇到的问题可能已经有人提了,也可能已经在最新版本中被修正。注意:如果你发现一个已经关闭的旧 issue 在最新版本中仍然存在,请不要在旧 issue 下面留言,而应该用下面的表单开一个新的 issue。 + + --- + - type: textarea + id: needs + attributes: + label: 这个功能解决了什么问题? + description: | + 请尽可能详尽地说明这个需求的用例和场景。最重要的是:解释清楚是怎样的用户体验需求催生了这个功能上的需求。 + Ant Design 的一个重要设计原则是保持 API 的简洁和直接。通常来说,我们只考虑添加在现有的 API 下无法轻松实现的功能。新功能的用例也应当足够常见。 + validations: + required: true + - type: textarea + id: api + attributes: + label: 你期望的 API 是怎样的? + description: | + 描述一下你期望这个新功能的 API 是如何使用的,并提供一些代码示例。请用 Markdown 格式化你的代码片段。 + 如果有新的 UI 界面,最好截图展示你期望的界面是什么样的? + placeholder: | + ```jsx + } {...props} /> + ``` + validations: + required: true + - type: input + id: hidden-tag + attributes: + label: 其他 + description: 不要删除预填内容,否则 issue 会被自动关闭。 + value: diff --git a/.github/workflows/issue-check-inactive.yml b/.github/workflows/issue-check-inactive.yml index 6ca5f9f3e8c3..df05004109a9 100644 --- a/.github/workflows/issue-check-inactive.yml +++ b/.github/workflows/issue-check-inactive.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: check-inactive - uses: actions-cool/issues-helper@v2 + uses: actions-cool/issues-helper@v3 with: actions: 'check-inactive' inactive-label: 'Inactive' diff --git a/.github/workflows/issue-close-require.yml b/.github/workflows/issue-close-require.yml index 24c129200095..31074703267a 100644 --- a/.github/workflows/issue-close-require.yml +++ b/.github/workflows/issue-close-require.yml @@ -9,14 +9,14 @@ jobs: runs-on: ubuntu-latest steps: - name: need reproduce - uses: actions-cool/issues-helper@v2 + uses: actions-cool/issues-helper@v3 with: actions: 'close-issues' labels: '🤔 Need Reproduce' inactive-day: 3 - name: needs more info - uses: actions-cool/issues-helper@v2 + uses: actions-cool/issues-helper@v3 with: actions: 'close-issues' labels: 'needs-more-info' diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml index e3effb710b61..a6699fa1df14 100644 --- a/.github/workflows/issue-labeled.yml +++ b/.github/workflows/issue-labeled.yml @@ -12,7 +12,7 @@ jobs: steps: - name: help wanted if: github.event.label.name == 'help wanted' - uses: actions-cool/issues-helper@v2 + uses: actions-cool/issues-helper@v3 with: actions: 'create-comment' token: ${{ secrets.GITHUB_TOKEN }} @@ -26,7 +26,7 @@ jobs: - name: 🤔 Need Reproduce if: github.event.label.name == '🤔 Need Reproduce' - uses: actions-cool/issues-helper@v2 + uses: actions-cool/issues-helper@v3 with: actions: 'create-comment' token: ${{ secrets.GITHUB_TOKEN }} @@ -40,7 +40,7 @@ jobs: - name: Usage if: github.event.label.name == 'Usage' || github.event.label.name == 'Question' - uses: actions-cool/issues-helper@v2 + uses: actions-cool/issues-helper@v3 with: actions: 'create-comment,close-issue' token: ${{ secrets.GITHUB_TOKEN }} @@ -52,7 +52,7 @@ jobs: - name: 3.x if: github.event.label.name == '3.x' - uses: actions-cool/issues-helper@v2 + uses: actions-cool/issues-helper@v3 with: actions: 'create-comment,close-issue' token: ${{ secrets.GITHUB_TOKEN }} @@ -64,7 +64,7 @@ jobs: - name: invalid if: github.event.label.name == 'Invalid' - uses: actions-cool/issues-helper@v2 + uses: actions-cool/issues-helper@v3 with: actions: 'create-comment,close-issue' token: ${{ secrets.GITHUB_TOKEN }} @@ -76,7 +76,7 @@ jobs: - name: rtl if: github.event.label.name == 'rtl' - uses: actions-cool/issues-helper@v2 + uses: actions-cool/issues-helper@v3 with: actions: 'add-assignees' assignees: 'xrkffgg' diff --git a/.github/workflows/issue-open-check.yml b/.github/workflows/issue-open-check.yml index 183d44acf94f..1f2112592fd0 100644 --- a/.github/workflows/issue-open-check.yml +++ b/.github/workflows/issue-open-check.yml @@ -16,7 +16,7 @@ jobs: - name: check invalid if: (contains(github.event.issue.body, 'ant-design-issue-helper') == false) && (steps.checkUser.outputs.result == 'false') - uses: actions-cool/issues-helper@v2 + uses: actions-cool/issues-helper@v3 with: actions: 'create-comment,add-labels,close-issue' issue-number: ${{ github.event.issue.number }} @@ -27,7 +27,7 @@ jobs: 你好 @${{ github.event.issue.user.login }},为了能够进行高效沟通,我们对 issue 有一定的格式要求,你的 issue 因为不符合要求而被自动关闭。你可以通过 [issue 助手](http://new-issue.ant.design) 来创建 issue 以方便我们定位错误。谢谢配合! - name: check website - uses: actions-cool/issues-helper@v2 + uses: actions-cool/issues-helper@v3 id: checkid with: actions: 'check-issue' @@ -37,7 +37,7 @@ jobs: - name: deal website if: steps.checkid.outputs.check-result == 'true' - uses: actions-cool/issues-helper@v2 + uses: actions-cool/issues-helper@v3 with: actions: 'create-comment,close-issue' issue-number: ${{ github.event.issue.number }} @@ -59,11 +59,11 @@ jobs: * Infra Design Pro: http://ant-design-pro.gitee.io * Infra Design Mobile: http://antd-mobile.gitee.io * Ant Motion: http://ant-motion.gitee.io - * Infra Design Pro Preview : https://prosite.z23.web.core.windows.net - + * Ant Design Pro Preview : https://prosite.z23.web.core.windows.net + - name: check ie if: contains(github.event.issue.body, 'ant-design-issue-helper') == true && contains(github.event.issue.title, 'IE9') == true || contains(github.event.issue.title, 'IE 9') == true || contains(github.event.issue.title, 'IE10') == true || contains(github.event.issue.title, 'IE 10') == true || contains(github.event.issue.title, 'IE11') == true || contains(github.event.issue.title, 'IE 11') == true || contains(github.event.issue.title, 'Internet Explorer') == true || contains(github.event.issue.body, 'IE9') == true || contains(github.event.issue.body, 'IE 9') == true || contains(github.event.issue.body, 'IE10') == true || contains(github.event.issue.body, 'IE 10') == true || contains(github.event.issue.body, 'IE11') == true || contains(github.event.issue.body, 'IE 11') == true || contains(github.event.issue.body, 'Internet Explorer') == true - uses: actions-cool/issues-helper@v2 + uses: actions-cool/issues-helper@v3 with: actions: 'add-labels' issue-number: ${{ github.event.issue.number }} @@ -71,7 +71,7 @@ jobs: - name: check ie if: contains(github.event.issue.body, 'ant-design-issue-helper') == true && contains(github.event.issue.title, 'IE9') == true || contains(github.event.issue.title, 'IE 9') == true || contains(github.event.issue.title, 'IE10') == true || contains(github.event.issue.title, 'IE 10') == true || contains(github.event.issue.title, 'IE11') == true || contains(github.event.issue.title, 'IE 11') == true || contains(github.event.issue.title, 'Internet Explorer') == true || contains(github.event.issue.body, 'IE9') == true || contains(github.event.issue.body, 'IE 9') == true || contains(github.event.issue.body, 'IE10') == true || contains(github.event.issue.body, 'IE 10') == true - uses: actions-cool/issues-helper@v2 + uses: actions-cool/issues-helper@v3 with: actions: 'create-comment, close-issue' issue-number: ${{ github.event.issue.number }} diff --git a/.github/workflows/issue-remove-inactive.yml b/.github/workflows/issue-remove-inactive.yml index f6634e88c863..90556c416dbd 100644 --- a/.github/workflows/issue-remove-inactive.yml +++ b/.github/workflows/issue-remove-inactive.yml @@ -12,7 +12,7 @@ jobs: steps: - name: remove inactive if: github.event.issue.state == 'open' && github.actor == github.event.issue.user.login - uses: actions-cool/issues-helper@v2 + uses: actions-cool/issues-helper@v3 with: actions: 'remove-labels' issue-number: ${{ github.event.issue.number }} diff --git a/.github/workflows/pr-check-ci.yml b/.github/workflows/pr-check-ci.yml index a8d492dd5f4b..d9599590a57c 100644 --- a/.github/workflows/pr-check-ci.yml +++ b/.github/workflows/pr-check-ci.yml @@ -13,7 +13,7 @@ jobs: with: filter-label: 'BranchAutoMerge' filter-creator-authority: 'write' - filter-head-ref: 'master, feature, master-merge-feature, feature-merge-master' + filter-head-ref: 'master, feature, next, master-merge-feature, feature-merge-master, next-merge-master' filter-support-fork: false skip-run-names: 'deploy preview, pr-check-ci, build preview failed, suggest-related-links' conflict-review-body: '😅 This branch has conflicts that must be resolved!' diff --git a/.github/workflows/pr-check-merge.yml b/.github/workflows/pr-check-merge.yml index 1d35c970dd27..c2ff3d4e10f9 100644 --- a/.github/workflows/pr-check-merge.yml +++ b/.github/workflows/pr-check-merge.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest if: (github.event.pull_request.head.ref == 'feature' || github.event.pull_request.head.ref == 'master') && github.event.pull_request.head.user.login == 'ant-design' steps: - - uses: actions-cool/issues-helper@v2 + - uses: actions-cool/issues-helper@v3 with: actions: 'create-comment' issue-number: ${{ github.event.number }} diff --git a/.github/workflows/release-helper.yml b/.github/workflows/release-helper.yml index d53ea4b21a65..05ee24a92742 100644 --- a/.github/workflows/release-helper.yml +++ b/.github/workflows/release-helper.yml @@ -16,12 +16,12 @@ jobs: runs-on: ubuntu-latest steps: - name: make release - uses: actions-cool/release-helper@v1 + uses: actions-cool/release-helper@v2 with: triger: 'tag' changelogs: 'CHANGELOG.en-US.md, CHANGELOG.zh-CN.md' branch: 'master' - dingding-token: ${{ secrets.DINGDING_BOT_TOKEN }} + dingding-token: ${{ secrets.DINGDING_BOT_TOKEN }} ${{ secrets.DINGDING_BOT_BIGFISH_TOKEN }} dingding-msg: 'CHANGELOG.zh-CN.md' msg-poster: 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*zx7LTI_ECSAAAAAAAAAAAABkARQnAQ' msg-footer: '💬 前往 [**Ant Design Releases**]({{url}}) 查看更新日志' diff --git a/.github/workflows/verify-files-modify.yml b/.github/workflows/verify-files-modify.yml index e536da38fa48..d76777352fef 100644 --- a/.github/workflows/verify-files-modify.yml +++ b/.github/workflows/verify-files-modify.yml @@ -14,10 +14,11 @@ jobs: forbid-paths: '.github/, scripts/' forbid-files: 'CHANGELOG.zh-CN.md, CHANGELOG.en-US.md, LICENSE' skip-verify-authority: 'write' - assignees: 'afc163, zombieJ, xrkffgg' + assignees: 'afc163, zombieJ, xrkffgg, MadCcc' comment: | Hi @${{ github.event.pull_request.user.login }}. Thanks for your contribution. The path `.github/` or `scripts/` and `CHANGELOG` `package.json` is only maintained by team members. This current PR will be closed and team members will help on this. close: true + set-failed: false - name: verify-less uses: actions-cool/verify-files-modify@v1 diff --git a/.stylelintrc.json b/.stylelintrc.json index 5a03e7f8aa26..b5af6dd10a45 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -8,6 +8,25 @@ "plugins": ["stylelint-declaration-block-no-ignored-properties"], "rules": { "function-name-case": ["lower", { "ignoreFunctions": ["/colorPalette/"] }], + "function-no-unknown": [ + true, + { + "ignoreFunctions": [ + "fade", + "tint", + "darken", + "ceil", + "fadein", + "floor", + "unit", + "shade", + "lighten", + "percentage", + "-", + "~`colorPalette" + ] + } + ], "no-descending-specificity": null, "no-invalid-position-at-import-rule": null, "declaration-empty-line-before": null, diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index da9a8b5037aa..8afd236a8210 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -9,6 +9,7 @@ timeline: true | infrad version | antd version | update content | time | | --- | --- | --- | --- | +| 4.18.9 | 4.18.9 | Synchronize the update of antd 4.18.9 version | 2022-03-08 | | 4.18.5 | 4.18.3 | Roll back some components, details can be [View](https://docs.google.com/spreadsheets/d/1TvmnH4gNNt52CCLTn1GCuPlPDfjIQVHfbtauUOX3hdw/edit#gid=0) | 2022-02-25 | | 4.18.4 | 4.18.3 | fix error-color difference | 2022-01-17 | | 4.18.3 | 4.18.3 | Synchronize the update of antd 4.18.3 version | 2022-01-17 | @@ -28,6 +29,100 @@ if you have some problem, welcome to connect `taofeng.yang@shopee.com` or `lay.z --- +## 4.18.9 + +`2022-02-28` + +- 🆕 New theme less variable for Radio, Divider, Modal, Dropdown, Drawer. [#34194](https://github.com/ant-design/ant-design/pull/34194) [#34187](https://github.com/ant-design/ant-design/pull/34187) [#34191](https://github.com/ant-design/ant-design/pull/34191) [#34189](https://github.com/ant-design/ant-design/pull/34189) [#34188](https://github.com/ant-design/ant-design/pull/34188) [@qdzhaoxiaodao](https://github.com/qdzhaoxiaodao) +- 💄 Fix Dropdown item wrap style when text is too long. [#34177](https://github.com/ant-design/ant-design/pull/34177) +- TypeScript + - 🐞 Fix Upload `onChange` parameter generic passing. [#34161](https://github.com/ant-design/ant-design/pull/34161) [@wangcch](https://github.com/wangcch) + +## 4.18.8 + +`2022-02-21` + +- 🐞 Fix `getContainer` config not working bug when called multi-times via `message.config`. [#34123](https://github.com/ant-design/ant-design/pull/34123) [@TrickyPi](https://github.com/TrickyPi) +- 🐞 Fix invalid context value cache in Menu component. [#34121](https://github.com/ant-design/ant-design/pull/34121) [@mrwd2009](https://github.com/mrwd2009) +- 🐞 Fix ConfigProvider config theme on server side crash, and warning for useless in SSR instead. [#34118](https://github.com/ant-design/ant-design/pull/34118) +- Table + - ⚡️ Fix Table render twice on first mount. [#34106](https://github.com/ant-design/ant-design/pull/34106) + - ⚡️ Optimized Table rendering performance, now will skip useless rendering when deprecated `column.render: () => { children, props }` method is not used. [#34075](https://github.com/ant-design/ant-design/pull/34075) +- 🐞 Fix incorrect copy text of Typography after children is updated when enable `copyable`. [#34034](https://github.com/ant-design/ant-design/pull/34034) [@opopeieie](https://github.com/opopeieie) +- ⚡️ Optimize Avatar, List, Pagination, Steps to avoid additional render on mount if unnecessary. [34122](https://github.com/ant-design/ant-design/pull/34122) +- 💄 Fix Form broken style when Select item is too long in horizontal layout. [#34117](https://github.com/ant-design/ant-design/pull/34117) +- 🇸🇰 Improve texts for Table, Form and Modal in `sk_SK`. [#34061](https://github.com/ant-design/ant-design/pull/34061) [@xseman](https://github.com/xseman) +- TypeScript + - 🤖 Export `SiderProps` type from Layout component. [#34137](https://github.com/ant-design/ant-design/pull/34137) [@Picsong](https://github.com/Picsong) + +## 4.18.7 + +`2022-02-14` + +- Typography + - 🛠 Fix Typography `useLayoutEffect` warning in SSR. [#33818](https://github.com/ant-design/ant-design/pull/33818) [@SoYoung210](https://github.com/SoYoung210) + - 🐞 Fix Typography with `ellipsis` makes screen show the scroll bar in some case. [#34007](https://github.com/ant-design/ant-design/pull/34007) + - 🐞 Typography copy click event is now `stopPropagation` by default. [#33998](https://github.com/ant-design/ant-design/pull/33998) [@linxianxi](https://github.com/linxianxi) + - 🐞 Fix Typography edit & copy button not trigger by enter key. [#33976](https://github.com/ant-design/ant-design/pull/33976) [@mrwd2009](https://github.com/mrwd2009) +- 🐞 Fix Form `undefined` text of min/max validators in pl_PL locale. [#34024](https://github.com/ant-design/ant-design/pull/34024) [@MichalPodeszwa](https://github.com/MichalPodeszwa) +- 🐞 Fix Input.TextArea cut text logic when `maxLength` configured. [#33910](https://github.com/ant-design/ant-design/pull/33910) [@chenyizhongx](https://github.com/chenyizhongx) +- 💄 Button with `type=default` will provide `.ant-btn-default` className. [#34013](https://github.com/ant-design/ant-design/pull/34013) +- 💄 Improve Menu `:focus-visible` style. [#34008](https://github.com/ant-design/ant-design/pull/34008) +- 💄 Fix Pagination and Rate style problem in Safari. [#34002](https://github.com/ant-design/ant-design/pull/34002) +- 💄 Fix Row and Col component styles when using prefixCls. [#33969](https://github.com/ant-design/ant-design/pull/33969) [@mic-web](https://github.com/mic-web) +- 🐞 Fix Timeline icons with custom color not working. [#33951](https://github.com/ant-design/ant-design/pull/33951) [@MadCcc](https://github.com/MadCcc) +- TypeScript + - 🤖 Optimize Cascader `onChange` definition with `multiple` prop. [#33947](https://github.com/ant-design/ant-design/pull/33947) [@babycannotsay](https://github.com/babycannotsay) + +## 4.18.6 + +`2022-02-07` + +- 🐞 Fix the empty Popover displayed when `content` and `title` is undefined or null. [#33835](https://github.com/ant-design/ant-design/pull/33835) [@DawnLck](https://github.com/DawnLck) +- 🐞 Fix the problem that Tooltip didn't show on `ellipsis` with rows larger than 1. [#33875](https://github.com/ant-design/ant-design/pull/33875) +- Button + - 🐞 Fix the issue that `block` of Button not work when small size. [#33878](https://github.com/ant-design/ant-design/pull/33878) [@tangjinzhou](https://github.com/tangjinzhou) + - 🐞 Fix the issue that `loading.delay` of Button cause React memory leak warning [#33858](https://github.com/ant-design/ant-design/pull/33858) [@mrwd2009](https://github.com/mrwd2009) +- 🐞 Fix the problem that Tooltip cannot be displayed when it is used with Switch in `loading` state. [#33860](https://github.com/ant-design/ant-design/pull/33860) +- 🐞 Fix the Upload button sometimes flashes after changed from hidden to display when the Upload component is a `picture-card` type. [#33820](https://github.com/ant-design/ant-design/pull/33820) [@credred](https://github.com/credred) +- TypeScript + - 🤖 Fix DatePicker `ref` TypeScript definition. [#33901](https://github.com/ant-design/ant-design/pull/33901) [@Amour1688](https://github.com/Amour1688) + +## 4.18.5 + +`2022-01-24` + +- Cascader + - 💄 Fix Cascader loading icon. [#33799](https://github.com/ant-design/ant-design/pull/33799) + - 🐞 Fix Cascader not auto offset placement when popup is out of screen and fix active option out of screen not scroll. [#33777](https://github.com/ant-design/ant-design/pull/33777) +- 💄 Fix Tag style in dark theme. [#33751](https://github.com/ant-design/ant-design/pull/33751) +- 💄 Fix disabled Checkbox inside Tooltip dom structure. [#33772](https://github.com/ant-design/ant-design/pull/33772) [@boomler](https://github.com/boomler) +- ⚡️ Fix invalid hook dependency array in Row and Layout.Sider components. [#33804](https://github.com/ant-design/ant-design/pull/33804) [@mrwd2009](https://github.com/mrwd2009) +- 🐞 Fix Card `ref` not working. [#33784](https://github.com/ant-design/ant-design/pull/33784) [@LongHaoo](https://github.com/LongHaoo) +- 🐞 Fix a Checkbox problem that `onChange` could not correctly pass in the modified value when dynamically modifying `value` property. [#33753](https://github.com/ant-design/ant-design/pull/33753) + +## 4.18.4 + +`2022-01-18` + +- Typography + - ⚡️ Optimize Typography to use native css ellipsis when `tooltip` is configured. [#33669](https://github.com/ant-design/ant-design/pull/33669) + - 🐞 Refactor Typography `ellipsis` logic to fix error when `children` use Context content. [#33725](https://github.com/ant-design/ant-design/pull/33725) +- Icon + - 🐞 Fix `` and `` not aligned. (https://github.com/ant-design/ant-design/pull/33709) + - 🐞 Fix `` shake. [#33726](https://github.com/ant-design/ant-design/pull/33726) [@JX-Zhuang](https://github.com/JX-Zhuang) +- Input + - 🐞 Fix the display effect for Input related components with `hidden`. [#33735](https://github.com/ant-design/ant-design/pull/33735) [@fanerge](https://github.com/fanerge) [#33706](https://github.com/ant-design/ant-design/pull/33706) [@hydraZty](https://github.com/hydraZty) + - 🐞 Fix the warning in console for Input with `showCount`. [#33686](https://github.com/ant-design/ant-design/pull/33686) [@whwangms](https://github.com/whwangms) +- ⚡️ Fix ConfigProvider and Anchor rerender unexpectedly. [#33723](https://github.com/ant-design/ant-design/pull/33723) [@mrwd2009](https://github.com/mrwd2009) +- 🐞 Fix the duplicate keys warning in console for Cascader. [#33649](https://github.com/ant-design/ant-design/pull/33649) [@dimbslmh](https://github.com/dimbslmh) +- 🐞 Checkbox.Group support number and boolean as options element. [#33678](https://github.com/ant-design/ant-design/pull/33678) +- 🐞 Fix Form `validateMessages` bug in multiple ConfigProvider. [#33705](https://github.com/ant-design/ant-design/pull/33705) +- 🐞 Fix Steps the tail part would be hidden when type is navigation and labelPlacement is vertical. [#33716](https://github.com/ant-design/ant-design/pull/33716) [@toSayNothing](https://github.com/toSayNothing) +- 🐞 Fix Image has bottom blank style. [#33631](https://github.com/ant-design/ant-design/pull/33631) [@fanerge](https://github.com/fanerge) +- 🐞 Fix TreeSelect with keyboard operation missing highlight issue. [#33755](https://github.com/ant-design/ant-design/pull/33755) +- 🇰🇭 Fix some translations for Khmer (km_KH). [#33738](https://github.com/ant-design/ant-design/pull/33738) [@vireakkeosokvibol](https://github.com/vireakkeosokvibol) + ## 4.18.3 `2022-01-10` diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index 5c09c112e671..0171e1927980 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -9,6 +9,7 @@ timeline: true | infrad 版本号 | 对应 antd 版本号 | 更新内容 | 时间 | | --- | --- | --- | --- | +| 4.18.9 | 4.18.9 | 同步 antd 4.18.9 版本的更新 | 2022-03-08 | | 4.18.5 | 4.18.3 | 回滚部分组件,详情可[查看](https://docs.google.com/spreadsheets/d/1TvmnH4gNNt52CCLTn1GCuPlPDfjIQVHfbtauUOX3hdw/edit#gid=0) | 2022-02-25 | | 4.18.4 | 4.18.3 | 修复 error-color 颜色差异问题 | 2022-01-18 | | 4.18.3 | 4.18.3 | 同步 antd 4.18.3 版本的更新 | 2022-01-17 | @@ -28,6 +29,101 @@ timeline: true --- +## 4.18.9 + +`2022-02-28` + +- 🆕 新增 Radio、Divider、Modal、Dropdown、Drawer 主题变量。[#34194](https://github.com/ant-design/ant-design/pull/34194) [#34187](https://github.com/ant-design/ant-design/pull/34187) [#34191](https://github.com/ant-design/ant-design/pull/34191) [#34189](https://github.com/ant-design/ant-design/pull/34189) [#34188](https://github.com/ant-design/ant-design/pull/34188) [@qdzhaoxiaodao](https://github.com/qdzhaoxiaodao) +- 🐞 修复 Form 组件当 `preserve` 为 `false` 时 `initialValues` 会被更改的问题。[#34153](https://github.com/ant-design/ant-design/pull/34153) +- 💄 修复 Dropdown 菜单项文本太长没有换行的问题。[#34177](https://github.com/ant-design/ant-design/pull/3417) +- TypeScript + - 🐞 修复 Upload `onChange` 参数泛型传递。[#34161](https://github.com/ant-design/ant-design/pull/34161) [@wangcch](https://github.com/wangcch) + +## 4.18.8 + +`2022-02-21` + +- 🐞 修复 `message.config` 多次配置 `getContainer` 时无法生效的问题。[#34123](https://github.com/ant-design/ant-design/pull/34123) [@TrickyPi](https://github.com/TrickyPi) +- 🐞 修复 Menu 组件中无效的缓存逻辑。[#34121](https://github.com/ant-design/ant-design/pull/34121) [@mrwd2009](https://github.com/mrwd2009) +- 🐞 修复 ConfigProvider 在服务端配置主题会崩溃的问题,同时现在会提示动态主题于 SSR 上无效。[#34118](https://github.com/ant-design/ant-design/pull/34118) +- Table + - ⚡️ 修复 Table 在首次加载时会渲染两次的问题。[#34106](https://github.com/ant-design/ant-design/pull/34106) + - ⚡️ 优化 Table 渲染性能,现在不使用废弃 `column.render: () => { children, props }` 方法时默认会跳过无用渲染。[#34075](https://github.com/ant-design/ant-design/pull/34075) +- 🐞 修复 Typography 启用 `copyable` 时 `children` 内容变化后复制内容没变的问题。[#34034](https://github.com/ant-design/ant-design/pull/34034) [@opopeieie](https://github.com/opopeieie) +- ⚡️ 优化 Avatar、List、Pagination、Steps 以防止初始化时非必要的额外渲染。[34122](https://github.com/ant-design/ant-design/pull/34122) +- 💄 修复 Form 下 Select 内容太长导致布局换行的问题。[#34117](https://github.com/ant-design/ant-design/pull/34117) +- 🇸🇰 完善 `sk-SK` 中 Table、Form、Modal 的文案。[#34061](https://github.com/ant-design/ant-design/pull/34061) [@xseman](https://github.com/xseman) +- TypeScript + - 🤖 导出 Layout 组件的 `SiderProps` 类型。[#34137](https://github.com/ant-design/ant-design/pull/34137) [@Picsong](https://github.com/Picsong) + +## 4.18.7 + +`2022-02-14` + +- Typography + - 🛠 修复 Typography 在 SSR 渲染时警告 `useLayoutEffect` 的问题。[#33818](https://github.com/ant-design/ant-design/pull/33818) [@SoYoung210](https://github.com/SoYoung210) + - 🐞 修复 Typography 配置 `ellipsis` 后在某些情况下会出现滚动条的问题。[#34007](https://github.com/ant-design/ant-design/pull/34007) + - 🐞 Typography 复制按钮点击事件不在冒泡。[#33998](https://github.com/ant-design/ant-design/pull/33998) [@linxianxi](https://github.com/linxianxi) + - 🐞 修复 Typography 中编辑和拷贝按钮无法响应 Enter 按键的问题。[#33976](https://github.com/ant-design/ant-design/pull/33976) [@mrwd2009](https://github.com/mrwd2009) +- 🐞 修复 Form 波兰语中表单校验部分文案未定义的问题。[#34024](https://github.com/ant-design/ant-design/pull/34024) [@MichalPodeszwa](https://github.com/MichalPodeszwa) +- 🐞 修复 Input.TextArea 设置 `maxLength` 时光标位置会影响超出部分截取的问题。[#33910](https://github.com/ant-design/ant-design/pull/33910) [@chenyizhongx](https://github.com/chenyizhongx) +- 💄 Button 对于 `type=default` 也会提供 `.ant-btn-default` 的样式类名。[#34013](https://github.com/ant-design/ant-design/pull/34013) +- 💄 优化 Menu `:focus-visible` 的样式。[#34008](https://github.com/ant-design/ant-design/pull/34008) +- 💄 修复 Pagination 和 Rate 在 Safari 下部分样式丢失的问题,比如分页按钮禁用样式失效。[#34002](https://github.com/ant-design/ant-design/pull/34002) +- 💄 修复 Row 与 Col 在配置 `prefixCls` 的样式问题。[#33969](https://github.com/ant-design/ant-design/pull/33969) [@mic-web](https://github.com/mic-web) +- 🐞 修复 Timeline 的自定义图标颜色无效的问题。[#33951](https://github.com/ant-design/ant-design/pull/33951) [@MadCcc](https://github.com/MadCcc) +- TypeScript + - 🤖 优化 Cascader `multiple` 属性对应的 `onChange` 类型推断。[#33947](https://github.com/ant-design/ant-design/pull/33947) [@babycannotsay](https://github.com/babycannotsay) + +## 4.18.6 + +`2022-02-07` + +- 🐞 修复当传入的内容参数和标题参数都为空时,Popover 仍旧会渲染空气泡的问题。[#33835](https://github.com/ant-design/ant-design/pull/33835) [@DawnLck](https://github.com/DawnLck) +- 🐞 修复 Typography `ellipsis` 行数大于 1 时 Tooltip 不显示的问题。[#33875](https://github.com/ant-design/ant-design/pull/33875) +- Button + - 🐞 修复小尺寸下 Button 组件 `block` 属性无效的问题[#33878](https://github.com/ant-design/ant-design/pull/33878) [@tangjinzhou](https://github.com/tangjinzhou) + - 🐞 修复 Button 组件 `loading.delay` 定时器未清除导致的内存泄漏警告[#33858](https://github.com/ant-design/ant-design/pull/33858) [@mrwd2009](https://github.com/mrwd2009) +- 🐞 修复 Tooltip 套在 `loading` 状态的 Switch 上时无法正常显示的问题。[#33860](https://github.com/ant-design/ant-design/pull/33860) +- 🐞 修复 Upload 组件为 `picture-card` 类型时,由隐藏上传按钮改为显示后,上传按钮有时会闪烁的问题。[#33820](https://github.com/ant-design/ant-design/pull/33820) [@credred](https://github.com/credred) +- Typescript + - 🤖 修复 DatePicker `ref` TypeScript 定义。[#33901](https://github.com/ant-design/ant-design/pull/33901) [@Amour1688](https://github.com/Amour1688) + +## 4.18.5 + +`2022-01-24` + +- Cascader + - 🐞 修复 Cascader 弹层超出屏幕时不会自动偏移以及激活选项不会自动滚动到正确位置的问题。[#33777](https://github.com/ant-design/ant-design/pull/33777) + - 💄 修复 Cascader 加载中图标。[#33799](https://github.com/ant-design/ant-design/pull/33799) +- 💄 修复 Tag 在暗黑主题下的样式。[#33751](https://github.com/ant-design/ant-design/pull/33751) +- 💄 修复 Tooltip 的子元素含有禁用态的 CheckBox 时可能引起的行为和样式异常。[#33772](https://github.com/ant-design/ant-design/pull/33772) [@boomler](https://github.com/boomler) +- ⚡️ 优化 Row 和 Layout.Sider 的 hooks 依赖数组。[#33804](https://github.com/ant-design/ant-design/pull/33804) [@mrwd2009](https://github.com/mrwd2009) +- 🐞 修复 Card `ref` 不生效的问题。[#33784](https://github.com/ant-design/ant-design/pull/33784) [@LongHaoo](https://github.com/LongHaoo) +- 🐞 修复动态修改 Checkbox 的 `value` 时 `onChange` 不能正确传入修改后的值的问题。[#33753](https://github.com/ant-design/ant-design/pull/33753) + +## 4.18.4 + +`2022-01-18` + +- Typography + - ⚡️ 优化 Typography 在配置 `tooltip` 时优先使用原生省略样式以提升性能。[#33669](https://github.com/ant-design/ant-design/pull/33669) + - 🐞 重构 Typography `ellipsis` 逻辑以修复 `children` 如果消费上游 Context 会报错的问题。 [#33725](https://github.com/ant-design/ant-design/pull/33725) +- Icon + - 🐞 修复 `` 和 `` 不对齐的问题。[#33709](https://github.com/ant-design/ant-design/pull/33709) + - 🐞 修复 `` 抖动的问题。[#33726](https://github.com/ant-design/ant-design/pull/33726) [@JX-Zhuang](https://github.com/JX-Zhuang) +- Input + - 🐞 修复 Input 相关组件设置 `hidden` 时的展示问题。[#33735](https://github.com/ant-design/ant-design/pull/33735) [@fanerge](https://github.com/fanerge),[#33706](https://github.com/ant-design/ant-design/pull/33706) [@hydraZty](https://github.com/hydraZty) + - 🐞 修复 Input 传入 `showCount` 时控制台 warning 问题。[#33686](https://github.com/ant-design/ant-design/pull/33686) [@whwangms](https://github.com/whwangms) +- ⚡️ 修复 ConfigProvider 和 Anchor 的渲染函数多次运行的问题。[#33723](https://github.com/ant-design/ant-design/pull/33723) [@mrwd2009](https://github.com/mrwd2009) +- 🐞 修复 Cascader 组件中出现重复 key 的控制台 warning 问题。[#33649](https://github.com/ant-design/ant-design/pull/33649) [@dimbslmh](https://github.com/dimbslmh) +- 🐞 Checkbox.Group 的 `options` 支持数组中直接传入 number 和 boolean 类型。[#33678](https://github.com/ant-design/ant-design/pull/33678) +- 🐞 修复 Form `validateMessages` 在多个 ConfigProvider 内错乱的问题。[#33705](https://github.com/ant-design/ant-design/pull/33705) +- 🐞 修复 Steps 组件在 `type` 为 navigation 和 `labelPlacement` 为 vertical 时,tail 部分不会显示的问题。[#33716](https://github.com/ant-design/ant-design/pull/33716) [@toSayNothing](https://github.com/toSayNothing) +- 🐞 修复 Image 底部留白问题。[#33631](https://github.com/ant-design/ant-design/pull/33631) [@fanerge](https://github.com/fanerge) +- 🐞 修复 TreeSelect 键盘操作时,激活项不会高亮的问题。[#33755](https://github.com/ant-design/ant-design/pull/33755) +- 🇰🇭 修正高棉语 (km_KH) 语言包中部分翻译。[#33738](https://github.com/ant-design/ant-design/pull/33738) [@vireakkeosokvibol](https://github.com/vireakkeosokvibol) + ## 4.18.3 `2022-01-10` diff --git a/README.md b/README.md index a7ad23471ba6..98afad9aa698 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ ### Infra Design -Based on [Infra Design](https://github.com/ant-design/ant-design) +Based on [Ant Design](https://github.com/ant-design/ant-design) diff --git a/components/_util/motion.tsx b/components/_util/motion.tsx index 1c69a9f05a11..edac9ccda166 100644 --- a/components/_util/motion.tsx +++ b/components/_util/motion.tsx @@ -1,5 +1,6 @@ import { CSSMotionProps, MotionEventHandler, MotionEndEventHandler } from 'rc-motion'; import { MotionEvent } from 'rc-motion/lib/interface'; +import { tuple } from './type'; // ================== Collapse Motion ================== const getCollapsedHeight: MotionEventHandler = () => ({ height: 0, opacity: 0 }); @@ -25,11 +26,21 @@ const collapseMotion: CSSMotionProps = { motionDeadline: 500, }; +const SelectPlacements = tuple('bottomLeft', 'bottomRight', 'topLeft', 'topRight'); +export type SelectCommonPlacement = typeof SelectPlacements[number]; + +const getTransitionDirection = (placement: SelectCommonPlacement | undefined) => { + if (placement !== undefined && (placement === 'topLeft' || placement === 'topRight')) { + return `slide-down`; + } + return `slide-up`; +}; + const getTransitionName = (rootPrefixCls: string, motion: string, transitionName?: string) => { if (transitionName !== undefined) { return transitionName; } return `${rootPrefixCls}-${motion}`; }; -export { getTransitionName }; +export { getTransitionName, getTransitionDirection }; export default collapseMotion; diff --git a/components/tooltip/placements.tsx b/components/_util/placements.tsx similarity index 97% rename from components/tooltip/placements.tsx rename to components/_util/placements.tsx index 3fc9152268ce..eb4dead8a872 100644 --- a/components/tooltip/placements.tsx +++ b/components/_util/placements.tsx @@ -42,6 +42,7 @@ export default function getPlacements(config: PlacementsConfig) { horizontalArrowShift = 16, verticalArrowShift = 8, autoAdjustOverflow, + arrowPointAtCenter, } = config; const placementMap: BuildInPlacements = { left: { @@ -94,7 +95,7 @@ export default function getPlacements(config: PlacementsConfig) { }, }; Object.keys(placementMap).forEach(key => { - placementMap[key] = config.arrowPointAtCenter + placementMap[key] = arrowPointAtCenter ? { ...placementMap[key], overflow: getOverflowOptions(autoAdjustOverflow), diff --git a/components/_util/statusUtils.tsx b/components/_util/statusUtils.tsx new file mode 100644 index 000000000000..25153ba93fdc --- /dev/null +++ b/components/_util/statusUtils.tsx @@ -0,0 +1,44 @@ +import React from 'react'; +import CheckCircleFilled from '@ant-design/icons/CheckCircleFilled'; +import ExclamationCircleFilled from '@ant-design/icons/ExclamationCircleFilled'; +import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled'; +import LoadingOutlined from '@ant-design/icons/LoadingOutlined'; +import classNames from 'classnames'; +import { ValidateStatus } from '../form/FormItem'; +import { tuple } from './type'; + +const InputStatuses = tuple('warning', 'error', ''); +export type InputStatus = typeof InputStatuses[number]; + +const iconMap = { + success: CheckCircleFilled, + warning: ExclamationCircleFilled, + error: CloseCircleFilled, + validating: LoadingOutlined, +}; + +export const getFeedbackIcon = (prefixCls: string, status?: ValidateStatus) => { + const IconNode = status && iconMap[status]; + return IconNode ? ( + + + + ) : null; +}; + +export function getStatusClassNames( + prefixCls: string, + status?: ValidateStatus, + hasFeedback?: boolean, +) { + return classNames({ + [`${prefixCls}-status-success`]: status === 'success', + [`${prefixCls}-status-warning`]: status === 'warning', + [`${prefixCls}-status-error`]: status === 'error', + [`${prefixCls}-status-validating`]: status === 'validating', + [`${prefixCls}-has-feedback`]: hasFeedback, + }); +} + +export const getMergedStatus = (contextStatus?: ValidateStatus, customStatus?: InputStatus) => + customStatus || contextStatus; diff --git a/components/affix/__tests__/Affix.test.tsx b/components/affix/__tests__/Affix.test.tsx index e67833cbbb8d..5c47a383f47b 100644 --- a/components/affix/__tests__/Affix.test.tsx +++ b/components/affix/__tests__/Affix.test.tsx @@ -17,7 +17,7 @@ class AffixMounter extends React.Component<{ }> { private container: HTMLDivElement; - public affix: Affix; + public affix: React.Component; componentDidMount() { this.container.addEventListener = jest @@ -58,7 +58,7 @@ describe('Affix Render', () => { const domMock = jest.spyOn(HTMLElement.prototype, 'getBoundingClientRect'); let affixMounterWrapper: ReactWrapper; - let affixWrapper: ReactWrapper; + let affixWrapper: ReactWrapper>; const classRect: Record = { container: { @@ -157,9 +157,9 @@ describe('Affix Render', () => { const getTarget = () => container; affixWrapper = mount({null}); affixWrapper.setProps({ target: () => null }); - expect(affixWrapper.instance().state.status).toBe(0); - expect(affixWrapper.instance().state.affixStyle).toBe(undefined); - expect(affixWrapper.instance().state.placeholderStyle).toBe(undefined); + expect(affixWrapper.find('Affix').last().state().status).toBe(0); + expect(affixWrapper.find('Affix').last().state().affixStyle).toBe(undefined); + expect(affixWrapper.find('Affix').last().state().placeholderStyle).toBe(undefined); }); it('instance change', async () => { diff --git a/components/affix/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/affix/__tests__/__snapshots__/demo-extend.test.ts.snap index 82f95baa2dff..a77adba2535f 100644 --- a/components/affix/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/affix/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -71,7 +71,7 @@ exports[`renders ./components/affix/demo/on-change.md extend context correctly 1 class="" > , , , , , , , , , ,
, , ,
, , , , , ,
, , , ,
, , , , , , , , ,
, , ,
, , , , , , , ,
,
, , , , , , ,
, , , , , + + {visible && + +
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + +
+ Su + + Mo + + Tu + + We + + Th + + Fr + + Sa +
+
+ 30 +
+
- - - - - -
+ 1 +
+
- - +
- 2016 - -
-
- - - - - - -
- + 5 + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
-
- Su - - Mo - - Tu - - We - - Th - - Fr - - Sa -
-
+ 6 +
+
+
+ 7 +
+
+
+ 8 +
+
+
+ 9 +
+
+
+ 10 +
+
+
+ 11 +
+
+
+ 12 +
+
+
+ 13 +
+
+
+ 14 +
+
+
+ 15 +
+
+
+ 16 +
+
+
+ 17 +
+
+
+ 18 +
+
+
+ 19 +
+
+
+ 20 +
+
+
+ 21 +
+
+
+ 22 +
+
+
+ 23 +
+
+
+ 24 +
+
+
+ 25 +
+
+
+ 26 +
+
+
+ 27 +
+
+
+ 28 +
+
+
+ 29 +
+
+
+ 30 +
+
+
+ 1 +
+
+
+ 2 +
+
+
+ 3 +
+
+
+ 4 +
+
+
+ 5 +
+
+
+ 6 +
+
+
+ 7 +
+
+
+ 8 +
+
+
+ 9 +
+
+
+ 10 +
+
+
+ + + + + + , +
, +
, +
+
+ +
+
+ + + + + +
+
+ +
+
+ + + + + +
, +
+
+
+
+
+
+
+
+
+ + +
+ + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Su + + Mo + + Tu + + We + + Th + + Fr + + Sa +
+
+ 30 +
+
+
+ 31 +
+
+
+ 1 +
+
+
+ 2 +
+
+
+ 3 +
+
+
+ 4 +
+
+
+ 5 +
+
+
+ 6 +
+
+
+ 7 +
+
+
+ 8 +
+
+
+ 9 +
+
+
+ 10 +
+
+
+ 11 +
+
+
+ 12 +
+
+
+ 13 +
+
+
+ 14 +
+
+
+ 15 +
+
+
+ 16 +
+
+
+ 17 +
+
+
+ 18 +
+
+
+ 19 +
+
+
+ 20 +
+
+
+ 21 +
+
+
+ 22 +
+
+
+ 23 +
+
+
+ 24 +
+
+
+ 25 +
+
+
+ 26 +
+
+
+ 27 +
+
+
+ 28 +
+
+
+ 29 +
+
+
+ 30 +
+
+
+ 1 +
+
+
+ 2 +
+
+
+ 3 +
+
+
+ 4 +
+
+
+ 5 +
+
+
+ 6 +
+
+
+ 7 +
+
+
+ 8 +
+
+
+ 9 +
+
+
+ 10 +
+
+
+
+
+
+
+
+ + +
+ + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Su + + Mo + + Tu + + We + + Th + + Fr + + Sa +
+
+ 27 +
+
+
+ 28 +
+
+
+ 29 +
+
+
+ 30 +
+
+
+ 1 +
+
+
+ 2 +
+
+
+ 3 +
+
+
+ 4 +
+
+
+ 5 +
+
+
+ 6 +
+
+
+ 7 +
+
+
+ 8 +
+
+
+ 9 +
+
+
+ 10 +
+
+
+ 11 +
+
+
+ 12 +
+
+
+ 13 +
+
+
+ 14 +
+
+
+ 15 +
+
+
+ 16 +
+
+
+ 17 +
+
+
+ 18 +
+
+
+ 19 +
+
+
+ 20 +
+
+
+ 21 +
+
+
+ 22 +
+
+
+ 23 +
+
+
+ 24 +
+
+
+ 25 +
+
+
+ 26 +
+
+
+ 27 +
+
+
+ 28 +
+
+
+ 29 +
+
+
+ 30 +
+
+
+ 31 +
+
+
+ 1 +
+
+
+ 2 +
+
+
+ 3 +
+
+
+ 4 +
+
+
+ 5 +
+
+
+ 6 +
+
+
+ 7 +
+
+
+
+
+
+
+
+
+
, +] +`; + +exports[`renders ./components/date-picker/demo/presetted-ranges.md extend context correctly 1`] = ` +
+
+
+
+ +
+
+ + + + + +
+
+ +
+
+ + + + + +
+
+
+
+
+
+
+
+
+
+ + +
+ + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -35500,76 +37598,76 @@ exports[`renders ./components/date-picker/demo/range-picker.md extend context co @@ -35579,155 +37677,262 @@ exports[`renders ./components/date-picker/demo/range-picker.md extend context co + +
+ Su + + Mo + + Tu + + We + + Th + + Fr + + Sa +
+
30
@@ -35490,7 +37351,244 @@ exports[`renders ./components/date-picker/demo/range-picker.md extend context co
- 5 + 5 +
+
+ 46 + +
+ 6 +
+
+
+ 7 +
+
+
+ 8 +
+
+
+ 9 +
+
+
+ 10 +
+
+
+ 11 +
+
+
+ 12 +
+
+ 47 + +
+ 13 +
+
+
+ 14 +
+
+
+ 15 +
+
+
+ 16 +
+
+
+ 17 +
+
+
+ 18 +
+
+
+ 19 +
+
+ 48 + +
+ 20 +
+
+
+ 21 +
+
+
+ 22 +
+
+
+ 23 +
+
+
+ 24 +
+
+
+ 25 +
+
+
+ 26
- 46 + 49
- 6 + 27
- 7 + 28
- 8 + 29
- 9 + 30
- 10 + 1
- 11 + 2
- 12 + 3
- 47 + 50
- 13 + 4
- 14 + 5
- 15 + 6
- 16 + 7
- 17 + 8
- 18 + 9
- 19 + 10
+
+
+
+
+
+
+ + +
+ + +
+ + +
+
+ + + + + + + + + + + + + @@ -35737,76 +37942,76 @@ exports[`renders ./components/date-picker/demo/range-picker.md extend context co @@ -35816,262 +38021,155 @@ exports[`renders ./components/date-picker/demo/range-picker.md extend context co - -
+ + Su + + Mo + + Tu + + We + + Th + + Fr + + Sa +
- 48 + 49
- 20 + 27
- 21 + 28
- 22 + 29
- 23 + 30
- 24 + 1
- 25 + 2
- 26 + 3
- 49 + 50
- 27 + 4
- 28 + 5
- 29 + 6
- 30 + 7
- 1 + 8
- 2 + 9
- 3 + 10
- 50 + 51
- 4 + 11
- 5 + 12
- 6 + 13
- 7 + 14
- 8 + 15
- 9 + 16
- 10 + 17
-
-
-
-
-
-
- - -
- - -
- - -
-
- - - - - - - - - - - - - @@ -36081,392 +38179,626 @@ exports[`renders ./components/date-picker/demo/range-picker.md extend context co + + + + + - - - + + +
- - Su - - Mo - - Tu - - We - - Th - - Fr - - Sa -
- 49 + 52
- 27 + 18
- 28 + 19
- 29 + 20
- 30 + 21
- 1 + 22
- 2 + 23
- 3 + 24
- 50 + 53
- 4 + 25
- 5 + 26
- 6 + 27
- 7 + 28
- 8 + 29
+
+ 30 +
+
+
+ 31 +
+
+ 1 +
- 9 + 1
- 10 + 2
- 51 -
- 11 + 3
- 12 + 4
- 13 + 5
- 14 + 6
- 15 + 7
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ + + + + +
+
+ +
+
+ + + + + +
+
+
+
+
+
+
+
+
+
+ +
+ +
+ +
+
+ + + - - - + + + + - - + + + +
- 16 + Jan
- 17 + Feb
- 52 -
- 18 + Mar
- 19 + Apr
- 20 + May
- 21 + Jun
- 22 + Jul
- 23 + Aug
- 24 + Sep
- 53 -
- 25 + Oct
- 26 + Nov
- 27 + Dec
+
+
+
+
+
+
+ +
+ +
+ +
+
+ + + + + - - + + + + @@ -36493,7 +38825,7 @@ exports[`renders ./components/date-picker/demo/range-picker.md extend context co >
-
-
- 28 + Jan
- 29 + Feb
- 30 + Mar
- 31 + Apr
- 1 +
+ May +
- 1 + Jun
- 2 + Jul
- 3 + Aug
- 4 + Sep
- 5 + Oct
- 6 + Nov
- 7 + Dec
- - - - - - - - - - - - - - +
+
-
- Jan -
-
-
- Feb -
-
-
- Mar -
-
-
- Apr -
-
-
- May -
-
-
- Jun -
-
-
- Jul -
-
-
- Aug -
-
+ + - - @@ -36771,7 +39017,7 @@ exports[`renders ./components/date-picker/demo/range-picker.md extend context co tabindex="-1" >
- - - - - - - - - - - - - - @@ -43880,12 +46040,778 @@ exports[`renders ./components/date-picker/demo/start-end.md extend context corre
-   -
- -
+   +
+ +
+
    +
  • +
    + 00 +
    +
  • +
  • +
    + 01 +
    +
  • +
  • +
    + 02 +
    +
  • +
  • +
    + 03 +
    +
  • +
  • +
    + 04 +
    +
  • +
  • +
    + 05 +
    +
  • +
  • +
    + 06 +
    +
  • +
  • +
    + 07 +
    +
  • +
  • +
    + 08 +
    +
  • +
  • +
    + 09 +
    +
  • +
  • +
    + 10 +
    +
  • +
  • +
    + 11 +
    +
  • +
  • +
    + 12 +
    +
  • +
  • +
    + 13 +
    +
  • +
  • +
    + 14 +
    +
  • +
  • +
    + 15 +
    +
  • +
  • +
    + 16 +
    +
  • +
  • +
    + 17 +
    +
  • +
  • +
    + 18 +
    +
  • +
  • +
    + 19 +
    +
  • +
  • +
    + 20 +
    +
  • +
  • +
    + 21 +
    +
  • +
  • +
    + 22 +
    +
  • +
  • +
    + 23 +
    +
  • +
+
    +
  • +
    + 00 +
    +
  • +
  • +
    + 01 +
    +
  • +
  • +
    + 02 +
    +
  • +
  • +
    + 03 +
    +
  • +
  • +
    + 04 +
    +
  • +
  • +
    + 05 +
    +
  • +
  • +
    + 06 +
    +
  • +
  • +
    + 07 +
    +
  • +
  • +
    + 08 +
    +
  • +
  • +
    + 09 +
    +
  • +
  • +
    + 10 +
    +
  • +
  • +
    + 11 +
    +
  • +
  • +
    + 12 +
    +
  • +
  • +
    + 13 +
    +
  • +
  • +
    + 14 +
    +
  • +
  • +
    + 15 +
    +
  • +
  • +
    + 16 +
    +
  • +
  • +
    + 17 +
    +
  • +
  • +
    + 18 +
    +
  • +
  • +
    + 19 +
    +
  • +
  • +
    + 20 +
    +
  • +
  • +
    + 21 +
    +
  • +
  • +
    + 22 +
    +
  • +
  • +
    + 23 +
    +
  • +
  • +
    + 24 +
    +
  • +
  • +
    + 25 +
    +
  • +
  • +
    + 26 +
    +
  • +
  • +
    + 27 +
    +
  • +
  • +
    + 28 +
    +
  • +
  • +
    + 29 +
    +
  • +
  • +
    + 30 +
    +
  • +
  • +
    + 31 +
    +
  • +
  • +
    + 32 +
    +
  • +
  • +
    + 33 +
    +
  • +
  • +
    + 34 +
    +
  • +
  • +
    + 35 +
    +
  • +
  • +
    + 36 +
    +
  • +
  • +
    + 37 +
    +
  • +
  • +
    + 38 +
    +
  • +
  • +
    + 39 +
    +
  • +
  • +
    + 40 +
    +
  • +
  • +
    + 41 +
    +
  • +
  • +
    + 42 +
    +
  • +
  • +
    + 43 +
    +
  • +
  • +
    + 44 +
    +
  • +
  • +
    + 45 +
    +
  • +
  • +
    + 46 +
    +
  • +
  • +
    + 47 +
    +
  • +
  • +
    + 48 +
    +
  • +
  • +
    + 49 +
    +
  • +
  • +
    + 50 +
    +
  • +
  • +
    + 51 +
    +
  • +
  • +
    + 52 +
    +
  • +
  • +
    + 53 +
    +
  • +
  • +
    + 54 +
    +
  • +
  • +
    + 55 +
    +
  • +
  • +
    + 56 +
    +
  • +
  • +
    + 57 +
    +
  • +
  • +
    + 58 +
    +
  • +
  • +
    + 59 +
    +
  • +
    -
-
    -
  • -
    - 00 -
    -
  • - 01 + 24
  • - 02 + 25
  • - 03 + 26
  • - 04 + 27
  • - 05 + 28
  • - 06 + 29
  • - 07 + 30
  • - 08 + 31
  • - 09 + 32
  • - 10 + 33
  • - 11 + 34
  • - 12 + 35
  • - 13 + 36
  • - 14 + 37
  • - 15 + 38
  • - 16 + 39
  • - 17 + 40
  • - 18 + 41
  • - 19 + 42
  • - 20 + 43
  • - 21 + 44
  • - 22 + 45
  • - 23 + 46
  • - 24 + 47
  • - 25 + 48
  • - 26 + 49
  • - 27 + 50
  • - 28 + 51
  • - 29 + 52
  • - 30 + 53
  • - 31 + 54
  • - 32 + 55
  • - 33 + 56
  • - 34 + 57
  • - 35 + 58
  • - 36 + 59
  • -
  • -
    +
    + + + + + + + + + +`; + +exports[`renders ./components/date-picker/demo/status.md extend context correctly 1`] = ` +
    +
    +
    +
    + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    + + +
    + + +
    + + +
    +
    +
  • - Sep + Q1
    - Oct + Q2
    - Nov + Q3
    - Dec + Q4
    -
    - Jan -
    -
    -
    - Feb -
    -
    -
    - Mar -
    -
    -
    - Apr -
    -
    -
    - May -
    -
    -
    - Jun -
    -
    -
    - Jul -
    -
    -
    - Aug -
    -
    - Sep + Q1
    - Oct + Q2
    - Nov + Q3
    - Dec + Q4
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Su + + Mo + + Tu + + We + + Th + + Fr + + Sa +
    - 37 - - -
  • -
    + 30 +
    +
  • - 38 - - -
  • -
    + 31 +
    +
  • - 39 - - -
  • -
    + 1 +
    +
  • - 40 - - -
  • -
    + 2 +
    +
  • - 41 - - -
  • -
    + 3 +
    +
  • - 42 - - -
  • -
    + 4 +
    +
  • - 43 - - -
  • -
    + 5 +
    +
  • - 44 - - -
  • -
    + 6 +
    +
  • - 45 - - -
  • -
    + 7 +
    +
  • - 46 - - -
  • -
    + 8 +
    +
  • - 47 - - -
  • -
    + 9 +
    +
  • - 48 - - -
  • -
    + 10 +
    +
  • - 49 - - -
  • -
    + 11 +
    +
  • - 50 - - -
  • -
    + 12 +
    +
  • - 51 - - -
  • -
    + 13 +
    +
  • - 52 - - -
  • -
    + 14 +
    +
  • - 53 - - -
  • -
    + 15 +
    +
  • - 54 - - -
  • -
    + 16 +
    +
  • - 55 - - -
  • -
    + 17 +
    +
  • - 56 - - -
  • -
    + 18 +
    +
  • - 57 - - -
  • -
    + 19 +
    +
  • - 58 - - -
  • -
    + 20 +
    +
  • - 59 - - - -
      -
    • -
      + 21 +
      +
    - 00 - - -
  • -
    + 22 +
    +
  • - 01 - - -
  • -
    + 23 +
    +
  • - 02 - - -
  • -
    + 24 +
    +
  • - 03 - - -
  • -
    + 25 +
    +
  • - 04 - - -
  • -
    + 26 +
    +
  • - 05 - - -
  • -
    + 27 +
    +
  • - 06 - - -
  • -
    + 28 +
    +
  • - 07 - - -
  • -
    + 29 +
    +
  • - 08 - - -
  • -
    + 30 +
    +
  • - 09 - - -
  • -
    + 1 +
    +
  • - 10 - - -
  • -
    + 2 +
    +
  • - 11 - - -
  • -
    + 3 +
    +
  • +
    + 4 +
    +
    - 12 - - -
  • -
    + 5 +
    +
  • - 13 - - -
  • -
    + 6 +
    +
  • - 14 - - -
  • -
    + 7 +
    +
  • - 15 - - -
  • -
    + 8 +
    +
  • - 16 - - -
  • -
    + 9 +
    +
  • - 17 - - -
  • -
    + 10 +
    +
  • +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + +
    +
    +
    +
    +
    +
    +
    +
    + + +
    + + +
    + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Su + + Mo + + Tu + + We + + Th + + Fr + + Sa +
    - 18 - - -
  • -
    + 30 +
    +
  • - 19 - - -
  • -
    + 31 +
    +
  • - 20 - - -
  • -
    + 1 +
    +
  • - 21 - - -
  • -
    + 2 +
    +
  • - 22 - - -
  • -
    + 3 +
    +
  • - 23 - - -
  • -
    + 4 +
    +
  • - 24 - - -
  • -
    + 5 +
    +
  • - 25 - - -
  • -
    + 6 +
    +
  • - 26 - - -
  • -
    + 7 +
    +
  • - 27 - - -
  • -
    + 8 +
    +
  • - 28 - - -
  • -
    + 9 +
    +
  • - 29 - - -
  • -
    + 10 +
    +
  • - 30 - - -
  • -
    + 11 +
    +
  • - 31 - - -
  • -
    + 12 +
    +
  • - 32 - - -
  • -
    + 13 +
    +
  • - 33 - - -
  • -
    + 14 +
    +
  • - 34 - - -
  • -
    + 15 +
    +
  • - 35 - - -
  • -
    + 16 +
    +
  • - 36 - - -
  • -
    + 17 +
    +
  • - 37 - - -
  • -
    + 18 +
    +
  • - 38 - - -
  • -
    + 19 +
    +
  • - 39 - - -
  • -
    + 20 +
    +
  • - 40 - - -
  • -
    + 21 +
    +
  • - 41 - - -
  • -
    + 22 +
    +
  • - 42 - - -
  • -
    + 23 +
    +
  • - 43 - - -
  • -
    + 24 +
    +
  • - 44 - - -
  • -
    + 25 +
    +
  • - 45 - - -
  • -
    + 26 +
    +
  • - 46 - - -
  • -
    + 27 +
    +
  • - 47 - - -
  • -
    + 28 +
    +
  • - 48 - - -
  • -
    + 29 +
    +
  • - 49 - - -
  • -
    + 30 +
    +
  • - 50 - - -
  • -
    + 1 +
    +
  • - 51 - - -
  • -
    + 2 +
    +
  • - 52 - - -
  • -
    + 3 +
    +
  • - 53 - - -
  • -
    + 4 +
    +
  • - 54 - - -
  • -
    + 5 +
    +
  • - 55 - - -
  • -
    + 6 +
    +
  • - 56 - - -
  • -
    + 7 +
    +
  • - 57 - - -
  • -
    + 8 +
    +
  • - 58 - - -
  • -
    + 9 +
    +
  • - 59 - - - - +
    + 10 +
    +
    diff --git a/components/date-picker/__tests__/__snapshots__/demo.test.js.snap b/components/date-picker/__tests__/__snapshots__/demo.test.js.snap index a8c220b6cb43..6e0dc91b0fc2 100644 --- a/components/date-picker/__tests__/__snapshots__/demo.test.js.snap +++ b/components/date-picker/__tests__/__snapshots__/demo.test.js.snap @@ -2349,6 +2349,216 @@ exports[`renders ./components/date-picker/demo/mode.md correctly 1`] = `
    `; +exports[`renders ./components/date-picker/demo/placement.md correctly 1`] = ` +Array [ +
    + + + + +
    , +
    , +
    , +
    +
    + + + + + + +
    +
    , +
    , +
    , +
    +
    + +
    +
    + + + + + +
    +
    + +
    +
    + + + + + +
    , +] +`; + exports[`renders ./components/date-picker/demo/presetted-ranges.md correctly 1`] = `
    +
    +
    +
    + +
    +
    + + + + + +
    +
    + +
    +
    + + + + + +
    +
    @@ -3432,6 +3728,103 @@ exports[`renders ./components/date-picker/demo/start-end.md correctly 1`] = `
    `; +exports[`renders ./components/date-picker/demo/status.md correctly 1`] = ` +
    +
    +
    +
    + + + + + + +
    +
    +
    +
    +
    +
    + + + + + + +
    +
    +
    +
    +`; + exports[`renders ./components/date-picker/demo/suffix.md correctly 1`] = `
    { it('DatePicker ref methods', () => { @@ -13,6 +15,23 @@ describe('DatePicker.typescript', () => { ); expect(datePicker).toBeTruthy(); }); + + // https://github.com/ant-design/ant-design/issues/33417 + it('DatePicker ref methods with forwardRef', () => { + const MyDatePicker = React.forwardRef((props, ref: DatePickRef) => ( + + )); + const datePicker = ( + { + picker?.focus(); + picker?.blur(); + }} + /> + ); + expect(datePicker).toBeTruthy(); + }); + it('RangePicker ref methods', () => { const rangePicker = ( { ); expect(rangePicker).toBeTruthy(); }); + + it('RangePicker ref methods with forwardRef', () => { + const MyRangePicker = React.forwardRef((props, ref: RangePickerRef) => ( + + )); + const datePicker = ( + { + picker?.focus(); + picker?.blur(); + }} + /> + ); + expect(datePicker).toBeTruthy(); + }); }); diff --git a/components/date-picker/demo/placement.md b/components/date-picker/demo/placement.md new file mode 100644 index 000000000000..b878b80cf830 --- /dev/null +++ b/components/date-picker/demo/placement.md @@ -0,0 +1,47 @@ +--- +order: 28 +title: + zh-CN: 基本 + en-US: Basic +--- + +## zh-CN + +可以通过 `placement` 手动指定弹出的位置。 + +## en-US + +You can manually specify the position of the popup via `placement`. + +```jsx +import { DatePicker, Space, Radio } from 'infrad'; + +const { RangePicker } = DatePicker; + +const SetPlacementDemo = () => { + const [placement, SetPlacement] = React.useState('topLeft'); + + const placementChange = e => { + SetPlacement(e.target.value); + }; + + return ( + <> + + topLeft + topRight + bottomLeft + bottomRight + +
    +
    + +
    +
    + + + ); +}; + +ReactDOM.render(, mountNode); +``` diff --git a/components/date-picker/demo/range-picker.md b/components/date-picker/demo/range-picker.md index 67ea108c6c88..7e7f09f6141a 100644 --- a/components/date-picker/demo/range-picker.md +++ b/components/date-picker/demo/range-picker.md @@ -24,6 +24,7 @@ ReactDOM.render( + , mountNode, diff --git a/components/date-picker/demo/status.md b/components/date-picker/demo/status.md new file mode 100644 index 000000000000..7a75ecd7bafa --- /dev/null +++ b/components/date-picker/demo/status.md @@ -0,0 +1,28 @@ +--- +order: 19 +version: 4.19.0 +title: + zh-CN: 自定义状态 + en-US: Status +--- + +## zh-CN + +使用 `status` 为 DatePicker 添加状态,可选 `error` 或者 `warning`。 + +## en-US + +Add status to DatePicker with `status`, which could be `error` or `warning`. + +```tsx +import { DatePicker, Space } from 'infrad'; + +const Status: React.FC = () => ( + + + + +); + +ReactDOM.render(, mountNode); +``` diff --git a/components/date-picker/generatePicker/generateRangePicker.tsx b/components/date-picker/generatePicker/generateRangePicker.tsx index ad3cb8e25b0d..b22466ffa80a 100644 --- a/components/date-picker/generatePicker/generateRangePicker.tsx +++ b/components/date-picker/generatePicker/generateRangePicker.tsx @@ -12,7 +12,7 @@ import enUS from '../locale/en_US'; import { ConfigContext, ConfigConsumerProps } from '../../config-provider'; import SizeContext from '../../config-provider/SizeContext'; import LocaleReceiver from '../../locale-provider/LocaleReceiver'; -import { getRangePlaceholder } from '../util'; +import { getRangePlaceholder, transPlacement2DropdownAlign } from '../util'; import { RangePickerProps, PickerLocale, getTimeProps, Components } from '.'; import { PickerComponentClass } from './interface'; @@ -45,6 +45,7 @@ export default function generateRangePicker( prefixCls: customizePrefixCls, getPopupContainer: customGetPopupContainer, className, + placement, size: customizeSize, bordered = true, placeholder, @@ -75,6 +76,7 @@ export default function generateRangePicker( } ref={this.pickerRef} + dropdownAlign={transPlacement2DropdownAlign(direction, placement)} placeholder={getRangePlaceholder(picker, locale, placeholder)} suffixIcon={picker === 'time' ? : } clearIcon={} diff --git a/components/date-picker/generatePicker/generateSinglePicker.tsx b/components/date-picker/generatePicker/generateSinglePicker.tsx index d86f254201c6..2a8e13e2a4d7 100644 --- a/components/date-picker/generatePicker/generateSinglePicker.tsx +++ b/components/date-picker/generatePicker/generateSinglePicker.tsx @@ -5,7 +5,7 @@ import RCPicker from 'rc-picker'; import { PickerMode } from 'rc-picker/lib/interface'; import { GenerateConfig } from 'rc-picker/lib/generate/index'; import enUS from '../locale/en_US'; -import { getPlaceholder } from '../util'; +import { getPlaceholder, transPlacement2DropdownAlign } from '../util'; import devWarning from '../../_util/devWarning'; import { ConfigContext, ConfigConsumerProps } from '../../config-provider'; import LocaleReceiver from '../../locale-provider/LocaleReceiver'; @@ -19,9 +19,18 @@ import { Components, } from '.'; import { PickerComponentClass } from './interface'; +import { FormItemStatusContext } from '../../form/context'; +import { + getFeedbackIcon, + getMergedStatus, + getStatusClassNames, + InputStatus, +} from '../../_util/statusUtils'; export default function generatePicker(generateConfig: GenerateConfig) { - type DatePickerProps = PickerProps; + type DatePickerProps = PickerProps & { + status?: InputStatus; + }; function getPicker( picker?: PickerMode, @@ -57,6 +66,23 @@ export default function generatePicker(generateConfig: GenerateConfig< } }; + renderFeedback = (prefixCls: string) => ( + + {({ hasFeedback, status: contextStatus }) => { + const { status: customStatus } = this.props; + const status = getMergedStatus(contextStatus, customStatus); + return hasFeedback && getFeedbackIcon(prefixCls, status); + }} + + ); + + renderSuffix = (prefixCls: string, mergedPicker?: PickerMode) => ( + <> + {mergedPicker === 'time' ? : } + {this.renderFeedback(prefixCls)} + + ); + renderPicker = (contextLocale: PickerLocale) => { const locale = { ...contextLocale, ...this.props.locale }; const { getPrefixCls, direction, getPopupContainer } = this.context; @@ -66,7 +92,9 @@ export default function generatePicker(generateConfig: GenerateConfig< className, size: customizeSize, bordered = true, + placement, placeholder, + status: customStatus, ...restProps } = this.props; const { format, showTime } = this.props as any; @@ -97,36 +125,44 @@ export default function generatePicker(generateConfig: GenerateConfig< const mergedSize = customizeSize || size; return ( - - ref={this.pickerRef} - placeholder={getPlaceholder(mergedPicker, locale, placeholder)} - suffixIcon={ - mergedPicker === 'time' ? : - } - clearIcon={} - prevIcon={} - nextIcon={} - superPrevIcon={} - superNextIcon={} - allowClear - transitionName={`${rootPrefixCls}-slide-up`} - {...additionalProps} - {...restProps} - {...additionalOverrideProps} - locale={locale!.lang} - className={classNames( - { - [`${prefixCls}-${mergedSize}`]: mergedSize, - [`${prefixCls}-borderless`]: !bordered, - }, - className, + + {({ hasFeedback, status: contextStatus }) => ( + + ref={this.pickerRef} + placeholder={getPlaceholder(mergedPicker, locale, placeholder)} + suffixIcon={this.renderSuffix(prefixCls, mergedPicker)} + dropdownAlign={transPlacement2DropdownAlign(direction, placement)} + clearIcon={} + prevIcon={} + nextIcon={} + superPrevIcon={} + superNextIcon={} + allowClear + transitionName={`${rootPrefixCls}-slide-up`} + {...additionalProps} + {...restProps} + {...additionalOverrideProps} + locale={locale!.lang} + className={classNames( + { + [`${prefixCls}-${mergedSize}`]: mergedSize, + [`${prefixCls}-borderless`]: !bordered, + }, + getStatusClassNames( + prefixCls, + getMergedStatus(contextStatus, customStatus), + hasFeedback, + ), + className, + )} + prefixCls={prefixCls} + getPopupContainer={customizeGetPopupContainer || getPopupContainer} + generateConfig={generateConfig} + components={Components} + direction={direction} + /> )} - prefixCls={prefixCls} - getPopupContainer={customizeGetPopupContainer || getPopupContainer} - generateConfig={generateConfig} - components={Components} - direction={direction} - /> + ); }} diff --git a/components/date-picker/generatePicker/index.tsx b/components/date-picker/generatePicker/index.tsx index adf7476f5b10..f6341c972408 100644 --- a/components/date-picker/generatePicker/index.tsx +++ b/components/date-picker/generatePicker/index.tsx @@ -19,6 +19,7 @@ import { TimePickerLocale } from '../../time-picker'; import generateSinglePicker from './generateSinglePicker'; import generateRangePicker from './generateRangePicker'; import { QuickPicker, IQuickDatePicker } from './QuickPicker'; +import { tuple } from '../../_util/type'; export const Components = { button: PickerButton, rangeItem: PickerTag }; @@ -29,13 +30,18 @@ function toArray(list: T | T[]): T[] { return Array.isArray(list) ? list : [list]; } -export function getTimeProps( - props: { format?: string; picker?: PickerMode } & SharedTimeProps, +export function getTimeProps( + props: { format?: string; picker?: PickerMode } & Omit< + SharedTimeProps, + 'disabledTime' + > & { + disabledTime?: DisabledTime; + }, ) { const { format, picker, showHour, showMinute, showSecond, use12Hours } = props; const firstFormat = toArray(format)[0]; - const showTimeObj: SharedTimeProps = { ...props }; + const showTimeObj = { ...props }; if (firstFormat && typeof firstFormat === 'string') { if (!firstFormat.includes('s') && showSecond === undefined) { @@ -66,6 +72,8 @@ export function getTimeProps( showTime: showTimeObj, }; } +const DataPickerPlacements = tuple('bottomLeft', 'bottomRight', 'topLeft', 'topRight'); +type DataPickerPlacement = typeof DataPickerPlacements[number]; type InjectDefaultProps = Omit< Props, @@ -73,6 +81,7 @@ type InjectDefaultProps = Omit< > & { locale?: PickerLocale; size?: SizeType; + placement?: DataPickerPlacement; bordered?: boolean; }; @@ -95,6 +104,7 @@ export type AdditionalPickerLocaleLangProps = { monthPlaceholder?: string; weekPlaceholder?: string; rangeYearPlaceholder?: [string, string]; + rangeQuarterPlaceholder?: [string, string]; rangeMonthPlaceholder?: [string, string]; rangeWeekPlaceholder?: [string, string]; rangePlaceholder?: [string, string]; diff --git a/components/date-picker/generatePicker/interface.tsx b/components/date-picker/generatePicker/interface.tsx index 2daf343d66a0..c0771f2e0cac 100644 --- a/components/date-picker/generatePicker/interface.tsx +++ b/components/date-picker/generatePicker/interface.tsx @@ -1,4 +1,5 @@ -import { ComponentClass } from 'react'; +import type { ComponentClass, ForwardedRef, Component } from 'react'; +import { PickerProps, RangePickerProps } from '.'; export interface CommonPickerMethods { focus: () => void; @@ -9,3 +10,9 @@ export interface PickerComponentClass

    extends ComponentClas new (...args: ConstructorParameters>): InstanceType> & CommonPickerMethods; } + +export type PickerRef

    = ForwardedRef & CommonPickerMethods>; + +export type DatePickRef = PickerRef>; + +export type RangePickerRef = PickerRef>; diff --git a/components/date-picker/index.en-US.md b/components/date-picker/index.en-US.md index 0a93414b4797..648ef673f1c0 100644 --- a/components/date-picker/index.en-US.md +++ b/components/date-picker/index.en-US.md @@ -69,9 +69,11 @@ The following APIs are shared by DatePicker, RangePicker. | panelRender | Customize panel render | (panelNode) => ReactNode | - | 4.5.0 | | picker | Set picker type | `date` \| `week` \| `month` \| `quarter` \| `year` | `date` | `quarter`: 4.1.0 | | placeholder | The placeholder of date input | string \| \[string,string] | - | | +| placement | The position where the selection box pops up | `bottomLeft` `bottomRight` `topLeft` `topRight` | bottomLeft | | | popupStyle | To customize the style of the popup calendar | CSSProperties | {} | | | prevIcon | The custom prev icon | ReactNode | - | 4.17.0 | | size | To determine the size of the input box, the height of `large` and `small`, are 40px and 24px respectively, while default size is 32px | `large` \| `middle` \| `small` | - | | +| status | Set validation status | 'error' \| 'warning' | - | 4.19.0 | | style | To customize the style of the input box | CSSProperties | {} | | | suffixIcon | The custom suffix icon | ReactNode | - | | | superNextIcon | The custom super next icon | ReactNode | - | 4.17.0 | diff --git a/components/date-picker/index.zh-CN.md b/components/date-picker/index.zh-CN.md index a65f3d4431e5..e2780b3e5ee3 100644 --- a/components/date-picker/index.zh-CN.md +++ b/components/date-picker/index.zh-CN.md @@ -71,9 +71,11 @@ import locale from 'infrad/lib/locale/zh_CN'; | panelRender | 自定义渲染面板 | (panelNode) => ReactNode | - | 4.5.0 | | picker | 设置选择器类型 | `date` \| `week` \| `month` \| `quarter` \| `year` | `date` | `quarter`: 4.1.0 | | placeholder | 输入框提示文字 | string \| \[string, string] | - | | +| placement | 选择框弹出的位置 | `bottomLeft` `bottomRight` `topLeft` `topRight` | bottomLeft | | | popupStyle | 额外的弹出日历样式 | CSSProperties | {} | | | prevIcon | 自定义上一个图标 | ReactNode | - | 4.17.0 | | size | 输入框大小,`large` 高度为 40px,`small` 为 24px,默认是 32px | `large` \| `middle` \| `small` | - | | +| status | 设置校验状态 | 'error' \| 'warning' | - | 4.19.0 | | style | 自定义输入框样式 | CSSProperties | {} | | | suffixIcon | 自定义的选择框后缀图标 | ReactNode | - | | | superNextIcon | 自定义 `<<` 切换图标 | ReactNode | - | 4.17.0 | diff --git a/components/date-picker/locale/en_GB.tsx b/components/date-picker/locale/en_GB.tsx index 15cb6161b257..5e278f58c032 100644 --- a/components/date-picker/locale/en_GB.tsx +++ b/components/date-picker/locale/en_GB.tsx @@ -12,6 +12,7 @@ const locale: PickerLocale = { weekPlaceholder: 'Select week', rangePlaceholder: ['Start date', 'End date'], rangeYearPlaceholder: ['Start year', 'End year'], + rangeQuarterPlaceholder: ['Start quarter', 'End quarter'], rangeMonthPlaceholder: ['Start month', 'End month'], rangeWeekPlaceholder: ['Start week', 'End week'], ...CalendarLocale, diff --git a/components/date-picker/locale/en_US.tsx b/components/date-picker/locale/en_US.tsx index 47b57b9eeb24..358216edd786 100644 --- a/components/date-picker/locale/en_US.tsx +++ b/components/date-picker/locale/en_US.tsx @@ -12,6 +12,7 @@ const locale: PickerLocale = { weekPlaceholder: 'Select week', rangePlaceholder: ['Start date', 'End date'], rangeYearPlaceholder: ['Start year', 'End year'], + rangeQuarterPlaceholder: ['Start quarter', 'End quarter'], rangeMonthPlaceholder: ['Start month', 'End month'], rangeWeekPlaceholder: ['Start week', 'End week'], ...CalendarLocale, diff --git a/components/date-picker/locale/zh_CN.tsx b/components/date-picker/locale/zh_CN.tsx index bb3181123d8b..41df329de639 100644 --- a/components/date-picker/locale/zh_CN.tsx +++ b/components/date-picker/locale/zh_CN.tsx @@ -13,6 +13,7 @@ const locale: PickerLocale = { rangePlaceholder: ['开始日期', '结束日期'], rangeYearPlaceholder: ['开始年份', '结束年份'], rangeMonthPlaceholder: ['开始月份', '结束月份'], + rangeQuarterPlaceholder: ['开始季度', '结束季度'], rangeWeekPlaceholder: ['开始周', '结束周'], ...CalendarLocale, }, diff --git a/components/date-picker/locale/zh_TW.tsx b/components/date-picker/locale/zh_TW.tsx index 663e94380282..f0bcf20c1e34 100644 --- a/components/date-picker/locale/zh_TW.tsx +++ b/components/date-picker/locale/zh_TW.tsx @@ -13,6 +13,7 @@ const locale: PickerLocale = { rangePlaceholder: ['開始日期', '結束日期'], rangeYearPlaceholder: ['開始年份', '結束年份'], rangeMonthPlaceholder: ['開始月份', '結束月份'], + rangeQuarterPlaceholder: ['開始季度', '結束季度'], rangeWeekPlaceholder: ['開始周', '結束周'], ...CalendarLocale, }, diff --git a/components/date-picker/style/index.less b/components/date-picker/style/index.less index fe07cffcaf71..c0f0a2d88bb3 100644 --- a/components/date-picker/style/index.less +++ b/components/date-picker/style/index.less @@ -1,6 +1,7 @@ @import '../../style/themes/index'; @import '../../style/mixins/index'; @import '../../input/style/mixin'; +@import './status'; @picker-prefix-cls: ~'@{ant-prefix}-picker'; @@ -13,7 +14,7 @@ } .@{picker-prefix-cls} { - @arrow-size: 10px; + @arrow-size: @popover-arrow-width; .reset-component(); .picker-padding(@input-height-base, @font-size-base, @input-padding-horizontal-base); @@ -106,6 +107,8 @@ } &-suffix { + display: flex; + flex: none; align-self: center; margin-left: (@padding-xs / 2); color: @disabled-color; @@ -114,6 +117,10 @@ > * { vertical-align: top; + + &:not(:last-child) { + margin-right: 8px; + } } } @@ -221,17 +228,17 @@ &-placement-bottomLeft { .@{picker-prefix-cls}-range-arrow { - top: (@arrow-size / 2) - (@arrow-size / 3); + top: (@arrow-size / 2) - (@arrow-size / 3) + 0.7px; display: block; - transform: rotate(-45deg); + transform: rotate(-135deg) translateY(1px); } } &-placement-topLeft { .@{picker-prefix-cls}-range-arrow { - bottom: (@arrow-size / 2) - (@arrow-size / 3); + bottom: (@arrow-size / 2) - (@arrow-size / 3) + 0.7px; display: block; - transform: rotate(135deg); + transform: rotate(45deg); } } @@ -311,19 +318,14 @@ width: @arrow-size; height: @arrow-size; margin-left: @input-padding-horizontal-base * 1.5; - box-shadow: 2px -2px 6px fade(@black, 6%); + background: linear-gradient( + 135deg, + transparent 40%, + @calendar-bg 40% + ); // Use linear-gradient to prevent arrow from covering text + box-shadow: 2px 2px 6px -2px fade(@black, 10%); // use spread radius to hide shadow over popover transition: left @animation-duration-slow ease-out; - - &::after { - position: absolute; - top: @border-width-base; - right: @border-width-base; - width: @arrow-size; - height: @arrow-size; - border: (@arrow-size / 2) solid @border-color-split; - border-color: @calendar-bg @calendar-bg transparent transparent; - content: ''; - } + .roundedArrow(@arrow-size, 5px, @calendar-bg); } &-panel-container { diff --git a/components/date-picker/style/index.tsx b/components/date-picker/style/index.tsx index cc4424295a44..18447e360f85 100644 --- a/components/date-picker/style/index.tsx +++ b/components/date-picker/style/index.tsx @@ -3,3 +3,5 @@ import './index.less'; // style dependencies import '../../tag/style'; import '../../button/style'; + +// deps-lint-skip: form diff --git a/components/date-picker/style/panel.less b/components/date-picker/style/panel.less index 5c6ee0a4f0e8..fec6899f38c7 100644 --- a/components/date-picker/style/panel.less +++ b/components/date-picker/style/panel.less @@ -101,7 +101,7 @@ display: inline-block; width: @picker-arrow-size; height: @picker-arrow-size; - border: 0 solid currentColor; + border: 0 solid currentcolor; border-width: 1.5px 0 0 1.5px; content: ''; } @@ -116,7 +116,7 @@ display: inline-block; width: @picker-arrow-size; height: @picker-arrow-size; - border: 0 solid currentColor; + border: 0 solid currentcolor; border-width: 1.5px 0 0 1.5px; content: ''; } diff --git a/components/date-picker/style/status.less b/components/date-picker/style/status.less new file mode 100644 index 000000000000..be3adba330e3 --- /dev/null +++ b/components/date-picker/style/status.less @@ -0,0 +1,52 @@ +@import '../../input/style/mixin'; + +@picker-prefix-cls: ~'@{ant-prefix}-picker'; + +.picker-status-color( + @text-color: @input-color; + @border-color: @input-border-color; + @background-color: @input-bg; + @hoverBorderColor: @primary-color-hover; + @outlineColor: @primary-color-outline; +) { + &.@{picker-prefix-cls} { + &, + &:not([disabled]):hover { + background-color: @background-color; + border-color: @border-color; + } + + &-focused, + &:focus { + .active(@text-color, @hoverBorderColor, @outlineColor); + } + } + + .@{picker-prefix-cls}-feedback-icon { + color: @text-color; + } +} + +.@{picker-prefix-cls} { + &-status-error { + .picker-status-color(@error-color, @error-color, @input-bg, @error-color-hover, @error-color-outline); + } + + &-status-warning { + .picker-status-color(@warning-color, @warning-color, @input-bg, @warning-color-hover, @warning-color-outline); + } + + &-status-validating { + .@{picker-prefix-cls}-feedback-icon { + display: inline-block; + color: @primary-color; + } + } + + &-status-success { + .@{picker-prefix-cls}-feedback-icon { + color: @success-color; + animation-name: diffZoomIn1 !important; + } + } +} diff --git a/components/date-picker/util.ts b/components/date-picker/util.ts index 0643a0842a16..c2dbc6c50132 100644 --- a/components/date-picker/util.ts +++ b/components/date-picker/util.ts @@ -1,4 +1,6 @@ import { PickerMode } from 'rc-picker/lib/interface'; +import { DirectionType } from '../config-provider'; +import { SelectCommonPlacement } from '../_util/motion'; import { PickerLocale } from './generatePicker'; export function getPlaceholder( @@ -40,6 +42,9 @@ export function getRangePlaceholder( if (picker === 'year' && locale.lang.yearPlaceholder) { return locale.lang.rangeYearPlaceholder; } + if (picker === 'quarter' && locale.lang.quarterPlaceholder) { + return locale.lang.rangeQuarterPlaceholder; + } if (picker === 'month' && locale.lang.monthPlaceholder) { return locale.lang.rangeMonthPlaceholder; } @@ -51,3 +56,56 @@ export function getRangePlaceholder( } return locale.lang.rangePlaceholder; } + +export function transPlacement2DropdownAlign( + direction: DirectionType, + placement?: SelectCommonPlacement, +) { + const overflow = { + adjustX: 1, + adjustY: 1, + }; + switch (placement) { + case 'bottomLeft': { + return { + points: ['tl', 'bl'], + offset: [0, 4], + overflow, + }; + } + case 'bottomRight': { + return { + points: ['tr', 'br'], + offset: [0, 4], + overflow, + }; + } + case 'topLeft': { + return { + points: ['bl', 'tl'], + offset: [0, -4], + overflow, + }; + } + case 'topRight': { + return { + points: ['br', 'tr'], + offset: [0, -4], + overflow, + }; + } + default: { + return direction === 'rtl' + ? { + points: ['tr', 'br'], + offset: [0, 4], + overflow, + } + : { + points: ['tl', 'bl'], + offset: [0, 4], + overflow, + }; + } + } +} diff --git a/components/divider/index.tsx b/components/divider/index.tsx index e45e8a9e60ea..aa52bdd74d74 100644 --- a/components/divider/index.tsx +++ b/components/divider/index.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import classNames from 'classnames'; -import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; +import { ConfigContext } from '../config-provider'; export interface DividerProps { prefixCls?: string; @@ -14,56 +14,54 @@ export interface DividerProps { plain?: boolean; } -const Divider: React.FC = props => ( - - {({ getPrefixCls, direction }: ConfigConsumerProps) => { - const { - prefixCls: customizePrefixCls, - type = 'horizontal', - orientation = 'center', - orientationMargin, - className, - children, - dashed, - plain, - ...restProps - } = props; - const prefixCls = getPrefixCls('divider', customizePrefixCls); - const orientationPrefix = orientation.length > 0 ? `-${orientation}` : orientation; - const hasChildren = !!children; - const hasCustomMarginLeft = orientation === 'left' && orientationMargin != null; - const hasCustomMarginRight = orientation === 'right' && orientationMargin != null; - const classString = classNames( - prefixCls, - `${prefixCls}-${type}`, - { - [`${prefixCls}-with-text`]: hasChildren, - [`${prefixCls}-with-text${orientationPrefix}`]: hasChildren, - [`${prefixCls}-dashed`]: !!dashed, - [`${prefixCls}-plain`]: !!plain, - [`${prefixCls}-rtl`]: direction === 'rtl', - [`${prefixCls}-no-default-orientation-margin-left`]: hasCustomMarginLeft, - [`${prefixCls}-no-default-orientation-margin-right`]: hasCustomMarginRight, - }, - className, - ); +const Divider: React.FC = props => { + const { getPrefixCls, direction } = React.useContext(ConfigContext); - const innerStyle = { - ...(hasCustomMarginLeft && { marginLeft: orientationMargin }), - ...(hasCustomMarginRight && { marginRight: orientationMargin }), - }; + const { + prefixCls: customizePrefixCls, + type = 'horizontal', + orientation = 'center', + orientationMargin, + className, + children, + dashed, + plain, + ...restProps + } = props; + const prefixCls = getPrefixCls('divider', customizePrefixCls); + const orientationPrefix = orientation.length > 0 ? `-${orientation}` : orientation; + const hasChildren = !!children; + const hasCustomMarginLeft = orientation === 'left' && orientationMargin != null; + const hasCustomMarginRight = orientation === 'right' && orientationMargin != null; + const classString = classNames( + prefixCls, + `${prefixCls}-${type}`, + { + [`${prefixCls}-with-text`]: hasChildren, + [`${prefixCls}-with-text${orientationPrefix}`]: hasChildren, + [`${prefixCls}-dashed`]: !!dashed, + [`${prefixCls}-plain`]: !!plain, + [`${prefixCls}-rtl`]: direction === 'rtl', + [`${prefixCls}-no-default-orientation-margin-left`]: hasCustomMarginLeft, + [`${prefixCls}-no-default-orientation-margin-right`]: hasCustomMarginRight, + }, + className, + ); - return ( -

    - {children && ( - - {children} - - )} -
    - ); - }} - -); + const innerStyle = { + ...(hasCustomMarginLeft && { marginLeft: orientationMargin }), + ...(hasCustomMarginRight && { marginRight: orientationMargin }), + }; + + return ( +
    + {children && ( + + {children} + + )} +
    + ); +}; export default Divider; diff --git a/components/divider/style/index.less b/components/divider/style/index.less index ba271e05397e..ff7e932ef09d 100644 --- a/components/divider/style/index.less +++ b/components/divider/style/index.less @@ -13,7 +13,7 @@ top: -0.06em; display: inline-block; height: 0.9em; - margin: 0 8px; + margin: 0 @divider-vertical-gutter; vertical-align: middle; border-top: 0; border-left: @border-width-base solid @divider-color; diff --git a/components/drawer/__tests__/__snapshots__/DrawerEvent.test.js.snap b/components/drawer/__tests__/__snapshots__/DrawerEvent.test.js.snap index 944ad8b1aa4b..5b0680e6b11c 100644 --- a/components/drawer/__tests__/__snapshots__/DrawerEvent.test.js.snap +++ b/components/drawer/__tests__/__snapshots__/DrawerEvent.test.js.snap @@ -3,7 +3,7 @@ exports[`Drawer render correctly 1`] = `
    , ,
    @@ -429,7 +429,7 @@ Array [
    ,
    ,
    ,
    , ,
    @@ -1069,7 +1069,1291 @@ Array [
    , , +
    +
    +
    + +
    @@ -16960,7 +17296,7 @@ exports[`renders ./components/form/demo/validate-static.md extend context correc class="ant-form-item-control-input-content" >
    + + + + +
    @@ -18368,29 +18727,6 @@ exports[`renders ./components/form/demo/validate-static.md extend context correc
    - - - - -
    @@ -18417,7 +18753,7 @@ exports[`renders ./components/form/demo/validate-static.md extend context correc class="ant-form-item-control-input-content" >
    + > + I'm Select +
    - +
    +
    +
    +
    + +
    +
    +
    +
    - - + + + + + I'm Cascader + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + - + + + + +
    +
    +
    +
    +
    + > + I'm TreeSelect +
    -
    - +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    @@ -18707,38 +19194,15 @@ exports[`renders ./components/form/demo/validate-static.md extend context correc
    - - - - -
    @@ -18780,7 +19244,7 @@ exports[`renders ./components/form/demo/validate-static.md extend context correc class="ant-form-item-control-input-content" >
    +
    + + + + + + + + + + +
    +
    + +
    +
    + + +
    +
    +
    + + +
    +
    + +
    +
    +
    +
    + + + -
    -
    - -
    -
    -
    - - - + + + + + + - +
    + + + + +
    - - - - -
    + + + + + + + + + +
    - - - - -
    @@ -20306,9 +20895,9 @@ exports[`renders ./components/form/demo/validate-static.md extend context correc >
    - - +
    + +
    +
    +
    +
    + +
    +
    + +`; diff --git a/components/mentions/__tests__/__snapshots__/demo.test.js.snap b/components/mentions/__tests__/__snapshots__/demo.test.js.snap index cbc74049399c..e794c84dca76 100644 --- a/components/mentions/__tests__/__snapshots__/demo.test.js.snap +++ b/components/mentions/__tests__/__snapshots__/demo.test.js.snap @@ -137,7 +137,7 @@ exports[`renders ./components/mentions/demo/form.md correctly 1`] = `     , +
    , +
    , + , + "`; +exports[`Popconfirm should show overlay when trigger is clicked 1`] = `"
    code
    "`; -exports[`Popconfirm should show overlay when trigger is clicked 2`] = `"
    code
    "`; +exports[`Popconfirm should show overlay when trigger is clicked 2`] = `"
    code
    "`; -exports[`Popconfirm shows content for render functions 1`] = `"
    some-title
    "`; +exports[`Popconfirm shows content for render functions 1`] = `"
    some-title
    "`; diff --git a/components/popover/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/popover/__tests__/__snapshots__/demo-extend.test.ts.snap index 6c0d229581a4..d7d0a3d0d69b 100644 --- a/components/popover/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/popover/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -3,7 +3,7 @@ exports[`renders ./components/popover/demo/arrow-point-at-center.md extend context correctly 1`] = ` Array [ , , , , , , , , , , , , ,
    `; +exports[`renders ./components/table/demo/filter-search.md extend context correctly 1`] = ` +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + Name + + + + + + +
    +
    +
    + +
    + +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    +
    + + Age + + + + + + + + + + + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    +
    +
    + + Address + + + + + + +
    +
    +
    + + + +
    +
    +
    + John Brown + + 32 + + New York No. 1 Lake Park +
    + Jim Green + + 42 + + London No. 1 Lake Park +
    + Joe Black + + 32 + + Sidney No. 1 Lake Park +
    + Jim Red + + 32 + + London No. 2 Lake Park +
    +
    +
    +
    +
      +
    • + +
    • +
    • + + 1 + +
    • +
    • + +
    • +
    +
    +
    +
    +`; + exports[`renders ./components/table/demo/fixed-columns.md extend context correctly 1`] = `
    `; +exports[`renders ./components/table/demo/filter-search.md correctly 1`] = ` +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + Name + + + + + + +
    +
    +
    + + Age + + + + + + + + + + + +
    +
    +
    + + Address + + + + + + +
    +
    + John Brown + + 32 + + New York No. 1 Lake Park +
    + Jim Green + + 42 + + London No. 1 Lake Park +
    + Joe Black + + 32 + + Sidney No. 1 Lake Park +
    + Jim Red + + 32 + + London No. 2 Lake Park +
    +
    +
    +
    +
      +
    • + +
    • +
    • + + 1 + +
    • +
    • + +
    • +
    +
    +
    +
    +`; + exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = `