vue-composable-ui 1.0.1 → 1.0.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.
- package/dist/combobox.vue_vue_type_script_setup_true_lang-BhVMcx67.js +140 -0
- package/dist/comboboxHiddenInput.vue_vue_type_script_setup_true_lang-Ba-UPd-M.js +29 -0
- package/dist/comboboxInput.vue_vue_type_script_setup_true_lang-DzRfJ5ke.js +33 -0
- package/dist/comboboxOption.vue_vue_type_script_setup_true_lang-OyJxB4Jk.js +42 -0
- package/dist/comboboxOptions.vue_vue_type_script_setup_true_lang-Doy6MfEQ.js +20 -0
- package/dist/composable-ui.js +47 -1112
- package/dist/composable-ui10.js +4 -0
- package/dist/composable-ui11.js +4 -0
- package/dist/composable-ui12.js +4 -0
- package/dist/composable-ui13.js +4 -0
- package/dist/composable-ui14.js +4 -0
- package/dist/composable-ui15.js +4 -0
- package/dist/composable-ui16.js +4 -0
- package/dist/composable-ui17.js +31 -0
- package/dist/composable-ui18.js +4 -0
- package/dist/composable-ui19.js +4 -0
- package/dist/composable-ui2.js +55 -0
- package/dist/composable-ui20.js +4 -0
- package/dist/composable-ui21.js +100 -0
- package/dist/composable-ui22.js +144 -0
- package/dist/composable-ui23.js +7 -0
- package/dist/composable-ui24.js +7 -0
- package/dist/composable-ui3.js +4 -0
- package/dist/composable-ui4.js +4 -0
- package/dist/composable-ui5.js +4 -0
- package/dist/composable-ui6.js +4 -0
- package/dist/composable-ui7.js +4 -0
- package/dist/composable-ui8.js +4 -0
- package/dist/composable-ui9.js +4 -0
- package/dist/listbox.vue_vue_type_script_setup_true_lang-Bj1ZXiBX.js +69 -0
- package/dist/listboxOption.vue_vue_type_script_setup_true_lang-B_yRptJm.js +37 -0
- package/dist/menu.vue_vue_type_script_setup_true_lang-Ci7q2rOg.js +82 -0
- package/dist/menuItem.vue_vue_type_script_setup_true_lang-mXtMa4gO.js +63 -0
- package/dist/menuItems.vue_vue_type_script_setup_true_lang-p9vftREy.js +49 -0
- package/dist/popover.vue_vue_type_script_setup_true_lang-DhKF7_nY.js +50 -0
- package/dist/popoverDialog.vue_vue_type_script_setup_true_lang-CDXUO7wZ.js +33 -0
- package/dist/tab.vue_vue_type_script_setup_true_lang-Y5OFGqMB.js +29 -0
- package/dist/tabContainer.vue_vue_type_script_setup_true_lang-fPpLno2Z.js +40 -0
- package/dist/tabList.vue_vue_type_script_setup_true_lang-CZyqGCuj.js +48 -0
- package/dist/tabPanel.vue_vue_type_script_setup_true_lang-CGhP6SHR.js +31 -0
- package/dist/tooltip.vue_vue_type_script_setup_true_lang-DVKYJyfL.js +85 -0
- package/dist/types/components/combobox/combobox.vue.d.ts +45 -0
- package/dist/types/components/combobox/comboboxHiddenInput.vue.d.ts +3 -5
- package/dist/types/components/combobox/comboboxInput.vue.d.ts +3 -3
- package/dist/types/components/combobox/comboboxOption.vue.d.ts +12 -14
- package/dist/types/components/combobox/comboboxOptions.vue.d.ts +6 -5
- package/dist/types/components/listbox/listbox.vue.d.ts +11 -11
- package/dist/types/components/listbox/listboxOption.vue.d.ts +12 -14
- package/dist/types/components/menu/menu.vue.d.ts +42 -0
- package/dist/types/components/menu/menuItem.vue.d.ts +13 -15
- package/dist/types/components/menu/menuItems.vue.d.ts +6 -5
- package/dist/types/components/popover/popover.vue.d.ts +40 -0
- package/dist/types/components/popover/popoverDialog.vue.d.ts +6 -5
- package/dist/types/components/tabs/tab.vue.d.ts +9 -11
- package/dist/types/components/tabs/tabContainer.vue.d.ts +8 -7
- package/dist/types/components/tabs/tabList.vue.d.ts +9 -9
- package/dist/types/components/tabs/tabPanel.vue.d.ts +9 -9
- package/dist/types/components/tooltip.vue.d.ts +23 -25
- package/dist/types/composables/list.d.ts +5 -1
- package/dist/types/composables/listOption.d.ts +4 -0
- package/dist/types/main.d.ts +21 -23
- package/dist/types/utils/element.d.ts +2 -2
- package/package.json +11 -8
- package/dist/composable-ui.umd.cjs +0 -1
- package/dist/types/utils/id.d.ts +0 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
id?: string;
|
|
3
|
+
activatorId?: string;
|
|
4
|
+
direction?: "up" | "down" | "left" | "right";
|
|
5
|
+
align?: "top" | "bottom" | "left" | "right" | "center" | "stretch";
|
|
6
|
+
position?: "fixed" | "absolute";
|
|
7
|
+
};
|
|
8
|
+
declare function onActivatorKeyDown(evt: KeyboardEvent): void;
|
|
9
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
10
|
+
modelValue?: any;
|
|
11
|
+
};
|
|
12
|
+
declare var __VLS_1: {
|
|
13
|
+
attrs: {
|
|
14
|
+
id: string;
|
|
15
|
+
"aria-controls": string | undefined;
|
|
16
|
+
"aria-haspopup": "menu";
|
|
17
|
+
"aria-expanded": boolean;
|
|
18
|
+
onclick: () => void;
|
|
19
|
+
onkeydown: typeof onActivatorKeyDown;
|
|
20
|
+
tabindex: number;
|
|
21
|
+
};
|
|
22
|
+
isOpen: boolean;
|
|
23
|
+
};
|
|
24
|
+
type __VLS_Slots = {} & {
|
|
25
|
+
default?: (props: typeof __VLS_1) => any;
|
|
26
|
+
};
|
|
27
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
|
+
"update:modelValue": (value: any) => any;
|
|
29
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
30
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
31
|
+
}>, {
|
|
32
|
+
direction: "up" | "down" | "left" | "right";
|
|
33
|
+
align: "top" | "bottom" | "left" | "right" | "center" | "stretch";
|
|
34
|
+
position: "fixed" | "absolute";
|
|
35
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
36
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
37
|
+
export default _default;
|
|
38
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
39
|
+
new (): {
|
|
40
|
+
$slots: S;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
default?(_: {
|
|
3
|
-
isSelected: boolean;
|
|
4
|
-
isActive: boolean;
|
|
5
|
-
}): any;
|
|
6
|
-
};
|
|
7
|
-
declare const __VLS_component: import("vue").DefineComponent<{
|
|
1
|
+
type __VLS_Props = {
|
|
8
2
|
id?: string;
|
|
9
3
|
value?: any;
|
|
10
4
|
disabled?: boolean;
|
|
11
|
-
}
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_1: {
|
|
7
|
+
isSelected: boolean;
|
|
8
|
+
isActive: boolean;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_Slots = {} & {
|
|
11
|
+
default?: (props: typeof __VLS_1) => any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
14
|
select: (value: any) => any;
|
|
13
|
-
}, string, import("vue").PublicProps, Readonly<{
|
|
14
|
-
id?: string;
|
|
15
|
-
value?: any;
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
}> & Readonly<{
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
18
16
|
onSelect?: ((value: any) => any) | undefined;
|
|
19
17
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
-
declare const _default:
|
|
18
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
21
19
|
export default _default;
|
|
22
|
-
type
|
|
20
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
21
|
new (): {
|
|
24
22
|
$slots: S;
|
|
25
23
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
declare
|
|
2
|
-
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
3
4
|
};
|
|
4
|
-
declare const __VLS_component: import("vue").DefineComponent<{},
|
|
5
|
-
declare const _default:
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
6
7
|
export default _default;
|
|
7
|
-
type
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
8
9
|
new (): {
|
|
9
10
|
$slots: S;
|
|
10
11
|
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
id?: string;
|
|
3
|
+
activatorId?: string;
|
|
4
|
+
direction?: "up" | "down" | "left" | "right";
|
|
5
|
+
align?: "top" | "bottom" | "left" | "right" | "center" | "stretch";
|
|
6
|
+
position?: "fixed" | "absolute";
|
|
7
|
+
closeOnOutsideClick?: boolean;
|
|
8
|
+
closeOnInsideClick?: boolean;
|
|
9
|
+
role?: "dialog" | "listbox" | "menu" | "tree" | "grid";
|
|
10
|
+
};
|
|
11
|
+
declare var __VLS_1: {
|
|
12
|
+
attrs: {
|
|
13
|
+
id: string;
|
|
14
|
+
"aria-controls": string | undefined;
|
|
15
|
+
"aria-haspopup": "dialog" | "menu" | "listbox" | "tree" | "grid";
|
|
16
|
+
"aria-expanded": boolean;
|
|
17
|
+
};
|
|
18
|
+
isOpen: boolean;
|
|
19
|
+
toggle: () => void;
|
|
20
|
+
open: () => void;
|
|
21
|
+
close: () => void;
|
|
22
|
+
};
|
|
23
|
+
type __VLS_Slots = {} & {
|
|
24
|
+
default?: (props: typeof __VLS_1) => any;
|
|
25
|
+
};
|
|
26
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
27
|
+
role: "dialog" | "listbox" | "menu" | "tree" | "grid";
|
|
28
|
+
direction: "up" | "down" | "left" | "right";
|
|
29
|
+
align: "top" | "bottom" | "left" | "right" | "center" | "stretch";
|
|
30
|
+
position: "fixed" | "absolute";
|
|
31
|
+
closeOnOutsideClick: boolean;
|
|
32
|
+
closeOnInsideClick: boolean;
|
|
33
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
34
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
35
|
+
export default _default;
|
|
36
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
37
|
+
new (): {
|
|
38
|
+
$slots: S;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
declare
|
|
2
|
-
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
3
4
|
};
|
|
4
|
-
declare const __VLS_component: import("vue").DefineComponent<{},
|
|
5
|
-
declare const _default:
|
|
5
|
+
declare const __VLS_component: import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
6
7
|
export default _default;
|
|
7
|
-
type
|
|
8
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
8
9
|
new (): {
|
|
9
10
|
$slots: S;
|
|
10
11
|
};
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
default?(_: {}): any;
|
|
3
|
-
};
|
|
4
|
-
declare const __VLS_component: import("vue").DefineComponent<{
|
|
5
|
-
id?: string;
|
|
6
|
-
ariaControls?: string;
|
|
7
|
-
value: string | number;
|
|
8
|
-
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
1
|
+
type __VLS_Props = {
|
|
9
2
|
id?: string;
|
|
10
3
|
ariaControls?: string;
|
|
11
4
|
value: string | number;
|
|
12
|
-
}
|
|
13
|
-
declare
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_1: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
default?: (props: typeof __VLS_1) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
14
12
|
export default _default;
|
|
15
|
-
type
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
16
14
|
new (): {
|
|
17
15
|
$slots: S;
|
|
18
16
|
};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
type __VLS_PublicProps = {
|
|
2
2
|
modelValue?: string | number;
|
|
3
3
|
};
|
|
4
|
-
declare
|
|
5
|
-
|
|
4
|
+
declare var __VLS_1: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
default?: (props: typeof __VLS_1) => any;
|
|
6
7
|
};
|
|
7
|
-
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps,
|
|
8
|
-
"update:modelValue": (
|
|
8
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
"update:modelValue": (value: string | number | undefined) => any;
|
|
9
10
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
10
|
-
"onUpdate:modelValue"?: ((
|
|
11
|
+
"onUpdate:modelValue"?: ((value: string | number | undefined) => any) | undefined;
|
|
11
12
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
-
declare const _default:
|
|
13
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
13
14
|
export default _default;
|
|
14
|
-
type
|
|
15
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
16
|
new (): {
|
|
16
17
|
$slots: S;
|
|
17
18
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
default?(_: {}): any;
|
|
3
|
-
};
|
|
4
|
-
declare const __VLS_component: import("vue").DefineComponent<{
|
|
5
|
-
orientation?: "horizontal" | "vertical";
|
|
6
|
-
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
1
|
+
type __VLS_Props = {
|
|
7
2
|
orientation?: "horizontal" | "vertical";
|
|
8
|
-
}
|
|
3
|
+
};
|
|
4
|
+
declare var __VLS_1: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
default?: (props: typeof __VLS_1) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
9
9
|
orientation: "horizontal" | "vertical";
|
|
10
10
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
-
declare const _default:
|
|
11
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
12
12
|
export default _default;
|
|
13
|
-
type
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
14
14
|
new (): {
|
|
15
15
|
$slots: S;
|
|
16
16
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
default?(_: {}): any;
|
|
3
|
-
};
|
|
4
|
-
declare const __VLS_component: import("vue").DefineComponent<{
|
|
5
|
-
value: string | number;
|
|
6
|
-
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
1
|
+
type __VLS_Props = {
|
|
7
2
|
value: string | number;
|
|
8
|
-
}
|
|
9
|
-
declare
|
|
3
|
+
};
|
|
4
|
+
declare var __VLS_1: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
default?: (props: typeof __VLS_1) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
10
10
|
export default _default;
|
|
11
|
-
type
|
|
11
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
12
12
|
new (): {
|
|
13
13
|
$slots: S;
|
|
14
14
|
};
|
|
@@ -1,35 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
declare function close(): void;
|
|
3
|
-
declare function onKeyDown(evt: KeyboardEvent): void;
|
|
4
|
-
declare function __VLS_template(): {
|
|
5
|
-
default?(_: {
|
|
6
|
-
attrs: {
|
|
7
|
-
"aria-describedby": string;
|
|
8
|
-
onmouseenter: typeof open;
|
|
9
|
-
onmouseleave: typeof close;
|
|
10
|
-
onfocus: typeof open;
|
|
11
|
-
onblur: typeof close;
|
|
12
|
-
onkeydown: typeof onKeyDown;
|
|
13
|
-
};
|
|
14
|
-
}): any;
|
|
15
|
-
content?(_: {}): any;
|
|
16
|
-
};
|
|
17
|
-
declare const __VLS_component: import("vue").DefineComponent<{
|
|
18
|
-
id?: string;
|
|
19
|
-
text?: string;
|
|
20
|
-
delay?: string | number;
|
|
21
|
-
direction?: "up" | "down" | "left" | "right";
|
|
22
|
-
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
1
|
+
type __VLS_Props = {
|
|
23
2
|
id?: string;
|
|
24
3
|
text?: string;
|
|
25
4
|
delay?: string | number;
|
|
26
5
|
direction?: "up" | "down" | "left" | "right";
|
|
27
|
-
}
|
|
6
|
+
};
|
|
7
|
+
declare function open(): void;
|
|
8
|
+
declare function close(): void;
|
|
9
|
+
declare function onKeyDown(evt: KeyboardEvent): void;
|
|
10
|
+
declare var __VLS_1: {
|
|
11
|
+
attrs: {
|
|
12
|
+
"aria-describedby": string;
|
|
13
|
+
onmouseenter: typeof open;
|
|
14
|
+
onmouseleave: typeof close;
|
|
15
|
+
onfocus: typeof open;
|
|
16
|
+
onblur: typeof close;
|
|
17
|
+
onkeydown: typeof onKeyDown;
|
|
18
|
+
};
|
|
19
|
+
}, __VLS_8: {};
|
|
20
|
+
type __VLS_Slots = {} & {
|
|
21
|
+
default?: (props: typeof __VLS_1) => any;
|
|
22
|
+
} & {
|
|
23
|
+
content?: (props: typeof __VLS_8) => any;
|
|
24
|
+
};
|
|
25
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
28
26
|
direction: "up" | "down" | "left" | "right";
|
|
29
27
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
30
|
-
declare const _default:
|
|
28
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
31
29
|
export default _default;
|
|
32
|
-
type
|
|
30
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
33
31
|
new (): {
|
|
34
32
|
$slots: S;
|
|
35
33
|
};
|
|
@@ -3,7 +3,7 @@ import { TemplateRefOrSelector } from "../utils/element";
|
|
|
3
3
|
export type ItemValue = unknown;
|
|
4
4
|
export interface Item {
|
|
5
5
|
id: number;
|
|
6
|
-
element: Ref<HTMLElement |
|
|
6
|
+
element: Ref<HTMLElement | null>;
|
|
7
7
|
value: ItemValue;
|
|
8
8
|
disabled: MaybeRef<boolean>;
|
|
9
9
|
}
|
|
@@ -74,6 +74,10 @@ interface UseListInjectionKey {
|
|
|
74
74
|
* Activate an item by ID
|
|
75
75
|
*/
|
|
76
76
|
activateItem: (itemId: number, options?: ActivationOptions) => void;
|
|
77
|
+
/**
|
|
78
|
+
* Deactivates the currently active item
|
|
79
|
+
*/
|
|
80
|
+
deactivateItem: () => void;
|
|
77
81
|
/**
|
|
78
82
|
* Check if an item is selected
|
|
79
83
|
*/
|
|
@@ -18,6 +18,10 @@ interface UseListOptionReturn {
|
|
|
18
18
|
* Activate the item
|
|
19
19
|
*/
|
|
20
20
|
activate: (options?: ActivationOptions) => void;
|
|
21
|
+
/**
|
|
22
|
+
* Deactivate the item
|
|
23
|
+
*/
|
|
24
|
+
deactivate: () => void;
|
|
21
25
|
}
|
|
22
26
|
/**
|
|
23
27
|
* Registers an HTML element and an associated value in the list created in the parent component
|
package/dist/types/main.d.ts
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { useSequentialId } from "./utils/id";
|
|
1
|
+
export { usePopover } from "./composables/popover";
|
|
2
|
+
export { useList } from "./composables/list";
|
|
3
|
+
export { useListOption } from "./composables/listOption";
|
|
4
|
+
export { useFormControl } from "./composables/formControl";
|
|
5
|
+
export { useHTMLElement } from "./utils/element";
|
|
7
6
|
export * from "./components/injectionKeys";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export { usePopover, useList, useListOption, useFormControl, useHTMLElement, useSequentialId, Listbox, ListboxOption, Popover, PopoverDialog, TabContainer, TabList, Tab, TabPanel, Tooltip, Menu, MenuItems, MenuItem, Combobox, ComboboxInput, ComboboxOptions, ComboboxOption, };
|
|
7
|
+
export { default as Listbox } from "./components/listbox/listbox.vue";
|
|
8
|
+
export { default as ListboxOption } from "./components/listbox/listboxOption.vue";
|
|
9
|
+
export { default as TabContainer } from "./components/tabs/tabContainer.vue";
|
|
10
|
+
export { default as TabList } from "./components/tabs/tabList.vue";
|
|
11
|
+
export { default as Tab } from "./components/tabs/tab.vue";
|
|
12
|
+
export { default as TabPanel } from "./components/tabs/tabPanel.vue";
|
|
13
|
+
export { default as Popover } from "./components/popover/popover.vue";
|
|
14
|
+
export { default as PopoverDialog } from "./components/popover/popoverDialog.vue";
|
|
15
|
+
export { default as Tooltip } from "./components/tooltip.vue";
|
|
16
|
+
export { default as Menu } from "./components/menu/menu.vue";
|
|
17
|
+
export { default as MenuItems } from "./components/menu/menuItems.vue";
|
|
18
|
+
export { default as MenuItem } from "./components/menu/menuItem.vue";
|
|
19
|
+
export { default as Combobox } from "./components/combobox/combobox.vue";
|
|
20
|
+
export { default as ComboboxInput } from "./components/combobox/comboboxInput.vue";
|
|
21
|
+
export { default as ComboboxOptions } from "./components/combobox/comboboxOptions.vue";
|
|
22
|
+
export { default as ComboboxOption } from "./components/combobox/comboboxOption.vue";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Ref } from "vue";
|
|
2
|
-
export type TemplateRefOrSelector<E extends HTMLElement = HTMLElement> = Ref<E |
|
|
3
|
-
export declare function useHTMLElement<E extends HTMLElement = HTMLElement>(el: TemplateRefOrSelector<E>): Ref<E |
|
|
2
|
+
export type TemplateRefOrSelector<E extends HTMLElement = HTMLElement> = Ref<E | null> | E | string;
|
|
3
|
+
export declare function useHTMLElement<E extends HTMLElement = HTMLElement>(el: TemplateRefOrSelector<E>): Ref<E | null, E | null> | ([E | null] extends [Ref<any, any>] ? import("@vue/shared").IfAny<Ref<any, any> & E, Ref<Ref<any, any> & E, Ref<any, any> & E>, Ref<any, any> & E> : Ref<import("vue").UnwrapRef<E> | null, E | import("vue").UnwrapRef<E> | null>);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-composable-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"preview": "vite preview",
|
|
28
28
|
"docs:dev": "vitepress dev docs",
|
|
29
29
|
"docs:build": "vitepress build docs",
|
|
30
|
-
"docs:preview": "vitepress preview docs"
|
|
30
|
+
"docs:preview": "vitepress preview docs",
|
|
31
|
+
"release": "release-it"
|
|
31
32
|
},
|
|
32
33
|
"files": [
|
|
33
34
|
"dist"
|
|
@@ -36,13 +37,15 @@
|
|
|
36
37
|
"vue": "^3.5.12"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
|
-
"
|
|
40
|
-
"@
|
|
41
|
-
"
|
|
40
|
+
"@types/node": "^24.1.0",
|
|
41
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
42
|
+
"glob": "^11.0.2",
|
|
43
|
+
"release-it": "^19.0.4",
|
|
42
44
|
"sass": "^1.69.5",
|
|
43
45
|
"typescript": "^5.0.2",
|
|
44
|
-
"vite": "^
|
|
45
|
-
"vitepress": "^1.
|
|
46
|
-
"vue
|
|
46
|
+
"vite": "^7.0.6",
|
|
47
|
+
"vitepress": "^1.6.4",
|
|
48
|
+
"vue": "^3.5.12",
|
|
49
|
+
"vue-tsc": "^3.0.5"
|
|
47
50
|
}
|
|
48
51
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(k,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(k=typeof globalThis<"u"?globalThis:k||self,e(k["Vue Composable UI"]={},k.Vue))})(this,function(k,e){"use strict";function j(i){return typeof i=="string"?e.ref(document.querySelector(i)||void 0):i instanceof HTMLElement?e.ref(i):i}function T(i,t,{direction:o="down",align:n="left",position:r="fixed",closeOnOutsideClick:l=!0,closeOnInsideClick:u=!1}={}){const a=e.ref(!1);function c(){const p=j(i);if(!p.value)throw new Error("Activator element is undefined");return p.value}function d(){const p=j(t);if(!p.value)throw new Error("Popover element is undefined");return p.value}function b({focus:p=!0}={}){a.value=!0,p&&e.nextTick(()=>{d().focus()})}function v({focus:p=!0}={}){a.value=!1,p&&c().focus()}function f(p){a.value?v(p):b(p)}function h(){if(!a.value)return;const p=c(),$=d();$.style.position=r;const{top:A,right:s,bottom:m,left:w,width:_,height:I}=p.getBoundingClientRect(),B=$.offsetHeight,V=$.offsetWidth,L=document.documentElement.clientHeight,K=document.documentElement.clientWidth;let O=o;o=="up"?A-B<0&&(O="down"):o=="down"?m+B>L&&(O="up"):o=="right"?s+V>K&&(O="left"):o=="left"&&w-V<0&&(O="right");let S=n;n=="left"?w+V>K&&(S="right"):n=="right"?s-V<0&&(S="left"):n=="top"?A+B>L&&(S="bottom"):n=="bottom"&&m-B<0&&(S="top");const C={top:"auto",bottom:"auto",left:"auto",right:"auto",width:"auto"},M=r==="fixed";O=="up"?C.bottom=`${I+(M?L-m:0)}px`:O=="down"?C.top=`${I+(M?A:0)}px`:O=="right"?C.left=`${_+(M?w:0)}px`:O=="left"&&(C.right=`${_+(M?K-s:0)}px`),["up","down"].includes(O)?S=="right"?C.right=`${M?K-s:0}px`:S=="left"||S=="stretch"?C.left=`${M?w:0}px`:S=="center"&&(C.left=`${(M?w:0)-(V-_)/2}px`):S=="bottom"?C.bottom=`${M?L-m:0}px`:S=="top"?C.top=`${M?A:0}px`:S=="center"&&(C.top=`${(M?A:0)-(B-I)/2}px`),["up","down"].includes(O)&&S==="stretch"&&(C.width=_+"px");for(const W in C)$.style[W]=C[W]}e.watch(a,p=>{p&&e.nextTick(()=>{h()})},{flush:"pre"});function E(p){const $=p.target;if(!c().contains($))try{d().contains($)?u&&v():l&&(a.value=!1)}catch{}}const g=new ResizeObserver(h),y=new AbortController;return e.onMounted(()=>{window.addEventListener("resize",h,{passive:!0,signal:y.signal}),window.addEventListener("scroll",h,{passive:!0,signal:y.signal}),window.addEventListener("click",E,{passive:!0,signal:y.signal}),g.observe(c())}),e.onBeforeUnmount(()=>{y.abort(),g.disconnect()}),{isOpen:a,open:b,close:v,toggle:f}}const U=Symbol();function R(i,t){const[o,n]=[e.unref(i),e.unref(t)];return typeof o=="object"?typeof n=="object"?JSON.stringify(o)===JSON.stringify(n):!1:o===n}function D(i){let t=0;const o=e.shallowRef([]),n=e.ref(),r=e.computed(()=>Array.isArray(i.value));function l(s){const m=o.value.find(w=>w.id===s);if(!m)throw new Error(`Item not found: (${s})`);return m}function u(s){const m=e.unref(s.element);if(m)return m.focus(),m}function a(s,{focus:m=!1}={}){n.value=(s==null?void 0:s.id)??void 0,s!==void 0&&m&&u(s)}function c(s,{focus:m=!1}={}){const w=l(s);return a(w,{focus:m})}function d(s){return n.value===s}function b(s,m,w=!1){const _=j(s),I=t++;return o.value.push({id:I,value:m,element:_,disabled:w}),e.triggerRef(o),I}function v(s){d(s)&&a();const m=l(s),w=o.value.indexOf(m);o.value.splice(w,1),e.triggerRef(o)}function f(s){const m=l(s);if(e.unref(m.disabled))return;const w=e.unref(m.value);if(w!==void 0){if(e.unref(r)){const _=i.value.findIndex(I=>R(w,I));_>-1?i.value.splice(_,1):i.value=[...i.value,w]}else i.value=w;a(m)}}function h(s){return e.unref(r)?!!i.value.find(m=>R(s.value,m)):R(i,s.value)}function E(s){try{const m=l(s);return h(m)}catch{return!1}}function g({focus:s=!1}={}){for(let m of o.value)if(h(m))return a(m,{focus:s})}function y({focus:s=!1}={}){if(o.value.length)return a(o.value[0],{focus:s})}function p({focus:s=!1}={}){if(o.value.length)return a(o.value[o.value.length-1],{focus:s})}function $({focus:s=!1,loop:m=!1}={}){if(n.value===void 0)return y({focus:s});const w=l(n.value),_=o.value.indexOf(w);let I;if(_+1<o.value.length)I=o.value[_+1];else if(m)I=o.value[0];else return;return a(I,{focus:s})}function A({focus:s=!1,loop:m=!1}={}){if(n.value===void 0)return p({focus:s});const w=l(n.value),_=o.value.indexOf(w);let I;if(_-1>-1)I=o.value[_-1];else if(m)I=o.value[o.value.length-1];else return;return a(I,{focus:s})}return e.provide(U,{value:e.readonly(i),selectItem:f,activateItem:c,isSelected:E,isActive:d,addItem:b,removeItem:v}),{items:e.shallowReadonly(o),isMultiselectable:e.readonly(r),activeItem:e.computed(()=>n.value!==void 0?l(n.value):void 0),selectActiveItem:()=>{n.value!==void 0&&f(n.value)},activateSelectedItem:g,activateFirstItem:y,activateLastItem:p,activateNextItem:$,activatePrevItem:A}}function P(i,t,o){const n=e.inject(U);if(!n)throw new Error("List injectable context is not provided");const r=e.ref(-1),l=e.computed(()=>n.isSelected(r.value)),u=e.computed(()=>n.isActive(r.value));function a(){n.selectItem(r.value)}function c({focus:d=!0}={}){e.unref(o)||n.activateItem(r.value,{focus:d})}return e.onBeforeMount(()=>{r.value=n.addItem(i,t,o)}),e.onBeforeUnmount(()=>{n.removeItem(r.value)}),{isSelected:l,isActive:u,select:a,activate:c}}function J(i,t=[],o=!0){const n=e.ref(!1),r=e.ref(!0),l=e.ref(),u=e.ref("");let a,c;function d(){a==null||a.focus()}function b(){r.value=a.validity.valid,l.value=a.validity,u.value=a.validationMessage}function v(){if(!a)throw new Error("Form element is undefined");if(a.setCustomValidity(""),a.validity.valid){const g=a.value;for(const y of e.unref(t)){const p=y(g);if(p!==!0){a.setCustomValidity(p);break}}}return b(),r.value}function f(g){b(),e.unref(o)||g.preventDefault()}function h(){v(),n.value=c!==a.value}let E=new AbortController;return e.onMounted(()=>{if(a=j(i).value,!a)throw new Error("Form element is undefined");c=a.value,a.addEventListener("change",h,{signal:E.signal,passive:!0}),a.addEventListener("invalid",f,{signal:E.signal}),a!=null&&a.autofocus&&d()}),e.onBeforeUnmount(()=>{E.abort()}),{focus:d,validate:v,isValid:r,validity:e.readonly(l),validationMessage:e.readonly(u),isChanged:n}}let G=0;function x(i="id"){return`${i}-${++G}`}const N=Symbol(),z=Symbol(),H=Symbol(),F=Symbol(),Q=["aria-activedescendant","aria-orientation","aria-multiselectable"],X=e.defineComponent({__name:"listbox",props:e.mergeModels({orientation:{default:"vertical"},loop:{type:Boolean,default:!1}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(i){const t=i,o=e.useModel(i,"modelValue"),{isMultiselectable:n,activeItem:r,selectActiveItem:l,activateFirstItem:u,activateLastItem:a,activateNextItem:c,activatePrevItem:d}=D(o),b=e.computed(()=>{var f,h;return(h=(f=r.value)==null?void 0:f.element.value)==null?void 0:h.id});function v(f){switch(f.code){case"Space":l();break;case"ArrowUp":if(t.orientation==="horizontal")return;d({focus:!1,loop:t.loop}),n.value||l();break;case"ArrowDown":if(t.orientation==="horizontal")return;c({focus:!1,loop:t.loop}),n.value||l();break;case"ArrowLeft":if(t.orientation==="vertical")return;d({focus:!1,loop:t.loop}),n.value||l();break;case"ArrowRight":if(t.orientation==="vertical")return;c({focus:!1,loop:t.loop}),n.value||l();break;case"Home":u({focus:!1});break;case"End":a({focus:!1});break;default:return}f.preventDefault()}return(f,h)=>(e.openBlock(),e.createElementBlock("div",{onKeydown:v,"aria-activedescendant":b.value,"aria-orientation":f.orientation,"aria-multiselectable":e.unref(n),role:"listbox",tabindex:"0"},[e.renderSlot(f.$slots,"default")],40,Q))}}),Y=["id","aria-disabled","aria-selected","data-active"],Z=e.defineComponent({__name:"listboxOption",props:{id:{},value:{},disabled:{type:Boolean}},setup(i){const t=i,o=t.id??x("list-option"),n=e.ref(),{isSelected:r,isActive:l,select:u}=P(n,t.value,t.disabled);return(a,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"itemEl",ref:n,id:e.unref(o),onClick:c[0]||(c[0]=(...d)=>e.unref(u)&&e.unref(u)(...d)),"aria-disabled":a.disabled,"aria-selected":e.unref(r),"data-active":e.unref(l),role:"option",tabindex:"-1"},[e.renderSlot(a.$slots,"default",{isSelected:e.unref(r),isActive:e.unref(l)})],8,Y))}}),ee=e.defineComponent({__name:"tabContainer",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(i){const t=e.useModel(i,"modelValue"),{items:o,selectActiveItem:n,activateFirstItem:r,activateLastItem:l,activateNextItem:u,activatePrevItem:a}=D(t);return e.provide(N,{getIds:c=>e.computed(()=>{var b,v;const d=o.value.find(f=>f.value===c);return{tabId:((b=d==null?void 0:d.element.value)==null?void 0:b.getAttribute("id"))||void 0,panelId:((v=d==null?void 0:d.element.value)==null?void 0:v.getAttribute("aria-controls"))||void 0}}),selectActiveItem:n,activateFirstItem:r,activateLastItem:l,activateNextItem:u,activatePrevItem:a}),(c,d)=>(e.openBlock(),e.createElementBlock("div",null,[e.renderSlot(c.$slots,"default")]))}}),te=["aria-orientation"],oe=e.defineComponent({__name:"tabList",props:{orientation:{default:"horizontal"}},setup(i){const t=i,o=e.inject(N);if(!o)throw new Error("Tabs injectable context is not provided");function n(r){switch(r.code){case"ArrowUp":t.orientation==="vertical"&&o.activatePrevItem({focus:!0,loop:!0});break;case"ArrowDown":t.orientation==="vertical"&&o.activateNextItem({focus:!0,loop:!0});break;case"ArrowLeft":t.orientation==="horizontal"&&o.activatePrevItem({focus:!0,loop:!0});break;case"ArrowRight":t.orientation==="horizontal"&&o.activateNextItem({focus:!0,loop:!0});break;case"Home":o.activateFirstItem({focus:!0});break;case"End":o.activateLastItem({focus:!0});break;default:return}o.selectActiveItem(),r.preventDefault()}return(r,l)=>(e.openBlock(),e.createElementBlock("div",{onKeydown:n,"aria-orientation":t.orientation,role:"tablist"},[e.renderSlot(r.$slots,"default")],40,te))}}),ne=["id","aria-selected","aria-controls","tabindex"],ae=e.defineComponent({__name:"tab",props:{id:{},ariaControls:{},value:{}},setup(i){const t=i,o=e.ref(),{isSelected:n,select:r}=P(o,t.value),l=t.id??x("tab"),u=t.ariaControls??x("tab-panel");return(a,c)=>(e.openBlock(),e.createElementBlock("button",{ref_key:"tab",ref:o,onClick:c[0]||(c[0]=(...d)=>e.unref(r)&&e.unref(r)(...d)),id:e.unref(l),"aria-selected":e.unref(n),"aria-controls":e.unref(u),tabindex:e.unref(n)?0:-1,role:"tab"},[e.renderSlot(a.$slots,"default")],8,ne))}}),ie=["id","aria-labelledby"],re=e.defineComponent({__name:"tabPanel",props:{value:{}},setup(i){const t=i,o=e.inject(U);if(!o)throw new Error("List injectable context is not provided");const n=e.inject(N);if(!n)throw new Error("Tabs injectable context is not provided");const r=e.computed(()=>t.value===o.value.value),l=n.getIds(t.value);return(u,a)=>r.value?(e.openBlock(),e.createElementBlock("div",{key:0,id:e.unref(l).panelId,"aria-labelledby":e.unref(l).tabId,tabindex:"0",role:"tabpanel"},[e.renderSlot(u.$slots,"default")],8,ie)):e.createCommentVNode("",!0)}}),le=e.defineComponent({__name:"popover",props:{id:{},activatorId:{},direction:{default:"down"},align:{default:"left"},position:{default:"fixed"},closeOnOutsideClick:{type:Boolean,default:!0},closeOnInsideClick:{type:Boolean,default:!1},role:{default:"dialog"}},setup(i){const t=i,o=t.id??x("popover"),n=t.activatorId??x("popover-activator"),{isOpen:r,toggle:l,open:u,close:a}=T(`#${n}`,`#${o}`,{direction:t.direction,align:t.align,position:t.position,closeOnOutsideClick:t.closeOnOutsideClick,closeOnInsideClick:t.closeOnInsideClick}),c=e.computed(()=>({id:n,"aria-controls":r.value?t.id:void 0,"aria-haspopup":t.role,"aria-expanded":r.value}));return e.provide(z,{popoverId:o,activatorId:n,role:t.role,isOpen:r,close:a}),(d,b)=>e.renderSlot(d.$slots,"default",{attrs:c.value,isOpen:e.unref(r),toggle:e.unref(l),open:e.unref(u),close:e.unref(a)})}}),se=["id","role","aria-labelledby"],ce=e.defineComponent({__name:"popoverDialog",setup(i){const t=e.inject(z);if(!t)throw new Error("Popover injectable context is not provided");function o(n){switch(n.code){case"Escape":t.close();break;default:return}n.preventDefault()}return(n,r)=>e.unref(t).isOpen.value?(e.openBlock(),e.createElementBlock("div",{key:0,onKeydown:o,id:e.unref(t).popoverId,role:e.unref(t).role,"aria-labelledby":e.unref(t).activatorId,tabindex:"-1"},[e.renderSlot(n.$slots,"default")],40,se)):e.createCommentVNode("",!0)}}),de=["id"],fe=e.defineComponent({inheritAttrs:!1,__name:"tooltip",props:{id:{},text:{},delay:{},direction:{default:"up"}},setup(i){const t=i,o=e.useSlots(),n=e.ref();let r;const l=t.id??x("tooltip"),{isOpen:u}=T(`[aria-describedby=${l}]`,n,{direction:t.direction,align:"center"});function a(){r=setTimeout(()=>{u.value=!0},typeof t.delay=="string"?parseInt(t.delay):t.delay)}function c(){u.value=!1,clearTimeout(r)}function d(f){f.key==="Escape"&&c()}const b={"aria-describedby":l,onmouseenter:a,onmouseleave:c,onfocus:a,onblur:c,onkeydown:d},v=new AbortController;return e.onMounted(()=>{if(o.default)return;const f=document.querySelector(`[aria-describedby=${l}]`);if(!f)throw new Error(`Tooltip activator not found: ${l}`);f.addEventListener("mouseenter",a,{signal:v.signal,passive:!0}),f.addEventListener("mouseleave",c,{signal:v.signal,passive:!0}),f.addEventListener("focus",a,{signal:v.signal,passive:!0}),f.addEventListener("blur",c,{signal:v.signal,passive:!0}),f.addEventListener("keydown",d,{signal:v.signal,passive:!0})}),e.onBeforeUnmount(()=>{v.abort()}),(f,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.renderSlot(f.$slots,"default",{attrs:b}),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.unref(u)?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:0,ref_key:"popupEl",ref:n,id:e.unref(l)},f.$attrs,{role:"tooltip"}),[e.renderSlot(f.$slots,"content",{},()=>[e.createTextVNode(e.toDisplayString(f.text),1)])],16,de)):e.createCommentVNode("",!0)]))],64))}}),ue=e.defineComponent({__name:"menu",props:e.mergeModels({id:{},activatorId:{},direction:{default:"down"},align:{default:"left"},position:{default:"fixed"}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(i){const t=i,o=t.id??x("menu"),n=t.activatorId??x("menu-activator"),r=e.useModel(i,"modelValue"),{isMultiselectable:l,activeItem:u,activateFirstItem:a,activateLastItem:c,activateNextItem:d,activatePrevItem:b}=D(r),{isOpen:v,toggle:f,open:h,close:E}=T(`#${n}`,`#${o}`,{direction:t.direction,align:t.align,position:t.position,closeOnOutsideClick:!0,closeOnInsideClick:!1});function g(p){switch(p.code){case"Space":case"Enter":f(),v.value&&e.nextTick(a);break;case"ArrowUp":h(),e.nextTick(c);break;case"ArrowDown":h(),e.nextTick(a);break;default:return}p.preventDefault()}const y=e.computed(()=>({id:n,"aria-controls":v.value?o:void 0,"aria-haspopup":"menu","aria-expanded":v.value,onclick:f,onkeydown:g,tabindex:0}));return e.provide(H,{menuId:o,activatorId:n,isOpen:v,close:E,isMultiselectable:l,activeItemId:e.computed(()=>{var p,$;return($=(p=u.value)==null?void 0:p.element.value)==null?void 0:$.id}),activateFirstItem:a,activateLastItem:c,activateNextItem:d,activatePrevItem:b}),(p,$)=>e.renderSlot(p.$slots,"default",{attrs:y.value})}}),pe=["id","aria-activedescendant","aria-labelledby"],me=e.defineComponent({__name:"menuItems",setup(i){const t=e.inject(H);if(!t)throw new Error("Menu injectable context is not provided");function o(n){switch(n.code){case"ArrowUp":t.activatePrevItem({focus:!0,loop:!1});break;case"ArrowDown":t.activateNextItem({focus:!0,loop:!1});break;case"Home":t.activateFirstItem({focus:!0});break;case"End":t.activateLastItem({focus:!0});break;case"Escape":t.close();break;case"Tab":t.isOpen.value=!1;return;default:return}n.preventDefault()}return(n,r)=>e.unref(t).isOpen.value?(e.openBlock(),e.createElementBlock("div",{key:0,onKeydown:o,id:e.unref(t).menuId,"aria-activedescendant":e.unref(t).activeItemId.value,"aria-labelledby":e.unref(t).activatorId,role:"menu",tabindex:"-1"},[e.renderSlot(n.$slots,"default")],40,pe)):e.createCommentVNode("",!0)}}),be=["id","data-active","role","aria-checked","aria-disabled"],ve=e.defineComponent({__name:"menuItem",props:{id:{},value:{},disabled:{type:Boolean}},emits:["select"],setup(i,{emit:t}){const o=i,n=t,r=o.id??x("menu-item"),l=e.ref(),{isSelected:u,isActive:a,select:c,activate:d}=P(l,o.value,o.disabled),b=e.inject(H);if(!b)throw new Error("Menu injectable context is not provided");const v=e.computed(()=>o.value!==void 0?b.isMultiselectable.value?"menuitemcheckbox":"menuitemradio":"menuitem");function f(){c(),n("select",o.value)}function h(){f(),(o.value===void 0||!(b!=null&&b.isMultiselectable.value))&&b.close()}function E(g){switch(g.code){case"Space":f(),o.value===void 0&&b.close();break;case"Enter":f(),b.close();break;default:return}g.preventDefault()}return(g,y)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"itemEl",ref:l,id:e.unref(r),onClick:h,onKeydown:E,onMouseenter:y[0]||(y[0]=p=>e.unref(d)({focus:!1})),"data-active":e.unref(a),role:v.value,"aria-checked":g.value!==void 0?e.unref(u):void 0,"aria-disabled":g.disabled||void 0,tabindex:"-1"},[e.renderSlot(g.$slots,"default",{isSelected:e.unref(u),isActive:e.unref(a)})],40,be))}}),ke=["name","value"],q=e.defineComponent({__name:"comboboxHiddenInput",props:{name:{},value:{}},setup(i){const t=i,o=e.computed(()=>{if(typeof t.value=="object"){const n={};for(const[r,l]of Object.entries(t.value))n[`${t.name}[${r}]`]=l;return n}else return{[t.name]:t.value}});return(n,r)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(l,u)=>(e.openBlock(),e.createElementBlock("input",{name:u,value:l,type:"hidden"},null,8,ke))),256))}}),Ie=e.defineComponent({inheritAttrs:!1,__name:"combobox",props:e.mergeModels({displayValue:{type:Function,default:i=>Array.isArray(i)?i.map(t=>t.toString()).join(", "):i.toString()},id:{},activatorId:{},name:{},formValue:{type:Function,default:i=>i}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(i){const t=i,o=e.computed(()=>h.value?n.value.map(I=>t.formValue(I)):t.formValue(n.value)),n=e.useModel(i,"modelValue"),r=t.id??x("combobox"),l=t.activatorId??r,u=`${r}-popover`,{isOpen:a,toggle:c,open:d,close:b}=T(`#${l}`,`#${u}`,{direction:"down",align:"stretch",position:"fixed",closeOnOutsideClick:!0,closeOnInsideClick:!1}),{items:v,activeItem:f,isMultiselectable:h,selectActiveItem:E,activateSelectedItem:g,activateFirstItem:y,activateLastItem:p,activateNextItem:$,activatePrevItem:A}=D(n),s=e.computed(()=>t.displayValue(n.value));e.watch(v,()=>{!f.value&&v.value.length&&(g({focus:!1}),f.value||y({focus:!1}))});function m(){var B;(B=j(`#${l}`).value)==null||B.focus()}function w(I){if(a.value)switch(I.code){case"Space":E(),h.value||b({focus:!0});break;case"Enter":E(),b({focus:!0});break;case"Tab":E(),b({focus:!0});return;case"ArrowUp":A({focus:!1,loop:!1});break;case"ArrowDown":$({focus:!1,loop:!1});break;case"Home":y({focus:!1});break;case"End":p({focus:!1});break;case"Escape":b({focus:!0});break;default:return}else switch(I.code){case"Space":case"Enter":d({focus:!1});break;case"End":case"ArrowUp":d({focus:!1}),e.nextTick(()=>p({focus:!1}));break;case"Home":case"ArrowDown":d({focus:!1}),e.nextTick(()=>y({focus:!1}));break;default:return}I.preventDefault()}const _=e.computed(()=>{var I,B;return{onkeydown:w,onclick:()=>d({focus:!1}),id:r,"aria-controls":a.value?u:void 0,"aria-expanded":a.value,"aria-activedescendant":(B=(I=f.value)==null?void 0:I.element.value)==null?void 0:B.id,"aria-haspopup":"listbox",role:"combobox"}});return e.provide(F,{displayValue:s,popoverId:u,isOpen:a,open:d,close:b,focus:m,isMultiselectable:h,activatorAttrs:_}),(I,B)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[I.name?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.unref(h)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(o.value,(V,L)=>(e.openBlock(),e.createBlock(q,{name:`${I.name}[${L}]`,value:V},null,8,["name","value"]))),256)):(e.openBlock(),e.createBlock(q,{key:1,name:I.name,value:o.value},null,8,["name","value"]))],64)):e.createCommentVNode("",!0),e.renderSlot(I.$slots,"default",{popoverId:u,isOpen:e.unref(a),toggle:e.unref(c),displayValue:s.value,attrs:_.value})],64))}}),he=e.defineComponent({__name:"comboboxInput",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(i){const t=e.inject(F);if(!t)throw new Error("Combobox injectable context is not provided");const o=e.useModel(i,"modelValue");function n(){o.value=t.displayValue.value}e.watch(t.displayValue,n,{immediate:!0});const r=e.computed(()=>({oninput:()=>t.open({focus:!0}),onchange:n,...t.activatorAttrs.value}));return(l,u)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",e.mergeProps({"onUpdate:modelValue":u[0]||(u[0]=a=>o.value=a)},r.value,{autocomplete:"off"}),null,16)),[[e.vModelDynamic,o.value]])}}),we=["id"],ge=e.defineComponent({__name:"comboboxOptions",setup(i){const t=e.inject(F);if(!t)throw new Error("Combobox injectable context is not provided");return(o,n)=>e.unref(t).isOpen.value?(e.openBlock(),e.createElementBlock("div",{key:0,id:e.unref(t).popoverId,role:"listbox"},[e.renderSlot(o.$slots,"default")],8,we)):e.createCommentVNode("",!0)}}),ye=["id","data-active","aria-selected","aria-disabled"],_e=e.defineComponent({__name:"comboboxOption",props:{id:{},value:{},disabled:{type:Boolean}},setup(i){const t=i,o=t.id??x("combobox-option"),n=e.ref(),{isSelected:r,isActive:l,activate:u,select:a}=P(n,t.value,t.disabled),c=e.inject(F);if(!c)throw new Error("Combobox injectable context is not provided");function d(){a(),c.isMultiselectable.value?c.focus():c.close({focus:!0})}return(b,v)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"itemEl",ref:n,id:e.unref(o),onClick:d,onMouseenter:v[0]||(v[0]=f=>e.unref(u)({focus:!1})),"data-active":e.unref(l),"aria-selected":e.unref(r),"aria-disabled":b.disabled||void 0,role:"option"},[e.renderSlot(b.$slots,"default",{isSelected:e.unref(r),isActive:e.unref(l)})],40,ye))}});k.Combobox=Ie,k.ComboboxInput=he,k.ComboboxOption=_e,k.ComboboxOptions=ge,k.Listbox=X,k.ListboxOption=Z,k.Menu=ue,k.MenuItem=ve,k.MenuItems=me,k.Popover=le,k.PopoverDialog=ce,k.Tab=ae,k.TabContainer=ee,k.TabList=oe,k.TabPanel=re,k.Tooltip=fe,k.injectCombobox=F,k.injectMenu=H,k.injectPopover=z,k.injectTabs=N,k.useFormControl=J,k.useHTMLElement=j,k.useList=D,k.useListOption=P,k.usePopover=T,k.useSequentialId=x,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});
|
package/dist/types/utils/id.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useSequentialId(base?: string): string;
|