@vue-dnd-kit/core 0.0.20 → 0.0.22
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/LICENSE +21 -0
- 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 +2 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 ZiZiGY
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -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.22",
|
|
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",
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"vue": "^3.5.13"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
+
"@types/node": "^22.13.14",
|
|
57
58
|
"@vitejs/plugin-vue": "^4.2.3",
|
|
58
59
|
"eslint": "^8.38.0",
|
|
59
60
|
"typescript": "^4.9.5",
|