@@ -14,7 +14,6 @@ import useCursor from './hooks/useCursor';
1414import StepHandler from './StepHandler' ;
1515import { getDecupleSteps } from './utils/numberUtil' ;
1616
17- import { BaseInputProps } from '@rc-component/input/lib/interface' ;
1817import { useEvent } from '@rc-component/util' ;
1918import { triggerFocus , type InputFocusOptions } from '@rc-component/util/lib/DOM/focus' ;
2019import useFrame from './hooks/useFrame' ;
@@ -51,7 +50,7 @@ const getDecimalIfValidate = (value: ValueType) => {
5150 return decimal . isInvalidate ( ) ? null : decimal ;
5251} ;
5352
54- type SemanticName = 'actions' | 'input' | 'action' ;
53+ type SemanticName = 'root' | ' actions' | 'input' | 'action' | 'prefix' | 'suffix ';
5554export interface InputNumberProps < T extends ValueType = ValueType >
5655 extends Omit <
5756 React . InputHTMLAttributes < HTMLInputElement > ,
@@ -75,10 +74,8 @@ export interface InputNumberProps<T extends ValueType = ValueType>
7574 controls ?: boolean ;
7675 prefix ?: React . ReactNode ;
7776 suffix ?: React . ReactNode ;
78- addonBefore ?: React . ReactNode ;
79- addonAfter ?: React . ReactNode ;
80- classNames ?: BaseInputProps [ 'classNames' ] & Partial < Record < SemanticName , string > > ;
81- styles ?: BaseInputProps [ 'styles' ] & Partial < Record < SemanticName , React . CSSProperties > > ;
77+ classNames ?: Partial < Record < SemanticName , string > > ;
78+ styles ?: Partial < Record < SemanticName , React . CSSProperties > > ;
8279
8380 // Customize handler node
8481 upHandler ?: React . ReactNode ;
@@ -619,14 +616,14 @@ const InputNumber = React.forwardRef<InputNumberRef, InputNumberProps>((props, r
619616 return (
620617 < div
621618 ref = { rootRef }
622- className = { clsx ( prefixCls , `${ prefixCls } -mode-${ mode } ` , className , {
619+ className = { clsx ( prefixCls , `${ prefixCls } -mode-${ mode } ` , className , classNames ?. root , {
623620 [ `${ prefixCls } -focused` ] : focus ,
624621 [ `${ prefixCls } -disabled` ] : disabled ,
625622 [ `${ prefixCls } -readonly` ] : readOnly ,
626623 [ `${ prefixCls } -not-a-number` ] : decimalValue . isNaN ( ) ,
627624 [ `${ prefixCls } -out-of-range` ] : ! decimalValue . isInvalidate ( ) && ! isInRange ( decimalValue ) ,
628625 } ) }
629- style = { style }
626+ style = { { ... styles ?. root , ... style } }
630627 onFocus = { ( ) => {
631628 setFocus ( true ) ;
632629 } }
0 commit comments