Merge pull request #31359 from ant-design/master-to-merge-feature

chore: sync master into feature
This commit is contained in:
afc163 2021-07-12 19:56:54 +08:00 committed by GitHub
commit c6130c13b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 312 additions and 236 deletions

View File

@ -15,6 +15,32 @@ timeline: true
---
## 4.16.7
`2021-07-12`
- 🐞 Fix DatePicker date cell not centered when used in Table. [#31306](https://github.com/ant-design/ant-design/pull/31306) [@Map1en](https://github.com/Map1en)
- 🐞 Fix Desciptions border missing when inside Table. [#31307](https://github.com/ant-design/ant-design/pull/31307)
- 🐞 Fix InputNumber border and interactive handler not matched. [#31300](https://github.com/ant-design/ant-design/pull/31300) [@diyews](https://github.com/diyews)
- Table
- 🐞 Fix incomplete display of the upper border of the table when the window is too small. [#31298](https://github.com/ant-design/ant-design/pull/31298) [@Map1en](https://github.com/Map1en)
- 🐞 Fix Table `rowSelection.selectedRows` don't sync in initial state. [#31224](https://github.com/ant-design/ant-design/pull/31224) [@kerm1it](https://github.com/kerm1it)
- 🐞 Fix Table `filteredValue` not work with nested columns. [#30815](https://github.com/ant-design/ant-design/pull/30815) [@moraispgsi](https://github.com/moraispgsi)
- Form
- 🐞 Fix Form Input outline color under Form validation. [#31240](https://github.com/ant-design/ant-design/pull/31240)
- 🆕 Form add `name` as a default label value in `validationMessages`. [#30179](https://github.com/ant-design/ant-design/pull/30179) [@jameslahm](https://github.com/jameslahm)
- 💄 Fix Rate focus ring style in Safari. [#31241](https://github.com/ant-design/ant-design/pull/31241)
- 💄 Tweak Select arrow icon position. [#31234](https://github.com/ant-design/ant-design/pull/31234)
- 🐞 Input will not trigger `onBlur` when click clear icon now which resolve that editable table input cannot be cleared. [#31202](https://github.com/ant-design/ant-design/pull/31202)
- 🐞 Fix Tooltip `arrowPointAtCenter` 1px shift bug. [#31201](https://github.com/ant-design/ant-design/pull/31201)
- 💄 Fix Menu.Item hover color transition style. [#31189](https://github.com/ant-design/ant-design/pull/31189)
- 🐞 Fix Dropdown.Button don't support `overlayClassName` and `overlayStyle`. [#31187](https://github.com/ant-design/ant-design/pull/31187)
- 💄 Adjust Pagination pattern of disabled-active buttons align with Radio style. [#31185](https://github.com/ant-design/ant-design/pull/31185) [@Map1en](https://github.com/Map1en)
- 🐞 Fix the path error when packaging the component style export file in the Windows environment. [#31277](https://github.com/ant-design/ant-design/pull/31277) [@aoxiang78](https://github.com/aoxiang78)
- 🌐 Add `selectNone` for en_GB locale file. [#31264](https://github.com/ant-design/ant-design/pull/31264) [@Map1en](https://github.com/Map1en)
- TypeScript
- 🤖 Adjust Transfer `listStyle` definition to be optional. [#31322](https://github.com/ant-design/ant-design/pull/31322) [@geekrainy](https://github.com/geekrainy)
## 4.16.6
`2021-06-29`
@ -472,7 +498,7 @@ It is a wrong release which same as `4.10.3`, don't use it.
- 🐞 Fix the compatibility issue of less 4.0.0.
- 🐞 Fix the problem of cursor jumping when Typography is editable. [#28545](https://github.com/ant-design/ant-design/pull/28545)
- 🐞 Fix the problem that repeatedly clicking on expanded nodes when Tree dynamically loads data will lead to wrong status.[#28349](https://github.com/ant-design/ant-design/issues/28349) [@liuchao233](https://github.com/react-component/tree/pull/401)
- 🐞 Fix the problem that TreeSelect & Select cannot open the dropdown menu when it's `searchValue` has value. [#28574](https://github.com/ant-design/ant-design/pull/28574)
- 🐞 Fix TreeSelect and Select cannot open the dropdown menu when it's `searchValue` has value. [#28574](https://github.com/ant-design/ant-design/pull/28574)
- 🐞 Fix Dropdown disabled menu item link style. [#28578](https://github.com/ant-design/ant-design/pull/28578)
- 🐞 Fix Progress `steps` display accuracy issue. [#28530](https://github.com/ant-design/ant-design/pull/28530) [@gaoryrt](https://github.com/gaoryrt)
- 🐞 Fix Radio align issue in Chrome. [#28616](https://github.com/ant-design/ant-design/pull/28616)

View File

@ -15,8 +15,36 @@ timeline: true
---
## 4.16.7
`2021-07-12`
- 🐞 修复 DatePicker 在 Table 内使用时日期未居中的问题。[#31306](https://github.com/ant-design/ant-design/pull/31306) [@Map1en](https://github.com/Map1en)
- 🐞 修复 Descriptions 在 Table 内边框丢失的问题。[#31307](https://github.com/ant-design/ant-design/pull/31307)
- 🐞 修复 InputNumber 边框和交互范围不匹配的问题。[#31300](https://github.com/ant-design/ant-design/pull/31300) [@diyews](https://github.com/diyews)
- Table
- 🐞 修复 Table 当窗口过小时上边框显示不完全的问题。[#31298](https://github.com/ant-design/ant-design/pull/31298) [@Map1en](https://github.com/Map1en)
- 🐞 修复 Table `rowSelection``selectedRows` 属性在初始化时不同步问题。[#31224](https://github.com/ant-design/ant-design/pull/31224) [@kerm1it](https://github.com/kerm1it)
- 🐞 修复 Table 组合列上的筛选状态 `filteredValue` 不生效的问题。[#30815](https://github.com/ant-design/ant-design/pull/30815) [@moraispgsi](https://github.com/moraispgsi)
- Form
- 🐞 修复 Form 错误校验状态下 Input 的聚焦外框色。[#31240](https://github.com/ant-design/ant-design/pull/31240)
- 🆕 Form 增加 `name` 作为验证消息 `label` 的默认值。[#30179](https://github.com/ant-design/ant-design/pull/30179) [@jameslahm](https://github.com/jameslahm)
- 💄 修复 Rate 在 Safari 下聚焦外框的样式。[#31241](https://github.com/ant-design/ant-design/pull/31241)
- 💄 微调 Select 箭头垂直位置。[#31234](https://github.com/ant-design/ant-design/pull/31234)
- 🐞 清除 Input 内容时不再触发 `onBlur`,修复可编辑表格 Input 无法正确清除内容的问题。[#31202](https://github.com/ant-design/ant-design/pull/31202)
- 🐞 修复 Tooltip `arrowPointAtCenter` 有一像素偏移的问题。[#31201](https://github.com/ant-design/ant-design/pull/31201)
- 💄 修复 Menu 项 hover 文字色彩的渐变效果。[#31189](https://github.com/ant-design/ant-design/pull/31189)
- 🐞 修复 Dropdown.Button 不支持 `overlayClassName``overlayStyle` 的问题。[#31187](https://github.com/ant-design/ant-design/pull/31187)
- 💄 使 Pagination 选中禁用状态的按钮样式与单选框相应按钮的样式一致。[#31185](https://github.com/ant-design/ant-design/pull/31185) [@Map1en](https://github.com/Map1en)
- 🐞 修复在 Windows 环境下打包组件样式导出文件时路径错误。[#31277](https://github.com/ant-design/ant-design/pull/31277) [@aoxiang78](https://github.com/aoxiang78)
- 🌐 en_GB 语言文件中增添 `selectNone`。[#31264](https://github.com/ant-design/ant-design/pull/31264) [@Map1en](https://github.com/Map1en)
- TypeScript
- 🤖 调整 Transfer `listStyle` 属性为可选属性。[#31322](https://github.com/ant-design/ant-design/pull/31322) [@geekrainy](https://github.com/geekrainy)
## 4.16.6
`2021-06-29`
- 🐞 修复 Tree `loadData` 失败后节点 `loading` 效果没有重置的问题。[#31170](https://github.com/ant-design/ant-design/pull/31170)
- ⚡️ 优化 Progress 动画性能,显著降低 CPU 使用率。[#31128](https://github.com/ant-design/ant-design/pull/31128) [@stygian-desolator](https://github.com/stygian-desolator)
- 🐞 修复 Popover 箭头颜色和内容不匹配的问题。[#31127](https://github.com/ant-design/ant-design/pull/31127) [@A113n1003](https://github.com/A113n1003)
@ -470,7 +498,7 @@ timeline: true
- 🐞 修复不兼容 less 4.0.0 的问题。
- 🐞 修复 Typography 可编辑态光标跳动的问题。[#28545](https://github.com/ant-design/ant-design/pull/28545)
- 🐞 修复 Tree 动态加载数据时重复点击展开节点会导致状态错误的问题。[#28349](https://github.com/ant-design/ant-design/issues/28349) [@liuchao233](https://github.com/react-component/tree/pull/401)
- 🐞 修复 TreeSelect & Select `searchValue` 在受控且有值时,下拉菜单无法打开的问题。[#28574](https://github.com/ant-design/ant-design/pull/28574)
- 🐞 修复 TreeSelect Select `searchValue` 在受控且有值时,下拉菜单无法打开的问题。[#28574](https://github.com/ant-design/ant-design/pull/28574)
- 🐞 修复 Dropdown 禁用菜单项内的链接样式。[#28578](https://github.com/ant-design/ant-design/pull/28578)
- 🐞 修复 Progress `steps` 显示精度问题。[#28530](https://github.com/ant-design/ant-design/pull/28530) [@gaoryrt](https://github.com/gaoryrt)
- 🐞 修复 Radio 在 Chrome 下的对齐样式问题。[#28616](https://github.com/ant-design/ant-design/pull/28616)

View File

@ -91,17 +91,12 @@ const BackTop: React.FC<BackTopProps> = props => {
</div>
);
return (
<CSSMotion visible={visible} motionName={`${rootPrefixCls}-fade`} removeOnLeave>
{({ className: motionClassName }) => {
const childNode = children || defaultElement;
return (
<div>
{cloneElement(childNode, ({ className }) => ({
className: classNames(motionClassName, className),
}))}
</div>
);
}}
<CSSMotion visible={visible} motionName={`${rootPrefixCls}-fade`}>
{({ className: motionClassName }) =>
cloneElement(children || defaultElement, ({ className }) => ({
className: classNames(motionClassName, className),
}))
}
</CSSMotion>
);
};

View File

@ -592,33 +592,31 @@ exports[`ConfigProvider components BackTop configProvider 1`] = `
<div
class="config-back-top"
>
<div>
<div
class="config-back-top-content"
>
<div
class="config-back-top-content"
class="config-back-top-icon"
>
<div
class="config-back-top-icon"
<span
aria-label="vertical-align-top"
class="anticon anticon-vertical-align-top"
role="img"
>
<span
aria-label="vertical-align-top"
class="anticon anticon-vertical-align-top"
role="img"
<svg
aria-hidden="true"
data-icon="vertical-align-top"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<svg
aria-hidden="true"
data-icon="vertical-align-top"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M859.9 168H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM518.3 355a8 8 0 00-12.6 0l-112 141.7a7.98 7.98 0 006.3 12.9h73.9V848c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V509.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 355z"
/>
</svg>
</span>
</div>
<path
d="M859.9 168H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM518.3 355a8 8 0 00-12.6 0l-112 141.7a7.98 7.98 0 006.3 12.9h73.9V848c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V509.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 355z"
/>
</svg>
</span>
</div>
</div>
</div>
@ -628,33 +626,31 @@ exports[`ConfigProvider components BackTop configProvider componentSize large 1`
<div
class="config-back-top"
>
<div>
<div
class="config-back-top-content"
>
<div
class="config-back-top-content"
class="config-back-top-icon"
>
<div
class="config-back-top-icon"
<span
aria-label="vertical-align-top"
class="anticon anticon-vertical-align-top"
role="img"
>
<span
aria-label="vertical-align-top"
class="anticon anticon-vertical-align-top"
role="img"
<svg
aria-hidden="true"
data-icon="vertical-align-top"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<svg
aria-hidden="true"
data-icon="vertical-align-top"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M859.9 168H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM518.3 355a8 8 0 00-12.6 0l-112 141.7a7.98 7.98 0 006.3 12.9h73.9V848c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V509.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 355z"
/>
</svg>
</span>
</div>
<path
d="M859.9 168H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM518.3 355a8 8 0 00-12.6 0l-112 141.7a7.98 7.98 0 006.3 12.9h73.9V848c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V509.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 355z"
/>
</svg>
</span>
</div>
</div>
</div>
@ -664,33 +660,31 @@ exports[`ConfigProvider components BackTop configProvider componentSize middle 1
<div
class="config-back-top"
>
<div>
<div
class="config-back-top-content"
>
<div
class="config-back-top-content"
class="config-back-top-icon"
>
<div
class="config-back-top-icon"
<span
aria-label="vertical-align-top"
class="anticon anticon-vertical-align-top"
role="img"
>
<span
aria-label="vertical-align-top"
class="anticon anticon-vertical-align-top"
role="img"
<svg
aria-hidden="true"
data-icon="vertical-align-top"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<svg
aria-hidden="true"
data-icon="vertical-align-top"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M859.9 168H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM518.3 355a8 8 0 00-12.6 0l-112 141.7a7.98 7.98 0 006.3 12.9h73.9V848c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V509.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 355z"
/>
</svg>
</span>
</div>
<path
d="M859.9 168H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM518.3 355a8 8 0 00-12.6 0l-112 141.7a7.98 7.98 0 006.3 12.9h73.9V848c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V509.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 355z"
/>
</svg>
</span>
</div>
</div>
</div>
@ -700,33 +694,31 @@ exports[`ConfigProvider components BackTop configProvider virtual and dropdownMa
<div
class="ant-back-top"
>
<div>
<div
class="ant-back-top-content"
>
<div
class="ant-back-top-content"
class="ant-back-top-icon"
>
<div
class="ant-back-top-icon"
<span
aria-label="vertical-align-top"
class="anticon anticon-vertical-align-top"
role="img"
>
<span
aria-label="vertical-align-top"
class="anticon anticon-vertical-align-top"
role="img"
<svg
aria-hidden="true"
data-icon="vertical-align-top"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<svg
aria-hidden="true"
data-icon="vertical-align-top"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M859.9 168H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM518.3 355a8 8 0 00-12.6 0l-112 141.7a7.98 7.98 0 006.3 12.9h73.9V848c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V509.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 355z"
/>
</svg>
</span>
</div>
<path
d="M859.9 168H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM518.3 355a8 8 0 00-12.6 0l-112 141.7a7.98 7.98 0 006.3 12.9h73.9V848c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V509.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 355z"
/>
</svg>
</span>
</div>
</div>
</div>
@ -736,33 +728,31 @@ exports[`ConfigProvider components BackTop normal 1`] = `
<div
class="ant-back-top"
>
<div>
<div
class="ant-back-top-content"
>
<div
class="ant-back-top-content"
class="ant-back-top-icon"
>
<div
class="ant-back-top-icon"
<span
aria-label="vertical-align-top"
class="anticon anticon-vertical-align-top"
role="img"
>
<span
aria-label="vertical-align-top"
class="anticon anticon-vertical-align-top"
role="img"
<svg
aria-hidden="true"
data-icon="vertical-align-top"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<svg
aria-hidden="true"
data-icon="vertical-align-top"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M859.9 168H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM518.3 355a8 8 0 00-12.6 0l-112 141.7a7.98 7.98 0 006.3 12.9h73.9V848c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V509.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 355z"
/>
</svg>
</span>
</div>
<path
d="M859.9 168H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM518.3 355a8 8 0 00-12.6 0l-112 141.7a7.98 7.98 0 006.3 12.9h73.9V848c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V509.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 355z"
/>
</svg>
</span>
</div>
</div>
</div>
@ -772,33 +762,31 @@ exports[`ConfigProvider components BackTop prefixCls 1`] = `
<div
class="prefix-BackTop"
>
<div>
<div
class="prefix-BackTop-content"
>
<div
class="prefix-BackTop-content"
class="prefix-BackTop-icon"
>
<div
class="prefix-BackTop-icon"
<span
aria-label="vertical-align-top"
class="anticon anticon-vertical-align-top"
role="img"
>
<span
aria-label="vertical-align-top"
class="anticon anticon-vertical-align-top"
role="img"
<svg
aria-hidden="true"
data-icon="vertical-align-top"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<svg
aria-hidden="true"
data-icon="vertical-align-top"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M859.9 168H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM518.3 355a8 8 0 00-12.6 0l-112 141.7a7.98 7.98 0 006.3 12.9h73.9V848c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V509.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 355z"
/>
</svg>
</span>
</div>
<path
d="M859.9 168H164.1c-4.5 0-8.1 3.6-8.1 8v60c0 4.4 3.6 8 8.1 8h695.8c4.5 0 8.1-3.6 8.1-8v-60c0-4.4-3.6-8-8.1-8zM518.3 355a8 8 0 00-12.6 0l-112 141.7a7.98 7.98 0 006.3 12.9h73.9V848c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V509.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 355z"
/>
</svg>
</span>
</div>
</div>
</div>

View File

@ -346,6 +346,11 @@
border-width: 0 0 @border-width-base 0;
border-radius: 0;
.@{picker-prefix-cls}-content,
table {
text-align: center;
}
&-focused {
border-color: @border-color-split;
}

View File

@ -340,10 +340,10 @@
// >>> Disabled
&-disabled {
color: @disabled-color;
pointer-events: none;
.@{cellClassName} {
color: @disabled-color;
background: transparent;
}
@ -366,11 +366,6 @@
color: @text-color;
}
// Disabled
&-disabled {
cursor: not-allowed;
}
.picker-cell-inner(~'@{picker-cell-inner-cls}');
}
@ -385,12 +380,6 @@
.@{picker-cell-inner-cls} {
padding: 0 @padding-xs;
}
.@{picker-prefix-cls}-cell {
&-disabled .@{picker-cell-inner-cls} {
background: @picker-basic-cell-disabled-bg;
}
}
}
&-quarter-panel {

View File

@ -65,9 +65,7 @@ export default function ErrorList({
motionName={`${rootPrefixCls}-show-help`}
motionAppear={false}
motionEnter={false}
motionLeave
visible={!!fullKeyList.length}
removeOnLeave
onLeaveStart={node => {
// Force disable css override style in index.less configured
node.style.height = 'auto';

View File

@ -318,7 +318,7 @@ type Rule = RuleConfig | ((form: FormInstance) => RuleConfig);
| validateTrigger | Set validate trigger event. Must be the sub set of `validateTrigger` in Form.Item | string \| string\[] | |
| validator | Customize validation rule. Accept Promise as return. See [example](#components-form-demo-register) | ([rule](#Rule), value) => Promise | |
| warningOnly | Warning only. Not block form submit | boolean | 4.17.0 |
| whitespace | Failed if only has whitespace | boolean | |
| whitespace | Failed if only has whitespace, only work with `type: 'string'` rule | boolean | |
## Migrate to v4

View File

@ -317,7 +317,7 @@ type Rule = RuleConfig | ((form: FormInstance) => RuleConfig);
| validateTrigger | 设置触发验证时机,必须是 Form.Item 的 `validateTrigger` 的子集 | string \| string\[] | |
| validator | 自定义校验,接收 Promise 作为返回值。[示例](#components-form-demo-register)参考 | ([rule](#Rule), value) => Promise | |
| warningOnly | 仅警告,不阻塞表单提交 | boolean | 4.17.0 |
| whitespace | 如果字段仅包含空格则校验不通过 | boolean | |
| whitespace | 如果字段仅包含空格则校验不通过,只在 `type: 'string'` 时生效 | boolean | |
## 从 v3 升级到 v4

View File

@ -1,9 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders ./components/input/demo/addon.md correctly 1`] = `
Array [
<div
class="ant-space ant-space-vertical"
>
<div
style="margin-bottom:16px"
class="ant-space-item"
style="margin-bottom:8px"
>
<span
class="ant-input-group-wrapper"
@ -28,9 +31,10 @@ Array [
</span>
</span>
</span>
</div>,
</div>
<div
style="margin-bottom:16px"
class="ant-space-item"
style="margin-bottom:8px"
>
<span
class="ant-input-group-wrapper"
@ -171,9 +175,10 @@ Array [
</span>
</span>
</span>
</div>,
</div>
<div
style="margin-bottom:16px"
class="ant-space-item"
style="margin-bottom:8px"
>
<span
class="ant-input-group-wrapper"
@ -211,9 +216,10 @@ Array [
</span>
</span>
</span>
</div>,
</div>
<div
style="margin-bottom:16px"
class="ant-space-item"
style="margin-bottom:8px"
>
<span
class="ant-input-group-wrapper"
@ -242,8 +248,66 @@ Array [
</span>
</span>
</span>
</div>,
]
</div>
<div
class="ant-space-item"
>
<span
class="ant-input-group-wrapper"
>
<span
class="ant-input-wrapper ant-input-group"
>
<span
class="ant-input-group-addon"
>
<span
class="ant-cascader-picker"
style="width:150px"
tabindex="0"
>
<span
class="ant-cascader-picker-label"
/>
<input
autocomplete="off"
class="ant-input ant-cascader-input "
placeholder="cascader"
readonly=""
tabindex="-1"
type="text"
value=""
/>
<span
aria-label="down"
class="anticon anticon-down ant-cascader-picker-arrow"
role="img"
>
<svg
aria-hidden="true"
data-icon="down"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"
/>
</svg>
</span>
</span>
</span>
<input
class="ant-input"
type="text"
value="mysite"
/>
</span>
</span>
</div>
</div>
`;
exports[`renders ./components/input/demo/align.md correctly 1`] = `

View File

@ -14,7 +14,7 @@ title:
Using pre & post tabs example.
```jsx
import { Input, Select } from 'antd';
import { Input, Select, Space, Cascader } from 'antd';
import { SettingOutlined } from '@ant-design/icons';
const { Option } = Select;
@ -35,20 +35,16 @@ const selectAfter = (
);
ReactDOM.render(
<>
<div style={{ marginBottom: 16 }}>
<Input addonBefore="http://" addonAfter=".com" defaultValue="mysite" />
</div>
<div style={{ marginBottom: 16 }}>
<Input addonBefore={selectBefore} addonAfter={selectAfter} defaultValue="mysite" />
</div>
<div style={{ marginBottom: 16 }}>
<Input addonAfter={<SettingOutlined />} defaultValue="mysite" />
</div>
<div style={{ marginBottom: 16 }}>
<Input addonBefore="http://" suffix=".com" defaultValue="mysite" />
</div>
</>,
<Space direction="vertical">
<Input addonBefore="http://" addonAfter=".com" defaultValue="mysite" />
<Input addonBefore={selectBefore} addonAfter={selectAfter} defaultValue="mysite" />
<Input addonAfter={<SettingOutlined />} defaultValue="mysite" />
<Input addonBefore="http://" suffix=".com" defaultValue="mysite" />
<Input
addonBefore={<Cascader placeholder="cascader" style={{ width: 150 }} />}
defaultValue="mysite"
/>
</Space>,
mountNode,
);
```

View File

@ -205,6 +205,17 @@
}
}
}
// https://github.com/ant-design/ant-design/issues/31333
.@{ant-prefix}-cascader-picker {
margin: -9px (-@control-padding-horizontal);
background-color: transparent;
.@{ant-prefix}-cascader-input {
text-align: left;
border: 0;
box-shadow: none;
}
}
}
// Reset rounded corners

View File

@ -639,7 +639,7 @@
@picker-basic-cell-hover-color: @item-hover-bg;
@picker-basic-cell-active-with-range-color: @primary-1;
@picker-basic-cell-hover-with-range-color: lighten(@primary-color, 35%);
@picker-basic-cell-disabled-bg: @disabled-bg;
@picker-basic-cell-disabled-bg: rgba(0, 0, 0, 0.04);
@picker-border-color: @border-color-split;
@picker-date-hover-range-border-color: lighten(@primary-color, 20%);
@picker-date-hover-range-color: @picker-basic-cell-hover-with-range-color;

View File

@ -70,7 +70,7 @@ export interface TransferProps<RecordType> {
onChange?: (targetKeys: string[], direction: TransferDirection, moveKeys: string[]) => void;
onSelectChange?: (sourceSelectedKeys: string[], targetSelectedKeys: string[]) => void;
style?: React.CSSProperties;
listStyle: ((style: ListStyle) => React.CSSProperties) | React.CSSProperties;
listStyle?: ((style: ListStyle) => React.CSSProperties) | React.CSSProperties;
operationStyle?: React.CSSProperties;
titles?: React.ReactNode[];
operations?: string[];
@ -301,7 +301,7 @@ class Transfer<RecordType extends TransferItem = TransferItem> extends React.Com
}
handleListStyle = (
listStyle: ((style: ListStyle) => React.CSSProperties) | React.CSSProperties,
listStyle: TransferProps<RecordType>['listStyle'],
direction: TransferDirection,
) => {
if (typeof listStyle === 'function') {

View File

@ -44,6 +44,7 @@ Almost anything can be represented in a tree structure. Examples include directo
| switcherIcon | Customize collapse/expand icon of tree node | ReactNode | - | |
| titleRender | Customize tree node title render | (nodeData) => ReactNode | - | 4.5.0 |
| treeData | The treeNodes data Array, if set it then you need not to construct children TreeNode. (key should be unique across the whole array) | array&lt;{ key, title, children, \[disabled, selectable] }> | - | |
| treeLoadedKeys | (Controlled) Set loaded tree nodes, work with `loadData` only | string[] | [] | |
| virtual | Disable virtual scroll when set to false | boolean | true | 4.1.0 |
| onCheck | Callback function for when the onCheck event occurs | function(checkedKeys, e:{checked: bool, checkedNodes, node, event, halfCheckedKeys}) | - | |
| onDragEnd | Callback function for when the onDragEnd event occurs | function({event, node}) | - | |

View File

@ -45,6 +45,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/Xh-oWqg9k/Tree.svg
| switcherIcon | 自定义树节点的展开/折叠图标 | ReactNode | - | |
| titleRender | 自定义渲染节点 | (nodeData) => ReactNode | - | 4.5.0 |
| treeData | treeNodes 数据,如果设置则不需要手动构造 TreeNode 节点key 在整个树范围内唯一) | array&lt;{key, title, children, \[disabled, selectable]}> | - | |
| treeLoadedKeys | (受控)已经加载的节点,需要配合 `loadData` 使用 | string[] | [] | |
| virtual | 设置 false 时关闭虚拟滚动 | boolean | true | 4.1.0 |
| onCheck | 点击复选框触发 | function(checkedKeys, e:{checked: bool, checkedNodes, node, event, halfCheckedKeys}) | - | |
| onDragEnd | dragend 触发时调用 | function({event, node}) | - | |

View File

@ -1,6 +1,6 @@
{
"name": "antd",
"version": "4.16.6",
"version": "4.16.7",
"description": "An enterprise-class UI design language and React components implementation",
"title": "Ant Design",
"keywords": [
@ -155,7 +155,7 @@
"@ant-design/bisheng-plugin": "^2.3.0",
"@ant-design/hitu": "^0.0.0-alpha.13",
"@ant-design/tools": "^13.6.0",
"@docsearch/react": "^3.0.0-alpha.36",
"@docsearch/react": "^3.0.0-alpha.37",
"@qixian.cs/github-contributors-list": "^1.0.3",
"@stackblitz/sdk": "^1.3.0",
"@types/classnames": "^2.2.8",

View File

@ -15,7 +15,6 @@ import {
ProfileOutlined,
BugOutlined,
IssuesCloseOutlined,
BookOutlined,
QuestionCircleOutlined,
} from '@ant-design/icons';
import { isLocalStorageNameSupported, loadScript, getLocalizedPathname } from '../utils';
@ -234,12 +233,6 @@ class Footer extends React.Component<WrappedComponentProps & { location: any }>
url: 'https://github.com/ant-design/ant-design/issues',
openExternal: true,
},
{
icon: <BookOutlined />,
title: <FormattedMessage id="app.footer.course" />,
url: 'https://www.yuque.com/ant-design/course',
openExternal: true,
},
{
icon: <QuestionCircleOutlined />,
title: <FormattedMessage id="app.footer.discussions" />,

View File

@ -6,7 +6,7 @@ import { SharedProps } from './interface';
const smallStyle = { fontSize: 12, color: '#777', marginLeft: '0.3em' };
export function getEcosystemGroup({ isZhCN }: SharedProps): React.ReactNode {
export function getEcosystemGroup(): React.ReactNode {
return [
<Menu.Item key="charts">
<a
@ -29,15 +29,15 @@ export function getEcosystemGroup({ isZhCN }: SharedProps): React.ReactNode {
</a>
</Menu.Item>,
<Menu.Item key="procomponents">
<a
href="http://procomponents.ant.design"
className="header-link"
target="_blank"
rel="noopener noreferrer"
>
<FormattedMessage id="app.header.menu.pro.components" />
</a>
</Menu.Item>,
<a
href="http://procomponents.ant.design"
className="header-link"
target="_blank"
rel="noopener noreferrer"
>
<FormattedMessage id="app.header.menu.pro.components" />
</a>
</Menu.Item>,
<Menu.Item key="ng">
<a
href="http://ng.ant.design"
@ -52,35 +52,18 @@ export function getEcosystemGroup({ isZhCN }: SharedProps): React.ReactNode {
</a>
</Menu.Item>,
<Menu.Item key="vue">
<a
href="http://antdv.com"
className="header-link"
target="_blank"
rel="noopener noreferrer"
>
<a href="http://antdv.com" className="header-link" target="_blank" rel="noopener noreferrer">
Ant Design of Vue
<span style={smallStyle}>
(<FormattedMessage id="app.implementation.community" />)
</span>
</a>
</Menu.Item>,
isZhCN ? (
<Menu.Item key="course" className="hide-in-home-page">
<a
href="https://www.yuque.com/ant-design/course"
className="header-link"
target="_blank"
rel="noopener noreferrer"
>
Ant Design
</a>
</Menu.Item>
) : null,
];
}
export default (props: SharedProps) => {
const menu = <Menu>{getEcosystemGroup(props)}</Menu>;
const menu = <Menu>{getEcosystemGroup()}</Menu>;
const downstyle = props.isRTL ? '-1px 2px 0 0' : '-1px 0 0 2px';
return (
<Dropdown overlay={menu} placement="bottomRight">

View File

@ -24,7 +24,6 @@ export interface NavigationProps extends SharedProps {
export default ({
isZhCN,
isRTL,
isMobile,
pathname,
responsive,
@ -58,7 +57,7 @@ export default ({
<Menu.Item key="switch-direction" onClick={onDirectionChange}>
{directionText}
</Menu.Item>,
getEcosystemGroup({ isZhCN, isRTL }),
getEcosystemGroup(),
];
if (isMobile) {

View File

@ -65,7 +65,6 @@ module.exports = {
'app.home.view-more': '查看全部',
'app.footer.repo': 'GitHub 仓库',
'app.footer.awesome': 'Awesome Ant Design',
'app.footer.course': 'Ant Design 实战教程',
'app.footer.chinamirror': '国内镜像站点 🇨🇳',
'app.footer.primary-color-changing': '正在修改主题色...',
'app.footer.primary-color-changed': '修改主题色成功!',