| Total Complexity | 1 |
| Complexity/F | 1 |
| Lines of Code | 25 |
| Function Count | 1 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | import { withStyles } from '@material-ui/core/styles' |
||
| 2 | import TextField from '@material-ui/core/TextField' |
||
| 3 | |||
| 4 | 6 | const ValidationTextField = withStyles(theme => ({ |
|
| 5 | root: { |
||
| 6 | '& input:valid + fieldset': { |
||
| 7 | borderWidth: 2 |
||
| 8 | }, |
||
| 9 | '& input:invalid + fieldset': { |
||
| 10 | borderColor: 'red', |
||
| 11 | borderWidth: 2 |
||
| 12 | }, |
||
| 13 | '& input:valid:hover + fieldset': { |
||
| 14 | borderColor: theme.colors.primary |
||
| 15 | }, |
||
| 16 | '& input:valid:focus + fieldset': { |
||
| 17 | borderColor: theme.colors.primary, |
||
| 18 | borderLeftWidth: 3, |
||
| 19 | padding: '4px !important' // override inline-style |
||
| 20 | }, |
||
| 21 | margin: theme.spacing(1) |
||
| 22 | } |
||
| 23 | }))(TextField) |
||
| 24 | |||
| 25 | export default ValidationTextField |
||
| 26 |