Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
form-creator-ui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
simmctic
form-creator
form-creator-ui
Commits
48552d4b
Commit
48552d4b
authored
5 years ago
by
pdg16
Browse files
Options
Downloads
Patches
Plain Diff
create radio field component
parent
166e54d2
Branches
Branches containing commit
No related tags found
3 merge requests
!58
Version 1.1
,
!54
Issue #53: Fix password info
,
!15
Issue/4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/FormFieldRadio.js
+97
-0
97 additions, 0 deletions
src/components/FormFieldRadio.js
with
97 additions
and
0 deletions
src/components/FormFieldRadio.js
0 → 100644
+
97
−
0
View file @
48552d4b
import
React
from
'
react
'
;
import
{
makeStyles
}
from
'
@material-ui/core/styles
'
;
import
Grid
from
'
@material-ui/core/Grid
'
;
import
Paper
from
'
@material-ui/core/Paper
'
;
import
TextField
from
'
@material-ui/core/TextField
'
;
import
DeleteOutlinedIcon
from
'
@material-ui/icons/DeleteOutlined
'
;
import
IconButton
from
'
@material-ui/core/IconButton
'
;
import
Select
from
'
@material-ui/core/Select
'
;
import
MenuItem
from
'
@material-ui/core/MenuItem
'
;
import
AddCircleIcon
from
'
@material-ui/icons/AddCircle
'
;
import
CloseIcon
from
'
@material-ui/icons/Close
'
;
import
Switch
from
'
@material-ui/core/Switch
'
;
import
FormControlLabel
from
'
@material-ui/core/FormControlLabel
'
;
import
RadioButtonUncheckedIcon
from
'
@material-ui/icons/RadioButtonUnchecked
'
;
import
FieldFooterOptions
from
'
./FieldFooterOptions
'
;
const
useStyles
=
makeStyles
(
theme
=>
({
paper
:
{
padding
:
theme
.
spacing
(
3
),
width
:
theme
.
spacing
(
100
),
minheight
:
theme
.
spacing
(
16
),
margin
:
theme
.
spacing
(
2
)
},
questionsGrid
:
{
marginBottom
:
'
20px
'
},
}));
function
FormFieldRadio
(
props
)
{
const
classes
=
useStyles
();
return
(
<
Paper
className
=
{
classes
.
paper
}
>
<
Grid
container
>
<
Grid
item
xs
=
{
12
}
className
=
{
classes
.
questionsGrid
}
>
<
TextField
value
=
{
props
.
question
}
label
=
"
sua pergunta
"
onChange
=
{
e
=>
props
.
setTextField
(
e
.
target
.
value
,
props
.
idq
)}
/
>
<
/Grid
>
<
Grid
item
container
direction
=
"
column
"
justify
=
"
flex-start
"
alignItems
=
"
flex-start
"
xs
=
{
5
}
className
=
{
classes
.
questionsGrid
}
>
{
props
.
options
.
map
((
x
,
index
)
=>
{
return
<
Grid
container
>
<
Grid
item
container
justify
=
"
center
"
alignItems
=
"
center
"
xs
=
{
1
}
>
<
RadioButtonUncheckedIcon
/>
<
/Grid
>
<
Grid
item
xs
=
{
10
}
>
<
TextField
label
=
{
"
opção
"
+
index
}
value
=
{
x
}
fullWidth
onChange
=
{
e
=>
props
.
setSelectOption
(
e
.
target
.
value
,
props
.
idq
,
index
)}
/
>
<
/Grid
>
<
Grid
item
xs
=
{
1
}
>
<
IconButton
aria
-
label
=
"
remove option
"
onClick
=
{()
=>
{
props
.
removeSelectOption
(
props
.
idq
,
index
)
}
}
>
<
CloseIcon
/>
<
/IconButton
>
<
/Grid
>
<
/Grid
>
})
}
<
/Grid
>
<
Grid
item
container
direction
=
"
column
"
justify
=
"
flex-start
"
alignItems
=
"
flex-start
"
xs
=
{
4
}
>
<
IconButton
aria
-
label
=
"
add option
"
onClick
=
{()
=>
{
props
.
addSelectOption
(
props
.
idq
)
}
}
>
<
AddCircleIcon
/>
<
/IconButton
>
<
/Grid
>
<
Grid
item
container
direction
=
"
row
"
justify
=
"
flex-end
"
alignItems
=
"
flex-end
"
xs
=
{
3
}
>
<
FieldFooterOptions
deleteFromForm
=
{
props
.
deleteFromForm
}
idq
=
{
props
.
idq
}
setRequiredField
=
{
props
.
setRequiredField
}
/
>
<
/Grid
>
<
/Grid
>
<
/Paper
>
);
}
export
default
FormFieldRadio
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment