@adyen/bento-vue3 1.60.1 → 1.61.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 +119 -7
- package/dist/action-bar.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/base-modal.css +1 -1
- package/dist/assets/button.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/dashed-underline.css +1 -1
- package/dist/assets/data-grid.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-with-views.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/popover.css +1 -1
- package/dist/assets/radio-group.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/button.js +3 -3
- package/dist/card.js +1 -1
- package/dist/chunks/{action-bar.BDF61iH-.js → action-bar.BVfkekHC.js} +5 -5
- package/dist/chunks/{action-bar.BDF61iH-.js.map → action-bar.BVfkekHC.js.map} +1 -1
- package/dist/chunks/{alert.CjegN2iG.js → alert.C0YBI66O.js} +2 -2
- package/dist/chunks/{alert.CjegN2iG.js.map → alert.C0YBI66O.js.map} +1 -1
- package/dist/chunks/{base-modal.D2tNbxw3.js → base-modal.BphJ3uEa.js} +4 -4
- package/dist/chunks/{base-modal.D2tNbxw3.js.map → base-modal.BphJ3uEa.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.DG5t9zB7.js → button-actions-with-menu.DZVOijPY.js} +4 -4
- package/dist/chunks/{button-actions-with-menu.DG5t9zB7.js.map → button-actions-with-menu.DZVOijPY.js.map} +1 -1
- package/dist/chunks/{button-actions.1MReMMnL.js → button-actions.Cr5gxSXb.js} +2 -2
- package/dist/chunks/{button-actions.1MReMMnL.js.map → button-actions.Cr5gxSXb.js.map} +1 -1
- package/dist/chunks/{button.CVZJTZv0.js → button.BF_dGonK.js} +37 -26
- package/dist/chunks/button.BF_dGonK.js.map +1 -0
- package/dist/chunks/{calendar.ugV5Vzqs.js → calendar.CTcfG9JK.js} +2 -2
- package/dist/chunks/{calendar.ugV5Vzqs.js.map → calendar.CTcfG9JK.js.map} +1 -1
- package/dist/chunks/{card.dF_i6neN.js → card.B9AfyVI3.js} +2 -2
- package/dist/chunks/{card.dF_i6neN.js.map → card.B9AfyVI3.js.map} +1 -1
- package/dist/chunks/{code-snippet.iD36_pOw.js → code-snippet.CK52UjIT.js} +5 -5
- package/dist/chunks/{code-snippet.iD36_pOw.js.map → code-snippet.CK52UjIT.js.map} +1 -1
- package/dist/chunks/{copy.jE0EciK8.js → copy.CHnSy6IK.js} +2 -2
- package/dist/chunks/{copy.jE0EciK8.js.map → copy.CHnSy6IK.js.map} +1 -1
- package/dist/chunks/{dashboard-section.Bq1abySA.js → dashboard-section.Dmtz7Dcc.js} +3 -3
- package/dist/chunks/{dashboard-section.Bq1abySA.js.map → dashboard-section.Dmtz7Dcc.js.map} +1 -1
- package/dist/chunks/dashed-underline.BTdq4lZ4.js +114 -0
- package/dist/chunks/dashed-underline.BTdq4lZ4.js.map +1 -0
- package/dist/chunks/{data-grid-template.UkERMC7S.js → data-grid-template.CP8N6JL8.js} +4 -4
- package/dist/chunks/{data-grid-template.UkERMC7S.js.map → data-grid-template.CP8N6JL8.js.map} +1 -1
- package/dist/chunks/{data-grid.o4emi6FA.js → data-grid.mNFj1mbB.js} +338 -335
- package/dist/chunks/data-grid.mNFj1mbB.js.map +1 -0
- package/dist/chunks/{date-picker.BPLtpBbX.js → date-picker.C61tyaW9.js} +3 -3
- package/dist/chunks/{date-picker.BPLtpBbX.js.map → date-picker.C61tyaW9.js.map} +1 -1
- package/dist/chunks/{date-range-picker.BYvj1y8T.js → date-range-picker.BCD198XQ.js} +6 -6
- package/dist/chunks/{date-range-picker.BYvj1y8T.js.map → date-range-picker.BCD198XQ.js.map} +1 -1
- package/dist/chunks/delight.CDBAFnwC.js +5 -0
- package/dist/chunks/delight.CDBAFnwC.js.map +1 -0
- package/dist/chunks/delight.xKDCvvaS.js +5 -0
- package/dist/chunks/delight.xKDCvvaS.js.map +1 -0
- package/dist/chunks/{dialog-page.Cngbnn1Z.js → dialog-page.D0E69ruX.js} +2 -2
- package/dist/chunks/{dialog-page.Cngbnn1Z.js.map → dialog-page.D0E69ruX.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.DxLOtAIw.js → dropdown-tag.DstHH6nK.js} +2 -2
- package/dist/chunks/{dropdown-tag.DxLOtAIw.js.map → dropdown-tag.DstHH6nK.js.map} +1 -1
- package/dist/chunks/{dropdown.FJu_m8Tw.js → dropdown.B4yyYeuQ.js} +119 -104
- package/dist/chunks/{dropdown.FJu_m8Tw.js.map → dropdown.B4yyYeuQ.js.map} +1 -1
- package/dist/chunks/{empty-state.BGWjUH6G.js → empty-state.CEphUdux.js} +28 -28
- package/dist/chunks/empty-state.CEphUdux.js.map +1 -0
- package/dist/chunks/es6.n1ewaW31.js.map +1 -1
- package/dist/chunks/{file-uploader.Bp8PDPHt.js → file-uploader.DLFdbRG_.js} +3 -3
- package/dist/chunks/{file-uploader.Bp8PDPHt.js.map → file-uploader.DLFdbRG_.js.map} +1 -1
- package/dist/chunks/{filter-bar.BRB7BjbE.js → filter-bar.B4xd462M.js} +800 -794
- package/dist/chunks/filter-bar.B4xd462M.js.map +1 -0
- package/dist/chunks/{fixed-scroller.BjxA_R63.js → fixed-scroller.A-YuItwn.js} +2 -2
- package/dist/chunks/{fixed-scroller.BjxA_R63.js.map → fixed-scroller.A-YuItwn.js.map} +1 -1
- package/dist/chunks/{footer-actions.jRnnqdse.js → footer-actions.v8GdXxdM.js} +3 -3
- package/dist/chunks/{footer-actions.jRnnqdse.js.map → footer-actions.v8GdXxdM.js.map} +1 -1
- package/dist/chunks/{form-layout-title.CsmjzAje.js → form-layout-title.DTurbdqZ.js} +2 -2
- package/dist/chunks/{form-layout-title.CsmjzAje.js.map → form-layout-title.DTurbdqZ.js.map} +1 -1
- package/dist/chunks/{header-with-views.DJSGKRhj.js → header-with-views.CrR5TEJ6.js} +526 -522
- package/dist/chunks/{header-with-views.DJSGKRhj.js.map → header-with-views.CrR5TEJ6.js.map} +1 -1
- package/dist/chunks/{header.BBnN_HU9.js → header.B5gm8-_5.js} +4 -4
- package/dist/chunks/{header.BBnN_HU9.js.map → header.B5gm8-_5.js.map} +1 -1
- package/dist/chunks/{info-icon-with-popover.D6WFtFFY.js → info-icon-with-popover.DAq-iAlh.js} +2 -2
- package/dist/chunks/{info-icon-with-popover.D6WFtFFY.js.map → info-icon-with-popover.DAq-iAlh.js.map} +1 -1
- package/dist/chunks/{input-field-password.CtK2VVqL.js → input-field-password.B_khsQVP.js} +5 -5
- package/dist/chunks/{input-field-password.CtK2VVqL.js.map → input-field-password.B_khsQVP.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.Cf5nQpfS.js → input-field-phone-number.CLgA141p.js} +3 -3
- package/dist/chunks/{input-field-phone-number.Cf5nQpfS.js.map → input-field-phone-number.CLgA141p.js.map} +1 -1
- package/dist/chunks/{input-field.C94JL_Qv.js → input-field.hOqNPju4.js} +2 -2
- package/dist/chunks/{input-field.C94JL_Qv.js.map → input-field.hOqNPju4.js.map} +1 -1
- package/dist/chunks/{inspector.CxNXHV8C.js → inspector.DteTv0He.js} +2 -2
- package/dist/chunks/{inspector.CxNXHV8C.js.map → inspector.DteTv0He.js.map} +1 -1
- package/dist/chunks/{menu.BcXV6WhV.js → menu.CxYiSxSe.js} +3 -3
- package/dist/chunks/{menu.BcXV6WhV.js.map → menu.CxYiSxSe.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.D93NZCBg.js → modal-fullscreen.ByaJ5E40.js} +4 -4
- package/dist/chunks/{modal-fullscreen.D93NZCBg.js.map → modal-fullscreen.ByaJ5E40.js.map} +1 -1
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.B3uzibmr.js → modal.vue_vue_type_script_setup_true_lang.B6khnywr.js} +5 -5
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.B3uzibmr.js.map → modal.vue_vue_type_script_setup_true_lang.B6khnywr.js.map} +1 -1
- package/dist/chunks/{pagination.rrPdG7nK.js → pagination.CrwYnynf.js} +3 -3
- package/dist/chunks/{pagination.rrPdG7nK.js.map → pagination.CrwYnynf.js.map} +1 -1
- package/dist/chunks/{popover.KFyR9BXF.js → popover.DvAXLmCp.js} +3 -3
- package/dist/chunks/{popover.KFyR9BXF.js.map → popover.DvAXLmCp.js.map} +1 -1
- package/dist/chunks/{promo-banner.BfXfaCrf.js → promo-banner.Di_GK1ac.js} +2 -2
- package/dist/chunks/{promo-banner.BfXfaCrf.js.map → promo-banner.Di_GK1ac.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.Ddt7IVXL.js → rich-text-editor.9z0_M-YN.js} +2 -2
- package/dist/chunks/{rich-text-editor.Ddt7IVXL.js.map → rich-text-editor.9z0_M-YN.js.map} +1 -1
- package/dist/chunks/{search-bar.ZidZj4NE.js → search-bar.ye0aeyd2.js} +3 -3
- package/dist/chunks/{search-bar.ZidZj4NE.js.map → search-bar.ye0aeyd2.js.map} +1 -1
- package/dist/chunks/{secondary-nav.Cy2JAzoO.js → secondary-nav.Dsa986cq.js} +2 -2
- package/dist/chunks/{secondary-nav.Cy2JAzoO.js.map → secondary-nav.Dsa986cq.js.map} +1 -1
- package/dist/chunks/{sidepanel.CNA3pTXy.js → sidepanel.UiX__UxV.js} +4 -4
- package/dist/chunks/{sidepanel.CNA3pTXy.js.map → sidepanel.UiX__UxV.js.map} +1 -1
- package/dist/chunks/{structured-list-item.CLpfMbkV.js → structured-list-item.BYFd1N3z.js} +3 -3
- package/dist/chunks/{structured-list-item.CLpfMbkV.js.map → structured-list-item.BYFd1N3z.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.BcicwgZm.js → summary-grid.types.IkdgA45D.js} +3 -3
- package/dist/chunks/{summary-grid.types.BcicwgZm.js.map → summary-grid.types.IkdgA45D.js.map} +1 -1
- package/dist/chunks/{tabs.Bn4YIjoy.js → tabs.CVCqPMAR.js} +2 -2
- package/dist/chunks/{tabs.Bn4YIjoy.js.map → tabs.CVCqPMAR.js.map} +1 -1
- package/dist/chunks/{textarea.Dl5TFi8E.js → textarea.UtxQ22_c.js} +2 -2
- package/dist/chunks/{textarea.Dl5TFi8E.js.map → textarea.UtxQ22_c.js.map} +1 -1
- package/dist/chunks/{timeline-item.CcbL86D0.js → timeline-item.C3AkVKE8.js} +5 -5
- package/dist/chunks/{timeline-item.CcbL86D0.js.map → timeline-item.C3AkVKE8.js.map} +1 -1
- package/dist/chunks/{toast.Ae5ZoWHb.js → toast.DdAPkCce.js} +2 -2
- package/dist/chunks/{toast.Ae5ZoWHb.js.map → toast.DdAPkCce.js.map} +1 -1
- package/dist/chunks/{toggle-button.Dv1t15yj.js → toggle-button.D-jybXy-.js} +2 -2
- package/dist/chunks/{toggle-button.Dv1t15yj.js.map → toggle-button.D-jybXy-.js.map} +1 -1
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.Bcu-t4d8.js → tutorial.vue_vue_type_script_setup_true_lang.DwYfNGGI.js} +4 -4
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.Bcu-t4d8.js.map → tutorial.vue_vue_type_script_setup_true_lang.DwYfNGGI.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.Ber7lUiH.js → use-cached-selected-values.CRwxKmxX.js} +586 -580
- package/dist/chunks/use-cached-selected-values.CRwxKmxX.js.map +1 -0
- package/dist/code-snippet.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/dropdown.js +3 -3
- package/dist/empty-state.js +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 +45 -45
- 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/inspector.js +1 -1
- package/dist/internal.js +8 -8
- 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/promo-banner.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/sidepanel.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/toast.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +4 -4
- package/dist/chunks/button.CVZJTZv0.js.map +0 -1
- package/dist/chunks/dashed-underline.DweJIpuJ.js +0 -98
- package/dist/chunks/dashed-underline.DweJIpuJ.js.map +0 -1
- package/dist/chunks/data-grid.o4emi6FA.js.map +0 -1
- package/dist/chunks/empty-state.BGWjUH6G.js.map +0 -1
- package/dist/chunks/filter-bar.BRB7BjbE.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.Ber7lUiH.js.map +0 -1
|
@@ -1,112 +1,112 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { B as
|
|
1
|
+
import { computed as g, ref as P, onMounted as Ae, onUnmounted as Ke, watch as Ie, defineComponent as X, resolveComponent as k, createElementBlock as O, openBlock as m, createVNode as M, createElementVNode as K, withCtx as $, createTextVNode as Y, toDisplayString as z, renderSlot as F, mergeProps as U, withKeys as ve, createCommentVNode as V, createBlock as D, withModifiers as qe, normalizeProps as le, guardReactiveProps as re, withDirectives as oe, vShow as $e, toRef as Z, resolveDirective as ke, toHandlers as Q, Fragment as ee, renderList as W, createSlots as ce, normalizeClass as fe, useSlots as je, unref as N, normalizeStyle as He } from "vue";
|
|
2
|
+
import { B as G, a as de } from "./keyboard-navigation.CqgGzfZQ.js";
|
|
3
3
|
import "./events.FNmSWp_P.js";
|
|
4
4
|
import { B as ne } from "./typography.DN5eC5ch.js";
|
|
5
5
|
import { B as Xe } from "./loading-indicator.DEepb9Wl.js";
|
|
6
|
-
import { B as Je } from "./empty-state.
|
|
6
|
+
import { B as Je } from "./empty-state.CEphUdux.js";
|
|
7
7
|
import { u as ye } from "./i18n.B6g5VX0q.js";
|
|
8
8
|
import { d as Ze } from "./debounce.DUTu11PS.js";
|
|
9
9
|
import { B as Se } from "./checkbox.B-jC5L05.js";
|
|
10
10
|
import { B as Qe } from "./chip.BVCzNGaI.js";
|
|
11
11
|
import { _ as q } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
12
12
|
import { C as et, a as tt } from "./chevron-up.-0oLlHmh.js";
|
|
13
|
-
import { d as st, e as _e } from "./button-actions.
|
|
13
|
+
import { d as st, e as _e } from "./button-actions.Cr5gxSXb.js";
|
|
14
14
|
/* empty css */
|
|
15
15
|
import { o as lt } from "./resize.Bqks3WUm.js";
|
|
16
16
|
import "../assets/use-cached-selected-values.css";
|
|
17
|
-
const Be = (e,
|
|
18
|
-
const
|
|
17
|
+
const Be = (e, s, t, c) => {
|
|
18
|
+
const r = g(
|
|
19
19
|
() => {
|
|
20
|
-
var
|
|
21
|
-
return !!((
|
|
20
|
+
var v, S;
|
|
21
|
+
return !!((v = e.value) != null && v.length) && ((S = e.value) == null ? void 0 : S.length) === s.value.length;
|
|
22
22
|
}
|
|
23
|
-
), a =
|
|
24
|
-
var
|
|
25
|
-
return e.value == null || e.value.length === 0 ? !1 : ((
|
|
23
|
+
), a = g(() => {
|
|
24
|
+
var v;
|
|
25
|
+
return e.value == null || e.value.length === 0 ? !1 : ((v = e.value) == null ? void 0 : v.length) !== s.value.length;
|
|
26
26
|
});
|
|
27
27
|
return {
|
|
28
|
-
isAllSelected:
|
|
28
|
+
isAllSelected: r,
|
|
29
29
|
isIndeterminate: a,
|
|
30
|
-
toggleSelectAll: (
|
|
31
|
-
|
|
30
|
+
toggleSelectAll: (v) => {
|
|
31
|
+
v ? t() : c();
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
|
-
function ot(e, { disabled:
|
|
36
|
-
const a =
|
|
37
|
-
let
|
|
38
|
-
const
|
|
39
|
-
const
|
|
35
|
+
function ot(e, { disabled: s, itemHeight: t, overscan: c = 5, prefixHeight: r }) {
|
|
36
|
+
const a = P(null), l = P([]), v = P(0), S = P(0), o = P(0);
|
|
37
|
+
let i;
|
|
38
|
+
const n = g(() => {
|
|
39
|
+
const y = typeof t == "number" ? e.value.length * t : e.value.reduce((R, h, I) => R + t(I), 0), A = typeof t == "number" ? v.value * t : e.value.slice(0, v.value).reduce((R, h, I) => R + t(I), 0);
|
|
40
40
|
return {
|
|
41
41
|
style: {
|
|
42
|
-
marginTop: `${
|
|
43
|
-
height: `${
|
|
42
|
+
marginTop: `${A}px`,
|
|
43
|
+
height: `${y - A}px`
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
|
-
}),
|
|
47
|
-
const
|
|
48
|
-
if (typeof
|
|
49
|
-
return Math.floor(
|
|
50
|
-
let R = 0,
|
|
51
|
-
for (let
|
|
52
|
-
const
|
|
53
|
-
if (R +=
|
|
54
|
-
|
|
46
|
+
}), E = () => {
|
|
47
|
+
const y = (r == null ? void 0 : r.value) ?? 0, A = Math.max(a.value.scrollTop - y, 0);
|
|
48
|
+
if (typeof t == "number")
|
|
49
|
+
return Math.floor(A / t);
|
|
50
|
+
let R = 0, h = 0;
|
|
51
|
+
for (let I = 0; I < e.value.length; I += 1) {
|
|
52
|
+
const x = t(I);
|
|
53
|
+
if (R += x, R >= A) {
|
|
54
|
+
h = I;
|
|
55
55
|
break;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
return
|
|
59
|
-
},
|
|
60
|
-
if (
|
|
61
|
-
return Math.ceil(
|
|
62
|
-
const
|
|
63
|
-
let
|
|
64
|
-
for (let
|
|
65
|
-
const
|
|
66
|
-
if (
|
|
58
|
+
return h;
|
|
59
|
+
}, C = () => {
|
|
60
|
+
if (o.value = a.value.clientHeight, typeof t == "number")
|
|
61
|
+
return Math.ceil(o.value / t);
|
|
62
|
+
const y = v.value ?? 0;
|
|
63
|
+
let A = 0, R = 0;
|
|
64
|
+
for (let h = y; h < e.value.length; h += 1) {
|
|
65
|
+
const I = t(h);
|
|
66
|
+
if (A += I, R = h, A > o.value)
|
|
67
67
|
break;
|
|
68
68
|
}
|
|
69
|
-
return R -
|
|
70
|
-
},
|
|
69
|
+
return R - y;
|
|
70
|
+
}, L = () => {
|
|
71
71
|
if (a.value) {
|
|
72
|
-
const
|
|
73
|
-
|
|
72
|
+
const y = C();
|
|
73
|
+
v.value = E(), S.value = Math.min(v.value + y + c, e.value.length), l.value = e.value.slice(v.value, S.value);
|
|
74
74
|
}
|
|
75
75
|
}, B = () => {
|
|
76
|
-
|
|
76
|
+
L();
|
|
77
77
|
};
|
|
78
|
-
|
|
79
|
-
a.value && (
|
|
80
|
-
|
|
81
|
-
}),
|
|
78
|
+
s || (Ae(() => {
|
|
79
|
+
a.value && (o.value = a.value.clientHeight, i = lt(a.value, ({ clientHeight: y }) => {
|
|
80
|
+
o.value = y, L();
|
|
81
|
+
}), L());
|
|
82
82
|
}), Ke(() => {
|
|
83
|
-
|
|
83
|
+
i == null || i.disconnect();
|
|
84
84
|
}), Ie(
|
|
85
85
|
() => e.value,
|
|
86
86
|
() => {
|
|
87
|
-
|
|
87
|
+
L();
|
|
88
88
|
}
|
|
89
89
|
));
|
|
90
|
-
const
|
|
90
|
+
const p = {
|
|
91
91
|
ref: a,
|
|
92
92
|
style: { overflowY: "auto" }
|
|
93
93
|
};
|
|
94
|
-
return
|
|
94
|
+
return s ? {
|
|
95
95
|
containerRef: a,
|
|
96
|
-
containerProps:
|
|
96
|
+
containerProps: p,
|
|
97
97
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
98
98
|
onScroll: () => {
|
|
99
99
|
},
|
|
100
100
|
list: e
|
|
101
101
|
} : {
|
|
102
102
|
containerRef: a,
|
|
103
|
-
containerProps:
|
|
103
|
+
containerProps: p,
|
|
104
104
|
onScroll: B,
|
|
105
105
|
list: l,
|
|
106
|
-
wrapperProps:
|
|
106
|
+
wrapperProps: n
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
var
|
|
109
|
+
var b = /* @__PURE__ */ ((e) => (e.SELECT = "select", e.SHOW_MORE = "show-more", e.ESCAPE = "escape-pressed", e.CLICK = "click", e.ENTER = "enter-pressed", e.SPACE = "space-pressed", e.TAB = "tab-pressed", e.CLOSE_DROPDOWN = "close-dropdown", e))(b || {}), se = /* @__PURE__ */ ((e) => (e.AUTOMATIC = "automatic", e.BUTTON = "button", e.NONE = "none", e))(se || {});
|
|
110
110
|
const nt = X({
|
|
111
111
|
name: "bento-listbox-static-category",
|
|
112
112
|
components: {
|
|
@@ -121,26 +121,26 @@ const nt = X({
|
|
|
121
121
|
required: !0
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
}),
|
|
125
|
-
function
|
|
126
|
-
const l =
|
|
127
|
-
return
|
|
128
|
-
|
|
124
|
+
}), it = { class: "b-listbox-single-select-category" };
|
|
125
|
+
function at(e, s, t, c, r, a) {
|
|
126
|
+
const l = k("bento-typography");
|
|
127
|
+
return m(), O("div", it, [
|
|
128
|
+
M(l, {
|
|
129
129
|
variant: "caption",
|
|
130
130
|
el: "span",
|
|
131
131
|
class: "b-listbox-single-select-category__label-text"
|
|
132
132
|
}, {
|
|
133
|
-
default:
|
|
134
|
-
z(
|
|
133
|
+
default: $(() => [
|
|
134
|
+
Y(z(e.categoryLabel), 1)
|
|
135
135
|
]),
|
|
136
136
|
_: 1
|
|
137
137
|
}),
|
|
138
138
|
K("div", null, [
|
|
139
|
-
|
|
139
|
+
F(e.$slots, "default", {}, void 0, !0)
|
|
140
140
|
])
|
|
141
141
|
]);
|
|
142
142
|
}
|
|
143
|
-
const rt = /* @__PURE__ */ q(nt, [["render",
|
|
143
|
+
const rt = /* @__PURE__ */ q(nt, [["render", at], ["__scopeId", "data-v-a90eff17"]]), ct = X({
|
|
144
144
|
name: "bento-listbox-option",
|
|
145
145
|
props: {
|
|
146
146
|
/**
|
|
@@ -152,41 +152,41 @@ const rt = /* @__PURE__ */ q(nt, [["render", it], ["__scopeId", "data-v-a90eff17
|
|
|
152
152
|
*/
|
|
153
153
|
selected: { type: Boolean, default: !1 }
|
|
154
154
|
},
|
|
155
|
-
emits: [
|
|
156
|
-
setup(e, { emit:
|
|
157
|
-
const
|
|
155
|
+
emits: [b.CLICK, b.ENTER, b.SPACE, b.TAB],
|
|
156
|
+
setup(e, { emit: s }) {
|
|
157
|
+
const t = g(() => ({
|
|
158
158
|
"b-listbox-option--disabled": e.disabled,
|
|
159
159
|
"b-listbox-option--selected": e.selected
|
|
160
160
|
}));
|
|
161
161
|
return {
|
|
162
162
|
// Enums
|
|
163
|
-
BentoKeyboardNavigationKeyDownEvent:
|
|
164
|
-
BentoListboxEvent:
|
|
163
|
+
BentoKeyboardNavigationKeyDownEvent: G,
|
|
164
|
+
BentoListboxEvent: b,
|
|
165
165
|
// Values
|
|
166
|
-
conditionalClasses:
|
|
166
|
+
conditionalClasses: t,
|
|
167
167
|
// Events
|
|
168
168
|
onClick: (a) => {
|
|
169
|
-
|
|
169
|
+
s(b.CLICK, a);
|
|
170
170
|
},
|
|
171
171
|
onOptionSelected: (a, l) => {
|
|
172
|
-
|
|
172
|
+
s(a, l);
|
|
173
173
|
}
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
176
|
});
|
|
177
|
-
function ut(e, t,
|
|
178
|
-
return
|
|
177
|
+
function ut(e, s, t, c, r, a) {
|
|
178
|
+
return m(), O("label", U({
|
|
179
179
|
class: ["b-listbox-option", e.conditionalClasses],
|
|
180
180
|
role: "option"
|
|
181
181
|
}, e.$attrs, {
|
|
182
|
-
onClick:
|
|
182
|
+
onClick: s[0] || (s[0] = (...l) => e.onClick && e.onClick(...l)),
|
|
183
183
|
onKeydown: [
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
184
|
+
s[1] || (s[1] = ve((l) => e.onOptionSelected(e.BentoListboxEvent.ENTER, l), ["enter"])),
|
|
185
|
+
s[2] || (s[2] = ve((l) => e.onOptionSelected(e.BentoListboxEvent.SPACE, l), ["space"])),
|
|
186
|
+
s[3] || (s[3] = ve((l) => e.onOptionSelected(e.BentoListboxEvent.TAB, l), ["tab"]))
|
|
187
187
|
]
|
|
188
188
|
}), [
|
|
189
|
-
|
|
189
|
+
F(e.$slots, "default", {}, void 0, !0)
|
|
190
190
|
], 16);
|
|
191
191
|
}
|
|
192
192
|
const be = /* @__PURE__ */ q(ct, [["render", ut], ["__scopeId", "data-v-18a61f5d"]]);
|
|
@@ -196,16 +196,16 @@ const dt = {
|
|
|
196
196
|
this.uuid = Te.toString(), Te += 1;
|
|
197
197
|
}
|
|
198
198
|
}, bt = { key: 0 };
|
|
199
|
-
function mt(e, t,
|
|
200
|
-
return
|
|
199
|
+
function mt(e, s, t, c, r, a) {
|
|
200
|
+
return m(), O("svg", U({ role: "img" }, e.$attrs, {
|
|
201
201
|
class: "ui-assets-icons-16",
|
|
202
202
|
xmlns: "http://www.w3.org/2000/svg",
|
|
203
203
|
width: "16",
|
|
204
204
|
height: "16",
|
|
205
205
|
fill: "none"
|
|
206
206
|
}), [
|
|
207
|
-
e.$attrs["svg-title"] ? (
|
|
208
|
-
|
|
207
|
+
e.$attrs["svg-title"] ? (m(), O("title", bt, z(e.$attrs["svg-title"]), 1)) : V("", !0),
|
|
208
|
+
s[0] || (s[0] = K("path", {
|
|
209
209
|
fill: "#00112C",
|
|
210
210
|
d: "M15.0608 4.00011L14.0001 2.93945L6.00011 10.9395L2.00011 6.93945L0.939453 8.00011L6.00011 13.0608L15.0608 4.00011Z"
|
|
211
211
|
}, null, -1))
|
|
@@ -236,60 +236,60 @@ const vt = /* @__PURE__ */ q(dt, [["render", mt]]), ft = X({
|
|
|
236
236
|
*/
|
|
237
237
|
selected: { type: Boolean, default: !1 }
|
|
238
238
|
},
|
|
239
|
-
emits: [
|
|
240
|
-
setup(e, { emit:
|
|
241
|
-
const
|
|
242
|
-
e.disabled ||
|
|
243
|
-
},
|
|
239
|
+
emits: [b.ENTER, b.SELECT, b.SPACE, b.TAB],
|
|
240
|
+
setup(e, { emit: s }) {
|
|
241
|
+
const t = (l) => {
|
|
242
|
+
e.disabled || s(l, e.option);
|
|
243
|
+
}, c = g(() => e.disabled ? !0 : null), r = g(() => e.selected ? !0 : null), a = g(() => e.disabled ? -1 : 0);
|
|
244
244
|
return {
|
|
245
245
|
// Values
|
|
246
|
-
ariaDisabled:
|
|
247
|
-
ariaSelected:
|
|
246
|
+
ariaDisabled: c,
|
|
247
|
+
ariaSelected: r,
|
|
248
248
|
tabIndex: a,
|
|
249
249
|
// Enums
|
|
250
|
-
BentoListboxEvent:
|
|
250
|
+
BentoListboxEvent: b,
|
|
251
251
|
// Events
|
|
252
|
-
onOptionSelected:
|
|
252
|
+
onOptionSelected: t
|
|
253
253
|
};
|
|
254
254
|
}
|
|
255
255
|
}), gt = { class: "b-listbox-single-select-option__text" }, pt = { class: "b-listbox-single-select-option__check-icon" };
|
|
256
|
-
function yt(e, t,
|
|
257
|
-
const l =
|
|
258
|
-
return
|
|
256
|
+
function yt(e, s, t, c, r, a) {
|
|
257
|
+
const l = k("bento-typography"), v = k("checkmark-icon"), S = k("bento-listbox-option");
|
|
258
|
+
return m(), D(S, {
|
|
259
259
|
class: "b-listbox-single-select-option",
|
|
260
260
|
disabled: e.disabled,
|
|
261
261
|
selected: e.selected,
|
|
262
262
|
"aria-selected": e.ariaSelected,
|
|
263
263
|
"aria-disabled": e.ariaDisabled,
|
|
264
264
|
tabindex: e.tabIndex,
|
|
265
|
-
onClick:
|
|
266
|
-
onEnterPressed:
|
|
267
|
-
onSpacePressed:
|
|
268
|
-
onTabPressed:
|
|
265
|
+
onClick: s[0] || (s[0] = (o) => e.onOptionSelected(e.BentoListboxEvent.SELECT)),
|
|
266
|
+
onEnterPressed: s[1] || (s[1] = (o) => e.onOptionSelected(e.BentoListboxEvent.ENTER)),
|
|
267
|
+
onSpacePressed: s[2] || (s[2] = qe((o) => e.onOptionSelected(e.BentoListboxEvent.SPACE), ["prevent"])),
|
|
268
|
+
onTabPressed: s[3] || (s[3] = (o) => e.onOptionSelected(e.BentoListboxEvent.TAB))
|
|
269
269
|
}, {
|
|
270
|
-
default:
|
|
271
|
-
|
|
270
|
+
default: $(() => [
|
|
271
|
+
F(e.$slots, "default", le(re(e.option)), () => [
|
|
272
272
|
K("span", gt, [
|
|
273
|
-
|
|
274
|
-
default:
|
|
275
|
-
z(
|
|
273
|
+
M(l, { el: "span" }, {
|
|
274
|
+
default: $(() => [
|
|
275
|
+
Y(z(e.option.label), 1)
|
|
276
276
|
]),
|
|
277
277
|
_: 1
|
|
278
278
|
}),
|
|
279
|
-
e.option.description ? (
|
|
279
|
+
e.option.description ? (m(), D(l, {
|
|
280
280
|
key: 0,
|
|
281
281
|
class: "b-listbox-single-select-option__description",
|
|
282
282
|
el: "span"
|
|
283
283
|
}, {
|
|
284
|
-
default:
|
|
285
|
-
z(
|
|
284
|
+
default: $(() => [
|
|
285
|
+
Y(z(e.option.description), 1)
|
|
286
286
|
]),
|
|
287
287
|
_: 1
|
|
288
|
-
})) :
|
|
288
|
+
})) : V("", !0)
|
|
289
289
|
])
|
|
290
290
|
], !0),
|
|
291
291
|
K("span", pt, [
|
|
292
|
-
oe(
|
|
292
|
+
oe(M(v, { "svg-title": "selected" }, null, 512), [
|
|
293
293
|
[$e, e.selected]
|
|
294
294
|
])
|
|
295
295
|
])
|
|
@@ -297,19 +297,19 @@ function yt(e, t, s, r, b, a) {
|
|
|
297
297
|
_: 3
|
|
298
298
|
}, 8, ["disabled", "selected", "aria-selected", "aria-disabled", "tabindex"]);
|
|
299
299
|
}
|
|
300
|
-
const St = /* @__PURE__ */ q(ft, [["render", yt], ["__scopeId", "data-v-226f4c84"]]), Re = ({ items: e, isOptionDisabled:
|
|
301
|
-
const
|
|
302
|
-
() =>
|
|
303
|
-
), a =
|
|
300
|
+
const St = /* @__PURE__ */ q(ft, [["render", yt], ["__scopeId", "data-v-226f4c84"]]), Re = ({ items: e, isOptionDisabled: s, hasStaticCategories: t }, c) => {
|
|
301
|
+
const r = g(
|
|
302
|
+
() => t.value ? e.value.flatMap((p) => p.items) : e.value
|
|
303
|
+
), a = g(() => r.value.length - 1), l = P(0);
|
|
304
304
|
Ae(() => {
|
|
305
|
-
|
|
305
|
+
s && (l.value = e.value.findIndex((p) => !s(p)));
|
|
306
306
|
});
|
|
307
|
-
const
|
|
308
|
-
var R,
|
|
309
|
-
const
|
|
310
|
-
return !
|
|
311
|
-
},
|
|
312
|
-
switch (
|
|
307
|
+
const v = (p) => {
|
|
308
|
+
var R, h;
|
|
309
|
+
const A = ((h = (R = e.value[p]) == null ? void 0 : R.items) == null ? void 0 : h.length) ? e.value[p].items.every((I) => s(I)) : s(e.value[p]);
|
|
310
|
+
return !s || !!s && A;
|
|
311
|
+
}, S = (p) => {
|
|
312
|
+
switch (p) {
|
|
313
313
|
case "increase":
|
|
314
314
|
l.value += 1;
|
|
315
315
|
break;
|
|
@@ -317,42 +317,42 @@ const St = /* @__PURE__ */ q(ft, [["render", yt], ["__scopeId", "data-v-226f4c84
|
|
|
317
317
|
l.value -= 1;
|
|
318
318
|
break;
|
|
319
319
|
}
|
|
320
|
-
},
|
|
321
|
-
l.value !==
|
|
322
|
-
},
|
|
323
|
-
B(
|
|
320
|
+
}, o = ({ edgeCaseItem: p }, y, A) => {
|
|
321
|
+
l.value !== p && (S(A), v(l.value) && y(), c(l.value));
|
|
322
|
+
}, i = (p) => {
|
|
323
|
+
B(p), o(
|
|
324
324
|
{
|
|
325
325
|
edgeCaseItem: a.value
|
|
326
326
|
},
|
|
327
|
-
|
|
327
|
+
i,
|
|
328
328
|
"increase"
|
|
329
329
|
/* INCREASE */
|
|
330
330
|
);
|
|
331
|
-
},
|
|
332
|
-
B(
|
|
331
|
+
}, n = (p) => {
|
|
332
|
+
B(p), o(
|
|
333
333
|
{
|
|
334
334
|
edgeCaseItem: 0
|
|
335
335
|
},
|
|
336
|
-
|
|
336
|
+
n,
|
|
337
337
|
"decrease"
|
|
338
338
|
/* DECREASE */
|
|
339
339
|
);
|
|
340
|
-
},
|
|
341
|
-
l.value = 0,
|
|
342
|
-
},
|
|
343
|
-
l.value = a.value,
|
|
344
|
-
},
|
|
345
|
-
l.value =
|
|
346
|
-
}, B = (
|
|
347
|
-
var
|
|
348
|
-
(
|
|
340
|
+
}, E = () => {
|
|
341
|
+
l.value = 0, v(l.value) ? i() : c(l.value);
|
|
342
|
+
}, C = () => {
|
|
343
|
+
l.value = a.value, v(l.value) ? n() : c(l.value);
|
|
344
|
+
}, L = (p) => {
|
|
345
|
+
l.value = p;
|
|
346
|
+
}, B = (p) => {
|
|
347
|
+
var y;
|
|
348
|
+
(y = p == null ? void 0 : p.detail) == null || y.preventDefault();
|
|
349
349
|
};
|
|
350
350
|
return {
|
|
351
|
-
moveToFirstElement:
|
|
352
|
-
moveToLastElement:
|
|
353
|
-
moveToNextElement:
|
|
354
|
-
moveToPreviousElement:
|
|
355
|
-
setListboxFocusedIndex:
|
|
351
|
+
moveToFirstElement: E,
|
|
352
|
+
moveToLastElement: C,
|
|
353
|
+
moveToNextElement: i,
|
|
354
|
+
moveToPreviousElement: n,
|
|
355
|
+
setListboxFocusedIndex: L,
|
|
356
356
|
preventDefault: B,
|
|
357
357
|
focusedIndex: l
|
|
358
358
|
};
|
|
@@ -403,41 +403,41 @@ const St = /* @__PURE__ */ q(ft, [["render", yt], ["__scopeId", "data-v-226f4c84
|
|
|
403
403
|
*/
|
|
404
404
|
staticCategories: { type: Boolean, default: !1 }
|
|
405
405
|
},
|
|
406
|
-
emits: [
|
|
407
|
-
setup(e, { emit:
|
|
408
|
-
const
|
|
409
|
-
var
|
|
410
|
-
return !!((
|
|
411
|
-
}),
|
|
412
|
-
|
|
413
|
-
},
|
|
414
|
-
var
|
|
415
|
-
(
|
|
406
|
+
emits: [b.SELECT, b.ENTER, b.SPACE, b.TAB],
|
|
407
|
+
setup(e, { emit: s, expose: t, slots: c }) {
|
|
408
|
+
const r = P(null), a = P([]), l = g(() => {
|
|
409
|
+
var y;
|
|
410
|
+
return !!((y = e.selectedValue) != null && y.length) && e.selectedValue.at(0);
|
|
411
|
+
}), v = g(() => !!e.items.some(({ items: y }) => !!y)), S = (y) => (A) => {
|
|
412
|
+
s(y, [A]);
|
|
413
|
+
}, o = (y) => {
|
|
414
|
+
var A;
|
|
415
|
+
(A = r.value.querySelectorAll('[role="option"]')[y]) == null || A.focus();
|
|
416
416
|
}, {
|
|
417
|
-
moveToNextElement:
|
|
418
|
-
moveToPreviousElement:
|
|
419
|
-
moveToFirstElement:
|
|
420
|
-
moveToLastElement:
|
|
421
|
-
setListboxFocusedIndex:
|
|
417
|
+
moveToNextElement: i,
|
|
418
|
+
moveToPreviousElement: n,
|
|
419
|
+
moveToFirstElement: E,
|
|
420
|
+
moveToLastElement: C,
|
|
421
|
+
setListboxFocusedIndex: L
|
|
422
422
|
} = Re(
|
|
423
423
|
{
|
|
424
424
|
items: Z(e, "items"),
|
|
425
425
|
isOptionDisabled: e.isOptionDisabled,
|
|
426
426
|
hasStaticCategories: Z(e, "staticCategories")
|
|
427
427
|
},
|
|
428
|
-
|
|
428
|
+
o
|
|
429
429
|
), B = {
|
|
430
|
-
[
|
|
431
|
-
[
|
|
432
|
-
[
|
|
433
|
-
[
|
|
434
|
-
},
|
|
435
|
-
[
|
|
436
|
-
[
|
|
437
|
-
[
|
|
438
|
-
[
|
|
430
|
+
[G.ARROW_UP]: n,
|
|
431
|
+
[G.ARROW_DOWN]: i,
|
|
432
|
+
[G.HOME]: E,
|
|
433
|
+
[G.END]: C
|
|
434
|
+
}, p = {
|
|
435
|
+
[b.SELECT]: S(b.SELECT),
|
|
436
|
+
[b.SPACE]: S(b.SPACE),
|
|
437
|
+
[b.TAB]: S(b.TAB),
|
|
438
|
+
[b.ENTER]: S(b.ENTER)
|
|
439
439
|
};
|
|
440
|
-
return
|
|
440
|
+
return t({
|
|
441
441
|
/**
|
|
442
442
|
* Reference for a single listbox item.
|
|
443
443
|
* Required for keyboard navigation in dropdown as $children is removed in vue@3
|
|
@@ -447,74 +447,74 @@ const St = /* @__PURE__ */ q(ft, [["render", yt], ["__scopeId", "data-v-226f4c84
|
|
|
447
447
|
* Method to set the index of the item to be focused on
|
|
448
448
|
* Used for focus management to be kept in-sync with parent e.g. dropdowns
|
|
449
449
|
*/
|
|
450
|
-
setListboxFocusedIndex:
|
|
450
|
+
setListboxFocusedIndex: L
|
|
451
451
|
}), {
|
|
452
452
|
// Enums
|
|
453
|
-
BentoListboxEvent:
|
|
453
|
+
BentoListboxEvent: b,
|
|
454
454
|
// Values
|
|
455
|
-
listboxRef:
|
|
455
|
+
listboxRef: r,
|
|
456
456
|
listboxItemRef: a,
|
|
457
457
|
selectedItem: l,
|
|
458
|
-
slots:
|
|
458
|
+
slots: c,
|
|
459
459
|
// Computed
|
|
460
|
-
hasCategories:
|
|
460
|
+
hasCategories: v,
|
|
461
461
|
// Methods
|
|
462
|
-
onOptionSelected:
|
|
462
|
+
onOptionSelected: S,
|
|
463
463
|
// Keyboard navigation
|
|
464
464
|
listboxListeners: B,
|
|
465
|
-
listboxOptionListeners:
|
|
465
|
+
listboxOptionListeners: p
|
|
466
466
|
};
|
|
467
467
|
}
|
|
468
468
|
});
|
|
469
|
-
function ht(e, t,
|
|
470
|
-
const l =
|
|
471
|
-
return oe((
|
|
472
|
-
e.hasCategories && e.staticCategories ? (
|
|
473
|
-
key:
|
|
474
|
-
"category-label":
|
|
469
|
+
function ht(e, s, t, c, r, a) {
|
|
470
|
+
const l = k("bento-listbox-single-select-option"), v = k("bento-listbox-single-select-category"), S = ke("bento-keyboard-navigation-directive");
|
|
471
|
+
return oe((m(), O("div", U({ ref: "listboxRef" }, Q(e.listboxListeners, !0)), [
|
|
472
|
+
e.hasCategories && e.staticCategories ? (m(!0), O(ee, { key: 0 }, W(e.items, (o) => (m(), D(v, {
|
|
473
|
+
key: o.value,
|
|
474
|
+
"category-label": o.label,
|
|
475
475
|
role: "group"
|
|
476
476
|
}, {
|
|
477
|
-
default:
|
|
478
|
-
(
|
|
479
|
-
key:
|
|
477
|
+
default: $(() => [
|
|
478
|
+
(m(!0), O(ee, null, W(o.items, (i) => (m(), D(l, U({
|
|
479
|
+
key: i.value,
|
|
480
480
|
ref_for: !0,
|
|
481
481
|
ref: "listboxItemRef",
|
|
482
482
|
role: "option",
|
|
483
|
-
option:
|
|
484
|
-
disabled: e.isOptionDisabled ? e.isOptionDisabled(
|
|
485
|
-
selected:
|
|
483
|
+
option: i,
|
|
484
|
+
disabled: e.isOptionDisabled ? e.isOptionDisabled(i) : null,
|
|
485
|
+
selected: i.value === e.selectedItem.value
|
|
486
486
|
}, Q(e.listboxOptionListeners)), ce({ _: 2 }, [
|
|
487
|
-
|
|
488
|
-
name:
|
|
489
|
-
fn:
|
|
490
|
-
|
|
487
|
+
W(e.slots, (n, E) => ({
|
|
488
|
+
name: E,
|
|
489
|
+
fn: $((C) => [
|
|
490
|
+
F(e.$slots, E, U({ ref_for: !0 }, C))
|
|
491
491
|
])
|
|
492
492
|
}))
|
|
493
493
|
]), 1040, ["option", "disabled", "selected"]))), 128))
|
|
494
494
|
]),
|
|
495
495
|
_: 2
|
|
496
|
-
}, 1032, ["category-label"]))), 128)) : (
|
|
497
|
-
key:
|
|
496
|
+
}, 1032, ["category-label"]))), 128)) : (m(!0), O(ee, { key: 1 }, W(e.items, (o) => (m(), D(l, U({
|
|
497
|
+
key: o.value,
|
|
498
498
|
ref_for: !0,
|
|
499
499
|
ref: "listboxItemRef",
|
|
500
500
|
role: "option",
|
|
501
|
-
option:
|
|
502
|
-
disabled: e.isOptionDisabled ? e.isOptionDisabled(
|
|
503
|
-
selected:
|
|
501
|
+
option: o,
|
|
502
|
+
disabled: e.isOptionDisabled ? e.isOptionDisabled(o) : null,
|
|
503
|
+
selected: o.value === e.selectedItem.value
|
|
504
504
|
}, Q(e.listboxOptionListeners)), ce({ _: 2 }, [
|
|
505
|
-
|
|
506
|
-
name:
|
|
507
|
-
fn:
|
|
508
|
-
|
|
505
|
+
W(e.slots, (i, n) => ({
|
|
506
|
+
name: n,
|
|
507
|
+
fn: $((E) => [
|
|
508
|
+
F(e.$slots, n, U({ ref_for: !0 }, E))
|
|
509
509
|
])
|
|
510
510
|
}))
|
|
511
511
|
]), 1040, ["option", "disabled", "selected"]))), 128))
|
|
512
512
|
], 16)), [
|
|
513
|
-
[
|
|
513
|
+
[S]
|
|
514
514
|
]);
|
|
515
515
|
}
|
|
516
516
|
const Et = /* @__PURE__ */ q(Ct, [["render", ht]]);
|
|
517
|
-
var ge = /* @__PURE__ */ ((e) => (e.DISABLED = "disabled", e.STATIC_CATEGORY = "static-category", e))(ge || {}),
|
|
517
|
+
var ge = /* @__PURE__ */ ((e) => (e.DISABLED = "disabled", e.STATIC_CATEGORY = "static-category", e))(ge || {}), ae = /* @__PURE__ */ ((e) => (e.SELECT_CATEGORY = "select-category", e.UNSELECT_CATEGORY = "unselect-category", e))(ae || {});
|
|
518
518
|
const _t = {
|
|
519
519
|
"en-US": {
|
|
520
520
|
categoryClosed: "{category} closed",
|
|
@@ -573,78 +573,78 @@ const _t = {
|
|
|
573
573
|
*/
|
|
574
574
|
tabindex: { type: Number, default: -1 }
|
|
575
575
|
},
|
|
576
|
-
emits: [
|
|
577
|
-
setup(e, { emit:
|
|
578
|
-
const
|
|
579
|
-
() => e.category.items.every((
|
|
580
|
-
), l = Z(e, "staticCategories"),
|
|
576
|
+
emits: [ae.SELECT_CATEGORY, ae.UNSELECT_CATEGORY],
|
|
577
|
+
setup(e, { emit: s }) {
|
|
578
|
+
const t = P(!1), { t: c } = ye(), r = (h) => e.isOptionDisabled ? e.isOptionDisabled(h) : !1, a = g(
|
|
579
|
+
() => e.category.items.every((h) => r(h))
|
|
580
|
+
), l = Z(e, "staticCategories"), v = g(() => t.value || e.staticCategories), S = g(() => ({
|
|
581
581
|
[`b-listbox-multi-select-category--${ge.DISABLED}`]: a.value,
|
|
582
582
|
[`b-listbox-multi-select-category--${ge.STATIC_CATEGORY}`]: e.staticCategories
|
|
583
|
-
})),
|
|
584
|
-
|
|
585
|
-
},
|
|
583
|
+
})), o = (h) => {
|
|
584
|
+
h.preventDefault(), t.value = !t.value;
|
|
585
|
+
}, i = (h) => {
|
|
586
586
|
var te;
|
|
587
|
-
const
|
|
588
|
-
return { isDisabled:
|
|
589
|
-
},
|
|
590
|
-
() => e.category.items.filter((
|
|
591
|
-
const { isDisabled:
|
|
592
|
-
return
|
|
587
|
+
const I = r(h), x = ((te = e.selectedItemsList) == null ? void 0 : te.includes(h.value)) || !1;
|
|
588
|
+
return { isDisabled: I, isPreSelected: x };
|
|
589
|
+
}, n = g(
|
|
590
|
+
() => e.category.items.filter((h) => {
|
|
591
|
+
const { isDisabled: I, isPreSelected: x } = i(h);
|
|
592
|
+
return I && x || !I;
|
|
593
593
|
})
|
|
594
|
-
),
|
|
594
|
+
), E = g(
|
|
595
595
|
() => {
|
|
596
|
-
var
|
|
597
|
-
return (
|
|
598
|
-
({ value:
|
|
599
|
-
var
|
|
600
|
-
return (
|
|
596
|
+
var h;
|
|
597
|
+
return (h = n.value) == null ? void 0 : h.filter(
|
|
598
|
+
({ value: I }) => {
|
|
599
|
+
var x;
|
|
600
|
+
return (x = e.selectedItemsList) == null ? void 0 : x.includes(I);
|
|
601
601
|
}
|
|
602
602
|
);
|
|
603
603
|
}
|
|
604
|
-
),
|
|
605
|
-
const
|
|
606
|
-
return
|
|
607
|
-
}),
|
|
604
|
+
), C = g(() => {
|
|
605
|
+
const h = t.value ? "categoryOpened" : "categoryClosed";
|
|
606
|
+
return c(h, { category: e.category.label });
|
|
607
|
+
}), L = g(
|
|
608
608
|
() => ({
|
|
609
609
|
el: "span",
|
|
610
610
|
variant: e.staticCategories ? "caption" : "body"
|
|
611
611
|
})
|
|
612
612
|
), B = () => {
|
|
613
|
-
|
|
614
|
-
},
|
|
615
|
-
|
|
616
|
-
}, { isAllSelected:
|
|
617
|
-
|
|
618
|
-
|
|
613
|
+
s(ae.SELECT_CATEGORY);
|
|
614
|
+
}, p = () => {
|
|
615
|
+
s(ae.UNSELECT_CATEGORY);
|
|
616
|
+
}, { isAllSelected: y, isIndeterminate: A, toggleSelectAll: R } = Be(
|
|
617
|
+
E,
|
|
618
|
+
n,
|
|
619
619
|
B,
|
|
620
|
-
|
|
620
|
+
p
|
|
621
621
|
);
|
|
622
622
|
return {
|
|
623
623
|
// Values
|
|
624
|
-
chevronTitle:
|
|
625
|
-
conditionalClass:
|
|
624
|
+
chevronTitle: C,
|
|
625
|
+
conditionalClass: S,
|
|
626
626
|
hasAllPropsDisabled: a,
|
|
627
|
-
isOpen:
|
|
628
|
-
isAllSelected:
|
|
629
|
-
isIndeterminate:
|
|
627
|
+
isOpen: t,
|
|
628
|
+
isAllSelected: y,
|
|
629
|
+
isIndeterminate: A,
|
|
630
630
|
isStaticCategory: l,
|
|
631
631
|
// Computed
|
|
632
|
-
showItemChildren:
|
|
633
|
-
categoryLabelProps:
|
|
632
|
+
showItemChildren: v,
|
|
633
|
+
categoryLabelProps: L,
|
|
634
634
|
// Methods
|
|
635
|
-
toggleOpen:
|
|
635
|
+
toggleOpen: o,
|
|
636
636
|
toggleSelectAll: R
|
|
637
637
|
};
|
|
638
638
|
}
|
|
639
|
-
}),
|
|
640
|
-
function
|
|
641
|
-
const l =
|
|
642
|
-
return
|
|
643
|
-
|
|
639
|
+
}), Ot = { class: "b-listbox-multi-select-category__label" };
|
|
640
|
+
function Lt(e, s, t, c, r, a) {
|
|
641
|
+
const l = k("bento-checkbox"), v = k("bento-typography"), S = k("chevron-up-icon"), o = k("chevron-down-icon"), i = k("bento-listbox-option");
|
|
642
|
+
return m(), O("div", null, [
|
|
643
|
+
M(i, {
|
|
644
644
|
class: fe(["b-listbox-multi-select-category__option", e.conditionalClass])
|
|
645
645
|
}, {
|
|
646
|
-
default:
|
|
647
|
-
e.isStaticCategory ?
|
|
646
|
+
default: $(() => [
|
|
647
|
+
e.isStaticCategory ? V("", !0) : (m(), D(l, {
|
|
648
648
|
key: 0,
|
|
649
649
|
"model-value": e.isAllSelected,
|
|
650
650
|
indeterminate: e.isIndeterminate,
|
|
@@ -654,23 +654,23 @@ function Ot(e, t, s, r, b, a) {
|
|
|
654
654
|
tabindex: e.tabindex,
|
|
655
655
|
"onUpdate:modelValue": e.toggleSelectAll
|
|
656
656
|
}, null, 8, ["model-value", "indeterminate", "disabled", "aria-label", "value", "tabindex", "onUpdate:modelValue"])),
|
|
657
|
-
K("span",
|
|
658
|
-
|
|
659
|
-
default:
|
|
660
|
-
z(
|
|
657
|
+
K("span", Ot, [
|
|
658
|
+
M(v, U(e.categoryLabelProps, { class: "b-listbox-multi-select-category__label-text" }), {
|
|
659
|
+
default: $(() => [
|
|
660
|
+
Y(z(e.category.label), 1)
|
|
661
661
|
]),
|
|
662
662
|
_: 1
|
|
663
663
|
}, 16),
|
|
664
|
-
e.isStaticCategory ?
|
|
664
|
+
e.isStaticCategory ? V("", !0) : (m(), O("div", {
|
|
665
665
|
key: 0,
|
|
666
666
|
class: "b-listbox-multi-select-category__label-chevron",
|
|
667
667
|
"data-testid": "toggle-listbox",
|
|
668
|
-
onClickCapture:
|
|
668
|
+
onClickCapture: s[0] || (s[0] = (...n) => e.toggleOpen && e.toggleOpen(...n))
|
|
669
669
|
}, [
|
|
670
|
-
e.isOpen ? (
|
|
670
|
+
e.isOpen ? (m(), D(S, {
|
|
671
671
|
key: 0,
|
|
672
672
|
"svg-title": e.chevronTitle
|
|
673
|
-
}, null, 8, ["svg-title"])) : (
|
|
673
|
+
}, null, 8, ["svg-title"])) : (m(), D(o, {
|
|
674
674
|
key: 1,
|
|
675
675
|
"svg-title": e.chevronTitle
|
|
676
676
|
}, null, 8, ["svg-title"]))
|
|
@@ -680,13 +680,13 @@ function Ot(e, t, s, r, b, a) {
|
|
|
680
680
|
_: 1
|
|
681
681
|
}, 8, ["class"]),
|
|
682
682
|
oe(K("div", null, [
|
|
683
|
-
|
|
683
|
+
F(e.$slots, "default", {}, void 0, !0)
|
|
684
684
|
], 512), [
|
|
685
685
|
[$e, e.showItemChildren]
|
|
686
686
|
])
|
|
687
687
|
]);
|
|
688
688
|
}
|
|
689
|
-
const At = /* @__PURE__ */ q(Tt, [["render",
|
|
689
|
+
const At = /* @__PURE__ */ q(Tt, [["render", Lt], ["__scopeId", "data-v-9681c80b"]]);
|
|
690
690
|
var H = /* @__PURE__ */ ((e) => (e.SELECT_CATEGORY = "select-category", e.TOGGLE_CHECKBOX_SELECTION = "toggle-checkbox-selection", e.UNSELECT_CATEGORY = "unselect-category", e))(H || {});
|
|
691
691
|
const It = X({
|
|
692
692
|
name: "listbox-multi-select-options",
|
|
@@ -760,134 +760,134 @@ const It = X({
|
|
|
760
760
|
H.SELECT_CATEGORY,
|
|
761
761
|
H.UNSELECT_CATEGORY
|
|
762
762
|
],
|
|
763
|
-
setup(e, { emit:
|
|
764
|
-
const
|
|
765
|
-
|
|
766
|
-
},
|
|
767
|
-
const
|
|
768
|
-
return
|
|
769
|
-
}, a = (
|
|
770
|
-
if (
|
|
771
|
-
return
|
|
772
|
-
|
|
763
|
+
setup(e, { emit: s }) {
|
|
764
|
+
const t = (o) => {
|
|
765
|
+
s(H.TOGGLE_CHECKBOX_SELECTION, o);
|
|
766
|
+
}, c = (o) => !!o.items, r = (o) => {
|
|
767
|
+
const i = e.isMultiLevel && e.searching;
|
|
768
|
+
return o.description && (!e.isMultiLevel || i);
|
|
769
|
+
}, a = (o) => o.items ? !!o.items.find((i) => e.selectedItemsList.includes(i.value)) : e.selectedItemsList.includes(o.value), l = (o, i) => {
|
|
770
|
+
if (c(i))
|
|
771
|
+
return s(o ? H.SELECT_CATEGORY : H.UNSELECT_CATEGORY, i);
|
|
772
|
+
t(i.value);
|
|
773
773
|
};
|
|
774
774
|
return {
|
|
775
775
|
// Values
|
|
776
|
-
conditionalClasses:
|
|
776
|
+
conditionalClasses: g(() => ({
|
|
777
777
|
"b-listbox-multi-select-options__static-category-option": e.staticCategories,
|
|
778
778
|
"b-listbox-multi-select-options__category-option": e.categoryItems
|
|
779
779
|
})),
|
|
780
780
|
// Methods
|
|
781
781
|
isOptionSelected: a,
|
|
782
|
-
shouldShowDescription:
|
|
783
|
-
toggleCheckboxSelection:
|
|
782
|
+
shouldShowDescription: r,
|
|
783
|
+
toggleCheckboxSelection: t,
|
|
784
784
|
selectSearch: l,
|
|
785
|
-
computedTabindex: (
|
|
785
|
+
computedTabindex: (o) => o + 1 === e.focusedIndex ? 0 : -1,
|
|
786
786
|
// Enums
|
|
787
|
-
BentoListboxEvent:
|
|
787
|
+
BentoListboxEvent: b,
|
|
788
788
|
ListboxMultiSelectOptionsEvent: H
|
|
789
789
|
};
|
|
790
790
|
}
|
|
791
791
|
}), $t = { class: "b-listbox-multi-select__option-text" }, kt = { class: "b-listbox-multi-select__option-text" };
|
|
792
|
-
function Bt(e, t,
|
|
793
|
-
const l =
|
|
794
|
-
return
|
|
795
|
-
(
|
|
796
|
-
key: `selected-${
|
|
792
|
+
function Bt(e, s, t, c, r, a) {
|
|
793
|
+
const l = k("bento-checkbox"), v = k("bento-typography"), S = k("bento-listbox-option"), o = k("listbox-multi-select-options", !0), i = k("listbox-multi-select-category");
|
|
794
|
+
return m(), O("div", null, [
|
|
795
|
+
(m(!0), O(ee, null, W(e.items, (n, E) => (m(), O("div", {
|
|
796
|
+
key: `selected-${n.value}`
|
|
797
797
|
}, [
|
|
798
|
-
e.searching && e.isMultiLevel ? (
|
|
798
|
+
e.searching && e.isMultiLevel ? (m(), D(S, {
|
|
799
799
|
key: 0,
|
|
800
800
|
class: fe(["b-listbox-multi-select-options", e.conditionalClasses]),
|
|
801
|
-
disabled: e.isOptionDisabled ? e.isOptionDisabled(
|
|
801
|
+
disabled: e.isOptionDisabled ? e.isOptionDisabled(n) : null
|
|
802
802
|
}, {
|
|
803
|
-
default:
|
|
804
|
-
|
|
805
|
-
"model-value": e.isOptionSelected(
|
|
806
|
-
"aria-label":
|
|
807
|
-
disabled: e.isOptionDisabled ? e.isOptionDisabled(
|
|
808
|
-
value:
|
|
809
|
-
tabindex: e.computedTabindex(
|
|
810
|
-
"onUpdate:modelValue": (
|
|
803
|
+
default: $(() => [
|
|
804
|
+
M(l, {
|
|
805
|
+
"model-value": e.isOptionSelected(n),
|
|
806
|
+
"aria-label": n.label,
|
|
807
|
+
disabled: e.isOptionDisabled ? e.isOptionDisabled(n) : null,
|
|
808
|
+
value: n.value,
|
|
809
|
+
tabindex: e.computedTabindex(E),
|
|
810
|
+
"onUpdate:modelValue": (C) => e.selectSearch(C, n)
|
|
811
811
|
}, null, 8, ["model-value", "aria-label", "disabled", "value", "tabindex", "onUpdate:modelValue"]),
|
|
812
|
-
|
|
812
|
+
F(e.$slots, "default", U({ ref_for: !0 }, n), () => [
|
|
813
813
|
K("span", $t, [
|
|
814
|
-
|
|
815
|
-
default:
|
|
816
|
-
z(
|
|
814
|
+
M(v, { el: "span" }, {
|
|
815
|
+
default: $(() => [
|
|
816
|
+
Y(z(n.label), 1)
|
|
817
817
|
]),
|
|
818
818
|
_: 2
|
|
819
819
|
}, 1024),
|
|
820
|
-
e.shouldShowDescription(
|
|
820
|
+
e.shouldShowDescription(n) ? (m(), D(v, {
|
|
821
821
|
key: 0,
|
|
822
822
|
class: "b-listbox-multi-select__option-description",
|
|
823
823
|
el: "span"
|
|
824
824
|
}, {
|
|
825
|
-
default:
|
|
826
|
-
z(
|
|
825
|
+
default: $(() => [
|
|
826
|
+
Y(z(n.description), 1)
|
|
827
827
|
]),
|
|
828
828
|
_: 2
|
|
829
|
-
}, 1024)) :
|
|
829
|
+
}, 1024)) : V("", !0)
|
|
830
830
|
])
|
|
831
831
|
], !0)
|
|
832
832
|
]),
|
|
833
833
|
_: 2
|
|
834
|
-
}, 1032, ["class", "disabled"])) : (
|
|
835
|
-
|
|
834
|
+
}, 1032, ["class", "disabled"])) : (m(), O(ee, { key: 1 }, [
|
|
835
|
+
n.items ? (m(), D(i, {
|
|
836
836
|
key: 0,
|
|
837
|
-
category:
|
|
837
|
+
category: n,
|
|
838
838
|
"static-categories": e.staticCategories,
|
|
839
839
|
"is-option-disabled": e.isOptionDisabled,
|
|
840
840
|
"selected-items-list": e.selectedItemsList,
|
|
841
|
-
tabindex: e.computedTabindex(
|
|
842
|
-
onSelectCategory: (
|
|
843
|
-
onUnselectCategory: (
|
|
841
|
+
tabindex: e.computedTabindex(E),
|
|
842
|
+
onSelectCategory: (C) => e.$emit(e.ListboxMultiSelectOptionsEvent.SELECT_CATEGORY, n),
|
|
843
|
+
onUnselectCategory: (C) => e.$emit(e.ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY, n)
|
|
844
844
|
}, {
|
|
845
|
-
default:
|
|
846
|
-
|
|
845
|
+
default: $(() => [
|
|
846
|
+
M(o, {
|
|
847
847
|
"category-items": "",
|
|
848
|
-
items:
|
|
848
|
+
items: n.items,
|
|
849
849
|
"is-option-disabled": e.isOptionDisabled,
|
|
850
850
|
"focused-index": e.focusedIndex,
|
|
851
851
|
"is-multi-level": e.isMultiLevel,
|
|
852
852
|
"static-categories": e.staticCategories,
|
|
853
853
|
"selected-items-list": e.selectedItemsList,
|
|
854
854
|
searching: e.searching,
|
|
855
|
-
onToggleCheckboxSelection:
|
|
855
|
+
onToggleCheckboxSelection: s[0] || (s[0] = (C) => e.toggleCheckboxSelection(C))
|
|
856
856
|
}, null, 8, ["items", "is-option-disabled", "focused-index", "is-multi-level", "static-categories", "selected-items-list", "searching"])
|
|
857
857
|
]),
|
|
858
858
|
_: 2
|
|
859
|
-
}, 1032, ["category", "static-categories", "is-option-disabled", "selected-items-list", "tabindex", "onSelectCategory", "onUnselectCategory"])) : (
|
|
859
|
+
}, 1032, ["category", "static-categories", "is-option-disabled", "selected-items-list", "tabindex", "onSelectCategory", "onUnselectCategory"])) : (m(), D(S, {
|
|
860
860
|
key: 1,
|
|
861
861
|
class: fe(["b-listbox-multi-select-options", e.conditionalClasses]),
|
|
862
|
-
disabled: e.isOptionDisabled ? e.isOptionDisabled(
|
|
862
|
+
disabled: e.isOptionDisabled ? e.isOptionDisabled(n) : null
|
|
863
863
|
}, {
|
|
864
|
-
default:
|
|
865
|
-
|
|
864
|
+
default: $(() => [
|
|
865
|
+
M(l, {
|
|
866
866
|
"model-value": e.selectedItemsList,
|
|
867
|
-
"aria-label":
|
|
868
|
-
disabled: e.isOptionDisabled ? e.isOptionDisabled(
|
|
869
|
-
value:
|
|
870
|
-
tabindex: e.computedTabindex(
|
|
871
|
-
"onUpdate:modelValue": (
|
|
867
|
+
"aria-label": n.label,
|
|
868
|
+
disabled: e.isOptionDisabled ? e.isOptionDisabled(n) : null,
|
|
869
|
+
value: n.value,
|
|
870
|
+
tabindex: e.computedTabindex(E),
|
|
871
|
+
"onUpdate:modelValue": (C) => e.toggleCheckboxSelection(n)
|
|
872
872
|
}, null, 8, ["model-value", "aria-label", "disabled", "value", "tabindex", "onUpdate:modelValue"]),
|
|
873
|
-
|
|
873
|
+
F(e.$slots, "default", U({ ref_for: !0 }, n), () => [
|
|
874
874
|
K("span", kt, [
|
|
875
|
-
|
|
876
|
-
default:
|
|
877
|
-
z(
|
|
875
|
+
M(v, { el: "span" }, {
|
|
876
|
+
default: $(() => [
|
|
877
|
+
Y(z(n.label), 1)
|
|
878
878
|
]),
|
|
879
879
|
_: 2
|
|
880
880
|
}, 1024),
|
|
881
|
-
e.shouldShowDescription(
|
|
881
|
+
e.shouldShowDescription(n) ? (m(), D(v, {
|
|
882
882
|
key: 0,
|
|
883
883
|
class: "b-listbox-multi-select__option-description",
|
|
884
884
|
el: "span"
|
|
885
885
|
}, {
|
|
886
|
-
default:
|
|
887
|
-
z(
|
|
886
|
+
default: $(() => [
|
|
887
|
+
Y(z(n.description), 1)
|
|
888
888
|
]),
|
|
889
889
|
_: 2
|
|
890
|
-
}, 1024)) :
|
|
890
|
+
}, 1024)) : V("", !0)
|
|
891
891
|
])
|
|
892
892
|
], !0)
|
|
893
893
|
]),
|
|
@@ -898,16 +898,16 @@ function Bt(e, t, s, r, b, a) {
|
|
|
898
898
|
]);
|
|
899
899
|
}
|
|
900
900
|
const Rt = /* @__PURE__ */ q(It, [["render", Bt], ["__scopeId", "data-v-b83035ab"]]), Dt = (e) => {
|
|
901
|
-
const
|
|
902
|
-
var
|
|
903
|
-
return !!((
|
|
904
|
-
}),
|
|
905
|
-
var
|
|
906
|
-
return
|
|
901
|
+
const s = g(() => {
|
|
902
|
+
var c;
|
|
903
|
+
return !!((c = e.value) != null && c.find(({ items: r }) => !!r));
|
|
904
|
+
}), t = g(() => {
|
|
905
|
+
var c;
|
|
906
|
+
return s.value ? (c = e.value) == null ? void 0 : c.reduce((r, a) => (a.items ? r.push(...a.items.flat()) : r.push(a), r), []) : e.value;
|
|
907
907
|
});
|
|
908
908
|
return {
|
|
909
|
-
isMultiLevelSelect:
|
|
910
|
-
flattenedItemsList:
|
|
909
|
+
isMultiLevelSelect: s,
|
|
910
|
+
flattenedItemsList: t
|
|
911
911
|
};
|
|
912
912
|
}, De = {
|
|
913
913
|
"en-US": {
|
|
@@ -916,7 +916,7 @@ const Rt = /* @__PURE__ */ q(It, [["render", Bt], ["__scopeId", "data-v-b83035ab
|
|
|
916
916
|
numbersSelected: "{number} selected",
|
|
917
917
|
selectAll: "Select all ({total})"
|
|
918
918
|
}
|
|
919
|
-
}, Nt = { class: "b-listbox-multi-select" },
|
|
919
|
+
}, Nt = { class: "b-listbox-multi-select" }, Mt = { key: 0 }, Pt = {
|
|
920
920
|
key: 1,
|
|
921
921
|
class: "b-listbox-multi-select__divider"
|
|
922
922
|
}, wt = { i18n: { messages: De } }, Ut = /* @__PURE__ */ X({
|
|
@@ -932,179 +932,179 @@ const Rt = /* @__PURE__ */ q(It, [["render", Bt], ["__scopeId", "data-v-b83035ab
|
|
|
932
932
|
staticCategories: { type: Boolean, default: !1 }
|
|
933
933
|
},
|
|
934
934
|
emits: ["select"],
|
|
935
|
-
setup(e, { emit:
|
|
936
|
-
const
|
|
937
|
-
var
|
|
938
|
-
const f =
|
|
939
|
-
return { isDisabled: f, isPreSelected:
|
|
940
|
-
},
|
|
941
|
-
if (
|
|
942
|
-
return
|
|
943
|
-
const
|
|
944
|
-
const { isDisabled:
|
|
945
|
-
return
|
|
935
|
+
setup(e, { emit: s }) {
|
|
936
|
+
const t = e, c = s, { t: r } = ye({ messages: De }), a = je(), l = P(null), v = P(null), S = P(null), o = g(() => t.selectedValues.map(({ value: d }) => d)), { isMultiLevelSelect: i, flattenedItemsList: n } = Dt(Z(t, "items")), E = (d) => {
|
|
937
|
+
var T;
|
|
938
|
+
const f = t.isOptionDisabled(d), u = ((T = o.value) == null ? void 0 : T.includes(d.value)) || !1;
|
|
939
|
+
return { isDisabled: f, isPreSelected: u };
|
|
940
|
+
}, C = g(() => {
|
|
941
|
+
if (t.searching && i)
|
|
942
|
+
return t.items;
|
|
943
|
+
const d = n.value.filter((f) => {
|
|
944
|
+
const { isDisabled: u, isPreSelected: T } = E(f);
|
|
945
|
+
return u && T || !u;
|
|
946
946
|
});
|
|
947
|
-
return
|
|
948
|
-
|
|
949
|
-
}),
|
|
950
|
-
}),
|
|
947
|
+
return t.selectedValues.forEach((f) => {
|
|
948
|
+
d.find((u) => u.value === f.value) || d.push(f);
|
|
949
|
+
}), d;
|
|
950
|
+
}), L = g(
|
|
951
951
|
() => {
|
|
952
|
-
var
|
|
953
|
-
return (
|
|
954
|
-
var
|
|
955
|
-
return f.items &&
|
|
956
|
-
(
|
|
957
|
-
).length === f.items.length : (
|
|
952
|
+
var d;
|
|
953
|
+
return (d = C.value) == null ? void 0 : d.filter((f) => {
|
|
954
|
+
var u;
|
|
955
|
+
return f.items && i.value && t.searching ? f.items.filter(
|
|
956
|
+
(_) => (t.selectedValues ?? []).includes(_.value)
|
|
957
|
+
).length === f.items.length : (u = o.value) == null ? void 0 : u.includes(f.value);
|
|
958
958
|
});
|
|
959
959
|
}
|
|
960
|
-
), B = () =>
|
|
961
|
-
var
|
|
962
|
-
const
|
|
963
|
-
return
|
|
964
|
-
}),
|
|
960
|
+
), B = () => i.value && !t.searching ? n.value.length : t.items.length, p = g(() => {
|
|
961
|
+
var T;
|
|
962
|
+
const d = C.value.length, f = B(), u = ((T = L.value) == null ? void 0 : T.length) || 0;
|
|
963
|
+
return u === 0 ? r("selectAll", { total: d }) : u === f ? r("allSelected", { total: f }) : u <= f ? r("numberOfTotalSelected", { number: u, total: f }) : r("numbersSelected", { number: u });
|
|
964
|
+
}), y = (d) => {
|
|
965
|
+
const f = (T) => {
|
|
966
|
+
const { isDisabled: _, isPreSelected: j } = E(T);
|
|
967
|
+
return _ && j || !_;
|
|
968
|
+
}, u = d.filter(f).filter((T) => !o.value.includes(T.value));
|
|
969
|
+
c("select", [...t.selectedValues, ...u]);
|
|
970
|
+
}, A = (d) => {
|
|
965
971
|
const f = (_) => {
|
|
966
|
-
const { isDisabled:
|
|
967
|
-
return
|
|
968
|
-
},
|
|
969
|
-
|
|
970
|
-
}, O = (c) => {
|
|
971
|
-
const f = (E) => {
|
|
972
|
-
const { isDisabled: j, isPreSelected: We } = h(E);
|
|
973
|
-
return !(j && We);
|
|
974
|
-
}, i = c.filter(f).map(({ value: E }) => E), _ = s.selectedValues.filter((E) => !(i != null && i.includes(E.value)));
|
|
975
|
-
r("select", _);
|
|
972
|
+
const { isDisabled: j, isPreSelected: Ve } = E(_);
|
|
973
|
+
return !(j && Ve);
|
|
974
|
+
}, u = d.filter(f).map(({ value: _ }) => _), T = t.selectedValues.filter((_) => !(u != null && u.includes(_.value)));
|
|
975
|
+
c("select", T);
|
|
976
976
|
}, R = () => {
|
|
977
|
-
|
|
978
|
-
},
|
|
979
|
-
|
|
980
|
-
}, { isAllSelected:
|
|
981
|
-
k,
|
|
977
|
+
y(n.value);
|
|
978
|
+
}, h = () => {
|
|
979
|
+
A(n.value);
|
|
980
|
+
}, { isAllSelected: I, isIndeterminate: x, toggleSelectAll: te } = Be(
|
|
982
981
|
L,
|
|
982
|
+
C,
|
|
983
983
|
R,
|
|
984
|
-
|
|
985
|
-
), me = (
|
|
986
|
-
|
|
987
|
-
}, ue = (
|
|
988
|
-
|
|
989
|
-
}, J = (
|
|
990
|
-
let
|
|
991
|
-
const
|
|
992
|
-
|
|
993
|
-
}, w =
|
|
994
|
-
if (!
|
|
995
|
-
return
|
|
996
|
-
const
|
|
997
|
-
return
|
|
998
|
-
(
|
|
999
|
-
).filter((
|
|
1000
|
-
}),
|
|
1001
|
-
var
|
|
1002
|
-
const
|
|
1003
|
-
return
|
|
1004
|
-
}), Ce =
|
|
984
|
+
h
|
|
985
|
+
), me = (d) => {
|
|
986
|
+
y(d.items);
|
|
987
|
+
}, ue = (d) => {
|
|
988
|
+
A(d.items);
|
|
989
|
+
}, J = (d, f) => {
|
|
990
|
+
let u = !1;
|
|
991
|
+
const T = t.selectedValues.filter(({ value: _ }) => f.value === _ ? (u = !0, !1) : !0);
|
|
992
|
+
u || T.push(f), c(d, T);
|
|
993
|
+
}, w = g(() => {
|
|
994
|
+
if (!i.value)
|
|
995
|
+
return t.selectedValues;
|
|
996
|
+
const d = (_) => o.value.includes(_.value), f = (_) => !t.staticCategories && _.every((j) => d(j));
|
|
997
|
+
return t.items.flatMap(
|
|
998
|
+
(_) => _.items && !f(_.items) ? _.items : _
|
|
999
|
+
).filter((_) => _.items ? !0 : d(_));
|
|
1000
|
+
}), ie = g(() => {
|
|
1001
|
+
var u, T, _, j;
|
|
1002
|
+
const d = ["automatic", "button"].includes(t.lazyLoadType), f = ((u = t.selectedValues) == null ? void 0 : u.length) > 0 && ((T = L.value) == null ? void 0 : T.length) !== ((_ = n.value) == null ? void 0 : _.length);
|
|
1003
|
+
return d && t.hasMoreItems ? !!((j = t.selectedValues) != null && j.length) : f;
|
|
1004
|
+
}), Ce = g(() => ["automatic", "button"].includes(t.lazyLoadType) ? !t.hasMoreItems : !0), Ne = g(
|
|
1005
1005
|
() => l.value ? [l.value] : []
|
|
1006
|
-
),
|
|
1006
|
+
), Me = g(
|
|
1007
1007
|
() => {
|
|
1008
|
-
var
|
|
1009
|
-
return (f = (
|
|
1008
|
+
var d, f;
|
|
1009
|
+
return (f = (d = S.value) == null ? void 0 : d.$children) != null && f.length ? S.value.$children : [];
|
|
1010
1010
|
}
|
|
1011
|
-
),
|
|
1012
|
-
var
|
|
1013
|
-
const f = [...Ne.value, ...
|
|
1014
|
-
|
|
1011
|
+
), Pe = g(() => ({ label: p, value: I })), we = g(() => [Pe, ...Z(t, "items").value]), Ue = (d) => {
|
|
1012
|
+
var T;
|
|
1013
|
+
const f = [...Ne.value, ...Me.value], u = f[d].$el;
|
|
1014
|
+
u.tagName === "LABEL" ? u.focus() : (T = u.querySelector("label")) == null || T.focus(), f[d].$el.focus();
|
|
1015
1015
|
}, {
|
|
1016
|
-
moveToNextElement:
|
|
1017
|
-
moveToPreviousElement:
|
|
1018
|
-
moveToFirstElement:
|
|
1019
|
-
moveToLastElement:
|
|
1016
|
+
moveToNextElement: xe,
|
|
1017
|
+
moveToPreviousElement: Ge,
|
|
1018
|
+
moveToFirstElement: ze,
|
|
1019
|
+
moveToLastElement: Ye,
|
|
1020
1020
|
preventDefault: he,
|
|
1021
1021
|
focusedIndex: Ee
|
|
1022
1022
|
} = Re(
|
|
1023
1023
|
{
|
|
1024
|
-
items:
|
|
1025
|
-
isOptionDisabled:
|
|
1026
|
-
hasStaticCategories: Z(
|
|
1024
|
+
items: P(we),
|
|
1025
|
+
isOptionDisabled: t.isOptionDisabled,
|
|
1026
|
+
hasStaticCategories: Z(t, "staticCategories")
|
|
1027
1027
|
},
|
|
1028
1028
|
Ue
|
|
1029
|
-
),
|
|
1030
|
-
[
|
|
1031
|
-
[
|
|
1032
|
-
[
|
|
1033
|
-
[
|
|
1034
|
-
},
|
|
1035
|
-
[
|
|
1036
|
-
[
|
|
1029
|
+
), Fe = {
|
|
1030
|
+
[G.ARROW_UP]: (d) => Ge(d),
|
|
1031
|
+
[G.ARROW_DOWN]: (d) => xe(d),
|
|
1032
|
+
[G.HOME]: ze,
|
|
1033
|
+
[G.END]: Ye
|
|
1034
|
+
}, We = {
|
|
1035
|
+
[G.ARROW_UP]: he,
|
|
1036
|
+
[G.ARROW_DOWN]: he
|
|
1037
1037
|
};
|
|
1038
|
-
return (
|
|
1039
|
-
|
|
1040
|
-
oe((
|
|
1041
|
-
(
|
|
1042
|
-
key:
|
|
1038
|
+
return (d, f) => (m(), O("div", Nt, [
|
|
1039
|
+
ie.value ? (m(), O("div", Mt, [
|
|
1040
|
+
oe((m(), O("ul", U({ class: "b-listbox-multi-select__chips" }, Q(We, !0)), [
|
|
1041
|
+
(m(!0), O(ee, null, W(w.value, (u) => (m(), O("li", {
|
|
1042
|
+
key: u.value
|
|
1043
1043
|
}, [
|
|
1044
|
-
|
|
1044
|
+
M(N(Qe), {
|
|
1045
1045
|
ref_for: !0,
|
|
1046
1046
|
ref_key: "selectedListboxItemsRef",
|
|
1047
|
-
ref:
|
|
1048
|
-
disabled:
|
|
1049
|
-
label:
|
|
1047
|
+
ref: v,
|
|
1048
|
+
disabled: d.isOptionDisabled(u),
|
|
1049
|
+
label: u.label,
|
|
1050
1050
|
condensed: "",
|
|
1051
|
-
onClick: (
|
|
1051
|
+
onClick: (T) => u.items ? ue(u) : J("select", u)
|
|
1052
1052
|
}, null, 8, ["disabled", "label", "onClick"])
|
|
1053
1053
|
]))), 128))
|
|
1054
1054
|
], 16)), [
|
|
1055
1055
|
[N(de)]
|
|
1056
1056
|
]),
|
|
1057
1057
|
f[4] || (f[4] = K("hr", { class: "b-listbox-multi-select__divider" }, null, -1))
|
|
1058
|
-
])) :
|
|
1059
|
-
oe((
|
|
1060
|
-
Ce.value ? (
|
|
1058
|
+
])) : V("", !0),
|
|
1059
|
+
oe((m(), O("div", Q(Fe, !0), [
|
|
1060
|
+
Ce.value ? (m(), D(N(be), {
|
|
1061
1061
|
key: 0,
|
|
1062
1062
|
ref_key: "selectAllListboxItemsRef",
|
|
1063
1063
|
ref: l,
|
|
1064
1064
|
class: "b-listbox-multi-select__option"
|
|
1065
1065
|
}, {
|
|
1066
|
-
default:
|
|
1067
|
-
|
|
1068
|
-
"aria-label":
|
|
1069
|
-
"model-value": N(
|
|
1070
|
-
indeterminate: N(
|
|
1066
|
+
default: $(() => [
|
|
1067
|
+
M(N(Se), {
|
|
1068
|
+
"aria-label": p.value,
|
|
1069
|
+
"model-value": N(I),
|
|
1070
|
+
indeterminate: N(x),
|
|
1071
1071
|
tabindex: N(Ee) === 0 ? 0 : -1,
|
|
1072
1072
|
"onUpdate:modelValue": N(te)
|
|
1073
1073
|
}, null, 8, ["aria-label", "model-value", "indeterminate", "tabindex", "onUpdate:modelValue"]),
|
|
1074
|
-
|
|
1074
|
+
M(N(ne), {
|
|
1075
1075
|
el: "span",
|
|
1076
1076
|
"aria-hidden": "true"
|
|
1077
1077
|
}, {
|
|
1078
|
-
default:
|
|
1079
|
-
z(
|
|
1078
|
+
default: $(() => [
|
|
1079
|
+
Y(z(p.value), 1)
|
|
1080
1080
|
]),
|
|
1081
1081
|
_: 1
|
|
1082
1082
|
})
|
|
1083
1083
|
]),
|
|
1084
1084
|
_: 1
|
|
1085
|
-
}, 512)) :
|
|
1086
|
-
Ce.value ? (
|
|
1087
|
-
|
|
1085
|
+
}, 512)) : V("", !0),
|
|
1086
|
+
Ce.value ? (m(), O("hr", Pt)) : V("", !0),
|
|
1087
|
+
M(N(Rt), {
|
|
1088
1088
|
ref_key: "listboxItemsRef",
|
|
1089
|
-
ref:
|
|
1090
|
-
items:
|
|
1091
|
-
"is-option-disabled":
|
|
1092
|
-
"is-multi-level": N(
|
|
1093
|
-
"static-categories":
|
|
1094
|
-
searching:
|
|
1095
|
-
"selected-items-list":
|
|
1089
|
+
ref: S,
|
|
1090
|
+
items: d.items,
|
|
1091
|
+
"is-option-disabled": d.isOptionDisabled,
|
|
1092
|
+
"is-multi-level": N(i),
|
|
1093
|
+
"static-categories": d.staticCategories,
|
|
1094
|
+
searching: d.searching,
|
|
1095
|
+
"selected-items-list": o.value,
|
|
1096
1096
|
"focused-index": N(Ee),
|
|
1097
|
-
onToggleCheckboxSelection: f[0] || (f[0] = (
|
|
1097
|
+
onToggleCheckboxSelection: f[0] || (f[0] = (u) => J("select", u)),
|
|
1098
1098
|
onSelectCategory: me,
|
|
1099
1099
|
onUnselectCategory: ue,
|
|
1100
|
-
onSpacePressed: f[1] || (f[1] = (
|
|
1101
|
-
onTabPressed: f[2] || (f[2] = (
|
|
1102
|
-
onEnterPressed: f[3] || (f[3] = (
|
|
1100
|
+
onSpacePressed: f[1] || (f[1] = (u) => J(N(b).SPACE, u)),
|
|
1101
|
+
onTabPressed: f[2] || (f[2] = (u) => J(N(b).TAB, u)),
|
|
1102
|
+
onEnterPressed: f[3] || (f[3] = (u) => J(N(b).ENTER, u))
|
|
1103
1103
|
}, ce({ _: 2 }, [
|
|
1104
|
-
|
|
1105
|
-
name:
|
|
1106
|
-
fn:
|
|
1107
|
-
|
|
1104
|
+
W(N(a), (u, T) => ({
|
|
1105
|
+
name: T,
|
|
1106
|
+
fn: $((_) => [
|
|
1107
|
+
F(d.$slots, T, le(re(_)), void 0, !0)
|
|
1108
1108
|
])
|
|
1109
1109
|
}))
|
|
1110
1110
|
]), 1032, ["items", "is-option-disabled", "is-multi-level", "static-categories", "searching", "selected-items-list", "focused-index"])
|
|
@@ -1113,7 +1113,7 @@ const Rt = /* @__PURE__ */ q(It, [["render", Bt], ["__scopeId", "data-v-b83035ab
|
|
|
1113
1113
|
])
|
|
1114
1114
|
]));
|
|
1115
1115
|
}
|
|
1116
|
-
}),
|
|
1116
|
+
}), Oe = /* @__PURE__ */ q(Ut, [["__scopeId", "data-v-98a72a10"]]), Le = {
|
|
1117
1117
|
"en-US": {
|
|
1118
1118
|
loading: "Loading",
|
|
1119
1119
|
showMore: "Show more"
|
|
@@ -1126,18 +1126,18 @@ const Rt = /* @__PURE__ */ q(It, [["render", Bt], ["__scopeId", "data-v-b83035ab
|
|
|
1126
1126
|
loading: "Carregando",
|
|
1127
1127
|
showMore: "Mostrar mais"
|
|
1128
1128
|
}
|
|
1129
|
-
},
|
|
1129
|
+
}, xt = 36, Gt = X({
|
|
1130
1130
|
name: "bento-listbox",
|
|
1131
1131
|
components: {
|
|
1132
1132
|
BentoEmptyState: Je,
|
|
1133
1133
|
BentoListboxSingleSelect: Et,
|
|
1134
|
-
BentoListboxMultiSelect:
|
|
1134
|
+
BentoListboxMultiSelect: Oe,
|
|
1135
1135
|
BentoTypography: ne,
|
|
1136
1136
|
BentoLoadingIndicator: Xe,
|
|
1137
1137
|
BentoLoadingButton: st
|
|
1138
1138
|
},
|
|
1139
1139
|
directives: { BentoKeyboardNavigationDirective: de },
|
|
1140
|
-
i18n: { messages:
|
|
1140
|
+
i18n: { messages: Le },
|
|
1141
1141
|
props: {
|
|
1142
1142
|
/**
|
|
1143
1143
|
* Defines a string value that labels an interactive element.
|
|
@@ -1218,7 +1218,7 @@ const Rt = /* @__PURE__ */ q(It, [["render", Bt], ["__scopeId", "data-v-b83035ab
|
|
|
1218
1218
|
*
|
|
1219
1219
|
* If enabled, hides the "Select all" checkbox in "multiple" mode.
|
|
1220
1220
|
*/
|
|
1221
|
-
searching:
|
|
1221
|
+
searching: Oe.props.searching,
|
|
1222
1222
|
/**
|
|
1223
1223
|
* The `input` value.
|
|
1224
1224
|
* Providing an empty string or empty array will select no options.
|
|
@@ -1238,106 +1238,106 @@ const Rt = /* @__PURE__ */ q(It, [["render", Bt], ["__scopeId", "data-v-b83035ab
|
|
|
1238
1238
|
}
|
|
1239
1239
|
},
|
|
1240
1240
|
emits: [
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1241
|
+
b.SELECT,
|
|
1242
|
+
b.SPACE,
|
|
1243
|
+
b.SHOW_MORE,
|
|
1244
|
+
b.ENTER,
|
|
1245
|
+
b.ESCAPE,
|
|
1246
|
+
b.TAB
|
|
1247
1247
|
],
|
|
1248
|
-
setup(e, { emit:
|
|
1249
|
-
const
|
|
1248
|
+
setup(e, { emit: s, slots: t }) {
|
|
1249
|
+
const c = P([]), r = Z(e, "items"), { t: a } = ye({ messages: Le }), l = g(() => e.lazyLoadType !== se.AUTOMATIC), v = g(() => e.lazyLoadType === se.AUTOMATIC), S = () => {
|
|
1250
1250
|
var w;
|
|
1251
|
-
return typeof (e == null ? void 0 : e.virtualScroll) == "object" && ((w = e == null ? void 0 : e.virtualScroll) != null && w.itemHeight) ? e.virtualScroll.itemHeight :
|
|
1251
|
+
return typeof (e == null ? void 0 : e.virtualScroll) == "object" && ((w = e == null ? void 0 : e.virtualScroll) != null && w.itemHeight) ? e.virtualScroll.itemHeight : xt;
|
|
1252
1252
|
}, {
|
|
1253
|
-
containerRef:
|
|
1254
|
-
containerProps:
|
|
1255
|
-
onScroll:
|
|
1256
|
-
list:
|
|
1257
|
-
wrapperProps:
|
|
1258
|
-
} = ot(
|
|
1259
|
-
itemHeight:
|
|
1253
|
+
containerRef: o,
|
|
1254
|
+
containerProps: i,
|
|
1255
|
+
onScroll: n,
|
|
1256
|
+
list: E,
|
|
1257
|
+
wrapperProps: C
|
|
1258
|
+
} = ot(r, {
|
|
1259
|
+
itemHeight: S(),
|
|
1260
1260
|
// Disable virtual scrolling if not enabled or if lazy loading is enabled or if multi-select
|
|
1261
1261
|
disabled: (e == null ? void 0 : e.multiple) || (e == null ? void 0 : e.virtualScroll) === !1 || (e == null ? void 0 : e.lazyLoadType) !== "none"
|
|
1262
|
-
}),
|
|
1262
|
+
}), L = g(
|
|
1263
1263
|
() => e.componentLoading !== void 0 || l.value ? "true" : void 0
|
|
1264
|
-
), B =
|
|
1264
|
+
), B = g(
|
|
1265
1265
|
() => l.value && e.loading || e.componentLoading ? "true" : "false"
|
|
1266
|
-
),
|
|
1266
|
+
), p = g(
|
|
1267
1267
|
() => l.value || e.componentLoading !== void 0 ? "polite" : void 0
|
|
1268
|
-
),
|
|
1269
|
-
|
|
1270
|
-
},
|
|
1271
|
-
|
|
1268
|
+
), y = (w) => (ie) => {
|
|
1269
|
+
s(w, ie);
|
|
1270
|
+
}, A = () => {
|
|
1271
|
+
s(b.SHOW_MORE);
|
|
1272
1272
|
}, R = Ze(() => {
|
|
1273
|
-
const w =
|
|
1273
|
+
const w = o.value;
|
|
1274
1274
|
if (!w)
|
|
1275
1275
|
return;
|
|
1276
|
-
const
|
|
1277
|
-
e.hasMoreItems &&
|
|
1278
|
-
}),
|
|
1279
|
-
|
|
1280
|
-
},
|
|
1276
|
+
const ie = Math.round(w.scrollTop) + w.clientHeight >= w.scrollHeight;
|
|
1277
|
+
e.hasMoreItems && ie && !e.loading && A();
|
|
1278
|
+
}), h = () => {
|
|
1279
|
+
v.value ? R() : n();
|
|
1280
|
+
}, I = g(() => {
|
|
1281
1281
|
var w;
|
|
1282
1282
|
return ((w = e.items) == null ? void 0 : w.length) === 0;
|
|
1283
|
-
}),
|
|
1283
|
+
}), x = g(
|
|
1284
1284
|
() => e.lazyLoadType === se.BUTTON && e.hasMoreItems
|
|
1285
|
-
), te =
|
|
1285
|
+
), te = g(
|
|
1286
1286
|
() => e.loading ? _e.LOADING : _e.START
|
|
1287
|
-
), me =
|
|
1287
|
+
), me = g(() => e.loading ? a("loading") : a("showMore")), ue = g(() => ({
|
|
1288
1288
|
...e.emptyState,
|
|
1289
1289
|
variant: "condensed"
|
|
1290
1290
|
})), J = {
|
|
1291
|
-
[
|
|
1292
|
-
[
|
|
1293
|
-
[
|
|
1294
|
-
[
|
|
1291
|
+
[b.SELECT]: y(b.SELECT),
|
|
1292
|
+
[b.SPACE]: y(b.SPACE),
|
|
1293
|
+
[b.TAB]: y(b.TAB),
|
|
1294
|
+
[b.ENTER]: y(b.ENTER)
|
|
1295
1295
|
};
|
|
1296
1296
|
return {
|
|
1297
1297
|
// Refs
|
|
1298
|
-
listboxRef:
|
|
1299
|
-
listboxItemRef:
|
|
1298
|
+
listboxRef: o,
|
|
1299
|
+
listboxItemRef: c,
|
|
1300
1300
|
// a11y
|
|
1301
|
-
ariaAtomic:
|
|
1301
|
+
ariaAtomic: L,
|
|
1302
1302
|
ariaBusy: B,
|
|
1303
|
-
ariaLive:
|
|
1303
|
+
ariaLive: p,
|
|
1304
1304
|
// Values
|
|
1305
|
-
containerProps:
|
|
1306
|
-
isSearchResultEmpty:
|
|
1305
|
+
containerProps: i,
|
|
1306
|
+
isSearchResultEmpty: I,
|
|
1307
1307
|
limitedEmptyStateProps: ue,
|
|
1308
1308
|
loadingButtonState: te,
|
|
1309
|
-
slots:
|
|
1310
|
-
shouldDisplayShowMoreButton:
|
|
1309
|
+
slots: t,
|
|
1310
|
+
shouldDisplayShowMoreButton: x,
|
|
1311
1311
|
showMoreButtonText: me,
|
|
1312
|
-
virtualisedItems:
|
|
1313
|
-
wrapperProps:
|
|
1312
|
+
virtualisedItems: E,
|
|
1313
|
+
wrapperProps: C,
|
|
1314
1314
|
// Enums
|
|
1315
|
-
BentoKeyboardNavigationKeyDownEvent:
|
|
1316
|
-
BentoListboxEvent:
|
|
1315
|
+
BentoKeyboardNavigationKeyDownEvent: G,
|
|
1316
|
+
BentoListboxEvent: b,
|
|
1317
1317
|
// Methods
|
|
1318
|
-
onListboxContainerScroll:
|
|
1319
|
-
onOptionSelected:
|
|
1320
|
-
emitShowMore:
|
|
1318
|
+
onListboxContainerScroll: h,
|
|
1319
|
+
onOptionSelected: y,
|
|
1320
|
+
emitShowMore: A,
|
|
1321
1321
|
listboxListeners: J
|
|
1322
1322
|
};
|
|
1323
1323
|
}
|
|
1324
|
-
}),
|
|
1324
|
+
}), zt = ["id", "aria-busy", "aria-atomic", "aria-label", "aria-live"], Yt = {
|
|
1325
1325
|
key: 0,
|
|
1326
1326
|
class: "b-listbox__loading-filtered-items"
|
|
1327
|
-
},
|
|
1327
|
+
}, Ft = {
|
|
1328
1328
|
key: 1,
|
|
1329
1329
|
class: "b-listbox__empty-search-message"
|
|
1330
|
-
},
|
|
1330
|
+
}, Wt = {
|
|
1331
1331
|
key: 2,
|
|
1332
1332
|
class: "b-listbox__lazy-load"
|
|
1333
|
-
},
|
|
1333
|
+
}, Vt = {
|
|
1334
1334
|
key: 3,
|
|
1335
1335
|
class: "b-listbox__lazy-load"
|
|
1336
1336
|
};
|
|
1337
|
-
function Kt(e, t,
|
|
1338
|
-
var
|
|
1339
|
-
const l =
|
|
1340
|
-
return oe((
|
|
1337
|
+
function Kt(e, s, t, c, r, a) {
|
|
1338
|
+
var C;
|
|
1339
|
+
const l = k("bento-loading-indicator"), v = k("bento-empty-state"), S = k("bento-typography"), o = k("bento-listbox-multi-select"), i = k("bento-listbox-single-select"), n = k("bento-loading-button"), E = ke("bento-keyboard-navigation-directive");
|
|
1340
|
+
return oe((m(), O("div", {
|
|
1341
1341
|
id: e.id,
|
|
1342
1342
|
ref: "listboxRef",
|
|
1343
1343
|
class: "b-listbox",
|
|
@@ -1347,24 +1347,24 @@ function Kt(e, t, s, r, b, a) {
|
|
|
1347
1347
|
"aria-atomic": e.ariaAtomic,
|
|
1348
1348
|
"aria-label": e.ariaLabel,
|
|
1349
1349
|
"aria-live": e.ariaLive,
|
|
1350
|
-
style: He((
|
|
1351
|
-
onScroll:
|
|
1350
|
+
style: He((C = e.containerProps) == null ? void 0 : C.style),
|
|
1351
|
+
onScroll: s[0] || (s[0] = (...L) => e.onListboxContainerScroll && e.onListboxContainerScroll(...L))
|
|
1352
1352
|
}, [
|
|
1353
1353
|
K("div", le(re(e.wrapperProps)), [
|
|
1354
|
-
e.componentLoading ? (
|
|
1355
|
-
|
|
1356
|
-
])) : e.isSearchResultEmpty ? (
|
|
1357
|
-
e.emptyState ? (
|
|
1354
|
+
e.componentLoading ? (m(), O("div", Yt, [
|
|
1355
|
+
M(l)
|
|
1356
|
+
])) : e.isSearchResultEmpty ? (m(), O("div", Ft, [
|
|
1357
|
+
e.emptyState ? (m(), D(v, le(U({ key: 0 }, e.limitedEmptyStateProps)), null, 16)) : (m(), D(S, {
|
|
1358
1358
|
key: 1,
|
|
1359
1359
|
el: "span"
|
|
1360
1360
|
}, {
|
|
1361
|
-
default:
|
|
1362
|
-
z(
|
|
1361
|
+
default: $(() => [
|
|
1362
|
+
Y(z(e.noResultsMessage), 1)
|
|
1363
1363
|
]),
|
|
1364
1364
|
_: 1
|
|
1365
1365
|
}))
|
|
1366
|
-
])) : (
|
|
1367
|
-
e.multiple ? (
|
|
1366
|
+
])) : (m(), O(ee, { key: 2 }, [
|
|
1367
|
+
e.multiple ? (m(), D(o, U({
|
|
1368
1368
|
key: 0,
|
|
1369
1369
|
ref: "listboxItemRef",
|
|
1370
1370
|
"has-more-items": e.hasMoreItems,
|
|
@@ -1375,13 +1375,13 @@ function Kt(e, t, s, r, b, a) {
|
|
|
1375
1375
|
searching: e.searching,
|
|
1376
1376
|
"is-option-disabled": e.isOptionDisabled
|
|
1377
1377
|
}, Q(e.listboxListeners)), ce({ _: 2 }, [
|
|
1378
|
-
|
|
1378
|
+
W(e.slots, (L, B) => ({
|
|
1379
1379
|
name: B,
|
|
1380
|
-
fn:
|
|
1381
|
-
|
|
1380
|
+
fn: $((p) => [
|
|
1381
|
+
F(e.$slots, B, le(re(p)), void 0, !0)
|
|
1382
1382
|
])
|
|
1383
1383
|
}))
|
|
1384
|
-
]), 1040, ["has-more-items", "items", "lazy-load-type", "static-categories", "selected-values", "searching", "is-option-disabled"])) : (
|
|
1384
|
+
]), 1040, ["has-more-items", "items", "lazy-load-type", "static-categories", "selected-values", "searching", "is-option-disabled"])) : (m(), D(i, U({
|
|
1385
1385
|
key: 1,
|
|
1386
1386
|
ref: "listboxItemRef",
|
|
1387
1387
|
items: e.virtualisedItems,
|
|
@@ -1389,87 +1389,93 @@ function Kt(e, t, s, r, b, a) {
|
|
|
1389
1389
|
"static-categories": e.staticCategories,
|
|
1390
1390
|
"is-option-disabled": e.isOptionDisabled
|
|
1391
1391
|
}, Q(e.listboxListeners)), ce({ _: 2 }, [
|
|
1392
|
-
|
|
1392
|
+
W(e.slots, (L, B) => ({
|
|
1393
1393
|
name: B,
|
|
1394
|
-
fn:
|
|
1395
|
-
|
|
1394
|
+
fn: $((p) => [
|
|
1395
|
+
F(e.$slots, B, le(re(p)), void 0, !0)
|
|
1396
1396
|
])
|
|
1397
1397
|
}))
|
|
1398
1398
|
]), 1040, ["items", "selected-value", "static-categories", "is-option-disabled"])),
|
|
1399
|
-
e.shouldDisplayShowMoreButton ? (
|
|
1400
|
-
|
|
1399
|
+
e.shouldDisplayShowMoreButton ? (m(), O("div", Wt, [
|
|
1400
|
+
M(n, {
|
|
1401
1401
|
state: e.loadingButtonState,
|
|
1402
1402
|
variant: "secondary",
|
|
1403
1403
|
onClickCapture: e.emitShowMore
|
|
1404
1404
|
}, {
|
|
1405
|
-
default:
|
|
1406
|
-
z(
|
|
1405
|
+
default: $(() => [
|
|
1406
|
+
Y(z(e.showMoreButtonText), 1)
|
|
1407
1407
|
]),
|
|
1408
1408
|
_: 1
|
|
1409
1409
|
}, 8, ["state", "onClickCapture"])
|
|
1410
|
-
])) : e.loading ? (
|
|
1411
|
-
|
|
1412
|
-
])) :
|
|
1410
|
+
])) : e.loading ? (m(), O("div", Vt, [
|
|
1411
|
+
M(l)
|
|
1412
|
+
])) : V("", !0)
|
|
1413
1413
|
], 64))
|
|
1414
1414
|
], 16)
|
|
1415
|
-
], 44,
|
|
1416
|
-
[
|
|
1415
|
+
], 44, zt)), [
|
|
1416
|
+
[E]
|
|
1417
1417
|
]);
|
|
1418
1418
|
}
|
|
1419
|
-
const
|
|
1420
|
-
for (const
|
|
1421
|
-
if (
|
|
1422
|
-
return
|
|
1423
|
-
if (
|
|
1424
|
-
const
|
|
1425
|
-
if (
|
|
1426
|
-
return
|
|
1419
|
+
const cs = /* @__PURE__ */ q(Gt, [["render", Kt], ["__scopeId", "data-v-7b74fe4e"]]), pe = (e, s) => {
|
|
1420
|
+
for (const t of e) {
|
|
1421
|
+
if (t.value === s)
|
|
1422
|
+
return t;
|
|
1423
|
+
if (t.items) {
|
|
1424
|
+
const c = pe(t.items, s);
|
|
1425
|
+
if (c)
|
|
1426
|
+
return c;
|
|
1427
1427
|
}
|
|
1428
1428
|
}
|
|
1429
1429
|
return null;
|
|
1430
|
-
},
|
|
1431
|
-
const r =
|
|
1432
|
-
|
|
1433
|
-
},
|
|
1434
|
-
|
|
1435
|
-
},
|
|
1436
|
-
r.value =
|
|
1430
|
+
}, qt = (e) => typeof e == "object" && e !== null && "value" in e && "label" in e, us = (e, s, t, c) => {
|
|
1431
|
+
const r = P([]), a = P(), l = (i) => {
|
|
1432
|
+
t.value ? a.value = i.map(({ value: n }) => n) : a.value = i.length > 0 ? i[0].value : null;
|
|
1433
|
+
}, v = (i) => {
|
|
1434
|
+
t.value ? a.value = i.map(({ value: n, label: E }) => ({ value: n, label: E })) : a.value = i.length > 0 ? { value: i[0].value, label: i[0].label } : null;
|
|
1435
|
+
}, S = (i) => {
|
|
1436
|
+
r.value = i, c != null && c.value ? v(i) : l(i);
|
|
1437
|
+
}, o = () => {
|
|
1438
|
+
r.value = [], a.value = null;
|
|
1437
1439
|
};
|
|
1438
1440
|
return Ie(
|
|
1439
|
-
() =>
|
|
1441
|
+
() => s.value,
|
|
1440
1442
|
() => {
|
|
1441
|
-
if (!
|
|
1442
|
-
|
|
1443
|
+
if (!s.value && s.value !== 0) {
|
|
1444
|
+
o();
|
|
1443
1445
|
return;
|
|
1444
1446
|
}
|
|
1445
|
-
const
|
|
1446
|
-
|
|
1447
|
-
const
|
|
1448
|
-
|
|
1449
|
-
|
|
1447
|
+
const i = !Array.isArray(s.value), n = [...r.value];
|
|
1448
|
+
o();
|
|
1449
|
+
const E = (C) => {
|
|
1450
|
+
if (qt(C))
|
|
1451
|
+
r.value.push(C);
|
|
1452
|
+
else {
|
|
1453
|
+
let L = pe(e.value, C);
|
|
1454
|
+
L || (L = pe(n, C)), L || (L = { value: C, label: C.toString() }), r.value.push(L);
|
|
1455
|
+
}
|
|
1450
1456
|
};
|
|
1451
|
-
if (
|
|
1452
|
-
const
|
|
1453
|
-
|
|
1457
|
+
if (i) {
|
|
1458
|
+
const C = s.value;
|
|
1459
|
+
E(C), c != null && c.value ? v(r.value) : l(r.value);
|
|
1454
1460
|
return;
|
|
1455
1461
|
}
|
|
1456
|
-
|
|
1462
|
+
s.value.forEach(E), c != null && c.value ? v(r.value) : l(r.value);
|
|
1457
1463
|
},
|
|
1458
1464
|
{ immediate: !0 }
|
|
1459
1465
|
), {
|
|
1460
1466
|
// Values
|
|
1461
1467
|
cachedSelectedListboxOptions: r,
|
|
1462
|
-
cachedListboxSelectedValues:
|
|
1468
|
+
cachedListboxSelectedValues: a,
|
|
1463
1469
|
// Methods
|
|
1464
|
-
resetCache:
|
|
1465
|
-
setCachedValues:
|
|
1470
|
+
resetCache: o,
|
|
1471
|
+
setCachedValues: S
|
|
1466
1472
|
};
|
|
1467
1473
|
};
|
|
1468
1474
|
export {
|
|
1469
1475
|
se as B,
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1476
|
+
b as a,
|
|
1477
|
+
cs as b,
|
|
1478
|
+
us as c,
|
|
1473
1479
|
Dt as u
|
|
1474
1480
|
};
|
|
1475
|
-
//# sourceMappingURL=use-cached-selected-values.
|
|
1481
|
+
//# sourceMappingURL=use-cached-selected-values.CRwxKmxX.js.map
|