File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
projects/app/src/components/core/app Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -385,7 +385,7 @@ const TableItem = ({
385
385
onClick = { ( ) => {
386
386
const formattedItem = {
387
387
...item ,
388
- list : item . enums || [ ]
388
+ list : item . enums ?. map ( ( item ) => ( { label : item . value , value : item . value } ) ) || [ ]
389
389
} ;
390
390
reset ( formattedItem ) ;
391
391
} }
Original file line number Diff line number Diff line change @@ -100,11 +100,14 @@ const InputRender = (props: InputRenderProps) => {
100
100
}
101
101
102
102
if ( inputType === InputTypeEnum . select ) {
103
- return < MySelect { ...commonProps } list = { props . list || [ ] } h = { 10 } /> ;
103
+ const list =
104
+ props . list || props . enums ?. map ( ( item ) => ( { label : item . value , value : item . value } ) ) || [ ] ;
105
+ return < MySelect { ...commonProps } list = { list } h = { 10 } /> ;
104
106
}
105
107
106
108
if ( inputType === InputTypeEnum . multipleSelect ) {
107
- const { list = [ ] } = props ;
109
+ const list =
110
+ props . list || props . enums ?. map ( ( item ) => ( { label : item . value , value : item . value } ) ) || [ ] ;
108
111
return (
109
112
< MultipleSelect < string >
110
113
{ ...commonProps }
Original file line number Diff line number Diff line change @@ -40,6 +40,9 @@ type SpecificProps =
40
40
// select & multipleSelect
41
41
inputType : InputTypeEnum . select | InputTypeEnum . multipleSelect ;
42
42
list ?: { label : string ; value : string } [ ] ;
43
+
44
+ // old version
45
+ enums ?: { value : string } [ ] ;
43
46
}
44
47
| {
45
48
// JSONEditor
You can’t perform that action at this time.
0 commit comments