-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from fga-eps-mds/US04
Us04
- Loading branch information
Showing
26 changed files
with
5,318 additions
and
116 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import Checkbox from "@mui/material/Checkbox"; | ||
import List from "@mui/material/List"; | ||
import ListItem from "@mui/material/ListItem"; | ||
import ListItemText from "@mui/material/ListItemText"; | ||
import Divider from "@mui/material/Divider"; | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
|
||
export default function CheckList({ items, value, onChange }) { | ||
const handleToggle = (e) => () => { | ||
const currentIndex = value.indexOf(e); | ||
const newChecked = [...value]; | ||
|
||
if (currentIndex === -1) { | ||
newChecked.push(e); | ||
} else { | ||
newChecked.splice(currentIndex, 1); | ||
} | ||
|
||
onChange(newChecked); | ||
}; | ||
return ( | ||
<List> | ||
{items.map((item, index) => ( | ||
<React.Fragment key={item}> | ||
<ListItem onClick={handleToggle(item)}> | ||
<Checkbox | ||
edge="start" | ||
checked={value.indexOf(item) !== -1} | ||
tabIndex={-1} | ||
disableRipple | ||
/> | ||
<ListItemText primary={item} /> | ||
</ListItem> | ||
{index !== items.length - 1 && <Divider />} | ||
</React.Fragment> | ||
))} | ||
</List> | ||
); | ||
} | ||
|
||
CheckList.propTypes = { | ||
items: PropTypes.any, | ||
value: PropTypes.any, | ||
onChange: PropTypes.any, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs"; | ||
import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider"; | ||
import { DatePicker } from "@mui/x-date-pickers/DatePicker"; | ||
import { TextField } from "@mui/material"; | ||
import PropTypes from "prop-types"; | ||
|
||
export default function DataSelect({ label, value, onChange }) { | ||
return ( | ||
<LocalizationProvider dateAdapter={AdapterDayjs}> | ||
<DatePicker | ||
label={label} | ||
value={value} | ||
onChange={onChange} | ||
format="DD/MM/YYYY" // Define o formato desejado | ||
renderInput={(params) => <TextField {...params} variant="filled" />} | ||
sx={{ | ||
margin: ".7rem", | ||
}} | ||
/> | ||
</LocalizationProvider> | ||
); | ||
} | ||
|
||
DataSelect.propTypes = { | ||
label: PropTypes.any, | ||
value: PropTypes.any, | ||
onChange: PropTypes.any, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import PropTypes from "prop-types"; | ||
import FieldText from "../FieldText"; | ||
import { PatternFormat } from "react-number-format"; | ||
|
||
export default function FieldNumber({ | ||
label, | ||
value, | ||
onChange, | ||
disabled, | ||
format, | ||
}) { | ||
return ( | ||
<PatternFormat | ||
format={format} | ||
mask="_" | ||
allowEmptyFormatting | ||
patternChar="#" | ||
type="tel" | ||
customInput={FieldText} | ||
label={label} | ||
value={value} | ||
onChange={onChange} | ||
disabled={disabled} | ||
variant="filled" | ||
id="filled-basic" | ||
/> | ||
); | ||
} | ||
FieldNumber.propTypes = { | ||
label: PropTypes.string.isRequired, | ||
value: PropTypes.string.isRequired, | ||
onChange: PropTypes.func.isRequired, | ||
disabled: PropTypes.bool, | ||
format: PropTypes.string.isRequired, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import theme from "../../Styles/global"; | ||
import { FormControl, InputLabel, MenuItem, Select } from "@mui/material"; | ||
import "dayjs/locale/pt-br"; | ||
import PropTypes from "prop-types"; | ||
|
||
function FieldSelect({ label, value, onChange, options }) { | ||
return ( | ||
<FormControl | ||
fullWidth | ||
sx={{ | ||
margin: ".7rem", | ||
backgroundColor: "#f5f5f5", | ||
borderRadius: "5px", | ||
width: "inherit", | ||
}} | ||
> | ||
<InputLabel id={`label-${label}`}>{label}</InputLabel> | ||
<Select | ||
labelId={`label-${label}`} | ||
id={`select-${label}`} | ||
value={value} | ||
onChange={onChange} | ||
label={label} | ||
sx={{ | ||
background: "#e0d4cc", | ||
backgroundColor: "#e0d4cc", | ||
"& .MuiSelect-select": { | ||
borderColor: theme.palette.main, | ||
}, | ||
"& .MuiOutlinedInput-notchedOutline": { | ||
borderColor: theme.palette.main, | ||
}, | ||
"&:hover .MuiOutlinedInput-notchedOutline": { | ||
borderColor: theme.palette.main, | ||
}, | ||
"&.Mui-focused .MuiOutlinedInput-notchedOutline": { | ||
borderColor: theme.palette.main, | ||
}, | ||
}} | ||
> | ||
{options.map((option) => ( | ||
<MenuItem | ||
key={option} | ||
value={option} | ||
sx={{ padding: "10px", backgroundColor: "#e0e0e0" }} | ||
> | ||
{option} | ||
</MenuItem> | ||
))} | ||
</Select> | ||
</FormControl> | ||
); | ||
} | ||
|
||
FieldSelect.propTypes = { | ||
label: PropTypes.any, | ||
value: PropTypes.any, | ||
onChange: PropTypes.any, | ||
options: PropTypes.any, | ||
}; | ||
|
||
export default FieldSelect; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import PropTypes from "prop-types"; | ||
import theme from "../../Styles/global"; | ||
import TextField from "@mui/material/TextField"; | ||
|
||
export default function FieldText({ label, value, onChange, disabled }) { | ||
return ( | ||
<TextField | ||
id="filled-basic" | ||
label={label} | ||
value={value} | ||
variant="filled" | ||
onChange={onChange} | ||
disabled={disabled} | ||
sx={{ | ||
margin: ".7rem", | ||
background: "#EAE3D7", | ||
backgroundColor: "#EAE3D7", | ||
borderRadius: "5px", | ||
"& .MuiInput-underline:before": { | ||
borderBottomColor: theme.palette.main, // Cor da borda inferior antes do foco | ||
}, | ||
"& .MuiInput-underline:hover:before": { | ||
borderBottomColor: theme.palette.main, // Cor da borda inferior ao passar o mouse | ||
}, | ||
"& .MuiInput-underline:after": { | ||
borderBottomColor: theme.palette.main, // Cor da borda inferior após o foco | ||
}, | ||
"& .MuiInputBase-input": { | ||
color: theme.palette.contrastText, // Cor do texto | ||
}, | ||
"& .MuiInputLabel-root": { | ||
color: theme.palette.main, | ||
fontFamily: '"Noto Sans", sans-serif', | ||
}, | ||
"& .MuiInputLabel-root.Mui-focused": { | ||
color: theme.palette.main, // Cor do rótulo quando focado | ||
}, | ||
"& .MuiInputBase-input::placeholder": { | ||
fontFamily: '"Overpass", sans-serif', // Fonte do placeholder | ||
}, | ||
}} | ||
/> | ||
); | ||
} | ||
|
||
FieldText.propTypes = { | ||
label: PropTypes.string.isRequired, | ||
value: PropTypes.string.isRequired, | ||
onChange: PropTypes.func.isRequired, | ||
disabled: PropTypes.bool, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.