bitboss-ui 2.1.123 → 2.1.124

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index232.js CHANGED
@@ -8,14 +8,14 @@ import s from "./index60.js";
8
8
  import c from "./index219.js";
9
9
  import { findRightIndex as l } from "./index229.js";
10
10
  import u from "./index230.js";
11
- import { parseWidthString as ee } from "./index231.js";
12
- import { Fragment as d, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as g, createVNode as _, defineComponent as v, mergeProps as y, normalizeProps as te, normalizeStyle as ne, onBeforeUnmount as re, openBlock as b, ref as x, renderList as S, renderSlot as C, toDisplayString as ie, unref as w, useTemplateRef as ae, watch as T, withCtx as E } from "vue";
11
+ import { parseWidthString as d } from "./index231.js";
12
+ import { Fragment as f, computed as p, createBlock as m, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createVNode as v, defineComponent as y, mergeProps as b, normalizeProps as ee, normalizeStyle as te, onBeforeUnmount as ne, openBlock as x, ref as S, renderList as re, renderSlot as C, toDisplayString as ie, unref as ae, useTemplateRef as oe, watch as w, withCtx as T } from "vue";
13
13
  //#region src/components/BbDropdown/BbDropdown.vue?vue&type=script&setup=true&lang.ts
14
- var oe = [
14
+ var se = [
15
15
  "id",
16
16
  "aria-labelledby",
17
17
  "inert"
18
- ], se = { class: "item__content" }, ce = 500, le = 10, D = /* @__PURE__ */ v({
18
+ ], ce = { class: "item__content" }, le = 500, ue = 10, E = /* @__PURE__ */ y({
19
19
  inheritAttrs: !1,
20
20
  __name: "BbDropdown",
21
21
  props: {
@@ -34,9 +34,9 @@ var oe = [
34
34
  trigger: { default: "click" },
35
35
  width: { default: "auto" }
36
36
  },
37
- setup(v) {
38
- let D = v, O = D.id ?? `bb_${t().id.value}`, k = x(), A = f(() => a(k.value)), ue = f(() => D.activator != null), de = ae("popover"), j = f(() => a(de.value)), M = x(!1), fe = o(M, { initialValue: D.eager }), pe = f(() => {
39
- let e = D.trigger;
37
+ setup(y) {
38
+ let E = y, D = E.id ?? `bb_${t().id.value}`, O = S(D), k = S(), A = p(() => a(k.value)), de = p(() => E.activator != null), fe = oe("popover"), j = p(() => a(fe.value)), M = S(!1), pe = o(M, { initialValue: E.eager }), me = p(() => {
39
+ let e = E.trigger;
40
40
  return new Set(Array.isArray(e) ? e : [e]);
41
41
  }), N = (e, t) => ({ getBoundingClientRect: () => ({
42
42
  x: e,
@@ -50,20 +50,20 @@ var oe = [
50
50
  toJSON() {
51
51
  return this;
52
52
  }
53
- }) }), P = x(null), me = f(() => D.placement === "cursor" && P.value ? P.value : k.value), F = (e) => {
53
+ }) }), P = S(null), he = p(() => E.placement === "cursor" && P.value ? P.value : k.value), F = (e) => {
54
54
  let t = a(e);
55
55
  t && (k.value = t);
56
- }, { resume: he, pause: I } = r(A, async ([{ intersectionRatio: e }]) => {
56
+ }, { resume: I, pause: ge } = r(A, async ([{ intersectionRatio: e }]) => {
57
57
  e !== 1 && M.value && await Z();
58
58
  }, {
59
59
  threshold: [0, 1],
60
60
  immediate: !1
61
- }), L = f(() => {
62
- let e = D.items.findIndex((e) => !e.disabled), t = l(D.items, (e) => !e.disabled);
63
- return D.items.map((n, r) => {
64
- let i = `${O}-item-${n.key}`, { onClick: a, ...o } = n, s = async (e) => {
61
+ }), L = p(() => {
62
+ let e = E.items.findIndex((e) => !e.disabled), t = l(E.items, (e) => !e.disabled);
63
+ return E.items.map((n, r) => {
64
+ let i = `${D}-item-${n.key}`, { onClick: a, ...o } = n, s = async (e) => {
65
65
  e.stopPropagation(), await Z();
66
- let t = document.querySelector(`#${O}`);
66
+ let t = document.querySelector(`#${D}`);
67
67
  t && t.focus(), a?.(e);
68
68
  }, c = (n) => {
69
69
  if (!(!(n.target instanceof HTMLElement) || !n.target.dataset.dropdownItem || !j.value)) {
@@ -74,15 +74,15 @@ var oe = [
74
74
  }
75
75
  } else if (n.key === "ArrowUp") {
76
76
  if (n.preventDefault(), r !== e) {
77
- let e = l(D.items, (e, t) => t < r && !e.disabled), t = Array.from(j.value.querySelectorAll(".bb-dropdown__item"))[e];
77
+ let e = l(E.items, (e, t) => t < r && !e.disabled), t = Array.from(j.value.querySelectorAll(".bb-dropdown__item"))[e];
78
78
  t instanceof HTMLElement && t.focus();
79
79
  }
80
80
  } else if (n.key === "Tab") {
81
81
  if (r === t && !n.shiftKey) {
82
- let e = Array.from(document.querySelectorAll(u.join(","))), t = e[e.findIndex((e) => e.id === O) + 1];
82
+ let e = Array.from(document.querySelectorAll(u.join(","))), t = e[e.findIndex((e) => e.id === D) + 1];
83
83
  t instanceof HTMLElement && (n.preventDefault(), Z(), t.focus());
84
84
  } else if (r === e && n.shiftKey) {
85
- let e = document.querySelector(`#${O}`);
85
+ let e = document.querySelector(`#${D}`);
86
86
  e && (n.preventDefault(), e.focus());
87
87
  }
88
88
  }
@@ -92,40 +92,40 @@ var oe = [
92
92
  ...o,
93
93
  original: n,
94
94
  key: n.key.split(/\W+/g).join("_").toLowerCase(),
95
- disabled: o.disabled || D.disabled,
95
+ disabled: o.disabled || E.disabled,
96
96
  id: i,
97
97
  onClick: s,
98
98
  onKeydown: c
99
99
  };
100
100
  });
101
101
  }), R = (e) => {
102
- if (!D.disabled) {
102
+ if (!E.disabled) {
103
103
  if (H) {
104
104
  H = !1, e.preventDefault(), e.stopPropagation();
105
105
  return;
106
106
  }
107
- e.stopPropagation(), D.placement === "cursor" && (P.value = N(e.clientX, e.clientY)), M.value ? Z() : X();
107
+ e.stopPropagation(), E.placement === "cursor" && (P.value = N(e.clientX, e.clientY)), M.value ? Z() : X();
108
108
  }
109
109
  }, z = (e) => {
110
- D.disabled || (e.preventDefault(), e.stopPropagation(), !(D.placement === "cursor" && (P.value = N(e.clientX, e.clientY), M.value)) && (M.value ? Z() : X()));
110
+ E.disabled || (e.preventDefault(), e.stopPropagation(), !(E.placement === "cursor" && (P.value = N(e.clientX, e.clientY), M.value)) && (M.value ? Z() : X()));
111
111
  }, B, V = null, H = !1, U = () => {
112
112
  clearTimeout(B), V = null;
113
113
  }, W = (e) => {
114
- D.disabled || e.pointerType === "mouse" || (H = !1, V = {
114
+ E.disabled || e.pointerType === "mouse" || (H = !1, V = {
115
115
  x: e.clientX,
116
116
  y: e.clientY
117
117
  }, B = setTimeout(() => {
118
- H = !0, D.placement === "cursor" && V && (P.value = N(V.x, V.y)), V = null, X();
119
- }, ce));
118
+ H = !0, E.placement === "cursor" && V && (P.value = N(V.x, V.y)), V = null, X();
119
+ }, le));
120
120
  }, G = (e) => {
121
121
  if (!V) return;
122
122
  let t = e.clientX - V.x, n = e.clientY - V.y;
123
- Math.sqrt(t * t + n * n) > le && U();
123
+ Math.sqrt(t * t + n * n) > ue && U();
124
124
  }, K = () => {
125
125
  U();
126
126
  }, q = async (e) => {
127
- if (D.disabled) return;
128
- let t = D.items.findIndex((e) => !e.disabled), n = l(D.items, (e) => !e.disabled), r = (e) => {
127
+ if (E.disabled) return;
128
+ let t = E.items.findIndex((e) => !e.disabled), n = l(E.items, (e) => !e.disabled), r = (e) => {
129
129
  if (!j.value || !L.value.length || e === -1) return;
130
130
  let t = L.value[e].id;
131
131
  j.value.querySelector(`#${t}`)?.focus();
@@ -135,58 +135,59 @@ var oe = [
135
135
  let t = e.target;
136
136
  t instanceof HTMLElement && (j.value?.contains(t) || Z());
137
137
  }, Y = (e) => {
138
- !M.value || e.key !== "Escape" || (e.stopImmediatePropagation(), e.preventDefault(), document.activeElement?.id !== O && document.querySelector(`#${O}`)?.focus(), Z());
138
+ !M.value || e.key !== "Escape" || (e.stopImmediatePropagation(), e.preventDefault(), document.activeElement?.id !== D && document.querySelector(`#${D}`)?.focus(), Z());
139
139
  }, X = async () => {
140
- he(), await e(50), M.value = !0, document.addEventListener("click", J, { passive: !0 }), document.addEventListener("contextmenu", J, { passive: !0 }), document.addEventListener("focusin", J, { passive: !0 }), document.addEventListener("keydown", Y, { capture: !0 });
140
+ I(), await e(50), M.value = !0, document.addEventListener("click", J, { passive: !0 }), document.addEventListener("contextmenu", J, { passive: !0 }), document.addEventListener("focusin", J, { passive: !0 }), document.addEventListener("keydown", Y, { capture: !0 });
141
141
  }, Z = async () => {
142
- M.value = !1, I();
142
+ M.value = !1, ge();
143
143
  };
144
- T(M, (e) => {
144
+ w(M, (e) => {
145
145
  e || (document.removeEventListener("click", J), document.removeEventListener("contextmenu", J), document.removeEventListener("focusin", J), document.removeEventListener("keydown", Y, { capture: !0 }));
146
- }), T(() => D.activator, (e) => {
146
+ }), w(() => E.activator, (e) => {
147
147
  e && F(e);
148
148
  }, { immediate: !0 });
149
149
  let Q = null;
150
- T([k, pe], ([e, t]) => {
150
+ w([k, me], ([e, t]) => {
151
151
  if (Q &&= (Q(), null), !e) return;
152
- e.id = O;
153
- let n = [];
154
- t.has("click") && (e.addEventListener("click", R), n.push(() => e.removeEventListener("click", R))), t.has("contextMenu") && (e.addEventListener("contextmenu", z), e.addEventListener("pointerdown", W), e.addEventListener("pointermove", G), e.addEventListener("pointerup", K), e.addEventListener("pointercancel", K), n.push(() => {
152
+ let n = !1;
153
+ e.id || (e.id = D, n = !0), O.value = e.id, e.setAttribute("aria-haspopup", "menu");
154
+ let r = [];
155
+ t.has("click") && (e.addEventListener("click", R), r.push(() => e.removeEventListener("click", R))), t.has("contextMenu") && (e.addEventListener("contextmenu", z), e.addEventListener("pointerdown", W), e.addEventListener("pointermove", G), e.addEventListener("pointerup", K), e.addEventListener("pointercancel", K), r.push(() => {
155
156
  e.removeEventListener("contextmenu", z), e.removeEventListener("pointerdown", W), e.removeEventListener("pointermove", G), e.removeEventListener("pointerup", K), e.removeEventListener("pointercancel", K), U();
156
- })), e.addEventListener("keydown", q), n.push(() => e.removeEventListener("keydown", q)), Q = () => {
157
- n.forEach((e) => e()), e.removeAttribute("id"), e.removeAttribute("aria-expanded"), e.removeAttribute("aria-controls");
157
+ })), e.addEventListener("keydown", q), r.push(() => e.removeEventListener("keydown", q)), Q = () => {
158
+ r.forEach((e) => e()), n && e.removeAttribute("id"), e.removeAttribute("aria-haspopup"), e.removeAttribute("aria-expanded"), e.removeAttribute("aria-controls");
158
159
  };
159
- }, { immediate: !0 }), T([
160
+ }, { immediate: !0 }), w([
160
161
  k,
161
162
  M,
162
- fe
163
+ pe
163
164
  ], ([e, t, n]) => {
164
- e && (e.setAttribute("aria-expanded", n ? String(t) : "false"), n ? e.setAttribute("aria-controls", `menu_${O}`) : e.removeAttribute("aria-controls"));
165
- }, { immediate: !0 }), re(() => {
165
+ e && (e.setAttribute("aria-expanded", n ? String(t) : "false"), n ? e.setAttribute("aria-controls", `menu_${D}`) : e.removeAttribute("aria-controls"));
166
+ }, { immediate: !0 }), ne(() => {
166
167
  Q?.();
167
168
  });
168
- let { width: ge } = n(A, {
169
+ let { width: _e } = n(A, {
169
170
  width: 0,
170
171
  height: 0
171
- }, { box: "border-box" }), $ = f(() => {
172
- if (D.width !== "auto") {
173
- if (D.width) {
174
- let { value: e, unit: t } = ee(D.width);
175
- return t === "%" ? A.value ? `${ge.value * (e / 100)}px` : "0px" : `${e}px`;
172
+ }, { box: "border-box" }), $ = p(() => {
173
+ if (E.width !== "auto") {
174
+ if (E.width) {
175
+ let { value: e, unit: t } = d(E.width);
176
+ return t === "%" ? A.value ? `${_e.value * (e / 100)}px` : "0px" : `${e}px`;
176
177
  }
177
178
  return "0px";
178
179
  }
179
180
  });
180
- return (e, t) => (b(), h(d, null, [ue.value ? m("", !0) : C(e.$slots, "activator", te(y({ key: 0 }, {
181
+ return (e, t) => (x(), g(f, null, [de.value ? h("", !0) : C(e.$slots, "activator", ee(b({ key: 0 }, {
181
182
  props: { ref: F },
182
183
  disabled: e.disabled,
183
184
  open: M.value,
184
185
  placement: e.placement
185
- }))), _(s, y({
186
+ }))), v(s, b({
186
187
  ref: "popover",
187
188
  modelValue: M.value,
188
189
  "onUpdate:modelValue": t[0] ||= (e) => M.value = e,
189
- anchor: me.value,
190
+ anchor: he.value,
190
191
  "arrow-padding": e.arrowPadding,
191
192
  boundary: e.boundary,
192
193
  class: ["bb-dropdown", { [`bb-dropdown--${e.theme}`]: !0 }],
@@ -197,20 +198,20 @@ var oe = [
197
198
  placement: e.placement === "cursor" ? "bottom-start" : e.placement,
198
199
  "transition-duration": e.transitionDuration
199
200
  }, e.$attrs), {
200
- default: E(() => [g("span", {
201
- id: `menu_${w(O)}`,
202
- "aria-labelledby": w(O),
203
- "aria-role": "menu",
201
+ default: T(() => [_("span", {
202
+ id: `menu_${ae(D)}`,
203
+ "aria-labelledby": O.value,
204
+ role: "menu",
204
205
  class: "bb-dropdown__items-container",
205
206
  inert: !M.value,
206
- style: ne($.value ? { width: $.value } : void 0)
207
+ style: te($.value ? { width: $.value } : void 0)
207
208
  }, [
208
209
  C(e.$slots, "prepend", {
209
210
  disabled: e.disabled,
210
211
  open: M.value,
211
212
  placement: e.placement
212
213
  }),
213
- (b(!0), h(d, null, S(L.value, ({ original: t, ...n }, r) => (b(), h(d, { key: n.key }, [
214
+ (x(!0), g(f, null, re(L.value, ({ original: t, ...n }, r) => (x(), g(f, { key: n.key }, [
214
215
  C(e.$slots, "item:prepend", {
215
216
  disabled: n.disabled,
216
217
  index: r,
@@ -219,8 +220,8 @@ var oe = [
219
220
  placement: e.placement,
220
221
  text: n.text
221
222
  }),
222
- _(i, y({
223
- "aria-role": "menuitem",
223
+ v(i, b({
224
+ role: "menuitem",
224
225
  class: ["bb-dropdown__item", {
225
226
  "bb-dropdown__item--first": r === 0,
226
227
  "bb-dropdown__item--last": r === e.items.length - 1
@@ -228,7 +229,7 @@ var oe = [
228
229
  "data-dropdown-item": !0,
229
230
  ref_for: !0
230
231
  }, n), {
231
- default: E(() => [C(e.$slots, n.key, {
232
+ default: T(() => [C(e.$slots, n.key, {
232
233
  disabled: n.disabled,
233
234
  index: r,
234
235
  item: t,
@@ -236,17 +237,17 @@ var oe = [
236
237
  placement: e.placement,
237
238
  text: n.text
238
239
  }, () => [
239
- n["prepend:icon"] ? (b(), p(c, {
240
+ n["prepend:icon"] ? (x(), m(c, {
240
241
  key: 0,
241
242
  class: "item__prepend-icon",
242
243
  type: n["prepend:icon"]
243
- }, null, 8, ["type"])) : m("", !0),
244
- g("span", se, ie(n.text), 1),
245
- n["append:icon"] ? (b(), p(c, {
244
+ }, null, 8, ["type"])) : h("", !0),
245
+ _("span", ce, ie(n.text), 1),
246
+ n["append:icon"] ? (x(), m(c, {
246
247
  key: 1,
247
248
  class: "item__append-icon",
248
249
  type: n["append:icon"]
249
- }, null, 8, ["type"])) : m("", !0)
250
+ }, null, 8, ["type"])) : h("", !0)
250
251
  ])]),
251
252
  _: 2
252
253
  }, 1040, ["class"]),
@@ -264,7 +265,7 @@ var oe = [
264
265
  open: M.value,
265
266
  placement: e.placement
266
267
  })
267
- ], 12, oe)]),
268
+ ], 12, se)]),
268
269
  _: 3
269
270
  }, 16, [
270
271
  "modelValue",
@@ -282,4 +283,4 @@ var oe = [
282
283
  }
283
284
  });
284
285
  //#endregion
285
- export { D as default };
286
+ export { E as default };
package/dist/index270.js CHANGED
@@ -56,7 +56,7 @@ var w = [
56
56
  let n = A.accept[t];
57
57
  if (n.includes("/")) e.push(n);
58
58
  else {
59
- k ||= (await import("./index353.js")).default;
59
+ k ||= (await import("./index356.js")).default;
60
60
  let t = k.getType(n);
61
61
  if (!t) throw Error(`Could not detect the correct mime associated with ${n}`);
62
62
  e.push(t);
package/dist/index343.js CHANGED
@@ -6,12 +6,12 @@ import { extractDomContainer as i } from "./index45.js";
6
6
  import { useUntil as a } from "./index50.js";
7
7
  import o from "./index60.js";
8
8
  import { parseWidthString as s } from "./index231.js";
9
- import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createVNode as m, defineComponent as h, mergeModels as g, mergeProps as _, normalizeProps as v, normalizeStyle as y, onBeforeUnmount as b, openBlock as x, ref as S, renderSlot as C, unref as w, useModel as T, useTemplateRef as E, watch as D, withCtx as O } from "vue";
9
+ import { Comment as c, Fragment as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createTextVNode as ee, createVNode as h, defineComponent as g, mergeModels as _, mergeProps as v, normalizeProps as y, normalizeStyle as te, onBeforeUnmount as ne, onMounted as b, openBlock as x, ref as S, renderSlot as C, toDisplayString as w, unref as re, useModel as ie, useSlots as T, useTemplateRef as E, watch as D, withCtx as O } from "vue";
10
10
  //#region src/components/BbTooltip/BbTooltip.vue?vue&type=script&setup=true&lang.ts
11
- var k = /* @__PURE__ */ h({
11
+ var k = /* @__PURE__ */ g({
12
12
  inheritAttrs: !1,
13
13
  __name: "BbTooltip",
14
- props: /* @__PURE__ */ g({
14
+ props: /* @__PURE__ */ _({
15
15
  arrowPadding: { default: 10 },
16
16
  block: { type: Boolean },
17
17
  disabled: { type: Boolean },
@@ -23,6 +23,7 @@ var k = /* @__PURE__ */ h({
23
23
  type: Boolean,
24
24
  default: !0
25
25
  },
26
+ text: {},
26
27
  theme: { default: "default" },
27
28
  transitionDuration: { default: 250 },
28
29
  activator: {},
@@ -37,104 +38,130 @@ var k = /* @__PURE__ */ h({
37
38
  modelModifiers: {}
38
39
  }),
39
40
  emits: ["update:modelValue"],
40
- setup(h) {
41
- let g = h, { t: k } = r(), A = `bb_${g.id ?? e().id.value}`, j = S(), M = l(() => g.activator != null), N = E("popover"), P = l(() => i(N.value)), F = S(!0), I = T(h, "modelValue"), L = a(I), R = (e) => {
41
+ setup(g) {
42
+ let _ = g, k = T(), { t: A } = r(), j = `bb_${_.id ?? e().id.value}`, M = `${j}_desc`, N = (e) => {
43
+ if (!e) return "";
44
+ let t = "";
45
+ for (let n of e) {
46
+ if (n.type === c) continue;
47
+ let e = n.children;
48
+ typeof e == "string" ? t += e : Array.isArray(e) && (t += N(e));
49
+ }
50
+ return t;
51
+ }, P = S(!1), F = u(() => (_.text ?? (P.value ? N(k.default?.({})) : "")).replace(/\s+/g, " ").trim()), I = S(), L = u(() => _.activator != null), R = E("popover"), z = u(() => i(R.value)), B = S(!0), V = ie(g, "modelValue"), H = a(V), U = (e) => {
42
52
  let t = i(e);
43
- t && (j.value = t);
44
- }, z, B, V = () => {
45
- clearTimeout(B);
46
- }, H = () => {
47
- clearTimeout(z), clearTimeout(B), document.removeEventListener("keydown", G), I.value = !1;
48
- }, U = () => {
49
- clearTimeout(z), clearTimeout(B), B = setTimeout(H, 50);
50
- }, W = () => {
51
- V(), !(I.value || g.disabled || !F.value) && (z = setTimeout(() => {
52
- I.value = !0, document.addEventListener("keydown", G, { passive: !0 });
53
- }, g.timeout));
54
- }, G = (e) => {
55
- e.key === "Escape" && H();
56
- }, K = () => {
57
- F.value = !1, H();
53
+ t && (I.value = t);
54
+ }, W, G, K = () => {
55
+ clearTimeout(G);
56
+ }, q = () => {
57
+ clearTimeout(W), clearTimeout(G), document.removeEventListener("keydown", X), V.value = !1;
58
+ }, J = () => {
59
+ clearTimeout(W), clearTimeout(G), G = setTimeout(q, 50);
60
+ }, Y = () => {
61
+ K(), !(V.value || _.disabled || !B.value) && (W = setTimeout(() => {
62
+ V.value = !0, document.addEventListener("keydown", X, { passive: !0 });
63
+ }, _.timeout));
64
+ }, X = (e) => {
65
+ e.key === "Escape" && q();
66
+ }, ae = () => {
67
+ B.value = !1, q();
58
68
  };
59
- D(() => g.activator, (e) => {
60
- e && R(e);
69
+ D(() => _.activator, (e) => {
70
+ e && U(e);
61
71
  }, { immediate: !0 });
62
- let q = null;
63
- D(j, (e) => {
64
- q &&= (q(), null), e && (e.addEventListener("mouseenter", W, { passive: !0 }), e.addEventListener("mouseleave", U, { passive: !0 }), e.addEventListener("focus", W, { passive: !0 }), e.addEventListener("blur", H, { passive: !0 }), q = () => {
65
- e.removeEventListener("mouseenter", W), e.removeEventListener("mouseleave", U), e.removeEventListener("focus", W), e.removeEventListener("blur", H);
72
+ let Z = null;
73
+ D(I, (e) => {
74
+ Z &&= (Z(), null), e && (e.addEventListener("mouseenter", Y, { passive: !0 }), e.addEventListener("mouseleave", J, { passive: !0 }), e.addEventListener("focus", Y, { passive: !0 }), e.addEventListener("blur", q, { passive: !0 }), Z = () => {
75
+ e.removeEventListener("mouseenter", Y), e.removeEventListener("mouseleave", J), e.removeEventListener("focus", Y), e.removeEventListener("blur", q);
66
76
  });
67
77
  }, { immediate: !0 });
68
- let J = null;
69
- D(P, (e) => {
70
- J &&= (J(), null), e && (e.addEventListener("mouseenter", V, { passive: !0 }), e.addEventListener("mouseleave", U, { passive: !0 }), J = () => {
71
- e.removeEventListener("mouseenter", V), e.removeEventListener("mouseleave", U);
78
+ let Q = null;
79
+ D(z, (e) => {
80
+ Q &&= (Q(), null), e && (e.addEventListener("mouseenter", K, { passive: !0 }), e.addEventListener("mouseleave", J, { passive: !0 }), Q = () => {
81
+ e.removeEventListener("mouseenter", K), e.removeEventListener("mouseleave", J);
72
82
  });
73
- }, { immediate: !0 }), D([j, L], ([e, t]) => {
74
- e && t && e.setAttribute("aria-describedby", A);
75
- }, { immediate: !0 }), b(() => {
76
- q?.(), J?.(), j.value && j.value.removeAttribute("aria-describedby"), H();
83
+ }, { immediate: !0 });
84
+ let $ = () => {
85
+ let e = I.value;
86
+ e && (F.value ? e.setAttribute("aria-describedby", M) : H.value && e.setAttribute("aria-describedby", j));
87
+ };
88
+ b(() => {
89
+ $(), P.value = !0;
90
+ }), D([
91
+ I,
92
+ H,
93
+ F
94
+ ], $, { flush: "post" }), ne(() => {
95
+ Z?.(), Q?.(), I.value && I.value.removeAttribute("aria-describedby"), q();
77
96
  });
78
- let { width: Y } = t(j, {
97
+ let { width: oe } = t(I, {
79
98
  width: 0,
80
99
  height: 0
81
- }, { box: "border-box" }), X = l(() => {
82
- if (g.width) {
83
- let { value: e, unit: t } = s(g.width);
84
- return t === "%" ? j.value ? `${Y.value * (e / 100)}px` : "0px" : `${e}px`;
100
+ }, { box: "border-box" }), se = u(() => {
101
+ if (_.width) {
102
+ let { value: e, unit: t } = s(_.width);
103
+ return t === "%" ? I.value ? `${oe.value * (e / 100)}px` : "0px" : `${e}px`;
85
104
  }
86
105
  });
87
- return (e, t) => (x(), f(c, null, [M.value ? d("", !0) : C(e.$slots, "activator", v(_({ key: 0 }, {
88
- props: { ref: R },
89
- disabled: e.disabled,
90
- open: I.value,
91
- placement: e.placement
92
- }))), m(o, _({
93
- ref: "popover",
94
- modelValue: I.value,
95
- "onUpdate:modelValue": t[0] ||= (e) => I.value = e,
96
- anchor: j.value,
97
- "arrow-padding": e.arrowPadding,
98
- boundary: e.boundary,
99
- class: ["bb-tooltip", { [`bb-tooltip--${e.theme}`]: !0 }],
100
- padding: e.padding,
101
- placement: e.placement,
102
- "transition-duration": e.transitionDuration
103
- }, e.$attrs), {
104
- default: O(() => [p("span", {
105
- id: A,
106
- class: "bb-tooltip__content",
107
- style: y({ width: X.value })
108
- }, [e.showClose ? (x(), u(n, {
106
+ return (e, t) => (x(), p(l, null, [
107
+ F.value ? (x(), p("span", {
109
108
  key: 0,
110
- "aria-label": w(k)("common.closeLabel").value,
111
- class: "bb-tooltip__close",
112
- tabindex: "-1",
113
- onClick: K
114
- }, {
115
- default: O(() => t[1] ||= [p("svg", {
116
- fill: "none",
117
- viewBox: "0 0 24 24",
118
- xmlns: "http://www.w3.org/2000/svg"
119
- }, [p("path", {
120
- d: "M23 23L1 1M23 1L1 23",
121
- stroke: "currentColor",
122
- "stroke-linecap": "round",
123
- "stroke-width": "2"
124
- })], -1)]),
125
- _: 1
126
- }, 8, ["aria-label"])) : d("", !0), C(e.$slots, "default")], 4)]),
127
- _: 3
128
- }, 16, [
129
- "modelValue",
130
- "anchor",
131
- "arrow-padding",
132
- "boundary",
133
- "class",
134
- "padding",
135
- "placement",
136
- "transition-duration"
137
- ])], 64));
109
+ id: M,
110
+ class: "sr-only"
111
+ }, w(F.value), 1)) : f("", !0),
112
+ L.value ? f("", !0) : C(e.$slots, "activator", y(v({ key: 1 }, {
113
+ props: { ref: U },
114
+ disabled: e.disabled,
115
+ open: V.value,
116
+ placement: e.placement
117
+ }))),
118
+ h(o, v({
119
+ ref: "popover",
120
+ modelValue: V.value,
121
+ "onUpdate:modelValue": t[0] ||= (e) => V.value = e,
122
+ anchor: I.value,
123
+ "arrow-padding": e.arrowPadding,
124
+ boundary: e.boundary,
125
+ class: ["bb-tooltip", { [`bb-tooltip--${e.theme}`]: !0 }],
126
+ padding: e.padding,
127
+ placement: e.placement,
128
+ "transition-duration": e.transitionDuration
129
+ }, e.$attrs), {
130
+ default: O(() => [m("span", {
131
+ id: j,
132
+ class: "bb-tooltip__content",
133
+ style: te({ width: se.value })
134
+ }, [e.showClose ? (x(), d(n, {
135
+ key: 0,
136
+ "aria-label": re(A)("common.closeLabel").value,
137
+ class: "bb-tooltip__close",
138
+ tabindex: "-1",
139
+ onClick: ae
140
+ }, {
141
+ default: O(() => t[1] ||= [m("svg", {
142
+ fill: "none",
143
+ viewBox: "0 0 24 24",
144
+ xmlns: "http://www.w3.org/2000/svg"
145
+ }, [m("path", {
146
+ d: "M23 23L1 1M23 1L1 23",
147
+ stroke: "currentColor",
148
+ "stroke-linecap": "round",
149
+ "stroke-width": "2"
150
+ })], -1)]),
151
+ _: 1
152
+ }, 8, ["aria-label"])) : f("", !0), C(e.$slots, "default", {}, () => [ee(w(e.text), 1)])], 4)]),
153
+ _: 3
154
+ }, 16, [
155
+ "modelValue",
156
+ "anchor",
157
+ "arrow-padding",
158
+ "boundary",
159
+ "class",
160
+ "padding",
161
+ "placement",
162
+ "transition-duration"
163
+ ])
164
+ ], 64));
138
165
  }
139
166
  });
140
167
  //#endregion