27 lines
610 B
TypeScript
27 lines
610 B
TypeScript
import type { InputNumberProps } from 'antd';
|
|
import { Form, InputNumber as AntInputNumber } from 'antd';
|
|
import type { BaseElementProps } from './types';
|
|
|
|
const { Item: FormItem } = Form;
|
|
|
|
export default function InputNumber({
|
|
setValue,
|
|
status,
|
|
isValid,
|
|
help,
|
|
...props
|
|
}: BaseElementProps<number>) {
|
|
return (
|
|
<FormItem hasFeedback validateStatus={isValid === false ? 'error' : ''} help={help}>
|
|
<AntInputNumber
|
|
type="number"
|
|
onChange={setValue}
|
|
disabled={status === 'Disabled'}
|
|
{...props}
|
|
/>
|
|
</FormItem>
|
|
);
|
|
}
|
|
|
|
export type { InputNumberProps };
|