chore: Merge master

This commit is contained in:
zombiej 2019-11-13 11:48:20 +08:00
commit 2ba81538d8
50 changed files with 2986 additions and 2719 deletions

View File

@ -15,6 +15,26 @@ timeline: true
---
## 3.25.1
`2019-11-10`
- 🐞 Fix less variables of `@menu-icon-size` and `@menu-icon-size-lg` not working. [#19553](https://github.com/ant-design/ant-design/pull/19553) [@yoyo837](https://github.com/yoyo837)
- 🐞 Fix DirectoryTree `defaultExpandedAll` not working with `treeData`. [#19646](https://github.com/ant-design/ant-design/pull/19646)
- 🐞 Fix Drawer content overflow when `placement` prop is top or bottom. [#19506](https://github.com/ant-design/ant-design/pull/19506) [@shaodahong](https://github.com/shaodahong)
- 🐞 Fix broken Menu.ItemGroup style inside Dropdown again. [#19578](https://github.com/ant-design/ant-design/pull/19578)
- 🐞 Fix Dropdown that menu icon `margin-right` style is missing. [#19635](https://github.com/ant-design/ant-design/pull/19635)
- 🐞 Fix Form.Item custom props not working. [#19599](https://github.com/ant-design/ant-design/pull/19599) [@yoyo837](https://github.com/yoyo837)
- 🐞 Fix Icon `extraCommonProps` not working properly. [#19572](https://github.com/ant-design/ant-design/pull/19572) [@yoyo837](https://github.com/yoyo837)
- 🐞 Fix Modal.method() scrollbar not disabled. [#19233](https://github.com/ant-design/ant-design/pull/19233) [@emersonlaurentino](https://github.com/emersonlaurentino)
- Table
- 🐞 Fix border missing in fixed columns. [#19559](https://github.com/ant-design/ant-design/pull/19559)
- 🐞 Fix Column with `sortOrder` throw error of inifinite loop. [#19558](https://github.com/ant-design/ant-design/pull/19558)
- 🐞 Fix Column `defaultSortOrder` not working. [#19558](https://github.com/ant-design/ant-design/pull/19558)
- TypeScript
- 🐞 Fix type definition of `ListStyle` for Transfer. [#19568](https://github.com/ant-design/ant-design/pull/19568) [@lxnxbnq](https://github.com/lxnxbnq)
- 🐞 Fix type definition of multiple props for RangePicker. [#19421](https://github.com/ant-design/ant-design/pull/19421) [@JennieJi](https://github.com/JennieJi)
## 3.25.0
`2019-11-04`

View File

@ -15,6 +15,26 @@ timeline: true
---
## 3.25.1
`2019-11-10`
- 🐞 修复定制 `@menu-icon-size``@menu-icon-size-lg` less 变量不生效的问题。[#19553](https://github.com/ant-design/ant-design/pull/19553) [@yoyo837](https://github.com/yoyo837)
- 🐞 修复 DirectoryTree 中 `defaultExpandedAll` 在使用 `treeData` 时不生效的问题。[#19646](https://github.com/ant-design/ant-design/pull/19646)
- 🐞 修复 Drawer 中 `placement` 属性为 top 或 bottom 时内容溢出的问题。[#19506](https://github.com/ant-design/ant-design/pull/19506) [@shaodahong](https://github.com/shaodahong)
- 🐞 修复 Dropdown 下 Menu.ItemGroup 样式错乱的问题。 [#19578](https://github.com/ant-design/ant-design/pull/19578)
- 🐞 修复 Dropdown 中菜单图标丢失右边距的问题。[#19635](https://github.com/ant-design/ant-design/pull/19635)
- 🐞 修复 Form.Item 中自定义属性无法生效的问题。[#19599](https://github.com/ant-design/ant-design/pull/19599) [@yoyo837](https://github.com/yoyo837)
- 🐞 修复 Icon 中 `extraCommonProps` 属性不生效的问题。 [#19572](https://github.com/ant-design/ant-design/pull/19572) [@yoyo837](https://github.com/yoyo837)
- 🐞 修复 Modal.method() 中浏览器滚动条没有禁用的问题。[#19233](https://github.com/ant-design/ant-design/pull/19233) [@emersonlaurentino](https://github.com/emersonlaurentino)
- Table
- 🐞 修复合并单元格和固定列同时使用时边框丢失的问题。[#19559](https://github.com/ant-design/ant-design/pull/19559)
- 🐞 修复 Column 设置了 `sortOrder` 属性导致死循环的问题。[#19558](https://github.com/ant-design/ant-design/pull/19558)
- 🐞 修复 Column 的 `defaultSortOrder` 属性不生效的问题。[#19558](https://github.com/ant-design/ant-design/pull/19558)
- TypeScript
- 🐞 修复 Transfer 中 `ListStyle` 的类型定义。[#19568](https://github.com/ant-design/ant-design/pull/19568) [@lxnxbnq](https://github.com/lxnxbnq)
- 🐞 修复 RangePicker 中多个属性的类型定义缺失的问题。[#19421](https://github.com/ant-design/ant-design/pull/19421) [@JennieJi](https://github.com/JennieJi)
## 3.25.0
`2019-11-04`

View File

@ -6743,7 +6743,6 @@ exports[`ConfigProvider components Drawer configProvider 1`] = `
>
<div
class="config-drawer-wrapper-body"
style="overflow:auto;height:100%"
>
<div
class="config-drawer-header-no-title"
@ -6804,7 +6803,6 @@ exports[`ConfigProvider components Drawer normal 1`] = `
>
<div
class="ant-drawer-wrapper-body"
style="overflow:auto;height:100%"
>
<div
class="ant-drawer-header-no-title"
@ -6865,7 +6863,6 @@ exports[`ConfigProvider components Drawer prefixCls 1`] = `
>
<div
class="prefix-Drawer-wrapper-body"
style="overflow:auto;height:100%"
>
<div
class="prefix-Drawer-header-no-title"
@ -17671,97 +17668,103 @@ exports[`ConfigProvider components Upload configProvider 1`] = `
<div
class="config-upload-list config-upload-list-text"
>
<div
class="config-upload-list-item config-upload-list-item-done config-upload-list-item-list-type-text"
>
<div
class="config-upload-list-item-info"
>
<span>
<span
aria-label="paper-clip"
class="anticon anticon-paper-clip"
role="img"
>
<svg
aria-hidden="true"
class=""
data-icon="paper-clip"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
<div>
<span>
<div
class="config-upload-list-item config-upload-list-item-done config-upload-list-item-list-type-text"
>
<div>
<div
class="config-upload-list-item-info"
>
<path
d="M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"
/>
</svg>
</span>
<span
class="config-upload-list-item-name config-upload-list-item-name-icon-count-2"
title="xxx.png"
>
xxx.png
</span>
<span
class="config-upload-list-item-card-actions "
>
<a
title="Download file"
>
<span
aria-label="download"
class="anticon anticon-download"
role="img"
tabindex="-1"
title="Download file"
>
<svg
aria-hidden="true"
class=""
data-icon="download"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
<span>
<span
aria-label="paper-clip"
class="anticon anticon-paper-clip"
role="img"
>
<path
d="M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</a>
<a
title="Remove file"
>
<span
aria-label="delete"
class="anticon anticon-delete"
role="img"
tabindex="-1"
title="Remove file"
>
<svg
aria-hidden="true"
class=""
data-icon="delete"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
<svg
aria-hidden="true"
class=""
data-icon="paper-clip"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"
/>
</svg>
</span>
<span
class="config-upload-list-item-name config-upload-list-item-name-icon-count-2"
title="xxx.png"
>
<path
d="M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"
/>
</svg>
xxx.png
</span>
<span
class="config-upload-list-item-card-actions "
>
<a
title="Download file"
>
<span
aria-label="download"
class="anticon anticon-download"
role="img"
tabindex="-1"
title="Download file"
>
<svg
aria-hidden="true"
class=""
data-icon="download"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</a>
<a
title="Remove file"
>
<span
aria-label="delete"
class="anticon anticon-delete"
role="img"
tabindex="-1"
title="Remove file"
>
<svg
aria-hidden="true"
class=""
data-icon="delete"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"
/>
</svg>
</span>
</a>
</span>
</span>
</a>
</span>
</span>
</div>
</div>
</div>
</div>
</span>
</div>
</div>
</span>
@ -17777,97 +17780,103 @@ exports[`ConfigProvider components Upload normal 1`] = `
<div
class="ant-upload-list ant-upload-list-text"
>
<div
class="ant-upload-list-item ant-upload-list-item-done ant-upload-list-item-list-type-text"
>
<div
class="ant-upload-list-item-info"
>
<span>
<span
aria-label="paper-clip"
class="anticon anticon-paper-clip"
role="img"
>
<svg
aria-hidden="true"
class=""
data-icon="paper-clip"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
<div>
<span>
<div
class="ant-upload-list-item ant-upload-list-item-done ant-upload-list-item-list-type-text"
>
<div>
<div
class="ant-upload-list-item-info"
>
<path
d="M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"
/>
</svg>
</span>
<span
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-2"
title="xxx.png"
>
xxx.png
</span>
<span
class="ant-upload-list-item-card-actions "
>
<a
title="Download file"
>
<span
aria-label="download"
class="anticon anticon-download"
role="img"
tabindex="-1"
title="Download file"
>
<svg
aria-hidden="true"
class=""
data-icon="download"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
<span>
<span
aria-label="paper-clip"
class="anticon anticon-paper-clip"
role="img"
>
<path
d="M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</a>
<a
title="Remove file"
>
<span
aria-label="delete"
class="anticon anticon-delete"
role="img"
tabindex="-1"
title="Remove file"
>
<svg
aria-hidden="true"
class=""
data-icon="delete"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
<svg
aria-hidden="true"
class=""
data-icon="paper-clip"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"
/>
</svg>
</span>
<span
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-2"
title="xxx.png"
>
<path
d="M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"
/>
</svg>
xxx.png
</span>
<span
class="ant-upload-list-item-card-actions "
>
<a
title="Download file"
>
<span
aria-label="download"
class="anticon anticon-download"
role="img"
tabindex="-1"
title="Download file"
>
<svg
aria-hidden="true"
class=""
data-icon="download"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</a>
<a
title="Remove file"
>
<span
aria-label="delete"
class="anticon anticon-delete"
role="img"
tabindex="-1"
title="Remove file"
>
<svg
aria-hidden="true"
class=""
data-icon="delete"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"
/>
</svg>
</span>
</a>
</span>
</span>
</a>
</span>
</span>
</div>
</div>
</div>
</div>
</span>
</div>
</div>
</span>
@ -17883,97 +17892,103 @@ exports[`ConfigProvider components Upload prefixCls 1`] = `
<div
class="ant-upload-list ant-upload-list-text"
>
<div
class="ant-upload-list-item ant-upload-list-item-done ant-upload-list-item-list-type-text"
>
<div
class="ant-upload-list-item-info"
>
<span>
<span
aria-label="paper-clip"
class="anticon anticon-paper-clip"
role="img"
>
<svg
aria-hidden="true"
class=""
data-icon="paper-clip"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
<div>
<span>
<div
class="ant-upload-list-item ant-upload-list-item-done ant-upload-list-item-list-type-text"
>
<div>
<div
class="ant-upload-list-item-info"
>
<path
d="M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"
/>
</svg>
</span>
<span
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-2"
title="xxx.png"
>
xxx.png
</span>
<span
class="ant-upload-list-item-card-actions "
>
<a
title="Download file"
>
<span
aria-label="download"
class="anticon anticon-download"
role="img"
tabindex="-1"
title="Download file"
>
<svg
aria-hidden="true"
class=""
data-icon="download"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
<span>
<span
aria-label="paper-clip"
class="anticon anticon-paper-clip"
role="img"
>
<path
d="M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</a>
<a
title="Remove file"
>
<span
aria-label="delete"
class="anticon anticon-delete"
role="img"
tabindex="-1"
title="Remove file"
>
<svg
aria-hidden="true"
class=""
data-icon="delete"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
<svg
aria-hidden="true"
class=""
data-icon="paper-clip"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"
/>
</svg>
</span>
<span
class="ant-upload-list-item-name ant-upload-list-item-name-icon-count-2"
title="xxx.png"
>
<path
d="M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"
/>
</svg>
xxx.png
</span>
<span
class="ant-upload-list-item-card-actions "
>
<a
title="Download file"
>
<span
aria-label="download"
class="anticon anticon-download"
role="img"
tabindex="-1"
title="Download file"
>
<svg
aria-hidden="true"
class=""
data-icon="download"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</a>
<a
title="Remove file"
>
<span
aria-label="delete"
class="anticon anticon-delete"
role="img"
tabindex="-1"
title="Remove file"
>
<svg
aria-hidden="true"
class=""
data-icon="delete"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"
/>
</svg>
</span>
</a>
</span>
</span>
</a>
</span>
</span>
</div>
</div>
</div>
</div>
</span>
</div>
</div>
</span>

View File

@ -45,3 +45,9 @@ Some component use dynamic style to support wave effect. You can config `csp` pr
| locale | language package setting, you can find the packages in [antd/es/locale](http://unpkg.com/antd/es/locale/) | object | 3.21.0 |
| prefixCls | set prefix class | string | ant | 3.12.0 |
| pageHeader | Unify the ghost of pageHeader ,Ref [pageHeader](<(/components/page-header)> | { ghost:boolean } | 'true' | 3.24.0 |
## FAQ
#### Locale problem is still existed in DatePicker even ConfigProvider `locale` is used?
Please make sure you set moment locale by `moment.locale('zh-cn')`, or you don't have two moment of different version.

View File

@ -46,3 +46,9 @@ return (
| locale | 语言包配置,语言包可到 [antd/es/locale](http://unpkg.com/antd/es/locale/) 目录下寻找 | object | - | 3.21.0 |
| prefixCls | 设置统一样式前缀 | string | ant | 3.12.0 |
| pageHeader | 统一设置 pageHeader 的 ghost参考 [pageHeader](<(/components/page-header)>) | { ghost: boolean } | 'true' | 3.24.0 |
## FAQ
#### 为什么我使用了 ConfigProvider `locale`,时间类组件的国际化还有问题?
请检查是否设置了 `moment.locale('zh-cn')`,或者是否有两个版本的 moment 共存。

View File

@ -12,7 +12,7 @@ import Tag from '../tag';
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
import warning from '../_util/warning';
import interopDefault from '../_util/interopDefault';
import { RangePickerValue, RangePickerPresetRange } from './interface';
import { RangePickerValue, RangePickerPresetRange, RangePickerProps } from './interface';
import { formatDate } from './utils';
import InputIcon from './InputIcon';
@ -55,7 +55,7 @@ function isEmptyArray(arr: any) {
return false;
}
function fixLocale(value: RangePickerValue | undefined, localeCode: string) {
function fixLocale(value: RangePickerValue | undefined, localeCode: string | undefined) {
if (!localeCode) {
return;
}
@ -71,14 +71,14 @@ function fixLocale(value: RangePickerValue | undefined, localeCode: string) {
}
}
class RangePicker extends React.Component<any, RangePickerState> {
class RangePicker extends React.Component<RangePickerProps, RangePickerState> {
static defaultProps = {
allowClear: true,
showToday: false,
separator: '~',
};
static getDerivedStateFromProps(nextProps: any, prevState: any) {
static getDerivedStateFromProps(nextProps: RangePickerProps, prevState: RangePickerState) {
let state = null;
if ('value' in nextProps) {
const value = nextProps.value || [];
@ -167,7 +167,9 @@ class RangePicker extends React.Component<any, RangePickerState> {
value[1] = undefined;
}
const [start, end] = value;
props.onChange(value, [formatDate(start, props.format), formatDate(end, props.format)]);
if (typeof props.onChange === 'function') {
props.onChange(value, [formatDate(start, props.format), formatDate(end, props.format)]);
}
};
handleOpenChange = (open: boolean) => {
@ -242,21 +244,24 @@ class RangePicker extends React.Component<any, RangePickerState> {
{renderExtraFooter()}
</div>
) : null;
const operations = Object.keys(ranges || {}).map(range => {
const value = ranges[range];
return (
<Tag
key={range}
prefixCls={tagPrefixCls}
color="blue"
onClick={() => this.handleRangeClick(value)}
onMouseEnter={() => this.setState({ hoverValue: value })}
onMouseLeave={this.handleRangeMouseLeave}
>
{range}
</Tag>
);
});
const operations =
ranges &&
Object.keys(ranges).map(range => {
const value = ranges[range];
const hoverValue = typeof value === 'function' ? value.call(this) : value;
return (
<Tag
key={range}
prefixCls={tagPrefixCls}
color="blue"
onClick={() => this.handleRangeClick(value)}
onMouseEnter={() => this.setState({ hoverValue })}
onMouseLeave={this.handleRangeMouseLeave}
>
{range}
</Tag>
);
});
const rangeNode =
operations && operations.length > 0 ? (
<div className={`${prefixCls}-footer-extra ${prefixCls}-range-quick-selector`} key="range">
@ -281,6 +286,7 @@ class RangePicker extends React.Component<any, RangePickerState> {
ranges,
onOk,
locale,
// @ts-ignore
localeCode,
format,
dateRender,
@ -327,10 +333,12 @@ class RangePicker extends React.Component<any, RangePickerState> {
calendarProps.mode = props.mode;
}
const startPlaceholder =
'placeholder' in props ? props.placeholder[0] : locale.lang.rangePlaceholder[0];
const endPlaceholder =
'placeholder' in props ? props.placeholder[1] : locale.lang.rangePlaceholder[1];
const startPlaceholder = Array.isArray(props.placeholder)
? props.placeholder[0]
: locale.lang.rangePlaceholder[0];
const endPlaceholder = Array.isArray(props.placeholder)
? props.placeholder[1]
: locale.lang.rangePlaceholder[1];
const calendar = (
<RangeCalendar
@ -401,7 +409,7 @@ class RangePicker extends React.Component<any, RangePickerState> {
return (
<span
ref={this.savePicker}
id={props.id}
id={typeof props.id === 'number' ? props.id.toString() : props.id}
className={classNames(props.className, props.pickerClass)}
style={{ ...style, ...pickerStyle }}
tabIndex={props.disabled ? -1 : 0}

View File

@ -12,6 +12,8 @@ export interface PickerProps {
disabled?: boolean;
allowClear?: boolean;
className?: string;
pickerClass?: string;
pickerInputClass?: string;
suffixIcon?: React.ReactNode;
style?: React.CSSProperties;
popupStyle?: React.CSSProperties;
@ -24,6 +26,8 @@ export interface PickerProps {
disabledDate?: (current: moment.Moment | undefined) => boolean;
dateRender?: (current: moment.Moment, today: moment.Moment) => React.ReactNode;
autoFocus?: boolean;
onFocus?: React.FocusEventHandler;
onBlur?: (e: React.SyntheticEvent) => void;
}
export interface SinglePickerProps {
@ -36,7 +40,7 @@ export interface SinglePickerProps {
}
const DatePickerModes = tuple('time', 'date', 'month', 'year', 'decade');
export type DatePickerMode = (typeof DatePickerModes)[number];
export type DatePickerMode = typeof DatePickerModes[number];
export interface DatePickerProps extends PickerProps, SinglePickerProps {
showTime?: TimePickerProps | boolean;
@ -69,9 +73,11 @@ export type RangePickerPresetRange = RangePickerValue | (() => RangePickerValue)
export interface RangePickerProps extends PickerProps {
className?: string;
tagPrefixCls?: string;
value?: RangePickerValue;
defaultValue?: RangePickerValue;
defaultPickerValue?: RangePickerValue;
timePicker?: React.ReactNode;
onChange?: (dates: RangePickerValue, dateStrings: [string, string]) => void;
onCalendarChange?: (dates: RangePickerValue, dateStrings: [string, string]) => void;
onOk?: (selectedTime: RangePickerPresetRange) => void;
@ -93,6 +99,8 @@ export interface RangePickerProps extends PickerProps {
};
onPanelChange?: (value?: RangePickerValue, mode?: string | string[]) => void;
renderExtraFooter?: () => React.ReactNode;
onMouseEnter?: (e: React.MouseEvent<HTMLSpanElement, MouseEvent>) => void;
onMouseLeave?: (e: React.MouseEvent<HTMLSpanElement, MouseEvent>) => void;
}
export interface WeekPickerProps extends PickerProps, SinglePickerProps {

View File

@ -3,7 +3,7 @@ import * as moment from 'moment';
// eslint-disable-next-line import/prefer-default-export
export function formatDate(
value: moment.Moment | undefined | null,
format: string | string[],
format: string | string[] | undefined,
): string {
if (!value) {
return '';

View File

@ -263,7 +263,7 @@ exports[`renders ./components/descriptions/demo/border.md correctly 1`] = `
<br />
Storage space: 10 GB
<br />
Replication_factor:3
Replication factor: 3
<br />
Region: East China 1
<br />
@ -384,7 +384,7 @@ exports[`renders ./components/descriptions/demo/responsive.md correctly 1`] = `
<br />
Storage space: 10 GB
<br />
Replication_factor:3
Replication factor: 3
<br />
Region: East China 1
</td>
@ -569,7 +569,7 @@ exports[`renders ./components/descriptions/demo/size.md correctly 1`] = `
<br />
Storage space: 10 GB
<br />
Replication_factor:3
Replication factor: 3
<br />
Region: East China 1
<br />
@ -1025,7 +1025,7 @@ exports[`renders ./components/descriptions/demo/vertical-border.md correctly 1`]
<br />
Storage space: 10 GB
<br />
Replication_factor:3
Replication factor: 3
<br />
Region: East China 1
<br />

View File

@ -40,7 +40,7 @@ ReactDOM.render(
<br />
Storage space: 10 GB
<br />
Replication_factor:3
Replication factor: 3
<br />
Region: East China 1<br />
</Descriptions.Item>

View File

@ -39,7 +39,7 @@ const Demo = () => {
<br />
Storage space: 10 GB
<br />
Replication_factor:3
Replication factor: 3
<br />
Region: East China 1
</Descriptions.Item>

View File

@ -54,7 +54,7 @@ class Demo extends React.Component {
<br />
Storage space: 10 GB
<br />
Replication_factor:3
Replication factor: 3
<br />
Region: East China 1<br />
</Descriptions.Item>

View File

@ -40,7 +40,7 @@ ReactDOM.render(
<br />
Storage space: 10 GB
<br />
Replication_factor:3
Replication factor: 3
<br />
Region: East China 1<br />
</Descriptions.Item>

View File

@ -20,7 +20,7 @@ exports[`Drawer className is test_drawer 1`] = `
>
<div
class="ant-drawer-wrapper-body"
style="overflow:auto;height:100%;opacity:0;transition:opacity .3s"
style="opacity:0;transition:opacity .3s"
>
<div
class="ant-drawer-header-no-title"
@ -83,7 +83,6 @@ exports[`Drawer closable is false 1`] = `
>
<div
class="ant-drawer-wrapper-body"
style="overflow:auto;height:100%"
>
<div
class="ant-drawer-body"
@ -117,7 +116,7 @@ exports[`Drawer destroyOnClose is true 1`] = `
>
<div
class="ant-drawer-wrapper-body"
style="overflow:auto;height:100%;opacity:0;transition:opacity .3s"
style="opacity:0;transition:opacity .3s"
>
<div
class="ant-drawer-header-no-title"
@ -180,7 +179,6 @@ exports[`Drawer have a title 1`] = `
>
<div
class="ant-drawer-wrapper-body"
style="overflow:auto;height:100%"
>
<div
class="ant-drawer-header"
@ -248,7 +246,6 @@ exports[`Drawer render correctly 1`] = `
>
<div
class="ant-drawer-wrapper-body"
style="overflow:auto;height:100%"
>
<div
class="ant-drawer-header-no-title"
@ -374,7 +371,7 @@ exports[`Drawer style/drawerStyle/headerStyle/bodyStyle should work 1`] = `
>
<div
class="ant-drawer-wrapper-body"
style="overflow:auto;height:100%;background-color:#08c"
style="background-color:#08c"
>
<div
class="ant-drawer-header-no-title"

View File

@ -29,7 +29,6 @@ exports[`Drawer render correctly 1`] = `
>
<div
class="ant-drawer-wrapper-body"
style="overflow: auto; height: 100%;"
>
<div
class="ant-drawer-header-no-title"

View File

@ -195,7 +195,6 @@ exports[`renders ./components/drawer/demo/render-in-current.md correctly 1`] = `
>
<div
class="ant-drawer-wrapper-body"
style="overflow:auto;height:100%"
>
<div
class="ant-drawer-header"
@ -267,7 +266,7 @@ exports[`renders ./components/drawer/demo/user-profile.md correctly 1`] = `
<div
class="ant-list-item-meta-description"
>
Progresser AFX
Progresser XTech
</div>
</div>
</div>
@ -313,7 +312,7 @@ exports[`renders ./components/drawer/demo/user-profile.md correctly 1`] = `
<div
class="ant-list-item-meta-description"
>
Progresser AFX
Progresser XTech
</div>
</div>
</div>

View File

@ -88,7 +88,7 @@ class App extends React.Component {
<Avatar src="https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png" />
}
title={<a href="https://ant.design/index-cn">{item.name}</a>}
description="Progresser AFX"
description="Progresser XTech"
/>
</List.Item>
)}
@ -146,7 +146,7 @@ class App extends React.Component {
</Row>
<Row>
<Col span={12}>
<DescriptionItem title="Department" content="AFX" />
<DescriptionItem title="Department" content="XTech" />
</Col>
<Col span={12}>
<DescriptionItem title="Supervisor" content={<a>Lin</a>} />

View File

@ -19,7 +19,7 @@ type EventType =
type getContainerFunc = () => HTMLElement;
const PlacementTypes = tuple('top', 'right', 'bottom', 'left');
type placementType = (typeof PlacementTypes)[number];
type placementType = typeof PlacementTypes[number];
export interface DrawerProps {
closable?: boolean;
destroyOnClose?: boolean;
@ -175,19 +175,13 @@ class Drawer extends React.Component<DrawerProps & ConfigConsumerProps, IDrawerS
// render drawer body dom
renderBody = () => {
const { bodyStyle, drawerStyle, placement, prefixCls, visible } = this.props;
const { bodyStyle, drawerStyle, prefixCls, visible } = this.props;
if (this.destroyClose && !visible) {
return null;
}
this.destroyClose = false;
const containerStyle: React.CSSProperties =
placement === 'left' || placement === 'right'
? {
overflow: 'auto',
height: '100%',
}
: {};
const containerStyle: React.CSSProperties = {};
const isDestroyOnClose = this.getDestroyOnClose();

View File

@ -22,7 +22,7 @@ title: Drawer
| destroyOnClose | 关闭时销毁 Drawer 里的子元素 | boolean | false | 3.7.0 |
| getContainer | 指定 Drawer 挂载的 HTML 节点, false 为挂载在当前 dom | HTMLElement \| `() => HTMLElement` \| Selectors \| false | 'body' | 3.7.0 |
| maskClosable | 点击蒙层是否允许关闭 | boolean | true | 3.7.0 |
| mask | 是否展示遮罩 | Boolean | true | 3.7.0 |
| mask | 是否展示遮罩 | boolean | true | 3.7.0 |
| maskStyle | 遮罩样式 | object | {} | 3.7.0 |
| style | 可用于设置 Drawer 最外层容器的样式,和 `drawerStyle` 的区别是作用节点包括 `mask` | object | - | 3.7.0 |
| drawerStyle | 用于设置 Drawer 弹出层的样式 | object | - | 3.24.0 |
@ -33,7 +33,7 @@ title: Drawer
| width | 宽度 | string \| number | 256 | 3.7.0 |
| height | 高度, 在 `placement``top``bottom` 时使用 | string \| number | 256 | 3.9.0 |
| className | 对话框外层容器的类名 | string | - | 3.8.0 |
| zIndex | 设置 Drawer 的 `z-index` | Number | 1000 | 3.7.0 |
| zIndex | 设置 Drawer 的 `z-index` | number | 1000 | 3.7.0 |
| placement | 抽屉的方向 | 'top' \| 'right' \| 'bottom' \| 'left' | 'right' | 3.7.0 |
| onClose | 点击遮罩层或右上角叉或取消按钮的回调 | function(e) | 无 | 3.7.0 |
| afterVisibleChange | 切换抽屉时动画结束后的回调 | function(visible) | 无 | 3.17.0 |

View File

@ -140,6 +140,7 @@
&-content {
position: relative;
z-index: 1;
overflow: auto;
background-color: @component-background;
background-clip: padding-box;
border: 0;

View File

@ -98,6 +98,7 @@
cursor: pointer;
transition: all 0.3s;
> .anticon:first-child,
> span > .anticon:first-child {
min-width: 12px;
margin-right: 8px;

View File

@ -3,6 +3,7 @@ import isEqual from 'lodash/isEqual';
import classNames from 'classnames';
import { Field, FormInstance } from 'rc-field-form';
import { FieldProps as RcFieldProps } from 'rc-field-form/lib/Field';
import omit from 'omit.js';
import Row from '../grid/row';
import { ConfigContext } from '../config-provider';
import { tuple } from '../_util/type';
@ -13,7 +14,7 @@ import { FormContext, FormItemContext } from './context';
import { toArray, getFieldId } from './util';
const ValidateStatuses = tuple('success', 'warning', 'error', 'validating', '');
export type ValidateStatus = (typeof ValidateStatuses)[number];
export type ValidateStatus = typeof ValidateStatuses[number];
type RenderChildren = (form: FormInstance) => React.ReactElement;
@ -50,6 +51,7 @@ const FormItem: React.FC<FormItemProps> = (props: FormItemProps) => {
required,
trigger = 'onChange',
validateTrigger = 'onChange',
...restProps
} = props;
const { getPrefixCls } = React.useContext(ConfigContext);
const formContext = React.useContext(FormContext);
@ -193,7 +195,22 @@ const FormItem: React.FC<FormItemProps> = (props: FormItemProps) => {
}
return (
<Row type="flex" className={classNames(itemClassName)} style={style} key="row">
<Row
type="flex"
className={classNames(itemClassName)}
style={style}
key="row"
{...omit(restProps, [
'id', // It is deprecated because `htmlFor` is its replacement.
'htmlFor',
'label',
'labelAlign',
'labelCol',
'wrapperCol',
'extra',
'colon',
])}
>
{/* Label */}
<FormItemLabel
htmlFor={fieldId}

View File

@ -379,6 +379,7 @@ exports[`renders ./components/form/demo/basic.md correctly 1`] = `
</div>
<div
class="ant-row-flex ant-form-item"
valuepropname="checked"
>
<div
class="ant-col ant-col-16 ant-col-offset-8 ant-form-item-control"
@ -2437,6 +2438,7 @@ exports[`renders ./components/form/demo/register.md correctly 1`] = `
</div>
<div
class="ant-row-flex ant-form-item"
valuepropname="checked"
>
<div
class="ant-col ant-form-item-control ant-col-xs-24 ant-col-xs-offset-0 ant-col-sm-16 ant-col-sm-offset-8"
@ -3179,6 +3181,7 @@ exports[`renders ./components/form/demo/validate-other.md correctly 1`] = `
</div>
<div
class="ant-row-flex ant-form-item"
valuepropname="checked"
>
<div
class="ant-col ant-col-6 ant-form-item-label"
@ -3975,6 +3978,7 @@ exports[`renders ./components/form/demo/validate-other.md correctly 1`] = `
</div>
<div
class="ant-row-flex ant-form-item"
valuepropname="fileList"
>
<div
class="ant-col ant-col-6 ant-form-item-label"

View File

@ -0,0 +1,24 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Form Form.Item should support data-*、aria-* and custom attribute 1`] = `
<form
class="ant-form ant-form-horizontal"
>
<div
aria-hidden="true"
cccc="bbbb"
class="ant-row-flex ant-form-item"
data-text="123"
>
<div
class="ant-col ant-form-item-control"
>
<div
class="ant-form-item-control-input"
>
text
</div>
</div>
</div>
</form>
`;

View File

@ -185,4 +185,15 @@ describe('Form', () => {
};
});
});
it('Form.Item should support data-*、aria-* and custom attribute', () => {
const wrapper = mount(
<Form>
<Form.Item data-text="123" aria-hidden="true" cccc="bbbb">
text
</Form.Item>
</Form>,
);
expect(wrapper.render()).toMatchSnapshot();
});
});

View File

@ -24,7 +24,7 @@ High performance Form component with data scope management. Including data colle
| form | Form control instance created by `Form.useForm()`. Automatically created when not provided | [FormInstance](#FormInstance) | - |
| hideRequiredMark | Hide required mark for all form items | boolean | false |
| initialValues | Set value by Form initialization or reset | object | - |
| labelAlign | Label text alignment | 'left' \| 'right' | 'right' |
| labelAlign | text align of label of all items | 'left' \| 'right' | 'right' | 3.15.0 |
| labelCol | label layout, like `<Col>` component. Set `span` `offset` value like `{span: 3, offset: 12}` or `sm: {span: 3, offset: 12}` | [object](https://ant.design/components/grid/#Col) | |
| layout | Form layout | 'horizontal'\|'vertical'\|'inline' | 'horizontal' |
| name | Form name. Will be the prefix of Field `id` | string | - |
@ -76,6 +76,7 @@ Form field component for data bidirectional binding, validation, layout, and so
| htmlFor | Set sub label `htmlFor` | string | - |
| noStyle | No style for `true`, used as a pure field control | boolean | false |
| label | Label text | string\|ReactNode | - |
| labelAlign | text align of label | 'left' \| 'right' | 'right' | 3.15.0 |
| labelCol | The layout of label. You can set `span` `offset` to something like `{span: 3, offset: 12}` or `sm: {span: 3, offset: 12}` same as with `<Col>`. You can set `labelCol` on Form. If both exists, use Item first | [object](/components/grid/#Col) | - |
| name | Field name, support array | [NamePath](#NamePath) | - |
| normalize | Normalize value to form component | (value, prevValue, prevValues) => any | - |

View File

@ -77,6 +77,7 @@ const validateMessages = {
| htmlFor | 设置子元素 label `htmlFor` 属性 | string | - |
| noStyle | 为 `true` 时不带样式,作为纯字段控件使用 | boolean | false |
| label | `label` 标签的文本 | string\|ReactNode | - |
| labelAlign | 标签文本对齐方式 | 'left' \| 'right' | 'right' | 3.15.0 |
| labelCol | `label` 标签布局,同 `<Col>` 组件,设置 `span` `offset` 值,如 `{span: 3, offset: 12}``sm: {span: 3, offset: 12}`。你可以通过 Form 的 `labelCol` 进行统一设置。当和 Form 同时设置时,以 Item 为准 | [object](/components/grid/#Col) | - |
| name | 字段名,支持数组 | [NamePath](#NamePath) | - |
| normalize | 转换字段值给控件 | (value, prevValue, prevValues) => any | - |

View File

@ -46,7 +46,7 @@ The rest of the props of Input are exactly the same as the original [input](http
| defaultValue | The initial input content | string | | |
| value | The input content value | string | | |
| onPressEnter | The callback function that is triggered when Enter key is pressed. | function(e) | | |
| allowClear | allow to remove input content with clear icon | boolean | | |
| allowClear | allow to remove input content with clear icon | boolean | | 3.25.0 |
The rest of the props of `Input.TextArea` are the same as the original [textarea](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea).

View File

@ -47,7 +47,7 @@ Input 的其他属性和 React 自带的 [input](https://facebook.github.io/reac
| defaultValue | 输入框默认内容 | string | | |
| value | 输入框内容 | string | | |
| onPressEnter | 按下回车的回调 | function(e) | | |
| allowClear | 可以点击清除图标删除内容 | boolean | | |
| allowClear | 可以点击清除图标删除内容 | boolean | | 3.25.0 |
`Input.TextArea` 的其他属性和浏览器自带的 [textarea](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea) 一致。

View File

@ -139,7 +139,7 @@ export default function confirm(config: ModalFuncProps) {
}
function render(props: any) {
ReactDOM.render(<ConfirmDialog getContainer={false} {...props} />, div);
ReactDOM.render(<ConfirmDialog {...props} />, div);
}
function close(...args: any[]) {

View File

@ -12,7 +12,7 @@ cols: 1
- 网络较慢,需要长时间等待加载处理的情况下。
- 图文信息内容较多的列表/卡片中。
- 只适合用在第一次加载数据的场景
- 只在第一次加载数据的时候使用
- 可以被 Spin 完全代替,但是在可用的场景下可以比 Spin 提供更好的视觉效果和用户体验。
## API

View File

@ -23,7 +23,7 @@ export interface FilterDropdownProps {
setSelectedKeys?: (selectedKeys: string[]) => void;
selectedKeys?: React.Key[];
confirm?: () => void;
clearFilters?: (selectedKeys: string[]) => void;
clearFilters?: () => void;
filters?: ColumnFilterItem[];
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
visible?: boolean;
@ -53,7 +53,7 @@ export interface ColumnProps<T> {
colSpan?: number;
width?: string | number;
className?: string;
fixed?: boolean | (typeof ColumnFixedPlacements)[number];
fixed?: boolean | typeof ColumnFixedPlacements[number];
filterIcon?: React.ReactNode | ((filtered: boolean) => React.ReactNode);
filteredValue?: any[];
sortOrder?: SortOrder | boolean;

View File

@ -35,7 +35,7 @@
}
&-search {
padding: 0 @control-padding-horizontal-sm;
padding: 0 24px 0 @control-padding-horizontal-sm;
&-action {
position: absolute;
top: 12px;

View File

@ -231,26 +231,27 @@ export default class UploadList extends React.Component<UploadListProps, any> {
} else {
message = (file.error && file.error.statusText) || locale.uploadError;
}
const iconAndPreview =
file.status === 'error' ? (
<Tooltip title={message}>
{icon}
{preview}
</Tooltip>
) : (
<span>
{icon}
{preview}
</span>
);
const iconAndPreview = (
<span>
{icon}
{preview}
</span>
);
const dom = (
<div className={infoUploadingClass}>
<div>
<div className={`${prefixCls}-list-item-info`}>{iconAndPreview}</div>
{actions}
<Animate transitionName="fade" component="">
{progress}
</Animate>
</div>
</div>
);
return (
<div className={infoUploadingClass} key={file.uid}>
<div className={`${prefixCls}-list-item-info`}>{iconAndPreview}</div>
{actions}
<Animate transitionName="fade" component="">
{progress}
</Animate>
<div key={file.uid}>
{file.status === 'error' ? <Tooltip title={message}>{dom}</Tooltip> : <span>{dom}</span>}
</div>
);
});

File diff suppressed because it is too large Load Diff

View File

@ -58,8 +58,7 @@ class PicturesWall extends React.Component {
{
uid: '-5',
name: 'image.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
status: 'error',
},
],
};

View File

@ -28,9 +28,7 @@ const fileList = [
{
uid: '-2',
name: 'yyy.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
thumbUrl: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
status: 'error',
},
];

View File

@ -17,7 +17,7 @@ title: Third-Party Libraries
| Color Picker | [rc-color-picker](https://github.com/react-component/color-picker) [react-color](http://casesandberg.github.io/react-color/) |
| Media Query | [react-responsive](https://github.com/contra/react-responsive) [react-media](https://github.com/ReactTraining/react-media) |
| Copy to clipboard | [react-copy-to-clipboard](https://github.com/nkbt/react-copy-to-clipboard) |
| Document head manager | [react-helmet](https://github.com/nfl/react-helmet) [react-document-title](https://github.com/gaearon/react-document-title) |
| Document head manager | [react-helmet](https://github.com/nfl/react-helmet) [react-helmet-async](https://github.com/staylor/react-helmet-async) |
| Icons | [react-fa](https://github.com/andreypopp/react-fa) [react-icons](https://github.com/gorangajic/react-icons) |
| QR Code | [qrcode.react](https://github.com/zpao/qrcode.react) |
| Visual Graph Editor | [GGEditor](https://github.com/gaoli/GGEditor) |

View File

@ -17,7 +17,7 @@ title: 社区精选组件
| 拾色器 | [rc-color-picker](https://github.com/react-component/color-picker) [react-color](http://casesandberg.github.io/react-color/) |
| 响应式 | [react-responsive](https://github.com/contra/react-responsive) [react-media](https://github.com/ReactTraining/react-media) |
| 复制到剪贴板 | [react-copy-to-clipboard](https://github.com/nkbt/react-copy-to-clipboard) |
| 页面 meta 属性 | [react-helmet](https://github.com/nfl/react-helmet) [react-document-title](https://github.com/gaearon/react-document-title) |
| 页面 meta 属性 | [react-helmet](https://github.com/nfl/react-helmet) [react-helmet-async](https://github.com/staylor/react-helmet-async) |
| 图标 | [react-fa](https://github.com/andreypopp/react-fa) [react-icons](https://github.com/gorangajic/react-icons) |
| 二维码 | [qrcode.react](https://github.com/zpao/qrcode.react) |
| 可视化图编辑器 | [GGEditor](https://github.com/gaoli/GGEditor) |

View File

@ -7,7 +7,7 @@ title: Design Values
Ant Design provides a practical evaluation of better design for both designers of Ant Design and designers who are using it. At the same time, it builds a foundation for design principles and design patterns which could provide guideline and general solutions for specified design goal.
<div>
<img src="https://gw.alipayobjects.com/zos/rmsportal/kEwBspjVFChYqhqafCiW.png" />
<img src="https://gw.alipayobjects.com/mdn/miniapp_social/afts/img/A*8KqgSKde8PMAAAAAAAAAAABkARQnAQ" />
</div>
Here is our design values:

View File

@ -105,7 +105,7 @@
"omit.js": "^1.0.2",
"prop-types": "^15.7.2",
"raf": "^3.4.1",
"rc-animate": "^2.8.3",
"rc-animate": "^2.10.2",
"rc-calendar": "~9.15.5",
"rc-cascader": "~1.0.0-alpha.0",
"rc-checkbox": "~2.1.6",
@ -115,7 +115,6 @@
"rc-dropdown": "~3.0.0-alpha.0",
"rc-editor-mention": "^1.1.13",
"rc-field-form": "^0.0.0-alpha.17",
"rc-form": "^2.4.5",
"rc-input-number": "~4.5.0",
"rc-mentions": "~0.4.0",
"rc-menu": "~8.0.0-alpha.3",
@ -160,17 +159,17 @@
"@types/shallowequal": "^1.1.1",
"@types/warning": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^2.0.0",
"@typescript-eslint/parser": "~2.4.0",
"@typescript-eslint/parser": "~2.7.0",
"antd-theme-generator": "^1.1.6",
"babel-eslint": "^10.0.1",
"babel-plugin-add-react-displayname": "^0.0.5",
"bisheng": "^1.3.1-alpha.0",
"bisheng": "^1.3.3",
"bisheng-plugin-antd": "^1.3.1",
"bisheng-plugin-description": "^0.1.4",
"bisheng-plugin-react": "^1.1.0",
"bisheng-plugin-toc": "^0.4.4",
"bundlesize": "^0.18.0",
"chalk": "^2.4.2",
"chalk": "^3.0.0",
"cheerio": "^1.0.0-rc.3",
"cross-env": "^6.0.0",
"css-split-webpack-plugin": "^0.2.6",
@ -210,7 +209,7 @@
"prettier": "^1.17.1",
"pretty-quick": "^2.0.0",
"querystring": "^0.2.0",
"rc-footer": "^0.5.0",
"rc-footer": "^0.6.0",
"rc-queue-anim": "^1.6.12",
"rc-scroll-anim": "^2.5.8",
"rc-tween-one": "^2.4.1",
@ -221,7 +220,7 @@
"react-dnd-html5-backend": "^9.0.0",
"react-dom": "^16.9.0",
"react-github-button": "^0.1.11",
"react-helmet": "^6.0.0-beta",
"react-helmet-async": "^1.0.4",
"react-highlight-words": "^0.16.0",
"react-infinite-scroller": "^1.2.4",
"react-intl": "^3.1.1",
@ -241,7 +240,7 @@
"stylelint-config-standard": "^19.0.0",
"stylelint-declaration-block-no-ignored-properties": "^2.1.0",
"stylelint-order": "^3.0.0",
"typescript": "~3.6.2",
"typescript": "~3.7.2",
"xhr-mock": "^2.4.1",
"xhr2": "^0.2.0",
"yaml-front-matter": "^4.0.0"

View File

@ -21,9 +21,9 @@ const components = uniq(
describe('site test', () => {
let server;
const host = 3000;
const port = 3000;
const render = async path => {
const resp = await fetch(`http://localhost:${host}${path}`).then(async res => {
const resp = await fetch(`http://127.0.0.1:${port}${path}`).then(async res => {
const html = await res.text();
const $ = cheerio.load(html, { decodeEntities: false, recognizeSelfClosing: true });
return {
@ -58,7 +58,7 @@ describe('site test', () => {
server = createServer({
root: join(process.cwd(), '_site'),
});
server.listen(host);
server.listen(port);
// eslint-disable-next-line no-console
console.log('site static server run: http://localhost:3000');
});

View File

@ -85,15 +85,17 @@ module.exports = {
'app.footer.bug-report': 'Bug Report',
'app.footer.issues': 'Issues',
'app.footer.version': 'Version: ',
'app.footer.author': 'Created by AFX',
'app.footer.author': 'Created by XTech',
'app.footer.work_with_us': 'Work with Us',
'app.footer.more-product': 'More Products',
'app.footer.company': 'AFX',
'app.footer.company': 'XTech',
'app.footer.ant-design': 'UI Design Language',
'app.footer.yuque': 'YuQue',
'app.footer.yuque.slogan': 'Write your document as a team',
'app.footer.fengdie': 'FengDie',
'app.footer.fengdie.slogan': 'Mobile web app builder',
'app.footer.fengdie.slogan': 'Console Applications Builder',
'app.footer.antv.slogan': 'Data Visualization',
'app.footer.egg.slogan': 'Enterprise Node.js Framework',
'app.footer.zhihu': 'Ant Design Blog',
'app.footer.zhihu.xtech': 'Experience Cloud Blog',
'app.footer.seeconf': 'Experience Tech Conference',

View File

@ -1,6 +1,6 @@
import React, { Children, cloneElement } from 'react';
import { FormattedMessage, injectIntl } from 'react-intl';
import { Helmet } from 'react-helmet';
import { Helmet } from 'react-helmet-async';
import { getChildren } from 'jsonml.js/lib/utils';
import { Timeline, Alert, Affix } from 'antd';
import EditButton from './EditButton';

View File

@ -1,5 +1,5 @@
import React from 'react';
import { Helmet } from 'react-helmet';
import { Helmet } from 'react-helmet-async';
import { FormattedMessage, injectIntl } from 'react-intl';
import classNames from 'classnames';
import { Row, Col, Affix, Tooltip } from 'antd';

View File

@ -1,6 +1,6 @@
import React from 'react';
import { injectIntl } from 'react-intl';
import { Helmet } from 'react-helmet';
import { Helmet } from 'react-helmet-async';
import PropTypes from 'prop-types';
import Banner from './Banner';
import Page1 from './Page1';

View File

@ -229,7 +229,7 @@ class Footer extends React.Component {
icon: (
<img
src="https://gw.alipayobjects.com/zos/rmsportal/nBVXkrFdWHxbZlmMbsaH.svg"
alt="AFX Cloud"
alt="Ant XTech"
/>
),
title: <FormattedMessage id="app.footer.more-product" />,
@ -241,9 +241,9 @@ class Footer extends React.Component {
alt="yuque"
/>
),
title: '语雀',
title: <FormattedMessage id="app.footer.yuque" />,
url: 'https://yuque.com',
description: '知识创作与分享工具',
description: <FormattedMessage id="app.footer.yuque.slogan" />,
openExternal: true,
},
{
@ -253,9 +253,9 @@ class Footer extends React.Component {
alt="yunfengdie"
/>
),
title: '云凤蝶',
title: <FormattedMessage id="app.footer.fengdie" />,
url: 'https://yunfengdie.com',
description: '中台建站平台',
description: <FormattedMessage id="app.footer.fengdie.slogan" />,
openExternal: true,
},
{
@ -267,7 +267,7 @@ class Footer extends React.Component {
),
title: 'AntV',
url: 'https://antv.alipay.com',
description: '数据可视化',
description: <FormattedMessage id="app.footer.antv.slogan" />,
openExternal: true,
},
{
@ -279,7 +279,7 @@ class Footer extends React.Component {
),
title: 'Egg',
url: 'https://eggjs.org',
description: '企业级 Node 开发框架',
description: <FormattedMessage id="app.footer.egg.slogan" />,
openExternal: true,
},
{
@ -301,7 +301,7 @@ class Footer extends React.Component {
alt="xtech"
/>
),
title: '蚂蚁体验科技',
title: <FormattedMessage id="app.footer.xtech" />,
url: 'https://xtech.antfin.com/',
openExternal: true,
},

View File

@ -3,7 +3,7 @@ import ReactDOM from 'react-dom';
import PropTypes from 'prop-types';
import { enquireScreen } from 'enquire-js';
import { IntlProvider } from 'react-intl';
import { Helmet } from 'react-helmet';
import { Helmet, HelmetProvider } from 'react-helmet-async';
import 'moment/locale/zh-cn';
import { ConfigProvider } from 'antd';
import LogRocket from 'logrocket';
@ -110,7 +110,7 @@ export default class Layout extends React.Component {
}
render() {
const { children, ...restProps } = this.props;
const { children, helmetContext = {}, ...restProps } = this.props;
const { appLocale } = this.state;
const title =
appLocale.locale === 'zh-CN'
@ -121,7 +121,7 @@ export default class Layout extends React.Component {
? '基于 Ant Design 设计体系的 React UI 组件库,用于研发企业级中后台产品。'
: 'An enterprise-class UI design language and React UI library with a set of high-quality React components, one of best React UI library for enterprises';
return (
<>
<HelmetProvider context={helmetContext}>
<Helmet encodeSpecialCharacters={false}>
<html lang={appLocale.locale === 'zh-CN' ? 'zh' : 'en'} />
<title>{title}</title>
@ -146,7 +146,7 @@ export default class Layout extends React.Component {
</div>
</ConfigProvider>
</IntlProvider>
</>
</HelmetProvider>
);
}
}

View File

@ -82,15 +82,17 @@ module.exports = {
'app.footer.bug-report': '报告 Bug',
'app.footer.issues': '讨论列表',
'app.footer.version': '文档版本:',
'app.footer.author': '蚂蚁金服体验技术部出品 @ AFX',
'app.footer.author': '蚂蚁金服体验技术部出品 @ XTech',
'app.footer.work_with_us': '加入我们',
'app.footer.more-product': '更多产品',
'app.footer.company': 'AFX',
'app.footer.company': 'XTech',
'app.footer.ant-design': '蚂蚁 UI 体系',
'app.footer.yuque': '语雀',
'app.footer.yuque.slogan': '知识创作与分享工具',
'app.footer.fengdie': '云凤蝶',
'app.footer.fengdie.slogan': '移动建站平台',
'app.footer.antv.slogan': '数据可视化',
'app.footer.egg.slogan': '企业级 Node 开发框架',
'app.footer.zhihu': 'Ant Design 专栏',
'app.footer.zhihu.xtech': '体验科技专栏',
'app.footer.seeconf': '蚂蚁体验科技大会',