@pzerelles/headlessui-svelte 2.1.1-next.1 → 2.1.2-next.11
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/button/Button.svelte +6 -10
- package/dist/button/Button.svelte.d.ts +34 -26
- package/dist/checkbox/Checkbox.svelte +43 -25
- package/dist/checkbox/Checkbox.svelte.d.ts +42 -28
- package/dist/close-button/CloseButton.svelte +5 -4
- package/dist/close-button/CloseButton.svelte.d.ts +36 -13
- package/dist/combobox/Combobox.svelte +2 -2
- package/dist/combobox/Combobox.svelte.d.ts +9 -9
- package/dist/data-interactive/DataInteractive.svelte +41 -0
- package/dist/data-interactive/DataInteractive.svelte.d.ts +39 -0
- package/dist/data-interactive/index.d.ts +1 -0
- package/dist/data-interactive/index.js +1 -0
- package/dist/description/Description.svelte +10 -53
- package/dist/description/Description.svelte.d.ts +15 -32
- package/dist/description/context.svelte.d.ts +17 -0
- package/dist/description/context.svelte.js +51 -0
- package/dist/dialog/Dialog.svelte +51 -0
- package/dist/dialog/Dialog.svelte.d.ts +60 -0
- package/dist/dialog/DialogBackdrop.svelte +39 -0
- package/dist/dialog/DialogBackdrop.svelte.d.ts +38 -0
- package/dist/dialog/DialogPanel.svelte +46 -0
- package/dist/dialog/DialogPanel.svelte.d.ts +40 -0
- package/dist/dialog/DialogTitle.svelte +29 -0
- package/dist/dialog/DialogTitle.svelte.d.ts +34 -0
- package/dist/dialog/InternalDialog.svelte +233 -0
- package/dist/dialog/InternalDialog.svelte.d.ts +42 -0
- package/dist/dialog/context.svelte.d.ts +15 -0
- package/dist/dialog/context.svelte.js +16 -0
- package/dist/dialog/index.d.ts +4 -0
- package/dist/dialog/index.js +4 -0
- package/dist/field/Field.svelte +8 -11
- package/dist/field/Field.svelte.d.ts +21 -17
- package/dist/fieldset/Fieldset.svelte +11 -9
- package/dist/fieldset/Fieldset.svelte.d.ts +21 -17
- package/dist/focus-trap/FocusTrap.svelte +325 -0
- package/dist/focus-trap/FocusTrap.svelte.d.ts +46 -0
- package/dist/focus-trap/FocusTrapFeatures.d.ts +14 -0
- package/dist/focus-trap/FocusTrapFeatures.js +15 -0
- package/dist/hooks/use-controllable.svelte.d.ts +1 -1
- package/dist/hooks/use-controllable.svelte.js +3 -3
- package/dist/hooks/use-did-element-move.svelte.js +5 -10
- package/dist/hooks/use-escape.svelte.d.ts +5 -0
- package/dist/hooks/use-escape.svelte.js +26 -0
- package/dist/hooks/use-event-listener.svelte.d.ts +6 -0
- package/dist/hooks/use-event-listener.svelte.js +12 -0
- package/dist/hooks/use-inert-others.svelte.d.ts +2 -2
- package/dist/hooks/use-inert-others.svelte.js +3 -3
- package/dist/hooks/use-is-mounted.svelte.d.ts +3 -0
- package/dist/hooks/use-is-mounted.svelte.js +14 -0
- package/dist/hooks/use-is-touch-device.svelte.d.ts +3 -0
- package/dist/hooks/use-is-touch-device.svelte.js +20 -0
- package/dist/hooks/use-root-containers.svelte.d.ts +9 -0
- package/dist/hooks/use-root-containers.svelte.js +50 -0
- package/dist/hooks/use-tab-direction.svelte.d.ts +7 -0
- package/dist/hooks/use-tab-direction.svelte.js +25 -0
- package/dist/hooks/use-transition.svelte.js +14 -13
- package/dist/hooks/use-tree-walker.svelte.d.ts +8 -0
- package/dist/hooks/use-tree-walker.svelte.js +19 -0
- package/dist/hooks/use-watch.svelte.d.ts +4 -0
- package/dist/hooks/use-watch.svelte.js +16 -0
- package/dist/hooks/use-window-event.svelte.d.ts +6 -0
- package/dist/hooks/use-window-event.svelte.js +12 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +10 -0
- package/dist/input/Input.svelte +59 -0
- package/dist/input/Input.svelte.d.ts +50 -0
- package/dist/input/index.d.ts +1 -0
- package/dist/input/index.js +1 -0
- package/dist/internal/FloatingProvider.svelte +12 -0
- package/dist/internal/FloatingProvider.svelte.d.ts +22 -0
- package/dist/internal/FocusSentinel.svelte.d.ts +4 -1
- package/dist/internal/ForcePortalRoot.svelte +6 -0
- package/dist/internal/ForcePortalRoot.svelte.d.ts +22 -0
- package/dist/internal/FormFields.svelte.d.ts +4 -1
- package/dist/internal/FormResolver.svelte.d.ts +4 -1
- package/dist/internal/Hidden.svelte +6 -14
- package/dist/internal/Hidden.svelte.d.ts +19 -15
- package/dist/internal/HiddenFeatures.d.ts +5 -0
- package/dist/internal/HiddenFeatures.js +9 -0
- package/dist/internal/HoistFormFields.svelte.d.ts +4 -1
- package/dist/internal/MainTreeProvider.svelte +45 -0
- package/dist/internal/MainTreeProvider.svelte.d.ts +31 -0
- package/dist/internal/Portal.svelte.d.ts +4 -1
- package/dist/internal/close-provider.d.ts +7 -0
- package/dist/internal/close-provider.js +7 -0
- package/dist/internal/floating-provider.svelte.d.ts +3 -0
- package/dist/internal/floating-provider.svelte.js +206 -0
- package/dist/internal/floating.svelte.d.ts +50 -20
- package/dist/internal/floating.svelte.js +100 -271
- package/dist/internal/inner.svelte.d.ts +91 -0
- package/dist/internal/inner.svelte.js +202 -0
- package/dist/internal/open-closed.d.ts +1 -1
- package/dist/internal/open-closed.js +1 -1
- package/dist/label/Label.svelte +17 -65
- package/dist/label/Label.svelte.d.ts +19 -32
- package/dist/label/context.svelte.d.ts +17 -0
- package/dist/label/context.svelte.js +56 -0
- package/dist/legend/Legend.svelte +4 -3
- package/dist/legend/Legend.svelte.d.ts +33 -15
- package/dist/listbox/Listbox.svelte +40 -74
- package/dist/listbox/Listbox.svelte.d.ts +30 -72
- package/dist/listbox/ListboxButton.svelte +16 -18
- package/dist/listbox/ListboxButton.svelte.d.ts +16 -7
- package/dist/listbox/ListboxOption.svelte +10 -10
- package/dist/listbox/ListboxOption.svelte.d.ts +22 -11
- package/dist/listbox/ListboxOptions.svelte +62 -60
- package/dist/listbox/ListboxOptions.svelte.d.ts +23 -7
- package/dist/listbox/ListboxSelectedOption.svelte +15 -7
- package/dist/listbox/ListboxSelectedOption.svelte.d.ts +24 -14
- package/dist/listbox/context.svelte.d.ts +75 -0
- package/dist/listbox/context.svelte.js +36 -0
- package/dist/menu/Menu.svelte +235 -0
- package/dist/menu/Menu.svelte.d.ts +42 -0
- package/dist/menu/MenuButton.svelte +129 -0
- package/dist/menu/MenuButton.svelte.d.ts +52 -0
- package/dist/menu/MenuHeading.svelte +19 -0
- package/dist/menu/MenuHeading.svelte.d.ts +39 -0
- package/dist/menu/MenuItem.svelte +114 -0
- package/dist/menu/MenuItem.svelte.d.ts +49 -0
- package/dist/menu/MenuItems.svelte +248 -0
- package/dist/menu/MenuItems.svelte.d.ts +55 -0
- package/dist/menu/MenuSection.svelte +14 -0
- package/dist/menu/MenuSection.svelte.d.ts +35 -0
- package/dist/menu/MenuSeparator.svelte +9 -0
- package/dist/menu/MenuSeparator.svelte.d.ts +35 -0
- package/dist/menu/context.svelte.d.ts +47 -0
- package/dist/menu/context.svelte.js +21 -0
- package/dist/menu/index.d.ts +7 -0
- package/dist/menu/index.js +7 -0
- package/dist/portal/InternalPortal.svelte +22 -33
- package/dist/portal/InternalPortal.svelte.d.ts +16 -7
- package/dist/portal/Portal.svelte +4 -8
- package/dist/portal/Portal.svelte.d.ts +6 -6
- package/dist/portal/PortalGroup.svelte +5 -6
- package/dist/portal/PortalGroup.svelte.d.ts +16 -7
- package/dist/switch/Switch.svelte +41 -37
- package/dist/switch/Switch.svelte.d.ts +24 -7
- package/dist/switch/SwitchGroup.svelte +7 -8
- package/dist/switch/SwitchGroup.svelte.d.ts +14 -7
- package/dist/tabs/Tab.svelte +9 -14
- package/dist/tabs/Tab.svelte.d.ts +18 -6
- package/dist/tabs/TabGroup.svelte +20 -23
- package/dist/tabs/TabGroup.svelte.d.ts +19 -6
- package/dist/tabs/TabList.svelte +5 -7
- package/dist/tabs/TabList.svelte.d.ts +13 -6
- package/dist/tabs/TabPanel.svelte +30 -32
- package/dist/tabs/TabPanel.svelte.d.ts +19 -6
- package/dist/tabs/TabPanels.svelte +5 -6
- package/dist/tabs/TabPanels.svelte.d.ts +13 -6
- package/dist/textarea/Textarea.svelte +67 -0
- package/dist/textarea/Textarea.svelte.d.ts +50 -0
- package/dist/textarea/index.d.ts +1 -0
- package/dist/textarea/index.js +1 -0
- package/dist/transition/InternalTransitionChild.svelte +178 -0
- package/dist/transition/InternalTransitionChild.svelte.d.ts +55 -0
- package/dist/transition/Transition.svelte +89 -0
- package/dist/transition/Transition.svelte.d.ts +42 -0
- package/dist/transition/TransitionChild.svelte +16 -0
- package/dist/transition/TransitionChild.svelte.d.ts +44 -0
- package/dist/transition/context.svelte.d.ts +64 -0
- package/dist/transition/context.svelte.js +120 -0
- package/dist/transition/index.d.ts +2 -0
- package/dist/transition/index.js +2 -0
- package/dist/utils/ElementOrComponent.svelte +26 -0
- package/dist/utils/ElementOrComponent.svelte.d.ts +56 -0
- package/dist/utils/Generic.svelte +44 -0
- package/dist/utils/Generic.svelte.d.ts +35 -0
- package/dist/utils/StableCollection.svelte +1 -1
- package/dist/utils/StableCollection.svelte.d.ts +4 -1
- package/dist/utils/active-element-history.d.ts +1 -0
- package/dist/utils/active-element-history.js +35 -0
- package/dist/utils/alternative-types.d.ts +21 -0
- package/dist/utils/alternative-types.js +1 -0
- package/dist/utils/class-names.d.ts +1 -0
- package/dist/utils/class-names.js +10 -0
- package/dist/utils/floating-ui/svelte/components/FloatingNode.svelte +17 -0
- package/dist/utils/floating-ui/svelte/components/FloatingNode.svelte.d.ts +23 -0
- package/dist/utils/floating-ui/svelte/components/FloatingTree.svelte +50 -0
- package/dist/utils/floating-ui/svelte/components/FloatingTree.svelte.d.ts +41 -0
- package/dist/utils/floating-ui/svelte/hooks/useFloating.svelte.d.ts +6 -0
- package/dist/utils/floating-ui/svelte/hooks/useFloating.svelte.js +158 -0
- package/dist/utils/floating-ui/svelte/hooks/useFloatingRootContext.svelte.d.ts +11 -0
- package/dist/utils/floating-ui/svelte/hooks/useFloatingRootContext.svelte.js +53 -0
- package/dist/utils/floating-ui/svelte/hooks/useId.svelte.d.ts +9 -0
- package/dist/utils/floating-ui/svelte/hooks/useId.svelte.js +28 -0
- package/dist/utils/floating-ui/svelte/hooks/useInteractions.svelte.d.ts +23 -0
- package/dist/utils/floating-ui/svelte/hooks/useInteractions.svelte.js +72 -0
- package/dist/utils/floating-ui/svelte/index.d.ts +5 -0
- package/dist/utils/floating-ui/svelte/index.js +5 -0
- package/dist/utils/floating-ui/svelte/inner.svelte.d.ts +83 -0
- package/dist/utils/floating-ui/svelte/inner.svelte.js +178 -0
- package/dist/utils/floating-ui/svelte/types.d.ts +114 -0
- package/dist/utils/floating-ui/svelte/types.js +1 -0
- package/dist/utils/floating-ui/svelte/utils/createPubSub.d.ts +5 -0
- package/dist/utils/floating-ui/svelte/utils/createPubSub.js +14 -0
- package/dist/utils/floating-ui/svelte/utils/getFloatingFocusElement.d.ts +2 -0
- package/dist/utils/floating-ui/svelte/utils/getFloatingFocusElement.js +13 -0
- package/dist/utils/floating-ui/svelte/utils/log.d.ts +2 -0
- package/dist/utils/floating-ui/svelte/utils/log.js +19 -0
- package/dist/utils/floating-ui/svelte/utils.d.ts +19 -0
- package/dist/utils/floating-ui/svelte/utils.js +136 -0
- package/dist/utils/floating-ui/svelte-dom/arrow.d.ts +22 -0
- package/dist/utils/floating-ui/svelte-dom/arrow.js +29 -0
- package/dist/utils/floating-ui/svelte-dom/index.d.ts +2 -0
- package/dist/utils/floating-ui/svelte-dom/index.js +2 -0
- package/dist/utils/floating-ui/svelte-dom/types.d.ts +80 -0
- package/dist/utils/floating-ui/svelte-dom/types.js +3 -0
- package/dist/utils/floating-ui/svelte-dom/useFloating.svelte.d.ts +6 -0
- package/dist/utils/floating-ui/svelte-dom/useFloating.svelte.js +183 -0
- package/dist/utils/floating-ui/svelte-dom/utils/deepEqual.d.ts +1 -0
- package/dist/utils/floating-ui/svelte-dom/utils/deepEqual.js +50 -0
- package/dist/utils/floating-ui/svelte-dom/utils/getDPR.d.ts +1 -0
- package/dist/utils/floating-ui/svelte-dom/utils/getDPR.js +7 -0
- package/dist/utils/floating-ui/svelte-dom/utils/roundByDPR.d.ts +1 -0
- package/dist/utils/floating-ui/svelte-dom/utils/roundByDPR.js +5 -0
- package/dist/utils/floating-ui/svelte-dom/utils/useLatestRef.d.ts +4 -0
- package/dist/utils/floating-ui/svelte-dom/utils/useLatestRef.js +7 -0
- package/dist/utils/focus-management.d.ts +2 -1
- package/dist/utils/focus-management.js +13 -13
- package/dist/utils/id.d.ts +1 -1
- package/dist/utils/id.js +1 -1
- package/dist/utils/on-document-ready.d.ts +1 -0
- package/dist/utils/on-document-ready.js +12 -0
- package/dist/utils/render.d.ts +3 -0
- package/dist/utils/render.js +63 -0
- package/dist/utils/state.d.ts +7 -1
- package/dist/utils/state.js +10 -6
- package/dist/utils/style.d.ts +2 -0
- package/dist/utils/style.js +6 -0
- package/dist/utils/types.d.ts +14 -17
- package/dist/utils/types.js +0 -5
- package/package.json +33 -31
- package/dist/internal/id.d.ts +0 -8
- package/dist/internal/id.js +0 -11
- package/dist/tabs/Button.svelte +0 -65
- package/dist/tabs/Button.svelte.d.ts +0 -39
- package/dist/utils/close.d.ts +0 -2
- package/dist/utils/close.js +0 -3
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
|
+
import type { ElementProps } from "../types.js";
|
|
3
|
+
declare const ACTIVE_KEY = "active";
|
|
4
|
+
declare const SELECTED_KEY = "selected";
|
|
5
|
+
export type ExtendedUserProps = {
|
|
6
|
+
[ACTIVE_KEY]?: boolean;
|
|
7
|
+
[SELECTED_KEY]?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export interface UseInteractionsReturn {
|
|
10
|
+
getReferenceProps: (userProps?: HTMLAttributes<Element>) => Record<string, unknown>;
|
|
11
|
+
getFloatingProps: (userProps?: HTMLAttributes<HTMLElement>) => Record<string, unknown>;
|
|
12
|
+
getItemProps: (userProps?: Omit<HTMLAttributes<HTMLElement>, "selected" | "active"> & ExtendedUserProps) => Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Merges an array of interaction hooks' props into prop getters, allowing
|
|
16
|
+
* event handler functions to be composed together without overwriting one
|
|
17
|
+
* another.
|
|
18
|
+
* @see https://floating-ui.com/docs/useInteractions
|
|
19
|
+
*/
|
|
20
|
+
export declare function useInteractions(options?: {
|
|
21
|
+
propsList: Array<ElementProps | void>;
|
|
22
|
+
}): UseInteractionsReturn;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { FOCUSABLE_ATTRIBUTE } from "../utils/getFloatingFocusElement.js";
|
|
2
|
+
const ACTIVE_KEY = "active";
|
|
3
|
+
const SELECTED_KEY = "selected";
|
|
4
|
+
function mergeProps(userProps, propsList, elementKey) {
|
|
5
|
+
const map = new Map();
|
|
6
|
+
const isItem = elementKey === "item";
|
|
7
|
+
let domUserProps = userProps;
|
|
8
|
+
if (isItem && userProps) {
|
|
9
|
+
const { [ACTIVE_KEY]: _, [SELECTED_KEY]: __, ...validProps } = userProps;
|
|
10
|
+
domUserProps = validProps;
|
|
11
|
+
}
|
|
12
|
+
return {
|
|
13
|
+
...(elementKey === "floating" && {
|
|
14
|
+
tabIndex: -1,
|
|
15
|
+
[FOCUSABLE_ATTRIBUTE]: "",
|
|
16
|
+
}),
|
|
17
|
+
...domUserProps,
|
|
18
|
+
...propsList
|
|
19
|
+
.map((value) => {
|
|
20
|
+
const propsOrGetProps = value ? value[elementKey] : null;
|
|
21
|
+
if (typeof propsOrGetProps === "function") {
|
|
22
|
+
return userProps ? propsOrGetProps(userProps) : null;
|
|
23
|
+
}
|
|
24
|
+
return propsOrGetProps;
|
|
25
|
+
})
|
|
26
|
+
.concat(userProps)
|
|
27
|
+
.reduce((acc, props) => {
|
|
28
|
+
if (!props) {
|
|
29
|
+
return acc;
|
|
30
|
+
}
|
|
31
|
+
Object.entries(props).forEach(([key, value]) => {
|
|
32
|
+
if (isItem && [ACTIVE_KEY, SELECTED_KEY].includes(key)) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (key.indexOf("on") === 0) {
|
|
36
|
+
if (!map.has(key)) {
|
|
37
|
+
map.set(key, []);
|
|
38
|
+
}
|
|
39
|
+
if (typeof value === "function") {
|
|
40
|
+
map.get(key)?.push(value);
|
|
41
|
+
acc[key] = (...args) => {
|
|
42
|
+
return map
|
|
43
|
+
.get(key)
|
|
44
|
+
?.map((fn) => fn(...args))
|
|
45
|
+
.find((val) => val !== undefined);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
acc[key] = value;
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
return acc;
|
|
54
|
+
}, {}),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Merges an array of interaction hooks' props into prop getters, allowing
|
|
59
|
+
* event handler functions to be composed together without overwriting one
|
|
60
|
+
* another.
|
|
61
|
+
* @see https://floating-ui.com/docs/useInteractions
|
|
62
|
+
*/
|
|
63
|
+
export function useInteractions(options = { propsList: [] }) {
|
|
64
|
+
const { propsList } = $derived(options);
|
|
65
|
+
//const referenceDeps = $derived(propsList.map((key) => key?.reference))
|
|
66
|
+
//const floatingDeps = $derived(propsList.map((key) => key?.floating))
|
|
67
|
+
//const itemDeps = $derived(propsList.map((key) => key?.item))
|
|
68
|
+
const getReferenceProps = (userProps) => mergeProps(userProps, propsList, "reference");
|
|
69
|
+
const getFloatingProps = (userProps) => mergeProps(userProps, propsList, "floating");
|
|
70
|
+
const getItemProps = (userProps) => mergeProps(userProps, propsList, "item");
|
|
71
|
+
return { getReferenceProps, getFloatingProps, getItemProps };
|
|
72
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from "./types.js";
|
|
2
|
+
export { useFloating } from "./hooks/useFloating.svelte.js";
|
|
3
|
+
export { useInteractions } from "./hooks/useInteractions.svelte.js";
|
|
4
|
+
export { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, getOverflowAncestors, hide, inline, limitShift, offset, platform, shift, size, } from "../svelte-dom/index.js";
|
|
5
|
+
export { inner, useInnerOffset, type InnerProps, type UseInnerOffsetProps } from "./inner.svelte.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from "./types.js";
|
|
2
|
+
export { useFloating } from "./hooks/useFloating.svelte.js";
|
|
3
|
+
export { useInteractions } from "./hooks/useInteractions.svelte.js";
|
|
4
|
+
export { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, getOverflowAncestors, hide, inline, limitShift, offset, platform, shift, size, } from "../svelte-dom/index.js";
|
|
5
|
+
export { inner, useInnerOffset } from "./inner.svelte.js";
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { type Derivable } from "../svelte-dom/index.js";
|
|
2
|
+
import type { DetectOverflowOptions, ElementProps, FloatingRootContext, Middleware, SideObject } from "./types.js";
|
|
3
|
+
import type { MutableRefObject } from "../../ref.svelte.js";
|
|
4
|
+
export interface InnerProps extends DetectOverflowOptions {
|
|
5
|
+
/**
|
|
6
|
+
* A ref which contains an array of HTML elements.
|
|
7
|
+
* @default empty list
|
|
8
|
+
*/
|
|
9
|
+
listRef: MutableRefObject<Array<HTMLElement | null>>;
|
|
10
|
+
/**
|
|
11
|
+
* The index of the active (focused or highlighted) item in the list.
|
|
12
|
+
* @default 0
|
|
13
|
+
*/
|
|
14
|
+
index: number;
|
|
15
|
+
/**
|
|
16
|
+
* Callback invoked when the fallback state changes.
|
|
17
|
+
*/
|
|
18
|
+
onFallbackChange?: null | ((fallback: boolean) => void);
|
|
19
|
+
/**
|
|
20
|
+
* The offset to apply to the floating element.
|
|
21
|
+
* @default 0
|
|
22
|
+
*/
|
|
23
|
+
offset?: number;
|
|
24
|
+
/**
|
|
25
|
+
* A ref which contains the overflow of the floating element.
|
|
26
|
+
*/
|
|
27
|
+
overflowRef?: MutableRefObject<SideObject | null>;
|
|
28
|
+
/**
|
|
29
|
+
* An optional ref containing an HTMLElement. This may be used as the
|
|
30
|
+
* scrolling container instead of the floating element — for instance,
|
|
31
|
+
* to position inner elements as direct children without being interfered by
|
|
32
|
+
* scrolling layout.
|
|
33
|
+
*/
|
|
34
|
+
scrollRef?: MutableRefObject<HTMLElement | null>;
|
|
35
|
+
/**
|
|
36
|
+
* The minimum number of items that should be visible in the list.
|
|
37
|
+
* @default 4
|
|
38
|
+
*/
|
|
39
|
+
minItemsVisible?: number;
|
|
40
|
+
/**
|
|
41
|
+
* The threshold for the reference element's overflow in pixels.
|
|
42
|
+
* @default 0
|
|
43
|
+
*/
|
|
44
|
+
referenceOverflowThreshold?: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Positions the floating element such that an inner element inside of it is
|
|
48
|
+
* anchored to the reference element.
|
|
49
|
+
* @see https://floating-ui.com/docs/inner
|
|
50
|
+
*/
|
|
51
|
+
export declare const inner: (props: InnerProps | Derivable<InnerProps>) => Middleware;
|
|
52
|
+
export interface UseInnerOffsetProps {
|
|
53
|
+
/**
|
|
54
|
+
* Whether the Hook is enabled, including all internal Effects and event
|
|
55
|
+
* handlers.
|
|
56
|
+
* @default true
|
|
57
|
+
*/
|
|
58
|
+
enabled?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* A ref which contains the overflow of the floating element.
|
|
61
|
+
*/
|
|
62
|
+
overflowRef: MutableRefObject<SideObject | null>;
|
|
63
|
+
/**
|
|
64
|
+
* An optional ref containing an HTMLElement. This may be used as the
|
|
65
|
+
* scrolling container instead of the floating element — for instance,
|
|
66
|
+
* to position inner elements as direct children without being interfered by
|
|
67
|
+
* scrolling layout.
|
|
68
|
+
*/
|
|
69
|
+
scrollRef?: MutableRefObject<HTMLElement | null>;
|
|
70
|
+
/**
|
|
71
|
+
* Callback invoked when the offset changes.
|
|
72
|
+
*/
|
|
73
|
+
onChange: (offset: number | ((offset: number) => number)) => void;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Changes the `inner` middleware's `offset` upon a `wheel` event to
|
|
77
|
+
* expand the floating element's height, revealing more list items.
|
|
78
|
+
* @see https://floating-ui.com/docs/inner
|
|
79
|
+
*/
|
|
80
|
+
export declare function useInnerOffset(options: {
|
|
81
|
+
context: FloatingRootContext;
|
|
82
|
+
props: UseInnerOffsetProps;
|
|
83
|
+
}): ElementProps;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { getUserAgent } from "./utils.js";
|
|
2
|
+
import { evaluate, max, min, round } from "@floating-ui/utils";
|
|
3
|
+
import { detectOverflow, offset } from "../svelte-dom/index.js";
|
|
4
|
+
import { warn } from "./utils/log.js";
|
|
5
|
+
import { DEV } from "esm-env";
|
|
6
|
+
import { tick, untrack } from "svelte";
|
|
7
|
+
function getArgsWithCustomFloatingHeight(state, height) {
|
|
8
|
+
return {
|
|
9
|
+
...state,
|
|
10
|
+
rects: {
|
|
11
|
+
...state.rects,
|
|
12
|
+
floating: {
|
|
13
|
+
...state.rects.floating,
|
|
14
|
+
height,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Positions the floating element such that an inner element inside of it is
|
|
21
|
+
* anchored to the reference element.
|
|
22
|
+
* @see https://floating-ui.com/docs/inner
|
|
23
|
+
*/
|
|
24
|
+
export const inner = (props) => ({
|
|
25
|
+
name: "inner",
|
|
26
|
+
options: props,
|
|
27
|
+
async fn(state) {
|
|
28
|
+
const { listRef, overflowRef, onFallbackChange, offset: innerOffset = 0, index = 0, minItemsVisible = 4, referenceOverflowThreshold = 0, scrollRef, ...detectOverflowOptions } = evaluate(props, state);
|
|
29
|
+
const { rects, elements: { floating }, } = state;
|
|
30
|
+
const item = listRef.current[index];
|
|
31
|
+
const scrollEl = scrollRef?.current || floating;
|
|
32
|
+
// Valid combinations:
|
|
33
|
+
// 1. Floating element is the scrollRef and has a border (default)
|
|
34
|
+
// 2. Floating element is not the scrollRef, floating element has a border
|
|
35
|
+
// 3. Floating element is not the scrollRef, scrollRef has a border
|
|
36
|
+
// Floating > {...getFloatingProps()} wrapper > scrollRef > items is not
|
|
37
|
+
// allowed as VoiceOver doesn't work.
|
|
38
|
+
const clientTop = floating.clientTop || scrollEl.clientTop;
|
|
39
|
+
const floatingIsBordered = floating.clientTop !== 0;
|
|
40
|
+
const scrollElIsBordered = scrollEl.clientTop !== 0;
|
|
41
|
+
const floatingIsScrollEl = floating === scrollEl;
|
|
42
|
+
if (DEV) {
|
|
43
|
+
if (!state.placement.startsWith("bottom")) {
|
|
44
|
+
warn('`placement` side must be "bottom" when using the `inner`', "middleware.");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (!item) {
|
|
48
|
+
return {};
|
|
49
|
+
}
|
|
50
|
+
const nextArgs = {
|
|
51
|
+
...state,
|
|
52
|
+
...(await offset(-item.offsetTop - floating.clientTop - rects.reference.height / 2 - item.offsetHeight / 2 - innerOffset).fn(state)),
|
|
53
|
+
};
|
|
54
|
+
const overflow = await detectOverflow(getArgsWithCustomFloatingHeight(nextArgs, scrollEl.scrollHeight + clientTop + floating.clientTop), detectOverflowOptions);
|
|
55
|
+
const refOverflow = await detectOverflow(nextArgs, {
|
|
56
|
+
...detectOverflowOptions,
|
|
57
|
+
elementContext: "reference",
|
|
58
|
+
});
|
|
59
|
+
const diffY = max(0, overflow.top);
|
|
60
|
+
const nextY = nextArgs.y + diffY;
|
|
61
|
+
const maxHeight = round(max(0, scrollEl.scrollHeight +
|
|
62
|
+
((floatingIsBordered && floatingIsScrollEl) || scrollElIsBordered ? clientTop * 2 : 0) -
|
|
63
|
+
diffY -
|
|
64
|
+
max(0, overflow.bottom)));
|
|
65
|
+
scrollEl.style.maxHeight = `${maxHeight}px`;
|
|
66
|
+
scrollEl.scrollTop = diffY;
|
|
67
|
+
// There is not enough space, fallback to standard anchored positioning
|
|
68
|
+
if (onFallbackChange) {
|
|
69
|
+
const shouldFallback = (scrollEl.scrollHeight > scrollEl.offsetHeight &&
|
|
70
|
+
scrollEl.offsetHeight < item.offsetHeight * minItemsVisible - 1) ||
|
|
71
|
+
refOverflow.top >= -referenceOverflowThreshold ||
|
|
72
|
+
refOverflow.bottom >= -referenceOverflowThreshold;
|
|
73
|
+
onFallbackChange(shouldFallback);
|
|
74
|
+
await tick();
|
|
75
|
+
}
|
|
76
|
+
if (overflowRef) {
|
|
77
|
+
overflowRef.current = await detectOverflow(getArgsWithCustomFloatingHeight({ ...nextArgs, y: nextY }, scrollEl.offsetHeight + clientTop + floating.clientTop), detectOverflowOptions);
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
y: nextY,
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
/**
|
|
85
|
+
* Changes the `inner` middleware's `offset` upon a `wheel` event to
|
|
86
|
+
* expand the floating element's height, revealing more list items.
|
|
87
|
+
* @see https://floating-ui.com/docs/inner
|
|
88
|
+
*/
|
|
89
|
+
export function useInnerOffset(options) {
|
|
90
|
+
const { context, props } = $derived(options);
|
|
91
|
+
const { open, elements } = $derived(context);
|
|
92
|
+
const { enabled = true, overflowRef, scrollRef, onChange: unstable_onChange } = $derived(props);
|
|
93
|
+
const onChange = unstable_onChange;
|
|
94
|
+
const controlledScrollingRef = $state({ current: false });
|
|
95
|
+
const prevScrollTopRef = $state({ current: null });
|
|
96
|
+
const initialOverflowRef = $state({ current: null });
|
|
97
|
+
$effect(() => {
|
|
98
|
+
if (!enabled)
|
|
99
|
+
return;
|
|
100
|
+
[enabled, open, elements.floating, overflowRef, scrollRef, onChange];
|
|
101
|
+
untrack(() => {
|
|
102
|
+
function onWheel(e) {
|
|
103
|
+
if (e.ctrlKey || !el || overflowRef.current == null) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
const dY = e.deltaY;
|
|
107
|
+
const isAtTop = overflowRef.current.top >= -0.5;
|
|
108
|
+
const isAtBottom = overflowRef.current.bottom >= -0.5;
|
|
109
|
+
const remainingScroll = el.scrollHeight - el.clientHeight;
|
|
110
|
+
const sign = dY < 0 ? -1 : 1;
|
|
111
|
+
const method = dY < 0 ? "max" : "min";
|
|
112
|
+
if (el.scrollHeight <= el.clientHeight) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if ((!isAtTop && dY > 0) || (!isAtBottom && dY < 0)) {
|
|
116
|
+
e.preventDefault();
|
|
117
|
+
onChange((d) => d + Math[method](dY, remainingScroll * sign));
|
|
118
|
+
tick();
|
|
119
|
+
}
|
|
120
|
+
else if (/firefox/i.test(getUserAgent())) {
|
|
121
|
+
// Needed to propagate scrolling during momentum scrolling phase once
|
|
122
|
+
// it gets limited by the boundary. UX improvement, not critical.
|
|
123
|
+
el.scrollTop += dY;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
const el = scrollRef?.current || elements.floating;
|
|
127
|
+
if (open && el) {
|
|
128
|
+
el.addEventListener("wheel", onWheel);
|
|
129
|
+
// Wait for the position to be ready.
|
|
130
|
+
requestAnimationFrame(() => {
|
|
131
|
+
prevScrollTopRef.current = el.scrollTop;
|
|
132
|
+
if (overflowRef.current != null) {
|
|
133
|
+
initialOverflowRef.current = { ...overflowRef.current };
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
return () => {
|
|
137
|
+
prevScrollTopRef.current = null;
|
|
138
|
+
initialOverflowRef.current = null;
|
|
139
|
+
el.removeEventListener("wheel", onWheel);
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
const floating = {
|
|
145
|
+
onkeydown() {
|
|
146
|
+
controlledScrollingRef.current = true;
|
|
147
|
+
},
|
|
148
|
+
onwheel() {
|
|
149
|
+
controlledScrollingRef.current = false;
|
|
150
|
+
},
|
|
151
|
+
onpointermove() {
|
|
152
|
+
controlledScrollingRef.current = false;
|
|
153
|
+
},
|
|
154
|
+
async onscroll() {
|
|
155
|
+
const el = scrollRef?.current || elements.floating;
|
|
156
|
+
if (!overflowRef.current || !el || !controlledScrollingRef.current) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (prevScrollTopRef.current !== null) {
|
|
160
|
+
const scrollDiff = el.scrollTop - prevScrollTopRef.current;
|
|
161
|
+
if ((overflowRef.current.bottom < -0.5 && scrollDiff < -1) ||
|
|
162
|
+
(overflowRef.current.top < -0.5 && scrollDiff > 1)) {
|
|
163
|
+
onChange((d) => d + scrollDiff);
|
|
164
|
+
await tick();
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
// [Firefox] Wait for the height change to have been applied.
|
|
168
|
+
requestAnimationFrame(() => {
|
|
169
|
+
prevScrollTopRef.current = el.scrollTop;
|
|
170
|
+
});
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
return {
|
|
174
|
+
get floating() {
|
|
175
|
+
return enabled ? floating : undefined;
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { MutableRefObject } from "../../ref.svelte.js";
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
import type { UseFloatingOptions as UsePositionOptions, UseFloatingReturn as UsePositionFloatingReturn, VirtualElement } from "../svelte-dom/types.js";
|
|
4
|
+
import type { ExtendedUserProps } from "./hooks/useInteractions.svelte.js";
|
|
5
|
+
export type { ReferenceElement, DetectOverflowOptions, Middleware, MiddlewareState, SideObject, } from "../svelte-dom/types.js";
|
|
6
|
+
type Prettify<T> = {
|
|
7
|
+
[K in keyof T]: T[K];
|
|
8
|
+
} & {};
|
|
9
|
+
export type OpenChangeReason = "outside-press" | "escape-key" | "ancestor-scroll" | "reference-press" | "click" | "hover" | "focus" | "focus-out" | "list-navigation" | "safe-polygon";
|
|
10
|
+
export type NarrowedElement<T> = T extends Element ? T : Element;
|
|
11
|
+
export interface ExtendedRefs<RT> {
|
|
12
|
+
reference: MutableRefObject<ReferenceType | null>;
|
|
13
|
+
floating: MutableRefObject<HTMLElement | null>;
|
|
14
|
+
domReference: MutableRefObject<NarrowedElement<RT> | null>;
|
|
15
|
+
setReference(node: RT | null): void;
|
|
16
|
+
setFloating(node: HTMLElement | null): void;
|
|
17
|
+
setPositionReference(node: ReferenceType | null): void;
|
|
18
|
+
}
|
|
19
|
+
export interface ExtendedElements<RT> {
|
|
20
|
+
reference: ReferenceType | null;
|
|
21
|
+
floating: HTMLElement | null;
|
|
22
|
+
domReference: NarrowedElement<RT> | null;
|
|
23
|
+
}
|
|
24
|
+
export interface FloatingEvents {
|
|
25
|
+
emit<T extends string>(event: T, data?: any): void;
|
|
26
|
+
on(event: string, handler: (data: any) => void): void;
|
|
27
|
+
off(event: string, handler: (data: any) => void): void;
|
|
28
|
+
}
|
|
29
|
+
export interface ContextData {
|
|
30
|
+
openEvent?: Event;
|
|
31
|
+
floatingContext?: FloatingContext;
|
|
32
|
+
/** @deprecated use `onTypingChange` prop in `useTypeahead` */
|
|
33
|
+
typing?: boolean;
|
|
34
|
+
[key: string]: any;
|
|
35
|
+
}
|
|
36
|
+
export interface FloatingRootContext<RT extends ReferenceType = ReferenceType> {
|
|
37
|
+
dataRef: MutableRefObject<ContextData>;
|
|
38
|
+
open: boolean;
|
|
39
|
+
onOpenChange: (open: boolean, event?: Event, reason?: OpenChangeReason) => void;
|
|
40
|
+
elements: {
|
|
41
|
+
domReference: Element | null;
|
|
42
|
+
reference: RT | null;
|
|
43
|
+
floating: HTMLElement | null;
|
|
44
|
+
};
|
|
45
|
+
events: FloatingEvents;
|
|
46
|
+
floatingId: string;
|
|
47
|
+
refs: {
|
|
48
|
+
setPositionReference(node: ReferenceType | null): void;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export type FloatingContext<RT extends ReferenceType = ReferenceType> = Omit<UsePositionFloatingReturn<RT>, "refs" | "elements"> & {
|
|
52
|
+
open: boolean;
|
|
53
|
+
onOpenChange(open: boolean, event?: Event, reason?: OpenChangeReason): void;
|
|
54
|
+
events: FloatingEvents;
|
|
55
|
+
dataRef: MutableRefObject<ContextData>;
|
|
56
|
+
nodeId: string | undefined;
|
|
57
|
+
floatingId: string;
|
|
58
|
+
refs: ExtendedRefs<RT>;
|
|
59
|
+
elements: ExtendedElements<RT>;
|
|
60
|
+
};
|
|
61
|
+
export interface FloatingNodeType<RT extends ReferenceType = ReferenceType> {
|
|
62
|
+
id: string;
|
|
63
|
+
parentId: string | null;
|
|
64
|
+
context?: FloatingContext<RT>;
|
|
65
|
+
}
|
|
66
|
+
export interface FloatingTreeType<RT extends ReferenceType = ReferenceType> {
|
|
67
|
+
nodesRef: MutableRefObject<Array<FloatingNodeType<RT>>>;
|
|
68
|
+
events: FloatingEvents;
|
|
69
|
+
addNode(node: FloatingNodeType): void;
|
|
70
|
+
removeNode(node: FloatingNodeType): void;
|
|
71
|
+
}
|
|
72
|
+
export interface ElementProps {
|
|
73
|
+
reference?: HTMLAttributes<Element>;
|
|
74
|
+
floating?: HTMLAttributes<HTMLElement>;
|
|
75
|
+
item?: HTMLAttributes<HTMLElement> | ((props: ExtendedUserProps) => HTMLAttributes<HTMLElement>);
|
|
76
|
+
}
|
|
77
|
+
export type ReferenceType = Element | VirtualElement;
|
|
78
|
+
export type UseFloatingData = Prettify<UseFloatingReturn>;
|
|
79
|
+
export type UseFloatingReturn<RT extends ReferenceType = ReferenceType> = Prettify<UsePositionFloatingReturn & {
|
|
80
|
+
/**
|
|
81
|
+
* `FloatingContext`
|
|
82
|
+
*/
|
|
83
|
+
context: Prettify<FloatingContext<RT>>;
|
|
84
|
+
/**
|
|
85
|
+
* Object containing the reference and floating refs and reactive setters.
|
|
86
|
+
*/
|
|
87
|
+
refs: ExtendedRefs<RT>;
|
|
88
|
+
elements: ExtendedElements<RT>;
|
|
89
|
+
}>;
|
|
90
|
+
export interface UseFloatingOptions<RT extends ReferenceType = ReferenceType> extends Omit<UsePositionOptions<RT>, "elements"> {
|
|
91
|
+
rootContext?: FloatingRootContext<RT>;
|
|
92
|
+
/**
|
|
93
|
+
* Object of external elements as an alternative to the `refs` object setters.
|
|
94
|
+
*/
|
|
95
|
+
elements?: {
|
|
96
|
+
/**
|
|
97
|
+
* Externally passed reference element. Store in state.
|
|
98
|
+
*/
|
|
99
|
+
reference?: Element | null;
|
|
100
|
+
/**
|
|
101
|
+
* Externally passed floating element. Store in state.
|
|
102
|
+
*/
|
|
103
|
+
floating?: HTMLElement | null;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* An event callback that is invoked when the floating element is opened or
|
|
107
|
+
* closed.
|
|
108
|
+
*/
|
|
109
|
+
onOpenChange?(open: boolean, event?: Event, reason?: OpenChangeReason): void;
|
|
110
|
+
/**
|
|
111
|
+
* Unique node id when using `FloatingTree`.
|
|
112
|
+
*/
|
|
113
|
+
nodeId?: string;
|
|
114
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function createPubSub() {
|
|
2
|
+
const map = new Map();
|
|
3
|
+
return {
|
|
4
|
+
emit(event, data) {
|
|
5
|
+
map.get(event)?.forEach((handler) => handler(data));
|
|
6
|
+
},
|
|
7
|
+
on(event, listener) {
|
|
8
|
+
map.set(event, [...(map.get(event) || []), listener]);
|
|
9
|
+
},
|
|
10
|
+
off(event, listener) {
|
|
11
|
+
map.set(event, map.get(event)?.filter((l) => l !== listener) || []);
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const FOCUSABLE_ATTRIBUTE = "data-floating-ui-focusable";
|
|
2
|
+
export function getFloatingFocusElement(floatingElement) {
|
|
3
|
+
if (!floatingElement) {
|
|
4
|
+
return null;
|
|
5
|
+
}
|
|
6
|
+
// Try to find the element that has `{...getFloatingProps()}` spread on it.
|
|
7
|
+
// This indicates the floating element is acting as a positioning wrapper, and
|
|
8
|
+
// so focus should be managed on the child element with the event handlers and
|
|
9
|
+
// aria props.
|
|
10
|
+
return floatingElement.hasAttribute(FOCUSABLE_ATTRIBUTE)
|
|
11
|
+
? floatingElement
|
|
12
|
+
: floatingElement.querySelector(`[${FOCUSABLE_ATTRIBUTE}]`) || floatingElement;
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DEV } from "esm-env";
|
|
2
|
+
let devMessageSet;
|
|
3
|
+
if (DEV) {
|
|
4
|
+
devMessageSet = new Set();
|
|
5
|
+
}
|
|
6
|
+
export function warn(...messages) {
|
|
7
|
+
const message = `Floating UI: ${messages.join(" ")}`;
|
|
8
|
+
if (!devMessageSet?.has(message)) {
|
|
9
|
+
devMessageSet?.add(message);
|
|
10
|
+
console.warn(message);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export function error(...messages) {
|
|
14
|
+
const message = `Floating UI: ${messages.join(" ")}`;
|
|
15
|
+
if (!devMessageSet?.has(message)) {
|
|
16
|
+
devMessageSet?.add(message);
|
|
17
|
+
console.error(message);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare function activeElement(doc: Document): Element | null;
|
|
2
|
+
export declare function contains(parent?: Element | null, child?: Element | null): boolean;
|
|
3
|
+
export declare function getPlatform(): string;
|
|
4
|
+
export declare function getUserAgent(): string;
|
|
5
|
+
export declare function isVirtualClick(event: MouseEvent | PointerEvent): boolean;
|
|
6
|
+
export declare function isVirtualPointerEvent(event: PointerEvent): boolean;
|
|
7
|
+
export declare function isSafari(): boolean;
|
|
8
|
+
export declare function isAndroid(): boolean;
|
|
9
|
+
export declare function isMac(): boolean;
|
|
10
|
+
export declare function isJSDOM(): boolean;
|
|
11
|
+
export declare function isMouseLikePointerType(pointerType: string | undefined, strict?: boolean): boolean;
|
|
12
|
+
export declare function isRootElement(element: Element): boolean;
|
|
13
|
+
export declare function getDocument(node: Element | null): Document;
|
|
14
|
+
export declare function isEventTargetWithin(event: Event, node: Node | null | undefined): boolean;
|
|
15
|
+
export declare function getTarget(event: Event): EventTarget | null;
|
|
16
|
+
export declare const TYPEABLE_SELECTOR: string;
|
|
17
|
+
export declare function isTypeableElement(element: unknown): boolean;
|
|
18
|
+
export declare function stopEvent(event: Event): void;
|
|
19
|
+
export declare function isTypeableCombobox(element: Element | null): boolean;
|