You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
650 B
18 lines
650 B
import type { ShallowRef } from 'vue';
|
|
interface UseFocusControllerOptions {
|
|
afterFocus?: () => void;
|
|
/**
|
|
* return true to cancel blur
|
|
* @param event FocusEvent
|
|
*/
|
|
beforeBlur?: (event: FocusEvent) => boolean | undefined;
|
|
afterBlur?: () => void;
|
|
}
|
|
export declare function useFocusController<T extends HTMLElement>(target: ShallowRef<T | undefined>, { afterFocus, beforeBlur, afterBlur }?: UseFocusControllerOptions): {
|
|
wrapperRef: ShallowRef<HTMLElement | undefined>;
|
|
isFocused: import("vue").Ref<boolean>;
|
|
handleFocus: (event: FocusEvent) => void;
|
|
handleBlur: (event: FocusEvent) => void;
|
|
};
|
|
export {};
|