Merge pull request #27388 from ant-design/master

chore: merge master into featrue
This commit is contained in:
偏右 2020-10-27 12:21:04 +08:00 committed by GitHub
commit 6880bf7073
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 207 additions and 170 deletions

View File

@ -1,9 +0,0 @@
codecov:
branch: master
coverage:
status:
project:
default:
# Fail the status if coverage drops by >= 0.1%
threshold: 0.1

View File

@ -28,8 +28,8 @@ import {
Transfer,
Radio,
} from 'antd';
import enUS from 'antd/es/locale/en_US';
import zhCN from 'antd/es/locale/zh_CN';
import enUS from 'antd/lib/locale/en_US';
import zhCN from 'antd/lib/locale/zh_CN';
import moment from 'moment';
import 'moment/locale/zh-cn';

View File

@ -47,7 +47,7 @@ Some components use dynamic style to support wave effect. You can config `csp` p
| getPopupContainer | To set the container of the popup element. The default is to create a `div` element in `body` | function(triggerNode) | () => document.body | |
| getTargetContainer | Config Affix, Anchor scroll target container | () => HTMLElement | () => window | 4.2.0 |
| input | Set Input common props | { autoComplete?: string } | - | 4.2.0 |
| locale | Language package setting, you can find the packages in [antd/es/locale](http://unpkg.com/antd/es/locale/) | object | - | |
| locale | Language package setting, you can find the packages in [antd/lib/locale](http://unpkg.com/antd/lib/locale/) | object | - | |
| pageHeader | Unify the ghost of PageHeader, ref [PageHeader](/components/page-header) | { ghost: boolean } | true | |
| prefixCls | Set prefix className (cooperated with [@ant-prefix](https://github.com/ant-design/ant-design/blob/2c6c789e3a9356f96c47aea0083f5a15538315cf/components/style/themes/default.less#L7)) | string | `ant` | |
| renderEmpty | Set empty content of components. Ref [Empty](/components/empty/) | function(componentName: string): ReactNode | - | |

View File

@ -48,7 +48,7 @@ export default () => (
| getPopupContainer | 弹出框Select, Tooltip, Menu 等等)渲染父节点,默认渲染到 body 上。 | function(triggerNode) | () => document.body | |
| getTargetContainer | 配置 Affix、Anchor 滚动监听容器。 | () => HTMLElement | () => window | 4.2.0 |
| input | 设置 Input 组件的通用属性 | { autoComplete?: string } | - | 4.2.0 |
| locale | 语言包配置,语言包可到 [antd/es/locale](http://unpkg.com/antd/es/locale/) 目录下寻找 | object | - | |
| locale | 语言包配置,语言包可到 [antd/lib/locale](http://unpkg.com/antd/lib/locale/) 目录下寻找 | object | - | |
| pageHeader | 统一设置 PageHeader 的 ghost参考 [PageHeader](/components/page-header) | { ghost: boolean } | true | |
| prefixCls | 设置统一样式前缀。注意:需要配合 `less` 变量 [@ant-prefix](https://github.com/ant-design/ant-design/blob/2c6c789e3a9356f96c47aea0083f5a15538315cf/components/style/themes/default.less#L7) 使用 | string | `ant` | |
| renderEmpty | 自定义组件空状态。参考 [空状态](/components/empty/) | function(componentName: string): ReactNode | - | |

View File

@ -39,7 +39,7 @@ import locale from 'antd/es/date-picker/locale/zh_CN';
// The default locale is en-US, if you want to use other locale, just set locale in entry file globally.
import moment from 'moment';
import 'moment/locale/zh-cn';
import locale from 'antd/es/locale/zh_CN';
import locale from 'antd/lib/locale/zh_CN';
<ConfigProvider locale={locale}>
<DatePicker defaultValue={moment('2015-01-01', 'YYYY-MM-DD')} />

View File

@ -40,7 +40,7 @@ import locale from 'antd/es/date-picker/locale/zh_CN';
// 默认语言为 en-US如果你需要设置其他语言推荐在入口文件全局设置 locale
import moment from 'moment';
import 'moment/locale/zh-cn';
import locale from 'antd/es/locale/zh_CN';
import locale from 'antd/lib/locale/zh_CN';
<ConfigProvider locale={locale}>
<DatePicker defaultValue={moment('2015-01-01', 'YYYY-MM-DD')} />

View File

@ -861,7 +861,11 @@ exports[`renders ./components/descriptions/demo/text.md correctly 1`] = `
<span
class="ant-descriptions-item-label"
>
Billing Mode
<div
style="display:flex"
>
Billing Mode
</div>
</span>
<span
class="ant-descriptions-item-content"

View File

@ -52,7 +52,9 @@ const columns = [
ReactDOM.render(
<Descriptions title="User Info" column={2}>
<Descriptions.Item label="Product">Cloud Database</Descriptions.Item>
<Descriptions.Item label="Billing Mode">Prepaid</Descriptions.Item>
<Descriptions.Item label={<div style={{ display: 'flex' }}>Billing Mode</div>}>
Prepaid
</Descriptions.Item>
<Descriptions.Item label="Automatic Renewal">YES</Descriptions.Item>
<Descriptions.Item label="Order time">2018-04-24 18:00:00</Descriptions.Item>
<Descriptions.Item label="Usage Time" span={2}>

View File

@ -93,13 +93,15 @@
&-item {
padding-bottom: 0;
vertical-align: top;
> span {
display: inline-flex;
align-items: baseline;
}
&-container {
display: flex;
.@{descriptions-prefix-cls}-item-label,
.@{descriptions-prefix-cls}-item-content {
display: inline-flex;
align-items: baseline;
}
}
}

View File

@ -144,6 +144,10 @@
&.@{ant-prefix}-select-focused .@{ant-prefix}-select-selector {
.active(@warning-color);
}
&-focused,
&:focus {
.active(@warning-color);
}
}
//input-number, timepicker
@ -185,6 +189,10 @@
&.@{ant-prefix}-select-focused .@{ant-prefix}-select-selector {
.active(@error-color);
}
&-focused,
&:focus {
.active(@error-color);
}
}
// fixes https://github.com/ant-design/ant-design/issues/20482

View File

@ -63,8 +63,8 @@ ReactDOM.render(
}
#components-layout-demo-basic .ant-layout-header,
#components-layout-demo-basic .ant-layout-footer {
background: #7dbcea;
color: #fff;
background: #7dbcea;
}
[data-theme="dark"] #components-layout-demo-basic .ant-layout-header {
background: #6aa0c7;
@ -76,18 +76,18 @@ ReactDOM.render(
line-height: 1.5;
}
#components-layout-demo-basic .ant-layout-sider {
background: #3ba0e9;
color: #fff;
line-height: 120px;
background: #3ba0e9;
}
[data-theme="dark"] #components-layout-demo-basic .ant-layout-sider {
background: #3499ec;
}
#components-layout-demo-basic .ant-layout-content {
background: rgba(16, 142, 233, 1);
color: #fff;
min-height: 120px;
color: #fff;
line-height: 120px;
background: rgba(16, 142, 233, 1);
}
[data-theme="dark"] #components-layout-demo-basic .ant-layout-content {
background: #107bcb;

View File

@ -98,14 +98,4 @@ ReactDOM.render(<SiderDemo />, mountNode);
#components-layout-demo-custom-trigger .trigger:hover {
color: #1890ff;
}
#components-layout-demo-custom-trigger .logo {
height: 32px;
background: rgba(255, 255, 255, 0.2);
margin: 16px;
}
.site-layout-background {
background: #fff;
}
```

View File

@ -94,7 +94,7 @@ ReactDOM.render(<SiderDemo />, mountNode);
#components-layout-demo-custom-trigger .logo {
height: 32px;
background: rgba(255, 255, 255, 0.2);
background: rgba(255, 255, 255, 0.3);
margin: 16px;
}

View File

@ -94,8 +94,8 @@ ReactDOM.render(<SiderDemo />, mountNode);
```css
#components-layout-demo-side .logo {
height: 32px;
background: rgba(255, 255, 255, 0.2);
margin: 16px;
background: rgba(255, 255, 255, 0.3);
}
.site-layout .site-layout-background {

View File

@ -83,20 +83,19 @@ ReactDOM.render(
```css
#components-layout-demo-top-side-2 .logo {
float: left;
width: 120px;
height: 31px;
background: rgba(255, 255, 255, 0.2);
margin: 16px 28px 16px 0;
float: left;
margin: 16px 24px 16px 0;
background: rgba(255, 255, 255, 0.3);
}
.ant-row-rtl #components-layout-demo-top-side-2 .logo {
float: right;
margin: 16px 0 16px 24px;
}
.site-layout-background {
background: #fff;
}
```
<style>
#components-layout-demo-top-side-2 .logo {
background: rgba(255, 255, 255, 0.3);
}
</style>

View File

@ -75,11 +75,16 @@ ReactDOM.render(
```css
#components-layout-demo-top-side .logo {
float: left;
width: 120px;
height: 31px;
background: rgba(255, 255, 255, 0.2);
margin: 16px 28px 16px 0;
float: left;
margin: 16px 24px 16px 0;
background: rgba(255, 255, 255, 0.3);
}
.ant-row-rtl #components-layout-demo-top-side .logo {
float: right;
margin: 16px 0 16px 24px;
}
.site-layout-background {

View File

@ -50,16 +50,20 @@ ReactDOM.render(
```css
.site-layout-content {
background: #fff;
padding: 24px;
min-height: 280px;
padding: 24px;
background: #fff;
}
#components-layout-demo-top .logo {
float: left;
width: 120px;
height: 31px;
background: rgba(255, 255, 255, 0.2);
margin: 16px 24px 16px 0;
float: left;
background: rgba(255, 255, 255, 0.3);
}
.ant-row-rtl #components-layout-demo-top .logo {
float: right;
margin: 16px 0 16px 24px;
}
```
@ -67,7 +71,4 @@ ReactDOM.render(
[data-theme="dark"] .site-layout-content {
background: #141414;
}
[data-theme="dark"] #components-layout-demo-top .logo {
background: rgba(255,255,255,0.3);
}
</style>

View File

@ -4,7 +4,7 @@ import TimePicker from '../time-picker/locale/kmr_IQ';
import Calendar from '../calendar/locale/kmr_IQ';
import { Locale } from '../locale-provider';
// please use antd/es/locale/kmr_IQ instead
// please use antd/lib/locale/kmr_IQ instead
// keep this file for compatibility
// https://github.com/ant-design/ant-design/issues/25778

View File

@ -4406,7 +4406,7 @@ exports[`renders ./components/transfer/demo/tree-transfer.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start"
class="ant-tree-indent-unit"
/>
</span>
<span
@ -4438,7 +4438,7 @@ exports[`renders ./components/transfer/demo/tree-transfer.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end"
class="ant-tree-indent-unit"
/>
</span>
<span

View File

@ -78,7 +78,7 @@ exports[`renders ./components/tree/demo/basic.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
</span>
<span
@ -131,7 +131,7 @@ exports[`renders ./components/tree/demo/basic.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start"
@ -166,10 +166,10 @@ exports[`renders ./components/tree/demo/basic.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
@ -201,7 +201,7 @@ exports[`renders ./components/tree/demo/basic.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
</span>
<span
@ -254,10 +254,10 @@ exports[`renders ./components/tree/demo/basic.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
class="ant-tree-indent-unit ant-tree-indent-unit-end"
/>
</span>
<span
@ -461,7 +461,7 @@ exports[`renders ./components/tree/demo/basic-controlled.md correctly 1`] = `
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
<span
class="ant-tree-indent-unit"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
@ -496,7 +496,7 @@ exports[`renders ./components/tree/demo/basic-controlled.md correctly 1`] = `
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
@ -528,7 +528,7 @@ exports[`renders ./components/tree/demo/basic-controlled.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
@ -581,10 +581,10 @@ exports[`renders ./components/tree/demo/basic-controlled.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start"
class="ant-tree-indent-unit"
/>
</span>
<span
@ -616,7 +616,7 @@ exports[`renders ./components/tree/demo/basic-controlled.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
<span
class="ant-tree-indent-unit"
@ -651,10 +651,10 @@ exports[`renders ./components/tree/demo/basic-controlled.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end"
class="ant-tree-indent-unit"
/>
</span>
<span
@ -686,7 +686,7 @@ exports[`renders ./components/tree/demo/basic-controlled.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
@ -881,7 +881,7 @@ exports[`renders ./components/tree/demo/customized-icon.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
</span>
<span
@ -930,7 +930,7 @@ exports[`renders ./components/tree/demo/customized-icon.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
</span>
<span
@ -1122,7 +1122,7 @@ exports[`renders ./components/tree/demo/directory.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
@ -1233,7 +1233,7 @@ exports[`renders ./components/tree/demo/directory.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-end"
/>
</span>
<span
@ -1282,7 +1282,7 @@ exports[`renders ./components/tree/demo/directory.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-end"
/>
</span>
<span
@ -1484,7 +1484,7 @@ exports[`renders ./components/tree/demo/draggable.md correctly 1`] = `
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
<span
class="ant-tree-indent-unit"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
@ -1514,7 +1514,7 @@ exports[`renders ./components/tree/demo/draggable.md correctly 1`] = `
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
@ -1541,7 +1541,7 @@ exports[`renders ./components/tree/demo/draggable.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
@ -1589,7 +1589,7 @@ exports[`renders ./components/tree/demo/draggable.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
@ -2025,7 +2025,7 @@ exports[`renders ./components/tree/demo/line.md correctly 1`] = `
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
<span
class="ant-tree-indent-unit"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
@ -2054,12 +2054,17 @@ exports[`renders ./components/tree/demo/line.md correctly 1`] = `
</span>
<span
class="ant-tree-node-content-wrapper ant-tree-node-content-wrapper-normal"
title="leaf"
title=""
>
<span
class="ant-tree-title"
>
leaf
<div>
multiple line title
</div>
<div>
multiple line title
</div>
</span>
</span>
</div>
@ -2074,7 +2079,7 @@ exports[`renders ./components/tree/demo/line.md correctly 1`] = `
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
@ -2120,7 +2125,7 @@ exports[`renders ./components/tree/demo/line.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
@ -2169,7 +2174,7 @@ exports[`renders ./components/tree/demo/line.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
@ -2516,7 +2521,7 @@ exports[`renders ./components/tree/demo/switcher-icon.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
</span>
<span
@ -2562,7 +2567,7 @@ exports[`renders ./components/tree/demo/switcher-icon.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start"
@ -2611,10 +2616,10 @@ exports[`renders ./components/tree/demo/switcher-icon.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
<span
class="ant-tree-indent-unit"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
@ -2660,10 +2665,10 @@ exports[`renders ./components/tree/demo/switcher-icon.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
@ -2709,7 +2714,7 @@ exports[`renders ./components/tree/demo/switcher-icon.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
</span>
<span
@ -2755,7 +2760,7 @@ exports[`renders ./components/tree/demo/switcher-icon.md correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
</span>
<span

View File

@ -95,7 +95,7 @@ exports[`Directory Tree DirectoryTree should expend all when use treeData and de
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
</span>
<span
@ -165,7 +165,7 @@ exports[`Directory Tree DirectoryTree should expend all when use treeData and de
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
@ -360,7 +360,7 @@ exports[`Directory Tree defaultExpandAll 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
@ -471,7 +471,7 @@ exports[`Directory Tree defaultExpandAll 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-end"
/>
</span>
<span
@ -520,7 +520,7 @@ exports[`Directory Tree defaultExpandAll 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-end"
/>
</span>
<span
@ -872,7 +872,7 @@ exports[`Directory Tree expand click 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
@ -1291,7 +1291,7 @@ exports[`Directory Tree expand double click 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
@ -1661,7 +1661,7 @@ exports[`Directory Tree expand with state control click 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
</span>
<span
@ -1809,7 +1809,7 @@ exports[`Directory Tree expand with state control doubleClick 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
</span>
<span
@ -2019,7 +2019,7 @@ exports[`Directory Tree expandedKeys update 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-end"
/>
</span>
<span
@ -2068,7 +2068,7 @@ exports[`Directory Tree expandedKeys update 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-end"
/>
</span>
<span
@ -2261,7 +2261,7 @@ exports[`Directory Tree group select 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
@ -2372,7 +2372,7 @@ exports[`Directory Tree group select 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-end"
/>
</span>
<span
@ -2421,7 +2421,7 @@ exports[`Directory Tree group select 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-end"
/>
</span>
<span
@ -2613,7 +2613,7 @@ exports[`Directory Tree group select 2`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
@ -2724,7 +2724,7 @@ exports[`Directory Tree group select 2`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-end"
/>
</span>
<span
@ -2773,7 +2773,7 @@ exports[`Directory Tree group select 2`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-end"
/>
</span>
<span
@ -3027,7 +3027,7 @@ exports[`Directory Tree selectedKeys update 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
@ -3138,7 +3138,7 @@ exports[`Directory Tree selectedKeys update 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-end"
/>
</span>
<span
@ -3187,7 +3187,7 @@ exports[`Directory Tree selectedKeys update 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-end"
/>
</span>
<span

View File

@ -196,7 +196,7 @@ exports[`Tree showLine is object type should render correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
</span>
<span
@ -245,7 +245,7 @@ exports[`Tree showLine is object type should render correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start"
@ -277,10 +277,10 @@ exports[`Tree showLine is object type should render correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
<span
class="ant-tree-indent-unit"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
@ -309,10 +309,10 @@ exports[`Tree showLine is object type should render correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end"
class="ant-tree-indent-unit ant-tree-indent-unit-start"
/>
</span>
<span
@ -341,7 +341,7 @@ exports[`Tree showLine is object type should render correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
</span>
<span
@ -390,7 +390,7 @@ exports[`Tree showLine is object type should render correctly 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
</span>
<span
@ -490,7 +490,7 @@ exports[`Tree switcherIcon in Tree could be string 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
</span>
<span
@ -515,7 +515,7 @@ exports[`Tree switcherIcon in Tree could be string 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
</span>
<span
@ -591,7 +591,7 @@ exports[`Tree switcherIcon should be loading icon when loadData 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
</span>
<span
@ -640,7 +640,7 @@ exports[`Tree switcherIcon should be loading icon when loadData 1`] = `
class="ant-tree-indent"
>
<span
class="ant-tree-indent-unit ant-tree-indent-unit-end ant-tree-indent-unit-end-first-level"
class="ant-tree-indent-unit ant-tree-indent-unit-start ant-tree-indent-unit-end"
/>
</span>
<span

View File

@ -30,7 +30,16 @@ const treeData = [
icon: <CarryOutOutlined />,
children: [
{ title: 'leaf', key: '0-0-0-0', icon: <CarryOutOutlined /> },
{ title: 'leaf', key: '0-0-0-1', icon: <CarryOutOutlined /> },
{
title: (
<>
<div>multiple line title</div>
<div>multiple line title</div>
</>
),
key: '0-0-0-1',
icon: <CarryOutOutlined />,
},
{ title: 'leaf', key: '0-0-0-2', icon: <CarryOutOutlined /> },
],
},

View File

@ -4,6 +4,7 @@
@tree-node-prefix-cls: ~'@{tree-prefix-cls}-treenode';
@select-tree-prefix-cls: ~'@{ant-prefix}-select-tree';
@tree-motion: ~'@{ant-prefix}-motion-collapse';
@tree-node-padding: @padding-xs / 2;
.antTreeSwitcherIcon(@type: 'tree-default-open-icon') {
.@{tree-prefix-cls}-switcher-icon,
@ -60,7 +61,7 @@
.@{custom-tree-node-prefix-cls} {
display: flex;
align-items: flex-start;
padding: 0 0 (@padding-xs / 2) 0;
padding: 0 0 @tree-node-padding 0;
outline: none;
// Disabled
&-disabled {
@ -95,10 +96,11 @@
// >>> Switcher
& &-switcher {
.antTreeSwitcherIcon();
position: relative;
flex: none;
align-self: stretch;
width: @tree-title-height;
height: @tree-title-height;
margin: 0;
line-height: @tree-title-height;
text-align: center;
@ -127,7 +129,8 @@
height: 100%;
&::before {
position: absolute;
height: @tree-title-height;
top: 0;
bottom: -@tree-node-padding;
margin-left: -1px;
border-left: 1px solid @normal-color;
content: ' ';
@ -217,37 +220,19 @@
position: relative;
height: 100%;
&:first-child::after {
&::before {
position: absolute;
top: calc(100% - @tree-title-height - 4px);
top: 0;
right: @tree-title-height / 2;
bottom: -4px;
bottom: -@tree-node-padding;
border-right: 1px solid @border-color-base;
content: '';
}
&::before {
position: absolute;
top: calc(100% - 4px);
right: -@tree-title-height / 2;
bottom: -@tree-title-height - 4px;
border-right: 1px solid @border-color-base;
content: '';
}
&-end::before,
&-end-first-level::after {
display: none;
}
}
}
/* Motion should hide line of measure */
.@{custom-tree-node-prefix-cls}-motion:not(.@{tree-motion}-leave):not(.@{tree-motion}-appear-active) {
.@{custom-tree-prefix-cls}-indent-unit {
&::after,
&::before {
display: none;
&-end {
&::before {
display: none;
}
}
}
}
@ -264,6 +249,8 @@
.@{tree-prefix-cls}-switcher {
&-leaf-line {
&::before {
top: auto !important;
bottom: auto !important;
height: @tree-title-height - 10px !important;
}
}

View File

@ -472,7 +472,7 @@ class Base extends React.Component<InternalBlockProps, BaseState> {
}
// show rest content as title on symbol
restContent = restContent?.replace(new RegExp(`^${ellipsisContent}`), '');
restContent = restContent?.slice(String(ellipsisContent || '').length);
// We move full content to outer element to avoid repeat read the content by accessibility
textNode = (

View File

@ -104,6 +104,41 @@ describe('Typography', () => {
wrapper.unmount();
});
it('string with parentheses', async () => {
const parenthesesStr = `Ant Design, a design language (for background applications, is refined by
Ant UED Team. Ant Design, a design language for background applications,
is refined by Ant UED Team. Ant Design, a design language for background
applications, is refined by Ant UED Team. Ant Design, a design language
for background applications, is refined by Ant UED Team. Ant Design, a
design language for background applications, is refined by Ant UED Team.
Ant Design, a design language for background applications, is refined by
Ant UED Team.`;
const onEllipsis = jest.fn();
const wrapper = mount(
<Base ellipsis={{ onEllipsis }} component="p" editable>
{parenthesesStr}
</Base>,
);
await sleep(20);
wrapper.update();
expect(wrapper.text()).toEqual('Ant Design, a des...');
const ellipsisSpan = wrapper.find('span[title]');
expect(ellipsisSpan.text()).toEqual('...');
expect(ellipsisSpan.props().title)
.toEqual(`ign language (for background applications, is refined by
Ant UED Team. Ant Design, a design language for background applications,
is refined by Ant UED Team. Ant Design, a design language for background
applications, is refined by Ant UED Team. Ant Design, a design language
for background applications, is refined by Ant UED Team. Ant Design, a
design language for background applications, is refined by Ant UED Team.
Ant Design, a design language for background applications, is refined by
Ant UED Team.`);
onEllipsis.mockReset();
wrapper.unmount();
});
it('should middle ellipsis', async () => {
const suffix = '--suffix';
const wrapper = mount(

View File

@ -34,7 +34,7 @@ import React, { useState } from 'react';
import { render } from 'react-dom';
import { ConfigProvider, DatePicker, message } from 'antd';
// 由于 antd 组件的默认文案是英文,所以需要修改为中文
import zhCN from 'antd/es/locale/zh_CN';
import zhCN from 'antd/lib/locale/zh_CN';
import moment from 'moment';
import 'moment/locale/zh-cn';
import 'antd/dist/antd.css';

View File

@ -11,7 +11,7 @@ The default language of `antd@2.x` is currently English. If you wish to use othe
```jsx
import { ConfigProvider } from 'antd';
import frFR from 'antd/es/locale/fr_FR';
import frFR from 'antd/lib/locale/fr_FR';
return (
<ConfigProvider locale={frFR}>

View File

@ -10,7 +10,7 @@ title: 国际化
antd 提供了一个 React 组件 [ConfigProvider](/components/config-provider) 用于全局配置国际化文案。
```jsx
import zhCN from 'antd/es/locale/zh_CN';
import zhCN from 'antd/lib/locale/zh_CN';
return (
<ConfigProvider locale={zhCN}>

View File

@ -145,7 +145,7 @@
"rc-tabs": "~11.7.0",
"rc-textarea": "~0.3.0",
"rc-tooltip": "~5.0.0",
"rc-tree": "~3.10.0",
"rc-tree": "~3.11.0",
"rc-tree-select": "~4.1.1",
"rc-trigger": "~5.0.3",
"rc-upload": "~3.3.1",

View File

@ -23,10 +23,10 @@ const LIST_CN: Recommend[] = [
popularize: true,
},
{
title: '或许这就是下一代组件库',
description: '随着 React hooks、Vue composition API 的推出,或许组件库有了新的突破点。',
img: 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*SU6hQ5jHVEsAAAAAAAAAAAAAARQnAQ',
href: 'https://zhuanlan.zhihu.com/p/252824872',
title: '第十五届 D2 前端技术论坛 - 无界',
description: '前端热爱,技术无界,第十五届 D2 前端技术论坛,我们云端相聚!',
img: 'https://img.alicdn.com/tfs/TB1R39KnSR26e4jSZFEXXbwuXXa-1960-768.png',
href: 'http://d2forum.alibaba-inc.com/',
},
{
title: 'Ant Design 4.0 的一些杂事儿 - VirtualList 篇',

View File

@ -11,8 +11,7 @@ import { ConfigProvider } from 'antd';
import LogRocket from 'logrocket';
import setupLogRocketReact from 'logrocket-react';
import { browserHistory } from 'bisheng/router';
// eslint-disable-next-line import/no-unresolved
import zhCN from 'antd/es/locale/zh_CN';
import zhCN from 'antd/lib/locale/zh_CN';
import Header from './Header';
import SiteContext from './SiteContext';
import enLocale from '../../en-US';