2022-04-06 21:49:30 +08:00
|
|
|
import type { InputToken } from '../../input/style';
|
2022-03-14 11:40:13 +08:00
|
|
|
import {
|
|
|
|
genActiveStyle,
|
|
|
|
genBasicInputStyle,
|
|
|
|
genDisabledStyle,
|
|
|
|
genHoverStyle,
|
|
|
|
genInputGroupStyle,
|
|
|
|
genPlaceholderStyle,
|
|
|
|
genStatusStyle,
|
|
|
|
initInputToken,
|
|
|
|
} from '../../input/style';
|
2022-11-23 20:22:38 +08:00
|
|
|
import type { FullToken, GenerateStyle } from '../../theme/internal';
|
|
|
|
import { genComponentStyleHook } from '../../theme/internal';
|
2022-07-11 15:35:58 +08:00
|
|
|
import { resetComponent, resetIcon } from '../../style';
|
2022-10-28 16:09:38 +08:00
|
|
|
import { genCompactItemStyle } from '../../style/compact-item';
|
2022-02-16 11:48:24 +08:00
|
|
|
|
2022-03-29 15:57:39 +08:00
|
|
|
export interface ComponentToken {
|
|
|
|
controlWidth: number;
|
|
|
|
handleWidth: number;
|
|
|
|
handleFontSize: number;
|
2022-09-22 11:54:05 +08:00
|
|
|
/** Default `auto`. Set `true` will always show the handle */
|
|
|
|
handleVisible: 'auto' | true;
|
2022-03-29 15:57:39 +08:00
|
|
|
}
|
|
|
|
|
2022-04-06 21:49:30 +08:00
|
|
|
type InputNumberToken = InputToken<FullToken<'InputNumber'>>;
|
2022-03-14 11:40:13 +08:00
|
|
|
|
|
|
|
const genInputNumberStyles: GenerateStyle<InputNumberToken> = (token: InputNumberToken) => {
|
|
|
|
const {
|
2022-04-06 21:49:30 +08:00
|
|
|
componentCls,
|
2022-11-01 15:06:38 +08:00
|
|
|
lineWidth,
|
|
|
|
lineType,
|
2022-03-29 15:57:39 +08:00
|
|
|
colorBorder,
|
2022-11-01 15:06:38 +08:00
|
|
|
borderRadius,
|
2022-03-14 11:40:13 +08:00
|
|
|
fontSizeLG,
|
|
|
|
controlHeightLG,
|
|
|
|
controlHeightSM,
|
2022-03-22 09:37:37 +08:00
|
|
|
colorError,
|
2022-03-29 15:57:39 +08:00
|
|
|
inputPaddingHorizontalSM,
|
2022-08-04 16:16:50 +08:00
|
|
|
colorTextDescription,
|
2022-11-17 23:31:41 +08:00
|
|
|
motionDurationMid,
|
2022-03-22 09:37:37 +08:00
|
|
|
colorPrimary,
|
2022-03-14 11:40:13 +08:00
|
|
|
controlHeight,
|
|
|
|
inputPaddingHorizontal,
|
2022-06-28 20:33:01 +08:00
|
|
|
colorBgContainer,
|
2022-03-29 15:57:39 +08:00
|
|
|
colorTextDisabled,
|
2022-11-01 15:06:38 +08:00
|
|
|
borderRadiusSM,
|
|
|
|
borderRadiusLG,
|
2022-03-29 15:57:39 +08:00
|
|
|
controlWidth,
|
2022-09-22 11:54:05 +08:00
|
|
|
handleVisible,
|
2022-03-14 11:40:13 +08:00
|
|
|
} = token;
|
|
|
|
|
2022-03-29 15:57:39 +08:00
|
|
|
return [
|
|
|
|
{
|
2022-04-06 21:49:30 +08:00
|
|
|
[componentCls]: {
|
2022-03-29 15:57:39 +08:00
|
|
|
...resetComponent(token),
|
|
|
|
...genBasicInputStyle(token),
|
|
|
|
...genStatusStyle(token),
|
2022-03-14 11:40:13 +08:00
|
|
|
|
2022-03-29 15:57:39 +08:00
|
|
|
display: 'inline-block',
|
|
|
|
width: controlWidth,
|
|
|
|
margin: 0,
|
|
|
|
padding: 0,
|
2022-11-01 15:06:38 +08:00
|
|
|
border: `${lineWidth}px ${lineType} ${colorBorder}`,
|
|
|
|
borderRadius,
|
2022-03-14 11:40:13 +08:00
|
|
|
|
2022-03-29 15:57:39 +08:00
|
|
|
'&-rtl': {
|
2022-03-14 11:40:13 +08:00
|
|
|
direction: 'rtl',
|
|
|
|
|
2022-04-06 21:49:30 +08:00
|
|
|
[`${componentCls}-input`]: {
|
2022-03-29 15:57:39 +08:00
|
|
|
direction: 'rtl',
|
|
|
|
},
|
2022-03-14 11:40:13 +08:00
|
|
|
},
|
|
|
|
|
2022-03-29 15:57:39 +08:00
|
|
|
'&-lg': {
|
|
|
|
padding: 0,
|
|
|
|
fontSize: fontSizeLG,
|
2022-11-01 15:06:38 +08:00
|
|
|
borderRadius: borderRadiusLG,
|
2022-03-14 11:40:13 +08:00
|
|
|
|
2022-04-06 21:49:30 +08:00
|
|
|
[`input${componentCls}-input`]: {
|
2022-11-01 15:06:38 +08:00
|
|
|
height: controlHeightLG - 2 * lineWidth,
|
2022-03-29 15:57:39 +08:00
|
|
|
},
|
2022-03-14 11:40:13 +08:00
|
|
|
},
|
|
|
|
|
2022-03-29 15:57:39 +08:00
|
|
|
'&-sm': {
|
|
|
|
padding: 0,
|
2022-11-01 15:06:38 +08:00
|
|
|
borderRadius: borderRadiusSM,
|
2022-03-14 11:40:13 +08:00
|
|
|
|
2022-04-06 21:49:30 +08:00
|
|
|
[`input${componentCls}-input`]: {
|
2022-11-01 15:06:38 +08:00
|
|
|
height: controlHeightSM - 2 * lineWidth,
|
2022-03-29 15:57:39 +08:00
|
|
|
padding: `0 ${inputPaddingHorizontalSM}px`,
|
|
|
|
},
|
2022-03-14 11:40:13 +08:00
|
|
|
},
|
|
|
|
|
2022-03-29 15:57:39 +08:00
|
|
|
'&:hover': {
|
|
|
|
...genHoverStyle(token),
|
2022-03-14 11:40:13 +08:00
|
|
|
},
|
|
|
|
|
2022-03-29 15:57:39 +08:00
|
|
|
'&-focused': {
|
|
|
|
...genActiveStyle(token),
|
2022-03-14 11:40:13 +08:00
|
|
|
},
|
|
|
|
|
2022-03-29 15:57:39 +08:00
|
|
|
'&-disabled': {
|
|
|
|
...genDisabledStyle(token),
|
2022-04-06 21:49:30 +08:00
|
|
|
[`${componentCls}-input`]: {
|
2022-03-29 15:57:39 +08:00
|
|
|
cursor: 'not-allowed',
|
|
|
|
},
|
|
|
|
},
|
2022-03-14 11:40:13 +08:00
|
|
|
|
2022-03-29 15:57:39 +08:00
|
|
|
// ===================== Out Of Range =====================
|
|
|
|
'&-out-of-range': {
|
|
|
|
input: {
|
|
|
|
color: colorError,
|
2022-03-14 11:40:13 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2022-03-29 15:57:39 +08:00
|
|
|
// Style for input-group: input with label, with button or dropdown...
|
|
|
|
'&-group': {
|
|
|
|
...resetComponent(token),
|
|
|
|
...genInputGroupStyle(token),
|
2022-03-14 11:40:13 +08:00
|
|
|
|
2022-03-29 15:57:39 +08:00
|
|
|
'&-wrapper': {
|
|
|
|
display: 'inline-block',
|
|
|
|
textAlign: 'start',
|
|
|
|
verticalAlign: 'top', // https://github.com/ant-design/ant-design/issues/6403
|
2022-03-14 11:40:13 +08:00
|
|
|
|
2022-04-06 21:49:30 +08:00
|
|
|
[`${componentCls}-affix-wrapper`]: {
|
2022-03-29 15:57:39 +08:00
|
|
|
width: '100%',
|
|
|
|
},
|
2022-08-19 10:10:51 +08:00
|
|
|
|
|
|
|
// Size
|
|
|
|
'&-lg': {
|
|
|
|
[`${componentCls}-group-addon`]: {
|
2022-11-01 15:06:38 +08:00
|
|
|
borderRadius: borderRadiusLG,
|
2022-08-19 10:10:51 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
'&-sm': {
|
|
|
|
[`${componentCls}-group-addon`]: {
|
2022-11-01 15:06:38 +08:00
|
|
|
borderRadius: borderRadiusSM,
|
2022-08-19 10:10:51 +08:00
|
|
|
},
|
|
|
|
},
|
2022-03-14 11:40:13 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2022-04-06 21:49:30 +08:00
|
|
|
[componentCls]: {
|
2022-03-29 15:57:39 +08:00
|
|
|
'&-input': {
|
|
|
|
width: '100%',
|
2022-11-01 15:06:38 +08:00
|
|
|
height: controlHeight - 2 * lineWidth,
|
2022-03-29 15:57:39 +08:00
|
|
|
padding: `0 ${inputPaddingHorizontal}px`,
|
|
|
|
textAlign: 'start',
|
|
|
|
backgroundColor: 'transparent',
|
|
|
|
border: 0,
|
2022-11-01 15:06:38 +08:00
|
|
|
borderRadius,
|
2022-03-29 15:57:39 +08:00
|
|
|
outline: 0,
|
2022-11-17 23:31:41 +08:00
|
|
|
transition: `all ${motionDurationMid} linear`,
|
2022-03-29 15:57:39 +08:00
|
|
|
appearance: 'textfield',
|
2022-10-19 10:30:22 +08:00
|
|
|
color: token.colorText,
|
2022-11-08 15:37:35 +08:00
|
|
|
fontSize: 'inherit',
|
|
|
|
verticalAlign: 'top',
|
2022-06-17 18:47:47 +08:00
|
|
|
...genPlaceholderStyle(token.colorTextPlaceholder),
|
2022-03-29 15:57:39 +08:00
|
|
|
|
|
|
|
'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':
|
|
|
|
{
|
|
|
|
margin: 0,
|
|
|
|
/* stylelint-disable-next-line property-no-vendor-prefix */
|
|
|
|
webkitAppearance: 'none',
|
|
|
|
appearance: 'none',
|
|
|
|
},
|
|
|
|
},
|
2022-03-14 11:40:13 +08:00
|
|
|
},
|
2022-03-29 15:57:39 +08:00
|
|
|
},
|
|
|
|
},
|
2022-03-14 11:40:13 +08:00
|
|
|
|
2022-03-29 15:57:39 +08:00
|
|
|
// Handler
|
|
|
|
{
|
2022-04-06 21:49:30 +08:00
|
|
|
[componentCls]: {
|
|
|
|
[`&:hover ${componentCls}-handler-wrap, &-focused ${componentCls}-handler-wrap`]: {
|
2022-03-29 15:57:39 +08:00
|
|
|
opacity: 1,
|
2022-03-14 11:40:13 +08:00
|
|
|
},
|
|
|
|
|
2022-04-06 21:49:30 +08:00
|
|
|
[`${componentCls}-handler-wrap`]: {
|
2022-03-14 11:40:13 +08:00
|
|
|
position: 'absolute',
|
|
|
|
insetBlockStart: 0,
|
|
|
|
insetInlineEnd: 0,
|
2022-03-29 15:57:39 +08:00
|
|
|
width: token.handleWidth,
|
2022-03-14 11:40:13 +08:00
|
|
|
height: '100%',
|
2022-06-28 20:33:01 +08:00
|
|
|
background: colorBgContainer,
|
2022-03-14 11:40:13 +08:00
|
|
|
borderStartStartRadius: 0,
|
2022-11-01 15:06:38 +08:00
|
|
|
borderStartEndRadius: borderRadius,
|
|
|
|
borderEndEndRadius: borderRadius,
|
2022-03-14 11:40:13 +08:00
|
|
|
borderEndStartRadius: 0,
|
2022-09-22 11:54:05 +08:00
|
|
|
opacity: handleVisible === true ? 1 : 0,
|
2022-03-29 15:57:39 +08:00
|
|
|
display: 'flex',
|
|
|
|
flexDirection: 'column',
|
|
|
|
alignItems: 'stretch',
|
2022-11-17 23:31:41 +08:00
|
|
|
transition: `opacity ${motionDurationMid} linear ${motionDurationMid}`,
|
2022-03-14 11:40:13 +08:00
|
|
|
|
|
|
|
// Fix input number inside Menu makes icon too large
|
|
|
|
// We arise the selector priority by nest selector here
|
|
|
|
// https://github.com/ant-design/ant-design/issues/14367
|
2022-04-06 21:49:30 +08:00
|
|
|
[`${componentCls}-handler`]: {
|
2022-03-29 15:57:39 +08:00
|
|
|
display: 'flex',
|
|
|
|
alignItems: 'center',
|
|
|
|
justifyContent: 'center',
|
|
|
|
flex: 'auto',
|
2022-03-14 11:40:13 +08:00
|
|
|
height: '40%',
|
2022-03-29 15:57:39 +08:00
|
|
|
|
|
|
|
[`
|
2022-04-06 21:49:30 +08:00
|
|
|
${componentCls}-handler-up-inner,
|
|
|
|
${componentCls}-handler-down-inner
|
2022-03-29 15:57:39 +08:00
|
|
|
`]: {
|
|
|
|
marginInlineEnd: 0,
|
|
|
|
fontSize: token.handleFontSize,
|
|
|
|
},
|
2022-03-14 11:40:13 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2022-04-06 21:49:30 +08:00
|
|
|
[`${componentCls}-handler`]: {
|
2022-03-29 15:57:39 +08:00
|
|
|
height: '50%',
|
|
|
|
overflow: 'hidden',
|
2022-08-04 16:16:50 +08:00
|
|
|
color: colorTextDescription,
|
2022-03-29 15:57:39 +08:00
|
|
|
fontWeight: 'bold',
|
|
|
|
lineHeight: 0,
|
|
|
|
textAlign: 'center',
|
2022-03-14 11:40:13 +08:00
|
|
|
cursor: 'pointer',
|
2022-11-01 15:06:38 +08:00
|
|
|
borderInlineStart: `${lineWidth}px ${lineType} ${colorBorder}`,
|
2022-11-17 23:31:41 +08:00
|
|
|
transition: `all ${motionDurationMid} linear`,
|
2022-03-29 15:57:39 +08:00
|
|
|
'&:active': {
|
2022-07-21 17:00:42 +08:00
|
|
|
background: token.colorFillAlter,
|
2022-03-14 11:40:13 +08:00
|
|
|
},
|
|
|
|
|
2022-03-29 15:57:39 +08:00
|
|
|
// Hover
|
2022-03-14 11:40:13 +08:00
|
|
|
'&:hover': {
|
2022-03-29 15:57:39 +08:00
|
|
|
height: `60%`,
|
|
|
|
|
|
|
|
[`
|
2022-04-06 21:49:30 +08:00
|
|
|
${componentCls}-handler-up-inner,
|
|
|
|
${componentCls}-handler-down-inner
|
2022-03-29 15:57:39 +08:00
|
|
|
`]: {
|
|
|
|
color: colorPrimary,
|
|
|
|
},
|
2022-03-14 11:40:13 +08:00
|
|
|
},
|
|
|
|
|
2022-03-29 15:57:39 +08:00
|
|
|
'&-up-inner, &-down-inner': {
|
|
|
|
...resetIcon(),
|
2022-03-14 11:40:13 +08:00
|
|
|
|
2022-08-04 16:16:50 +08:00
|
|
|
color: colorTextDescription,
|
2022-11-17 23:31:41 +08:00
|
|
|
transition: `all ${motionDurationMid} linear`,
|
2022-03-29 15:57:39 +08:00
|
|
|
userSelect: 'none',
|
2022-03-14 11:40:13 +08:00
|
|
|
},
|
2022-03-29 15:57:39 +08:00
|
|
|
},
|
2022-03-14 11:40:13 +08:00
|
|
|
|
2022-04-06 21:49:30 +08:00
|
|
|
[`${componentCls}-handler-up`]: {
|
2022-11-01 15:06:38 +08:00
|
|
|
borderStartEndRadius: borderRadius,
|
2022-03-29 15:57:39 +08:00
|
|
|
},
|
|
|
|
|
2022-04-06 21:49:30 +08:00
|
|
|
[`${componentCls}-handler-down`]: {
|
2022-11-01 15:06:38 +08:00
|
|
|
borderBlockStart: `${lineWidth}px ${lineType} ${colorBorder}`,
|
|
|
|
borderEndEndRadius: borderRadius,
|
2022-03-29 15:57:39 +08:00
|
|
|
},
|
2022-03-14 11:40:13 +08:00
|
|
|
|
2022-03-29 15:57:39 +08:00
|
|
|
// Disabled
|
|
|
|
'&-disabled, &-readonly': {
|
2022-04-06 21:49:30 +08:00
|
|
|
[`${componentCls}-handler-wrap`]: {
|
2022-03-29 15:57:39 +08:00
|
|
|
display: 'none',
|
2022-03-14 11:40:13 +08:00
|
|
|
},
|
|
|
|
},
|
2022-03-29 15:57:39 +08:00
|
|
|
|
|
|
|
[`
|
2022-04-06 21:49:30 +08:00
|
|
|
${componentCls}-handler-up-disabled,
|
|
|
|
${componentCls}-handler-down-disabled
|
2022-03-29 15:57:39 +08:00
|
|
|
`]: {
|
2022-03-14 11:40:13 +08:00
|
|
|
cursor: 'not-allowed',
|
|
|
|
},
|
|
|
|
|
2022-03-29 15:57:39 +08:00
|
|
|
[`
|
2022-04-06 21:49:30 +08:00
|
|
|
${componentCls}-handler-up-disabled:hover &-handler-up-inner,
|
|
|
|
${componentCls}-handler-down-disabled:hover &-handler-down-inner
|
2022-03-29 15:57:39 +08:00
|
|
|
`]: {
|
|
|
|
color: colorTextDisabled,
|
2022-03-14 11:40:13 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2022-03-29 15:57:39 +08:00
|
|
|
|
|
|
|
// Border-less
|
|
|
|
{
|
2022-04-06 21:49:30 +08:00
|
|
|
[`${componentCls}-borderless`]: {
|
2022-03-29 15:57:39 +08:00
|
|
|
borderColor: 'transparent',
|
|
|
|
boxShadow: 'none',
|
|
|
|
|
2022-04-06 21:49:30 +08:00
|
|
|
[`${componentCls}-handler-down`]: {
|
2022-03-29 15:57:39 +08:00
|
|
|
borderBlockStartWidth: 0,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
];
|
2022-03-14 11:40:13 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
const genAffixWrapperStyles: GenerateStyle<InputNumberToken> = (token: InputNumberToken) => {
|
2022-08-19 10:10:51 +08:00
|
|
|
const {
|
|
|
|
componentCls,
|
|
|
|
inputPaddingHorizontal,
|
|
|
|
inputAffixPadding,
|
|
|
|
controlWidth,
|
2022-11-01 15:06:38 +08:00
|
|
|
borderRadiusLG,
|
|
|
|
borderRadiusSM,
|
2022-08-19 10:10:51 +08:00
|
|
|
} = token;
|
2022-03-14 11:40:13 +08:00
|
|
|
|
|
|
|
return {
|
2022-04-06 21:49:30 +08:00
|
|
|
[`${componentCls}-affix-wrapper`]: {
|
2022-03-14 20:57:01 +08:00
|
|
|
...genBasicInputStyle(token),
|
|
|
|
...genStatusStyle(token),
|
2022-03-14 11:40:13 +08:00
|
|
|
// or number handler will cover form status
|
|
|
|
position: 'relative',
|
|
|
|
display: 'inline-flex',
|
2022-03-29 15:57:39 +08:00
|
|
|
width: controlWidth,
|
2022-03-14 11:40:13 +08:00
|
|
|
padding: 0,
|
|
|
|
paddingInlineStart: inputPaddingHorizontal,
|
|
|
|
|
2022-08-19 10:10:51 +08:00
|
|
|
'&-lg': {
|
2022-11-01 15:06:38 +08:00
|
|
|
borderRadius: borderRadiusLG,
|
2022-08-19 10:10:51 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
'&-sm': {
|
2022-11-01 15:06:38 +08:00
|
|
|
borderRadius: borderRadiusSM,
|
2022-08-19 10:10:51 +08:00
|
|
|
},
|
|
|
|
|
2022-03-14 11:40:13 +08:00
|
|
|
'&:not(&-disabled):hover': {
|
|
|
|
...genHoverStyle(token),
|
|
|
|
zIndex: 1,
|
|
|
|
},
|
|
|
|
|
|
|
|
'&-focused, &:focus': {
|
|
|
|
zIndex: 1,
|
|
|
|
},
|
|
|
|
|
|
|
|
'&-disabled': {
|
2022-04-06 21:49:30 +08:00
|
|
|
[`${componentCls}[disabled]`]: {
|
2022-03-14 11:40:13 +08:00
|
|
|
background: 'transparent',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2022-04-06 21:49:30 +08:00
|
|
|
[`> div${componentCls}`]: {
|
2022-03-14 11:40:13 +08:00
|
|
|
width: '100%',
|
|
|
|
border: 'none',
|
|
|
|
outline: 'none',
|
|
|
|
|
2022-04-06 21:49:30 +08:00
|
|
|
[`&${componentCls}-focused`]: {
|
2022-03-14 11:40:13 +08:00
|
|
|
boxShadow: 'none !important',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2022-04-06 21:49:30 +08:00
|
|
|
[`input${componentCls}-input`]: {
|
2022-03-14 11:40:13 +08:00
|
|
|
padding: 0,
|
|
|
|
},
|
|
|
|
|
|
|
|
'&::before': {
|
|
|
|
width: 0,
|
|
|
|
visibility: 'hidden',
|
|
|
|
content: '"\\a0"',
|
|
|
|
},
|
|
|
|
|
2022-04-06 21:49:30 +08:00
|
|
|
[`${componentCls}-handler-wrap`]: {
|
2022-03-14 11:40:13 +08:00
|
|
|
zIndex: 2,
|
|
|
|
},
|
|
|
|
|
2022-04-06 21:49:30 +08:00
|
|
|
[componentCls]: {
|
2022-03-14 11:40:13 +08:00
|
|
|
'&-prefix, &-suffix': {
|
|
|
|
display: 'flex',
|
|
|
|
flex: 'none',
|
|
|
|
alignItems: 'center',
|
|
|
|
pointerEvents: 'none',
|
|
|
|
},
|
|
|
|
|
|
|
|
'&-prefix': {
|
2022-03-29 15:57:39 +08:00
|
|
|
marginInlineEnd: inputAffixPadding,
|
2022-03-14 11:40:13 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
'&-suffix': {
|
|
|
|
position: 'absolute',
|
|
|
|
insetBlockStart: 0,
|
|
|
|
insetInlineEnd: 0,
|
|
|
|
zIndex: 1,
|
|
|
|
height: '100%',
|
|
|
|
marginInlineEnd: inputPaddingHorizontal,
|
2022-03-29 15:57:39 +08:00
|
|
|
marginInlineStart: inputAffixPadding,
|
2022-03-14 11:40:13 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
// ============================== Export ==============================
|
2022-04-06 21:49:30 +08:00
|
|
|
export default genComponentStyleHook(
|
|
|
|
'InputNumber',
|
2022-11-17 23:31:41 +08:00
|
|
|
(token) => {
|
2022-04-06 21:49:30 +08:00
|
|
|
const inputNumberToken = initInputToken<FullToken<'InputNumber'>>(token);
|
2022-12-12 16:36:46 +08:00
|
|
|
return [
|
|
|
|
genInputNumberStyles(inputNumberToken),
|
|
|
|
genAffixWrapperStyles(inputNumberToken),
|
|
|
|
// =====================================================
|
|
|
|
// == Space Compact ==
|
|
|
|
// =====================================================
|
|
|
|
genCompactItemStyle(inputNumberToken),
|
|
|
|
];
|
2022-04-06 21:49:30 +08:00
|
|
|
},
|
2022-11-17 23:31:41 +08:00
|
|
|
(token) => ({
|
2022-04-06 21:49:30 +08:00
|
|
|
controlWidth: 90,
|
2022-11-01 15:06:38 +08:00
|
|
|
handleWidth: token.controlHeightSM - token.lineWidth * 2,
|
2022-04-06 21:49:30 +08:00
|
|
|
handleFontSize: token.fontSize / 2,
|
2022-09-22 11:54:05 +08:00
|
|
|
handleVisible: 'auto',
|
2022-04-06 21:49:30 +08:00
|
|
|
}),
|
|
|
|
);
|