bitboss-ui 0.1.80 → 0.1.82
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/BaseButton/BaseButton.vue.d.ts +5 -2
- package/dist/components/BaseCheckbox/BaseCheckbox.vue.d.ts +3 -0
- package/dist/components/BaseCheckboxGroup/BaseCheckboxGroup.vue.d.ts +10 -2
- package/dist/components/BaseDatePicker/BaseDatePicker.vue.d.ts +3 -0
- package/dist/components/BaseDatePickerInput/BaseDatePickerInput.vue.d.ts +3 -0
- package/dist/components/BaseDialog/BaseDialog.vue.d.ts +3 -0
- package/dist/components/BaseInputContainer/BaseInputContainer.vue.d.ts +3 -0
- package/dist/components/BaseNumberInput/BaseNumberInput.vue.d.ts +4 -1
- package/dist/components/BaseRadioGroup/BaseRadioGroup.vue.d.ts +4 -1
- package/dist/components/BaseRating/BaseRating.vue.d.ts +4 -1
- package/dist/components/BaseSelect/BaseSelect.vue.d.ts +16 -2
- package/dist/components/BaseSlider/BaseSlider.vue.d.ts +3 -0
- package/dist/components/BaseSwitch/BaseSwitch.vue.d.ts +3 -0
- package/dist/components/BaseSwitchGroup/BaseSwitchGroup.vue.d.ts +3 -0
- package/dist/components/BaseTag/BaseTag.vue.d.ts +4 -1
- package/dist/components/BaseTextInput/BaseTextInput.vue.d.ts +4 -1
- package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +2 -2
- package/dist/components/BbAccordion/BbAccordion.vue.d.ts +5 -2
- package/dist/components/BbAlert/BbAlert.vue.d.ts +3 -0
- package/dist/components/BbAvatar/BbAvatar.vue.d.ts +7 -58
- package/dist/components/BbBadge/BbBadge.vue.d.ts +4 -1
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue.d.ts +3 -0
- package/dist/components/BbCheckbox/BbCheckbox.vue.d.ts +3 -0
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +3 -0
- package/dist/components/BbChip/BbChip.vue.d.ts +7 -1
- package/dist/components/BbCollapsible/BbCollapsible.vue.d.ts +4 -1
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +3 -0
- package/dist/components/BbDialog/BbDialog.vue.d.ts +3 -0
- package/dist/components/BbDropdown/BbDropdown.vue.d.ts +15 -3
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +4 -1
- package/dist/components/BbDropzone/BbDropzone.vue.d.ts +6 -7
- package/dist/components/BbIcon/BbIcon.vue.d.ts +3 -0
- package/dist/components/BbIntersection/BbIntersection.vue.d.ts +4 -1
- package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +3 -0
- package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +3 -0
- package/dist/components/BbPagination/BbPagination.vue.d.ts +4 -1
- package/dist/components/BbPopover/BbPopover.vue.d.ts +14 -7
- package/dist/components/BbProgress/BbProgress.vue.d.ts +3 -0
- package/dist/components/BbRadio/BbRadio.vue.d.ts +3 -0
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +1 -6
- package/dist/components/BbRating/BbRating.vue.d.ts +3 -0
- package/dist/components/BbRatio/BbRatio.vue.d.ts +4 -1
- package/dist/components/BbSelect/BbSelect.vue.d.ts +14 -3
- package/dist/components/BbSmoothHeight/BbSmoothHeight.vue.d.ts +5 -2
- package/dist/components/BbSpinner/BbSpinner.vue.d.ts +3 -0
- package/dist/components/BbSwitch/BbSwitch.vue.d.ts +3 -0
- package/dist/components/BbTab/BbTab.vue.d.ts +4 -1
- package/dist/components/BbTable/BbTable.vue.d.ts +258 -295
- package/dist/components/BbTable/types.d.ts +214 -0
- package/dist/components/BbTag/BbTag.vue.d.ts +3 -0
- package/dist/components/BbToast/BbToast.vue.d.ts +3 -0
- package/dist/components/BbToast/BbToastMessage.vue.d.ts +3 -0
- package/dist/components/BbTooltip/BbTooltip.vue.d.ts +8 -7
- package/dist/components/BbTree/BbTree.vue.d.ts +9 -1
- package/dist/composables/useItemText.d.ts +6 -1
- package/dist/index.d.ts +1 -1
- package/dist/index10.js +2 -2
- package/dist/index10.js.map +1 -1
- package/dist/index100.js +2 -2
- package/dist/index102.js +4 -3
- package/dist/index102.js.map +1 -1
- package/dist/index106.js +1 -1
- package/dist/index108.js +85 -57
- package/dist/index108.js.map +1 -1
- package/dist/index110.js +77 -55
- package/dist/index110.js.map +1 -1
- package/dist/index112.js +5 -5
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +1 -1
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +1 -1
- package/dist/index115.js +1 -1
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +1 -1
- package/dist/index118.js +1 -1
- package/dist/index12.js +8 -8
- package/dist/index120.js +1 -1
- package/dist/index121.js +11 -11
- package/dist/index121.js.map +1 -1
- package/dist/index14.js +9 -9
- package/dist/index16.js +3 -3
- package/dist/index18.js +2 -2
- package/dist/index189.js +2 -2
- package/dist/index189.js.map +1 -1
- package/dist/index190.js +2 -4
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +2 -2
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +3 -2
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +3 -2
- package/dist/index193.js.map +1 -1
- package/dist/index194.js +4 -3
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +3 -35
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +35 -6
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +6 -350
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +5 -134
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +16 -5
- package/dist/index199.js.map +1 -1
- package/dist/index20.js +1 -1
- package/dist/index20.js.map +1 -1
- package/dist/index200.js +15 -18
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +19 -2
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +18 -184
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +29 -23
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +8 -331
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +2 -2
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +351 -2
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +131 -13
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +2 -16
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +184 -18
- package/dist/index209.js.map +1 -1
- package/dist/index210.js +23 -29
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +369 -8
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +2 -3
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +2 -3
- package/dist/index213.js.map +1 -1
- package/dist/index216.js +73 -53
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +3 -3
- package/dist/index22.js +2 -2
- package/dist/index221.js +223 -10
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +252 -429
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +10 -8
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +428 -82
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +9 -8
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +88 -5
- package/dist/index226.js.map +1 -1
- package/dist/index235.js +2 -69
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +2 -162
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +2 -2
- package/dist/index238.js +2 -2
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +9 -2
- package/dist/index239.js.map +1 -1
- package/dist/index24.js +1 -1
- package/dist/index24.js.map +1 -1
- package/dist/index240.js +6 -2
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +162 -2
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +2 -2
- package/dist/index243.js +2 -224
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +68 -257
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +2 -38
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +38 -2
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +2 -2
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +2 -2
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +2 -2
- package/dist/index250.js +2 -2
- package/dist/index251.js +2 -2
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +5 -0
- package/dist/index252.js.map +1 -0
- package/dist/index26.js +3 -3
- package/dist/index26.js.map +1 -1
- package/dist/index28.js +172 -155
- package/dist/index28.js.map +1 -1
- package/dist/index30.js +2 -2
- package/dist/index32.js +2 -2
- package/dist/index34.js +2 -2
- package/dist/index34.js.map +1 -1
- package/dist/index36.js +21 -19
- package/dist/index36.js.map +1 -1
- package/dist/index38.js.map +1 -1
- package/dist/index44.js +1 -1
- package/dist/index44.js.map +1 -1
- package/dist/index46.js +1 -1
- package/dist/index46.js.map +1 -1
- package/dist/index6.js.map +1 -1
- package/dist/index62.js +168 -137
- package/dist/index62.js.map +1 -1
- package/dist/index64.js +38 -30
- package/dist/index64.js.map +1 -1
- package/dist/index66.js.map +1 -1
- package/dist/index69.js +1 -1
- package/dist/index72.js +1 -1
- package/dist/index74.js.map +1 -1
- package/dist/index76.js +96 -66
- package/dist/index76.js.map +1 -1
- package/dist/index78.js +1 -1
- package/dist/index8.js +2 -2
- package/dist/index82.js +2 -2
- package/dist/index82.js.map +1 -1
- package/dist/index84.js.map +1 -1
- package/dist/index88.js +7 -4
- package/dist/index88.js.map +1 -1
- package/dist/index96.js +2 -2
- package/dist/index96.js.map +1 -1
- package/dist/index98.js +35 -30
- package/dist/index98.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/CommonProps.d.ts +15 -8
- package/package.json +1 -1
package/dist/index62.js
CHANGED
@@ -1,73 +1,77 @@
|
|
1
|
-
import { defineComponent as
|
2
|
-
import { findRightIndex as
|
3
|
-
import { useFloating as
|
4
|
-
import { useId as
|
5
|
-
import { wait as
|
6
|
-
import
|
1
|
+
import { defineComponent as Y, computed as H, ref as v, openBlock as h, createElementBlock as D, mergeProps as S, createElementVNode as L, renderSlot as y, 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 I } from "./index215.js";
|
3
|
+
import { useFloating as re, arrow as ue } from "./index216.js";
|
4
|
+
import { useId as de } from "./index120.js";
|
5
|
+
import { wait as U } from "./index119.js";
|
6
|
+
import ce from "./index6.js";
|
7
7
|
import "./index7.js";
|
8
|
-
import
|
9
|
-
import { autoUpdate as
|
10
|
-
import { flip as
|
11
|
-
const
|
8
|
+
import V from "./index210.js";
|
9
|
+
import { autoUpdate as fe } from "./index206.js";
|
10
|
+
import { flip as pe, offset as be, shift as me } from "./index211.js";
|
11
|
+
const ve = ["aria-labelledby", "id"], we = { class: "bb-dropdown__items-container" }, Me = /* @__PURE__ */ Y({
|
12
12
|
__name: "BbDropdown",
|
13
13
|
props: {
|
14
|
+
arrowPadding: { default: 10 },
|
14
15
|
block: { type: Boolean },
|
15
16
|
disabled: { type: Boolean },
|
17
|
+
eager: { type: Boolean },
|
16
18
|
id: {},
|
19
|
+
offset: { default: 3 },
|
20
|
+
padding: { default: 6 },
|
17
21
|
placement: { default: "bottom" },
|
18
22
|
theme: { default: "default" },
|
19
23
|
transitionDuration: { default: 150 },
|
20
24
|
items: {},
|
21
25
|
width: { default: 200 }
|
22
26
|
},
|
23
|
-
setup(
|
24
|
-
const
|
25
|
-
let e =
|
26
|
-
|
27
|
-
(
|
27
|
+
setup(j) {
|
28
|
+
const a = j, b = a.id ?? `bb_${de().id.value}`, w = H(() => {
|
29
|
+
let e = a.items.findIndex((t) => !t.disabled), n = I(
|
30
|
+
a.items,
|
31
|
+
(t) => !t.disabled
|
28
32
|
);
|
29
|
-
return
|
30
|
-
const d = `${
|
31
|
-
await
|
32
|
-
const
|
33
|
-
if (
|
34
|
-
|
33
|
+
return a.items.map((t, o) => {
|
34
|
+
const d = `${b}-item-${t.key}`, { onClick: O, ...P } = t, W = async () => {
|
35
|
+
await _();
|
36
|
+
const s = document.querySelector(`#${b}`);
|
37
|
+
if (s)
|
38
|
+
s instanceof HTMLElement && s.focus();
|
35
39
|
else
|
36
40
|
return;
|
37
|
-
|
38
|
-
},
|
39
|
-
if (
|
41
|
+
O && O();
|
42
|
+
}, X = (s) => {
|
43
|
+
if (s.target instanceof HTMLElement && s.target.dataset.dropdownItem) {
|
40
44
|
if (!l.value)
|
41
45
|
return;
|
42
|
-
if (
|
43
|
-
if (
|
46
|
+
if (s.key === "ArrowDown") {
|
47
|
+
if (s.preventDefault(), l.value && o !== n) {
|
44
48
|
const p = l.value.querySelector(
|
45
|
-
|
49
|
+
V.map((k) => `#${d} ~ ${k}`).join(",")
|
46
50
|
);
|
47
51
|
p && p instanceof HTMLElement && p.focus();
|
48
52
|
}
|
49
|
-
} else if (
|
50
|
-
if (
|
51
|
-
const p =
|
53
|
+
} else if (s.key === "ArrowUp") {
|
54
|
+
if (s.preventDefault(), l.value && o !== e) {
|
55
|
+
const p = I(a.items, ($, M) => M < o && !$.disabled), E = Array.from(
|
52
56
|
l.value.querySelectorAll(".bb-dropdown__item")
|
53
57
|
)[p];
|
54
58
|
E && E instanceof HTMLElement && E.focus();
|
55
59
|
}
|
56
|
-
} else if (
|
57
|
-
if (
|
58
|
-
const p =
|
60
|
+
} else if (s.key === "Tab") {
|
61
|
+
if (o === n && !s.shiftKey) {
|
62
|
+
const p = V.join(","), k = Array.from(
|
59
63
|
document.querySelectorAll(p)
|
60
64
|
), E = k.findIndex(
|
61
|
-
(
|
62
|
-
),
|
63
|
-
if (
|
64
|
-
|
65
|
+
(M) => M.id === b
|
66
|
+
), $ = k[E + 1];
|
67
|
+
if ($)
|
68
|
+
$ instanceof HTMLElement && (s.preventDefault(), _(), $.focus());
|
65
69
|
else
|
66
70
|
return;
|
67
|
-
} else if (
|
68
|
-
const p = document.querySelector(`#${
|
71
|
+
} else if (o === e && s.shiftKey) {
|
72
|
+
const p = document.querySelector(`#${b}`);
|
69
73
|
if (p)
|
70
|
-
p instanceof HTMLElement && (
|
74
|
+
p instanceof HTMLElement && (s.preventDefault(), p.focus());
|
71
75
|
else
|
72
76
|
return;
|
73
77
|
}
|
@@ -75,86 +79,108 @@ const ue = ["aria-labelledby", "id"], de = /* @__PURE__ */ $("span", { class: "b
|
|
75
79
|
}
|
76
80
|
};
|
77
81
|
return {
|
78
|
-
...
|
79
|
-
disabled:
|
82
|
+
...P,
|
83
|
+
disabled: P.disabled || a.disabled,
|
80
84
|
id: d,
|
81
|
-
onClick:
|
82
|
-
onKeydown:
|
85
|
+
onClick: W,
|
86
|
+
onKeydown: X
|
83
87
|
};
|
84
88
|
});
|
85
|
-
}),
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
89
|
+
}), g = v(), l = v(), F = v(), { floatingStyles: R, placement: m, middlewareData: q } = re(
|
90
|
+
g,
|
91
|
+
l,
|
92
|
+
{
|
93
|
+
placement: a.placement,
|
94
|
+
whileElementsMounted: fe,
|
95
|
+
middleware: [
|
96
|
+
pe(),
|
97
|
+
be(a.offset),
|
98
|
+
me({ padding: a.padding }),
|
99
|
+
ue({
|
100
|
+
element: F,
|
101
|
+
padding: a.arrowPadding
|
102
|
+
})
|
103
|
+
]
|
104
|
+
}
|
105
|
+
), i = v(!1), r = v(!1), u = v(!1), f = v(!0), x = H(() => {
|
106
|
+
if (q.value.arrow) {
|
107
|
+
const { x: e, y: n } = q.value.arrow;
|
108
|
+
return {
|
109
|
+
style: {
|
110
|
+
left: `${e}px`,
|
111
|
+
top: `${n}px`
|
112
|
+
}
|
113
|
+
};
|
114
|
+
}
|
115
|
+
}), G = () => {
|
116
|
+
i.value || u.value || (r.value ? _() : T());
|
117
|
+
}, J = async (e) => {
|
118
|
+
let n = a.items.findIndex((o) => !o.disabled), t = I(
|
119
|
+
a.items,
|
120
|
+
(o) => !o.disabled
|
95
121
|
);
|
96
122
|
if (e.key === "ArrowDown") {
|
97
123
|
if (e.preventDefault(), u.value || i.value)
|
98
124
|
return;
|
99
|
-
if (f.value && await
|
100
|
-
const
|
125
|
+
if (f.value && await T(), l.value && w.value.length && n !== -1) {
|
126
|
+
const o = w.value[n].id, d = l.value.querySelector(`#${o}`);
|
101
127
|
d && d instanceof HTMLElement && d.focus();
|
102
128
|
}
|
103
129
|
} else if (e.key === "ArrowUp") {
|
104
130
|
if (e.preventDefault(), u.value || i.value)
|
105
131
|
return;
|
106
|
-
if (f.value && await
|
107
|
-
const
|
132
|
+
if (f.value && await T(), l.value && w.value.length && t !== -1) {
|
133
|
+
const o = w.value[t].id, d = l.value.querySelector(`#${o}`);
|
108
134
|
d && d instanceof HTMLElement && d.focus();
|
109
135
|
}
|
110
|
-
} else if (e.key === "Tab" && r.value && !e.shiftKey && (e.preventDefault(), l.value &&
|
111
|
-
const
|
136
|
+
} else if (e.key === "Tab" && r.value && !e.shiftKey && (e.preventDefault(), l.value && w.value.length && n !== -1)) {
|
137
|
+
const o = w.value[n].id, d = l.value.querySelector(`#${o}`);
|
112
138
|
d && d instanceof HTMLElement && d.focus();
|
113
139
|
}
|
114
|
-
},
|
140
|
+
}, A = (e) => {
|
115
141
|
const n = e.target;
|
116
142
|
if (n && n instanceof HTMLElement) {
|
117
|
-
let
|
118
|
-
|
143
|
+
let t = !0;
|
144
|
+
g.value && g.value.contains(n) && (t = !1), l.value && l.value.contains(n) && (t = !1), t && _();
|
119
145
|
}
|
120
|
-
},
|
146
|
+
}, C = (e) => {
|
121
147
|
const n = e.target;
|
122
148
|
if (n && n instanceof HTMLElement) {
|
123
|
-
let
|
124
|
-
|
149
|
+
let t = !0;
|
150
|
+
g.value && g.value.contains(n) && (t = !1), l.value && l.value.contains(n) && (t = !1), t && _();
|
125
151
|
}
|
126
|
-
},
|
152
|
+
}, B = (e) => {
|
127
153
|
var n;
|
128
154
|
if (r.value && e.key === "Escape") {
|
129
|
-
if (((n = document.activeElement) == null ? void 0 : n.id) !==
|
130
|
-
const
|
131
|
-
|
155
|
+
if (((n = document.activeElement) == null ? void 0 : n.id) !== b) {
|
156
|
+
const t = document.querySelector(`#${b}`);
|
157
|
+
t instanceof HTMLElement && t.focus();
|
132
158
|
}
|
133
|
-
|
159
|
+
_();
|
134
160
|
}
|
135
|
-
},
|
136
|
-
f.value = !1, u.value = !1, i.value = !0, await
|
137
|
-
},
|
138
|
-
r.value = !1, i.value = !1, u.value = !0, await
|
139
|
-
},
|
161
|
+
}, K = v(!1), T = async () => {
|
162
|
+
K.value = !0, f.value = !1, u.value = !1, i.value = !0, await U(50), r.value = !0, i.value = !1, document.addEventListener("click", A, { passive: !0 }), document.addEventListener("focusin", C, { passive: !0 }), document.addEventListener("keydown", B, { passive: !0 });
|
163
|
+
}, _ = async () => {
|
164
|
+
r.value = !1, i.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);
|
165
|
+
}, Q = H(() => ({
|
140
166
|
class: {
|
141
|
-
"bb-dropdown--block":
|
142
|
-
[`bb-dropdown--theme-${
|
167
|
+
"bb-dropdown--block": a.block,
|
168
|
+
[`bb-dropdown--theme-${a.theme}`]: a.theme
|
143
169
|
}
|
144
170
|
}));
|
145
|
-
return (e, n) => (
|
146
|
-
|
171
|
+
return (e, n) => (h(), D("span", S({ class: "bb-dropdown" }, Q.value), [
|
172
|
+
L("span", {
|
147
173
|
class: "bb-dropdown__wrapper",
|
148
174
|
ref_key: "wrapper",
|
149
|
-
ref:
|
175
|
+
ref: g
|
150
176
|
}, [
|
151
|
-
|
177
|
+
y(e.$slots, "activator", Z(ee({
|
152
178
|
props: {
|
153
179
|
"aria-expanded": r.value,
|
154
|
-
"aria-controls": `menu_${c(
|
155
|
-
id: c(
|
156
|
-
onClick:
|
157
|
-
onKeydown:
|
180
|
+
"aria-controls": `menu_${c(b)}`,
|
181
|
+
id: c(b),
|
182
|
+
onClick: G,
|
183
|
+
onKeydown: J,
|
158
184
|
disabled: e.disabled
|
159
185
|
},
|
160
186
|
closed: f.value,
|
@@ -162,13 +188,14 @@ const ue = ["aria-labelledby", "id"], de = /* @__PURE__ */ $("span", { class: "b
|
|
162
188
|
disabled: e.disabled,
|
163
189
|
open: r.value,
|
164
190
|
opening: i.value,
|
165
|
-
placement: c(
|
191
|
+
placement: c(m)
|
166
192
|
})))
|
167
193
|
], 512),
|
168
|
-
(
|
169
|
-
|
170
|
-
|
171
|
-
|
194
|
+
(h(), te(oe, { to: "body" }, [
|
195
|
+
K.value || e.eager ? (h(), D("span", {
|
196
|
+
key: 0,
|
197
|
+
class: ne(["bb-dropdown__bubble-container", {
|
198
|
+
[`bb-dropdown__bubble-container--${c(m)}`]: !0,
|
172
199
|
[`bb-dropdown__bubble-container--${e.theme}`]: e.theme,
|
173
200
|
"bb-dropdown__bubble-container--hidden": f.value,
|
174
201
|
"bb-dropdown__bubble-container--closing": u.value,
|
@@ -177,105 +204,109 @@ const ue = ["aria-labelledby", "id"], de = /* @__PURE__ */ $("span", { class: "b
|
|
177
204
|
}]),
|
178
205
|
ref_key: "content",
|
179
206
|
ref: l,
|
180
|
-
style:
|
181
|
-
...c(
|
182
|
-
transitionDuration: `${
|
207
|
+
style: z({
|
208
|
+
...c(R),
|
209
|
+
transitionDuration: `${a.transitionDuration}ms`
|
183
210
|
}),
|
184
|
-
"aria-labelledby": c(
|
211
|
+
"aria-labelledby": c(b),
|
185
212
|
"aria-role": "menu",
|
186
|
-
id: `menu_${c(
|
213
|
+
id: `menu_${c(b)}`
|
187
214
|
}, [
|
188
|
-
|
189
|
-
|
215
|
+
L("span", S({
|
216
|
+
class: "bb-dropdown__arrow",
|
217
|
+
ref_key: "bubblearrow",
|
218
|
+
ref: F
|
219
|
+
}, x.value), null, 16),
|
220
|
+
L("span", {
|
190
221
|
class: "bb-dropdown__bubble",
|
191
|
-
style:
|
222
|
+
style: z({ width: `${e.width}px` })
|
192
223
|
}, [
|
193
|
-
|
224
|
+
y(e.$slots, "prepend", {
|
194
225
|
closed: f.value,
|
195
226
|
closing: u.value,
|
196
227
|
disabled: e.disabled,
|
197
228
|
open: r.value,
|
198
229
|
opening: i.value,
|
199
|
-
placement: c(
|
230
|
+
placement: c(m)
|
200
231
|
}),
|
201
|
-
|
202
|
-
(
|
203
|
-
key:
|
232
|
+
L("span", we, [
|
233
|
+
(h(!0), D(N, null, ae(w.value, (t, o) => (h(), D(N, {
|
234
|
+
key: t.key
|
204
235
|
}, [
|
205
|
-
|
236
|
+
y(e.$slots, "item:prepend", {
|
206
237
|
closed: f.value,
|
207
238
|
closing: u.value,
|
208
|
-
disabled:
|
209
|
-
index:
|
210
|
-
item: e.items[
|
239
|
+
disabled: t.disabled,
|
240
|
+
index: o,
|
241
|
+
item: e.items[o],
|
211
242
|
open: r.value,
|
212
243
|
opening: i.value,
|
213
|
-
placement: c(
|
214
|
-
text:
|
244
|
+
placement: c(m),
|
245
|
+
text: t.text
|
215
246
|
}),
|
216
|
-
|
247
|
+
le(ce, S({
|
217
248
|
class: ["bb-dropdown__item", {
|
218
|
-
"bb-dropdown__item--first":
|
219
|
-
"bb-dropdown__item--last":
|
249
|
+
"bb-dropdown__item--first": o === 0,
|
250
|
+
"bb-dropdown__item--last": o === e.items.length - 1
|
220
251
|
}],
|
221
252
|
"aria-role": "menuitem",
|
222
253
|
"data-dropdown-item": !0
|
223
|
-
},
|
224
|
-
default:
|
225
|
-
|
254
|
+
}, t), {
|
255
|
+
default: se(() => [
|
256
|
+
y(e.$slots, t.key, {
|
226
257
|
closed: f.value,
|
227
258
|
closing: u.value,
|
228
|
-
disabled:
|
229
|
-
index:
|
230
|
-
item:
|
259
|
+
disabled: t.disabled,
|
260
|
+
index: o,
|
261
|
+
item: t,
|
231
262
|
open: r.value,
|
232
263
|
opening: i.value,
|
233
|
-
placement: c(
|
234
|
-
text:
|
264
|
+
placement: c(m),
|
265
|
+
text: t.text
|
235
266
|
}, () => [
|
236
|
-
|
267
|
+
y(e.$slots, "item", {
|
237
268
|
closed: f.value,
|
238
269
|
closing: u.value,
|
239
|
-
disabled:
|
240
|
-
index:
|
241
|
-
item:
|
270
|
+
disabled: t.disabled,
|
271
|
+
index: o,
|
272
|
+
item: t,
|
242
273
|
open: r.value,
|
243
274
|
opening: i.value,
|
244
|
-
placement: c(
|
245
|
-
text:
|
275
|
+
placement: c(m),
|
276
|
+
text: t.text
|
246
277
|
})
|
247
278
|
])
|
248
279
|
]),
|
249
280
|
_: 2
|
250
281
|
}, 1040, ["class"]),
|
251
|
-
|
282
|
+
y(e.$slots, "item:append", {
|
252
283
|
closed: f.value,
|
253
284
|
closing: u.value,
|
254
|
-
disabled:
|
255
|
-
index:
|
256
|
-
item: e.items[
|
285
|
+
disabled: t.disabled,
|
286
|
+
index: o,
|
287
|
+
item: e.items[o],
|
257
288
|
open: r.value,
|
258
289
|
opening: i.value,
|
259
|
-
placement: c(
|
260
|
-
text:
|
290
|
+
placement: c(m),
|
291
|
+
text: t.text
|
261
292
|
})
|
262
293
|
], 64))), 128))
|
263
294
|
]),
|
264
|
-
|
295
|
+
y(e.$slots, "append", {
|
265
296
|
disabled: e.disabled,
|
266
|
-
placement: c(
|
297
|
+
placement: c(m),
|
267
298
|
open: r.value,
|
268
299
|
opening: i.value,
|
269
300
|
closing: u.value,
|
270
301
|
closed: f.value
|
271
302
|
})
|
272
303
|
], 4)
|
273
|
-
], 14,
|
304
|
+
], 14, ve)) : ie("", !0)
|
274
305
|
]))
|
275
306
|
], 16));
|
276
307
|
}
|
277
308
|
});
|
278
309
|
export {
|
279
|
-
|
310
|
+
Me as default
|
280
311
|
};
|
281
312
|
//# sourceMappingURL=index62.js.map
|
package/dist/index62.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index62.js","sources":["../src/components/BbDropdown/BbDropdown.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderSlot as _renderSlot, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, mergeProps as _mergeProps, withCtx as _withCtx, createVNode as _createVNode, normalizeStyle as _normalizeStyle, normalizeClass as _normalizeClass, Teleport as _Teleport, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = [\"aria-labelledby\", \"id\"]\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"span\", { class: \"bb-dropdown__arrow\" }, null, -1)\nconst _hoisted_3 = { class: \"bb-dropdown__items-container\" }\n\nimport { computed, ref } from \"vue\";\nimport { findRightIndex } from \"@/utilities/functions/findRightIndex\";\nimport { useFloating, autoUpdate, flip, shift } from \"@floating-ui/vue\";\nimport { useId } from \"@/composables/useId\";\nimport { wait } from \"@/utilities/functions/wait\";\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 CommonProps,\n \"block\" | \"disabled\" | \"id\" | \"placement\" | \"theme\" | \"transitionDuration\"\n> & {\n /**\n * Array used to render each dropdown button.\n * They can act as `button`, as `a`, or as `router-link`\n * as they are based on the functionality provided by\n * `BaseButton`\n */\n items: Item[];\n /**\n * Width of the dropdown in pixels.\n */\n width?: number;\n};\n\nexport type Item = Omit<BaseButtonProps, \"block\" | \"tag\" | \"type\"> & {\n /**\n * Click handler of the item.\n */\n onClick?: (...args: any[]) => any;\n /**\n * Key used to identify the element.\n */\n key: string;\n};\n\nexport type MappedItem = Item & {\n /**\n * Identifier of the element among it's siblings.\n */\n id: string;\n /**\n * Keydown event used to handle accessibility.\n */\n onKeydown: (event: KeyboardEvent) => void;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbDropdown',\n props: {\n block: { type: Boolean },\n disabled: { type: Boolean },\n id: {},\n placement: { default: \"bottom\" },\n theme: { default: \"default\" },\n transitionDuration: { default: 150 },\n items: {},\n width: { default: 200 }\n },\n setup(__props: any) {\n\n\n\nconst props = __props;\n\nconst id = props.id ?? `bb_${useId().id.value}`;\n\nconst mappedItems = computed<MappedItem[]>(() => {\n let firstFocusableIndex: number = props.items.findIndex((el) => !el.disabled);\n let lastFocusableIndex: number = findRightIndex(\n props.items,\n (item) => !item.disabled\n );\n\n return props.items.map((item, index) => {\n const itemid = `${id}-item-${item.key}`;\n const { onClick: handler, ...rest } = item;\n\n /* Id a click handler has been passed close the dropdown\n * return focus and run the handler\n */\n const onClick = async () => {\n await closeDropdown();\n const nextElement = document.querySelector(`#${id}`);\n if (!nextElement) return;\n else if (nextElement instanceof HTMLElement) {\n nextElement.focus();\n }\n if (handler) handler();\n };\n\n /**\n * On keydown\n * arrow down move to the next focusable element if it's not the last\n * arrow up move to the previous focusable element if it's not the first\n * on tab search the next focusable element after the button that opens the dropdown\n * if an element is found focus on that\n * (the menu is attached to body so it's not in order)\n */\n const onKeydown = (event: KeyboardEvent) => {\n if (\n event.target instanceof HTMLElement &&\n event.target.dataset[\"dropdownItem\"]\n ) {\n if (!content.value) return;\n if (event.key === \"ArrowDown\") {\n event.preventDefault();\n if (content.value && index !== lastFocusableIndex) {\n const option = content.value.querySelector(\n selectors.map((selector) => `#${itemid} ~ ${selector}`).join(\",\")\n );\n if (option && option instanceof HTMLElement) {\n option.focus();\n }\n }\n } else if (event.key === \"ArrowUp\") {\n event.preventDefault();\n if (content.value && index !== firstFocusableIndex) {\n const indexOfPrevious = findRightIndex(props.items, (item, i) => {\n return i < index && !item.disabled;\n });\n\n const options = Array.from(\n content.value.querySelectorAll(`.bb-dropdown__item`)\n );\n\n const option = options[indexOfPrevious];\n\n if (option && option instanceof HTMLElement) {\n option.focus();\n }\n }\n } else if (event.key === \"Tab\") {\n if (index === lastFocusableIndex && !event.shiftKey) {\n const selector = selectors.join(\",\");\n const focusableElements = Array.from(\n document.querySelectorAll(selector)\n );\n const indexOfButton = focusableElements.findIndex(\n (el) => el.id === id\n );\n const nextElement = focusableElements[indexOfButton + 1];\n if (!nextElement) return;\n else if (nextElement instanceof HTMLElement) {\n event.preventDefault();\n closeDropdown();\n nextElement.focus();\n }\n } else if (index === firstFocusableIndex && event.shiftKey) {\n const nextElement = document.querySelector(`#${id}`);\n if (!nextElement) return;\n else if (nextElement instanceof HTMLElement) {\n event.preventDefault();\n nextElement.focus();\n }\n }\n }\n }\n };\n\n return {\n ...rest,\n disabled: rest.disabled || props.disabled,\n id: itemid,\n onClick,\n onKeydown,\n };\n });\n});\n\nconst wrapper = ref<HTMLElement>();\nconst content = ref<HTMLElement>();\n\nconst { floatingStyles, placement } = useFloating(wrapper, content, {\n placement: props.placement,\n whileElementsMounted: autoUpdate,\n middleware: [flip(), shift({ padding: 6 })],\n});\n\nconst opening = ref(false);\nconst open = ref(false);\nconst closing = ref(false);\nconst closed = ref(true);\n\n/* On click of the trigger attach elements */\nconst onClick = () => {\n if (opening.value || closing.value) return;\n if (open.value) {\n closeDropdown();\n } else {\n openDropdown();\n }\n};\n\nconst onKeydown = async (event: KeyboardEvent) => {\n let firstFocusableIndex: number = props.items.findIndex((el) => !el.disabled);\n let lastFocusableIndex: number = findRightIndex(\n props.items,\n (item) => !item.disabled\n );\n if (event.key === \"ArrowDown\") {\n event.preventDefault();\n if (closing.value || opening.value) return;\n if (closed.value) {\n await openDropdown();\n }\n if (\n content.value &&\n mappedItems.value.length &&\n firstFocusableIndex !== -1\n ) {\n const idToFocus = mappedItems.value[firstFocusableIndex].id;\n const option = content.value.querySelector(`#${idToFocus}`);\n if (option && option instanceof HTMLElement) {\n option.focus();\n }\n }\n } else if (event.key === \"ArrowUp\") {\n event.preventDefault();\n if (closing.value || opening.value) return;\n if (closed.value) {\n await openDropdown();\n }\n if (\n content.value &&\n mappedItems.value.length &&\n lastFocusableIndex !== -1\n ) {\n const idToFocus = mappedItems.value[lastFocusableIndex].id;\n const option = content.value.querySelector(`#${idToFocus}`);\n if (option && option instanceof HTMLElement) {\n option.focus();\n }\n }\n } else if (event.key === \"Tab\") {\n if (open.value && !event.shiftKey) {\n event.preventDefault();\n if (\n content.value &&\n mappedItems.value.length &&\n firstFocusableIndex !== -1\n ) {\n const idToFocus = mappedItems.value[firstFocusableIndex].id;\n const option = content.value.querySelector(`#${idToFocus}`);\n if (option && option instanceof HTMLElement) {\n option.focus();\n }\n }\n }\n }\n};\n\nconst onClickDocument = (event: Event) => {\n const target = event.target;\n if (!target) return;\n if (target instanceof HTMLElement) {\n let isOutside = true;\n\n if (wrapper.value) {\n if (wrapper.value.contains(target)) {\n isOutside = false;\n }\n }\n if (content.value) {\n if (content.value.contains(target)) {\n isOutside = false;\n }\n }\n\n if (isOutside) {\n closeDropdown();\n }\n }\n};\n\nconst onDocumentFocus = (event: FocusEvent) => {\n const target = event.target;\n if (!target) return;\n if (target instanceof HTMLElement) {\n let isOutside = true;\n\n if (wrapper.value) {\n if (wrapper.value.contains(target)) {\n isOutside = false;\n }\n }\n if (content.value) {\n if (content.value.contains(target)) {\n isOutside = false;\n }\n }\n\n if (isOutside) {\n closeDropdown();\n }\n }\n};\n\nconst onEsc = (event: KeyboardEvent) => {\n if (open.value) {\n if (event.key === \"Escape\") {\n if (document.activeElement?.id !== id) {\n const button = document.querySelector(`#${id}`);\n if (button instanceof HTMLElement) {\n button.focus();\n }\n }\n closeDropdown();\n }\n }\n};\n\nconst openDropdown = async () => {\n closed.value = false;\n closing.value = false;\n opening.value = true;\n await wait(50);\n open.value = true;\n opening.value = false;\n /* Attach listeners to document so we don't have to track them one by one */\n document.addEventListener(\"click\", onClickDocument, { passive: true });\n document.addEventListener(\"focusin\", onDocumentFocus, { passive: true });\n document.addEventListener(\"keydown\", onEsc, { passive: true });\n};\n\nconst closeDropdown = async () => {\n open.value = false;\n opening.value = false;\n closing.value = true;\n await wait(props.transitionDuration);\n closing.value = false;\n closed.value = true;\n document.removeEventListener(\"click\", onClickDocument);\n document.removeEventListener(\"focusin\", onDocumentFocus);\n document.removeEventListener(\"keydown\", onEsc);\n};\n\nconst attributes = computed(() => {\n const classes = {\n \"bb-dropdown--block\": props.block,\n [`bb-dropdown--theme-${props.theme}`]: props.theme,\n };\n return {\n class: classes,\n };\n});\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", _mergeProps({ class: \"bb-dropdown\" }, attributes.value), [\n _createElementVNode(\"span\", {\n class: \"bb-dropdown__wrapper\",\n ref_key: \"wrapper\",\n ref: wrapper\n }, [\n _renderSlot(_ctx.$slots, \"activator\", _normalizeProps(_guardReactiveProps({\n props: {\n 'aria-expanded': open.value,\n 'aria-controls': `menu_${_unref(id)}`,\n id: _unref(id),\n onClick: onClick,\n onKeydown: onKeydown,\n disabled: _ctx.disabled,\n },\n closed: closed.value,\n closing: closing.value,\n disabled: _ctx.disabled,\n open: open.value,\n opening: opening.value,\n placement: _unref(placement),\n })))\n ], 512),\n (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n _createElementVNode(\"span\", {\n class: _normalizeClass([\"bb-dropdown__bubble-container\", {\n [`bb-dropdown__bubble-container--${_unref(placement)}`]: true,\n [`bb-dropdown__bubble-container--${_ctx.theme}`]: _ctx.theme,\n 'bb-dropdown__bubble-container--hidden': closed.value,\n 'bb-dropdown__bubble-container--closing': closing.value,\n 'bb-dropdown__bubble-container--opening': opening.value,\n 'bb-dropdown__bubble-container--open': open.value,\n }]),\n ref_key: \"content\",\n ref: content,\n style: _normalizeStyle({\n ..._unref(floatingStyles),\n transitionDuration: `${props.transitionDuration}ms`,\n }),\n \"aria-labelledby\": _unref(id),\n \"aria-role\": \"menu\",\n id: `menu_${_unref(id)}`\n }, [\n _hoisted_2,\n _createElementVNode(\"span\", {\n class: \"bb-dropdown__bubble\",\n style: _normalizeStyle({ width: `${_ctx.width}px` })\n }, [\n _renderSlot(_ctx.$slots, \"prepend\", {\n closed: closed.value,\n closing: closing.value,\n disabled: _ctx.disabled,\n open: open.value,\n opening: opening.value,\n placement: _unref(placement)\n }),\n _createElementVNode(\"span\", _hoisted_3, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(mappedItems.value, (item, index) => {\n return (_openBlock(), _createElementBlock(_Fragment, {\n key: item.key\n }, [\n _renderSlot(_ctx.$slots, `item:prepend`, {\n closed: closed.value,\n closing: closing.value,\n disabled: item.disabled,\n index: index,\n item: _ctx.items[index],\n open: open.value,\n opening: opening.value,\n placement: _unref(placement),\n text: item.text\n }),\n _createVNode(BaseButton, _mergeProps({\n class: [\"bb-dropdown__item\", {\n 'bb-dropdown__item--first': index === 0,\n 'bb-dropdown__item--last': index === _ctx.items.length - 1,\n }],\n \"aria-role\": 'menuitem',\n \"data-dropdown-item\": true\n }, item), {\n default: _withCtx(() => [\n _renderSlot(_ctx.$slots, item.key, {\n closed: closed.value,\n closing: closing.value,\n disabled: item.disabled,\n index: index,\n item: item,\n open: open.value,\n opening: opening.value,\n placement: _unref(placement),\n text: item.text\n }, () => [\n _renderSlot(_ctx.$slots, \"item\", {\n closed: closed.value,\n closing: closing.value,\n disabled: item.disabled,\n index: index,\n item: item,\n open: open.value,\n opening: opening.value,\n placement: _unref(placement),\n text: item.text\n })\n ])\n ]),\n _: 2\n }, 1040, [\"class\"]),\n _renderSlot(_ctx.$slots, `item:append`, {\n closed: closed.value,\n closing: closing.value,\n disabled: item.disabled,\n index: index,\n item: _ctx.items[index],\n open: open.value,\n opening: opening.value,\n placement: _unref(placement),\n text: item.text\n })\n ], 64))\n }), 128))\n ]),\n _renderSlot(_ctx.$slots, \"append\", {\n disabled: _ctx.disabled,\n placement: _unref(placement),\n open: open.value,\n opening: opening.value,\n closing: closing.value,\n closed: closed.value\n })\n ], 4)\n ], 14, _hoisted_1)\n ]))\n ], 16))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_sfc_main","_defineComponent","__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","floatingStyles","placement","useFloating","autoUpdate","flip","shift","opening","open","closing","closed","openDropdown","idToFocus","onClickDocument","target","isOutside","onDocumentFocus","onEsc","_a","button","wait","attributes","_ctx","_cache","_openBlock","_createElementBlock","_mergeProps","_createElementVNode","_renderSlot","_normalizeProps","_guardReactiveProps","_unref","_createBlock","_Teleport","_normalizeClass","_normalizeStyle","_Fragment","_renderList","_createVNode","BaseButton","_withCtx"],"mappings":";;;;;;;;;;AAGA,MAAMA,KAAa,CAAC,mBAAmB,IAAI,GACrCC,uBAA8C,QAAQ,EAAE,OAAO,wBAAwB,MAAM,EAAE,GAC/FC,KAAa,EAAE,OAAO,kCAoDAC,KAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,OAAO,EAAE,MAAM,QAAQ;AAAA,IACvB,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC1B,IAAI,CAAC;AAAA,IACL,WAAW,EAAE,SAAS,SAAS;AAAA,IAC/B,OAAO,EAAE,SAAS,UAAU;AAAA,IAC5B,oBAAoB,EAAE,SAAS,IAAI;AAAA,IACnC,OAAO,CAAC;AAAA,IACR,OAAO,EAAE,SAAS,IAAI;AAAA,EACxB;AAAA,EACA,MAAMC,GAAc;AAItB,UAAMC,IAAQD,GAERE,IAAKD,EAAM,MAAM,MAAME,KAAQ,GAAG,KAAK,IAEvCC,IAAcC,EAAuB,MAAM;AAC3C,UAAAC,IAA8BL,EAAM,MAAM,UAAU,CAACM,MAAO,CAACA,EAAG,QAAQ,GACxEC,IAA6BC;AAAA,QAC/BR,EAAM;AAAA,QACN,CAACS,MAAS,CAACA,EAAK;AAAA,MAAA;AAGlB,aAAOT,EAAM,MAAM,IAAI,CAACS,GAAMC,MAAU;AACtC,cAAMC,IAAS,GAAGV,CAAE,SAASQ,EAAK,GAAG,IAC/B,EAAE,SAASG,GAAS,GAAGC,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AWS,EAAO7B,CAAS;AAAA,cAC3B,MAAMM,EAAK;AAAA,cACX,SAASD,EAAQ;AAAA,cACjB,SAASE,EAAQ;AAAA,cACjB,QAAQC,EAAO;AAAA,YAAA,CAChB;AAAA,aACA,CAAC;AAAA,QAAA,GACH,IAAI5C,EAAU;AAAA,MAAA,CAClB;AAAA,OACA,EAAE;AAAA,EAEP;AAEA,CAAC;"}
|
1
|
+
{"version":3,"file":"index62.js","sources":["../src/components/BbDropdown/BbDropdown.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderSlot as _renderSlot, createElementVNode as _createElementVNode, mergeProps as _mergeProps, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, withCtx as _withCtx, createVNode as _createVNode, normalizeStyle as _normalizeStyle, normalizeClass as _normalizeClass, createCommentVNode as _createCommentVNode, Teleport as _Teleport, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = [\"aria-labelledby\", \"id\"]\nconst _hoisted_2 = { class: \"bb-dropdown__items-container\" }\n\nimport { computed, ref } from \"vue\";\nimport { findRightIndex } from \"@/utilities/functions/findRightIndex\";\nimport {\n useFloating,\n autoUpdate,\n flip,\n shift,\n arrow,\n offset,\n} from \"@floating-ui/vue\";\nimport { useId } from \"@/composables/useId\";\nimport { wait } from \"@/utilities/functions/wait\";\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 CommonProps,\n | \"arrowPadding\"\n | \"block\"\n | \"disabled\"\n | \"eager\"\n | \"id\"\n | \"offset\"\n | \"padding\"\n | \"placement\"\n | \"theme\"\n | \"transitionDuration\"\n> & {\n /**\n * Array used to render each dropdown button.\n * They can act as `button`, as `a`, or as `router-link`\n * as they are based on the functionality provided by\n * `BaseButton`\n */\n items: Item[];\n /**\n * Width of the dropdown in pixels.\n */\n width?: number;\n};\n\nexport type Item = Omit<BaseButtonProps, \"block\" | \"tag\" | \"type\"> & {\n /**\n * Click handler of the item.\n */\n onClick?: (...args: any[]) => any;\n /**\n * Key used to identify the element.\n */\n key: string;\n};\n\nexport type MappedItem = Item & {\n /**\n * Identifier of the element among it's siblings.\n */\n id: string;\n /**\n * Keydown event used to handle accessibility.\n */\n onKeydown: (event: KeyboardEvent) => void;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbDropdown',\n props: {\n arrowPadding: { default: 10 },\n block: { type: Boolean },\n disabled: { type: Boolean },\n eager: { type: Boolean },\n id: {},\n offset: { default: 3 },\n padding: { default: 6 },\n placement: { default: \"bottom\" },\n theme: { default: \"default\" },\n transitionDuration: { default: 150 },\n items: {},\n width: { default: 200 }\n },\n setup(__props: any) {\n\n\n\nconst props = __props;\n\nconst id = props.id ?? `bb_${useId().id.value}`;\n\nconst mappedItems = computed<MappedItem[]>(() => {\n let firstFocusableIndex: number = props.items.findIndex((el) => !el.disabled);\n let lastFocusableIndex: number = findRightIndex(\n props.items,\n (item) => !item.disabled\n );\n\n return props.items.map((item, index) => {\n const itemid = `${id}-item-${item.key}`;\n const { onClick: handler, ...rest } = item;\n\n /* Id a click handler has been passed close the dropdown\n * return focus and run the handler\n */\n const onClick = async () => {\n await closeDropdown();\n const nextElement = document.querySelector(`#${id}`);\n if (!nextElement) return;\n else if (nextElement instanceof HTMLElement) {\n nextElement.focus();\n }\n if (handler) handler();\n };\n\n /**\n * On keydown\n * arrow down move to the next focusable element if it's not the last\n * arrow up move to the previous focusable element if it's not the first\n * on tab search the next focusable element after the button that opens the dropdown\n * if an element is found focus on that\n * (the menu is attached to body so it's not in order)\n */\n const onKeydown = (event: KeyboardEvent) => {\n if (\n event.target instanceof HTMLElement &&\n event.target.dataset[\"dropdownItem\"]\n ) {\n if (!content.value) return;\n if (event.key === \"ArrowDown\") {\n event.preventDefault();\n if (content.value && index !== lastFocusableIndex) {\n const option = content.value.querySelector(\n selectors.map((selector) => `#${itemid} ~ ${selector}`).join(\",\")\n );\n if (option && option instanceof HTMLElement) {\n option.focus();\n }\n }\n } else if (event.key === \"ArrowUp\") {\n event.preventDefault();\n if (content.value && index !== firstFocusableIndex) {\n const indexOfPrevious = findRightIndex(props.items, (item, i) => {\n return i < index && !item.disabled;\n });\n\n const options = Array.from(\n content.value.querySelectorAll(`.bb-dropdown__item`)\n );\n\n const option = options[indexOfPrevious];\n\n if (option && option instanceof HTMLElement) {\n option.focus();\n }\n }\n } else if (event.key === \"Tab\") {\n if (index === lastFocusableIndex && !event.shiftKey) {\n const selector = selectors.join(\",\");\n const focusableElements = Array.from(\n document.querySelectorAll(selector)\n );\n const indexOfButton = focusableElements.findIndex(\n (el) => el.id === id\n );\n const nextElement = focusableElements[indexOfButton + 1];\n if (!nextElement) return;\n else if (nextElement instanceof HTMLElement) {\n event.preventDefault();\n closeDropdown();\n nextElement.focus();\n }\n } else if (index === firstFocusableIndex && event.shiftKey) {\n const nextElement = document.querySelector(`#${id}`);\n if (!nextElement) return;\n else if (nextElement instanceof HTMLElement) {\n event.preventDefault();\n nextElement.focus();\n }\n }\n }\n }\n };\n\n return {\n ...rest,\n disabled: rest.disabled || props.disabled,\n id: itemid,\n onClick,\n onKeydown,\n };\n });\n});\n\nconst wrapper = ref<HTMLElement>();\nconst content = ref<HTMLElement>();\nconst bubblearrow = ref<HTMLElement>();\n\nconst { floatingStyles, placement, middlewareData } = useFloating(\n wrapper,\n content,\n {\n placement: props.placement,\n whileElementsMounted: autoUpdate,\n middleware: [\n flip(),\n offset(props.offset),\n shift({ padding: props.padding }),\n arrow({\n element: bubblearrow,\n padding: props.arrowPadding,\n }),\n ],\n }\n);\n\nconst opening = ref(false);\nconst open = ref(false);\nconst closing = ref(false);\nconst closed = ref(true);\n\nconst arrowAttributes = computed(() => {\n if (middlewareData.value.arrow) {\n const { x, y } = middlewareData.value.arrow;\n return {\n style: {\n left: `${x}px`,\n top: `${y}px`,\n },\n };\n }\n});\n\n/* On click of the trigger attach elements */\nconst onClick = () => {\n if (opening.value || closing.value) return;\n if (open.value) {\n closeDropdown();\n } else {\n openDropdown();\n }\n};\n\nconst onKeydown = async (event: KeyboardEvent) => {\n let firstFocusableIndex: number = props.items.findIndex((el) => !el.disabled);\n let lastFocusableIndex: number = findRightIndex(\n props.items,\n (item) => !item.disabled\n );\n if (event.key === \"ArrowDown\") {\n event.preventDefault();\n if (closing.value || opening.value) return;\n if (closed.value) {\n await openDropdown();\n }\n if (\n content.value &&\n mappedItems.value.length &&\n firstFocusableIndex !== -1\n ) {\n const idToFocus = mappedItems.value[firstFocusableIndex].id;\n const option = content.value.querySelector(`#${idToFocus}`);\n if (option && option instanceof HTMLElement) {\n option.focus();\n }\n }\n } else if (event.key === \"ArrowUp\") {\n event.preventDefault();\n if (closing.value || opening.value) return;\n if (closed.value) {\n await openDropdown();\n }\n if (\n content.value &&\n mappedItems.value.length &&\n lastFocusableIndex !== -1\n ) {\n const idToFocus = mappedItems.value[lastFocusableIndex].id;\n const option = content.value.querySelector(`#${idToFocus}`);\n if (option && option instanceof HTMLElement) {\n option.focus();\n }\n }\n } else if (event.key === \"Tab\") {\n if (open.value && !event.shiftKey) {\n event.preventDefault();\n if (\n content.value &&\n mappedItems.value.length &&\n firstFocusableIndex !== -1\n ) {\n const idToFocus = mappedItems.value[firstFocusableIndex].id;\n const option = content.value.querySelector(`#${idToFocus}`);\n if (option && option instanceof HTMLElement) {\n option.focus();\n }\n }\n }\n }\n};\n\nconst onClickDocument = (event: Event) => {\n const target = event.target;\n if (!target) return;\n if (target instanceof HTMLElement) {\n let isOutside = true;\n\n if (wrapper.value) {\n if (wrapper.value.contains(target)) {\n isOutside = false;\n }\n }\n if (content.value) {\n if (content.value.contains(target)) {\n isOutside = false;\n }\n }\n\n if (isOutside) {\n closeDropdown();\n }\n }\n};\n\nconst onDocumentFocus = (event: FocusEvent) => {\n const target = event.target;\n if (!target) return;\n if (target instanceof HTMLElement) {\n let isOutside = true;\n\n if (wrapper.value) {\n if (wrapper.value.contains(target)) {\n isOutside = false;\n }\n }\n if (content.value) {\n if (content.value.contains(target)) {\n isOutside = false;\n }\n }\n\n if (isOutside) {\n closeDropdown();\n }\n }\n};\n\nconst onEsc = (event: KeyboardEvent) => {\n if (open.value) {\n if (event.key === \"Escape\") {\n if (document.activeElement?.id !== id) {\n const button = document.querySelector(`#${id}`);\n if (button instanceof HTMLElement) {\n button.focus();\n }\n }\n closeDropdown();\n }\n }\n};\nconst hasOpenedOnce = ref(false);\nconst openDropdown = async () => {\n hasOpenedOnce.value = true;\n closed.value = false;\n closing.value = false;\n opening.value = true;\n await wait(50);\n open.value = true;\n opening.value = false;\n /* Attach listeners to document so we don't have to track them one by one */\n document.addEventListener(\"click\", onClickDocument, { passive: true });\n document.addEventListener(\"focusin\", onDocumentFocus, { passive: true });\n document.addEventListener(\"keydown\", onEsc, { passive: true });\n};\n\nconst closeDropdown = async () => {\n open.value = false;\n opening.value = false;\n closing.value = true;\n await wait(props.transitionDuration);\n closing.value = false;\n closed.value = true;\n document.removeEventListener(\"click\", onClickDocument);\n document.removeEventListener(\"focusin\", onDocumentFocus);\n document.removeEventListener(\"keydown\", onEsc);\n};\n\nconst attributes = computed(() => {\n const classes = {\n \"bb-dropdown--block\": props.block,\n [`bb-dropdown--theme-${props.theme}`]: props.theme,\n };\n return {\n class: classes,\n };\n});\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", _mergeProps({ class: \"bb-dropdown\" }, attributes.value), [\n _createElementVNode(\"span\", {\n class: \"bb-dropdown__wrapper\",\n ref_key: \"wrapper\",\n ref: wrapper\n }, [\n _renderSlot(_ctx.$slots, \"activator\", _normalizeProps(_guardReactiveProps({\n props: {\n 'aria-expanded': open.value,\n 'aria-controls': `menu_${_unref(id)}`,\n id: _unref(id),\n onClick: onClick,\n onKeydown: onKeydown,\n disabled: _ctx.disabled,\n },\n closed: closed.value,\n closing: closing.value,\n disabled: _ctx.disabled,\n open: open.value,\n opening: opening.value,\n placement: _unref(placement),\n })))\n ], 512),\n (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n (hasOpenedOnce.value || _ctx.eager)\n ? (_openBlock(), _createElementBlock(\"span\", {\n key: 0,\n class: _normalizeClass([\"bb-dropdown__bubble-container\", {\n [`bb-dropdown__bubble-container--${_unref(placement)}`]: true,\n [`bb-dropdown__bubble-container--${_ctx.theme}`]: _ctx.theme,\n 'bb-dropdown__bubble-container--hidden': closed.value,\n 'bb-dropdown__bubble-container--closing': closing.value,\n 'bb-dropdown__bubble-container--opening': opening.value,\n 'bb-dropdown__bubble-container--open': open.value,\n }]),\n ref_key: \"content\",\n ref: content,\n style: _normalizeStyle({\n ..._unref(floatingStyles),\n transitionDuration: `${props.transitionDuration}ms`,\n }),\n \"aria-labelledby\": _unref(id),\n \"aria-role\": \"menu\",\n id: `menu_${_unref(id)}`\n }, [\n _createElementVNode(\"span\", _mergeProps({\n class: \"bb-dropdown__arrow\",\n ref_key: \"bubblearrow\",\n ref: bubblearrow\n }, arrowAttributes.value), null, 16),\n _createElementVNode(\"span\", {\n class: \"bb-dropdown__bubble\",\n style: _normalizeStyle({ width: `${_ctx.width}px` })\n }, [\n _renderSlot(_ctx.$slots, \"prepend\", {\n closed: closed.value,\n closing: closing.value,\n disabled: _ctx.disabled,\n open: open.value,\n opening: opening.value,\n placement: _unref(placement)\n }),\n _createElementVNode(\"span\", _hoisted_2, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(mappedItems.value, (item, index) => {\n return (_openBlock(), _createElementBlock(_Fragment, {\n key: item.key\n }, [\n _renderSlot(_ctx.$slots, `item:prepend`, {\n closed: closed.value,\n closing: closing.value,\n disabled: item.disabled,\n index: index,\n item: _ctx.items[index],\n open: open.value,\n opening: opening.value,\n placement: _unref(placement),\n text: item.text\n }),\n _createVNode(BaseButton, _mergeProps({\n class: [\"bb-dropdown__item\", {\n 'bb-dropdown__item--first': index === 0,\n 'bb-dropdown__item--last': index === _ctx.items.length - 1,\n }],\n \"aria-role\": 'menuitem',\n \"data-dropdown-item\": true\n }, item), {\n default: _withCtx(() => [\n _renderSlot(_ctx.$slots, item.key, {\n closed: closed.value,\n closing: closing.value,\n disabled: item.disabled,\n index: index,\n item: item,\n open: open.value,\n opening: opening.value,\n placement: _unref(placement),\n text: item.text\n }, () => [\n _renderSlot(_ctx.$slots, \"item\", {\n closed: closed.value,\n closing: closing.value,\n disabled: item.disabled,\n index: index,\n item: item,\n open: open.value,\n opening: opening.value,\n placement: _unref(placement),\n text: item.text\n })\n ])\n ]),\n _: 2\n }, 1040, [\"class\"]),\n _renderSlot(_ctx.$slots, `item:append`, {\n closed: closed.value,\n closing: closing.value,\n disabled: item.disabled,\n index: index,\n item: _ctx.items[index],\n open: open.value,\n opening: opening.value,\n placement: _unref(placement),\n text: item.text\n })\n ], 64))\n }), 128))\n ]),\n _renderSlot(_ctx.$slots, \"append\", {\n disabled: _ctx.disabled,\n placement: _unref(placement),\n open: open.value,\n opening: opening.value,\n closing: closing.value,\n closed: closed.value\n })\n ], 4)\n ], 14, _hoisted_1))\n : _createCommentVNode(\"\", true)\n ]))\n ], 16))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_sfc_main","_defineComponent","__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","opening","open","closing","closed","arrowAttributes","x","y","openDropdown","idToFocus","onClickDocument","target","isOutside","onDocumentFocus","onEsc","_a","button","hasOpenedOnce","wait","attributes","_ctx","_cache","_openBlock","_createElementBlock","_mergeProps","_createElementVNode","_renderSlot","_normalizeProps","_guardReactiveProps","_unref","_createBlock","_Teleport","_normalizeClass","_normalizeStyle","_Fragment","_renderList","_createVNode","BaseButton","_withCtx","_createCommentVNode"],"mappings":";;;;;;;;;;AAGA,MAAMA,KAAa,CAAC,mBAAmB,IAAI,GACrCC,KAAa,EAAE,OAAO,kCAoEAC,KAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,cAAc,EAAE,SAAS,GAAG;AAAA,IAC5B,OAAO,EAAE,MAAM,QAAQ;AAAA,IACvB,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC1B,OAAO,EAAE,MAAM,QAAQ;AAAA,IACvB,IAAI,CAAC;AAAA,IACL,QAAQ,EAAE,SAAS,EAAE;AAAA,IACrB,SAAS,EAAE,SAAS,EAAE;AAAA,IACtB,WAAW,EAAE,SAAS,SAAS;AAAA,IAC/B,OAAO,EAAE,SAAS,UAAU;AAAA,IAC5B,oBAAoB,EAAE,SAAS,IAAI;AAAA,IACnC,OAAO,CAAC;AAAA,IACR,OAAO,EAAE,SAAS,IAAI;AAAA,EACxB;AAAA,EACA,MAAMC,GAAc;AAItB,UAAMC,IAAQD,GAERE,IAAKD,EAAM,MAAM,MAAME,KAAQ,GAAG,KAAK,IAEvCC,IAAcC,EAAuB,MAAM;AAC3C,UAAAC,IAA8BL,EAAM,MAAM,UAAU,CAACM,MAAO,CAACA,EAAG,QAAQ,GACxEC,IAA6BC;AAAA,QAC/BR,EAAM;AAAA,QACN,CAACS,MAAS,CAACA,EAAK;AAAA,MAAA;AAGlB,aAAOT,EAAM,MAAM,IAAI,CAACS,GAAMC,MAAU;AACtC,cAAMC,IAAS,GAAGV,CAAE,SAASQ,EAAK,GAAG,IAC/B,EAAE,SAASG,GAAS,GAAGC,MAASJ,GAKhCK,IAAU,YAAY;AAC1B,gBAAMC,EAAc;AACpB,gBAAMC,IAAc,SAAS,cAAc,IAAIf,CAAE,EAAE;AACnD,cAAKe;AAAa,YAC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