vue-composable-ui 0.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.
Files changed (123) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +5 -1
  3. package/dist/combobox.vue_vue_type_script_setup_true_lang-BhVMcx67.js +140 -0
  4. package/dist/comboboxHiddenInput.vue_vue_type_script_setup_true_lang-Ba-UPd-M.js +29 -0
  5. package/dist/comboboxInput.vue_vue_type_script_setup_true_lang-DzRfJ5ke.js +33 -0
  6. package/dist/comboboxOption.vue_vue_type_script_setup_true_lang-OyJxB4Jk.js +42 -0
  7. package/dist/comboboxOptions.vue_vue_type_script_setup_true_lang-Doy6MfEQ.js +20 -0
  8. package/dist/composable-ui.js +49 -0
  9. package/dist/composable-ui10.js +4 -0
  10. package/dist/composable-ui11.js +4 -0
  11. package/dist/composable-ui12.js +4 -0
  12. package/dist/composable-ui13.js +4 -0
  13. package/dist/composable-ui14.js +4 -0
  14. package/dist/composable-ui15.js +4 -0
  15. package/dist/composable-ui16.js +4 -0
  16. package/dist/composable-ui17.js +31 -0
  17. package/dist/composable-ui18.js +4 -0
  18. package/dist/composable-ui19.js +4 -0
  19. package/dist/composable-ui2.js +55 -0
  20. package/dist/composable-ui20.js +4 -0
  21. package/dist/composable-ui21.js +100 -0
  22. package/dist/composable-ui22.js +144 -0
  23. package/dist/composable-ui23.js +7 -0
  24. package/dist/composable-ui24.js +7 -0
  25. package/dist/composable-ui3.js +4 -0
  26. package/dist/composable-ui4.js +4 -0
  27. package/dist/composable-ui5.js +4 -0
  28. package/dist/composable-ui6.js +4 -0
  29. package/dist/composable-ui7.js +4 -0
  30. package/dist/composable-ui8.js +4 -0
  31. package/dist/composable-ui9.js +4 -0
  32. package/dist/listbox.vue_vue_type_script_setup_true_lang-Bj1ZXiBX.js +69 -0
  33. package/dist/listboxOption.vue_vue_type_script_setup_true_lang-B_yRptJm.js +37 -0
  34. package/dist/menu.vue_vue_type_script_setup_true_lang-Ci7q2rOg.js +82 -0
  35. package/dist/menuItem.vue_vue_type_script_setup_true_lang-mXtMa4gO.js +63 -0
  36. package/dist/menuItems.vue_vue_type_script_setup_true_lang-p9vftREy.js +49 -0
  37. package/dist/popover.vue_vue_type_script_setup_true_lang-DhKF7_nY.js +50 -0
  38. package/dist/popoverDialog.vue_vue_type_script_setup_true_lang-CDXUO7wZ.js +33 -0
  39. package/dist/tab.vue_vue_type_script_setup_true_lang-Y5OFGqMB.js +29 -0
  40. package/dist/tabContainer.vue_vue_type_script_setup_true_lang-fPpLno2Z.js +40 -0
  41. package/dist/tabList.vue_vue_type_script_setup_true_lang-CZyqGCuj.js +48 -0
  42. package/dist/tabPanel.vue_vue_type_script_setup_true_lang-CGhP6SHR.js +31 -0
  43. package/dist/tooltip.vue_vue_type_script_setup_true_lang-DVKYJyfL.js +85 -0
  44. package/dist/types/components/combobox/combobox.vue.d.ts +45 -0
  45. package/dist/types/components/combobox/comboboxHiddenInput.vue.d.ts +6 -0
  46. package/dist/types/components/combobox/comboboxInput.vue.d.ts +9 -0
  47. package/dist/types/components/combobox/comboboxOption.vue.d.ts +20 -0
  48. package/dist/types/components/combobox/comboboxOptions.vue.d.ts +12 -0
  49. package/dist/types/components/injectionKeys.d.ts +43 -0
  50. package/dist/types/components/listbox/listbox.vue.d.ts +26 -0
  51. package/dist/types/components/listbox/listboxOption.vue.d.ts +20 -0
  52. package/dist/types/components/menu/menu.vue.d.ts +42 -0
  53. package/dist/types/components/menu/menuItem.vue.d.ts +24 -0
  54. package/dist/types/components/menu/menuItems.vue.d.ts +12 -0
  55. package/dist/types/components/popover/popover.vue.d.ts +40 -0
  56. package/dist/types/components/popover/popoverDialog.vue.d.ts +12 -0
  57. package/dist/types/components/tabs/tab.vue.d.ts +17 -0
  58. package/dist/types/components/tabs/tabContainer.vue.d.ts +19 -0
  59. package/dist/types/components/tabs/tabList.vue.d.ts +17 -0
  60. package/dist/types/components/tabs/tabPanel.vue.d.ts +15 -0
  61. package/dist/types/components/tooltip.vue.d.ts +34 -0
  62. package/dist/types/composables/formControl.d.ts +48 -0
  63. package/dist/types/composables/list.d.ts +107 -0
  64. package/dist/types/composables/listOption.d.ts +34 -0
  65. package/dist/types/composables/popover.d.ts +68 -0
  66. package/dist/types/main.d.ts +22 -0
  67. package/dist/types/utils/element.d.ts +3 -0
  68. package/package.json +28 -12
  69. package/.github/workflows/deploy.yml +0 -21
  70. package/.github/workflows/docs.yml +0 -62
  71. package/.vscode/extensions.json +0 -7
  72. package/docs/.vitepress/config.mts +0 -40
  73. package/docs/.vitepress/theme/index.js +0 -4
  74. package/docs/.vitepress/theme/style.scss +0 -155
  75. package/docs/components/combobox.md +0 -174
  76. package/docs/components/demos/combobox.vue +0 -142
  77. package/docs/components/demos/combobox_autocomplete.vue +0 -75
  78. package/docs/components/demos/combobox_tags.vue +0 -127
  79. package/docs/components/demos/input.vue +0 -35
  80. package/docs/components/demos/listbox.vue +0 -64
  81. package/docs/components/demos/menu.vue +0 -93
  82. package/docs/components/demos/popover.vue +0 -16
  83. package/docs/components/demos/tabs.vue +0 -59
  84. package/docs/components/demos/tooltip.vue +0 -27
  85. package/docs/components/listbox.md +0 -9
  86. package/docs/components/menu.md +0 -121
  87. package/docs/components/popover.md +0 -82
  88. package/docs/components/tabs.md +0 -9
  89. package/docs/components/tooltip.md +0 -78
  90. package/docs/composables/form-control.md +0 -130
  91. package/docs/composables/list-option.md +0 -47
  92. package/docs/composables/list.md +0 -192
  93. package/docs/composables/popover.md +0 -90
  94. package/docs/index.md +0 -24
  95. package/docs/intro.md +0 -0
  96. package/src/components/combobox/combobox.vue +0 -229
  97. package/src/components/combobox/comboboxFormInput.vue +0 -33
  98. package/src/components/combobox/comboboxOption.vue +0 -52
  99. package/src/components/combobox/comboboxOptions.vue +0 -17
  100. package/src/components/injectionKeys.ts +0 -50
  101. package/src/components/listbox/listbox.vue +0 -91
  102. package/src/components/listbox/listboxOption.vue +0 -37
  103. package/src/components/menu/menu.vue +0 -100
  104. package/src/components/menu/menuItem.vue +0 -86
  105. package/src/components/menu/menuItems.vue +0 -51
  106. package/src/components/popover/popover.vue +0 -68
  107. package/src/components/popover/popoverDialog.vue +0 -35
  108. package/src/components/tabs/tab.vue +0 -35
  109. package/src/components/tabs/tabContainer.vue +0 -50
  110. package/src/components/tabs/tabList.vue +0 -52
  111. package/src/components/tabs/tabPanel.vue +0 -36
  112. package/src/components/tooltip.vue +0 -115
  113. package/src/composables/formControl.ts +0 -144
  114. package/src/composables/list.ts +0 -326
  115. package/src/composables/listOption.ts +0 -80
  116. package/src/composables/popover.ts +0 -306
  117. package/src/main.ts +0 -65
  118. package/src/utils/element.ts +0 -19
  119. package/src/utils/id.ts +0 -5
  120. package/src/vite-env.d.ts +0 -1
  121. package/tsconfig.json +0 -27
  122. package/tsconfig.node.json +0 -10
  123. package/vite.config.ts +0 -28
