File tree Expand file tree Collapse file tree 2 files changed +10
-14
lines changed
client/packages/lowcoder-design/src/components Expand file tree Collapse file tree 2 files changed +10
-14
lines changed Original file line number Diff line number Diff line change 1- import { Collapse as AntdCollapse } from "antd" ;
1+ import { Collapse as AntdCollapse , CollapseProps } from "antd" ;
22import { ReactComponent as UnFold } from "icons/icon-unfold.svg" ;
33import { ReactComponent as Folded } from "icons/icon-folded.svg" ;
44import { ReactComponent as Omit } from "icons/icon-omit.svg" ;
@@ -98,6 +98,12 @@ export const Collapse = (props: Iprops) => {
9898 // setColor(keys.length ? "#F2F7FC" : "");
9999 // onChange && onChange(keys);
100100 // };
101+ const collapseItems :CollapseProps [ 'items' ] = config . map ( ( item ) => ( {
102+ key : item . key ,
103+ label : item . title ,
104+ children : item . data ,
105+ } ) )
106+
101107 return (
102108 // <Contain $color={props.isSelected || Color!==""}>
103109 < Container optColor = { props . isSelected } simple = { props . simple } className = { props . className } >
@@ -106,19 +112,8 @@ export const Collapse = (props: Iprops) => {
106112 expandIcon = { getExpandIcon }
107113 defaultActiveKey = { props . isOpen ? [ props . config [ 0 ] . key ] : [ ] }
108114 // onChange={handlechange}
109- >
110- { config && config . length > 0
111- ? config . map ( ( item , index ) => {
112- return (
113- < React . Fragment key = { index } >
114- < Panel header = { item . title } key = { item . key } showArrow = { true } >
115- { item . data }
116- </ Panel >
117- </ React . Fragment >
118- ) ;
119- } )
120- : null }
121- </ AntdCollapse >
115+ items = { collapseItems }
116+ />
122117 </ Container >
123118 ) ;
124119} ;
Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ const CustomPopover = (props: {
9898 ) ;
9999 return (
100100 < Popover
101+ overlayInnerStyle = { { padding : 0 } }
101102 content = { contentWithBox }
102103 trigger = "click"
103104 open = { visible }
You can’t perform that action at this time.
0 commit comments