/** * The number input element * * @author Platon Fedorov * @date 2020-01-14 */ import * as React from 'react'; import { Props } from './Input.types'; export declare type IInputNumber = Omit & { isInteger?: boolean; isOnlyNegative?: boolean; isOnlyPositive?: boolean; min?: number; max?: number; step?: number; value?: number | string; defaultValue?: number | string; parser?: (displayValue: string | undefined) => string; formatter?: (value: number | string | undefined) => string; /** * Code works correct with a separator consisting of a single symbol */ decimalSeparator?: DecimalSeparator; precision?: number; onChange?: (value: number | undefined) => void; maxErrorMessage?: string; minErrorMessage?: string; }; declare type DefaultPropsKeys = 'min' | 'max' | 'step'; export declare type DecimalSeparator = ',' | '.'; export declare type DefaultProps = Required>; export declare type PropsWithDefault = IInputNumber & DefaultProps; declare type IState = { value: number; displayValue: string; showValue: boolean; }; export declare class InputNumber extends React.Component { static defaultProps: DefaultProps; state: IState; inputRef: React.RefObject; initState(): IState; createRef(): React.RefObject; isValuePossible: (value: string) => boolean; onKeyPress: (e: React.KeyboardEvent) => void; getMinMaxErrorMessage(hasMinError: boolean, hasMaxError: boolean): string | undefined; hasMinError: (value: number) => boolean; hasMaxError: (value: number) => boolean; escapeRegExp: (str: string) => string; replaceAll: (str: string, find: string, replace: string) => string; enableSeparator: (value: string) => string; disableSeparator: (value: string) => string; formatter: (value: string | number | undefined) => string; parser: (displayValue: string | undefined) => string; getDisplayValueFromNumber: (value: number, toPrecision?: boolean) => string; getDisplayValueFromString: (value: string) => string; onIncrease: () => void; onDecrease: () => void; setNewValue(newValue: number, newDisplayValue?: string): void; onChange: (e: React.ChangeEvent) => void; onBlur: (e: React.FocusEvent) => void; render(): JSX.Element; } export {};