react-dragdrop-kit 1.1.0 → 1.3.0
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/README.md +289 -196
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/kanban.esm.js +2 -0
- package/dist/kanban.esm.js.map +1 -0
- package/dist/kanban.js +2 -0
- package/dist/kanban.js.map +1 -0
- package/dist/src/components/DragDropList.d.ts +1 -1
- package/dist/src/components/DraggableItemWrapper.d.ts +1 -1
- package/dist/src/hooks/useDragDropMonitor.d.ts +5 -2
- package/dist/src/kanban/a11y/Announcer.d.ts +37 -0
- package/dist/src/kanban/a11y/useLiveRegion.d.ts +17 -0
- package/dist/src/kanban/components/KanbanBoard.d.ts +8 -0
- package/dist/src/kanban/components/KanbanCardView.d.ts +8 -0
- package/dist/src/kanban/components/KanbanColumnView.d.ts +8 -0
- package/dist/src/kanban/context.d.ts +13 -0
- package/dist/src/kanban/hooks/useAutoscroll.d.ts +10 -0
- package/dist/src/kanban/hooks/useKanbanDnd.d.ts +16 -0
- package/dist/src/kanban/index.d.ts +15 -0
- package/dist/src/kanban/types.d.ts +187 -0
- package/dist/src/kanban/utils/dndMath.d.ts +61 -0
- package/dist/src/kanban/utils/dom.d.ts +62 -0
- package/dist/src/kanban/utils/reorder.d.ts +38 -0
- package/dist/src/types/index.d.ts +5 -0
- package/dist/src/utils/order.d.ts +7 -0
- package/package.json +7 -2
|
@@ -27,6 +27,9 @@ export type DragDropListProps<T extends DraggableItem> = {
|
|
|
27
27
|
dropIndicatorClassName?: string;
|
|
28
28
|
dropIndicatorStyle?: React.CSSProperties;
|
|
29
29
|
dropIndicatorPosition?: "top" | "bottom";
|
|
30
|
+
dragHandle?: string;
|
|
31
|
+
selectedIds?: string[];
|
|
32
|
+
multiDragEnabled?: boolean;
|
|
30
33
|
};
|
|
31
34
|
export type DraggableItemWrapperProps<T extends DraggableItem> = {
|
|
32
35
|
item: T;
|
|
@@ -43,4 +46,6 @@ export type DraggableItemWrapperProps<T extends DraggableItem> = {
|
|
|
43
46
|
dropIndicatorClassName?: string;
|
|
44
47
|
dropIndicatorStyle?: React.CSSProperties;
|
|
45
48
|
dropIndicatorPosition?: "top" | "bottom";
|
|
49
|
+
direction?: "vertical" | "horizontal";
|
|
50
|
+
dragHandle?: string;
|
|
46
51
|
};
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import type { DraggableItem, OrderUpdate } from '../types';
|
|
2
2
|
export declare function reorder<T>(list: T[], startIndex: number, endIndex: number): T[];
|
|
3
|
+
export declare function normalizeDestinationIndex(params: {
|
|
4
|
+
itemCount: number;
|
|
5
|
+
sourceIndex: number;
|
|
6
|
+
rawDestinationIndex: number;
|
|
7
|
+
isSameList: boolean;
|
|
8
|
+
}): number;
|
|
9
|
+
export declare function reorderMany<T>(list: T[], selectedIndexes: number[], rawDestinationIndex: number): T[];
|
|
3
10
|
export declare function calculateOrderUpdates<T extends DraggableItem>(oldItems: T[], newItems: T[]): OrderUpdate[];
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-dragdrop-kit",
|
|
3
3
|
"author": "Souvik Sen <https://github.com/Yourstruggle11>",
|
|
4
|
-
"version": "1.
|
|
5
|
-
"description": "A flexible, lightweight React drag-and-drop kit for building sortable lists, grids, and boards with ease.",
|
|
4
|
+
"version": "1.3.0",
|
|
5
|
+
"description": "A flexible, lightweight React drag-and-drop kit for building sortable lists, grids, and kanban boards with ease.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
|
|
8
8
|
"main": "dist/index.js",
|
|
@@ -13,6 +13,11 @@
|
|
|
13
13
|
"types": "./dist/src/index.d.ts",
|
|
14
14
|
"import": "./dist/index.esm.js",
|
|
15
15
|
"require": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./kanban": {
|
|
18
|
+
"types": "./dist/src/kanban/index.d.ts",
|
|
19
|
+
"import": "./dist/kanban.esm.js",
|
|
20
|
+
"require": "./dist/kanban.js"
|
|
16
21
|
}
|
|
17
22
|
},
|
|
18
23
|
"files": ["dist", "README.md", "LICENSE"],
|