@@ -0,0 +1,48 @@
1
+ import { defineComponent as i, inject as n, createElementBlock as c, openBlock as s, renderSlot as u } from "vue";
2
+ import { injectTabs as l } from "./composable-ui24.js";
3
+ const f = ["aria-orientation"], b = /* @__PURE__ */ i({
4
+ __name: "tabList",
5
+ props: {
6
+ orientation: { default: "horizontal" }
7
+ },
8
+ setup(r) {
9
+ const e = r, t = n(l);
10
+ if (!t)
11
+ throw new Error("Tabs injectable context is not provided");
12
+ function a(o) {
13
+ switch (o.code) {
14
+ case "ArrowUp":
15
+ e.orientation === "vertical" && t.activatePrevItem({ focus: !0, loop: !0 });
16
+ break;
17
+ case "ArrowDown":
18
+ e.orientation === "vertical" && t.activateNextItem({ focus: !0, loop: !0 });
19
+ break;
20
+ case "ArrowLeft":
21
+ e.orientation === "horizontal" && t.activatePrevItem({ focus: !0, loop: !0 });
22
+ break;
23
+ case "ArrowRight":
24
+ e.orientation === "horizontal" && t.activateNextItem({ focus: !0, loop: !0 });
25
+ break;
26
+ case "Home":
27
+ t.activateFirstItem({ focus: !0 });
28
+ break;
29
+ case "End":
30
+ t.activateLastItem({ focus: !0 });
31
+ break;
32
+ default:
33
+ return;
34
+ }
35
+ t.selectActiveItem(), o.preventDefault();
36
+ }
37
+ return (o, p) => (s(), c("div", {
38
+ onKeydown: a,
39
+ "aria-orientation": e.orientation,
40
+ role: "tablist"
41
+ }, [
42
+ u(o.$slots, "default")
43
+ ], 40, f));
44
+ }
45
+ });
46
+ export {
47
+ b as _
48
+ };
@@ -0,0 +1,31 @@
1
+ import { defineComponent as c, inject as i, computed as d, withDirectives as p, createElementBlock as b, openBlock as u, unref as r, renderSlot as m, vShow as v } from "vue";
2
+ import { injectList as f } from "./composable-ui22.js";
3
+ import { injectTabs as _ } from "./composable-ui24.js";
4
+ const h = ["id", "aria-labelledby"], I = /* @__PURE__ */ c({
5
+ __name: "tabPanel",
6
+ props: {
7
+ value: {}
8
+ },
9
+ setup(a) {
10
+ const e = a, t = i(f);
11
+ if (!t)
12
+ throw new Error("List injectable context is not provided");
13
+ const o = i(_);
14
+ if (!o)
15
+ throw new Error("Tabs injectable context is not provided");
16
+ const s = d(() => e.value === t.value.value), n = o.getIds(e.value);
17
+ return (l, w) => p((u(), b("div", {
18
+ id: r(n).panelId,
19
+ "aria-labelledby": r(n).tabId,
20
+ tabindex: "0",
21
+ role: "tabpanel"
22
+ }, [
23
+ m(l.$slots, "default")
24
+ ], 8, h)), [
25
+ [v, s.value]
26
+ ]);
27
+ }
28
+ });
29
+ export {
30
+ I as _
31
+ };
@@ -0,0 +1,85 @@
1
+ import { defineComponent as g, useSlots as b, ref as E, useId as k, onMounted as w, onBeforeUnmount as _, createElementBlock as c, openBlock as a, Fragment as $, renderSlot as p, createBlock as L, Teleport as T, createCommentVNode as h, unref as f, mergeProps as B, createTextVNode as S, toDisplayString as A } from "vue";
2
+ import { usePopover as C } from "./composable-ui21.js";
3
+ const I = ["id"], V = /* @__PURE__ */ g({
4
+ inheritAttrs: !1,
5
+ __name: "tooltip",
6
+ props: {
7
+ id: {},
8
+ text: {},
9
+ delay: {},
10
+ direction: { default: "up" }
11
+ },
12
+ setup(m) {
13
+ const o = m, v = b(), l = E();
14
+ let d;
15
+ const n = o.id ?? k(), { isOpen: i } = C(`[aria-describedby=${n}]`, l, {
16
+ direction: o.direction,
17
+ align: "center"
18
+ });
19
+ function s() {
20
+ d = setTimeout(
21
+ () => {
22
+ i.value = !0;
23
+ },
24
+ typeof o.delay == "string" ? parseInt(o.delay) : o.delay
25
+ );
26
+ }
27
+ function r() {
28
+ i.value = !1, clearTimeout(d);
29
+ }
30
+ function u(e) {
31
+ e.key === "Escape" && r();
32
+ }
33
+ const y = {
34
+ "aria-describedby": n,
35
+ onmouseenter: s,
36
+ onmouseleave: r,
37
+ onfocus: s,
38
+ onblur: r,
39
+ onkeydown: u
40
+ }, t = new AbortController();
41
+ return w(() => {
42
+ if (v.default) return;
43
+ const e = document.querySelector(
44
+ `[aria-describedby=${n}]`
45
+ );
46
+ if (!e)
47
+ throw new Error(`Tooltip activator not found: ${n}`);
48
+ e.addEventListener("mouseenter", s, {
49
+ signal: t.signal,
50
+ passive: !0
51
+ }), e.addEventListener("mouseleave", r, {
52
+ signal: t.signal,
53
+ passive: !0
54
+ }), e.addEventListener("focus", s, {
55
+ signal: t.signal,
56
+ passive: !0
57
+ }), e.addEventListener("blur", r, {
58
+ signal: t.signal,
59
+ passive: !0
60
+ }), e.addEventListener("keydown", u, {
61
+ signal: t.signal,
62
+ passive: !0
63
+ });
64
+ }), _(() => {
65
+ t.abort();
66
+ }), (e, D) => (a(), c($, null, [
67
+ p(e.$slots, "default", { attrs: y }),
68
+ (a(), L(T, { to: "body" }, [
69
+ f(i) ? (a(), c("div", B({
70
+ key: 0,
71
+ ref_key: "popupEl",
72
+ ref: l,
73
+ id: f(n)
74
+ }, e.$attrs, { role: "tooltip" }), [
75
+ p(e.$slots, "content", {}, () => [
76
+ S(A(e.text), 1)
77
+ ])
78
+ ], 16, I)) : h("", !0)
79
+ ]))
80
+ ], 64));
81
+ }
82
+ });
83
+ export {
84
+ V as _
85
+ };
@@ -0,0 +1,45 @@
1
+ type __VLS_Props = {
2
+ displayValue?: (value: any) => string;
3
+ id?: string;
4
+ activatorId?: string;
5
+ name?: string;
6
+ formValue?: (item: any) => Record<string, string> | string;
7
+ };
8
+ declare function onKeyDown(evt: KeyboardEvent): void;
9
+ type __VLS_PublicProps = __VLS_Props & {
10
+ modelValue?: any;
11
+ };
12
+ declare var __VLS_9: {
13
+ popoverId: string;
14
+ isOpen: boolean;
15
+ toggle: () => void;
16
+ displayValue: ((value: any) => string) & string;
17
+ attrs: {
18
+ onkeydown: typeof onKeyDown;
19
+ onclick: () => void;
20
+ id: string;
21
+ "aria-controls": string | undefined;
22
+ "aria-expanded": boolean;
23
+ "aria-activedescendant": string | undefined;
24
+ "aria-haspopup": "listbox";
25
+ role: string;
26
+ };
27
+ };
28
+ type __VLS_Slots = {} & {
29
+ default?: (props: typeof __VLS_9) => any;
30
+ };
31
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
32
+ "update:modelValue": (value: any) => any;
33
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
34
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
35
+ }>, {
36
+ displayValue: (value: any) => string;
37
+ formValue: (item: any) => Record<string, string> | string;
38
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
39
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
40
+ export default _default;
41
+ type __VLS_WithSlots<T, S> = T & {
42
+ new (): {
43
+ $slots: S;
44
+ };
45
+ };
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ name: string;
3
+ value: any;
4
+ };
5
+ declare const _default: 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>;
6
+ export default _default;
@@ -0,0 +1,9 @@
1
+ type __VLS_PublicProps = {
2
+ modelValue?: string;
3
+ };
4
+ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
+ "update:modelValue": (value: string | undefined) => any;
6
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
7
+ "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
8
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ export default _default;
@@ -0,0 +1,20 @@
1
+ type __VLS_Props = {
2
+ id?: string;
3
+ value: any;
4
+ disabled?: boolean;
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, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
15
+ export default _default;
16
+ type __VLS_WithSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
@@ -0,0 +1,12 @@
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ };
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>;
7
+ export default _default;
8
+ type __VLS_WithSlots<T, S> = T & {
9
+ new (): {
10
+ $slots: S;
11
+ };
12
+ };
@@ -0,0 +1,43 @@
1
+ import type { ComputedRef, InjectionKey } from "vue";
2
+ import type { UseListReturn } from "../composables/list";
3
+ import type { UsePopoverReturn } from "../composables/popover";
4
+ export declare const injectTabs: InjectionKey<{
5
+ getIds: (value: any) => ComputedRef<{
6
+ tabId: string | undefined;
7
+ panelId: string | undefined;
8
+ }>;
9
+ selectActiveItem: UseListReturn["selectActiveItem"];
10
+ activateFirstItem: UseListReturn["activateFirstItem"];
11
+ activateLastItem: UseListReturn["activateLastItem"];
12
+ activateNextItem: UseListReturn["activateNextItem"];
13
+ activatePrevItem: UseListReturn["activatePrevItem"];
14
+ }>;
15
+ export declare const injectPopover: InjectionKey<{
16
+ popoverId: string;
17
+ activatorId: string;
18
+ role: "dialog" | "listbox" | "menu" | "tree" | "grid";
19
+ isOpen: UsePopoverReturn["isOpen"];
20
+ close: UsePopoverReturn["close"];
21
+ }>;
22
+ export declare const injectMenu: InjectionKey<{
23
+ menuId: string;
24
+ activatorId: string;
25
+ isOpen: UsePopoverReturn["isOpen"];
26
+ close: UsePopoverReturn["close"];
27
+ activeItemId: ComputedRef<string | undefined>;
28
+ isMultiselectable: UseListReturn["isMultiselectable"];
29
+ activateFirstItem: UseListReturn["activateFirstItem"];
30
+ activateLastItem: UseListReturn["activateLastItem"];
31
+ activateNextItem: UseListReturn["activateNextItem"];
32
+ activatePrevItem: UseListReturn["activatePrevItem"];
33
+ }>;
34
+ export declare const injectCombobox: InjectionKey<{
35
+ displayValue: ComputedRef<string | undefined>;
36
+ popoverId: string;
37
+ isOpen: UsePopoverReturn["isOpen"];
38
+ open: UsePopoverReturn["open"];
39
+ close: UsePopoverReturn["close"];
40
+ isMultiselectable: UseListReturn["isMultiselectable"];
41
+ focus: () => void;
42
+ activatorAttrs: ComputedRef<Record<string, any>>;
43
+ }>;
@@ -0,0 +1,26 @@
1
+ type __VLS_Props = {
2
+ orientation?: "horizontal" | "vertical";
3
+ loop?: boolean;
4
+ };
5
+ type __VLS_PublicProps = __VLS_Props & {
6
+ modelValue?: any;
7
+ };
8
+ declare var __VLS_1: {};
9
+ type __VLS_Slots = {} & {
10
+ default?: (props: typeof __VLS_1) => any;
11
+ };
12
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ "update:modelValue": (value: any) => any;
14
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
15
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
16
+ }>, {
17
+ loop: boolean;
18
+ orientation: "horizontal" | "vertical";
19
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
21
+ export default _default;
22
+ type __VLS_WithSlots<T, S> = T & {
23
+ new (): {
24
+ $slots: S;
25
+ };
26
+ };
@@ -0,0 +1,20 @@
1
+ type __VLS_Props = {
2
+ id?: string;
3
+ value?: any;
4
+ disabled?: boolean;
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, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
15
+ export default _default;
16
+ type __VLS_WithSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
@@ -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
+ };
@@ -0,0 +1,24 @@
1
+ type __VLS_Props = {
2
+ id?: string;
3
+ value?: any;
4
+ disabled?: boolean;
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, {
14
+ select: (value: any) => any;
15
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
16
+ onSelect?: ((value: any) => any) | undefined;
17
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
19
+ export default _default;
20
+ type __VLS_WithSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -0,0 +1,12 @@
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ };
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>;
7
+ export default _default;
8
+ type __VLS_WithSlots<T, S> = T & {
9
+ new (): {
10
+ $slots: S;
11
+ };
12
+ };
@@ -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
+ };
@@ -0,0 +1,12 @@
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ };
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>;
7
+ export default _default;
8
+ type __VLS_WithSlots<T, S> = T & {
9
+ new (): {
10
+ $slots: S;
11
+ };
12
+ };
@@ -0,0 +1,17 @@
1
+ type __VLS_Props = {
2
+ id?: string;
3
+ ariaControls?: string;
4
+ value: string | number;
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>;
12
+ export default _default;
13
+ type __VLS_WithSlots<T, S> = T & {
14
+ new (): {
15
+ $slots: S;
16
+ };
17
+ };
@@ -0,0 +1,19 @@
1
+ type __VLS_PublicProps = {
2
+ modelValue?: string | number;
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_PublicProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
+ "update:modelValue": (value: string | number | undefined) => any;
10
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
11
+ "onUpdate:modelValue"?: ((value: string | number | undefined) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
14
+ export default _default;
15
+ type __VLS_WithSlots<T, S> = T & {
16
+ new (): {
17
+ $slots: S;
18
+ };
19
+ };
@@ -0,0 +1,17 @@
1
+ type __VLS_Props = {
2
+ orientation?: "horizontal" | "vertical";
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
+ orientation: "horizontal" | "vertical";
10
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
12
+ export default _default;
13
+ type __VLS_WithSlots<T, S> = T & {
14
+ new (): {
15
+ $slots: S;
16
+ };
17
+ };
@@ -0,0 +1,15 @@
1
+ type __VLS_Props = {
2
+ value: string | number;
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
+ export default _default;
11
+ type __VLS_WithSlots<T, S> = T & {
12
+ new (): {
13
+ $slots: S;
14
+ };
15
+ };
@@ -0,0 +1,34 @@
1
+ type __VLS_Props = {
2
+ id?: string;
3
+ text?: string;
4
+ delay?: string | number;
5
+ direction?: "up" | "down" | "left" | "right";
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<{}>, {
26
+ direction: "up" | "down" | "left" | "right";
27
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
29
+ export default _default;
30
+ type __VLS_WithSlots<T, S> = T & {
31
+ new (): {
32
+ $slots: S;
33
+ };
34
+ };
@@ -0,0 +1,48 @@
1
+ import type { MaybeRef, Ref } from "vue";
2
+ import type { TemplateRefOrSelector } from "../utils/element";
3
+ type FormElement = HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;
4
+ /**
5
+ * A validating function must return `true` or a string describing the error
6
+ */
7
+ export type FormValidator = (value: string) => boolean | string;
8
+ export interface useFormControlReturn {
9
+ /**
10
+ * Focus the form control
11
+ */
12
+ focus: () => void;
13
+ /**
14
+ * Validate the form control
15
+ *
16
+ * @returns Validation result
17
+ */
18
+ validate: () => boolean;
19
+ /**
20
+ * Whether the form control is valid. A shorthand for `validity.valid`, but can be manually overriden.
21
+ */
22
+ isValid: Ref<boolean>;
23
+ /**
24
+ * The validity state of the form control
25
+ *
26
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/ValidityState}
27
+ */
28
+ validity: Readonly<Ref<ValidityState | undefined>>;
29
+ /**
30
+ * A string representing a localized message that describes the validation constraints that the control does not satisfy (if any)
31
+ */
32
+ validationMessage: Readonly<Ref<string>>;
33
+ /**
34
+ * Whether the value has been changed since the form control was mounted
35
+ */
36
+ isChanged: Ref<boolean>;
37
+ }
38
+ /**
39
+ * Utilizes Constraint Validation API to enable custom validation constrains for a form control
40
+ *
41
+ * @param el A template ref or a CSS selector
42
+ * @param validators An array of validating functions
43
+ * @param showValidationError Whether to show the default browser validation error (true by default)
44
+ *
45
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Constraint_validation}
46
+ */
47
+ export declare function useFormControl(el: TemplateRefOrSelector<FormElement>, validators?: MaybeRef<FormValidator[]>, showValidationError?: MaybeRef<boolean>): useFormControlReturn;
48
+ export {};