bitboss-ui 2.1.131 → 2.1.133

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 (198) hide show
  1. package/dist/ai/BbDropdown.md +66 -13
  2. package/dist/ai/BbDropdownButton.md +29 -13
  3. package/dist/ai/BbTable.md +25 -11
  4. package/dist/components/BbDropdown/types.d.ts +14 -2
  5. package/dist/components/BbDropdownButton/types.d.ts +2 -2
  6. package/dist/components/BbTable/types.d.ts +6 -4
  7. package/dist/index.css +1 -1
  8. package/dist/index109.js +9 -9
  9. package/dist/index110.js +18 -18
  10. package/dist/index118.js +1 -1
  11. package/dist/index124.js +3 -3
  12. package/dist/index126.js +183 -180
  13. package/dist/index134.js +1 -1
  14. package/dist/index136.js +4 -4
  15. package/dist/index138.js +1 -1
  16. package/dist/index14.js +1 -1
  17. package/dist/index142.js +2 -2
  18. package/dist/index146.js +1 -1
  19. package/dist/index150.js +1 -1
  20. package/dist/index151.js +2 -2
  21. package/dist/index16.js +3 -3
  22. package/dist/index18.js +3 -3
  23. package/dist/index20.js +9 -9
  24. package/dist/index22.js +14 -14
  25. package/dist/index224.js +2 -2
  26. package/dist/index226.js +2 -2
  27. package/dist/index227.js +86 -5
  28. package/dist/index229.js +30 -4
  29. package/dist/index230.js +17 -13
  30. package/dist/index231.js +49 -371
  31. package/dist/index232.js +20 -0
  32. package/dist/index233.js +3 -160
  33. package/dist/index234.js +14 -0
  34. package/dist/index235.js +18 -25
  35. package/dist/index236.js +8 -2
  36. package/dist/index237.js +5 -2
  37. package/dist/index238.js +8 -2
  38. package/dist/index239.js +2 -7
  39. package/dist/index24.js +10 -10
  40. package/dist/index240.js +2 -2
  41. package/dist/index241.js +3 -7
  42. package/dist/index242.js +4 -3
  43. package/dist/index243.js +187 -33
  44. package/dist/index244.js +3 -5
  45. package/dist/index245.js +13 -5
  46. package/dist/index246.js +34 -5
  47. package/dist/index247.js +2 -5
  48. package/dist/index248.js +10 -5
  49. package/dist/index249.js +3 -5
  50. package/dist/index250.js +4 -3
  51. package/dist/index251.js +4 -8
  52. package/dist/index252.js +20 -3
  53. package/dist/index253.js +5 -18
  54. package/dist/index254.js +5 -12
  55. package/dist/index255.js +5 -51
  56. package/dist/index256.js +5 -18
  57. package/dist/index257.js +2 -12
  58. package/dist/index258.js +6 -17
  59. package/dist/index259.js +268 -30
  60. package/dist/index26.js +3 -3
  61. package/dist/index260.js +52 -18
  62. package/dist/index261.js +52 -4
  63. package/dist/index262.js +26 -100
  64. package/dist/{index297.js → index263.js} +1 -1
  65. package/dist/index264.js +5 -100
  66. package/dist/index265.js +7 -0
  67. package/dist/index266.js +5 -107
  68. package/dist/index267.js +3 -13
  69. package/dist/index268.js +160 -11
  70. package/dist/index270.js +3 -3
  71. package/dist/index271.js +7 -3
  72. package/dist/index272.js +2 -86
  73. package/dist/index273.js +4 -0
  74. package/dist/index274.js +6 -8
  75. package/dist/index275.js +7 -23
  76. package/dist/index276.js +25 -23
  77. package/dist/index277.js +9 -13
  78. package/dist/index278.js +3 -7
  79. package/dist/index279.js +13 -9
  80. package/dist/index28.js +1 -1
  81. package/dist/index280.js +13 -5
  82. package/dist/index281.js +373 -2
  83. package/dist/index283.js +23 -3
  84. package/dist/index284.js +67 -33
  85. package/dist/index285.js +7 -26
  86. package/dist/index286.js +46 -0
  87. package/dist/index287.js +52 -8
  88. package/dist/index288.js +10 -43
  89. package/dist/index289.js +16 -51
  90. package/dist/index290.js +12 -2
  91. package/dist/index291.js +33 -5
  92. package/dist/index292.js +107 -6
  93. package/dist/index293.js +5 -267
  94. package/dist/index294.js +100 -46
  95. package/dist/index296.js +96 -28
  96. package/dist/index298.js +5 -3
  97. package/dist/index299.js +8 -20
  98. package/dist/index30.js +3 -3
  99. package/dist/index300.js +23 -67
  100. package/dist/index301.js +8 -6
  101. package/dist/index302.js +6 -4
  102. package/dist/index303.js +15 -19
  103. package/dist/index304.js +28 -6
  104. package/dist/index306.js +20 -3
  105. package/dist/index307.js +3 -7
  106. package/dist/index308.js +17 -3
  107. package/dist/index309.js +28 -5
  108. package/dist/index310.js +7 -2
  109. package/dist/index311.js +4 -0
  110. package/dist/index312.js +3 -6
  111. package/dist/index313.js +5 -3
  112. package/dist/index316.js +12 -121
  113. package/dist/index317.js +2 -2
  114. package/dist/index318.js +11 -10
  115. package/dist/index32.js +2 -2
  116. package/dist/index320.js +23 -12
  117. package/dist/index322.js +2 -16
  118. package/dist/index323.js +2 -2
  119. package/dist/index324.js +2 -19
  120. package/dist/index325.js +2 -2
  121. package/dist/index326.js +2 -3
  122. package/dist/index327.js +125 -3
  123. package/dist/index328.js +2 -17
  124. package/dist/index329.js +14 -27
  125. package/dist/index330.js +2 -3
  126. package/dist/index331.js +19 -3
  127. package/dist/index332.js +2 -2
  128. package/dist/index333.js +3 -4
  129. package/dist/index334.js +4 -4
  130. package/dist/index335.js +2 -27
  131. package/dist/index336.js +3 -2
  132. package/dist/index337.js +4 -2
  133. package/dist/index338.js +6 -2
  134. package/dist/index339.js +3 -2
  135. package/dist/index34.js +8 -8
  136. package/dist/index340.js +3 -2
  137. package/dist/index341.js +1 -1
  138. package/dist/index343.js +6 -718
  139. package/dist/index344.js +716 -363
  140. package/dist/index345.js +366 -57
  141. package/dist/index346.js +56 -66
  142. package/dist/index347.js +3 -67
  143. package/dist/index348.js +5 -228
  144. package/dist/index349.js +6 -5
  145. package/dist/index351.js +2 -2
  146. package/dist/index352.js +3 -3
  147. package/dist/index353.js +6 -92
  148. package/dist/index354.js +17 -198
  149. package/dist/index355.js +9 -259
  150. package/dist/index356.js +14 -6
  151. package/dist/index357.js +91 -17
  152. package/dist/index358.js +227 -8
  153. package/dist/index359.js +66 -14
  154. package/dist/index36.js +4 -4
  155. package/dist/index360.js +67 -5
  156. package/dist/index361.js +22 -7
  157. package/dist/index363.js +133 -21
  158. package/dist/index364.js +202 -0
  159. package/dist/index365.js +259 -2
  160. package/dist/index366.js +1 -1
  161. package/dist/index367.js +2 -482
  162. package/dist/index368.js +468 -114
  163. package/dist/index369.js +127 -46
  164. package/dist/index370.js +44 -67
  165. package/dist/index371.js +66 -516
  166. package/dist/index372.js +515 -45
  167. package/dist/index373.js +52 -0
  168. package/dist/index38.js +21 -21
  169. package/dist/index40.js +7 -7
  170. package/dist/index42.js +2 -2
  171. package/dist/index44.js +8 -8
  172. package/dist/index46.js +6 -6
  173. package/dist/index50.js +2 -2
  174. package/dist/index54.js +1 -1
  175. package/dist/index56.js +1 -1
  176. package/dist/index58.js +2 -2
  177. package/dist/index60.js +2 -2
  178. package/dist/index62.js +5 -5
  179. package/dist/index68.js +1 -1
  180. package/dist/index74.js +4 -4
  181. package/dist/index82.js +194 -179
  182. package/dist/index84.js +49 -47
  183. package/dist/index86.js +2 -2
  184. package/dist/index88.js +3 -3
  185. package/dist/index90.js +1 -1
  186. package/dist/index93.js +3 -3
  187. package/dist/index95.js +2 -2
  188. package/dist/index97.js +5 -5
  189. package/dist/index99.js +1 -1
  190. package/dist/utilities/functions/normalizeItemGroups.d.ts +13 -0
  191. package/package.json +2 -2
  192. package/dist/index228.js +0 -10
  193. package/dist/index269.js +0 -12
  194. package/dist/index282.js +0 -190
  195. package/dist/index295.js +0 -54
  196. package/dist/index305.js +0 -18
  197. package/dist/index342.js +0 -4
  198. package/dist/index362.js +0 -136
