bitboss-ui 2.0.5 → 2.0.8
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/components/BaseDialog/BaseDialog.vue.d.ts +1 -3
- package/dist/composables/useOptions.d.ts +1 -1
- package/dist/index.js +89 -87
- package/dist/index.js.map +1 -1
- package/dist/index10.js +7 -39
- package/dist/index10.js.map +1 -1
- package/dist/index101.js +60 -87
- package/dist/index101.js.map +1 -1
- package/dist/index103.js +113 -258
- package/dist/index103.js.map +1 -1
- package/dist/index105.js +254 -388
- package/dist/index105.js.map +1 -1
- package/dist/index107.js +387 -98
- package/dist/index107.js.map +1 -1
- package/dist/index109.js +52 -48
- package/dist/index109.js.map +1 -1
- package/dist/index11.js +74 -188
- package/dist/index11.js.map +1 -1
- package/dist/index111.js +35 -34
- package/dist/index111.js.map +1 -1
- package/dist/index113.js +105 -23
- package/dist/index113.js.map +1 -1
- package/dist/index115.js +23 -156
- package/dist/index115.js.map +1 -1
- package/dist/index117.js +153 -112
- package/dist/index117.js.map +1 -1
- package/dist/index119.js +115 -39
- package/dist/index119.js.map +1 -1
- package/dist/index12.js +38 -80
- package/dist/index12.js.map +1 -1
- package/dist/index121.js +36 -40
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +34 -37
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +30 -21
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +47 -2
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +35 -21
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +2 -2
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +21 -312
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +2 -24
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +312 -2
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +196 -0
- package/dist/index13.js.map +1 -0
- package/dist/index130.js +24 -5
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +2 -9
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +5 -6
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +9 -3
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +6 -3
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +1 -1
- package/dist/index136.js +1 -1
- package/dist/index137.js +1 -1
- package/dist/index138.js +1 -1
- package/dist/index139.js +1 -1
- package/dist/index14.js +73 -121
- package/dist/index14.js.map +1 -1
- package/dist/index140.js +1 -1
- package/dist/index141.js +1 -1
- package/dist/index142.js +1 -1
- package/dist/index143.js +1 -1
- package/dist/index144.js +1 -1
- package/dist/index145.js +1 -1
- package/dist/index146.js +1 -1
- package/dist/index147.js +1 -1
- package/dist/index148.js +1 -1
- package/dist/index149.js +1 -1
- package/dist/index150.js +1 -1
- package/dist/index151.js +1 -1
- package/dist/index152.js +1 -1
- package/dist/index153.js +1 -1
- package/dist/index154.js +1 -1
- package/dist/index155.js +1 -1
- package/dist/index156.js +1 -1
- package/dist/index157.js +1 -1
- package/dist/index158.js +1 -1
- package/dist/index159.js +2 -2
- package/dist/index16.js +119 -118
- package/dist/index16.js.map +1 -1
- package/dist/index160.js +6 -0
- package/dist/index160.js.map +1 -0
- package/dist/index161.js +1 -1
- package/dist/index163.js +2 -2
- package/dist/index165.js +1 -1
- package/dist/index166.js +1 -1
- package/dist/index167.js +1 -1
- package/dist/index168.js +1 -1
- package/dist/index169.js +2 -2
- package/dist/index170.js +6 -0
- package/dist/index170.js.map +1 -0
- package/dist/index171.js +3 -2
- package/dist/index171.js.map +1 -1
- package/dist/index173.js +2 -3
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +1 -1
- package/dist/index175.js +1 -1
- package/dist/index176.js +1 -1
- package/dist/index177.js +1 -1
- package/dist/index178.js +1 -1
- package/dist/index179.js +1 -1
- package/dist/index18.js +120 -208
- package/dist/index18.js.map +1 -1
- package/dist/index180.js +1 -1
- package/dist/index181.js +1 -1
- package/dist/index182.js +1 -1
- package/dist/index183.js +2 -2
- package/dist/index184.js +6 -0
- package/dist/index184.js.map +1 -0
- package/dist/index185.js +1 -1
- package/dist/index187.js +1 -1
- package/dist/index189.js +1 -1
- package/dist/index190.js +1 -1
- package/dist/index191.js +1 -1
- package/dist/index192.js +1 -1
- package/dist/index193.js +1 -1
- package/dist/index194.js +1 -1
- package/dist/index195.js +1 -1
- package/dist/index196.js +1 -1
- package/dist/index197.js +3 -81
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +3 -3
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +81 -5
- package/dist/index199.js.map +1 -1
- package/dist/index20.js +193 -275
- package/dist/index20.js.map +1 -1
- package/dist/index200.js +2 -16
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +3 -16
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +124 -17
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +5 -19
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +119 -23
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +19 -3
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +16 -2
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +16 -8
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +2 -249
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +5 -0
- package/dist/index209.js.map +1 -0
- package/dist/index210.js +35 -52
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +173 -36
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +6 -5
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +39 -36
- package/dist/index213.js.map +1 -1
- package/dist/index215.js +13 -4
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +5 -2
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +369 -2
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +6 -40
- package/dist/index218.js.map +1 -1
- package/dist/{index214.js → index219.js} +1 -1
- package/dist/{index214.js.map → index219.js.map} +1 -1
- package/dist/index22.js +287 -247
- package/dist/index22.js.map +1 -1
- package/dist/index220.js +4 -13
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +2 -158
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +3 -84
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +10 -0
- package/dist/index223.js.map +1 -0
- package/dist/index224.js +19 -3
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +26 -34
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +3 -6
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +249 -7
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +49 -123
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +44 -123
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +5 -2
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +49 -174
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +158 -5
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +83 -368
- package/dist/index233.js.map +1 -1
- package/dist/index235.js +2 -18
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +17 -105
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +109 -0
- package/dist/index237.js.map +1 -0
- package/dist/{index238.js → index239.js} +3 -3
- package/dist/{index238.js.map → index239.js.map} +1 -1
- package/dist/index24.js +249 -120
- package/dist/index24.js.map +1 -1
- package/dist/index241.js +2 -10
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +9 -2
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +3 -224
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +9 -281
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +23 -6
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +6 -2
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +16 -2
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +224 -2
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +281 -2
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +6 -2
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +2 -2
- package/dist/index252.js +2 -3
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +2 -2
- package/dist/index254.js +2 -2
- package/dist/index255.js +2 -2
- package/dist/index256.js +122 -24
- package/dist/index256.js.map +1 -1
- package/dist/index257.js +429 -20
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +6 -0
- package/dist/index258.js.map +1 -0
- package/dist/index26.js +119 -142
- package/dist/index26.js.map +1 -1
- package/dist/index260.js +6 -3
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +21 -8
- package/dist/index261.js.map +1 -1
- package/dist/index263.js +9 -3
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +439 -0
- package/dist/index264.js.map +1 -0
- package/dist/index265.js +127 -6
- package/dist/index265.js.map +1 -1
- package/dist/index266.js +199 -15
- package/dist/index266.js.map +1 -1
- package/dist/index267.js +4 -9
- package/dist/index267.js.map +1 -1
- package/dist/index268.js +89 -3
- package/dist/index268.js.map +1 -1
- package/dist/index269.js +2 -12
- package/dist/index269.js.map +1 -1
- package/dist/index270.js +2 -9
- package/dist/index270.js.map +1 -1
- package/dist/index271.js +2 -9
- package/dist/index271.js.map +1 -1
- package/dist/index272.js +2 -17
- package/dist/index272.js.map +1 -1
- package/dist/index273.js +2 -431
- package/dist/index273.js.map +1 -1
- package/dist/index274.js +2 -89
- package/dist/index274.js.map +1 -1
- package/dist/index275.js +28 -2
- package/dist/index275.js.map +1 -1
- package/dist/index276.js +17 -64
- package/dist/index276.js.map +1 -1
- package/dist/index278.js +3 -200
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +12 -2
- package/dist/index279.js.map +1 -1
- package/dist/index28.js +138 -83
- package/dist/index28.js.map +1 -1
- package/dist/index280.js +7 -124
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +7 -20
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +20 -0
- package/dist/index282.js.map +1 -0
- package/dist/index283.js +2 -436
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +68 -126
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +5 -3
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +1 -1
- package/dist/index287.js +3 -211
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +214 -0
- package/dist/index288.js.map +1 -0
- package/dist/index290.js +4 -7
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +4 -19
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +58 -6
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +35 -4
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +7 -4
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +6 -58
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +18 -34
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +2 -11
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +47 -2
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +10 -46
- package/dist/index299.js.map +1 -1
- package/dist/index30.js +85 -115
- package/dist/index30.js.map +1 -1
- package/dist/index32.js +111 -112
- package/dist/index32.js.map +1 -1
- package/dist/index34.js +114 -365
- package/dist/index34.js.map +1 -1
- package/dist/index36.js +361 -283
- package/dist/index36.js.map +1 -1
- package/dist/index38.js +288 -106
- package/dist/index38.js.map +1 -1
- package/dist/index40.js +114 -121
- package/dist/index40.js.map +1 -1
- package/dist/index42.js +113 -200
- package/dist/index42.js.map +1 -1
- package/dist/index44.js +180 -90
- package/dist/index44.js.map +1 -1
- package/dist/index46.js +110 -78
- package/dist/index46.js.map +1 -1
- package/dist/index48.js +89 -54
- package/dist/index48.js.map +1 -1
- package/dist/index5.js +14 -78
- package/dist/index5.js.map +1 -1
- package/dist/index50.js +54 -84
- package/dist/index50.js.map +1 -1
- package/dist/index52.js +86 -60
- package/dist/index52.js.map +1 -1
- package/dist/index54.js +59 -40
- package/dist/index54.js.map +1 -1
- package/dist/index56.js +42 -55
- package/dist/index56.js.map +1 -1
- package/dist/index58.js +53 -103
- package/dist/index58.js.map +1 -1
- package/dist/index6.js +36 -58
- package/dist/index6.js.map +1 -1
- package/dist/index60.js +103 -89
- package/dist/index60.js.map +1 -1
- package/dist/index62.js +61 -88
- package/dist/index62.js.map +1 -1
- package/dist/index64.js +119 -77
- package/dist/index64.js.map +1 -1
- package/dist/index66.js +77 -91
- package/dist/index66.js.map +1 -1
- package/dist/index68.js +88 -49
- package/dist/index68.js.map +1 -1
- package/dist/index7.js +78 -20
- package/dist/index7.js.map +1 -1
- package/dist/index70.js +51 -304
- package/dist/index70.js.map +1 -1
- package/dist/index72.js +299 -115
- package/dist/index72.js.map +1 -1
- package/dist/index74.js +120 -214
- package/dist/index74.js.map +1 -1
- package/dist/index76.js +213 -36
- package/dist/index76.js.map +1 -1
- package/dist/index78.js +47 -0
- package/dist/index78.js.map +1 -0
- package/dist/index79.js +119 -230
- package/dist/index79.js.map +1 -1
- package/dist/index8.js +61 -7
- package/dist/index8.js.map +1 -1
- package/dist/index81.js +227 -154
- package/dist/index81.js.map +1 -1
- package/dist/index83.js +154 -207
- package/dist/index83.js.map +1 -1
- package/dist/index85.js +215 -26
- package/dist/index85.js.map +1 -1
- package/dist/index87.js +27 -88
- package/dist/index87.js.map +1 -1
- package/dist/index89.js +53 -88
- package/dist/index89.js.map +1 -1
- package/dist/index9.js +17 -76
- package/dist/index9.js.map +1 -1
- package/dist/index91.js +75 -44
- package/dist/index91.js.map +1 -1
- package/dist/index93.js +89 -15
- package/dist/index93.js.map +1 -1
- package/dist/index95.js +15 -166
- package/dist/index95.js.map +1 -1
- package/dist/index97.js +120 -59
- package/dist/index97.js.map +1 -1
- package/dist/index99.js +66 -52
- package/dist/index99.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/dist/index120.js +0 -47
- package/dist/index120.js.map +0 -1
- package/dist/index164.js +0 -6
- package/dist/index164.js.map +0 -1
- package/dist/index172.js +0 -6
- package/dist/index172.js.map +0 -1
- package/dist/index188.js +0 -6
- package/dist/index188.js.map +0 -1
- package/dist/index234.js +0 -6
- package/dist/index234.js.map +0 -1
- package/dist/index240.js +0 -5
- package/dist/index240.js.map +0 -1
- package/dist/index259.js +0 -10
- package/dist/index259.js.map +0 -1
- package/dist/index262.js +0 -26
- package/dist/index262.js.map +0 -1
- package/dist/index277.js +0 -8
- package/dist/index277.js.map +0 -1
- package/dist/index3.js +0 -17
- package/dist/index3.js.map +0 -1
- package/dist/index4.js +0 -43
- package/dist/index4.js.map +0 -1
- package/dist/index77.js +0 -130
- package/dist/index77.js.map +0 -1
package/dist/index72.js
CHANGED
|
@@ -1,130 +1,314 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as Y, computed as M, ref as v, openBlock as D, createElementBlock as H, mergeProps as I, createElementVNode as $, renderSlot as _, normalizeProps as Z, guardReactiveProps as ee, unref as c, createBlock as te, Teleport as oe, normalizeClass as ne, normalizeStyle as z, Fragment as N, renderList as ae, createVNode as le, withCtx as se, createCommentVNode as ie } from "vue";
|
|
2
|
+
import { findRightIndex as S } from "./index244.js";
|
|
3
|
+
import { useFloating as re, arrow as ue } from "./index202.js";
|
|
4
|
+
import { useId as de } from "./index9.js";
|
|
5
|
+
import { wait as U } from "./index128.js";
|
|
6
|
+
import { useIntersectionObserver as ce } from "./index129.js";
|
|
7
|
+
import fe from "./index14.js";
|
|
3
8
|
/* empty css */
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
viewBox: "0 0 24 24",
|
|
9
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
10
|
-
}, [
|
|
11
|
-
/* @__PURE__ */ m("path", {
|
|
12
|
-
d: "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6l-6 6l1.41 1.41Z",
|
|
13
|
-
fill: "currentColor"
|
|
14
|
-
})
|
|
15
|
-
], -1), R = /* @__PURE__ */ c({
|
|
16
|
-
__name: "BbDropdownButton",
|
|
9
|
+
import V from "./index245.js";
|
|
10
|
+
import { autoUpdate as pe, flip as be, offset as me, shift as ve } from "./index217.js";
|
|
11
|
+
const we = ["id", "aria-labelledby"], ye = { class: "bb-dropdown__items-container" }, He = /* @__PURE__ */ Y({
|
|
12
|
+
__name: "BbDropdown",
|
|
17
13
|
props: {
|
|
18
|
-
arrowPadding: {},
|
|
14
|
+
arrowPadding: { default: 10 },
|
|
19
15
|
block: { type: Boolean },
|
|
20
16
|
disabled: { type: Boolean },
|
|
21
17
|
eager: { type: Boolean },
|
|
22
18
|
id: {},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
placement: {},
|
|
19
|
+
offset: { default: 3 },
|
|
20
|
+
padding: { default: 6 },
|
|
21
|
+
placement: { default: "bottom" },
|
|
27
22
|
theme: { default: "default" },
|
|
28
|
-
transitionDuration: {},
|
|
29
|
-
|
|
23
|
+
transitionDuration: { default: 150 },
|
|
24
|
+
items: {},
|
|
25
|
+
width: { default: 200 }
|
|
30
26
|
},
|
|
31
|
-
setup(
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
27
|
+
setup(j) {
|
|
28
|
+
const a = j, b = a.id ?? `bb_${de().id.value}`, w = M(() => {
|
|
29
|
+
let e = a.items.findIndex((t) => !t.disabled), n = S(
|
|
30
|
+
a.items,
|
|
31
|
+
(t) => !t.disabled
|
|
32
|
+
);
|
|
33
|
+
return a.items.map((t, o) => {
|
|
34
|
+
const d = `${b}-item-${t.key}`, { onClick: K, ...P } = t, W = async () => {
|
|
35
|
+
await g();
|
|
36
|
+
const i = document.querySelector(`#${b}`);
|
|
37
|
+
if (i) i instanceof HTMLElement && i.focus();
|
|
38
|
+
else return;
|
|
39
|
+
K && K();
|
|
40
|
+
}, X = (i) => {
|
|
41
|
+
if (i.target instanceof HTMLElement && i.target.dataset.dropdownItem) {
|
|
42
|
+
if (!l.value) return;
|
|
43
|
+
if (i.key === "ArrowDown") {
|
|
44
|
+
if (i.preventDefault(), l.value && o !== n) {
|
|
45
|
+
const p = l.value.querySelector(
|
|
46
|
+
V.map((k) => `#${d} ~ ${k}`).join(",")
|
|
47
|
+
);
|
|
48
|
+
p && p instanceof HTMLElement && p.focus();
|
|
49
|
+
}
|
|
50
|
+
} else if (i.key === "ArrowUp") {
|
|
51
|
+
if (i.preventDefault(), l.value && o !== e) {
|
|
52
|
+
const p = S(a.items, (E, T) => T < o && !E.disabled), h = Array.from(
|
|
53
|
+
l.value.querySelectorAll(".bb-dropdown__item")
|
|
54
|
+
)[p];
|
|
55
|
+
h && h instanceof HTMLElement && h.focus();
|
|
56
|
+
}
|
|
57
|
+
} else if (i.key === "Tab") {
|
|
58
|
+
if (o === n && !i.shiftKey) {
|
|
59
|
+
const p = V.join(","), k = Array.from(
|
|
60
|
+
document.querySelectorAll(p)
|
|
61
|
+
), h = k.findIndex(
|
|
62
|
+
(T) => T.id === b
|
|
63
|
+
), E = k[h + 1];
|
|
64
|
+
if (E) E instanceof HTMLElement && (i.preventDefault(), g(), E.focus());
|
|
65
|
+
else return;
|
|
66
|
+
} else if (o === e && i.shiftKey) {
|
|
67
|
+
const p = document.querySelector(`#${b}`);
|
|
68
|
+
if (p) p instanceof HTMLElement && (i.preventDefault(), p.focus());
|
|
69
|
+
else return;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
return {
|
|
75
|
+
...P,
|
|
76
|
+
disabled: P.disabled || a.disabled,
|
|
77
|
+
id: d,
|
|
78
|
+
onClick: W,
|
|
79
|
+
onKeydown: X
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
}), y = v(), l = v(), F = v(), { floatingStyles: R, placement: m, middlewareData: q } = re(
|
|
83
|
+
y,
|
|
84
|
+
l,
|
|
85
|
+
{
|
|
86
|
+
placement: a.placement,
|
|
87
|
+
whileElementsMounted: pe,
|
|
88
|
+
middleware: [
|
|
89
|
+
be(),
|
|
90
|
+
me(a.offset),
|
|
91
|
+
ve({ padding: a.padding }),
|
|
92
|
+
ue({
|
|
93
|
+
element: F,
|
|
94
|
+
padding: a.arrowPadding
|
|
47
95
|
})
|
|
48
|
-
]
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
ce(
|
|
100
|
+
y,
|
|
101
|
+
([{ intersectionRatio: e }]) => {
|
|
102
|
+
e !== 1 && s.value && g();
|
|
103
|
+
},
|
|
104
|
+
{ threshold: [0, 1] }
|
|
105
|
+
);
|
|
106
|
+
const r = v(!1), s = v(!1), u = v(!1), f = v(!0), x = M(() => {
|
|
107
|
+
if (q.value.arrow) {
|
|
108
|
+
const { x: e, y: n } = q.value.arrow;
|
|
109
|
+
return {
|
|
110
|
+
style: {
|
|
111
|
+
left: `${e}px`,
|
|
112
|
+
top: `${n}px`
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}), G = () => {
|
|
117
|
+
r.value || u.value || (s.value ? g() : L());
|
|
118
|
+
}, J = async (e) => {
|
|
119
|
+
let n = a.items.findIndex((o) => !o.disabled), t = S(
|
|
120
|
+
a.items,
|
|
121
|
+
(o) => !o.disabled
|
|
122
|
+
);
|
|
123
|
+
if (e.key === "ArrowDown") {
|
|
124
|
+
if (e.preventDefault(), u.value || r.value) return;
|
|
125
|
+
if (f.value && await L(), l.value && w.value.length && n !== -1) {
|
|
126
|
+
const o = w.value[n].id, d = l.value.querySelector(`#${o}`);
|
|
127
|
+
d && d instanceof HTMLElement && d.focus();
|
|
128
|
+
}
|
|
129
|
+
} else if (e.key === "ArrowUp") {
|
|
130
|
+
if (e.preventDefault(), u.value || r.value) return;
|
|
131
|
+
if (f.value && await L(), l.value && w.value.length && t !== -1) {
|
|
132
|
+
const o = w.value[t].id, d = l.value.querySelector(`#${o}`);
|
|
133
|
+
d && d instanceof HTMLElement && d.focus();
|
|
134
|
+
}
|
|
135
|
+
} else if (e.key === "Tab" && s.value && !e.shiftKey && (e.preventDefault(), l.value && w.value.length && n !== -1)) {
|
|
136
|
+
const o = w.value[n].id, d = l.value.querySelector(`#${o}`);
|
|
137
|
+
d && d instanceof HTMLElement && d.focus();
|
|
138
|
+
}
|
|
139
|
+
}, A = (e) => {
|
|
140
|
+
const n = e.target;
|
|
141
|
+
if (n && n instanceof HTMLElement) {
|
|
142
|
+
let t = !0;
|
|
143
|
+
y.value && y.value.contains(n) && (t = !1), l.value && l.value.contains(n) && (t = !1), t && g();
|
|
144
|
+
}
|
|
145
|
+
}, C = (e) => {
|
|
146
|
+
const n = e.target;
|
|
147
|
+
if (n && n instanceof HTMLElement) {
|
|
148
|
+
let t = !0;
|
|
149
|
+
y.value && y.value.contains(n) && (t = !1), l.value && l.value.contains(n) && (t = !1), t && g();
|
|
150
|
+
}
|
|
151
|
+
}, B = (e) => {
|
|
152
|
+
var n;
|
|
153
|
+
if (s.value && e.key === "Escape") {
|
|
154
|
+
if (((n = document.activeElement) == null ? void 0 : n.id) !== b) {
|
|
155
|
+
const t = document.querySelector(`#${b}`);
|
|
156
|
+
t instanceof HTMLElement && t.focus();
|
|
157
|
+
}
|
|
158
|
+
g();
|
|
159
|
+
}
|
|
160
|
+
}, O = v(!1), L = async () => {
|
|
161
|
+
O.value = !0, f.value = !1, u.value = !1, r.value = !0, await U(50), s.value = !0, r.value = !1, document.addEventListener("click", A, { passive: !0 }), document.addEventListener("focusin", C, { passive: !0 }), document.addEventListener("keydown", B, { passive: !0 });
|
|
162
|
+
}, g = async () => {
|
|
163
|
+
s.value = !1, r.value = !1, u.value = !0, await U(a.transitionDuration), u.value = !1, f.value = !0, document.removeEventListener("click", A), document.removeEventListener("focusin", C), document.removeEventListener("keydown", B);
|
|
164
|
+
}, Q = M(() => ({
|
|
165
|
+
class: {
|
|
166
|
+
"bb-dropdown--block": a.block,
|
|
167
|
+
[`bb-dropdown--theme-${a.theme}`]: a.theme
|
|
168
|
+
}
|
|
169
|
+
}));
|
|
170
|
+
return (e, n) => (D(), H("span", I({ class: "bb-dropdown" }, Q.value), [
|
|
171
|
+
$("span", {
|
|
172
|
+
ref_key: "wrapper",
|
|
173
|
+
ref: y,
|
|
174
|
+
class: "bb-dropdown__wrapper"
|
|
116
175
|
}, [
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
176
|
+
_(e.$slots, "activator", Z(ee({
|
|
177
|
+
props: {
|
|
178
|
+
"aria-expanded": s.value,
|
|
179
|
+
"aria-controls": `menu_${c(b)}`,
|
|
180
|
+
id: c(b),
|
|
181
|
+
onClick: G,
|
|
182
|
+
onKeydown: J,
|
|
183
|
+
disabled: e.disabled
|
|
184
|
+
},
|
|
185
|
+
closed: f.value,
|
|
186
|
+
closing: u.value,
|
|
187
|
+
disabled: e.disabled,
|
|
188
|
+
open: s.value,
|
|
189
|
+
opening: r.value,
|
|
190
|
+
placement: c(m)
|
|
191
|
+
})))
|
|
192
|
+
], 512),
|
|
193
|
+
O.value || e.eager ? (D(), te(oe, {
|
|
194
|
+
key: 0,
|
|
195
|
+
to: "body"
|
|
196
|
+
}, [
|
|
197
|
+
$("span", {
|
|
198
|
+
id: `menu_${c(b)}`,
|
|
199
|
+
ref_key: "content",
|
|
200
|
+
ref: l,
|
|
201
|
+
"aria-labelledby": c(b),
|
|
202
|
+
"aria-role": "menu",
|
|
203
|
+
class: ne(["bb-dropdown__bubble-container", {
|
|
204
|
+
[`bb-dropdown__bubble-container--${c(m)}`]: !0,
|
|
205
|
+
[`bb-dropdown__bubble-container--${e.theme}`]: e.theme,
|
|
206
|
+
"bb-dropdown__bubble-container--hidden": f.value,
|
|
207
|
+
"bb-dropdown__bubble-container--closing": u.value,
|
|
208
|
+
"bb-dropdown__bubble-container--opening": r.value,
|
|
209
|
+
"bb-dropdown__bubble-container--open": s.value
|
|
210
|
+
}]),
|
|
211
|
+
style: z({
|
|
212
|
+
...c(R),
|
|
213
|
+
transitionDuration: `${a.transitionDuration}ms`
|
|
214
|
+
})
|
|
215
|
+
}, [
|
|
216
|
+
$("span", I({
|
|
217
|
+
ref_key: "bubblearrow",
|
|
218
|
+
ref: F,
|
|
219
|
+
class: "bb-dropdown__arrow"
|
|
220
|
+
}, x.value), null, 16),
|
|
221
|
+
$("span", {
|
|
222
|
+
class: "bb-dropdown__bubble",
|
|
223
|
+
style: z({ width: `${e.width}px` })
|
|
224
|
+
}, [
|
|
225
|
+
_(e.$slots, "prepend", {
|
|
226
|
+
closed: f.value,
|
|
227
|
+
closing: u.value,
|
|
228
|
+
disabled: e.disabled,
|
|
229
|
+
open: s.value,
|
|
230
|
+
opening: r.value,
|
|
231
|
+
placement: c(m)
|
|
232
|
+
}),
|
|
233
|
+
$("span", ye, [
|
|
234
|
+
(D(!0), H(N, null, ae(w.value, (t, o) => (D(), H(N, {
|
|
235
|
+
key: t.key
|
|
236
|
+
}, [
|
|
237
|
+
_(e.$slots, "item:prepend", {
|
|
238
|
+
closed: f.value,
|
|
239
|
+
closing: u.value,
|
|
240
|
+
disabled: t.disabled,
|
|
241
|
+
index: o,
|
|
242
|
+
item: e.items[o],
|
|
243
|
+
open: s.value,
|
|
244
|
+
opening: r.value,
|
|
245
|
+
placement: c(m),
|
|
246
|
+
text: t.text
|
|
247
|
+
}),
|
|
248
|
+
le(fe, I({
|
|
249
|
+
"aria-role": "menuitem",
|
|
250
|
+
class: ["bb-dropdown__item", {
|
|
251
|
+
"bb-dropdown__item--first": o === 0,
|
|
252
|
+
"bb-dropdown__item--last": o === e.items.length - 1
|
|
253
|
+
}],
|
|
254
|
+
"data-dropdown-item": !0,
|
|
255
|
+
ref_for: !0
|
|
256
|
+
}, t), {
|
|
257
|
+
default: se(() => [
|
|
258
|
+
_(e.$slots, t.key, {
|
|
259
|
+
closed: f.value,
|
|
260
|
+
closing: u.value,
|
|
261
|
+
disabled: t.disabled,
|
|
262
|
+
index: o,
|
|
263
|
+
item: t,
|
|
264
|
+
open: s.value,
|
|
265
|
+
opening: r.value,
|
|
266
|
+
placement: c(m),
|
|
267
|
+
text: t.text
|
|
268
|
+
}, () => [
|
|
269
|
+
_(e.$slots, "item", {
|
|
270
|
+
closed: f.value,
|
|
271
|
+
closing: u.value,
|
|
272
|
+
disabled: t.disabled,
|
|
273
|
+
index: o,
|
|
274
|
+
item: t,
|
|
275
|
+
open: s.value,
|
|
276
|
+
opening: r.value,
|
|
277
|
+
placement: c(m),
|
|
278
|
+
text: t.text
|
|
279
|
+
})
|
|
280
|
+
])
|
|
281
|
+
]),
|
|
282
|
+
_: 2
|
|
283
|
+
}, 1040, ["class"]),
|
|
284
|
+
_(e.$slots, "item:append", {
|
|
285
|
+
closed: f.value,
|
|
286
|
+
closing: u.value,
|
|
287
|
+
disabled: t.disabled,
|
|
288
|
+
index: o,
|
|
289
|
+
item: e.items[o],
|
|
290
|
+
open: s.value,
|
|
291
|
+
opening: r.value,
|
|
292
|
+
placement: c(m),
|
|
293
|
+
text: t.text
|
|
294
|
+
})
|
|
295
|
+
], 64))), 128))
|
|
296
|
+
]),
|
|
297
|
+
_(e.$slots, "append", {
|
|
298
|
+
closed: f.value,
|
|
299
|
+
closing: u.value,
|
|
300
|
+
disabled: e.disabled,
|
|
301
|
+
open: s.value,
|
|
302
|
+
opening: r.value,
|
|
303
|
+
placement: c(m)
|
|
304
|
+
})
|
|
305
|
+
], 4)
|
|
306
|
+
], 14, we)
|
|
307
|
+
])) : ie("", !0)
|
|
308
|
+
], 16));
|
|
125
309
|
}
|
|
126
310
|
});
|
|
127
311
|
export {
|
|
128
|
-
|
|
312
|
+
He as default
|
|
129
313
|
};
|
|
130
314
|
//# sourceMappingURL=index72.js.map
|
package/dist/index72.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index72.js","sources":["../src/components/BbDropdownButton/BbDropdownButton.vue"],"sourcesContent":["<template>\n\t<span\n\t\tclass=\"bb-dropdown-button\"\n\t\t:class=\"{\n\t\t\t'bb-dropdown-button--block': block,\n\t\t\t[`bb-dropdown-button--theme-${props.theme}`]: props.theme,\n\t\t}\"\n\t>\n\t\t<BaseButton v-bind=\"mainBtn\" class=\"bb-dropdown-button__main-btn\">\n\t\t\t<slot\n\t\t\t\t:disabled=\"mainBtn.disabled\"\n\t\t\t\tname=\"left-btn\"\n\t\t\t\t:text=\"mainBtn.text\"\n\t\t\t></slot>\n\t\t</BaseButton>\n\t\t<BbDropdown\n\t\t\t:id=\"id\"\n\t\t\t:arrow-padding=\"arrowPadding\"\n\t\t\t:disabled=\"disabled\"\n\t\t\t:eager=\"eager\"\n\t\t\t:items=\"items\"\n\t\t\t:offset=\"offset\"\n\t\t\t:padding=\"padding\"\n\t\t\t:placement=\"placement\"\n\t\t\t:theme=\"theme\"\n\t\t\t:transition-duration=\"transitionDuration\"\n\t\t\t:width=\"width\"\n\t\t>\n\t\t\t<template\n\t\t\t\t#activator=\"{\n\t\t\t\t\tprops,\n\t\t\t\t\topening,\n\t\t\t\t\topen,\n\t\t\t\t\tclosed,\n\t\t\t\t\tclosing,\n\t\t\t\t\tdisabled,\n\t\t\t\t\tplacement,\n\t\t\t\t}\"\n\t\t\t>\n\t\t\t\t<slot\n\t\t\t\t\t:closed=\"closed\"\n\t\t\t\t\t:closing=\"closing\"\n\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\tname=\"activator\"\n\t\t\t\t\t:open=\"open\"\n\t\t\t\t\t:opening=\"opening\"\n\t\t\t\t\t:placement=\"placement\"\n\t\t\t\t\t:props=\"props\"\n\t\t\t\t>\n\t\t\t\t\t<BaseButton v-bind=\"props\" class=\"bb-dropdown-button__dropdown-btn\">\n\t\t\t\t\t\t<span class=\"bb-dropdown-button__dropdown-label\"\n\t\t\t\t\t\t\t>{{ open || opening ? 'Chiudi' : 'Apri' }} il menu</span\n\t\t\t\t\t\t>\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t:closed=\"closed\"\n\t\t\t\t\t\t\t:closing=\"closing\"\n\t\t\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t\t\tname=\"right-btn\"\n\t\t\t\t\t\t\t:open=\"open\"\n\t\t\t\t\t\t\t:opening=\"opening\"\n\t\t\t\t\t\t\t:placement=\"placement\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\tclass=\"bb-dropdown-button__dropdown-chevron\"\n\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\td=\"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6l-6 6l1.41 1.41Z\"\n\t\t\t\t\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t\t\t\t\t/></svg></slot></BaseButton></slot\n\t\t\t></template>\n\t\t\t<template #prepend=\"data\"><slot name=\"prepend\" v-bind=\"data\" /></template>\n\t\t\t<template #item:prepend=\"data\">\n\t\t\t\t<slot name=\"item:prepend\" v-bind=\"data\" />\n\t\t\t</template>\n\t\t\t<template #item=\"data\"><slot name=\"item\" v-bind=\"data\" /></template>\n\t\t\t<template v-for=\"item in items\" #[item.key]=\"data\">\n\t\t\t\t<slot :name=\"item.key\" v-bind=\"data\" />\n\t\t\t</template>\n\t\t\t<template #item:append=\"data\">\n\t\t\t\t<slot name=\"item:append\" v-bind=\"data\" />\n\t\t\t</template>\n\t\t\t<template #append=\"data\"><slot name=\"append\" v-bind=\"data\" /></template>\n\t\t</BbDropdown>\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport BaseButton from '../BaseButton/BaseButton.vue';\nimport BbDropdown from '../BbDropdown/BbDropdown.vue';\nimport type { BbDropdownProps, MappedItem } from '../BbDropdown/BbDropdown.vue';\n\nexport type BbDropdownButtonProps = Pick<\n\tBbDropdownProps,\n\t| 'arrowPadding'\n\t| 'block'\n\t| 'disabled'\n\t| 'eager'\n\t| 'id'\n\t| 'items'\n\t| 'offset'\n\t| 'padding'\n\t| 'placement'\n\t| 'theme'\n\t| 'transitionDuration'\n\t| 'width'\n>;\n\nconst props = withDefaults(defineProps<BbDropdownButtonProps>(), {\n\ttheme: 'default',\n});\n\ndefineSlots<\n\t{\n\t\t'left-btn'?: (props: {\n\t\t\tdisabled?: boolean;\n\t\t\ttext: MappedItem['text'];\n\t\t}) => any;\n\t\tactivator?: (props: {\n\t\t\tprops: {\n\t\t\t\t'aria-expanded': boolean;\n\t\t\t\t'aria-controls': string;\n\t\t\t\tid: string;\n\t\t\t\tonClick: MappedItem['onClick'];\n\t\t\t\tonKeydown: MappedItem['onKeydown'];\n\t\t\t\tdisabled?: BbDropdownButtonProps['disabled'];\n\t\t\t};\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: boolean;\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownButtonProps['placement'];\n\t\t}) => any;\n\t\tprepend?: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: boolean;\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownButtonProps['placement'];\n\t\t}) => any;\n\t\t'item:prepend'?: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: MappedItem['disabled'];\n\t\t\tindex: number;\n\t\t\titem: BbDropdownButtonProps['items'][number];\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownButtonProps['placement'];\n\t\t\ttext: MappedItem['text'];\n\t\t}) => any;\n\t\titem?: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: MappedItem['disabled'];\n\t\t\tindex: number;\n\t\t\titem: BbDropdownButtonProps['items'][number];\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownButtonProps['placement'];\n\t\t\ttext: MappedItem['text'];\n\t\t}) => any;\n\t\t'item:append'?: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: MappedItem['disabled'];\n\t\t\tindex: number;\n\t\t\titem: BbDropdownButtonProps['items'][number];\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownButtonProps['placement'];\n\t\t\ttext: MappedItem['text'];\n\t\t}) => any;\n\t\tappend?: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: boolean;\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownButtonProps['placement'];\n\t\t}) => any;\n\t\t'right-btn'?: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: boolean;\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownButtonProps['placement'];\n\t\t}) => any;\n\t} & {\n\t\t[key: string]: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: MappedItem['disabled'];\n\t\t\tindex: number;\n\t\t\titem: BbDropdownButtonProps['items'][number];\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownButtonProps['placement'];\n\t\t\ttext: MappedItem['text'];\n\t\t}) => any;\n\t}\n>();\n\nconst mainBtn = computed(() => {\n\tconst base = { ...props.items[0] };\n\tbase.disabled = base.disabled || props.disabled;\n\treturn base;\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbDropdownButton';\n</style>\n"],"names":["props","__props","mainBtn","computed","base"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8GA,UAAMA,IAAQC,GAkGRC,IAAUC,EAAS,MAAM;AAC9B,YAAMC,IAAO,EAAE,GAAGJ,EAAM,MAAM,CAAC,EAAE;AAC5B,aAAAI,EAAA,WAAWA,EAAK,YAAYJ,EAAM,UAChCI;AAAA,IAAA,CACP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index72.js","sources":["../src/components/BbDropdown/BbDropdown.vue"],"sourcesContent":["<template>\n\t<span class=\"bb-dropdown\" v-bind=\"attributes\">\n\t\t<span ref=\"wrapper\" class=\"bb-dropdown__wrapper\">\n\t\t\t<slot\n\t\t\t\tname=\"activator\"\n\t\t\t\tv-bind=\"{\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t'aria-expanded': open,\n\t\t\t\t\t\t'aria-controls': `menu_${id}`,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tonClick,\n\t\t\t\t\t\tonKeydown,\n\t\t\t\t\t\tdisabled,\n\t\t\t\t\t},\n\t\t\t\t\tclosed: closed,\n\t\t\t\t\tclosing: closing,\n\t\t\t\t\tdisabled: disabled,\n\t\t\t\t\topen: open,\n\t\t\t\t\topening: opening,\n\t\t\t\t\tplacement: placement,\n\t\t\t\t}\"\n\t\t\t></slot>\n\t\t</span>\n\t\t<teleport v-if=\"hasOpenedOnce || eager\" to=\"body\">\n\t\t\t<span\n\t\t\t\t:id=\"`menu_${id}`\"\n\t\t\t\tref=\"content\"\n\t\t\t\t:aria-labelledby=\"id\"\n\t\t\t\taria-role=\"menu\"\n\t\t\t\tclass=\"bb-dropdown__bubble-container\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t[`bb-dropdown__bubble-container--${placement}`]: true,\n\t\t\t\t\t[`bb-dropdown__bubble-container--${theme}`]: theme,\n\t\t\t\t\t'bb-dropdown__bubble-container--hidden': closed,\n\t\t\t\t\t'bb-dropdown__bubble-container--closing': closing,\n\t\t\t\t\t'bb-dropdown__bubble-container--opening': opening,\n\t\t\t\t\t'bb-dropdown__bubble-container--open': open,\n\t\t\t\t}\"\n\t\t\t\t:style=\"{\n\t\t\t\t\t...floatingStyles,\n\t\t\t\t\ttransitionDuration: `${props.transitionDuration}ms`,\n\t\t\t\t}\"\n\t\t\t>\n\t\t\t\t<span\n\t\t\t\t\tref=\"bubblearrow\"\n\t\t\t\t\tclass=\"bb-dropdown__arrow\"\n\t\t\t\t\tv-bind=\"arrowAttributes\"\n\t\t\t\t></span>\n\t\t\t\t<span class=\"bb-dropdown__bubble\" :style=\"{ width: `${width}px` }\">\n\t\t\t\t\t<slot\n\t\t\t\t\t\t:closed=\"closed\"\n\t\t\t\t\t\t:closing=\"closing\"\n\t\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t\tname=\"prepend\"\n\t\t\t\t\t\t:open=\"open\"\n\t\t\t\t\t\t:opening=\"opening\"\n\t\t\t\t\t\t:placement=\"placement\"\n\t\t\t\t\t></slot>\n\t\t\t\t\t<span class=\"bb-dropdown__items-container\">\n\t\t\t\t\t\t<template v-for=\"(item, index) in mappedItems\" :key=\"item.key\">\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:closed=\"closed\"\n\t\t\t\t\t\t\t\t:closing=\"closing\"\n\t\t\t\t\t\t\t\t:disabled=\"item.disabled\"\n\t\t\t\t\t\t\t\t:index=\"index\"\n\t\t\t\t\t\t\t\t:item=\"items[index]\"\n\t\t\t\t\t\t\t\t:name=\"`item:prepend`\"\n\t\t\t\t\t\t\t\t:open=\"open\"\n\t\t\t\t\t\t\t\t:opening=\"opening\"\n\t\t\t\t\t\t\t\t:placement=\"placement\"\n\t\t\t\t\t\t\t\t:text=\"item.text\"\n\t\t\t\t\t\t\t></slot>\n\t\t\t\t\t\t\t<BaseButton\n\t\t\t\t\t\t\t\t:aria-role=\"'menuitem'\"\n\t\t\t\t\t\t\t\tclass=\"bb-dropdown__item\"\n\t\t\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t\t\t'bb-dropdown__item--first': index === 0,\n\t\t\t\t\t\t\t\t\t'bb-dropdown__item--last': index === items.length - 1,\n\t\t\t\t\t\t\t\t}\"\n\t\t\t\t\t\t\t\t:data-dropdown-item=\"true\"\n\t\t\t\t\t\t\t\tv-bind=\"item\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t\t:closed=\"closed\"\n\t\t\t\t\t\t\t\t\t:closing=\"closing\"\n\t\t\t\t\t\t\t\t\t:disabled=\"item.disabled\"\n\t\t\t\t\t\t\t\t\t:index=\"index\"\n\t\t\t\t\t\t\t\t\t:item=\"item\"\n\t\t\t\t\t\t\t\t\t:name=\"item.key\"\n\t\t\t\t\t\t\t\t\t:open=\"open\"\n\t\t\t\t\t\t\t\t\t:opening=\"opening\"\n\t\t\t\t\t\t\t\t\t:placement=\"placement\"\n\t\t\t\t\t\t\t\t\t:text=\"item.text\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t\t\t:closed=\"closed\"\n\t\t\t\t\t\t\t\t\t\t:closing=\"closing\"\n\t\t\t\t\t\t\t\t\t\t:disabled=\"item.disabled\"\n\t\t\t\t\t\t\t\t\t\t:index=\"index\"\n\t\t\t\t\t\t\t\t\t\t:item=\"item\"\n\t\t\t\t\t\t\t\t\t\tname=\"item\"\n\t\t\t\t\t\t\t\t\t\t:open=\"open\"\n\t\t\t\t\t\t\t\t\t\t:opening=\"opening\"\n\t\t\t\t\t\t\t\t\t\t:placement=\"placement\"\n\t\t\t\t\t\t\t\t\t\t:text=\"item.text\"\n\t\t\t\t\t\t\t\t\t></slot>\n\t\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t\t</BaseButton>\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:closed=\"closed\"\n\t\t\t\t\t\t\t\t:closing=\"closing\"\n\t\t\t\t\t\t\t\t:disabled=\"item.disabled\"\n\t\t\t\t\t\t\t\t:index=\"index\"\n\t\t\t\t\t\t\t\t:item=\"items[index]\"\n\t\t\t\t\t\t\t\t:name=\"`item:append`\"\n\t\t\t\t\t\t\t\t:open=\"open\"\n\t\t\t\t\t\t\t\t:opening=\"opening\"\n\t\t\t\t\t\t\t\t:placement=\"placement\"\n\t\t\t\t\t\t\t\t:text=\"item.text\"\n\t\t\t\t\t\t\t></slot>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</span>\n\t\t\t\t\t<slot\n\t\t\t\t\t\t:closed=\"closed\"\n\t\t\t\t\t\t:closing=\"closing\"\n\t\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t\tname=\"append\"\n\t\t\t\t\t\t:open=\"open\"\n\t\t\t\t\t\t:opening=\"opening\"\n\t\t\t\t\t\t:placement=\"placement\"\n\t\t\t\t\t></slot>\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t</teleport>\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from 'vue';\nimport { findRightIndex } from '@/utilities/functions/findRightIndex';\nimport {\n\tuseFloating,\n\tautoUpdate,\n\tflip,\n\tshift,\n\tarrow,\n\toffset,\n} from '@floating-ui/vue';\nimport { useId } from '@/composables/useId';\nimport { wait } from '@/utilities/functions/wait';\nimport { useIntersectionObserver } from '@vueuse/core';\nimport BaseButton from '../BaseButton/BaseButton.vue';\nimport selectors from 'focusable-selectors';\nimport type { BaseButtonProps } from '../BaseButton/BaseButton.vue';\nimport type { CommonProps } from '@/types/CommonProps';\n\nexport type BbDropdownProps = Pick<\n\tCommonProps,\n\t| 'arrowPadding'\n\t| 'block'\n\t| 'disabled'\n\t| 'eager'\n\t| 'id'\n\t| 'offset'\n\t| 'padding'\n\t| 'placement'\n\t| 'theme'\n\t| 'transitionDuration'\n> & {\n\t/**\n\t * Array used to render each dropdown button.\n\t * They can act as `button`, as `a`, or as `router-link`\n\t * as they are based on the functionality provided by\n\t * `BaseButton`\n\t */\n\titems: Item[];\n\t/**\n\t * Width of the dropdown in pixels.\n\t */\n\twidth?: number;\n};\n\ndefineSlots<\n\t{\n\t\tactivator?: (props: {\n\t\t\tprops: {\n\t\t\t\t'aria-expanded': boolean;\n\t\t\t\t'aria-controls': string;\n\t\t\t\tid: string;\n\t\t\t\tonClick: MappedItem['onClick'];\n\t\t\t\tonKeydown: MappedItem['onKeydown'];\n\t\t\t\tdisabled?: BbDropdownProps['disabled'];\n\t\t\t};\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: boolean;\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownProps['placement'];\n\t\t}) => any;\n\t\tprepend?: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: boolean;\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownProps['placement'];\n\t\t}) => any;\n\t\t'item:prepend'?: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: MappedItem['disabled'];\n\t\t\tindex: number;\n\t\t\titem: BbDropdownProps['items'][number];\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownProps['placement'];\n\t\t\ttext: MappedItem['text'];\n\t\t}) => any;\n\t\titem?: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: MappedItem['disabled'];\n\t\t\tindex: number;\n\t\t\titem: BbDropdownProps['items'][number];\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownProps['placement'];\n\t\t\ttext: MappedItem['text'];\n\t\t}) => any;\n\t\t'item:append'?: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: MappedItem['disabled'];\n\t\t\tindex: number;\n\t\t\titem: BbDropdownProps['items'][number];\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownProps['placement'];\n\t\t\ttext: MappedItem['text'];\n\t\t}) => any;\n\t\tappend?: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: boolean;\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownProps['placement'];\n\t\t}) => any;\n\t} & {\n\t\t[key: string]: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: MappedItem['disabled'];\n\t\t\tindex: number;\n\t\t\titem: BbDropdownProps['items'][number];\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownProps['placement'];\n\t\t\ttext: MappedItem['text'];\n\t\t}) => any;\n\t}\n>();\n\nexport type Item = Omit<BaseButtonProps, 'block' | 'tag' | 'type'> & {\n\t/**\n\t * Click handler of the item.\n\t */\n\tonClick?: (...args: any[]) => any;\n\t/**\n\t * Key used to identify the element.\n\t */\n\tkey: string;\n};\n\nexport type MappedItem = Item & {\n\t/**\n\t * Identifier of the element among it's siblings.\n\t */\n\tid: string;\n\t/**\n\t * Keydown event used to handle accessibility.\n\t */\n\tonKeydown: (event: KeyboardEvent) => void;\n};\n\nconst props = withDefaults(defineProps<BbDropdownProps>(), {\n\tarrowPadding: 10,\n\tplacement: 'bottom',\n\ttheme: 'default',\n\ttransitionDuration: 150,\n\twidth: 200,\n\tpadding: 6,\n\toffset: 3,\n});\n\nconst id = props.id ?? `bb_${useId().id.value}`;\n\nconst mappedItems = computed<MappedItem[]>(() => {\n\tlet firstFocusableIndex: number = props.items.findIndex((el) => !el.disabled);\n\tlet lastFocusableIndex: number = findRightIndex(\n\t\tprops.items,\n\t\t(item) => !item.disabled\n\t);\n\n\treturn props.items.map((item, index) => {\n\t\tconst itemid = `${id}-item-${item.key}`;\n\t\tconst { onClick: handler, ...rest } = item;\n\n\t\t/* Id a click handler has been passed close the dropdown\n\t\t * return focus and run the handler\n\t\t */\n\t\tconst onClick = async () => {\n\t\t\tawait closeDropdown();\n\t\t\tconst nextElement = document.querySelector(`#${id}`);\n\t\t\tif (!nextElement) return;\n\t\t\telse if (nextElement instanceof HTMLElement) {\n\t\t\t\tnextElement.focus();\n\t\t\t}\n\t\t\tif (handler) handler();\n\t\t};\n\n\t\t/**\n\t\t * On keydown\n\t\t * arrow down move to the next focusable element if it's not the last\n\t\t * arrow up move to the previous focusable element if it's not the first\n\t\t * on tab search the next focusable element after the button that opens the dropdown\n\t\t * if an element is found focus on that\n\t\t * (the menu is attached to body so it's not in order)\n\t\t */\n\t\tconst onKeydown = (event: KeyboardEvent) => {\n\t\t\tif (\n\t\t\t\tevent.target instanceof HTMLElement &&\n\t\t\t\tevent.target.dataset['dropdownItem']\n\t\t\t) {\n\t\t\t\tif (!content.value) return;\n\t\t\t\tif (event.key === 'ArrowDown') {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tif (content.value && index !== lastFocusableIndex) {\n\t\t\t\t\t\tconst option = content.value.querySelector(\n\t\t\t\t\t\t\tselectors.map((selector) => `#${itemid} ~ ${selector}`).join(',')\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (option && option instanceof HTMLElement) {\n\t\t\t\t\t\t\toption.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (event.key === 'ArrowUp') {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tif (content.value && index !== firstFocusableIndex) {\n\t\t\t\t\t\tconst indexOfPrevious = findRightIndex(props.items, (item, i) => {\n\t\t\t\t\t\t\treturn i < index && !item.disabled;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tconst options = Array.from(\n\t\t\t\t\t\t\tcontent.value.querySelectorAll(`.bb-dropdown__item`)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tconst option = options[indexOfPrevious];\n\n\t\t\t\t\t\tif (option && option instanceof HTMLElement) {\n\t\t\t\t\t\t\toption.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (event.key === 'Tab') {\n\t\t\t\t\tif (index === lastFocusableIndex && !event.shiftKey) {\n\t\t\t\t\t\tconst selector = selectors.join(',');\n\t\t\t\t\t\tconst focusableElements = Array.from(\n\t\t\t\t\t\t\tdocument.querySelectorAll(selector)\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst indexOfButton = focusableElements.findIndex(\n\t\t\t\t\t\t\t(el) => el.id === id\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst nextElement = focusableElements[indexOfButton + 1];\n\t\t\t\t\t\tif (!nextElement) return;\n\t\t\t\t\t\telse if (nextElement instanceof HTMLElement) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tcloseDropdown();\n\t\t\t\t\t\t\tnextElement.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (index === firstFocusableIndex && event.shiftKey) {\n\t\t\t\t\t\tconst nextElement = document.querySelector(`#${id}`);\n\t\t\t\t\t\tif (!nextElement) return;\n\t\t\t\t\t\telse if (nextElement instanceof HTMLElement) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tnextElement.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\treturn {\n\t\t\t...rest,\n\t\t\tdisabled: rest.disabled || props.disabled,\n\t\t\tid: itemid,\n\t\t\tonClick,\n\t\t\tonKeydown,\n\t\t};\n\t});\n});\n\nconst wrapper = ref<HTMLElement>();\nconst content = ref<HTMLElement>();\nconst bubblearrow = ref<HTMLElement>();\n\nconst { floatingStyles, placement, middlewareData } = useFloating(\n\twrapper,\n\tcontent,\n\t{\n\t\tplacement: props.placement,\n\t\twhileElementsMounted: autoUpdate,\n\t\tmiddleware: [\n\t\t\tflip(),\n\t\t\toffset(props.offset),\n\t\t\tshift({ padding: props.padding }),\n\t\t\tarrow({\n\t\t\t\telement: bubblearrow,\n\t\t\t\tpadding: props.arrowPadding,\n\t\t\t}),\n\t\t],\n\t}\n);\n\nuseIntersectionObserver(\n\twrapper,\n\t([{ intersectionRatio }]) => {\n\t\tif (intersectionRatio !== 1 && open.value) closeDropdown();\n\t},\n\t{ threshold: [0, 1] }\n);\n\nconst opening = ref(false);\nconst open = ref(false);\nconst closing = ref(false);\nconst closed = ref(true);\n\nconst arrowAttributes = computed(() => {\n\tif (middlewareData.value.arrow) {\n\t\tconst { x, y } = middlewareData.value.arrow;\n\t\treturn {\n\t\t\tstyle: {\n\t\t\t\tleft: `${x}px`,\n\t\t\t\ttop: `${y}px`,\n\t\t\t},\n\t\t};\n\t}\n\treturn undefined;\n});\n\n/* On click of the trigger attach elements */\nconst onClick = () => {\n\tif (opening.value || closing.value) return;\n\tif (open.value) {\n\t\tcloseDropdown();\n\t} else {\n\t\topenDropdown();\n\t}\n};\n\nconst onKeydown = async (event: KeyboardEvent) => {\n\tlet firstFocusableIndex: number = props.items.findIndex((el) => !el.disabled);\n\tlet lastFocusableIndex: number = findRightIndex(\n\t\tprops.items,\n\t\t(item) => !item.disabled\n\t);\n\tif (event.key === 'ArrowDown') {\n\t\tevent.preventDefault();\n\t\tif (closing.value || opening.value) return;\n\t\tif (closed.value) {\n\t\t\tawait openDropdown();\n\t\t}\n\t\tif (\n\t\t\tcontent.value &&\n\t\t\tmappedItems.value.length &&\n\t\t\tfirstFocusableIndex !== -1\n\t\t) {\n\t\t\tconst idToFocus = mappedItems.value[firstFocusableIndex].id;\n\t\t\tconst option = content.value.querySelector(`#${idToFocus}`);\n\t\t\tif (option && option instanceof HTMLElement) {\n\t\t\t\toption.focus();\n\t\t\t}\n\t\t}\n\t} else if (event.key === 'ArrowUp') {\n\t\tevent.preventDefault();\n\t\tif (closing.value || opening.value) return;\n\t\tif (closed.value) {\n\t\t\tawait openDropdown();\n\t\t}\n\t\tif (\n\t\t\tcontent.value &&\n\t\t\tmappedItems.value.length &&\n\t\t\tlastFocusableIndex !== -1\n\t\t) {\n\t\t\tconst idToFocus = mappedItems.value[lastFocusableIndex].id;\n\t\t\tconst option = content.value.querySelector(`#${idToFocus}`);\n\t\t\tif (option && option instanceof HTMLElement) {\n\t\t\t\toption.focus();\n\t\t\t}\n\t\t}\n\t} else if (event.key === 'Tab') {\n\t\tif (open.value && !event.shiftKey) {\n\t\t\tevent.preventDefault();\n\t\t\tif (\n\t\t\t\tcontent.value &&\n\t\t\t\tmappedItems.value.length &&\n\t\t\t\tfirstFocusableIndex !== -1\n\t\t\t) {\n\t\t\t\tconst idToFocus = mappedItems.value[firstFocusableIndex].id;\n\t\t\t\tconst option = content.value.querySelector(`#${idToFocus}`);\n\t\t\t\tif (option && option instanceof HTMLElement) {\n\t\t\t\t\toption.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\nconst onClickDocument = (event: Event) => {\n\tconst target = event.target;\n\tif (!target) return;\n\tif (target instanceof HTMLElement) {\n\t\tlet isOutside = true;\n\n\t\tif (wrapper.value) {\n\t\t\tif (wrapper.value.contains(target)) {\n\t\t\t\tisOutside = false;\n\t\t\t}\n\t\t}\n\t\tif (content.value) {\n\t\t\tif (content.value.contains(target)) {\n\t\t\t\tisOutside = false;\n\t\t\t}\n\t\t}\n\n\t\tif (isOutside) {\n\t\t\tcloseDropdown();\n\t\t}\n\t}\n};\n\nconst onDocumentFocus = (event: FocusEvent) => {\n\tconst target = event.target;\n\tif (!target) return;\n\tif (target instanceof HTMLElement) {\n\t\tlet isOutside = true;\n\n\t\tif (wrapper.value) {\n\t\t\tif (wrapper.value.contains(target)) {\n\t\t\t\tisOutside = false;\n\t\t\t}\n\t\t}\n\t\tif (content.value) {\n\t\t\tif (content.value.contains(target)) {\n\t\t\t\tisOutside = false;\n\t\t\t}\n\t\t}\n\n\t\tif (isOutside) {\n\t\t\tcloseDropdown();\n\t\t}\n\t}\n};\n\nconst onEsc = (event: KeyboardEvent) => {\n\tif (open.value) {\n\t\tif (event.key === 'Escape') {\n\t\t\tif (document.activeElement?.id !== id) {\n\t\t\t\tconst button = document.querySelector(`#${id}`);\n\t\t\t\tif (button instanceof HTMLElement) {\n\t\t\t\t\tbutton.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcloseDropdown();\n\t\t}\n\t}\n};\nconst hasOpenedOnce = ref(false);\nconst openDropdown = async () => {\n\thasOpenedOnce.value = true;\n\tclosed.value = false;\n\tclosing.value = false;\n\topening.value = true;\n\tawait wait(50);\n\topen.value = true;\n\topening.value = false;\n\t/* Attach listeners to document so we don't have to track them one by one */\n\tdocument.addEventListener('click', onClickDocument, { passive: true });\n\tdocument.addEventListener('focusin', onDocumentFocus, { passive: true });\n\tdocument.addEventListener('keydown', onEsc, { passive: true });\n};\n\nconst closeDropdown = async () => {\n\topen.value = false;\n\topening.value = false;\n\tclosing.value = true;\n\tawait wait(props.transitionDuration);\n\tclosing.value = false;\n\tclosed.value = true;\n\tdocument.removeEventListener('click', onClickDocument);\n\tdocument.removeEventListener('focusin', onDocumentFocus);\n\tdocument.removeEventListener('keydown', onEsc);\n};\n\nconst attributes = computed(() => {\n\tconst classes = {\n\t\t'bb-dropdown--block': props.block,\n\t\t[`bb-dropdown--theme-${props.theme}`]: props.theme,\n\t};\n\treturn {\n\t\tclass: classes,\n\t};\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbDropdown';\n</style>\n"],"names":["props","__props","id","useId","mappedItems","computed","firstFocusableIndex","el","lastFocusableIndex","findRightIndex","item","index","itemid","handler","rest","onClick","closeDropdown","nextElement","onKeydown","event","content","option","selectors","selector","indexOfPrevious","i","focusableElements","indexOfButton","wrapper","ref","bubblearrow","floatingStyles","placement","middlewareData","useFloating","autoUpdate","flip","offset","shift","arrow","useIntersectionObserver","intersectionRatio","open","opening","closing","closed","arrowAttributes","x","y","openDropdown","idToFocus","onClickDocument","target","isOutside","onDocumentFocus","onEsc","_a","button","hasOpenedOnce","wait","attributes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA8RA,UAAMA,IAAQC,GAURC,IAAKF,EAAM,MAAM,MAAMG,KAAQ,GAAG,KAAK,IAEvCC,IAAcC,EAAuB,MAAM;AAC5C,UAAAC,IAA8BN,EAAM,MAAM,UAAU,CAACO,MAAO,CAACA,EAAG,QAAQ,GACxEC,IAA6BC;AAAA,QAChCT,EAAM;AAAA,QACN,CAACU,MAAS,CAACA,EAAK;AAAA,MAAA;AAGjB,aAAOV,EAAM,MAAM,IAAI,CAACU,GAAMC,MAAU;AACvC,cAAMC,IAAS,GAAGV,CAAE,SAASQ,EAAK,GAAG,IAC/B,EAAE,SAASG,GAAS,GAAGC,MAASJ,GAKhCK,IAAU,YAAY;AAC3B,gBAAMC,EAAc;AACpB,gBAAMC,IAAc,SAAS,cAAc,IAAIf,CAAE,EAAE;AACnD,cAAKe,EAAa,CACTA,aAAuB,eAC/BA,EAAY,MAAM;AAAA,cAFD;AAI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