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.
- package/dist/ai/BbDropdown.md +66 -13
- package/dist/ai/BbDropdownButton.md +29 -13
- package/dist/ai/BbTable.md +25 -11
- package/dist/components/BbDropdown/types.d.ts +14 -2
- package/dist/components/BbDropdownButton/types.d.ts +2 -2
- package/dist/components/BbTable/types.d.ts +6 -4
- package/dist/index.css +1 -1
- package/dist/index109.js +9 -9
- package/dist/index110.js +18 -18
- package/dist/index118.js +1 -1
- package/dist/index124.js +3 -3
- package/dist/index126.js +183 -180
- package/dist/index134.js +1 -1
- package/dist/index136.js +4 -4
- package/dist/index138.js +1 -1
- package/dist/index14.js +1 -1
- package/dist/index142.js +2 -2
- package/dist/index146.js +1 -1
- package/dist/index150.js +1 -1
- package/dist/index151.js +2 -2
- package/dist/index16.js +3 -3
- package/dist/index18.js +3 -3
- package/dist/index20.js +9 -9
- package/dist/index22.js +14 -14
- package/dist/index224.js +2 -2
- package/dist/index226.js +2 -2
- package/dist/index227.js +86 -5
- package/dist/index229.js +30 -4
- package/dist/index230.js +17 -13
- package/dist/index231.js +49 -371
- package/dist/index232.js +20 -0
- package/dist/index233.js +3 -160
- package/dist/index234.js +14 -0
- package/dist/index235.js +18 -25
- package/dist/index236.js +8 -2
- package/dist/index237.js +5 -2
- package/dist/index238.js +8 -2
- package/dist/index239.js +2 -7
- package/dist/index24.js +10 -10
- package/dist/index240.js +2 -2
- package/dist/index241.js +3 -7
- package/dist/index242.js +4 -3
- package/dist/index243.js +187 -33
- package/dist/index244.js +3 -5
- package/dist/index245.js +13 -5
- package/dist/index246.js +34 -5
- package/dist/index247.js +2 -5
- package/dist/index248.js +10 -5
- package/dist/index249.js +3 -5
- package/dist/index250.js +4 -3
- package/dist/index251.js +4 -8
- package/dist/index252.js +20 -3
- package/dist/index253.js +5 -18
- package/dist/index254.js +5 -12
- package/dist/index255.js +5 -51
- package/dist/index256.js +5 -18
- package/dist/index257.js +2 -12
- package/dist/index258.js +6 -17
- package/dist/index259.js +268 -30
- package/dist/index26.js +3 -3
- package/dist/index260.js +52 -18
- package/dist/index261.js +52 -4
- package/dist/index262.js +26 -100
- package/dist/{index297.js → index263.js} +1 -1
- package/dist/index264.js +5 -100
- package/dist/index265.js +7 -0
- package/dist/index266.js +5 -107
- package/dist/index267.js +3 -13
- package/dist/index268.js +160 -11
- package/dist/index270.js +3 -3
- package/dist/index271.js +7 -3
- package/dist/index272.js +2 -86
- package/dist/index273.js +4 -0
- package/dist/index274.js +6 -8
- package/dist/index275.js +7 -23
- package/dist/index276.js +25 -23
- package/dist/index277.js +9 -13
- package/dist/index278.js +3 -7
- package/dist/index279.js +13 -9
- package/dist/index28.js +1 -1
- package/dist/index280.js +13 -5
- package/dist/index281.js +373 -2
- package/dist/index283.js +23 -3
- package/dist/index284.js +67 -33
- package/dist/index285.js +7 -26
- package/dist/index286.js +46 -0
- package/dist/index287.js +52 -8
- package/dist/index288.js +10 -43
- package/dist/index289.js +16 -51
- package/dist/index290.js +12 -2
- package/dist/index291.js +33 -5
- package/dist/index292.js +107 -6
- package/dist/index293.js +5 -267
- package/dist/index294.js +100 -46
- package/dist/index296.js +96 -28
- package/dist/index298.js +5 -3
- package/dist/index299.js +8 -20
- package/dist/index30.js +3 -3
- package/dist/index300.js +23 -67
- package/dist/index301.js +8 -6
- package/dist/index302.js +6 -4
- package/dist/index303.js +15 -19
- package/dist/index304.js +28 -6
- package/dist/index306.js +20 -3
- package/dist/index307.js +3 -7
- package/dist/index308.js +17 -3
- package/dist/index309.js +28 -5
- package/dist/index310.js +7 -2
- package/dist/index311.js +4 -0
- package/dist/index312.js +3 -6
- package/dist/index313.js +5 -3
- package/dist/index316.js +12 -121
- package/dist/index317.js +2 -2
- package/dist/index318.js +11 -10
- package/dist/index32.js +2 -2
- package/dist/index320.js +23 -12
- package/dist/index322.js +2 -16
- package/dist/index323.js +2 -2
- package/dist/index324.js +2 -19
- package/dist/index325.js +2 -2
- package/dist/index326.js +2 -3
- package/dist/index327.js +125 -3
- package/dist/index328.js +2 -17
- package/dist/index329.js +14 -27
- package/dist/index330.js +2 -3
- package/dist/index331.js +19 -3
- package/dist/index332.js +2 -2
- package/dist/index333.js +3 -4
- package/dist/index334.js +4 -4
- package/dist/index335.js +2 -27
- package/dist/index336.js +3 -2
- package/dist/index337.js +4 -2
- package/dist/index338.js +6 -2
- package/dist/index339.js +3 -2
- package/dist/index34.js +8 -8
- package/dist/index340.js +3 -2
- package/dist/index341.js +1 -1
- package/dist/index343.js +6 -718
- package/dist/index344.js +716 -363
- package/dist/index345.js +366 -57
- package/dist/index346.js +56 -66
- package/dist/index347.js +3 -67
- package/dist/index348.js +5 -228
- package/dist/index349.js +6 -5
- package/dist/index351.js +2 -2
- package/dist/index352.js +3 -3
- package/dist/index353.js +6 -92
- package/dist/index354.js +17 -198
- package/dist/index355.js +9 -259
- package/dist/index356.js +14 -6
- package/dist/index357.js +91 -17
- package/dist/index358.js +227 -8
- package/dist/index359.js +66 -14
- package/dist/index36.js +4 -4
- package/dist/index360.js +67 -5
- package/dist/index361.js +22 -7
- package/dist/index363.js +133 -21
- package/dist/index364.js +202 -0
- package/dist/index365.js +259 -2
- package/dist/index366.js +1 -1
- package/dist/index367.js +2 -482
- package/dist/index368.js +468 -114
- package/dist/index369.js +127 -46
- package/dist/index370.js +44 -67
- package/dist/index371.js +66 -516
- package/dist/index372.js +515 -45
- package/dist/index373.js +52 -0
- package/dist/index38.js +21 -21
- package/dist/index40.js +7 -7
- package/dist/index42.js +2 -2
- package/dist/index44.js +8 -8
- package/dist/index46.js +6 -6
- package/dist/index50.js +2 -2
- package/dist/index54.js +1 -1
- package/dist/index56.js +1 -1
- package/dist/index58.js +2 -2
- package/dist/index60.js +2 -2
- package/dist/index62.js +5 -5
- package/dist/index68.js +1 -1
- package/dist/index74.js +4 -4
- package/dist/index82.js +194 -179
- package/dist/index84.js +49 -47
- package/dist/index86.js +2 -2
- package/dist/index88.js +3 -3
- package/dist/index90.js +1 -1
- package/dist/index93.js +3 -3
- package/dist/index95.js +2 -2
- package/dist/index97.js +5 -5
- package/dist/index99.js +1 -1
- package/dist/utilities/functions/normalizeItemGroups.d.ts +13 -0
- package/package.json +2 -2
- package/dist/index228.js +0 -10
- package/dist/index269.js +0 -12
- package/dist/index282.js +0 -190
- package/dist/index295.js +0 -54
- package/dist/index305.js +0 -18
- package/dist/index342.js +0 -4
- package/dist/index362.js +0 -136
package/dist/index82.js
CHANGED
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { findRightIndex as
|
|
3
|
-
import { useId as
|
|
4
|
-
import { useUntil as
|
|
5
|
-
import { wait as
|
|
6
|
-
import
|
|
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
|
|
8
|
+
import oe from "./index88.js";
|
|
9
9
|
/* empty css */
|
|
10
|
-
import
|
|
10
|
+
import _e from "./index268.js";
|
|
11
11
|
/* empty css */
|
|
12
|
-
import
|
|
13
|
-
import { extractDomContainer as
|
|
14
|
-
import { useIntersectionObserver as
|
|
15
|
-
import { parseWidthString as
|
|
16
|
-
|
|
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(
|
|
36
|
-
const
|
|
37
|
-
const e =
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
54
|
-
() =>
|
|
55
|
-
),
|
|
56
|
-
const t =
|
|
57
|
-
t && (
|
|
58
|
-
}, { resume:
|
|
59
|
-
|
|
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 &&
|
|
66
|
+
e !== 1 && r.value && await f();
|
|
62
67
|
},
|
|
63
68
|
{ threshold: [0, 1], immediate: !1 }
|
|
64
|
-
),
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
|
70
|
-
const
|
|
71
|
-
s.stopPropagation(), await
|
|
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(),
|
|
74
|
-
},
|
|
75
|
-
if (!(!(s.target instanceof HTMLElement) || !s.target.dataset.dropdownItem || !
|
|
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(),
|
|
78
|
-
const l =
|
|
79
|
-
|
|
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(),
|
|
85
|
-
const l =
|
|
86
|
-
|
|
87
|
-
(
|
|
88
|
-
),
|
|
89
|
-
|
|
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
|
-
|
|
104
|
+
L instanceof HTMLElement && L.focus();
|
|
92
105
|
}
|
|
93
106
|
} else if (s.key === "Tab") {
|
|
94
|
-
if (
|
|
107
|
+
if (i === t && !s.shiftKey) {
|
|
95
108
|
const l = Array.from(
|
|
96
|
-
document.querySelectorAll(
|
|
97
|
-
),
|
|
98
|
-
(
|
|
99
|
-
),
|
|
100
|
-
|
|
101
|
-
} else if (
|
|
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:
|
|
111
|
-
key:
|
|
112
|
-
disabled:
|
|
113
|
-
id:
|
|
114
|
-
|
|
115
|
-
|
|
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
|
-
}),
|
|
119
|
-
if (!
|
|
120
|
-
if (
|
|
121
|
-
|
|
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(),
|
|
138
|
+
e.stopPropagation(), a.placement === "cursor" && (h.value = O(e.clientX, e.clientY)), r.value ? f() : E();
|
|
125
139
|
}
|
|
126
|
-
},
|
|
127
|
-
|
|
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
|
|
130
|
-
const
|
|
131
|
-
clearTimeout(
|
|
143
|
+
let z, m = null, A = !1;
|
|
144
|
+
const M = () => {
|
|
145
|
+
clearTimeout(z), m = null;
|
|
132
146
|
}, W = (e) => {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
)),
|
|
138
|
-
},
|
|
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 (!
|
|
141
|
-
const t = e.clientX -
|
|
142
|
-
Math.sqrt(t * t +
|
|
143
|
-
},
|
|
144
|
-
|
|
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 (
|
|
147
|
-
const t =
|
|
148
|
-
|
|
149
|
-
(
|
|
150
|
-
),
|
|
151
|
-
if (!
|
|
152
|
-
const
|
|
153
|
-
|
|
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(),
|
|
156
|
-
},
|
|
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
|
-
!
|
|
160
|
-
},
|
|
161
|
-
!
|
|
162
|
-
},
|
|
163
|
-
|
|
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",
|
|
166
|
-
},
|
|
167
|
-
|
|
179
|
+
}), document.addEventListener("focusin", b, { passive: !0 }), document.addEventListener("keydown", x, { capture: !0 });
|
|
180
|
+
}, f = async () => {
|
|
181
|
+
r.value = !1, ce();
|
|
168
182
|
};
|
|
169
|
-
|
|
170
|
-
e || (document.removeEventListener("click",
|
|
171
|
-
}),
|
|
172
|
-
() =>
|
|
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 &&
|
|
188
|
+
e && N(e);
|
|
175
189
|
},
|
|
176
190
|
{ immediate: !0 }
|
|
177
191
|
);
|
|
178
|
-
let
|
|
179
|
-
|
|
180
|
-
[
|
|
192
|
+
let k = null;
|
|
193
|
+
I(
|
|
194
|
+
[g, le],
|
|
181
195
|
([e, t]) => {
|
|
182
|
-
if (
|
|
183
|
-
let
|
|
184
|
-
e.id || (e.id = d,
|
|
185
|
-
const
|
|
186
|
-
t.has("click") && (e.addEventListener("click",
|
|
187
|
-
e.removeEventListener("contextmenu",
|
|
188
|
-
})), e.addEventListener("keydown", j),
|
|
189
|
-
|
|
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
|
-
[
|
|
195
|
-
([e, t,
|
|
196
|
-
e && (e.setAttribute("aria-expanded",
|
|
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
|
-
),
|
|
200
|
-
|
|
213
|
+
), ge(() => {
|
|
214
|
+
k?.();
|
|
201
215
|
});
|
|
202
|
-
const { width:
|
|
203
|
-
|
|
216
|
+
const { width: me } = Te(
|
|
217
|
+
T,
|
|
204
218
|
{ width: 0, height: 0 },
|
|
205
219
|
{
|
|
206
220
|
box: "border-box"
|
|
207
221
|
}
|
|
208
|
-
),
|
|
209
|
-
if (
|
|
210
|
-
if (
|
|
211
|
-
const { value: e, unit: t } =
|
|
212
|
-
return t === "%" ?
|
|
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) => (
|
|
218
|
-
|
|
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:
|
|
234
|
+
ref: N
|
|
221
235
|
},
|
|
222
236
|
disabled: e.disabled,
|
|
223
|
-
open:
|
|
237
|
+
open: r.value,
|
|
224
238
|
placement: e.placement
|
|
225
239
|
}))),
|
|
226
|
-
|
|
240
|
+
Q(_e, R({
|
|
227
241
|
ref: "popover",
|
|
228
|
-
modelValue:
|
|
229
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
230
|
-
anchor:
|
|
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:
|
|
244
|
-
|
|
245
|
-
id: `menu_${
|
|
246
|
-
"aria-labelledby":
|
|
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: !
|
|
250
|
-
style:
|
|
263
|
+
inert: !r.value,
|
|
264
|
+
style: Ee(J.value ? { width: J.value } : void 0)
|
|
251
265
|
}, [
|
|
252
|
-
|
|
266
|
+
w(e.$slots, "prepend", {
|
|
253
267
|
disabled: e.disabled,
|
|
254
|
-
open:
|
|
268
|
+
open: r.value,
|
|
255
269
|
placement: e.placement
|
|
256
270
|
}),
|
|
257
|
-
(
|
|
258
|
-
key:
|
|
271
|
+
(y(!0), _(q, null, Le(C.value, ({ original: o, isGroupStart: i, ...n }, u) => (y(), _(q, {
|
|
272
|
+
key: n.key
|
|
259
273
|
}, [
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
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:
|
|
281
|
+
text: n.text
|
|
267
282
|
}),
|
|
268
|
-
|
|
283
|
+
Q(Ie, R({
|
|
269
284
|
role: "menuitem",
|
|
270
285
|
class: ["bb-dropdown__item", {
|
|
271
|
-
"bb-dropdown__item--first":
|
|
272
|
-
"bb-dropdown__item--last":
|
|
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
|
-
},
|
|
277
|
-
default:
|
|
278
|
-
|
|
279
|
-
disabled:
|
|
280
|
-
index:
|
|
281
|
-
item:
|
|
282
|
-
open:
|
|
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:
|
|
299
|
+
text: n.text
|
|
285
300
|
}, () => [
|
|
286
|
-
|
|
301
|
+
n["prepend:icon"] ? (y(), te(oe, {
|
|
287
302
|
key: 0,
|
|
288
303
|
class: "item__prepend-icon",
|
|
289
|
-
type:
|
|
290
|
-
}, null, 8, ["type"])) :
|
|
291
|
-
|
|
292
|
-
|
|
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:
|
|
296
|
-
}, null, 8, ["type"])) :
|
|
310
|
+
type: n["append:icon"]
|
|
311
|
+
}, null, 8, ["type"])) : P("", !0)
|
|
297
312
|
])
|
|
298
313
|
]),
|
|
299
314
|
_: 2
|
|
300
315
|
}, 1040, ["class"]),
|
|
301
|
-
|
|
302
|
-
disabled:
|
|
303
|
-
index:
|
|
304
|
-
item:
|
|
305
|
-
open:
|
|
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:
|
|
322
|
+
text: n.text
|
|
308
323
|
})
|
|
309
324
|
], 64))), 128)),
|
|
310
|
-
|
|
325
|
+
w(e.$slots, "append", {
|
|
311
326
|
disabled: e.disabled,
|
|
312
|
-
open:
|
|
327
|
+
open: r.value,
|
|
313
328
|
placement: e.placement
|
|
314
329
|
})
|
|
315
|
-
], 12,
|
|
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
|
-
|
|
338
|
+
tt as default
|
|
324
339
|
};
|