@adyen/bento-vue2 1.96.1 → 1.97.0
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/@types/index.d.ts +162 -127
- package/dist/action-bar.js +1 -1
- package/dist/ai-tag.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/alert.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/calendar.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/country.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-picker.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/date-time-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/navigation-menu-group.css +1 -1
- package/dist/assets/secondary-nav.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/summary-grid.css +1 -1
- package/dist/assets/textarea.css +1 -1
- package/dist/button.js +1 -1
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{action-bar.Chu-0oVy.js → action-bar.B890LCTe.js} +3 -3
- package/dist/chunks/{action-bar.Chu-0oVy.js.map → action-bar.B890LCTe.js.map} +1 -1
- package/dist/chunks/{ai-tag.DVmvni7U.js → ai-tag.C8RxACNj.js} +2 -2
- package/dist/chunks/{ai-tag.DVmvni7U.js.map → ai-tag.C8RxACNj.js.map} +1 -1
- package/dist/chunks/{alert.B4bHCE8V.js → alert.BDkEbdf4.js} +10 -10
- package/dist/chunks/{alert.B4bHCE8V.js.map → alert.BDkEbdf4.js.map} +1 -1
- package/dist/chunks/{base-modal.CC7gm9fc.js → base-modal.CDMoF3b_.js} +3 -3
- package/dist/chunks/{base-modal.CC7gm9fc.js.map → base-modal.CDMoF3b_.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.BlOBDvdL.js → button-actions-with-menu.DqDQ_gVX.js} +2 -2
- package/dist/chunks/{button-actions-with-menu.BlOBDvdL.js.map → button-actions-with-menu.DqDQ_gVX.js.map} +1 -1
- package/dist/chunks/{button-actions.D1jRC1fs.js → button-actions.DKc63aCb.js} +122 -110
- package/dist/chunks/{button-actions.D1jRC1fs.js.map → button-actions.DKc63aCb.js.map} +1 -1
- package/dist/chunks/calendar.BckAv9N_.js +1235 -0
- package/dist/chunks/calendar.BckAv9N_.js.map +1 -0
- package/dist/chunks/{card.ErZLKN0q.js → card.ChBURa5R.js} +2 -2
- package/dist/chunks/{card.ErZLKN0q.js.map → card.ChBURa5R.js.map} +1 -1
- package/dist/chunks/{checkbox-group.CNTMMwQr.js → checkbox-group.BAjvgXlc.js} +2 -2
- package/dist/chunks/{checkbox-group.CNTMMwQr.js.map → checkbox-group.BAjvgXlc.js.map} +1 -1
- package/dist/chunks/{checkbox.BIzqX_eH.js → checkbox.BAQDBNL6.js} +18 -18
- package/dist/chunks/{checkbox.BIzqX_eH.js.map → checkbox.BAQDBNL6.js.map} +1 -1
- package/dist/chunks/{code-snippet.lcQRsLdZ.js → code-snippet.nUo9bjhC.js} +3 -3
- package/dist/chunks/{code-snippet.lcQRsLdZ.js.map → code-snippet.nUo9bjhC.js.map} +1 -1
- package/dist/chunks/{country.BEwW8TQo.js → country.nGZJwp_A.js} +2 -2
- package/dist/chunks/country.nGZJwp_A.js.map +1 -0
- package/dist/chunks/{dashboard-section.DiGQXS9L.js → dashboard-section.BDDVJpxY.js} +2 -2
- package/dist/chunks/{dashboard-section.DiGQXS9L.js.map → dashboard-section.BDDVJpxY.js.map} +1 -1
- package/dist/chunks/{dashed-underline.Cl07OQID.js → dashed-underline.CfEmbgOv.js} +2 -2
- package/dist/chunks/{dashed-underline.Cl07OQID.js.map → dashed-underline.CfEmbgOv.js.map} +1 -1
- package/dist/chunks/{data-grid-template.BVppx9kZ.js → data-grid-template.BUlLHTYe.js} +2 -2
- package/dist/chunks/{data-grid-template.BVppx9kZ.js.map → data-grid-template.BUlLHTYe.js.map} +1 -1
- package/dist/chunks/{data-grid.DQwAkw4U.js → data-grid.0OiCQjFc.js} +28 -29
- package/dist/chunks/{data-grid.DQwAkw4U.js.map → data-grid.0OiCQjFc.js.map} +1 -1
- package/dist/chunks/date-picker.CsFSskqf.js +245 -0
- package/dist/chunks/date-picker.CsFSskqf.js.map +1 -0
- package/dist/chunks/date-picker.types.Ckt7zxGy.js.map +1 -1
- package/dist/chunks/date-range-picker.Bczgdu5X.js +1250 -0
- package/dist/chunks/date-range-picker.Bczgdu5X.js.map +1 -0
- package/dist/chunks/date-range-picker.types.Ckt7zxGy.js.map +1 -1
- package/dist/chunks/date-time-picker.DT54TiG4.js +177 -0
- package/dist/chunks/date-time-picker.DT54TiG4.js.map +1 -0
- package/dist/chunks/{draggable-handle.DIhHtHG9.js → draggable-handle.DwJBaf5y.js} +2 -2
- package/dist/chunks/{draggable-handle.DIhHtHG9.js.map → draggable-handle.DwJBaf5y.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.CuDxdSfb.js → dropdown-tag.BqSrkuwj.js} +2 -2
- package/dist/chunks/{dropdown-tag.CuDxdSfb.js.map → dropdown-tag.BqSrkuwj.js.map} +1 -1
- package/dist/chunks/dropdown.CIEm6MBB.js +2660 -0
- package/dist/chunks/dropdown.CIEm6MBB.js.map +1 -0
- package/dist/chunks/{file-uploader.CO2MeHwl.js → file-uploader.DOvQMUHC.js} +2 -2
- package/dist/chunks/{file-uploader.CO2MeHwl.js.map → file-uploader.DOvQMUHC.js.map} +1 -1
- package/dist/chunks/{filter-bar.DQ9fJXq1.js → filter-bar.DVRPM9tf.js} +318 -319
- package/dist/chunks/filter-bar.DVRPM9tf.js.map +1 -0
- package/dist/chunks/{footer-actions.CZE9dcmA.js → footer-actions.C1sXd7ti.js} +2 -2
- package/dist/chunks/{footer-actions.CZE9dcmA.js.map → footer-actions.C1sXd7ti.js.map} +1 -1
- package/dist/chunks/{form-layout-title.CXXdsiK5.js → form-layout-title.xrix5vY3.js} +2 -2
- package/dist/chunks/{form-layout-title.CXXdsiK5.js.map → form-layout-title.xrix5vY3.js.map} +1 -1
- package/dist/chunks/{header-meta.6rZdOgXD.js → header-meta.D1eb37QJ.js} +2 -2
- package/dist/chunks/{header-meta.6rZdOgXD.js.map → header-meta.D1eb37QJ.js.map} +1 -1
- package/dist/chunks/{header-with-views.4VNHbNk0.js → header-with-views.Bk6ly102.js} +8 -8
- package/dist/chunks/{header-with-views.4VNHbNk0.js.map → header-with-views.Bk6ly102.js.map} +1 -1
- package/dist/chunks/{header.BsroOD5b.js → header.CszOmM16.js} +3 -3
- package/dist/chunks/{header.BsroOD5b.js.map → header.CszOmM16.js.map} +1 -1
- package/dist/chunks/{input-field-password.CRqYWZGS.js → input-field-password.C4Wxsl16.js} +3 -3
- package/dist/chunks/{input-field-password.CRqYWZGS.js.map → input-field-password.C4Wxsl16.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.DHiuL0cF.js → input-field-phone-number.BhYTU628.js} +2 -2
- package/dist/chunks/{input-field-phone-number.DHiuL0cF.js.map → input-field-phone-number.BhYTU628.js.map} +1 -1
- package/dist/chunks/{input-field.BkQZ6Qzl.js → input-field.3tzX7t2y.js} +2 -2
- package/dist/chunks/{input-field.BkQZ6Qzl.js.map → input-field.3tzX7t2y.js.map} +1 -1
- package/dist/chunks/{input-time.BiOHvUEA.js → input-time.Bf-ZrCPX.js} +34 -34
- package/dist/chunks/{input-time.BiOHvUEA.js.map → input-time.Bf-ZrCPX.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.OS6KhVdg.js → modal-fullscreen.Dg1Hi3jB.js} +2 -2
- package/dist/chunks/{modal-fullscreen.OS6KhVdg.js.map → modal-fullscreen.Dg1Hi3jB.js.map} +1 -1
- package/dist/chunks/{modal.DHL3TGHv.js → modal.DZTEFM_E.js} +4 -4
- package/dist/chunks/{modal.DHL3TGHv.js.map → modal.DZTEFM_E.js.map} +1 -1
- package/dist/chunks/{pagination.DItyAwy1.js → pagination.C6HIPq58.js} +2 -2
- package/dist/chunks/{pagination.DItyAwy1.js.map → pagination.C6HIPq58.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.D5URbwnM.js → rich-text-editor.-B96ibAd.js} +3 -3
- package/dist/chunks/{rich-text-editor.D5URbwnM.js.map → rich-text-editor.-B96ibAd.js.map} +1 -1
- package/dist/chunks/{search-bar.D-WK8eMQ.js → search-bar.DunTxVmZ.js} +5 -5
- package/dist/chunks/{search-bar.D-WK8eMQ.js.map → search-bar.DunTxVmZ.js.map} +1 -1
- package/dist/chunks/{secondary-nav.C7lEDaoj.js → secondary-nav.CGGPkYpc.js} +2 -2
- package/dist/chunks/{secondary-nav.C7lEDaoj.js.map → secondary-nav.CGGPkYpc.js.map} +1 -1
- package/dist/chunks/{selection-card-group.CiFW4AZR.js → selection-card-group.ZZ_qF1L1.js} +8 -8
- package/dist/chunks/{selection-card-group.CiFW4AZR.js.map → selection-card-group.ZZ_qF1L1.js.map} +1 -1
- package/dist/chunks/{sidepanel.B8zQp_MJ.js → sidepanel.ChuW63J7.js} +3 -3
- package/dist/chunks/{sidepanel.B8zQp_MJ.js.map → sidepanel.ChuW63J7.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.CkqRXOKv.js → summary-grid.types.BnEhhDQz.js} +3 -3
- package/dist/chunks/summary-grid.types.BnEhhDQz.js.map +1 -0
- package/dist/chunks/{timeline-item.sdxvTjmS.js → timeline-item.DzMh520x.js} +3 -3
- package/dist/chunks/{timeline-item.sdxvTjmS.js.map → timeline-item.DzMh520x.js.map} +1 -1
- package/dist/chunks/{tutorial.Ba9dqb2j.js → tutorial.CkeL_7Je.js} +2 -2
- package/dist/chunks/{tutorial.Ba9dqb2j.js.map → tutorial.CkeL_7Je.js.map} +1 -1
- package/dist/chunks/use-bento-delayed-hover.D4rfUUOr.js.map +1 -1
- package/dist/chunks/{use-date-input-formatter.B5GQd3s2.js → use-date-input-formatter.Dq9C0nc9.js} +2 -2
- package/dist/chunks/{use-date-input-formatter.B5GQd3s2.js.map → use-date-input-formatter.Dq9C0nc9.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/country.js +1 -1
- package/dist/dashboard-template.js +1 -1
- package/dist/dashed-underline.js +1 -1
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/date-range-picker.js +2 -2
- package/dist/date-time-picker.js +1 -1
- package/dist/draggable.js +1 -1
- package/dist/dropdown.js +10 -11
- package/dist/dropdown.js.map +1 -1
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/form-layout.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +269 -270
- package/dist/index.js.map +1 -1
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/input-time.js +1 -1
- package/dist/internal.js +13 -13
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/pagination.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/summary-grid.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +205 -2
- package/package.json +3 -3
- package/dist/assets/use-cached-selected-values.css +0 -1
- package/dist/chunks/calendar.D0JIbmoS.js +0 -1151
- package/dist/chunks/calendar.D0JIbmoS.js.map +0 -1
- package/dist/chunks/country.BEwW8TQo.js.map +0 -1
- package/dist/chunks/date-picker.BWxvyK5J.js +0 -245
- package/dist/chunks/date-picker.BWxvyK5J.js.map +0 -1
- package/dist/chunks/date-range-picker.gfRJmzXn.js +0 -1114
- package/dist/chunks/date-range-picker.gfRJmzXn.js.map +0 -1
- package/dist/chunks/date-time-picker.BIl9kFLh.js +0 -129
- package/dist/chunks/date-time-picker.BIl9kFLh.js.map +0 -1
- package/dist/chunks/dropdown.C70AlvOT.js +0 -1155
- package/dist/chunks/dropdown.C70AlvOT.js.map +0 -1
- package/dist/chunks/filter-bar.DQ9fJXq1.js.map +0 -1
- package/dist/chunks/summary-grid.types.CkqRXOKv.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.D0s14AxT.js +0 -1520
- package/dist/chunks/use-cached-selected-values.D0s14AxT.js.map +0 -1
|
@@ -0,0 +1,2660 @@
|
|
|
1
|
+
import { computed as n, ref as E, onMounted as rt, onUnmounted as ct, watch as Z, defineComponent as z, nextTick as Y, toRef as K, useSlots as Se, useAttrs as $e, toRefs as He, inject as Fe } from "vue";
|
|
2
|
+
import { B as ae, d as Re } from "./typography.C8lPlsbD.js";
|
|
3
|
+
import { g as le } from "./generate-uid.NJ8tVoha.js";
|
|
4
|
+
import { u as oe } from "./index.B6WW_F-J.js";
|
|
5
|
+
import { u as Je } from "./use-has-slot.C9lQZ6nz.js";
|
|
6
|
+
import { C as dt } from "./cross-circle-fill.DTDtgLMf.js";
|
|
7
|
+
import { C as ut } from "./cross-circle-fill-small.DfxDedRr.js";
|
|
8
|
+
import { n as U } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
9
|
+
import { s as fe } from "./events.BQOQSSb7.js";
|
|
10
|
+
import { C as Xe } from "./chevron-down.eYtgv5ly.js";
|
|
11
|
+
import { C as Ze } from "./chevron-up.d8cwIlA_.js";
|
|
12
|
+
/* empty css */
|
|
13
|
+
import { u as pt } from "./aria-label.CaUURpnB.js";
|
|
14
|
+
import { u as ft } from "./form-field.D_2g7vaP.js";
|
|
15
|
+
import { u as bt } from "./use-form-layout-loading.CWbjZiwP.js";
|
|
16
|
+
import { B as V, a as we } from "./keyboard-navigation.DWmhelVv.js";
|
|
17
|
+
import { B as vt } from "./loading-indicator.PxbRzshH.js";
|
|
18
|
+
import { B as mt } from "./empty-state.Dttc-ZO_.js";
|
|
19
|
+
import { o as _t } from "./resize.Bqks3WUm.js";
|
|
20
|
+
import "./index.Cl4_42j5.js";
|
|
21
|
+
import { C as Te, N as yt } from "./minus-small.DJacLGTw.js";
|
|
22
|
+
import { C as gt } from "./checkmark-small.DVDtD4HQ.js";
|
|
23
|
+
import { B as ht } from "./chip.BFY_-VCz.js";
|
|
24
|
+
import { a as St, b as Ue, h as xt, e as Ct } from "./button-actions.DKc63aCb.js";
|
|
25
|
+
import { B as Ot } from "./directive.BBWhsNtO.js";
|
|
26
|
+
import { F as Et } from "./field-label.CdVbAfK-.js";
|
|
27
|
+
import { E as It } from "./error-message.CyERcfdt.js";
|
|
28
|
+
import { P as Ge } from "./popper-container.CFYFCz6u.js";
|
|
29
|
+
import "../assets/dropdown.css";
|
|
30
|
+
const Qe = (a, e, l, t) => {
|
|
31
|
+
const s = n(
|
|
32
|
+
() => {
|
|
33
|
+
var r, v;
|
|
34
|
+
return !!((r = a.value) != null && r.length) && ((v = a.value) == null ? void 0 : v.length) === e.value.length;
|
|
35
|
+
}
|
|
36
|
+
), o = n(() => {
|
|
37
|
+
var r;
|
|
38
|
+
return a.value == null || a.value.length === 0 ? !1 : ((r = a.value) == null ? void 0 : r.length) !== e.value.length;
|
|
39
|
+
});
|
|
40
|
+
return {
|
|
41
|
+
isAllSelected: s,
|
|
42
|
+
isIndeterminate: o,
|
|
43
|
+
toggleSelectAll: (r) => {
|
|
44
|
+
r ? l() : t();
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
function Lt(a, { disabled: e, itemHeight: l, overscan: t = 5, prefixHeight: s }) {
|
|
49
|
+
const o = E(null), i = E([]), r = E(0), v = E(0), u = E(0);
|
|
50
|
+
let c;
|
|
51
|
+
const g = n(() => {
|
|
52
|
+
const p = typeof l == "number" ? a.value.length * l : a.value.reduce((T, O, A) => T + l(A), 0), L = typeof l == "number" ? r.value * l : a.value.slice(0, r.value).reduce((T, O, A) => T + l(A), 0);
|
|
53
|
+
return {
|
|
54
|
+
style: {
|
|
55
|
+
marginTop: `${L}px`,
|
|
56
|
+
height: `${p - L}px`
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}), b = () => {
|
|
60
|
+
const p = (s == null ? void 0 : s.value) ?? 0, L = Math.max(o.value.scrollTop - p, 0);
|
|
61
|
+
if (typeof l == "number")
|
|
62
|
+
return Math.floor(L / l);
|
|
63
|
+
let T = 0, O = 0;
|
|
64
|
+
for (let A = 0; A < a.value.length; A += 1) {
|
|
65
|
+
const M = l(A);
|
|
66
|
+
if (T += M, T >= L) {
|
|
67
|
+
O = A;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return O;
|
|
72
|
+
}, f = () => {
|
|
73
|
+
if (u.value = o.value.clientHeight, typeof l == "number")
|
|
74
|
+
return Math.ceil(u.value / l);
|
|
75
|
+
const p = r.value ?? 0;
|
|
76
|
+
let L = 0, T = 0;
|
|
77
|
+
for (let O = p; O < a.value.length; O += 1) {
|
|
78
|
+
const A = l(O);
|
|
79
|
+
if (L += A, T = O, L > u.value)
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
return T - p;
|
|
83
|
+
}, h = () => {
|
|
84
|
+
if (o.value) {
|
|
85
|
+
const p = f();
|
|
86
|
+
r.value = b(), v.value = Math.min(r.value + p + t, a.value.length), i.value = a.value.slice(r.value, v.value);
|
|
87
|
+
}
|
|
88
|
+
}, y = () => {
|
|
89
|
+
h();
|
|
90
|
+
};
|
|
91
|
+
e || (rt(() => {
|
|
92
|
+
o.value && (u.value = o.value.clientHeight, c = _t(o.value, ({ clientHeight: p }) => {
|
|
93
|
+
u.value = p, h();
|
|
94
|
+
}), h());
|
|
95
|
+
}), ct(() => {
|
|
96
|
+
c == null || c.disconnect();
|
|
97
|
+
}), Z(
|
|
98
|
+
() => a.value,
|
|
99
|
+
() => {
|
|
100
|
+
h();
|
|
101
|
+
}
|
|
102
|
+
));
|
|
103
|
+
const B = {
|
|
104
|
+
ref: o,
|
|
105
|
+
style: { overflowY: "auto" }
|
|
106
|
+
}, R = (p) => {
|
|
107
|
+
if (!o.value)
|
|
108
|
+
return;
|
|
109
|
+
const L = typeof l == "number" ? p * l : a.value.slice(0, p).reduce((C, I, N) => C + l(N), 0), T = typeof l == "number" ? l : l(p), O = L + T, { scrollTop: A, clientHeight: M } = o.value, m = A + M;
|
|
110
|
+
O > m ? o.value.scrollTop = M > 0 ? O - M : L : L < A && (o.value.scrollTop = L), h();
|
|
111
|
+
};
|
|
112
|
+
return e ? {
|
|
113
|
+
containerRef: o,
|
|
114
|
+
containerProps: B,
|
|
115
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
116
|
+
onScroll: () => {
|
|
117
|
+
},
|
|
118
|
+
list: a,
|
|
119
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
120
|
+
scrollToIndex: () => {
|
|
121
|
+
},
|
|
122
|
+
startIndex: E(0)
|
|
123
|
+
} : {
|
|
124
|
+
containerRef: o,
|
|
125
|
+
containerProps: B,
|
|
126
|
+
onScroll: y,
|
|
127
|
+
list: i,
|
|
128
|
+
wrapperProps: g,
|
|
129
|
+
scrollToIndex: R,
|
|
130
|
+
startIndex: r
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
var d = /* @__PURE__ */ ((a) => (a.SELECT = "select", a.SHOW_MORE = "show-more", a.ESCAPE = "escape-pressed", a.CLICK = "click", a.ENTER = "enter-pressed", a.SPACE = "space-pressed", a.TAB = "tab-pressed", a.CLOSE_DROPDOWN = "close-dropdown", a))(d || {}), te = /* @__PURE__ */ ((a) => (a.AUTOMATIC = "automatic", a.BUTTON = "button", a.NONE = "none", a))(te || {});
|
|
134
|
+
const Tt = z({
|
|
135
|
+
name: "bento-listbox-static-category",
|
|
136
|
+
components: {
|
|
137
|
+
BentoTypography: ae
|
|
138
|
+
},
|
|
139
|
+
props: {
|
|
140
|
+
/**
|
|
141
|
+
* Category label text
|
|
142
|
+
*/
|
|
143
|
+
categoryLabel: {
|
|
144
|
+
type: String,
|
|
145
|
+
required: !0
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
var wt = function() {
|
|
150
|
+
var e = this, l = e._self._c;
|
|
151
|
+
return e._self._setupProxy, l("div", { staticClass: "b-listbox-single-select-category", attrs: { role: "group", "aria-label": e.categoryLabel } }, [l("bento-typography", { staticClass: "b-listbox-single-select-category__label-text", attrs: { variant: "caption", el: "span", "aria-hidden": "true" } }, [e._v(" " + e._s(e.categoryLabel) + " ")]), l("div", [e._t("default")], 2)], 1);
|
|
152
|
+
}, At = [], Dt = /* @__PURE__ */ U(
|
|
153
|
+
Tt,
|
|
154
|
+
wt,
|
|
155
|
+
At,
|
|
156
|
+
!1,
|
|
157
|
+
null,
|
|
158
|
+
"bfbc1649"
|
|
159
|
+
);
|
|
160
|
+
const kt = Dt.exports, Bt = z({
|
|
161
|
+
name: "bento-listbox-option",
|
|
162
|
+
props: {
|
|
163
|
+
/**
|
|
164
|
+
* Setting this property to true will disable the option.
|
|
165
|
+
*/
|
|
166
|
+
disabled: { type: Boolean, default: !1 },
|
|
167
|
+
/**
|
|
168
|
+
* Indicates if the value is selected. Only one element can be selected at a time.
|
|
169
|
+
*/
|
|
170
|
+
selected: { type: Boolean, default: !1 }
|
|
171
|
+
},
|
|
172
|
+
emits: [d.CLICK, d.ENTER, d.SPACE, d.TAB],
|
|
173
|
+
setup(a, { emit: e }) {
|
|
174
|
+
const l = n(() => ({
|
|
175
|
+
"b-listbox-option--disabled": a.disabled,
|
|
176
|
+
"b-listbox-option--selected": a.selected
|
|
177
|
+
}));
|
|
178
|
+
return {
|
|
179
|
+
// Enums
|
|
180
|
+
BentoKeyboardNavigationKeyDownEvent: V,
|
|
181
|
+
BentoListboxEvent: d,
|
|
182
|
+
// Values
|
|
183
|
+
conditionalClasses: l,
|
|
184
|
+
// Events
|
|
185
|
+
onClick: (o) => {
|
|
186
|
+
e(d.CLICK, o);
|
|
187
|
+
},
|
|
188
|
+
onOptionSelected: (o, i) => {
|
|
189
|
+
e(o, i);
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
var Rt = function() {
|
|
195
|
+
var e = this, l = e._self._c;
|
|
196
|
+
return e._self._setupProxy, l("div", e._b({ staticClass: "b-listbox-option", class: e.conditionalClasses, attrs: { role: "option" }, on: { click: e.onClick, keydown: [function(t) {
|
|
197
|
+
return !t.type.indexOf("key") && e._k(t.keyCode, "enter", 13, t.key, "Enter") ? null : e.onOptionSelected(e.BentoListboxEvent.ENTER, t);
|
|
198
|
+
}, function(t) {
|
|
199
|
+
return !t.type.indexOf("key") && e._k(t.keyCode, "space", 32, t.key, [" ", "Spacebar"]) ? null : e.onOptionSelected(e.BentoListboxEvent.SPACE, t);
|
|
200
|
+
}, function(t) {
|
|
201
|
+
return !t.type.indexOf("key") && e._k(t.keyCode, "tab", 9, t.key, "Tab") ? null : e.onOptionSelected(e.BentoListboxEvent.TAB, t);
|
|
202
|
+
}] } }, "div", e.$attrs, !1), [e._t("default")], 2);
|
|
203
|
+
}, Mt = [], Nt = /* @__PURE__ */ U(
|
|
204
|
+
Bt,
|
|
205
|
+
Rt,
|
|
206
|
+
Mt,
|
|
207
|
+
!1,
|
|
208
|
+
null,
|
|
209
|
+
"c345b6c0"
|
|
210
|
+
);
|
|
211
|
+
const Ae = Nt.exports;
|
|
212
|
+
let Ke = 0;
|
|
213
|
+
const $t = {
|
|
214
|
+
beforeCreate() {
|
|
215
|
+
this.uuid = Ke.toString(), Ke += 1;
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
var Ft = function() {
|
|
219
|
+
var e = this, l = e._self._c;
|
|
220
|
+
return l("svg", e._b({ staticClass: "ui-assets-icons-16", attrs: { role: "img", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none" } }, "svg", e.$attrs, !1), [e.$attrs["svg-title"] ? l("title", [e._v(e._s(e.$attrs["svg-title"]))]) : e._e(), l("path", { attrs: { fill: "#001222", d: "M15.0608 4.00011L14.0001 2.93945L6.00011 10.9395L2.00011 6.93945L0.939453 8.00011L6.00011 13.0608L15.0608 4.00011Z" } })]);
|
|
221
|
+
}, Pt = [], Vt = /* @__PURE__ */ U(
|
|
222
|
+
$t,
|
|
223
|
+
Ft,
|
|
224
|
+
Pt,
|
|
225
|
+
!1,
|
|
226
|
+
null,
|
|
227
|
+
null
|
|
228
|
+
);
|
|
229
|
+
const zt = Vt.exports, Ut = z({
|
|
230
|
+
name: "bento-listbox-single-select-option",
|
|
231
|
+
components: {
|
|
232
|
+
BentoListboxOption: Ae,
|
|
233
|
+
BentoTypography: ae,
|
|
234
|
+
CheckmarkIcon: zt
|
|
235
|
+
},
|
|
236
|
+
props: {
|
|
237
|
+
/**
|
|
238
|
+
* Setting this property to true will disable the option.
|
|
239
|
+
*/
|
|
240
|
+
disabled: { type: Boolean, default: !1 },
|
|
241
|
+
/**
|
|
242
|
+
* The option item that contains all the option item's data.
|
|
243
|
+
* @type {BentoListboxOptionItem}
|
|
244
|
+
*/
|
|
245
|
+
option: {
|
|
246
|
+
type: Object,
|
|
247
|
+
required: !0
|
|
248
|
+
},
|
|
249
|
+
/**
|
|
250
|
+
* Indicates if the value is selected. Only one element can be selected at a time.
|
|
251
|
+
*/
|
|
252
|
+
selected: { type: Boolean, default: !1 }
|
|
253
|
+
},
|
|
254
|
+
emits: [d.ENTER, d.SELECT, d.SPACE, d.TAB],
|
|
255
|
+
setup(a, { emit: e }) {
|
|
256
|
+
const l = (i) => {
|
|
257
|
+
a.disabled || e(i, a.option);
|
|
258
|
+
}, t = n(() => a.disabled ? !0 : null), s = n(() => a.selected ? !0 : null), o = n(() => a.disabled ? -1 : 0);
|
|
259
|
+
return {
|
|
260
|
+
// Values
|
|
261
|
+
ariaDisabled: t,
|
|
262
|
+
ariaSelected: s,
|
|
263
|
+
tabIndex: o,
|
|
264
|
+
// Enums
|
|
265
|
+
BentoListboxEvent: d,
|
|
266
|
+
// Events
|
|
267
|
+
onOptionSelected: l
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
var Gt = function() {
|
|
272
|
+
var e = this, l = e._self._c;
|
|
273
|
+
return e._self._setupProxy, l("bento-listbox-option", { staticClass: "b-listbox-single-select-option", attrs: { disabled: e.disabled, selected: e.selected, "aria-selected": e.ariaSelected, "aria-disabled": e.ariaDisabled, tabindex: e.tabIndex }, on: { click: function(t) {
|
|
274
|
+
return e.onOptionSelected(e.BentoListboxEvent.SELECT);
|
|
275
|
+
}, "enter-pressed": function(t) {
|
|
276
|
+
return e.onOptionSelected(e.BentoListboxEvent.ENTER);
|
|
277
|
+
}, "space-pressed": function(t) {
|
|
278
|
+
return t.preventDefault(), e.onOptionSelected(e.BentoListboxEvent.SPACE);
|
|
279
|
+
}, "tab-pressed": function(t) {
|
|
280
|
+
return e.onOptionSelected(e.BentoListboxEvent.TAB);
|
|
281
|
+
} } }, [e._t("default", function() {
|
|
282
|
+
return [l("span", { staticClass: "b-listbox-single-select-option__text" }, [l("bento-typography", { attrs: { el: "span" } }, [e._v(e._s(e.option.label))]), e.option.description ? l("bento-typography", { staticClass: "b-listbox-single-select-option__description", attrs: { el: "span" } }, [e._v(" " + e._s(e.option.description) + " ")]) : e._e()], 1)];
|
|
283
|
+
}, null, e.option), l("span", { staticClass: "b-listbox-single-select-option__check-icon" }, [l("checkmark-icon", { directives: [{ name: "show", rawName: "v-show", value: e.selected, expression: "selected" }], attrs: { "svg-title": "selected" } })], 1)], 2);
|
|
284
|
+
}, Kt = [], qt = /* @__PURE__ */ U(
|
|
285
|
+
Ut,
|
|
286
|
+
Gt,
|
|
287
|
+
Kt,
|
|
288
|
+
!1,
|
|
289
|
+
null,
|
|
290
|
+
"bb14d75a"
|
|
291
|
+
);
|
|
292
|
+
const Yt = qt.exports, et = ({ items: a, totalItemCount: e }, l) => {
|
|
293
|
+
const t = n(() => e != null && e.value ? e.value - 1 : a.value.length - 1), s = E(0), o = (f) => {
|
|
294
|
+
switch (f) {
|
|
295
|
+
case "increase":
|
|
296
|
+
s.value += 1;
|
|
297
|
+
break;
|
|
298
|
+
case "decrease":
|
|
299
|
+
s.value -= 1;
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
}, i = ({ edgeCaseItem: f }, h) => {
|
|
303
|
+
s.value !== f && (o(h), l(s.value));
|
|
304
|
+
}, r = (f) => {
|
|
305
|
+
b(f), i(
|
|
306
|
+
{
|
|
307
|
+
edgeCaseItem: t.value
|
|
308
|
+
},
|
|
309
|
+
"increase"
|
|
310
|
+
/* INCREASE */
|
|
311
|
+
);
|
|
312
|
+
}, v = (f) => {
|
|
313
|
+
b(f), i(
|
|
314
|
+
{
|
|
315
|
+
edgeCaseItem: 0
|
|
316
|
+
},
|
|
317
|
+
"decrease"
|
|
318
|
+
/* DECREASE */
|
|
319
|
+
);
|
|
320
|
+
}, u = () => {
|
|
321
|
+
s.value = 0, l(s.value);
|
|
322
|
+
}, c = () => {
|
|
323
|
+
s.value = t.value, l(s.value);
|
|
324
|
+
}, g = (f) => {
|
|
325
|
+
s.value = f;
|
|
326
|
+
}, b = (f) => {
|
|
327
|
+
var h;
|
|
328
|
+
(h = f == null ? void 0 : f.detail) == null || h.preventDefault();
|
|
329
|
+
};
|
|
330
|
+
return {
|
|
331
|
+
moveToFirstElement: u,
|
|
332
|
+
moveToLastElement: c,
|
|
333
|
+
moveToNextElement: r,
|
|
334
|
+
moveToPreviousElement: v,
|
|
335
|
+
setListboxFocusedIndex: g,
|
|
336
|
+
preventDefault: b,
|
|
337
|
+
focusedIndex: s
|
|
338
|
+
};
|
|
339
|
+
}, Pe = (a, e, l = E("option"), t = !0) => {
|
|
340
|
+
const s = E([]), o = async () => {
|
|
341
|
+
if (!a.value || a.value.nodeType === Node.COMMENT_NODE)
|
|
342
|
+
return;
|
|
343
|
+
const i = Array.from(a.value.querySelectorAll(`[role="${l.value}"]`));
|
|
344
|
+
s.value = t ? i.filter((r) => r.checkVisibility()) : i;
|
|
345
|
+
};
|
|
346
|
+
return Z(
|
|
347
|
+
e,
|
|
348
|
+
() => {
|
|
349
|
+
Y(() => {
|
|
350
|
+
o();
|
|
351
|
+
});
|
|
352
|
+
},
|
|
353
|
+
{ immediate: !0 }
|
|
354
|
+
), {
|
|
355
|
+
visibleDomOptions: s,
|
|
356
|
+
updateVisibleDomOptions: o
|
|
357
|
+
};
|
|
358
|
+
}, Wt = z({
|
|
359
|
+
name: "bento-listbox-single-select",
|
|
360
|
+
components: {
|
|
361
|
+
BentoListboxSingleSelectCategory: kt,
|
|
362
|
+
BentoListboxSingleSelectOption: Yt
|
|
363
|
+
},
|
|
364
|
+
directives: { BentoKeyboardNavigationDirective: we },
|
|
365
|
+
inheritAttrs: !1,
|
|
366
|
+
props: {
|
|
367
|
+
/**
|
|
368
|
+
* Function that allows the options to be disabled
|
|
369
|
+
*
|
|
370
|
+
* @type {BentoListboxIsOptionDisabled}
|
|
371
|
+
* @param {BentoListboxOptionItem} option - listbox option object
|
|
372
|
+
* @param {string} option.label - Option's label text
|
|
373
|
+
* @param {string|number} option.value - Option's value
|
|
374
|
+
* @param {unknown} option.data - Option's extra data to be passed to the default slot
|
|
375
|
+
*/
|
|
376
|
+
isOptionDisabled: {
|
|
377
|
+
type: Function,
|
|
378
|
+
default: () => !1
|
|
379
|
+
},
|
|
380
|
+
/**
|
|
381
|
+
* The option elements to populate the listbox with.
|
|
382
|
+
* It must be an array of {@see BentoListboxOptionItem }.
|
|
383
|
+
*
|
|
384
|
+
* @property {string} value.label - Text to be displayed in the option
|
|
385
|
+
* @property {string,number} value.value - Value of the option
|
|
386
|
+
*/
|
|
387
|
+
items: {
|
|
388
|
+
type: Array,
|
|
389
|
+
required: !0
|
|
390
|
+
},
|
|
391
|
+
/**
|
|
392
|
+
* The `input` value.
|
|
393
|
+
* Providing an empty string will select no options.
|
|
394
|
+
* Set to an empty string `''` if you don't want any of the available options to be selected
|
|
395
|
+
*/
|
|
396
|
+
selectedValue: {
|
|
397
|
+
type: Array,
|
|
398
|
+
default: void 0
|
|
399
|
+
},
|
|
400
|
+
/**
|
|
401
|
+
* If enabled, dropdown will display non-selectable, static categories
|
|
402
|
+
*/
|
|
403
|
+
staticCategories: { type: Boolean, default: !1 },
|
|
404
|
+
/**
|
|
405
|
+
* Total number of items in the full list (used for virtual scroll keyboard navigation).
|
|
406
|
+
* When greater than 0, virtual scroll keyboard navigation is enabled.
|
|
407
|
+
*/
|
|
408
|
+
totalItemCount: { type: Number, default: 0 },
|
|
409
|
+
/**
|
|
410
|
+
* Function to scroll the virtual list container to a given item index.
|
|
411
|
+
*/
|
|
412
|
+
scrollToIndex: { type: Function, default: void 0 },
|
|
413
|
+
/**
|
|
414
|
+
* The start index of the currently rendered virtual scroll slice.
|
|
415
|
+
*/
|
|
416
|
+
virtualScrollStartIndex: { type: Number, default: 0 }
|
|
417
|
+
},
|
|
418
|
+
emits: [d.SELECT, d.ENTER, d.SPACE, d.TAB],
|
|
419
|
+
setup(a, { emit: e, expose: l, slots: t, attrs: s }) {
|
|
420
|
+
const o = E(null), i = E([]), r = n(() => {
|
|
421
|
+
var m;
|
|
422
|
+
return !!((m = a.selectedValue) != null && m.length) && a.selectedValue.at(0);
|
|
423
|
+
}), v = n(
|
|
424
|
+
() => {
|
|
425
|
+
var m, C, I, N;
|
|
426
|
+
return {
|
|
427
|
+
"aria-label": (m = s["aria-label"]) == null ? void 0 : m.toString(),
|
|
428
|
+
"aria-busy": (C = s["aria-busy"]) == null ? void 0 : C.toString(),
|
|
429
|
+
"aria-atomic": (I = s["aria-atomic"]) == null ? void 0 : I.toString(),
|
|
430
|
+
"aria-live": (N = s["aria-live"]) == null ? void 0 : N.toString()
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
), u = n(() => !!a.items.some(({ items: m }) => !!m)), c = (m) => (C) => {
|
|
434
|
+
e(m, [C]);
|
|
435
|
+
}, { visibleDomOptions: g, updateVisibleDomOptions: b } = Pe(
|
|
436
|
+
o,
|
|
437
|
+
K(a, "items"),
|
|
438
|
+
E("option"),
|
|
439
|
+
!1
|
|
440
|
+
), f = n(() => a.totalItemCount > 0), h = (m) => {
|
|
441
|
+
if (!f.value)
|
|
442
|
+
return;
|
|
443
|
+
const C = m.target;
|
|
444
|
+
if (C === o.value || (C == null ? void 0 : C.getAttribute("role")) !== "option")
|
|
445
|
+
return;
|
|
446
|
+
const I = g.value.indexOf(C);
|
|
447
|
+
if (I !== -1) {
|
|
448
|
+
const N = I + a.virtualScrollStartIndex;
|
|
449
|
+
O(N);
|
|
450
|
+
}
|
|
451
|
+
}, y = async (m) => {
|
|
452
|
+
var C, I;
|
|
453
|
+
if (f.value && a.scrollToIndex) {
|
|
454
|
+
a.scrollToIndex(m), await Y(), await b();
|
|
455
|
+
const N = m - a.virtualScrollStartIndex;
|
|
456
|
+
(C = g.value[N]) == null || C.focus();
|
|
457
|
+
} else
|
|
458
|
+
(I = g.value[m]) == null || I.focus();
|
|
459
|
+
}, B = async (m) => {
|
|
460
|
+
O(m), await y(m);
|
|
461
|
+
}, {
|
|
462
|
+
moveToNextElement: R,
|
|
463
|
+
moveToPreviousElement: p,
|
|
464
|
+
moveToFirstElement: L,
|
|
465
|
+
moveToLastElement: T,
|
|
466
|
+
setListboxFocusedIndex: O
|
|
467
|
+
} = et(
|
|
468
|
+
{
|
|
469
|
+
items: g,
|
|
470
|
+
totalItemCount: K(a, "totalItemCount")
|
|
471
|
+
},
|
|
472
|
+
y
|
|
473
|
+
), A = {
|
|
474
|
+
[V.ARROW_UP]: p,
|
|
475
|
+
[V.ARROW_DOWN]: R,
|
|
476
|
+
[V.HOME]: L,
|
|
477
|
+
[V.END]: T
|
|
478
|
+
}, M = {
|
|
479
|
+
[d.SELECT]: c(d.SELECT),
|
|
480
|
+
[d.SPACE]: c(d.SPACE),
|
|
481
|
+
[d.TAB]: c(d.TAB),
|
|
482
|
+
[d.ENTER]: c(d.ENTER)
|
|
483
|
+
};
|
|
484
|
+
return l({
|
|
485
|
+
/**
|
|
486
|
+
* Reference for a single listbox item.
|
|
487
|
+
* Required for keyboard navigation in dropdown as $children is removed in vue@3
|
|
488
|
+
*/
|
|
489
|
+
listboxItemRef: i,
|
|
490
|
+
/**
|
|
491
|
+
* Method to set the index of the item to be focused on
|
|
492
|
+
* Used for focus management to be kept in-sync with parent e.g. dropdowns
|
|
493
|
+
*/
|
|
494
|
+
setListboxFocusedIndex: O,
|
|
495
|
+
/**
|
|
496
|
+
* Navigates to an item by global index, handling virtual scroll if enabled.
|
|
497
|
+
* Scrolls the virtual list and focuses the item.
|
|
498
|
+
*/
|
|
499
|
+
navigateToItem: B
|
|
500
|
+
}), {
|
|
501
|
+
// Enums
|
|
502
|
+
BentoListboxEvent: d,
|
|
503
|
+
// Values
|
|
504
|
+
listboxRef: o,
|
|
505
|
+
listboxItemRef: i,
|
|
506
|
+
selectedItem: r,
|
|
507
|
+
slots: t,
|
|
508
|
+
ariaAttributes: v,
|
|
509
|
+
// Computed
|
|
510
|
+
hasCategories: u,
|
|
511
|
+
// Methods
|
|
512
|
+
onOptionSelected: c,
|
|
513
|
+
// Keyboard navigation
|
|
514
|
+
listboxListeners: A,
|
|
515
|
+
listboxOptionListeners: M,
|
|
516
|
+
// Virtual scroll focus management
|
|
517
|
+
handleVirtualScrollingFocus: h
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
});
|
|
521
|
+
var jt = function() {
|
|
522
|
+
var e = this, l = e._self._c;
|
|
523
|
+
return e._self._setupProxy, l("div", e._g(e._b({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], ref: "listboxRef", attrs: { role: "listbox" }, on: { focusin: e.handleVirtualScrollingFocus } }, "div", e.ariaAttributes, !1), e.listboxListeners), [e.hasCategories && e.staticCategories ? [e._l(e.items, function(t) {
|
|
524
|
+
return [t.items && t.items.length > 0 ? l("bento-listbox-single-select-category", { key: `category-${t.value}`, attrs: { "category-label": t.label } }, e._l(t.items, function(s) {
|
|
525
|
+
return l("bento-listbox-single-select-option", e._g({ key: s.value, ref: "listboxItemRef", refInFor: !0, attrs: { role: "option", option: s, disabled: e.isOptionDisabled ? e.isOptionDisabled(s) : null, selected: s.value === e.selectedItem.value }, scopedSlots: e._u([e._l(e.slots, function(o, i) {
|
|
526
|
+
return { key: i, fn: function(r) {
|
|
527
|
+
return [e._t(i, null, null, r)];
|
|
528
|
+
} };
|
|
529
|
+
})], null, !0) }, e.listboxOptionListeners));
|
|
530
|
+
}), 1) : l("bento-listbox-single-select-option", e._g({ key: `option-${t.value}`, ref: "listboxItemRef", refInFor: !0, attrs: { role: "option", option: t, disabled: e.isOptionDisabled ? e.isOptionDisabled(t) : null, selected: t.value === e.selectedItem.value }, scopedSlots: e._u([e._l(e.slots, function(s, o) {
|
|
531
|
+
return { key: o, fn: function(i) {
|
|
532
|
+
return [e._t(o, null, null, i)];
|
|
533
|
+
} };
|
|
534
|
+
})], null, !0) }, e.listboxOptionListeners))];
|
|
535
|
+
})] : e._l(e.items, function(t) {
|
|
536
|
+
return l("bento-listbox-single-select-option", e._g({ key: t.value, ref: "listboxItemRef", refInFor: !0, attrs: { role: "option", option: t, disabled: e.isOptionDisabled ? e.isOptionDisabled(t) : null, selected: t.value === e.selectedItem.value }, scopedSlots: e._u([e._l(e.slots, function(s, o) {
|
|
537
|
+
return { key: o, fn: function(i) {
|
|
538
|
+
return [e._t(o, null, null, i)];
|
|
539
|
+
} };
|
|
540
|
+
})], null, !0) }, e.listboxOptionListeners));
|
|
541
|
+
})], 2);
|
|
542
|
+
}, Ht = [], Jt = /* @__PURE__ */ U(
|
|
543
|
+
Wt,
|
|
544
|
+
jt,
|
|
545
|
+
Ht,
|
|
546
|
+
!1,
|
|
547
|
+
null,
|
|
548
|
+
null
|
|
549
|
+
);
|
|
550
|
+
const Xt = Jt.exports;
|
|
551
|
+
let qe = 0;
|
|
552
|
+
const Zt = {
|
|
553
|
+
beforeCreate() {
|
|
554
|
+
this.uuid = qe.toString(), qe += 1;
|
|
555
|
+
}
|
|
556
|
+
};
|
|
557
|
+
var Qt = function() {
|
|
558
|
+
var e = this, l = e._self._c;
|
|
559
|
+
return l("svg", e._b({ staticClass: "ui-assets-icons-16", attrs: { role: "img", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none" } }, "svg", e.$attrs, !1), [e.$attrs["svg-title"] ? l("title", [e._v(e._s(e.$attrs["svg-title"]))]) : e._e(), l("path", { attrs: { fill: "#001222", d: "M9.69043 5.75L4.62988 10.8105L1.56934 7.75L2.62988 6.68945L4.62988 8.68945L8.62988 4.68945L9.69043 5.75Z" } }), l("path", { attrs: { fill: "#001222", d: "M13.9307 5.75L8.87012 10.8105L7.80957 9.75L12.8701 4.68945L13.9307 5.75Z" } })]);
|
|
560
|
+
}, el = [], tl = /* @__PURE__ */ U(
|
|
561
|
+
Zt,
|
|
562
|
+
Qt,
|
|
563
|
+
el,
|
|
564
|
+
!1,
|
|
565
|
+
null,
|
|
566
|
+
null
|
|
567
|
+
);
|
|
568
|
+
const ll = tl.exports, al = {}, sl = /* @__PURE__ */ z({
|
|
569
|
+
...al,
|
|
570
|
+
__name: "decorative-checkbox",
|
|
571
|
+
props: {
|
|
572
|
+
disabled: { type: Boolean, default: !1 },
|
|
573
|
+
indeterminate: { type: Boolean, default: !1 },
|
|
574
|
+
checked: { type: Boolean, default: !1 },
|
|
575
|
+
allSelected: { type: Boolean, default: !1 }
|
|
576
|
+
},
|
|
577
|
+
setup(a) {
|
|
578
|
+
const e = a, l = n(() => ({
|
|
579
|
+
[`b-checkbox-input--${Te.DISABLED}`]: e.disabled
|
|
580
|
+
})), t = n(() => ({
|
|
581
|
+
[`b-checkbox-input__outline--${Te.UNCHECKED}`]: !e.checked && !e.indeterminate && !e.allSelected,
|
|
582
|
+
[`b-checkbox-input__outline--${Te.CHECKED}`]: (e.checked || e.allSelected) && !e.indeterminate,
|
|
583
|
+
[`b-checkbox-input__outline--${Te.INDETERMINATE}`]: e.indeterminate
|
|
584
|
+
}));
|
|
585
|
+
return { __sfc: !0, props: e, conditionalClasses: l, outlineConditionalClasses: t, CheckmarkSmallIcon: gt, MinusSmallIcon: yt, DoubleCheckmarkSmallIcon: ll };
|
|
586
|
+
}
|
|
587
|
+
});
|
|
588
|
+
var ol = function() {
|
|
589
|
+
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
590
|
+
return l("div", { staticClass: "b-checkbox-input", class: t.conditionalClasses, attrs: { role: "presentation" } }, [e.indeterminate ? l(t.MinusSmallIcon, { staticClass: "b-checkbox-input__icon", attrs: { "svg-title": "", "aria-hidden": "true" } }) : e.allSelected ? l(t.DoubleCheckmarkSmallIcon, { staticClass: "b-checkbox-input__icon", attrs: { "svg-title": "", "aria-hidden": "true", "data-testid": "decorative-checkbox-double-checkmark-icon" } }) : e.checked ? l(t.CheckmarkSmallIcon, { staticClass: "b-checkbox-input__icon", attrs: { "svg-title": "", "aria-hidden": "true" } }) : e._e(), l("div", { staticClass: "b-checkbox-input__outline", class: t.outlineConditionalClasses })], 1);
|
|
591
|
+
}, nl = [], il = /* @__PURE__ */ U(
|
|
592
|
+
sl,
|
|
593
|
+
ol,
|
|
594
|
+
nl,
|
|
595
|
+
!1,
|
|
596
|
+
null,
|
|
597
|
+
"b87bbaf9"
|
|
598
|
+
);
|
|
599
|
+
const Ve = il.exports;
|
|
600
|
+
var tt = /* @__PURE__ */ ((a) => (a.DISABLED = "disabled", a.STATIC_CATEGORY = "static-category", a))(tt || {}), se = /* @__PURE__ */ ((a) => (a.SELECT_CATEGORY = "select-category", a.UNSELECT_CATEGORY = "unselect-category", a.TOGGLE_CATEGORY_VISIBILITY = "toggle-category-visibility", a))(se || {});
|
|
601
|
+
const rl = {
|
|
602
|
+
"de-DE": {
|
|
603
|
+
categoryClosed: "{category} geschlossen",
|
|
604
|
+
categoryOpened: "{category} geöffnet"
|
|
605
|
+
},
|
|
606
|
+
"en-GB": {
|
|
607
|
+
categoryClosed: "{category} closed",
|
|
608
|
+
categoryOpened: "{category} opened"
|
|
609
|
+
},
|
|
610
|
+
"en-US": {
|
|
611
|
+
categoryClosed: "{category} closed",
|
|
612
|
+
categoryOpened: "{category} opened"
|
|
613
|
+
},
|
|
614
|
+
"es-ES": {
|
|
615
|
+
categoryClosed: "{category} cerrado",
|
|
616
|
+
categoryOpened: "{category} abierto"
|
|
617
|
+
},
|
|
618
|
+
"es-MX": {
|
|
619
|
+
categoryClosed: "{category} cerrado",
|
|
620
|
+
categoryOpened: "{category} abierto"
|
|
621
|
+
},
|
|
622
|
+
"fr-FR": {
|
|
623
|
+
categoryClosed: "{category} fermée",
|
|
624
|
+
categoryOpened: "{category} ouverte"
|
|
625
|
+
},
|
|
626
|
+
"it-IT": {
|
|
627
|
+
categoryClosed: "{category} chiuso",
|
|
628
|
+
categoryOpened: "{category} aperto"
|
|
629
|
+
},
|
|
630
|
+
"ja-JP": {
|
|
631
|
+
categoryClosed: "{category}を閉じました",
|
|
632
|
+
categoryOpened: "{category}を開きました"
|
|
633
|
+
},
|
|
634
|
+
"pt-BR": {
|
|
635
|
+
categoryClosed: "{category} fechada",
|
|
636
|
+
categoryOpened: "{categoria} aberta"
|
|
637
|
+
},
|
|
638
|
+
"zh-CN": {
|
|
639
|
+
categoryClosed: "{category} 已关闭",
|
|
640
|
+
categoryOpened: "{category} 已打开"
|
|
641
|
+
}
|
|
642
|
+
}, cl = z({
|
|
643
|
+
i18n: { messages: rl },
|
|
644
|
+
name: "bento-listbox-multi-select-category",
|
|
645
|
+
components: {
|
|
646
|
+
BentoTypography: ae,
|
|
647
|
+
BentoListboxOption: Ae,
|
|
648
|
+
ChevronDownIcon: Xe,
|
|
649
|
+
ChevronUpIcon: Ze,
|
|
650
|
+
DecorativeCheckbox: Ve
|
|
651
|
+
},
|
|
652
|
+
props: {
|
|
653
|
+
/**
|
|
654
|
+
* The option elements to populate the listbox with.
|
|
655
|
+
* It must be an array of {@see BentoListboxOptionItem }.
|
|
656
|
+
*
|
|
657
|
+
* @property {string} value.label - Text to be displayed in the option
|
|
658
|
+
* @property {string,number} value.value - Value of the option
|
|
659
|
+
* @property {BentoListboxOptionItem} value.items - Category items list
|
|
660
|
+
*/
|
|
661
|
+
category: {
|
|
662
|
+
type: Object,
|
|
663
|
+
required: !0
|
|
664
|
+
},
|
|
665
|
+
/**
|
|
666
|
+
* Function that allows the options to be disabled
|
|
667
|
+
*
|
|
668
|
+
* @type {BentoListboxIsOptionDisabled}
|
|
669
|
+
* @param {BentoListboxOptionItem} option - listbox option object
|
|
670
|
+
* @param {string} option.label - Option's label text
|
|
671
|
+
* @param {string|number} option.value - Option's value
|
|
672
|
+
* @param {unknown} option.data - Option's extra data to be passed to the default slot
|
|
673
|
+
*/
|
|
674
|
+
isOptionDisabled: {
|
|
675
|
+
type: [Function],
|
|
676
|
+
default: () => !1
|
|
677
|
+
},
|
|
678
|
+
/**
|
|
679
|
+
* The `input` value.
|
|
680
|
+
* Providing an empty array will select no options.
|
|
681
|
+
*/
|
|
682
|
+
selectedItemsList: {
|
|
683
|
+
type: Array,
|
|
684
|
+
default: () => []
|
|
685
|
+
},
|
|
686
|
+
/**
|
|
687
|
+
* If enabled, dropdown will display non-selectable, static categories
|
|
688
|
+
*/
|
|
689
|
+
staticCategories: { type: Boolean, default: !1 },
|
|
690
|
+
/**
|
|
691
|
+
* Category's tabindex
|
|
692
|
+
*/
|
|
693
|
+
tabindex: { type: Number, default: -1 }
|
|
694
|
+
},
|
|
695
|
+
emits: [
|
|
696
|
+
se.SELECT_CATEGORY,
|
|
697
|
+
se.UNSELECT_CATEGORY,
|
|
698
|
+
se.TOGGLE_CATEGORY_VISIBILITY
|
|
699
|
+
],
|
|
700
|
+
setup(a, { emit: e }) {
|
|
701
|
+
const l = E(!1), { t } = oe(), s = le("category-group"), o = le("category-name"), i = (m) => a.isOptionDisabled ? a.isOptionDisabled(m) : !1, r = n(
|
|
702
|
+
() => a.category.items.every((m) => i(m))
|
|
703
|
+
), v = K(a, "staticCategories"), u = n(() => l.value || a.staticCategories), c = n(() => ({
|
|
704
|
+
[`b-listbox-multi-select-category--${tt.DISABLED}`]: r.value
|
|
705
|
+
})), g = (m, C) => {
|
|
706
|
+
m.preventDefault(), l.value = C !== void 0 ? C : !l.value, e(se.TOGGLE_CATEGORY_VISIBILITY, a.category.value);
|
|
707
|
+
}, b = (m) => {
|
|
708
|
+
var N;
|
|
709
|
+
const C = i(m), I = ((N = a.selectedItemsList) == null ? void 0 : N.includes(m.value)) || !1;
|
|
710
|
+
return { isDisabled: C, isPreSelected: I };
|
|
711
|
+
}, f = n(
|
|
712
|
+
() => a.category.items.filter((m) => {
|
|
713
|
+
const { isDisabled: C, isPreSelected: I } = b(m);
|
|
714
|
+
return C && I || !C;
|
|
715
|
+
})
|
|
716
|
+
), h = n(
|
|
717
|
+
() => {
|
|
718
|
+
var m;
|
|
719
|
+
return (m = f.value) == null ? void 0 : m.filter(
|
|
720
|
+
({ value: C }) => {
|
|
721
|
+
var I;
|
|
722
|
+
return (I = a.selectedItemsList) == null ? void 0 : I.includes(C);
|
|
723
|
+
}
|
|
724
|
+
);
|
|
725
|
+
}
|
|
726
|
+
), y = n(() => {
|
|
727
|
+
const m = l.value ? "categoryOpened" : "categoryClosed";
|
|
728
|
+
return t(m, { category: a.category.label });
|
|
729
|
+
}), B = () => {
|
|
730
|
+
e(se.SELECT_CATEGORY);
|
|
731
|
+
}, R = () => {
|
|
732
|
+
e(se.UNSELECT_CATEGORY);
|
|
733
|
+
}, { isAllSelected: p, isIndeterminate: L, toggleSelectAll: T } = Qe(
|
|
734
|
+
h,
|
|
735
|
+
f,
|
|
736
|
+
B,
|
|
737
|
+
R
|
|
738
|
+
), O = n(() => L.value ? "mixed" : `${p.value}`), A = E(p.value), M = () => {
|
|
739
|
+
A.value = !A.value, T(A.value);
|
|
740
|
+
};
|
|
741
|
+
return Z(p, () => {
|
|
742
|
+
A.value = p.value;
|
|
743
|
+
}), {
|
|
744
|
+
// Values
|
|
745
|
+
chevronTitle: y,
|
|
746
|
+
conditionalClass: c,
|
|
747
|
+
hasAllPropsDisabled: r,
|
|
748
|
+
isOpen: l,
|
|
749
|
+
isAllSelected: p,
|
|
750
|
+
isIndeterminate: L,
|
|
751
|
+
isStaticCategory: v,
|
|
752
|
+
categoryGroupId: s,
|
|
753
|
+
categoryNameId: o,
|
|
754
|
+
// Computed
|
|
755
|
+
showItemChildren: u,
|
|
756
|
+
ariaCheckedComputed: O,
|
|
757
|
+
// Methods
|
|
758
|
+
handleSelectAll: M,
|
|
759
|
+
toggleOpen: g,
|
|
760
|
+
toggleSelectAll: T
|
|
761
|
+
};
|
|
762
|
+
}
|
|
763
|
+
});
|
|
764
|
+
var dl = function() {
|
|
765
|
+
var e = this, l = e._self._c;
|
|
766
|
+
return e._self._setupProxy, l("div", [e.isStaticCategory ? l("div", { staticClass: "b-listbox-multi-select-category b-listbox-multi-select-category--static-category", attrs: { "aria-hidden": "true" } }, [l("span", { staticClass: "b-listbox-multi-select-category__label" }, [l("bento-typography", { staticClass: "b-listbox-multi-select-category__label-text", attrs: { el: "span", variant: "caption" } }, [e._v(" " + e._s(e.category.label) + " ")])], 1)]) : l("bento-listbox-option", { staticClass: "b-listbox-multi-select-category__option", class: e.conditionalClass, attrs: { tabindex: e.tabindex, "aria-selected": e.ariaCheckedComputed !== "false", "aria-checked": e.ariaCheckedComputed, "aria-disabled": e.hasAllPropsDisabled, "aria-expanded": `${e.isOpen}`, role: "treeitem", "aria-owns": e.categoryGroupId, "aria-labelledby": e.categoryNameId }, on: { click: e.handleSelectAll, "enter-pressed": e.handleSelectAll, "space-pressed": function(t) {
|
|
767
|
+
return t.preventDefault(), e.handleSelectAll.apply(null, arguments);
|
|
768
|
+
} }, nativeOn: { keydown: [function(t) {
|
|
769
|
+
return !t.type.indexOf("key") && e._k(t.keyCode, "arrow-left", void 0, t.key, void 0) ? null : e.toggleOpen(t, !1);
|
|
770
|
+
}, function(t) {
|
|
771
|
+
return !t.type.indexOf("key") && e._k(t.keyCode, "arrow-right", void 0, t.key, void 0) ? null : e.toggleOpen(t, !0);
|
|
772
|
+
}] } }, [l("decorative-checkbox", { attrs: { indeterminate: e.isIndeterminate, disabled: e.hasAllPropsDisabled, checked: e.isAllSelected } }), l("span", { staticClass: "b-listbox-multi-select-category__label" }, [l("bento-typography", { staticClass: "b-listbox-multi-select-category__label-text", attrs: { id: e.categoryNameId, el: "span" } }, [e._v(" " + e._s(e.category.label) + " ")]), l("div", { staticClass: "b-listbox-multi-select-category__label-chevron", attrs: { "aria-hidden": "true", "data-testid": "toggle-listbox" }, on: { "!click": function(t) {
|
|
773
|
+
return t.stopPropagation(), e.toggleOpen.apply(null, arguments);
|
|
774
|
+
} } }, [e.isOpen ? l("chevron-up-icon", { attrs: { "svg-title": e.chevronTitle } }) : l("chevron-down-icon", { attrs: { "svg-title": e.chevronTitle } })], 1)], 1)], 1), l("div", { directives: [{ name: "show", rawName: "v-show", value: e.showItemChildren, expression: "showItemChildren" }], attrs: { id: e.categoryGroupId, role: "group", "aria-label": e.category.label } }, [e._t("default")], 2)], 1);
|
|
775
|
+
}, ul = [], pl = /* @__PURE__ */ U(
|
|
776
|
+
cl,
|
|
777
|
+
dl,
|
|
778
|
+
ul,
|
|
779
|
+
!1,
|
|
780
|
+
null,
|
|
781
|
+
"00ccd708"
|
|
782
|
+
);
|
|
783
|
+
const fl = pl.exports;
|
|
784
|
+
var X = /* @__PURE__ */ ((a) => (a.SELECT_CATEGORY = "select-category", a.TOGGLE_CHECKBOX_SELECTION = "toggle-checkbox-selection", a.UNSELECT_CATEGORY = "unselect-category", a.TOGGLE_CATEGORY_VISIBILITY = "toggle-category-visibility", a))(X || {});
|
|
785
|
+
const bl = z({
|
|
786
|
+
name: "listbox-multi-select-options",
|
|
787
|
+
components: {
|
|
788
|
+
BentoListboxOption: Ae,
|
|
789
|
+
BentoTypography: ae,
|
|
790
|
+
ListboxMultiSelectCategory: fl,
|
|
791
|
+
DecorativeCheckbox: Ve
|
|
792
|
+
},
|
|
793
|
+
inheritAttrs: !1,
|
|
794
|
+
props: {
|
|
795
|
+
/**
|
|
796
|
+
* Indicates if the items listed are inside a category
|
|
797
|
+
* so they can be padded to right by one level in recursion.
|
|
798
|
+
* Items of categories are automatically defined as "categoryItems"
|
|
799
|
+
*/
|
|
800
|
+
categoryItems: { type: Boolean, default: !1 },
|
|
801
|
+
/**
|
|
802
|
+
* Current focused option index
|
|
803
|
+
*/
|
|
804
|
+
focusedIndex: { type: Number, default: 0 },
|
|
805
|
+
/**
|
|
806
|
+
* Function that allows the options to be disabled
|
|
807
|
+
*
|
|
808
|
+
* @type {BentoListboxIsOptionDisabled}
|
|
809
|
+
* @param {BentoListboxOptionItem} option - listbox option object
|
|
810
|
+
* @param {string} option.label - Option's label text
|
|
811
|
+
* @param {string|number} option.value - Option's value
|
|
812
|
+
* @param {unknown} option.data - Option's extra data to be passed to the default slot
|
|
813
|
+
*/
|
|
814
|
+
isOptionDisabled: {
|
|
815
|
+
type: Function,
|
|
816
|
+
default: () => !1
|
|
817
|
+
},
|
|
818
|
+
/**
|
|
819
|
+
* The option elements to populate the listbox with.
|
|
820
|
+
* It must be an array of {@see BentoListboxOptionItem }.
|
|
821
|
+
*
|
|
822
|
+
* @property {string} value.label - Text to be displayed in the option
|
|
823
|
+
* @property {string,number} value.value - Value of the option
|
|
824
|
+
*/
|
|
825
|
+
items: {
|
|
826
|
+
type: Array,
|
|
827
|
+
required: !0
|
|
828
|
+
},
|
|
829
|
+
/**
|
|
830
|
+
* Indicates if the elements options are inside a multi-level category
|
|
831
|
+
*/
|
|
832
|
+
isMultiLevel: { type: Boolean, default: !1 },
|
|
833
|
+
/**
|
|
834
|
+
* Flag that indicates that an external search it's being made
|
|
835
|
+
* to filter out the items inside the the multi-select listbox
|
|
836
|
+
*
|
|
837
|
+
* If enabled, hides the "Select all" checkbox in "multiple" mode.
|
|
838
|
+
*/
|
|
839
|
+
searching: { type: Boolean, default: !1 },
|
|
840
|
+
/**
|
|
841
|
+
* List of selected items.
|
|
842
|
+
* Providing an empty array will select no options.
|
|
843
|
+
*/
|
|
844
|
+
selectedItemsList: {
|
|
845
|
+
type: Array,
|
|
846
|
+
default: () => []
|
|
847
|
+
},
|
|
848
|
+
/**
|
|
849
|
+
* If enabled, dropdown will display non-selectable, static categories
|
|
850
|
+
*/
|
|
851
|
+
staticCategories: { type: Boolean, default: !1 },
|
|
852
|
+
/**
|
|
853
|
+
* Object with the index of each item.
|
|
854
|
+
*/
|
|
855
|
+
itemsIndex: {
|
|
856
|
+
type: Object,
|
|
857
|
+
default: () => ({})
|
|
858
|
+
}
|
|
859
|
+
},
|
|
860
|
+
emits: [
|
|
861
|
+
X.TOGGLE_CHECKBOX_SELECTION,
|
|
862
|
+
X.SELECT_CATEGORY,
|
|
863
|
+
X.UNSELECT_CATEGORY,
|
|
864
|
+
X.TOGGLE_CATEGORY_VISIBILITY
|
|
865
|
+
],
|
|
866
|
+
setup(a, { emit: e }) {
|
|
867
|
+
const l = (u) => {
|
|
868
|
+
a.isOptionDisabled(u) || e(X.TOGGLE_CHECKBOX_SELECTION, u);
|
|
869
|
+
}, t = (u) => !!u.items, s = (u) => {
|
|
870
|
+
const c = a.isMultiLevel && a.searching;
|
|
871
|
+
return u.description && (!a.isMultiLevel || c);
|
|
872
|
+
}, o = (u) => u.items ? !!u.items.find((c) => a.selectedItemsList.includes(c.value)) : a.selectedItemsList.includes(u.value), i = (u) => {
|
|
873
|
+
if (t(u)) {
|
|
874
|
+
const c = o(u) ? X.UNSELECT_CATEGORY : X.SELECT_CATEGORY;
|
|
875
|
+
e(c, u);
|
|
876
|
+
} else
|
|
877
|
+
l(u);
|
|
878
|
+
};
|
|
879
|
+
return {
|
|
880
|
+
// Values
|
|
881
|
+
conditionalClasses: n(() => ({
|
|
882
|
+
"b-listbox-multi-select-options__static-category-option": a.staticCategories,
|
|
883
|
+
"b-listbox-multi-select-options__category-option": a.categoryItems
|
|
884
|
+
})),
|
|
885
|
+
// Methods
|
|
886
|
+
isOptionSelected: o,
|
|
887
|
+
shouldShowDescription: s,
|
|
888
|
+
toggleCheckboxSelection: l,
|
|
889
|
+
toggleSearchOption: i,
|
|
890
|
+
computedTabindex: (u) => a.itemsIndex[u] === a.focusedIndex ? 0 : -1,
|
|
891
|
+
// Enums
|
|
892
|
+
BentoListboxEvent: d,
|
|
893
|
+
ListboxMultiSelectOptionsEvent: X
|
|
894
|
+
};
|
|
895
|
+
}
|
|
896
|
+
});
|
|
897
|
+
var vl = function() {
|
|
898
|
+
var e = this, l = e._self._c;
|
|
899
|
+
return e._self._setupProxy, l("div", e._l(e.items, function(t) {
|
|
900
|
+
return l("div", { key: `selected-${t.value}` }, [e.searching && e.isMultiLevel ? [l("bento-listbox-option", { staticClass: "b-listbox-multi-select-options", class: e.conditionalClasses, attrs: { disabled: e.isOptionDisabled ? e.isOptionDisabled(t) : null, tabindex: e.computedTabindex(t.value), "aria-selected": `${e.isOptionSelected(t)}`, "aria-checked": `${e.isOptionSelected(t)}`, "aria-disabled": e.isOptionDisabled ? e.isOptionDisabled(t) : null, role: e.$attrs.role || "option" }, on: { click: function(s) {
|
|
901
|
+
return e.toggleSearchOption(t);
|
|
902
|
+
}, "enter-pressed": function(s) {
|
|
903
|
+
return e.toggleSearchOption(t);
|
|
904
|
+
}, "space-pressed": function(s) {
|
|
905
|
+
return s.preventDefault(), e.toggleSearchOption(t);
|
|
906
|
+
} } }, [l("decorative-checkbox", { attrs: { disabled: e.isOptionDisabled ? e.isOptionDisabled(t) : null, checked: e.isOptionSelected(t) } }), e._t("default", function() {
|
|
907
|
+
return [l("span", { staticClass: "b-listbox-multi-select__option-text" }, [l("bento-typography", { attrs: { el: "span" } }, [e._v(e._s(t.label))]), e.shouldShowDescription(t) ? l("bento-typography", { staticClass: "b-listbox-multi-select__option-description", attrs: { el: "span" } }, [e._v(" " + e._s(t.description) + " ")]) : e._e()], 1)];
|
|
908
|
+
}, null, t)], 2)] : [t.items ? [l("listbox-multi-select-category", { attrs: { category: t, "static-categories": e.staticCategories, "is-option-disabled": e.isOptionDisabled, "selected-items-list": e.selectedItemsList, tabindex: e.computedTabindex(t.value) }, on: { "select-category": function(s) {
|
|
909
|
+
return e.$emit(e.ListboxMultiSelectOptionsEvent.SELECT_CATEGORY, t);
|
|
910
|
+
}, "unselect-category": function(s) {
|
|
911
|
+
return e.$emit(e.ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY, t);
|
|
912
|
+
}, "toggle-category-visibility": function(s) {
|
|
913
|
+
return e.$emit(e.ListboxMultiSelectOptionsEvent.TOGGLE_CATEGORY_VISIBILITY, s);
|
|
914
|
+
} } }, [l("listbox-multi-select-options", { attrs: { "category-items": "", items: t.items, "is-option-disabled": e.isOptionDisabled, "items-index": e.itemsIndex, "focused-index": e.focusedIndex, "is-multi-level": e.isMultiLevel, "static-categories": e.staticCategories, "selected-items-list": e.selectedItemsList, searching: e.searching, role: e.$attrs.role || "option" }, on: { "toggle-checkbox-selection": (s) => e.toggleCheckboxSelection(s) } })], 1)] : l("bento-listbox-option", { staticClass: "b-listbox-multi-select-options", class: e.conditionalClasses, attrs: { disabled: e.isOptionDisabled ? e.isOptionDisabled(t) : null, tabindex: e.computedTabindex(t.value), "aria-selected": `${e.isOptionSelected(t)}`, "aria-checked": `${e.isOptionSelected(t)}`, "aria-disabled": e.isOptionDisabled ? e.isOptionDisabled(t) : null, role: e.$attrs.role || "option" }, on: { click: function(s) {
|
|
915
|
+
return e.toggleCheckboxSelection(t);
|
|
916
|
+
}, "enter-pressed": function(s) {
|
|
917
|
+
return e.toggleCheckboxSelection(t);
|
|
918
|
+
}, "space-pressed": function(s) {
|
|
919
|
+
return s.preventDefault(), e.toggleCheckboxSelection(t);
|
|
920
|
+
} } }, [l("decorative-checkbox", { attrs: { disabled: e.isOptionDisabled ? e.isOptionDisabled(t) : null, checked: e.isOptionSelected(t) } }), e._t("default", function() {
|
|
921
|
+
return [l("span", { staticClass: "b-listbox-multi-select__option-text" }, [l("bento-typography", { attrs: { el: "span" } }, [e._v(e._s(t.label))]), e.shouldShowDescription(t) ? l("bento-typography", { staticClass: "b-listbox-multi-select__option-description", attrs: { el: "span" } }, [e._v(" " + e._s(t.description) + " ")]) : e._e()], 1)];
|
|
922
|
+
}, null, t)], 2)]], 2);
|
|
923
|
+
}), 0);
|
|
924
|
+
}, ml = [], _l = /* @__PURE__ */ U(
|
|
925
|
+
bl,
|
|
926
|
+
vl,
|
|
927
|
+
ml,
|
|
928
|
+
!1,
|
|
929
|
+
null,
|
|
930
|
+
"0985e0a4"
|
|
931
|
+
);
|
|
932
|
+
const yl = _l.exports, lt = (a) => {
|
|
933
|
+
const e = n(() => {
|
|
934
|
+
var t;
|
|
935
|
+
return !!((t = a.value) != null && t.find(({ items: s }) => !!s));
|
|
936
|
+
}), l = n(() => {
|
|
937
|
+
var t;
|
|
938
|
+
return e.value ? (t = a.value) == null ? void 0 : t.reduce((s, o) => (o.items ? s.push(...o.items.flat()) : s.push(o), s), []) : a.value;
|
|
939
|
+
});
|
|
940
|
+
return {
|
|
941
|
+
isMultiLevelSelect: e,
|
|
942
|
+
flattenedItemsList: l
|
|
943
|
+
};
|
|
944
|
+
}, gl = {
|
|
945
|
+
"de-DE": {
|
|
946
|
+
allSelected: "Alle ausgewählt ({total})",
|
|
947
|
+
numberOfTotalSelected: "{number} von {total} ausgewählt",
|
|
948
|
+
numbersSelected: "{number} ausgewählt",
|
|
949
|
+
selectAll: "Alle auswählen ({total})"
|
|
950
|
+
},
|
|
951
|
+
"en-GB": {
|
|
952
|
+
allSelected: "All selected ({total})",
|
|
953
|
+
numberOfTotalSelected: "{number} of {total} selected",
|
|
954
|
+
numbersSelected: "{number} selected",
|
|
955
|
+
selectAll: "Select all ({total})"
|
|
956
|
+
},
|
|
957
|
+
"en-US": {
|
|
958
|
+
allSelected: "All selected ({total})",
|
|
959
|
+
numberOfTotalSelected: "{number} of {total} selected",
|
|
960
|
+
numbersSelected: "{number} selected",
|
|
961
|
+
selectAll: "Select all ({total})"
|
|
962
|
+
},
|
|
963
|
+
"es-ES": {
|
|
964
|
+
allSelected: "Todos seleccionados ({total})",
|
|
965
|
+
numberOfTotalSelected: "{number} de {total} seleccionados",
|
|
966
|
+
numbersSelected: "{number} seleccionado",
|
|
967
|
+
selectAll: "Seleccionar todo ({total})"
|
|
968
|
+
},
|
|
969
|
+
"es-MX": {
|
|
970
|
+
allSelected: "Todos seleccionados ({total})",
|
|
971
|
+
numberOfTotalSelected: "{number} de {total} seleccionados",
|
|
972
|
+
numbersSelected: "{número} seleccionado",
|
|
973
|
+
selectAll: "Seleccionar todo ({total})"
|
|
974
|
+
},
|
|
975
|
+
"fr-FR": {
|
|
976
|
+
allSelected: "Tous sélectionnés ({total})",
|
|
977
|
+
numberOfTotalSelected: "{number} sélectionné(s) sur {total}",
|
|
978
|
+
numbersSelected: "{number} sélectionné(s)",
|
|
979
|
+
selectAll: "Tout sélectionner ({total})"
|
|
980
|
+
},
|
|
981
|
+
"it-IT": {
|
|
982
|
+
allSelected: "Tutti i selezionati ({total})",
|
|
983
|
+
numberOfTotalSelected: "{numero} su {totale} selezionati",
|
|
984
|
+
numbersSelected: "{numero} selezionati",
|
|
985
|
+
selectAll: "Seleziona tutto ({total})"
|
|
986
|
+
},
|
|
987
|
+
"ja-JP": {
|
|
988
|
+
allSelected: "すべて選択 ({total})",
|
|
989
|
+
numberOfTotalSelected: "{total}件中{number}件を選択済み",
|
|
990
|
+
numbersSelected: "{number}件選択済み",
|
|
991
|
+
selectAll: "すべて選択 ({total})"
|
|
992
|
+
},
|
|
993
|
+
"pt-BR": {
|
|
994
|
+
allSelected: "Todos os selecionados ({total})",
|
|
995
|
+
numberOfTotalSelected: "{number} de {total} selecionados",
|
|
996
|
+
numbersSelected: "{number} selecionados",
|
|
997
|
+
selectAll: "Selecionar tudo ({total})"
|
|
998
|
+
},
|
|
999
|
+
"zh-CN": {
|
|
1000
|
+
allSelected: "全部已选 ({total})",
|
|
1001
|
+
numberOfTotalSelected: "已选择 {number} 个,共 {total} 个",
|
|
1002
|
+
numbersSelected: "已选择 {number} 个",
|
|
1003
|
+
selectAll: "选择全部({total})个"
|
|
1004
|
+
}
|
|
1005
|
+
}, hl = { i18n: { messages: gl } }, Sl = /* @__PURE__ */ z({
|
|
1006
|
+
...hl,
|
|
1007
|
+
__name: "listbox-multi-select",
|
|
1008
|
+
props: {
|
|
1009
|
+
hasMoreItems: { type: Boolean, default: !1 },
|
|
1010
|
+
isOptionDisabled: { default: () => () => !1 },
|
|
1011
|
+
items: null,
|
|
1012
|
+
lazyLoadType: { default: "none" },
|
|
1013
|
+
searching: { type: Boolean, default: !1 },
|
|
1014
|
+
selectedValues: null,
|
|
1015
|
+
staticCategories: { type: Boolean, default: !1 }
|
|
1016
|
+
},
|
|
1017
|
+
emits: ["select"],
|
|
1018
|
+
setup(a, { expose: e, emit: l }) {
|
|
1019
|
+
const t = a, { t: s, n: o } = oe(), i = Se(), r = $e(), v = n(
|
|
1020
|
+
() => {
|
|
1021
|
+
var _, S, x, k;
|
|
1022
|
+
return {
|
|
1023
|
+
"aria-label": (_ = r["aria-label"]) == null ? void 0 : _.toString(),
|
|
1024
|
+
"aria-busy": (S = r["aria-busy"]) == null ? void 0 : S.toString(),
|
|
1025
|
+
"aria-atomic": (x = r["aria-atomic"]) == null ? void 0 : x.toString(),
|
|
1026
|
+
"aria-live": (k = r["aria-live"]) == null ? void 0 : k.toString(),
|
|
1027
|
+
"aria-multiselectable": !0
|
|
1028
|
+
};
|
|
1029
|
+
}
|
|
1030
|
+
), u = E(null), c = E(null), g = E(null), b = E(null), f = n(() => t.selectedValues.map(({ value: _ }) => _)), { isMultiLevelSelect: h, flattenedItemsList: y } = lt(K(t, "items")), B = n(() => h.value && !t.staticCategories), R = n(() => B.value ? "tree" : "listbox"), p = n(() => B.value ? "treeitem" : "option"), L = (_) => {
|
|
1031
|
+
var k;
|
|
1032
|
+
const S = t.isOptionDisabled(_), x = ((k = f.value) == null ? void 0 : k.includes(_.value)) || !1;
|
|
1033
|
+
return { isDisabled: S, isPreSelected: x };
|
|
1034
|
+
}, T = n(() => {
|
|
1035
|
+
if (t.searching && h)
|
|
1036
|
+
return t.items;
|
|
1037
|
+
const _ = y.value.filter((S) => {
|
|
1038
|
+
const { isDisabled: x, isPreSelected: k } = L(S);
|
|
1039
|
+
return x && k || !x;
|
|
1040
|
+
});
|
|
1041
|
+
return t.selectedValues.forEach((S) => {
|
|
1042
|
+
_.find((x) => x.value === S.value) || _.push(S);
|
|
1043
|
+
}), _;
|
|
1044
|
+
}), O = n(
|
|
1045
|
+
() => {
|
|
1046
|
+
var _;
|
|
1047
|
+
return (_ = T.value) == null ? void 0 : _.filter((S) => {
|
|
1048
|
+
var x;
|
|
1049
|
+
return S.items && h.value && t.searching ? S.items.filter(
|
|
1050
|
+
(w) => (t.selectedValues ?? []).includes(w.value)
|
|
1051
|
+
).length === S.items.length : (x = f.value) == null ? void 0 : x.includes(S.value);
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
), A = () => h.value && !t.searching ? y.value.length : t.items.length, M = n(() => {
|
|
1055
|
+
var k;
|
|
1056
|
+
const _ = T.value.length, S = A(), x = ((k = O.value) == null ? void 0 : k.length) || 0;
|
|
1057
|
+
return x === 0 ? s("selectAll", { total: o(_) }) : x === S ? s("allSelected", { total: o(S) }) : x <= S ? s("numberOfTotalSelected", { number: o(x), total: o(S) }) : s("numbersSelected", { number: o(x) });
|
|
1058
|
+
}), m = (_) => {
|
|
1059
|
+
const S = (k) => {
|
|
1060
|
+
const { isDisabled: w, isPreSelected: W } = L(k);
|
|
1061
|
+
return w && W || !w;
|
|
1062
|
+
}, x = _.filter(S).filter((k) => !f.value.includes(k.value));
|
|
1063
|
+
l("select", [...t.selectedValues, ...x]);
|
|
1064
|
+
}, C = (_) => {
|
|
1065
|
+
const S = (w) => {
|
|
1066
|
+
const { isDisabled: W, isPreSelected: Le } = L(w);
|
|
1067
|
+
return !(W && Le);
|
|
1068
|
+
}, x = _.filter(S).map(({ value: w }) => w), k = t.selectedValues.filter((w) => !(x != null && x.includes(w.value)));
|
|
1069
|
+
l("select", k);
|
|
1070
|
+
}, I = () => {
|
|
1071
|
+
m(y.value);
|
|
1072
|
+
}, N = () => {
|
|
1073
|
+
C(y.value);
|
|
1074
|
+
}, { isAllSelected: D, isIndeterminate: $, toggleSelectAll: J } = Qe(
|
|
1075
|
+
O,
|
|
1076
|
+
T,
|
|
1077
|
+
I,
|
|
1078
|
+
N
|
|
1079
|
+
), Q = n(() => $.value ? "mixed" : `${D.value}`), q = E(D.value), F = () => {
|
|
1080
|
+
q.value = !q.value, J(q.value);
|
|
1081
|
+
};
|
|
1082
|
+
Z(D, () => {
|
|
1083
|
+
q.value = D.value;
|
|
1084
|
+
});
|
|
1085
|
+
const ee = (_) => {
|
|
1086
|
+
m(_.items);
|
|
1087
|
+
}, ne = (_) => {
|
|
1088
|
+
C(_.items);
|
|
1089
|
+
}, ve = (_, S) => {
|
|
1090
|
+
let x = !1;
|
|
1091
|
+
const k = t.selectedValues.filter(({ value: w }) => S.value === w ? (x = !0, !1) : !0);
|
|
1092
|
+
x || k.push(S), l(_, k);
|
|
1093
|
+
}, De = n(() => {
|
|
1094
|
+
if (!h.value)
|
|
1095
|
+
return t.selectedValues;
|
|
1096
|
+
const _ = (w) => f.value.includes(w.value), S = (w) => !t.staticCategories && w.every((W) => _(W));
|
|
1097
|
+
return t.items.flatMap(
|
|
1098
|
+
(w) => w.items && !S(w.items) ? w.items : w
|
|
1099
|
+
).filter((w) => w.items ? !0 : _(w));
|
|
1100
|
+
}), ke = n(() => {
|
|
1101
|
+
var x, k, w, W;
|
|
1102
|
+
const _ = ["automatic", "button"].includes(t.lazyLoadType), S = ((x = t.selectedValues) == null ? void 0 : x.length) > 0 && ((k = O.value) == null ? void 0 : k.length) !== ((w = y.value) == null ? void 0 : w.length);
|
|
1103
|
+
return _ && t.hasMoreItems ? !!((W = t.selectedValues) != null && W.length) : S;
|
|
1104
|
+
}), me = n(() => ["automatic", "button"].includes(t.lazyLoadType) ? !t.hasMoreItems : !0), H = E([]), { visibleDomOptions: ie, updateVisibleDomOptions: _e } = Pe(
|
|
1105
|
+
u,
|
|
1106
|
+
K(t, "items"),
|
|
1107
|
+
p
|
|
1108
|
+
), xe = (_) => {
|
|
1109
|
+
H.value.includes(_) ? H.value = H.value.filter((S) => S !== _) : H.value.push(_), Y(() => {
|
|
1110
|
+
_e();
|
|
1111
|
+
});
|
|
1112
|
+
}, Ce = (_) => {
|
|
1113
|
+
var S;
|
|
1114
|
+
(S = ie.value[_]) == null || S.focus();
|
|
1115
|
+
}, {
|
|
1116
|
+
moveToNextElement: Oe,
|
|
1117
|
+
moveToPreviousElement: re,
|
|
1118
|
+
moveToFirstElement: ye,
|
|
1119
|
+
moveToLastElement: ce,
|
|
1120
|
+
preventDefault: de,
|
|
1121
|
+
focusedIndex: ue,
|
|
1122
|
+
setListboxFocusedIndex: ge
|
|
1123
|
+
} = et(
|
|
1124
|
+
{
|
|
1125
|
+
items: ie
|
|
1126
|
+
},
|
|
1127
|
+
Ce
|
|
1128
|
+
), Ee = {
|
|
1129
|
+
[V.ARROW_UP]: (_) => re(_),
|
|
1130
|
+
[V.ARROW_DOWN]: (_) => Oe(_),
|
|
1131
|
+
[V.HOME]: ye,
|
|
1132
|
+
[V.END]: ce
|
|
1133
|
+
};
|
|
1134
|
+
e({
|
|
1135
|
+
/**
|
|
1136
|
+
* Method to set the index of the item to be focused on
|
|
1137
|
+
* Used for focus management to be kept in-sync with parent e.g. dropdowns
|
|
1138
|
+
*/
|
|
1139
|
+
setListboxFocusedIndex: ge
|
|
1140
|
+
});
|
|
1141
|
+
const Be = {
|
|
1142
|
+
[V.ARROW_UP]: de,
|
|
1143
|
+
[V.ARROW_DOWN]: de
|
|
1144
|
+
}, Ie = n(() => {
|
|
1145
|
+
let _ = me.value ? 1 : 0;
|
|
1146
|
+
const S = {};
|
|
1147
|
+
return t.items.forEach((x) => {
|
|
1148
|
+
let k = H.value.includes(x.value);
|
|
1149
|
+
x.items ? (t.staticCategories ? k = !0 : S[x.value] = _++, k && x.items.forEach((w) => S[w.value] = _++)) : S[x.value] = _++;
|
|
1150
|
+
}), S;
|
|
1151
|
+
});
|
|
1152
|
+
return { __sfc: !0, props: t, emit: l, t: s, n: o, slots: i, attrs: r, ariaAttributes: v, listboxRef: u, selectAllListboxItemsRef: c, selectedListboxItemsRef: g, listboxItemsRef: b, selectedItemsList: f, isMultiLevelSelect: h, flattenedItemsList: y, isTreePattern: B, computedRole: R, computedOptionRole: p, optionStates: L, enabledItems: T, visibleSelectedList: O, calculateTotalItems: A, selectAllCheckboxText: M, selectAll: m, unselectAll: C, selectAllItems: I, unselectAllItems: N, isAllSelected: D, isIndeterminate: $, toggleSelectAll: J, ariaCheckedComputed: Q, isSelectAllOn: q, handleSelectAll: F, selectAllCategory: ee, unselectAllCategory: ne, toggleCheckboxSelection: ve, selectedOptions: De, showSelectedItems: ke, showSelectAllCheckbox: me, expandedCategories: H, visibleDomOptions: ie, updateVisibleDomOptions: _e, toggleCategoryVisibility: xe, focusItem: Ce, moveToNextElement: Oe, moveToPreviousElement: re, moveToFirstElement: ye, moveToLastElement: ce, preventDefault: de, focusedIndex: ue, setListboxFocusedIndex: ge, listboxListeners: Ee, chipsSectionListeners: Be, computedItemsIndex: Ie, DecorativeCheckbox: Ve, BentoTypography: ae, BentoChip: ht, BentoListboxOption: Ae, ListboxMultiSelectOptions: yl, vBentoKeyboardNavigationDirective: we, BentoListboxEvent: d };
|
|
1153
|
+
}
|
|
1154
|
+
});
|
|
1155
|
+
var xl = function() {
|
|
1156
|
+
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
1157
|
+
return l("div", { ref: "listboxRef", staticClass: "b-listbox-multi-select" }, [t.showSelectedItems ? l("div", [l("ul", e._g({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], staticClass: "b-listbox-multi-select__chips" }, t.chipsSectionListeners), e._l(t.selectedOptions, function(s) {
|
|
1158
|
+
return l("li", { key: s.value }, [l(t.BentoChip, { ref: "selectedListboxItemsRef", refInFor: !0, attrs: { disabled: e.isOptionDisabled(s), label: s.label, condensed: "" }, on: { click: function(o) {
|
|
1159
|
+
s.items ? t.unselectAllCategory(s) : t.toggleCheckboxSelection("select", s);
|
|
1160
|
+
} } })], 1);
|
|
1161
|
+
}), 0), l("hr", { staticClass: "b-listbox-multi-select__divider", attrs: { "aria-hidden": "true" } })]) : e._e(), l("div", e._g(e._b({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], attrs: { role: t.computedRole } }, "div", t.ariaAttributes, !1), t.listboxListeners), [t.showSelectAllCheckbox ? l(t.BentoListboxOption, { ref: "selectAllListboxItemsRef", staticClass: "b-listbox-multi-select__option", attrs: { tabindex: t.focusedIndex === 0 ? 0 : -1, "aria-selected": t.ariaCheckedComputed !== "false", "aria-checked": t.ariaCheckedComputed, role: t.computedOptionRole }, on: { click: t.handleSelectAll, "enter-pressed": t.handleSelectAll, "space-pressed": function(s) {
|
|
1162
|
+
return s.preventDefault(), t.handleSelectAll.apply(null, arguments);
|
|
1163
|
+
} } }, [l(t.DecorativeCheckbox, { attrs: { checked: t.isAllSelected, indeterminate: t.isIndeterminate } }), l(t.BentoTypography, { attrs: { el: "span" } }, [e._v(" " + e._s(t.selectAllCheckboxText) + " ")])], 1) : e._e(), t.showSelectAllCheckbox ? l("hr", { staticClass: "b-listbox-multi-select__divider", attrs: { "aria-hidden": "true" } }) : e._e(), l(t.ListboxMultiSelectOptions, { ref: "listboxItemsRef", attrs: { items: e.items, "is-option-disabled": e.isOptionDisabled, "is-multi-level": t.isMultiLevelSelect, "static-categories": e.staticCategories, searching: e.searching, "selected-items-list": t.selectedItemsList, "focused-index": t.focusedIndex, "items-index": t.computedItemsIndex, role: t.computedOptionRole }, on: { "toggle-checkbox-selection": function(s) {
|
|
1164
|
+
return t.toggleCheckboxSelection("select", s);
|
|
1165
|
+
}, "select-category": t.selectAllCategory, "unselect-category": t.unselectAllCategory, "toggle-category-visibility": t.toggleCategoryVisibility, "space-pressed": function(s) {
|
|
1166
|
+
return t.toggleCheckboxSelection(t.BentoListboxEvent.SPACE, s);
|
|
1167
|
+
}, "tab-pressed": function(s) {
|
|
1168
|
+
return t.toggleCheckboxSelection(t.BentoListboxEvent.TAB, s);
|
|
1169
|
+
}, "enter-pressed": function(s) {
|
|
1170
|
+
return t.toggleCheckboxSelection(t.BentoListboxEvent.ENTER, s);
|
|
1171
|
+
} }, scopedSlots: e._u([e._l(t.slots, function(s, o) {
|
|
1172
|
+
return { key: o, fn: function(i) {
|
|
1173
|
+
return [e._t(o, null, null, i)];
|
|
1174
|
+
} };
|
|
1175
|
+
})], null, !0) })], 1)]);
|
|
1176
|
+
}, Cl = [], Ol = /* @__PURE__ */ U(
|
|
1177
|
+
Sl,
|
|
1178
|
+
xl,
|
|
1179
|
+
Cl,
|
|
1180
|
+
!1,
|
|
1181
|
+
null,
|
|
1182
|
+
"b81d7402"
|
|
1183
|
+
);
|
|
1184
|
+
const Ye = Ol.exports, at = (a, e = 300) => {
|
|
1185
|
+
let l;
|
|
1186
|
+
return (...s) => {
|
|
1187
|
+
l && clearTimeout(l), l = setTimeout(() => a(...s), e);
|
|
1188
|
+
};
|
|
1189
|
+
}, El = {
|
|
1190
|
+
"de-DE": {
|
|
1191
|
+
loading: "Laden",
|
|
1192
|
+
showMore: "Mehr anzeigen"
|
|
1193
|
+
},
|
|
1194
|
+
"en-GB": {
|
|
1195
|
+
loading: "Loading",
|
|
1196
|
+
showMore: "Show more"
|
|
1197
|
+
},
|
|
1198
|
+
"en-US": {
|
|
1199
|
+
loading: "Loading",
|
|
1200
|
+
showMore: "Show more"
|
|
1201
|
+
},
|
|
1202
|
+
"es-ES": {
|
|
1203
|
+
loading: "Cargando",
|
|
1204
|
+
showMore: "Mostrar más"
|
|
1205
|
+
},
|
|
1206
|
+
"es-MX": {
|
|
1207
|
+
loading: "Cargando",
|
|
1208
|
+
showMore: "Mostrar más"
|
|
1209
|
+
},
|
|
1210
|
+
"fr-FR": {
|
|
1211
|
+
loading: "Chargement",
|
|
1212
|
+
showMore: "Afficher plus"
|
|
1213
|
+
},
|
|
1214
|
+
"it-IT": {
|
|
1215
|
+
loading: "Caricamento",
|
|
1216
|
+
showMore: "Mostra di più"
|
|
1217
|
+
},
|
|
1218
|
+
"ja-JP": {
|
|
1219
|
+
loading: "読み込み中",
|
|
1220
|
+
showMore: "さらに表示"
|
|
1221
|
+
},
|
|
1222
|
+
"pt-BR": {
|
|
1223
|
+
loading: "Carregando",
|
|
1224
|
+
showMore: "Mostrar mais"
|
|
1225
|
+
},
|
|
1226
|
+
"zh-CN": {
|
|
1227
|
+
loading: "正在加载",
|
|
1228
|
+
showMore: "显示更多"
|
|
1229
|
+
}
|
|
1230
|
+
}, Il = 36, Ll = z({
|
|
1231
|
+
name: "bento-listbox",
|
|
1232
|
+
components: {
|
|
1233
|
+
BentoEmptyState: mt,
|
|
1234
|
+
BentoListboxSingleSelect: Xt,
|
|
1235
|
+
BentoListboxMultiSelect: Ye,
|
|
1236
|
+
BentoTypography: ae,
|
|
1237
|
+
BentoLoadingIndicator: vt,
|
|
1238
|
+
BentoLoadingButton: St
|
|
1239
|
+
},
|
|
1240
|
+
directives: { BentoKeyboardNavigationDirective: we },
|
|
1241
|
+
i18n: { messages: El },
|
|
1242
|
+
props: {
|
|
1243
|
+
/**
|
|
1244
|
+
* Defines a string value that labels an interactive element.
|
|
1245
|
+
*/
|
|
1246
|
+
ariaLabel: { type: String, default: null },
|
|
1247
|
+
/**
|
|
1248
|
+
* Empty state props that will be used with the inner empty state component to be displayed when no search results are found.
|
|
1249
|
+
*/
|
|
1250
|
+
emptyState: {
|
|
1251
|
+
type: Object,
|
|
1252
|
+
default: void 0
|
|
1253
|
+
},
|
|
1254
|
+
/**
|
|
1255
|
+
* Indicates whether there are more items to load
|
|
1256
|
+
*/
|
|
1257
|
+
hasMoreItems: { type: Boolean, default: !1 },
|
|
1258
|
+
/**
|
|
1259
|
+
* Identifies the listbox whose contents are controlled by the the combobox on which the aria-controls attribute is set.
|
|
1260
|
+
*/
|
|
1261
|
+
id: { type: String, required: !0 },
|
|
1262
|
+
/**
|
|
1263
|
+
* Function that allows the options to be disabled
|
|
1264
|
+
*
|
|
1265
|
+
* @type {BentoListboxIsOptionDisabled}
|
|
1266
|
+
* @param {BentoListboxOptionItem} option - Listbox option object
|
|
1267
|
+
* @param {string} option.label - Option's label text
|
|
1268
|
+
* @param {string|number} option.value - Option's value
|
|
1269
|
+
* @param {unknown} option.data - Option's extra data to be passed to the default slot
|
|
1270
|
+
*/
|
|
1271
|
+
isOptionDisabled: {
|
|
1272
|
+
type: Function,
|
|
1273
|
+
default: () => {
|
|
1274
|
+
}
|
|
1275
|
+
},
|
|
1276
|
+
/**
|
|
1277
|
+
* The option elements to populate the listbox with.
|
|
1278
|
+
* It must be an array of {@see BentoListboxOptionItem }
|
|
1279
|
+
* * @property {string} value.label - Text to be displayed in the option
|
|
1280
|
+
* * @property {string,number} value.value - Value of the option
|
|
1281
|
+
*/
|
|
1282
|
+
items: {
|
|
1283
|
+
type: Array,
|
|
1284
|
+
required: !0
|
|
1285
|
+
},
|
|
1286
|
+
/**
|
|
1287
|
+
* Indicates if new options are lazy loading.
|
|
1288
|
+
*/
|
|
1289
|
+
loading: { type: Boolean, default: !1 },
|
|
1290
|
+
/**
|
|
1291
|
+
* The type of `Lazy Load`.
|
|
1292
|
+
* Type "automatic" will enable infinite scrolling
|
|
1293
|
+
* Type "button" will enable lazy loading with "Show more" button
|
|
1294
|
+
*/
|
|
1295
|
+
lazyLoadType: {
|
|
1296
|
+
type: String,
|
|
1297
|
+
default: te.NONE,
|
|
1298
|
+
validator: (a) => Object.values(te).includes(a)
|
|
1299
|
+
},
|
|
1300
|
+
/**
|
|
1301
|
+
* Indicates the listbox is loading filtered items.
|
|
1302
|
+
*/
|
|
1303
|
+
componentLoading: { type: Boolean, default: !1 },
|
|
1304
|
+
/**
|
|
1305
|
+
* If enabled, the user will be able to select multiple items.
|
|
1306
|
+
*/
|
|
1307
|
+
multiple: { type: Boolean, default: !1 },
|
|
1308
|
+
/**
|
|
1309
|
+
* If enabled, dropdown will display non-selectable, static categories
|
|
1310
|
+
*/
|
|
1311
|
+
staticCategories: { type: Boolean, default: !1 },
|
|
1312
|
+
/**
|
|
1313
|
+
* Messaged displayed when no items are listed in the listbox
|
|
1314
|
+
*/
|
|
1315
|
+
noResultsMessage: { type: String, required: !0 },
|
|
1316
|
+
/**
|
|
1317
|
+
* Flag that indicates that an external search it's being made
|
|
1318
|
+
* to filter out the items inside the the multi-select listbox
|
|
1319
|
+
*
|
|
1320
|
+
* If enabled, hides the "Select all" checkbox in "multiple" mode.
|
|
1321
|
+
*/
|
|
1322
|
+
searching: Ye.props.searching,
|
|
1323
|
+
/**
|
|
1324
|
+
* The `input` value.
|
|
1325
|
+
* Providing an empty string or empty array will select no options.
|
|
1326
|
+
* Set to an empty string `''` if you don't want any of the available options to be selected for single select
|
|
1327
|
+
*/
|
|
1328
|
+
selectedValue: {
|
|
1329
|
+
type: Array,
|
|
1330
|
+
default: () => []
|
|
1331
|
+
},
|
|
1332
|
+
/**
|
|
1333
|
+
* Enables virtual scrolling if set to true or by providing an object with itemHeight function.
|
|
1334
|
+
* The itemHeight function is used to calculate the height of rendered item given it's index.
|
|
1335
|
+
*/
|
|
1336
|
+
virtualScroll: {
|
|
1337
|
+
type: [Boolean, Object],
|
|
1338
|
+
default: !1
|
|
1339
|
+
}
|
|
1340
|
+
},
|
|
1341
|
+
emits: [
|
|
1342
|
+
d.SELECT,
|
|
1343
|
+
d.SPACE,
|
|
1344
|
+
d.SHOW_MORE,
|
|
1345
|
+
d.ENTER,
|
|
1346
|
+
d.ESCAPE,
|
|
1347
|
+
d.TAB
|
|
1348
|
+
],
|
|
1349
|
+
setup(a, { emit: e, slots: l }) {
|
|
1350
|
+
const t = E([]), s = K(a, "items"), { t: o } = oe(), i = n(() => a.lazyLoadType !== te.AUTOMATIC), r = n(() => a.lazyLoadType === te.AUTOMATIC), v = () => {
|
|
1351
|
+
var F;
|
|
1352
|
+
return typeof (a == null ? void 0 : a.virtualScroll) == "object" && ((F = a == null ? void 0 : a.virtualScroll) != null && F.itemHeight) ? a.virtualScroll.itemHeight : Il;
|
|
1353
|
+
}, u = !(a != null && a.multiple) && (a == null ? void 0 : a.virtualScroll) !== !1 && (a == null ? void 0 : a.lazyLoadType) === "none", {
|
|
1354
|
+
containerRef: c,
|
|
1355
|
+
containerProps: g,
|
|
1356
|
+
onScroll: b,
|
|
1357
|
+
list: f,
|
|
1358
|
+
wrapperProps: h,
|
|
1359
|
+
scrollToIndex: y,
|
|
1360
|
+
startIndex: B
|
|
1361
|
+
} = Lt(s, {
|
|
1362
|
+
itemHeight: v(),
|
|
1363
|
+
// Disable virtual scrolling if not enabled or if lazy loading is enabled or if multi-select
|
|
1364
|
+
disabled: !u
|
|
1365
|
+
}), R = n(() => u ? s.value.length : 0), p = n(
|
|
1366
|
+
() => a.componentLoading !== void 0 || i.value ? "true" : void 0
|
|
1367
|
+
), L = n(
|
|
1368
|
+
() => i.value && a.loading || a.componentLoading ? "true" : "false"
|
|
1369
|
+
), T = n(
|
|
1370
|
+
() => i.value || a.componentLoading !== void 0 ? "polite" : void 0
|
|
1371
|
+
), O = n(
|
|
1372
|
+
() => ({
|
|
1373
|
+
"aria-label": a.ariaLabel,
|
|
1374
|
+
"aria-busy": L.value,
|
|
1375
|
+
"aria-atomic": p.value,
|
|
1376
|
+
"aria-live": T.value
|
|
1377
|
+
})
|
|
1378
|
+
), A = n(
|
|
1379
|
+
() => a.componentLoading ? {
|
|
1380
|
+
...O.value,
|
|
1381
|
+
role: "alert"
|
|
1382
|
+
} : {}
|
|
1383
|
+
), M = (F) => (ee) => {
|
|
1384
|
+
e(F, ee);
|
|
1385
|
+
}, m = () => {
|
|
1386
|
+
e(d.SHOW_MORE);
|
|
1387
|
+
}, C = at(() => {
|
|
1388
|
+
const F = c.value;
|
|
1389
|
+
if (!F)
|
|
1390
|
+
return;
|
|
1391
|
+
const ee = Math.round(F.scrollTop) + F.clientHeight >= F.scrollHeight;
|
|
1392
|
+
a.hasMoreItems && ee && !a.loading && m();
|
|
1393
|
+
}), I = () => {
|
|
1394
|
+
r.value ? C() : b();
|
|
1395
|
+
}, N = n(() => {
|
|
1396
|
+
var F;
|
|
1397
|
+
return ((F = a.items) == null ? void 0 : F.length) === 0;
|
|
1398
|
+
}), D = n(
|
|
1399
|
+
() => a.lazyLoadType === te.BUTTON && a.hasMoreItems
|
|
1400
|
+
), $ = n(
|
|
1401
|
+
() => a.loading ? Ue.LOADING : Ue.START
|
|
1402
|
+
), J = n(() => a.loading ? o("loading") : o("showMore")), Q = n(() => ({
|
|
1403
|
+
...a.emptyState,
|
|
1404
|
+
variant: "condensed"
|
|
1405
|
+
})), q = {
|
|
1406
|
+
[d.SELECT]: M(d.SELECT),
|
|
1407
|
+
[d.SPACE]: M(d.SPACE),
|
|
1408
|
+
[d.TAB]: M(d.TAB),
|
|
1409
|
+
[d.ENTER]: M(d.ENTER)
|
|
1410
|
+
};
|
|
1411
|
+
return {
|
|
1412
|
+
// Refs
|
|
1413
|
+
listboxRef: c,
|
|
1414
|
+
listboxItemRef: t,
|
|
1415
|
+
// a11y
|
|
1416
|
+
ariaAttributes: O,
|
|
1417
|
+
listboxContainerAttributes: A,
|
|
1418
|
+
// Values
|
|
1419
|
+
containerProps: g,
|
|
1420
|
+
isSearchResultEmpty: N,
|
|
1421
|
+
limitedEmptyStateProps: Q,
|
|
1422
|
+
loadingButtonState: $,
|
|
1423
|
+
slots: l,
|
|
1424
|
+
shouldDisplayShowMoreButton: D,
|
|
1425
|
+
showMoreButtonText: J,
|
|
1426
|
+
virtualisedItems: f,
|
|
1427
|
+
wrapperProps: h,
|
|
1428
|
+
// Virtual scroll
|
|
1429
|
+
totalItemCount: R,
|
|
1430
|
+
scrollToIndex: y,
|
|
1431
|
+
virtualScrollStartIndex: B,
|
|
1432
|
+
// Enums
|
|
1433
|
+
BentoKeyboardNavigationKeyDownEvent: V,
|
|
1434
|
+
BentoListboxEvent: d,
|
|
1435
|
+
// Methods
|
|
1436
|
+
onListboxContainerScroll: I,
|
|
1437
|
+
onOptionSelected: M,
|
|
1438
|
+
emitShowMore: m,
|
|
1439
|
+
listboxListeners: q
|
|
1440
|
+
};
|
|
1441
|
+
}
|
|
1442
|
+
});
|
|
1443
|
+
var Tl = function() {
|
|
1444
|
+
var t;
|
|
1445
|
+
var e = this, l = e._self._c;
|
|
1446
|
+
return e._self._setupProxy, l("div", e._b({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], ref: "listboxRef", staticClass: "b-listbox", style: (t = e.containerProps) == null ? void 0 : t.style, attrs: { id: e.id, tabindex: "-1", "data-testid": "listbox-container" }, on: { scroll: e.onListboxContainerScroll } }, "div", e.listboxContainerAttributes, !1), [l("div", e._b({}, "div", e.wrapperProps, !1), [e.componentLoading ? l("div", { staticClass: "b-listbox__loading-filtered-items" }, [l("bento-loading-indicator")], 1) : e.isSearchResultEmpty ? l("div", { staticClass: "b-listbox__empty-search-message" }, [e.emptyState ? l("bento-empty-state", e._b({}, "bento-empty-state", e.limitedEmptyStateProps, !1)) : l("bento-typography", { attrs: { el: "span" } }, [e._v(e._s(e.noResultsMessage))])], 1) : [e.multiple ? [l("bento-listbox-multi-select", e._g(e._b({ ref: "listboxItemRef", attrs: { "has-more-items": e.hasMoreItems, items: e.items, "lazy-load-type": e.lazyLoadType, "static-categories": e.staticCategories, "selected-values": e.selectedValue, searching: e.searching, "is-option-disabled": e.isOptionDisabled }, scopedSlots: e._u([e._l(e.slots, function(s, o) {
|
|
1447
|
+
return { key: o, fn: function(i) {
|
|
1448
|
+
return [e._t(o, null, null, i)];
|
|
1449
|
+
} };
|
|
1450
|
+
})], null, !0) }, "bento-listbox-multi-select", e.ariaAttributes, !1), e.listboxListeners))] : [l("bento-listbox-single-select", e._g(e._b({ ref: "listboxItemRef", attrs: { items: e.virtualisedItems, "total-item-count": e.totalItemCount, "scroll-to-index": e.scrollToIndex, "virtual-scroll-start-index": e.virtualScrollStartIndex, "selected-value": e.selectedValue, "static-categories": e.staticCategories, "is-option-disabled": e.isOptionDisabled }, scopedSlots: e._u([e._l(e.slots, function(s, o) {
|
|
1451
|
+
return { key: o, fn: function(i) {
|
|
1452
|
+
return [e._t(o, null, null, i)];
|
|
1453
|
+
} };
|
|
1454
|
+
})], null, !0) }, "bento-listbox-single-select", e.ariaAttributes, !1), e.listboxListeners))], e.shouldDisplayShowMoreButton ? l("div", { staticClass: "b-listbox__lazy-load" }, [l("bento-loading-button", { attrs: { state: e.loadingButtonState, variant: "secondary" }, on: { "!click": function(s) {
|
|
1455
|
+
return e.emitShowMore.apply(null, arguments);
|
|
1456
|
+
} } }, [e._v(" " + e._s(e.showMoreButtonText) + " ")])], 1) : e.loading ? l("div", { staticClass: "b-listbox__lazy-load" }, [l("bento-loading-indicator")], 1) : e._e()]], 2)]);
|
|
1457
|
+
}, wl = [], Al = /* @__PURE__ */ U(
|
|
1458
|
+
Ll,
|
|
1459
|
+
Tl,
|
|
1460
|
+
wl,
|
|
1461
|
+
!1,
|
|
1462
|
+
null,
|
|
1463
|
+
"7819d7a2"
|
|
1464
|
+
);
|
|
1465
|
+
const Me = Al.exports, Ne = (a, e) => {
|
|
1466
|
+
for (const l of a) {
|
|
1467
|
+
if (l.value === e)
|
|
1468
|
+
return l;
|
|
1469
|
+
if (l.items) {
|
|
1470
|
+
const t = Ne(l.items, e);
|
|
1471
|
+
if (t)
|
|
1472
|
+
return t;
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
return null;
|
|
1476
|
+
}, Dl = (a) => typeof a == "object" && a !== null && "value" in a && "label" in a, kl = (a, e, l, t) => {
|
|
1477
|
+
const s = E([]), o = E(), i = (c) => {
|
|
1478
|
+
l.value ? o.value = c.map(({ value: g }) => g) : o.value = c.length > 0 ? c[0].value : null;
|
|
1479
|
+
}, r = (c) => {
|
|
1480
|
+
l.value ? o.value = c.map(({ value: g, label: b }) => ({ value: g, label: b })) : o.value = c.length > 0 ? { value: c[0].value, label: c[0].label } : null;
|
|
1481
|
+
}, v = (c) => {
|
|
1482
|
+
s.value = c, t != null && t.value ? r(c) : i(c);
|
|
1483
|
+
}, u = () => {
|
|
1484
|
+
s.value = [], o.value = null;
|
|
1485
|
+
};
|
|
1486
|
+
return Z(
|
|
1487
|
+
() => e.value,
|
|
1488
|
+
() => {
|
|
1489
|
+
if (!e.value && e.value !== 0) {
|
|
1490
|
+
u();
|
|
1491
|
+
return;
|
|
1492
|
+
}
|
|
1493
|
+
const c = !Array.isArray(e.value), g = [...s.value];
|
|
1494
|
+
u();
|
|
1495
|
+
const b = (f) => {
|
|
1496
|
+
if (Dl(f))
|
|
1497
|
+
s.value.push(f);
|
|
1498
|
+
else {
|
|
1499
|
+
let h = Ne(a.value, f);
|
|
1500
|
+
h || (h = Ne(g, f)), h || (h = { value: f, label: f.toString() }), s.value.push(h);
|
|
1501
|
+
}
|
|
1502
|
+
};
|
|
1503
|
+
if (c) {
|
|
1504
|
+
const f = e.value;
|
|
1505
|
+
b(f), t != null && t.value ? r(s.value) : i(s.value);
|
|
1506
|
+
return;
|
|
1507
|
+
}
|
|
1508
|
+
e.value.forEach(b), t != null && t.value ? r(s.value) : i(s.value);
|
|
1509
|
+
},
|
|
1510
|
+
{ immediate: !0 }
|
|
1511
|
+
), {
|
|
1512
|
+
// Values
|
|
1513
|
+
cachedSelectedListboxOptions: s,
|
|
1514
|
+
cachedListboxSelectedValues: o,
|
|
1515
|
+
// Methods
|
|
1516
|
+
resetCache: u,
|
|
1517
|
+
setCachedValues: v
|
|
1518
|
+
};
|
|
1519
|
+
};
|
|
1520
|
+
var be = /* @__PURE__ */ ((a) => (a.DEFAULT = "DropdownInputDefault", a.SMALL = "DropdownInputSmall", a))(be || {});
|
|
1521
|
+
const Bl = {
|
|
1522
|
+
"de-DE": {
|
|
1523
|
+
apply: "Anwenden",
|
|
1524
|
+
cancel: "Abbrechen",
|
|
1525
|
+
noOptionsMatchThisSearch: "Für diese Suche wurden keine Ergebnisse gefunden."
|
|
1526
|
+
},
|
|
1527
|
+
"en-GB": {
|
|
1528
|
+
apply: "Apply",
|
|
1529
|
+
cancel: "Cancel",
|
|
1530
|
+
noOptionsMatchThisSearch: "No options match this search"
|
|
1531
|
+
},
|
|
1532
|
+
"en-US": {
|
|
1533
|
+
apply: "Apply",
|
|
1534
|
+
cancel: "Cancel",
|
|
1535
|
+
noOptionsMatchThisSearch: "No options match this search"
|
|
1536
|
+
},
|
|
1537
|
+
"es-ES": {
|
|
1538
|
+
apply: "Aplicar",
|
|
1539
|
+
cancel: "Cancelar",
|
|
1540
|
+
noOptionsMatchThisSearch: "No hay opciones que coincidan con esta búsqueda"
|
|
1541
|
+
},
|
|
1542
|
+
"es-MX": {
|
|
1543
|
+
apply: "Aplicar",
|
|
1544
|
+
cancel: "Cancelar",
|
|
1545
|
+
noOptionsMatchThisSearch: "No hay opciones que coincidan con esta búsqueda"
|
|
1546
|
+
},
|
|
1547
|
+
"fr-FR": {
|
|
1548
|
+
apply: "Appliquer",
|
|
1549
|
+
cancel: "Annuler",
|
|
1550
|
+
noOptionsMatchThisSearch: "Aucune option ne correspond à cette recherche"
|
|
1551
|
+
},
|
|
1552
|
+
"it-IT": {
|
|
1553
|
+
apply: "Applica",
|
|
1554
|
+
cancel: "Annulla",
|
|
1555
|
+
noOptionsMatchThisSearch: "Nessun risultato corrispondente a questa ricerca"
|
|
1556
|
+
},
|
|
1557
|
+
"ja-JP": {
|
|
1558
|
+
apply: "適用",
|
|
1559
|
+
cancel: "キャンセル",
|
|
1560
|
+
noOptionsMatchThisSearch: "この検索に一致するオプションはありません"
|
|
1561
|
+
},
|
|
1562
|
+
"pt-BR": {
|
|
1563
|
+
apply: "Aplicar",
|
|
1564
|
+
cancel: "Cancelar",
|
|
1565
|
+
noOptionsMatchThisSearch: "Nenhuma opção corresponde a esta busca"
|
|
1566
|
+
},
|
|
1567
|
+
"zh-CN": {
|
|
1568
|
+
apply: "应用",
|
|
1569
|
+
cancel: "取消",
|
|
1570
|
+
noOptionsMatchThisSearch: "没有符合此搜索条件的选项"
|
|
1571
|
+
}
|
|
1572
|
+
}, Rl = (a, e, l, t) => {
|
|
1573
|
+
const s = E(a.value), { t: o } = oe();
|
|
1574
|
+
Z(a, () => {
|
|
1575
|
+
s.value = a.value;
|
|
1576
|
+
});
|
|
1577
|
+
const i = n(
|
|
1578
|
+
() => JSON.stringify(s.value) === JSON.stringify(a.value)
|
|
1579
|
+
), r = () => {
|
|
1580
|
+
t(d.SELECT, s.value), t(d.CLOSE_DROPDOWN);
|
|
1581
|
+
}, v = () => {
|
|
1582
|
+
s.value = a.value, t(d.CLOSE_DROPDOWN);
|
|
1583
|
+
}, u = () => {
|
|
1584
|
+
l.value && e.value && (s.value = a.value);
|
|
1585
|
+
}, c = n(() => [
|
|
1586
|
+
{
|
|
1587
|
+
title: o("apply"),
|
|
1588
|
+
event: r,
|
|
1589
|
+
disabled: i.value
|
|
1590
|
+
},
|
|
1591
|
+
{
|
|
1592
|
+
title: o("cancel"),
|
|
1593
|
+
event: v
|
|
1594
|
+
}
|
|
1595
|
+
]), g = (p) => {
|
|
1596
|
+
s.value = p, e.value || t(d.SELECT, p);
|
|
1597
|
+
}, b = (p) => {
|
|
1598
|
+
g(p), t(d.TAB);
|
|
1599
|
+
}, f = (p) => {
|
|
1600
|
+
g(p), t(d.ENTER);
|
|
1601
|
+
}, h = (p) => {
|
|
1602
|
+
g(p), t(d.SPACE);
|
|
1603
|
+
}, y = () => {
|
|
1604
|
+
v(), t(d.ESCAPE);
|
|
1605
|
+
}, B = () => {
|
|
1606
|
+
t(d.SHOW_MORE);
|
|
1607
|
+
}, R = {
|
|
1608
|
+
[d.SELECT]: g,
|
|
1609
|
+
[d.SHOW_MORE]: B,
|
|
1610
|
+
[d.TAB]: b,
|
|
1611
|
+
[d.SPACE]: h,
|
|
1612
|
+
[d.ENTER]: f
|
|
1613
|
+
};
|
|
1614
|
+
return {
|
|
1615
|
+
// Values
|
|
1616
|
+
actions: c,
|
|
1617
|
+
internalSelectedValue: s,
|
|
1618
|
+
// Methods
|
|
1619
|
+
listeners: R,
|
|
1620
|
+
onEscapeKey: y,
|
|
1621
|
+
onOutsideDropdownClick: u
|
|
1622
|
+
};
|
|
1623
|
+
}, Ml = z({
|
|
1624
|
+
i18n: { messages: Bl },
|
|
1625
|
+
name: "bento-dropdown-options-container"
|
|
1626
|
+
}), Nl = /* @__PURE__ */ z({
|
|
1627
|
+
...Ml,
|
|
1628
|
+
props: {
|
|
1629
|
+
/**
|
|
1630
|
+
* Defines a string value that labels an interactive element.
|
|
1631
|
+
*/
|
|
1632
|
+
ariaLabel: { type: String, default: null },
|
|
1633
|
+
/**
|
|
1634
|
+
* Indicates that dropdown items are loading
|
|
1635
|
+
*/
|
|
1636
|
+
componentLoading: { type: Boolean, default: !1 },
|
|
1637
|
+
/**
|
|
1638
|
+
* Empty state props used with the inner empty state component which is displayed when no search results are found.
|
|
1639
|
+
*/
|
|
1640
|
+
emptyState: {
|
|
1641
|
+
type: Object,
|
|
1642
|
+
default: void 0
|
|
1643
|
+
},
|
|
1644
|
+
/**
|
|
1645
|
+
* Disables dropdown functionality
|
|
1646
|
+
*/
|
|
1647
|
+
disabled: { type: Boolean, default: !1 },
|
|
1648
|
+
/**
|
|
1649
|
+
* Indicates whether there are more items to load
|
|
1650
|
+
*/
|
|
1651
|
+
hasMoreItems: { type: Boolean, default: !1 },
|
|
1652
|
+
/**
|
|
1653
|
+
* Identifies the listbox whose contents are controlled by the the combobox on which the aria-controls attribute is set.
|
|
1654
|
+
*/
|
|
1655
|
+
id: { type: String, required: !0 },
|
|
1656
|
+
/**
|
|
1657
|
+
* Function that allows the options to be disabled
|
|
1658
|
+
*
|
|
1659
|
+
* @type {BentoDropdownIsOptionDisabled}
|
|
1660
|
+
* @param {BentoDropdownOptionItem} option - Dropdown option object
|
|
1661
|
+
* @param {string} option.label - Option's label text
|
|
1662
|
+
* @param {string|number} option.value - Option's value
|
|
1663
|
+
* @param {unknown} option.data - Option's extra data to be passed to the default slot
|
|
1664
|
+
*/
|
|
1665
|
+
isOptionDisabled: {
|
|
1666
|
+
type: Function,
|
|
1667
|
+
default: void 0
|
|
1668
|
+
},
|
|
1669
|
+
/**
|
|
1670
|
+
* The option elements to populate the dropdown with.
|
|
1671
|
+
* It must be an array of {@see BentoDropdownOptionItem }
|
|
1672
|
+
* * @property {string} value.label - Text to be displayed in the option
|
|
1673
|
+
* * @property {string,number} value.value - Value of the option
|
|
1674
|
+
*/
|
|
1675
|
+
items: {
|
|
1676
|
+
type: Array,
|
|
1677
|
+
required: !0
|
|
1678
|
+
},
|
|
1679
|
+
/**
|
|
1680
|
+
* The type of `Lazy Load`.
|
|
1681
|
+
* Type "automatic" will enable infinite scrolling
|
|
1682
|
+
* Type "button" will enable lazy loading with "Show more" button
|
|
1683
|
+
*/
|
|
1684
|
+
lazyLoadType: {
|
|
1685
|
+
type: String,
|
|
1686
|
+
default: te.AUTOMATIC,
|
|
1687
|
+
validator: (a) => Object.values(te).includes(a)
|
|
1688
|
+
},
|
|
1689
|
+
/**
|
|
1690
|
+
* Indicates if new options are lazy loading.
|
|
1691
|
+
*/
|
|
1692
|
+
loading: { type: Boolean, default: !1 },
|
|
1693
|
+
/**
|
|
1694
|
+
* If enabled, the user will be able to select multiple items.
|
|
1695
|
+
*/
|
|
1696
|
+
multiple: { type: Boolean, default: !1 },
|
|
1697
|
+
/**
|
|
1698
|
+
* Indicates if the dropdown is open so that
|
|
1699
|
+
* the container can be displayed.
|
|
1700
|
+
*/
|
|
1701
|
+
open: { type: Boolean, required: !0 },
|
|
1702
|
+
/**
|
|
1703
|
+
* The `input` value.
|
|
1704
|
+
* Providing an empty string or empty array will select no options.
|
|
1705
|
+
* Set to an empty string `''` if you don't want any of the available options to be selected for single select
|
|
1706
|
+
*/
|
|
1707
|
+
selectedValue: {
|
|
1708
|
+
type: Array,
|
|
1709
|
+
default: null
|
|
1710
|
+
},
|
|
1711
|
+
/**
|
|
1712
|
+
* Flag that indicates that an external search it's being made
|
|
1713
|
+
* to filter out the items inside the the multi-select listbox
|
|
1714
|
+
*
|
|
1715
|
+
* If enabled, hides the "Select all" checkbox in "multiple" mode.
|
|
1716
|
+
*/
|
|
1717
|
+
searching: Me.props.searching,
|
|
1718
|
+
/**
|
|
1719
|
+
* If enabled, dropdown will display non-selectable, static categories
|
|
1720
|
+
*/
|
|
1721
|
+
staticCategories: { type: Boolean, default: !1 },
|
|
1722
|
+
/**
|
|
1723
|
+
* Reference to the DOM element or Vue component for positioning
|
|
1724
|
+
* the Dropdown container.
|
|
1725
|
+
*/
|
|
1726
|
+
targetElement: { type: Ge.props.targetElement.type, required: !0 },
|
|
1727
|
+
/**
|
|
1728
|
+
* Enables virtual scrolling if set to true or by providing an object with itemHeight function.
|
|
1729
|
+
* The itemHeight function is used to calculate the height of rendered item given it's index.
|
|
1730
|
+
*/
|
|
1731
|
+
virtualScroll: {
|
|
1732
|
+
type: [Boolean, Object],
|
|
1733
|
+
default: !1
|
|
1734
|
+
}
|
|
1735
|
+
},
|
|
1736
|
+
emits: [],
|
|
1737
|
+
setup(a, { expose: e, emit: l }) {
|
|
1738
|
+
const t = a, s = Se(), { selectedValue: o, multiple: i } = He(t), r = E(null), { t: v } = oe(), u = n(() => t.open && !t.disabled), c = n(() => v("noOptionsMatchThisSearch")), g = n(() => ({
|
|
1739
|
+
"b-dropdown-options-container--single": !(t != null && t.multiple)
|
|
1740
|
+
})), b = n(() => ({
|
|
1741
|
+
"b-dropdown-options-container__listbox--single": !(t != null && t.multiple)
|
|
1742
|
+
})), { actions: f, internalSelectedValue: h, listeners: y, onEscapeKey: B, onOutsideDropdownClick: R } = Rl(o, i, u, l), p = n(() => t != null && t.multiple ? xt : Ge), L = n(() => {
|
|
1743
|
+
var O;
|
|
1744
|
+
const T = {
|
|
1745
|
+
"min-width": `${(O = t == null ? void 0 : t.targetElement) == null ? void 0 : O.clientWidth}px`,
|
|
1746
|
+
"max-width": "min(500px, 95%)"
|
|
1747
|
+
};
|
|
1748
|
+
return t != null && t.multiple ? {
|
|
1749
|
+
actionsLayout: "space-between",
|
|
1750
|
+
ariaLabel: t.ariaLabel,
|
|
1751
|
+
actions: f.value,
|
|
1752
|
+
divider: !0,
|
|
1753
|
+
fallbackPosition: ["top-start"],
|
|
1754
|
+
id: le(`dropdown-options-${t.id}`),
|
|
1755
|
+
open: t.open,
|
|
1756
|
+
position: "bottom-start",
|
|
1757
|
+
style: {
|
|
1758
|
+
width: "auto",
|
|
1759
|
+
...T
|
|
1760
|
+
},
|
|
1761
|
+
targetElement: t.targetElement
|
|
1762
|
+
} : {
|
|
1763
|
+
fallbackPosition: ["top-start"],
|
|
1764
|
+
offset: [0, 8],
|
|
1765
|
+
position: "bottom-start",
|
|
1766
|
+
style: {
|
|
1767
|
+
display: u.value ? "block" : "none",
|
|
1768
|
+
...T
|
|
1769
|
+
},
|
|
1770
|
+
targetElement: t.targetElement
|
|
1771
|
+
};
|
|
1772
|
+
});
|
|
1773
|
+
return e({
|
|
1774
|
+
onOutsideDropdownClick: R
|
|
1775
|
+
}), { __sfc: !0, slots: s, emit: l, props: t, selectedValue: o, multiple: i, dropdownOptionsListboxRef: r, t: v, isDropdownOpen: u, noResultsMessage: c, conditionalClasses: g, conditionalListboxClasses: b, actions: f, internalSelectedValue: h, listeners: y, onEscapeKey: B, onOutsideDropdownClick: R, popperContainerOrPopoverComponent: p, popperContainerOrPopoverProps: L, BentoListbox: Me };
|
|
1776
|
+
}
|
|
1777
|
+
});
|
|
1778
|
+
var $l = function() {
|
|
1779
|
+
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
1780
|
+
return t.isDropdownOpen ? l(t.popperContainerOrPopoverComponent, e._b({ tag: "component", staticClass: "b-dropdown-options-container", class: t.conditionalClasses }, "component", t.popperContainerOrPopoverProps, !1), [l("div", { on: { keydown: function(s) {
|
|
1781
|
+
return !s.type.indexOf("key") && e._k(s.keyCode, "esc", 27, s.key, ["Esc", "Escape"]) ? null : t.onEscapeKey.apply(null, arguments);
|
|
1782
|
+
} } }, [l(t.BentoListbox, e._g({ ref: "dropdownOptionsListboxRef", staticClass: "b-dropdown-options-container__listbox", class: t.conditionalListboxClasses, attrs: { id: e.id, "aria-label": e.ariaLabel, "component-loading": e.componentLoading, "empty-state": e.emptyState, "is-option-disabled": e.isOptionDisabled, items: e.items, "selected-value": t.internalSelectedValue, multiple: t.multiple, "static-categories": e.staticCategories, "no-results-message": t.noResultsMessage, searching: e.searching, loading: e.loading, "lazy-load-type": e.lazyLoadType, "has-more-items": e.hasMoreItems, "virtual-scroll": e.virtualScroll }, scopedSlots: e._u([e._l(t.slots, function(s, o) {
|
|
1783
|
+
return { key: o, fn: function(i) {
|
|
1784
|
+
return [e._t(o, null, null, i)];
|
|
1785
|
+
} };
|
|
1786
|
+
})], null, !0) }, t.listeners))], 1)]) : e._e();
|
|
1787
|
+
}, Fl = [], Pl = /* @__PURE__ */ U(
|
|
1788
|
+
Nl,
|
|
1789
|
+
$l,
|
|
1790
|
+
Fl,
|
|
1791
|
+
!1,
|
|
1792
|
+
null,
|
|
1793
|
+
"9e0761e0"
|
|
1794
|
+
);
|
|
1795
|
+
const Vl = Pl.exports;
|
|
1796
|
+
var j = /* @__PURE__ */ ((a) => (a.DISABLED = "disabled", a.READONLY = "readonly", a.HAS_ITEMS = "has-items", a.OPENED = "opened", a.ERROR = "error", a))(j || {}), G = /* @__PURE__ */ ((a) => (a.OPEN = "dropdown-base-open", a.KEYDOWN = "dropdown-base-keydown", a.CLOSE = "dropdown-base-close", a.INPUT = "dropdown-base-input", a.CLEAR = "dropdown-base-clear", a))(G || {});
|
|
1797
|
+
const zl = /* @__PURE__ */ Symbol("dropdown small size injection key"), st = /* @__PURE__ */ Symbol("dropdown underline style injection key"), Ul = {
|
|
1798
|
+
"de-DE": {
|
|
1799
|
+
clearSearch: "Suche löschen"
|
|
1800
|
+
},
|
|
1801
|
+
"en-GB": {
|
|
1802
|
+
clearSearch: "Clear search"
|
|
1803
|
+
},
|
|
1804
|
+
"en-US": {
|
|
1805
|
+
clearSearch: "Clear search"
|
|
1806
|
+
},
|
|
1807
|
+
"es-ES": {
|
|
1808
|
+
clearSearch: "Borrar búsqueda"
|
|
1809
|
+
},
|
|
1810
|
+
"es-MX": {
|
|
1811
|
+
clearSearch: "Borrar búsqueda"
|
|
1812
|
+
},
|
|
1813
|
+
"fr-FR": {
|
|
1814
|
+
clearSearch: "Effacer la recherche"
|
|
1815
|
+
},
|
|
1816
|
+
"it-IT": {
|
|
1817
|
+
clearSearch: "Cancella ricerca"
|
|
1818
|
+
},
|
|
1819
|
+
"ja-JP": {
|
|
1820
|
+
clearSearch: "検索をクリア"
|
|
1821
|
+
},
|
|
1822
|
+
"pt-BR": {
|
|
1823
|
+
clearSearch: "Limpar busca"
|
|
1824
|
+
},
|
|
1825
|
+
"zh-CN": {
|
|
1826
|
+
clearSearch: "清除搜索"
|
|
1827
|
+
}
|
|
1828
|
+
}, Gl = z({
|
|
1829
|
+
i18n: { messages: Ul },
|
|
1830
|
+
name: "dropdown-base-textbox",
|
|
1831
|
+
inheritAttrs: !1
|
|
1832
|
+
}), Kl = /* @__PURE__ */ z({
|
|
1833
|
+
...Gl,
|
|
1834
|
+
props: {
|
|
1835
|
+
/**
|
|
1836
|
+
* The number of additional items that have been selected in the dropdown.
|
|
1837
|
+
*/
|
|
1838
|
+
additionalItemsSelected: { type: [Number, String], default: 0 },
|
|
1839
|
+
/**
|
|
1840
|
+
* If the combobox DOM element should be an `input` element.
|
|
1841
|
+
*/
|
|
1842
|
+
alwaysComboboxIsInput: {
|
|
1843
|
+
type: Boolean,
|
|
1844
|
+
default: !1
|
|
1845
|
+
},
|
|
1846
|
+
/**
|
|
1847
|
+
* Sets the aria-controls attribute on the textbox. This should correspond to the popover's id that the textbox triggers.
|
|
1848
|
+
*/
|
|
1849
|
+
ariaControls: { type: String, required: !0 },
|
|
1850
|
+
/**
|
|
1851
|
+
* Indicates whether the content the textbox triggers is visible or not. Needs to be set accordingly when the textbox is used and changed every time the popover is shown/hidden.
|
|
1852
|
+
*/
|
|
1853
|
+
ariaExpanded: {
|
|
1854
|
+
type: [String, Boolean],
|
|
1855
|
+
required: !0
|
|
1856
|
+
},
|
|
1857
|
+
/**
|
|
1858
|
+
* If no label element is used then the aria-label is be set should be set.
|
|
1859
|
+
*/
|
|
1860
|
+
ariaLabel: { type: String, default: null },
|
|
1861
|
+
/**
|
|
1862
|
+
* Corresponds to the label's id that labels the textbox element.
|
|
1863
|
+
*/
|
|
1864
|
+
ariaLabelledby: { type: String, default: null },
|
|
1865
|
+
/**
|
|
1866
|
+
* Disables any textbox functionality
|
|
1867
|
+
*/
|
|
1868
|
+
disabled: { type: Boolean, default: !1 },
|
|
1869
|
+
/**
|
|
1870
|
+
* Selected option's label
|
|
1871
|
+
*/
|
|
1872
|
+
displayValue: { type: String, default: null },
|
|
1873
|
+
/**
|
|
1874
|
+
* Sets the possibility to type into the textbox.
|
|
1875
|
+
*/
|
|
1876
|
+
dynamicFiltering: { type: Boolean, default: !1 },
|
|
1877
|
+
/**
|
|
1878
|
+
* Marks the textbox as invalid, rendering an error state
|
|
1879
|
+
*/
|
|
1880
|
+
isInvalid: { type: Boolean, default: !1 },
|
|
1881
|
+
/*
|
|
1882
|
+
* If enabled, the user will be able to select multiple items.
|
|
1883
|
+
*/
|
|
1884
|
+
multiple: { type: Boolean, default: !1 },
|
|
1885
|
+
/**
|
|
1886
|
+
* Indicates if the dropdown is open so that
|
|
1887
|
+
* the respective event can be emitted
|
|
1888
|
+
*/
|
|
1889
|
+
open: { type: Boolean, default: !1 },
|
|
1890
|
+
/**
|
|
1891
|
+
* Sets the dropdown to readonly state
|
|
1892
|
+
*/
|
|
1893
|
+
readonly: { type: Boolean, default: !1 },
|
|
1894
|
+
/**
|
|
1895
|
+
* The input value
|
|
1896
|
+
*/
|
|
1897
|
+
value: { type: String, default: "" },
|
|
1898
|
+
/**
|
|
1899
|
+
* The selected value's list box item.
|
|
1900
|
+
*/
|
|
1901
|
+
selectedValueItem: {
|
|
1902
|
+
type: [Object, Array],
|
|
1903
|
+
default: void 0
|
|
1904
|
+
},
|
|
1905
|
+
/**
|
|
1906
|
+
* Toggles whether to use the slot content select items shown in the textbox in multiple mode.
|
|
1907
|
+
*/
|
|
1908
|
+
showSlotContentInMultiple: { type: Boolean, default: !1 },
|
|
1909
|
+
/**
|
|
1910
|
+
* Dropdown size
|
|
1911
|
+
*/
|
|
1912
|
+
size: {
|
|
1913
|
+
type: String,
|
|
1914
|
+
default: null
|
|
1915
|
+
}
|
|
1916
|
+
},
|
|
1917
|
+
emits: [],
|
|
1918
|
+
setup(a, { expose: e, emit: l }) {
|
|
1919
|
+
const t = a, { t: s } = oe(), o = $e(), i = Se(), r = Je(i), v = E(null), u = le("textbox"), c = Fe(st, !1), g = n(() => ({
|
|
1920
|
+
[`b-dropdown-base-textbox--${j.DISABLED}`]: t.disabled,
|
|
1921
|
+
[`b-dropdown-base-textbox--${j.READONLY}`]: t.readonly,
|
|
1922
|
+
[`b-dropdown-base-textbox--${j.HAS_ITEMS}`]: !!t.additionalItemsSelected,
|
|
1923
|
+
"b-dropdown-base-textbox--underline": c
|
|
1924
|
+
})), b = n(
|
|
1925
|
+
() => R.value && o["aria-required"] ? "true" : null
|
|
1926
|
+
), f = n(() => ({
|
|
1927
|
+
"b-dropdown-base-textbox__input--dynamic-filtering": t.dynamicFiltering
|
|
1928
|
+
})), h = n(() => t.dynamicFiltering && !!t.value && t.open), y = n(
|
|
1929
|
+
() => {
|
|
1930
|
+
var I;
|
|
1931
|
+
return {
|
|
1932
|
+
"aria-haspopup": "listbox",
|
|
1933
|
+
"aria-controls": t.ariaControls,
|
|
1934
|
+
"aria-describedby": (I = o["aria-describedby"]) == null ? void 0 : I.toString(),
|
|
1935
|
+
"aria-expanded": t.ariaExpanded ? "true" : "false",
|
|
1936
|
+
"aria-labelledby": t.ariaLabelledby,
|
|
1937
|
+
"aria-label": t.ariaLabelledby ? null : t.ariaLabel,
|
|
1938
|
+
"aria-invalid": t.isInvalid,
|
|
1939
|
+
"aria-disabled": t.disabled ? !0 : null,
|
|
1940
|
+
"aria-required": o["aria-required"]
|
|
1941
|
+
};
|
|
1942
|
+
}
|
|
1943
|
+
), B = n(
|
|
1944
|
+
() => t.multiple ? t.selectedValueItem : []
|
|
1945
|
+
), R = n(() => t.dynamicFiltering && (t.open || t.alwaysComboboxIsInput)), p = n(() => t.selectedValueItem && !t.multiple), L = n(
|
|
1946
|
+
() => t.multiple && t.selectedValueItem && B.value.length > 0 && t.showSlotContentInMultiple
|
|
1947
|
+
);
|
|
1948
|
+
Z(
|
|
1949
|
+
() => R.value,
|
|
1950
|
+
() => {
|
|
1951
|
+
R.value && !t.alwaysComboboxIsInput && Y(() => {
|
|
1952
|
+
v.value.focus();
|
|
1953
|
+
});
|
|
1954
|
+
}
|
|
1955
|
+
);
|
|
1956
|
+
const T = async () => {
|
|
1957
|
+
!t.disabled && !t.readonly && (l(G.OPEN), await Y(), v.value.focus());
|
|
1958
|
+
}, O = () => {
|
|
1959
|
+
t.open && (v.value.focus(), l(G.CLOSE));
|
|
1960
|
+
}, A = (I) => t.open && I.target.tagName === "INPUT" ? null : t.open ? O() : T(), M = () => {
|
|
1961
|
+
l(G.CLEAR), l(G.INPUT, ""), v.value.focus();
|
|
1962
|
+
}, m = (I) => {
|
|
1963
|
+
!t.readonly && !t.disabled ? l(G.INPUT, I.target.value) : (I.preventDefault(), I.stopPropagation());
|
|
1964
|
+
}, C = () => {
|
|
1965
|
+
v.value.focus();
|
|
1966
|
+
};
|
|
1967
|
+
return e({
|
|
1968
|
+
focus: C
|
|
1969
|
+
}), { __sfc: !0, t: s, attrs: o, slots: i, hasSlot: r, props: t, emit: l, textbox: v, textboxId: u, isUnderlineStyle: c, conditionalClasses: g, showRequiredAttribute: b, comboboxConditionalClasses: f, isFiltering: h, ariaAttributes: y, selectedValueItems: B, shouldShowInput: R, shouldShowSingleSelectSlot: p, shouldShowMultipleSlot: L, onOpenDropdown: T, onCloseDropdown: O, onToggleDropdown: A, onClearSearch: M, onInputEvent: m, focus: C, BentoTypography: ae, DropdownBaseTextboxEvent: G, CrossCircleFillIcon: dt, CrossCircleFillSmallIcon: ut, BentoDropdownSize: be };
|
|
1970
|
+
}
|
|
1971
|
+
});
|
|
1972
|
+
var ql = function() {
|
|
1973
|
+
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
1974
|
+
return l("div", { class: e.$attrs.class, attrs: { "data-testid": "textbox-wrapper" }, on: { click: t.onToggleDropdown, keydown: function(s) {
|
|
1975
|
+
return !s.type.indexOf("key") && e._k(s.keyCode, "escape", void 0, s.key, void 0) ? null : t.onCloseDropdown.apply(null, arguments);
|
|
1976
|
+
} } }, [l(t.BentoTypography, { staticClass: "b-dropdown-base-textbox", class: t.conditionalClasses, attrs: { variant: t.isUnderlineStyle ? "title" : "body", el: "div", "data-testid": "base-textbox" } }, [t.shouldShowInput ? l("input", e._b({ ref: "textbox", staticClass: "b-dropdown-base-textbox__input", attrs: { id: t.textboxId, role: "combobox", type: "text", "aria-autocomplete": "list", size: "1", disabled: e.disabled ? !0 : null, readonly: e.readonly, required: t.showRequiredAttribute }, domProps: { value: e.open ? e.value : e.displayValue }, on: { keydown: [function(s) {
|
|
1977
|
+
return e.$emit(t.DropdownBaseTextboxEvent.KEYDOWN, s);
|
|
1978
|
+
}, function(s) {
|
|
1979
|
+
return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : t.onToggleDropdown.apply(null, arguments);
|
|
1980
|
+
}], input: t.onInputEvent } }, "input", t.ariaAttributes, !1)) : l("div", e._b({ ref: "textbox", staticClass: "b-dropdown-base-textbox__input", class: t.comboboxConditionalClasses, attrs: { id: t.textboxId, "aria-readonly": e.readonly ? "true" : null, role: "combobox", tabindex: e.disabled ? -1 : 0 } }, "div", t.ariaAttributes, !1), [t.shouldShowSingleSelectSlot ? [t.hasSlot("display-value") ? e._t("display-value", null, null, e.selectedValueItem) : e._t("default", function() {
|
|
1981
|
+
return [e._v(" " + e._s(e.displayValue) + " ")];
|
|
1982
|
+
}, null, e.selectedValueItem)] : t.shouldShowMultipleSlot ? [l("div", { staticClass: "b-dropdown-base-textbox__input-multiple-selected" }, e._l(t.selectedValueItems, function(s) {
|
|
1983
|
+
return l("div", { key: s.value }, [l("div", { staticClass: "b-dropdown-base-textbox__input-selected-element" }, [e._t("default", function() {
|
|
1984
|
+
return [e._v(" " + e._s(e.displayValue) + " ")];
|
|
1985
|
+
}, null, s)], 2)]);
|
|
1986
|
+
}), 0)] : [e._v(e._s(e.displayValue))]], 2), e.additionalItemsSelected ? l("span", { staticClass: "b-dropdown-base-textbox__additional-items" }, [e._v(" " + e._s(e.additionalItemsSelected) + " ")]) : e._e(), t.hasSlot("icon") && !t.isFiltering ? l("span", { staticClass: "b-dropdown-base-textbox__icon", attrs: { "aria-hidden": "true" } }, [e._t("icon")], 2) : e._e(), t.isFiltering ? l("span", { staticClass: "b-dropdown-base-textbox__clear-search", attrs: { tabindex: e.disabled ? -1 : 0, "data-testid": "clear-search-button" }, on: { click: function(s) {
|
|
1987
|
+
return s.stopPropagation(), t.onClearSearch.apply(null, arguments);
|
|
1988
|
+
}, keydown: function(s) {
|
|
1989
|
+
return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : (s.stopPropagation(), t.onClearSearch.apply(null, arguments));
|
|
1990
|
+
}, keyup: function(s) {
|
|
1991
|
+
return !s.type.indexOf("key") && e._k(s.keyCode, "space", 32, s.key, [" ", "Spacebar"]) ? null : t.onClearSearch.apply(null, arguments);
|
|
1992
|
+
} } }, [e.size === t.BentoDropdownSize.SMALL ? l(t.CrossCircleFillSmallIcon, { attrs: { "svg-title": t.t("clearSearch") } }) : l(t.CrossCircleFillIcon, { attrs: { "svg-title": t.t("clearSearch") } })], 1) : e._e()])], 1);
|
|
1993
|
+
}, Yl = [], Wl = /* @__PURE__ */ U(
|
|
1994
|
+
Kl,
|
|
1995
|
+
ql,
|
|
1996
|
+
Yl,
|
|
1997
|
+
!1,
|
|
1998
|
+
null,
|
|
1999
|
+
"4d2fd594"
|
|
2000
|
+
);
|
|
2001
|
+
const ot = Wl.exports, jl = z({
|
|
2002
|
+
name: "dropdown-default-textbox",
|
|
2003
|
+
inheritAttrs: !1
|
|
2004
|
+
}), Hl = /* @__PURE__ */ z({
|
|
2005
|
+
...jl,
|
|
2006
|
+
props: {
|
|
2007
|
+
/**
|
|
2008
|
+
* The number of additional items that have been selected in the dropdown.
|
|
2009
|
+
*/
|
|
2010
|
+
additionalItemsSelected: { type: [Number, String], default: 0 },
|
|
2011
|
+
/**
|
|
2012
|
+
* Sets the aria-controls attribute on the textbox. This should correspond to the popover's id that the textbox triggers.
|
|
2013
|
+
*/
|
|
2014
|
+
ariaControls: {
|
|
2015
|
+
type: String,
|
|
2016
|
+
required: !0
|
|
2017
|
+
},
|
|
2018
|
+
/**
|
|
2019
|
+
* Indicates whether the content the textbox triggers is visible or not. Needs to be set accordingly when the textbox is used and changed every time the popover is shown/hidden.
|
|
2020
|
+
*/
|
|
2021
|
+
ariaExpanded: {
|
|
2022
|
+
type: [String, Boolean],
|
|
2023
|
+
required: !0
|
|
2024
|
+
},
|
|
2025
|
+
/**
|
|
2026
|
+
* If no label element is used then the aria-label is be set should be set.
|
|
2027
|
+
*/
|
|
2028
|
+
ariaLabel: {
|
|
2029
|
+
type: String,
|
|
2030
|
+
default: null
|
|
2031
|
+
},
|
|
2032
|
+
/**
|
|
2033
|
+
* Corresponds to the label's id that labels the textbox element.
|
|
2034
|
+
*/
|
|
2035
|
+
ariaLabelledby: {
|
|
2036
|
+
type: String,
|
|
2037
|
+
default: null
|
|
2038
|
+
},
|
|
2039
|
+
/**
|
|
2040
|
+
* Renders the dropdown with a condensed style.
|
|
2041
|
+
*/
|
|
2042
|
+
condensed: { type: Boolean, default: !1 },
|
|
2043
|
+
/**
|
|
2044
|
+
* Disables any textbox functionality
|
|
2045
|
+
*/
|
|
2046
|
+
disabled: { type: Boolean, default: !1 },
|
|
2047
|
+
/**
|
|
2048
|
+
* Selected option's label
|
|
2049
|
+
*/
|
|
2050
|
+
displayValue: { type: String, default: null },
|
|
2051
|
+
/**
|
|
2052
|
+
* Sets the possibility to type into the textbox
|
|
2053
|
+
*/
|
|
2054
|
+
dynamicFiltering: {
|
|
2055
|
+
type: Boolean,
|
|
2056
|
+
default: !1
|
|
2057
|
+
},
|
|
2058
|
+
/**
|
|
2059
|
+
* Marks the textbox as invalid, rendering an error state
|
|
2060
|
+
*/
|
|
2061
|
+
isInvalid: { type: Boolean, default: !1 },
|
|
2062
|
+
/**
|
|
2063
|
+
* Indicates if the dropdown is open so that
|
|
2064
|
+
* the respective event can be emitted
|
|
2065
|
+
*/
|
|
2066
|
+
open: { type: Boolean, default: !1 },
|
|
2067
|
+
/**
|
|
2068
|
+
* Sets the dropdown to readonly state
|
|
2069
|
+
*/
|
|
2070
|
+
readonly: { type: Boolean, default: !1 },
|
|
2071
|
+
/**
|
|
2072
|
+
* The selected value's list box item.
|
|
2073
|
+
*/
|
|
2074
|
+
selectedValueItem: {
|
|
2075
|
+
type: [Object, Array],
|
|
2076
|
+
default: void 0
|
|
2077
|
+
},
|
|
2078
|
+
/**
|
|
2079
|
+
* Toggles whether to use the slot content select items shown in the textbox in multiple mode.
|
|
2080
|
+
*/
|
|
2081
|
+
showSlotContentInMultiple: { type: Boolean, default: !1 },
|
|
2082
|
+
/**
|
|
2083
|
+
* The input value
|
|
2084
|
+
*/
|
|
2085
|
+
value: { type: String, default: "" },
|
|
2086
|
+
/*
|
|
2087
|
+
* If enabled, the user will be able to select multiple items.
|
|
2088
|
+
*/
|
|
2089
|
+
multiple: { type: Boolean, default: !1 }
|
|
2090
|
+
},
|
|
2091
|
+
emits: ["clear", "close", "input", "keydown", "open"],
|
|
2092
|
+
setup(a, { expose: e, emit: l }) {
|
|
2093
|
+
const t = a, s = Se(), o = E(null), i = n(() => ({
|
|
2094
|
+
[`b-dropdown-default-textbox--${j.ERROR}`]: !t.disabled && !t.readonly && t.isInvalid,
|
|
2095
|
+
[`b-dropdown-default-textbox--${j.DISABLED}`]: t.disabled,
|
|
2096
|
+
[`b-dropdown-default-textbox--${j.READONLY}`]: t.readonly,
|
|
2097
|
+
[`b-dropdown-default-textbox--${j.OPENED}`]: t.open,
|
|
2098
|
+
"b-dropdown-default-textbox--condensed": t.condensed
|
|
2099
|
+
})), r = n(() => t.open && !t.disabled && !t.readonly), v = (y) => {
|
|
2100
|
+
l("input", y);
|
|
2101
|
+
}, u = (y) => {
|
|
2102
|
+
l("keydown", y);
|
|
2103
|
+
}, c = (y) => {
|
|
2104
|
+
fe(y), l("open");
|
|
2105
|
+
}, g = (y) => {
|
|
2106
|
+
fe(y), l("close");
|
|
2107
|
+
}, b = (y) => {
|
|
2108
|
+
fe(y), l("clear");
|
|
2109
|
+
}, f = {
|
|
2110
|
+
[G.INPUT]: v,
|
|
2111
|
+
[G.OPEN]: c,
|
|
2112
|
+
[G.CLOSE]: g,
|
|
2113
|
+
[G.CLEAR]: b,
|
|
2114
|
+
[G.KEYDOWN]: u
|
|
2115
|
+
}, h = () => {
|
|
2116
|
+
o.value.focus();
|
|
2117
|
+
};
|
|
2118
|
+
return e({
|
|
2119
|
+
focus: h
|
|
2120
|
+
}), { __sfc: !0, emit: l, slots: s, props: t, baseTextbox: o, conditionalClasses: i, isDropdownOpen: r, onInput: v, onKeyDown: u, openDropdown: c, closeDropdown: g, clearValue: b, listeners: f, focus: h, DropdownBaseTextbox: ot, ChevronDownIcon: Xe, ChevronUpIcon: Ze };
|
|
2121
|
+
}
|
|
2122
|
+
});
|
|
2123
|
+
var Jl = function() {
|
|
2124
|
+
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
2125
|
+
return l("div", { staticClass: "b-dropdown-default-textbox", class: t.conditionalClasses, attrs: { "data-testid": "default-textbox" } }, [l(t.DropdownBaseTextbox, e._g(e._b({ ref: "baseTextbox", staticClass: "b-dropdown-default-textbox__textbox", attrs: { value: e.value }, scopedSlots: e._u([e._l(t.slots, function(s, o) {
|
|
2126
|
+
return { key: o, fn: function(i) {
|
|
2127
|
+
return [e._t(o, null, null, i ?? {})];
|
|
2128
|
+
} };
|
|
2129
|
+
}), { key: "icon", fn: function() {
|
|
2130
|
+
return [l("div", { staticClass: "b-dropdown-default-textbox__chevron" }, [l(t.ChevronUpIcon, { directives: [{ name: "show", rawName: "v-show", value: t.isDropdownOpen, expression: "isDropdownOpen" }], attrs: { "svg-title": "opened" } }), l(t.ChevronDownIcon, { directives: [{ name: "show", rawName: "v-show", value: !t.isDropdownOpen, expression: "!isDropdownOpen" }], attrs: { "svg-title": "closed" } })], 1)];
|
|
2131
|
+
}, proxy: !0 }], null, !0) }, "dropdown-base-textbox", { ...e.$attrs, ...e.$props }, !1), t.listeners))], 1);
|
|
2132
|
+
}, Xl = [], Zl = /* @__PURE__ */ U(
|
|
2133
|
+
Hl,
|
|
2134
|
+
Jl,
|
|
2135
|
+
Xl,
|
|
2136
|
+
!1,
|
|
2137
|
+
null,
|
|
2138
|
+
"bf2d43b0"
|
|
2139
|
+
);
|
|
2140
|
+
const Ql = Zl.exports;
|
|
2141
|
+
let We = 0;
|
|
2142
|
+
const ea = {
|
|
2143
|
+
beforeCreate() {
|
|
2144
|
+
this.uuid = We.toString(), We += 1;
|
|
2145
|
+
}
|
|
2146
|
+
};
|
|
2147
|
+
var ta = function() {
|
|
2148
|
+
var e = this, l = e._self._c;
|
|
2149
|
+
return l("svg", e._b({ staticClass: "ui-assets-icons-16", attrs: { role: "img", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none" } }, "svg", e.$attrs, !1), [e.$attrs["svg-title"] ? l("title", [e._v(e._s(e.$attrs["svg-title"]))]) : e._e(), l("path", { attrs: { fill: "#001222", d: "M5.00011 5.43922L8.00011 8.43922L11.0001 5.43922L12.0608 6.49988L8.00011 10.5605L3.93945 6.49988L5.00011 5.43922Z" } })]);
|
|
2150
|
+
}, la = [], aa = /* @__PURE__ */ U(
|
|
2151
|
+
ea,
|
|
2152
|
+
ta,
|
|
2153
|
+
la,
|
|
2154
|
+
!1,
|
|
2155
|
+
null,
|
|
2156
|
+
null
|
|
2157
|
+
);
|
|
2158
|
+
const sa = aa.exports;
|
|
2159
|
+
let je = 0;
|
|
2160
|
+
const oa = {
|
|
2161
|
+
beforeCreate() {
|
|
2162
|
+
this.uuid = je.toString(), je += 1;
|
|
2163
|
+
}
|
|
2164
|
+
};
|
|
2165
|
+
var na = function() {
|
|
2166
|
+
var e = this, l = e._self._c;
|
|
2167
|
+
return l("svg", e._b({ staticClass: "ui-assets-icons-16", attrs: { role: "img", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none" } }, "svg", e.$attrs, !1), [e.$attrs["svg-title"] ? l("title", [e._v(e._s(e.$attrs["svg-title"]))]) : e._e(), l("path", { attrs: { fill: "#001222", d: "M10.9999 10.5608L7.9999 7.56077L4.9999 10.5608L3.93924 9.50011L7.9999 5.43945L12.0606 9.50011L10.9999 10.5608Z" } })]);
|
|
2168
|
+
}, ia = [], ra = /* @__PURE__ */ U(
|
|
2169
|
+
oa,
|
|
2170
|
+
na,
|
|
2171
|
+
ia,
|
|
2172
|
+
!1,
|
|
2173
|
+
null,
|
|
2174
|
+
null
|
|
2175
|
+
);
|
|
2176
|
+
const ca = ra.exports, da = z({
|
|
2177
|
+
name: "dropdown-small-textbox",
|
|
2178
|
+
inheritAttrs: !1
|
|
2179
|
+
}), ua = /* @__PURE__ */ z({
|
|
2180
|
+
...da,
|
|
2181
|
+
props: {
|
|
2182
|
+
/**
|
|
2183
|
+
* The number of additional items that have been selected in the dropdown.
|
|
2184
|
+
*/
|
|
2185
|
+
additionalItemsSelected: { type: [Number, String], default: 0 },
|
|
2186
|
+
/**
|
|
2187
|
+
* Sets the aria-controls attribute on the textbox. This should correspond to the popover's id that the textbox triggers.
|
|
2188
|
+
*/
|
|
2189
|
+
ariaControls: { type: String, required: !0 },
|
|
2190
|
+
/**
|
|
2191
|
+
* Indicates whether the content the textbox triggers is visible or not. Needs to be set accordingly when the textbox is used and changed every time the popover is shown/hidden.
|
|
2192
|
+
*/
|
|
2193
|
+
ariaExpanded: {
|
|
2194
|
+
type: [String, Boolean],
|
|
2195
|
+
required: !0
|
|
2196
|
+
},
|
|
2197
|
+
/**
|
|
2198
|
+
* If no label element is used then the aria-label is be set should be set.
|
|
2199
|
+
*/
|
|
2200
|
+
ariaLabel: { type: String, default: null },
|
|
2201
|
+
/**
|
|
2202
|
+
* Corresponds to the label's id that labels the textbox element.
|
|
2203
|
+
*/
|
|
2204
|
+
ariaLabelledby: { type: String, default: null },
|
|
2205
|
+
/**
|
|
2206
|
+
* Disables any textbox functionality
|
|
2207
|
+
*/
|
|
2208
|
+
disabled: { type: Boolean, default: !1 },
|
|
2209
|
+
/**
|
|
2210
|
+
* Selected option's label
|
|
2211
|
+
*/
|
|
2212
|
+
displayValue: { type: String, default: null },
|
|
2213
|
+
/**
|
|
2214
|
+
* Sets the possibility to type into the textbox
|
|
2215
|
+
*/
|
|
2216
|
+
dynamicFiltering: { type: Boolean, default: !1 },
|
|
2217
|
+
/**
|
|
2218
|
+
* Marks the textbox as invalid, rendering an error state
|
|
2219
|
+
*/
|
|
2220
|
+
isInvalid: { type: Boolean, default: !1 },
|
|
2221
|
+
/**
|
|
2222
|
+
* Indicates if the dropdown is open so that
|
|
2223
|
+
* the respective event can be emitted
|
|
2224
|
+
*/
|
|
2225
|
+
open: { type: Boolean, default: !1 },
|
|
2226
|
+
/**
|
|
2227
|
+
* Sets the dropdown to readonly state
|
|
2228
|
+
*/
|
|
2229
|
+
readonly: { type: Boolean, default: !1 },
|
|
2230
|
+
/**
|
|
2231
|
+
* The input value
|
|
2232
|
+
*/
|
|
2233
|
+
value: { type: String, default: "" }
|
|
2234
|
+
},
|
|
2235
|
+
emits: ["clear", "close", "input", "keydown", "open"],
|
|
2236
|
+
setup(a, { expose: e, emit: l }) {
|
|
2237
|
+
const t = a, s = E(null), o = Fe(st, !1), i = n(() => ({
|
|
2238
|
+
[`b-dropdown-small-textbox--${j.DISABLED}`]: t.disabled,
|
|
2239
|
+
[`b-dropdown-small-textbox--${j.READONLY}`]: t.readonly,
|
|
2240
|
+
[`b-dropdown-small-textbox--${j.OPENED}`]: t.open,
|
|
2241
|
+
"b-dropdown-small-textbox--underline": o
|
|
2242
|
+
})), r = n(() => t.open && !t.disabled && !t.readonly), v = (y) => {
|
|
2243
|
+
l("input", y);
|
|
2244
|
+
}, u = (y) => {
|
|
2245
|
+
l("keydown", y);
|
|
2246
|
+
}, c = (y) => {
|
|
2247
|
+
fe(y), l("open");
|
|
2248
|
+
}, g = (y) => {
|
|
2249
|
+
fe(y), l("close");
|
|
2250
|
+
}, b = (y) => {
|
|
2251
|
+
fe(y), l("clear");
|
|
2252
|
+
}, f = {
|
|
2253
|
+
[G.INPUT]: v,
|
|
2254
|
+
[G.OPEN]: c,
|
|
2255
|
+
[G.CLOSE]: g,
|
|
2256
|
+
[G.CLEAR]: b,
|
|
2257
|
+
[G.KEYDOWN]: u
|
|
2258
|
+
}, h = () => {
|
|
2259
|
+
s.value.focus();
|
|
2260
|
+
};
|
|
2261
|
+
return e({
|
|
2262
|
+
focus: h
|
|
2263
|
+
}), { __sfc: !0, emit: l, props: t, baseTextbox: s, isUnderlineStyle: o, conditionalClasses: i, isDropdownOpen: r, onInput: v, onKeyDown: u, openDropdown: c, closeDropdown: g, clearValue: b, listeners: f, focus: h, BentoDropdownSize: be, DropdownBaseTextbox: ot, ChevronDownSmallIcon: sa, ChevronUpSmallIcon: ca };
|
|
2264
|
+
}
|
|
2265
|
+
});
|
|
2266
|
+
var pa = function() {
|
|
2267
|
+
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
2268
|
+
return l("div", { staticClass: "b-dropdown-small-textbox", class: t.conditionalClasses }, [l(t.DropdownBaseTextbox, e._g(e._b({ ref: "baseTextbox", staticClass: "b-dropdown-small-textbox__textbox", attrs: { size: t.BentoDropdownSize.SMALL }, scopedSlots: e._u([{ key: "icon", fn: function() {
|
|
2269
|
+
return [l("div", { staticClass: "b-dropdown-small-textbox__chevron" }, [l(t.ChevronUpSmallIcon, { directives: [{ name: "show", rawName: "v-show", value: t.isDropdownOpen, expression: "isDropdownOpen" }], attrs: { "svg-title": "opened" } }), l(t.ChevronDownSmallIcon, { directives: [{ name: "show", rawName: "v-show", value: !t.isDropdownOpen, expression: "!isDropdownOpen" }], attrs: { "svg-title": "closed" } })], 1)];
|
|
2270
|
+
}, proxy: !0 }]) }, "dropdown-base-textbox", { ...e.$attrs, ...e.$props }, !1), t.listeners))], 1);
|
|
2271
|
+
}, fa = [], ba = /* @__PURE__ */ U(
|
|
2272
|
+
ua,
|
|
2273
|
+
pa,
|
|
2274
|
+
fa,
|
|
2275
|
+
!1,
|
|
2276
|
+
null,
|
|
2277
|
+
"fa225e76"
|
|
2278
|
+
);
|
|
2279
|
+
const va = ba.exports, ma = (a, e) => e.value.reduce((l, t) => {
|
|
2280
|
+
if (t.items) {
|
|
2281
|
+
const s = t.items.filter(
|
|
2282
|
+
(i) => a.value.find((r) => r.value === i.value)
|
|
2283
|
+
);
|
|
2284
|
+
s.length === t.items.length ? l.push(t.displayValue ?? t.label) : s.forEach(({ label: i, displayValue: r }) => l.push(r ?? i));
|
|
2285
|
+
}
|
|
2286
|
+
return a.value.find((s) => s.value === t.value) && l.push(t.displayValue ?? t.label), l;
|
|
2287
|
+
}, []).join(", "), _a = ({ items: a, placeholder: e, selectedValues: l, isMultiSelect: t }) => {
|
|
2288
|
+
const s = n(
|
|
2289
|
+
() => t.value && a.value.find((i) => {
|
|
2290
|
+
var r;
|
|
2291
|
+
return (r = i.items) == null ? void 0 : r.length;
|
|
2292
|
+
})
|
|
2293
|
+
);
|
|
2294
|
+
return n(() => l.value.length ? s.value ? ma(l, a) : l.value.map(({ label: i, displayValue: r }) => r ?? i).join(", ") : e.value || null);
|
|
2295
|
+
}, nt = (a) => {
|
|
2296
|
+
var e;
|
|
2297
|
+
(e = a.value.$children) == null || e[0].$refs.textbox.focus();
|
|
2298
|
+
}, ya = ({
|
|
2299
|
+
inputContainerRef: a,
|
|
2300
|
+
optionsContainerRef: e,
|
|
2301
|
+
selectedValueIndex: l,
|
|
2302
|
+
isDropdownOpen: t,
|
|
2303
|
+
isDynamicFltering: s,
|
|
2304
|
+
items: o,
|
|
2305
|
+
isMultiple: i,
|
|
2306
|
+
totalItemCount: r,
|
|
2307
|
+
isVirtualScroll: v
|
|
2308
|
+
}, u, c, g) => {
|
|
2309
|
+
const b = async (D) => {
|
|
2310
|
+
var $;
|
|
2311
|
+
s.value && await Y(), ($ = o.value[D]) == null || $.focus();
|
|
2312
|
+
}, f = async (D) => {
|
|
2313
|
+
var J, Q;
|
|
2314
|
+
s.value && await Y();
|
|
2315
|
+
const $ = (J = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef) == null ? void 0 : J.$el.querySelectorAll(
|
|
2316
|
+
"button"
|
|
2317
|
+
);
|
|
2318
|
+
$ != null && $.length ? (Q = $[D]) == null || Q.focus() : b(D);
|
|
2319
|
+
}, h = (D) => {
|
|
2320
|
+
var $;
|
|
2321
|
+
return ($ = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef) == null ? void 0 : $.setListboxFocusedIndex(
|
|
2322
|
+
D
|
|
2323
|
+
);
|
|
2324
|
+
}, y = async (D) => {
|
|
2325
|
+
var $;
|
|
2326
|
+
await (($ = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef) == null ? void 0 : $.navigateToItem(D));
|
|
2327
|
+
}, B = (D) => {
|
|
2328
|
+
Y(() => {
|
|
2329
|
+
v ? y(D) : (h(D), b(D));
|
|
2330
|
+
});
|
|
2331
|
+
}, R = () => {
|
|
2332
|
+
t.value || c(), B(0);
|
|
2333
|
+
}, p = () => {
|
|
2334
|
+
t.value || c(), Y(() => {
|
|
2335
|
+
B(v ? r.value - 1 : o.value.length - 1);
|
|
2336
|
+
});
|
|
2337
|
+
}, L = ({ detail: D }) => {
|
|
2338
|
+
D.preventDefault(), R();
|
|
2339
|
+
}, T = ({ detail: D }) => {
|
|
2340
|
+
D.preventDefault(), p();
|
|
2341
|
+
}, O = () => {
|
|
2342
|
+
R();
|
|
2343
|
+
}, A = () => {
|
|
2344
|
+
p();
|
|
2345
|
+
}, M = ({ detail: D }) => {
|
|
2346
|
+
D.preventDefault(), u(), t.value && (i ? f(0) : B(l.value));
|
|
2347
|
+
}, m = ({ detail: D }) => {
|
|
2348
|
+
D.preventDefault(), u(), t.value && (i ? f(0) : B(l.value));
|
|
2349
|
+
}, C = () => {
|
|
2350
|
+
t.value && g();
|
|
2351
|
+
}, I = () => {
|
|
2352
|
+
t.value && (g(), nt(a));
|
|
2353
|
+
};
|
|
2354
|
+
return n(() => ({
|
|
2355
|
+
[V.ARROW_DOWN]: L,
|
|
2356
|
+
[V.ARROW_UP]: T,
|
|
2357
|
+
[V.HOME]: O,
|
|
2358
|
+
[V.END]: A,
|
|
2359
|
+
...s.value ? {} : { [V.SPACE]: M },
|
|
2360
|
+
[V.ENTER]: m,
|
|
2361
|
+
...s.value ? {} : { [V.TAB]: C },
|
|
2362
|
+
[V.ESCAPE]: I
|
|
2363
|
+
}));
|
|
2364
|
+
}, ga = ({ inputContainerRef: a, isDropdownOpen: e }, l) => {
|
|
2365
|
+
const t = () => {
|
|
2366
|
+
e.value && l(), Y(() => {
|
|
2367
|
+
nt(a);
|
|
2368
|
+
});
|
|
2369
|
+
};
|
|
2370
|
+
return {
|
|
2371
|
+
[d.ENTER]: t,
|
|
2372
|
+
[d.ESCAPE]: t,
|
|
2373
|
+
[d.TAB]: t,
|
|
2374
|
+
[d.SPACE]: t
|
|
2375
|
+
};
|
|
2376
|
+
};
|
|
2377
|
+
function ha(a, e, l, t, s) {
|
|
2378
|
+
const o = E(a), i = E(e), r = (c, g = []) => g.flatMap((b) => b.label.toLocaleLowerCase().includes(c) ? t != null && t.value && b.items ? [...r(c, b.items)] : [b, ...r(c, b.items)] : b.items ? [...r(c, b.items)] : []), v = l !== void 0 ? at(() => l(o.value), s ?? 300) : void 0;
|
|
2379
|
+
return Z(o, () => {
|
|
2380
|
+
v !== void 0 && v();
|
|
2381
|
+
}), n(() => {
|
|
2382
|
+
if (!o.value || l !== void 0)
|
|
2383
|
+
return i.value;
|
|
2384
|
+
const c = o.value.toLocaleLowerCase();
|
|
2385
|
+
return r(c, i.value);
|
|
2386
|
+
});
|
|
2387
|
+
}
|
|
2388
|
+
const Sa = {
|
|
2389
|
+
"de-DE": {
|
|
2390
|
+
all: "Alle",
|
|
2391
|
+
ariaLabelFallback: "Dropdown",
|
|
2392
|
+
clearSearch: "Filter löschen"
|
|
2393
|
+
},
|
|
2394
|
+
"en-GB": {
|
|
2395
|
+
all: "All",
|
|
2396
|
+
ariaLabelFallback: "Dropdown",
|
|
2397
|
+
clearSearch: "Clear filter"
|
|
2398
|
+
},
|
|
2399
|
+
"en-US": {
|
|
2400
|
+
all: "All",
|
|
2401
|
+
ariaLabelFallback: "Dropdown",
|
|
2402
|
+
clearSearch: "Clear filter"
|
|
2403
|
+
},
|
|
2404
|
+
"es-ES": {
|
|
2405
|
+
all: "Todos",
|
|
2406
|
+
ariaLabelFallback: "Menú desplegable",
|
|
2407
|
+
clearSearch: "Limpiar filtro"
|
|
2408
|
+
},
|
|
2409
|
+
"es-MX": {
|
|
2410
|
+
all: "Todos",
|
|
2411
|
+
ariaLabelFallback: "Menú desplegable",
|
|
2412
|
+
clearSearch: "Limpiar filtro"
|
|
2413
|
+
},
|
|
2414
|
+
"fr-FR": {
|
|
2415
|
+
all: "Tous",
|
|
2416
|
+
ariaLabelFallback: "Menu déroulant",
|
|
2417
|
+
clearSearch: "Effacer le filtre"
|
|
2418
|
+
},
|
|
2419
|
+
"it-IT": {
|
|
2420
|
+
all: "Tutti",
|
|
2421
|
+
ariaLabelFallback: "Menu a discesa",
|
|
2422
|
+
clearSearch: "Cancella filtro"
|
|
2423
|
+
},
|
|
2424
|
+
"ja-JP": {
|
|
2425
|
+
all: "すべて",
|
|
2426
|
+
ariaLabelFallback: "ドロップダウン",
|
|
2427
|
+
clearSearch: "フィルターをクリア"
|
|
2428
|
+
},
|
|
2429
|
+
"pt-BR": {
|
|
2430
|
+
all: "Todos",
|
|
2431
|
+
ariaLabelFallback: "Menu suspenso",
|
|
2432
|
+
clearSearch: "Limpar filtro"
|
|
2433
|
+
},
|
|
2434
|
+
"zh-CN": {
|
|
2435
|
+
all: "全部",
|
|
2436
|
+
ariaLabelFallback: "下拉菜单",
|
|
2437
|
+
clearSearch: "清除筛选器"
|
|
2438
|
+
}
|
|
2439
|
+
}, xa = z({
|
|
2440
|
+
i18n: { messages: Sa },
|
|
2441
|
+
name: "b-dropdown",
|
|
2442
|
+
components: {
|
|
2443
|
+
DropdownInputDefault: Ql,
|
|
2444
|
+
DropdownInputSmall: va
|
|
2445
|
+
},
|
|
2446
|
+
model: { prop: "modelValue" }
|
|
2447
|
+
}), Ca = /* @__PURE__ */ z({
|
|
2448
|
+
...xa,
|
|
2449
|
+
props: {
|
|
2450
|
+
description: { default: null },
|
|
2451
|
+
disabled: { type: Boolean, default: !1 },
|
|
2452
|
+
errorMessage: { default: null },
|
|
2453
|
+
label: { default: null },
|
|
2454
|
+
optional: { type: Boolean, default: !1 },
|
|
2455
|
+
placeholder: { default: null },
|
|
2456
|
+
readonly: { type: Boolean, default: !1 },
|
|
2457
|
+
required: { type: Boolean, default: !1 },
|
|
2458
|
+
tooltipText: { default: null },
|
|
2459
|
+
ariaLabel: { default: null },
|
|
2460
|
+
condensed: { type: Boolean, default: !1 },
|
|
2461
|
+
emptyState: { default: void 0 },
|
|
2462
|
+
dynamicFiltering: { type: Boolean, default: !1 },
|
|
2463
|
+
error: { type: Boolean, default: !1 },
|
|
2464
|
+
hasMoreItems: { type: Boolean, default: !1 },
|
|
2465
|
+
isOptionDisabled: { type: Function, default: void 0 },
|
|
2466
|
+
items: { default: () => [] },
|
|
2467
|
+
loading: { type: Boolean, default: !1 },
|
|
2468
|
+
componentLoading: { type: Boolean, default: !1 },
|
|
2469
|
+
lazyLoadType: { default: Me.props.lazyLoadType.default },
|
|
2470
|
+
multiple: { type: Boolean, default: !1 },
|
|
2471
|
+
search: { default: void 0 },
|
|
2472
|
+
showSlotContentInMultiple: { type: Boolean, default: !1 },
|
|
2473
|
+
size: { default: null },
|
|
2474
|
+
staticCategories: { type: Boolean, default: !1 },
|
|
2475
|
+
teleport: { default: () => ({ disabled: !0 }) },
|
|
2476
|
+
value: { default: null },
|
|
2477
|
+
modelValue: { default: null },
|
|
2478
|
+
virtualScroll: { type: Boolean, default: !1 },
|
|
2479
|
+
enableValueLabelPair: { type: Boolean, default: !1 }
|
|
2480
|
+
},
|
|
2481
|
+
emits: ["input", "update:model-value", "show-more", "open"],
|
|
2482
|
+
setup(a, { expose: e, emit: l }) {
|
|
2483
|
+
var W, Le;
|
|
2484
|
+
const t = a, s = $e(), o = Se(), i = Je(o), { t: r } = oe(), { emitValue: v } = ft(l), u = E(null), c = E(null), g = E(null), b = E(!1), f = le("bento-dropdown-options-container"), h = le("dropdown-label"), y = le("dropdown-description"), B = le("dropdown-error"), { isReadOnly: R } = bt(K(t, "readonly")), p = n(() => t.modelValue ?? t.value), { cachedSelectedListboxOptions: L, cachedListboxSelectedValues: T, setCachedValues: O } = kl(
|
|
2485
|
+
K(t, "items"),
|
|
2486
|
+
p,
|
|
2487
|
+
K(t, "multiple"),
|
|
2488
|
+
K(t, "enableValueLabelPair")
|
|
2489
|
+
), A = E(s["aria-label"]), M = E(s["aria-describedby"]), { ariaLabel: m, label: C } = He(t), I = n(() => r("ariaLabelFallback")), N = pt({
|
|
2490
|
+
// TODO: take ariaLabel ref away when aria-label prop is removed
|
|
2491
|
+
ariaLabel: m.value || A,
|
|
2492
|
+
label: C,
|
|
2493
|
+
defaultFallback: I
|
|
2494
|
+
}), D = t.size === be.SMALL || Fe(zl, !1), $ = n(() => D ? be.SMALL : be.DEFAULT), J = n(() => ({
|
|
2495
|
+
"b-dropdown--condensed": t.condensed
|
|
2496
|
+
})), Q = n(() => ({
|
|
2497
|
+
"b-dropdown__description--error": !!t.errorMessage
|
|
2498
|
+
})), q = E(""), F = K(t, "items"), ee = K(t, "staticCategories"), ne = ha(
|
|
2499
|
+
q,
|
|
2500
|
+
F,
|
|
2501
|
+
(W = t == null ? void 0 : t.search) == null ? void 0 : W.searchEvent,
|
|
2502
|
+
ee,
|
|
2503
|
+
(Le = t == null ? void 0 : t.search) == null ? void 0 : Le.debounceTime
|
|
2504
|
+
), ve = n(() => t.dynamicFiltering && !!q.value), De = _a({
|
|
2505
|
+
items: F,
|
|
2506
|
+
placeholder: K(t, "placeholder"),
|
|
2507
|
+
isMultiSelect: K(t, "multiple"),
|
|
2508
|
+
selectedValues: L
|
|
2509
|
+
}), ke = n(() => {
|
|
2510
|
+
if (t != null && t.multiple && Array.isArray(p.value))
|
|
2511
|
+
return t.items.filter(
|
|
2512
|
+
({ value: P }) => (t == null ? void 0 : t.value) && (t == null ? void 0 : t.value).includes(P)
|
|
2513
|
+
);
|
|
2514
|
+
if (!t.multiple && t.staticCategories) {
|
|
2515
|
+
const P = t.items.find(
|
|
2516
|
+
(he) => {
|
|
2517
|
+
var ze;
|
|
2518
|
+
return (ze = he.items) == null ? void 0 : ze.some((it) => it.value === p.value);
|
|
2519
|
+
}
|
|
2520
|
+
);
|
|
2521
|
+
return (P ? P.items.find((he) => he.value === p.value) : t.items.find(({ value: he }) => he === p.value)) ?? null;
|
|
2522
|
+
}
|
|
2523
|
+
return t.items.find(({ value: P }) => P === p.value);
|
|
2524
|
+
}), me = n(() => {
|
|
2525
|
+
const P = ne.value.findIndex(({ value: pe }) => t.enableValueLabelPair ? p.value.value === pe : p.value === pe);
|
|
2526
|
+
return P > -1 ? P : 0;
|
|
2527
|
+
}), { isMultiLevelSelect: H, flattenedItemsList: ie } = lt(F), _e = n(() => H.value && !t.staticCategories), xe = n(() => _e.value ? "treeitem" : "option"), Ce = n(() => {
|
|
2528
|
+
if (t.multiple) {
|
|
2529
|
+
const P = Array.isArray(p.value) ? p.value.length : 0, pe = H.value ? ie.value.length : F.value.length;
|
|
2530
|
+
return P === 0 ? null : !t.hasMoreItems && pe > 0 && pe === P ? r("all") : P;
|
|
2531
|
+
}
|
|
2532
|
+
return null;
|
|
2533
|
+
}), Oe = n(
|
|
2534
|
+
() => [
|
|
2535
|
+
t.description ? y : null,
|
|
2536
|
+
M.value,
|
|
2537
|
+
t.errorMessage ? B : null
|
|
2538
|
+
].filter(Boolean).join(" ") || null
|
|
2539
|
+
), re = n(() => {
|
|
2540
|
+
var P;
|
|
2541
|
+
return (P = g.value) == null ? void 0 : P.$el;
|
|
2542
|
+
}), { visibleDomOptions: ye, updateVisibleDomOptions: ce } = Pe(
|
|
2543
|
+
re,
|
|
2544
|
+
ne,
|
|
2545
|
+
xe
|
|
2546
|
+
), de = () => {
|
|
2547
|
+
R.value || (b.value = !0, Y(() => {
|
|
2548
|
+
ce();
|
|
2549
|
+
}));
|
|
2550
|
+
}, ue = () => {
|
|
2551
|
+
b.value = !1;
|
|
2552
|
+
}, ge = () => {
|
|
2553
|
+
R.value || (b.value = !b.value, Y(() => {
|
|
2554
|
+
ce();
|
|
2555
|
+
}), ve.value && (q.value = ""));
|
|
2556
|
+
}, Ee = () => {
|
|
2557
|
+
ve.value && (q.value = ""), b.value && (b.value = !1, g.value.onOutsideDropdownClick());
|
|
2558
|
+
}, Be = n(() => [
|
|
2559
|
+
Ee,
|
|
2560
|
+
{
|
|
2561
|
+
ignore: [re]
|
|
2562
|
+
}
|
|
2563
|
+
]), Ie = async (P) => {
|
|
2564
|
+
t.multiple || (q.value = "", b.value = !1), O(P), v(T.value), t.multiple || (await Y(), w());
|
|
2565
|
+
}, _ = () => {
|
|
2566
|
+
l(d.SHOW_MORE);
|
|
2567
|
+
}, S = ya(
|
|
2568
|
+
{
|
|
2569
|
+
inputContainerRef: u,
|
|
2570
|
+
optionsContainerRef: g,
|
|
2571
|
+
selectedValueIndex: me,
|
|
2572
|
+
isDropdownOpen: b,
|
|
2573
|
+
isDynamicFltering: K(t, "dynamicFiltering"),
|
|
2574
|
+
items: ye,
|
|
2575
|
+
isMultiple: t.multiple,
|
|
2576
|
+
totalItemCount: n(() => ne.value.length),
|
|
2577
|
+
isVirtualScroll: !(t != null && t.multiple) && (t == null ? void 0 : t.virtualScroll) !== !1 && (t == null ? void 0 : t.lazyLoadType) === "none"
|
|
2578
|
+
},
|
|
2579
|
+
ge,
|
|
2580
|
+
de,
|
|
2581
|
+
ue
|
|
2582
|
+
), x = ga(
|
|
2583
|
+
{
|
|
2584
|
+
inputContainerRef: u,
|
|
2585
|
+
isDropdownOpen: b
|
|
2586
|
+
},
|
|
2587
|
+
ue
|
|
2588
|
+
), k = {
|
|
2589
|
+
[d.CLOSE_DROPDOWN]: ue,
|
|
2590
|
+
[d.SELECT]: Ie,
|
|
2591
|
+
[d.SHOW_MORE]: _,
|
|
2592
|
+
...x
|
|
2593
|
+
};
|
|
2594
|
+
t.error && Re(
|
|
2595
|
+
'BentoDropdown "error" property',
|
|
2596
|
+
`Use the BentoDropdown "errorMessage" property instead to indicate that there is a modifier error.
|
|
2597
|
+
Having the field as "undefined" will hide/remove the error.
|
|
2598
|
+
<bento-dropdown errorMessage="Error message text" />`,
|
|
2599
|
+
"2.0.0"
|
|
2600
|
+
), t.size && Re('BentoDropdown "size" property', "Do not use. Only 'default' size should be used.", "2.0.0"), t.value && Re(
|
|
2601
|
+
'BentoDropdown "value" property',
|
|
2602
|
+
`The use of "value" prop in "BentoDropdown" is no longer supported.
|
|
2603
|
+
Use the "v-model" or "model-value" property instead.`,
|
|
2604
|
+
"2.0.0"
|
|
2605
|
+
);
|
|
2606
|
+
const w = () => {
|
|
2607
|
+
u.value.focus();
|
|
2608
|
+
};
|
|
2609
|
+
return Z(
|
|
2610
|
+
() => b.value,
|
|
2611
|
+
(P) => {
|
|
2612
|
+
P && l("open");
|
|
2613
|
+
}
|
|
2614
|
+
), e({
|
|
2615
|
+
focus: w
|
|
2616
|
+
}), { __sfc: !0, attrs: s, slots: o, hasSlot: i, props: t, emit: l, t: r, emitValue: v, inputContainerRef: u, inputContainerRefWrapper: c, optionsContainerRef: g, isDropdownOpen: b, dropdownOptionsContainerId: f, labelId: h, descriptionId: y, errorId: B, isReadOnly: R, dropdownValue: p, cachedSelectedListboxOptions: L, cachedListboxSelectedValues: T, setCachedValues: O, ariaLabelAttribute: A, ariaDescribedByAttribute: M, ariaLabel: m, label: C, computedAriaLabelFallbackMessage: I, computedAriaLabel: N, isInputComponent: D, computedSize: $, conditionalClasses: J, descriptionConditionalClasses: Q, searchTerm: q, items: F, staticCategories: ee, filteredItems: ne, isSearching: ve, displayValue: De, selectedValueItem: ke, selectedValueIndex: me, isMultiLevelSelect: H, flattenedItemsList: ie, isTreePattern: _e, computedOptionRole: xe, additionalItemsSelected: Ce, ariaDescribedBy: Oe, listboxRef: re, visibleDomOptions: ye, updateVisibleDomOptions: ce, openDropdown: de, closeDropdown: ue, toggleDropdown: ge, clickOutsideDropdown: Ee, clickOutsideDropdownOptions: Be, onOptionSelected: Ie, emitShowMoreEvent: _, textboxKeyboardNavigationListeners: S, listboxKeyboardNavigationListeners: x, listboxListeners: k, focus: w, BentoDropdownOptionsContainer: Vl, BentoTypography: ae, ErrorMessage: It, FieldLabel: Et, BentoTeleport: Ct, vBentoClickOutsideDirective: Ot, vBentoKeyboardNavigationDirective: we };
|
|
2617
|
+
}
|
|
2618
|
+
});
|
|
2619
|
+
var Oa = function() {
|
|
2620
|
+
var s, o;
|
|
2621
|
+
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
2622
|
+
return l("div", { directives: [{ name: "bento-click-outside-directive", rawName: "v-bento-click-outside-directive", value: t.clickOutsideDropdownOptions, expression: "clickOutsideDropdownOptions" }], staticClass: "b-dropdown", class: t.conditionalClasses }, [t.label ? l(t.FieldLabel, { attrs: { id: t.labelId, condensed: e.condensed, label: t.label, "tooltip-text": e.tooltipText, optional: e.optional, required: e.required } }) : e._e(), l("div", e._g({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], ref: "inputContainerRefWrapper" }, t.textboxKeyboardNavigationListeners), [l(t.computedSize, { ref: "inputContainerRef", tag: "component", attrs: { condensed: e.condensed, value: t.searchTerm, "additional-items-selected": t.additionalItemsSelected, "aria-controls": t.dropdownOptionsContainerId, ariaExpanded: t.isDropdownOpen, "aria-labelledby": t.label ? t.labelId : null, "aria-describedby": t.ariaDescribedBy, "aria-label": t.computedAriaLabel, "aria-readonly": t.isReadOnly, "aria-required": e.required, readonly: t.isReadOnly, disabled: e.disabled, "display-value": t.displayValue, "dynamic-filtering": e.dynamicFiltering, "is-invalid": !!e.errorMessage || e.error, multiple: e.multiple, open: t.isDropdownOpen, "selected-value-item": t.isInputComponent ? void 0 : t.selectedValueItem, "show-slot-content-in-multiple": e.showSlotContentInMultiple }, on: { input: function(i) {
|
|
2623
|
+
t.searchTerm = i;
|
|
2624
|
+
}, open: t.toggleDropdown, close: t.toggleDropdown }, scopedSlots: e._u([e._l(t.slots, function(i, r) {
|
|
2625
|
+
return { key: r, fn: function(v) {
|
|
2626
|
+
return [e._t(r, null, null, v)];
|
|
2627
|
+
} };
|
|
2628
|
+
})], null, !0) })], 1), t.inputContainerRef ? l(t.BentoTeleport, { attrs: { disabled: (s = e.teleport) == null ? void 0 : s.disabled, to: (o = e.teleport) == null ? void 0 : o.to } }, [l(t.BentoDropdownOptionsContainer, e._g({ ref: "optionsContainerRef", attrs: { id: t.dropdownOptionsContainerId, "aria-label": t.computedAriaLabel, "component-loading": e.componentLoading, "empty-state": e.emptyState, disabled: e.disabled, "is-option-disabled": e.isOptionDisabled, items: t.filteredItems, multiple: e.multiple, "static-categories": t.staticCategories, open: t.isDropdownOpen, "selected-value": t.cachedSelectedListboxOptions, searching: t.isSearching, "target-element": t.inputContainerRefWrapper, loading: e.loading, "has-more-items": e.hasMoreItems, "lazy-load-type": e.lazyLoadType, "virtual-scroll": e.virtualScroll }, scopedSlots: e._u([e._l(t.slots, function(i, r) {
|
|
2629
|
+
return { key: r, fn: function(v) {
|
|
2630
|
+
return [e._t(r, null, null, v)];
|
|
2631
|
+
} };
|
|
2632
|
+
})], null, !0) }, t.listboxListeners))], 1) : e._e(), e.errorMessage ? l(t.ErrorMessage, { staticClass: "b-dropdown__error-message", attrs: { id: t.errorId, "error-message": e.errorMessage } }) : e._e(), e.description || t.hasSlot("description") ? l(t.BentoTypography, { staticClass: "b-dropdown__description", class: t.descriptionConditionalClasses, attrs: { id: t.descriptionId, el: "span" } }, [e._t("description", function() {
|
|
2633
|
+
return [e._v(" " + e._s(e.description) + " ")];
|
|
2634
|
+
})], 2) : e._e()], 1);
|
|
2635
|
+
}, Ea = [], Ia = /* @__PURE__ */ U(
|
|
2636
|
+
Ca,
|
|
2637
|
+
Oa,
|
|
2638
|
+
Ea,
|
|
2639
|
+
!1,
|
|
2640
|
+
null,
|
|
2641
|
+
"65b604ae"
|
|
2642
|
+
);
|
|
2643
|
+
const ts = Ia.exports;
|
|
2644
|
+
export {
|
|
2645
|
+
ts as B,
|
|
2646
|
+
zt as C,
|
|
2647
|
+
Ql as D,
|
|
2648
|
+
d as a,
|
|
2649
|
+
te as b,
|
|
2650
|
+
be as c,
|
|
2651
|
+
Me as d,
|
|
2652
|
+
lt as e,
|
|
2653
|
+
ha as f,
|
|
2654
|
+
at as g,
|
|
2655
|
+
zl as h,
|
|
2656
|
+
st as i,
|
|
2657
|
+
Ve as j,
|
|
2658
|
+
kl as u
|
|
2659
|
+
};
|
|
2660
|
+
//# sourceMappingURL=dropdown.CIEm6MBB.js.map
|