@vue-dnd-kit/core 0.0.24-beta → 0.0.26-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/LICENSE +21 -21
- package/README.md +252 -252
- package/dist/composables/useDnDStore.d.ts +63 -64
- package/dist/composables/useDragContainer.d.ts +73 -73
- package/dist/composables/useDraggable.d.ts +49 -50
- package/dist/composables/useDroppable.d.ts +89 -90
- package/dist/composables/usePointer.d.ts +5 -6
- package/dist/composables/useSelection.d.ts +12 -13
- package/dist/composables/useSensor.d.ts +5 -6
- package/dist/index.d.ts +3 -4
- package/dist/managers/useElementManager.d.ts +16 -17
- package/dist/managers/useInteractionManager.d.ts +4 -4
- package/dist/managers/useZoneManager.d.ts +7 -8
- package/dist/types/index.d.ts +170 -170
- package/dist/utils/dom.d.ts +1 -1
- package/dist/utils/geometry.d.ts +14 -15
- package/dist/utils/namespaces.d.ts +2 -2
- package/dist/vue-dnd-kit-core.cjs.js +1 -1
- package/dist/vue-dnd-kit-core.es.js +353 -250
- package/dist/vue-shims.d.ts +5 -5
- package/package.json +72 -70
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hook for creating custom drag container with overlay management.
|
|
3
|
-
* Provides functionality for controlling drag visualization and element positioning.
|
|
4
|
-
*
|
|
5
|
-
* This hook is typically used to create custom drag overlays, layers,
|
|
6
|
-
* and control how dragged elements are displayed during drag operations.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```vue
|
|
10
|
-
* <script setup lang="ts">
|
|
11
|
-
* import { computed } from 'vue';
|
|
12
|
-
* import { useDragContainer } from '../composables/useDragContainer';
|
|
13
|
-
*
|
|
14
|
-
* const { elementRef, pointerPosition, isDragging, draggingElements } =
|
|
15
|
-
* useDragContainer();
|
|
16
|
-
*
|
|
17
|
-
* const computedStyle = computed(() => ({
|
|
18
|
-
* transform: `translate3d(${
|
|
19
|
-
* (pointerPosition.current.value?.x ?? 0) -
|
|
20
|
-
* (pointerPosition.offset.pixel.value?.x ?? 0)
|
|
21
|
-
* }px, ${
|
|
22
|
-
* (pointerPosition.current.value?.y ?? 0) -
|
|
23
|
-
* (pointerPosition.offset.pixel.value?.y ?? 0)
|
|
24
|
-
* }px, 0)`,
|
|
25
|
-
* }));
|
|
26
|
-
*</script>
|
|
27
|
-
*
|
|
28
|
-
*<template>
|
|
29
|
-
* <Teleport to="body">
|
|
30
|
-
* <div
|
|
31
|
-
* v-if="isDragging"
|
|
32
|
-
* ref="elementRef"
|
|
33
|
-
* :style="computedStyle"
|
|
34
|
-
* class="default-drag-overlay"
|
|
35
|
-
* >
|
|
36
|
-
* <div
|
|
37
|
-
* v-for="(element, index) in draggingElements"
|
|
38
|
-
* :key="index"
|
|
39
|
-
* v-html="element.initialHTML"
|
|
40
|
-
* :style="{
|
|
41
|
-
* width: `${element.initialRect?.width}px`,
|
|
42
|
-
* height: `${element.initialRect?.height}px`,
|
|
43
|
-
* }"
|
|
44
|
-
* />
|
|
45
|
-
* </div>
|
|
46
|
-
* </Teleport>
|
|
47
|
-
*</template>
|
|
48
|
-
*
|
|
49
|
-
*<style scoped>
|
|
50
|
-
* .default-drag-overlay {
|
|
51
|
-
* position: fixed;
|
|
52
|
-
* top: 0;
|
|
53
|
-
* left: 0;
|
|
54
|
-
* background-color: rgba(0, 0, 0, 0.5);
|
|
55
|
-
* transition: 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
|
|
56
|
-
* z-index: 1000;
|
|
57
|
-
* }
|
|
58
|
-
*</style>
|
|
59
|
-
*
|
|
60
|
-
* ```
|
|
61
|
-
*
|
|
62
|
-
* @returns {Object} Container controls and state
|
|
63
|
-
* @property {Ref<HTMLElement | null>} elementRef - Reference to be bound to container element
|
|
64
|
-
* @property {Ref<IDragElement[]>} draggingElements - Currently dragged elements
|
|
65
|
-
* @property {IPointerPosition} pointerPosition - Current pointer coordinates and offsets
|
|
66
|
-
* @property {Ref<boolean>} isDragging - Whether drag operation is in progress
|
|
67
|
-
*/
|
|
68
|
-
export declare const useDragContainer: () => {
|
|
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
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* Hook for creating custom drag container with overlay management.
|
|
3
|
+
* Provides functionality for controlling drag visualization and element positioning.
|
|
4
|
+
*
|
|
5
|
+
* This hook is typically used to create custom drag overlays, layers,
|
|
6
|
+
* and control how dragged elements are displayed during drag operations.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```vue
|
|
10
|
+
* <script setup lang="ts">
|
|
11
|
+
* import { computed } from 'vue';
|
|
12
|
+
* import { useDragContainer } from '../composables/useDragContainer';
|
|
13
|
+
*
|
|
14
|
+
* const { elementRef, pointerPosition, isDragging, draggingElements } =
|
|
15
|
+
* useDragContainer();
|
|
16
|
+
*
|
|
17
|
+
* const computedStyle = computed(() => ({
|
|
18
|
+
* transform: `translate3d(${
|
|
19
|
+
* (pointerPosition.current.value?.x ?? 0) -
|
|
20
|
+
* (pointerPosition.offset.pixel.value?.x ?? 0)
|
|
21
|
+
* }px, ${
|
|
22
|
+
* (pointerPosition.current.value?.y ?? 0) -
|
|
23
|
+
* (pointerPosition.offset.pixel.value?.y ?? 0)
|
|
24
|
+
* }px, 0)`,
|
|
25
|
+
* }));
|
|
26
|
+
*</script>
|
|
27
|
+
*
|
|
28
|
+
*<template>
|
|
29
|
+
* <Teleport to="body">
|
|
30
|
+
* <div
|
|
31
|
+
* v-if="isDragging"
|
|
32
|
+
* ref="elementRef"
|
|
33
|
+
* :style="computedStyle"
|
|
34
|
+
* class="default-drag-overlay"
|
|
35
|
+
* >
|
|
36
|
+
* <div
|
|
37
|
+
* v-for="(element, index) in draggingElements"
|
|
38
|
+
* :key="index"
|
|
39
|
+
* v-html="element.initialHTML"
|
|
40
|
+
* :style="{
|
|
41
|
+
* width: `${element.initialRect?.width}px`,
|
|
42
|
+
* height: `${element.initialRect?.height}px`,
|
|
43
|
+
* }"
|
|
44
|
+
* />
|
|
45
|
+
* </div>
|
|
46
|
+
* </Teleport>
|
|
47
|
+
*</template>
|
|
48
|
+
*
|
|
49
|
+
*<style scoped>
|
|
50
|
+
* .default-drag-overlay {
|
|
51
|
+
* position: fixed;
|
|
52
|
+
* top: 0;
|
|
53
|
+
* left: 0;
|
|
54
|
+
* background-color: rgba(0, 0, 0, 0.5);
|
|
55
|
+
* transition: 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
|
|
56
|
+
* z-index: 1000;
|
|
57
|
+
* }
|
|
58
|
+
*</style>
|
|
59
|
+
*
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* @returns {Object} Container controls and state
|
|
63
|
+
* @property {Ref<HTMLElement | null>} elementRef - Reference to be bound to container element
|
|
64
|
+
* @property {Ref<IDragElement[]>} draggingElements - Currently dragged elements
|
|
65
|
+
* @property {IPointerPosition} pointerPosition - Current pointer coordinates and offsets
|
|
66
|
+
* @property {Ref<boolean>} isDragging - Whether drag operation is in progress
|
|
67
|
+
*/
|
|
68
|
+
export declare const useDragContainer: () => {
|
|
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
|
+
};
|
|
@@ -1,51 +1,50 @@
|
|
|
1
1
|
import { IUseDragOptions } from "../types";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @param options -
|
|
8
|
-
* @param options.
|
|
9
|
-
* @param options.
|
|
10
|
-
* @param options.
|
|
11
|
-
* @param options.
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* -
|
|
16
|
-
* -
|
|
17
|
-
* -
|
|
18
|
-
* -
|
|
19
|
-
* -
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
};
|
|
2
|
+
/**
|
|
3
|
+
* Main hook for making elements draggable.
|
|
4
|
+
* Provides all necessary functionality for drag and drop operations.
|
|
5
|
+
*
|
|
6
|
+
* @param options - Configuration options for draggable element
|
|
7
|
+
* @param options.groups - Groups that element belongs to (for drop zone filtering)
|
|
8
|
+
* @param options.events - Event handlers for drag lifecycle
|
|
9
|
+
* @param options.data - Custom data to be passed to event handlers
|
|
10
|
+
* @param options.layer - Custom component to render while dragging
|
|
11
|
+
* @param options.container - Parent container component reference
|
|
12
|
+
*
|
|
13
|
+
* @returns Object containing:
|
|
14
|
+
* - elementRef: Reference to be bound to draggable element
|
|
15
|
+
* - isDragging: Whether element is currently being dragged
|
|
16
|
+
* - isOvered: Whether element is being hovered by dragged element
|
|
17
|
+
* - isAllowed: Whether element can interact with current drop zone based on group matching
|
|
18
|
+
* - pointerPosition: Current pointer coordinates
|
|
19
|
+
* - handleDragStart: Function to initiate drag operation
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```vue
|
|
23
|
+
* <template>
|
|
24
|
+
* <div
|
|
25
|
+
* ref="elementRef"
|
|
26
|
+
* :class="{ 'dragging': isDragging }"
|
|
27
|
+
* @pointerdown="handleDragStart"
|
|
28
|
+
* >
|
|
29
|
+
* Drag me!
|
|
30
|
+
* </div>
|
|
31
|
+
* </template>
|
|
32
|
+
*
|
|
33
|
+
* <script setup lang="ts">
|
|
34
|
+
* const { elementRef, isDragging, handleDragStart } = useDraggable({
|
|
35
|
+
* groups: ['items'],
|
|
36
|
+
* events: {
|
|
37
|
+
* onEnd: (store) => console.log('Drag ended!'),
|
|
38
|
+
* }
|
|
39
|
+
* });
|
|
40
|
+
* </script>
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare const useDraggable: (options?: IUseDragOptions) => {
|
|
44
|
+
pointerPosition: import('../types').IPointerPosition;
|
|
45
|
+
elementRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
46
|
+
isDragging: import('vue').ComputedRef<boolean>;
|
|
47
|
+
isOvered: import('vue').ComputedRef<boolean>;
|
|
48
|
+
isAllowed: import('vue').ComputedRef<boolean>;
|
|
49
|
+
handleDragStart: (event: PointerEvent) => void;
|
|
50
|
+
};
|
|
@@ -1,91 +1,90 @@
|
|
|
1
1
|
import { IUseDropOptions } from "../types";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @param options -
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* @param options.events -
|
|
11
|
-
* @param options.events.
|
|
12
|
-
* @param options.events.
|
|
13
|
-
* @param options.
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* -
|
|
18
|
-
* -
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* '
|
|
28
|
-
* '
|
|
29
|
-
* 'drop-
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
};
|
|
2
|
+
/**
|
|
3
|
+
* Hook for creating drop zones that can accept dragged elements.
|
|
4
|
+
* Manages drop zone registration and interaction states.
|
|
5
|
+
*
|
|
6
|
+
* @param options - Configuration options for drop zone
|
|
7
|
+
* @param options.groups - Groups that this zone accepts. Elements can only be
|
|
8
|
+
* dropped if they share at least one group with the zone
|
|
9
|
+
* @param options.events - Event handlers for drop zone lifecycle
|
|
10
|
+
* @param options.events.onDrop - Called when compatible element is dropped
|
|
11
|
+
* @param options.events.onHover - Called when compatible element hovers
|
|
12
|
+
* @param options.events.onLeave - Called when element leaves zone
|
|
13
|
+
* @param options.data - Custom data accessible in event handlers
|
|
14
|
+
*
|
|
15
|
+
* @returns Object containing:
|
|
16
|
+
* - elementRef: Reference to be bound to drop zone element
|
|
17
|
+
* - isOvered: Whether zone is currently being hovered by dragged element
|
|
18
|
+
* - isAllowed: Whether currently dragged element can be dropped (groups match)
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```vue
|
|
22
|
+
* <template>
|
|
23
|
+
* <div
|
|
24
|
+
* ref="elementRef"
|
|
25
|
+
* :class="{
|
|
26
|
+
* 'drop-zone': true,
|
|
27
|
+
* 'zone-hovered': isOvered,
|
|
28
|
+
* 'drop-allowed': isAllowed && isOvered,
|
|
29
|
+
* 'drop-forbidden': !isAllowed && isOvered
|
|
30
|
+
* }"
|
|
31
|
+
* >
|
|
32
|
+
* <slot />
|
|
33
|
+
* </div>
|
|
34
|
+
* </template>
|
|
35
|
+
*
|
|
36
|
+
* <script setup lang="ts">
|
|
37
|
+
* const { elementRef, isOvered, isAllowed } = useDrop({
|
|
38
|
+
* // Зона принимает только элементы из группы 'items'
|
|
39
|
+
* groups: ['items'],
|
|
40
|
+
* events: {
|
|
41
|
+
* onDrop: (store) => {
|
|
42
|
+
* const droppedElements = store.draggingElements.value;
|
|
43
|
+
* console.log('Elements dropped!', droppedElements);
|
|
44
|
+
* },
|
|
45
|
+
* onHover: (store) => {
|
|
46
|
+
* // Подсветка зоны при наведении совместимого элемента
|
|
47
|
+
* if (isAllowed.value) {
|
|
48
|
+
* console.log('Compatible element hovering!');
|
|
49
|
+
* }
|
|
50
|
+
* },
|
|
51
|
+
* onLeave: () => {
|
|
52
|
+
* console.log('Element left drop zone');
|
|
53
|
+
* }
|
|
54
|
+
* },
|
|
55
|
+
* // Пользовательские данные доступны в обработчиках
|
|
56
|
+
* data: {
|
|
57
|
+
* zoneId: 'main-drop-zone',
|
|
58
|
+
* acceptLimit: 5
|
|
59
|
+
* }
|
|
60
|
+
* });
|
|
61
|
+
* </script>
|
|
62
|
+
*
|
|
63
|
+
* <style scoped>
|
|
64
|
+
* .drop-zone {
|
|
65
|
+
* border: 2px dashed #ccc;
|
|
66
|
+
* padding: 20px;
|
|
67
|
+
* transition: all 0.3s;
|
|
68
|
+
* }
|
|
69
|
+
*
|
|
70
|
+
* .zone-hovered {
|
|
71
|
+
* background: #f0f0f0;
|
|
72
|
+
* }
|
|
73
|
+
*
|
|
74
|
+
* .drop-allowed {
|
|
75
|
+
* border-color: #4CAF50;
|
|
76
|
+
* background: #E8F5E9;
|
|
77
|
+
* }
|
|
78
|
+
*
|
|
79
|
+
* .drop-forbidden {
|
|
80
|
+
* border-color: #F44336;
|
|
81
|
+
* background: #FFEBEE;
|
|
82
|
+
* }
|
|
83
|
+
* </style>
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export declare const useDroppable: (options?: IUseDropOptions) => {
|
|
87
|
+
elementRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
88
|
+
isOvered: import('vue').ComputedRef<boolean>;
|
|
89
|
+
isAllowed: import('vue').ComputedRef<boolean>;
|
|
90
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
2
|
+
export declare const usePointer: (elementRef: Ref<HTMLElement | null>) => {
|
|
3
|
+
onPointerStart: (event: PointerEvent) => void;
|
|
4
|
+
onPointerMove: (event: PointerEvent | WheelEvent) => void;
|
|
5
|
+
onPointerEnd: () => void;
|
|
6
|
+
};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
* @
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
2
|
+
/**
|
|
3
|
+
* Hook for managing element selection in drag and drop interface
|
|
4
|
+
* @param elementRef - Reference to the HTML element that can be selected
|
|
5
|
+
* @returns Object containing selection state and handlers
|
|
6
|
+
*/
|
|
7
|
+
export declare const useSelection: (elementRef: Ref<HTMLElement | null>) => {
|
|
8
|
+
handleUnselect: () => void;
|
|
9
|
+
handleSelect: () => void;
|
|
10
|
+
handleToggleSelect: () => void;
|
|
11
|
+
isSelected: import('vue').ComputedRef<boolean>;
|
|
12
|
+
isParentOfSelected: import('vue').ComputedRef<boolean>;
|
|
13
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
2
|
+
export declare const useSensor: (elementRef: Ref<HTMLElement | null>) => {
|
|
3
|
+
activate: (event: PointerEvent) => void;
|
|
4
|
+
track: (event: PointerEvent | WheelEvent) => void;
|
|
5
|
+
deactivate: () => void;
|
|
6
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { useDnDStore } from './composables/useDnDStore';
|
|
|
3
3
|
import { useDraggable } from './composables/useDraggable';
|
|
4
4
|
import { useDroppable } from './composables/useDroppable';
|
|
5
5
|
import { useSelection } from './composables/useSelection';
|
|
6
|
-
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export type { IDnDStore, IActiveContainer, IBoundingBox, IDragElement, IDraggingElement, IDropZone, IPoint, IPointerPosition, IUseDragOptions, IUseDropOptions, } from './types';
|
|
6
|
+
export { DragOverlay, useDraggable, useDroppable, useDnDStore, useSelection };
|
|
7
|
+
export { getBoundingBox } from './utils/geometry';
|
|
8
|
+
export type { IDnDStore, IActiveContainer, IBoundingBox, IDragElement, IDraggingElement, IDropZone, IPoint, IPointerPosition, IUseDragOptions, IUseDropOptions, } from './types';
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { IUseDragOptions } from "../types";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* @
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
2
|
+
/**
|
|
3
|
+
* Hook for managing draggable elements and their interactions.
|
|
4
|
+
* Provides methods for registering, unregistering elements,
|
|
5
|
+
* checking if an element is being dragged, and determining if it can be dropped.
|
|
6
|
+
*
|
|
7
|
+
* @param options - Optional configuration object for element management
|
|
8
|
+
* @returns Object containing element management state and methods
|
|
9
|
+
*/
|
|
10
|
+
export declare const useElementManager: (options?: IUseDragOptions) => {
|
|
11
|
+
elementRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
12
|
+
registerElement: () => void;
|
|
13
|
+
unregisterElement: () => void;
|
|
14
|
+
isDragging: import('vue').ComputedRef<boolean>;
|
|
15
|
+
isOvered: import('vue').ComputedRef<boolean>;
|
|
16
|
+
isAllowed: import('vue').ComputedRef<boolean>;
|
|
17
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const useInteractionManager: () => {
|
|
2
|
-
disableInteractions: () => void;
|
|
3
|
-
enableInteractions: () => void;
|
|
4
|
-
};
|
|
1
|
+
export declare const useInteractionManager: () => {
|
|
2
|
+
disableInteractions: () => void;
|
|
3
|
+
enableInteractions: () => void;
|
|
4
|
+
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { IUseDropOptions } from "../types";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
2
|
+
export declare const useZoneManager: (options?: IUseDropOptions) => {
|
|
3
|
+
elementRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
4
|
+
registerZone: () => void;
|
|
5
|
+
unregisterZone: () => void;
|
|
6
|
+
isOvered: import('vue').ComputedRef<boolean>;
|
|
7
|
+
isAllowed: import('vue').ComputedRef<boolean>;
|
|
8
|
+
};
|