File tree Expand file tree Collapse file tree 3 files changed +15
-8
lines changed
Expand file tree Collapse file tree 3 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @programmer_network/yail" ,
3- "version" : " 1.0.175 " ,
3+ "version" : " 1.0.176 " ,
44 "description" : " Programmer Network's official UI library for React" ,
55 "author" : " Aleksandar Grbic - (https://programmer.network)" ,
66 "publishConfig" : {
Original file line number Diff line number Diff line change @@ -58,7 +58,8 @@ const Accordion: FC<IAccordionProps> = ({
5858 sections ,
5959 sections . findIndex ( item => item . id === draggedId ) ,
6060 sections . findIndex ( item => item . id === draggedOverId )
61- )
61+ ) ,
62+ { sectionId : draggedId , items : [ ] }
6263 ) ;
6364 }
6465
@@ -132,11 +133,14 @@ const Accordion: FC<IAccordionProps> = ({
132133 < DraggableList
133134 items = { section . items }
134135 onDragged = { ( items : IDraggableListItem [ ] ) => {
135- setSections ( [
136- ...sections . map ( s =>
137- s . id === section . id ? { ...s , items } : s
138- )
139- ] ) ;
136+ setSections (
137+ [
138+ ...sections . map ( s =>
139+ s . id === section . id ? { ...s , items } : s
140+ )
141+ ] ,
142+ { sectionId : section . id , items }
143+ ) ;
140144 } }
141145 isDraggable = { hasDraggableSectionItems }
142146 className = 'yl-gap-4 yl-flex yl-flex-col yl-py-4'
Original file line number Diff line number Diff line change @@ -22,7 +22,10 @@ export enum AccordionOrderType {
2222export interface IAccordionProps {
2323 className ?: string ;
2424 sections : ISection [ ] ;
25- setSections : ( sections : ISection [ ] ) => void ;
25+ setSections : (
26+ sections : ISection [ ] ,
27+ section : { sectionId : number ; items : IDraggableListItem [ ] }
28+ ) => void ;
2629 sectionTitleClassName ?: string ;
2730 onSectionItemClick ?: ( item : IDraggableListItem ) => void ;
2831 onSectionClick ?: ( item : IDraggableListItem ) => void ;
You can’t perform that action at this time.
0 commit comments