@flux-ui/internals 3.0.0-next.8 → 3.0.0
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/README.md +35 -0
- package/dist/composable/index.d.ts +2 -17
- package/dist/composable/index.js +1 -0
- package/dist/composable-DPolUL3R.js +2 -0
- package/dist/composable-DPolUL3R.js.map +1 -0
- package/dist/data/index.d.ts +246 -1
- package/dist/data/index.d.ts.map +1 -0
- package/dist/data/index.js +2 -0
- package/dist/data/index.js.map +1 -0
- package/dist/directive/index.d.ts +2 -3
- package/dist/directive/index.js +1 -0
- package/dist/directive-Bti3pKwZ.js +2 -0
- package/dist/directive-Bti3pKwZ.js.map +1 -0
- package/dist/index-BXp0Gr5f.d.ts +138 -0
- package/dist/index-BXp0Gr5f.d.ts.map +1 -0
- package/dist/index-Bf3XnnIf.d.ts +73 -0
- package/dist/index-Bf3XnnIf.d.ts.map +1 -0
- package/dist/index-ZutYFtKs.d.ts +14 -0
- package/dist/index-ZutYFtKs.d.ts.map +1 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +1 -4
- package/dist/util/index.d.ts +2 -13
- package/dist/util/index.js +1 -0
- package/dist/util-BGzD1ED0.js +2 -0
- package/dist/util-BGzD1ED0.js.map +1 -0
- package/package.json +30 -13
- package/src/composable/index.ts +3 -5
- package/src/composable/useCalendar.ts +1 -1
- package/src/composable/useCalendarMonthSwitcher.ts +1 -2
- package/src/composable/useCalendarTimeGrid.ts +103 -0
- package/src/composable/useCalendarYearSwitcher.ts +1 -2
- package/src/composable/useEventListener.ts +6 -4
- package/src/composable/useFocusTrap.ts +28 -24
- package/src/composable/useFocusTrapLock.ts +1 -2
- package/src/composable/useFocusTrapReturn.ts +11 -7
- package/src/composable/useFocusTrapSubscription.ts +1 -2
- package/src/composable/useFocusZone.ts +13 -12
- package/src/composable/useInView.ts +2 -4
- package/src/composable/useKeyboardGrab.ts +156 -0
- package/src/composable/useRemembered.ts +21 -7
- package/src/composable/useScrollEdges.ts +76 -0
- package/src/composable/useScrollPosition.ts +16 -8
- package/src/directive/focusTrap.ts +4 -0
- package/src/directive/heightTransition.ts +6 -2
- package/src/directive/index.ts +1 -1
- package/src/util/animationFrameDebounce.ts +15 -0
- package/src/util/flattenVNodeTree.ts +3 -4
- package/src/util/focusTrap.ts +9 -5
- package/src/util/getBidirectionalFocusElement.ts +1 -1
- package/src/util/getComponentName.ts +1 -1
- package/src/util/getFocusableElement.ts +2 -1
- package/src/util/getFocusableElements.ts +5 -4
- package/src/util/getKeyboardFocusableElements.ts +1 -1
- package/src/util/index.ts +3 -1
- package/src/util/isActiveElement.ts +5 -0
- package/src/util/unrefTemplateElement.ts +1 -1
- package/src/util/wrapFocus.ts +1 -1
- package/dist/composable/useCalendar.d.ts +0 -20
- package/dist/composable/useCalendarMonthSwitcher.d.ts +0 -10
- package/dist/composable/useCalendarYearSwitcher.d.ts +0 -8
- package/dist/composable/useClickOutside.d.ts +0 -4
- package/dist/composable/useComponentId.d.ts +0 -2
- package/dist/composable/useDebouncedRef.d.ts +0 -2
- package/dist/composable/useEventListener.d.ts +0 -2
- package/dist/composable/useFocusTrap.d.ts +0 -8
- package/dist/composable/useFocusTrapLock.d.ts +0 -2
- package/dist/composable/useFocusTrapReturn.d.ts +0 -2
- package/dist/composable/useFocusTrapSubscription.d.ts +0 -2
- package/dist/composable/useFocusZone.d.ts +0 -6
- package/dist/composable/useInView.d.ts +0 -6
- package/dist/composable/useInterval.d.ts +0 -2
- package/dist/composable/useMutationObserver.d.ts +0 -2
- package/dist/composable/useRemembered.d.ts +0 -2
- package/dist/composable/useScrollPosition.d.ts +0 -7
- package/dist/data/color.d.ts +0 -242
- package/dist/directive/focusTrap.d.ts +0 -5
- package/dist/directive/heightTransition.d.ts +0 -5
- package/dist/index.js.map +0 -42
- package/dist/util/flattenVNodeTree.d.ts +0 -2
- package/dist/util/focusTrap.d.ts +0 -8
- package/dist/util/getBidirectionalFocusElement.d.ts +0 -1
- package/dist/util/getComponentName.d.ts +0 -7
- package/dist/util/getComponentProps.d.ts +0 -1
- package/dist/util/getExposedRef.d.ts +0 -2
- package/dist/util/getFocusableElement.d.ts +0 -1
- package/dist/util/getFocusableElements.d.ts +0 -1
- package/dist/util/getKeyboardFocusableElements.d.ts +0 -1
- package/dist/util/unrefTemplateElement.d.ts +0 -4
- package/dist/util/warn.d.ts +0 -1
- package/dist/util/wrapFocus.d.ts +0 -1
- package/src/composable/useClickOutside.ts +0 -38
- package/src/composable/useComponentId.ts +0 -8
- package/src/composable/useDebouncedRef.ts +0 -38
- package/src/composable/useInterval.ts +0 -23
- package/src/composable/useMutationObserver.ts +0 -38
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { n as FocusTrapListener, s as TemplateRef } from "./index-Bf3XnnIf.js";
|
|
2
|
+
import { ComponentPublicInstance, ComputedRef, MaybeRefOrGetter, Ref } from "vue";
|
|
3
|
+
import { DateTime } from "luxon";
|
|
4
|
+
|
|
5
|
+
//#region src/composable/useCalendar.d.ts
|
|
6
|
+
declare function export_default$13(initialDate: DateTime, options?: UseCalendarOptions): UseCalendarReturn;
|
|
7
|
+
type UseCalendarOptions = {
|
|
8
|
+
readonly monthLength?: "short" | "long";
|
|
9
|
+
readonly weekDayLength?: "short" | "long";
|
|
10
|
+
};
|
|
11
|
+
type UseCalendarReturn = {
|
|
12
|
+
readonly isTransitioningToPast: Ref<boolean>;
|
|
13
|
+
readonly viewDate: Ref<DateTime>;
|
|
14
|
+
readonly viewDateNext: Ref<DateTime>;
|
|
15
|
+
readonly viewDatePrevious: Ref<DateTime>;
|
|
16
|
+
readonly viewMonth: Ref<string>;
|
|
17
|
+
readonly viewYear: Ref<string>;
|
|
18
|
+
readonly dates: Ref<DateTime[]>;
|
|
19
|
+
readonly days: Ref<string[]>;
|
|
20
|
+
setViewDate(date: DateTime): void;
|
|
21
|
+
nextMonth(): void;
|
|
22
|
+
previousMonth(): void;
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/composable/useCalendarMonthSwitcher.d.ts
|
|
26
|
+
declare function export_default$12(currentDate: Ref<DateTime>, displayLength: "short" | "long"): UseCalendarMonthSwitcherReturn;
|
|
27
|
+
type MonthEntry = {
|
|
28
|
+
readonly date: DateTime;
|
|
29
|
+
readonly label: string;
|
|
30
|
+
};
|
|
31
|
+
type UseCalendarMonthSwitcherReturn = {
|
|
32
|
+
readonly months: Ref<MonthEntry[]>;
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/composable/useCalendarTimeGrid.d.ts
|
|
36
|
+
type UseCalendarTimeGridDayCount = 1 | 2 | 7;
|
|
37
|
+
type UseCalendarTimeGridReturn = {
|
|
38
|
+
readonly isTransitioningToPast: Ref<boolean>;
|
|
39
|
+
readonly viewDate: Ref<DateTime>;
|
|
40
|
+
readonly viewDates: ComputedRef<DateTime[]>;
|
|
41
|
+
readonly rangeLabel: ComputedRef<string>;
|
|
42
|
+
setViewDate(date: DateTime): void;
|
|
43
|
+
next(): void;
|
|
44
|
+
previous(): void;
|
|
45
|
+
};
|
|
46
|
+
declare function export_default$11(initialDate: DateTime, dayCount: MaybeRefOrGetter<UseCalendarTimeGridDayCount>): UseCalendarTimeGridReturn;
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/composable/useCalendarYearSwitcher.d.ts
|
|
49
|
+
declare function export_default$10(currentDate: Ref<DateTime>, limit?: number): UseCalendarYearSwitcherReturn;
|
|
50
|
+
type UseCalendarYearSwitcherReturn = {
|
|
51
|
+
readonly years: Ref<number[]>;
|
|
52
|
+
next(): void;
|
|
53
|
+
previous(): void;
|
|
54
|
+
};
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/composable/useKeyboardGrab.d.ts
|
|
57
|
+
type KeyboardGrabDirection = "up" | "down" | "left" | "right";
|
|
58
|
+
type UseKeyboardGrabOptions<TPos> = {
|
|
59
|
+
readonly isDraggable: Ref<boolean>;
|
|
60
|
+
readonly itemId: Ref<string | number | null | undefined>;
|
|
61
|
+
readonly grabbedId: Ref<string | number | null>;
|
|
62
|
+
onGrab(): TPos;
|
|
63
|
+
onMove(direction: KeyboardGrabDirection): void;
|
|
64
|
+
onCommit(origin: TPos): void;
|
|
65
|
+
onCancel(origin: TPos): void;
|
|
66
|
+
announce?(message: string): void;
|
|
67
|
+
};
|
|
68
|
+
type UseKeyboardGrabReturn = {
|
|
69
|
+
readonly isGrabbed: ComputedRef<boolean>;
|
|
70
|
+
handleKeyDown(evt: KeyboardEvent): void;
|
|
71
|
+
release(): void;
|
|
72
|
+
};
|
|
73
|
+
declare function defaultAnnounce(message: string): void;
|
|
74
|
+
/**
|
|
75
|
+
* Generic keyboard-grab state machine. Maps Space/Enter/Escape/Arrow keys
|
|
76
|
+
* onto grab/commit/cancel/move callbacks. The actual movement logic is
|
|
77
|
+
* delegated to `onMove` since it depends on the host component's topology.
|
|
78
|
+
*/
|
|
79
|
+
declare function useKeyboardGrab<TPos>(options: UseKeyboardGrabOptions<TPos>): UseKeyboardGrabReturn;
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/composable/useEventListener.d.ts
|
|
82
|
+
declare function export_default$9<K extends keyof HTMLElementEventMap>(elementRef: TemplateRef<HTMLElement>, eventName: K, listener: (evt: HTMLElementEventMap[K]) => any, options?: AddEventListenerOptions): void;
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/composable/useInView.d.ts
|
|
85
|
+
declare function export_default$8<TElement extends HTMLElement>(containerRef: TemplateRef<TElement>, options?: UseInViewOptions): Ref<boolean>;
|
|
86
|
+
type UseInViewOptions = IntersectionObserverInit & {
|
|
87
|
+
readonly initial?: boolean;
|
|
88
|
+
};
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/composable/useRemembered.d.ts
|
|
91
|
+
declare function export_default$7<T>(key: string, initialValue: T): Ref<T>;
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/composable/useScrollEdges.d.ts
|
|
94
|
+
declare function export_default$6<TElement extends HTMLElement>(elementRef: TemplateRef<TElement>): UseScrollEdgesReturn;
|
|
95
|
+
type UseScrollEdgesReturn = {
|
|
96
|
+
readonly isAtStart: Ref<boolean>;
|
|
97
|
+
readonly isAtEnd: Ref<boolean>;
|
|
98
|
+
readonly isAtLeft: Ref<boolean>;
|
|
99
|
+
readonly isAtRight: Ref<boolean>;
|
|
100
|
+
};
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/composable/useScrollPosition.d.ts
|
|
103
|
+
declare function export_default$5<TElement extends HTMLElement>(elementRef?: TemplateRef<TElement>): UseScrollPositionReturn;
|
|
104
|
+
type UseScrollPositionReturn = {
|
|
105
|
+
readonly x: Ref<number>;
|
|
106
|
+
readonly y: Ref<number>;
|
|
107
|
+
};
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/composable/useFocusTrap.d.ts
|
|
110
|
+
declare function export_default$4(containerRef: TemplateRef<HTMLElement>, options?: UseFocusTrapOptions): void;
|
|
111
|
+
type UseFocusTrapOptions = {
|
|
112
|
+
attachTo?: HTMLElement | Document;
|
|
113
|
+
disable?: Ref<boolean>;
|
|
114
|
+
disableReturn?: Ref<boolean>;
|
|
115
|
+
};
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region src/composable/useFocusTrapLock.d.ts
|
|
118
|
+
declare function export_default$3(autoFocus?: boolean): Ref<boolean>;
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region src/composable/useFocusTrapReturn.d.ts
|
|
121
|
+
declare function export_default$2(containerRef: TemplateRef<HTMLElement>, disabled: Ref<boolean>): void;
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/composable/useFocusTrapSubscription.d.ts
|
|
124
|
+
declare function export_default$1(listener: FocusTrapListener): void;
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region src/composable/useFocusZone.d.ts
|
|
127
|
+
type EligibleElement = ComponentPublicInstance | HTMLElement;
|
|
128
|
+
declare function export_default<TElement extends EligibleElement>(containerRef: Ref<TElement>, {
|
|
129
|
+
cycle,
|
|
130
|
+
direction
|
|
131
|
+
}?: UseFocusZoneOptions): void;
|
|
132
|
+
type UseFocusZoneOptions = {
|
|
133
|
+
readonly cycle?: boolean;
|
|
134
|
+
readonly direction?: "bidirectional" | "horizontal" | "vertical";
|
|
135
|
+
};
|
|
136
|
+
//#endregion
|
|
137
|
+
export { export_default$4 as a, export_default$7 as c, defaultAnnounce as d, useKeyboardGrab as f, export_default$13 as g, export_default$12 as h, export_default$3 as i, export_default$8 as l, export_default$11 as m, export_default$1 as n, export_default$5 as o, export_default$10 as p, export_default$2 as r, export_default$6 as s, export_default as t, export_default$9 as u };
|
|
138
|
+
//# sourceMappingURL=index-BXp0Gr5f.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BXp0Gr5f.d.ts","names":[],"sources":["../src/composable/useCalendar.ts","../src/composable/useCalendarMonthSwitcher.ts","../src/composable/useCalendarTimeGrid.ts","../src/composable/useCalendarYearSwitcher.ts","../src/composable/useKeyboardGrab.ts","../src/composable/useEventListener.ts","../src/composable/useInView.ts","../src/composable/useRemembered.ts","../src/composable/useScrollEdges.ts","../src/composable/useScrollPosition.ts","../src/composable/useFocusTrap.ts","../src/composable/useFocusTrapLock.ts","../src/composable/useFocusTrapReturn.ts","../src/composable/useFocusTrapSubscription.ts","../src/composable/useFocusZone.ts"],"mappings":";;;;;iBAC+C,iBAAA,CAEtB,WAAA,EAAa,QAAA,EAAU,OAAA,GAAU,kBAAA,GAAqB,iBAAA;AAAA,KAyE1E,kBAAA;EAAA,SACQ,WAAA;EAAA,SACA,aAAA;AAAA;AAAA,KAGR,iBAAA;EAAA,SACQ,qBAAA,EAAuB,GAAA;EAAA,SACvB,QAAA,EAAU,GAAA,CAAI,QAAA;EAAA,SACd,YAAA,EAAc,GAAA,CAAI,QAAA;EAAA,SAClB,gBAAA,EAAkB,GAAA,CAAI,QAAA;EAAA,SACtB,SAAA,EAAW,GAAA;EAAA,SACX,QAAA,EAAU,GAAA;EAAA,SACV,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AA,GAAc,QAAA,EAAU,GAAA;;;iBCFlB,gBAAA,CAEhC,QAAU,EAAA,iBAAA;;;KCC9B,eAAA,GAAkB,uBAAA,GAA0B,WAAA;AAAA,iBAAA,cAAA,kBAEP,eAAA,EAAiB,YAAA,EAAc,GAAA,CAAI,QAAA;EAAY,KAAA;EAAc;AAAA,IAA8B,mBAAA;AAAA,KAsHhI,mBAAA;EAAA,SACQ,KAAA;EAAA,SACA,SAAA;AAAA"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ComponentInternalInstance, ComponentPublicInstance, Ref, ShallowRef, VNode } from "vue";
|
|
2
|
+
import { FluxMaybePromise } from "@flux-ui/types";
|
|
3
|
+
|
|
4
|
+
//#region src/util/animationFrameDebounce.d.ts
|
|
5
|
+
declare function export_default$11<T extends () => FluxMaybePromise<void>>(fn: T): T;
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/util/flattenVNodeTree.d.ts
|
|
8
|
+
declare function flattenVNodeTree(vnodes: VNode[]): VNode[];
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/util/getBidirectionalFocusElement.d.ts
|
|
11
|
+
declare function export_default$10(container: HTMLElement, currentElement: HTMLElement, direction: "up" | "down" | "left" | "right"): HTMLElement | null;
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/util/getComponentName.d.ts
|
|
14
|
+
declare function export_default$9(component: ExtendedVNode): string;
|
|
15
|
+
type ExtendedVNode = {
|
|
16
|
+
readonly type: VNode["type"] & {
|
|
17
|
+
readonly __name?: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/util/getComponentProps.d.ts
|
|
22
|
+
declare function export_default$8<T extends object>(component: any): T;
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/util/getExposedRef.d.ts
|
|
25
|
+
declare function export_default$7<T>(instance: ComponentInternalInstance, key: string): Ref<T>;
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/util/getFocusableElement.d.ts
|
|
28
|
+
declare function export_default$6(container: HTMLElement, direction: number, activeElement?: HTMLElement | undefined): HTMLElement | undefined;
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/util/getFocusableElements.d.ts
|
|
31
|
+
declare function export_default$5(container: HTMLElement): HTMLElement[];
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/util/getKeyboardFocusableElements.d.ts
|
|
34
|
+
declare function export_default$4(root: HTMLElement): HTMLElement[];
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/util/isActiveElement.d.ts
|
|
37
|
+
declare function export_default$3(element: HTMLElement): boolean;
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/util/unrefTemplateElement.d.ts
|
|
40
|
+
type TemplateElement<TElement extends HTMLElement> = ComponentPublicInstance<any, any, any, any, any, any, any, any, any, any, any, any, any, any, TElement> | TElement | null;
|
|
41
|
+
type TemplateRef<TElement extends HTMLElement> = Readonly<ShallowRef<TemplateElement<TElement>>>;
|
|
42
|
+
declare function export_default$2<T extends HTMLElement>(ref: TemplateRef<T>): T | null;
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/util/warn.d.ts
|
|
45
|
+
declare function export_default$1(...data: any): void;
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region src/util/wrapFocus.d.ts
|
|
48
|
+
declare function export_default(elm: HTMLElement, targetElm: Element, forceFirst?: boolean): void;
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/util/focusTrap.d.ts
|
|
51
|
+
declare class FocusTrapLockStack {
|
|
52
|
+
#private;
|
|
53
|
+
get active(): boolean;
|
|
54
|
+
get current(): FocusTrap | null;
|
|
55
|
+
add(id: FocusTrap["id"], setEnabled: FocusTrap["setEnabled"], autoFocus?: boolean): void;
|
|
56
|
+
remove(id: FocusTrap["id"]): void;
|
|
57
|
+
emit(): void;
|
|
58
|
+
subscribe(listener: FocusTrapListener): () => void;
|
|
59
|
+
toggle(trap: FocusTrap, isEnabled: boolean): void;
|
|
60
|
+
}
|
|
61
|
+
interface FocusTrap {
|
|
62
|
+
id: string;
|
|
63
|
+
isEnabled: boolean;
|
|
64
|
+
setEnabled(isEnabled: boolean): void;
|
|
65
|
+
}
|
|
66
|
+
type FocusTrapListener = (isEnabled: boolean, focusTraps: FocusTrap[]) => void;
|
|
67
|
+
declare const _default: FocusTrapLockStack;
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/util/index.d.ts
|
|
70
|
+
declare const isSSR: boolean;
|
|
71
|
+
//#endregion
|
|
72
|
+
export { flattenVNodeTree as _, export_default$1 as a, export_default$2 as c, export_default$5 as d, export_default$6 as f, export_default$10 as g, export_default$9 as h, export_default as i, export_default$3 as l, export_default$8 as m, FocusTrapListener as n, TemplateElement as o, export_default$7 as p, _default as r, TemplateRef as s, isSSR as t, export_default$4 as u, export_default$11 as v };
|
|
73
|
+
//# sourceMappingURL=index-Bf3XnnIf.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-Bf3XnnIf.d.ts","names":[],"sources":["../src/util/animationFrameDebounce.ts","../src/util/flattenVNodeTree.ts","../src/util/getBidirectionalFocusElement.ts","../src/util/getComponentName.ts","../src/util/getComponentProps.ts","../src/util/getExposedRef.ts","../src/util/getFocusableElement.ts","../src/util/getFocusableElements.ts","../src/util/getKeyboardFocusableElements.ts","../src/util/isActiveElement.ts","../src/util/unrefTemplateElement.ts","../src/util/warn.ts","../src/util/wrapFocus.ts","../src/util/focusTrap.ts","../src/util/index.ts"],"mappings":";;;;iBAAsC,iBAAA,iBAEG,gBAAA,QAAwB,EAAA,EAAI,CAAA,GAAI,CAAA;;;iBCAjD,gBAAA,CAAiB,MAAA,EAAQ,KAAA,KAAU,KAAA;;;mCCAlC,SAAA,EAAW,WAAA,EAAa,cAAA,EAAgB,WAAA,EAAa,SAAA,qCAA8C,WAAA;;;iBCFjG,gBAAA,CAEF,SAAW,EAAA,aAAA;AAAA,KAU/B,aAAA;EAAA,SACQ,IAAA,EAAM,KA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
|
5
|
+
beforeUnmount(elm: HTMLElement): void;
|
|
6
|
+
mounted(elm: HTMLElement): void;
|
|
7
|
+
getSSRProps(): Record<string, unknown>;
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/directive/heightTransition.d.ts
|
|
11
|
+
declare const _default: Directive;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { _default$1 as n, _default as t };
|
|
14
|
+
//# sourceMappingURL=index-ZutYFtKs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-ZutYFtKs.d.ts","names":[],"sources":["../src/directive/focusTrap.ts","../src/directive/heightTransition.ts"],"mappings":";;;cA8DA,UAAA;EACI,aAAA,CAAc,GAAA,EAAK,WAAA;EAMnB,OAAA,CAAQ,GAAA,EAAK,WAAA;EAMb,WAAA,IAAe,MAAA;AAAA;;;cCnCnB,QAAA,EAgByB,SAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { a as export_default$15, c as export_default$21, d as defaultAnnounce, f as useKeyboardGrab, g as export_default$10, h as export_default$11, i as export_default$16, l as export_default$20, m as export_default$12, n as export_default$18, o as export_default$23, p as export_default$13, r as export_default$17, s as export_default$22, t as export_default$19, u as export_default$14 } from "./index-BXp0Gr5f.js";
|
|
2
|
+
import { _ as flattenVNodeTree, a as export_default$24, c as export_default$9, d as export_default$6, f as export_default$5, g as export_default$1, h as export_default$2, i as export_default$25, l as export_default$8, m as export_default$3, n as FocusTrapListener, o as TemplateElement, p as export_default$4, r as _default, s as TemplateRef, t as isSSR, u as export_default$7, v as export_default } from "./index-Bf3XnnIf.js";
|
|
3
|
+
import { amber100, amber200, amber300, amber400, amber50, amber500, amber600, amber700, amber800, amber900, amber950, blue100, blue200, blue300, blue400, blue50, blue500, blue600, blue700, blue800, blue900, blue950, cyan100, cyan200, cyan300, cyan400, cyan50, cyan500, cyan600, cyan700, cyan800, cyan900, cyan950, emerald100, emerald200, emerald300, emerald400, emerald50, emerald500, emerald600, emerald700, emerald800, emerald900, emerald950, fuchsia100, fuchsia200, fuchsia300, fuchsia400, fuchsia50, fuchsia500, fuchsia600, fuchsia700, fuchsia800, fuchsia900, fuchsia950, gray100, gray200, gray300, gray400, gray50, gray500, gray600, gray700, gray800, gray900, gray950, green100, green200, green300, green400, green50, green500, green600, green700, green800, green900, green950, indigo100, indigo200, indigo300, indigo400, indigo50, indigo500, indigo600, indigo700, indigo800, indigo900, indigo950, lime100, lime200, lime300, lime400, lime50, lime500, lime600, lime700, lime800, lime900, lime950, neutral100, neutral200, neutral300, neutral400, neutral50, neutral500, neutral600, neutral700, neutral800, neutral900, neutral950, orange100, orange200, orange300, orange400, orange50, orange500, orange600, orange700, orange800, orange900, orange950, pink100, pink200, pink300, pink400, pink50, pink500, pink600, pink700, pink800, pink900, pink950, purple100, purple200, purple300, purple400, purple50, purple500, purple600, purple700, purple800, purple900, purple950, red100, red200, red300, red400, red50, red500, red600, red700, red800, red900, red950, rose100, rose200, rose300, rose400, rose50, rose500, rose600, rose700, rose800, rose900, rose950, sky100, sky200, sky300, sky400, sky50, sky500, sky600, sky700, sky800, sky900, sky950, slate100, slate200, slate300, slate400, slate50, slate500, slate600, slate700, slate800, slate900, slate950, stone100, stone200, stone300, stone400, stone50, stone500, stone600, stone700, stone800, stone900, stone950, teal100, teal200, teal300, teal400, teal50, teal500, teal600, teal700, teal800, teal900, teal950, violet100, violet200, violet300, violet400, violet50, violet500, violet600, violet700, violet800, violet900, violet950, yellow100, yellow200, yellow300, yellow400, yellow50, yellow500, yellow600, yellow700, yellow800, yellow900, yellow950, zinc100, zinc200, zinc300, zinc400, zinc50, zinc500, zinc600, zinc700, zinc800, zinc900, zinc950 } from "./data/index.js";
|
|
4
|
+
import { n as _default$1, t as _default$2 } from "./index-ZutYFtKs.js";
|
|
5
|
+
export { _default as FOCUS_TRAP_LOCKS, type FocusTrapListener, type TemplateElement, type TemplateRef, amber100, amber200, amber300, amber400, amber50, amber500, amber600, amber700, amber800, amber900, amber950, export_default as animationFrameDebounce, blue100, blue200, blue300, blue400, blue50, blue500, blue600, blue700, blue800, blue900, blue950, cyan100, cyan200, cyan300, cyan400, cyan50, cyan500, cyan600, cyan700, cyan800, cyan900, cyan950, defaultAnnounce as defaultKeyboardGrabAnnounce, emerald100, emerald200, emerald300, emerald400, emerald50, emerald500, emerald600, emerald700, emerald800, emerald900, emerald950, flattenVNodeTree, fuchsia100, fuchsia200, fuchsia300, fuchsia400, fuchsia50, fuchsia500, fuchsia600, fuchsia700, fuchsia800, fuchsia900, fuchsia950, export_default$1 as getBidirectionalFocusElement, export_default$2 as getComponentName, export_default$3 as getComponentProps, export_default$4 as getExposedRef, export_default$5 as getFocusableElement, export_default$6 as getFocusableElements, export_default$7 as getKeyboardFocusableElements, gray100, gray200, gray300, gray400, gray50, gray500, gray600, gray700, gray800, gray900, gray950, green100, green200, green300, green400, green50, green500, green600, green700, green800, green900, green950, indigo100, indigo200, indigo300, indigo400, indigo50, indigo500, indigo600, indigo700, indigo800, indigo900, indigo950, export_default$8 as isActiveElement, isSSR, lime100, lime200, lime300, lime400, lime50, lime500, lime600, lime700, lime800, lime900, lime950, neutral100, neutral200, neutral300, neutral400, neutral50, neutral500, neutral600, neutral700, neutral800, neutral900, neutral950, orange100, orange200, orange300, orange400, orange50, orange500, orange600, orange700, orange800, orange900, orange950, pink100, pink200, pink300, pink400, pink50, pink500, pink600, pink700, pink800, pink900, pink950, purple100, purple200, purple300, purple400, purple50, purple500, purple600, purple700, purple800, purple900, purple950, red100, red200, red300, red400, red50, red500, red600, red700, red800, red900, red950, rose100, rose200, rose300, rose400, rose50, rose500, rose600, rose700, rose800, rose900, rose950, sky100, sky200, sky300, sky400, sky50, sky500, sky600, sky700, sky800, sky900, sky950, slate100, slate200, slate300, slate400, slate50, slate500, slate600, slate700, slate800, slate900, slate950, stone100, stone200, stone300, stone400, stone50, stone500, stone600, stone700, stone800, stone900, stone950, teal100, teal200, teal300, teal400, teal50, teal500, teal600, teal700, teal800, teal900, teal950, export_default$9 as unrefTemplateElement, export_default$10 as useCalendar, export_default$11 as useCalendarMonthSwitcher, export_default$12 as useCalendarTimeGrid, export_default$13 as useCalendarYearSwitcher, export_default$14 as useEventListener, export_default$15 as useFocusTrap, export_default$16 as useFocusTrapLock, export_default$17 as useFocusTrapReturn, export_default$18 as useFocusTrapSubscription, export_default$19 as useFocusZone, export_default$20 as useInView, useKeyboardGrab, export_default$21 as useRemembered, export_default$22 as useScrollEdges, export_default$23 as useScrollPosition, _default$1 as vFocusTrap, _default$2 as vHeightTransition, violet100, violet200, violet300, violet400, violet50, violet500, violet600, violet700, violet800, violet900, violet950, export_default$24 as warn, export_default$25 as wrapFocus, yellow100, yellow200, yellow300, yellow400, yellow50, yellow500, yellow600, yellow700, yellow800, yellow900, yellow950, zinc100, zinc200, zinc300, zinc400, zinc50, zinc500, zinc600, zinc700, zinc800, zinc900, zinc950 };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
import{computed as E,ref as _,unref as b}from"vue";function N(e,t){let o=_(!1),n=_(e),s=E(()=>{let c=[],m=b(n).month,h=b(n).startOf("month");do c.push(h),h=h.plus({day:1});while(h.month===m);let y=c[0],T=c[c.length-1];for(let x=1;x<y.weekday;++x)c.unshift(y.minus({day:x}));for(let x=T.weekday+1;x<=7;++x)c.push(T.plus({day:x-T.weekday}));while(c.length/7<6){let x=c[c.length-1];for(let S=1;S<=7;++S)c.push(x.plus({day:S}))}return c}),r=E(()=>b(s).slice(0,7).map((c)=>c.toLocaleString({weekday:t?.weekDayLength??"short"}))),i=E(()=>b(n).plus({month:1})),a=E(()=>b(n).minus({month:1})),f=E(()=>b(n).toLocaleString({month:t?.monthLength??"long"})),l=E(()=>b(n).year.toString());function u(c){o.value=n.value>c,n.value=c}function v(){u(b(n).plus({month:1}))}function L(){u(b(n).minus({month:1}))}return{isTransitioningToPast:o,viewDate:n,viewDateNext:i,viewDatePrevious:a,viewMonth:f,viewYear:l,dates:s,days:r,setViewDate:u,nextMonth:v,previousMonth:L}}import{computed as me,unref as xe}from"vue";function U(e,t){return{months:me(()=>{let n=[],s=xe(e),r=s.startOf("year");while(r.month<=12&&r.year===s.year)n.push({date:r,label:r.toLocaleString({month:t})}),r=r.plus({months:1});return n})}}import{computed as be,ref as he,unref as P,watch as ye}from"vue";function K(e,t=10){let o=he(0),n=be(()=>{let i=P(e).year,a=[],f=i-i%t+P(o)*t;for(let l=0;l<t;++l)a.push(f+l);return a});function s(){++o.value}function r(){--o.value}return ye(e,()=>o.value=0),{years:n,next:s,previous:r}}import{onMounted as De,onUnmounted as Ae,ref as Se,unref as Y,watchEffect as Ie}from"vue";import{Fragment as Te}from"vue";function z(e){let t=[];for(let o of e){if(o.type===Te&&Array.isArray(o.children)){t.push(...o.children);continue}t.push(o)}return t}import{isHtmlElement as ve}from"@basmilius/utils";var Ee=["a:not([disabled])","button:not([disabled])","input[type=checkbox]:not([disabled])","input[type=radio]:not([disabled])","input[type=text]:not([disabled])",'[tabindex]:not([disabled]):not([tabindex="-1"])'].join(",");function d(e){return Array.from(e.querySelectorAll(Ee)).filter(ve).filter((t)=>t.offsetWidth>0||t.offsetHeight>0||t===document.activeElement)}function M(e,t,o){let n=d(e),s=n.indexOf(t);if(s===-1)return null;let r=Le(n);ge(r,s,o);let i=we(s,o,r,n);if(!i){if(o==="up"||o==="left")i=n[s-1];if(o==="down"||o==="right")i=n[s+1]}return i}function ge(e,t,o){let n=e[t];e.forEach((s)=>{let r=s.center;switch(o){case"up":r={x:r.x,y:s.top+s.height};break;case"down":r={x:r.x,y:s.top};break;case"left":r={x:s.left+s.width,y:r.y};break;case"right":r={x:s.left,y:r.y};break}s.distance=Math.sqrt(Math.pow(n.center.x-r.x,2)+Math.pow(n.center.y-r.y,2))})}function we(e,t,o,n){let s=o[e],r=[];switch(t){case"up":r=o.map((a,f)=>f===e||a.top+a.height>s.top?Number.MAX_SAFE_INTEGER:a.distance);break;case"down":r=o.map((a,f)=>f===e||a.top<s.top+s.height?Number.MAX_SAFE_INTEGER:a.distance);break;case"left":r=o.map((a,f)=>f===e||a.left+a.width>s.left?Number.MAX_SAFE_INTEGER:a.distance);break;case"right":r=o.map((a,f)=>f===e||a.left<s.left+s.width?Number.MAX_SAFE_INTEGER:a.distance);break}let i=r.indexOf(Math.min(...r));if(r[i]!==Number.MAX_SAFE_INTEGER)return n[i];return null}function Le(e){return e.map((t)=>t.getBoundingClientRect()).map((t)=>({height:t.height,width:t.width,top:t.top,left:t.left,right:t.right,bottom:t.bottom,center:{x:t.left+t.width/2,y:t.top+t.height/2},distance:0}))}function B(e){let t="UnknownComponent";if(e.type&&e.type.__name)t=e.type.__name;return t}import{camelCase as Me}from"lodash-es";function V(e){return Object.fromEntries(Object.entries(e.props??{}).map(([t,o])=>[Me(t),o]))}function q(e,t){if(!e.exposed||!(t in e.exposed))throw new Error(`'${t}' was not exposed by the component.`);return e.exposed[t]}import{isHtmlElement as Re}from"@basmilius/utils";function R(e,t,o=void 0){let n=d(e),s=o||document.activeElement;if(!s||!Re(s))return n[0]||void 0;let r=n.indexOf(s);return n[r+t]||void 0}function F(e){return Array.from(e.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter((t)=>!t.hasAttribute("disabled")||t.getAttribute("disabled")!=="true").filter((t)=>!t.hasAttribute("aria-disabled")||t.getAttribute("aria-disabled")!=="true")}import{isHtmlElement as Fe}from"@basmilius/utils";import{unref as ke}from"vue";function p(e){let t=ke(e);if(Fe(t))return t;return t?.$el}function W(...e){console.warn("[Flux]",...e)}function g(e,t,o=!1){let n=He(e),s=t.compareDocumentPosition(e),r;if(s&&Node.DOCUMENT_POSITION_PRECEDING||o)r=n.firstChild();else r=n.lastChild();(r!==null?r:e).focus()}function He(e){return document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:(t)=>t.tabIndex>=0&&!t.disabled?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP})}class G{get active(){return this.current?.isEnabled??!1}get current(){return this.#e[this.#e.length-1]??null}#t=[];#e=[];add(e,t,o=!0){let n={id:e,setEnabled:t,isEnabled:!0};if(this.current&&this.toggle(this.current,!1),this.#e.push(n),o)this.toggle(n,!0),this.emit()}remove(e){let t=this.#e.find((s)=>s.id===e);t&&this.toggle(t,!1);let n=this.current?.id===e;this.#e=this.#e.filter((s)=>s.id!==e),n&&this.current&&this.toggle(this.current,!0),this.emit()}emit(){this.#t.forEach((e)=>e(this.active,this.#e))}subscribe(e){return this.#t.push(e),e(this.active,this.#e),()=>this.#t=this.#t.filter((t)=>t!==e)}toggle(e,t){e.setEnabled(t),e.isEnabled=t}}var w=new G;var X=!globalThis.document;function j(e,t,o){let n=Se([]);De(()=>{document.addEventListener("pointerdown",s)}),Ae(()=>{document.removeEventListener("pointerdown",s)});function s(r){if(!Y(t))return;!Y(n).some((a)=>a.contains(r.target))&&o(r)}Ie(()=>{let r=[];(Array.isArray(e)?e:[e]).forEach((i)=>{let a=p(i);a&&r.push(a)}),n.value=r})}import{computed as Oe,getCurrentInstance as Ce}from"vue";function Z(){let e=Ce();return Oe(()=>e?.uid??(e?.proxy)._uid??0)}import{customRef as _e,isRef as $,ref as Ne,watch as Ue}from"vue";function J(e,t,o=!1){let n=Ne($(e)?e.value:e),s=_e((r,i)=>({get(){return r(),n.value},set:Pe((a)=>{n.value=a,i()},t,o)}));if($(e))Ue(e,(r)=>s.value=r);return s}function Pe(e,t,o=!1){let n;return(...s)=>{if(o&&!n)e(...s);clearTimeout(n),n=setTimeout(()=>requestAnimationFrame(()=>e(...s)),t)}}import{watch as Ke}from"vue";function k(e,t,o,n={passive:!0}){Ke(e,(s,r,i)=>{if(!s)return;s.addEventListener(t,o,n),i(()=>s.removeEventListener(t,o))},{immediate:!0})}import{onMounted as ze,onUnmounted as Be,ref as Ve,unref as qe}from"vue";function Q(e,t){let o=Ve();ze(()=>{s()}),Be(()=>{clearTimeout(o.value)});function n(){o.value=setTimeout(()=>requestAnimationFrame(s),qe(e))}function s(){n(),t()}}import{ref as We,watch as Ge}from"vue";function ee(e,t={}){let o=We(t.initial??!1);return Ge(e,(n,s,r)=>{let i=p(e);if(!i)return;let a=new IntersectionObserver((f)=>o.value=f[0]?.isIntersecting??!1,t);a.observe(i),r(()=>a.disconnect())},{immediate:!0}),o}import{onScopeDispose as Xe,watch as Ye}from"vue";function H(e,t,o){o??={attributes:!0};let n,s=Ye(()=>p(e),(a)=>{if(r(),!a)return;n=new MutationObserver(t),n.observe(a,o)},{immediate:!0});function r(){if(!n)return;n.disconnect(),n=void 0}function i(){r(),s()}Xe(i)}import{DateTime as te}from"luxon";import{ref as je,watch as Ze}from"vue";function oe(e,t){let o=`flux/${e}`,n=je(s()??t);function s(){if(o in localStorage){let r=JSON.parse(localStorage.getItem(o));if(Array.isArray(r)&&r[0]==="DateTime")r=te.fromISO(r[1]);return r}return null}return Ze(n,(r)=>{let i=r;if(te.isDateTime(r))i=["DateTime",r.toISO({includeOffset:!0,extendedZone:!0})];localStorage.setItem(o,JSON.stringify(i))}),n}import{ref as I,unref as $e}from"vue";function ne(e){let t=I(0),o=I(0);if(!e)e=I(document);return k(e,"scroll",()=>{let n=$e(e);if(n instanceof Document)n=n.scrollingElement;t.value=n?.scrollLeft??0,o.value=n?.scrollTop??0}),{x:t,y:o}}import{ref as ie,watch as ce}from"vue";import{onMounted as Je,onUnmounted as Qe,ref as re,unref as se}from"vue";var et=0;function D(e=!1){let t=re(`focus-trap-${++et}`),o=re(!1);return Je(()=>w.add(se(t),(n)=>o.value=n,e)),Qe(()=>w.remove(se(t))),o}import{onUnmounted as tt,ref as ot,unref as ae}from"vue";function A(e){let t=ot(document.activeElement);tt(()=>{if(ae(e))return;requestAnimationFrame(()=>ae(t)?.focus())})}function le(e,t={}){if(X)return;let{disable:o=ie(!1),disableReturn:n=ie(!1),attachTo:s=null}=t,r=D(!o);A(n),ce(e,(i,a,f)=>{let l=p(e),u=s||document;if(r.value&&l&&document.activeElement&&!l.contains(document.activeElement)&&!l.querySelector("[autofocus]"))g(l,document.activeElement,!0);function v(c){if(!r.value||!l)return;let m=c.target||document.body;if(l.contains(m))return;c.preventDefault(),c.stopImmediatePropagation(),g(l,m)}function L(c){if(!r.value||!l)return;if(!c.relatedTarget||c.relatedTarget===document.body)c.preventDefault(),l.focus();let m=c.target||document.body;if(l.contains(m))return;g(l,m)}if(u.addEventListener("focusin",v,{capture:!0}),u.addEventListener("focusout",L,{capture:!0}),l){let c=d(l),m=c.findIndex((T)=>T.classList.contains("is-active")),h=c.findIndex((T)=>!T.hasAttribute("aria-disabled")),y=c[0];if(m>-1)y=c[m];if(h>-1)y=c[h];if(y)y.focus()}f(()=>{u.removeEventListener("focusin",v),u.removeEventListener("focusout",L)})},{immediate:!0}),ce(()=>o,()=>{let i=p(e);if(r.value=!o,o||!i)return;let a=d(i);if(a.includes(document.activeElement))return;a[0]?.focus()},{immediate:!0})}import{onMounted as nt,onUnmounted as rt,ref as st}from"vue";function fe(e){let t=st(null);nt(()=>t.value=w.subscribe(e)),rt(()=>t.value?.())}import{watch as at}from"vue";function pe(e,{cycle:t=!0,direction:o="bidirectional"}={}){H(e,()=>s(n(),!1));function n(){let i=p(e),a=d(i),f=a.findIndex((u)=>u.classList.contains("is-active")),l=a.findIndex((u)=>!u.hasAttribute("aria-disabled"));if(f>-1)return f;if(l>-1)return l;return 0}function s(i,a=!0){let f=p(e),l=d(f);l.forEach((u,v)=>u.tabIndex=v===i?0:-1),a&&l[i]?.focus()}function r(i){let a=p(e),f=d(a);if(["Enter"," "].includes(i.key))return;switch(o){case"bidirectional":it(i,a,f,s);break;case"horizontal":case"vertical":ct(i,a,t,o,f,s);break}}at(e,(i,a,f)=>{let l=p(e);if(!l)return;l.addEventListener("keydown",r),s(n(),!1),f(()=>l.removeEventListener("keydown",r))},{immediate:!0})}function it(e,t,o,n){let s;switch(e.key){case"ArrowUp":s="up";break;case"ArrowDown":s="down";break;case"ArrowLeft":s="left";break;case"ArrowRight":s="right";break;default:return}let r=M(t,document.activeElement,s);if(r)n(o.indexOf(r));e.preventDefault()}function ct(e,t,o,n,s,r){let i;if(e.key===(n==="horizontal"?"ArrowLeft":"ArrowUp"))i=-1;else if(e.key===(n==="horizontal"?"ArrowRight":"ArrowDown"))i=1;else return;let a=R(t,i);if(a)r(s.indexOf(a));else if(o)r(i===1?0:s.length-1);e.preventDefault()}var nn="#f8fafc",rn="#f1f5f9",sn="#e2e8f0",an="#cbd5e1",cn="#94a3b8",ln="#64748b",fn="#475569",pn="#334155",un="#1e293b",dn="#0f172a",mn="#020617",xn="#f9fafb",bn="#f3f4f6",hn="#e5e7eb",yn="#d1d5db",Tn="#9ca3af",vn="#6b7280",En="#4b5563",gn="#374151",wn="#1f2937",Ln="#111827",Mn="#030712",Rn="#fafafa",Fn="#f4f4f5",kn="#e4e4e7",Hn="#d4d4d8",Dn="#a1a1aa",An="#71717a",Sn="#52525b",In="#3f3f46",On="#27272a",Cn="#18181b",_n="#09090b",Nn="#fafafa",Un="#f5f5f5",Pn="#e5e5e5",Kn="#d4d4d4",zn="#a3a3a3",Bn="#737373",Vn="#525252",qn="#404040",Wn="#262626",Gn="#171717",Xn="#0a0a0a",Yn="#fafaf9",jn="#f5f5f4",Zn="#e7e5e4",$n="#d6d3d1",Jn="#a8a29e",Qn="#78716c",er="#57534e",tr="#44403c",or="#292524",nr="#1c1917",rr="#0c0a09",sr="#fef2f2",ar="#fee2e2",ir="#fecaca",cr="#fca5a5",lr="#f87171",fr="#ef4444",pr="#dc2626",ur="#b91c1c",dr="#991b1b",mr="#7f1d1d",xr="#450a0a",br="#fff7ed",hr="#ffedd5",yr="#fed7aa",Tr="#fdba74",vr="#fb923c",Er="#f97316",gr="#ea580c",wr="#c2410c",Lr="#9a3412",Mr="#7c2d12",Rr="#431407",Fr="#fffbeb",kr="#fef3c7",Hr="#fde68a",Dr="#fcd34d",Ar="#fbbf24",Sr="#f59e0b",Ir="#d97706",Or="#b45309",Cr="#92400e",_r="#78350f",Nr="#451a03",Ur="#fefce8",Pr="#fef9c3",Kr="#fef08a",zr="#fde047",Br="#facc15",Vr="#eab308",qr="#ca8a04",Wr="#a16207",Gr="#854d0e",Xr="#713f12",Yr="#422006",jr="#f7fee7",Zr="#ecfccb",$r="#d9f99d",Jr="#bef264",Qr="#a3e635",es="#84cc16",ts="#65a30d",os="#4d7c0f",ns="#3f6212",rs="#365314",ss="#1a2e05",as="#f0fdf4",is="#dcfce7",cs="#bbf7d0",ls="#86efac",fs="#4ade80",ps="#22c55e",us="#16a34a",ds="#15803d",ms="#166534",xs="#14532d",bs="#052e16",hs="#ecfdf5",ys="#d1fae5",Ts="#a7f3d0",vs="#6ee7b7",Es="#34d399",gs="#10b981",ws="#059669",Ls="#047857",Ms="#065f46",Rs="#064e3b",Fs="#022c22",ks="#f0fdfa",Hs="#ccfbf1",Ds="#99f6e4",As="#5eead4",Ss="#2dd4bf",Is="#14b8a6",Os="#0d9488",Cs="#0f766e",_s="#115e59",Ns="#134e4a",Us="#042f2e",Ps="#ecfeff",Ks="#cffafe",zs="#a5f3fc",Bs="#67e8f9",Vs="#22d3ee",qs="#06b6d4",Ws="#0891b2",Gs="#0e7490",Xs="#155e75",Ys="#164e63",js="#083344",Zs="#f0f9ff",$s="#e0f2fe",Js="#bae6fd",Qs="#7dd3fc",ea="#38bdf8",ta="#0ea5e9",oa="#0284c7",na="#0369a1",ra="#075985",sa="#0c4a6e",aa="#082f49",ia="#eff6ff",ca="#dbeafe",la="#bfdbfe",fa="#93c5fd",pa="#60a5fa",ua="#3b82f6",da="#2563eb",ma="#1d4ed8",xa="#1e40af",ba="#1e3a8a",ha="#172554",ya="#eef2ff",Ta="#e0e7ff",va="#c7d2fe",Ea="#a5b4fc",ga="#818cf8",wa="#6366f1",La="#4f46e5",Ma="#4338ca",Ra="#3730a3",Fa="#312e81",ka="#1e1b4b",Ha="#f5f3ff",Da="#ede9fe",Aa="#ddd6fe",Sa="#c4b5fd",Ia="#a78bfa",Oa="#8b5cf6",Ca="#7c3aed",_a="#6d28d9",Na="#5b21b6",Ua="#4c1d95",Pa="#2e1065",Ka="#faf5ff",za="#f3e8ff",Ba="#e9d5ff",Va="#d8b4fe",qa="#c084fc",Wa="#a855f7",Ga="#9333ea",Xa="#7e22ce",Ya="#6b21a8",ja="#581c87",Za="#3b0764",$a="#fdf4ff",Ja="#fae8ff",Qa="#f5d0fe",ei="#f0abfc",ti="#e879f9",oi="#d946ef",ni="#c026d3",ri="#a21caf",si="#86198f",ai="#701a75",ii="#4a044e",ci="#fdf2f8",li="#fce7f3",fi="#fbcfe8",pi="#f9a8d4",ui="#f472b6",di="#ec4899",mi="#db2777",xi="#be185d",bi="#9d174d",hi="#831843",yi="#500724",Ti="#fff1f2",vi="#ffe4e6",Ei="#fecdd3",gi="#fda4af",wi="#fb7185",Li="#f43f5e",Mi="#e11d48",Ri="#be123c",Fi="#9f1239",ki="#881337",Hi="#4c0519";class ue{#t;#e;constructor(e){this.#e=[],this.#t=e,this.onKeyDown=this.onKeyDown.bind(this)}focusElement(e,t=!0){if(!this.#e[e])return;for(let o=0;o<this.#e.length;++o)this.#e[o].tabIndex=o===e?0:-1;if(t)this.#e[e]?.focus()}register(){this.#e=F(this.#t),this.#t.addEventListener("keydown",this.onKeyDown),this.focusElement(0,!1)}unregister(){this.#t.removeEventListener("keydown",this.onKeyDown)}onKeyDown(e){let t=this.#t.querySelector('[tabindex="0"]'),o=this.#e.findIndex((n)=>n===t)??0;switch(e.key){case"ArrowUp":case"ArrowLeft":this.focusElement(o-1);break;case"ArrowDown":case"ArrowRight":this.focusElement(o+1);break;default:return}e.preventDefault(),e.stopPropagation()}}var lt={beforeUnmount(e){O.get(e)?.unregister(),O.delete(e)},mounted(e){let t=new ue(e);t.register(),O.set(e,t)}},O=new WeakMap;class de{#t;#e;constructor(e){this.#t=e,this.#e=new MutationObserver(this.onMutation.bind(this))}register(){this.#e.observe(this.#t,{childList:!0,subtree:!0}),requestAnimationFrame(this.onMutation.bind(this))}unregister(){this.#e.disconnect()}onMutation(){let{height:e}=getComputedStyle(this.#t);this.#t.style.height="auto";let{height:t}=getComputedStyle(this.#t);if(this.#t.style.height=e,t===e)return;getComputedStyle(this.#t),requestAnimationFrame(()=>requestAnimationFrame(()=>this.#t.style.height=t))}}var ft={beforeUnmount(e){C.get(e)?.unregister(),C.delete(e)},mounted(e){let t=new de(e);t.register(),C.set(e,t)}},C=new WeakMap;export{_n as zinc950,Cn as zinc900,On as zinc800,In as zinc700,Sn as zinc600,An as zinc500,Rn as zinc50,Dn as zinc400,Hn as zinc300,kn as zinc200,Fn as zinc100,Yr as yellow950,Xr as yellow900,Gr as yellow800,Wr as yellow700,qr as yellow600,Vr as yellow500,Ur as yellow50,Br as yellow400,zr as yellow300,Kr as yellow200,Pr as yellow100,g as wrapFocus,W as warn,Pa as violet950,Ua as violet900,Na as violet800,_a as violet700,Ca as violet600,Oa as violet500,Ha as violet50,Ia as violet400,Sa as violet300,Aa as violet200,Da as violet100,ft as vHeightTransition,lt as vFocusTrap,ne as useScrollPosition,oe as useRemembered,H as useMutationObserver,Q as useInterval,ee as useInView,pe as useFocusZone,fe as useFocusTrapSubscription,A as useFocusTrapReturn,D as useFocusTrapLock,le as useFocusTrap,k as useEventListener,J as useDebouncedRef,Z as useComponentId,j as useClickOutside,K as useCalendarYearSwitcher,U as useCalendarMonthSwitcher,N as useCalendar,p as unrefTemplateElement,Us as teal950,Ns as teal900,_s as teal800,Cs as teal700,Os as teal600,Is as teal500,ks as teal50,Ss as teal400,As as teal300,Ds as teal200,Hs as teal100,rr as stone950,nr as stone900,or as stone800,tr as stone700,er as stone600,Qn as stone500,Yn as stone50,Jn as stone400,$n as stone300,Zn as stone200,jn as stone100,mn as slate950,dn as slate900,un as slate800,pn as slate700,fn as slate600,ln as slate500,nn as slate50,cn as slate400,an as slate300,sn as slate200,rn as slate100,aa as sky950,sa as sky900,ra as sky800,na as sky700,oa as sky600,ta as sky500,Zs as sky50,ea as sky400,Qs as sky300,Js as sky200,$s as sky100,Hi as rose950,ki as rose900,Fi as rose800,Ri as rose700,Mi as rose600,Li as rose500,Ti as rose50,wi as rose400,gi as rose300,Ei as rose200,vi as rose100,xr as red950,mr as red900,dr as red800,ur as red700,pr as red600,fr as red500,sr as red50,lr as red400,cr as red300,ir as red200,ar as red100,Za as purple950,ja as purple900,Ya as purple800,Xa as purple700,Ga as purple600,Wa as purple500,Ka as purple50,qa as purple400,Va as purple300,Ba as purple200,za as purple100,yi as pink950,hi as pink900,bi as pink800,xi as pink700,mi as pink600,di as pink500,ci as pink50,ui as pink400,pi as pink300,fi as pink200,li as pink100,Rr as orange950,Mr as orange900,Lr as orange800,wr as orange700,gr as orange600,Er as orange500,br as orange50,vr as orange400,Tr as orange300,yr as orange200,hr as orange100,Xn as neutral950,Gn as neutral900,Wn as neutral800,qn as neutral700,Vn as neutral600,Bn as neutral500,Nn as neutral50,zn as neutral400,Kn as neutral300,Pn as neutral200,Un as neutral100,ss as lime950,rs as lime900,ns as lime800,os as lime700,ts as lime600,es as lime500,jr as lime50,Qr as lime400,Jr as lime300,$r as lime200,Zr as lime100,X as isSSR,ka as indigo950,Fa as indigo900,Ra as indigo800,Ma as indigo700,La as indigo600,wa as indigo500,ya as indigo50,ga as indigo400,Ea as indigo300,va as indigo200,Ta as indigo100,bs as green950,xs as green900,ms as green800,ds as green700,us as green600,ps as green500,as as green50,fs as green400,ls as green300,cs as green200,is as green100,Mn as gray950,Ln as gray900,wn as gray800,gn as gray700,En as gray600,vn as gray500,xn as gray50,Tn as gray400,yn as gray300,hn as gray200,bn as gray100,F as getKeyboardFocusableElements,d as getFocusableElements,R as getFocusableElement,q as getExposedRef,V as getComponentProps,B as getComponentName,M as getBidirectionalFocusElement,ii as fuchsia950,ai as fuchsia900,si as fuchsia800,ri as fuchsia700,ni as fuchsia600,oi as fuchsia500,$a as fuchsia50,ti as fuchsia400,ei as fuchsia300,Qa as fuchsia200,Ja as fuchsia100,z as flattenVNodeTree,Fs as emerald950,Rs as emerald900,Ms as emerald800,Ls as emerald700,ws as emerald600,gs as emerald500,hs as emerald50,Es as emerald400,vs as emerald300,Ts as emerald200,ys as emerald100,js as cyan950,Ys as cyan900,Xs as cyan800,Gs as cyan700,Ws as cyan600,qs as cyan500,Ps as cyan50,Vs as cyan400,Bs as cyan300,zs as cyan200,Ks as cyan100,ha as blue950,ba as blue900,xa as blue800,ma as blue700,da as blue600,ua as blue500,ia as blue50,pa as blue400,fa as blue300,la as blue200,ca as blue100,Nr as amber950,_r as amber900,Cr as amber800,Or as amber700,Ir as amber600,Sr as amber500,Fr as amber50,Ar as amber400,Dr as amber300,Hr as amber200,kr as amber100,w as FOCUS_TRAP_LOCKS};
|
|
2
|
-
|
|
3
|
-
//# debugId=87BCF3546FF8C71064756E2164756E21
|
|
4
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import{a as e,c as t,d as n,f as r,g as i,h as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,s as p,t as m,u as h}from"./composable-DPolUL3R.js";import{a as g,c as _,d as v,f as y,h as b,i as x,l as S,m as C,n as w,o as T,p as E,r as D,s as O,t as k,u as A}from"./util-BGzD1ED0.js";import{amber100 as j,amber200 as M,amber300 as N,amber400 as P,amber50 as F,amber500 as I,amber600 as L,amber700 as R,amber800 as z,amber900 as B,amber950 as V,blue100 as H,blue200 as U,blue300 as W,blue400 as G,blue50 as K,blue500 as q,blue600 as J,blue700 as Y,blue800 as X,blue900 as Z,blue950 as Q,cyan100 as $,cyan200 as ee,cyan300 as te,cyan400 as ne,cyan50 as re,cyan500 as ie,cyan600 as ae,cyan700 as oe,cyan800 as se,cyan900 as ce,cyan950 as le,emerald100 as ue,emerald200 as de,emerald300 as fe,emerald400 as pe,emerald50 as me,emerald500 as he,emerald600 as ge,emerald700 as _e,emerald800 as ve,emerald900 as ye,emerald950 as be,fuchsia100 as xe,fuchsia200 as Se,fuchsia300 as Ce,fuchsia400 as we,fuchsia50 as Te,fuchsia500 as Ee,fuchsia600 as De,fuchsia700 as Oe,fuchsia800 as ke,fuchsia900 as Ae,fuchsia950 as je,gray100 as Me,gray200 as Ne,gray300 as Pe,gray400 as Fe,gray50 as Ie,gray500 as Le,gray600 as Re,gray700 as ze,gray800 as Be,gray900 as Ve,gray950 as He,green100 as Ue,green200 as We,green300 as Ge,green400 as Ke,green50 as qe,green500 as Je,green600 as Ye,green700 as Xe,green800 as Ze,green900 as Qe,green950 as $e,indigo100 as et,indigo200 as tt,indigo300 as nt,indigo400 as rt,indigo50 as it,indigo500 as at,indigo600 as ot,indigo700 as st,indigo800 as ct,indigo900 as lt,indigo950 as ut,lime100 as dt,lime200 as ft,lime300 as pt,lime400 as mt,lime50 as ht,lime500 as gt,lime600 as _t,lime700 as vt,lime800 as yt,lime900 as bt,lime950 as xt,neutral100 as St,neutral200 as Ct,neutral300 as wt,neutral400 as Tt,neutral50 as Et,neutral500 as Dt,neutral600 as Ot,neutral700 as kt,neutral800 as At,neutral900 as jt,neutral950 as Mt,orange100 as Nt,orange200 as Pt,orange300 as Ft,orange400 as It,orange50 as Lt,orange500 as Rt,orange600 as zt,orange700 as Bt,orange800 as Vt,orange900 as Ht,orange950 as Ut,pink100 as Wt,pink200 as Gt,pink300 as Kt,pink400 as qt,pink50 as Jt,pink500 as Yt,pink600 as Xt,pink700 as Zt,pink800 as Qt,pink900 as $t,pink950 as en,purple100 as tn,purple200 as nn,purple300 as rn,purple400 as an,purple50 as on,purple500 as sn,purple600 as cn,purple700 as ln,purple800 as un,purple900 as dn,purple950 as fn,red100 as pn,red200 as mn,red300 as hn,red400 as gn,red50 as _n,red500 as vn,red600 as yn,red700 as bn,red800 as xn,red900 as Sn,red950 as Cn,rose100 as wn,rose200 as Tn,rose300 as En,rose400 as Dn,rose50 as On,rose500 as kn,rose600 as An,rose700 as jn,rose800 as Mn,rose900 as Nn,rose950 as Pn,sky100 as Fn,sky200 as In,sky300 as Ln,sky400 as Rn,sky50 as zn,sky500 as Bn,sky600 as Vn,sky700 as Hn,sky800 as Un,sky900 as Wn,sky950 as Gn,slate100 as Kn,slate200 as qn,slate300 as Jn,slate400 as Yn,slate50 as Xn,slate500 as Zn,slate600 as Qn,slate700 as $n,slate800 as er,slate900 as tr,slate950 as nr,stone100 as rr,stone200 as ir,stone300 as ar,stone400 as or,stone50 as sr,stone500 as cr,stone600 as lr,stone700 as ur,stone800 as dr,stone900 as fr,stone950 as pr,teal100 as mr,teal200 as hr,teal300 as gr,teal400 as _r,teal50 as vr,teal500 as yr,teal600 as br,teal700 as xr,teal800 as Sr,teal900 as Cr,teal950 as wr,violet100 as Tr,violet200 as Er,violet300 as Dr,violet400 as Or,violet50 as kr,violet500 as Ar,violet600 as jr,violet700 as Mr,violet800 as Nr,violet900 as Pr,violet950 as Fr,yellow100 as Ir,yellow200 as Lr,yellow300 as Rr,yellow400 as zr,yellow50 as Br,yellow500 as Vr,yellow600 as Hr,yellow700 as Ur,yellow800 as Wr,yellow900 as Gr,yellow950 as Kr,zinc100 as qr,zinc200 as Jr,zinc300 as Yr,zinc400 as Xr,zinc50 as Zr,zinc500 as Qr,zinc600 as $r,zinc700 as ei,zinc800 as ti,zinc900 as ni,zinc950 as ri}from"./data/index.js";import{n as ii,t as ai}from"./directive-Bti3pKwZ.js";export{w as FOCUS_TRAP_LOCKS,j as amber100,M as amber200,N as amber300,P as amber400,F as amber50,I as amber500,L as amber600,R as amber700,z as amber800,B as amber900,V as amber950,b as animationFrameDebounce,H as blue100,U as blue200,W as blue300,G as blue400,K as blue50,q as blue500,J as blue600,Y as blue700,X as blue800,Z as blue900,Q as blue950,$ as cyan100,ee as cyan200,te as cyan300,ne as cyan400,re as cyan50,ie as cyan500,ae as cyan600,oe as cyan700,se as cyan800,ce as cyan900,le as cyan950,n as defaultKeyboardGrabAnnounce,ue as emerald100,de as emerald200,fe as emerald300,pe as emerald400,me as emerald50,he as emerald500,ge as emerald600,_e as emerald700,ve as emerald800,ye as emerald900,be as emerald950,C as flattenVNodeTree,xe as fuchsia100,Se as fuchsia200,Ce as fuchsia300,we as fuchsia400,Te as fuchsia50,Ee as fuchsia500,De as fuchsia600,Oe as fuchsia700,ke as fuchsia800,Ae as fuchsia900,je as fuchsia950,y as getBidirectionalFocusElement,v as getComponentName,A as getComponentProps,S as getExposedRef,_ as getFocusableElement,E as getFocusableElements,O as getKeyboardFocusableElements,Me as gray100,Ne as gray200,Pe as gray300,Fe as gray400,Ie as gray50,Le as gray500,Re as gray600,ze as gray700,Be as gray800,Ve as gray900,He as gray950,Ue as green100,We as green200,Ge as green300,Ke as green400,qe as green50,Je as green500,Ye as green600,Xe as green700,Ze as green800,Qe as green900,$e as green950,et as indigo100,tt as indigo200,nt as indigo300,rt as indigo400,it as indigo50,at as indigo500,ot as indigo600,st as indigo700,ct as indigo800,lt as indigo900,ut as indigo950,T as isActiveElement,k as isSSR,dt as lime100,ft as lime200,pt as lime300,mt as lime400,ht as lime50,gt as lime500,_t as lime600,vt as lime700,yt as lime800,bt as lime900,xt as lime950,St as neutral100,Ct as neutral200,wt as neutral300,Tt as neutral400,Et as neutral50,Dt as neutral500,Ot as neutral600,kt as neutral700,At as neutral800,jt as neutral900,Mt as neutral950,Nt as orange100,Pt as orange200,Ft as orange300,It as orange400,Lt as orange50,Rt as orange500,zt as orange600,Bt as orange700,Vt as orange800,Ht as orange900,Ut as orange950,Wt as pink100,Gt as pink200,Kt as pink300,qt as pink400,Jt as pink50,Yt as pink500,Xt as pink600,Zt as pink700,Qt as pink800,$t as pink900,en as pink950,tn as purple100,nn as purple200,rn as purple300,an as purple400,on as purple50,sn as purple500,cn as purple600,ln as purple700,un as purple800,dn as purple900,fn as purple950,pn as red100,mn as red200,hn as red300,gn as red400,_n as red50,vn as red500,yn as red600,bn as red700,xn as red800,Sn as red900,Cn as red950,wn as rose100,Tn as rose200,En as rose300,Dn as rose400,On as rose50,kn as rose500,An as rose600,jn as rose700,Mn as rose800,Nn as rose900,Pn as rose950,Fn as sky100,In as sky200,Ln as sky300,Rn as sky400,zn as sky50,Bn as sky500,Vn as sky600,Hn as sky700,Un as sky800,Wn as sky900,Gn as sky950,Kn as slate100,qn as slate200,Jn as slate300,Yn as slate400,Xn as slate50,Zn as slate500,Qn as slate600,$n as slate700,er as slate800,tr as slate900,nr as slate950,rr as stone100,ir as stone200,ar as stone300,or as stone400,sr as stone50,cr as stone500,lr as stone600,ur as stone700,dr as stone800,fr as stone900,pr as stone950,mr as teal100,hr as teal200,gr as teal300,_r as teal400,vr as teal50,yr as teal500,br as teal600,xr as teal700,Sr as teal800,Cr as teal900,wr as teal950,g as unrefTemplateElement,i as useCalendar,a as useCalendarMonthSwitcher,c as useCalendarTimeGrid,d as useCalendarYearSwitcher,h as useEventListener,f as useFocusTrap,e as useFocusTrapLock,o as useFocusTrapReturn,l as useFocusTrapSubscription,m as useFocusZone,s as useInView,r as useKeyboardGrab,t as useRemembered,p as useScrollEdges,u as useScrollPosition,ii as vFocusTrap,ai as vHeightTransition,Tr as violet100,Er as violet200,Dr as violet300,Or as violet400,kr as violet50,Ar as violet500,jr as violet600,Mr as violet700,Nr as violet800,Pr as violet900,Fr as violet950,x as warn,D as wrapFocus,Ir as yellow100,Lr as yellow200,Rr as yellow300,zr as yellow400,Br as yellow50,Vr as yellow500,Hr as yellow600,Ur as yellow700,Wr as yellow800,Gr as yellow900,Kr as yellow950,qr as zinc100,Jr as zinc200,Yr as zinc300,Xr as zinc400,Zr as zinc50,Qr as zinc500,$r as zinc600,ei as zinc700,ti as zinc800,ni as zinc900,ri as zinc950};
|
package/dist/util/index.d.ts
CHANGED
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
export { default as getComponentName } from "./getComponentName";
|
|
4
|
-
export { default as getComponentProps } from "./getComponentProps";
|
|
5
|
-
export { default as getExposedRef } from "./getExposedRef";
|
|
6
|
-
export { default as getFocusableElement } from "./getFocusableElement";
|
|
7
|
-
export { default as getFocusableElements } from "./getFocusableElements";
|
|
8
|
-
export { default as getKeyboardFocusableElements } from "./getKeyboardFocusableElements";
|
|
9
|
-
export { default as unrefTemplateElement, type TemplateElement, type TemplateRef } from "./unrefTemplateElement";
|
|
10
|
-
export { default as warn } from "./warn";
|
|
11
|
-
export { default as wrapFocus } from "./wrapFocus";
|
|
12
|
-
export { default as FOCUS_TRAP_LOCKS, type FocusTrapListener } from "./focusTrap";
|
|
13
|
-
export declare const isSSR: unknown;
|
|
1
|
+
import { _ as flattenVNodeTree, a as export_default$10, c as export_default$9, d as export_default$6, f as export_default$5, g as export_default$1, h as export_default$2, i as export_default$11, l as export_default$8, m as export_default$3, n as FocusTrapListener, o as TemplateElement, p as export_default$4, r as _default, s as TemplateRef, t as isSSR, u as export_default$7, v as export_default } from "../index-Bf3XnnIf.js";
|
|
2
|
+
export { _default as FOCUS_TRAP_LOCKS, type FocusTrapListener, type TemplateElement, type TemplateRef, export_default as animationFrameDebounce, flattenVNodeTree, export_default$1 as getBidirectionalFocusElement, export_default$2 as getComponentName, export_default$3 as getComponentProps, export_default$4 as getExposedRef, export_default$5 as getFocusableElement, export_default$6 as getFocusableElements, export_default$7 as getKeyboardFocusableElements, export_default$8 as isActiveElement, isSSR, export_default$9 as unrefTemplateElement, export_default$10 as warn, export_default$11 as wrapFocus };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,c as t,d as n,f as r,h as i,i as a,l as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m}from"../util-BGzD1ED0.js";export{c as FOCUS_TRAP_LOCKS,i as animationFrameDebounce,s as flattenVNodeTree,r as getBidirectionalFocusElement,n as getComponentName,m as getComponentProps,o as getExposedRef,t as getFocusableElement,u as getFocusableElements,f as getKeyboardFocusableElements,l as isActiveElement,p as isSSR,e as unrefTemplateElement,a as warn,d as wrapFocus};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Fragment as e,unref as t}from"vue";import{isHtmlElement as n}from"@basmilius/utils";import{camelCase as r}from"lodash-es";function i(e){if(typeof requestAnimationFrame>`u`)return(()=>{});let t=0;return(()=>{cancelAnimationFrame(t),t=requestAnimationFrame(e)})}function a(t){let n=[];for(let r of t){if(r.type===e&&Array.isArray(r.children)){n.push(...a(r.children));continue}n.push(r)}return n}const o=[`a[href]:not([disabled])`,`button:not([disabled])`,`input:not([type=hidden]):not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[contenteditable]:not([contenteditable=false])`,`[tabindex]:not([disabled]):not([tabindex="-1"])`].join(`,`);function s(e){return Array.from(e.querySelectorAll(o)).filter(n).filter(e=>e.offsetWidth>0||e.offsetHeight>0||e===document.activeElement)}function c(e,t,n){let r=s(e),i=r.indexOf(t);if(i===-1)return null;let a=d(r);l(a,i,n);let o=u(i,n,a,r);return o||((n===`up`||n===`left`)&&(o=r[i-1]),(n===`down`||n===`right`)&&(o=r[i+1])),o}function l(e,t,n){let r=e[t];e.forEach(e=>{let t=e.center;switch(n){case`up`:t={x:t.x,y:e.top+e.height};break;case`down`:t={x:t.x,y:e.top};break;case`left`:t={x:e.left+e.width,y:t.y};break;case`right`:t={x:e.left,y:t.y};break}e.distance=Math.sqrt((r.center.x-t.x)**2+(r.center.y-t.y)**2)})}function u(e,t,n,r){let i=n[e],a=[];switch(t){case`up`:a=n.map((t,n)=>n===e||t.top+t.height>i.top?2**53-1:t.distance);break;case`down`:a=n.map((t,n)=>n===e||t.top<i.top+i.height?2**53-1:t.distance);break;case`left`:a=n.map((t,n)=>n===e||t.left+t.width>i.left?2**53-1:t.distance);break;case`right`:a=n.map((t,n)=>n===e||t.left<i.left+i.width?2**53-1:t.distance);break}let o=a.indexOf(Math.min(...a));return a[o]===2**53-1?null:r[o]}function d(e){return e.map(e=>e.getBoundingClientRect()).map(e=>({height:e.height,width:e.width,top:e.top,left:e.left,right:e.right,bottom:e.bottom,center:{x:e.left+e.width/2,y:e.top+e.height/2},distance:0}))}function f(e){let t=`UnknownComponent`;return e.type&&e.type.__name&&(t=e.type.__name),t}function p(e){return Object.fromEntries(Object.entries(e.props??{}).map(([e,t])=>[r(e),t]))}function m(e,t){if(!e.exposed||!(t in e.exposed))throw Error(`'${t}' was not exposed by the component.`);return e.exposed[t]}function h(e,t,r=void 0){let i=s(e),a=r||document.activeElement;return!a||!n(a)?i[0]||void 0:i[i.indexOf(a)+t]||void 0}function g(e){return Array.from(e.querySelectorAll(`a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])`)).filter(e=>!e.hasAttribute(`disabled`)).filter(e=>!e.hasAttribute(`aria-disabled`)||e.getAttribute(`aria-disabled`)!==`true`)}function _(e){return e.matches(`[aria-selected="true"], [aria-checked="true"], [aria-current]`)}function v(e){let r=t(e);return n(r)?r:r?.$el}function y(...e){console.warn(`[Flux]`,...e)}function b(e,t,n=!1){let r=x(e),i=t.compareDocumentPosition(e),a;a=(i&Node.DOCUMENT_POSITION_PRECEDING)!==0||n?r.firstChild():r.lastChild(),(a===null?e:a).focus()}function x(e){return document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.tabIndex>=0&&!e.disabled?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP})}const S=new class{get active(){return this.current?.isEnabled??!1}get current(){return this.#t[this.#t.length-1]??null}#e=[];#t=[];add(e,t,n=!0){let r={id:e,setEnabled:t,isEnabled:!1};n?(this.current&&this.toggle(this.current,!1),this.#t.push(r),this.toggle(r,!0)):this.#t.push(r),this.emit()}remove(e){let t=this.#t.find(t=>t.id===e);t&&this.toggle(t,!1);let n=this.current?.id===e;this.#t=this.#t.filter(t=>t.id!==e),n&&this.current&&this.toggle(this.current,!0),this.emit()}emit(){this.#e.forEach(e=>e(this.active,this.#t))}subscribe(e){return this.#e.push(e),e(this.active,this.#t),()=>this.#e=this.#e.filter(t=>t!==e)}toggle(e,t){e.setEnabled(t),e.isEnabled=t}},C=!globalThis.document;export{v as a,h as c,f as d,c as f,i as h,y as i,m as l,a as m,S as n,_ as o,s as p,b as r,g as s,C as t,p as u};
|
|
2
|
+
//# sourceMappingURL=util-BGzD1ED0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util-BGzD1ED0.js","names":["getFocusableElements","getFocusableElements","#traps","#listeners"],"sources":["../src/util/animationFrameDebounce.ts","../src/util/flattenVNodeTree.ts","../src/util/getFocusableElements.ts","../src/util/getBidirectionalFocusElement.ts","../src/util/getComponentName.ts","../src/util/getComponentProps.ts","../src/util/getExposedRef.ts","../src/util/getFocusableElement.ts","../src/util/getKeyboardFocusableElements.ts","../src/util/isActiveElement.ts","../src/util/unrefTemplateElement.ts","../src/util/warn.ts","../src/util/wrapFocus.ts","../src/util/focusTrap.ts","../src/util/index.ts"],"sourcesContent":["import type { FluxMaybePromise } from '@flux-ui/types';\n\nexport default function <T extends () => FluxMaybePromise<void>>(fn: T): T {\n if (typeof requestAnimationFrame === 'undefined') {\n return (() => {\n }) as T;\n }\n\n let animationFrame = 0;\n\n return (() => {\n cancelAnimationFrame(animationFrame);\n animationFrame = requestAnimationFrame(fn);\n }) as T;\n}\n","import { Fragment, type VNode } from 'vue';\n\nexport default function flattenVNodeTree(vnodes: VNode[]): VNode[] {\n const flattened: VNode[] = [];\n\n for (const vnode of vnodes) {\n if (vnode.type === Fragment && Array.isArray(vnode.children)) {\n flattened.push(...flattenVNodeTree(vnode.children as VNode[]));\n continue;\n }\n\n flattened.push(vnode);\n }\n\n return flattened;\n}\n","import { isHtmlElement } from '@basmilius/utils';\n\nconst FOCUSABLE_ELEMENTS = [\n 'a[href]:not([disabled])',\n 'button:not([disabled])',\n 'input:not([type=hidden]):not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[contenteditable]:not([contenteditable=false])',\n '[tabindex]:not([disabled]):not([tabindex=\"-1\"])'\n].join(',');\n\nexport default function (container: HTMLElement): HTMLElement[] {\n return Array.from(container.querySelectorAll(FOCUSABLE_ELEMENTS))\n .filter(isHtmlElement)\n .filter(elm => elm.offsetWidth > 0 || elm.offsetHeight > 0 || elm === document.activeElement);\n}\n","import getFocusableElements from './getFocusableElements';\n\nexport default function (container: HTMLElement, currentElement: HTMLElement, direction: 'up' | 'down' | 'left' | 'right'): HTMLElement | null {\n const elements = getFocusableElements(container);\n const currentIndex = elements.indexOf(currentElement);\n\n if (currentIndex === -1) {\n return null;\n }\n\n const elementInfos = getBidirectionalInfoForElements(elements);\n\n calculateBidirectionalDistances(elementInfos, currentIndex, direction);\n\n let candidate = determineBidirectionalCandidate(currentIndex, direction, elementInfos, elements);\n\n if (!candidate) {\n if (direction === 'up' || direction === 'left') {\n candidate = elements[currentIndex - 1];\n }\n\n if (direction === 'down' || direction === 'right') {\n candidate = elements[currentIndex + 1];\n }\n }\n\n return candidate;\n}\n\nfunction calculateBidirectionalDistances(elementInfos: BidirectionalInfo[], currentIndex: number, direction: 'up' | 'down' | 'left' | 'right'): void {\n const current = elementInfos[currentIndex];\n\n elementInfos.forEach(r => {\n let point = r.center;\n\n switch (direction) {\n case 'up':\n point = {x: point.x, y: r.top + r.height};\n break;\n\n case 'down':\n point = {x: point.x, y: r.top};\n break;\n\n case 'left':\n point = {x: r.left + r.width, y: point.y};\n break;\n\n case 'right':\n point = {x: r.left, y: point.y};\n break;\n }\n\n r.distance = Math.sqrt(Math.pow(current.center.x - point.x, 2) + Math.pow(current.center.y - point.y, 2));\n });\n}\n\nfunction determineBidirectionalCandidate(currentIndex: number, direction: 'up' | 'down' | 'left' | 'right', elementInfos: BidirectionalInfo[], elements: HTMLElement[]): HTMLElement | null {\n const current = elementInfos[currentIndex];\n let distances: number[] = [];\n\n switch (direction) {\n case 'up':\n distances = elementInfos.map((r, index) => index === currentIndex || r.top + r.height > current.top ? Number.MAX_SAFE_INTEGER : r.distance);\n break;\n\n case 'down':\n distances = elementInfos.map((r, index) => index === currentIndex || r.top < current.top + current.height ? Number.MAX_SAFE_INTEGER : r.distance);\n break;\n\n case 'left':\n distances = elementInfos.map((r, index) => index === currentIndex || r.left + r.width > current.left ? Number.MAX_SAFE_INTEGER : r.distance);\n break;\n\n case 'right':\n distances = elementInfos.map((r, index) => index === currentIndex || r.left < current.left + current.width ? Number.MAX_SAFE_INTEGER : r.distance);\n break;\n }\n\n const candidateIndex = distances.indexOf(Math.min(...distances));\n\n if (distances[candidateIndex] !== Number.MAX_SAFE_INTEGER) {\n return elements[candidateIndex];\n }\n\n return null;\n}\n\nfunction getBidirectionalInfoForElements(elements: HTMLElement[]): BidirectionalInfo[] {\n return elements\n .map(elm => elm.getBoundingClientRect())\n .map(rect => ({\n height: rect.height,\n width: rect.width,\n top: rect.top,\n left: rect.left,\n right: rect.right,\n bottom: rect.bottom,\n center: {\n x: rect.left + rect.width / 2,\n y: rect.top + rect.height / 2\n },\n distance: 0\n }));\n}\n\ntype BidirectionalInfo = Omit<DOMRect, 'x' | 'y' | 'toJSON'> & {\n center: { x: number; y: number; };\n distance: number;\n};\n","import type { VNode } from 'vue';\n\nexport default function (component: ExtendedVNode): string {\n let name = 'UnknownComponent';\n\n if (component.type && component.type.__name) {\n name = component.type.__name;\n }\n\n return name;\n}\n\ntype ExtendedVNode = {\n readonly type: VNode['type'] & {\n readonly __name?: string;\n };\n};\n","import { camelCase } from 'lodash-es';\n\nexport default function <T extends object>(component: any): T {\n return Object.fromEntries(\n Object.entries(component.props ?? {})\n .map(([key, value]) => [camelCase(key), value])\n ) as T;\n}\n","import type { ComponentInternalInstance, Ref } from 'vue';\n\nexport default function <T>(instance: ComponentInternalInstance, key: string): Ref<T> {\n if (!instance.exposed || !(key in instance.exposed)) {\n throw new Error(`'${key}' was not exposed by the component.`);\n }\n\n return instance.exposed[key];\n}\n","import { isHtmlElement } from '@basmilius/utils';\nimport getFocusableElements from './getFocusableElements';\n\nexport default function (container: HTMLElement, direction: number, activeElement: HTMLElement | undefined = undefined): HTMLElement | undefined {\n const elements = getFocusableElements(container);\n const focusedElement = activeElement || document.activeElement;\n\n if (!focusedElement || !isHtmlElement(focusedElement)) {\n return elements[0] || undefined;\n }\n\n const currentIndex = elements.indexOf(focusedElement);\n\n return elements[currentIndex + direction] || undefined;\n}\n","export default function (root: HTMLElement): HTMLElement[] {\n return Array.from<HTMLElement>(root.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])'))\n .filter(elm => !elm.hasAttribute('disabled'))\n .filter(elm => !elm.hasAttribute('aria-disabled') || elm.getAttribute('aria-disabled') !== 'true');\n}\n","const ACTIVE_ELEMENT_SELECTOR = '[aria-selected=\"true\"], [aria-checked=\"true\"], [aria-current]';\n\nexport default function (element: HTMLElement): boolean {\n return element.matches(ACTIVE_ELEMENT_SELECTOR);\n}\n","import { isHtmlElement } from '@basmilius/utils';\nimport { type ComponentPublicInstance, type ShallowRef, unref } from 'vue';\n\nexport type TemplateElement<TElement extends HTMLElement> = ComponentPublicInstance<any, any, any, any, any, any, any, any, any, any, any, any, any, any, TElement> | TElement | null;\nexport type TemplateRef<TElement extends HTMLElement> = Readonly<ShallowRef<TemplateElement<TElement>>>;\n\nexport default function <T extends HTMLElement>(ref: TemplateRef<T>): T | null {\n const value = unref(ref);\n\n if (isHtmlElement(value)) {\n return value as T;\n }\n\n return value?.$el;\n}\n","export default function (...data: any): void {\n console.warn('[Flux]', ...data);\n}\n","export default function (elm: HTMLElement, targetElm: Element, forceFirst: boolean = false): void {\n const walker = createFocusWalker(elm);\n const position = targetElm.compareDocumentPosition(elm);\n let wrappedTarget: HTMLElement | null;\n\n if ((position & Node.DOCUMENT_POSITION_PRECEDING) !== 0 || forceFirst) {\n wrappedTarget = walker.firstChild() as HTMLElement | null;\n } else {\n wrappedTarget = walker.lastChild() as HTMLElement | null;\n }\n\n const newFocus = wrappedTarget !== null ? wrappedTarget : elm;\n newFocus.focus();\n}\n\nfunction createFocusWalker(elm: HTMLElement): TreeWalker {\n return document.createTreeWalker(elm, NodeFilter.SHOW_ELEMENT, {\n acceptNode: (node: HTMLButtonElement) => node.tabIndex >= 0 && !node.disabled ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP\n });\n}\n","class FocusTrapLockStack {\n get active(): boolean {\n return this.current?.isEnabled ?? false;\n }\n\n get current(): FocusTrap | null {\n return this.#traps[this.#traps.length - 1] ?? null;\n }\n\n #listeners: FocusTrapListener[] = [];\n #traps: FocusTrap[] = [];\n\n add(id: FocusTrap['id'], setEnabled: FocusTrap['setEnabled'], autoFocus: boolean = true): void {\n const trap: FocusTrap = {id, setEnabled, isEnabled: false};\n\n if (autoFocus) {\n this.current && this.toggle(this.current, false);\n this.#traps.push(trap);\n this.toggle(trap, true);\n } else {\n this.#traps.push(trap);\n }\n\n this.emit();\n }\n\n remove(id: FocusTrap['id']): void {\n const trap = this.#traps.find(t => t.id === id);\n trap && this.toggle(trap, false);\n\n const current = this.current;\n const wasCurrent = current?.id === id;\n this.#traps = this.#traps.filter(t => t.id !== id);\n\n wasCurrent && this.current && this.toggle(this.current, true);\n this.emit();\n }\n\n emit(): void {\n this.#listeners.forEach(listener => listener(this.active, this.#traps));\n }\n\n subscribe(listener: FocusTrapListener): () => void {\n this.#listeners.push(listener);\n listener(this.active, this.#traps);\n\n return () => this.#listeners = this.#listeners.filter(l => l !== listener);\n }\n\n toggle(trap: FocusTrap, isEnabled: boolean): void {\n trap.setEnabled(isEnabled);\n trap.isEnabled = isEnabled;\n }\n}\n\ninterface FocusTrap {\n id: string;\n isEnabled: boolean;\n\n setEnabled(isEnabled: boolean): void;\n}\n\nexport type FocusTrapListener = (isEnabled: boolean, focusTraps: FocusTrap[]) => void;\n\nconst _default: FocusTrapLockStack = new FocusTrapLockStack();\nexport default _default;\n","export { default as animationFrameDebounce } from './animationFrameDebounce';\nexport { default as flattenVNodeTree } from './flattenVNodeTree';\nexport { default as getBidirectionalFocusElement } from './getBidirectionalFocusElement';\nexport { default as getComponentName } from './getComponentName';\nexport { default as getComponentProps } from './getComponentProps';\nexport { default as getExposedRef } from './getExposedRef';\nexport { default as getFocusableElement } from './getFocusableElement';\nexport { default as getFocusableElements } from './getFocusableElements';\nexport { default as getKeyboardFocusableElements } from './getKeyboardFocusableElements';\nexport { default as isActiveElement } from './isActiveElement';\nexport { default as unrefTemplateElement, type TemplateElement, type TemplateRef } from './unrefTemplateElement';\nexport { default as warn } from './warn';\nexport { default as wrapFocus } from './wrapFocus';\n\nexport { default as FOCUS_TRAP_LOCKS, type FocusTrapListener } from './focusTrap';\n\nexport const isSSR: boolean = !globalThis.document;\n"],"mappings":"iIAEA,SAAA,EAAiE,EAAU,CACvE,GAAI,OAAO,sBAA0B,IACjC,WAAc,CACd,GAGJ,IAAI,EAAiB,EAErB,WAAc,CACV,qBAAqB,CAAc,EACnC,EAAiB,sBAAsB,CAAE,CAC7C,EACJ,CCZA,SAAwB,EAAiB,EAA0B,CAC/D,IAAM,EAAqB,CAAC,EAE5B,IAAK,IAAM,KAAS,EAAQ,CACxB,GAAI,EAAM,OAAS,GAAY,MAAM,QAAQ,EAAM,QAAQ,EAAG,CAC1D,EAAU,KAAK,GAAG,EAAiB,EAAM,QAAmB,CAAC,EAC7D,QACJ,CAEA,EAAU,KAAK,CAAK,CACxB,CAEA,OAAO,CACX,CCbA,MAAM,EAAqB,CACvB,0BACA,yBACA,2CACA,yBACA,2BACA,iDACA,iDACJ,EAAE,KAAK,GAAG,EAEV,SAAA,EAAyB,EAAuC,CAC5D,OAAO,MAAM,KAAK,EAAU,iBAAiB,CAAkB,CAAC,EAC3D,OAAO,CAAa,EACpB,OAAO,GAAO,EAAI,YAAc,GAAK,EAAI,aAAe,GAAK,IAAQ,SAAS,aAAa,CACpG,CCdA,SAAA,EAAyB,EAAwB,EAA6B,EAAiE,CAC3I,IAAM,EAAWA,EAAqB,CAAS,EACzC,EAAe,EAAS,QAAQ,CAAc,EAEpD,GAAI,IAAiB,GACjB,OAAO,KAGX,IAAM,EAAe,EAAgC,CAAQ,EAE7D,EAAgC,EAAc,EAAc,CAAS,EAErE,IAAI,EAAY,EAAgC,EAAc,EAAW,EAAc,CAAQ,EAY/F,OAVK,KACG,IAAc,MAAQ,IAAc,UAC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AGzB,KAAK,KAAK,CACd,CAEA,OAAO,EAA2B,CAC9B,IAAM,EAAO,KAAKA,GAAO,KAAK,GAAK,EAAE,KAAO,CAAE,EAC9C,GAAQ,KAAK,OAAO,EAAM,EAAK,EAG/B,IAAM,EADU,KAAK,SACO,KAAO,EACnC,KAAKA,GAAS,KAAKA,GAAO,OAAO,GAAK,EAAE,KAAO,CAAE,EAEjD,GAAc,KAAK,SAAW,KAAK,OAAO,KAAK,QAAS,EAAI,EAC5D,KAAK,KAAK,CACd,CAEA,MAAa,CACT,KAAKC,GAAW,QAAQ,GAAY,EAAS,KAAK,OAAQ,KAAKD,EAAM,CAAC,CAC1E,CAEA,UAAU,EAAyC,CAI/C,OAHA,KAAKC,GAAW,KAAK,CAAQ,EAC7B,EAAS,KAAK,OAAQ,KAAKD,EAAM,MAEpB,KAAKC,GAAa,KAAKA,GAAW,OAAO,GAAK,IAAM,CAAQ,CAC7E,CAEA,OAAO,EAAiB,EAA0B,CAC9C,EAAK,WAAW,CAAS,EACzB,EAAK,UAAY,CACrB,CACJ,ECrCa,EAAiB,CAAC,WAAW"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flux-ui/internals",
|
|
3
3
|
"description": "Contains internal workings of Flux UI packages.",
|
|
4
|
-
"version": "3.0.0
|
|
4
|
+
"version": "3.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/basmilius",
|
|
8
|
-
"homepage": "https://flux.
|
|
8
|
+
"homepage": "https://flux-ui.dev",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "git+https://github.com/basmilius/flux.git",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"flux"
|
|
23
23
|
],
|
|
24
24
|
"scripts": {
|
|
25
|
-
"build": "
|
|
25
|
+
"build": "tsdown"
|
|
26
26
|
},
|
|
27
27
|
"files": [
|
|
28
28
|
"dist",
|
|
@@ -35,25 +35,42 @@
|
|
|
35
35
|
"main": "./dist/index.js",
|
|
36
36
|
"module": "./dist/index.js",
|
|
37
37
|
"types": "./dist/index.d.ts",
|
|
38
|
-
"typings": "./dist/index.d.ts",
|
|
39
38
|
"sideEffects": false,
|
|
40
39
|
"exports": {
|
|
41
40
|
".": {
|
|
42
41
|
"types": "./dist/index.d.ts",
|
|
43
42
|
"default": "./dist/index.js"
|
|
43
|
+
},
|
|
44
|
+
"./composable": {
|
|
45
|
+
"types": "./dist/composable/index.d.ts",
|
|
46
|
+
"default": "./dist/composable/index.js"
|
|
47
|
+
},
|
|
48
|
+
"./data": {
|
|
49
|
+
"types": "./dist/data/index.d.ts",
|
|
50
|
+
"default": "./dist/data/index.js"
|
|
51
|
+
},
|
|
52
|
+
"./directive": {
|
|
53
|
+
"types": "./dist/directive/index.d.ts",
|
|
54
|
+
"default": "./dist/directive/index.js"
|
|
55
|
+
},
|
|
56
|
+
"./util": {
|
|
57
|
+
"types": "./dist/util/index.d.ts",
|
|
58
|
+
"default": "./dist/util/index.js"
|
|
44
59
|
}
|
|
45
60
|
},
|
|
46
61
|
"dependencies": {
|
|
47
|
-
"@basmilius/
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
62
|
+
"@basmilius/common": "^3.40.0",
|
|
63
|
+
"@basmilius/utils": "^3.40.0",
|
|
64
|
+
"@flux-ui/types": "3.0.0",
|
|
65
|
+
"lodash-es": "^4.18.1"
|
|
66
|
+
},
|
|
67
|
+
"peerDependencies": {
|
|
68
|
+
"luxon": "^3.7.2",
|
|
69
|
+
"vue": "^3.6.0-beta.13"
|
|
51
70
|
},
|
|
52
71
|
"devDependencies": {
|
|
53
|
-
"@
|
|
54
|
-
"@types/luxon": "^3.
|
|
55
|
-
"
|
|
56
|
-
"luxon": "^3.6.1",
|
|
57
|
-
"vue": "^3.5.13"
|
|
72
|
+
"@types/bun": "^1.3.14",
|
|
73
|
+
"@types/luxon": "^3.7.1",
|
|
74
|
+
"tsdown": "^0.22.1"
|
|
58
75
|
}
|
|
59
76
|
}
|
package/src/composable/index.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
export { default as useCalendar } from './useCalendar';
|
|
2
2
|
export { default as useCalendarMonthSwitcher } from './useCalendarMonthSwitcher';
|
|
3
|
+
export { default as useCalendarTimeGrid } from './useCalendarTimeGrid';
|
|
3
4
|
export { default as useCalendarYearSwitcher } from './useCalendarYearSwitcher';
|
|
4
|
-
export { default as
|
|
5
|
-
export { default as useComponentId } from './useComponentId';
|
|
6
|
-
export { default as useDebouncedRef } from './useDebouncedRef';
|
|
5
|
+
export { default as useKeyboardGrab, defaultAnnounce as defaultKeyboardGrabAnnounce } from './useKeyboardGrab';
|
|
7
6
|
export { default as useEventListener } from './useEventListener';
|
|
8
|
-
export { default as useInterval } from './useInterval';
|
|
9
7
|
export { default as useInView } from './useInView';
|
|
10
|
-
export { default as useMutationObserver } from './useMutationObserver';
|
|
11
8
|
export { default as useRemembered } from './useRemembered';
|
|
9
|
+
export { default as useScrollEdges } from './useScrollEdges';
|
|
12
10
|
export { default as useScrollPosition } from './useScrollPosition';
|
|
13
11
|
|
|
14
12
|
export { default as useFocusTrap } from './useFocusTrap';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DateTime } from 'luxon';
|
|
2
|
-
import { computed, type Ref,
|
|
2
|
+
import { computed, ref, type Ref, unref } from 'vue';
|
|
3
3
|
|
|
4
4
|
export default function (initialDate: DateTime, options?: UseCalendarOptions): UseCalendarReturn {
|
|
5
5
|
const isTransitioningToPast = ref(false);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { DateTime } from 'luxon';
|
|
2
|
-
import type
|
|
3
|
-
import { computed, unref } from 'vue';
|
|
2
|
+
import { computed, type Ref, unref } from 'vue';
|
|
4
3
|
|
|
5
4
|
export default function (currentDate: Ref<DateTime>, displayLength: 'short' | 'long'): UseCalendarMonthSwitcherReturn {
|
|
6
5
|
const months = computed(() => {
|