Browse Source

Merge remote-tracking branch 'origin/master' into antd-3.0

pull/7159/head
乐仪 7 years ago
parent
commit
f8f34fc1f4
  1. 8
      CHANGELOG.en-US.md
  2. 8
      CHANGELOG.zh-CN.md
  3. 2
      components/badge/style/index.less
  4. 16
      components/card/__tests__/__snapshots__/demo.test.js.snap
  5. 16
      components/card/demo/grid-card.md
  6. 4
      components/card/style/index.less
  7. 2
      components/date-picker/style/Picker.less
  8. 2
      components/date-picker/style/RangePicker.less
  9. 1
      components/dropdown/dropdown.tsx
  10. 14
      components/form/Form.tsx
  11. 1
      components/form/index.en-US.md
  12. 1
      components/form/index.zh-CN.md
  13. 2
      components/grid/style/index.less
  14. 1
      components/input-number/style/index.less
  15. 1
      components/input/style/mixin.less
  16. 4
      components/layout/style/index.less
  17. 4
      components/select/index.tsx
  18. 1
      components/steps/style/index.less
  19. 14
      components/table/util.tsx
  20. 2
      components/transfer/index.zh-CN.md
  21. 8
      components/upload/UploadList.tsx
  22. 2
      docs/react/getting-started.en-US.md
  23. 2
      docs/react/getting-started.zh-CN.md
  24. 1
      docs/spec/introduce.en-US.md
  25. 1
      docs/spec/introduce.zh-CN.md
  26. 4
      package.json

8
CHANGELOG.en-US.md

