v-float 0.5.0 → 0.6.1
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/dist/composables/index.d.ts +0 -1
- package/dist/composables/index.d.ts.map +1 -1
- package/dist/composables/interactions/index.d.ts +1 -1
- package/dist/composables/interactions/index.d.ts.map +1 -1
- package/dist/composables/interactions/polygon.d.ts +1 -1
- package/dist/composables/interactions/polygon.d.ts.map +1 -1
- package/dist/composables/interactions/use-click.d.ts +1 -1
- package/dist/composables/interactions/use-click.d.ts.map +1 -1
- package/dist/composables/interactions/use-client-point.d.ts +180 -20
- package/dist/composables/interactions/use-client-point.d.ts.map +1 -1
- package/dist/composables/interactions/use-escape-key.d.ts +37 -4
- package/dist/composables/interactions/use-escape-key.d.ts.map +1 -1
- package/dist/composables/interactions/use-focus.d.ts +1 -1
- package/dist/composables/interactions/use-focus.d.ts.map +1 -1
- package/dist/composables/interactions/use-hover.d.ts +1 -1
- package/dist/composables/interactions/use-hover.d.ts.map +1 -1
- package/dist/composables/interactions/utils/tree-context.d.ts +1 -1
- package/dist/composables/interactions/utils/tree-context.d.ts.map +1 -1
- package/dist/composables/use-floating-tree.d.ts +72 -10
- package/dist/composables/use-floating-tree.d.ts.map +1 -1
- package/dist/composables/use-floating.d.ts +1 -1
- package/dist/composables/use-floating.d.ts.map +1 -1
- package/dist/v-float.es.js +1476 -1329
- package/dist/v-float.umd.js +1 -1
- package/package.json +3 -3
- package/dist/composables/use-tree.d.ts +0 -144
- package/dist/composables/use-tree.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composables/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composables/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './use-click';
|
|
2
|
-
export
|
|
2
|
+
export { type AxisConstraint, type Coordinates, type TrackingMode, type UseClientPointContext, type UseClientPointOptions, type UseClientPointReturn, useClientPoint, } from './use-client-point';
|
|
3
3
|
export * from './use-escape-key';
|
|
4
4
|
export * from './use-focus';
|
|
5
5
|
export * from './use-hover';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,cAAc,GACf,MAAM,oBAAoB,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polygon.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/polygon.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"polygon.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/polygon.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAA;AAE/D,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAGtF,KAAK,KAAK,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAC7B,KAAK,OAAO,GAAG,KAAK,EAAE,CAAA;AAoDtB,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;CAC7C;AAED,MAAM,WAAW,+BAA+B;IAC9C,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,SAAS,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAA;IAChD,QAAQ,EAAE;QACR,YAAY,EAAE,aAAa,GAAG,IAAI,CAAA;QAClC,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAA;KACjC,CAAA;IACD,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAA;KAAE,CAAA;CACzD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB;cAsCJ,+BAA+B,WAehD,UAAU;;;;EAiVhD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MaybeRefOrGetter } from 'vue';
|
|
2
2
|
import { FloatingContext } from '..';
|
|
3
|
-
import { TreeNode } from '../use-tree';
|
|
3
|
+
import { TreeNode } from '../use-floating-tree';
|
|
4
4
|
/**
|
|
5
5
|
* Enables showing/hiding the floating element when clicking the reference element
|
|
6
6
|
* and optionally when clicking outside both the reference and floating elements.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-click.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/use-click.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,gBAAgB,EAA8C,MAAM,KAAK,CAAA;AACjG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"use-click.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/use-click.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,gBAAgB,EAA8C,MAAM,KAAK,CAAA;AACjG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAA;AAiB/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,QAAQ,CACtB,OAAO,EAAE,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC,EACpD,OAAO,GAAE,eAAoB,GAC5B,IAAI,CA6PN;AA0CD;;GAEG;AACH,MAAM,WAAW,eAAe;IAG9B;;;OAGG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAEnC;;;;OAIG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC,OAAO,GAAG,WAAW,CAAC,CAAA;IAE/C;;;OAGG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAElC;;;OAGG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAEvC;;;OAGG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAE1C;;;OAGG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAIvC;;;OAGG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAExC;;;OAGG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC,aAAa,GAAG,WAAW,GAAG,OAAO,CAAC,CAAA;IAEtE;;;OAGG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAE1C;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,KAAK,IAAI,CAAA;IAEtE;;;OAGG;IACH,qBAAqB,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAEjD;;;OAGG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;CAC7C"}
|
|
@@ -1,25 +1,35 @@
|
|
|
1
|
+
import { VirtualElement } from '@floating-ui/dom';
|
|
1
2
|
import { MaybeRefOrGetter, Ref } from 'vue';
|
|
2
|
-
import {
|
|
3
|
+
import { AnchorElement } from '../use-floating';
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
*
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
*
|
|
20
|
-
|
|
5
|
+
* Represents 2D coordinates with optional null values for unset states
|
|
6
|
+
*/
|
|
7
|
+
export interface Coordinates {
|
|
8
|
+
x: number | null;
|
|
9
|
+
y: number | null;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Axis constraint types for coordinate positioning
|
|
13
|
+
*/
|
|
14
|
+
export type AxisConstraint = "x" | "y" | "both";
|
|
15
|
+
/**
|
|
16
|
+
* Tracking mode for client point positioning behavior
|
|
17
|
+
*/
|
|
18
|
+
export type TrackingMode = "follow" | "static";
|
|
19
|
+
/**
|
|
20
|
+
* Processed pointer event data
|
|
21
|
+
*/
|
|
22
|
+
interface PointerEventData {
|
|
23
|
+
type: "pointerdown" | "pointermove" | "pointerenter";
|
|
24
|
+
coordinates: Coordinates;
|
|
25
|
+
originalEvent: PointerEvent;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Context for tracking strategy operations
|
|
21
29
|
*/
|
|
22
|
-
|
|
30
|
+
interface TrackingContext {
|
|
31
|
+
isOpen: boolean;
|
|
32
|
+
}
|
|
23
33
|
export interface UseClientPointOptions {
|
|
24
34
|
/**
|
|
25
35
|
* Whether the Hook is enabled
|
|
@@ -30,7 +40,7 @@ export interface UseClientPointOptions {
|
|
|
30
40
|
* Whether to restrict the client point to an axis
|
|
31
41
|
* @default 'both'
|
|
32
42
|
*/
|
|
33
|
-
axis?: MaybeRefOrGetter<
|
|
43
|
+
axis?: MaybeRefOrGetter<AxisConstraint>;
|
|
34
44
|
/**
|
|
35
45
|
* Controlled x coordinate
|
|
36
46
|
* @default null
|
|
@@ -41,6 +51,13 @@ export interface UseClientPointOptions {
|
|
|
41
51
|
* @default null
|
|
42
52
|
*/
|
|
43
53
|
y?: MaybeRefOrGetter<number | null>;
|
|
54
|
+
/**
|
|
55
|
+
* Tracking behavior mode:
|
|
56
|
+
* - "follow": Continuous cursor tracking (default)
|
|
57
|
+
* - "static": Position at initial interaction, no subsequent tracking
|
|
58
|
+
* @default "follow"
|
|
59
|
+
*/
|
|
60
|
+
trackingMode?: TrackingMode;
|
|
44
61
|
}
|
|
45
62
|
export interface UseClientPointReturn {
|
|
46
63
|
/**
|
|
@@ -55,4 +72,147 @@ export interface UseClientPointReturn {
|
|
|
55
72
|
*/
|
|
56
73
|
updatePosition: (x: number, y: number) => void;
|
|
57
74
|
}
|
|
75
|
+
export interface UseClientPointContext {
|
|
76
|
+
open: Readonly<Ref<boolean>>;
|
|
77
|
+
refs: {
|
|
78
|
+
anchorEl: Ref<AnchorElement>;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Virtual element factory for floating positioning anchors.
|
|
83
|
+
* Creates virtual DOM elements that serve as positioning anchors.
|
|
84
|
+
*/
|
|
85
|
+
export declare class VirtualElementFactory {
|
|
86
|
+
private static readonly DEFAULT_DIMENSIONS;
|
|
87
|
+
/**
|
|
88
|
+
* Create a virtual anchor element
|
|
89
|
+
*/
|
|
90
|
+
create(options: {
|
|
91
|
+
coordinates: Coordinates;
|
|
92
|
+
referenceElement?: HTMLElement | null;
|
|
93
|
+
baselineCoordinates?: Coordinates | null;
|
|
94
|
+
axis?: AxisConstraint;
|
|
95
|
+
}): VirtualElement;
|
|
96
|
+
/**
|
|
97
|
+
* Build configuration from options with defaults
|
|
98
|
+
*/
|
|
99
|
+
private buildConfiguration;
|
|
100
|
+
/**
|
|
101
|
+
* Build the bounding rectangle for the virtual element
|
|
102
|
+
*/
|
|
103
|
+
private buildBoundingRect;
|
|
104
|
+
/**
|
|
105
|
+
* Get reference element bounds with fallback
|
|
106
|
+
*/
|
|
107
|
+
private getReferenceRect;
|
|
108
|
+
/**
|
|
109
|
+
* Resolve final position from coordinate sources
|
|
110
|
+
*/
|
|
111
|
+
private resolvePosition;
|
|
112
|
+
/**
|
|
113
|
+
* Resolve coordinate for a single axis with clear precedence
|
|
114
|
+
*/
|
|
115
|
+
private resolveAxisCoordinate;
|
|
116
|
+
/**
|
|
117
|
+
* Calculate virtual element size based on axis constraints
|
|
118
|
+
*/
|
|
119
|
+
private calculateSize;
|
|
120
|
+
/**
|
|
121
|
+
* Build a DOMRect object
|
|
122
|
+
*/
|
|
123
|
+
private buildDOMRect;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Abstract base class for tracking strategies
|
|
127
|
+
*/
|
|
128
|
+
export declare abstract class TrackingStrategy {
|
|
129
|
+
abstract readonly name: TrackingMode;
|
|
130
|
+
protected lastKnownCoordinates: Coordinates | null;
|
|
131
|
+
/**
|
|
132
|
+
* Process a pointer event and return coordinates if the strategy wants to update
|
|
133
|
+
* This is the heart of each strategy's behavior
|
|
134
|
+
*/
|
|
135
|
+
abstract process(event: PointerEventData, context: TrackingContext): Coordinates | null;
|
|
136
|
+
/**
|
|
137
|
+
* Get the list of pointer events this strategy needs to listen for
|
|
138
|
+
* This allows strategies to optimize performance by only registering necessary events
|
|
139
|
+
*/
|
|
140
|
+
abstract getRequiredEvents(): PointerEventData["type"][];
|
|
141
|
+
/**
|
|
142
|
+
* Get coordinates to use when the floating element opens
|
|
143
|
+
* This lets each strategy decide its opening behavior without client code needing to know the details
|
|
144
|
+
*/
|
|
145
|
+
getCoordinatesForOpening(): Coordinates | null;
|
|
146
|
+
/**
|
|
147
|
+
* Called when the floating element closes
|
|
148
|
+
* This is where strategies should clean up any temporary state
|
|
149
|
+
*/
|
|
150
|
+
onClose(): void;
|
|
151
|
+
/**
|
|
152
|
+
* Reset all strategy state - used when the composable is disabled or reset
|
|
153
|
+
*/
|
|
154
|
+
reset(): void;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Strategy for continuous cursor tracking
|
|
158
|
+
*/
|
|
159
|
+
export declare class FollowTracker extends TrackingStrategy {
|
|
160
|
+
readonly name: "follow";
|
|
161
|
+
/**
|
|
162
|
+
* Follow strategy needs all pointer events for continuous tracking
|
|
163
|
+
*/
|
|
164
|
+
getRequiredEvents(): PointerEventData["type"][];
|
|
165
|
+
/**
|
|
166
|
+
* Follow strategy: always update coordinates based on the current pointer position
|
|
167
|
+
* This creates smooth, continuous tracking behavior
|
|
168
|
+
*/
|
|
169
|
+
process(event: PointerEventData, context: TrackingContext): Coordinates | null;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Strategy for static positioning at initial interaction
|
|
173
|
+
*/
|
|
174
|
+
export declare class StaticTracker extends TrackingStrategy {
|
|
175
|
+
readonly name: "static";
|
|
176
|
+
private triggerCoordinates;
|
|
177
|
+
/**
|
|
178
|
+
* Static strategy only needs click events, not hover or continuous movement
|
|
179
|
+
* This optimization avoids registering unnecessary pointer events
|
|
180
|
+
*/
|
|
181
|
+
getRequiredEvents(): PointerEventData["type"][];
|
|
182
|
+
/**
|
|
183
|
+
* Static strategy: capture coordinates from trigger events, ignore movement
|
|
184
|
+
* This creates stable positioning that doesn't jump around
|
|
185
|
+
*/
|
|
186
|
+
process(event: PointerEventData, context: TrackingContext): Coordinates | null;
|
|
187
|
+
/**
|
|
188
|
+
* Get coordinates to use when floating element opens
|
|
189
|
+
*/
|
|
190
|
+
getCoordinatesForOpening(): Coordinates | null;
|
|
191
|
+
/**
|
|
192
|
+
* Reset tracking state
|
|
193
|
+
*/
|
|
194
|
+
reset(): void;
|
|
195
|
+
onClose(): void;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Positions the floating element relative to a client point (mouse position).
|
|
199
|
+
*
|
|
200
|
+
* This composable tracks pointer movements and positions the floating element
|
|
201
|
+
* accordingly, with options for axis locking and controlled coordinates.
|
|
202
|
+
*
|
|
203
|
+
* @param pointerTarget - The DOM element whose bounding box is used as the reference for pointer event listeners and initial positioning.
|
|
204
|
+
* @param context - The floating context with open state and position reference
|
|
205
|
+
* @param options - Configuration options for client point behavior
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* ```ts
|
|
209
|
+
* const context = useFloating(...)
|
|
210
|
+
* useClientPoint(context, {
|
|
211
|
+
* axis: "x",
|
|
212
|
+
* enabled: true
|
|
213
|
+
* })
|
|
214
|
+
* ```
|
|
215
|
+
*/
|
|
216
|
+
export declare function useClientPoint(pointerTarget: Ref<HTMLElement | null>, context: UseClientPointContext, options?: UseClientPointOptions): UseClientPointReturn;
|
|
217
|
+
export {};
|
|
58
218
|
//# sourceMappingURL=use-client-point.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-client-point.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/use-client-point.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-client-point.d.ts","sourceRoot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2
4
|
export interface UseEscapeKeyOptions {
|
|
3
5
|
/**
|
|
4
6
|
* Condition to enable the escape key listener.
|
|
@@ -11,14 +13,45 @@ export interface UseEscapeKeyOptions {
|
|
|
11
13
|
*/
|
|
12
14
|
capture?: boolean;
|
|
13
15
|
/**
|
|
14
|
-
*
|
|
16
|
+
* Custom callback function to be executed when the escape key is pressed.
|
|
17
|
+
* When provided, overrides default behavior.
|
|
15
18
|
*/
|
|
16
|
-
onEscape
|
|
19
|
+
onEscape?: (event: KeyboardEvent) => void;
|
|
17
20
|
}
|
|
18
21
|
/**
|
|
19
|
-
* A composable to handle the escape key press
|
|
22
|
+
* A composable to handle the escape key press with tree-aware behavior and composition event handling.
|
|
20
23
|
*
|
|
24
|
+
* When passed a FloatingContext, it will close that floating element by setting open to false.
|
|
25
|
+
* When passed a TreeNode<FloatingContext>, it will find and close the topmost open node in the tree.
|
|
26
|
+
*
|
|
27
|
+
* @param context - The floating context or tree node with open state and change handler.
|
|
21
28
|
* @param options - {@link UseEscapeKeyOptions}
|
|
29
|
+
*
|
|
30
|
+
* @example Basic standalone usage
|
|
31
|
+
* ```ts
|
|
32
|
+
* const context = useFloating(...)
|
|
33
|
+
* useEscapeKey(context) // Closes the floating element on escape
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @example Tree-aware usage
|
|
37
|
+
* ```ts
|
|
38
|
+
* const tree = useFloatingTree(...)
|
|
39
|
+
* const childNode = tree.addNode(...)
|
|
40
|
+
* useEscapeKey(childNode) // Closes the topmost open node in the tree
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @example Custom handler
|
|
44
|
+
* ```ts
|
|
45
|
+
* useEscapeKey(context, {
|
|
46
|
+
* onEscape: (event) => {
|
|
47
|
+
* if (hasUnsavedChanges.value) {
|
|
48
|
+
* showConfirmDialog.value = true
|
|
49
|
+
* } else {
|
|
50
|
+
* context.setOpen(false)
|
|
51
|
+
* }
|
|
52
|
+
* }
|
|
53
|
+
* })
|
|
54
|
+
* ```
|
|
22
55
|
*/
|
|
23
|
-
export declare function useEscapeKey(
|
|
56
|
+
export declare function useEscapeKey(context: FloatingContext | TreeNode<FloatingContext>, options?: UseEscapeKeyOptions): void;
|
|
24
57
|
//# sourceMappingURL=use-escape-key.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-escape-key.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/use-escape-key.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,gBAAgB,EAAgB,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"use-escape-key.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/use-escape-key.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,gBAAgB,EAAgB,MAAM,KAAK,CAAA;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAA;AAO/D,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAEnC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAA;CAC1C;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC,EACpD,OAAO,GAAE,mBAAwB,GAChC,IAAI,CAiCN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-focus.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/use-focus.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,gBAAgB,EAMtB,MAAM,KAAK,CAAA;AACZ,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"use-focus.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/use-focus.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,gBAAgB,EAMtB,MAAM,KAAK,CAAA;AACZ,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAA;AAc/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,QAAQ,CACtB,OAAO,EAAE,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC,EACpD,OAAO,GAAE,eAAoB,GAC5B,cAAc,CAwIhB;AAMD,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAEnC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;CAChD;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,SAAS,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-hover.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/use-hover.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,QAAQ,EAKd,MAAM,KAAK,CAAA;AACZ,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"use-hover.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/use-hover.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,QAAQ,EAKd,MAAM,KAAK,CAAA;AACZ,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAA;AAE/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,KAAK,kBAAkB,EAAe,MAAM,WAAW,CAAA;AAWhE,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;IAE3B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAE5D;;;;;OAKG;IACH,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;IAEzB;;;OAGG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;IAE7B;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,QAAQ,CAAC,OAAO,GAAG,kBAAkB,CAAC,CAAA;CACrD;AAiED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,QAAQ,CACtB,OAAO,EAAE,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC,EACpD,OAAO,GAAE,eAAoB,GAC5B,IAAI,CA8ON"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-context.d.ts","sourceRoot":"","sources":["../../../../src/composables/interactions/utils/tree-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"tree-context.d.ts","sourceRoot":"","sources":["../../../../src/composables/interactions/utils/tree-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAA;AAE/D;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC,GACnD,OAAO,IAAI,QAAQ,CAAC,eAAe,CAAC,CAStC;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC,GAAG;IAC7F,eAAe,EAAE,eAAe,CAAA;IAChC,WAAW,EAAE,QAAQ,CAAC,eAAe,CAAC,GAAG,IAAI,CAAA;CAC9C,CAWA;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAkB7E;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,QAAQ,CAAC,eAAe,CAAC,EAC/B,MAAM,EAAE,IAAI,GACX,QAAQ,CAAC,eAAe,CAAC,GAAG,IAAI,CAgBlC"}
|
|
@@ -1,20 +1,54 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { AnchorElement, FloatingContext, FloatingElement, UseFloatingOptions } from './use-floating';
|
|
3
|
-
import { TreeNode, TreeOptions } from './use-tree';
|
|
4
3
|
/**
|
|
5
|
-
*
|
|
4
|
+
* Options for creating a TreeNode
|
|
6
5
|
*/
|
|
7
|
-
export interface
|
|
6
|
+
export interface CreateTreeNodeOptions {
|
|
7
|
+
/** Optional ID for the node. If not provided, one will be generated. */
|
|
8
|
+
id?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Options for configuring tree behavior
|
|
12
|
+
*/
|
|
13
|
+
export interface CreateTreeOptions {
|
|
14
|
+
/** Strategy for deleting child nodes when a parent is deleted.
|
|
15
|
+
* - 'orphan': Children are detached from the tree (parent becomes null).
|
|
16
|
+
* - 'recursive': Children are also deleted recursively.
|
|
17
|
+
* @default 'recursive'
|
|
18
|
+
*/
|
|
19
|
+
deleteStrategy?: "orphan" | "recursive";
|
|
8
20
|
}
|
|
9
|
-
export interface
|
|
10
|
-
readonly
|
|
11
|
-
readonly
|
|
12
|
-
|
|
21
|
+
export interface TreeNode<T> {
|
|
22
|
+
readonly id: string;
|
|
23
|
+
readonly data: T;
|
|
24
|
+
readonly parent: Ref<TreeNode<T> | null>;
|
|
25
|
+
readonly children: Ref<TreeNode<T>[]>;
|
|
26
|
+
readonly isRoot: boolean;
|
|
27
|
+
readonly isLeaf: Readonly<Ref<boolean>>;
|
|
28
|
+
addChild: (childNode: TreeNode<T>) => void;
|
|
29
|
+
_removeChildInstance: (childNode: TreeNode<T>) => boolean;
|
|
30
|
+
findChild: (predicate: (node: TreeNode<T>) => boolean) => TreeNode<T> | null;
|
|
31
|
+
findDescendant: (predicate: (node: TreeNode<T>) => boolean) => TreeNode<T> | null;
|
|
32
|
+
isDescendantOf: (potentialAncestor: TreeNode<T>) => boolean;
|
|
33
|
+
getPath: () => TreeNode<T>[];
|
|
34
|
+
}
|
|
35
|
+
export interface Tree<T> {
|
|
36
|
+
readonly root: TreeNode<T>;
|
|
37
|
+
readonly nodeMap: Readonly<Map<string, TreeNode<T>>>;
|
|
38
|
+
findNodeById: (id: string) => TreeNode<T> | null;
|
|
39
|
+
addNode: (data: T, parentId?: string | null, nodeOptions?: CreateTreeNodeOptions) => TreeNode<T> | null;
|
|
40
|
+
removeNode: (nodeId: string, deleteStrategy?: "orphan" | "recursive") => boolean;
|
|
13
41
|
moveNode: (nodeId: string, newParentId: string | null) => boolean;
|
|
42
|
+
traverse: (strategy?: "dfs" | "bfs", startNode?: TreeNode<T> | null) => TreeNode<T>[];
|
|
14
43
|
dispose: () => void;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Configuration options for the floating tree
|
|
47
|
+
*/
|
|
48
|
+
export interface FloatingTreeOptions extends CreateTreeOptions {
|
|
49
|
+
}
|
|
50
|
+
export interface UseFloatingTreeReturn extends Omit<Tree<FloatingContext>, "addNode"> {
|
|
15
51
|
addNode: (anchorEl: Ref<AnchorElement>, floatingEl: Ref<FloatingElement>, options?: UseFloatingOptions) => TreeNode<FloatingContext> | null;
|
|
16
|
-
removeNode: (nodeId: string, deleteStrategy?: "orphan" | "recursive") => boolean;
|
|
17
|
-
traverse: (mode: "dfs" | "bfs", startNode?: TreeNode<FloatingContext>) => TreeNode<FloatingContext>[];
|
|
18
52
|
getAllOpenNodes: () => TreeNode<FloatingContext>[];
|
|
19
53
|
getTopmostOpenNode: () => TreeNode<FloatingContext> | null;
|
|
20
54
|
/**
|
|
@@ -25,7 +59,7 @@ export interface UseFloatingTreeReturn {
|
|
|
25
59
|
* @param callback - A function to execute for each matching node
|
|
26
60
|
* @param options - Configuration options for the iteration behavior
|
|
27
61
|
*/
|
|
28
|
-
|
|
62
|
+
applyToNodes: (nodeId: string, callback: (node: TreeNode<FloatingContext>) => void, options?: {
|
|
29
63
|
relationship?: NodeRelationship;
|
|
30
64
|
applyToMatching?: boolean;
|
|
31
65
|
}) => void;
|
|
@@ -44,5 +78,33 @@ type NodeRelationship = "ancestors-only" | "siblings-only" | "descendants-only"
|
|
|
44
78
|
* @returns UseFloatingTreeReturn with tree management methods and root context
|
|
45
79
|
*/
|
|
46
80
|
export declare function useFloatingTree(anchorEl: Ref<AnchorElement>, floatingEl: Ref<FloatingElement>, options?: UseFloatingOptions, treeOptions?: FloatingTreeOptions): UseFloatingTreeReturn;
|
|
81
|
+
/**
|
|
82
|
+
* Creates a reactive tree node with data, parent reference, and children references.
|
|
83
|
+
* @param data The data to store in the node
|
|
84
|
+
* @param parent The parent node, or null for root nodes
|
|
85
|
+
* @param options Configuration options for the node
|
|
86
|
+
* @param isRoot Whether this node is the true root of a tree
|
|
87
|
+
* @returns A reactive tree node object with methods and reactive properties
|
|
88
|
+
*/
|
|
89
|
+
export declare function createTreeNode<T>(data: T, parent?: TreeNode<T> | null, options?: CreateTreeNodeOptions, isRoot?: boolean): TreeNode<T>;
|
|
90
|
+
/**
|
|
91
|
+
* Creates and manages a reactive tree structure.
|
|
92
|
+
*
|
|
93
|
+
* This factory function provides a complete tree data structure with reactive nodes,
|
|
94
|
+
* supporting operations like adding, removing, and moving nodes, as well as
|
|
95
|
+
* traversal and search functionality.
|
|
96
|
+
*
|
|
97
|
+
* @template T The type of data stored in the tree nodes.
|
|
98
|
+
* @param initialRootData Data for the root node.
|
|
99
|
+
* @param options Configuration options for the tree behavior.
|
|
100
|
+
* @returns A tree management object with methods and reactive properties
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* const myTree = createTree({ name: 'Root' });
|
|
105
|
+
* const childNode = myTree.addNode({ name: 'Child' }, myTree.root.id);
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
export declare function createTree<T>(initialRootData: T, options?: CreateTreeOptions): Tree<T>;
|
|
47
109
|
export {};
|
|
48
110
|
//# sourceMappingURL=use-floating-tree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-floating-tree.d.ts","sourceRoot":"","sources":["../../src/composables/use-floating-tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"use-floating-tree.d.ts","sourceRoot":"","sources":["../../src/composables/use-floating-tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAG9B,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EACf,eAAe,EACf,kBAAkB,EACnB,MAAM,gBAAgB,CAAA;AAOvB;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,wEAAwE;IACxE,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAEhC;;;;OAIG;IACH,cAAc,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAA;CACxC;AAID,MAAM,WAAW,QAAQ,CAAC,CAAC;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;IAChB,Q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CAAA;KAC1B,KACE,IAAI,CAAA;CACV;AAED;;GAEG;AACH,KAAK,gBAAgB,GACjB,gBAAgB,GAChB,eAAe,GACf,kBAAkB,GAClB,eAAe,GACf,oBAAoB,GACpB,mBAAmB,GACnB,sBAAsB,GACtB,mBAAmB,GACnB,6BAA6B,GAC7B,aAAa,GACb,mBAAmB,CAAA;AAqBvB;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,GAAG,CAAC,aAAa,CAAC,EAC5B,UAAU,EAAE,GAAG,CAAC,eAAe,CAAC,EAChC,OAAO,GAAE,kBAAuB,EAChC,WAAW,GAAE,mBAAwB,GACpC,qBAAqB,CAiKvB;AAMD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,IAAI,EAAE,CAAC,EACP,MAAM,GAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAW,EACjC,OAAO,GAAE,qBAA0B,EACnC,MAAM,UAAQ,GACb,QAAQ,CAAC,CAAC,CAAC,CAiEb;AAMD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC,CAAC,CAAC,CAkOtF"}
|
|
@@ -57,7 +57,7 @@ export interface UseFloatingOptions {
|
|
|
57
57
|
/**
|
|
58
58
|
* Middlewares modify the positioning coordinates in some fashion, or provide useful data for the consumer to use.
|
|
59
59
|
*/
|
|
60
|
-
middlewares?: Middleware[]
|
|
60
|
+
middlewares?: MaybeRefOrGetter<Middleware[]>;
|
|
61
61
|
/**
|
|
62
62
|
* Whether to automatically update the position of the floating element.
|
|
63
63
|
* Can be a boolean or an `AutoUpdateOptions` object.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-floating.d.ts","sourceRoot":"","sources":["../../src/composables/use-floating.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB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