File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
packages/react/src/widgets/DragSourceWidget Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,8 @@ export const DragSourceWidget: React.FC<IDragSourceWidgetProps> = observer(
4646
4747 const source =
4848 workspace ?. source ?. size > 0 ? workspace . source : designer . source
49-
49+ const sources = source . getSourcesByGroup ( props . name )
50+ const remainItems = sources . length % 3
5051 return (
5152 < div
5253 className = { cls ( prefix , props . className , {
@@ -70,10 +71,8 @@ export const DragSourceWidget: React.FC<IDragSourceWidgetProps> = observer(
7071 </ div >
7172 < div className = { prefix + '-content-wrapper' } >
7273 < div className = { prefix + '-content' } >
73- { source . mapSourcesByGroup (
74- props . name ,
75- isFn ( props . children ) ? props . children : renderNode
76- ) }
74+ { sources . map ( isFn ( props . children ) ? props . children : renderNode ) }
75+ { remainItems && < div className = { prefix + '-item-remain' } > </ div > }
7776 </ div >
7877 </ div >
7978 </ div >
Original file line number Diff line number Diff line change 6161 position : relative ;
6262 user-select : none ;
6363 padding : 8px 10px ;
64- background : #fff ;
64+ background : var ( --dn-drag-source-content-bg-color ) ;
6565 min-height : 40px ;
6666 color : var (--dn-drag-source-item-color );
6767 display : flex ;
7676 box-shadow : 0 0 10px rgba (0 , 0 , 0 , 0.1 );
7777 z-index : 1 ;
7878 }
79+
7980 &-text {
8081 text-align : center ;
8182 font-size : 12px ;
8283 }
84+ &-remain {
85+ background : var (--dn-drag-source-content-bg-color );
86+ }
8387 }
8488}
You can’t perform that action at this time.
0 commit comments