diff options
Diffstat (limited to 'src/@types')
-rw-r--r-- | src/@types/mobx-form.types.ts | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/@types/mobx-form.types.ts b/src/@types/mobx-form.types.ts index 7caddc9e4..c9932c053 100644 --- a/src/@types/mobx-form.types.ts +++ b/src/@types/mobx-form.types.ts | |||
@@ -26,15 +26,22 @@ export interface Field extends Partial<Listeners> { | |||
26 | id?: string; | 26 | id?: string; |
27 | type?: string; | 27 | type?: string; |
28 | name?: string; | 28 | name?: string; |
29 | value: string; | 29 | value: string | string[]; |
30 | label?: string; | 30 | label?: string; |
31 | placeholder?: string; | 31 | placeholder?: string; |
32 | disabled?: boolean; | 32 | disabled?: boolean; |
33 | error?: GlobalError | string; | 33 | error?: GlobalError | string; |
34 | options?: SelectOptions[]; | ||
35 | } | ||
36 | |||
37 | export interface SelectOptions { | ||
38 | disabled?: boolean; | ||
39 | label?: string; | ||
40 | value?: string; | ||
34 | } | 41 | } |
35 | 42 | ||
36 | export interface Listeners { | 43 | export interface Listeners { |
37 | onChange?: ChangeEventHandler<HTMLInputElement>; | 44 | onChange?: ChangeEventHandler<HTMLInputElement | HTMLSelectElement>; |
38 | onBlur?: FocusEventHandler<HTMLElement>; | 45 | onBlur?: FocusEventHandler<HTMLElement>; |
39 | onFocus?: FocusEventHandler<HTMLElement>; | 46 | onFocus?: FocusEventHandler<HTMLElement>; |
40 | } | 47 | } |