vue-composable-ui 1.0.2 → 1.0.3

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 (33) hide show
  1. package/dist/{combobox.vue_vue_type_script_setup_true_lang-BhVMcx67.js → combobox.vue_vue_type_script_setup_true_lang-DpM6lN_3.js} +36 -36
  2. package/dist/comboboxOption.vue_vue_type_script_setup_true_lang-DPEArk3M.js +42 -0
  3. package/dist/composable-ui.js +6 -6
  4. package/dist/composable-ui11.js +1 -1
  5. package/dist/composable-ui13.js +1 -1
  6. package/dist/composable-ui14.js +1 -1
  7. package/dist/composable-ui16.js +1 -1
  8. package/dist/composable-ui20.js +1 -1
  9. package/dist/composable-ui3.js +1 -1
  10. package/dist/{listbox.vue_vue_type_script_setup_true_lang-Bj1ZXiBX.js → listbox.vue_vue_type_script_setup_true_lang-CP8lV3wp.js} +12 -12
  11. package/dist/{listboxOption.vue_vue_type_script_setup_true_lang-B_yRptJm.js → listboxOption.vue_vue_type_script_setup_true_lang-C1-Q-dSr.js} +16 -16
  12. package/dist/menuItem.vue_vue_type_script_setup_true_lang-ezPw3j-i.js +63 -0
  13. package/dist/{tooltip.vue_vue_type_script_setup_true_lang-DVKYJyfL.js → tooltip.vue_vue_type_script_setup_true_lang-D4uAZmQb.js} +21 -21
  14. package/dist/types/components/combobox/combobox.vue.d.ts +1 -1
  15. package/dist/types/components/combobox/comboboxHiddenInput.vue.d.ts +1 -1
  16. package/dist/types/components/combobox/comboboxInput.vue.d.ts +1 -1
  17. package/dist/types/components/combobox/comboboxOption.vue.d.ts +1 -1
  18. package/dist/types/components/combobox/comboboxOptions.vue.d.ts +1 -1
  19. package/dist/types/components/listbox/listbox.vue.d.ts +1 -1
  20. package/dist/types/components/listbox/listboxOption.vue.d.ts +1 -1
  21. package/dist/types/components/menu/menu.vue.d.ts +1 -1
  22. package/dist/types/components/menu/menuItem.vue.d.ts +1 -1
  23. package/dist/types/components/menu/menuItems.vue.d.ts +1 -1
  24. package/dist/types/components/popover/popover.vue.d.ts +1 -1
  25. package/dist/types/components/popover/popoverDialog.vue.d.ts +1 -1
  26. package/dist/types/components/tabs/tab.vue.d.ts +1 -1
  27. package/dist/types/components/tabs/tabContainer.vue.d.ts +1 -1
  28. package/dist/types/components/tabs/tabList.vue.d.ts +1 -1
  29. package/dist/types/components/tabs/tabPanel.vue.d.ts +1 -1
  30. package/dist/types/components/tooltip.vue.d.ts +1 -1
  31. package/package.json +2 -1
  32. package/dist/comboboxOption.vue_vue_type_script_setup_true_lang-OyJxB4Jk.js +0 -42
  33. package/dist/menuItem.vue_vue_type_script_setup_true_lang-mXtMa4gO.js +0 -63
@@ -1,25 +1,25 @@
1
- import { defineComponent as _, mergeModels as B, computed as p, useModel as H, useId as T, watch as j, provide as N, createElementBlock as v, openBlock as l, Fragment as b, createCommentVNode as P, renderSlot as U, createBlock as h, unref as k, renderList as K, nextTick as $ } from "vue";
1
+ import { defineComponent as B, mergeModels as H, computed as p, useModel as T, useId as j, watch as N, provide as P, createElementBlock as v, openBlock as r, Fragment as b, createCommentVNode as U, renderSlot as K, createBlock as A, unref as k, renderList as _, nextTick as h } from "vue";
2
2
  import { useHTMLElement as q } from "./composable-ui23.js";
3
3
  import { usePopover as z } from "./composable-ui21.js";
4
4
  import { useList as G } from "./composable-ui22.js";
5
- import { _ as x } from "./comboboxHiddenInput.vue_vue_type_script_setup_true_lang-Ba-UPd-M.js";
5
+ import { _ as $ } from "./comboboxHiddenInput.vue_vue_type_script_setup_true_lang-Ba-UPd-M.js";
6
6
  import { injectCombobox as J } from "./composable-ui24.js";
