This repository was archived by the owner on Sep 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +37
-21
lines changed
src/components/HyperMediaControls Expand file tree Collapse file tree 3 files changed +37
-21
lines changed Original file line number Diff line number Diff line change 11import { TextField } from '@material-ui/core' ;
2- import React , { FormEventHandler , StatelessComponent } from 'react' ;
2+ import React , { ComponentType , StatelessComponent } from 'react' ;
33import { ComposedComponent } from 'react-schema-form' ;
4+ import { FormInputProps } from './reactSchemaForms' ;
45
5- interface TextAreaFieldProps {
6- error : string ;
7- form : {
8- description : string ;
9- htmlClass : string ;
10- placeholder : string ;
11- readonly : boolean ;
12- title : string ;
13- type : string ;
14- } ;
15- onChangeValidate : FormEventHandler ;
16- value : string ;
17- }
18-
19- const TextAreaField : StatelessComponent < TextAreaFieldProps > = ( {
6+ const TextAreaField : StatelessComponent < FormInputProps > = ( {
207 form,
218 error,
229 onChangeValidate,
@@ -40,4 +27,6 @@ const TextAreaField: StatelessComponent<TextAreaFieldProps> = ({
4027 </ div >
4128) ;
4229
43- export default ComposedComponent . default ( TextAreaField ) ;
30+ export default ComposedComponent . default ( TextAreaField ) as ComponentType <
31+ FormInputProps
32+ > ;
Original file line number Diff line number Diff line change 1- import React from 'react' ;
21import { Button , TextField } from '@material-ui/core' ;
3- import { SpaceBar } from '../Icons' ;
4- import uuid from 'uuid' ;
2+ import React from 'react' ;
53import { ComposedComponent } from 'react-schema-form' ;
4+ import uuid from 'uuid' ;
5+ import { SpaceBar } from '../Icons' ;
6+ import { FormInputProps } from './reactSchemaForms' ;
67
7- class UuidField extends React . PureComponent {
8+ class UuidField extends React . PureComponent < FormInputProps > {
89 constructor ( props ) {
910 super ( props ) ;
1011
Original file line number Diff line number Diff line change 1+ import { FormEventHandler } from 'react' ;
2+
3+ interface Form {
4+ description : string ;
5+ htmlClass : string ;
6+ key : string ;
7+ placeholder : string ;
8+ readonly : boolean ;
9+ title : string ;
10+ type : string ;
11+ }
12+
13+ export interface FormInputProps {
14+ error : string ;
15+ form : Form ;
16+ onChangeValidate : FormEventHandler ;
17+ model : { [ key : string ] : any } ;
18+ onChange : ( key : string , value : string ) => void ;
19+ setDefault : (
20+ key : string ,
21+ model : { [ key : string ] : any } ,
22+ form : Form ,
23+ value : string ,
24+ ) => void ;
25+ value : string ;
26+ }
You can’t perform that action at this time.
0 commit comments