import React from "react"; import { StyledProps } from "../_type"; import { ControlledProps } from "../form/controlled"; export interface InputNumberProps extends ControlledProps, StyledProps { /** 最小值 */ min?: number; /** 最大值 */ max?: number; /** * 使用按钮增减时的步长 * @default 1 */ step?: number; /** 单位 */ unit?: string; /** * 是否禁用 * @default false */ disabled?: boolean; /** * 精度(保留小数位数) */ precision?: number; /** * 输入框大小 * @default "m" * @since 2.2.1 */ size?: "m" | "l"; /** * 输入框展示值的格式 * * *配合 `parser` 使用* * * @since 2.7.0 */ formatter?: (value: number | string) => string; /** * 从 `formatter` 格式转回数字的方法 * @since 2.7.0 */ parser?: (content: string) => number; /** * 隐藏输入框两侧按钮 * @default false * @since 2.2.2 */ hideButton?: boolean; /** * 输入值变化回调 * @since 2.5.0 */ onInputChange?: (inputValue: string) => void; /** * 自定义输入框属性 * @since 2.7.0 */ inputProps?: React.InputHTMLAttributes; /** * 是否允许不输入值 * * *使用 `null` 表示空值* * * @default false * @since 2.7.0 */ allowEmpty?: boolean; /** * 输入框聚焦事件 * @since 2.2.1 */ onFocus?: React.DOMAttributes["onFocus"]; /** * 输入框失焦事件 * @since 2.2.1 */ onBlur?: React.DOMAttributes["onBlur"]; } /** * 数字输入组件 */ export declare const InputNumber: React.FunctionComponent> & { defaultLabelAlign: string; };