UNPKG

1.95 kBTypeScriptView Raw
1import * as React from 'react';
2import { ButtonProps } from '../Button';
3export interface NumberInputProps extends React.HTMLProps<HTMLDivElement> {
4 /** Value of the number input */
5 value?: number;
6 /** Additional classes added to the number input */
7 className?: string;
8 /** Sets the width of the number input to a number of characters */
9 widthChars?: number;
10 /** Indicates the whole number input should be disabled */
11 isDisabled?: boolean;
12 /** Callback for the minus button */
13 onMinus?: (event: React.MouseEvent, name?: string) => void;
14 /** Callback for the text input changing */
15 onChange?: (event: React.FormEvent<HTMLInputElement>) => void;
16 /** Callback function when text input is blurred (focus leaves) */
17 onBlur?: (event?: any) => void;
18 /** Callback for the plus button */
19 onPlus?: (event: React.MouseEvent, name?: string) => void;
20 /** Adds the given unit to the number input */
21 unit?: React.ReactNode;
22 /** Position of the number input unit in relation to the number input */
23 unitPosition?: 'before' | 'after';
24 /** Minimum value of the number input, disabling the minus button when reached */
25 min?: number;
26 /** Maximum value of the number input, disabling the plus button when reached */
27 max?: number;
28 /** Name of the input */
29 inputName?: string;
30 /** Aria label of the input */
31 inputAriaLabel?: string;
32 /** Aria label of the minus button */
33 minusBtnAriaLabel?: string;
34 /** Aria label of the plus button */
35 plusBtnAriaLabel?: string;
36 /** Additional properties added to the text input */
37 inputProps?: any;
38 /** Additional properties added to the minus button */
39 minusBtnProps?: ButtonProps;
40 /** Additional properties added to the plus button */
41 plusBtnProps?: ButtonProps;
42}
43export declare const NumberInput: React.FunctionComponent<NumberInputProps>;
44//# sourceMappingURL=NumberInput.d.ts.map
\No newline at end of file