mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-03 04:30:06 +08:00
commit
4ec23c50c9
@ -35,6 +35,7 @@ Previewable image.
|
|||||||
src?: string; // V4.10.0
|
src?: string; // V4.10.0
|
||||||
mask?: ReactNode; // V4.9.0
|
mask?: ReactNode; // V4.9.0
|
||||||
maskClassName?: string; // V4.11.0
|
maskClassName?: string; // V4.11.0
|
||||||
|
current?: number; // V4.12.0 Only support PreviewGroup.
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/D1dXz9PZqa/image.svg
|
|||||||
src?: string; // V4.10.0
|
src?: string; // V4.10.0
|
||||||
mask?: ReactNode; // V4.9.0
|
mask?: ReactNode; // V4.9.0
|
||||||
maskClassName?: string; // V4.11.0
|
maskClassName?: string; // V4.11.0
|
||||||
|
current?: number; // V4.12.0 仅支持 PreviewGroup。
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -79,6 +79,85 @@ exports[`renders ./components/input-number/demo/basic.md correctly 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`renders ./components/input-number/demo/borderless.md correctly 1`] = `
|
||||||
|
<div
|
||||||
|
class="ant-input-number ant-input-number-borderless"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ant-input-number-handler-wrap"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-label="Increase Value"
|
||||||
|
class="ant-input-number-handler ant-input-number-handler-up"
|
||||||
|
role="button"
|
||||||
|
unselectable="on"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-label="up"
|
||||||
|
class="anticon anticon-up ant-input-number-handler-up-inner"
|
||||||
|
role="img"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
aria-hidden="true"
|
||||||
|
data-icon="up"
|
||||||
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
aria-label="Decrease Value"
|
||||||
|
class="ant-input-number-handler ant-input-number-handler-down"
|
||||||
|
role="button"
|
||||||
|
unselectable="on"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
aria-label="down"
|
||||||
|
class="anticon anticon-down ant-input-number-handler-down-inner"
|
||||||
|
role="img"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
aria-hidden="true"
|
||||||
|
data-icon="down"
|
||||||
|
fill="currentColor"
|
||||||
|
focusable="false"
|
||||||
|
height="1em"
|
||||||
|
viewBox="64 64 896 896"
|
||||||
|
width="1em"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="ant-input-number-input-wrap"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
aria-valuemax="10"
|
||||||
|
aria-valuemin="1"
|
||||||
|
aria-valuenow="3"
|
||||||
|
autocomplete="off"
|
||||||
|
class="ant-input-number-input"
|
||||||
|
max="10"
|
||||||
|
min="1"
|
||||||
|
role="spinbutton"
|
||||||
|
step="1"
|
||||||
|
value="3"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
exports[`renders ./components/input-number/demo/digit.md correctly 1`] = `
|
exports[`renders ./components/input-number/demo/digit.md correctly 1`] = `
|
||||||
<div
|
<div
|
||||||
class="ant-input-number"
|
class="ant-input-number"
|
||||||
|
20
components/input-number/demo/borderless.md
Normal file
20
components/input-number/demo/borderless.md
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
order: 6
|
||||||
|
title:
|
||||||
|
zh-CN: 无边框
|
||||||
|
en-US: Borderless
|
||||||
|
---
|
||||||
|
|
||||||
|
## zh-CN
|
||||||
|
|
||||||
|
没有边框。
|
||||||
|
|
||||||
|
## en-US
|
||||||
|
|
||||||
|
No border.
|
||||||
|
|
||||||
|
```jsx
|
||||||
|
import { InputNumber } from 'antd';
|
||||||
|
|
||||||
|
ReactDOM.render(<InputNumber min={1} max={10} defaultValue={3} bordered={false} />, mountNode);
|
||||||
|
```
|
@ -16,6 +16,7 @@ When a numeric value needs to be provided.
|
|||||||
| Property | Description | Type | Default | Version |
|
| Property | Description | Type | Default | Version |
|
||||||
| --- | --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| autoFocus | If get focus when component mounted | boolean | false | - |
|
| autoFocus | If get focus when component mounted | boolean | false | - |
|
||||||
|
| bordered | Whether has border style | boolean | true | 4.12.0 |
|
||||||
| decimalSeparator | Decimal separator | string | - | - |
|
| decimalSeparator | Decimal separator | string | - | - |
|
||||||
| defaultValue | The initial value | number | - | - |
|
| defaultValue | The initial value | number | - | - |
|
||||||
| disabled | If disable the input | boolean | false | - |
|
| disabled | If disable the input | boolean | false | - |
|
||||||
|
@ -24,6 +24,7 @@ export interface InputNumberProps
|
|||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
readOnly?: boolean;
|
readOnly?: boolean;
|
||||||
size?: SizeType;
|
size?: SizeType;
|
||||||
|
bordered?: boolean;
|
||||||
formatter?: (value: number | string | undefined) => string;
|
formatter?: (value: number | string | undefined) => string;
|
||||||
parser?: (displayValue: string | undefined) => number | string;
|
parser?: (displayValue: string | undefined) => number | string;
|
||||||
decimalSeparator?: string;
|
decimalSeparator?: string;
|
||||||
@ -45,6 +46,7 @@ const InputNumber = React.forwardRef<unknown, InputNumberProps>((props, ref) =>
|
|||||||
className,
|
className,
|
||||||
size: customizeSize,
|
size: customizeSize,
|
||||||
prefixCls: customizePrefixCls,
|
prefixCls: customizePrefixCls,
|
||||||
|
bordered = true,
|
||||||
readOnly,
|
readOnly,
|
||||||
...others
|
...others
|
||||||
} = props;
|
} = props;
|
||||||
@ -60,6 +62,7 @@ const InputNumber = React.forwardRef<unknown, InputNumberProps>((props, ref) =>
|
|||||||
[`${prefixCls}-sm`]: mergeSize === 'small',
|
[`${prefixCls}-sm`]: mergeSize === 'small',
|
||||||
[`${prefixCls}-rtl`]: direction === 'rtl',
|
[`${prefixCls}-rtl`]: direction === 'rtl',
|
||||||
[`${prefixCls}-readonly`]: readOnly,
|
[`${prefixCls}-readonly`]: readOnly,
|
||||||
|
[`${prefixCls}-borderless`]: !bordered,
|
||||||
},
|
},
|
||||||
className,
|
className,
|
||||||
);
|
);
|
||||||
|
@ -19,6 +19,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/XOS8qZ0kU/InputNumber.svg
|
|||||||
| 成员 | 说明 | 类型 | 默认值 | 版本 |
|
| 成员 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
| --- | --- | --- | --- | --- |
|
| --- | --- | --- | --- | --- |
|
||||||
| autoFocus | 自动获取焦点 | boolean | false | - |
|
| autoFocus | 自动获取焦点 | boolean | false | - |
|
||||||
|
| bordered | 是否有边框 | boolean | true | 4.12.0 |
|
||||||
| decimalSeparator | 小数点 | string | - | - |
|
| decimalSeparator | 小数点 | string | - | - |
|
||||||
| defaultValue | 初始值 | number | - | - |
|
| defaultValue | 初始值 | number | - | - |
|
||||||
| disabled | 禁用 | boolean | false | - |
|
| disabled | 禁用 | boolean | false | - |
|
||||||
|
@ -139,6 +139,10 @@
|
|||||||
font-size: 7px;
|
font-size: 7px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.@{input-number-prefix-cls}-borderless & {
|
||||||
|
border-left-width: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-handler-wrap:hover &-handler {
|
&-handler-wrap:hover &-handler {
|
||||||
@ -175,6 +179,9 @@
|
|||||||
&:hover {
|
&:hover {
|
||||||
height: 60% !important;
|
height: 60% !important;
|
||||||
}
|
}
|
||||||
|
.@{input-number-prefix-cls}-borderless & {
|
||||||
|
border-top-width: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-handler-up-disabled,
|
&-handler-up-disabled,
|
||||||
@ -186,6 +193,10 @@
|
|||||||
&-handler-down-disabled:hover &-handler-down-inner {
|
&-handler-down-disabled:hover &-handler-down-inner {
|
||||||
color: @disabled-color;
|
color: @disabled-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&-borderless {
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@import './rtl';
|
@import './rtl';
|
||||||
|
@ -17,6 +17,10 @@
|
|||||||
border-left: 0;
|
border-left: 0;
|
||||||
border-radius: @border-radius-base 0 0 @border-radius-base;
|
border-radius: @border-radius-base 0 0 @border-radius-base;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.@{input-number-prefix-cls}-rtl.@{input-number-prefix-cls}-borderless & {
|
||||||
|
border-right-width: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-input {
|
&-input {
|
||||||
|
@ -125,7 +125,7 @@
|
|||||||
"rc-drawer": "~4.2.0",
|
"rc-drawer": "~4.2.0",
|
||||||
"rc-dropdown": "~3.2.0",
|
"rc-dropdown": "~3.2.0",
|
||||||
"rc-field-form": "~1.18.0",
|
"rc-field-form": "~1.18.0",
|
||||||
"rc-image": "~5.1.1",
|
"rc-image": "~5.2.0",
|
||||||
"rc-input-number": "~6.2.0",
|
"rc-input-number": "~6.2.0",
|
||||||
"rc-mentions": "~1.5.0",
|
"rc-mentions": "~1.5.0",
|
||||||
"rc-menu": "~8.10.0",
|
"rc-menu": "~8.10.0",
|
||||||
|
Loading…
Reference in New Issue
Block a user