@@ -54,7 +54,7 @@ const KANBAN_ERROR = {
54
54
55
55
interface KanbanContextValue < T > {
56
56
id : string ;
57
- value : Record < UniqueIdentifier , T [ ] > ;
57
+ items : Record < UniqueIdentifier , T [ ] > ;
58
58
activeId : UniqueIdentifier | null ;
59
59
setActiveId : ( id : UniqueIdentifier | null ) => void ;
60
60
getItemValue : ( item : T ) => UniqueIdentifier ;
@@ -98,7 +98,7 @@ function Kanban<T>(props: KanbanProps<T>) {
98
98
const [ activeId , setActiveId ] = React . useState < UniqueIdentifier | null > ( null ) ;
99
99
const lastOverId = React . useRef < UniqueIdentifier | null > ( null ) ;
100
100
const recentlyMovedToNewContainer = React . useRef ( false ) ;
101
- const [ clonedColumns , setClonedColumns ] = React . useState < Record <
101
+ const [ clonedItems , setClonedItems ] = React . useState < Record <
102
102
UniqueIdentifier ,
103
103
T [ ]
104
104
> | null > ( null ) ;
@@ -128,7 +128,7 @@ function Kanban<T>(props: KanbanProps<T>) {
128
128
const contextValue = React . useMemo < KanbanContextValue < T > > (
129
129
( ) => ( {
130
130
id,
131
- value,
131
+ items : value ,
132
132
activeId,
133
133
setActiveId,
134
134
getItemValue,
@@ -223,7 +223,7 @@ function Kanban<T>(props: KanbanProps<T>) {
223
223
} }
224
224
onDragStart = { composeEventHandlers ( kanbanProps . onDragStart , ( event ) => {
225
225
setActiveId ( event . active . id ) ;
226
- setClonedColumns ( value ) ;
226
+ setClonedItems ( value ) ;
227
227
} ) }
228
228
onDragOver = { composeEventHandlers ( kanbanProps . onDragOver , ( event ) => {
229
229
const { active, over } = event ;
@@ -294,7 +294,7 @@ function Kanban<T>(props: KanbanProps<T>) {
294
294
295
295
if ( ! over ) {
296
296
setActiveId ( null ) ;
297
- setClonedColumns ( null ) ;
297
+ setClonedItems ( null ) ;
298
298
return ;
299
299
}
300
300
@@ -303,7 +303,7 @@ function Kanban<T>(props: KanbanProps<T>) {
303
303
304
304
if ( ! activeContainer || ! overContainer ) {
305
305
setActiveId ( null ) ;
306
- setClonedColumns ( null ) ;
306
+ setClonedItems ( null ) ;
307
307
return ;
308
308
}
309
309
@@ -312,7 +312,7 @@ function Kanban<T>(props: KanbanProps<T>) {
312
312
313
313
if ( ! activeItems || ! overItems ) {
314
314
setActiveId ( null ) ;
315
- setClonedColumns ( null ) ;
315
+ setClonedItems ( null ) ;
316
316
return ;
317
317
}
318
318
@@ -333,14 +333,14 @@ function Kanban<T>(props: KanbanProps<T>) {
333
333
334
334
if ( ! activeColumn || ! overColumn ) {
335
335
setActiveId ( null ) ;
336
- setClonedColumns ( null ) ;
336
+ setClonedItems ( null ) ;
337
337
return ;
338
338
}
339
339
340
340
const [ movedItem ] = activeColumn . splice ( activeIndex , 1 ) ;
341
341
if ( ! movedItem ) {
342
342
setActiveId ( null ) ;
343
- setClonedColumns ( null ) ;
343
+ setClonedItems ( null ) ;
344
344
return ;
345
345
}
346
346
@@ -351,7 +351,7 @@ function Kanban<T>(props: KanbanProps<T>) {
351
351
const items = value [ activeContainer ] ;
352
352
if ( ! items ) {
353
353
setActiveId ( null ) ;
354
- setClonedColumns ( null ) ;
354
+ setClonedItems ( null ) ;
355
355
return ;
356
356
}
357
357
@@ -370,7 +370,7 @@ function Kanban<T>(props: KanbanProps<T>) {
370
370
const columnItems = newColumns [ activeContainer ] ;
371
371
if ( ! columnItems ) {
372
372
setActiveId ( null ) ;
373
- setClonedColumns ( null ) ;
373
+ setClonedItems ( null ) ;
374
374
return ;
375
375
}
376
376
newColumns [ activeContainer ] = arrayMove (
@@ -383,14 +383,14 @@ function Kanban<T>(props: KanbanProps<T>) {
383
383
}
384
384
}
385
385
setActiveId ( null ) ;
386
- setClonedColumns ( null ) ;
386
+ setClonedItems ( null ) ;
387
387
} ) }
388
388
onDragCancel = { composeEventHandlers ( kanbanProps . onDragCancel , ( ) => {
389
- if ( clonedColumns ) {
390
- onValueChange ?.( clonedColumns ) ;
389
+ if ( clonedItems ) {
390
+ onValueChange ?.( clonedItems ) ;
391
391
}
392
392
setActiveId ( null ) ;
393
- setClonedColumns ( null ) ;
393
+ setClonedItems ( null ) ;
394
394
} ) }
395
395
{ ...kanbanProps }
396
396
/>
@@ -446,7 +446,7 @@ const KanbanColumn = React.forwardRef<HTMLDivElement, KanbanColumnProps>(
446
446
}
447
447
448
448
const ColumnSlot = asChild ? Slot : "div" ;
449
- const items = context . value [ value ] ?? [ ] ;
449
+ const items = context . items [ value ] ?? [ ] ;
450
450
451
451
return (
452
452
< SortableContext
@@ -649,17 +649,17 @@ const ItemGrip = KanbanItemGrip;
649
649
const Overlay = KanbanOverlay ;
650
650
651
651
export {
652
+ Root ,
652
653
Board ,
653
654
Column ,
654
655
Item ,
655
656
ItemGrip ,
657
+ Overlay ,
656
658
//
657
659
Kanban ,
658
660
KanbanBoard ,
659
661
KanbanColumn ,
660
662
KanbanItem ,
661
663
KanbanItemGrip ,
662
664
KanbanOverlay ,
663
- Overlay ,
664
- Root ,
665
665
} ;
0 commit comments