v-float 0.2.0 → 0.3.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/README.md +249 -109
- package/dist/composables/interactions/index.d.ts +2 -1
- package/dist/composables/interactions/index.d.ts.map +1 -1
- package/dist/composables/interactions/polygon.d.ts +38 -0
- package/dist/composables/interactions/polygon.d.ts.map +1 -0
- package/dist/composables/interactions/use-click.d.ts +78 -10
- package/dist/composables/interactions/use-click.d.ts.map +1 -1
- package/dist/composables/interactions/use-client-point.d.ts +1 -1
- package/dist/composables/interactions/use-client-point.d.ts.map +1 -1
- package/dist/composables/interactions/use-escape-key.d.ts +24 -0
- package/dist/composables/interactions/use-escape-key.d.ts.map +1 -0
- package/dist/composables/interactions/use-focus.d.ts +28 -3
- package/dist/composables/interactions/use-focus.d.ts.map +1 -1
- package/dist/composables/interactions/use-hover.d.ts +32 -18
- package/dist/composables/interactions/use-hover.d.ts.map +1 -1
- package/dist/composables/interactions/utils/browser-detection.d.ts +23 -0
- package/dist/composables/interactions/utils/browser-detection.d.ts.map +1 -0
- package/dist/composables/interactions/utils/element-detection.d.ts +53 -0
- package/dist/composables/interactions/utils/element-detection.d.ts.map +1 -0
- package/dist/composables/interactions/utils/event-utils.d.ts +30 -0
- package/dist/composables/interactions/utils/event-utils.d.ts.map +1 -0
- package/dist/composables/interactions/utils/index.d.ts +11 -0
- package/dist/composables/interactions/utils/index.d.ts.map +1 -0
- package/dist/composables/interactions/utils/tree-context.d.ts +32 -0
- package/dist/composables/interactions/utils/tree-context.d.ts.map +1 -0
- package/dist/composables/middlewares/index.d.ts +0 -1
- package/dist/composables/middlewares/index.d.ts.map +1 -1
- package/dist/composables/use-arrow.d.ts +10 -3
- package/dist/composables/use-arrow.d.ts.map +1 -1
- package/dist/composables/use-floating-tree.d.ts +13 -13
- package/dist/composables/use-floating-tree.d.ts.map +1 -1
- package/dist/composables/use-floating.d.ts +12 -20
- package/dist/composables/use-floating.d.ts.map +1 -1
- package/dist/composables/use-tree.d.ts.map +1 -1
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/v-float.es.js +1457 -1061
- package/dist/v-float.umd.js +1 -1
- package/package.json +34 -21
- package/dist/composables/interactions/use-dismiss.d.ts +0 -68
- package/dist/composables/interactions/use-dismiss.d.ts.map +0 -1
|
@@ -1,15 +1,40 @@
|
|
|
1
1
|
import { FloatingContext } from '..';
|
|
2
|
+
import { TreeNode } from '../use-tree';
|
|
2
3
|
import { MaybeRefOrGetter } from 'vue';
|
|
3
4
|
/**
|
|
4
5
|
* Enables showing/hiding the floating element when focusing the reference element.
|
|
5
6
|
*
|
|
6
7
|
* This composable is responsible for KEYBOARD-ONLY interactions. For a complete user experience,
|
|
7
|
-
* it should be composed with other hooks like `useClick`, `useHover`, and `
|
|
8
|
+
* it should be composed with other hooks like `useClick`, `useHover`, and `useEscapeKey`.
|
|
8
9
|
*
|
|
9
|
-
*
|
|
10
|
+
* The composable supports both standalone usage with FloatingContext and tree-aware
|
|
11
|
+
* usage with TreeNode<FloatingContext> for complex nested floating UI structures.
|
|
12
|
+
*
|
|
13
|
+
* @param context - The floating context or tree node with open state and change handler.
|
|
10
14
|
* @param options - Configuration options for focus behavior.
|
|
15
|
+
*
|
|
16
|
+
* @example Basic standalone usage
|
|
17
|
+
* ```ts
|
|
18
|
+
* const context = useFloating(...)
|
|
19
|
+
* useFocus(context, {
|
|
20
|
+
* enabled: true,
|
|
21
|
+
* requireFocusVisible: true
|
|
22
|
+
* })
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @example Tree-aware usage for nested floating elements
|
|
26
|
+
* ```ts
|
|
27
|
+
* const tree = useFloatingTree(rootContext)
|
|
28
|
+
* const parentNode = tree.root
|
|
29
|
+
* const childNode = tree.addNode(childContext, parentNode.id)
|
|
30
|
+
*
|
|
31
|
+
* // Tree-aware behavior: parent stays open when focus moves to child,
|
|
32
|
+
* // but closes when focus moves outside hierarchy
|
|
33
|
+
* useFocus(parentNode, { requireFocusVisible: true })
|
|
34
|
+
* useFocus(childNode, { requireFocusVisible: true })
|
|
35
|
+
* ```
|
|
11
36
|
*/
|
|
12
|
-
export declare function useFocus(context: FloatingContext
|
|
37
|
+
export declare function useFocus(context: FloatingContext | TreeNode<FloatingContext>, options?: UseFocusOptions): UseFocusReturn;
|
|
13
38
|
export interface UseFocusOptions {
|
|
14
39
|
/**
|
|
15
40
|
* Whether focus event listeners are enabled
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-focus.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/use-focus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"use-focus.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/use-focus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAEtD,OAAO,EACL,KAAK,gBAAgB,EAOtB,MAAM,KAAK,CAAA;AAgBZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,18 +1,7 @@
|
|
|
1
|
+
import { TreeNode } from '../use-tree';
|
|
1
2
|
import { MaybeRef } from 'vue';
|
|
2
|
-
import { FloatingContext
|
|
3
|
-
|
|
4
|
-
export interface HandleCloseContext {
|
|
5
|
-
context: FloatingContext;
|
|
6
|
-
open: boolean;
|
|
7
|
-
pointerType: PointerType;
|
|
8
|
-
x: number;
|
|
9
|
-
y: number;
|
|
10
|
-
referenceEl: AnchorElement;
|
|
11
|
-
floatingEl: FloatingElement;
|
|
12
|
-
isPointInFloating(event: PointerEvent | MouseEvent | TouchEvent): boolean;
|
|
13
|
-
originalEvent?: Event;
|
|
14
|
-
}
|
|
15
|
-
export type HandleCloseFn = (context: HandleCloseContext, onClose: () => void) => undefined | (() => void);
|
|
3
|
+
import { FloatingContext } from '../use-floating';
|
|
4
|
+
import { SafePolygonOptions } from './polygon';
|
|
16
5
|
export interface UseHoverOptions {
|
|
17
6
|
/**
|
|
18
7
|
* Whether hover event listeners are enabled.
|
|
@@ -41,16 +30,28 @@ export interface UseHoverOptions {
|
|
|
41
30
|
* @default false
|
|
42
31
|
*/
|
|
43
32
|
mouseOnly?: MaybeRef<boolean>;
|
|
33
|
+
/**
|
|
34
|
+
* Enable floating-ui style safe polygon algorithm that keeps the
|
|
35
|
+
* floating element open while the pointer traverses the rectangle/triangle
|
|
36
|
+
* region between the reference and floating elements.
|
|
37
|
+
* – `true` → enabled with defaults
|
|
38
|
+
* – `false | undefined` → disabled (current behaviour)
|
|
39
|
+
* – `SafePolygonOptions` → enabled with custom buffer
|
|
40
|
+
*/
|
|
41
|
+
safePolygon?: MaybeRef<boolean | SafePolygonOptions>;
|
|
44
42
|
}
|
|
45
43
|
/**
|
|
46
44
|
* Enables showing/hiding the floating element when hovering the reference element
|
|
47
45
|
* with enhanced behaviors like delayed open/close, rest detection, and custom
|
|
48
46
|
* exit handling.
|
|
49
47
|
*
|
|
50
|
-
*
|
|
48
|
+
* The composable supports both standalone usage with FloatingContext and tree-aware
|
|
49
|
+
* usage with TreeNode<FloatingContext> for complex nested floating UI structures.
|
|
50
|
+
*
|
|
51
|
+
* @param context - The floating context or tree node with open state and change handler
|
|
51
52
|
* @param options - Configuration options for hover behavior
|
|
52
53
|
*
|
|
53
|
-
* @example
|
|
54
|
+
* @example Basic standalone usage
|
|
54
55
|
* ```ts
|
|
55
56
|
* const context = useFloating(...)
|
|
56
57
|
* useHover(context, {
|
|
@@ -58,7 +59,20 @@ export interface UseHoverOptions {
|
|
|
58
59
|
* restMs: 150
|
|
59
60
|
* })
|
|
60
61
|
* ```
|
|
62
|
+
*
|
|
63
|
+
* @example Tree-aware usage for nested floating elements
|
|
64
|
+
* ```ts
|
|
65
|
+
* const tree = useFloatingTree(rootContext)
|
|
66
|
+
* const parentNode = tree.root
|
|
67
|
+
* const childNode = tree.addNode(childContext, parentNode.id)
|
|
68
|
+
*
|
|
69
|
+
* // Tree-aware behavior: child hover won't end when hovering over child,
|
|
70
|
+
* // but will end when hovering outside the entire hierarchy
|
|
71
|
+
* useHover(childNode, {
|
|
72
|
+
* delay: { close: 300 },
|
|
73
|
+
* safePolygon: true
|
|
74
|
+
* })
|
|
75
|
+
* ```
|
|
61
76
|
*/
|
|
62
|
-
export declare function useHover(context: FloatingContext
|
|
63
|
-
export {};
|
|
77
|
+
export declare function useHover(context: FloatingContext | TreeNode<FloatingContext>, options?: UseHoverOptions): void;
|
|
64
78
|
//# sourceMappingURL=use-hover.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-hover.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/use-hover.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-hover.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/use-hover.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAGtD,OAAO,EACL,KAAK,QAAQ,EAMd,MAAM,KAAK,CAAA;AACZ,OAAO,KAAK,EAAiB,eAAe,EAAmB,MAAM,iBAAiB,CAAA;AACtF,OAAO,EAAE,KAAK,kBAAkB,EAAe,MAAM,WAAW,CAAA;AAehE,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"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Browser environment detection utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides utilities for detecting browser types, platforms, and
|
|
5
|
+
* environment-specific polyfills for focus-visible behavior.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Checks if the user agent is on a Mac.
|
|
9
|
+
* @returns True if running on macOS
|
|
10
|
+
*/
|
|
11
|
+
export declare function isMac(): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Checks if the browser is Safari.
|
|
14
|
+
* @returns True if the browser is Safari
|
|
15
|
+
*/
|
|
16
|
+
export declare function isSafari(): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* A simple utility to check if an element matches `:focus-visible`.
|
|
19
|
+
* @param element - The element to check
|
|
20
|
+
* @returns True if the element matches :focus-visible
|
|
21
|
+
*/
|
|
22
|
+
export declare function matchesFocusVisible(element: Element): boolean;
|
|
23
|
+
//# sourceMappingURL=browser-detection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-detection.d.ts","sourceRoot":"","sources":["../../../../src/composables/interactions/utils/browser-detection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,wBAAgB,KAAK,IAAI,OAAO,CAG/B;AAED;;;GAGG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAGlC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAG7D"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { VirtualElement } from '@floating-ui/dom';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if the pointer type is mouse-like (mouse or pen).
|
|
4
|
+
* @param pointerType - The pointer type string.
|
|
5
|
+
* @param strict - If true, only considers "mouse".
|
|
6
|
+
* @returns True if the pointer type is mouse-like.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isMouseLikePointerType(pointerType: string | undefined, strict?: boolean): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Checks if the element is an input, textarea, or contenteditable element.
|
|
11
|
+
* @param element - The element to check.
|
|
12
|
+
* @returns True if the element is typeable.
|
|
13
|
+
*/
|
|
14
|
+
export declare function isTypeableElement(element: Element | null): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Checks if the event target is a button-like element.
|
|
17
|
+
* @param event - The KeyboardEvent.
|
|
18
|
+
* @returns True if the target is a button.
|
|
19
|
+
*/
|
|
20
|
+
export declare function isButtonTarget(event: KeyboardEvent): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Checks if the Space key press should be ignored for the given element.
|
|
23
|
+
* @param element - The element to check.
|
|
24
|
+
* @returns True if Space should be ignored.
|
|
25
|
+
*/
|
|
26
|
+
export declare function isSpaceIgnored(element: Element | null): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Checks if the value is an HTML element.
|
|
29
|
+
* @param node - The value to check.
|
|
30
|
+
* @returns True if the value is an HTML element.
|
|
31
|
+
*/
|
|
32
|
+
export declare function isHTMLElement(node: unknown | null): node is HTMLElement;
|
|
33
|
+
/**
|
|
34
|
+
* Checks if the value is a VirtualElement.
|
|
35
|
+
* @param el - The value to check.
|
|
36
|
+
* @returns True if the value is a VirtualElement.
|
|
37
|
+
*/
|
|
38
|
+
export declare function isVirtualElement(el: unknown): el is VirtualElement;
|
|
39
|
+
/**
|
|
40
|
+
* Checks if the event target is within the given element.
|
|
41
|
+
* @param event - The event to check.
|
|
42
|
+
* @param element - The element to check containment against.
|
|
43
|
+
* @returns True if the event target is within the element.
|
|
44
|
+
*/
|
|
45
|
+
export declare function isEventTargetWithin(event: Event, element: Element | null | undefined): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Checks if a click event occurred on a scrollbar.
|
|
48
|
+
* @param event - The mouse event.
|
|
49
|
+
* @param target - The target HTML element.
|
|
50
|
+
* @returns True if the click was on a scrollbar.
|
|
51
|
+
*/
|
|
52
|
+
export declare function isClickOnScrollbar(event: MouseEvent, target: HTMLElement): boolean;
|
|
53
|
+
//# sourceMappingURL=element-detection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-detection.d.ts","sourceRoot":"","sources":["../../../../src/composables/interactions/utils/element-detection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEtD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAIjG;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,OAAO,CAQlE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAS5D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,OAAO,CAE/D;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,IAAI,WAAW,CAEvE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,IAAI,cAAc,CAElE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAQ9F;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CA0BlF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Event handling and timing utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides utilities for event handling, timing operations,
|
|
5
|
+
* and DOM element containment checks.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Simple element containment wrapper.
|
|
9
|
+
* @param el - The container element
|
|
10
|
+
* @param target - The target element to check
|
|
11
|
+
* @returns True if the container contains the target
|
|
12
|
+
*/
|
|
13
|
+
export declare function contains(el: HTMLElement, target: Element | null): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Event target extraction utility.
|
|
16
|
+
* @param event - The mouse or touch event
|
|
17
|
+
* @returns The event target as an Element or null
|
|
18
|
+
*/
|
|
19
|
+
export declare function getTarget(event: MouseEvent | TouchEvent): Element | null;
|
|
20
|
+
/**
|
|
21
|
+
* Safe performance timing that handles environments without performance API.
|
|
22
|
+
* @returns Current timestamp in milliseconds
|
|
23
|
+
*/
|
|
24
|
+
export declare function getCurrentTime(): number;
|
|
25
|
+
/**
|
|
26
|
+
* Centralized timeout management to prevent memory leaks.
|
|
27
|
+
* @param timeoutId - The timeout ID to clear
|
|
28
|
+
*/
|
|
29
|
+
export declare function clearTimeoutIfSet(timeoutId: number): void;
|
|
30
|
+
//# sourceMappingURL=event-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-utils.d.ts","sourceRoot":"","sources":["../../../../src/composables/interactions/utils/event-utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,GAAG,OAAO,CAEzE;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,OAAO,GAAG,IAAI,CAExE;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAIzD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Centralized utility functions for interaction composables
|
|
3
|
+
*
|
|
4
|
+
* This module exports shared helper functions to eliminate code duplication
|
|
5
|
+
* across use-click, use-focus, use-hover, use-client-point, and polygon composables.
|
|
6
|
+
*/
|
|
7
|
+
export { isTreeNode, getContextFromParameter, isTargetWithinElement, findDescendantContainingTarget, } from './tree-context';
|
|
8
|
+
export { isMouseLikePointerType, isTypeableElement, isButtonTarget, isSpaceIgnored, isHTMLElement, isVirtualElement, isEventTargetWithin, isClickOnScrollbar, } from './element-detection';
|
|
9
|
+
export { isMac, isSafari, matchesFocusVisible, } from './browser-detection';
|
|
10
|
+
export { contains, getTarget, getCurrentTime, clearTimeoutIfSet, } from './event-utils';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/composables/interactions/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,UAAU,EACV,uBAAuB,EACvB,qBAAqB,EACrB,8BAA8B,GAC/B,MAAM,gBAAgB,CAAA;AAGvB,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,qBAAqB,CAAA;AAG5B,OAAO,EACL,KAAK,EACL,QAAQ,EACR,mBAAmB,GACpB,MAAM,qBAAqB,CAAA;AAG5B,OAAO,EACL,QAAQ,EACR,SAAS,EACT,cAAc,EACd,iBAAiB,GAClB,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { FloatingContext } from '../..';
|
|
2
|
+
import { TreeNode } from '../../use-tree';
|
|
3
|
+
/**
|
|
4
|
+
* Type guard to determine if the context parameter is a TreeNode.
|
|
5
|
+
* @param context - The context parameter to check
|
|
6
|
+
* @returns True if the context is a TreeNode
|
|
7
|
+
*/
|
|
8
|
+
export declare function isTreeNode(context: FloatingContext | TreeNode<FloatingContext>): context is TreeNode<FloatingContext>;
|
|
9
|
+
/**
|
|
10
|
+
* Extracts floating context and tree context from the parameter.
|
|
11
|
+
* @param context - Either a FloatingContext or TreeNode<FloatingContext>
|
|
12
|
+
* @returns Object containing both floating context and optional tree context
|
|
13
|
+
*/
|
|
14
|
+
export declare function getContextFromParameter(context: FloatingContext | TreeNode<FloatingContext>): {
|
|
15
|
+
floatingContext: FloatingContext;
|
|
16
|
+
treeContext: TreeNode<FloatingContext> | null;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Checks if a target node is within an anchor or floating element, handling VirtualElement.
|
|
20
|
+
* @param target - The target node to check
|
|
21
|
+
* @param element - The element to check containment against (can be VirtualElement or null)
|
|
22
|
+
* @returns True if the target is within the element
|
|
23
|
+
*/
|
|
24
|
+
export declare function isTargetWithinElement(target: Node, element: any): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Finds a descendant node that contains the target element.
|
|
27
|
+
* @param node - The parent node to search from
|
|
28
|
+
* @param target - The target element to find
|
|
29
|
+
* @returns The descendant node containing the target, or null
|
|
30
|
+
*/
|
|
31
|
+
export declare function findDescendantContainingTarget(node: TreeNode<FloatingContext>, target: Node): TreeNode<FloatingContext> | null;
|
|
32
|
+
//# sourceMappingURL=tree-context.d.ts.map
|
|
@@ -0,0 +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,wBAAwB,CAAA;AAEtD;;;;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,GAAG,GAAG,OAAO,CAkBzE;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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/middlewares/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/middlewares/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Padding } from '@floating-ui/dom';
|
|
2
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
3
|
import { FloatingContext } from './use-floating';
|
|
3
4
|
/**
|
|
4
5
|
* Return value of the useArrow composable
|
|
@@ -33,6 +34,10 @@ export interface UseArrowOptions {
|
|
|
33
34
|
* @default '-4px'
|
|
34
35
|
*/
|
|
35
36
|
offset?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Padding around arrow element
|
|
39
|
+
*/
|
|
40
|
+
padding?: Padding;
|
|
36
41
|
}
|
|
37
42
|
/**
|
|
38
43
|
* Composable for computing arrow position styles for floating elements
|
|
@@ -40,14 +45,16 @@ export interface UseArrowOptions {
|
|
|
40
45
|
* This composable calculates the position and styles for an arrow element
|
|
41
46
|
* based on the placement and middleware data from a floating element.
|
|
42
47
|
*
|
|
48
|
+
* @param arrowEl - A ref to the arrow HTML element
|
|
43
49
|
* @param context - The floating context containing middleware data and placement information
|
|
44
50
|
* @param options - Optional configuration for the arrow, e.g., offset
|
|
45
51
|
* @returns Computed arrow positions and CSS styles
|
|
46
52
|
*
|
|
47
53
|
* @example
|
|
48
54
|
* ```ts
|
|
49
|
-
* const
|
|
55
|
+
* const arrowRef = ref<HTMLElement | null>(null)
|
|
56
|
+
* const { arrowStyles } = useArrow(arrowRef, floatingContext, { offset: "-10px" })
|
|
50
57
|
* ```
|
|
51
58
|
*/
|
|
52
|
-
export declare function useArrow(context: FloatingContext, options?: UseArrowOptions): UseArrowReturn;
|
|
59
|
+
export declare function useArrow(arrowEl: Ref<HTMLElement | null>, context: FloatingContext, options?: UseArrowOptions): UseArrowReturn;
|
|
53
60
|
//# sourceMappingURL=use-arrow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-arrow.d.ts","sourceRoot":"","sources":["../../src/composables/use-arrow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"use-arrow.d.ts","sourceRoot":"","sources":["../../src/composables/use-arrow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAMrD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAE3B;;OAEG;IACH,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAE3B;;OAEG;IACH,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CACjD;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAMD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CACtB,OAAO,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,EAChC,OAAO,EAAE,eAAe,EACxB,OAAO,GAAE,eAAoB,GAC5B,cAAc,CAyDhB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { AnchorElement, FloatingContext, FloatingElement, UseFloatingOptions } from './use-floating';
|
|
2
3
|
import { TreeNode, TreeOptions } from './use-tree';
|
|
3
4
|
/**
|
|
4
5
|
* Configuration options for the floating tree
|
|
@@ -7,22 +8,15 @@ export interface FloatingTreeOptions extends TreeOptions {
|
|
|
7
8
|
}
|
|
8
9
|
export interface UseFloatingTreeReturn {
|
|
9
10
|
readonly nodeMap: Readonly<Map<string, TreeNode<FloatingContext>>>;
|
|
10
|
-
readonly root:
|
|
11
|
+
readonly root: TreeNode<FloatingContext>;
|
|
11
12
|
findNodeById: (nodeId: string) => TreeNode<FloatingContext> | null;
|
|
12
13
|
moveNode: (nodeId: string, newParentId: string | null) => boolean;
|
|
13
14
|
dispose: () => void;
|
|
14
|
-
addNode: (
|
|
15
|
+
addNode: (anchorEl: Ref<AnchorElement>, floatingEl: Ref<FloatingElement>, options?: UseFloatingOptions) => TreeNode<FloatingContext> | null;
|
|
15
16
|
removeNode: (nodeId: string, deleteStrategy?: "orphan" | "recursive") => boolean;
|
|
16
17
|
traverse: (mode: "dfs" | "bfs", startNode?: TreeNode<FloatingContext>) => TreeNode<FloatingContext>[];
|
|
17
|
-
/**
|
|
18
|
-
* Checks if a given node is the topmost open node in the tree hierarchy.
|
|
19
|
-
* A node is considered topmost if it's open and none of its ancestors are open.
|
|
20
|
-
*
|
|
21
|
-
* @param nodeId - The ID of the node to check.
|
|
22
|
-
* @returns True if the node is open and no ancestors are open, false otherwise.
|
|
23
|
-
*/
|
|
24
|
-
isTopmost: (nodeId: string) => boolean;
|
|
25
18
|
getAllOpenNodes: () => TreeNode<FloatingContext>[];
|
|
19
|
+
getTopmostOpenNode: () => TreeNode<FloatingContext> | null;
|
|
26
20
|
/**
|
|
27
21
|
* Executes a provided function once for each tree node that matches the specified relationship.
|
|
28
22
|
* This is a flexible iteration method that can target nodes based on their relationship to a target node.
|
|
@@ -41,8 +35,14 @@ export interface UseFloatingTreeReturn {
|
|
|
41
35
|
*/
|
|
42
36
|
type NodeRelationship = "ancestors-only" | "siblings-only" | "descendants-only" | "children-only" | "self-and-ancestors" | "self-and-children" | "self-and-descendants" | "self-and-siblings" | "self-ancestors-and-children" | "full-branch" | "all-except-branch";
|
|
43
37
|
/**
|
|
44
|
-
*
|
|
38
|
+
* Creates and manages a hierarchical tree of floating elements.
|
|
39
|
+
*
|
|
40
|
+
* @param anchorEl - The anchor element for the root floating context
|
|
41
|
+
* @param floatingEl - The floating element for the root floating context
|
|
42
|
+
* @param options - Options for the root floating context
|
|
43
|
+
* @param treeOptions - Options for tree behavior
|
|
44
|
+
* @returns UseFloatingTreeReturn with tree management methods and root context
|
|
45
45
|
*/
|
|
46
|
-
export declare function useFloatingTree(
|
|
46
|
+
export declare function useFloatingTree(anchorEl: Ref<AnchorElement>, floatingEl: Ref<FloatingElement>, options?: UseFloatingOptions, treeOptions?: FloatingTreeOptions): UseFloatingTreeReturn;
|
|
47
47
|
export {};
|
|
48
48
|
//# 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,
|
|
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;AAC9B,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EACf,eAAe,EACf,kBAAkB,EACnB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAQ,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAA;AAMlE;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,WAAW;CAAG;AAE3D,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAA;IAClE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAA;IACxC,YAAY,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vB;;;;;;;;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,CA+LvB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AutoUpdateOptions, Middleware, MiddlewareData, Placement, Strategy, VirtualElement } from '@floating-ui/dom';
|
|
2
|
-
import {
|
|
2
|
+
import { MaybeRefOrGetter, Ref } from 'vue';
|
|
3
3
|
/**
|
|
4
4
|
* Type for anchor element in floating UI
|
|
5
5
|
*/
|
|
@@ -59,18 +59,22 @@ export interface UseFloatingOptions {
|
|
|
59
59
|
*/
|
|
60
60
|
middlewares?: Middleware[];
|
|
61
61
|
/**
|
|
62
|
-
*
|
|
62
|
+
* Whether to automatically update the position of the floating element.
|
|
63
|
+
* Can be a boolean or an `AutoUpdateOptions` object.
|
|
64
|
+
* @default true
|
|
63
65
|
*/
|
|
64
|
-
|
|
66
|
+
autoUpdate?: boolean | AutoUpdateOptions;
|
|
65
67
|
/**
|
|
66
68
|
* Whether the floating element is open.
|
|
67
69
|
* @default false
|
|
68
70
|
*/
|
|
69
71
|
open?: Ref<boolean>;
|
|
70
72
|
/**
|
|
71
|
-
*
|
|
73
|
+
* Parent node ID for tree hierarchy.
|
|
74
|
+
* Used when adding nodes to floating trees.
|
|
75
|
+
* @default null
|
|
72
76
|
*/
|
|
73
|
-
|
|
77
|
+
parentId?: string | null;
|
|
74
78
|
}
|
|
75
79
|
/**
|
|
76
80
|
* Context object returned by useFloating containing all necessary data and methods
|
|
@@ -101,9 +105,9 @@ export interface FloatingContext {
|
|
|
101
105
|
*/
|
|
102
106
|
isPositioned: Readonly<Ref<boolean>>;
|
|
103
107
|
/**
|
|
104
|
-
*
|
|
108
|
+
* Reactive styles to apply to the floating element
|
|
105
109
|
*/
|
|
106
|
-
floatingStyles:
|
|
110
|
+
floatingStyles: Readonly<Ref<FloatingStyles>>;
|
|
107
111
|
/**
|
|
108
112
|
* Function to manually update the position
|
|
109
113
|
*/
|
|
@@ -114,6 +118,7 @@ export interface FloatingContext {
|
|
|
114
118
|
refs: {
|
|
115
119
|
anchorEl: Ref<AnchorElement>;
|
|
116
120
|
floatingEl: Ref<FloatingElement>;
|
|
121
|
+
arrowEl: Ref<HTMLElement | null>;
|
|
117
122
|
};
|
|
118
123
|
/**
|
|
119
124
|
* Whether the floating element is open
|
|
@@ -145,17 +150,4 @@ export interface FloatingContext {
|
|
|
145
150
|
* ```
|
|
146
151
|
*/
|
|
147
152
|
export declare function useFloating(anchorEl: Ref<AnchorElement>, floatingEl: Ref<FloatingElement>, options?: UseFloatingOptions): FloatingContext;
|
|
148
|
-
/**
|
|
149
|
-
* Auto-update function to use with `whileElementsMounted` option
|
|
150
|
-
*
|
|
151
|
-
* This function provides automatic position updates for floating elements.
|
|
152
|
-
* It's a wrapper around Floating UI's autoUpdate function.
|
|
153
|
-
*
|
|
154
|
-
* @param anchorEl - The anchor element
|
|
155
|
-
* @param floatingEl - The floating element
|
|
156
|
-
* @param update - The update function to call
|
|
157
|
-
* @param options - Additional options for auto-updating
|
|
158
|
-
* @returns A cleanup function to stop auto-updating
|
|
159
|
-
*/
|
|
160
|
-
export declare function autoUpdate(anchorEl: HTMLElement, floatingEl: HTMLElement, update: () => void, options?: AutoUpdateOptions): () => void;
|
|
161
153
|
//# sourceMappingURL=use-floating.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-floating.d.ts","sourceRoot":"","sources":["../../src/composables/use-floating.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,SAAS,EACT,QAAQ,EACR,cAAc,EACf,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"use-floating.d.ts","sourceRoot":"","sources":["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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-tree.d.ts","sourceRoot":"","sources":["../../src/composables/use-tree.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-tree.d.ts","sourceRoot":"","sources":["../../src/composables/use-tree.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,GAAG,EAA+B,MAAM,KAAK,CAAA;AAM3D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,wEAAwE;IACxE,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAE1B;;;;OAIG;IACH,cAAc,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAA;CACxC;AAQD;;;GAGG;AACH,qBAAa,QAAQ,CAAC,CAAC;;IACrB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,CAAC,CAAA;IACP,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;IAC/B,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;gBAI1B,IAAI,EAAE,CAAC,EACP,MAAM,GAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAW,EACjC,OAAO,GAAE,eAAoB,EAC7B,MAAM,UAAQ;IAShB;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;IAKtC;;;;;;OAMG;IACH,oBAAoB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO;IAQrD;;;;OAIG;IACH,SAAS,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;IAIxE;;;;OAIG;IACH,cAAc,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,QAAQ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CAAC,CAAC,CAAC,GAAG,IAAgB,GACxC,QAAQ,CAAC,CAAC,CAAC,EAAE;IAgChB;;;;;OAKG;IACH,OAAO,IAAI,IAAI;CAiBhB"}
|
package/dist/utils.d.ts
CHANGED
|
@@ -11,4 +11,5 @@ export declare function useId(): string;
|
|
|
11
11
|
* @returns True if the value is a function, false otherwise
|
|
12
12
|
*/
|
|
13
13
|
export declare function isFunction(value: unknown): value is AnyFn;
|
|
14
|
+
export declare function isHTMLElement(value: unknown): value is HTMLElement;
|
|
14
15
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAGpC;;;;GAIG;AACH,wBAAgB,KAAK,IAAI,MAAM,CAE9B;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,CAEzD"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAGpC;;;;GAIG;AACH,wBAAgB,KAAK,IAAI,MAAM,CAE9B;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,CAEzD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE"}
|