1 |
|
2 |
|
3 | import * as React from 'react';
|
4 | import CommonProps from '../util';
|
5 | import { ButtonProps } from '../button';
|
6 | import Input from '../input';
|
7 |
|
8 | interface HTMLAttributesWeak extends React.HTMLAttributes<HTMLElement> {
|
9 | defaultValue?: any;
|
10 | onChange?: any;
|
11 | onKeyDown?: any;
|
12 | }
|
13 |
|
14 | export interface NumberPickerProps extends HTMLAttributesWeak, CommonProps {
|
15 | |
16 |
|
17 |
|
18 | prefix?: string;
|
19 | name?: string;
|
20 | |
21 |
|
22 |
|
23 | type?: 'normal' | 'inline';
|
24 |
|
25 | |
26 |
|
27 |
|
28 | size?: 'large' | 'medium' | 'small';
|
29 |
|
30 | |
31 |
|
32 |
|
33 | value?: number | string;
|
34 |
|
35 | |
36 |
|
37 |
|
38 | defaultValue?: number | string;
|
39 | |
40 |
|
41 |
|
42 | label?: React.ReactNode;
|
43 |
|
44 | |
45 |
|
46 |
|
47 | innerAfter?: React.ReactNode;
|
48 |
|
49 | |
50 |
|
51 |
|
52 | disabled?: boolean;
|
53 |
|
54 | |
55 |
|
56 |
|
57 | step?: number | string;
|
58 |
|
59 | |
60 |
|
61 |
|
62 | precision?: number;
|
63 |
|
64 | |
65 |
|
66 |
|
67 | editable?: boolean;
|
68 |
|
69 | |
70 |
|
71 |
|
72 | autoFocus?: boolean;
|
73 |
|
74 | |
75 |
|
76 |
|
77 | onChange?: (value: number, e: any) => void;
|
78 |
|
79 | |
80 |
|
81 |
|
82 | onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
83 |
|
84 | |
85 |
|
86 |
|
87 | onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
88 |
|
89 | |
90 |
|
91 |
|
92 | onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
93 |
|
94 | |
95 |
|
96 |
|
97 | onCorrect?: (obj: object) => void;
|
98 |
|
99 | |
100 |
|
101 |
|
102 | max?: number | string;
|
103 |
|
104 | |
105 |
|
106 |
|
107 | min?: number | string;
|
108 |
|
109 | |
110 |
|
111 |
|
112 | className?: string;
|
113 |
|
114 | |
115 |
|
116 |
|
117 | style?: React.CSSProperties;
|
118 |
|
119 | |
120 |
|
121 |
|
122 | format?: (value: number) => string | number;
|
123 |
|
124 | |
125 |
|
126 |
|
127 | upBtnProps?: ButtonProps;
|
128 |
|
129 | |
130 |
|
131 |
|
132 | downBtnProps?: ButtonProps;
|
133 | |
134 |
|
135 |
|
136 | alwaysShowTrigger?: boolean;
|
137 | |
138 |
|
139 |
|
140 | isPreview?: boolean;
|
141 | |
142 |
|
143 |
|
144 | renderPreview?: (value: number | string, props: object) => React.ReactNode;
|
145 | |
146 |
|
147 |
|
148 | device?: 'phone' | 'tablet' | 'desktop';
|
149 | |
150 |
|
151 |
|
152 | hasTrigger?: boolean;
|
153 | |
154 |
|
155 |
|
156 | stringMode?: boolean;
|
157 | }
|
158 |
|
159 | export default class NumberPicker extends React.Component<NumberPickerProps, any> {
|
160 | getInputNode: () => Input;
|
161 | }
|