@empathyco/x-components
Version:
Empathy X Components
55 lines (46 loc) • 2.06 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [BaseKeyboardNavigation](./x-components.basekeyboardnavigation.md)
## BaseKeyboardNavigation variable
Base component to handle keyboard navigation for elements inside it. It has a required slot to include the navigable elements.
**Signature:**
```typescript
_default: import("vue").DefineComponent<{
navigationHijacker: {
type: PropType<TakeNavigationControl[]>;
default: () => {
xEvent: string;
moduleName: string;
direction: string;
}[];
};
eventsForDirectionLimit: {
type: PropType<Partial<EventsForDirectionLimit>>;
default: () => {
ArrowUp: string;
};
};
}, {
el: import("vue").Ref<HTMLElement | undefined>;
focusNextNavigableElement: (direction: ArrowKey | KeyboardEvent) => void;
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
navigationHijacker: {
type: PropType<TakeNavigationControl[]>;
default: () => {
xEvent: string;
moduleName: string;
direction: string;
}[];
};
eventsForDirectionLimit: {
type: PropType<Partial<EventsForDirectionLimit>>;
default: () => {
ArrowUp: string;
};
};
}>>, {
navigationHijacker: TakeNavigationControl[];
eventsForDirectionLimit: Partial<EventsForDirectionLimit>;
}, {}>
```
## Remarks
The component can be customized through props: an array of navigationHijacker objects, which contains: the xEvent to listen to, the moduleName in charge of emitting the event and to which direction it should react to; to take control of the navigation and eventsForDirectionLimit, to emit an xEvent when reaching the navigation limit in any direction.