Browse Source

Merge branch "1.x-stable"

pull/3050/head
afc163 8 years ago
parent
commit
9e5061acdc
  1. 11
      CHANGELOG.md
  2. 2
      components/cascader/style/index.less
  3. 16
      components/dropdown/demo/dropdown-button.md
  4. 4
      components/dropdown/index.en-US.md
  5. 2
      components/dropdown/index.zh-CN.md
  6. 13
      components/dropdown/style/index.less
  7. 2
      components/form/index.en-US.md
  8. 2
      components/form/index.zh-CN.md
  9. 12
      components/form/style/index.less
  10. 1
      components/select/style/index.less
  11. 1
      components/table/style/index.less
  12. 1
      components/upload/demo/beforeUpload.md
  13. 11
      components/upload/index.tsx
  14. 14
      docs/spec/colors.md

11
CHANGELOG.md

@ -9,6 +9,17 @@ timeline: true
---
## 1.11.1
`2016-09-14`
- 修复 Menu 设置成 `theme=dark` 后,链接点击无效的问题。[#2929](https://github.com/ant-design/ant-design/issues/2929)
- 修复迷你型 Table 表头与内容不对齐的问题。[#2933](https://github.com/ant-design/ant-design/issues/2933)
- 修复 Cascader hover 样式。[#3015](https://github.com/ant-design/ant-design/issues/3015)
- 修复 Upload 上传多个文件时,`onChange` 调用不正确的问题。[#3001](https://github.com/ant-design/ant-design/issues/3001)
- 修复 TimePicker 报错样式的问题。[#2973](https://github.com/ant-design/ant-design/issues/2973)
- 修复 Calendar 控件的年度选择下拉内容截断的问题。[#2927](https://github.com/ant-design/ant-design/issues/2927)
## 1.11.0
`2016-09-01`

2
components/cascader/style/index.less

@ -11,6 +11,8 @@
cursor: pointer;
width: 100%;
z-index: 1;
background: transparent;
color: transparent;
}
&-picker {
position: relative;

16
components/dropdown/demo/dropdown-button.md

@ -14,8 +14,7 @@ title:
A button is on the left, and a related functional menu is on the right.
````jsx
import { Menu, Dropdown } from 'antd';
const DropdownButton = Dropdown.Button;
import { Menu, Dropdown, Button, Icon } from 'antd';
function handleButtonClick(e) {
console.log('click left button', e);
@ -34,8 +33,15 @@ const menu = (
);
ReactDOM.render(
<DropdownButton onClick={handleButtonClick} overlay={menu} type="primary">
某功能按钮
</DropdownButton>
<div>
<Dropdown.Button onClick={handleButtonClick} overlay={menu} type="ghost">
某功能按钮
</Dropdown.Button>
<Dropdown overlay={menu}>
<Button type="ghost" style={{ marginLeft: 8 }}>
按钮 <Icon type="down" />
</Button>
</Dropdown>
</div>
, mountNode);
````

4
components/dropdown/index.en-US.md

@ -27,7 +27,7 @@ You can get the menu list by `antd.Menu`, and set a callback function `onSelect`
> Warning: You must set a unique `key` for `Menu.Item`.
### DropdownButton
### Dropdown.Button
| Property | Description | Type | Default |
|--------------|----------------|----------|--------------|
@ -37,5 +37,3 @@ You can get the menu list by `antd.Menu`, and set a callback function `onSelect`
| overlay | the dropdown menu | [Menu](/components/menu) | - |
| visible | determine whether the dropdown menu is visible | Boolean | - |
| onVisibleChange | a callback function takes an argument: `visible`, can be executed when the visible state is changing | Function | - |

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

@ -27,7 +27,7 @@ english: Dropdown
> 注意: Menu.Item 必须设置唯一的 key 属性。
### DropdownButton
### Dropdown.Button
| 参数 | 说明 | 类型 | 默认值 |
|-------------|------------------|--------------------|--------------|

13
components/dropdown/style/index.less

@ -17,7 +17,7 @@
position: relative;
.@{ant-prefix}-btn > .@{iconfont-css-prefix}-down {
.iconfont-size-under-12px(10px);
.iconfont-size-under-12px(9px);
}
.@{iconfont-css-prefix}-down:before {
@ -110,7 +110,7 @@
content: "\e600";
right: 15px;
color: #999;
.iconfont-size-under-12px(8px);
.iconfont-size-under-12px(9px);
}
&-submenu-vertical {
@ -157,8 +157,7 @@
.@{dropdown-prefix-cls}-link {
font-size: 12px;
.@{iconfont-css-prefix}-down {
.iconfont-size-under-12px(8px);
font-weight: bold;
.iconfont-size-under-12px(9px);
}
}
@ -167,6 +166,10 @@
padding-right: 7px;
}
.@{iconfont-css-prefix}-down {
.iconfont-size-under-12px(10px);
.iconfont-size-under-12px(9px);
}
}
.ant-btn .anticon-down {
.iconfont-size-under-12px(9px);
}

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

@ -66,7 +66,7 @@ If the form has been decorated by `Form.create` then it has `this.props.form` pr
|-----------|------------------------------------------|------------|
| getFieldsValue | Get the specified fields' values. If you don't specify a parameter, you will get all fields' values. | Function([fieldNames: string[]]) |
| getFieldValue | Get the value of a field. | Function(fieldName: string) |
| setFieldsValue | Set the value of a field.(Note: please don't use it in `componentWillReceiveProps`, otherwise, it will cause an endless loop, [more](https://github.com/ant-design/ant-design/issues/2985)) | Function(obj: object) |
| setFieldsValue | Set the value of a field.(Note: please don't use it in `componentWillReceiveProps`, otherwise, it will cause an endless loop, [more](https://github.com/ant-design/ant-design/issues/2985)) | Function({ [fieldName]: value } |
| setFields | Set the value and error of a field. | Function(obj: object) |
| validateFields | Validate the specified fields and get theirs values and errors. | Function([fieldNames: string[]], [options: object], callback: Function(errors, values)) |
| validateFieldsAndScroll | This function is similar to `validateFields`, but after validation, if the target field is not in visible area of form, form will be automatically scrolled to the target field area. | same as `validateFields` |

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

@ -68,7 +68,7 @@ CustomizedForm = Form.create({})(CustomizedForm);
|-----------|------------------------------------------|------------|
| getFieldsValue | 获取一组输入控件的值,如不传入参数,则获取全部组件的值 | Function([fieldNames: string[]]) |
| getFieldValue | 获取一个输入控件的值 | Function(fieldName: string) |
| setFieldsValue | 设置一组输入控件的值(注意:不要在 `componentWillReceiveProps` 内使用,否则会导致死循环,[更多](https://github.com/ant-design/ant-design/issues/2985)) | Function(obj: object) |
| setFieldsValue | 设置一组输入控件的值(注意:不要在 `componentWillReceiveProps` 内使用,否则会导致死循环,[更多](https://github.com/ant-design/ant-design/issues/2985)) | Function({ [fieldName]: value } |
| setFields | 设置一组输入控件的值与 Error | Function(obj: object) |
| validateFields | 校验并获取一组输入域的值与 Error | Function([fieldNames: string[]], [options: object], callback: Function(errors, values)) |
| validateFieldsAndScroll | 与 `validateFields` 相似,但校验完后,如果校验不通过的菜单域不在可见范围内,则自动滚动进可见范围 | 参考 `validateFields` |

12
components/form/style/index.less

@ -357,8 +357,9 @@ form {
color: @warning-color;
}
//input-number
.@{ant-prefix}-input-number {
//input-number, timepicker
.@{ant-prefix}-input-number,
.@{ant-prefix}-time-picker-input {
border-color: @warning-color;
.active(@warning-color);
&:not([disabled]):hover {
@ -393,12 +394,13 @@ form {
}
//timepicker
.@{ant-prefix}-time-picker-picker-icon:after {
.@{ant-prefix}-picker-icon:after {
color: @error-color;
}
//input-number
.@{ant-prefix}-input-number {
//input-number, timepicker
.@{ant-prefix}-input-number,
.@{ant-prefix}-time-picker-input {
border-color: @error-color;
.active(@error-color);
&:not([disabled]):hover {

1
components/select/style/index.less

@ -439,7 +439,6 @@
white-space: nowrap;
cursor: pointer;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
transition: background 0.3s ease;

1
components/table/style/index.less

@ -160,6 +160,7 @@
border: 1px solid @border-color-split;
border-radius: @border-radius-base;
.@{table-prefix-cls}-header > table,
.@{table-prefix-cls}-body > table {
border: 0;
padding: 0 8px;

1
components/upload/demo/beforeUpload.md

@ -19,6 +19,7 @@ import { Upload, Button, Icon, message } from 'antd';
const props = {
action: '/upload.do',
multiple: true,
beforeUpload(file) {
const isJPG = file.type === 'image/jpeg';
if (!isJPG) {

11
components/upload/index.tsx

@ -96,10 +96,6 @@ export default class Upload extends React.Component<UploadProps, any> {
}
onStart = (file) => {
if (this.recentUploadStatus === false) {
return;
}
let targetItem;
let nextFileList = this.state.fileList.concat();
if (file.length > 0) {
@ -197,11 +193,6 @@ export default class Upload extends React.Component<UploadProps, any> {
this.handleRemove(targetItem);
}
beforeUpload = (file) => {
this.recentUploadStatus = this.props.beforeUpload(file);
return this.recentUploadStatus;
}
handleRemove(file) {
let fileList = this.removeFile(file);
if (fileList) {
@ -255,7 +246,7 @@ export default class Upload extends React.Component<UploadProps, any> {
onError: this.onError,
onProgress: this.onProgress,
onSuccess: this.onSuccess,
beforeUpload: this.beforeUpload,
beforeUpload: this.props.beforeUpload,
});
let uploadList;
if (this.props.showUploadList) {

14
docs/spec/colors.md

@ -157,6 +157,7 @@ ReactDOM.render(<ExtendPalettes key="palettes" />, mountNode);
`````__react
const Values = require('values.js');
const CopyToClipboard = require('react-copy-to-clipboard');
const classNames = require('classnames');
const antd = require('antd');
const Button = antd.Button;
const InputNumber = antd.InputNumber;
@ -213,11 +214,20 @@ const TintShadeTool = React.createClass({
'0': '原色',
'100': '加白'
};
const className = classNames({
'color-block': true,
copied: this.state.justCopied,
dark: this.state.darkBackground,
});
return <div style={{margin: '40px 0'}}>
<div>
<Tooltip title="点击色块复制色值">
<CopyToClipboard onCopy={this.copySuccess} text={this.state.result}>
<div style={{backgroundColor: this.state.result}} className={'color-block ' + (this.state.justCopied ? 'copied' : '') + (this.state.darkBackground ? ' dark' : '')}></div>
<CopyToClipboard
className={className}
onCopy={this.copySuccess}
text={this.state.result}
>
<div style={{backgroundColor: this.state.result}} />
</CopyToClipboard>
</Tooltip>
<span style={{width: 188, display: 'inline-block', fontFamily: 'Consolas'}}>{this.state.result}</span>

Loading…
Cancel
Save