Browse Source

inputNumber size

pull/121/head
zhujun24 9 years ago
parent
commit
7b64e31ea3
  1. 2
      components/input-number/demo/disabled.md
  2. 29
      components/input-number/demo/size.md
  3. 1
      components/input-number/index.md
  4. 54
      style/components/inputNumber.less

2
components/input-number/demo/disabled.md

@ -1,6 +1,6 @@
# 不可用
- order: 0
- order: 2
点击按钮切换可用状态。

29
components/input-number/demo/size.md

@ -0,0 +1,29 @@
# 三种大小
- order: 1
三种大小的数字输入框,当 className 分别为 `ant-input-number-lg``ant-input-number-sm` 时,输入框高度为 `32px``22px` ,默认高度为 `28px`
---
````jsx
var InputNumber = antd.InputNumber;
function onChange(value) {
console.log('changed', value);
}
React.render(
<div>
<InputNumber className="ant-input-number-lg" min={1} max={100000} defaultValue={3} onChange={onChange} />
<InputNumber min={1} max={100000} defaultValue={3} onChange={onChange} />
<InputNumber className="ant-input-number-sm" min={1} max={100000} defaultValue={3} onChange={onChange} />
</div>
, document.getElementById('components-input-number-demo-size'));
````
````css
.ant-input-number{
margin-right: 10px;
}
````

1
components/input-number/index.md

@ -25,3 +25,4 @@
| defaultValue | 初始值 | Number | |
| onChange | 变化回调 | Function | |
| disabled | 禁用 | Boolean | false |
| className | 输入框大小 | String | 无 |

54
style/components/inputNumber.less

@ -75,6 +75,60 @@
.disabled();
}
}
&-lg{
padding: 0!important;
.ant-input-number-handler-wrap{
height: 32px;
}
.ant-input-number-input-wrap{
height: 32px;
}
.ant-input-number-handler{
height: 16px;
}
input{
height: 32px;
line-height: 32px;
font-size: 14px;
}
.ant-input-number-handler-up-inner{
top: 2px;
}
.ant-input-number-handler-down-inner{
top: 18px;
}
}
&-sm{
padding: 0!important;
.ant-input-number-handler-wrap{
height: 22px;
}
.ant-input-number-input-wrap{
height: 22px;
overflow: hidden;
position: relative;
}
.ant-input-number-handler{
height: 11px;
}
input{
height: 22px;
line-height: 22px;
position: absolute;
top: 0;
}
.ant-input-number-handler-up-inner{
top: -1px;
}
.ant-input-number-handler-down-inner{
top: 10px;
}
}
&-handler-wrap {
float: right;

Loading…
Cancel
Save