@vue-dnd-kit/core 0.0.21 → 0.0.23-beta
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 → README.txt} +14 -7
- package/dist/composables/useDnDStore.d.ts +2 -0
- package/dist/composables/useDragContainer.d.ts +4 -4
- package/dist/composables/useDraggable.d.ts +8 -6
- package/dist/composables/useDroppable.d.ts +6 -4
- package/dist/composables/usePointer.d.ts +2 -0
- package/dist/composables/useSelection.d.ts +4 -2
- package/dist/composables/useSensor.d.ts +2 -0
- package/dist/managers/useElementManager.d.ts +7 -5
- package/dist/managers/useZoneManager.d.ts +6 -4
- package/dist/utils/geometry.d.ts +2 -0
- package/dist/vue-shims.d.ts +5 -0
- package/package.json +1 -1
package/{README.md → README.txt}
RENAMED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Vue Drag & Drop Library - Core Package
|
|
2
2
|
|
|
3
|
+
[](https://github.com/zizigy/vue-dnd-kit)
|
|
4
|
+
> ⚠️ **Warning**: This project is in active development (beta). The API may change between minor versions. Not recommended for production use until version 1.0.0.
|
|
5
|
+
|
|
3
6
|
<p align="center">
|
|
4
7
|
<a href="https://zizigy.github.io/vue-dnd-hooks/">
|
|
5
8
|
<img src="https://raw.githubusercontent.com/ZiZiGY/vue-dnd-hooks/master/public/logo.svg" width="400" alt="Vue Drag & Drop Logo">
|
|
@@ -20,6 +23,16 @@
|
|
|
20
23
|
Inspired by the popular <a href="https://dndkit.com/" target="_blank">React DnD Kit</a> library, adapted for Vue.js
|
|
21
24
|
</p>
|
|
22
25
|
|
|
26
|
+
## Project Status
|
|
27
|
+
|
|
28
|
+
This project is in active development. We're working toward a stable API, but until version 1.0.0, there may be breaking changes.
|
|
29
|
+
|
|
30
|
+
Roadmap:
|
|
31
|
+
- [x] Basic drag & drop functionality
|
|
32
|
+
- [x] Complete documentation
|
|
33
|
+
- [ ] Tests
|
|
34
|
+
- [ ] Stable API (version 1.0.0)
|
|
35
|
+
|
|
23
36
|
## Features
|
|
24
37
|
|
|
25
38
|
### Core Capabilities
|
|
@@ -29,14 +42,12 @@
|
|
|
29
42
|
- Intuitive hooks-based approach
|
|
30
43
|
- Clean and declarative syntax
|
|
31
44
|
- Minimal boilerplate code
|
|
32
|
-
|
|
33
45
|
- 🎨 **Full Customization**
|
|
34
46
|
|
|
35
47
|
- Custom drag overlays
|
|
36
48
|
- Flexible styling system
|
|
37
49
|
- Animation support
|
|
38
50
|
- Custom drag handles
|
|
39
|
-
|
|
40
51
|
- 📱 **Advanced Input Support**
|
|
41
52
|
|
|
42
53
|
- Touch devices support
|
|
@@ -51,7 +62,6 @@
|
|
|
51
62
|
- Minimal re-renders
|
|
52
63
|
- Efficient DOM updates
|
|
53
64
|
- Memory leak prevention
|
|
54
|
-
|
|
55
65
|
- 🔄 **Smart Auto-scrolling**
|
|
56
66
|
|
|
57
67
|
- Smooth scroll animations
|
|
@@ -67,7 +77,6 @@
|
|
|
67
77
|
- Type inference
|
|
68
78
|
- IDE autocompletion
|
|
69
79
|
- Type-safe events
|
|
70
|
-
|
|
71
80
|
- 📐 **Layout Features**
|
|
72
81
|
|
|
73
82
|
- Grid system support
|
|
@@ -83,14 +92,12 @@
|
|
|
83
92
|
- Zone filtering
|
|
84
93
|
- Nested groups
|
|
85
94
|
- Dynamic group validation
|
|
86
|
-
|
|
87
95
|
- 📊 **Rich Events System**
|
|
88
96
|
|
|
89
97
|
- Comprehensive lifecycle events
|
|
90
98
|
- Custom event handlers
|
|
91
99
|
- Drag state tracking
|
|
92
100
|
- Position coordinates
|
|
93
|
-
|
|
94
101
|
- 🛡️ **Built-in Utilities**
|
|
95
102
|
|
|
96
103
|
- Geometry calculations
|
|
@@ -193,7 +200,7 @@ pnpm install @vue-dnd-kit/core
|
|
|
193
200
|
</style>
|
|
194
201
|
```
|
|
195
202
|
|
|
196
|
-
### Droppable.vue
|
|
203
|
+
### Droppable.vue
|
|
197
204
|
|
|
198
205
|
<sup>🧩 components/Droppable.vue</sup>
|
|
199
206
|
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
* @property {Ref<boolean>} isDragging - Whether drag operation is in progress
|
|
67
67
|
*/
|
|
68
68
|
export declare const useDragContainer: () => {
|
|
69
|
-
elementRef:
|
|
70
|
-
draggingElements:
|
|
71
|
-
pointerPosition:
|
|
72
|
-
isDragging:
|
|
69
|
+
elementRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
70
|
+
draggingElements: import('vue').Ref<import('..').IDraggingElement[], import('..').IDraggingElement[]>;
|
|
71
|
+
pointerPosition: import('..').IPointerPosition;
|
|
72
|
+
isDragging: import('vue').Ref<boolean, boolean>;
|
|
73
73
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { IUseDragOptions } from "../types";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Main hook for making elements draggable.
|
|
3
5
|
* Provides all necessary functionality for drag and drop operations.
|
|
@@ -39,11 +41,11 @@
|
|
|
39
41
|
* </script>
|
|
40
42
|
* ```
|
|
41
43
|
*/
|
|
42
|
-
export declare const useDraggable: (options?:
|
|
43
|
-
pointerPosition:
|
|
44
|
-
elementRef:
|
|
45
|
-
isDragging:
|
|
46
|
-
isOvered:
|
|
47
|
-
isAllowed:
|
|
44
|
+
export declare const useDraggable: (options?: IUseDragOptions) => {
|
|
45
|
+
pointerPosition: import('../types').IPointerPosition;
|
|
46
|
+
elementRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
47
|
+
isDragging: import('vue').ComputedRef<boolean>;
|
|
48
|
+
isOvered: import('vue').ComputedRef<boolean>;
|
|
49
|
+
isAllowed: import('vue').ComputedRef<boolean>;
|
|
48
50
|
handleDragStart: (event: PointerEvent) => void;
|
|
49
51
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { IUseDropOptions } from "../types";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Hook for creating drop zones that can accept dragged elements.
|
|
3
5
|
* Manages drop zone registration and interaction states.
|
|
@@ -82,8 +84,8 @@
|
|
|
82
84
|
* </style>
|
|
83
85
|
* ```
|
|
84
86
|
*/
|
|
85
|
-
export declare const useDroppable: (options?:
|
|
86
|
-
elementRef:
|
|
87
|
-
isOvered:
|
|
88
|
-
isAllowed:
|
|
87
|
+
export declare const useDroppable: (options?: IUseDropOptions) => {
|
|
88
|
+
elementRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
89
|
+
isOvered: import('vue').ComputedRef<boolean>;
|
|
90
|
+
isAllowed: import('vue').ComputedRef<boolean>;
|
|
89
91
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Hook for managing element selection in drag and drop interface
|
|
3
5
|
* @param elementRef - Reference to the HTML element that can be selected
|
|
@@ -7,6 +9,6 @@ export declare const useSelection: (elementRef: Ref<HTMLElement | null>) => {
|
|
|
7
9
|
handleUnselect: () => void;
|
|
8
10
|
handleSelect: () => void;
|
|
9
11
|
handleToggleSelect: () => void;
|
|
10
|
-
isSelected:
|
|
11
|
-
isParentOfSelected:
|
|
12
|
+
isSelected: import('vue').ComputedRef<boolean>;
|
|
13
|
+
isParentOfSelected: import('vue').ComputedRef<boolean>;
|
|
12
14
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { IUseDragOptions } from "../types";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Hook for managing draggable elements and their interactions.
|
|
3
5
|
* Provides methods for registering, unregistering elements,
|
|
@@ -6,11 +8,11 @@
|
|
|
6
8
|
* @param options - Optional configuration object for element management
|
|
7
9
|
* @returns Object containing element management state and methods
|
|
8
10
|
*/
|
|
9
|
-
export declare const useElementManager: (options?:
|
|
10
|
-
elementRef:
|
|
11
|
+
export declare const useElementManager: (options?: IUseDragOptions) => {
|
|
12
|
+
elementRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
11
13
|
registerElement: () => void;
|
|
12
14
|
unregisterElement: () => void;
|
|
13
|
-
isDragging:
|
|
14
|
-
isOvered:
|
|
15
|
-
isAllowed:
|
|
15
|
+
isDragging: import('vue').ComputedRef<boolean>;
|
|
16
|
+
isOvered: import('vue').ComputedRef<boolean>;
|
|
17
|
+
isAllowed: import('vue').ComputedRef<boolean>;
|
|
16
18
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { IUseDropOptions } from "../types";
|
|
2
|
+
|
|
3
|
+
export declare const useZoneManager: (options?: IUseDropOptions) => {
|
|
4
|
+
elementRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
3
5
|
registerZone: () => void;
|
|
4
6
|
unregisterZone: () => void;
|
|
5
|
-
isOvered:
|
|
6
|
-
isAllowed:
|
|
7
|
+
isOvered: import('vue').ComputedRef<boolean>;
|
|
8
|
+
isAllowed: import('vue').ComputedRef<boolean>;
|
|
7
9
|
};
|
package/dist/utils/geometry.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { IBoundingBox, IPoint } from "../types";
|
|
2
|
+
|
|
1
3
|
export declare const checkCollision: (boxA: IBoundingBox, boxB: IBoundingBox) => boolean;
|
|
2
4
|
export declare const getBoundingBox: (element: HTMLElement | null) => IBoundingBox;
|
|
3
5
|
export declare const getCenter: (box: IBoundingBox) => IPoint;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-dnd-kit/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.23-beta",
|
|
4
4
|
"description": "Core functionality for Vue DnD Kit - a lightweight Vue 3 library for building performant and accessible drag and drop interfaces",
|
|
5
5
|
"author": "ZiZIGY",
|
|
6
6
|
"license": "MIT",
|