Merge pull request #24018 from ant-design/master

chore: Feature merge master
This commit is contained in:
二货机器人 2020-05-10 18:42:00 +08:00 committed by GitHub
commit 1cf1a15d50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 300 additions and 311 deletions

View File

@ -1,172 +1,164 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders ./components/drawer/demo/basic-right.md correctly 1`] = `
<div>
<button
class="ant-btn ant-btn-primary"
type="button"
>
<span>
Open
</span>
</button>
</div>
<button
class="ant-btn ant-btn-primary"
type="button"
>
<span>
Open
</span>
</button>
`;
exports[`renders ./components/drawer/demo/form-in-drawer.md correctly 1`] = `
<div>
<button
class="ant-btn ant-btn-primary"
type="button"
<button
class="ant-btn ant-btn-primary"
type="button"
>
<span
aria-label="plus"
class="anticon anticon-plus"
role="img"
>
<span
aria-label="plus"
class="anticon anticon-plus"
role="img"
<svg
aria-hidden="true"
class=""
data-icon="plus"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<svg
aria-hidden="true"
class=""
data-icon="plus"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<defs />
<path
d="M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"
/>
<path
d="M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"
/>
</svg>
</span>
<span>
New account
</span>
</button>
</div>
<defs />
<path
d="M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"
/>
<path
d="M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"
/>
</svg>
</span>
<span>
New account
</span>
</button>
`;
exports[`renders ./components/drawer/demo/multi-level-drawer.md correctly 1`] = `
<div>
<button
class="ant-btn ant-btn-primary"
type="button"
>
<span>
Open drawer
</span>
</button>
</div>
<button
class="ant-btn ant-btn-primary"
type="button"
>
<span>
Open drawer
</span>
</button>
`;
exports[`renders ./components/drawer/demo/placement.md correctly 1`] = `
<div>
<div
class="ant-space ant-space-horizontal ant-space-align-center"
>
<div
class="ant-space ant-space-horizontal ant-space-align-center"
class="ant-space-item"
style="margin-right:8px"
>
<div
class="ant-space-item"
style="margin-right:8px"
class="ant-radio-group ant-radio-group-outline"
>
<div
class="ant-radio-group ant-radio-group-outline"
<label
class="ant-radio-wrapper"
>
<label
class="ant-radio-wrapper"
<span
class="ant-radio"
>
<input
class="ant-radio-input"
type="radio"
value="top"
/>
<span
class="ant-radio"
>
<input
class="ant-radio-input"
type="radio"
value="top"
/>
<span
class="ant-radio-inner"
/>
</span>
<span>
top
</span>
</label>
<label
class="ant-radio-wrapper"
>
<span
class="ant-radio"
>
<input
class="ant-radio-input"
type="radio"
value="right"
/>
<span
class="ant-radio-inner"
/>
</span>
<span>
right
</span>
</label>
<label
class="ant-radio-wrapper"
>
<span
class="ant-radio"
>
<input
class="ant-radio-input"
type="radio"
value="bottom"
/>
<span
class="ant-radio-inner"
/>
</span>
<span>
bottom
</span>
</label>
<label
class="ant-radio-wrapper ant-radio-wrapper-checked"
>
<span
class="ant-radio ant-radio-checked"
>
<input
checked=""
class="ant-radio-input"
type="radio"
value="left"
/>
<span
class="ant-radio-inner"
/>
</span>
<span>
left
</span>
</label>
</div>
</div>
<div
class="ant-space-item"
>
<button
class="ant-btn ant-btn-primary"
type="button"
>
<span>
Open
class="ant-radio-inner"
/>
</span>
</button>
<span>
top
</span>
</label>
<label
class="ant-radio-wrapper"
>
<span
class="ant-radio"
>
<input
class="ant-radio-input"
type="radio"
value="right"
/>
<span
class="ant-radio-inner"
/>
</span>
<span>
right
</span>
</label>
<label
class="ant-radio-wrapper"
>
<span
class="ant-radio"
>
<input
class="ant-radio-input"
type="radio"
value="bottom"
/>
<span
class="ant-radio-inner"
/>
</span>
<span>
bottom
</span>
</label>
<label
class="ant-radio-wrapper ant-radio-wrapper-checked"
>
<span
class="ant-radio ant-radio-checked"
>
<input
checked=""
class="ant-radio-input"
type="radio"
value="left"
/>
<span
class="ant-radio-inner"
/>
</span>
<span>
left
</span>
</label>
</div>
</div>
<div
class="ant-space-item"
>
<button
class="ant-btn ant-btn-primary"
type="button"
>
<span>
Open
</span>
</button>
</div>
</div>
`;
@ -233,113 +225,111 @@ exports[`renders ./components/drawer/demo/render-in-current.md correctly 1`] = `
`;
exports[`renders ./components/drawer/demo/user-profile.md correctly 1`] = `
<div>
<div
class="ant-list ant-list-split ant-list-bordered"
>
<div
class="ant-list ant-list-split ant-list-bordered"
class="ant-spin-nested-loading"
>
<div
class="ant-spin-nested-loading"
class="ant-spin-container"
>
<div
class="ant-spin-container"
<ul
class="ant-list-items"
>
<ul
class="ant-list-items"
<li
class="ant-list-item"
>
<li
class="ant-list-item"
<div
class="ant-list-item-meta"
>
<div
class="ant-list-item-meta"
class="ant-list-item-meta-avatar"
>
<div
class="ant-list-item-meta-avatar"
<span
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<span
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png"
/>
</span>
</div>
<div
class="ant-list-item-meta-content"
<img
src="https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png"
/>
</span>
</div>
<div
class="ant-list-item-meta-content"
>
<h4
class="ant-list-item-meta-title"
>
<h4
class="ant-list-item-meta-title"
<a
href="https://ant.design/index-cn"
>
<a
href="https://ant.design/index-cn"
>
Lily
</a>
</h4>
<div
class="ant-list-item-meta-description"
>
Progresser XTech
</div>
Lily
</a>
</h4>
<div
class="ant-list-item-meta-description"
>
Progresser XTech
</div>
</div>
<ul
class="ant-list-item-action"
>
<li>
<a>
View Profile
</a>
</li>
</ul>
</li>
<li
class="ant-list-item"
</div>
<ul
class="ant-list-item-action"
>
<li>
<a>
View Profile
</a>
</li>
</ul>
</li>
<li
class="ant-list-item"
>
<div
class="ant-list-item-meta"
>
<div
class="ant-list-item-meta"
class="ant-list-item-meta-avatar"
>
<div
class="ant-list-item-meta-avatar"
<span
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<span
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png"
/>
</span>
</div>
<div
class="ant-list-item-meta-content"
<img
src="https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png"
/>
</span>
</div>
<div
class="ant-list-item-meta-content"
>
<h4
class="ant-list-item-meta-title"
>
<h4
class="ant-list-item-meta-title"
<a
href="https://ant.design/index-cn"
>
<a
href="https://ant.design/index-cn"
>
Lily
</a>
</h4>
<div
class="ant-list-item-meta-description"
>
Progresser XTech
</div>
Lily
</a>
</h4>
<div
class="ant-list-item-meta-description"
>
Progresser XTech
</div>
</div>
<ul
class="ant-list-item-action"
>
<li>
<a>
View Profile
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<ul
class="ant-list-item-action"
>
<li>
<a>
View Profile
</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>