package/dist/index82.js CHANGED
@@ -1,19 +1,24 @@
1
- import { defineComponent as fe, ref as D, computed as p, useTemplateRef as ve, watch as $, onBeforeUnmount as be, createElementBlock as M, openBlock as E, Fragment as B, renderSlot as v, createCommentVNode as V, createVNode as x, normalizeProps as ye, mergeProps as q, withCtx as J, createElementVNode as Q, normalizeStyle as we, unref as ge, renderList as he, createBlock as Z, toDisplayString as Ee } from "vue";
2
- import { findRightIndex as R } from "./index274.js";
3
- import { useId as Le } from "./index8.js";
4
- import { useUntil as ke } from "./index267.js";
5
- import { wait as Ae } from "./index147.js";
6
- import De from "./index14.js";
1
+ import { defineComponent as ye, ref as S, computed as c, useTemplateRef as we, watch as I, onBeforeUnmount as ge, createElementBlock as _, openBlock as y, Fragment as q, renderSlot as w, createCommentVNode as P, createVNode as Q, normalizeProps as he, mergeProps as R, withCtx as Z, createElementVNode as ee, normalizeStyle as Ee, unref as ke, renderList as Le, createBlock as te, toDisplayString as Ae } from "vue";
2
+ import { findRightIndex as H } from "./index299.js";
3
+ import { useId as De } from "./index8.js";
4
+ import { useUntil as $e } from "./index280.js";
5
+ import { wait as Se } from "./index147.js";
6
+ import Ie from "./index14.js";
7
7
  /* empty css */
