Skip to content

Commit

Permalink
Merge branch "1.x-stable"
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Sep 14, 2016
2 parents 1a3f37e + b983b57 commit 9e5061a
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 34 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 2 additions & 0 deletions components/cascader/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
cursor: pointer;
width: 100%;
z-index: 1;
background: transparent;
color: transparent;
}
&-picker {
position: relative;
Expand Down
16 changes: 11 additions & 5 deletions components/dropdown/demo/dropdown-button.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 changes: 1 addition & 3 deletions components/dropdown/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
|--------------|----------------|----------|--------------|
Expand All @@ -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 changes: 1 addition & 1 deletion components/dropdown/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ english: Dropdown

> 注意: Menu.Item 必须设置唯一的 key 属性。
### DropdownButton
### Dropdown.Button

| 参数 | 说明 | 类型 | 默认值 |
|-------------|------------------|--------------------|--------------|
Expand Down
13 changes: 8 additions & 5 deletions components/dropdown/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -110,7 +110,7 @@
content: "\e600";
right: 15px;
color: #999;
.iconfont-size-under-12px(8px);
.iconfont-size-under-12px(9px);
}

&-submenu-vertical {
Expand Down Expand Up @@ -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);
}
}

Expand All @@ -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 changes: 1 addition & 1 deletion components/form/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down
2 changes: 1 addition & 1 deletion components/form/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down
12 changes: 7 additions & 5 deletions components/form/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion components/select/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,6 @@
white-space: nowrap;
cursor: pointer;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
transition: background 0.3s ease;

Expand Down
1 change: 1 addition & 0 deletions components/table/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions components/upload/demo/beforeUpload.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
11 changes: 1 addition & 10 deletions components/upload/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
14 changes: 12 additions & 2 deletions docs/spec/colors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit 9e5061a

Please sign in to comment.