Merge pull request #23853 from ant-design/master

chore: merge master into feature
This commit is contained in:
偏右 2020-05-04 14:19:32 +08:00 committed by GitHub
commit f05f2dd197
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 65 additions and 30 deletions

View File

@ -184,6 +184,7 @@ function FormItem(props: FormItemProps): React.ReactElement {
'help',
'htmlFor',
'id', // It is deprecated because `htmlFor` is its replacement.
'initialValue',
'label',
'labelAlign',
'labelCol',

View File

@ -694,4 +694,15 @@ describe('Form', () => {
wrapper.update();
expect(wrapper.find('.ant-form-item').last().hasClass('ant-form-item-with-help')).toBeFalsy();
});
it('no warning of initialValue', () => {
mount(
<Form>
<Form.Item initialValue="bamboo">
<Input />
</Form.Item>
</Form>,
);
expect(errorSpy).not.toHaveBeenCalled();
});
});

View File

@ -7,11 +7,11 @@ title:
## zh-CN
响应式的栅格列表。尺寸与 [Layout Grid](https://ant.design/components/grid-cn/#Col) 保持一致。
响应式的栅格列表。尺寸与 [Layout Grid](/components/grid-cn/#Col) 保持一致。
## en-US
Responsive grid list. The size property the is as same as [Layout Grid](https://ant.design/components/grid/#Col).
Responsive grid list. The size property the is as same as [Layout Grid](/components/grid/#Col).
```jsx
import { List, Card } from 'antd';

View File

@ -29,6 +29,7 @@ exports[`renders ./components/progress/demo/circle.md correctly 1`] = `
a 47,47 0 1 1 0,94
a 47,47 0 1 1 0,-94"
fill-opacity="0"
opacity="1"
stroke=""
stroke-linecap="round"
stroke-width="6"
@ -70,6 +71,7 @@ exports[`renders ./components/progress/demo/circle.md correctly 1`] = `
a 47,47 0 1 1 0,94
a 47,47 0 1 1 0,-94"
fill-opacity="0"
opacity="1"
stroke=""
stroke-linecap="round"
stroke-width="6"
@ -129,6 +131,7 @@ exports[`renders ./components/progress/demo/circle.md correctly 1`] = `
a 47,47 0 1 1 0,94
a 47,47 0 1 1 0,-94"
fill-opacity="0"
opacity="1"
stroke=""
stroke-linecap="round"
stroke-width="6"
@ -193,9 +196,10 @@ exports[`renders ./components/progress/demo/circle-dynamic.md correctly 1`] = `
a 47,47 0 1 1 0,94
a 47,47 0 1 1 0,-94"
fill-opacity="0"
opacity="0"
stroke=""
stroke-linecap="round"
stroke-width="0"
stroke-width="6"
style="stroke-dasharray:0px 295.3097094374406px;stroke-dashoffset:-0px;transition:stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"
/>
</svg>
@ -297,6 +301,7 @@ exports[`renders ./components/progress/demo/circle-mini.md correctly 1`] = `
a 47,47 0 1 1 0,94
a 47,47 0 1 1 0,-94"
fill-opacity="0"
opacity="1"
stroke=""
stroke-linecap="round"
stroke-width="6"
@ -338,6 +343,7 @@ exports[`renders ./components/progress/demo/circle-mini.md correctly 1`] = `
a 47,47 0 1 1 0,94
a 47,47 0 1 1 0,-94"
fill-opacity="0"
opacity="1"
stroke=""
stroke-linecap="round"
stroke-width="6"
@ -397,6 +403,7 @@ exports[`renders ./components/progress/demo/circle-mini.md correctly 1`] = `
a 47,47 0 1 1 0,94
a 47,47 0 1 1 0,-94"
fill-opacity="0"
opacity="1"
stroke=""
stroke-linecap="round"
stroke-width="6"
@ -461,6 +468,7 @@ exports[`renders ./components/progress/demo/dashboard.md correctly 1`] = `
a 47,47 0 1 1 0,-94
a 47,47 0 1 1 0,94"
fill-opacity="0"
opacity="1"
stroke=""
stroke-linecap="round"
stroke-width="6"
@ -502,6 +510,7 @@ exports[`renders ./components/progress/demo/dashboard.md correctly 1`] = `
a 47,47 0 1 1 0,-94
a 47,47 0 1 1 0,94"
fill-opacity="0"
opacity="1"
stroke=""
stroke-linecap="round"
stroke-width="6"
@ -633,6 +642,7 @@ exports[`renders ./components/progress/demo/format.md correctly 1`] = `
a 47,47 0 1 1 0,94
a 47,47 0 1 1 0,-94"
fill-opacity="0"
opacity="1"
stroke=""
stroke-linecap="round"
stroke-width="6"
@ -674,6 +684,7 @@ exports[`renders ./components/progress/demo/format.md correctly 1`] = `
a 47,47 0 1 1 0,94
a 47,47 0 1 1 0,-94"
fill-opacity="0"
opacity="1"
stroke=""
stroke-linecap="round"
stroke-width="6"
@ -782,6 +793,7 @@ exports[`renders ./components/progress/demo/gradient-line.md correctly 1`] = `
a 47,47 0 1 1 0,94
a 47,47 0 1 1 0,-94"
fill-opacity="0"
opacity="1"
stroke="url(#ant-progress-gradient-11)"
stroke-linecap="round"
stroke-width="6"
@ -841,6 +853,7 @@ exports[`renders ./components/progress/demo/gradient-line.md correctly 1`] = `
a 47,47 0 1 1 0,94
a 47,47 0 1 1 0,-94"
fill-opacity="0"
opacity="1"
stroke="url(#ant-progress-gradient-12)"
stroke-linecap="round"
stroke-width="6"
@ -1203,6 +1216,7 @@ exports[`renders ./components/progress/demo/linecap.md correctly 1`] = `
a 47,47 0 1 1 0,94
a 47,47 0 1 1 0,-94"
fill-opacity="0"
opacity="1"
stroke=""
stroke-linecap="square"
stroke-width="6"
@ -1244,6 +1258,7 @@ exports[`renders ./components/progress/demo/linecap.md correctly 1`] = `
a 47,47 0 1 1 0,-94
a 47,47 0 1 1 0,94"
fill-opacity="0"
opacity="1"
stroke=""
stroke-linecap="square"
stroke-width="6"
@ -1316,6 +1331,7 @@ exports[`renders ./components/progress/demo/segment.md correctly 1`] = `
a 47,47 0 1 1 0,94
a 47,47 0 1 1 0,-94"
fill-opacity="0"
opacity="1"
stroke=""
stroke-linecap="round"
stroke-width="6"
@ -1327,6 +1343,7 @@ exports[`renders ./components/progress/demo/segment.md correctly 1`] = `
a 47,47 0 1 1 0,94
a 47,47 0 1 1 0,-94"
fill-opacity="0"
opacity="1"
stroke=""
stroke-linecap="round"
stroke-width="6"
@ -1368,6 +1385,7 @@ exports[`renders ./components/progress/demo/segment.md correctly 1`] = `
a 47,47 0 1 1 0,-94
a 47,47 0 1 1 0,94"
fill-opacity="0"
opacity="1"
stroke=""
stroke-linecap="round"
stroke-width="6"
@ -1379,6 +1397,7 @@ exports[`renders ./components/progress/demo/segment.md correctly 1`] = `
a 47,47 0 1 1 0,-94
a 47,47 0 1 1 0,94"
fill-opacity="0"
opacity="1"
stroke=""
stroke-linecap="round"
stroke-width="6"

View File

@ -28,9 +28,10 @@ exports[`Progress render dashboard 295 gapDegree 1`] = `
a 47,47 0 1 1 0,-94
a 47,47 0 1 1 0,94"
fill-opacity="0"
opacity="0"
stroke=""
stroke-linecap="round"
stroke-width="0"
stroke-width="6"
style="stroke-dasharray: 0px 295.3097094374406px; stroke-dashoffset: -147.5px; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s;"
/>
</svg>
@ -72,9 +73,10 @@ exports[`Progress render dashboard 296 gapDegree 1`] = `
a 47,47 0 1 1 0,-94
a 47,47 0 1 1 0,94"
fill-opacity="0"
opacity="0"
stroke=""
stroke-linecap="round"
stroke-width="0"
stroke-width="6"
style="stroke-dasharray: 0px 295.3097094374406px; stroke-dashoffset: -148px; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s;"
/>
</svg>
@ -116,9 +118,10 @@ exports[`Progress render dashboard zero gapDegree 1`] = `
a 47,47 0 1 1 0,-94
a 47,47 0 1 1 0,94"
fill-opacity="0"
opacity="0"
stroke=""
stroke-linecap="round"
stroke-width="0"
stroke-width="6"
style="stroke-dasharray: 0px 295.3097094374406px; stroke-dashoffset: -0px; transition: stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s;"
/>
</svg>
@ -354,6 +357,7 @@ exports[`Progress render strokeColor 1`] = `
a 47,47 0 1 1 0,94
a 47,47 0 1 1 0,-94"
fill-opacity="0"
opacity="1"
stroke=""
stroke-linecap="round"
stroke-width="6"

View File

@ -18,7 +18,7 @@ Rate component.
| allowClear | whether to allow clear when click again | boolean | true |
| allowHalf | whether to allow semi selection | boolean | false |
| autoFocus | get focus when component mounted | boolean | false |
| character | custom character of rate | ReactNode | [<StarFilled /\>](https://ant.design/components/icon/) |
| character | custom character of rate | ReactNode | [<StarFilled /\>](/components/icon/) |
| className | custom class name of rate | string | |
| count | star count | number | 5 |
| defaultValue | default value | number | 0 |

View File

@ -19,7 +19,7 @@ title: Rate
| allowClear | 是否允许再次点击后清除 | boolean | true |
| allowHalf | 是否允许半选 | boolean | false |
| autoFocus | 自动获取焦点 | boolean | false |
| character | 自定义字符 | ReactNode | [<StarFilled /\>](https://ant.design/components/icon-cn/) |
| character | 自定义字符 | ReactNode | [<StarFilled /\>](/components/icon-cn/) |
| className | 自定义样式类名 | string | |
| count | star 总数 | number | 5 |
| defaultValue | 默认值 | number | 0 |

View File

@ -5,7 +5,7 @@ title: Getting Started
Ant Design React is dedicated to providing a **good development experience** for programmers. Make sure that you have installed [Node.js](https://nodejs.org/)(> 8.0.0) correctly.
If you try in local environment, Please refer to [Install and Initialization](https://ant.design/docs/react/use-with-create-react-app#Install-and-Initialization) section of "Use in create-react-app".
If you try in local environment, Please refer to [Install and Initialization](/docs/react/use-with-create-react-app#Install-and-Initialization) section of "Use in create-react-app".
> Before delving into Ant Design React, a good knowledge base of [React](https://reactjs.org) and [JavaScript ES2015](http://babeljs.io/docs/learn-es2015/) is needed.
@ -31,7 +31,7 @@ Visit http://u.ant.design/codesandbox-repro to create a codesandbox. Don't forge
Replace the content of `index.js` with the following code. As you can see, there is no difference between antd's components and typical React components.
If you already set up by [Install and Initialization](https://ant.design/docs/react/use-with-create-react-app#Install-and-Initialization) section of "Use in create-react-app", Please replace the content of /src/index.js
If you already set up by [Install and Initialization](/docs/react/use-with-create-react-app#Install-and-Initialization) section of "Use in create-react-app", Please replace the content of /src/index.js
```jsx
import React from 'react';

View File

@ -36,7 +36,7 @@ Following the Ant Design specification, we developed a React UI library `antd` t
## Environment Support
- Modern browsers and Internet Explorer 11 (with [polyfills](https://ant.design/docs/react/getting-started#Compatibility))
- Modern browsers and Internet Explorer 11 (with [polyfills](/docs/react/getting-started#Compatibility))
- Server-side Rendering
- [Electron](https://www.electronjs.org/)
@ -122,8 +122,8 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
## Links
- [Home page](https://ant.design/)
- [Components](https://ant.design/components/button/)
- [Home page](/)
- [Components](/components/button/)
- [Ant Design Pro](https://pro.ant.design/)
- [Change Log](/changelog)
- [rc-components](http://react-component.github.io/)

View File

@ -36,7 +36,7 @@ title: Ant Design of React
## 支持环境
- 现代浏览器和 IE11需要 [polyfills](https://ant.design/docs/react/getting-started-cn#兼容性))。
- 现代浏览器和 IE11需要 [polyfills](/docs/react/getting-started-cn#兼容性))。
- 支持服务端渲染。
- [Electron](https://electronjs.org/)
@ -124,8 +124,8 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
## 链接
- [首页](https://ant.design/)
- [组件库](https://ant.design/components/button-cn/)
- [首页](/)
- [组件库](/components/button-cn/)
- [Ant Design Pro](https://pro.ant.design/)
- [更新日志](/changelog)
- [React 底层基础组件](http://react-component.github.io/)

View File

@ -137,9 +137,9 @@ title:
### 会用到哪些模块或组件
- [描述列表](https://ant.design/components/descriptions-cn/#header)
- [折叠面板](https://ant.design/components/collapse-cn/)
- [表格](https://ant.design/components/table-cn/)
- [描述列表](/components/descriptions-cn/#header)
- [折叠面板](/components/collapse-cn/)
- [表格](/components/table-cn/)
### 外部参考文章

View File

@ -152,7 +152,7 @@ A. 动态增减:建议条目表单数 <=3 项,并且每个输入框不需要
#### 前期准备
- 表单页的核心由表单项组成,设计前建议先熟悉表单基础规则;
- 梳理用户当前信息录入任务中所涉及的信息类型,并根据 [antd 数据录入规则](https://ant.design/docs/spec/data-entry-cn#header) 确定所使用的组件;
- 梳理用户当前信息录入任务中所涉及的信息类型,并根据 [antd 数据录入规则](/docs/spec/data-entry-cn#header) 确定所使用的组件;
#### 布局方式
@ -198,8 +198,8 @@ A. 动态增减:建议条目表单数 <=3 项,并且每个输入框不需要
### 会用到哪些模块或组件
- [数据录入组件](https://ant.design/components/form-cn/#header)
- [步骤条](https://ant.design/components/steps-cn/#header)
- [数据录入组件](/components/form-cn/#header)
- [步骤条](/components/steps-cn/#header)
### 相关页面

View File

@ -28,7 +28,7 @@ We provide comprehensive design guidelines, best practices, resources, and tools
## Front-end Implementation
[React](http://facebook.github.io/react/) is used to encapsulate a library of components which embody our design language. We welcome the community to implement [our design system](https://ant.design/docs/spec/introduce) in other front-end frameworks of their choice.
[React](http://facebook.github.io/react/) is used to encapsulate a library of components which embody our design language. We welcome the community to implement [our design system](/docs/spec/introduce) in other front-end frameworks of their choice.
```__react
import {

View File

@ -26,5 +26,5 @@ The complete design pattern will include examples of templates, components (ETC)
We work with engineers to transform design patterns into reusable code that maximizes your productivity and communication efficiency.
- [Ant Design Pro](https://pro.ant.design): Out-of-the-box solution with 20+ templates and 10+ business components
- [Ant Design Components](https://ant.design/docs/react/introduce): Ant Design's React UI library is a global component library with 50+ base components
- [Ant Design Components](/docs/react/introduce): Ant Design's React UI library is a global component library with 50+ base components
- [Ant Design Library](http://library.ant.design/): Axure resource packs are included with the code to make your prototype look like a visual draft, including templates, components, and more.

View File

@ -175,8 +175,8 @@ Ant Design 标准注册模板
### 前期准备
- 表单页的核心由表单项组成,设计前建议先熟悉[表单基础规则](https://ant.design/components/form-cn/)
- 梳理用户当前信息录入任务中所涉及的信息类型,[并根据 Ant Design 数据录入规则](https://ant.design/docs/spec/data-entry-cn/) 确定所使用的组件。
- 表单页的核心由表单项组成,设计前建议先熟悉[表单基础规则](/components/form-cn/)
- 梳理用户当前信息录入任务中所涉及的信息类型,[并根据 Ant Design 数据录入规则](/docs/spec/data-entry-cn/) 确定所使用的组件。
### 布局方式
@ -212,7 +212,7 @@ Ant Design 标准注册模板
<img class="preview-img no-padding" align="right" src="https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*DoKmSYGaYtYAAAAAAAAAAABkARQnAQ" />
关于使用何种布局方式的判断,和[详情页](https://ant.design/docs/spec/detail-page-cn#%E8%AE%BE%E8%AE%A1%E5%BB%BA%E8%AE%AE)类似,应从信息的复杂度和关联性两个维度去梳理。随后可选择相匹配的模板,进行页面快速搭建。
关于使用何种布局方式的判断,和[详情页](/docs/spec/detail-page-cn#%E8%AE%BE%E8%AE%A1%E5%BB%BA%E8%AE%AE)类似,应从信息的复杂度和关联性两个维度去梳理。随后可选择相匹配的模板,进行页面快速搭建。
<br>
@ -220,8 +220,8 @@ Ant Design 标准注册模板
### 会用到哪些模块或组件
- [表单](https://ant.design/components/form-cn/#header)
- [步骤条](https://ant.design/components/steps-cn/#header)
- [表单](/components/form-cn/#header)
- [步骤条](/components/steps-cn/#header)
### 外部参考文章

View File

@ -110,7 +110,7 @@ title: 结果页
### 会用到哪些模块或组件
- [表单页](https://ant.design/components/form-cn/)
- [表单页](/components/form-cn/)
### 外部参考文章