@mantine-vue/hooks 1.1.2
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/cjs/index.cjs +4696 -0
- package/cjs/index.cjs.map +1 -0
- package/esm/index.mjs +4579 -0
- package/esm/index.mjs.map +1 -0
- package/lib/index.d.mts +141 -0
- package/lib/index.d.ts +141 -0
- package/lib/use-click-outside/use-click-outside.d.ts +4 -0
- package/lib/use-clipboard/use-clipboard.d.ts +11 -0
- package/lib/use-collapse/use-collapse.d.ts +38 -0
- package/lib/use-collapse/use-horizontal-collapse.d.ts +4 -0
- package/lib/use-color-scheme/use-color-scheme.d.ts +4 -0
- package/lib/use-counter/use-counter.d.ts +14 -0
- package/lib/use-debounced-callback/use-debounced-callback.d.ts +12 -0
- package/lib/use-debounced-state/use-debounced-state.d.ts +6 -0
- package/lib/use-debounced-value/use-debounced-value.d.ts +14 -0
- package/lib/use-did-update/use-did-update.d.ts +2 -0
- package/lib/use-disclosure/use-disclosure.d.ts +13 -0
- package/lib/use-document-title/use-document-title.d.ts +2 -0
- package/lib/use-document-visibility/use-document-visibility.d.ts +2 -0
- package/lib/use-drag/use-drag.d.ts +56 -0
- package/lib/use-event-listener/use-event-listener.d.ts +2 -0
- package/lib/use-eye-dropper/use-eye-dropper.d.ts +12 -0
- package/lib/use-favicon/use-favicon.d.ts +2 -0
- package/lib/use-fetch/use-fetch.d.ts +12 -0
- package/lib/use-file-dialog/use-file-dialog.d.ts +25 -0
- package/lib/use-floating-window/use-floating-window.d.ts +30 -0
- package/lib/use-focus-return/use-focus-return.d.ts +6 -0
- package/lib/use-focus-trap/scope-tab.d.ts +1 -0
- package/lib/use-focus-trap/tabbable.d.ts +4 -0
- package/lib/use-focus-trap/use-focus-trap.d.ts +5 -0
- package/lib/use-focus-within/use-focus-within.d.ts +10 -0
- package/lib/use-force-update/use-force-update.d.ts +2 -0
- package/lib/use-fullscreen/use-fullscreen.d.ts +12 -0
- package/lib/use-hash/use-hash.d.ts +6 -0
- package/lib/use-headroom/use-headroom.d.ts +27 -0
- package/lib/use-hotkeys/parse-hotkey.d.ts +20 -0
- package/lib/use-hotkeys/use-hotkeys.d.ts +15 -0
- package/lib/use-hover/use-hover.d.ts +6 -0
- package/lib/use-id/use-id.d.ts +2 -0
- package/lib/use-idle/use-idle.d.ts +6 -0
- package/lib/use-in-viewport/use-in-viewport.d.ts +6 -0
- package/lib/use-input-state/use-input-state.d.ts +6 -0
- package/lib/use-intersection/use-intersection.d.ts +6 -0
- package/lib/use-interval/use-interval.d.ts +16 -0
- package/lib/use-is-first-render/use-is-first-render.d.ts +2 -0
- package/lib/use-isomorphic-effect/use-isomorphic-effect.d.ts +1 -0
- package/lib/use-list-state/use-list-state.d.ts +25 -0
- package/lib/use-local-storage/create-storage.d.ts +23 -0
- package/lib/use-local-storage/use-local-storage.d.ts +3 -0
- package/lib/use-logger/use-logger.d.ts +2 -0
- package/lib/use-long-press/use-long-press.d.ts +20 -0
- package/lib/use-map/use-map.d.ts +1 -0
- package/lib/use-mask/use-mask.d.ts +57 -0
- package/lib/use-media-query/use-media-query.d.ts +5 -0
- package/lib/use-merged-ref/use-merged-ref.d.ts +6 -0
- package/lib/use-mounted/use-mounted.d.ts +2 -0
- package/lib/use-mouse/use-mouse.d.ts +15 -0
- package/lib/use-move/use-move.d.ts +17 -0
- package/lib/use-mutation-observer/use-mutation-observer.d.ts +3 -0
- package/lib/use-network/use-network.d.ts +11 -0
- package/lib/use-orientation/use-orientation.d.ts +23 -0
- package/lib/use-os/use-os.d.ts +6 -0
- package/lib/use-page-leave/use-page-leave.d.ts +2 -0
- package/lib/use-pagination/use-pagination.d.ts +20 -0
- package/lib/use-previous/use-previous.d.ts +2 -0
- package/lib/use-queue/use-queue.d.ts +20 -0
- package/lib/use-radial-move/use-radial-move.d.ts +13 -0
- package/lib/use-reduced-motion/use-reduced-motion.d.ts +3 -0
- package/lib/use-resize-observer/use-resize-observer.d.ts +13 -0
- package/lib/use-roving-index/use-roving-index.d.ts +45 -0
- package/lib/use-scroll-direction/use-scroll-direction.d.ts +3 -0
- package/lib/use-scroll-into-view/use-scroll-into-view.d.ts +32 -0
- package/lib/use-scroll-spy/use-scroll-spy.d.ts +30 -0
- package/lib/use-scroller/use-scroller.d.ts +25 -0
- package/lib/use-selection/use-selection.d.ts +27 -0
- package/lib/use-session-storage/use-session-storage.d.ts +3 -0
- package/lib/use-set/use-set.d.ts +9 -0
- package/lib/use-set-state/use-set-state.d.ts +4 -0
- package/lib/use-shallow-effect/use-shallow-effect.d.ts +2 -0
- package/lib/use-splitter/use-splitter.d.ts +94 -0
- package/lib/use-state-history/use-state-history.d.ts +17 -0
- package/lib/use-text-selection/use-text-selection.d.ts +2 -0
- package/lib/use-throttled-callback/use-throttled-callback.d.ts +2 -0
- package/lib/use-throttled-state/use-throttled-state.d.ts +3 -0
- package/lib/use-throttled-value/use-throttled-value.d.ts +2 -0
- package/lib/use-timeout/use-timeout.d.ts +8 -0
- package/lib/use-toggle/use-toggle.d.ts +4 -0
- package/lib/use-uncontrolled/use-uncontrolled.d.ts +13 -0
- package/lib/use-validated-state/use-validated-state.d.ts +16 -0
- package/lib/use-viewport-size/use-viewport-size.d.ts +6 -0
- package/lib/use-window-event/use-window-event.d.ts +2 -0
- package/lib/use-window-scroll/use-window-scroll.d.ts +8 -0
- package/lib/utils/clamp/clamp.d.ts +1 -0
- package/lib/utils/index.d.ts +7 -0
- package/lib/utils/lower-first/lower-first.d.ts +1 -0
- package/lib/utils/random-id/random-id.d.ts +1 -0
- package/lib/utils/range/range.d.ts +1 -0
- package/lib/utils/shallow-equal/shallow-equal.d.ts +1 -0
- package/lib/utils/upper-first/upper-first.d.ts +1 -0
- package/lib/utils/use-callback-ref/use-callback-ref.d.ts +2 -0
- package/package.json +37 -0
package/lib/index.d.mts
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
export * from './utils';
|
|
2
|
+
export { useDebouncedCallback } from './use-debounced-callback/use-debounced-callback';
|
|
3
|
+
export type { UseDebouncedCallbackOptions, UseDebouncedCallbackReturnValue, } from './use-debounced-callback/use-debounced-callback';
|
|
4
|
+
export { useClickOutside } from './use-click-outside/use-click-outside';
|
|
5
|
+
export { useClipboard } from './use-clipboard/use-clipboard';
|
|
6
|
+
export type { UseClipboardInput, UseClipboardInput as UseClipboardOptions, UseClipboardReturnValue, } from './use-clipboard/use-clipboard';
|
|
7
|
+
export { useColorScheme } from './use-color-scheme/use-color-scheme';
|
|
8
|
+
export type { UseColorSchemeValue } from './use-color-scheme/use-color-scheme';
|
|
9
|
+
export { useCounter } from './use-counter/use-counter';
|
|
10
|
+
export type { UseCounterOptions, UseCounterHandlers, UseCounterReturnValue, } from './use-counter/use-counter';
|
|
11
|
+
export { useDebouncedState } from './use-debounced-state/use-debounced-state';
|
|
12
|
+
export type { UseDebouncedStateOptions, UseDebouncedStateReturnValue, } from './use-debounced-state/use-debounced-state';
|
|
13
|
+
export { useDebouncedValue } from './use-debounced-value/use-debounced-value';
|
|
14
|
+
export type { UseDebouncedValueHandlers, UseDebouncedValueOptions, UseDebouncedValueReturnValue, } from './use-debounced-value/use-debounced-value';
|
|
15
|
+
export { useDocumentTitle } from './use-document-title/use-document-title';
|
|
16
|
+
export { useDocumentVisibility } from './use-document-visibility/use-document-visibility';
|
|
17
|
+
export { useFocusReturn } from './use-focus-return/use-focus-return';
|
|
18
|
+
export type { UseFocusReturnInput, UseFocusReturnInput as UseFocusReturnOptions, } from './use-focus-return/use-focus-return';
|
|
19
|
+
export { useDidUpdate } from './use-did-update/use-did-update';
|
|
20
|
+
export { useFocusTrap, scopeTab, FOCUS_SELECTOR, findTabbableDescendants, focusable, tabbable, } from './use-focus-trap/use-focus-trap';
|
|
21
|
+
export { useForceUpdate } from './use-force-update/use-force-update';
|
|
22
|
+
export { useId } from './use-id/use-id';
|
|
23
|
+
export { useIdle } from './use-idle/use-idle';
|
|
24
|
+
export type { UseIdleOptions } from './use-idle/use-idle';
|
|
25
|
+
export { useInterval } from './use-interval/use-interval';
|
|
26
|
+
export type { UseIntervalOptions, UseIntervalReturnValue } from './use-interval/use-interval';
|
|
27
|
+
export { useIsomorphicEffect } from './use-isomorphic-effect/use-isomorphic-effect';
|
|
28
|
+
export { useListState } from './use-list-state/use-list-state';
|
|
29
|
+
export type { UseListStateReturnValue, UseListStateHandlers } from './use-list-state/use-list-state';
|
|
30
|
+
export { useLocalStorage, readLocalStorageValue } from './use-local-storage/use-local-storage';
|
|
31
|
+
export type { UseStorageOptions, UseStorageReturnValue, StorageType, } from './use-local-storage/create-storage';
|
|
32
|
+
export { useSessionStorage, readSessionStorageValue, } from './use-session-storage/use-session-storage';
|
|
33
|
+
export { useMediaQuery } from './use-media-query/use-media-query';
|
|
34
|
+
export type { UseMediaQueryOptions } from './use-media-query/use-media-query';
|
|
35
|
+
export { useMergedRef, mergeRefs, assignRef } from './use-merged-ref/use-merged-ref';
|
|
36
|
+
export type { VueRefTarget } from './use-merged-ref/use-merged-ref';
|
|
37
|
+
export { useMouse, useMousePosition } from './use-mouse/use-mouse';
|
|
38
|
+
export type { UseMouseOptions, UseMouseReturnValue, UseMousePositionReturnValue, } from './use-mouse/use-mouse';
|
|
39
|
+
export { useMove, clampUseMovePosition } from './use-move/use-move';
|
|
40
|
+
export type { UseMoveHandlers, UseMovePosition } from './use-move/use-move';
|
|
41
|
+
export { usePagination, DOTS } from './use-pagination/use-pagination';
|
|
42
|
+
export type { UsePaginationOptions } from './use-pagination/use-pagination';
|
|
43
|
+
export { useQueue } from './use-queue/use-queue';
|
|
44
|
+
export type { UseQueueOptions, UseQueueReturnValue } from './use-queue/use-queue';
|
|
45
|
+
export { usePageLeave } from './use-page-leave/use-page-leave';
|
|
46
|
+
export { useReducedMotion } from './use-reduced-motion/use-reduced-motion';
|
|
47
|
+
export { useScrollIntoView } from './use-scroll-into-view/use-scroll-into-view';
|
|
48
|
+
export type { UseScrollIntoViewOptions, UseScrollIntoViewReturnValue, } from './use-scroll-into-view/use-scroll-into-view';
|
|
49
|
+
export { useResizeObserver, useElementSize } from './use-resize-observer/use-resize-observer';
|
|
50
|
+
export type { UseElementSizeReturnValue, UseResizeObserverReturnValue, ObserverRect, } from './use-resize-observer/use-resize-observer';
|
|
51
|
+
export { useShallowEffect } from './use-shallow-effect/use-shallow-effect';
|
|
52
|
+
export { useToggle } from './use-toggle/use-toggle';
|
|
53
|
+
export type { UseToggleReturnValue } from './use-toggle/use-toggle';
|
|
54
|
+
export { useUncontrolled } from './use-uncontrolled/use-uncontrolled';
|
|
55
|
+
export type { UseUncontrolledOptions, UseUncontrolledReturnValue, } from './use-uncontrolled/use-uncontrolled';
|
|
56
|
+
export { useViewportSize } from './use-viewport-size/use-viewport-size';
|
|
57
|
+
export type { UseViewportSizeReturnValue } from './use-viewport-size/use-viewport-size';
|
|
58
|
+
export { useWindowEvent } from './use-window-event/use-window-event';
|
|
59
|
+
export { useWindowScroll } from './use-window-scroll/use-window-scroll';
|
|
60
|
+
export type { UseWindowScrollPosition, UseWindowScrollTo, UseWindowScrollReturnValue, } from './use-window-scroll/use-window-scroll';
|
|
61
|
+
export { useIntersection } from './use-intersection/use-intersection';
|
|
62
|
+
export type { UseIntersectionReturnValue } from './use-intersection/use-intersection';
|
|
63
|
+
export { useHash } from './use-hash/use-hash';
|
|
64
|
+
export type { UseHashInput, UseHashInput as UseHashOptions, UseHashReturnValue, } from './use-hash/use-hash';
|
|
65
|
+
export { useHotkeys, getHotkeyHandler } from './use-hotkeys/use-hotkeys';
|
|
66
|
+
export type { HotkeyItemOptions, HotkeyItem } from './use-hotkeys/use-hotkeys';
|
|
67
|
+
export { useFullscreenDocument, useFullscreenElement } from './use-fullscreen/use-fullscreen';
|
|
68
|
+
export type { UseFullscreenElementReturnValue, UseFullscreenDocumentReturnValue, } from './use-fullscreen/use-fullscreen';
|
|
69
|
+
export { useLogger } from './use-logger/use-logger';
|
|
70
|
+
export { useHover } from './use-hover/use-hover';
|
|
71
|
+
export type { UseHoverReturnValue } from './use-hover/use-hover';
|
|
72
|
+
export { useValidatedState } from './use-validated-state/use-validated-state';
|
|
73
|
+
export type { UseValidatedStateValue, UseValidatedStateReturnValue, } from './use-validated-state/use-validated-state';
|
|
74
|
+
export { useOs } from './use-os/use-os';
|
|
75
|
+
export type { UseOSReturnValue, UseOsOptions } from './use-os/use-os';
|
|
76
|
+
export { useSetState } from './use-set-state/use-set-state';
|
|
77
|
+
export type { UseSetStateCallback, UseSetStateReturnValue } from './use-set-state/use-set-state';
|
|
78
|
+
export { useInputState } from './use-input-state/use-input-state';
|
|
79
|
+
export type { UseInputStateReturnValue } from './use-input-state/use-input-state';
|
|
80
|
+
export { useEventListener } from './use-event-listener/use-event-listener';
|
|
81
|
+
export { useDisclosure } from './use-disclosure/use-disclosure';
|
|
82
|
+
export type { UseDisclosureOptions, UseDisclosureHandlers, UseDisclosureReturnValue, } from './use-disclosure/use-disclosure';
|
|
83
|
+
export { useFocusWithin } from './use-focus-within/use-focus-within';
|
|
84
|
+
export type { UseFocusWithinOptions, UseFocusWithinReturnValue, } from './use-focus-within/use-focus-within';
|
|
85
|
+
export { useNetwork } from './use-network/use-network';
|
|
86
|
+
export type { UserNetworkReturnValue } from './use-network/use-network';
|
|
87
|
+
export { useTimeout } from './use-timeout/use-timeout';
|
|
88
|
+
export type { UseTimeoutOptions, UseTimeoutReturnValue } from './use-timeout/use-timeout';
|
|
89
|
+
export { useTextSelection } from './use-text-selection/use-text-selection';
|
|
90
|
+
export { usePrevious } from './use-previous/use-previous';
|
|
91
|
+
export { useFavicon } from './use-favicon/use-favicon';
|
|
92
|
+
export { useHeadroom, isFixed, isPinned, isReleased, isPinnedOrReleased, } from './use-headroom/use-headroom';
|
|
93
|
+
export type { UseHeadroomInput, UseHeadroomInput as UseHeadroomOptions, UseHeadroomReturnValue, } from './use-headroom/use-headroom';
|
|
94
|
+
export { useScrollDirection } from './use-scroll-direction/use-scroll-direction';
|
|
95
|
+
export type { ScrollDirection } from './use-scroll-direction/use-scroll-direction';
|
|
96
|
+
export { useEyeDropper } from './use-eye-dropper/use-eye-dropper';
|
|
97
|
+
export type { EyeDropperOpenOptions, EyeDropperOpenReturnType, UseEyeDropperReturnValue, } from './use-eye-dropper/use-eye-dropper';
|
|
98
|
+
export { useInViewport } from './use-in-viewport/use-in-viewport';
|
|
99
|
+
export type { UseInViewportReturnValue } from './use-in-viewport/use-in-viewport';
|
|
100
|
+
export { useMutationObserver, useMutationObserverTarget, } from './use-mutation-observer/use-mutation-observer';
|
|
101
|
+
export { useMounted } from './use-mounted/use-mounted';
|
|
102
|
+
export { useStateHistory } from './use-state-history/use-state-history';
|
|
103
|
+
export type { UseStateHistoryHandlers, UseStateHistoryValue, UseStateHistoryValue as StateHistory, UseStateHistoryReturnValue, } from './use-state-history/use-state-history';
|
|
104
|
+
export { useMap } from './use-map/use-map';
|
|
105
|
+
export { useSet, readonlySetLikeToSet } from './use-set/use-set';
|
|
106
|
+
export type { ReadonlySetLike } from './use-set/use-set';
|
|
107
|
+
export { useThrottledCallback } from './use-throttled-callback/use-throttled-callback';
|
|
108
|
+
export { useThrottledState } from './use-throttled-state/use-throttled-state';
|
|
109
|
+
export type { UseThrottledStateReturnValue } from './use-throttled-state/use-throttled-state';
|
|
110
|
+
export { useThrottledValue } from './use-throttled-value/use-throttled-value';
|
|
111
|
+
export { useIsFirstRender } from './use-is-first-render/use-is-first-render';
|
|
112
|
+
export { useOrientation } from './use-orientation/use-orientation';
|
|
113
|
+
export type { UseOrientationOptions, UseOrientationReturnType, } from './use-orientation/use-orientation';
|
|
114
|
+
export { useFetch } from './use-fetch/use-fetch';
|
|
115
|
+
export type { UseFetchOptions, UseFetchReturnValue } from './use-fetch/use-fetch';
|
|
116
|
+
export { useRadialMove, normalizeRadialValue } from './use-radial-move/use-radial-move';
|
|
117
|
+
export type { UseRadialMoveOptions, UseRadialMoveReturnValue, } from './use-radial-move/use-radial-move';
|
|
118
|
+
export { useScrollSpy } from './use-scroll-spy/use-scroll-spy';
|
|
119
|
+
export type { UseScrollSpyHeadingData, UseScrollSpyOptions } from './use-scroll-spy/use-scroll-spy';
|
|
120
|
+
export { useScroller } from './use-scroller/use-scroller';
|
|
121
|
+
export type { UseScrollerOptions, UseScrollerReturnValue, UseScrollerScrollState, } from './use-scroller/use-scroller';
|
|
122
|
+
export { useFileDialog } from './use-file-dialog/use-file-dialog';
|
|
123
|
+
export type { UseFileDialogOptions, UseFileDialogReturnValue, } from './use-file-dialog/use-file-dialog';
|
|
124
|
+
export { useLongPress } from './use-long-press/use-long-press';
|
|
125
|
+
export type { UseLongPressEvent, UseLongPressOptions, UseLongPressReturnValue, } from './use-long-press/use-long-press';
|
|
126
|
+
export { useSelection } from './use-selection/use-selection';
|
|
127
|
+
export type { UseSelectionHandlers, UseSelectionInput, UseSelectionReturnValue, } from './use-selection/use-selection';
|
|
128
|
+
export { useFloatingWindow } from './use-floating-window/use-floating-window';
|
|
129
|
+
export type { FloatingWindowPosition, FloatingWindowPositionConfig, SetFloatingWindowPosition, UseFloatingWindowOptions, } from './use-floating-window/use-floating-window';
|
|
130
|
+
export { useCollapse, createCollapse, getElementContentSize } from './use-collapse/use-collapse';
|
|
131
|
+
export type { UseCollapseInput, UseCollapseReturnValue, UseCollapseState, GetCollapsePropsInput, GetCollapsePropsReturnValue, } from './use-collapse/use-collapse';
|
|
132
|
+
export { useHorizontalCollapse } from './use-collapse/use-horizontal-collapse';
|
|
133
|
+
export type { UseHorizontalCollapseInput, UseHorizontalCollapseReturnValue, } from './use-collapse/use-horizontal-collapse';
|
|
134
|
+
export { useMask, formatMask, unformatMask, isMaskComplete, generatePattern, } from './use-mask/use-mask';
|
|
135
|
+
export type { UseMaskOptions, UseMaskReturnValue, MaskState } from './use-mask/use-mask';
|
|
136
|
+
export { useRovingIndex } from './use-roving-index/use-roving-index';
|
|
137
|
+
export type { UseRovingIndexInput, UseRovingIndexGetItemPropsInput, UseRovingIndexReturnValue, } from './use-roving-index/use-roving-index';
|
|
138
|
+
export { useDrag } from './use-drag/use-drag';
|
|
139
|
+
export type { UseDragState, UseDragOptions, UseDragReturnValue } from './use-drag/use-drag';
|
|
140
|
+
export { useSplitter } from './use-splitter/use-splitter';
|
|
141
|
+
export type { UseSplitterPanel, UseSplitterOptions, UseSplitterReturnValue, UseSplitterRedistributeInput, UseSplitterRedistributeFn, } from './use-splitter/use-splitter';
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
export * from './utils';
|
|
2
|
+
export { useDebouncedCallback } from './use-debounced-callback/use-debounced-callback';
|
|
3
|
+
export type { UseDebouncedCallbackOptions, UseDebouncedCallbackReturnValue, } from './use-debounced-callback/use-debounced-callback';
|
|
4
|
+
export { useClickOutside } from './use-click-outside/use-click-outside';
|
|
5
|
+
export { useClipboard } from './use-clipboard/use-clipboard';
|
|
6
|
+
export type { UseClipboardInput, UseClipboardInput as UseClipboardOptions, UseClipboardReturnValue, } from './use-clipboard/use-clipboard';
|
|
7
|
+
export { useColorScheme } from './use-color-scheme/use-color-scheme';
|
|
8
|
+
export type { UseColorSchemeValue } from './use-color-scheme/use-color-scheme';
|
|
9
|
+
export { useCounter } from './use-counter/use-counter';
|
|
10
|
+
export type { UseCounterOptions, UseCounterHandlers, UseCounterReturnValue, } from './use-counter/use-counter';
|
|
11
|
+
export { useDebouncedState } from './use-debounced-state/use-debounced-state';
|
|
12
|
+
export type { UseDebouncedStateOptions, UseDebouncedStateReturnValue, } from './use-debounced-state/use-debounced-state';
|
|
13
|
+
export { useDebouncedValue } from './use-debounced-value/use-debounced-value';
|
|
14
|
+
export type { UseDebouncedValueHandlers, UseDebouncedValueOptions, UseDebouncedValueReturnValue, } from './use-debounced-value/use-debounced-value';
|
|
15
|
+
export { useDocumentTitle } from './use-document-title/use-document-title';
|
|
16
|
+
export { useDocumentVisibility } from './use-document-visibility/use-document-visibility';
|
|
17
|
+
export { useFocusReturn } from './use-focus-return/use-focus-return';
|
|
18
|
+
export type { UseFocusReturnInput, UseFocusReturnInput as UseFocusReturnOptions, } from './use-focus-return/use-focus-return';
|
|
19
|
+
export { useDidUpdate } from './use-did-update/use-did-update';
|
|
20
|
+
export { useFocusTrap, scopeTab, FOCUS_SELECTOR, findTabbableDescendants, focusable, tabbable, } from './use-focus-trap/use-focus-trap';
|
|
21
|
+
export { useForceUpdate } from './use-force-update/use-force-update';
|
|
22
|
+
export { useId } from './use-id/use-id';
|
|
23
|
+
export { useIdle } from './use-idle/use-idle';
|
|
24
|
+
export type { UseIdleOptions } from './use-idle/use-idle';
|
|
25
|
+
export { useInterval } from './use-interval/use-interval';
|
|
26
|
+
export type { UseIntervalOptions, UseIntervalReturnValue } from './use-interval/use-interval';
|
|
27
|
+
export { useIsomorphicEffect } from './use-isomorphic-effect/use-isomorphic-effect';
|
|
28
|
+
export { useListState } from './use-list-state/use-list-state';
|
|
29
|
+
export type { UseListStateReturnValue, UseListStateHandlers } from './use-list-state/use-list-state';
|
|
30
|
+
export { useLocalStorage, readLocalStorageValue } from './use-local-storage/use-local-storage';
|
|
31
|
+
export type { UseStorageOptions, UseStorageReturnValue, StorageType, } from './use-local-storage/create-storage';
|
|
32
|
+
export { useSessionStorage, readSessionStorageValue, } from './use-session-storage/use-session-storage';
|
|
33
|
+
export { useMediaQuery } from './use-media-query/use-media-query';
|
|
34
|
+
export type { UseMediaQueryOptions } from './use-media-query/use-media-query';
|
|
35
|
+
export { useMergedRef, mergeRefs, assignRef } from './use-merged-ref/use-merged-ref';
|
|
36
|
+
export type { VueRefTarget } from './use-merged-ref/use-merged-ref';
|
|
37
|
+
export { useMouse, useMousePosition } from './use-mouse/use-mouse';
|
|
38
|
+
export type { UseMouseOptions, UseMouseReturnValue, UseMousePositionReturnValue, } from './use-mouse/use-mouse';
|
|
39
|
+
export { useMove, clampUseMovePosition } from './use-move/use-move';
|
|
40
|
+
export type { UseMoveHandlers, UseMovePosition } from './use-move/use-move';
|
|
41
|
+
export { usePagination, DOTS } from './use-pagination/use-pagination';
|
|
42
|
+
export type { UsePaginationOptions } from './use-pagination/use-pagination';
|
|
43
|
+
export { useQueue } from './use-queue/use-queue';
|
|
44
|
+
export type { UseQueueOptions, UseQueueReturnValue } from './use-queue/use-queue';
|
|
45
|
+
export { usePageLeave } from './use-page-leave/use-page-leave';
|
|
46
|
+
export { useReducedMotion } from './use-reduced-motion/use-reduced-motion';
|
|
47
|
+
export { useScrollIntoView } from './use-scroll-into-view/use-scroll-into-view';
|
|
48
|
+
export type { UseScrollIntoViewOptions, UseScrollIntoViewReturnValue, } from './use-scroll-into-view/use-scroll-into-view';
|
|
49
|
+
export { useResizeObserver, useElementSize } from './use-resize-observer/use-resize-observer';
|
|
50
|
+
export type { UseElementSizeReturnValue, UseResizeObserverReturnValue, ObserverRect, } from './use-resize-observer/use-resize-observer';
|
|
51
|
+
export { useShallowEffect } from './use-shallow-effect/use-shallow-effect';
|
|
52
|
+
export { useToggle } from './use-toggle/use-toggle';
|
|
53
|
+
export type { UseToggleReturnValue } from './use-toggle/use-toggle';
|
|
54
|
+
export { useUncontrolled } from './use-uncontrolled/use-uncontrolled';
|
|
55
|
+
export type { UseUncontrolledOptions, UseUncontrolledReturnValue, } from './use-uncontrolled/use-uncontrolled';
|
|
56
|
+
export { useViewportSize } from './use-viewport-size/use-viewport-size';
|
|
57
|
+
export type { UseViewportSizeReturnValue } from './use-viewport-size/use-viewport-size';
|
|
58
|
+
export { useWindowEvent } from './use-window-event/use-window-event';
|
|
59
|
+
export { useWindowScroll } from './use-window-scroll/use-window-scroll';
|
|
60
|
+
export type { UseWindowScrollPosition, UseWindowScrollTo, UseWindowScrollReturnValue, } from './use-window-scroll/use-window-scroll';
|
|
61
|
+
export { useIntersection } from './use-intersection/use-intersection';
|
|
62
|
+
export type { UseIntersectionReturnValue } from './use-intersection/use-intersection';
|
|
63
|
+
export { useHash } from './use-hash/use-hash';
|
|
64
|
+
export type { UseHashInput, UseHashInput as UseHashOptions, UseHashReturnValue, } from './use-hash/use-hash';
|
|
65
|
+
export { useHotkeys, getHotkeyHandler } from './use-hotkeys/use-hotkeys';
|
|
66
|
+
export type { HotkeyItemOptions, HotkeyItem } from './use-hotkeys/use-hotkeys';
|
|
67
|
+
export { useFullscreenDocument, useFullscreenElement } from './use-fullscreen/use-fullscreen';
|
|
68
|
+
export type { UseFullscreenElementReturnValue, UseFullscreenDocumentReturnValue, } from './use-fullscreen/use-fullscreen';
|
|
69
|
+
export { useLogger } from './use-logger/use-logger';
|
|
70
|
+
export { useHover } from './use-hover/use-hover';
|
|
71
|
+
export type { UseHoverReturnValue } from './use-hover/use-hover';
|
|
72
|
+
export { useValidatedState } from './use-validated-state/use-validated-state';
|
|
73
|
+
export type { UseValidatedStateValue, UseValidatedStateReturnValue, } from './use-validated-state/use-validated-state';
|
|
74
|
+
export { useOs } from './use-os/use-os';
|
|
75
|
+
export type { UseOSReturnValue, UseOsOptions } from './use-os/use-os';
|
|
76
|
+
export { useSetState } from './use-set-state/use-set-state';
|
|
77
|
+
export type { UseSetStateCallback, UseSetStateReturnValue } from './use-set-state/use-set-state';
|
|
78
|
+
export { useInputState } from './use-input-state/use-input-state';
|
|
79
|
+
export type { UseInputStateReturnValue } from './use-input-state/use-input-state';
|
|
80
|
+
export { useEventListener } from './use-event-listener/use-event-listener';
|
|
81
|
+
export { useDisclosure } from './use-disclosure/use-disclosure';
|
|
82
|
+
export type { UseDisclosureOptions, UseDisclosureHandlers, UseDisclosureReturnValue, } from './use-disclosure/use-disclosure';
|
|
83
|
+
export { useFocusWithin } from './use-focus-within/use-focus-within';
|
|
84
|
+
export type { UseFocusWithinOptions, UseFocusWithinReturnValue, } from './use-focus-within/use-focus-within';
|
|
85
|
+
export { useNetwork } from './use-network/use-network';
|
|
86
|
+
export type { UserNetworkReturnValue } from './use-network/use-network';
|
|
87
|
+
export { useTimeout } from './use-timeout/use-timeout';
|
|
88
|
+
export type { UseTimeoutOptions, UseTimeoutReturnValue } from './use-timeout/use-timeout';
|
|
89
|
+
export { useTextSelection } from './use-text-selection/use-text-selection';
|
|
90
|
+
export { usePrevious } from './use-previous/use-previous';
|
|
91
|
+
export { useFavicon } from './use-favicon/use-favicon';
|
|
92
|
+
export { useHeadroom, isFixed, isPinned, isReleased, isPinnedOrReleased, } from './use-headroom/use-headroom';
|
|
93
|
+
export type { UseHeadroomInput, UseHeadroomInput as UseHeadroomOptions, UseHeadroomReturnValue, } from './use-headroom/use-headroom';
|
|
94
|
+
export { useScrollDirection } from './use-scroll-direction/use-scroll-direction';
|
|
95
|
+
export type { ScrollDirection } from './use-scroll-direction/use-scroll-direction';
|
|
96
|
+
export { useEyeDropper } from './use-eye-dropper/use-eye-dropper';
|
|
97
|
+
export type { EyeDropperOpenOptions, EyeDropperOpenReturnType, UseEyeDropperReturnValue, } from './use-eye-dropper/use-eye-dropper';
|
|
98
|
+
export { useInViewport } from './use-in-viewport/use-in-viewport';
|
|
99
|
+
export type { UseInViewportReturnValue } from './use-in-viewport/use-in-viewport';
|
|
100
|
+
export { useMutationObserver, useMutationObserverTarget, } from './use-mutation-observer/use-mutation-observer';
|
|
101
|
+
export { useMounted } from './use-mounted/use-mounted';
|
|
102
|
+
export { useStateHistory } from './use-state-history/use-state-history';
|
|
103
|
+
export type { UseStateHistoryHandlers, UseStateHistoryValue, UseStateHistoryValue as StateHistory, UseStateHistoryReturnValue, } from './use-state-history/use-state-history';
|
|
104
|
+
export { useMap } from './use-map/use-map';
|
|
105
|
+
export { useSet, readonlySetLikeToSet } from './use-set/use-set';
|
|
106
|
+
export type { ReadonlySetLike } from './use-set/use-set';
|
|
107
|
+
export { useThrottledCallback } from './use-throttled-callback/use-throttled-callback';
|
|
108
|
+
export { useThrottledState } from './use-throttled-state/use-throttled-state';
|
|
109
|
+
export type { UseThrottledStateReturnValue } from './use-throttled-state/use-throttled-state';
|
|
110
|
+
export { useThrottledValue } from './use-throttled-value/use-throttled-value';
|
|
111
|
+
export { useIsFirstRender } from './use-is-first-render/use-is-first-render';
|
|
112
|
+
export { useOrientation } from './use-orientation/use-orientation';
|
|
113
|
+
export type { UseOrientationOptions, UseOrientationReturnType, } from './use-orientation/use-orientation';
|
|
114
|
+
export { useFetch } from './use-fetch/use-fetch';
|
|
115
|
+
export type { UseFetchOptions, UseFetchReturnValue } from './use-fetch/use-fetch';
|
|
116
|
+
export { useRadialMove, normalizeRadialValue } from './use-radial-move/use-radial-move';
|
|
117
|
+
export type { UseRadialMoveOptions, UseRadialMoveReturnValue, } from './use-radial-move/use-radial-move';
|
|
118
|
+
export { useScrollSpy } from './use-scroll-spy/use-scroll-spy';
|
|
119
|
+
export type { UseScrollSpyHeadingData, UseScrollSpyOptions } from './use-scroll-spy/use-scroll-spy';
|
|
120
|
+
export { useScroller } from './use-scroller/use-scroller';
|
|
121
|
+
export type { UseScrollerOptions, UseScrollerReturnValue, UseScrollerScrollState, } from './use-scroller/use-scroller';
|
|
122
|
+
export { useFileDialog } from './use-file-dialog/use-file-dialog';
|
|
123
|
+
export type { UseFileDialogOptions, UseFileDialogReturnValue, } from './use-file-dialog/use-file-dialog';
|
|
124
|
+
export { useLongPress } from './use-long-press/use-long-press';
|
|
125
|
+
export type { UseLongPressEvent, UseLongPressOptions, UseLongPressReturnValue, } from './use-long-press/use-long-press';
|
|
126
|
+
export { useSelection } from './use-selection/use-selection';
|
|
127
|
+
export type { UseSelectionHandlers, UseSelectionInput, UseSelectionReturnValue, } from './use-selection/use-selection';
|
|
128
|
+
export { useFloatingWindow } from './use-floating-window/use-floating-window';
|
|
129
|
+
export type { FloatingWindowPosition, FloatingWindowPositionConfig, SetFloatingWindowPosition, UseFloatingWindowOptions, } from './use-floating-window/use-floating-window';
|
|
130
|
+
export { useCollapse, createCollapse, getElementContentSize } from './use-collapse/use-collapse';
|
|
131
|
+
export type { UseCollapseInput, UseCollapseReturnValue, UseCollapseState, GetCollapsePropsInput, GetCollapsePropsReturnValue, } from './use-collapse/use-collapse';
|
|
132
|
+
export { useHorizontalCollapse } from './use-collapse/use-horizontal-collapse';
|
|
133
|
+
export type { UseHorizontalCollapseInput, UseHorizontalCollapseReturnValue, } from './use-collapse/use-horizontal-collapse';
|
|
134
|
+
export { useMask, formatMask, unformatMask, isMaskComplete, generatePattern, } from './use-mask/use-mask';
|
|
135
|
+
export type { UseMaskOptions, UseMaskReturnValue, MaskState } from './use-mask/use-mask';
|
|
136
|
+
export { useRovingIndex } from './use-roving-index/use-roving-index';
|
|
137
|
+
export type { UseRovingIndexInput, UseRovingIndexGetItemPropsInput, UseRovingIndexReturnValue, } from './use-roving-index/use-roving-index';
|
|
138
|
+
export { useDrag } from './use-drag/use-drag';
|
|
139
|
+
export type { UseDragState, UseDragOptions, UseDragReturnValue } from './use-drag/use-drag';
|
|
140
|
+
export { useSplitter } from './use-splitter/use-splitter';
|
|
141
|
+
export type { UseSplitterPanel, UseSplitterOptions, UseSplitterReturnValue, UseSplitterRedistributeInput, UseSplitterRedistributeFn, } from './use-splitter/use-splitter';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type MaybeRefOrGetter, type Ref } from 'vue';
|
|
2
|
+
type OutsideEvent = MouseEvent | TouchEvent;
|
|
3
|
+
export declare function useClickOutside<T extends HTMLElement = HTMLElement>(callback: (event: OutsideEvent) => void, events?: MaybeRefOrGetter<string[] | null | undefined>, nodes?: MaybeRefOrGetter<Array<HTMLElement | null | undefined>>, enabled?: MaybeRefOrGetter<boolean>): Ref<T | null>;
|
|
4
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
export interface UseClipboardInput {
|
|
3
|
+
timeout?: number;
|
|
4
|
+
}
|
|
5
|
+
export interface UseClipboardReturnValue {
|
|
6
|
+
copy: (value: string) => Promise<void>;
|
|
7
|
+
copied: Ref<boolean>;
|
|
8
|
+
reset: () => void;
|
|
9
|
+
error: Ref<Error | null>;
|
|
10
|
+
}
|
|
11
|
+
export declare function useClipboard({ timeout }?: UseClipboardInput): UseClipboardReturnValue;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type CSSProperties, type MaybeRefOrGetter, type Ref } from 'vue';
|
|
2
|
+
import { type VueRefTarget } from '../use-merged-ref/use-merged-ref';
|
|
3
|
+
export type UseCollapseState = 'entering' | 'entered' | 'exiting' | 'exited';
|
|
4
|
+
export interface UseCollapseInput {
|
|
5
|
+
/** Expanded state */
|
|
6
|
+
expanded: MaybeRefOrGetter<boolean>;
|
|
7
|
+
/** Transition duration in milliseconds, by default calculated based on content height */
|
|
8
|
+
transitionDuration?: number;
|
|
9
|
+
/** Transition timing function, `ease` by default */
|
|
10
|
+
transitionTimingFunction?: string;
|
|
11
|
+
/** Called when transition ends */
|
|
12
|
+
onTransitionEnd?: () => void;
|
|
13
|
+
/** Called when transition starts */
|
|
14
|
+
onTransitionStart?: () => void;
|
|
15
|
+
/** If true, collapsed content is kept in the DOM and hidden with `display: none` styles */
|
|
16
|
+
keepMounted?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface GetCollapsePropsInput {
|
|
19
|
+
style?: CSSProperties;
|
|
20
|
+
ref?: VueRefTarget<HTMLDivElement>;
|
|
21
|
+
}
|
|
22
|
+
export interface GetCollapsePropsReturnValue {
|
|
23
|
+
'aria-hidden': boolean;
|
|
24
|
+
inert: boolean;
|
|
25
|
+
ref: (value: any) => void;
|
|
26
|
+
onTransitionend: (event: TransitionEvent) => void;
|
|
27
|
+
style: CSSProperties;
|
|
28
|
+
}
|
|
29
|
+
export interface UseCollapseReturnValue {
|
|
30
|
+
state: Ref<UseCollapseState>;
|
|
31
|
+
getCollapseProps: (input?: GetCollapsePropsInput) => GetCollapsePropsReturnValue;
|
|
32
|
+
}
|
|
33
|
+
export declare function getElementContentSize(element: HTMLElement | null, dimension: 'height' | 'width'): number | string;
|
|
34
|
+
export declare function createCollapse({ dimension, getElementSize, expanded, transitionDuration, transitionTimingFunction, onTransitionEnd, onTransitionStart, keepMounted, }: UseCollapseInput & {
|
|
35
|
+
dimension: 'height' | 'width';
|
|
36
|
+
getElementSize: (element: HTMLElement | null) => number | string;
|
|
37
|
+
}): UseCollapseReturnValue;
|
|
38
|
+
export declare function useCollapse(input: UseCollapseInput): UseCollapseReturnValue;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type UseCollapseInput, type UseCollapseReturnValue } from './use-collapse';
|
|
2
|
+
export type UseHorizontalCollapseInput = UseCollapseInput;
|
|
3
|
+
export type UseHorizontalCollapseReturnValue = UseCollapseReturnValue;
|
|
4
|
+
export declare function useHorizontalCollapse(input: UseCollapseInput): UseCollapseReturnValue;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
import { type UseMediaQueryOptions } from '../use-media-query/use-media-query';
|
|
3
|
+
export type UseColorSchemeValue = 'dark' | 'light';
|
|
4
|
+
export declare function useColorScheme(initialValue?: UseColorSchemeValue, options?: UseMediaQueryOptions): Readonly<Ref<UseColorSchemeValue>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
export interface UseCounterOptions {
|
|
3
|
+
min?: number;
|
|
4
|
+
max?: number;
|
|
5
|
+
step?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface UseCounterHandlers {
|
|
8
|
+
increment: () => void;
|
|
9
|
+
decrement: () => void;
|
|
10
|
+
set: (value: number | ((current: number) => number)) => void;
|
|
11
|
+
reset: () => void;
|
|
12
|
+
}
|
|
13
|
+
export type UseCounterReturnValue = [Ref<number>, UseCounterHandlers];
|
|
14
|
+
export declare function useCounter(initialValue?: number, options?: UseCounterOptions): UseCounterReturnValue;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface UseDebouncedCallbackOptions {
|
|
2
|
+
delay: number;
|
|
3
|
+
flushOnUnmount?: boolean;
|
|
4
|
+
leading?: boolean;
|
|
5
|
+
maxWait?: number;
|
|
6
|
+
}
|
|
7
|
+
export type UseDebouncedCallbackReturnValue<Args extends unknown[]> = ((...args: Args) => void) & {
|
|
8
|
+
cancel: () => void;
|
|
9
|
+
flush: () => void;
|
|
10
|
+
isPending: () => boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare function useDebouncedCallback<Args extends unknown[]>(callback: (...args: Args) => void, waitOrOptions: number | UseDebouncedCallbackOptions): UseDebouncedCallbackReturnValue<Args>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
export interface UseDebouncedStateOptions {
|
|
3
|
+
leading?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export type UseDebouncedStateReturnValue<T> = [Ref<T>, (nextValue: T | ((value: T) => T)) => void];
|
|
6
|
+
export declare function useDebouncedState<T>(initialValue: T, wait: number, options?: UseDebouncedStateOptions): UseDebouncedStateReturnValue<T>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type MaybeRefOrGetter, type Ref } from 'vue';
|
|
2
|
+
export interface UseDebouncedValueOptions {
|
|
3
|
+
leading?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export type UseDebouncedValueHandlers = {
|
|
6
|
+
cancel: () => void;
|
|
7
|
+
flush: () => void;
|
|
8
|
+
};
|
|
9
|
+
export type UseDebouncedValueReturnValue<T> = [
|
|
10
|
+
Readonly<Ref<T>>,
|
|
11
|
+
() => void,
|
|
12
|
+
UseDebouncedValueHandlers
|
|
13
|
+
];
|
|
14
|
+
export declare function useDebouncedValue<T>(value: MaybeRefOrGetter<T>, wait: number, options?: UseDebouncedValueOptions): UseDebouncedValueReturnValue<T>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
export interface UseDisclosureOptions {
|
|
3
|
+
onOpen?: () => void;
|
|
4
|
+
onClose?: () => void;
|
|
5
|
+
}
|
|
6
|
+
export interface UseDisclosureHandlers {
|
|
7
|
+
set: (value: boolean) => void;
|
|
8
|
+
open: () => void;
|
|
9
|
+
close: () => void;
|
|
10
|
+
toggle: () => void;
|
|
11
|
+
}
|
|
12
|
+
export type UseDisclosureReturnValue = [Ref<boolean>, UseDisclosureHandlers];
|
|
13
|
+
export declare function useDisclosure(initialState?: boolean, options?: UseDisclosureOptions): UseDisclosureReturnValue;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
type Vector2 = [number, number];
|
|
3
|
+
export interface UseDragState {
|
|
4
|
+
/** Current pointer position [x, y] */
|
|
5
|
+
xy: Vector2;
|
|
6
|
+
/** Position where the gesture started [x, y] */
|
|
7
|
+
initial: Vector2;
|
|
8
|
+
/** Displacement from start [x, y], respects axis constraint */
|
|
9
|
+
movement: Vector2;
|
|
10
|
+
/** Change since previous event [x, y] */
|
|
11
|
+
delta: Vector2;
|
|
12
|
+
/** Absolute distance per axis [x, y] */
|
|
13
|
+
distance: Vector2;
|
|
14
|
+
/** Movement direction per axis: -1, 0, or 1 */
|
|
15
|
+
direction: Vector2;
|
|
16
|
+
/** Speed per axis in px/ms */
|
|
17
|
+
velocity: Vector2;
|
|
18
|
+
/** Time since drag started in ms */
|
|
19
|
+
elapsedTime: number;
|
|
20
|
+
/** `true` on the first handler call after the threshold is met */
|
|
21
|
+
first: boolean;
|
|
22
|
+
/** `true` on the last handler call (pointer released or canceled) */
|
|
23
|
+
last: boolean;
|
|
24
|
+
/** `true` while the gesture is ongoing */
|
|
25
|
+
active: boolean;
|
|
26
|
+
/** `true` when the gesture qualifies as a tap (requires `filterTaps: true`) */
|
|
27
|
+
tap: boolean;
|
|
28
|
+
/** `true` when the gesture was interrupted by a `pointercancel` event */
|
|
29
|
+
canceled: boolean;
|
|
30
|
+
/** Function to programmatically cancel the current gesture */
|
|
31
|
+
cancel: () => void;
|
|
32
|
+
/** The source `PointerEvent` */
|
|
33
|
+
event: PointerEvent;
|
|
34
|
+
}
|
|
35
|
+
export interface UseDragOptions {
|
|
36
|
+
/** Constrain movement to a specific axis. `'lock'` locks to whichever axis has more movement after `axisThreshold` is exceeded. */
|
|
37
|
+
axis?: 'x' | 'y' | 'lock';
|
|
38
|
+
/** Movement in px required to determine axis when `axis` is `'lock'`, `1` by default */
|
|
39
|
+
axisThreshold?: number;
|
|
40
|
+
/** When `true`, the last state includes `tap: true` when total distance is below `tapThreshold`, `false` by default */
|
|
41
|
+
filterTaps?: boolean;
|
|
42
|
+
/** Max displacement in px to still be considered a tap, `3` by default */
|
|
43
|
+
tapThreshold?: number;
|
|
44
|
+
/** Minimum displacement in px before the drag activates. Can be a number (both axes) or `[x, y]`. `0` by default */
|
|
45
|
+
threshold?: number | Vector2;
|
|
46
|
+
/** Enable or disable the hook, `true` by default */
|
|
47
|
+
enabled?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface UseDragReturnValue<T extends HTMLElement = any> {
|
|
50
|
+
/** Ref callback to attach to the draggable element */
|
|
51
|
+
ref: (node: T | null) => void;
|
|
52
|
+
/** `true` while the element is being dragged */
|
|
53
|
+
active: Ref<boolean>;
|
|
54
|
+
}
|
|
55
|
+
export declare function useDrag<T extends HTMLElement = any>(handler: (state: UseDragState) => void, options?: UseDragOptions): UseDragReturnValue<T>;
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
export declare function useEventListener<K extends keyof HTMLElementEventMap, T extends HTMLElement = HTMLElement>(type: K, listener: (this: T, ev: HTMLElementEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): Ref<T | null>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
export interface EyeDropperOpenOptions {
|
|
3
|
+
signal?: AbortSignal;
|
|
4
|
+
}
|
|
5
|
+
export interface EyeDropperOpenReturnType {
|
|
6
|
+
sRGBHex: string;
|
|
7
|
+
}
|
|
8
|
+
export interface UseEyeDropperReturnValue {
|
|
9
|
+
supported: Ref<boolean>;
|
|
10
|
+
open: (options?: EyeDropperOpenOptions) => Promise<EyeDropperOpenReturnType | undefined>;
|
|
11
|
+
}
|
|
12
|
+
export declare function useEyeDropper(): UseEyeDropperReturnValue;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type MaybeRefOrGetter, type Ref } from 'vue';
|
|
2
|
+
export interface UseFetchOptions extends RequestInit {
|
|
3
|
+
autoInvoke?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface UseFetchReturnValue<T> {
|
|
6
|
+
data: Ref<T | null>;
|
|
7
|
+
loading: Ref<boolean>;
|
|
8
|
+
error: Ref<Error | null>;
|
|
9
|
+
refetch: () => Promise<any>;
|
|
10
|
+
abort: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function useFetch<T>(url: MaybeRefOrGetter<string>, { autoInvoke, ...options }?: UseFetchOptions): UseFetchReturnValue<T>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type Ref } from 'vue';
|
|
2
|
+
export interface UseFileDialogOptions {
|
|
3
|
+
/** Determines whether multiple files are allowed, `true` by default */
|
|
4
|
+
multiple?: boolean;
|
|
5
|
+
/** `accept` attribute of the file input, '*' by default */
|
|
6
|
+
accept?: string;
|
|
7
|
+
/** `capture` attribute of the file input */
|
|
8
|
+
capture?: string;
|
|
9
|
+
/** Determines whether the user can pick a directory instead of file, `false` by default */
|
|
10
|
+
directory?: boolean;
|
|
11
|
+
/** Determines whether the file input state should be reset when the file dialog is opened, `false` by default */
|
|
12
|
+
resetOnOpen?: boolean;
|
|
13
|
+
/** Initial selected files */
|
|
14
|
+
initialFiles?: FileList | File[];
|
|
15
|
+
/** Called when files are selected */
|
|
16
|
+
onChange?: (files: FileList | null) => void;
|
|
17
|
+
/** Called when file dialog is canceled */
|
|
18
|
+
onCancel?: () => void;
|
|
19
|
+
}
|
|
20
|
+
export interface UseFileDialogReturnValue {
|
|
21
|
+
files: Ref<FileList | null>;
|
|
22
|
+
open: () => void;
|
|
23
|
+
reset: () => void;
|
|
24
|
+
}
|
|
25
|
+
export declare function useFileDialog(input?: UseFileDialogOptions): UseFileDialogReturnValue;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ComponentPublicInstance, type Ref } from 'vue';
|
|
2
|
+
export interface FloatingWindowPositionConfig {
|
|
3
|
+
top?: number;
|
|
4
|
+
left?: number;
|
|
5
|
+
right?: number;
|
|
6
|
+
bottom?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface FloatingWindowPosition {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
}
|
|
12
|
+
export interface UseFloatingWindowOptions {
|
|
13
|
+
enabled?: boolean;
|
|
14
|
+
constrainToViewport?: boolean;
|
|
15
|
+
constrainOffset?: number;
|
|
16
|
+
dragHandleSelector?: string;
|
|
17
|
+
excludeDragHandleSelector?: string;
|
|
18
|
+
axis?: 'x' | 'y';
|
|
19
|
+
initialPosition?: FloatingWindowPositionConfig;
|
|
20
|
+
onPositionChange?: (position: FloatingWindowPosition) => void;
|
|
21
|
+
onDragStart?: () => void;
|
|
22
|
+
onDragEnd?: () => void;
|
|
23
|
+
}
|
|
24
|
+
export type SetFloatingWindowPosition = (position: FloatingWindowPositionConfig) => void;
|
|
25
|
+
export declare function useFloatingWindow<T extends HTMLElement>(options?: UseFloatingWindowOptions): {
|
|
26
|
+
ref: (node: Element | ComponentPublicInstance | null) => void;
|
|
27
|
+
element: Readonly<Ref<import("vue").DeepReadonly<T> | null, import("vue").DeepReadonly<T> | null>>;
|
|
28
|
+
isDragging: Readonly<Ref<boolean, boolean>>;
|
|
29
|
+
setPosition: SetFloatingWindowPosition;
|
|
30
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type MaybeRefOrGetter } from 'vue';
|
|
2
|
+
export interface UseFocusReturnInput {
|
|
3
|
+
opened: MaybeRefOrGetter<boolean>;
|
|
4
|
+
shouldReturnFocus?: MaybeRefOrGetter<boolean>;
|
|
5
|
+
}
|
|
6
|
+
export declare function useFocusReturn({ opened, shouldReturnFocus }: UseFocusReturnInput): () => void | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function scopeTab(node: HTMLElement, event: KeyboardEvent): void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const FOCUS_SELECTOR = "a, input, select, textarea, button, object, [tabindex]";
|
|
2
|
+
export declare function focusable(element: HTMLElement): boolean;
|
|
3
|
+
export declare function tabbable(element: HTMLElement): boolean;
|
|
4
|
+
export declare function findTabbableDescendants(element: HTMLElement): HTMLElement[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import { scopeTab } from './scope-tab';
|
|
3
|
+
export declare function useFocusTrap(active?: MaybeRefOrGetter<boolean>): (node: any) => void;
|
|
4
|
+
export { scopeTab };
|
|
5
|
+
export { FOCUS_SELECTOR, findTabbableDescendants, focusable, tabbable } from './tabbable';
|