@dnd-kit/dom 0.1.21 → 0.2.0-beta-20251026132120
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/index.cjs +122 -74
- package/index.cjs.map +1 -1
- package/index.d.cts +104 -96
- package/index.d.ts +104 -96
- package/index.js +125 -78
- package/index.js.map +1 -1
- package/package.json +5 -5
- package/utilities.cjs +51 -9
- package/utilities.cjs.map +1 -1
- package/utilities.d.cts +16 -2
- package/utilities.d.ts +16 -2
- package/utilities.js +50 -10
- package/utilities.js.map +1 -1
package/index.d.cts
CHANGED
|
@@ -1,9 +1,50 @@
|
|
|
1
1
|
import * as _dnd_kit_abstract from '@dnd-kit/abstract';
|
|
2
|
-
import {
|
|
2
|
+
import { Sensors as Sensors$1, Data, Draggable as Draggable$1, DraggableInput, Droppable as Droppable$1, DroppableInput, DragDropManager as DragDropManager$1, DragDropManagerInput, Modifiers, Plugins, Sensor, ActivationConstraints, ActivationController, ActivationConstraint, DragDropEvents, Plugin, CorePlugin } from '@dnd-kit/abstract';
|
|
3
3
|
import { CollisionDetector } from '@dnd-kit/collision';
|
|
4
|
-
import {
|
|
4
|
+
import { Shape, Coordinates, Distance } from '@dnd-kit/geometry';
|
|
5
5
|
import { CleanupFunction } from '@dnd-kit/state';
|
|
6
6
|
|
|
7
|
+
type Sensors = Sensors$1<DragDropManager>;
|
|
8
|
+
|
|
9
|
+
type FeedbackType = 'default' | 'move' | 'clone' | 'none';
|
|
10
|
+
interface Input$2<T extends Data = Data> extends DraggableInput<T> {
|
|
11
|
+
handle?: Element;
|
|
12
|
+
element?: Element;
|
|
13
|
+
feedback?: FeedbackType;
|
|
14
|
+
sensors?: Sensors;
|
|
15
|
+
}
|
|
16
|
+
declare class Draggable<T extends Data = Data> extends Draggable$1<T, DragDropManager> {
|
|
17
|
+
constructor({ element, effects, handle, feedback, ...input }: Input$2<T>, manager: DragDropManager | undefined);
|
|
18
|
+
accessor handle: Element | undefined;
|
|
19
|
+
accessor element: Element | undefined;
|
|
20
|
+
accessor feedback: FeedbackType;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
type OptionalInput = 'collisionDetector';
|
|
24
|
+
interface Input$1<T extends Data = Data> extends Omit<DroppableInput<T>, OptionalInput> {
|
|
25
|
+
collisionDetector?: CollisionDetector;
|
|
26
|
+
element?: Element;
|
|
27
|
+
}
|
|
28
|
+
declare class Droppable<T extends Data = Data> extends Droppable$1<T, DragDropManager> {
|
|
29
|
+
#private;
|
|
30
|
+
constructor({ element, effects, ...input }: Input$1<T>, manager: DragDropManager | undefined);
|
|
31
|
+
accessor proxy: Element | undefined;
|
|
32
|
+
set element(element: Element | undefined);
|
|
33
|
+
get element(): Element | undefined;
|
|
34
|
+
refreshShape: () => Shape | undefined;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface Input extends DragDropManagerInput<DragDropManager> {
|
|
38
|
+
}
|
|
39
|
+
declare const defaultPreset: {
|
|
40
|
+
modifiers: Modifiers<DragDropManager>;
|
|
41
|
+
plugins: Plugins<DragDropManager>;
|
|
42
|
+
sensors: Sensors$1<DragDropManager>;
|
|
43
|
+
};
|
|
44
|
+
declare class DragDropManager<T extends Data = Data, U extends Draggable<T> = Draggable<T>, V extends Droppable<T> = Droppable<T>> extends DragDropManager$1<U, V> {
|
|
45
|
+
constructor(input?: Input);
|
|
46
|
+
}
|
|
47
|
+
|
|
7
48
|
interface EventListenerDescriptor {
|
|
8
49
|
type: string;
|
|
9
50
|
listener(event: Event): void;
|
|
@@ -13,10 +54,68 @@ type EventListenerInput = EventListenerDescriptor[] | EventListenerDescriptor;
|
|
|
13
54
|
declare class Listeners {
|
|
14
55
|
private entries;
|
|
15
56
|
constructor();
|
|
16
|
-
bind(target: EventTarget, input: EventListenerInput): () => void;
|
|
57
|
+
bind(target: EventTarget | EventTarget[], input: EventListenerInput): () => void;
|
|
17
58
|
clear: () => void;
|
|
18
59
|
}
|
|
19
60
|
|
|
61
|
+
type Maybe<T> = T | undefined;
|
|
62
|
+
interface PointerSensorOptions {
|
|
63
|
+
activationConstraints?: ActivationConstraints<PointerEvent> | ((event: PointerEvent, source: Draggable) => ActivationConstraints<PointerEvent> | undefined);
|
|
64
|
+
activatorElements?: Maybe<Element>[] | ((source: Draggable) => Maybe<Element>[]);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The PointerSensor class is an input sensor that handles Pointer events,
|
|
68
|
+
* such as mouse, touch and pen interactions.
|
|
69
|
+
*/
|
|
70
|
+
declare class PointerSensor extends Sensor<DragDropManager, PointerSensorOptions> {
|
|
71
|
+
#private;
|
|
72
|
+
manager: DragDropManager;
|
|
73
|
+
options?: PointerSensorOptions | undefined;
|
|
74
|
+
protected listeners: Listeners;
|
|
75
|
+
protected initialCoordinates: Coordinates | undefined;
|
|
76
|
+
protected controller: ActivationController<PointerEvent> | undefined;
|
|
77
|
+
constructor(manager: DragDropManager, options?: PointerSensorOptions | undefined);
|
|
78
|
+
protected activationConstraints(event: PointerEvent, source: Draggable): ActivationConstraints<PointerEvent> | undefined;
|
|
79
|
+
bind(source: Draggable, options?: PointerSensorOptions | undefined): () => void;
|
|
80
|
+
protected handlePointerDown(event: PointerEvent, source: Draggable, options?: PointerSensorOptions): void;
|
|
81
|
+
private latest;
|
|
82
|
+
protected handleMove: () => void;
|
|
83
|
+
protected handlePointerMove(event: PointerEvent, source: Draggable): void;
|
|
84
|
+
private handlePointerUp;
|
|
85
|
+
protected handleKeyDown(event: KeyboardEvent): void;
|
|
86
|
+
protected handleStart(source: Draggable, event: PointerEvent): void;
|
|
87
|
+
protected handleCancel(event: Event): void;
|
|
88
|
+
protected cleanup(): void;
|
|
89
|
+
destroy(): void;
|
|
90
|
+
static configure: (options: PointerSensorOptions) => _dnd_kit_abstract.PluginDescriptor<any, any, typeof PointerSensor>;
|
|
91
|
+
static defaults: Readonly<PointerSensorOptions>;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
interface DistanceConstraintOptions {
|
|
95
|
+
value: number;
|
|
96
|
+
tolerance?: Distance;
|
|
97
|
+
}
|
|
98
|
+
declare class DistanceConstraint extends ActivationConstraint<PointerEvent, DistanceConstraintOptions> {
|
|
99
|
+
#private;
|
|
100
|
+
onEvent(event: PointerEvent): void;
|
|
101
|
+
abort(): void;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
interface DelayConstraintOptions {
|
|
105
|
+
value: number;
|
|
106
|
+
tolerance: Distance;
|
|
107
|
+
}
|
|
108
|
+
declare class DelayConstraint extends ActivationConstraint<PointerEvent, DelayConstraintOptions> {
|
|
109
|
+
#private;
|
|
110
|
+
onEvent(event: PointerEvent): void;
|
|
111
|
+
abort(): void;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
declare class PointerActivationConstraints {
|
|
115
|
+
static Delay: typeof DelayConstraint;
|
|
116
|
+
static Distance: typeof DistanceConstraint;
|
|
117
|
+
}
|
|
118
|
+
|
|
20
119
|
type KeyCode = KeyboardEvent['code'];
|
|
21
120
|
type KeyboardCodes = {
|
|
22
121
|
start: KeyCode[];
|
|
@@ -69,10 +168,7 @@ declare class KeyboardSensor extends Sensor<DragDropManager, KeyboardSensorOptio
|
|
|
69
168
|
options?: KeyboardSensorOptions | undefined;
|
|
70
169
|
constructor(manager: DragDropManager, options?: KeyboardSensorOptions | undefined);
|
|
71
170
|
protected listeners: Listeners;
|
|
72
|
-
bind(source: Draggable, options?: KeyboardSensorOptions | undefined):
|
|
73
|
-
(): void;
|
|
74
|
-
[Symbol.dispose](): void;
|
|
75
|
-
};
|
|
171
|
+
bind(source: Draggable, options?: KeyboardSensorOptions | undefined): () => void;
|
|
76
172
|
protected handleSourceKeyDown: (event: KeyboardEvent, source: Draggable, options: KeyboardSensorOptions | undefined) => void;
|
|
77
173
|
protected handleStart(event: KeyboardEvent, source: Draggable, options: KeyboardSensorOptions | undefined): void;
|
|
78
174
|
protected handleKeyDown(event: KeyboardEvent, _source: Draggable, options: KeyboardSensorOptions | undefined): void;
|
|
@@ -85,94 +181,6 @@ declare class KeyboardSensor extends Sensor<DragDropManager, KeyboardSensorOptio
|
|
|
85
181
|
static defaults: Readonly<Required<KeyboardSensorOptions>>;
|
|
86
182
|
}
|
|
87
183
|
|
|
88
|
-
interface DelayConstraint {
|
|
89
|
-
value: number;
|
|
90
|
-
tolerance: Distance;
|
|
91
|
-
}
|
|
92
|
-
interface DistanceConstraint {
|
|
93
|
-
value: Distance;
|
|
94
|
-
tolerance?: Distance;
|
|
95
|
-
}
|
|
96
|
-
interface ActivationConstraints {
|
|
97
|
-
distance?: DistanceConstraint;
|
|
98
|
-
delay?: DelayConstraint;
|
|
99
|
-
}
|
|
100
|
-
type Maybe<T> = T | undefined;
|
|
101
|
-
interface PointerSensorOptions {
|
|
102
|
-
activationConstraints?: ActivationConstraints | ((event: PointerEvent, source: Draggable) => ActivationConstraints | undefined);
|
|
103
|
-
activatorElements?: Maybe<Element>[] | ((source: Draggable) => Maybe<Element>[]);
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* The PointerSensor class is an input sensor that handles Pointer events,
|
|
107
|
-
* such as mouse, touch and pen interactions.
|
|
108
|
-
*/
|
|
109
|
-
declare class PointerSensor extends Sensor<DragDropManager, PointerSensorOptions> {
|
|
110
|
-
#private;
|
|
111
|
-
manager: DragDropManager;
|
|
112
|
-
options?: PointerSensorOptions | undefined;
|
|
113
|
-
protected listeners: Listeners;
|
|
114
|
-
protected initialCoordinates: Coordinates | undefined;
|
|
115
|
-
constructor(manager: DragDropManager, options?: PointerSensorOptions | undefined);
|
|
116
|
-
protected activationConstraints(event: PointerEvent, source: Draggable): ActivationConstraints | undefined;
|
|
117
|
-
bind(source: Draggable, options?: PointerSensorOptions | undefined): {
|
|
118
|
-
(): void;
|
|
119
|
-
[Symbol.dispose](): void;
|
|
120
|
-
};
|
|
121
|
-
protected handlePointerDown(event: PointerEvent, source: Draggable, options?: PointerSensorOptions): void;
|
|
122
|
-
private latest;
|
|
123
|
-
protected handleMove: () => void;
|
|
124
|
-
protected handlePointerMove(event: PointerEvent, source: Draggable): void;
|
|
125
|
-
private handlePointerUp;
|
|
126
|
-
protected handleKeyDown(event: KeyboardEvent): void;
|
|
127
|
-
protected handleStart(source: Draggable, event: PointerEvent): void;
|
|
128
|
-
protected handleCancel(event: Event): void;
|
|
129
|
-
protected cleanup(): void;
|
|
130
|
-
destroy(): void;
|
|
131
|
-
static configure: (options: PointerSensorOptions) => _dnd_kit_abstract.PluginDescriptor<any, any, typeof PointerSensor>;
|
|
132
|
-
static defaults: Readonly<PointerSensorOptions>;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
type Sensors = Sensors$1<DragDropManager>;
|
|
136
|
-
|
|
137
|
-
type FeedbackType = 'default' | 'move' | 'clone' | 'none';
|
|
138
|
-
interface Input$2<T extends Data = Data> extends DraggableInput<T> {
|
|
139
|
-
handle?: Element;
|
|
140
|
-
element?: Element;
|
|
141
|
-
feedback?: FeedbackType;
|
|
142
|
-
sensors?: Sensors;
|
|
143
|
-
}
|
|
144
|
-
declare class Draggable<T extends Data = Data> extends Draggable$1<T, DragDropManager> {
|
|
145
|
-
constructor({ element, effects, handle, feedback, ...input }: Input$2<T>, manager: DragDropManager | undefined);
|
|
146
|
-
accessor handle: Element | undefined;
|
|
147
|
-
accessor element: Element | undefined;
|
|
148
|
-
accessor feedback: FeedbackType;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
type OptionalInput = 'collisionDetector';
|
|
152
|
-
interface Input$1<T extends Data = Data> extends Omit<DroppableInput<T>, OptionalInput> {
|
|
153
|
-
collisionDetector?: CollisionDetector;
|
|
154
|
-
element?: Element;
|
|
155
|
-
}
|
|
156
|
-
declare class Droppable<T extends Data = Data> extends Droppable$1<T, DragDropManager> {
|
|
157
|
-
#private;
|
|
158
|
-
constructor({ element, effects, ...input }: Input$1<T>, manager: DragDropManager | undefined);
|
|
159
|
-
accessor proxy: Element | undefined;
|
|
160
|
-
set element(element: Element | undefined);
|
|
161
|
-
get element(): Element | undefined;
|
|
162
|
-
refreshShape: () => Shape | undefined;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
interface Input extends DragDropManagerInput<DragDropManager> {
|
|
166
|
-
}
|
|
167
|
-
declare const defaultPreset: {
|
|
168
|
-
modifiers: Modifiers<DragDropManager>;
|
|
169
|
-
plugins: Plugins<DragDropManager>;
|
|
170
|
-
sensors: Sensors$1<DragDropManager>;
|
|
171
|
-
};
|
|
172
|
-
declare class DragDropManager<T extends Data = Data, U extends Draggable<T> = Draggable<T>, V extends Droppable<T> = Droppable<T>> extends DragDropManager$1<U, V> {
|
|
173
|
-
constructor(input?: Input);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
184
|
type GetAnnouncementForEvent<Key extends keyof DragDropEvents<any, any, any>> = (event: Parameters<DragDropEvents<Draggable, Droppable, DragDropManager>[Key]>[0], manager: DragDropManager) => string | undefined;
|
|
177
185
|
interface Announcements {
|
|
178
186
|
dragstart: GetAnnouncementForEvent<'dragstart'>;
|
|
@@ -295,4 +303,4 @@ declare class PreventSelection extends Plugin<DragDropManager> {
|
|
|
295
303
|
constructor(manager: DragDropManager, options?: PreventSelectionPluginOptions);
|
|
296
304
|
}
|
|
297
305
|
|
|
298
|
-
export { Accessibility, AutoScroller, Cursor, DragDropManager, type Input as DragDropManagerInput, Draggable, type Input$2 as DraggableInput, Droppable, type Input$1 as DroppableInput, Feedback, type FeedbackType, KeyboardSensor, PointerSensor, PreventSelection, ScrollListener, Scroller, type Sensors, type Transition, defaultPreset };
|
|
306
|
+
export { Accessibility, AutoScroller, Cursor, DragDropManager, type Input as DragDropManagerInput, Draggable, type Input$2 as DraggableInput, Droppable, type Input$1 as DroppableInput, Feedback, type FeedbackType, KeyboardSensor, type KeyboardSensorOptions, PointerActivationConstraints, PointerSensor, type PointerSensorOptions, PreventSelection, ScrollListener, Scroller, type Sensors, type Transition, defaultPreset };
|
package/index.d.ts
CHANGED
|
@@ -1,9 +1,50 @@
|
|
|
1
1
|
import * as _dnd_kit_abstract from '@dnd-kit/abstract';
|
|
2
|
-
import {
|
|
2
|
+
import { Sensors as Sensors$1, Data, Draggable as Draggable$1, DraggableInput, Droppable as Droppable$1, DroppableInput, DragDropManager as DragDropManager$1, DragDropManagerInput, Modifiers, Plugins, Sensor, ActivationConstraints, ActivationController, ActivationConstraint, DragDropEvents, Plugin, CorePlugin } from '@dnd-kit/abstract';
|
|
3
3
|
import { CollisionDetector } from '@dnd-kit/collision';
|
|
4
|
-
import {
|
|
4
|
+
import { Shape, Coordinates, Distance } from '@dnd-kit/geometry';
|
|
5
5
|
import { CleanupFunction } from '@dnd-kit/state';
|
|
6
6
|
|
|
7
|
+
type Sensors = Sensors$1<DragDropManager>;
|
|
8
|
+
|
|
9
|
+
type FeedbackType = 'default' | 'move' | 'clone' | 'none';
|
|
10
|
+
interface Input$2<T extends Data = Data> extends DraggableInput<T> {
|
|
11
|
+
handle?: Element;
|
|
12
|
+
element?: Element;
|
|
13
|
+
feedback?: FeedbackType;
|
|
14
|
+
sensors?: Sensors;
|
|
15
|
+
}
|
|
16
|
+
declare class Draggable<T extends Data = Data> extends Draggable$1<T, DragDropManager> {
|
|
17
|
+
constructor({ element, effects, handle, feedback, ...input }: Input$2<T>, manager: DragDropManager | undefined);
|
|
18
|
+
accessor handle: Element | undefined;
|
|
19
|
+
accessor element: Element | undefined;
|
|
20
|
+
accessor feedback: FeedbackType;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
type OptionalInput = 'collisionDetector';
|
|
24
|
+
interface Input$1<T extends Data = Data> extends Omit<DroppableInput<T>, OptionalInput> {
|
|
25
|
+
collisionDetector?: CollisionDetector;
|
|
26
|
+
element?: Element;
|
|
27
|
+
}
|
|
28
|
+
declare class Droppable<T extends Data = Data> extends Droppable$1<T, DragDropManager> {
|
|
29
|
+
#private;
|
|
30
|
+
constructor({ element, effects, ...input }: Input$1<T>, manager: DragDropManager | undefined);
|
|
31
|
+
accessor proxy: Element | undefined;
|
|
32
|
+
set element(element: Element | undefined);
|
|
33
|
+
get element(): Element | undefined;
|
|
34
|
+
refreshShape: () => Shape | undefined;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface Input extends DragDropManagerInput<DragDropManager> {
|
|
38
|
+
}
|
|
39
|
+
declare const defaultPreset: {
|
|
40
|
+
modifiers: Modifiers<DragDropManager>;
|
|
41
|
+
plugins: Plugins<DragDropManager>;
|
|
42
|
+
sensors: Sensors$1<DragDropManager>;
|
|
43
|
+
};
|
|
44
|
+
declare class DragDropManager<T extends Data = Data, U extends Draggable<T> = Draggable<T>, V extends Droppable<T> = Droppable<T>> extends DragDropManager$1<U, V> {
|
|
45
|
+
constructor(input?: Input);
|
|
46
|
+
}
|
|
47
|
+
|
|
7
48
|
interface EventListenerDescriptor {
|
|
8
49
|
type: string;
|
|
9
50
|
listener(event: Event): void;
|
|
@@ -13,10 +54,68 @@ type EventListenerInput = EventListenerDescriptor[] | EventListenerDescriptor;
|
|
|
13
54
|
declare class Listeners {
|
|
14
55
|
private entries;
|
|
15
56
|
constructor();
|
|
16
|
-
bind(target: EventTarget, input: EventListenerInput): () => void;
|
|
57
|
+
bind(target: EventTarget | EventTarget[], input: EventListenerInput): () => void;
|
|
17
58
|
clear: () => void;
|
|
18
59
|
}
|
|
19
60
|
|
|
61
|
+
type Maybe<T> = T | undefined;
|
|
62
|
+
interface PointerSensorOptions {
|
|
63
|
+
activationConstraints?: ActivationConstraints<PointerEvent> | ((event: PointerEvent, source: Draggable) => ActivationConstraints<PointerEvent> | undefined);
|
|
64
|
+
activatorElements?: Maybe<Element>[] | ((source: Draggable) => Maybe<Element>[]);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The PointerSensor class is an input sensor that handles Pointer events,
|
|
68
|
+
* such as mouse, touch and pen interactions.
|
|
69
|
+
*/
|
|
70
|
+
declare class PointerSensor extends Sensor<DragDropManager, PointerSensorOptions> {
|
|
71
|
+
#private;
|
|
72
|
+
manager: DragDropManager;
|
|
73
|
+
options?: PointerSensorOptions | undefined;
|
|
74
|
+
protected listeners: Listeners;
|
|
75
|
+
protected initialCoordinates: Coordinates | undefined;
|
|
76
|
+
protected controller: ActivationController<PointerEvent> | undefined;
|
|
77
|
+
constructor(manager: DragDropManager, options?: PointerSensorOptions | undefined);
|
|
78
|
+
protected activationConstraints(event: PointerEvent, source: Draggable): ActivationConstraints<PointerEvent> | undefined;
|
|
79
|
+
bind(source: Draggable, options?: PointerSensorOptions | undefined): () => void;
|
|
80
|
+
protected handlePointerDown(event: PointerEvent, source: Draggable, options?: PointerSensorOptions): void;
|
|
81
|
+
private latest;
|
|
82
|
+
protected handleMove: () => void;
|
|
83
|
+
protected handlePointerMove(event: PointerEvent, source: Draggable): void;
|
|
84
|
+
private handlePointerUp;
|
|
85
|
+
protected handleKeyDown(event: KeyboardEvent): void;
|
|
86
|
+
protected handleStart(source: Draggable, event: PointerEvent): void;
|
|
87
|
+
protected handleCancel(event: Event): void;
|
|
88
|
+
protected cleanup(): void;
|
|
89
|
+
destroy(): void;
|
|
90
|
+
static configure: (options: PointerSensorOptions) => _dnd_kit_abstract.PluginDescriptor<any, any, typeof PointerSensor>;
|
|
91
|
+
static defaults: Readonly<PointerSensorOptions>;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
interface DistanceConstraintOptions {
|
|
95
|
+
value: number;
|
|
96
|
+
tolerance?: Distance;
|
|
97
|
+
}
|
|
98
|
+
declare class DistanceConstraint extends ActivationConstraint<PointerEvent, DistanceConstraintOptions> {
|
|
99
|
+
#private;
|
|
100
|
+
onEvent(event: PointerEvent): void;
|
|
101
|
+
abort(): void;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
interface DelayConstraintOptions {
|
|
105
|
+
value: number;
|
|
106
|
+
tolerance: Distance;
|
|
107
|
+
}
|
|
108
|
+
declare class DelayConstraint extends ActivationConstraint<PointerEvent, DelayConstraintOptions> {
|
|
109
|
+
#private;
|
|
110
|
+
onEvent(event: PointerEvent): void;
|
|
111
|
+
abort(): void;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
declare class PointerActivationConstraints {
|
|
115
|
+
static Delay: typeof DelayConstraint;
|
|
116
|
+
static Distance: typeof DistanceConstraint;
|
|
117
|
+
}
|
|
118
|
+
|
|
20
119
|
type KeyCode = KeyboardEvent['code'];
|
|
21
120
|
type KeyboardCodes = {
|
|
22
121
|
start: KeyCode[];
|
|
@@ -69,10 +168,7 @@ declare class KeyboardSensor extends Sensor<DragDropManager, KeyboardSensorOptio
|
|
|
69
168
|
options?: KeyboardSensorOptions | undefined;
|
|
70
169
|
constructor(manager: DragDropManager, options?: KeyboardSensorOptions | undefined);
|
|
71
170
|
protected listeners: Listeners;
|
|
72
|
-
bind(source: Draggable, options?: KeyboardSensorOptions | undefined):
|
|
73
|
-
(): void;
|
|
74
|
-
[Symbol.dispose](): void;
|
|
75
|
-
};
|
|
171
|
+
bind(source: Draggable, options?: KeyboardSensorOptions | undefined): () => void;
|
|
76
172
|
protected handleSourceKeyDown: (event: KeyboardEvent, source: Draggable, options: KeyboardSensorOptions | undefined) => void;
|
|
77
173
|
protected handleStart(event: KeyboardEvent, source: Draggable, options: KeyboardSensorOptions | undefined): void;
|
|
78
174
|
protected handleKeyDown(event: KeyboardEvent, _source: Draggable, options: KeyboardSensorOptions | undefined): void;
|
|
@@ -85,94 +181,6 @@ declare class KeyboardSensor extends Sensor<DragDropManager, KeyboardSensorOptio
|
|
|
85
181
|
static defaults: Readonly<Required<KeyboardSensorOptions>>;
|
|
86
182
|
}
|
|
87
183
|
|
|
88
|
-
interface DelayConstraint {
|
|
89
|
-
value: number;
|
|
90
|
-
tolerance: Distance;
|
|
91
|
-
}
|
|
92
|
-
interface DistanceConstraint {
|
|
93
|
-
value: Distance;
|
|
94
|
-
tolerance?: Distance;
|
|
95
|
-
}
|
|
96
|
-
interface ActivationConstraints {
|
|
97
|
-
distance?: DistanceConstraint;
|
|
98
|
-
delay?: DelayConstraint;
|
|
99
|
-
}
|
|
100
|
-
type Maybe<T> = T | undefined;
|
|
101
|
-
interface PointerSensorOptions {
|
|
102
|
-
activationConstraints?: ActivationConstraints | ((event: PointerEvent, source: Draggable) => ActivationConstraints | undefined);
|
|
103
|
-
activatorElements?: Maybe<Element>[] | ((source: Draggable) => Maybe<Element>[]);
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* The PointerSensor class is an input sensor that handles Pointer events,
|
|
107
|
-
* such as mouse, touch and pen interactions.
|
|
108
|
-
*/
|
|
109
|
-
declare class PointerSensor extends Sensor<DragDropManager, PointerSensorOptions> {
|
|
110
|
-
#private;
|
|
111
|
-
manager: DragDropManager;
|
|
112
|
-
options?: PointerSensorOptions | undefined;
|
|
113
|
-
protected listeners: Listeners;
|
|
114
|
-
protected initialCoordinates: Coordinates | undefined;
|
|
115
|
-
constructor(manager: DragDropManager, options?: PointerSensorOptions | undefined);
|
|
116
|
-
protected activationConstraints(event: PointerEvent, source: Draggable): ActivationConstraints | undefined;
|
|
117
|
-
bind(source: Draggable, options?: PointerSensorOptions | undefined): {
|
|
118
|
-
(): void;
|
|
119
|
-
[Symbol.dispose](): void;
|
|
120
|
-
};
|
|
121
|
-
protected handlePointerDown(event: PointerEvent, source: Draggable, options?: PointerSensorOptions): void;
|
|
122
|
-
private latest;
|
|
123
|
-
protected handleMove: () => void;
|
|
124
|
-
protected handlePointerMove(event: PointerEvent, source: Draggable): void;
|
|
125
|
-
private handlePointerUp;
|
|
126
|
-
protected handleKeyDown(event: KeyboardEvent): void;
|
|
127
|
-
protected handleStart(source: Draggable, event: PointerEvent): void;
|
|
128
|
-
protected handleCancel(event: Event): void;
|
|
129
|
-
protected cleanup(): void;
|
|
130
|
-
destroy(): void;
|
|
131
|
-
static configure: (options: PointerSensorOptions) => _dnd_kit_abstract.PluginDescriptor<any, any, typeof PointerSensor>;
|
|
132
|
-
static defaults: Readonly<PointerSensorOptions>;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
type Sensors = Sensors$1<DragDropManager>;
|
|
136
|
-
|
|
137
|
-
type FeedbackType = 'default' | 'move' | 'clone' | 'none';
|
|
138
|
-
interface Input$2<T extends Data = Data> extends DraggableInput<T> {
|
|
139
|
-
handle?: Element;
|
|
140
|
-
element?: Element;
|
|
141
|
-
feedback?: FeedbackType;
|
|
142
|
-
sensors?: Sensors;
|
|
143
|
-
}
|
|
144
|
-
declare class Draggable<T extends Data = Data> extends Draggable$1<T, DragDropManager> {
|
|
145
|
-
constructor({ element, effects, handle, feedback, ...input }: Input$2<T>, manager: DragDropManager | undefined);
|
|
146
|
-
accessor handle: Element | undefined;
|
|
147
|
-
accessor element: Element | undefined;
|
|
148
|
-
accessor feedback: FeedbackType;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
type OptionalInput = 'collisionDetector';
|
|
152
|
-
interface Input$1<T extends Data = Data> extends Omit<DroppableInput<T>, OptionalInput> {
|
|
153
|
-
collisionDetector?: CollisionDetector;
|
|
154
|
-
element?: Element;
|
|
155
|
-
}
|
|
156
|
-
declare class Droppable<T extends Data = Data> extends Droppable$1<T, DragDropManager> {
|
|
157
|
-
#private;
|
|
158
|
-
constructor({ element, effects, ...input }: Input$1<T>, manager: DragDropManager | undefined);
|
|
159
|
-
accessor proxy: Element | undefined;
|
|
160
|
-
set element(element: Element | undefined);
|
|
161
|
-
get element(): Element | undefined;
|
|
162
|
-
refreshShape: () => Shape | undefined;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
interface Input extends DragDropManagerInput<DragDropManager> {
|
|
166
|
-
}
|
|
167
|
-
declare const defaultPreset: {
|
|
168
|
-
modifiers: Modifiers<DragDropManager>;
|
|
169
|
-
plugins: Plugins<DragDropManager>;
|
|
170
|
-
sensors: Sensors$1<DragDropManager>;
|
|
171
|
-
};
|
|
172
|
-
declare class DragDropManager<T extends Data = Data, U extends Draggable<T> = Draggable<T>, V extends Droppable<T> = Droppable<T>> extends DragDropManager$1<U, V> {
|
|
173
|
-
constructor(input?: Input);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
184
|
type GetAnnouncementForEvent<Key extends keyof DragDropEvents<any, any, any>> = (event: Parameters<DragDropEvents<Draggable, Droppable, DragDropManager>[Key]>[0], manager: DragDropManager) => string | undefined;
|
|
177
185
|
interface Announcements {
|
|
178
186
|
dragstart: GetAnnouncementForEvent<'dragstart'>;
|
|
@@ -295,4 +303,4 @@ declare class PreventSelection extends Plugin<DragDropManager> {
|
|
|
295
303
|
constructor(manager: DragDropManager, options?: PreventSelectionPluginOptions);
|
|
296
304
|
}
|
|
297
305
|
|
|
298
|
-
export { Accessibility, AutoScroller, Cursor, DragDropManager, type Input as DragDropManagerInput, Draggable, type Input$2 as DraggableInput, Droppable, type Input$1 as DroppableInput, Feedback, type FeedbackType, KeyboardSensor, PointerSensor, PreventSelection, ScrollListener, Scroller, type Sensors, type Transition, defaultPreset };
|
|
306
|
+
export { Accessibility, AutoScroller, Cursor, DragDropManager, type Input as DragDropManagerInput, Draggable, type Input$2 as DraggableInput, Droppable, type Input$1 as DroppableInput, Feedback, type FeedbackType, KeyboardSensor, type KeyboardSensorOptions, PointerActivationConstraints, PointerSensor, type PointerSensorOptions, PreventSelection, ScrollListener, Scroller, type Sensors, type Transition, defaultPreset };
|