@adyen/bento-vue2 1.65.0 → 1.66.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 +416 -234
- package/dist/action-bar.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions-with-menu.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/copy.css +1 -1
- package/dist/assets/data-grid-template.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date.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/header.css +1 -1
- package/dist/assets/info-icon.css +1 -1
- package/dist/assets/input-field-password.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/menu.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/pagination.css +1 -1
- package/dist/assets/popover.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/step.css +1 -1
- package/dist/assets/summary-grid.css +1 -1
- package/dist/assets/tab.css +1 -0
- package/dist/assets/textarea.css +1 -1
- package/dist/assets/use-cached-selected-values.css +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{action-bar.DHdrZtmW.js → action-bar.C8zeHAJG.js} +31 -31
- package/dist/chunks/action-bar.C8zeHAJG.js.map +1 -0
- package/dist/chunks/button-actions-with-menu.BVU1NS0m.js +83 -0
- package/dist/chunks/button-actions-with-menu.BVU1NS0m.js.map +1 -0
- package/dist/chunks/calendar.DvIQEYwN.js +2086 -0
- package/dist/chunks/calendar.DvIQEYwN.js.map +1 -0
- package/dist/chunks/{checkbox-group.DVX0GFm9.js → checkbox-group.BVMGnokj.js} +4 -4
- package/dist/chunks/{checkbox-group.DVX0GFm9.js.map → checkbox-group.BVMGnokj.js.map} +1 -1
- package/dist/chunks/{checkbox.nHrvoKfp.js → checkbox.Bg5FM5Oa.js} +2 -2
- package/dist/chunks/{checkbox.nHrvoKfp.js.map → checkbox.Bg5FM5Oa.js.map} +1 -1
- package/dist/chunks/{code-snippet.W8Zp0zQP.js → code-snippet.BcoVTIs2.js} +3 -3
- package/dist/chunks/{code-snippet.W8Zp0zQP.js.map → code-snippet.BcoVTIs2.js.map} +1 -1
- package/dist/chunks/{controls-group.BWAmz7Tg.js → controls-group.CccuLkgP.js} +2 -2
- package/dist/chunks/{controls-group.BWAmz7Tg.js.map → controls-group.CccuLkgP.js.map} +1 -1
- package/dist/chunks/copy.CF8Fzu2Y.js +96 -0
- package/dist/chunks/copy.CF8Fzu2Y.js.map +1 -0
- package/dist/chunks/{dashboard-section.Bz54Z6Hh.js → dashboard-section.CcEIwDqX.js} +3 -3
- package/dist/chunks/{dashboard-section.Bz54Z6Hh.js.map → dashboard-section.CcEIwDqX.js.map} +1 -1
- package/dist/chunks/{data-grid-template.DtFRjaR8.js → data-grid-template.DJQcVuPs.js} +16 -14
- package/dist/chunks/data-grid-template.DJQcVuPs.js.map +1 -0
- package/dist/chunks/{data-grid.D4oeTUhn.js → data-grid.t4fCoE2Y.js} +10 -10
- package/dist/chunks/{data-grid.D4oeTUhn.js.map → data-grid.t4fCoE2Y.js.map} +1 -1
- package/dist/chunks/{date-picker.k0g6anfy.js → date-picker.DOAWsba5.js} +6 -7
- package/dist/chunks/{date-picker.k0g6anfy.js.map → date-picker.DOAWsba5.js.map} +1 -1
- package/dist/chunks/{date-range-picker.D9lyIoO-.js → date-range-picker.DYxZygbL.js} +22 -23
- package/dist/chunks/{date-range-picker.D9lyIoO-.js.map → date-range-picker.DYxZygbL.js.map} +1 -1
- package/dist/chunks/date.BfyWX2PY.js +160 -0
- package/dist/chunks/date.BfyWX2PY.js.map +1 -0
- package/dist/chunks/{dropdown-tag.DKhxBV52.js → dropdown-tag.DYg5l6HT.js} +2 -2
- package/dist/chunks/{dropdown-tag.DKhxBV52.js.map → dropdown-tag.DYg5l6HT.js.map} +1 -1
- package/dist/chunks/{dropdown.DV7uhHNP.js → dropdown.BWsU98dn.js} +265 -270
- package/dist/chunks/{dropdown.DV7uhHNP.js.map → dropdown.BWsU98dn.js.map} +1 -1
- package/dist/chunks/{error-message.1Em7Lis3.js → error-message.BgxnwPLF.js} +2 -2
- package/dist/chunks/{error-message.1Em7Lis3.js.map → error-message.BgxnwPLF.js.map} +1 -1
- package/dist/chunks/es6.n1ewaW31.js.map +1 -1
- package/dist/chunks/{file-uploader.DyjdNLOa.js → file-uploader.BPslxGI8.js} +323 -323
- package/dist/chunks/file-uploader.BPslxGI8.js.map +1 -0
- package/dist/chunks/{filter-bar.BxDEplt3.js → filter-bar.Bx3wivl8.js} +664 -649
- package/dist/chunks/{filter-bar.BxDEplt3.js.map → filter-bar.Bx3wivl8.js.map} +1 -1
- package/dist/chunks/{get-date-locale.BN8xEjY0.js → get-date-locale.CAyOIbcp.js} +288 -649
- package/dist/chunks/get-date-locale.CAyOIbcp.js.map +1 -0
- package/dist/chunks/{header-with-views.Ds9mcwmp.js → header-with-views.B6mwBJjk.js} +13 -13
- package/dist/chunks/{header-with-views.Ds9mcwmp.js.map → header-with-views.B6mwBJjk.js.map} +1 -1
- package/dist/chunks/{header.Cb644uAi.js → header.hTMmMN8n.js} +25 -24
- package/dist/chunks/{header.Cb644uAi.js.map → header.hTMmMN8n.js.map} +1 -1
- package/dist/chunks/index.BrH1t1iu.js +407 -0
- package/dist/chunks/index.BrH1t1iu.js.map +1 -0
- package/dist/chunks/info-icon.CYOXx8CL.js +37 -0
- package/dist/chunks/info-icon.CYOXx8CL.js.map +1 -0
- package/dist/chunks/input-field-password.B8qWGzaB.js +252 -0
- package/dist/chunks/input-field-password.B8qWGzaB.js.map +1 -0
- package/dist/chunks/{input-field-phone-number.B3qzZKuP.js → input-field-phone-number.Bi4TJhbX.js} +3 -3
- package/dist/chunks/{input-field-phone-number.B3qzZKuP.js.map → input-field-phone-number.Bi4TJhbX.js.map} +1 -1
- package/dist/chunks/{input-field.B_3nZFYz.js → input-field.L5bWjTpB.js} +3 -3
- package/dist/chunks/{input-field.B_3nZFYz.js.map → input-field.L5bWjTpB.js.map} +1 -1
- package/dist/chunks/{pagination.Cl7SzoId.js → pagination.CW_1yX5C.js} +115 -115
- package/dist/chunks/pagination.CW_1yX5C.js.map +1 -0
- package/dist/chunks/{radio-group.CtPG_iiI.js → radio-group.4_KKjvAm.js} +3 -3
- package/dist/chunks/{radio-group.CtPG_iiI.js.map → radio-group.4_KKjvAm.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.CLxVaskq.js → rich-text-editor.BpaFd2-y.js} +3 -3
- package/dist/chunks/{rich-text-editor.CLxVaskq.js.map → rich-text-editor.BpaFd2-y.js.map} +1 -1
- package/dist/chunks/{search-bar.CadVBoj0.js → search-bar.5JHI6li0.js} +3 -3
- package/dist/chunks/{search-bar.CadVBoj0.js.map → search-bar.5JHI6li0.js.map} +1 -1
- package/dist/chunks/{secondary-nav.OwimHNCb.js → secondary-nav.D4hrWvf7.js} +2 -2
- package/dist/chunks/{secondary-nav.OwimHNCb.js.map → secondary-nav.D4hrWvf7.js.map} +1 -1
- package/dist/chunks/{selection-card-group.CoqBRUT8.js → selection-card-group.0o5T4tab.js} +3 -3
- package/dist/chunks/{selection-card-group.CoqBRUT8.js.map → selection-card-group.0o5T4tab.js.map} +1 -1
- package/dist/chunks/step.DMMofD4B.js +217 -0
- package/dist/chunks/step.DMMofD4B.js.map +1 -0
- package/dist/chunks/{structured-list-item.tox2Kcb6.js → structured-list-item.Bnn6-Z3q.js} +3 -3
- package/dist/chunks/{structured-list-item.tox2Kcb6.js.map → structured-list-item.Bnn6-Z3q.js.map} +1 -1
- package/dist/chunks/summary-grid.types.Cwri2Y3T.js +337 -0
- package/dist/chunks/summary-grid.types.Cwri2Y3T.js.map +1 -0
- package/dist/chunks/tab.BhWPBxcB.js +192 -0
- package/dist/chunks/tab.BhWPBxcB.js.map +1 -0
- package/dist/chunks/{tabs.keys.Bc2pSKRw.js → tabs.keys.Cb4Vw5Jh.js} +3 -3
- package/dist/chunks/{tabs.keys.Bc2pSKRw.js.map → tabs.keys.Cb4Vw5Jh.js.map} +1 -1
- package/dist/chunks/{textarea.BPeDUAPL.js → textarea.RAU710Uw.js} +83 -80
- package/dist/chunks/textarea.RAU710Uw.js.map +1 -0
- package/dist/chunks/{timeline-item.CS9ZDOsm.js → timeline-item.DK2d00rt.js} +10 -11
- package/dist/chunks/timeline-item.DK2d00rt.js.map +1 -0
- package/dist/chunks/{use-cached-selected-values.DNOmzQVy.js → use-cached-selected-values.CusB5KBl.js} +568 -528
- package/dist/chunks/use-cached-selected-values.CusB5KBl.js.map +1 -0
- package/dist/code-snippet.js +1 -1
- package/dist/dashboard-template.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.js +1 -1
- package/dist/dropdown.js +3 -3
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +34 -34
- package/dist/info-icon.js +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/internal.js +6 -6
- package/dist/pagination.js +1 -1
- package/dist/radio-group.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/stepper.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/styles/bento-dark.css +1 -0
- package/dist/styles/bento-light.css +1 -0
- package/dist/styles/bento.css +1 -0
- package/dist/styles/legacy.css +1 -0
- package/dist/styles/styleguide.css +1 -0
- package/dist/summary-grid.js +1 -1
- package/dist/tabs.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/web-types.json +197 -79
- package/package.json +5 -5
- package/dist/assets/tabs.css +0 -1
- package/dist/chunks/action-bar.DHdrZtmW.js.map +0 -1
- package/dist/chunks/button-actions-with-menu.CYkEoiee.js +0 -166
- package/dist/chunks/button-actions-with-menu.CYkEoiee.js.map +0 -1
- package/dist/chunks/calendar.DbTC35rM.js +0 -1167
- package/dist/chunks/calendar.DbTC35rM.js.map +0 -1
- package/dist/chunks/copy.CXeLbvUP.js +0 -129
- package/dist/chunks/copy.CXeLbvUP.js.map +0 -1
- package/dist/chunks/data-grid-template.DtFRjaR8.js.map +0 -1
- package/dist/chunks/date.dYFFEunA.js +0 -987
- package/dist/chunks/date.dYFFEunA.js.map +0 -1
- package/dist/chunks/file-uploader.DyjdNLOa.js.map +0 -1
- package/dist/chunks/get-date-locale.BN8xEjY0.js.map +0 -1
- package/dist/chunks/index.BDuTpjD8.js +0 -40
- package/dist/chunks/index.BDuTpjD8.js.map +0 -1
- package/dist/chunks/index.DD7TppDb.js +0 -10
- package/dist/chunks/index.DD7TppDb.js.map +0 -1
- package/dist/chunks/info-icon.B9aTl1nU.js +0 -41
- package/dist/chunks/info-icon.B9aTl1nU.js.map +0 -1
- package/dist/chunks/input-field-password.Bloa-rqx.js +0 -252
- package/dist/chunks/input-field-password.Bloa-rqx.js.map +0 -1
- package/dist/chunks/pagination.Cl7SzoId.js.map +0 -1
- package/dist/chunks/step.dNTg2rtW.js +0 -217
- package/dist/chunks/step.dNTg2rtW.js.map +0 -1
- package/dist/chunks/summary-grid.types.CkUIw703.js +0 -301
- package/dist/chunks/summary-grid.types.CkUIw703.js.map +0 -1
- package/dist/chunks/tabs.Dx6teJGW.js +0 -205
- package/dist/chunks/tabs.Dx6teJGW.js.map +0 -1
- package/dist/chunks/textarea.BPeDUAPL.js.map +0 -1
- package/dist/chunks/timeline-item.CS9ZDOsm.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.DNOmzQVy.js.map +0 -1
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
import { computed as
|
|
1
|
+
import { computed as i, ref as E, onMounted as Ne, onUnmounted as $e, watch as q, defineComponent as w, nextTick as me, toRef as j, useSlots as Me, useAttrs as we } from "vue";
|
|
2
2
|
import { B as W } from "./typography.J1v_SPG3.js";
|
|
3
|
-
import { B as
|
|
4
|
-
import { B as
|
|
5
|
-
import { u as
|
|
6
|
-
import { d as
|
|
3
|
+
import { B as Ge } from "./loading-indicator.z8COalOc.js";
|
|
4
|
+
import { B as Pe } from "./empty-state.mtXfb1BB.js";
|
|
5
|
+
import { u as se } from "./i18n.BQkEbtPM.js";
|
|
6
|
+
import { d as Fe } from "./debounce.DUTu11PS.js";
|
|
7
7
|
import "./index.Cl4_42j5.js";
|
|
8
|
-
import { B as
|
|
9
|
-
import { C as
|
|
10
|
-
import { C as
|
|
11
|
-
import { n as
|
|
12
|
-
import { C as
|
|
13
|
-
import { C as
|
|
14
|
-
import { B as
|
|
15
|
-
import { d as
|
|
8
|
+
import { B as Ye } from "./chip.OV0EWIP3.js";
|
|
9
|
+
import { C as J, N as Ue } from "./minus-small.DJacLGTw.js";
|
|
10
|
+
import { C as ze } from "./checkmark-small.DVDtD4HQ.js";
|
|
11
|
+
import { n as $ } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
12
|
+
import { C as Ve } from "./chevron-down.eYtgv5ly.js";
|
|
13
|
+
import { C as We } from "./chevron-up.d8cwIlA_.js";
|
|
14
|
+
import { B as N, a as le } from "./keyboard-navigation.pB8weElW.js";
|
|
15
|
+
import { d as Ke, e as be } from "./button-actions._OIvTdKt.js";
|
|
16
16
|
/* empty css */
|
|
17
|
-
import { o as
|
|
17
|
+
import { o as je } from "./resize.Bqks3WUm.js";
|
|
18
18
|
import "../assets/use-cached-selected-values.css";
|
|
19
|
-
const
|
|
20
|
-
const n =
|
|
19
|
+
const _e = (s, e, l, t) => {
|
|
20
|
+
const n = i(
|
|
21
21
|
() => {
|
|
22
|
-
var
|
|
23
|
-
return !!((
|
|
22
|
+
var f, I;
|
|
23
|
+
return !!((f = s.value) != null && f.length) && ((I = s.value) == null ? void 0 : I.length) === e.value.length;
|
|
24
24
|
}
|
|
25
|
-
),
|
|
26
|
-
var
|
|
27
|
-
return s.value == null || s.value.length === 0 ? !1 : ((
|
|
25
|
+
), o = i(() => {
|
|
26
|
+
var f;
|
|
27
|
+
return s.value == null || s.value.length === 0 ? !1 : ((f = s.value) == null ? void 0 : f.length) !== e.value.length;
|
|
28
28
|
});
|
|
29
29
|
return {
|
|
30
30
|
isAllSelected: n,
|
|
31
|
-
isIndeterminate:
|
|
32
|
-
toggleSelectAll: (
|
|
33
|
-
|
|
31
|
+
isIndeterminate: o,
|
|
32
|
+
toggleSelectAll: (f) => {
|
|
33
|
+
f ? l() : t();
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
|
-
function
|
|
38
|
-
const
|
|
39
|
-
let
|
|
40
|
-
const
|
|
41
|
-
const
|
|
37
|
+
function qe(s, { disabled: e, itemHeight: l, overscan: t = 5, prefixHeight: n }) {
|
|
38
|
+
const o = E(null), r = E([]), f = E(0), I = E(0), d = E(0);
|
|
39
|
+
let b;
|
|
40
|
+
const O = i(() => {
|
|
41
|
+
const T = typeof l == "number" ? s.value.length * l : s.value.reduce((S, m, y) => S + l(y), 0), A = typeof l == "number" ? f.value * l : s.value.slice(0, f.value).reduce((S, m, y) => S + l(y), 0);
|
|
42
42
|
return {
|
|
43
43
|
style: {
|
|
44
|
-
marginTop: `${
|
|
45
|
-
height: `${
|
|
44
|
+
marginTop: `${A}px`,
|
|
45
|
+
height: `${T - A}px`
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
}),
|
|
49
|
-
const
|
|
48
|
+
}), p = () => {
|
|
49
|
+
const T = (n == null ? void 0 : n.value) ?? 0, A = Math.max(o.value.scrollTop - T, 0);
|
|
50
50
|
if (typeof l == "number")
|
|
51
|
-
return Math.floor(
|
|
52
|
-
let
|
|
53
|
-
for (let
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
|
|
51
|
+
return Math.floor(A / l);
|
|
52
|
+
let S = 0, m = 0;
|
|
53
|
+
for (let y = 0; y < s.value.length; y += 1) {
|
|
54
|
+
const h = l(y);
|
|
55
|
+
if (S += h, S >= A) {
|
|
56
|
+
m = y;
|
|
57
57
|
break;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
return
|
|
60
|
+
return m;
|
|
61
61
|
}, g = () => {
|
|
62
|
-
if (d.value =
|
|
62
|
+
if (d.value = o.value.clientHeight, typeof l == "number")
|
|
63
63
|
return Math.ceil(d.value / l);
|
|
64
|
-
const
|
|
65
|
-
let
|
|
66
|
-
for (let
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
64
|
+
const T = f.value ?? 0;
|
|
65
|
+
let A = 0, S = 0;
|
|
66
|
+
for (let m = T; m < s.value.length; m += 1) {
|
|
67
|
+
const y = l(m);
|
|
68
|
+
if (A += y, S = m, A > d.value)
|
|
69
69
|
break;
|
|
70
70
|
}
|
|
71
|
-
return
|
|
72
|
-
},
|
|
73
|
-
if (
|
|
74
|
-
const
|
|
75
|
-
|
|
71
|
+
return S - T;
|
|
72
|
+
}, C = () => {
|
|
73
|
+
if (o.value) {
|
|
74
|
+
const T = g();
|
|
75
|
+
f.value = p(), I.value = Math.min(f.value + T + t, s.value.length), r.value = s.value.slice(f.value, I.value);
|
|
76
76
|
}
|
|
77
|
-
},
|
|
78
|
-
|
|
77
|
+
}, D = () => {
|
|
78
|
+
C();
|
|
79
79
|
};
|
|
80
|
-
e || (
|
|
81
|
-
|
|
82
|
-
d.value =
|
|
83
|
-
}),
|
|
84
|
-
}),
|
|
85
|
-
|
|
86
|
-
}),
|
|
80
|
+
e || (Ne(() => {
|
|
81
|
+
o.value && (d.value = o.value.clientHeight, b = je(o.value, ({ clientHeight: T }) => {
|
|
82
|
+
d.value = T, C();
|
|
83
|
+
}), C());
|
|
84
|
+
}), $e(() => {
|
|
85
|
+
b == null || b.disconnect();
|
|
86
|
+
}), q(
|
|
87
87
|
() => s.value,
|
|
88
88
|
() => {
|
|
89
|
-
|
|
89
|
+
C();
|
|
90
90
|
}
|
|
91
91
|
));
|
|
92
92
|
const L = {
|
|
93
|
-
ref:
|
|
93
|
+
ref: o,
|
|
94
94
|
style: { overflowY: "auto" }
|
|
95
95
|
};
|
|
96
96
|
return e ? {
|
|
97
|
-
containerRef:
|
|
97
|
+
containerRef: o,
|
|
98
98
|
containerProps: L,
|
|
99
99
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
100
100
|
onScroll: () => {
|
|
101
101
|
},
|
|
102
102
|
list: s
|
|
103
103
|
} : {
|
|
104
|
-
containerRef:
|
|
104
|
+
containerRef: o,
|
|
105
105
|
containerProps: L,
|
|
106
|
-
onScroll:
|
|
107
|
-
list:
|
|
108
|
-
wrapperProps:
|
|
106
|
+
onScroll: D,
|
|
107
|
+
list: r,
|
|
108
|
+
wrapperProps: O
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
|
-
var
|
|
112
|
-
const
|
|
111
|
+
var c = /* @__PURE__ */ ((s) => (s.SELECT = "select", s.SHOW_MORE = "show-more", s.ESCAPE = "escape-pressed", s.CLICK = "click", s.ENTER = "enter-pressed", s.SPACE = "space-pressed", s.TAB = "tab-pressed", s.CLOSE_DROPDOWN = "close-dropdown", s))(c || {}), V = /* @__PURE__ */ ((s) => (s.AUTOMATIC = "automatic", s.BUTTON = "button", s.NONE = "none", s))(V || {});
|
|
112
|
+
const He = w({
|
|
113
113
|
name: "bento-listbox-static-category",
|
|
114
114
|
components: {
|
|
115
115
|
BentoTypography: W
|
|
@@ -124,18 +124,18 @@ const Ye = w({
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
});
|
|
127
|
-
var
|
|
127
|
+
var Xe = function() {
|
|
128
128
|
var e = this, l = e._self._c;
|
|
129
129
|
return e._self._setupProxy, l("div", { staticClass: "b-listbox-single-select-category" }, [l("bento-typography", { staticClass: "b-listbox-single-select-category__label-text", attrs: { variant: "caption", el: "span" } }, [e._v(" " + e._s(e.categoryLabel) + " ")]), l("div", [e._t("default")], 2)], 1);
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
}, Je = [], Ze = /* @__PURE__ */ $(
|
|
131
|
+
He,
|
|
132
|
+
Xe,
|
|
133
|
+
Je,
|
|
134
134
|
!1,
|
|
135
135
|
null,
|
|
136
136
|
"4aa8cc6e"
|
|
137
137
|
);
|
|
138
|
-
const
|
|
138
|
+
const Qe = Ze.exports, et = w({
|
|
139
139
|
name: "bento-listbox-option",
|
|
140
140
|
props: {
|
|
141
141
|
/**
|
|
@@ -147,29 +147,29 @@ const Ke = We.exports, Ve = w({
|
|
|
147
147
|
*/
|
|
148
148
|
selected: { type: Boolean, default: !1 }
|
|
149
149
|
},
|
|
150
|
-
emits: [
|
|
150
|
+
emits: [c.CLICK, c.ENTER, c.SPACE, c.TAB],
|
|
151
151
|
setup(s, { emit: e }) {
|
|
152
|
-
const l =
|
|
152
|
+
const l = i(() => ({
|
|
153
153
|
"b-listbox-option--disabled": s.disabled,
|
|
154
154
|
"b-listbox-option--selected": s.selected
|
|
155
155
|
}));
|
|
156
156
|
return {
|
|
157
157
|
// Enums
|
|
158
|
-
BentoKeyboardNavigationKeyDownEvent:
|
|
159
|
-
BentoListboxEvent:
|
|
158
|
+
BentoKeyboardNavigationKeyDownEvent: N,
|
|
159
|
+
BentoListboxEvent: c,
|
|
160
160
|
// Values
|
|
161
161
|
conditionalClasses: l,
|
|
162
162
|
// Events
|
|
163
|
-
onClick: (
|
|
164
|
-
e(
|
|
163
|
+
onClick: (o) => {
|
|
164
|
+
e(c.CLICK, o);
|
|
165
165
|
},
|
|
166
|
-
onOptionSelected: (
|
|
167
|
-
e(
|
|
166
|
+
onOptionSelected: (o, r) => {
|
|
167
|
+
e(o, r);
|
|
168
168
|
}
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
171
|
});
|
|
172
|
-
var
|
|
172
|
+
var tt = function() {
|
|
173
173
|
var e = this, l = e._self._c;
|
|
174
174
|
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) {
|
|
175
175
|
return !t.type.indexOf("key") && e._k(t.keyCode, "enter", 13, t.key, "Enter") ? null : e.onOptionSelected(e.BentoListboxEvent.ENTER, t);
|
|
@@ -178,38 +178,38 @@ var qe = function() {
|
|
|
178
178
|
}, function(t) {
|
|
179
179
|
return !t.type.indexOf("key") && e._k(t.keyCode, "tab", 9, t.key, "Tab") ? null : e.onOptionSelected(e.BentoListboxEvent.TAB, t);
|
|
180
180
|
}] } }, "div", e.$attrs, !1), [e._t("default")], 2);
|
|
181
|
-
},
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
181
|
+
}, st = [], lt = /* @__PURE__ */ $(
|
|
182
|
+
et,
|
|
183
|
+
tt,
|
|
184
|
+
st,
|
|
185
185
|
!1,
|
|
186
186
|
null,
|
|
187
187
|
"a1e9ebff"
|
|
188
188
|
);
|
|
189
|
-
const
|
|
190
|
-
let
|
|
191
|
-
const
|
|
189
|
+
const Z = lt.exports;
|
|
190
|
+
let fe = 0;
|
|
191
|
+
const nt = {
|
|
192
192
|
beforeCreate() {
|
|
193
|
-
this.uuid =
|
|
193
|
+
this.uuid = fe.toString(), fe += 1;
|
|
194
194
|
}
|
|
195
195
|
};
|
|
196
|
-
var
|
|
196
|
+
var ot = function() {
|
|
197
197
|
var e = this, l = e._self._c;
|
|
198
198
|
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" } })]);
|
|
199
|
-
},
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
199
|
+
}, it = [], at = /* @__PURE__ */ $(
|
|
200
|
+
nt,
|
|
201
|
+
ot,
|
|
202
|
+
it,
|
|
203
203
|
!1,
|
|
204
204
|
null,
|
|
205
205
|
null
|
|
206
206
|
);
|
|
207
|
-
const
|
|
207
|
+
const ct = at.exports, rt = w({
|
|
208
208
|
name: "bento-listbox-single-select-option",
|
|
209
209
|
components: {
|
|
210
|
-
BentoListboxOption:
|
|
210
|
+
BentoListboxOption: Z,
|
|
211
211
|
BentoTypography: W,
|
|
212
|
-
CheckmarkIcon:
|
|
212
|
+
CheckmarkIcon: ct
|
|
213
213
|
},
|
|
214
214
|
props: {
|
|
215
215
|
/**
|
|
@@ -229,24 +229,24 @@ const et = Qe.exports, tt = w({
|
|
|
229
229
|
*/
|
|
230
230
|
selected: { type: Boolean, default: !1 }
|
|
231
231
|
},
|
|
232
|
-
emits: [
|
|
232
|
+
emits: [c.ENTER, c.SELECT, c.SPACE, c.TAB],
|
|
233
233
|
setup(s, { emit: e }) {
|
|
234
|
-
const l = (
|
|
235
|
-
s.disabled || e(
|
|
236
|
-
}, t =
|
|
234
|
+
const l = (r) => {
|
|
235
|
+
s.disabled || e(r, s.option);
|
|
236
|
+
}, t = i(() => s.disabled ? !0 : null), n = i(() => s.selected ? !0 : null), o = i(() => s.disabled ? -1 : 0);
|
|
237
237
|
return {
|
|
238
238
|
// Values
|
|
239
239
|
ariaDisabled: t,
|
|
240
240
|
ariaSelected: n,
|
|
241
|
-
tabIndex:
|
|
241
|
+
tabIndex: o,
|
|
242
242
|
// Enums
|
|
243
|
-
BentoListboxEvent:
|
|
243
|
+
BentoListboxEvent: c,
|
|
244
244
|
// Events
|
|
245
245
|
onOptionSelected: l
|
|
246
246
|
};
|
|
247
247
|
}
|
|
248
248
|
});
|
|
249
|
-
var
|
|
249
|
+
var ut = function() {
|
|
250
250
|
var e = this, l = e._self._c;
|
|
251
251
|
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) {
|
|
252
252
|
return e.onOptionSelected(e.BentoListboxEvent.SELECT);
|
|
@@ -259,17 +259,17 @@ var st = function() {
|
|
|
259
259
|
} } }, [e._t("default", function() {
|
|
260
260
|
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)];
|
|
261
261
|
}, 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);
|
|
262
|
-
},
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
262
|
+
}, dt = [], bt = /* @__PURE__ */ $(
|
|
263
|
+
rt,
|
|
264
|
+
ut,
|
|
265
|
+
dt,
|
|
266
266
|
!1,
|
|
267
267
|
null,
|
|
268
268
|
"5a5ff36a"
|
|
269
269
|
);
|
|
270
|
-
const
|
|
271
|
-
const l =
|
|
272
|
-
switch (
|
|
270
|
+
const ft = bt.exports, pe = ({ items: s }, e) => {
|
|
271
|
+
const l = i(() => s.value.length - 1), t = E(0), n = (p) => {
|
|
272
|
+
switch (p) {
|
|
273
273
|
case "increase":
|
|
274
274
|
t.value += 1;
|
|
275
275
|
break;
|
|
@@ -277,50 +277,69 @@ const it = nt.exports, _e = ({ items: s }, e) => {
|
|
|
277
277
|
t.value -= 1;
|
|
278
278
|
break;
|
|
279
279
|
}
|
|
280
|
-
},
|
|
281
|
-
t.value !==
|
|
282
|
-
},
|
|
283
|
-
|
|
280
|
+
}, o = ({ edgeCaseItem: p }, g) => {
|
|
281
|
+
t.value !== p && (n(g), e(t.value));
|
|
282
|
+
}, r = (p) => {
|
|
283
|
+
O(p), o(
|
|
284
284
|
{
|
|
285
285
|
edgeCaseItem: l.value
|
|
286
286
|
},
|
|
287
287
|
"increase"
|
|
288
288
|
/* INCREASE */
|
|
289
289
|
);
|
|
290
|
-
},
|
|
291
|
-
|
|
290
|
+
}, f = (p) => {
|
|
291
|
+
O(p), o(
|
|
292
292
|
{
|
|
293
293
|
edgeCaseItem: 0
|
|
294
294
|
},
|
|
295
295
|
"decrease"
|
|
296
296
|
/* DECREASE */
|
|
297
297
|
);
|
|
298
|
-
},
|
|
298
|
+
}, I = () => {
|
|
299
299
|
t.value = 0, e(t.value);
|
|
300
300
|
}, d = () => {
|
|
301
301
|
t.value = l.value, e(t.value);
|
|
302
|
-
},
|
|
303
|
-
t.value =
|
|
304
|
-
},
|
|
302
|
+
}, b = (p) => {
|
|
303
|
+
t.value = p;
|
|
304
|
+
}, O = (p) => {
|
|
305
305
|
var g;
|
|
306
|
-
(g =
|
|
306
|
+
(g = p == null ? void 0 : p.detail) == null || g.preventDefault();
|
|
307
307
|
};
|
|
308
308
|
return {
|
|
309
|
-
moveToFirstElement:
|
|
309
|
+
moveToFirstElement: I,
|
|
310
310
|
moveToLastElement: d,
|
|
311
|
-
moveToNextElement:
|
|
312
|
-
moveToPreviousElement:
|
|
313
|
-
setListboxFocusedIndex:
|
|
314
|
-
preventDefault:
|
|
311
|
+
moveToNextElement: r,
|
|
312
|
+
moveToPreviousElement: f,
|
|
313
|
+
setListboxFocusedIndex: b,
|
|
314
|
+
preventDefault: O,
|
|
315
315
|
focusedIndex: t
|
|
316
316
|
};
|
|
317
|
-
},
|
|
317
|
+
}, ge = (s, e, l = E("option"), t = !0) => {
|
|
318
|
+
const n = E([]), o = async () => {
|
|
319
|
+
if (!s.value || s.value.nodeType === Node.COMMENT_NODE)
|
|
320
|
+
return;
|
|
321
|
+
const r = Array.from(s.value.querySelectorAll(`[role="${l.value}"]`));
|
|
322
|
+
n.value = t ? r.filter((f) => f.checkVisibility()) : r;
|
|
323
|
+
};
|
|
324
|
+
return q(
|
|
325
|
+
e,
|
|
326
|
+
() => {
|
|
327
|
+
me(() => {
|
|
328
|
+
o();
|
|
329
|
+
});
|
|
330
|
+
},
|
|
331
|
+
{ immediate: !0 }
|
|
332
|
+
), {
|
|
333
|
+
visibleDomOptions: n,
|
|
334
|
+
updateVisibleDomOptions: o
|
|
335
|
+
};
|
|
336
|
+
}, vt = w({
|
|
318
337
|
name: "bento-listbox-single-select",
|
|
319
338
|
components: {
|
|
320
|
-
BentoListboxSingleSelectCategory:
|
|
321
|
-
BentoListboxSingleSelectOption:
|
|
339
|
+
BentoListboxSingleSelectCategory: Qe,
|
|
340
|
+
BentoListboxSingleSelectOption: ft
|
|
322
341
|
},
|
|
323
|
-
directives: { BentoKeyboardNavigationDirective:
|
|
342
|
+
directives: { BentoKeyboardNavigationDirective: le },
|
|
324
343
|
inheritAttrs: !1,
|
|
325
344
|
props: {
|
|
326
345
|
/**
|
|
@@ -361,115 +380,105 @@ const it = nt.exports, _e = ({ items: s }, e) => {
|
|
|
361
380
|
*/
|
|
362
381
|
staticCategories: { type: Boolean, default: !1 }
|
|
363
382
|
},
|
|
364
|
-
emits: [
|
|
383
|
+
emits: [c.SELECT, c.ENTER, c.SPACE, c.TAB],
|
|
365
384
|
setup(s, { emit: e, expose: l, slots: t, attrs: n }) {
|
|
366
|
-
const
|
|
385
|
+
const o = E(null), r = E([]), f = i(() => {
|
|
367
386
|
var m;
|
|
368
387
|
return !!((m = s.selectedValue) != null && m.length) && s.selectedValue.at(0);
|
|
369
|
-
}),
|
|
388
|
+
}), I = i(
|
|
370
389
|
() => {
|
|
371
|
-
var m,
|
|
390
|
+
var m, y, h, k;
|
|
372
391
|
return {
|
|
373
392
|
"aria-label": (m = n["aria-label"]) == null ? void 0 : m.toString(),
|
|
374
|
-
"aria-busy": (
|
|
375
|
-
"aria-atomic": (
|
|
393
|
+
"aria-busy": (y = n["aria-busy"]) == null ? void 0 : y.toString(),
|
|
394
|
+
"aria-atomic": (h = n["aria-atomic"]) == null ? void 0 : h.toString(),
|
|
376
395
|
"aria-live": (k = n["aria-live"]) == null ? void 0 : k.toString()
|
|
377
396
|
};
|
|
378
397
|
}
|
|
379
|
-
), d =
|
|
380
|
-
e(m, [
|
|
381
|
-
},
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
var p;
|
|
385
|
-
(p = b.value[m]) == null || p.focus();
|
|
398
|
+
), d = i(() => !!s.items.some(({ items: m }) => !!m)), b = (m) => (y) => {
|
|
399
|
+
e(m, [y]);
|
|
400
|
+
}, { visibleDomOptions: O } = ge(o, j(s, "items"), E("option"), !1), p = (m) => {
|
|
401
|
+
var y;
|
|
402
|
+
(y = O.value[m]) == null || y.focus();
|
|
386
403
|
}, {
|
|
387
|
-
moveToNextElement:
|
|
388
|
-
moveToPreviousElement:
|
|
389
|
-
moveToFirstElement:
|
|
390
|
-
moveToLastElement:
|
|
391
|
-
setListboxFocusedIndex:
|
|
392
|
-
} =
|
|
404
|
+
moveToNextElement: g,
|
|
405
|
+
moveToPreviousElement: C,
|
|
406
|
+
moveToFirstElement: D,
|
|
407
|
+
moveToLastElement: L,
|
|
408
|
+
setListboxFocusedIndex: T
|
|
409
|
+
} = pe(
|
|
393
410
|
{
|
|
394
|
-
items:
|
|
395
|
-
},
|
|
396
|
-
g
|
|
397
|
-
);
|
|
398
|
-
z(
|
|
399
|
-
() => s.items,
|
|
400
|
-
() => {
|
|
401
|
-
T();
|
|
411
|
+
items: O
|
|
402
412
|
},
|
|
403
|
-
|
|
404
|
-
)
|
|
405
|
-
|
|
406
|
-
[
|
|
407
|
-
[
|
|
408
|
-
[
|
|
409
|
-
[$.END]: C
|
|
413
|
+
p
|
|
414
|
+
), A = {
|
|
415
|
+
[N.ARROW_UP]: C,
|
|
416
|
+
[N.ARROW_DOWN]: g,
|
|
417
|
+
[N.HOME]: D,
|
|
418
|
+
[N.END]: L
|
|
410
419
|
}, S = {
|
|
411
|
-
[
|
|
412
|
-
[
|
|
413
|
-
[
|
|
414
|
-
[
|
|
420
|
+
[c.SELECT]: b(c.SELECT),
|
|
421
|
+
[c.SPACE]: b(c.SPACE),
|
|
422
|
+
[c.TAB]: b(c.TAB),
|
|
423
|
+
[c.ENTER]: b(c.ENTER)
|
|
415
424
|
};
|
|
416
425
|
return l({
|
|
417
426
|
/**
|
|
418
427
|
* Reference for a single listbox item.
|
|
419
428
|
* Required for keyboard navigation in dropdown as $children is removed in vue@3
|
|
420
429
|
*/
|
|
421
|
-
listboxItemRef:
|
|
430
|
+
listboxItemRef: r,
|
|
422
431
|
/**
|
|
423
432
|
* Method to set the index of the item to be focused on
|
|
424
433
|
* Used for focus management to be kept in-sync with parent e.g. dropdowns
|
|
425
434
|
*/
|
|
426
|
-
setListboxFocusedIndex:
|
|
435
|
+
setListboxFocusedIndex: T
|
|
427
436
|
}), {
|
|
428
437
|
// Enums
|
|
429
|
-
BentoListboxEvent:
|
|
438
|
+
BentoListboxEvent: c,
|
|
430
439
|
// Values
|
|
431
|
-
listboxRef:
|
|
432
|
-
listboxItemRef:
|
|
433
|
-
selectedItem:
|
|
440
|
+
listboxRef: o,
|
|
441
|
+
listboxItemRef: r,
|
|
442
|
+
selectedItem: f,
|
|
434
443
|
slots: t,
|
|
435
|
-
ariaAttributes:
|
|
444
|
+
ariaAttributes: I,
|
|
436
445
|
// Computed
|
|
437
446
|
hasCategories: d,
|
|
438
447
|
// Methods
|
|
439
|
-
onOptionSelected:
|
|
448
|
+
onOptionSelected: b,
|
|
440
449
|
// Keyboard navigation
|
|
441
|
-
listboxListeners:
|
|
450
|
+
listboxListeners: A,
|
|
442
451
|
listboxOptionListeners: S
|
|
443
452
|
};
|
|
444
453
|
}
|
|
445
454
|
});
|
|
446
|
-
var
|
|
455
|
+
var mt = function() {
|
|
447
456
|
var e = this, l = e._self._c;
|
|
448
457
|
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" } }, "div", e.ariaAttributes, !1), e.listboxListeners), [e.hasCategories && e.staticCategories ? e._l(e.items, function(t) {
|
|
449
458
|
return l("bento-listbox-single-select-category", { key: t.value, attrs: { "category-label": t.label, role: "group" } }, e._l(t.items, function(n) {
|
|
450
|
-
return l("bento-listbox-single-select-option", e._g({ key: n.value, ref: "listboxItemRef", refInFor: !0, attrs: { role: "option", option: n, disabled: e.isOptionDisabled ? e.isOptionDisabled(n) : null, selected: n.value === e.selectedItem.value }, scopedSlots: e._u([e._l(e.slots, function(
|
|
451
|
-
return { key:
|
|
452
|
-
return [e._t(
|
|
459
|
+
return l("bento-listbox-single-select-option", e._g({ key: n.value, ref: "listboxItemRef", refInFor: !0, attrs: { role: "option", option: n, disabled: e.isOptionDisabled ? e.isOptionDisabled(n) : null, selected: n.value === e.selectedItem.value }, scopedSlots: e._u([e._l(e.slots, function(o, r) {
|
|
460
|
+
return { key: r, fn: function(f) {
|
|
461
|
+
return [e._t(r, null, null, f)];
|
|
453
462
|
} };
|
|
454
463
|
})], null, !0) }, e.listboxOptionListeners));
|
|
455
464
|
}), 1);
|
|
456
465
|
}) : e._l(e.items, function(t) {
|
|
457
|
-
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(n,
|
|
458
|
-
return { key:
|
|
459
|
-
return [e._t(
|
|
466
|
+
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(n, o) {
|
|
467
|
+
return { key: o, fn: function(r) {
|
|
468
|
+
return [e._t(o, null, null, r)];
|
|
460
469
|
} };
|
|
461
470
|
})], null, !0) }, e.listboxOptionListeners));
|
|
462
471
|
})], 2);
|
|
463
|
-
},
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
472
|
+
}, _t = [], pt = /* @__PURE__ */ $(
|
|
473
|
+
vt,
|
|
474
|
+
mt,
|
|
475
|
+
_t,
|
|
467
476
|
!1,
|
|
468
477
|
null,
|
|
469
478
|
null
|
|
470
479
|
);
|
|
471
|
-
const
|
|
472
|
-
...
|
|
480
|
+
const gt = pt.exports, yt = {}, xt = /* @__PURE__ */ w({
|
|
481
|
+
...yt,
|
|
473
482
|
__name: "listbox-decorative-checkbox",
|
|
474
483
|
props: {
|
|
475
484
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -477,43 +486,43 @@ const ut = rt.exports, dt = {}, bt = /* @__PURE__ */ w({
|
|
|
477
486
|
checked: { type: Boolean, default: !1 }
|
|
478
487
|
},
|
|
479
488
|
setup(s) {
|
|
480
|
-
const e = s, l =
|
|
481
|
-
[`b-checkbox-input--${
|
|
482
|
-
})), t =
|
|
483
|
-
[`b-checkbox-input__outline--${
|
|
484
|
-
[`b-checkbox-input__outline--${
|
|
485
|
-
[`b-checkbox-input__outline--${
|
|
489
|
+
const e = s, l = i(() => ({
|
|
490
|
+
[`b-checkbox-input--${J.DISABLED}`]: e.disabled
|
|
491
|
+
})), t = i(() => ({
|
|
492
|
+
[`b-checkbox-input__outline--${J.UNCHECKED}`]: !e.checked && !e.indeterminate,
|
|
493
|
+
[`b-checkbox-input__outline--${J.CHECKED}`]: e.checked && !e.indeterminate,
|
|
494
|
+
[`b-checkbox-input__outline--${J.INDETERMINATE}`]: e.indeterminate
|
|
486
495
|
}));
|
|
487
|
-
return { __sfc: !0, props: e, conditionalClasses: l, outlineConditionalClasses: t, CheckmarkSmallIcon:
|
|
496
|
+
return { __sfc: !0, props: e, conditionalClasses: l, outlineConditionalClasses: t, CheckmarkSmallIcon: ze, MinusSmallIcon: Ue };
|
|
488
497
|
}
|
|
489
498
|
});
|
|
490
|
-
var
|
|
499
|
+
var ht = function() {
|
|
491
500
|
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
492
501
|
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.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);
|
|
493
|
-
},
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
502
|
+
}, Ct = [], St = /* @__PURE__ */ $(
|
|
503
|
+
xt,
|
|
504
|
+
ht,
|
|
505
|
+
Ct,
|
|
497
506
|
!1,
|
|
498
507
|
null,
|
|
499
508
|
"5dc60f05"
|
|
500
509
|
);
|
|
501
|
-
const
|
|
502
|
-
var
|
|
503
|
-
const
|
|
510
|
+
const ne = St.exports;
|
|
511
|
+
var ye = /* @__PURE__ */ ((s) => (s.DISABLED = "disabled", s.STATIC_CATEGORY = "static-category", s))(ye || {}), Y = /* @__PURE__ */ ((s) => (s.SELECT_CATEGORY = "select-category", s.UNSELECT_CATEGORY = "unselect-category", s.TOGGLE_CATEGORY_VISIBILITY = "toggle-category-visibility", s))(Y || {});
|
|
512
|
+
const Et = {
|
|
504
513
|
"en-US": {
|
|
505
514
|
categoryClosed: "{category} closed",
|
|
506
515
|
categoryOpened: "{category} opened"
|
|
507
516
|
}
|
|
508
|
-
},
|
|
509
|
-
i18n: { messages:
|
|
517
|
+
}, Ot = w({
|
|
518
|
+
i18n: { messages: Et },
|
|
510
519
|
name: "bento-listbox-multi-select-category",
|
|
511
520
|
components: {
|
|
512
521
|
BentoTypography: W,
|
|
513
|
-
BentoListboxOption:
|
|
514
|
-
ChevronDownIcon:
|
|
515
|
-
ChevronUpIcon:
|
|
516
|
-
ListboxDecorativeCheckbox:
|
|
522
|
+
BentoListboxOption: Z,
|
|
523
|
+
ChevronDownIcon: Ve,
|
|
524
|
+
ChevronUpIcon: We,
|
|
525
|
+
ListboxDecorativeCheckbox: ne
|
|
517
526
|
},
|
|
518
527
|
props: {
|
|
519
528
|
/**
|
|
@@ -564,92 +573,97 @@ const mt = {
|
|
|
564
573
|
Y.TOGGLE_CATEGORY_VISIBILITY
|
|
565
574
|
],
|
|
566
575
|
setup(s, { emit: e }) {
|
|
567
|
-
const l =
|
|
568
|
-
() => s.category.items.every((
|
|
569
|
-
),
|
|
570
|
-
[`b-listbox-multi-select-category--${
|
|
571
|
-
})), d = (
|
|
572
|
-
|
|
573
|
-
},
|
|
574
|
-
var
|
|
575
|
-
const
|
|
576
|
-
return { isDisabled:
|
|
577
|
-
},
|
|
578
|
-
() => s.category.items.filter((
|
|
579
|
-
const { isDisabled:
|
|
580
|
-
return
|
|
576
|
+
const l = E(!1), { t } = se(), n = (h) => s.isOptionDisabled ? s.isOptionDisabled(h) : !1, o = i(
|
|
577
|
+
() => s.category.items.every((h) => n(h))
|
|
578
|
+
), r = j(s, "staticCategories"), f = i(() => l.value || s.staticCategories), I = i(() => ({
|
|
579
|
+
[`b-listbox-multi-select-category--${ye.DISABLED}`]: o.value
|
|
580
|
+
})), d = (h, k) => {
|
|
581
|
+
h.preventDefault(), l.value = k !== void 0 ? k : !l.value, e(Y.TOGGLE_CATEGORY_VISIBILITY, s.category.value);
|
|
582
|
+
}, b = (h) => {
|
|
583
|
+
var G;
|
|
584
|
+
const k = n(h), B = ((G = s.selectedItemsList) == null ? void 0 : G.includes(h.value)) || !1;
|
|
585
|
+
return { isDisabled: k, isPreSelected: B };
|
|
586
|
+
}, O = i(
|
|
587
|
+
() => s.category.items.filter((h) => {
|
|
588
|
+
const { isDisabled: k, isPreSelected: B } = b(h);
|
|
589
|
+
return k && B || !k;
|
|
581
590
|
})
|
|
582
|
-
),
|
|
591
|
+
), p = i(
|
|
583
592
|
() => {
|
|
584
|
-
var
|
|
585
|
-
return (
|
|
586
|
-
({ value:
|
|
587
|
-
var
|
|
588
|
-
return (
|
|
593
|
+
var h;
|
|
594
|
+
return (h = O.value) == null ? void 0 : h.filter(
|
|
595
|
+
({ value: k }) => {
|
|
596
|
+
var B;
|
|
597
|
+
return (B = s.selectedItemsList) == null ? void 0 : B.includes(k);
|
|
589
598
|
}
|
|
590
599
|
);
|
|
591
600
|
}
|
|
592
|
-
), g =
|
|
593
|
-
const
|
|
594
|
-
return t(
|
|
595
|
-
}),
|
|
601
|
+
), g = i(() => {
|
|
602
|
+
const h = l.value ? "categoryOpened" : "categoryClosed";
|
|
603
|
+
return t(h, { category: s.category.label });
|
|
604
|
+
}), C = () => {
|
|
596
605
|
e(Y.SELECT_CATEGORY);
|
|
597
|
-
},
|
|
606
|
+
}, D = () => {
|
|
598
607
|
e(Y.UNSELECT_CATEGORY);
|
|
599
|
-
}, { isAllSelected: L, isIndeterminate:
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
),
|
|
605
|
-
|
|
608
|
+
}, { isAllSelected: L, isIndeterminate: T, toggleSelectAll: A } = _e(
|
|
609
|
+
p,
|
|
610
|
+
O,
|
|
611
|
+
C,
|
|
612
|
+
D
|
|
613
|
+
), S = i(() => T.value ? "mixed" : `${L.value}`), m = E(L.value), y = () => {
|
|
614
|
+
m.value = !m.value, A(m.value);
|
|
606
615
|
};
|
|
607
|
-
return
|
|
608
|
-
|
|
616
|
+
return q(L, () => {
|
|
617
|
+
m.value = L.value;
|
|
609
618
|
}), {
|
|
610
619
|
// Values
|
|
611
620
|
chevronTitle: g,
|
|
612
|
-
conditionalClass:
|
|
613
|
-
hasAllPropsDisabled:
|
|
621
|
+
conditionalClass: I,
|
|
622
|
+
hasAllPropsDisabled: o,
|
|
614
623
|
isOpen: l,
|
|
615
624
|
isAllSelected: L,
|
|
616
|
-
isIndeterminate:
|
|
617
|
-
isStaticCategory:
|
|
625
|
+
isIndeterminate: T,
|
|
626
|
+
isStaticCategory: r,
|
|
618
627
|
// Computed
|
|
619
|
-
showItemChildren:
|
|
620
|
-
ariaCheckedComputed:
|
|
628
|
+
showItemChildren: f,
|
|
629
|
+
ariaCheckedComputed: S,
|
|
621
630
|
// Methods
|
|
622
|
-
handleSelectAll:
|
|
631
|
+
handleSelectAll: y,
|
|
623
632
|
toggleOpen: d,
|
|
624
|
-
toggleSelectAll:
|
|
633
|
+
toggleSelectAll: A
|
|
625
634
|
};
|
|
626
635
|
}
|
|
627
636
|
});
|
|
628
|
-
var
|
|
637
|
+
var Tt = function() {
|
|
629
638
|
var e = this, l = e._self._c;
|
|
630
|
-
return e._self._setupProxy, l("div", [e.isStaticCategory ? l("div", { staticClass: "b-listbox-multi-select-category b-listbox-multi-select-category--static-category" }, [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-checked": e.ariaCheckedComputed, "aria-disabled": e.hasAllPropsDisabled }, on: { click: e.handleSelectAll, "enter-pressed": e.handleSelectAll, "space-pressed": function(t) {
|
|
639
|
+
return e._self._setupProxy, l("div", [e.isStaticCategory ? l("div", { staticClass: "b-listbox-multi-select-category b-listbox-multi-select-category--static-category" }, [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-checked": e.ariaCheckedComputed, "aria-disabled": e.hasAllPropsDisabled, "aria-expanded": e.isOpen, role: "treeitem" }, on: { click: e.handleSelectAll, "enter-pressed": e.handleSelectAll, "space-pressed": function(t) {
|
|
631
640
|
return t.preventDefault(), e.handleSelectAll.apply(null, arguments);
|
|
632
|
-
} }
|
|
641
|
+
} }, nativeOn: { keydown: [function(t) {
|
|
642
|
+
return !t.type.indexOf("key") && e._k(t.keyCode, "arrow-left", void 0, t.key, void 0) ? null : e.toggleOpen(t, !1);
|
|
643
|
+
}, function(t) {
|
|
644
|
+
return !t.type.indexOf("key") && e._k(t.keyCode, "arrow-right", void 0, t.key, void 0) ? null : e.toggleOpen(t, !0);
|
|
645
|
+
}] } }, [l("listbox-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: { el: "span" } }, [e._v(" " + e._s(e.category.label) + " ")]), l("div", { staticClass: "b-listbox-multi-select-category__label-chevron", attrs: { "data-testid": "toggle-listbox" }, on: { "!click": function(t) {
|
|
633
646
|
return t.stopPropagation(), e.toggleOpen.apply(null, arguments);
|
|
634
647
|
} } }, [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" }] }, [e._t("default")], 2)], 1);
|
|
635
|
-
},
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
648
|
+
}, It = [], At = /* @__PURE__ */ $(
|
|
649
|
+
Ot,
|
|
650
|
+
Tt,
|
|
651
|
+
It,
|
|
639
652
|
!1,
|
|
640
653
|
null,
|
|
641
|
-
"
|
|
654
|
+
"e1e7494c"
|
|
642
655
|
);
|
|
643
|
-
const
|
|
656
|
+
const Lt = At.exports;
|
|
644
657
|
var M = /* @__PURE__ */ ((s) => (s.SELECT_CATEGORY = "select-category", s.TOGGLE_CHECKBOX_SELECTION = "toggle-checkbox-selection", s.UNSELECT_CATEGORY = "unselect-category", s.TOGGLE_CATEGORY_VISIBILITY = "toggle-category-visibility", s))(M || {});
|
|
645
|
-
const
|
|
658
|
+
const kt = w({
|
|
646
659
|
name: "listbox-multi-select-options",
|
|
647
660
|
components: {
|
|
648
|
-
BentoListboxOption:
|
|
661
|
+
BentoListboxOption: Z,
|
|
649
662
|
BentoTypography: W,
|
|
650
|
-
ListboxMultiSelectCategory:
|
|
651
|
-
ListboxDecorativeCheckbox:
|
|
663
|
+
ListboxMultiSelectCategory: Lt,
|
|
664
|
+
ListboxDecorativeCheckbox: ne
|
|
652
665
|
},
|
|
666
|
+
inheritAttrs: !1,
|
|
653
667
|
props: {
|
|
654
668
|
/**
|
|
655
669
|
* Indicates if the items listed are inside a category
|
|
@@ -707,7 +721,14 @@ const Ct = w({
|
|
|
707
721
|
/**
|
|
708
722
|
* If enabled, dropdown will display non-selectable, static categories
|
|
709
723
|
*/
|
|
710
|
-
staticCategories: { type: Boolean, default: !1 }
|
|
724
|
+
staticCategories: { type: Boolean, default: !1 },
|
|
725
|
+
/**
|
|
726
|
+
* Object with the index of each item.
|
|
727
|
+
*/
|
|
728
|
+
itemsIndex: {
|
|
729
|
+
type: Object,
|
|
730
|
+
default: () => ({})
|
|
731
|
+
}
|
|
711
732
|
},
|
|
712
733
|
emits: [
|
|
713
734
|
M.TOGGLE_CHECKBOX_SELECTION,
|
|
@@ -719,89 +740,101 @@ const Ct = w({
|
|
|
719
740
|
const l = (d) => {
|
|
720
741
|
s.isOptionDisabled(d) || e(M.TOGGLE_CHECKBOX_SELECTION, d);
|
|
721
742
|
}, t = (d) => !!d.items, n = (d) => {
|
|
722
|
-
const
|
|
723
|
-
return d.description && (!s.isMultiLevel ||
|
|
724
|
-
},
|
|
743
|
+
const b = s.isMultiLevel && s.searching;
|
|
744
|
+
return d.description && (!s.isMultiLevel || b);
|
|
745
|
+
}, o = (d) => d.items ? !!d.items.find((b) => s.selectedItemsList.includes(b.value)) : s.selectedItemsList.includes(d.value), r = (d) => {
|
|
725
746
|
if (t(d)) {
|
|
726
|
-
const
|
|
727
|
-
e(
|
|
747
|
+
const b = o(d) ? M.UNSELECT_CATEGORY : M.SELECT_CATEGORY;
|
|
748
|
+
e(b, d);
|
|
728
749
|
} else
|
|
729
750
|
l(d);
|
|
730
751
|
};
|
|
731
752
|
return {
|
|
732
753
|
// Values
|
|
733
|
-
conditionalClasses:
|
|
754
|
+
conditionalClasses: i(() => ({
|
|
734
755
|
"b-listbox-multi-select-options__static-category-option": s.staticCategories,
|
|
735
756
|
"b-listbox-multi-select-options__category-option": s.categoryItems
|
|
736
757
|
})),
|
|
737
758
|
// Methods
|
|
738
|
-
isOptionSelected:
|
|
759
|
+
isOptionSelected: o,
|
|
739
760
|
shouldShowDescription: n,
|
|
740
761
|
toggleCheckboxSelection: l,
|
|
741
|
-
toggleSearchOption:
|
|
742
|
-
computedTabindex: (d) => d
|
|
762
|
+
toggleSearchOption: r,
|
|
763
|
+
computedTabindex: (d) => s.itemsIndex[d] === s.focusedIndex ? 0 : -1,
|
|
743
764
|
// Enums
|
|
744
|
-
BentoListboxEvent:
|
|
765
|
+
BentoListboxEvent: c,
|
|
745
766
|
ListboxMultiSelectOptionsEvent: M
|
|
746
767
|
};
|
|
747
768
|
}
|
|
748
769
|
});
|
|
749
|
-
var
|
|
770
|
+
var Rt = function() {
|
|
750
771
|
var e = this, l = e._self._c;
|
|
751
|
-
return e._self._setupProxy, l("div", e._l(e.items, function(t
|
|
752
|
-
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(
|
|
772
|
+
return e._self._setupProxy, l("div", e._l(e.items, function(t) {
|
|
773
|
+
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-checked": `${e.isOptionSelected(t)}`, "aria-disabled": e.isOptionDisabled ? e.isOptionDisabled(t) : null, role: e.$attrs.role }, on: { click: function(n) {
|
|
753
774
|
return e.toggleSearchOption(t);
|
|
754
|
-
}, "enter-pressed": function(
|
|
775
|
+
}, "enter-pressed": function(n) {
|
|
755
776
|
return e.toggleSearchOption(t);
|
|
756
|
-
}, "space-pressed": function(
|
|
757
|
-
return
|
|
777
|
+
}, "space-pressed": function(n) {
|
|
778
|
+
return n.preventDefault(), e.toggleSearchOption(t);
|
|
758
779
|
} } }, [l("listbox-decorative-checkbox", { attrs: { disabled: e.isOptionDisabled ? e.isOptionDisabled(t) : null, checked: e.isOptionSelected(t) } }), e._t("default", function() {
|
|
759
780
|
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)];
|
|
760
|
-
}, 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(
|
|
781
|
+
}, 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(n) {
|
|
761
782
|
return e.$emit(e.ListboxMultiSelectOptionsEvent.SELECT_CATEGORY, t);
|
|
762
|
-
}, "unselect-category": function(
|
|
783
|
+
}, "unselect-category": function(n) {
|
|
763
784
|
return e.$emit(e.ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY, t);
|
|
764
|
-
}, "toggle-category-visibility": function(
|
|
765
|
-
return e.$emit(e.ListboxMultiSelectOptionsEvent.TOGGLE_CATEGORY_VISIBILITY);
|
|
766
|
-
} } }, [l("listbox-multi-select-options", { attrs: { "category-items": "", items: t.items, "is-option-disabled": e.isOptionDisabled, "focused-index": e.focusedIndex, "is-multi-level": e.isMultiLevel, "static-categories": e.staticCategories, "selected-items-list": e.selectedItemsList, searching: e.searching }, on: { "toggle-checkbox-selection": (
|
|
785
|
+
}, "toggle-category-visibility": function(n) {
|
|
786
|
+
return e.$emit(e.ListboxMultiSelectOptionsEvent.TOGGLE_CATEGORY_VISIBILITY, n);
|
|
787
|
+
} } }, [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 }, on: { "toggle-checkbox-selection": (n) => e.toggleCheckboxSelection(n) } })], 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-checked": `${e.isOptionSelected(t)}`, "aria-disabled": e.isOptionDisabled ? e.isOptionDisabled(t) : null, role: e.$attrs.role }, on: { click: function(n) {
|
|
767
788
|
return e.toggleCheckboxSelection(t);
|
|
768
|
-
}, "enter-pressed": function(
|
|
789
|
+
}, "enter-pressed": function(n) {
|
|
769
790
|
return e.toggleCheckboxSelection(t);
|
|
770
|
-
}, "space-pressed": function(
|
|
771
|
-
return
|
|
791
|
+
}, "space-pressed": function(n) {
|
|
792
|
+
return n.preventDefault(), e.toggleCheckboxSelection(t);
|
|
772
793
|
} } }, [l("listbox-decorative-checkbox", { attrs: { disabled: e.isOptionDisabled ? e.isOptionDisabled(t) : null, checked: e.isOptionSelected(t) } }), e._t("default", function() {
|
|
773
794
|
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)];
|
|
774
795
|
}, null, t)], 2)]], 2);
|
|
775
796
|
}), 0);
|
|
776
|
-
},
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
797
|
+
}, Dt = [], Bt = /* @__PURE__ */ $(
|
|
798
|
+
kt,
|
|
799
|
+
Rt,
|
|
800
|
+
Dt,
|
|
780
801
|
!1,
|
|
781
802
|
null,
|
|
782
|
-
"
|
|
803
|
+
"4c869a48"
|
|
783
804
|
);
|
|
784
|
-
const
|
|
785
|
-
const e =
|
|
805
|
+
const Nt = Bt.exports, $t = (s) => {
|
|
806
|
+
const e = i(() => {
|
|
786
807
|
var t;
|
|
787
808
|
return !!((t = s.value) != null && t.find(({ items: n }) => !!n));
|
|
788
|
-
}), l =
|
|
809
|
+
}), l = i(() => {
|
|
789
810
|
var t;
|
|
790
|
-
return e.value ? (t = s.value) == null ? void 0 : t.reduce((n,
|
|
811
|
+
return e.value ? (t = s.value) == null ? void 0 : t.reduce((n, o) => (o.items ? n.push(...o.items.flat()) : n.push(o), n), []) : s.value;
|
|
791
812
|
});
|
|
792
813
|
return {
|
|
793
814
|
isMultiLevelSelect: e,
|
|
794
815
|
flattenedItemsList: l
|
|
795
816
|
};
|
|
796
|
-
},
|
|
817
|
+
}, Mt = {
|
|
797
818
|
"en-US": {
|
|
798
819
|
allSelected: "All selected ({total})",
|
|
799
820
|
numberOfTotalSelected: "{number} of {total} selected",
|
|
800
821
|
numbersSelected: "{number} selected",
|
|
801
822
|
selectAll: "Select all ({total})"
|
|
823
|
+
},
|
|
824
|
+
"ja-JP": {
|
|
825
|
+
allSelected: "すべて選択済み ({total})",
|
|
826
|
+
numberOfTotalSelected: "{total}件中{number}件を選択済み",
|
|
827
|
+
numbersSelected: "{number}件を選択済み",
|
|
828
|
+
selectAll: "すべて選択 ({total})"
|
|
829
|
+
},
|
|
830
|
+
"pt-BR": {
|
|
831
|
+
allSelected: "Todos selecionados ({total})",
|
|
832
|
+
numberOfTotalSelected: "{number} de {total} selecionados",
|
|
833
|
+
numbersSelected: "{number} selecionados",
|
|
834
|
+
selectAll: "Selecionar todos ({total})"
|
|
802
835
|
}
|
|
803
|
-
},
|
|
804
|
-
...
|
|
836
|
+
}, wt = { i18n: { messages: Mt } }, Gt = /* @__PURE__ */ w({
|
|
837
|
+
...wt,
|
|
805
838
|
__name: "listbox-multi-select",
|
|
806
839
|
props: {
|
|
807
840
|
hasMoreItems: { type: Boolean, default: !1 },
|
|
@@ -814,166 +847,172 @@ const Tt = Ot.exports, At = (s) => {
|
|
|
814
847
|
},
|
|
815
848
|
emits: ["select"],
|
|
816
849
|
setup(s, { expose: e, emit: l }) {
|
|
817
|
-
const t = s, { t: n } =
|
|
850
|
+
const t = s, { t: n, n: o } = se(), r = Me(), f = we(), I = i(
|
|
818
851
|
() => {
|
|
819
|
-
var
|
|
852
|
+
var a, u, v, x;
|
|
820
853
|
return {
|
|
821
|
-
"aria-label": (
|
|
822
|
-
"aria-busy": (
|
|
823
|
-
"aria-atomic": (
|
|
824
|
-
"aria-live": (x =
|
|
854
|
+
"aria-label": (a = f["aria-label"]) == null ? void 0 : a.toString(),
|
|
855
|
+
"aria-busy": (u = f["aria-busy"]) == null ? void 0 : u.toString(),
|
|
856
|
+
"aria-atomic": (v = f["aria-atomic"]) == null ? void 0 : v.toString(),
|
|
857
|
+
"aria-live": (x = f["aria-live"]) == null ? void 0 : x.toString(),
|
|
858
|
+
"aria-multiselectable": !0
|
|
825
859
|
};
|
|
826
860
|
}
|
|
827
|
-
),
|
|
861
|
+
), d = E(null), b = E(null), O = E(null), p = E(null), g = i(() => t.selectedValues.map(({ value: a }) => a)), { isMultiLevelSelect: C, flattenedItemsList: D } = $t(j(t, "items")), L = i(() => C.value && !t.staticCategories), T = i(() => L.value ? "tree" : "listbox"), A = i(() => L.value ? "treeitem" : "option"), S = (a) => {
|
|
828
862
|
var x;
|
|
829
|
-
const
|
|
830
|
-
return { isDisabled:
|
|
831
|
-
},
|
|
832
|
-
if (t.searching &&
|
|
863
|
+
const u = t.isOptionDisabled(a), v = ((x = g.value) == null ? void 0 : x.includes(a.value)) || !1;
|
|
864
|
+
return { isDisabled: u, isPreSelected: v };
|
|
865
|
+
}, m = i(() => {
|
|
866
|
+
if (t.searching && C)
|
|
833
867
|
return t.items;
|
|
834
|
-
const
|
|
835
|
-
const { isDisabled:
|
|
836
|
-
return
|
|
868
|
+
const a = D.value.filter((u) => {
|
|
869
|
+
const { isDisabled: v, isPreSelected: x } = S(u);
|
|
870
|
+
return v && x || !v;
|
|
837
871
|
});
|
|
838
|
-
return t.selectedValues.forEach((
|
|
839
|
-
|
|
840
|
-
}),
|
|
841
|
-
}),
|
|
872
|
+
return t.selectedValues.forEach((u) => {
|
|
873
|
+
a.find((v) => v.value === u.value) || a.push(u);
|
|
874
|
+
}), a;
|
|
875
|
+
}), y = i(
|
|
842
876
|
() => {
|
|
843
|
-
var
|
|
844
|
-
return (
|
|
845
|
-
var
|
|
846
|
-
return
|
|
847
|
-
(
|
|
848
|
-
).length ===
|
|
877
|
+
var a;
|
|
878
|
+
return (a = m.value) == null ? void 0 : a.filter((u) => {
|
|
879
|
+
var v;
|
|
880
|
+
return u.items && C.value && t.searching ? u.items.filter(
|
|
881
|
+
(_) => (t.selectedValues ?? []).includes(_.value)
|
|
882
|
+
).length === u.items.length : (v = g.value) == null ? void 0 : v.includes(u.value);
|
|
849
883
|
});
|
|
850
884
|
}
|
|
851
|
-
),
|
|
885
|
+
), h = () => C.value && !t.searching ? D.value.length : t.items.length, k = i(() => {
|
|
852
886
|
var x;
|
|
853
|
-
const
|
|
854
|
-
return
|
|
855
|
-
}),
|
|
856
|
-
const
|
|
857
|
-
const { isDisabled:
|
|
858
|
-
return
|
|
859
|
-
},
|
|
860
|
-
l("select", [...t.selectedValues, ...
|
|
861
|
-
},
|
|
862
|
-
const
|
|
863
|
-
const { isDisabled:
|
|
864
|
-
return !(
|
|
865
|
-
},
|
|
887
|
+
const a = m.value.length, u = h(), v = ((x = y.value) == null ? void 0 : x.length) || 0;
|
|
888
|
+
return v === 0 ? n("selectAll", { total: o(a) }) : v === u ? n("allSelected", { total: o(u) }) : v <= u ? n("numberOfTotalSelected", { number: o(v), total: o(u) }) : n("numbersSelected", { number: o(v) });
|
|
889
|
+
}), B = (a) => {
|
|
890
|
+
const u = (x) => {
|
|
891
|
+
const { isDisabled: _, isPreSelected: P } = S(x);
|
|
892
|
+
return _ && P || !_;
|
|
893
|
+
}, v = a.filter(u).filter((x) => !g.value.includes(x.value));
|
|
894
|
+
l("select", [...t.selectedValues, ...v]);
|
|
895
|
+
}, G = (a) => {
|
|
896
|
+
const u = (_) => {
|
|
897
|
+
const { isDisabled: P, isPreSelected: Be } = S(_);
|
|
898
|
+
return !(P && Be);
|
|
899
|
+
}, v = a.filter(u).map(({ value: _ }) => _), x = t.selectedValues.filter((_) => !(v != null && v.includes(_.value)));
|
|
866
900
|
l("select", x);
|
|
867
|
-
},
|
|
868
|
-
|
|
869
|
-
},
|
|
870
|
-
|
|
871
|
-
}, { isAllSelected:
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
),
|
|
877
|
-
|
|
901
|
+
}, H = () => {
|
|
902
|
+
B(D.value);
|
|
903
|
+
}, X = () => {
|
|
904
|
+
G(D.value);
|
|
905
|
+
}, { isAllSelected: F, isIndeterminate: R, toggleSelectAll: U } = _e(
|
|
906
|
+
y,
|
|
907
|
+
m,
|
|
908
|
+
H,
|
|
909
|
+
X
|
|
910
|
+
), xe = i(() => R.value ? "mixed" : `${F.value}`), K = E(F.value), he = () => {
|
|
911
|
+
K.value = !K.value, U(K.value);
|
|
878
912
|
};
|
|
879
|
-
|
|
880
|
-
|
|
913
|
+
q(F, () => {
|
|
914
|
+
K.value = F.value;
|
|
881
915
|
});
|
|
882
|
-
const
|
|
883
|
-
|
|
884
|
-
},
|
|
885
|
-
|
|
886
|
-
},
|
|
887
|
-
let
|
|
888
|
-
const x = t.selectedValues.filter(({ value:
|
|
889
|
-
|
|
890
|
-
},
|
|
891
|
-
if (!
|
|
916
|
+
const Ce = (a) => {
|
|
917
|
+
B(a.items);
|
|
918
|
+
}, Se = (a) => {
|
|
919
|
+
G(a.items);
|
|
920
|
+
}, Ee = (a, u) => {
|
|
921
|
+
let v = !1;
|
|
922
|
+
const x = t.selectedValues.filter(({ value: _ }) => u.value === _ ? (v = !0, !1) : !0);
|
|
923
|
+
v || x.push(u), l(a, x);
|
|
924
|
+
}, Oe = i(() => {
|
|
925
|
+
if (!C.value)
|
|
892
926
|
return t.selectedValues;
|
|
893
|
-
const
|
|
927
|
+
const a = (_) => g.value.includes(_.value), u = (_) => !t.staticCategories && _.every((P) => a(P));
|
|
894
928
|
return t.items.flatMap(
|
|
895
|
-
(
|
|
896
|
-
).filter((
|
|
897
|
-
}),
|
|
898
|
-
var
|
|
899
|
-
const
|
|
900
|
-
return
|
|
901
|
-
}),
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
929
|
+
(_) => _.items && !u(_.items) ? _.items : _
|
|
930
|
+
).filter((_) => _.items ? !0 : a(_));
|
|
931
|
+
}), Te = i(() => {
|
|
932
|
+
var v, x, _, P;
|
|
933
|
+
const a = ["automatic", "button"].includes(t.lazyLoadType), u = ((v = t.selectedValues) == null ? void 0 : v.length) > 0 && ((x = y.value) == null ? void 0 : x.length) !== ((_ = D.value) == null ? void 0 : _.length);
|
|
934
|
+
return a && t.hasMoreItems ? !!((P = t.selectedValues) != null && P.length) : u;
|
|
935
|
+
}), Ie = i(() => ["automatic", "button"].includes(t.lazyLoadType) ? !t.hasMoreItems : !0), z = E([]), { visibleDomOptions: Q, updateVisibleDomOptions: oe } = ge(
|
|
936
|
+
d,
|
|
937
|
+
j(t, "items"),
|
|
938
|
+
A
|
|
939
|
+
), Ae = (a) => {
|
|
940
|
+
z.value.includes(a) ? z.value = z.value.filter((u) => u !== a) : z.value.push(a), me(() => {
|
|
941
|
+
oe();
|
|
942
|
+
});
|
|
943
|
+
}, ie = (a) => {
|
|
944
|
+
var u;
|
|
945
|
+
(u = Q.value[a]) == null || u.focus();
|
|
908
946
|
}, {
|
|
909
|
-
moveToNextElement:
|
|
910
|
-
moveToPreviousElement:
|
|
911
|
-
moveToFirstElement:
|
|
912
|
-
moveToLastElement:
|
|
913
|
-
preventDefault:
|
|
914
|
-
focusedIndex:
|
|
915
|
-
setListboxFocusedIndex:
|
|
916
|
-
} =
|
|
947
|
+
moveToNextElement: ae,
|
|
948
|
+
moveToPreviousElement: ce,
|
|
949
|
+
moveToFirstElement: re,
|
|
950
|
+
moveToLastElement: ue,
|
|
951
|
+
preventDefault: ee,
|
|
952
|
+
focusedIndex: Le,
|
|
953
|
+
setListboxFocusedIndex: de
|
|
954
|
+
} = pe(
|
|
917
955
|
{
|
|
918
|
-
items:
|
|
956
|
+
items: Q
|
|
919
957
|
},
|
|
920
|
-
|
|
921
|
-
),
|
|
922
|
-
[
|
|
923
|
-
[
|
|
924
|
-
[
|
|
925
|
-
[
|
|
958
|
+
ie
|
|
959
|
+
), ke = {
|
|
960
|
+
[N.ARROW_UP]: (a) => ce(a),
|
|
961
|
+
[N.ARROW_DOWN]: (a) => ae(a),
|
|
962
|
+
[N.HOME]: re,
|
|
963
|
+
[N.END]: ue
|
|
926
964
|
};
|
|
927
965
|
e({
|
|
928
966
|
/**
|
|
929
967
|
* Method to set the index of the item to be focused on
|
|
930
968
|
* Used for focus management to be kept in-sync with parent e.g. dropdowns
|
|
931
969
|
*/
|
|
932
|
-
setListboxFocusedIndex:
|
|
970
|
+
setListboxFocusedIndex: de
|
|
933
971
|
});
|
|
934
|
-
const
|
|
935
|
-
[
|
|
936
|
-
[
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
() => {
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
)
|
|
972
|
+
const Re = {
|
|
973
|
+
[N.ARROW_UP]: ee,
|
|
974
|
+
[N.ARROW_DOWN]: ee
|
|
975
|
+
}, De = i(() => {
|
|
976
|
+
let a = 1;
|
|
977
|
+
const u = {};
|
|
978
|
+
return t.items.forEach((v) => {
|
|
979
|
+
let x = z.value.includes(v.value);
|
|
980
|
+
v.items ? (t.staticCategories ? x = !0 : u[v.value] = a++, x && v.items.forEach((_) => u[_.value] = a++)) : u[v.value] = a++;
|
|
981
|
+
}), u;
|
|
982
|
+
});
|
|
983
|
+
return { __sfc: !0, props: t, emit: l, t: n, n: o, slots: r, attrs: f, ariaAttributes: I, listboxRef: d, selectAllListboxItemsRef: b, selectedListboxItemsRef: O, listboxItemsRef: p, selectedItemsList: g, isMultiLevelSelect: C, flattenedItemsList: D, isTreePattern: L, computedRole: T, computedOptionRole: A, optionStates: S, enabledItems: m, visibleSelectedList: y, calculateTotalItems: h, selectAllCheckboxText: k, selectAll: B, unselectAll: G, selectAllItems: H, unselectAllItems: X, isAllSelected: F, isIndeterminate: R, toggleSelectAll: U, ariaCheckedComputed: xe, isSelectAllOn: K, handleSelectAll: he, selectAllCategory: Ce, unselectAllCategory: Se, toggleCheckboxSelection: Ee, selectedOptions: Oe, showSelectedItems: Te, showSelectAllCheckbox: Ie, expandedCategories: z, visibleDomOptions: Q, updateVisibleDomOptions: oe, toggleCategoryVisibility: Ae, focusItem: ie, moveToNextElement: ae, moveToPreviousElement: ce, moveToFirstElement: re, moveToLastElement: ue, preventDefault: ee, focusedIndex: Le, setListboxFocusedIndex: de, listboxListeners: ke, chipsSectionListeners: Re, computedItemsIndex: De, ListboxDecorativeCheckbox: ne, BentoTypography: W, BentoChip: Ye, BentoListboxOption: Z, ListboxMultiSelectOptions: Nt, vBentoKeyboardNavigationDirective: le, BentoListboxEvent: c };
|
|
945
984
|
}
|
|
946
985
|
});
|
|
947
|
-
var
|
|
986
|
+
var Pt = function() {
|
|
948
987
|
var e = this, l = e._self._c, t = e._self._setupProxy;
|
|
949
988
|
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(n) {
|
|
950
|
-
return l("li", { key: n.value }, [l(t.BentoChip, { ref: "selectedListboxItemsRef", refInFor: !0, attrs: { disabled: e.isOptionDisabled(n), label: n.label, condensed: "" }, on: { click: function(
|
|
989
|
+
return l("li", { key: n.value }, [l(t.BentoChip, { ref: "selectedListboxItemsRef", refInFor: !0, attrs: { disabled: e.isOptionDisabled(n), label: n.label, condensed: "" }, on: { click: function(o) {
|
|
951
990
|
n.items ? t.unselectAllCategory(n) : t.toggleCheckboxSelection("select", n);
|
|
952
991
|
} } })], 1);
|
|
953
|
-
}), 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:
|
|
992
|
+
}), 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-checked": t.ariaCheckedComputed, role: t.computedOptionRole }, on: { click: t.handleSelectAll, "enter-pressed": t.handleSelectAll, "space-pressed": function(n) {
|
|
954
993
|
return n.preventDefault(), t.handleSelectAll.apply(null, arguments);
|
|
955
|
-
} } }, [l(t.ListboxDecorativeCheckbox, { 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 }, on: { "toggle-checkbox-selection": function(n) {
|
|
994
|
+
} } }, [l(t.ListboxDecorativeCheckbox, { 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(n) {
|
|
956
995
|
return t.toggleCheckboxSelection("select", n);
|
|
957
|
-
}, "select-category": t.selectAllCategory, "unselect-category": t.unselectAllCategory, "toggle-category-visibility": t.
|
|
996
|
+
}, "select-category": t.selectAllCategory, "unselect-category": t.unselectAllCategory, "toggle-category-visibility": t.toggleCategoryVisibility, "space-pressed": function(n) {
|
|
958
997
|
return t.toggleCheckboxSelection(t.BentoListboxEvent.SPACE, n);
|
|
959
998
|
}, "tab-pressed": function(n) {
|
|
960
999
|
return t.toggleCheckboxSelection(t.BentoListboxEvent.TAB, n);
|
|
961
1000
|
}, "enter-pressed": function(n) {
|
|
962
1001
|
return t.toggleCheckboxSelection(t.BentoListboxEvent.ENTER, n);
|
|
963
|
-
} }, scopedSlots: e._u([e._l(t.slots, function(n,
|
|
964
|
-
return { key:
|
|
965
|
-
return [e._t(
|
|
1002
|
+
} }, scopedSlots: e._u([e._l(t.slots, function(n, o) {
|
|
1003
|
+
return { key: o, fn: function(r) {
|
|
1004
|
+
return [e._t(o, null, null, r)];
|
|
966
1005
|
} };
|
|
967
1006
|
})], null, !0) })], 1)]);
|
|
968
|
-
},
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
1007
|
+
}, Ft = [], Yt = /* @__PURE__ */ $(
|
|
1008
|
+
Gt,
|
|
1009
|
+
Pt,
|
|
1010
|
+
Ft,
|
|
972
1011
|
!1,
|
|
973
1012
|
null,
|
|
974
|
-
"
|
|
1013
|
+
"904fc859"
|
|
975
1014
|
);
|
|
976
|
-
const
|
|
1015
|
+
const ve = Yt.exports, Ut = {
|
|
977
1016
|
"en-US": {
|
|
978
1017
|
loading: "Loading",
|
|
979
1018
|
showMore: "Show more"
|
|
@@ -986,18 +1025,18 @@ const be = Bt.exports, $t = {
|
|
|
986
1025
|
loading: "Carregando",
|
|
987
1026
|
showMore: "Mostrar mais"
|
|
988
1027
|
}
|
|
989
|
-
},
|
|
1028
|
+
}, zt = 36, Vt = w({
|
|
990
1029
|
name: "bento-listbox",
|
|
991
1030
|
components: {
|
|
992
|
-
BentoEmptyState:
|
|
993
|
-
BentoListboxSingleSelect:
|
|
994
|
-
BentoListboxMultiSelect:
|
|
1031
|
+
BentoEmptyState: Pe,
|
|
1032
|
+
BentoListboxSingleSelect: gt,
|
|
1033
|
+
BentoListboxMultiSelect: ve,
|
|
995
1034
|
BentoTypography: W,
|
|
996
|
-
BentoLoadingIndicator:
|
|
997
|
-
BentoLoadingButton:
|
|
1035
|
+
BentoLoadingIndicator: Ge,
|
|
1036
|
+
BentoLoadingButton: Ke
|
|
998
1037
|
},
|
|
999
|
-
directives: { BentoKeyboardNavigationDirective:
|
|
1000
|
-
i18n: { messages:
|
|
1038
|
+
directives: { BentoKeyboardNavigationDirective: le },
|
|
1039
|
+
i18n: { messages: Ut },
|
|
1001
1040
|
props: {
|
|
1002
1041
|
/**
|
|
1003
1042
|
* Defines a string value that labels an interactive element.
|
|
@@ -1053,8 +1092,8 @@ const be = Bt.exports, $t = {
|
|
|
1053
1092
|
*/
|
|
1054
1093
|
lazyLoadType: {
|
|
1055
1094
|
type: String,
|
|
1056
|
-
default:
|
|
1057
|
-
validator: (s) => Object.values(
|
|
1095
|
+
default: V.NONE,
|
|
1096
|
+
validator: (s) => Object.values(V).includes(s)
|
|
1058
1097
|
},
|
|
1059
1098
|
/**
|
|
1060
1099
|
* Indicates the listbox is loading filtered items.
|
|
@@ -1078,7 +1117,7 @@ const be = Bt.exports, $t = {
|
|
|
1078
1117
|
*
|
|
1079
1118
|
* If enabled, hides the "Select all" checkbox in "multiple" mode.
|
|
1080
1119
|
*/
|
|
1081
|
-
searching:
|
|
1120
|
+
searching: ve.props.searching,
|
|
1082
1121
|
/**
|
|
1083
1122
|
* The `input` value.
|
|
1084
1123
|
* Providing an empty string or empty array will select no options.
|
|
@@ -1098,183 +1137,184 @@ const be = Bt.exports, $t = {
|
|
|
1098
1137
|
}
|
|
1099
1138
|
},
|
|
1100
1139
|
emits: [
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1140
|
+
c.SELECT,
|
|
1141
|
+
c.SPACE,
|
|
1142
|
+
c.SHOW_MORE,
|
|
1143
|
+
c.ENTER,
|
|
1144
|
+
c.ESCAPE,
|
|
1145
|
+
c.TAB
|
|
1107
1146
|
],
|
|
1108
1147
|
setup(s, { emit: e, slots: l }) {
|
|
1109
|
-
const t =
|
|
1148
|
+
const t = E([]), n = j(s, "items"), { t: o } = se(), r = i(() => s.lazyLoadType !== V.AUTOMATIC), f = i(() => s.lazyLoadType === V.AUTOMATIC), I = () => {
|
|
1110
1149
|
var R;
|
|
1111
|
-
return typeof (s == null ? void 0 : s.virtualScroll) == "object" && ((R = s == null ? void 0 : s.virtualScroll) != null && R.itemHeight) ? s.virtualScroll.itemHeight :
|
|
1150
|
+
return typeof (s == null ? void 0 : s.virtualScroll) == "object" && ((R = s == null ? void 0 : s.virtualScroll) != null && R.itemHeight) ? s.virtualScroll.itemHeight : zt;
|
|
1112
1151
|
}, {
|
|
1113
1152
|
containerRef: d,
|
|
1114
|
-
containerProps:
|
|
1115
|
-
onScroll:
|
|
1116
|
-
list:
|
|
1153
|
+
containerProps: b,
|
|
1154
|
+
onScroll: O,
|
|
1155
|
+
list: p,
|
|
1117
1156
|
wrapperProps: g
|
|
1118
|
-
} =
|
|
1119
|
-
itemHeight:
|
|
1157
|
+
} = qe(n, {
|
|
1158
|
+
itemHeight: I(),
|
|
1120
1159
|
// Disable virtual scrolling if not enabled or if lazy loading is enabled or if multi-select
|
|
1121
1160
|
disabled: (s == null ? void 0 : s.multiple) || (s == null ? void 0 : s.virtualScroll) === !1 || (s == null ? void 0 : s.lazyLoadType) !== "none"
|
|
1122
|
-
}),
|
|
1123
|
-
() => s.componentLoading !== void 0 ||
|
|
1124
|
-
),
|
|
1125
|
-
() =>
|
|
1126
|
-
), L =
|
|
1127
|
-
() =>
|
|
1128
|
-
),
|
|
1161
|
+
}), C = i(
|
|
1162
|
+
() => s.componentLoading !== void 0 || r.value ? "true" : void 0
|
|
1163
|
+
), D = i(
|
|
1164
|
+
() => r.value && s.loading || s.componentLoading ? "true" : "false"
|
|
1165
|
+
), L = i(
|
|
1166
|
+
() => r.value || s.componentLoading !== void 0 ? "polite" : void 0
|
|
1167
|
+
), T = i(
|
|
1129
1168
|
() => ({
|
|
1130
1169
|
"aria-label": s.ariaLabel,
|
|
1131
|
-
"aria-busy":
|
|
1132
|
-
"aria-atomic":
|
|
1170
|
+
"aria-busy": D.value,
|
|
1171
|
+
"aria-atomic": C.value,
|
|
1133
1172
|
"aria-live": L.value
|
|
1134
1173
|
})
|
|
1135
|
-
),
|
|
1174
|
+
), A = i(
|
|
1136
1175
|
() => s.componentLoading ? {
|
|
1137
|
-
...
|
|
1176
|
+
...T.value,
|
|
1138
1177
|
role: "alert"
|
|
1139
1178
|
} : {}
|
|
1140
|
-
),
|
|
1141
|
-
e(R,
|
|
1142
|
-
},
|
|
1143
|
-
e(
|
|
1144
|
-
},
|
|
1179
|
+
), S = (R) => (U) => {
|
|
1180
|
+
e(R, U);
|
|
1181
|
+
}, m = () => {
|
|
1182
|
+
e(c.SHOW_MORE);
|
|
1183
|
+
}, y = Fe(() => {
|
|
1145
1184
|
const R = d.value;
|
|
1146
1185
|
if (!R)
|
|
1147
1186
|
return;
|
|
1148
|
-
const
|
|
1149
|
-
s.hasMoreItems &&
|
|
1150
|
-
}),
|
|
1151
|
-
|
|
1152
|
-
},
|
|
1187
|
+
const U = Math.round(R.scrollTop) + R.clientHeight >= R.scrollHeight;
|
|
1188
|
+
s.hasMoreItems && U && !s.loading && m();
|
|
1189
|
+
}), h = () => {
|
|
1190
|
+
f.value ? y() : O();
|
|
1191
|
+
}, k = i(() => {
|
|
1153
1192
|
var R;
|
|
1154
1193
|
return ((R = s.items) == null ? void 0 : R.length) === 0;
|
|
1155
|
-
}),
|
|
1156
|
-
() => s.lazyLoadType ===
|
|
1157
|
-
),
|
|
1158
|
-
() => s.loading ?
|
|
1159
|
-
),
|
|
1194
|
+
}), B = i(
|
|
1195
|
+
() => s.lazyLoadType === V.BUTTON && s.hasMoreItems
|
|
1196
|
+
), G = i(
|
|
1197
|
+
() => s.loading ? be.LOADING : be.START
|
|
1198
|
+
), H = i(() => s.loading ? o("loading") : o("showMore")), X = i(() => ({
|
|
1160
1199
|
...s.emptyState,
|
|
1161
1200
|
variant: "condensed"
|
|
1162
1201
|
})), F = {
|
|
1163
|
-
[
|
|
1164
|
-
[
|
|
1165
|
-
[
|
|
1166
|
-
[
|
|
1202
|
+
[c.SELECT]: S(c.SELECT),
|
|
1203
|
+
[c.SPACE]: S(c.SPACE),
|
|
1204
|
+
[c.TAB]: S(c.TAB),
|
|
1205
|
+
[c.ENTER]: S(c.ENTER)
|
|
1167
1206
|
};
|
|
1168
1207
|
return {
|
|
1169
1208
|
// Refs
|
|
1170
1209
|
listboxRef: d,
|
|
1171
1210
|
listboxItemRef: t,
|
|
1172
1211
|
// a11y
|
|
1173
|
-
ariaAttributes:
|
|
1174
|
-
listboxContainerAttributes:
|
|
1212
|
+
ariaAttributes: T,
|
|
1213
|
+
listboxContainerAttributes: A,
|
|
1175
1214
|
// Values
|
|
1176
|
-
containerProps:
|
|
1177
|
-
isSearchResultEmpty:
|
|
1215
|
+
containerProps: b,
|
|
1216
|
+
isSearchResultEmpty: k,
|
|
1178
1217
|
limitedEmptyStateProps: X,
|
|
1179
|
-
loadingButtonState:
|
|
1218
|
+
loadingButtonState: G,
|
|
1180
1219
|
slots: l,
|
|
1181
|
-
shouldDisplayShowMoreButton:
|
|
1182
|
-
showMoreButtonText:
|
|
1183
|
-
virtualisedItems:
|
|
1220
|
+
shouldDisplayShowMoreButton: B,
|
|
1221
|
+
showMoreButtonText: H,
|
|
1222
|
+
virtualisedItems: p,
|
|
1184
1223
|
wrapperProps: g,
|
|
1185
1224
|
// Enums
|
|
1186
|
-
BentoKeyboardNavigationKeyDownEvent:
|
|
1187
|
-
BentoListboxEvent:
|
|
1225
|
+
BentoKeyboardNavigationKeyDownEvent: N,
|
|
1226
|
+
BentoListboxEvent: c,
|
|
1188
1227
|
// Methods
|
|
1189
|
-
onListboxContainerScroll:
|
|
1190
|
-
onOptionSelected:
|
|
1191
|
-
emitShowMore:
|
|
1228
|
+
onListboxContainerScroll: h,
|
|
1229
|
+
onOptionSelected: S,
|
|
1230
|
+
emitShowMore: m,
|
|
1192
1231
|
listboxListeners: F
|
|
1193
1232
|
};
|
|
1194
1233
|
}
|
|
1195
1234
|
});
|
|
1196
|
-
var
|
|
1235
|
+
var Wt = function() {
|
|
1197
1236
|
var t;
|
|
1198
1237
|
var e = this, l = e._self._c;
|
|
1199
|
-
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(n,
|
|
1200
|
-
return { key:
|
|
1201
|
-
return [e._t(
|
|
1238
|
+
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(n, o) {
|
|
1239
|
+
return { key: o, fn: function(r) {
|
|
1240
|
+
return [e._t(o, null, null, r)];
|
|
1202
1241
|
} };
|
|
1203
|
-
})], 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, "selected-value": e.selectedValue, "static-categories": e.staticCategories, "is-option-disabled": e.isOptionDisabled }, scopedSlots: e._u([e._l(e.slots, function(n,
|
|
1204
|
-
return { key:
|
|
1205
|
-
return [e._t(
|
|
1242
|
+
})], 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, "selected-value": e.selectedValue, "static-categories": e.staticCategories, "is-option-disabled": e.isOptionDisabled }, scopedSlots: e._u([e._l(e.slots, function(n, o) {
|
|
1243
|
+
return { key: o, fn: function(r) {
|
|
1244
|
+
return [e._t(o, null, null, r)];
|
|
1206
1245
|
} };
|
|
1207
1246
|
})], 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(n) {
|
|
1208
1247
|
return e.emitShowMore.apply(null, arguments);
|
|
1209
1248
|
} } }, [e._v(" " + e._s(e.showMoreButtonText) + " ")])], 1) : e.loading ? l("div", { staticClass: "b-listbox__lazy-load" }, [l("bento-loading-indicator")], 1) : e._e()]], 2)]);
|
|
1210
|
-
},
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1249
|
+
}, Kt = [], jt = /* @__PURE__ */ $(
|
|
1250
|
+
Vt,
|
|
1251
|
+
Wt,
|
|
1252
|
+
Kt,
|
|
1214
1253
|
!1,
|
|
1215
1254
|
null,
|
|
1216
1255
|
"46b000a2"
|
|
1217
1256
|
);
|
|
1218
|
-
const
|
|
1257
|
+
const bs = jt.exports, te = (s, e) => {
|
|
1219
1258
|
for (const l of s) {
|
|
1220
1259
|
if (l.value === e)
|
|
1221
1260
|
return l;
|
|
1222
1261
|
if (l.items) {
|
|
1223
|
-
const t =
|
|
1262
|
+
const t = te(l.items, e);
|
|
1224
1263
|
if (t)
|
|
1225
1264
|
return t;
|
|
1226
1265
|
}
|
|
1227
1266
|
}
|
|
1228
1267
|
return null;
|
|
1229
|
-
},
|
|
1230
|
-
const n =
|
|
1231
|
-
l.value ?
|
|
1232
|
-
},
|
|
1233
|
-
l.value ?
|
|
1234
|
-
},
|
|
1235
|
-
n.value =
|
|
1268
|
+
}, qt = (s) => typeof s == "object" && s !== null && "value" in s && "label" in s, fs = (s, e, l, t) => {
|
|
1269
|
+
const n = E([]), o = E(), r = (b) => {
|
|
1270
|
+
l.value ? o.value = b.map(({ value: O }) => O) : o.value = b.length > 0 ? b[0].value : null;
|
|
1271
|
+
}, f = (b) => {
|
|
1272
|
+
l.value ? o.value = b.map(({ value: O, label: p }) => ({ value: O, label: p })) : o.value = b.length > 0 ? { value: b[0].value, label: b[0].label } : null;
|
|
1273
|
+
}, I = (b) => {
|
|
1274
|
+
n.value = b, t != null && t.value ? f(b) : r(b);
|
|
1236
1275
|
}, d = () => {
|
|
1237
|
-
n.value = [],
|
|
1276
|
+
n.value = [], o.value = null;
|
|
1238
1277
|
};
|
|
1239
|
-
return
|
|
1278
|
+
return q(
|
|
1240
1279
|
() => e.value,
|
|
1241
1280
|
() => {
|
|
1242
1281
|
if (!e.value && e.value !== 0) {
|
|
1243
1282
|
d();
|
|
1244
1283
|
return;
|
|
1245
1284
|
}
|
|
1246
|
-
const
|
|
1285
|
+
const b = !Array.isArray(e.value), O = [...n.value];
|
|
1247
1286
|
d();
|
|
1248
|
-
const
|
|
1249
|
-
if (
|
|
1287
|
+
const p = (g) => {
|
|
1288
|
+
if (qt(g))
|
|
1250
1289
|
n.value.push(g);
|
|
1251
1290
|
else {
|
|
1252
|
-
let
|
|
1253
|
-
|
|
1291
|
+
let C = te(s.value, g);
|
|
1292
|
+
C || (C = te(O, g)), C || (C = { value: g, label: g.toString() }), n.value.push(C);
|
|
1254
1293
|
}
|
|
1255
1294
|
};
|
|
1256
|
-
if (
|
|
1295
|
+
if (b) {
|
|
1257
1296
|
const g = e.value;
|
|
1258
|
-
|
|
1297
|
+
p(g), t != null && t.value ? f(n.value) : r(n.value);
|
|
1259
1298
|
return;
|
|
1260
1299
|
}
|
|
1261
|
-
e.value.forEach(
|
|
1300
|
+
e.value.forEach(p), t != null && t.value ? f(n.value) : r(n.value);
|
|
1262
1301
|
},
|
|
1263
1302
|
{ immediate: !0 }
|
|
1264
1303
|
), {
|
|
1265
1304
|
// Values
|
|
1266
1305
|
cachedSelectedListboxOptions: n,
|
|
1267
|
-
cachedListboxSelectedValues:
|
|
1306
|
+
cachedListboxSelectedValues: o,
|
|
1268
1307
|
// Methods
|
|
1269
1308
|
resetCache: d,
|
|
1270
|
-
setCachedValues:
|
|
1309
|
+
setCachedValues: I
|
|
1271
1310
|
};
|
|
1272
1311
|
};
|
|
1273
1312
|
export {
|
|
1274
|
-
|
|
1275
|
-
a,
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1313
|
+
V as B,
|
|
1314
|
+
c as a,
|
|
1315
|
+
bs as b,
|
|
1316
|
+
fs as c,
|
|
1317
|
+
ge as d,
|
|
1318
|
+
$t as u
|
|
1279
1319
|
};
|
|
1280
|
-
//# sourceMappingURL=use-cached-selected-values.
|
|
1320
|
+
//# sourceMappingURL=use-cached-selected-values.CusB5KBl.js.map
|