@dao-style/core 1.27.1-beta.1 → 1.27.1-beta.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.
@@ -1,2 +1,3 @@
1
1
  export { useLockGesture } from './useLockGesture';
2
2
  export { useExpandTransition } from './useExpandTransition';
3
+ export { useFocusTrap } from './useFocusTrap';
@@ -0,0 +1,13 @@
1
+ import { MaybeRef } from '@vueuse/core';
2
+ export type TrapTabKeyOptions = {
3
+ onEscape?: (e: KeyboardEvent) => void;
4
+ };
5
+ export interface UseFocusTrapType {
6
+ saveFocus: () => void;
7
+ savFocusedElementOrigin: () => void;
8
+ blurActiveElement: () => void;
9
+ bindTrapTabKey: () => void;
10
+ restoreFocus: () => void;
11
+ cleanupTrapTabKey: () => void;
12
+ }
13
+ export declare function useFocusTrap(container: MaybeRef<HTMLElement | null>, options?: TrapTabKeyOptions): UseFocusTrapType;
@@ -2,10 +2,10 @@ import type { VNode, VNodeChild } from 'vue';
2
2
  declare const getFirstValidNode: (nodes: VNodeChild, maxDepth?: number) => VNode<import("vue").RendererNode, import("vue").RendererElement, {
3
3
  [key: string]: any;
4
4
  }> | undefined;
5
+ declare const getFocusedElementOrigin: () => Element | null;
5
6
  declare const getFocusElementRange: (elementNode: HTMLElement | null) => {
6
7
  lastTab: HTMLElement | null;
7
8
  firstTab: HTMLElement | null;
8
- focusedElementOrigin: Element | null;
9
9
  };
10
10
  declare const trapTabKey: (e: KeyboardEvent, firstTab: HTMLElement, lastTab: HTMLElement) => void;
11
- export { getFirstValidNode, getFocusElementRange, trapTabKey, };
11
+ export { getFirstValidNode, getFocusedElementOrigin, getFocusElementRange, trapTabKey, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dao-style/core",
3
- "version": "1.27.1-beta.1",
3
+ "version": "1.27.1-beta.2",
4
4
  "scripts": {
5
5
  "commit": "git-cz",
6
6
  "dev": "npm run dev:docs",