///
import React from 'react';
import { ThemeProps } from 'amis-core';
export type ValueType = string | number;
export interface NumberProps extends ThemeProps {
placeholder?: string;
max?: ValueType;
min?: ValueType;
step?: number;
showSteps?: boolean;
precision?: number;
disabled?: boolean;
/**
* 只读
*/
readOnly?: boolean;
value?: ValueType;
onChange?: (value: number) => void;
/**
* 边框模式,全边框,还是半边框,或者没边框。
*/
borderMode?: 'full' | 'half' | 'none';
/**
* 指定输入框展示值的格式
*/
formatter?: Function;
/**
* 指定从 formatter 里转换回数字的方式,和 formatter 搭配使用
*/
parser?: Function;
inputRef?: Function;
/**
* 获取焦点事件
*/
onFocus?: Function;
/**
* 失去焦点事件
*/
onBlur?: Function;
/**
* 指定输入框是基础输入框,增强输入框
*/
displayMode?: 'base' | 'enhance';
keyboard?: Boolean;
/**
* 是否是大数
*/
big?: boolean;
/**
* 清空输入内容时的值
*/
resetValue?: any;
}
export declare class NumberInput extends React.Component {
static defaultProps: Pick;
/**
* 处理value值
*
* @param value value 值
* @param min 最小值
* @param max 最大值
* @param precision 精度
* @param resetValue 重置值
* @param isBig 是否为大数模式
*/
static normalizeValue: (value: any, min: ValueType | undefined, max: ValueType | undefined, precision: number, resetValue: any, isBig: boolean | undefined) => any;
/**
* 获取精度,合法的精度为0和正整数,不合法的精度统一转化为0
* 若设置了step,则会基于step的精度生成,最终使用更高的精度
*
* @param precision 精度
* @param step 步长
*/
static normalizePrecision: (precision: any, step?: number) => number;
/**
* 是否是 bigNumber,如果输入的内容是字符串就自动开启
*/
isBig: boolean;
constructor(props: NumberProps);
componentDidUpdate(prevProps: NumberProps): void;
handleChange(value: any): void;
handleFocus(e: React.SyntheticEvent): void;
handleBlur(e: React.SyntheticEvent): void;
handleEnhanceModeChange(action: 'add' | 'subtract'): void;
renderBase(): JSX.Element;
render(): JSX.Element;
}
declare const _default: {
new (props: Omit & import("amis-core/lib/theme").ThemeOutterProps): {
ref: any;
childRef(ref: any): void;
getWrappedInstance(): any;
render(): JSX.Element;
context: any;
setState(state: {} | ((prevState: Readonly<{}>, props: Readonly & import("amis-core/lib/theme").ThemeOutterProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly & import("amis-core/lib/theme").ThemeOutterProps> & Readonly<{
children?: import("react").ReactNode;
}>;
state: Readonly<{}>;
refs: {
[key: string]: import("react").ReactInstance;
};
componentDidMount?(): void;
shouldComponentUpdate?(nextProps: Readonly & import("amis-core/lib/theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): boolean;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly & import("amis-core/lib/theme").ThemeOutterProps>, prevState: Readonly<{}>): any;
componentDidUpdate?(prevProps: Readonly & import("amis-core/lib/theme").ThemeOutterProps>, prevState: Readonly<{}>, snapshot?: any): void;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly & import("amis-core/lib/theme").ThemeOutterProps>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly & import("amis-core/lib/theme").ThemeOutterProps>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly & import("amis-core/lib/theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly & import("amis-core/lib/theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void;
};
displayName: string;
contextType: import("react").Context;
ComposedComponent: import("react").ComponentType & {
themeKey?: string | undefined;
}>;
} & import("hoist-non-react-statics").NonReactStatics & {
themeKey?: string | undefined;
}, {}> & {
ComposedComponent: import("react").ComponentType & {
themeKey?: string | undefined;
};
};
export default _default;