View File

@ -33,7 +33,7 @@ class App extends React.Component {
render() {
return (
<div>
<>
<Button type="primary" onClick={this.showDrawer}>
Open
</Button>
@ -48,7 +48,7 @@ class App extends React.Component {
<p>Some contents...</p>
<p>Some contents...</p>
</Drawer>
</div>
</>
);
}
}

View File

@ -36,7 +36,7 @@ class DrawerForm extends React.Component {
render() {
return (
<div>
<>
<Button type="primary" onClick={this.showDrawer}>
<PlusOutlined /> New account
</Button>
@ -52,10 +52,7 @@ class DrawerForm extends React.Component {
textAlign: 'right',
}}
>
<Button
onClick={this.onClose}
style={{ marginRight: 8 }}
>
<Button onClick={this.onClose} style={{ marginRight: 8 }}>
Cancel
</Button>
<Button onClick={this.onClose} type="primary">
@ -160,7 +157,7 @@ class DrawerForm extends React.Component {
</Row>
</Form>
</Drawer>
</div>
</>
);
}
}

View File

@ -45,7 +45,7 @@ class App extends React.Component {
render() {
return (
<div>
<>
<Button type="primary" onClick={this.showDrawer}>
Open drawer
</Button>
@ -69,7 +69,7 @@ class App extends React.Component {
This is two-level drawer
</Drawer>
</Drawer>
</div>
</>
);
}
}

View File

@ -40,10 +40,11 @@ class App extends React.Component {
};
render() {
const { placement, visible } = this.state;
return (
<div>
<>
<Space>
<RadioGroup defaultValue={this.state.placement} onChange={this.onChange}>
<RadioGroup defaultValue={placement} onChange={this.onChange}>
<Radio value="top">top</Radio>
<Radio value="right">right</Radio>
<Radio value="bottom">bottom</Radio>
@ -55,16 +56,17 @@ class App extends React.Component {
</Space>
<Drawer
title="Basic Drawer"
placement={this.state.placement}
placement={placement}
closable={false}
onClose={this.onClose}
visible={this.state.visible}
visible={visible}
key={placement}
>
<p>Some contents...</p>
<p>Some contents...</p>
<p>Some contents...</p>
</Drawer>
</div>
</>
);
}
}

View File

@ -61,14 +61,14 @@ ReactDOM.render(<App />, mountNode);
```css
.site-drawer-render-in-current-wrapper {
height: 200px;
overflow: hidden;
position: relative;
border: 1px solid #ebedf0;
border-radius: 2px;
height: 200px;
padding: 48px;
overflow: hidden;
text-align: center;
background: #fafafa;
border: 1px solid #ebedf0;
border-radius: 2px;
}
```

View File

@ -40,7 +40,7 @@ class App extends React.Component {
render() {
return (
<div>
<>
<List
dataSource={[
{
@ -162,7 +162,7 @@ class App extends React.Component {
</Col>
</Row>
</Drawer>
</div>
</>
);
}
}
@ -172,10 +172,10 @@ ReactDOM.render(<App />, mountNode);
```css
.site-description-item-profile-wrapper {
margin-bottom: 7px;
color: rgba(0, 0, 0, 0.65);
font-size: 14px;
line-height: 1.5715;
margin-bottom: 7px;
}
[data-theme='compact'] .site-description-item-profile-wrapper {
@ -184,11 +184,11 @@ ReactDOM.render(<App />, mountNode);
}
.ant-drawer-body p.site-description-item-profile-p {
display: block;
margin-bottom: 16px;
color: rgba(0, 0, 0, 0.85);
font-size: 16px;
line-height: 1.5715;
display: block;
margin-bottom: 16px;
}
[data-theme='compact'] .ant-drawer-body p.site-description-item-profile-p {
@ -197,8 +197,8 @@ ReactDOM.render(<App />, mountNode);
}
.site-description-item-profile-p-label {
margin-right: 8px;
display: inline-block;
margin-right: 8px;
color: rgba(0, 0, 0, 0.85);
}
```

View File

@ -19,7 +19,7 @@ import { DndProvider, useDrag, useDrop } from 'react-dnd';
import HTML5Backend from 'react-dnd-html5-backend';
import update from 'immutability-helper';
const type = 'DragbleBodyRow';
const type = 'DragableBodyRow';
const DragableBodyRow = ({ index, moveRow, className, style, ...restProps }) => {
const ref = React.useRef();

View File

@ -26,60 +26,60 @@ Note: `fr_FR` is the filename, follow below.
Supported languages:
| Language | Filename |
| --------------------- | -------- |
| Arabic | ar_EG |
| Azerbaijani | az_AZ |
| Bulgarian | bg_BG |
| Catalan | ca_ES |
| Czech | cs_CZ |
| Danish | da_DK |
| German | de_DE |
| Greek | el_GR |
| English (Global) | en_GB |
| English | en_US |
| Spanish | es_ES |
| Estonian | et_EE |
| Persian | fa_IR |
| Finnish | fi_FI |
| French (Belgium) | fr_BE |
| French (France) | fr_FR |
| Hebrew | he_IL |
| Hindi | hi_IN |
| Croatian | hr_HR |
| Hungarian | hu_HU |
| Armenian | hy_AM |
| Indonesian | id_ID |
| Italian | it_IT |
| Icelandic | is_IS |
| Japanese | ja_JP |
| Kurdish (Iraq) | ku_IQ |
| Kannada | kn_IN |
| Korean | ko_KR |
| Latvian | lv_LV |
| Macedonian | mk_MK |
| Mongolian | mn_MN |
| Malay (Malaysia) | ms_MY |
| Norwegian | nb_NO |
| Nepal | ne_NP |
| Dutch (Belgium) | nl_BE |
| Dutch | nl_NL |
| Polish | pl_PL |
| Portuguese (Brazil) | pt_BR |
| Portuguese | pt_PT |
| Romanian | ro_RO |
| Russian | ru_RU |
| Slovak | sk_SK |
| Serbian | sr_RS |
| Slovenian | sl_SI |
| Swedish | sv_SE |
| Tamil | ta_IN |
| Thai | th_TH |
| Turkish | tr_TR |
| Ukrainian | uk_UA |
| Vietnamese | vi_VN |
| Chinese (Simplified) | zh_CN |
| Chinese (Traditional) | zh_TW |
| Language | Filename |
| ------------------------ | -------- |
| Arabic | ar_EG |
| Azerbaijani | az_AZ |
| Bulgarian | bg_BG |
| Catalan | ca_ES |
| Czech | cs_CZ |
| Danish | da_DK |
| German | de_DE |
| Greek | el_GR |
| English (United Kingdom) | en_GB |
| English | en_US |
| Spanish | es_ES |
| Estonian | et_EE |
| Persian | fa_IR |
| Finnish | fi_FI |
| French (Belgium) | fr_BE |
| French (France) | fr_FR |
| Hebrew | he_IL |
| Hindi | hi_IN |
| Croatian | hr_HR |
| Hungarian | hu_HU |
| Armenian | hy_AM |
| Indonesian | id_ID |
| Italian | it_IT |
| Icelandic | is_IS |
| Japanese | ja_JP |
| Kurdish (Iraq) | ku_IQ |
| Kannada | kn_IN |
| Korean | ko_KR |
| Latvian | lv_LV |
| Macedonian | mk_MK |
| Mongolian | mn_MN |
| Malay (Malaysia) | ms_MY |
| Norwegian | nb_NO |
| Nepal | ne_NP |
| Dutch (Belgium) | nl_BE |
| Dutch | nl_NL |
| Polish | pl_PL |
| Portuguese (Brazil) | pt_BR |
| Portuguese | pt_PT |
| Romanian | ro_RO |
| Russian | ru_RU |
| Slovak | sk_SK |
| Serbian | sr_RS |
| Slovenian | sl_SI |
| Swedish | sv_SE |
| Tamil | ta_IN |
| Thai | th_TH |
| Turkish | tr_TR |
| Ukrainian | uk_UA |
| Vietnamese | vi_VN |
| Chinese (Simplified) | zh_CN |
| Chinese (Traditional) | zh_TW |
See usage and ways to contribute a new locale package at [ConfigProvider](/components/config-provider).

View File

@ -60,7 +60,7 @@ $ yarn add antd
```jsx
import React from 'react';
import { Button } from 'antd';
import Button from 'antd/es/button';
import './App.css';
const App = () => (