UNPKG

@activecollab/components

Version:

ActiveCollab Components

39 lines 1.64 kB
import { MouseEvent, RefObject } from "react"; export type Separators = "." | "," | " " | ""; export type InputNumberValue = number | undefined; export interface IInputNumber { decimalLength?: number; decimalSeparator?: Separators; disableAbbreviation?: boolean; disableMacros?: boolean; thousandSeparator?: Separators; trimDecimals?: boolean; value?: number; step?: number; limit?: number; onEnterKeyPress?: (val: InputNumberValue) => void; onChange?: (val: InputNumberValue) => void; onClick?: (event: MouseEvent<HTMLInputElement>) => void; allowEmptyValue?: boolean; onCancel?: (e: Event) => void; onSave?: (e: Event) => void; onBlur?: (e: Event) => void; validation?: (value: string, disableMacros: boolean, decimalSeparator: string, decimalLength: number, limit?: number) => boolean; min?: number; max?: number; update?: boolean; shortenThreshold?: number; } export declare const useInputNumber: ({ decimalSeparator, thousandSeparator, disableAbbreviation, disableMacros, decimalLength, value, onChange, onSave, onEnterKeyPress, onClick, onCancel, allowEmptyValue, step, trimDecimals, limit, validation, min, max, onBlur, update, shortenThreshold, }: IInputNumber, inputRef: RefObject<HTMLInputElement | null>) => { value: string; onBlur: (e: any) => void; onKeyDown: (e: any) => void; onChange: (e: any) => void; onClick: (e: any) => void; onDoubleClick: () => void; onFocus: () => void; focused: boolean; unformattedValue: string; numericValue: number | undefined; }; //# sourceMappingURL=useInputNumber.d.ts.map