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 = ({
385385 onClick = { ( ) => {
386386 const formattedItem = {
387387 ...item ,
388- list : item . enums || [ ]
388+ list : item . enums ?. map ( ( item ) => ( { label : item . value , value : item . value } ) ) || [ ]
389389 } ;
390390 reset ( formattedItem ) ;
391391 } }
Original file line number Diff line number Diff line change @@ -100,11 +100,14 @@ const InputRender = (props: InputRenderProps) => {
100100 }
101101
102102 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 } /> ;
104106 }
105107
106108 if ( inputType === InputTypeEnum . multipleSelect ) {
107- const { list = [ ] } = props ;
109+ const list =
110+ props . list || props . enums ?. map ( ( item ) => ( { label : item . value , value : item . value } ) ) || [ ] ;
108111 return (
109112 < MultipleSelect < string >
110113 { ...commonProps }
Original file line number Diff line number Diff line change @@ -40,6 +40,9 @@ type SpecificProps =
4040 // select & multipleSelect
4141 inputType : InputTypeEnum . select | InputTypeEnum . multipleSelect ;
4242 list ?: { label : string ; value : string } [ ] ;
43+
44+ // old version
45+ enums ?: { value : string } [ ] ;
4346 }
4447 | {
4548 // JSONEditor
You can’t perform that action at this time.
0 commit comments