7
- const ae = /* @__PURE__ */ _({
7
+ const ae = /* @__PURE__ */ B({
8
8
  inheritAttrs: !1,
9
9
  __name: "combobox",
10
- props: /* @__PURE__ */ B({
11
- displayValue: { type: Function, default: (a) => Array.isArray(a) ? a.map((o) => o.toString()).join(", ") : a.toString() },
10
+ props: /* @__PURE__ */ H({
11
+ displayValue: { type: Function, default: (e) => Array.isArray(e) ? e.map((t) => t.toString()).join(", ") : e.toString() },
12
12
  id: {},
13
13
  activatorId: {},
14
14
  name: {},
15
- formValue: { type: Function, default: (a) => a }
15
+ formValue: { type: Function, default: (e) => e }
16
16
  }, {
17
17
  modelValue: {},
18
18
  modelModifiers: {}
19
19
  }),
20
20
  emits: ["update:modelValue"],
21
- setup(a) {
22
- const o = a, I = p(() => u.value ? c.value.map((e) => o.formValue(e)) : o.formValue(c.value)), c = H(a, "modelValue"), i = o.id ?? T(), y = o.activatorId ?? i, n = `${i}-popover`, { isOpen: t, toggle: E, open: s, close: r } = z(
21
+ setup(e) {
22
+ const t = e, I = p(() => u.value ? l.value.map((a) => t.formValue(a)) : t.formValue(l.value)), l = T(e, "modelValue"), i = t.id ?? j(), y = t.activatorId ?? i, n = `${i}-popover`, { isOpen: o, toggle: E, open: s, close: c } = z(
23
23
  `#${y}`,
24
24
  `#${n}`,
25
25
  {
@@ -39,24 +39,24 @@ const ae = /* @__PURE__ */ _({
39
39
  activateLastItem: V,
40
40
  activateNextItem: C,
41
41
  activatePrevItem: M
42
- } = G(c), g = p(() => o.displayValue(c.value));
43
- j(w, () => {
42
+ } = G(l), g = p(() => t.displayValue(l.value));
43
+ N(w, () => {
44
44
  !f.value && w.value.length && (S({ focus: !1 }), f.value || d({ focus: !1 }));
45
45
  });
46
46
  function O() {
47
47
  q(`#${y}`).value?.focus();
48
48
  }
49
- function D(e) {
50
- if (t.value)
51
- switch (e.code) {
49
+ function D(a) {
50
+ if (o.value)
51
+ switch (a.code) {
52
52
  case "Space":
53
- m(), u.value || r({ focus: !0 });
53
+ m(), u.value || c({ focus: !0 });
54
54
  break;
55
55
  case "Enter":
56
- m(), r({ focus: !0 });
56
+ m(), c({ focus: !0 });
57
57
  break;
58
58
  case "Tab":
59
- m(), r({ focus: !0 });
59
+ m(), c({ focus: !0 });
60
60
  return;
61
61
  case "ArrowUp":
62
62
  M({ focus: !1, loop: !1 });
@@ -71,66 +71,66 @@ const ae = /* @__PURE__ */ _({
71
71
  V({ focus: !1 });
72
72
  break;
73
73
  case "Escape":
74
- r({ focus: !0 });
74
+ c({ focus: !0 });
75
75
  break;
76
76
  default:
77
77
  return;
78
78
  }
79
79
  else
80
- switch (e.code) {
80
+ switch (a.code) {
81
81
  case "Space":
82
82
  case "Enter":
83
83
  s({ focus: !1 });
84
84
  break;
85
85
  case "End":
86
86
  case "ArrowUp":
87
- s({ focus: !1 }), $(() => V({ focus: !1 }));
87
+ s({ focus: !1 }), h(() => V({ focus: !1 }));
88
88
  break;
89
89
  case "Home":
90
90
  case "ArrowDown":
91
- s({ focus: !1 }), $(() => d({ focus: !1 }));
91
+ s({ focus: !1 }), h(() => d({ focus: !1 }));
92
92
  break;
93
93
  default:
94
94
  return;
95
95
  }
96
- e.preventDefault();
96
+ a.preventDefault();
97
97
  }
98
- const A = p(() => ({
98
+ const x = p(() => ({
99
99
  onkeydown: D,
100
100
  onclick: () => s({ focus: !1 }),
101
101
  id: i,
102
- "aria-controls": t.value ? n : void 0,
103
- "aria-expanded": t.value,
102
+ "aria-controls": o.value ? n : void 0,
103
+ "aria-expanded": o.value,
104
104
  "aria-activedescendant": f.value?.element.value?.id,
105
105
  "aria-haspopup": "listbox",
106
106
  role: "combobox"
107
107
  }));
108
- return N(J, {
108
+ return P(J, {
109
109
  displayValue: g,
110
110
  popoverId: n,
111
- isOpen: t,
111
+ isOpen: o,
112
112
  open: s,
113
- close: r,
113
+ close: c,
114
114
  focus: O,
115
115
  isMultiselectable: u,
116
- activatorAttrs: A
117
- }), (e, Q) => (l(), v(b, null, [
118
- e.name ? (l(), v(b, { key: 0 }, [
119
- k(u) ? (l(!0), v(b, { key: 0 }, K(I.value, (F, L) => (l(), h(x, {
116
+ activatorAttrs: x
117
+ }), (a, Q) => (r(), v(b, null, [
118
+ e.name ? (r(), v(b, { key: 0 }, [
119
+ k(u) ? (r(!0), v(b, { key: 0 }, _(I.value, (F, L) => (r(), A($, {
120
120
  name: `${e.name}[${L}]`,
121
121
  value: F
122
- }, null, 8, ["name", "value"]))), 256)) : (l(), h(x, {
122
+ }, null, 8, ["name", "value"]))), 256)) : (r(), A($, {
123
123
  key: 1,
124
124
  name: e.name,
125
125
  value: I.value
126
126
  }, null, 8, ["name", "value"]))
127
- ], 64)) : P("", !0),
128
- U(e.$slots, "default", {
127
+ ], 64)) : U("", !0),
128
+ K(a.$slots, "default", {
129
129
  popoverId: n,
130
- isOpen: k(t),
130
+ isOpen: k(o),
131
131
  toggle: () => k(E)(),
132
132
  displayValue: g.value,
133
- attrs: A.value
133
+ attrs: x.value
134
134
  })
135
135
  ], 64));
136
136
  }
@@ -0,0 +1,42 @@
1
+ import { defineComponent as f, useId as b, useTemplateRef as p, inject as v, createElementBlock as x, openBlock as E, unref as e, renderSlot as _ } from "vue";
2
+ import { useListOption as k } from "./composable-ui17.js";
3
+ import { injectCombobox as C } from "./composable-ui24.js";
4
+ const j = ["id", "data-active", "aria-selected", "aria-disabled"], A = /* @__PURE__ */ f({
5
+ __name: "comboboxOption",
6
+ props: {
7
+ id: {},
8
+ value: {},
9
+ disabled: { type: Boolean }
10
+ },
11
+ setup(i) {
12
+ const o = i, c = o.id ?? b(), s = p("itemEl"), { isSelected: n, isActive: a, activate: d, select: r } = k(
13
+ s,
14
+ o.value,
15
+ o.disabled
16
+ ), t = v(C);
17
+ if (!t)
18
+ throw new Error("Combobox injectable context is not provided");
19
+ function m() {
20
+ r(), t.isMultiselectable.value ? t.focus() : t.close({ focus: !0 });
21
+ }
22
+ return (u, l) => (E(), x("div", {
23
+ ref_key: "itemEl",
24
+ ref: s,
25
+ id: e(c),
26
+ onClick: m,
27
+ onMouseenter: l[0] || (l[0] = (B) => e(d)({ focus: !1 })),
28
+ "data-active": e(a),
29
+ "aria-selected": e(n),
30
+ "aria-disabled": i.disabled || void 0,
31
+ role: "option"
32
+ }, [
33
+ _(u.$slots, "default", {
34
+ isSelected: e(n),
35
+ isActive: e(a)
36
+ })
37
+ ], 40, j));
38
+ }
39
+ });
40
+ export {
41
+ A as _
42
+ };
@@ -4,22 +4,22 @@ import { useListOption as s } from "./composable-ui17.js";
4
4
  import { useFormControl as a } from "./composable-ui2.js";
5
5
  import { useHTMLElement as n } from "./composable-ui23.js";
6
6
  import { injectCombobox as i, injectMenu as _, injectPopover as u, injectTabs as C } from "./composable-ui24.js";
7
- import { _ as L } from "./listbox.vue_vue_type_script_setup_true_lang-Bj1ZXiBX.js";
8
- import { _ as M } from "./listboxOption.vue_vue_type_script_setup_true_lang-B_yRptJm.js";
7
+ import { _ as L } from "./listbox.vue_vue_type_script_setup_true_lang-CP8lV3wp.js";
8
+ import { _ as M } from "./listboxOption.vue_vue_type_script_setup_true_lang-C1-Q-dSr.js";
9
9
  import { _ as c } from "./tabContainer.vue_vue_type_script_setup_true_lang-fPpLno2Z.js";
10
10
  import { _ as v } from "./tabList.vue_vue_type_script_setup_true_lang-CZyqGCuj.js";
11
11
  import { _ as I } from "./tab.vue_vue_type_script_setup_true_lang-Y5OFGqMB.js";
12
12
  import { _ as D } from "./tabPanel.vue_vue_type_script_setup_true_lang-CGhP6SHR.js";
13
13
  import { _ as F } from "./popover.vue_vue_type_script_setup_true_lang-DhKF7_nY.js";
14
14
  import { _ as d } from "./popoverDialog.vue_vue_type_script_setup_true_lang-CDXUO7wZ.js";
15
- import { _ as k } from "./tooltip.vue_vue_type_script_setup_true_lang-DVKYJyfL.js";
15
+ import { _ as k } from "./tooltip.vue_vue_type_script_setup_true_lang-D4uAZmQb.js";
16
16
  import { _ as w } from "./menu.vue_vue_type_script_setup_true_lang-Ci7q2rOg.js";
17
17
  import { _ as z } from "./menuItems.vue_vue_type_script_setup_true_lang-p9vftREy.js";
18
- import { _ as B } from "./menuItem.vue_vue_type_script_setup_true_lang-mXtMa4gO.js";
19
- import { _ as J } from "./combobox.vue_vue_type_script_setup_true_lang-BhVMcx67.js";
18
+ import { _ as B } from "./menuItem.vue_vue_type_script_setup_true_lang-ezPw3j-i.js";
19
+ import { _ as J } from "./combobox.vue_vue_type_script_setup_true_lang-DpM6lN_3.js";
20
20
  import { _ as N } from "./comboboxInput.vue_vue_type_script_setup_true_lang-DzRfJ5ke.js";
21
21
  import { _ as R } from "./comboboxOptions.vue_vue_type_script_setup_true_lang-Doy6MfEQ.js";
22
- import { _ as U } from "./comboboxOption.vue_vue_type_script_setup_true_lang-OyJxB4Jk.js";
22
+ import { _ as U } from "./comboboxOption.vue_vue_type_script_setup_true_lang-DPEArk3M.js";
23
23
  export {
24
24
  J as Combobox,
25
25
  N as ComboboxInput,
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./menuItem.vue_vue_type_script_setup_true_lang-mXtMa4gO.js";
1
+ import { _ as f } from "./menuItem.vue_vue_type_script_setup_true_lang-ezPw3j-i.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./listboxOption.vue_vue_type_script_setup_true_lang-B_yRptJm.js";
1
+ import { _ as f } from "./listboxOption.vue_vue_type_script_setup_true_lang-C1-Q-dSr.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./listbox.vue_vue_type_script_setup_true_lang-Bj1ZXiBX.js";
1
+ import { _ as f } from "./listbox.vue_vue_type_script_setup_true_lang-CP8lV3wp.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./comboboxOption.vue_vue_type_script_setup_true_lang-OyJxB4Jk.js";
1
+ import { _ as f } from "./comboboxOption.vue_vue_type_script_setup_true_lang-DPEArk3M.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./combobox.vue_vue_type_script_setup_true_lang-BhVMcx67.js";
1
+ import { _ as f } from "./combobox.vue_vue_type_script_setup_true_lang-DpM6lN_3.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./tooltip.vue_vue_type_script_setup_true_lang-DVKYJyfL.js";
1
+ import { _ as f } from "./tooltip.vue_vue_type_script_setup_true_lang-D4uAZmQb.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as m, mergeModels as p, useModel as v, computed as b, createElementBlock as k, openBlock as w, unref as I, renderSlot as h } from "vue";
2
- import { useList as A } from "./composable-ui22.js";
3
- const _ = ["aria-activedescendant", "aria-orientation", "aria-multiselectable"], B = /* @__PURE__ */ m({
2
+ import { useList as x } from "./composable-ui22.js";
3
+ const A = ["aria-activedescendant", "aria-orientation", "aria-multiselectable"], B = /* @__PURE__ */ m({
4
4
  __name: "listbox",
5
5
  props: /* @__PURE__ */ p({
6
6
  orientation: { default: "vertical" },
@@ -17,9 +17,9 @@ const _ = ["aria-activedescendant", "aria-orientation", "aria-multiselectable"],
17
17
  selectActiveItem: o,
18
18
  activateFirstItem: c,
19
19
  activateLastItem: u,
20
- activateNextItem: r,
21
- activatePrevItem: l
22
- } = A(n), f = b(() => s.value?.element.value?.id);
20
+ activateNextItem: l,
21
+ activatePrevItem: r
22
+ } = x(n), f = b(() => s.value?.element.value?.id);
23
23
  function d(a) {
24
24
  switch (a.code) {
25
25
  case "Space":
@@ -27,19 +27,19 @@ const _ = ["aria-activedescendant", "aria-orientation", "aria-multiselectable"],
27
27
  break;
28
28
  case "ArrowUp":
29
29
  if (e.orientation === "horizontal") return;
30
- l({ focus: !1, loop: e.loop }), t.value || o();
30
+ r({ focus: !1, loop: e.loop }), t.value || o();
31
31
  break;
32
32
  case "ArrowDown":
33
33
  if (e.orientation === "horizontal") return;
34
- r({ focus: !1, loop: e.loop }), t.value || o();
34
+ l({ focus: !1, loop: e.loop }), t.value || o();
35
35
  break;
36
36
  case "ArrowLeft":
37
37
  if (e.orientation === "vertical") return;
38
- l({ focus: !1, loop: e.loop }), t.value || o();
38
+ r({ focus: !1, loop: e.loop }), t.value || o();
39
39
  break;
40
40
  case "ArrowRight":
41
41
  if (e.orientation === "vertical") return;
42
- r({ focus: !1, loop: e.loop }), t.value || o();
42
+ l({ focus: !1, loop: e.loop }), t.value || o();
43
43
  break;
44
44
  case "Home":
45
45
  c({ focus: !1 });
@@ -52,16 +52,16 @@ const _ = ["aria-activedescendant", "aria-orientation", "aria-multiselectable"],
52
52
  }
53
53
  a.preventDefault();
54
54
  }
55
- return (a, x) => (w(), k("div", {
55
+ return (a, M) => (w(), k("div", {
56
56
  onKeydown: d,
57
57
  "aria-activedescendant": f.value,
58
- "aria-orientation": a.orientation,
58
+ "aria-orientation": i.orientation,
59
59
  "aria-multiselectable": I(t),
60
60
  role: "listbox",
61
61
  tabindex: "0"
62
62
  }, [
63
63
  h(a.$slots, "default")
64
- ], 40, _));
64
+ ], 40, A));
65
65
  }
66
66
  });
67
67
  export {
@@ -1,37 +1,37 @@
1
- import { defineComponent as p, useId as m, useTemplateRef as u, createElementBlock as f, openBlock as b, unref as e, renderSlot as v } from "vue";
1
+ import { defineComponent as m, useId as p, useTemplateRef as u, createElementBlock as f, openBlock as b, unref as e, renderSlot as v } from "vue";
2
2
  import { useListOption as _ } from "./composable-ui17.js";
3
- const k = ["id", "aria-disabled", "aria-selected", "data-active"], S = /* @__PURE__ */ p({
3
+ const k = ["id", "aria-disabled", "aria-selected", "data-active"], B = /* @__PURE__ */ m({
4
4
  __name: "listboxOption",
5
5
  props: {
6
6
  id: {},
7
7
  value: {},
8
8
  disabled: { type: Boolean }
9
9
  },
10
- setup(n) {
11
- const t = n, r = t.id ?? m(), i = u("itemEl"), { isSelected: s, isActive: o, select: a } = _(
12
- i,
10
+ setup(i) {
11
+ const t = i, n = t.id ?? p(), s = u("itemEl"), { isSelected: o, isActive: a, select: d } = _(
12
+ s,
13
13
  t.value,
14
14
  t.disabled
15
15
  );
16
- return (d, l) => (b(), f("div", {
16
+ return (r, l) => (b(), f("div", {
17
17
  ref_key: "itemEl",
18
- ref: i,
19
- id: e(r),
18
+ ref: s,
19
+ id: e(n),
20
20
  onClick: l[0] || (l[0] = //@ts-ignore
21
- (...c) => e(a) && e(a)(...c)),
22
- "aria-disabled": d.disabled,
23
- "aria-selected": e(s),
24
- "data-active": e(o),
21
+ (...c) => e(d) && e(d)(...c)),
22
+ "aria-disabled": i.disabled,
23
+ "aria-selected": e(o),
24
+ "data-active": e(a),
25
25
  role: "option",
26
26
  tabindex: "-1"
27
27
  }, [
28
- v(d.$slots, "default", {
29
- isSelected: e(s),
30
- isActive: e(o)
28
+ v(r.$slots, "default", {
29
+ isSelected: e(o),
30
+ isActive: e(a)
31
31
  })
32
32
  ], 8, k));
33
33
  }
34
34
  });
35
35
  export {
36
- S as _
36
+ B as _
37
37
  };
@@ -0,0 +1,63 @@
1
+ import { defineComponent as w, useId as x, useTemplateRef as y, inject as S, computed as h, createElementBlock as j, openBlock as A, unref as t, renderSlot as B } from "vue";
2
+ import { useListOption as I } from "./composable-ui17.js";
3
+ import { injectMenu as $ } from "./composable-ui24.js";
4
+ const C = ["id", "data-active", "role", "aria-checked", "aria-disabled"], O = /* @__PURE__ */ w({
5
+ __name: "menuItem",
6
+ props: {
7
+ id: {},
8
+ value: {},
9
+ disabled: { type: Boolean }
10
+ },
11
+ emits: ["select"],
12
+ setup(a, { emit: r }) {
13
+ const e = a, u = r, m = e.id ?? x(), s = y("itemEl"), { isSelected: c, isActive: d, select: v, activate: f, deactivate: p } = I(
14
+ s,
15
+ e.value,
16
+ e.disabled
17
+ ), i = S($);
18
+ if (!i)
19
+ throw new Error("Menu injectable context is not provided");
20
+ const b = h(() => e.value !== void 0 ? i.isMultiselectable.value ? "menuitemcheckbox" : "menuitemradio" : "menuitem");
21
+ function l() {
22
+ v(), u("select", e.value);
23
+ }
24
+ function k() {
25
+ l(), (e.value === void 0 || !i?.isMultiselectable.value) && i.close();
26
+ }
27
+ function E(o) {
28
+ switch (o.code) {
29
+ case "Space":
30
+ l(), e.value === void 0 && i.close();
31
+ break;
32
+ case "Enter":
33
+ l(), i.close();
34
+ break;
35
+ default:
36
+ return;
37
+ }
38
+ o.preventDefault();
39
+ }
40
+ return (o, n) => (A(), j("div", {
41
+ ref_key: "itemEl",
42
+ ref: s,
43
+ id: t(m),
44
+ onClick: k,
45
+ onKeydown: E,
46
+ onMouseenter: n[0] || (n[0] = (M) => t(f)({ focus: !1 })),
47
+ onMouseleave: n[1] || (n[1] = (M) => t(p)()),
48
+ "data-active": t(d),
49
+ role: b.value,
50
+ "aria-checked": a.value !== void 0 ? t(c) : void 0,
51
+ "aria-disabled": a.disabled || void 0,
52
+ tabindex: "-1"
53
+ }, [
54
+ B(o.$slots, "default", {
55
+ isSelected: t(c),
56
+ isActive: t(d)
57
+ })
58
+ ], 40, C));
59
+ }
60
+ });
61
+ export {
62
+ O as _
63
+ };
@@ -1,6 +1,6 @@
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";
1
+ import { defineComponent as g, useSlots as b, ref as E, useId as k, onMounted as w, onBeforeUnmount as $, createElementBlock as p, openBlock as a, Fragment as L, renderSlot as f, createBlock as T, Teleport as _, createCommentVNode as h, unref as m, mergeProps as B, createTextVNode as S, toDisplayString as A } from "vue";
2
2
  import { usePopover as C } from "./composable-ui21.js";
3
- const I = ["id"], V = /* @__PURE__ */ g({
3
+ const I = ["id"], P = /* @__PURE__ */ g({
4
4
  inheritAttrs: !1,
5
5
  __name: "tooltip",
6
6
  props: {
@@ -9,15 +9,15 @@ const I = ["id"], V = /* @__PURE__ */ g({
9
9
  delay: {},
10
10
  direction: { default: "up" }
11
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, {
12
+ setup(l) {
13
+ const o = l, v = b(), d = E();
14
+ let u;
15
+ const n = o.id ?? k(), { isOpen: i } = C(`[aria-describedby=${n}]`, d, {
16
16
  direction: o.direction,
17
17
  align: "center"
18
18
  });
19
19
  function s() {
20
- d = setTimeout(
20
+ u = setTimeout(
21
21
  () => {
22
22
  i.value = !0;
23
23
  },
@@ -25,9 +25,9 @@ const I = ["id"], V = /* @__PURE__ */ g({
25
25
  );
26
26
  }
27
27
  function r() {
28
- i.value = !1, clearTimeout(d);
28
+ i.value = !1, clearTimeout(u);
29
29
  }
30
- function u(e) {
30
+ function c(e) {
31
31
  e.key === "Escape" && r();
32
32
  }
33
33
  const y = {
@@ -36,7 +36,7 @@ const I = ["id"], V = /* @__PURE__ */ g({
36
36
  onmouseleave: r,
37
37
  onfocus: s,
38
38
  onblur: r,
39
- onkeydown: u
39
+ onkeydown: c
40
40
  }, t = new AbortController();
41
41
  return w(() => {
42
42
  if (v.default) return;
@@ -57,23 +57,23 @@ const I = ["id"], V = /* @__PURE__ */ g({
57
57
  }), e.addEventListener("blur", r, {
58
58
  signal: t.signal,
59
59
  passive: !0
60
- }), e.addEventListener("keydown", u, {
60
+ }), e.addEventListener("keydown", c, {
61
61
  signal: t.signal,
62
62
  passive: !0
63
63
  });
64
- }), _(() => {
64
+ }), $(() => {
65
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({
66
+ }), (e, x) => (a(), p(L, null, [
67
+ f(e.$slots, "default", { attrs: y }),
68
+ (a(), T(_, { to: "body" }, [
69
+ m(i) ? (a(), p("div", B({
70
70
  key: 0,
71
71
  ref_key: "popupEl",
72
- ref: l,
73
- id: f(n)
72
+ ref: d,
73
+ id: m(n)
74
74
  }, e.$attrs, { role: "tooltip" }), [
75
- p(e.$slots, "content", {}, () => [
76
- S(A(e.text), 1)
75
+ f(e.$slots, "content", {}, () => [
76
+ S(A(l.text), 1)
77
77
  ])
78
78
  ], 16, I)) : h("", !0)
79
79
  ]))
@@ -81,5 +81,5 @@ const I = ["id"], V = /* @__PURE__ */ g({
81
81
  }
82
82
  });
83
83
  export {
84
- V as _
84
+ P as _
85
85
  };
@@ -28,7 +28,7 @@ declare var __VLS_9: {
28
28
  type __VLS_Slots = {} & {
29
29
  default?: (props: typeof __VLS_9) => any;
30
30
  };
31
- declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
31
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
32
32
  "update:modelValue": (value: any) => any;
33
33
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
34
34
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
@@ -2,5 +2,5 @@ type __VLS_Props = {
2
2
  name: string;
3
3
  value: any;
4
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>;
5
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
6
  export default _default;
@@ -1,7 +1,7 @@
1
1
  type __VLS_PublicProps = {
2
2
  modelValue?: string;
3
3
  };
4
- declare const _default: import("vue").DefineComponent<__VLS_PublicProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
4
+ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
5
  "update:modelValue": (value: string | undefined) => any;
6
6
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
7
7
  "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
@@ -10,7 +10,7 @@ declare var __VLS_1: {
10
10
  type __VLS_Slots = {} & {
11
11
  default?: (props: typeof __VLS_1) => any;
12
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>;
13
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
14
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
15
15
  export default _default;
16
16
  type __VLS_WithSlots<T, S> = T & {
@@ -2,7 +2,7 @@ declare var __VLS_1: {};
2
2
  type __VLS_Slots = {} & {
3
3
  default?: (props: typeof __VLS_1) => any;
4
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>;
5
+ declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
6
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
7
7
  export default _default;
8
8
  type __VLS_WithSlots<T, S> = T & {
@@ -9,7 +9,7 @@ declare var __VLS_1: {};
9
9
  type __VLS_Slots = {} & {
10
10
  default?: (props: typeof __VLS_1) => any;
11
11
  };
12
- declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
13
  "update:modelValue": (value: any) => any;
14
14
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
15
15
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
@@ -10,7 +10,7 @@ declare var __VLS_1: {
10
10
  type __VLS_Slots = {} & {
11
11
  default?: (props: typeof __VLS_1) => any;
12
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>;
13
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
14
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
15
15
  export default _default;
16
16
  type __VLS_WithSlots<T, S> = T & {
@@ -24,7 +24,7 @@ declare var __VLS_1: {
24
24
  type __VLS_Slots = {} & {
25
25
  default?: (props: typeof __VLS_1) => any;
26
26
  };
27
- declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
27
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
28
28
  "update:modelValue": (value: any) => any;
29
29
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
30
30
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
@@ -10,7 +10,7 @@ declare var __VLS_1: {
10
10
  type __VLS_Slots = {} & {
11
11
  default?: (props: typeof __VLS_1) => any;
12
12
  };
13
- declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
14
  select: (value: any) => any;
15
15
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
16
16
  onSelect?: ((value: any) => any) | undefined;
@@ -2,7 +2,7 @@ declare var __VLS_1: {};
2
2
  type __VLS_Slots = {} & {
3
3
  default?: (props: typeof __VLS_1) => any;
4
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>;
5
+ declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
6
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
7
7
  export default _default;
8
8
  type __VLS_WithSlots<T, S> = T & {
@@ -23,7 +23,7 @@ declare var __VLS_1: {
23
23
  type __VLS_Slots = {} & {
24
24
  default?: (props: typeof __VLS_1) => any;
25
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<{}>, {
26
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
27
27
  role: "dialog" | "listbox" | "menu" | "tree" | "grid";
28
28
  direction: "up" | "down" | "left" | "right";
29
29
  align: "top" | "bottom" | "left" | "right" | "center" | "stretch";
@@ -2,7 +2,7 @@ declare var __VLS_1: {};
2
2
  type __VLS_Slots = {} & {
3
3
  default?: (props: typeof __VLS_1) => any;
4
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>;
5
+ declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
6
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
7
7
  export default _default;
8
8
  type __VLS_WithSlots<T, S> = T & {
@@ -7,7 +7,7 @@ declare var __VLS_1: {};
7
7
  type __VLS_Slots = {} & {
8
8
  default?: (props: typeof __VLS_1) => any;
9
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>;
10
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
11
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
12
12
  export default _default;
13
13
  type __VLS_WithSlots<T, S> = T & {
@@ -5,7 +5,7 @@ declare var __VLS_1: {};
5
5
  type __VLS_Slots = {} & {
6
6
  default?: (props: typeof __VLS_1) => any;
7
7
  };
8
- declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
9
  "update:modelValue": (value: string | number | undefined) => any;
10
10
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
11
11
  "onUpdate:modelValue"?: ((value: string | number | undefined) => any) | undefined;
@@ -5,7 +5,7 @@ declare var __VLS_1: {};
5
5
  type __VLS_Slots = {} & {
6
6
  default?: (props: typeof __VLS_1) => any;
7
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<{}>, {
8
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, 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
11
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
@@ -5,7 +5,7 @@ declare var __VLS_1: {};
5
5
  type __VLS_Slots = {} & {
6
6
  default?: (props: typeof __VLS_1) => any;
7
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>;
8
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
9
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
10
10
  export default _default;
11
11
  type __VLS_WithSlots<T, S> = T & {
@@ -22,7 +22,7 @@ type __VLS_Slots = {} & {
22
22
  } & {
23
23
  content?: (props: typeof __VLS_8) => any;
24
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<{}>, {
25
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
26
26
  direction: "up" | "down" | "left" | "right";
27
27
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
28
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-composable-ui",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -37,6 +37,7 @@
37
37
  "vue": "^3.5.12"
38
38
  },
39
39
  "devDependencies": {
40
+ "@release-it/conventional-changelog": "^10.0.1",
40
41
  "@types/node": "^24.1.0",
41
42
  "@vitejs/plugin-vue": "^6.0.1",
42
43
  "glob": "^11.0.2",
@@ -1,42 +0,0 @@
1
- import { defineComponent as f, useId as p, useTemplateRef as b, inject as v, createElementBlock as _, openBlock as x, unref as e, renderSlot as E } from "vue";
2
- import { useListOption as k } from "./composable-ui17.js";
3
- import { injectCombobox as C } from "./composable-ui24.js";
4
- const j = ["id", "data-active", "aria-selected", "aria-disabled"], A = /* @__PURE__ */ f({
5
- __name: "comboboxOption",
6
- props: {
7
- id: {},
8
- value: {},
9
- disabled: { type: Boolean }
10
- },
11
- setup(c) {
12
- const t = c, r = t.id ?? p(), i = b("itemEl"), { isSelected: s, isActive: n, activate: d, select: m } = k(
13
- i,
14
- t.value,
15
- t.disabled
16
- ), o = v(C);
17
- if (!o)
18
- throw new Error("Combobox injectable context is not provided");
19
- function u() {
20
- m(), o.isMultiselectable.value ? o.focus() : o.close({ focus: !0 });
21
- }
22
- return (a, l) => (x(), _("div", {
23
- ref_key: "itemEl",
24
- ref: i,
25
- id: e(r),
26
- onClick: u,
27
- onMouseenter: l[0] || (l[0] = (B) => e(d)({ focus: !1 })),
28
- "data-active": e(n),
29
- "aria-selected": e(s),
30
- "aria-disabled": a.disabled || void 0,
31
- role: "option"
32
- }, [
33
- E(a.$slots, "default", {
34
- isSelected: e(s),
35
- isActive: e(n)
36
- })
37
- ], 40, j));
38
- }
39
- });
40
- export {
41
- A as _
42
- };
@@ -1,63 +0,0 @@
1
- import { defineComponent as w, useId as y, useTemplateRef as S, inject as h, computed as j, createElementBlock as A, openBlock as B, unref as t, renderSlot as I } from "vue";
2
- import { useListOption as _ } from "./composable-ui17.js";
3
- import { injectMenu as $ } from "./composable-ui24.js";
4
- const x = ["id", "data-active", "role", "aria-checked", "aria-disabled"], L = /* @__PURE__ */ w({
5
- __name: "menuItem",
6
- props: {
7
- id: {},
8
- value: {},
9
- disabled: { type: Boolean }
10
- },
11
- emits: ["select"],
12
- setup(d, { emit: r }) {
13
- const e = d, u = r, m = e.id ?? y(), l = S("itemEl"), { isSelected: s, isActive: c, select: v, activate: f, deactivate: p } = _(
14
- l,
15
- e.value,
16
- e.disabled
17
- ), i = h($);
18
- if (!i)
19
- throw new Error("Menu injectable context is not provided");
20
- const b = j(() => e.value !== void 0 ? i.isMultiselectable.value ? "menuitemcheckbox" : "menuitemradio" : "menuitem");
21
- function a() {
22
- v(), u("select", e.value);
23
- }
24
- function k() {
25
- a(), (e.value === void 0 || !i?.isMultiselectable.value) && i.close();
26
- }
27
- function E(o) {
28
- switch (o.code) {
29
- case "Space":
30
- a(), e.value === void 0 && i.close();
31
- break;
32
- case "Enter":
33
- a(), i.close();
34
- break;
35
- default:
36
- return;
37
- }
38
- o.preventDefault();
39
- }
40
- return (o, n) => (B(), A("div", {
41
- ref_key: "itemEl",
42
- ref: l,
43
- id: t(m),
44
- onClick: k,
45
- onKeydown: E,
46
- onMouseenter: n[0] || (n[0] = (M) => t(f)({ focus: !1 })),
47
- onMouseleave: n[1] || (n[1] = (M) => t(p)()),
48
- "data-active": t(c),
49
- role: b.value,
50
- "aria-checked": o.value !== void 0 ? t(s) : void 0,
51
- "aria-disabled": o.disabled || void 0,
52
- tabindex: "-1"
53
- }, [
54
- I(o.$slots, "default", {
55
- isSelected: t(s),
56
- isActive: t(c)
57
- })
58
- ], 40, x));
59
- }
60
- });
61
- export {
62
- L as _
63
- };