@ -17,6 +17,14 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi
---
## 2.12.5
`2017-08-07`
- Fix the `SelectPropTypes not found` issue under es mode. [#7123](https://github.com/ant-design/ant-design/issues/7123)
- Fix Row no wrap issue. [4f73a23](https://github.com/ant-design/ant-design/commit/4f73a23a103733a3c148bb04013493a042f90a8f)
- Fix broken style of InputNumber and RangePicker. [#7117](https://github.com/ant-design/ant-design/issues/7117) [#7126](https://github.com/ant-design/ant-design/issues/7126)
## 2.12.4
`2017-08-06`

8
CHANGELOG.zh-CN.md

@ -17,6 +17,14 @@ timeline: true
---
## 2.12.5
`2017-08-07`
- 修复 ES 模式下报 `SelectPropTypes not found` 的问题。[#7123](https://github.com/ant-design/ant-design/issues/7123)
- 修复 Row 在 flex 模式下元素不换行的问题。[4f73a23](https://github.com/ant-design/ant-design/commit/4f73a23a103733a3c148bb04013493a042f90a8f)
- 修复 InputNumber 和 RangePicker 的样式问题。[#7117](https://github.com/ant-design/ant-design/issues/7117) [#7126](https://github.com/ant-design/ant-design/issues/7126)
## 2.12.4
`2017-08-06`

2
components/badge/style/index.less

@ -83,7 +83,7 @@
}
&-text {
color: @text-color;
font-size: @badge-font-size;
font-size: @font-size-base;
margin-left: 8px;
}
}

16
components/card/__tests__/__snapshots__/demo.test.js.snap

@ -92,7 +92,7 @@ exports[`renders ./components/card/demo/grid-card.md correctly 1`] = `
<h3
class="ant-card-head-title"
>
卡片标题
Card Title
</h3>
</div>
<div
@ -103,43 +103,43 @@ exports[`renders ./components/card/demo/grid-card.md correctly 1`] = `
class="ant-card-grid"
style="width:25%;text-align:center;"
>
卡片内容
Content
</div>
<div
class="ant-card-grid"
style="width:25%;text-align:center;"
>
卡片内容
Content
</div>
<div
class="ant-card-grid"
style="width:25%;text-align:center;"
>
卡片内容
Content
</div>
<div
class="ant-card-grid"
style="width:25%;text-align:center;"
>
卡片内容
Content
</div>
<div
class="ant-card-grid"
style="width:25%;text-align:center;"
>
卡片内容
Content
</div>
<div
class="ant-card-grid"
style="width:25%;text-align:center;"
>
卡片内容
Content
</div>
<div
class="ant-card-grid"
style="width:25%;text-align:center;"
>
卡片内容
Content
</div>
</div>
</div>

16
components/card/demo/grid-card.md

@ -22,14 +22,14 @@ const gridStyle = {
};
ReactDOM.render(
<Card title="卡片标题" noHovering>
<Card.Grid style={gridStyle}>卡片内容</Card.Grid>
<Card.Grid style={gridStyle}>卡片内容</Card.Grid>
<Card.Grid style={gridStyle}>卡片内容</Card.Grid>
<Card.Grid style={gridStyle}>卡片内容</Card.Grid>
<Card.Grid style={gridStyle}>卡片内容</Card.Grid>
<Card.Grid style={gridStyle}>卡片内容</Card.Grid>
<Card.Grid style={gridStyle}>卡片内容</Card.Grid>
<Card title="Card Title" noHovering>
<Card.Grid style={gridStyle}>Content</Card.Grid>
<Card.Grid style={gridStyle}>Content</Card.Grid>
<Card.Grid style={gridStyle}>Content</Card.Grid>
<Card.Grid style={gridStyle}>Content</Card.Grid>
<Card.Grid style={gridStyle}>Content</Card.Grid>
<Card.Grid style={gridStyle}>Content</Card.Grid>
<Card.Grid style={gridStyle}>Content</Card.Grid>
</Card>
, mountNode);
````

4
components/card/style/index.less

@ -88,14 +88,14 @@
}
&-contain-grid &-body {
margin: -0.5px;
margin: -1px 0 0 -1px;
padding: 0;
}
&-grid {
border-radius: 0;
border: 0;
box-shadow: 0 0 0 0.5px @border-color-split, 0 0 0 0.5px @border-color-split inset;
box-shadow: 1px 0 0 0 @border-color-split, 0 1px 0 0 @border-color-split, 1px 1px 0 0 @border-color-split, 1px 0 0 0 @border-color-split inset, 0 1px 0 0 @border-color-split inset;
width: 33.33%;
float: left;
padding: @card-padding-base;

2
components/date-picker/style/Picker.less

@ -36,7 +36,7 @@
&-input {
outline: none;
display: block;
vertical-align: top;
}
&:hover &-input:not(.@{ant-prefix}-input-disabled) {

2
components/date-picker/style/RangePicker.less

@ -20,6 +20,8 @@
position: absolute;
top: 50%;
margin-top: -10px;
line-height: 20px;
height: 20px;
}
.@{calendar-prefix-cls}-range {

1
components/dropdown/dropdown.tsx

@ -23,7 +23,6 @@ export default class Dropdown extends React.Component<DropDownProps, any> {
mouseEnterDelay: 0.15,
mouseLeaveDelay: 0.1,
placement: 'bottomLeft',
minOverlayWidthMatchTrigger: false,
};
getTransitionName() {

14
components/form/Form.tsx

@ -9,10 +9,10 @@ import warning from '../_util/warning';
import FormItem from './FormItem';
import { FIELD_META_PROP } from './constants';
export interface FormCreateOption {
onFieldsChange?: (props: any, fields: Array<any>) => void;
onValuesChange?: (props: any, values: any) => void;
mapPropsToFields?: (props: any) => void;
export interface FormCreateOption<T> {
onFieldsChange?: (props: T, fields: Array<any>) => void;
onValuesChange?: (props: T, values: any) => void;
mapPropsToFields?: (props: T) => void;
withRef?: boolean;
}
@ -139,7 +139,7 @@ export default class Form extends React.Component<FormProps, any> {
static Item = FormItem;
static create = function<TOwnProps>(options?: FormCreateOption): ComponentDecorator<TOwnProps> {
static create = function<TOwnProps>(options: FormCreateOption<TOwnProps> = {}): ComponentDecorator<TOwnProps> {
const formWrapper = createDOMForm({
fieldNameProp: 'id',
...options,
@ -174,8 +174,10 @@ export default class Form extends React.Component<FormProps, any> {
this.props.form.getFieldProps = this.deprecatedGetFieldProps;
const withRef: any = {};
if (options && options.withRef) {
if (options.withRef) {
withRef.ref = 'formWrappedComponent';
} else if (this.props.wrappedComponentRef) {
withRef.ref = this.props.wrappedComponentRef;
}
return <Component {...this.props} {...withRef} />;
},

1
components/form/index.en-US.md

@ -107,6 +107,7 @@ After wrapped by `getFieldDecorator`, `value`(or other property defined by `valu
| options.getValueFromEvent | Specify how to get value from event or other onChange arguments | function(..args) | [reference](https://github.com/react-component/form#option-object) |
| options.validateTrigger | When to validate the value of children node. | string\|string[] | 'onChange' |
| options.rules | Includes validation rules. Please refer to "Validation Rules" part for details. | object[] | n/a |
| options.validateFirst | Whether stop validate on first rule of error for this field. | boolean | false |
| options.exclusive | Whether it is exclusive with other controls, particularly for Radio. | boolean | false |
| options.normalize | Normalize value to form component, [a select-all example](https://codepen.io/afc163/pen/JJVXzG?editors=001) | function(value, prevValue, allValues): any | - |

1
components/form/index.zh-CN.md

@ -108,6 +108,7 @@ CustomizedForm = Form.create({})(CustomizedForm);
| options.getValueFromEvent | 可以把 onChange 的参数(如 event)转化为控件的值 | function(..args) | [reference](https://github.com/react-component/form#option-object) |
| options.validateTrigger | 校验子节点值的时机 | string\|string[] | 'onChange' |
| options.rules | 校验规则,参考下方文档 | object[] | |
| options.validateFirst | 当某一规则校验不通过时,是否停止剩下的规则的校验 | boolean | false |
| options.exclusive | 是否和其他控件互斥,特别用于 Radio 单选控件 | boolean | false |
| options.normalize | 转换默认的 value 给控件,[一个选择全部的例子](https://codepen.io/afc163/pen/JJVXzG?editors=001) | function(value, prevValue, allValues): any | - |

2
components/grid/style/index.less

@ -10,7 +10,7 @@
.@{ant-prefix}-row-flex {
display: flex;
flex-flow: row nowrap;
flex-flow: row wrap;
&:before,
&:after {

1
components/input-number/style/index.less

@ -79,6 +79,7 @@
border: 0;
border-radius: @border-radius-base;
padding: 0 7px;
display: block;
.placeholder();
&[disabled] {

1
components/input/style/mixin.less

@ -46,6 +46,7 @@
height: @input-height-base;
cursor: text;
font-size: @font-size-base;
line-height: @line-height-base;
color: @input-color;
background-color: @input-bg;
background-image: none;

4
components/layout/style/index.less

@ -11,6 +11,10 @@
&&-has-sider {
flex-direction: row;
> .@{layout-prefix-cls},
> .@{layout-prefix-cls}-content {
overflow-x: hidden;
}
}
&-header,

4
components/select/index.tsx

@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import RcSelect, { Option, OptGroup, SelectPropTypes as RcSelectPropTypes } from 'rc-select';
import RcSelect, { Option, OptGroup } from 'rc-select';
import classNames from 'classnames';
import warning from '../_util/warning';
@ -68,7 +68,7 @@ export interface SelectContext {
}
export const SelectPropTypes = {
...RcSelectPropTypes,
...RcSelect.propTypes,
prefixCls: PropTypes.string,
className: PropTypes.string,
size: PropTypes.oneOf(['default', 'large', 'small']),

1
components/steps/style/index.less

@ -419,6 +419,7 @@
margin-top: 10px;
.@{steps-prefix-cls}-title {
padding-right: 0;
background-color: transparent;
}
}
.@{steps-prefix-cls}-status-process {

14
components/table/util.tsx

@ -4,11 +4,15 @@ export function flatArray(data: Object[] = [], childrenName = 'children') {
const result: Object[] = [];
const loop = (array) => {
array.forEach(item => {
const newItem = { ...item };
delete newItem[childrenName];
result.push(newItem);
if (item[childrenName] && item[childrenName].length > 0) {
loop(item[childrenName]);
if (item[childrenName]) {
const newItem = { ...item };
delete newItem[childrenName];
result.push(newItem);
if (item[childrenName].length > 0) {
loop(item[childrenName]);
}
} else {
result.push(item);
}
});
};

2
components/transfer/index.zh-CN.md

@ -13,7 +13,7 @@ title: Transfer
用直观的方式在两栏中移动元素,完成选择行为。
选择一个或以上的选项后,点击对应的方向键,可以把选中的选项移动到另一栏。
其中,左边一栏为 `source`,右边一栏为 `target`,API 的设计也反了这两个概念。
其中,左边一栏为 `source`,右边一栏为 `target`,API 的设计也反了这两个概念。
## API

8
components/upload/UploadList.tsx

@ -154,8 +154,12 @@ export default class UploadList extends React.Component<UploadListProps, any> {
const actions = (listType === 'picture-card' && file.status !== 'uploading')
? <span className={`${prefixCls}-list-item-actions`}>{previewIcon}{removeIcon}</span>
: removeIconCross;
const message = file.response || (file.error && file.error.statusText) || locale.uploadError;
let message;
if (file.response && typeof file.response === 'string') {
message = file.response;
} else {
message = (file.error && file.error.statusText) || locale.uploadError;
}
const iconAndPreview = (file.status === 'error')
? <Tooltip title={message}>{icon}{preview}</Tooltip>
: <span>{icon}{preview}</span>;

2
docs/react/getting-started.en-US.md

@ -3,7 +3,7 @@ order: 1
title: Getting Started
---
Ant Design React is dedicated to providing a **good development experience** for programmers and make sure that you had installed [Node.js](https://nodejs.org/)(> v4.x) correctly.
Ant Design React is dedicated to providing a **good development experience** for programmers and make sure that you had installed [Node.js](https://nodejs.org/)(> v6.5) correctly.
---

2
docs/react/getting-started.zh-CN.md

@ -7,7 +7,7 @@ Ant Design React 致力于提供给程序员**愉悦**的开发体验。
---
在开始之前,推荐先学习 [React](http://facebook.github.io/react/) 和 [ES2015](http://babeljs.io/docs/learn-es2015/),并正确安装和配置了 [Node.js](https://nodejs.org/) v4.x 或以上。
在开始之前,推荐先学习 [React](http://facebook.github.io/react/) 和 [ES2015](http://babeljs.io/docs/learn-es2015/),并正确安装和配置了 [Node.js](https://nodejs.org/) v6.5 或以上。
## 第一个例子

1
docs/spec/introduce.en-US.md

@ -30,6 +30,7 @@ We supply a series of design principles, practical patterns and high quality des
- <div class="outside-link"><a href="https://github.com/iview/iview/" target="_blank">iView (vue)</a></div>
- <div class="outside-link"><a href="https://github.com/FE-Driver/vue-beauty" target="_blank">vue-beauty</a></div>
- <div class="outside-link"><a href="https://github.com/aliqin/atui" target="_blank">ATUI (vue)</a></div>
- <div class="outside-link"><a href="https://github.com/priornix/antizer" target="_blank">antizer (ClojureScript)</a></div>
- <div class="outside-link"><a href="https://github.com/idcos/antd-ember" target="_blank">antd-ember</a></div>
## Who's using Ant Design

1
docs/spec/introduce.zh-CN.md

@ -30,6 +30,7 @@ Ant Design 是一个致力于提升『用户』和『设计者』使用体验的
- <div class="outside-link"><a href="https://github.com/iview/iview/" target="_blank">iView (vue)</a></div>
- <div class="outside-link"><a href="https://github.com/FE-Driver/vue-beauty" target="_blank">vue-beauty</a></div>
- <div class="outside-link"><a href="https://github.com/aliqin/atui" target="_blank">ATUI (vue)</a></div>
- <div class="outside-link"><a href="https://github.com/priornix/antizer" target="_blank">antizer (ClojureScript)</a></div>
- <div class="outside-link"><a href="https://github.com/idcos/antd-ember" target="_blank">antd-ember</a></div>
## 谁在使用

4
package.json

@ -1,6 +1,6 @@
{
"name": "antd",
"version": "2.12.4",
"version": "2.12.5",
"title": "Ant Design",
"description": "An enterprise-class UI design language and React-based implementation",
"homepage": "http://ant.design/",
@ -51,7 +51,7 @@
"rc-checkbox": "~2.0.3",
"rc-collapse": "~1.7.5",
"rc-dialog": "~6.5.10",
"rc-dropdown": "~1.4.11",
"rc-dropdown": "~1.5.0",
"rc-editor-mention": "~0.6.12",
"rc-form": "~1.4.0",
"rc-input-number": "~3.6.0",

Loading…
Cancel
Save