Browse Source

Merge branch 'master' of github.com:ant-design/ant-design

pull/1954/head
偏右 9 years ago
parent
commit
23b8c44d39
  1. 2
      components/button/button.jsx
  2. 2
      components/cascader/index.md
  3. 4
      components/dropdown/demo/dropdown-button.md
  4. 4
      components/dropdown/dropdown-button.jsx
  5. 3
      components/input-number/demo/basic.md
  6. 19
      components/input-number/demo/digit.md
  7. 2
      components/input-number/index.md
  8. 6
      components/table/index.jsx
  9. 12
      components/tabs/index.jsx
  10. 2
      components/tag/index.jsx
  11. 3
      components/tree-select/index.md
  12. 27
      style/components/tabs.less

2
components/button/button.jsx

@ -25,7 +25,7 @@ function insertSpace(child) {
}
function clearButton(button) {
button.className = button.className.replace(`${prefix}clicked`, '');
button.className = button.className.replace(` ${prefix}clicked`, '');
}
export default class Button extends React.Component {

2
components/cascader/index.md

@ -27,7 +27,7 @@
| defaultValue | 默认的选中项 | array |[] |
| value | 指定选中项 | array | - |
| onChange | 选择完成后的回调 | `function(value, selectedOptions)` | - |
| displayRender | 选择后展示的渲染函数 | `function(label)`` | `function(label) { return label.join(' / ') }` |
| displayRender | 选择后展示的渲染函数 | `function(label)` | `label => label.join(' / ')` |
| style | 自定义样式 | string | - |
| className | 自定义类名 | string | - |
| popupClassName | 自定义浮层类名 | string | - |

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

@ -10,8 +10,8 @@
import { Menu, Dropdown } from 'antd';
const DropdownButton = Dropdown.Button;
function handleButtonClick() {
console.log('click button');
function handleButtonClick(e) {
console.log('click left button', e);
}
function handleMenuClick(e) {

4
components/dropdown/dropdown-button.jsx

@ -21,14 +21,14 @@ export default React.createClass({
};
},
render() {
const { type, overlay, trigger, align, children, className, ...restProps } = this.props;
const { type, overlay, trigger, align, children, className, onClick, ...restProps } = this.props;
const cls = classNames({
'ant-dropdown-button': true,
className: !!className,
});
return (
<ButtonGroup {...restProps} className={cls}>
<Button type={type}>{children}</Button>
<Button type={type} onClick={onClick}>{children}</Button>
<Dropdown align={align} overlay={overlay} trigger={trigger}>
<Button type={type}>
<Icon type="down" />

3
components/input-number/demo/basic.md

@ -2,7 +2,7 @@
- order: 0
数字输入框
数字输入框
---
@ -17,4 +17,3 @@ ReactDOM.render(
<InputNumber min={1} max={10} defaultValue={3} onChange={onChange} />
, mountNode);
````

19
components/input-number/demo/digit.md

@ -0,0 +1,19 @@
# 小数
- order: 3
和原生的数字输入框一样,value 的精度由 step 的小数位数决定。
---
````jsx
import { InputNumber } from 'antd';
function onChange(value) {
console.log('changed', value);
}
ReactDOM.render(
<InputNumber min={1} max={10} step={0.1} onChange={onChange} />
, mountNode);
````

2
components/input-number/index.md

@ -21,7 +21,7 @@
| min | 最小值 | Number | -Infinity |
| max | 最大值 | Number | Infinity |
| value | 当前值 | Number | |
| step | 每次改变步数 | Number or String | 1 |
| step | 每次改变步数,可以为小数 | Number or String | 1 |
| defaultValue | 初始值 | Number | |
| onChange | 变化回调 | Function | |
| disabled | 禁用 | Boolean | false |

6
components/table/index.jsx

@ -85,9 +85,9 @@ let AntTable = React.createClass({
componentWillReceiveProps(nextProps) {
if (('pagination' in nextProps) && nextProps.pagination !== false) {
this.setState({
pagination: objectAssign({}, defaultPagination, this.state.pagination, nextProps.pagination)
});
this.setState(previousState => ({
pagination: objectAssign({}, defaultPagination, previousState.pagination, nextProps.pagination),
}));
}
// dataSource
if ('dataSource' in nextProps &&

12
components/tabs/index.jsx

@ -58,14 +58,16 @@ class AntTabs extends React.Component {
);
}
return (
<Tabs {...this.props}
className={className}
tabBarExtraContent={
tabBarExtraContent = tabBarExtraContent ? (
<div className={`${prefixCls}-extra-content`}>
{tabBarExtraContent}
</div>
}
) : null;
return (
<Tabs {...this.props}
className={className}
tabBarExtraContent={tabBarExtraContent}
onChange={this.handleChange}
animation={animation}>
{children}

2
components/tag/index.jsx

@ -26,7 +26,7 @@ class AntTag extends React.Component {
}
animationEnd(key, existed) {
if (!existed) {
if (!existed && !this.state.closed) {
this.setState({
closed: true,
closing: false,

3
components/tree-select/index.md

@ -22,14 +22,13 @@
| defaultValue | 指定默认选中的条目 | string/Array<String> | 无 |
| multiple | 支持多选 | boolean | false |
| onSelect | 被选中时调用,参数为选中项的 value 值 | function(value) | 无 |
| onChange | 选中option,或input的value变化(combobox 模式下)时,调用此函数 | function(value, label) | 无 |
| onChange | 选中项变化时调用此函数 | function(value, label) | 无 |
| allowClear | 显示清除按钮 | boolean | false |
| onSearch | 文本框值变化时回调 | function(value: String) | |
| placeholder | 选择框默认文字 | string | 无 |
| searchPlaceholder | 搜索框默认文字 | string | 无 |
| dropdownStyle | 下拉菜单的样式 | object | 无 |
| dropdownMatchSelectWidth | 下拉菜单和选择器同宽 | boolean | true |
| combobox | 输入框自动提示模式 | boolean | false |
| size | 选择框大小,可选 `large` `small` | String | default |
| showSearch | 在下拉中显示搜索框 | boolean | false |
| disabled | 是否禁用 | boolean | false |

27
style/components/tabs.less

@ -281,6 +281,9 @@
}
&-vertical {
> .@{tab-prefix-cls}-bar {
border-bottom: 0;
.@{tab-prefix-cls}-tab {
float: none;
margin-right: 0;
@ -297,10 +300,6 @@
width: auto;
}
.@{tab-prefix-cls}-bar {
border-bottom: 0;
}
.@{tab-prefix-cls}-nav-container {
margin-bottom: 0;
}
@ -322,24 +321,20 @@
top 0.3s @ease-in-out;
}
}
.@{tab-prefix-cls}-container {
margin-bottom: 0;
}
.@{tab-prefix-cls}-content {
> .@{tab-prefix-cls}-content {
overflow: hidden;
width: auto;
}
}
&-vertical&-left {
.@{tab-prefix-cls}-bar {
> .@{tab-prefix-cls}-bar {
float: left;
border-right: 1px solid @border-color-split;
margin-right: -1px;
margin-bottom: 0;
}
.@{tab-prefix-cls}-tab {
.@{tab-prefix-cls}-tab-inner {
text-align: right;
@ -354,19 +349,19 @@
.@{tab-prefix-cls}-ink-bar {
right: 1px;
}
.@{tab-prefix-cls}-content {
}
> .@{tab-prefix-cls}-content {
padding-left: 24px;
border-left: 1px solid @border-color-split;
}
}
&-vertical&-right {
.@{tab-prefix-cls}-bar {
> .@{tab-prefix-cls}-bar {
float: right;
border-left: 1px solid @border-color-split;
margin-left: -1px;
margin-bottom: 0;
}
.@{tab-prefix-cls}-nav-container {
margin-left: -1px;
}
@ -376,18 +371,18 @@
.@{tab-prefix-cls}-ink-bar {
left: 1px;
}
.@{tab-prefix-cls}-content {
}
> .@{tab-prefix-cls}-content {
padding-right: 24px;
border-right: 1px solid @border-color-split;
}
}
&-bottom &-bar {
&-bottom > &-bar {
margin-bottom: 0;
margin-top: 16px;
}
// card style
&&-card &-nav-container {
height: 36px;

Loading…
Cancel
Save