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
9cc590de
Commit
9cc590de
authored
5 years ago
by
pdg16
Browse files
Options
Downloads
Patches
Plain Diff
create select field component
parent
37e71300
No related branches found
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/FormFieldSelect.js
+50
-28
50 additions, 28 deletions
src/components/FormFieldSelect.js
with
50 additions
and
28 deletions
src/components/FormFieldSelect.js
+
50
−
28
View file @
9cc590de
...
...
@@ -7,12 +7,19 @@ 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
FieldFooterOptions
from
'
./FieldFooterOptions
'
;
const
useStyles
=
makeStyles
(
theme
=>
({
paper
:
{
padding
:
theme
.
spacing
(
3
),
width
:
theme
.
spacing
(
100
),
height
:
theme
.
spacing
(
16
),
min
height
:
theme
.
spacing
(
16
),
margin
:
theme
.
spacing
(
2
)
},
questionsGrid
:
{
...
...
@@ -20,6 +27,8 @@ const useStyles = makeStyles(theme => ({
},
}));
function
FormFieldSelect
(
props
)
{
const
classes
=
useStyles
();
...
...
@@ -27,25 +36,50 @@ function FormFieldSelect(props) {
<
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
)}
/
>
<
TextField
value
=
{
props
.
question
}
label
=
"
sua pergunta
"
onChange
=
{
e
=>
props
.
setTextField
(
e
.
target
.
value
,
props
.
idq
)}
/
>
<
/Grid
>
<
Grid
item
xs
=
{
11
}
className
=
{
classes
.
questionsGrid
}
>
<
Select
labelId
=
"
demo-simple-select-label
"
id
=
"
demo-simple-select
"
// value={age}
// onChange={handleChange}
<
Grid
item
container
direction
=
"
column
"
justify
=
"
flex-start
"
alignItems
=
"
flex-start
"
xs
=
{
5
}
className
=
{
classes
.
questionsGrid
}
>
<
MenuItem
value
=
{
10
}
>
Ten
<
/MenuItem
>
<
MenuItem
value
=
{
20
}
>
Twenty
<
/MenuItem
>
<
MenuItem
value
=
{
30
}
>
Thirty
<
/MenuItem
>
<
/Select
>
{
props
.
options
.
map
((
x
,
index
)
=>
{
return
<
Grid
container
>
<
Grid
item
xs
=
{
11
}
>
<
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
=
"
delete
"
onClick
=
{()
=>
{
props
.
deleteFromForm
(
props
.
idq
)
}
}
>
<
DeleteOutlinedIcon
/>
<
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
>
);
...
...
@@ -53,15 +87,3 @@ function FormFieldSelect(props) {
}
export
default
FormFieldSelect
;
\ No newline at end of file
{
/* <InputLabel id="demo-simple-select-label">Age</InputLabel>
<Select
labelId="demo-simple-select-label"
id="demo-simple-select"
value={age}
onChange={handleChange}
>
<MenuItem value={10}>Ten</MenuItem>
<MenuItem value={20}>Twenty</MenuItem>
<MenuItem value={30}>Thirty</MenuItem>
</Select> */
}
\ 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