@sakaniui/react 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocks/KanbanBoardBlock/useKanbanDrag.d.ts +34 -0
- package/dist/blocks.cjs +2 -2
- package/dist/blocks.mjs +1405 -878
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface KanbanPos {
|
|
3
|
+
col: number;
|
|
4
|
+
index: number;
|
|
5
|
+
}
|
|
6
|
+
export interface KanbanDragActive {
|
|
7
|
+
id: string;
|
|
8
|
+
from: KanbanPos;
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
}
|
|
12
|
+
interface Options {
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
/** Commit a move. `to.index` counts the target column's cards without the moved one. */
|
|
15
|
+
onMove: (from: KanbanPos, to: KanbanPos) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare function useKanbanDrag({ enabled, onMove }: Options): {
|
|
18
|
+
active: KanbanDragActive | null;
|
|
19
|
+
target: KanbanPos | null;
|
|
20
|
+
blockRef: React.RefObject<HTMLDivElement | null>;
|
|
21
|
+
boardRef: React.RefObject<HTMLDivElement | null>;
|
|
22
|
+
overlayRef: React.RefObject<HTMLDivElement | null>;
|
|
23
|
+
cardProps: (from: KanbanPos, id: string) => {
|
|
24
|
+
'data-kanban-card': string;
|
|
25
|
+
'data-flip-id': string;
|
|
26
|
+
onPointerDown: (e: React.PointerEvent<HTMLElement>) => void;
|
|
27
|
+
} | {
|
|
28
|
+
'data-kanban-card'?: undefined;
|
|
29
|
+
'data-flip-id'?: undefined;
|
|
30
|
+
onPointerDown?: undefined;
|
|
31
|
+
};
|
|
32
|
+
columnRef: (col: number) => (el: HTMLElement | null) => void;
|
|
33
|
+
};
|
|
34
|
+
export {};
|