diff options
author | 2019-01-11 21:07:21 +0100 | |
---|---|---|
committer | 2019-01-11 21:07:21 +0100 | |
commit | 0ac2806481852249c6a2d4a032cc2c0324a58ef8 (patch) | |
tree | 03292af10a5a97b824293ff8878d2a5c821d5ed2 /packages/forms/src/input/index.tsx | |
parent | expose legacy styles (diff) | |
download | ferdium-app-0ac2806481852249c6a2d4a032cc2c0324a58ef8.tar.gz ferdium-app-0ac2806481852249c6a2d4a032cc2c0324a58ef8.tar.zst ferdium-app-0ac2806481852249c6a2d4a032cc2c0324a58ef8.zip |
Add toggle element to @meetfranz/forms
Diffstat (limited to 'packages/forms/src/input/index.tsx')
-rw-r--r-- | packages/forms/src/input/index.tsx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/packages/forms/src/input/index.tsx b/packages/forms/src/input/index.tsx index 0e19e3368..d82ee5fe3 100644 --- a/packages/forms/src/input/index.tsx +++ b/packages/forms/src/input/index.tsx | |||
@@ -16,14 +16,12 @@ import scorePasswordFunc from './scorePassword'; | |||
16 | 16 | ||
17 | import styles from './styles'; | 17 | import styles from './styles'; |
18 | 18 | ||
19 | interface IProps extends IFormField, React.InputHTMLAttributes<HTMLInputElement>, IWithStyle { | 19 | interface IProps extends React.InputHTMLAttributes<HTMLInputElement>, IFormField, IWithStyle { |
20 | label: string; | ||
21 | focus?: boolean; | 20 | focus?: boolean; |
22 | prefix?: string; | 21 | prefix?: string; |
23 | suffix?: string; | 22 | suffix?: string; |
24 | scorePassword?: boolean; | 23 | scorePassword?: boolean; |
25 | showPasswordToggle?: boolean; | 24 | showPasswordToggle?: boolean; |
26 | error?: string; | ||
27 | } | 25 | } |
28 | 26 | ||
29 | interface IState { | 27 | interface IState { |
@@ -32,15 +30,15 @@ interface IState { | |||
32 | } | 30 | } |
33 | 31 | ||
34 | @observer | 32 | @observer |
35 | class Input extends Component<IProps, IState> { | 33 | class InputComponent extends Component<IProps, IState> { |
36 | public static defaultProps = { | 34 | public static defaultProps = { |
37 | classes: {}, | ||
38 | focus: false, | 35 | focus: false, |
39 | onChange: () => {}, | 36 | onChange: () => {}, |
40 | scorePassword: false, | 37 | scorePassword: false, |
41 | showLabel: true, | 38 | showLabel: true, |
42 | showPasswordToggle: false, | 39 | showPasswordToggle: false, |
43 | type: 'text', | 40 | type: 'text', |
41 | disabled: false, | ||
44 | }; | 42 | }; |
45 | 43 | ||
46 | state = { | 44 | state = { |
@@ -172,4 +170,4 @@ class Input extends Component<IProps, IState> { | |||
172 | } | 170 | } |
173 | } | 171 | } |
174 | 172 | ||
175 | export default injectSheet(styles)(Input); | 173 | export const Input = injectSheet(styles)(InputComponent); |