8
- import ee from "./index88.js";
8
+ import oe from "./index88.js";
9
9
  /* empty css */
10
- import $e from "./index233.js";
10
+ import _e from "./index268.js";
11
11
  /* empty css */
12
- import te from "./index275.js";
13
- import { extractDomContainer as H } from "./index229.js";
14
- import { useIntersectionObserver as Se, useElementSize as Pe } from "./index148.js";
15
- import { parseWidthString as Ie } from "./index276.js";
16
- const Te = ["id", "aria-labelledby", "inert"], Oe = { class: "item__content" }, _e = 500, Ce = 10, Ge = /* @__PURE__ */ fe({
12
+ import ne from "./index300.js";
13
+ import { extractDomContainer as F } from "./index250.js";
14
+ import { useIntersectionObserver as Pe, useElementSize as Te } from "./index148.js";
15
+ import { parseWidthString as Oe } from "./index283.js";
16
+ import { normalizeItemGroups as Ce } from "./index301.js";
17
+ const Me = ["id", "aria-labelledby", "inert"], Be = {
18
+ key: 0,
19
+ "aria-hidden": "true",
20
+ class: "bb-dropdown__divider"
21
+ }, Ve = { class: "item__content" }, qe = 500, Re = 10, tt = /* @__PURE__ */ ye({
17
22
  inheritAttrs: !1,
18
23
  __name: "BbDropdown",
19
24
  props: {
@@ -32,11 +37,11 @@ const Te = ["id", "aria-labelledby", "inert"], Oe = { class: "item__content" },
32
37
  trigger: { default: "click" },
33
38
  width: { default: "auto" }
34
39
  },
35
- setup(oe) {
36
- const r = oe, d = r.id ?? `bb_${Le().id.value}`, F = D(d), b = D(), S = p(() => H(b.value)), ne = p(() => r.activator != null), re = ve("popover"), m = p(() => H(re.value)), a = D(!1), ae = ke(a, { initialValue: r.eager }), ie = p(() => {
37
- const e = r.trigger;
40
+ setup(re) {
41
+ const a = re, d = a.id ?? `bb_${De().id.value}`, K = S(d), g = S(), T = c(() => F(g.value)), ae = c(() => a.activator != null), ie = we("popover"), v = c(() => F(ie.value)), r = S(!1), se = $e(r, { initialValue: a.eager }), le = c(() => {
42
+ const e = a.trigger;
38
43
  return new Set(Array.isArray(e) ? e : [e]);
39
- }), P = (e, t) => ({
44
+ }), O = (e, t) => ({
40
45
  getBoundingClientRect: () => ({
41
46
  x: e,
42
47
  y: t,
@@ -50,55 +55,63 @@ const Te = ["id", "aria-labelledby", "inert"], Oe = { class: "item__content" },
50
55
  return this;
51
56
  }
52
57
  })
53
- }), y = D(null), se = p(
54
- () => r.placement === "cursor" && y.value ? y.value : b.value
55
- ), K = (e) => {
56
- const t = H(e);
57
- t && (b.value = t);
58
- }, { resume: le, pause: de } = Se(
59
- S,
58
+ }), h = S(null), ue = c(
59
+ () => a.placement === "cursor" && h.value ? h.value : g.value
60
+ ), N = (e) => {
61
+ const t = F(e);
62
+ t && (g.value = t);
63
+ }, { resume: de, pause: ce } = Pe(
64
+ T,
60
65
  async ([{ intersectionRatio: e }]) => {
61
- e !== 1 && a.value && await c();
66
+ e !== 1 && r.value && await f();
62
67
  },
63
68
  { threshold: [0, 1], immediate: !1 }
64
- ), I = p(() => {
65
- let e = r.items.findIndex((n) => !n.disabled), t = R(
66
- r.items,
67
- (n) => !n.disabled
69
+ ), U = c(() => Ce(a.items)), p = c(() => U.value.flat()), pe = c(() => {
70
+ const e = /* @__PURE__ */ new Set();
71
+ let t = 0;
72
+ for (const o of U.value)
73
+ e.add(t), t += o.length;
74
+ return e;
75
+ }), C = c(() => {
76
+ let e = p.value.findIndex(
77
+ (o) => !o.disabled
78
+ ), t = H(
79
+ p.value,
80
+ (o) => !o.disabled
68
81
  );
69
- return r.items.map((n, o) => {
70
- const i = `${d}-item-${n.key}`, { onClick: O, ..._ } = n, ce = async (s) => {
71
- s.stopPropagation(), await c();
82
+ return p.value.map((o, i) => {
83
+ const n = `${d}-item-${o.key}`, { onClick: u, ...B } = o, fe = async (s) => {
84
+ s.stopPropagation(), await f();
72
85
  const l = document.querySelector(`#${d}`);
73
- l && l.focus(), O?.(s);
74
- }, pe = (s) => {
75
- if (!(!(s.target instanceof HTMLElement) || !s.target.dataset.dropdownItem || !m.value)) {
86
+ l && l.focus(), u?.(s);
87
+ }, ve = (s) => {
88
+ if (!(!(s.target instanceof HTMLElement) || !s.target.dataset.dropdownItem || !v.value)) {
76
89
  if (s.key === "ArrowDown") {
77
- if (s.preventDefault(), o !== t) {
78
- const l = m.value.querySelector(
79
- te.map((A) => `#${i} ~ ${A}`).join(",")
90
+ if (s.preventDefault(), i !== t) {
91
+ const l = v.value.querySelector(
92
+ ne.map(($) => `#${n} ~ ${$}`).join(",")
80
93
  );
81
94
  l instanceof HTMLElement && l.focus();
82
95
  }
83
96
  } else if (s.key === "ArrowUp") {
84
- if (s.preventDefault(), o !== e) {
85
- const l = R(
86
- r.items,
87
- (C, me) => me < o && !C.disabled
88
- ), h = Array.from(
89
- m.value.querySelectorAll(".bb-dropdown__item")
97
+ if (s.preventDefault(), i !== e) {
98
+ const l = H(
99
+ p.value,
100
+ (V, be) => be < i && !V.disabled
101
+ ), L = Array.from(
102
+ v.value.querySelectorAll(".bb-dropdown__item")
90
103
  )[l];
91
- h instanceof HTMLElement && h.focus();
104
+ L instanceof HTMLElement && L.focus();
92
105
  }
93
106
  } else if (s.key === "Tab") {
94
- if (o === t && !s.shiftKey) {
107
+ if (i === t && !s.shiftKey) {
95
108
  const l = Array.from(
96
- document.querySelectorAll(te.join(","))
97
- ), A = l.findIndex(
98
- (C) => C.id === d
99
- ), h = l[A + 1];
100
- h instanceof HTMLElement && (s.preventDefault(), c(), h.focus());
101
- } else if (o === e && s.shiftKey) {
109
+ document.querySelectorAll(ne.join(","))
110
+ ), $ = l.findIndex(
111
+ (V) => V.id === d
112
+ ), L = l[$ + 1];
113
+ L instanceof HTMLElement && (s.preventDefault(), f(), L.focus());
114
+ } else if (i === e && s.shiftKey) {
102
115
  const l = document.querySelector(`#${d}`);
103
116
  l && (s.preventDefault(), l.focus());
104
117
  }
@@ -106,128 +119,129 @@ const Te = ["id", "aria-labelledby", "inert"], Oe = { class: "item__content" },
106
119
  }
107
120
  };
108
121
  return {
109
- ..._,
110
- original: n,
111
- key: n.key.split(/\W+/g).join("_").toLowerCase(),
112
- disabled: _.disabled || r.disabled,
113
- id: i,
114
- onClick: ce,
115
- onKeydown: pe
122
+ ...B,
123
+ original: o,
124
+ key: o.key.split(/\W+/g).join("_").toLowerCase(),
125
+ disabled: B.disabled || a.disabled,
126
+ id: n,
127
+ isGroupStart: pe.value.has(i),
128
+ onClick: fe,
129
+ onKeydown: ve
116
130
  };
117
131
  });
118
- }), N = (e) => {
119
- if (!r.disabled) {
120
- if (L) {
121
- L = !1, e.preventDefault(), e.stopPropagation();
132
+ }), G = (e) => {
133
+ if (!a.disabled) {
134
+ if (A) {
135
+ A = !1, e.preventDefault(), e.stopPropagation();
122
136
  return;
123
137
  }
124
- e.stopPropagation(), r.placement === "cursor" && (y.value = P(e.clientX, e.clientY)), a.value ? c() : w();
138
+ e.stopPropagation(), a.placement === "cursor" && (h.value = O(e.clientX, e.clientY)), r.value ? f() : E();
125
139
  }
126
- }, U = (e) => {
127
- r.disabled || (e.preventDefault(), e.stopPropagation(), !(r.placement === "cursor" && (y.value = P(e.clientX, e.clientY), a.value)) && (a.value ? c() : w()));
140
+ }, Y = (e) => {
141
+ a.disabled || (e.preventDefault(), e.stopPropagation(), !(a.placement === "cursor" && (h.value = O(e.clientX, e.clientY), r.value)) && (r.value ? f() : E()));
128
142
  };
129
- let Y, u = null, L = !1;
130
- const T = () => {
131
- clearTimeout(Y), u = null;
143
+ let z, m = null, A = !1;
144
+ const M = () => {
145
+ clearTimeout(z), m = null;
132
146
  }, W = (e) => {
133
- r.disabled || e.pointerType === "mouse" || (L = !1, u = { x: e.clientX, y: e.clientY }, Y = setTimeout(() => {
134
- L = !0, r.placement === "cursor" && u && (y.value = P(
135
- u.x,
136
- u.y
137
- )), u = null, w();
138
- }, _e));
147
+ a.disabled || e.pointerType === "mouse" || (A = !1, m = { x: e.clientX, y: e.clientY }, z = setTimeout(() => {
148
+ A = !0, a.placement === "cursor" && m && (h.value = O(
149
+ m.x,
150
+ m.y
151
+ )), m = null, E();
152
+ }, qe));
139
153
  }, X = (e) => {
140
- if (!u) return;
141
- const t = e.clientX - u.x, n = e.clientY - u.y;
142
- Math.sqrt(t * t + n * n) > Ce && T();
143
- }, k = () => {
144
- T();
154
+ if (!m) return;
155
+ const t = e.clientX - m.x, o = e.clientY - m.y;
156
+ Math.sqrt(t * t + o * o) > Re && M();
157
+ }, D = () => {
158
+ M();
145
159
  }, j = async (e) => {
146
- if (r.disabled) return;
147
- const t = r.items.findIndex((i) => !i.disabled), n = R(
148
- r.items,
149
- (i) => !i.disabled
150
- ), o = (i) => {
151
- if (!m.value || !I.value.length || i === -1) return;
152
- const O = I.value[i].id;
153
- m.value.querySelector(`#${O}`)?.focus();
160
+ if (a.disabled) return;
161
+ const t = p.value.findIndex((n) => !n.disabled), o = H(
162
+ p.value,
163
+ (n) => !n.disabled
164
+ ), i = (n) => {
165
+ if (!v.value || !C.value.length || n === -1) return;
166
+ const u = C.value[n].id;
167
+ v.value.querySelector(`#${u}`)?.focus();
154
168
  };
155
- e.key === "ArrowDown" ? (e.preventDefault(), a.value || await w(), o(t)) : e.key === "ArrowUp" ? (e.preventDefault(), a.value || await w(), o(n)) : e.key === "Tab" && a.value && !e.shiftKey && (e.preventDefault(), o(t));
156
- }, f = (e) => {
169
+ e.key === "ArrowDown" ? (e.preventDefault(), r.value || await E(), i(t)) : e.key === "ArrowUp" ? (e.preventDefault(), r.value || await E(), i(o)) : e.key === "Tab" && r.value && !e.shiftKey && (e.preventDefault(), i(t));
170
+ }, b = (e) => {
157
171
  const t = e.target;
158
172
  if (!(t instanceof HTMLElement)) return;
159
- !m.value?.contains(t) && c();
160
- }, z = (e) => {
161
- !a.value || e.key !== "Escape" || (e.stopImmediatePropagation(), e.preventDefault(), document.activeElement?.id !== d && document.querySelector(`#${d}`)?.focus(), c());
162
- }, w = async () => {
163
- le(), await Ae(50), a.value = !0, document.addEventListener("click", f, { passive: !0 }), document.addEventListener("contextmenu", f, {
173
+ !v.value?.contains(t) && f();
174
+ }, x = (e) => {
175
+ !r.value || e.key !== "Escape" || (e.stopImmediatePropagation(), e.preventDefault(), document.activeElement?.id !== d && document.querySelector(`#${d}`)?.focus(), f());
176
+ }, E = async () => {
177
+ de(), await Se(50), r.value = !0, document.addEventListener("click", b, { passive: !0 }), document.addEventListener("contextmenu", b, {
164
178
  passive: !0
165
- }), document.addEventListener("focusin", f, { passive: !0 }), document.addEventListener("keydown", z, { capture: !0 });
166
- }, c = async () => {
167
- a.value = !1, de();
179
+ }), document.addEventListener("focusin", b, { passive: !0 }), document.addEventListener("keydown", x, { capture: !0 });
180
+ }, f = async () => {
181
+ r.value = !1, ce();
168
182
  };
169
- $(a, (e) => {
170
- e || (document.removeEventListener("click", f), document.removeEventListener("contextmenu", f), document.removeEventListener("focusin", f), document.removeEventListener("keydown", z, { capture: !0 }));
171
- }), $(
172
- () => r.activator,
183
+ I(r, (e) => {
184
+ e || (document.removeEventListener("click", b), document.removeEventListener("contextmenu", b), document.removeEventListener("focusin", b), document.removeEventListener("keydown", x, { capture: !0 }));
185
+ }), I(
186
+ () => a.activator,
173
187
  (e) => {
174
- e && K(e);
188
+ e && N(e);
175
189
  },
176
190
  { immediate: !0 }
177
191
  );
178
- let g = null;
179
- $(
180
- [b, ie],
192
+ let k = null;
193
+ I(
194
+ [g, le],
181
195
  ([e, t]) => {
182
- if (g && (g(), g = null), !e) return;
183
- let n = !1;
184
- e.id || (e.id = d, n = !0), F.value = e.id, e.setAttribute("aria-haspopup", "menu");
185
- const o = [];
186
- t.has("click") && (e.addEventListener("click", N), o.push(() => e.removeEventListener("click", N))), t.has("contextMenu") && (e.addEventListener("contextmenu", U), e.addEventListener("pointerdown", W), e.addEventListener("pointermove", X), e.addEventListener("pointerup", k), e.addEventListener("pointercancel", k), o.push(() => {
187
- e.removeEventListener("contextmenu", U), e.removeEventListener("pointerdown", W), e.removeEventListener("pointermove", X), e.removeEventListener("pointerup", k), e.removeEventListener("pointercancel", k), T();
188
- })), e.addEventListener("keydown", j), o.push(() => e.removeEventListener("keydown", j)), g = () => {
189
- o.forEach((i) => i()), n && e.removeAttribute("id"), e.removeAttribute("aria-haspopup"), e.removeAttribute("aria-expanded"), e.removeAttribute("aria-controls");
196
+ if (k && (k(), k = null), !e) return;
197
+ let o = !1;
198
+ e.id || (e.id = d, o = !0), K.value = e.id, e.setAttribute("aria-haspopup", "menu");
199
+ const i = [];
200
+ t.has("click") && (e.addEventListener("click", G), i.push(() => e.removeEventListener("click", G))), t.has("contextMenu") && (e.addEventListener("contextmenu", Y), e.addEventListener("pointerdown", W), e.addEventListener("pointermove", X), e.addEventListener("pointerup", D), e.addEventListener("pointercancel", D), i.push(() => {
201
+ e.removeEventListener("contextmenu", Y), e.removeEventListener("pointerdown", W), e.removeEventListener("pointermove", X), e.removeEventListener("pointerup", D), e.removeEventListener("pointercancel", D), M();
202
+ })), e.addEventListener("keydown", j), i.push(() => e.removeEventListener("keydown", j)), k = () => {
203
+ i.forEach((n) => n()), o && e.removeAttribute("id"), e.removeAttribute("aria-haspopup"), e.removeAttribute("aria-expanded"), e.removeAttribute("aria-controls");
190
204
  };
191
205
  },
192
206
  { immediate: !0 }
193
- ), $(
194
- [b, a, ae],
195
- ([e, t, n]) => {
196
- e && (e.setAttribute("aria-expanded", n ? String(t) : "false"), n ? e.setAttribute("aria-controls", `menu_${d}`) : e.removeAttribute("aria-controls"));
207
+ ), I(
208
+ [g, r, se],
209
+ ([e, t, o]) => {
210
+ e && (e.setAttribute("aria-expanded", o ? String(t) : "false"), o ? e.setAttribute("aria-controls", `menu_${d}`) : e.removeAttribute("aria-controls"));
197
211
  },
198
212
  { immediate: !0 }
199
- ), be(() => {
200
- g?.();
213
+ ), ge(() => {
214
+ k?.();
201
215
  });
202
- const { width: ue } = Pe(
203
- S,
216
+ const { width: me } = Te(
217
+ T,
204
218
  { width: 0, height: 0 },
205
219
  {
206
220
  box: "border-box"
207
221
  }
208
- ), G = p(() => {
209
- if (r.width !== "auto") {
210
- if (r.width) {
211
- const { value: e, unit: t } = Ie(r.width);
212
- return t === "%" ? S.value ? `${ue.value * (e / 100)}px` : "0px" : `${e}px`;
222
+ ), J = c(() => {
223
+ if (a.width !== "auto") {
224
+ if (a.width) {
225
+ const { value: e, unit: t } = Oe(a.width);
226
+ return t === "%" ? T.value ? `${me.value * (e / 100)}px` : "0px" : `${e}px`;
213
227
  }
214
228
  return "0px";
215
229
  }
216
230
  });
217
- return (e, t) => (E(), M(B, null, [
218
- ne.value ? V("", !0) : v(e.$slots, "activator", ye(q({ key: 0 }, {
231
+ return (e, t) => (y(), _(q, null, [
232
+ ae.value ? P("", !0) : w(e.$slots, "activator", he(R({ key: 0 }, {
219
233
  props: {
220
- ref: K
234
+ ref: N
221
235
  },
222
236
  disabled: e.disabled,
223
- open: a.value,
237
+ open: r.value,
224
238
  placement: e.placement
225
239
  }))),
226
- x($e, q({
240
+ Q(_e, R({
227
241
  ref: "popover",
228
- modelValue: a.value,
229
- "onUpdate:modelValue": t[0] || (t[0] = (n) => a.value = n),
230
- anchor: se.value,
242
+ modelValue: r.value,
243
+ "onUpdate:modelValue": t[0] || (t[0] = (o) => r.value = o),
244
+ anchor: ue.value,
231
245
  "arrow-padding": e.arrowPadding,
232
246
  boundary: e.boundary,
233
247
  class: ["bb-dropdown", {
@@ -240,79 +254,80 @@ const Te = ["id", "aria-labelledby", "inert"], Oe = { class: "item__content" },
240
254
  placement: e.placement === "cursor" ? "bottom-start" : e.placement,
241
255
  "transition-duration": e.transitionDuration
242
256
  }, e.$attrs), {
243
- default: J(() => [
244
- Q("span", {
245
- id: `menu_${ge(d)}`,
246
- "aria-labelledby": F.value,
257
+ default: Z(() => [
258
+ ee("span", {
259
+ id: `menu_${ke(d)}`,
260
+ "aria-labelledby": K.value,
247
261
  role: "menu",
248
262
  class: "bb-dropdown__items-container",
249
- inert: !a.value,
250
- style: we(G.value ? { width: G.value } : void 0)
263
+ inert: !r.value,
264
+ style: Ee(J.value ? { width: J.value } : void 0)
251
265
  }, [
252
- v(e.$slots, "prepend", {
266
+ w(e.$slots, "prepend", {
253
267
  disabled: e.disabled,
254
- open: a.value,
268
+ open: r.value,
255
269
  placement: e.placement
256
270
  }),
257
- (E(!0), M(B, null, he(I.value, ({ original: n, ...o }, i) => (E(), M(B, {
258
- key: o.key
271
+ (y(!0), _(q, null, Le(C.value, ({ original: o, isGroupStart: i, ...n }, u) => (y(), _(q, {
272
+ key: n.key
259
273
  }, [
260
- v(e.$slots, "item:prepend", {
261
- disabled: o.disabled,
262
- index: i,
263
- item: e.items[i],
264
- open: a.value,
274
+ i && u > 0 ? (y(), _("hr", Be)) : P("", !0),
275
+ w(e.$slots, "item:prepend", {
276
+ disabled: n.disabled,
277
+ index: u,
278
+ item: p.value[u],
279
+ open: r.value,
265
280
  placement: e.placement,
266
- text: o.text
281
+ text: n.text
267
282
  }),
268
- x(De, q({
283
+ Q(Ie, R({
269
284
  role: "menuitem",
270
285
  class: ["bb-dropdown__item", {
271
- "bb-dropdown__item--first": i === 0,
272
- "bb-dropdown__item--last": i === e.items.length - 1
286
+ "bb-dropdown__item--first": u === 0,
287
+ "bb-dropdown__item--last": u === p.value.length - 1
273
288
  }],
274
289
  "data-dropdown-item": !0,
275
290
  ref_for: !0
276
- }, o), {
277
- default: J(() => [
278
- v(e.$slots, o.key, {
279
- disabled: o.disabled,
280
- index: i,
281
- item: n,
282
- open: a.value,
291
+ }, n), {
292
+ default: Z(() => [
293
+ w(e.$slots, n.key, {
294
+ disabled: n.disabled,
295
+ index: u,
296
+ item: o,
297
+ open: r.value,
283
298
  placement: e.placement,
284
- text: o.text
299
+ text: n.text
285
300
  }, () => [
286
- o["prepend:icon"] ? (E(), Z(ee, {
301
+ n["prepend:icon"] ? (y(), te(oe, {
287
302
  key: 0,
288
303
  class: "item__prepend-icon",
289
- type: o["prepend:icon"]
290
- }, null, 8, ["type"])) : V("", !0),
291
- Q("span", Oe, Ee(o.text), 1),
292
- o["append:icon"] ? (E(), Z(ee, {
304
+ type: n["prepend:icon"]
305
+ }, null, 8, ["type"])) : P("", !0),
306
+ ee("span", Ve, Ae(n.text), 1),
307
+ n["append:icon"] ? (y(), te(oe, {
293
308
  key: 1,
294
309
  class: "item__append-icon",
295
- type: o["append:icon"]
296
- }, null, 8, ["type"])) : V("", !0)
310
+ type: n["append:icon"]
311
+ }, null, 8, ["type"])) : P("", !0)
297
312
  ])
298
313
  ]),
299
314
  _: 2
300
315
  }, 1040, ["class"]),
301
- v(e.$slots, "item:append", {
302
- disabled: o.disabled,
303
- index: i,
304
- item: e.items[i],
305
- open: a.value,
316
+ w(e.$slots, "item:append", {
317
+ disabled: n.disabled,
318
+ index: u,
319
+ item: p.value[u],
320
+ open: r.value,
306
321
  placement: e.placement,
307
- text: o.text
322
+ text: n.text
308
323
  })
309
324
  ], 64))), 128)),
310
- v(e.$slots, "append", {
325
+ w(e.$slots, "append", {
311
326
  disabled: e.disabled,
312
- open: a.value,
327
+ open: r.value,
313
328
  placement: e.placement
314
329
  })
315
- ], 12, Te)
330
+ ], 12, Me)
316
331
  ]),
317
332
  _: 3
318
333
  }, 16, ["modelValue", "anchor", "arrow-padding", "boundary", "class", "eager", "offset", "hide-arrow", "padding", "placement", "transition-duration"])
@@ -320,5 +335,5 @@ const Te = ["id", "aria-labelledby", "inert"], Oe = { class: "item__content" },
320
335
  }
321
336
  });
322
337
  export {
323
- Ge as default
338
+ tt as default
324
339
  };