bitboss-ui 2.1.122 → 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/ai/BaseSelect.md +26 -4
- package/dist/ai/BbDropdown.md +20 -5
- package/dist/ai/BbSelect.md +8 -2
- package/dist/ai/BbTooltip.md +83 -13
- package/dist/ai/CommonPopover.md +45 -2
- package/dist/components/BaseSelect/types.d.ts +15 -2
- package/dist/components/BbSelect/types.d.ts +2 -0
- package/dist/components/BbTooltip/types.d.ts +1 -1
- package/dist/components/CommonPopover/types.d.ts +11 -0
- package/dist/directives/bbDropdown.d.ts +38 -0
- package/dist/directives/bbTooltip.d.ts +36 -0
- package/dist/directives/createPopoverDirective.d.ts +25 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -1
- package/dist/index186.js +4 -2
- package/dist/index232.js +68 -67
- package/dist/index270.js +1 -1
- package/dist/index343.js +116 -89
- package/dist/index350.js +53 -837
- package/dist/index351.js +23 -473
- package/dist/index352.js +21 -50
- package/dist/index353.js +838 -6
- package/dist/index354.js +474 -0
- package/dist/index355.js +52 -0
- package/dist/index356.js +7 -0
- package/dist/index58.js +54 -43
- package/package.json +2 -2
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
|
|
12
|
-
import { Fragment as
|
|
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
|
|
14
|
+
var se = [
|
|
15
15
|
"id",
|
|
16
16
|
"aria-labelledby",
|
|
17
17
|
"inert"
|
|
18
|
-
],
|
|
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(
|
|
38
|
-
let
|
|
39
|
-
let e =
|
|
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 =
|
|
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:
|
|
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 =
|
|
62
|
-
let e =
|
|
63
|
-
return
|
|
64
|
-
let i = `${
|
|
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(`#${
|
|
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(
|
|
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 ===
|
|
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(`#${
|
|
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 ||
|
|
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 (!
|
|
102
|
+
if (!E.disabled) {
|
|
103
103
|
if (H) {
|
|
104
104
|
H = !1, e.preventDefault(), e.stopPropagation();
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
|
-
e.stopPropagation(),
|
|
107
|
+
e.stopPropagation(), E.placement === "cursor" && (P.value = N(e.clientX, e.clientY)), M.value ? Z() : X();
|
|
108
108
|
}
|
|
109
109
|
}, z = (e) => {
|
|
110
|
-
|
|
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
|
-
|
|
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,
|
|
119
|
-
},
|
|
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) >
|
|
123
|
+
Math.sqrt(t * t + n * n) > ue && U();
|
|
124
124
|
}, K = () => {
|
|
125
125
|
U();
|
|
126
126
|
}, q = async (e) => {
|
|
127
|
-
if (
|
|
128
|
-
let t =
|
|
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 !==
|
|
138
|
+
!M.value || e.key !== "Escape" || (e.stopImmediatePropagation(), e.preventDefault(), document.activeElement?.id !== D && document.querySelector(`#${D}`)?.focus(), Z());
|
|
139
139
|
}, X = async () => {
|
|
140
|
-
|
|
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,
|
|
142
|
+
M.value = !1, ge();
|
|
143
143
|
};
|
|
144
|
-
|
|
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
|
-
}),
|
|
146
|
+
}), w(() => E.activator, (e) => {
|
|
147
147
|
e && F(e);
|
|
148
148
|
}, { immediate: !0 });
|
|
149
149
|
let Q = null;
|
|
150
|
-
|
|
150
|
+
w([k, me], ([e, t]) => {
|
|
151
151
|
if (Q &&= (Q(), null), !e) return;
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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),
|
|
157
|
-
|
|
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 }),
|
|
160
|
+
}, { immediate: !0 }), w([
|
|
160
161
|
k,
|
|
161
162
|
M,
|
|
162
|
-
|
|
163
|
+
pe
|
|
163
164
|
], ([e, t, n]) => {
|
|
164
|
-
e && (e.setAttribute("aria-expanded", n ? String(t) : "false"), n ? e.setAttribute("aria-controls", `menu_${
|
|
165
|
-
}, { immediate: !0 }),
|
|
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:
|
|
169
|
+
let { width: _e } = n(A, {
|
|
169
170
|
width: 0,
|
|
170
171
|
height: 0
|
|
171
|
-
}, { box: "border-box" }), $ =
|
|
172
|
-
if (
|
|
173
|
-
if (
|
|
174
|
-
let { value: e, unit: t } =
|
|
175
|
-
return t === "%" ? A.value ? `${
|
|
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) => (
|
|
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
|
-
}))),
|
|
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:
|
|
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:
|
|
201
|
-
id: `menu_${
|
|
202
|
-
"aria-labelledby":
|
|
203
|
-
|
|
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:
|
|
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
|
-
(
|
|
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
|
-
|
|
223
|
-
|
|
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:
|
|
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"] ? (
|
|
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"])) :
|
|
244
|
-
|
|
245
|
-
n["append:icon"] ? (
|
|
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"])) :
|
|
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,
|
|
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 {
|
|
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("./
|
|
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 {
|
|
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__ */
|
|
11
|
+
var k = /* @__PURE__ */ g({
|
|
12
12
|
inheritAttrs: !1,
|
|
13
13
|
__name: "BbTooltip",
|
|
14
|
-
props: /* @__PURE__ */
|
|
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(
|
|
41
|
-
let g =
|
|
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 && (
|
|
44
|
-
},
|
|
45
|
-
clearTimeout(
|
|
46
|
-
},
|
|
47
|
-
clearTimeout(
|
|
48
|
-
},
|
|
49
|
-
clearTimeout(
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
e.key === "Escape" &&
|
|
56
|
-
},
|
|
57
|
-
|
|
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(() =>
|
|
60
|
-
e &&
|
|
69
|
+
D(() => _.activator, (e) => {
|
|
70
|
+
e && U(e);
|
|
61
71
|
}, { immediate: !0 });
|
|
62
|
-
let
|
|
63
|
-
D(
|
|
64
|
-
|
|
65
|
-
e.removeEventListener("mouseenter",
|
|
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
|
|
69
|
-
D(
|
|
70
|
-
|
|
71
|
-
e.removeEventListener("mouseenter",
|
|
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 })
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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:
|
|
97
|
+
let { width: oe } = t(I, {
|
|
79
98
|
width: 0,
|
|
80
99
|
height: 0
|
|
81
|
-
}, { box: "border-box" }),
|
|
82
|
-
if (
|
|
83
|
-
let { value: e, unit: t } = s(
|
|
84
|
-
return t === "%" ?
|
|
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(),
|
|
88
|
-
|
|
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
|
-
|
|
111
|
-
class: "
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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
|