tokens.d.ts 1.1 KB

123456789101112131415161718192021222324252627
  1. import type { InjectionKey, Ref, StyleValue } from 'vue';
  2. import type { ElRovingFocusGroupProps } from './roving-focus-group';
  3. type EventHandler<T = Event> = (e: T) => void;
  4. export type RovingGroupInjectionContext = {
  5. currentTabbedId: Ref<string | null>;
  6. dir: Ref<ElRovingFocusGroupProps['dir']>;
  7. loop: Ref<ElRovingFocusGroupProps['loop']>;
  8. orientation: Ref<ElRovingFocusGroupProps['orientation']>;
  9. tabIndex: Ref<number>;
  10. rovingFocusGroupRef: Ref<HTMLElement | undefined>;
  11. rovingFocusGroupRootStyle: Ref<StyleValue>;
  12. onBlur: EventHandler;
  13. onFocus: EventHandler<FocusEvent>;
  14. onMousedown: EventHandler;
  15. onItemFocus: (id: string) => void;
  16. onItemShiftTab: () => void;
  17. };
  18. export type RovingFocusGroupItemInjectionContext = {
  19. rovingFocusGroupItemRef: Ref<HTMLElement | undefined>;
  20. tabIndex: Ref<number>;
  21. handleMousedown: EventHandler;
  22. handleFocus: EventHandler;
  23. handleKeydown: EventHandler;
  24. };
  25. export declare const ROVING_FOCUS_GROUP_INJECTION_KEY: InjectionKey<RovingGroupInjectionContext>;
  26. export declare const ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY: InjectionKey<RovingFocusGroupItemInjectionContext>;
  27. export {};