parent
8557d48cf4
commit
5e28e53d1a
7 changed files with 343 additions and 18 deletions
@ -0,0 +1,27 @@ |
||||
import React from 'react'; |
||||
import TextField from '@material-ui/core/TextField'; |
||||
import { makeStyles } from '@material-ui/core/styles'; |
||||
|
||||
const useStyles = makeStyles((theme) => ({ |
||||
root: { |
||||
'& .MuiTextField-root': { |
||||
|
||||
width: '100%', |
||||
position : 'relative', |
||||
marginRight : 10, |
||||
|
||||
}, |
||||
}, |
||||
})); |
||||
|
||||
export default function FormPropsTextFields(props) { |
||||
const classes = useStyles(); |
||||
|
||||
return ( |
||||
<form className={classes.root} noValidate autoComplete="off"> |
||||
<div> |
||||
<TextField id="outlined-basic" name={props.name} label={props.label} variant="outlined" /> |
||||
</div> |
||||
</form> |
||||
); |
||||
} |
@ -0,0 +1,75 @@ |
||||
import React from "react"; |
||||
import { makeStyles, withStyles } from "@material-ui/core/styles"; |
||||
import FormControl from "@material-ui/core/FormControl"; |
||||
import Select from '@material-ui/core/Select'; |
||||
import InputBase from "@material-ui/core/InputBase"; |
||||
import KeyboardArrowDownIcon from "@material-ui/icons/KeyboardArrowDown"; |
||||
import InputLabel from '@material-ui/core/InputLabel'; |
||||
|
||||
const BootstrapInput = withStyles((theme) => ({ |
||||
root: { |
||||
"label + &": { |
||||
marginTop: theme.spacing(3), |
||||
}, |
||||
}, |
||||
input: { |
||||
borderRadius: 4, |
||||
position: "relative", |
||||
// backgroundColor: theme.palette.background.paper,
|
||||
border: "1px solid #a5a5a5", |
||||
fontSize: window.innerWidth > 1000 ? 16 : "calc(100vw / 30)", |
||||
color: "#a5a5a5", |
||||
// maxWidth : 70,
|
||||
minWidth: '100%', |
||||
padding: "0px", |
||||
transition: theme.transitions.create(["border-color", "box-shadow"]), |
||||
// Use the system font instead of the default Roboto font.
|
||||
fontFamily: "numeralLight", |
||||
"&:focus": { |
||||
borderRadius: 4, |
||||
}, |
||||
}, |
||||
}))(InputBase); |
||||
|
||||
const useStyles = makeStyles((theme) => ({ |
||||
marginLeft: { |
||||
// margin: theme.spacing(1),
|
||||
marginLeft: 8, |
||||
}, |
||||
})); |
||||
|
||||
export default function CustomizedSelects(props) { |
||||
const classes = useStyles(); |
||||
|
||||
console.log(props); |
||||
return ( |
||||
<div style={{ position: "relative" }}> |
||||
<FormControl variant="outlined" className={classes.marginLeft}> |
||||
<InputLabel id="demo-simple-select-outlined-label">{props.label}</InputLabel> |
||||
<Select |
||||
labelId="demo-simple-select-outlined-label" |
||||
id="demo-simple-select-outlined" |
||||
value={props.parent.state[props.name]} |
||||
onChange={(e) => |
||||
props.parent.setState({ [props.name]: e.target.value }) |
||||
} label="Age" |
||||
> |
||||
{props.options.map((item,i) => ( |
||||
<option key={i} value={item}> |
||||
{item} |
||||
</option> |
||||
))} |
||||
</Select> |
||||
</FormControl> |
||||
<KeyboardArrowDownIcon |
||||
style={{ |
||||
position: "absolute", |
||||
left: 5, |
||||
top: 25, |
||||
fontSize: 30, |
||||
color: "#a5a5a5", |
||||
}} |
||||
/> |
||||
</div> |
||||
); |
||||
} |
@ -0,0 +1,32 @@ |
||||
import React from 'react'; |
||||
import { makeStyles } from '@material-ui/core/styles'; |
||||
import TextField from '@material-ui/core/TextField'; |
||||
|
||||
const useStyles = makeStyles((theme) => ({ |
||||
root: { |
||||
'& .MuiTextField-root': { |
||||
margin: theme.spacing(0), |
||||
width: '100%', |
||||
}, |
||||
}, |
||||
})); |
||||
|
||||
export default function MultilineTextFields(props) { |
||||
const classes = useStyles(); |
||||
const [value, setValue] = React.useState('Controlled'); |
||||
|
||||
return ( |
||||
<form className={classes.root} noValidate autoComplete="off"> |
||||
<TextField |
||||
id="outlined-multiline-static" |
||||
label={props.label} |
||||
multiline |
||||
rows={4} |
||||
onChange={(e) => props.parent.setState({[props.name] : e.target.value})} |
||||
name={props.name} |
||||
defaultValue="" |
||||
variant="outlined" |
||||
/> |
||||
</form> |
||||
); |
||||
} |
Loading…
Reference in new issue