bitboss-ui 2.1.123 → 2.1.125
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/BbButton.md +20 -11
- 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/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/index232.js +68 -67
- package/dist/index240.js +40 -36
- 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/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
|