@adyen/bento-vue2 1.54.2 → 1.55.1
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 +20 -2
- 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/copy.css +1 -1
- package/dist/assets/dashboard-section.css +1 -1
- package/dist/assets/data-grid-template.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown-default-textbox.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/focus-trap.css +1 -1
- package/dist/assets/input-field-phone-number.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/link.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/popper-container.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/tabs.css +1 -1
- package/dist/assets/teleport.css +1 -1
- package/dist/assets/use-cached-selected-values.css +1 -1
- package/dist/button.js +3 -3
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{action-bar.CH1Mswou.js → action-bar.DQ1JoKzt.js} +5 -5
- package/dist/chunks/{action-bar.CH1Mswou.js.map → action-bar.DQ1JoKzt.js.map} +1 -1
- package/dist/chunks/{alert.BkMKX9wD.js → alert.C5Y5RBx9.js} +2 -2
- package/dist/chunks/{alert.BkMKX9wD.js.map → alert.C5Y5RBx9.js.map} +1 -1
- package/dist/chunks/{base-modal.B4TNcOz9.js → base-modal.CEHMcrwC.js} +15 -15
- package/dist/chunks/{base-modal.B4TNcOz9.js.map → base-modal.CEHMcrwC.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.mqNecwDb.js → button-actions-with-menu.BehknT6F.js} +4 -4
- package/dist/chunks/{button-actions-with-menu.mqNecwDb.js.map → button-actions-with-menu.BehknT6F.js.map} +1 -1
- package/dist/chunks/{button-actions.XlUhz42n.js → button-actions.C5Dp4DeK.js} +2 -2
- package/dist/chunks/{button-actions.XlUhz42n.js.map → button-actions.C5Dp4DeK.js.map} +1 -1
- package/dist/chunks/{button.D-3uUhuG.js → button.DUApwEu1.js} +2 -2
- package/dist/chunks/button.DUApwEu1.js.map +1 -0
- package/dist/chunks/{calendar.D4dMXwc0.js → calendar.C9bRwE-l.js} +2 -2
- package/dist/chunks/calendar.C9bRwE-l.js.map +1 -0
- package/dist/chunks/{card.BT04hjvV.js → card.Ba5Jqezr.js} +2 -2
- package/dist/chunks/{card.BT04hjvV.js.map → card.Ba5Jqezr.js.map} +1 -1
- package/dist/chunks/{checkbox-group.DZF4UIym.js → checkbox-group.COqNevz5.js} +4 -4
- package/dist/chunks/{checkbox-group.DZF4UIym.js.map → checkbox-group.COqNevz5.js.map} +1 -1
- package/dist/chunks/{checkbox.DloQJI-K.js → checkbox.LFeWM5p4.js} +3 -3
- package/dist/chunks/{checkbox.DloQJI-K.js.map → checkbox.LFeWM5p4.js.map} +1 -1
- package/dist/chunks/{code-snippet.eHqicJXk.js → code-snippet.Q1HB3T_K.js} +6 -6
- package/dist/chunks/{code-snippet.eHqicJXk.js.map → code-snippet.Q1HB3T_K.js.map} +1 -1
- package/dist/chunks/{controls-group.C-HKhH1m.js → controls-group.B-JUz-ir.js} +2 -2
- package/dist/chunks/{controls-group.C-HKhH1m.js.map → controls-group.B-JUz-ir.js.map} +1 -1
- package/dist/chunks/{copy.k18tXmP1.js → copy.C7gFAgeL.js} +9 -9
- package/dist/chunks/{copy.k18tXmP1.js.map → copy.C7gFAgeL.js.map} +1 -1
- package/dist/chunks/{dashboard-section.DlIwNKkx.js → dashboard-section.Cn7UfGjF.js} +47 -50
- package/dist/chunks/dashboard-section.Cn7UfGjF.js.map +1 -0
- package/dist/chunks/{dashed-underline.BbQIbZfu.js → dashed-underline.0K0Xbu6k.js} +3 -3
- package/dist/chunks/{dashed-underline.BbQIbZfu.js.map → dashed-underline.0K0Xbu6k.js.map} +1 -1
- package/dist/chunks/data-grid-template.Bm08fIsa.js +69 -0
- package/dist/chunks/data-grid-template.Bm08fIsa.js.map +1 -0
- package/dist/chunks/{data-grid.BTxmzkic.js → data-grid.C8S9cY5p.js} +1181 -1095
- package/dist/chunks/data-grid.C8S9cY5p.js.map +1 -0
- package/dist/chunks/{date-picker.Dy0k-7_1.js → date-picker.DPSJvBlj.js} +5 -5
- package/dist/chunks/{date-picker.Dy0k-7_1.js.map → date-picker.DPSJvBlj.js.map} +1 -1
- package/dist/chunks/{date-range-picker.nTv7S5oB.js → date-range-picker.B03wCOPP.js} +27 -24
- package/dist/chunks/date-range-picker.B03wCOPP.js.map +1 -0
- package/dist/chunks/{dialog-page.BfF5_hmG.js → dialog-page.C8iNK4bf.js} +2 -2
- package/dist/chunks/{dialog-page.BfF5_hmG.js.map → dialog-page.C8iNK4bf.js.map} +1 -1
- package/dist/chunks/{dropdown-default-textbox.CDTdHfTv.js → dropdown-default-textbox.AUsF-RIc.js} +18 -18
- package/dist/chunks/{dropdown-default-textbox.CDTdHfTv.js.map → dropdown-default-textbox.AUsF-RIc.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.B15dzpe3.js → dropdown-tag.DUlkje2L.js} +3 -3
- package/dist/chunks/{dropdown-tag.B15dzpe3.js.map → dropdown-tag.DUlkje2L.js.map} +1 -1
- package/dist/chunks/{dropdown.CFBycvtL.js → dropdown.DihPVajz.js} +31 -31
- package/dist/chunks/{dropdown.CFBycvtL.js.map → dropdown.DihPVajz.js.map} +1 -1
- package/dist/chunks/{empty-state.JbgxSrnv.js → empty-state.aBO3bh4N.js} +2 -2
- package/dist/chunks/{empty-state.JbgxSrnv.js.map → empty-state.aBO3bh4N.js.map} +1 -1
- package/dist/chunks/{error-message.qHRfH-8Y.js → error-message.7bsic_sK.js} +2 -2
- package/dist/chunks/{error-message.qHRfH-8Y.js.map → error-message.7bsic_sK.js.map} +1 -1
- package/dist/chunks/es6.BtaxuP0b.js.map +1 -1
- package/dist/chunks/{file-uploader.CKcv6q6S.js → file-uploader.P_s39Esv.js} +5 -5
- package/dist/chunks/{file-uploader.CKcv6q6S.js.map → file-uploader.P_s39Esv.js.map} +1 -1
- package/dist/chunks/{filter-bar.Cu4I3kJB.js → filter-bar.Djv7J4G1.js} +31 -28
- package/dist/chunks/filter-bar.Djv7J4G1.js.map +1 -0
- package/dist/chunks/{fixed-scroller.BwvXYzE6.js → fixed-scroller.C7Eug22g.js} +2 -2
- package/dist/chunks/{fixed-scroller.BwvXYzE6.js.map → fixed-scroller.C7Eug22g.js.map} +1 -1
- package/dist/chunks/{focus-trap.V3Q8H_5C.js → focus-trap.DEHn1dxN.js} +6 -6
- package/dist/chunks/{focus-trap.V3Q8H_5C.js.map → focus-trap.DEHn1dxN.js.map} +1 -1
- package/dist/chunks/{footer-actions.DYi_MR9I.js → footer-actions.CNNRHYLb.js} +3 -3
- package/dist/chunks/{footer-actions.DYi_MR9I.js.map → footer-actions.CNNRHYLb.js.map} +1 -1
- package/dist/chunks/{form-layout-title.DK1-01RH.js → form-layout-title.C9P21KnX.js} +2 -2
- package/dist/chunks/{form-layout-title.DK1-01RH.js.map → form-layout-title.C9P21KnX.js.map} +1 -1
- package/dist/chunks/{header-with-views.ugNWdbC8.js → header-with-views.siHZ-MsA.js} +13 -13
- package/dist/chunks/{header-with-views.ugNWdbC8.js.map → header-with-views.siHZ-MsA.js.map} +1 -1
- package/dist/chunks/{header.DWx6s2nt.js → header.BXGTPqZK.js} +4 -4
- package/dist/chunks/{header.DWx6s2nt.js.map → header.BXGTPqZK.js.map} +1 -1
- package/dist/chunks/i18n.BQkEbtPM.js.map +1 -1
- package/dist/chunks/{info-icon-with-popover.B4wYDzGz.js → info-icon-with-popover.CdZ1_8hG.js} +2 -2
- package/dist/chunks/{info-icon-with-popover.B4wYDzGz.js.map → info-icon-with-popover.CdZ1_8hG.js.map} +1 -1
- package/dist/chunks/{info-icon.J62KXp9I.js → info-icon.Dn0FHy-U.js} +3 -3
- package/dist/chunks/{info-icon.J62KXp9I.js.map → info-icon.Dn0FHy-U.js.map} +1 -1
- package/dist/chunks/{input-field-password.DCcG3ju1.js → input-field-password.Dz_8fr0j.js} +6 -6
- package/dist/chunks/{input-field-password.DCcG3ju1.js.map → input-field-password.Dz_8fr0j.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.BxP8LyD-.js → input-field-phone-number.CPlRrAGe.js} +8 -12
- package/dist/chunks/{input-field-phone-number.BxP8LyD-.js.map → input-field-phone-number.CPlRrAGe.js.map} +1 -1
- package/dist/chunks/{input-field.BUj99rZv.js → input-field.DcOnDLTc.js} +3 -3
- package/dist/chunks/{input-field.BUj99rZv.js.map → input-field.DcOnDLTc.js.map} +1 -1
- package/dist/chunks/{inspector.types.Cmq6sdCz.js → inspector.types.D1m792RZ.js} +3 -3
- package/dist/chunks/{inspector.types.Cmq6sdCz.js.map → inspector.types.D1m792RZ.js.map} +1 -1
- package/dist/chunks/keyboard-navigation.pB8weElW.js.map +1 -1
- package/dist/chunks/{listbox-option-tag.BHI-8rRX.js → listbox-option-tag.BSQ8bM-O.js} +2 -2
- package/dist/chunks/{listbox-option-tag.BHI-8rRX.js.map → listbox-option-tag.BSQ8bM-O.js.map} +1 -1
- package/dist/chunks/{menu.BoxhffPs.js → menu.DFatjXpw.js} +5 -6
- package/dist/chunks/menu.DFatjXpw.js.map +1 -0
- package/dist/chunks/{modal-fullscreen.E7e13pW9.js → modal-fullscreen._NBj0IXu.js} +5 -5
- package/dist/chunks/{modal-fullscreen.E7e13pW9.js.map → modal-fullscreen._NBj0IXu.js.map} +1 -1
- package/dist/chunks/{modal.n7b-ITaf.js → modal.CpZzd8fG.js} +5 -5
- package/dist/chunks/{modal.n7b-ITaf.js.map → modal.CpZzd8fG.js.map} +1 -1
- package/dist/chunks/{pagination.eAo5wz5D.js → pagination.PQCpgVVF.js} +3 -3
- package/dist/chunks/{pagination.eAo5wz5D.js.map → pagination.PQCpgVVF.js.map} +1 -1
- package/dist/chunks/{popover.C4PNSrnW.js → popover.BVLuUYSi.js} +4 -4
- package/dist/chunks/{popover.C4PNSrnW.js.map → popover.BVLuUYSi.js.map} +1 -1
- package/dist/chunks/{popper-container.DWY19wS0.js → popper-container.DieshXa8.js} +3 -3
- package/dist/chunks/{popper-container.DWY19wS0.js.map → popper-container.DieshXa8.js.map} +1 -1
- package/dist/chunks/{promo-banner.DgCKKp6o.js → promo-banner.C4jiwSeA.js} +2 -2
- package/dist/chunks/{promo-banner.DgCKKp6o.js.map → promo-banner.C4jiwSeA.js.map} +1 -1
- package/dist/chunks/{radio-group.WbbrQhEO.js → radio-group.BuKC_n23.js} +4 -4
- package/dist/chunks/{radio-group.WbbrQhEO.js.map → radio-group.BuKC_n23.js.map} +1 -1
- package/dist/chunks/{search-bar.C-DwowF7.js → search-bar.BPnYyZ9S.js} +3 -3
- package/dist/chunks/{search-bar.C-DwowF7.js.map → search-bar.BPnYyZ9S.js.map} +1 -1
- package/dist/chunks/{secondary-nav.CTeYViOR.js → secondary-nav.CDykzeRU.js} +2 -2
- package/dist/chunks/{secondary-nav.CTeYViOR.js.map → secondary-nav.CDykzeRU.js.map} +1 -1
- package/dist/chunks/{segmented-control.DGNMY2BP.js → segmented-control.CCgCeLDQ.js} +2 -2
- package/dist/chunks/{segmented-control.DGNMY2BP.js.map → segmented-control.CCgCeLDQ.js.map} +1 -1
- package/dist/chunks/{selection-card-group.BmKUEuny.js → selection-card-group.Dj9wWfmY.js} +3 -3
- package/dist/chunks/{selection-card-group.BmKUEuny.js.map → selection-card-group.Dj9wWfmY.js.map} +1 -1
- package/dist/chunks/{sidepanel.Bnw4accy.js → sidepanel.DcBdDgec.js} +10 -10
- package/dist/chunks/{sidepanel.Bnw4accy.js.map → sidepanel.DcBdDgec.js.map} +1 -1
- package/dist/chunks/{structured-list-item.Co5P9bFC.js → structured-list-item.w0GVxwQf.js} +5 -5
- package/dist/chunks/{structured-list-item.Co5P9bFC.js.map → structured-list-item.w0GVxwQf.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.egM7irBt.js → summary-grid.types.DoD7Ls0O.js} +5 -5
- package/dist/chunks/{summary-grid.types.egM7irBt.js.map → summary-grid.types.DoD7Ls0O.js.map} +1 -1
- package/dist/chunks/tabs.T3A3YNdF.js +205 -0
- package/dist/chunks/tabs.T3A3YNdF.js.map +1 -0
- package/dist/chunks/{tag.CyspYb1E.js → tag.C7ATWnRW.js} +2 -2
- package/dist/chunks/{tag.CyspYb1E.js.map → tag.C7ATWnRW.js.map} +1 -1
- package/dist/chunks/{teleport.BHfrns33.js → teleport.5oodkxuB.js} +6 -6
- package/dist/chunks/teleport.5oodkxuB.js.map +1 -0
- package/dist/chunks/{textarea.CC8esIW6.js → textarea.CrPdkIGL.js} +3 -3
- package/dist/chunks/{textarea.CC8esIW6.js.map → textarea.CrPdkIGL.js.map} +1 -1
- package/dist/chunks/{timeline-item.Byorbxmc.js → timeline-item.B6XTUyr8.js} +6 -6
- package/dist/chunks/{timeline-item.Byorbxmc.js.map → timeline-item.B6XTUyr8.js.map} +1 -1
- package/dist/chunks/{toast.DqSWycRO.js → toast.CjJW9t4G.js} +2 -2
- package/dist/chunks/{toast.DqSWycRO.js.map → toast.CjJW9t4G.js.map} +1 -1
- package/dist/chunks/{toggle-button.DgSFugBP.js → toggle-button.Dj2uoRyw.js} +2 -2
- package/dist/chunks/{toggle-button.DgSFugBP.js.map → toggle-button.Dj2uoRyw.js.map} +1 -1
- package/dist/chunks/{tooltip.DOvci5lX.js → tooltip.CfER_5In.js} +2 -2
- package/dist/chunks/{tooltip.DOvci5lX.js.map → tooltip.CfER_5In.js.map} +1 -1
- package/dist/chunks/{tutorial.QwHbq1FO.js → tutorial.CTzjDY6m.js} +5 -5
- package/dist/chunks/{tutorial.QwHbq1FO.js.map → tutorial.CTzjDY6m.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.DHpjo2tV.js → use-cached-selected-values.D6lOsd0o.js} +431 -422
- package/dist/chunks/use-cached-selected-values.D6lOsd0o.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 +4 -4
- package/dist/empty-state.js +1 -1
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/focus-trap.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 +54 -54
- 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/inspector.js +1 -1
- package/dist/internal.js +13 -13
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/pagination.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/popper-container.js +1 -1
- package/dist/promo-banner.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/styles/bento-dark.css +7 -2
- package/dist/styles/bento-light.css +7 -2
- package/dist/styles/bento.css +7 -2
- package/dist/styles/legacy.css +7 -2
- package/dist/styles/styleguide.css +7 -2
- package/dist/summary-grid.js +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tag.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 +85 -5
- package/package.json +17 -5
- package/dist/chunks/button.D-3uUhuG.js.map +0 -1
- package/dist/chunks/calendar.D4dMXwc0.js.map +0 -1
- package/dist/chunks/dashboard-section.DlIwNKkx.js.map +0 -1
- package/dist/chunks/data-grid-template.BJTWe6Ty.js +0 -69
- package/dist/chunks/data-grid-template.BJTWe6Ty.js.map +0 -1
- package/dist/chunks/data-grid.BTxmzkic.js.map +0 -1
- package/dist/chunks/date-range-picker.nTv7S5oB.js.map +0 -1
- package/dist/chunks/filter-bar.Cu4I3kJB.js.map +0 -1
- package/dist/chunks/menu.BoxhffPs.js.map +0 -1
- package/dist/chunks/tabs.C8CgvNt4.js +0 -214
- package/dist/chunks/tabs.C8CgvNt4.js.map +0 -1
- package/dist/chunks/teleport.BHfrns33.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.DHpjo2tV.js.map +0 -1
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
import { computed as
|
|
1
|
+
import { computed as c, ref as O, onMounted as de, onUnmounted as ye, watch as be, defineComponent as P, toRef as w, useSlots as Ce } from "vue";
|
|
2
2
|
import { B as G } 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 Se } from "./loading-indicator.z8COalOc.js";
|
|
4
|
+
import { B as he } from "./empty-state.aBO3bh4N.js";
|
|
5
|
+
import { u as X } from "./i18n.BQkEbtPM.js";
|
|
6
|
+
import { d as xe } from "./debounce.DUTu11PS.js";
|
|
7
7
|
import "./index.Cl4_42j5.js";
|
|
8
|
-
import { B as
|
|
9
|
-
import { B as
|
|
10
|
-
import { C as
|
|
11
|
-
import { B as k, a as
|
|
8
|
+
import { B as J } from "./checkbox.LFeWM5p4.js";
|
|
9
|
+
import { B as Ee } from "./chip.BeK9uqmW.js";
|
|
10
|
+
import { C as Le, a as Oe } from "./chevron-up.CSVyoaTy.js";
|
|
11
|
+
import { B as k, a as Z } from "./keyboard-navigation.pB8weElW.js";
|
|
12
12
|
import { n as D } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
13
|
-
import { d as
|
|
13
|
+
import { d as Te, e as ce } from "./button-actions.C5Dp4DeK.js";
|
|
14
14
|
/* empty css */
|
|
15
|
-
import { o as
|
|
15
|
+
import { o as Ae } from "./resize.Bqks3WUm.js";
|
|
16
16
|
import "../assets/use-cached-selected-values.css";
|
|
17
17
|
const fe = (s, e, t, l) => {
|
|
18
|
-
const
|
|
18
|
+
const o = c(
|
|
19
19
|
() => {
|
|
20
|
-
var b,
|
|
21
|
-
return !!((b = s.value) != null && b.length) && ((
|
|
20
|
+
var b, v;
|
|
21
|
+
return !!((b = s.value) != null && b.length) && ((v = s.value) == null ? void 0 : v.length) === e.value.length;
|
|
22
22
|
}
|
|
23
|
-
),
|
|
23
|
+
), n = c(() => {
|
|
24
24
|
var b;
|
|
25
25
|
return s.value == null || s.value.length === 0 ? !1 : ((b = s.value) == null ? void 0 : b.length) !== e.value.length;
|
|
26
26
|
});
|
|
27
27
|
return {
|
|
28
|
-
isAllSelected:
|
|
29
|
-
isIndeterminate:
|
|
28
|
+
isAllSelected: o,
|
|
29
|
+
isIndeterminate: n,
|
|
30
30
|
toggleSelectAll: (b) => {
|
|
31
31
|
b ? t() : l();
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
|
-
function
|
|
36
|
-
const
|
|
37
|
-
let
|
|
38
|
-
const S =
|
|
39
|
-
const d = typeof t == "number" ? s.value.length * t : s.value.reduce((L,
|
|
35
|
+
function Ie(s, { disabled: e, itemHeight: t, overscan: l = 5, prefixHeight: o }) {
|
|
36
|
+
const n = O(null), a = O([]), b = O(0), v = O(0), r = O(0);
|
|
37
|
+
let m;
|
|
38
|
+
const S = c(() => {
|
|
39
|
+
const d = typeof t == "number" ? s.value.length * t : s.value.reduce((L, _, x) => L + t(x), 0), C = typeof t == "number" ? b.value * t : s.value.slice(0, b.value).reduce((L, _, x) => L + t(x), 0);
|
|
40
40
|
return {
|
|
41
41
|
style: {
|
|
42
|
-
marginTop: `${
|
|
43
|
-
height: `${d -
|
|
42
|
+
marginTop: `${C}px`,
|
|
43
|
+
height: `${d - C}px`
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
|
-
}),
|
|
47
|
-
const d = (
|
|
46
|
+
}), E = () => {
|
|
47
|
+
const d = (o == null ? void 0 : o.value) ?? 0, C = Math.max(n.value.scrollTop - d, 0);
|
|
48
48
|
if (typeof t == "number")
|
|
49
|
-
return Math.floor(
|
|
50
|
-
let L = 0,
|
|
49
|
+
return Math.floor(C / t);
|
|
50
|
+
let L = 0, _ = 0;
|
|
51
51
|
for (let x = 0; x < s.value.length; x += 1) {
|
|
52
52
|
const B = t(x);
|
|
53
|
-
if (L += B, L >=
|
|
54
|
-
|
|
53
|
+
if (L += B, L >= C) {
|
|
54
|
+
_ = x;
|
|
55
55
|
break;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
return
|
|
58
|
+
return _;
|
|
59
59
|
}, A = () => {
|
|
60
|
-
if (
|
|
61
|
-
return Math.ceil(
|
|
60
|
+
if (r.value = n.value.clientHeight, typeof t == "number")
|
|
61
|
+
return Math.ceil(r.value / t);
|
|
62
62
|
const d = b.value ?? 0;
|
|
63
|
-
let
|
|
64
|
-
for (let
|
|
65
|
-
const x = t(
|
|
66
|
-
if (
|
|
63
|
+
let C = 0, L = 0;
|
|
64
|
+
for (let _ = d; _ < s.value.length; _ += 1) {
|
|
65
|
+
const x = t(_);
|
|
66
|
+
if (C += x, L = _, C > r.value)
|
|
67
67
|
break;
|
|
68
68
|
}
|
|
69
69
|
return L - d;
|
|
70
70
|
}, T = () => {
|
|
71
|
-
if (
|
|
71
|
+
if (n.value) {
|
|
72
72
|
const d = A();
|
|
73
|
-
b.value =
|
|
73
|
+
b.value = E(), v.value = Math.min(b.value + d + l, s.value.length), a.value = s.value.slice(b.value, v.value);
|
|
74
74
|
}
|
|
75
|
-
},
|
|
75
|
+
}, I = () => {
|
|
76
76
|
T();
|
|
77
77
|
};
|
|
78
78
|
e || (de(() => {
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
n.value && (r.value = n.value.clientHeight, m = Ae(n.value, ({ clientHeight: d }) => {
|
|
80
|
+
r.value = d, T();
|
|
81
81
|
}), T());
|
|
82
|
-
}),
|
|
83
|
-
|
|
82
|
+
}), ye(() => {
|
|
83
|
+
m == null || m.disconnect();
|
|
84
84
|
}), be(
|
|
85
85
|
() => s.value,
|
|
86
86
|
() => {
|
|
@@ -88,26 +88,26 @@ function Te(s, { disabled: e, itemHeight: t, overscan: l = 5, prefixHeight: n })
|
|
|
88
88
|
}
|
|
89
89
|
));
|
|
90
90
|
const f = {
|
|
91
|
-
ref:
|
|
91
|
+
ref: n,
|
|
92
92
|
style: { overflowY: "auto" }
|
|
93
93
|
};
|
|
94
94
|
return e ? {
|
|
95
|
-
containerRef:
|
|
95
|
+
containerRef: n,
|
|
96
96
|
containerProps: f,
|
|
97
97
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
98
98
|
onScroll: () => {
|
|
99
99
|
},
|
|
100
100
|
list: s
|
|
101
101
|
} : {
|
|
102
|
-
containerRef:
|
|
102
|
+
containerRef: n,
|
|
103
103
|
containerProps: f,
|
|
104
|
-
onScroll:
|
|
104
|
+
onScroll: I,
|
|
105
105
|
list: a,
|
|
106
106
|
wrapperProps: S
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
var
|
|
110
|
-
const
|
|
109
|
+
var i = /* @__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))(i || {}), F = /* @__PURE__ */ ((s) => (s.AUTOMATIC = "automatic", s.BUTTON = "button", s.NONE = "none", s))(F || {});
|
|
110
|
+
const Re = P({
|
|
111
111
|
name: "bento-listbox-static-category",
|
|
112
112
|
components: {
|
|
113
113
|
BentoTypography: G
|
|
@@ -122,18 +122,18 @@ const Ie = P({
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
});
|
|
125
|
-
var
|
|
125
|
+
var Be = function() {
|
|
126
126
|
var e = this, t = e._self._c;
|
|
127
127
|
return e._self._setupProxy, t("div", { staticClass: "b-listbox-single-select-category" }, [t("bento-typography", { staticClass: "b-listbox-single-select-category__label-text", attrs: { variant: "caption", el: "span" } }, [e._v(" " + e._s(e.categoryLabel) + " ")]), t("div", [e._t("default")], 2)], 1);
|
|
128
|
-
},
|
|
129
|
-
|
|
130
|
-
Ae,
|
|
128
|
+
}, ke = [], De = /* @__PURE__ */ D(
|
|
129
|
+
Re,
|
|
131
130
|
Be,
|
|
131
|
+
ke,
|
|
132
132
|
!1,
|
|
133
133
|
null,
|
|
134
134
|
"4aa8cc6e"
|
|
135
135
|
);
|
|
136
|
-
const
|
|
136
|
+
const Ne = De.exports, Me = P({
|
|
137
137
|
name: "bento-listbox-option",
|
|
138
138
|
props: {
|
|
139
139
|
/**
|
|
@@ -145,29 +145,29 @@ const ke = Re.exports, De = P({
|
|
|
145
145
|
*/
|
|
146
146
|
selected: { type: Boolean, default: !1 }
|
|
147
147
|
},
|
|
148
|
-
emits: [
|
|
148
|
+
emits: [i.CLICK, i.ENTER, i.SPACE, i.TAB],
|
|
149
149
|
setup(s, { emit: e }) {
|
|
150
|
-
const t =
|
|
150
|
+
const t = c(() => ({
|
|
151
151
|
"b-listbox-option--disabled": s.disabled,
|
|
152
152
|
"b-listbox-option--selected": s.selected
|
|
153
153
|
}));
|
|
154
154
|
return {
|
|
155
155
|
// Enums
|
|
156
156
|
BentoKeyboardNavigationKeyDownEvent: k,
|
|
157
|
-
BentoListboxEvent:
|
|
157
|
+
BentoListboxEvent: i,
|
|
158
158
|
// Values
|
|
159
159
|
conditionalClasses: t,
|
|
160
160
|
// Events
|
|
161
|
-
onClick: (
|
|
162
|
-
e(
|
|
161
|
+
onClick: (n) => {
|
|
162
|
+
e(i.CLICK, n);
|
|
163
163
|
},
|
|
164
|
-
onOptionSelected: (
|
|
165
|
-
e(
|
|
164
|
+
onOptionSelected: (n, a) => {
|
|
165
|
+
e(n, a);
|
|
166
166
|
}
|
|
167
167
|
};
|
|
168
168
|
}
|
|
169
169
|
});
|
|
170
|
-
var
|
|
170
|
+
var Pe = function() {
|
|
171
171
|
var e = this, t = e._self._c;
|
|
172
172
|
return e._self._setupProxy, t("label", e._b({ staticClass: "b-listbox-option", class: e.conditionalClasses, attrs: { role: "option" }, on: { click: e.onClick, keydown: [function(l) {
|
|
173
173
|
return !l.type.indexOf("key") && e._k(l.keyCode, "enter", 13, l.key, "Enter") ? null : e.onOptionSelected(e.BentoListboxEvent.ENTER, l);
|
|
@@ -176,38 +176,38 @@ var Me = function() {
|
|
|
176
176
|
}, function(l) {
|
|
177
177
|
return !l.type.indexOf("key") && e._k(l.keyCode, "tab", 9, l.key, "Tab") ? null : e.onOptionSelected(e.BentoListboxEvent.TAB, l);
|
|
178
178
|
}] } }, "label", e.$attrs, !1), [e._t("default")], 2);
|
|
179
|
-
},
|
|
180
|
-
De,
|
|
179
|
+
}, we = [], $e = /* @__PURE__ */ D(
|
|
181
180
|
Me,
|
|
182
|
-
|
|
181
|
+
Pe,
|
|
182
|
+
we,
|
|
183
183
|
!1,
|
|
184
184
|
null,
|
|
185
185
|
"d7fb415c"
|
|
186
186
|
);
|
|
187
|
-
const
|
|
187
|
+
const V = $e.exports;
|
|
188
188
|
let re = 0;
|
|
189
|
-
const
|
|
189
|
+
const Fe = {
|
|
190
190
|
beforeCreate() {
|
|
191
191
|
this.uuid = re.toString(), re += 1;
|
|
192
192
|
}
|
|
193
193
|
};
|
|
194
|
-
var
|
|
194
|
+
var Ge = function() {
|
|
195
195
|
var e = this, t = e._self._c;
|
|
196
196
|
return t("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"] ? t("title", [e._v(e._s(e.$attrs["svg-title"]))]) : e._e(), t("path", { attrs: { fill: "#00112C", d: "M15.0608 4.00011L14.0001 2.93945L6.00011 10.9395L2.00011 6.93945L0.939453 8.00011L6.00011 13.0608L15.0608 4.00011Z" } })]);
|
|
197
|
-
},
|
|
198
|
-
we,
|
|
199
|
-
$e,
|
|
197
|
+
}, Ue = [], ze = /* @__PURE__ */ D(
|
|
200
198
|
Fe,
|
|
199
|
+
Ge,
|
|
200
|
+
Ue,
|
|
201
201
|
!1,
|
|
202
202
|
null,
|
|
203
203
|
null
|
|
204
204
|
);
|
|
205
|
-
const
|
|
205
|
+
const Ve = ze.exports, Ye = P({
|
|
206
206
|
name: "bento-listbox-single-select-option",
|
|
207
207
|
components: {
|
|
208
|
-
BentoListboxOption:
|
|
208
|
+
BentoListboxOption: V,
|
|
209
209
|
BentoTypography: G,
|
|
210
|
-
CheckmarkIcon:
|
|
210
|
+
CheckmarkIcon: Ve
|
|
211
211
|
},
|
|
212
212
|
props: {
|
|
213
213
|
/**
|
|
@@ -227,24 +227,24 @@ const Ue = Ge.exports, ze = P({
|
|
|
227
227
|
*/
|
|
228
228
|
selected: { type: Boolean, default: !1 }
|
|
229
229
|
},
|
|
230
|
-
emits: [
|
|
230
|
+
emits: [i.ENTER, i.SELECT, i.SPACE, i.TAB],
|
|
231
231
|
setup(s, { emit: e }) {
|
|
232
232
|
const t = (a) => {
|
|
233
233
|
s.disabled || e(a, s.option);
|
|
234
|
-
}, l =
|
|
234
|
+
}, l = c(() => s.disabled ? !0 : null), o = c(() => s.selected ? !0 : null), n = c(() => s.disabled ? -1 : 0);
|
|
235
235
|
return {
|
|
236
236
|
// Values
|
|
237
237
|
ariaDisabled: l,
|
|
238
|
-
ariaSelected:
|
|
239
|
-
tabIndex:
|
|
238
|
+
ariaSelected: o,
|
|
239
|
+
tabIndex: n,
|
|
240
240
|
// Enums
|
|
241
|
-
BentoListboxEvent:
|
|
241
|
+
BentoListboxEvent: i,
|
|
242
242
|
// Events
|
|
243
243
|
onOptionSelected: t
|
|
244
244
|
};
|
|
245
245
|
}
|
|
246
246
|
});
|
|
247
|
-
var
|
|
247
|
+
var We = function() {
|
|
248
248
|
var e = this, t = e._self._c;
|
|
249
249
|
return e._self._setupProxy, t("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(l) {
|
|
250
250
|
return e.onOptionSelected(e.BentoListboxEvent.SELECT);
|
|
@@ -257,22 +257,26 @@ var Ve = function() {
|
|
|
257
257
|
} } }, [e._t("default", function() {
|
|
258
258
|
return [t("span", { staticClass: "b-listbox-single-select-option__text" }, [t("bento-typography", { attrs: { el: "span" } }, [e._v(e._s(e.option.label))]), e.option.description ? t("bento-typography", { staticClass: "b-listbox-single-select-option__description", attrs: { el: "span" } }, [e._v(" " + e._s(e.option.description) + " ")]) : e._e()], 1)];
|
|
259
259
|
}, null, e.option), t("span", { staticClass: "b-listbox-single-select-option__check-icon" }, [t("checkmark-icon", { directives: [{ name: "show", rawName: "v-show", value: e.selected, expression: "selected" }], attrs: { "svg-title": "selected" } })], 1)], 2);
|
|
260
|
-
},
|
|
261
|
-
ze,
|
|
262
|
-
Ve,
|
|
260
|
+
}, Ke = [], qe = /* @__PURE__ */ D(
|
|
263
261
|
Ye,
|
|
262
|
+
We,
|
|
263
|
+
Ke,
|
|
264
264
|
!1,
|
|
265
265
|
null,
|
|
266
266
|
"5a5ff36a"
|
|
267
267
|
);
|
|
268
|
-
const
|
|
269
|
-
const
|
|
268
|
+
const je = qe.exports, ve = ({ items: s, isOptionDisabled: e, hasStaticCategories: t }, l) => {
|
|
269
|
+
const o = c(
|
|
270
270
|
() => t.value ? s.value.flatMap((f) => f.items) : s.value
|
|
271
|
-
),
|
|
271
|
+
), n = c(() => o.value.length - 1), a = O(0);
|
|
272
272
|
de(() => {
|
|
273
273
|
e && (a.value = s.value.findIndex((f) => !e(f)));
|
|
274
274
|
});
|
|
275
|
-
const b = (f) =>
|
|
275
|
+
const b = (f) => {
|
|
276
|
+
var L, _;
|
|
277
|
+
const C = ((_ = (L = s.value[f]) == null ? void 0 : L.items) == null ? void 0 : _.length) ? s.value[f].items.every((x) => e(x)) : e(s.value[f]);
|
|
278
|
+
return !e || !!e && C;
|
|
279
|
+
}, v = (f) => {
|
|
276
280
|
switch (f) {
|
|
277
281
|
case "increase":
|
|
278
282
|
a.value += 1;
|
|
@@ -281,55 +285,52 @@ const We = Ke.exports, ve = ({ items: s, isOptionDisabled: e, hasStaticCategorie
|
|
|
281
285
|
a.value -= 1;
|
|
282
286
|
break;
|
|
283
287
|
}
|
|
284
|
-
},
|
|
285
|
-
a.value !== f && (
|
|
286
|
-
},
|
|
287
|
-
|
|
288
|
-
(g = f == null ? void 0 : f.detail) == null || g.preventDefault();
|
|
289
|
-
const d = a.value === o.value - 2;
|
|
290
|
-
C(
|
|
288
|
+
}, r = ({ edgeCaseItem: f }, d, C) => {
|
|
289
|
+
a.value !== f && (v(C), b(a.value) && d(), l(a.value));
|
|
290
|
+
}, m = (f) => {
|
|
291
|
+
I(f), r(
|
|
291
292
|
{
|
|
292
|
-
|
|
293
|
-
edgeCaseItem: o.value
|
|
293
|
+
edgeCaseItem: n.value
|
|
294
294
|
},
|
|
295
|
-
|
|
295
|
+
m,
|
|
296
296
|
"increase"
|
|
297
297
|
/* INCREASE */
|
|
298
298
|
);
|
|
299
|
-
},
|
|
300
|
-
|
|
301
|
-
(g = f == null ? void 0 : f.detail) == null || g.preventDefault();
|
|
302
|
-
const d = a.value === 1;
|
|
303
|
-
C(
|
|
299
|
+
}, S = (f) => {
|
|
300
|
+
I(f), r(
|
|
304
301
|
{
|
|
305
|
-
edgeCaseItem: 0
|
|
306
|
-
isItemBeforeEdgeCaseItem: d
|
|
302
|
+
edgeCaseItem: 0
|
|
307
303
|
},
|
|
308
|
-
|
|
304
|
+
S,
|
|
309
305
|
"decrease"
|
|
310
306
|
/* DECREASE */
|
|
311
307
|
);
|
|
308
|
+
}, E = () => {
|
|
309
|
+
a.value = 0, b(a.value) ? m() : l(a.value);
|
|
310
|
+
}, A = () => {
|
|
311
|
+
a.value = n.value, b(a.value) ? S() : l(a.value);
|
|
312
|
+
}, T = (f) => {
|
|
313
|
+
a.value = f;
|
|
314
|
+
}, I = (f) => {
|
|
315
|
+
var d;
|
|
316
|
+
(d = f == null ? void 0 : f.detail) == null || d.preventDefault();
|
|
312
317
|
};
|
|
313
318
|
return {
|
|
314
|
-
moveToFirstElement:
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
moveToPreviousElement: h,
|
|
322
|
-
setListboxFocusedIndex: (f) => {
|
|
323
|
-
a.value = f;
|
|
324
|
-
}
|
|
319
|
+
moveToFirstElement: E,
|
|
320
|
+
moveToLastElement: A,
|
|
321
|
+
moveToNextElement: m,
|
|
322
|
+
moveToPreviousElement: S,
|
|
323
|
+
setListboxFocusedIndex: T,
|
|
324
|
+
preventDefault: I,
|
|
325
|
+
focusedIndex: a
|
|
325
326
|
};
|
|
326
|
-
},
|
|
327
|
+
}, He = P({
|
|
327
328
|
name: "bento-listbox-single-select",
|
|
328
329
|
components: {
|
|
329
|
-
BentoListboxSingleSelectCategory:
|
|
330
|
-
BentoListboxSingleSelectOption:
|
|
330
|
+
BentoListboxSingleSelectCategory: Ne,
|
|
331
|
+
BentoListboxSingleSelectOption: je
|
|
331
332
|
},
|
|
332
|
-
directives: { BentoKeyboardNavigationDirective:
|
|
333
|
+
directives: { BentoKeyboardNavigationDirective: Z },
|
|
333
334
|
inheritAttrs: !1,
|
|
334
335
|
props: {
|
|
335
336
|
/**
|
|
@@ -370,46 +371,46 @@ const We = Ke.exports, ve = ({ items: s, isOptionDisabled: e, hasStaticCategorie
|
|
|
370
371
|
*/
|
|
371
372
|
staticCategories: { type: Boolean, default: !1 }
|
|
372
373
|
},
|
|
373
|
-
emits: [
|
|
374
|
+
emits: [i.SELECT, i.ENTER, i.SPACE, i.TAB],
|
|
374
375
|
setup(s, { emit: e, expose: t, slots: l }) {
|
|
375
|
-
const
|
|
376
|
+
const o = O(null), n = O([]), a = c(() => {
|
|
376
377
|
var d;
|
|
377
378
|
return !!((d = s.selectedValue) != null && d.length) && s.selectedValue.at(0);
|
|
378
|
-
}), b =
|
|
379
|
-
e(d, [
|
|
380
|
-
},
|
|
381
|
-
var
|
|
382
|
-
(
|
|
379
|
+
}), b = c(() => !!s.items.some(({ items: d }) => !!d)), v = (d) => (C) => {
|
|
380
|
+
e(d, [C]);
|
|
381
|
+
}, r = (d) => {
|
|
382
|
+
var C;
|
|
383
|
+
(C = o.value.querySelectorAll('[role="option"]')[d]) == null || C.focus();
|
|
383
384
|
}, {
|
|
384
|
-
moveToNextElement:
|
|
385
|
+
moveToNextElement: m,
|
|
385
386
|
moveToPreviousElement: S,
|
|
386
|
-
moveToFirstElement:
|
|
387
|
+
moveToFirstElement: E,
|
|
387
388
|
moveToLastElement: A,
|
|
388
389
|
setListboxFocusedIndex: T
|
|
389
390
|
} = ve(
|
|
390
391
|
{
|
|
391
|
-
items:
|
|
392
|
+
items: w(s, "items"),
|
|
392
393
|
isOptionDisabled: s.isOptionDisabled,
|
|
393
|
-
hasStaticCategories:
|
|
394
|
+
hasStaticCategories: w(s, "staticCategories")
|
|
394
395
|
},
|
|
395
|
-
|
|
396
|
-
),
|
|
396
|
+
r
|
|
397
|
+
), I = {
|
|
397
398
|
[k.ARROW_UP]: S,
|
|
398
|
-
[k.ARROW_DOWN]:
|
|
399
|
-
[k.HOME]:
|
|
399
|
+
[k.ARROW_DOWN]: m,
|
|
400
|
+
[k.HOME]: E,
|
|
400
401
|
[k.END]: A
|
|
401
402
|
}, f = {
|
|
402
|
-
[
|
|
403
|
-
[
|
|
404
|
-
[
|
|
405
|
-
[
|
|
403
|
+
[i.SELECT]: v(i.SELECT),
|
|
404
|
+
[i.SPACE]: v(i.SPACE),
|
|
405
|
+
[i.TAB]: v(i.TAB),
|
|
406
|
+
[i.ENTER]: v(i.ENTER)
|
|
406
407
|
};
|
|
407
408
|
return t({
|
|
408
409
|
/**
|
|
409
410
|
* Reference for a single listbox item.
|
|
410
411
|
* Required for keyboard navigation in dropdown as $children is removed in vue@3
|
|
411
412
|
*/
|
|
412
|
-
listboxItemRef:
|
|
413
|
+
listboxItemRef: n,
|
|
413
414
|
/**
|
|
414
415
|
* Method to set the index of the item to be focused on
|
|
415
416
|
* Used for focus management to be kept in-sync with parent e.g. dropdowns
|
|
@@ -417,63 +418,63 @@ const We = Ke.exports, ve = ({ items: s, isOptionDisabled: e, hasStaticCategorie
|
|
|
417
418
|
setListboxFocusedIndex: T
|
|
418
419
|
}), {
|
|
419
420
|
// Enums
|
|
420
|
-
BentoListboxEvent:
|
|
421
|
+
BentoListboxEvent: i,
|
|
421
422
|
// Values
|
|
422
|
-
listboxRef:
|
|
423
|
-
listboxItemRef:
|
|
423
|
+
listboxRef: o,
|
|
424
|
+
listboxItemRef: n,
|
|
424
425
|
selectedItem: a,
|
|
425
426
|
slots: l,
|
|
426
427
|
// Computed
|
|
427
428
|
hasCategories: b,
|
|
428
429
|
// Methods
|
|
429
|
-
onOptionSelected:
|
|
430
|
+
onOptionSelected: v,
|
|
430
431
|
// Keyboard navigation
|
|
431
|
-
listboxListeners:
|
|
432
|
+
listboxListeners: I,
|
|
432
433
|
listboxOptionListeners: f
|
|
433
434
|
};
|
|
434
435
|
}
|
|
435
436
|
});
|
|
436
|
-
var
|
|
437
|
+
var Xe = function() {
|
|
437
438
|
var e = this, t = e._self._c;
|
|
438
439
|
return e._self._setupProxy, t("div", e._g({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], ref: "listboxRef" }, e.listboxListeners), [e.hasCategories && e.staticCategories ? e._l(e.items, function(l) {
|
|
439
|
-
return t("bento-listbox-single-select-category", { key: l.value, attrs: { "category-label": l.label, role: "group" } }, e._l(l.items, function(
|
|
440
|
-
return t("bento-listbox-single-select-option", e._g({ key:
|
|
440
|
+
return t("bento-listbox-single-select-category", { key: l.value, attrs: { "category-label": l.label, role: "group" } }, e._l(l.items, function(o) {
|
|
441
|
+
return t("bento-listbox-single-select-option", e._g({ key: o.value, ref: "listboxItemRef", refInFor: !0, attrs: { role: "option", option: o, disabled: e.isOptionDisabled ? e.isOptionDisabled(o) : null, selected: o.value === e.selectedItem.value }, scopedSlots: e._u([e._l(e.slots, function(n, a) {
|
|
441
442
|
return { key: a, fn: function(b) {
|
|
442
443
|
return [e._t(a, null, null, b)];
|
|
443
444
|
} };
|
|
444
445
|
})], null, !0) }, e.listboxOptionListeners));
|
|
445
446
|
}), 1);
|
|
446
447
|
}) : e._l(e.items, function(l) {
|
|
447
|
-
return t("bento-listbox-single-select-option", e._g({ key: l.value, ref: "listboxItemRef", refInFor: !0, attrs: { role: "option", option: l, disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null, selected: l.value === e.selectedItem.value }, scopedSlots: e._u([e._l(e.slots, function(
|
|
448
|
-
return { key:
|
|
449
|
-
return [e._t(
|
|
448
|
+
return t("bento-listbox-single-select-option", e._g({ key: l.value, ref: "listboxItemRef", refInFor: !0, attrs: { role: "option", option: l, disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null, selected: l.value === e.selectedItem.value }, scopedSlots: e._u([e._l(e.slots, function(o, n) {
|
|
449
|
+
return { key: n, fn: function(a) {
|
|
450
|
+
return [e._t(n, null, null, a)];
|
|
450
451
|
} };
|
|
451
452
|
})], null, !0) }, e.listboxOptionListeners));
|
|
452
453
|
})], 2);
|
|
453
|
-
},
|
|
454
|
-
qe,
|
|
455
|
-
je,
|
|
454
|
+
}, Je = [], Ze = /* @__PURE__ */ D(
|
|
456
455
|
He,
|
|
456
|
+
Xe,
|
|
457
|
+
Je,
|
|
457
458
|
!1,
|
|
458
459
|
null,
|
|
459
460
|
null
|
|
460
461
|
);
|
|
461
|
-
const
|
|
462
|
-
var
|
|
463
|
-
const
|
|
462
|
+
const Qe = Ze.exports;
|
|
463
|
+
var j = /* @__PURE__ */ ((s) => (s.DISABLED = "disabled", s.STATIC_CATEGORY = "static-category", s))(j || {}), z = /* @__PURE__ */ ((s) => (s.SELECT_CATEGORY = "select-category", s.UNSELECT_CATEGORY = "unselect-category", s))(z || {});
|
|
464
|
+
const et = {
|
|
464
465
|
"en-US": {
|
|
465
466
|
categoryClosed: "{category} closed",
|
|
466
467
|
categoryOpened: "{category} opened"
|
|
467
468
|
}
|
|
468
|
-
},
|
|
469
|
-
i18n: { messages:
|
|
469
|
+
}, tt = P({
|
|
470
|
+
i18n: { messages: et },
|
|
470
471
|
name: "bento-listbox-multi-select-category",
|
|
471
472
|
components: {
|
|
472
|
-
BentoCheckbox:
|
|
473
|
+
BentoCheckbox: J,
|
|
473
474
|
BentoTypography: G,
|
|
474
|
-
BentoListboxOption:
|
|
475
|
-
ChevronDownIcon:
|
|
476
|
-
ChevronUpIcon:
|
|
475
|
+
BentoListboxOption: V,
|
|
476
|
+
ChevronDownIcon: Oe,
|
|
477
|
+
ChevronUpIcon: Le
|
|
477
478
|
},
|
|
478
479
|
props: {
|
|
479
480
|
/**
|
|
@@ -512,94 +513,98 @@ const Ze = {
|
|
|
512
513
|
/**
|
|
513
514
|
* If enabled, dropdown will display non-selectable, static categories
|
|
514
515
|
*/
|
|
515
|
-
staticCategories: { type: Boolean, default: !1 }
|
|
516
|
+
staticCategories: { type: Boolean, default: !1 },
|
|
517
|
+
/**
|
|
518
|
+
* Category's tabindex
|
|
519
|
+
*/
|
|
520
|
+
tabindex: { type: Number, default: -1 }
|
|
516
521
|
},
|
|
517
522
|
emits: [z.SELECT_CATEGORY, z.UNSELECT_CATEGORY],
|
|
518
523
|
setup(s, { emit: e }) {
|
|
519
|
-
const t = O(!1), { t: l } =
|
|
520
|
-
() => s.category.items.every((
|
|
521
|
-
), a =
|
|
522
|
-
[`b-listbox-multi-select-category--${
|
|
523
|
-
[`b-listbox-multi-select-category--${
|
|
524
|
-
})),
|
|
525
|
-
|
|
526
|
-
},
|
|
527
|
-
var
|
|
528
|
-
const x =
|
|
524
|
+
const t = O(!1), { t: l } = X(), o = (_) => s.isOptionDisabled ? s.isOptionDisabled(_) : !1, n = c(
|
|
525
|
+
() => s.category.items.every((_) => o(_))
|
|
526
|
+
), a = w(s, "staticCategories"), b = c(() => t.value || s.staticCategories), v = c(() => ({
|
|
527
|
+
[`b-listbox-multi-select-category--${j.DISABLED}`]: n.value,
|
|
528
|
+
[`b-listbox-multi-select-category--${j.STATIC_CATEGORY}`]: s.staticCategories
|
|
529
|
+
})), r = (_) => {
|
|
530
|
+
_.preventDefault(), t.value = !t.value;
|
|
531
|
+
}, m = (_) => {
|
|
532
|
+
var $;
|
|
533
|
+
const x = o(_), B = (($ = s.selectedItemsList) == null ? void 0 : $.includes(_.value)) || !1;
|
|
529
534
|
return { isDisabled: x, isPreSelected: B };
|
|
530
|
-
}, S =
|
|
531
|
-
() => s.category.items.filter((
|
|
532
|
-
const { isDisabled: x, isPreSelected: B } =
|
|
535
|
+
}, S = c(
|
|
536
|
+
() => s.category.items.filter((_) => {
|
|
537
|
+
const { isDisabled: x, isPreSelected: B } = m(_);
|
|
533
538
|
return x && B || !x;
|
|
534
539
|
})
|
|
535
|
-
),
|
|
540
|
+
), E = c(
|
|
536
541
|
() => {
|
|
537
|
-
var
|
|
538
|
-
return (
|
|
542
|
+
var _;
|
|
543
|
+
return (_ = S.value) == null ? void 0 : _.filter(
|
|
539
544
|
({ value: x }) => {
|
|
540
545
|
var B;
|
|
541
546
|
return (B = s.selectedItemsList) == null ? void 0 : B.includes(x);
|
|
542
547
|
}
|
|
543
548
|
);
|
|
544
549
|
}
|
|
545
|
-
), A =
|
|
546
|
-
const
|
|
547
|
-
return l(
|
|
548
|
-
}), T =
|
|
550
|
+
), A = c(() => {
|
|
551
|
+
const _ = t.value ? "categoryOpened" : "categoryClosed";
|
|
552
|
+
return l(_, { category: s.category.label });
|
|
553
|
+
}), T = c(
|
|
549
554
|
() => ({
|
|
550
555
|
el: "span",
|
|
551
556
|
variant: s.staticCategories ? "caption" : "body"
|
|
552
557
|
})
|
|
553
|
-
),
|
|
558
|
+
), I = () => {
|
|
554
559
|
e(z.SELECT_CATEGORY);
|
|
555
560
|
}, f = () => {
|
|
556
561
|
e(z.UNSELECT_CATEGORY);
|
|
557
|
-
}, { isAllSelected: d, isIndeterminate:
|
|
558
|
-
|
|
562
|
+
}, { isAllSelected: d, isIndeterminate: C, toggleSelectAll: L } = fe(
|
|
563
|
+
E,
|
|
559
564
|
S,
|
|
560
|
-
|
|
565
|
+
I,
|
|
561
566
|
f
|
|
562
567
|
);
|
|
563
568
|
return {
|
|
564
569
|
// Values
|
|
565
570
|
chevronTitle: A,
|
|
566
|
-
conditionalClass:
|
|
567
|
-
hasAllPropsDisabled:
|
|
571
|
+
conditionalClass: v,
|
|
572
|
+
hasAllPropsDisabled: n,
|
|
568
573
|
isOpen: t,
|
|
569
574
|
isAllSelected: d,
|
|
570
|
-
isIndeterminate:
|
|
575
|
+
isIndeterminate: C,
|
|
571
576
|
isStaticCategory: a,
|
|
572
577
|
// Computed
|
|
573
578
|
showItemChildren: b,
|
|
574
579
|
categoryLabelProps: T,
|
|
575
580
|
// Methods
|
|
576
|
-
toggleOpen:
|
|
581
|
+
toggleOpen: r,
|
|
577
582
|
toggleSelectAll: L
|
|
578
583
|
};
|
|
579
584
|
}
|
|
580
585
|
});
|
|
581
|
-
var
|
|
586
|
+
var st = function() {
|
|
582
587
|
var e = this, t = e._self._c;
|
|
583
|
-
return e._self._setupProxy, t("div", [t("bento-listbox-option", { staticClass: "b-listbox-multi-select-category__option", class: e.conditionalClass }, [e.isStaticCategory ? e._e() : t("bento-checkbox", { attrs: { "model-value": e.isAllSelected, indeterminate: e.isIndeterminate, disabled: e.hasAllPropsDisabled, "aria-label": e.category.label, value: e.category.value }, on: { "update:model-value": e.toggleSelectAll } }), t("span", { staticClass: "b-listbox-multi-select-category__label" }, [t("bento-typography", e._b({ staticClass: "b-listbox-multi-select-category__label-text" }, "bento-typography", e.categoryLabelProps, !1), [e._v(" " + e._s(e.category.label) + " ")]), e.isStaticCategory ? e._e() : t("div", { staticClass: "b-listbox-multi-select-category__label-chevron", attrs: { "data-testid": "toggle-listbox" }, on: { "!click": function(l) {
|
|
588
|
+
return e._self._setupProxy, t("div", [t("bento-listbox-option", { staticClass: "b-listbox-multi-select-category__option", class: e.conditionalClass }, [e.isStaticCategory ? e._e() : t("bento-checkbox", { attrs: { "model-value": e.isAllSelected, indeterminate: e.isIndeterminate, disabled: e.hasAllPropsDisabled, "aria-label": e.category.label, value: e.category.value, tabindex: e.tabindex }, on: { "update:model-value": e.toggleSelectAll } }), t("span", { staticClass: "b-listbox-multi-select-category__label" }, [t("bento-typography", e._b({ staticClass: "b-listbox-multi-select-category__label-text" }, "bento-typography", e.categoryLabelProps, !1), [e._v(" " + e._s(e.category.label) + " ")]), e.isStaticCategory ? e._e() : t("div", { staticClass: "b-listbox-multi-select-category__label-chevron", attrs: { "data-testid": "toggle-listbox" }, on: { "!click": function(l) {
|
|
584
589
|
return e.toggleOpen.apply(null, arguments);
|
|
585
590
|
} } }, [e.isOpen ? t("chevron-up-icon", { attrs: { "svg-title": e.chevronTitle } }) : t("chevron-down-icon", { attrs: { "svg-title": e.chevronTitle } })], 1)], 1)], 1), t("div", { directives: [{ name: "show", rawName: "v-show", value: e.showItemChildren, expression: "showItemChildren" }] }, [e._t("default")], 2)], 1);
|
|
586
|
-
},
|
|
587
|
-
Qe,
|
|
588
|
-
et,
|
|
591
|
+
}, lt = [], nt = /* @__PURE__ */ D(
|
|
589
592
|
tt,
|
|
593
|
+
st,
|
|
594
|
+
lt,
|
|
590
595
|
!1,
|
|
591
596
|
null,
|
|
592
|
-
"
|
|
597
|
+
"09983823"
|
|
593
598
|
);
|
|
594
|
-
const
|
|
595
|
-
var
|
|
596
|
-
const
|
|
599
|
+
const ot = nt.exports;
|
|
600
|
+
var M = /* @__PURE__ */ ((s) => (s.SELECT_CATEGORY = "select-category", s.TOGGLE_CHECKBOX_SELECTION = "toggle-checkbox-selection", s.UNSELECT_CATEGORY = "unselect-category", s))(M || {});
|
|
601
|
+
const at = P({
|
|
597
602
|
name: "listbox-multi-select-options",
|
|
598
603
|
components: {
|
|
599
|
-
BentoCheckbox:
|
|
600
|
-
BentoListboxOption:
|
|
604
|
+
BentoCheckbox: J,
|
|
605
|
+
BentoListboxOption: V,
|
|
601
606
|
BentoTypography: G,
|
|
602
|
-
ListboxMultiSelectCategory:
|
|
607
|
+
ListboxMultiSelectCategory: ot
|
|
603
608
|
},
|
|
604
609
|
props: {
|
|
605
610
|
/**
|
|
@@ -608,6 +613,10 @@ const nt = P({
|
|
|
608
613
|
* Items of categories are automatically defined as "categoryItems"
|
|
609
614
|
*/
|
|
610
615
|
categoryItems: { type: Boolean, default: !1 },
|
|
616
|
+
/**
|
|
617
|
+
* Current focused option index
|
|
618
|
+
*/
|
|
619
|
+
focusedIndex: { type: Number, default: 0 },
|
|
611
620
|
/**
|
|
612
621
|
* Function that allows the options to be disabled
|
|
613
622
|
*
|
|
@@ -657,82 +666,83 @@ const nt = P({
|
|
|
657
666
|
staticCategories: { type: Boolean, default: !1 }
|
|
658
667
|
},
|
|
659
668
|
emits: [
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
669
|
+
M.TOGGLE_CHECKBOX_SELECTION,
|
|
670
|
+
M.SELECT_CATEGORY,
|
|
671
|
+
M.UNSELECT_CATEGORY
|
|
663
672
|
],
|
|
664
673
|
setup(s, { emit: e }) {
|
|
665
|
-
const t = (
|
|
666
|
-
e(
|
|
667
|
-
}, l = (
|
|
668
|
-
const
|
|
669
|
-
return
|
|
670
|
-
},
|
|
671
|
-
if (l(
|
|
672
|
-
return e(
|
|
673
|
-
t(
|
|
674
|
+
const t = (r) => {
|
|
675
|
+
e(M.TOGGLE_CHECKBOX_SELECTION, r);
|
|
676
|
+
}, l = (r) => !!r.items, o = (r) => {
|
|
677
|
+
const m = s.isMultiLevel && s.searching;
|
|
678
|
+
return r.description && (!s.isMultiLevel || m);
|
|
679
|
+
}, n = (r) => r.items ? !!r.items.find((m) => s.selectedItemsList.includes(m.value)) : s.selectedItemsList.includes(r.value), a = (r, m) => {
|
|
680
|
+
if (l(m))
|
|
681
|
+
return e(r ? M.SELECT_CATEGORY : M.UNSELECT_CATEGORY, m);
|
|
682
|
+
t(m.value);
|
|
674
683
|
};
|
|
675
684
|
return {
|
|
676
685
|
// Values
|
|
677
|
-
conditionalClasses:
|
|
686
|
+
conditionalClasses: c(() => ({
|
|
678
687
|
"b-listbox-multi-select-options__static-category-option": s.staticCategories,
|
|
679
688
|
"b-listbox-multi-select-options__category-option": s.categoryItems
|
|
680
689
|
})),
|
|
681
690
|
// Methods
|
|
682
|
-
isOptionSelected:
|
|
683
|
-
shouldShowDescription:
|
|
691
|
+
isOptionSelected: n,
|
|
692
|
+
shouldShowDescription: o,
|
|
684
693
|
toggleCheckboxSelection: t,
|
|
685
694
|
selectSearch: a,
|
|
695
|
+
computedTabindex: (r) => r + 1 === s.focusedIndex ? 0 : -1,
|
|
686
696
|
// Enums
|
|
687
|
-
BentoListboxEvent:
|
|
688
|
-
ListboxMultiSelectOptionsEvent:
|
|
697
|
+
BentoListboxEvent: i,
|
|
698
|
+
ListboxMultiSelectOptionsEvent: M
|
|
689
699
|
};
|
|
690
700
|
}
|
|
691
701
|
});
|
|
692
|
-
var
|
|
702
|
+
var it = function() {
|
|
693
703
|
var e = this, t = e._self._c;
|
|
694
|
-
return e._self._setupProxy, t("div", e._l(e.items, function(l) {
|
|
695
|
-
return t("div", { key: `selected-${l.value}` }, [e.searching && e.isMultiLevel ? [t("bento-listbox-option", { staticClass: "b-listbox-multi-select-options", class: e.conditionalClasses, attrs: { disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null } }, [t("bento-checkbox", { attrs: { "model-value": e.isOptionSelected(l), "aria-label": l.label, disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null, value: l.value }, on: { "update:model-value": (n) => e.selectSearch(n, l) } }), e._t("default", function() {
|
|
704
|
+
return e._self._setupProxy, t("div", e._l(e.items, function(l, o) {
|
|
705
|
+
return t("div", { key: `selected-${l.value}` }, [e.searching && e.isMultiLevel ? [t("bento-listbox-option", { staticClass: "b-listbox-multi-select-options", class: e.conditionalClasses, attrs: { disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null } }, [t("bento-checkbox", { attrs: { "model-value": e.isOptionSelected(l), "aria-label": l.label, disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null, value: l.value, tabindex: e.computedTabindex(o) }, on: { "update:model-value": (n) => e.selectSearch(n, l) } }), e._t("default", function() {
|
|
696
706
|
return [t("span", { staticClass: "b-listbox-multi-select__option-text" }, [t("bento-typography", { attrs: { el: "span" } }, [e._v(e._s(l.label))]), e.shouldShowDescription(l) ? t("bento-typography", { staticClass: "b-listbox-multi-select__option-description", attrs: { el: "span" } }, [e._v(" " + e._s(l.description) + " ")]) : e._e()], 1)];
|
|
697
|
-
}, null, l)], 2)] : [l.items ? [t("listbox-multi-select-category", { attrs: { category: l, "static-categories": e.staticCategories, "is-option-disabled": e.isOptionDisabled, "selected-items-list": e.selectedItemsList }, on: { "select-category": function(n) {
|
|
707
|
+
}, null, l)], 2)] : [l.items ? [t("listbox-multi-select-category", { attrs: { category: l, "static-categories": e.staticCategories, "is-option-disabled": e.isOptionDisabled, "selected-items-list": e.selectedItemsList, tabindex: e.computedTabindex(o) }, on: { "select-category": function(n) {
|
|
698
708
|
return e.$emit(e.ListboxMultiSelectOptionsEvent.SELECT_CATEGORY, l);
|
|
699
709
|
}, "unselect-category": function(n) {
|
|
700
710
|
return e.$emit(e.ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY, l);
|
|
701
|
-
} } }, [t("listbox-multi-select-options", { attrs: { "category-items": "", items: l.items, "is-option-disabled": e.isOptionDisabled, "is-multi-level": e.isMultiLevel, "static-categories": e.staticCategories, "selected-items-list": e.selectedItemsList, searching: e.searching }, on: { "toggle-checkbox-selection": (n) => e.toggleCheckboxSelection(n) } })], 1)] : t("bento-listbox-option", { staticClass: "b-listbox-multi-select-options", class: e.conditionalClasses, attrs: { disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null } }, [t("bento-checkbox", { attrs: { "model-value": e.selectedItemsList, "aria-label": l.label, disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null, value: l.value }, on: { "update:model-value": function(n) {
|
|
711
|
+
} } }, [t("listbox-multi-select-options", { attrs: { "category-items": "", items: l.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": (n) => e.toggleCheckboxSelection(n) } })], 1)] : t("bento-listbox-option", { staticClass: "b-listbox-multi-select-options", class: e.conditionalClasses, attrs: { disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null } }, [t("bento-checkbox", { attrs: { "model-value": e.selectedItemsList, "aria-label": l.label, disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null, value: l.value, tabindex: e.computedTabindex(o) }, on: { "update:model-value": function(n) {
|
|
702
712
|
return e.toggleCheckboxSelection(l);
|
|
703
713
|
} } }), e._t("default", function() {
|
|
704
714
|
return [t("span", { staticClass: "b-listbox-multi-select__option-text" }, [t("bento-typography", { attrs: { el: "span" } }, [e._v(e._s(l.label))]), e.shouldShowDescription(l) ? t("bento-typography", { staticClass: "b-listbox-multi-select__option-description", attrs: { el: "span" } }, [e._v(" " + e._s(l.description) + " ")]) : e._e()], 1)];
|
|
705
715
|
}, null, l)], 2)]], 2);
|
|
706
716
|
}), 0);
|
|
707
|
-
},
|
|
708
|
-
nt,
|
|
709
|
-
ot,
|
|
717
|
+
}, ct = [], rt = /* @__PURE__ */ D(
|
|
710
718
|
at,
|
|
719
|
+
it,
|
|
720
|
+
ct,
|
|
711
721
|
!1,
|
|
712
722
|
null,
|
|
713
|
-
"
|
|
723
|
+
"18d7cecf"
|
|
714
724
|
);
|
|
715
|
-
const
|
|
716
|
-
const e =
|
|
725
|
+
const ut = rt.exports, dt = (s) => {
|
|
726
|
+
const e = c(() => {
|
|
717
727
|
var l;
|
|
718
|
-
return !!((l = s.value) != null && l.find(({ items:
|
|
719
|
-
}), t =
|
|
728
|
+
return !!((l = s.value) != null && l.find(({ items: o }) => !!o));
|
|
729
|
+
}), t = c(() => {
|
|
720
730
|
var l;
|
|
721
|
-
return e.value ? (l = s.value) == null ? void 0 : l.reduce((
|
|
731
|
+
return e.value ? (l = s.value) == null ? void 0 : l.reduce((o, n) => (n.items ? o.push(...n.items.flat()) : o.push(n), o), []) : s.value;
|
|
722
732
|
});
|
|
723
733
|
return {
|
|
724
734
|
isMultiLevelSelect: e,
|
|
725
735
|
flattenedItemsList: t
|
|
726
736
|
};
|
|
727
|
-
},
|
|
737
|
+
}, bt = {
|
|
728
738
|
"en-US": {
|
|
729
739
|
allSelected: "All selected ({total})",
|
|
730
740
|
numberOfTotalSelected: "{number} of {total} selected",
|
|
731
741
|
numbersSelected: "{number} selected",
|
|
732
742
|
selectAll: "Select all ({total})"
|
|
733
743
|
}
|
|
734
|
-
},
|
|
735
|
-
...
|
|
744
|
+
}, ft = { i18n: { messages: bt } }, vt = /* @__PURE__ */ P({
|
|
745
|
+
...ft,
|
|
736
746
|
__name: "listbox-multi-select",
|
|
737
747
|
props: {
|
|
738
748
|
hasMoreItems: { type: Boolean, default: !1 },
|
|
@@ -745,140 +755,139 @@ const ct = it.exports, rt = (s) => {
|
|
|
745
755
|
},
|
|
746
756
|
emits: ["select"],
|
|
747
757
|
setup(s, { emit: e }) {
|
|
748
|
-
const t = s, { t: l } =
|
|
749
|
-
var
|
|
750
|
-
const
|
|
751
|
-
return { isDisabled:
|
|
752
|
-
},
|
|
753
|
-
if (t.searching &&
|
|
758
|
+
const t = s, { t: l } = X(), o = Ce(), n = O(null), a = O(null), b = O(null), v = c(() => t.selectedValues.map(({ value: u }) => u)), { isMultiLevelSelect: r, flattenedItemsList: m } = dt(w(t, "items")), S = (u) => {
|
|
759
|
+
var h;
|
|
760
|
+
const g = t.isOptionDisabled(u), p = ((h = v.value) == null ? void 0 : h.includes(u.value)) || !1;
|
|
761
|
+
return { isDisabled: g, isPreSelected: p };
|
|
762
|
+
}, E = c(() => {
|
|
763
|
+
if (t.searching && r)
|
|
754
764
|
return t.items;
|
|
755
|
-
const u =
|
|
756
|
-
const { isDisabled: p, isPreSelected:
|
|
757
|
-
return p &&
|
|
765
|
+
const u = m.value.filter((g) => {
|
|
766
|
+
const { isDisabled: p, isPreSelected: h } = S(g);
|
|
767
|
+
return p && h || !p;
|
|
758
768
|
});
|
|
759
|
-
return t.selectedValues.forEach((
|
|
760
|
-
u.find((p) => p.value ===
|
|
769
|
+
return t.selectedValues.forEach((g) => {
|
|
770
|
+
u.find((p) => p.value === g.value) || u.push(g);
|
|
761
771
|
}), u;
|
|
762
|
-
}), A =
|
|
772
|
+
}), A = c(
|
|
763
773
|
() => {
|
|
764
774
|
var u;
|
|
765
|
-
return (u =
|
|
775
|
+
return (u = E.value) == null ? void 0 : u.filter((g) => {
|
|
766
776
|
var p;
|
|
767
|
-
return
|
|
777
|
+
return g.items && r.value && t.searching ? g.items.filter(
|
|
768
778
|
(y) => (t.selectedValues ?? []).includes(y.value)
|
|
769
|
-
).length ===
|
|
779
|
+
).length === g.items.length : (p = v.value) == null ? void 0 : p.includes(g.value);
|
|
770
780
|
});
|
|
771
781
|
}
|
|
772
|
-
), T = () =>
|
|
773
|
-
var
|
|
774
|
-
const u =
|
|
775
|
-
return p === 0 ? l("selectAll", { total: u }) : p ===
|
|
782
|
+
), T = () => r.value && !t.searching ? m.value.length : t.items.length, I = c(() => {
|
|
783
|
+
var h;
|
|
784
|
+
const u = E.value.length, g = T(), p = ((h = A.value) == null ? void 0 : h.length) || 0;
|
|
785
|
+
return p === 0 ? l("selectAll", { total: u }) : p === g ? l("allSelected", { total: g }) : p <= g ? l("numberOfTotalSelected", { number: p, total: g }) : l("numbersSelected", { number: p });
|
|
776
786
|
}), f = (u) => {
|
|
777
|
-
const
|
|
778
|
-
const { isDisabled: y, isPreSelected:
|
|
779
|
-
return y &&
|
|
780
|
-
}, p = u.filter(
|
|
787
|
+
const g = (h) => {
|
|
788
|
+
const { isDisabled: y, isPreSelected: N } = S(h);
|
|
789
|
+
return y && N || !y;
|
|
790
|
+
}, p = u.filter(g).filter((h) => !v.value.includes(h.value));
|
|
781
791
|
e("select", [...t.selectedValues, ...p]);
|
|
782
792
|
}, d = (u) => {
|
|
783
|
-
const
|
|
784
|
-
const { isDisabled:
|
|
785
|
-
return !(
|
|
786
|
-
}, p = u.filter(
|
|
787
|
-
e("select",
|
|
788
|
-
},
|
|
789
|
-
f(
|
|
793
|
+
const g = (y) => {
|
|
794
|
+
const { isDisabled: N, isPreSelected: pe } = S(y);
|
|
795
|
+
return !(N && pe);
|
|
796
|
+
}, p = u.filter(g).map(({ value: y }) => y), h = t.selectedValues.filter((y) => !(p != null && p.includes(y.value)));
|
|
797
|
+
e("select", h);
|
|
798
|
+
}, C = () => {
|
|
799
|
+
f(m.value);
|
|
790
800
|
}, L = () => {
|
|
791
|
-
d(
|
|
792
|
-
}, { isAllSelected:
|
|
801
|
+
d(m.value);
|
|
802
|
+
}, { isAllSelected: _, isIndeterminate: x, toggleSelectAll: B } = fe(
|
|
793
803
|
A,
|
|
794
|
-
|
|
795
|
-
|
|
804
|
+
E,
|
|
805
|
+
C,
|
|
796
806
|
L
|
|
797
|
-
),
|
|
807
|
+
), $ = (u) => {
|
|
798
808
|
f(u.items);
|
|
799
|
-
},
|
|
809
|
+
}, Y = (u) => {
|
|
800
810
|
d(u.items);
|
|
801
|
-
}, W = (u,
|
|
811
|
+
}, W = (u, g) => {
|
|
802
812
|
let p = !1;
|
|
803
|
-
const
|
|
804
|
-
p ||
|
|
805
|
-
},
|
|
806
|
-
if (!
|
|
813
|
+
const h = t.selectedValues.filter(({ value: y }) => g.value === y ? (p = !0, !1) : !0);
|
|
814
|
+
p || h.push(g), e(u, h);
|
|
815
|
+
}, K = c(() => {
|
|
816
|
+
if (!r.value)
|
|
807
817
|
return t.selectedValues;
|
|
808
|
-
const u = (y) =>
|
|
818
|
+
const u = (y) => v.value.includes(y.value), g = (y) => !t.staticCategories && y.every((N) => u(N));
|
|
809
819
|
return t.items.flatMap(
|
|
810
|
-
(y) => y.items && !
|
|
820
|
+
(y) => y.items && !g(y.items) ? y.items : y
|
|
811
821
|
).filter((y) => y.items ? !0 : u(y));
|
|
812
|
-
}),
|
|
813
|
-
var p,
|
|
814
|
-
const u = ["automatic", "button"].includes(t.lazyLoadType),
|
|
815
|
-
return u && t.hasMoreItems ? !!((
|
|
816
|
-
}), U =
|
|
817
|
-
() =>
|
|
818
|
-
),
|
|
822
|
+
}), R = c(() => {
|
|
823
|
+
var p, h, y, N;
|
|
824
|
+
const u = ["automatic", "button"].includes(t.lazyLoadType), g = ((p = t.selectedValues) == null ? void 0 : p.length) > 0 && ((h = A.value) == null ? void 0 : h.length) !== ((y = m.value) == null ? void 0 : y.length);
|
|
825
|
+
return u && t.hasMoreItems ? !!((N = t.selectedValues) != null && N.length) : g;
|
|
826
|
+
}), U = c(() => ["automatic", "button"].includes(t.lazyLoadType) ? !t.hasMoreItems : !0), Q = c(
|
|
827
|
+
() => n.value ? [n.value] : []
|
|
828
|
+
), ee = c(
|
|
819
829
|
() => {
|
|
820
|
-
var u;
|
|
821
|
-
return (u =
|
|
822
|
-
}
|
|
823
|
-
), ee = r(
|
|
824
|
-
() => {
|
|
825
|
-
var u, _;
|
|
826
|
-
return (_ = (u = b.value) == null ? void 0 : u.$children) != null && _.length ? b.value.$children : [];
|
|
830
|
+
var u, g;
|
|
831
|
+
return (g = (u = b.value) == null ? void 0 : u.$children) != null && g.length ? b.value.$children : [];
|
|
827
832
|
}
|
|
828
|
-
), te =
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
833
|
+
), te = c(() => ({ label: I, value: _ })), se = c(() => [te, ...w(t, "items").value]), le = (u) => {
|
|
834
|
+
var h;
|
|
835
|
+
const g = [...Q.value, ...ee.value], p = g[u].$el;
|
|
836
|
+
p.tagName === "LABEL" ? p.focus() : (h = p.querySelector("label")) == null || h.focus(), g[u].$el.focus();
|
|
837
|
+
}, {
|
|
838
|
+
moveToNextElement: ne,
|
|
839
|
+
moveToPreviousElement: oe,
|
|
840
|
+
moveToFirstElement: ae,
|
|
841
|
+
moveToLastElement: ie,
|
|
842
|
+
preventDefault: q,
|
|
843
|
+
focusedIndex: me
|
|
844
|
+
} = ve(
|
|
839
845
|
{
|
|
840
846
|
items: O(se),
|
|
841
847
|
isOptionDisabled: t.isOptionDisabled,
|
|
842
|
-
hasStaticCategories:
|
|
848
|
+
hasStaticCategories: w(t, "staticCategories")
|
|
843
849
|
},
|
|
844
850
|
le
|
|
845
|
-
),
|
|
851
|
+
), _e = {
|
|
846
852
|
[k.ARROW_UP]: (u) => oe(u),
|
|
847
853
|
[k.ARROW_DOWN]: (u) => ne(u),
|
|
848
854
|
[k.HOME]: ae,
|
|
849
855
|
[k.END]: ie
|
|
856
|
+
}, ge = {
|
|
857
|
+
[k.ARROW_UP]: q,
|
|
858
|
+
[k.ARROW_DOWN]: q
|
|
850
859
|
};
|
|
851
|
-
return { __sfc: !0, props: t, emit: e, t: l, slots:
|
|
860
|
+
return { __sfc: !0, props: t, emit: e, t: l, slots: o, selectAllListboxItemsRef: n, selectedListboxItemsRef: a, listboxItemsRef: b, selectedItemsList: v, isMultiLevelSelect: r, flattenedItemsList: m, optionStates: S, enabledItems: E, visibleSelectedList: A, calculateTotalItems: T, selectAllCheckboxText: I, selectAll: f, unselectAll: d, selectAllItems: C, unselectAllItems: L, isAllSelected: _, isIndeterminate: x, toggleSelectAll: B, selectAllCategory: $, unselectAllCategory: Y, toggleCheckboxSelection: W, selectedOptions: K, showSelectedItems: R, showSelectAllCheckbox: U, computedSelectAllListboxItemsRefs: Q, computedlistboxItems: ee, computedselectAllItemRefs: te, computedItems: se, focusItem: le, moveToNextElement: ne, moveToPreviousElement: oe, moveToFirstElement: ae, moveToLastElement: ie, preventDefault: q, focusedIndex: me, listboxListeners: _e, chipsSectionListeners: ge, BentoCheckbox: J, BentoTypography: G, BentoChip: Ee, BentoListboxOption: V, ListboxMultiSelectOptions: ut, vBentoKeyboardNavigationDirective: Z, BentoListboxEvent: i };
|
|
852
861
|
}
|
|
853
862
|
});
|
|
854
|
-
var
|
|
863
|
+
var mt = function() {
|
|
855
864
|
var e = this, t = e._self._c, l = e._self._setupProxy;
|
|
856
|
-
return t("div", e._g({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], staticClass: "b-listbox-multi-
|
|
857
|
-
return t("li", { key:
|
|
858
|
-
|
|
865
|
+
return t("div", { staticClass: "b-listbox-multi-select" }, [l.showSelectedItems ? t("div", [t("ul", e._g({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], staticClass: "b-listbox-multi-select__chips" }, l.chipsSectionListeners), e._l(l.selectedOptions, function(o) {
|
|
866
|
+
return t("li", { key: o.value }, [t(l.BentoChip, { ref: "selectedListboxItemsRef", refInFor: !0, attrs: { disabled: e.isOptionDisabled(o), label: o.label, condensed: "" }, on: { click: function(n) {
|
|
867
|
+
o.items ? l.unselectAllCategory(o) : l.toggleCheckboxSelection("select", o);
|
|
859
868
|
} } })], 1);
|
|
860
|
-
}), 0), t("hr", { staticClass: "b-listbox-multi-select__divider" })]) : e._e(), l.showSelectAllCheckbox ? t(l.BentoListboxOption, { ref: "selectAllListboxItemsRef", staticClass: "b-listbox-multi-select__option" }, [t(l.BentoCheckbox, { attrs: { "aria-label": l.selectAllCheckboxText, "model-value": l.isAllSelected, indeterminate: l.isIndeterminate }, on: { "update:model-value": l.toggleSelectAll } }), t(l.BentoTypography, { attrs: { el: "span", "aria-hidden": "true" } }, [e._v(" " + e._s(l.selectAllCheckboxText) + " ")])], 1) : e._e(), l.showSelectAllCheckbox ? t("hr", { staticClass: "b-listbox-multi-select__divider" }) : e._e(), t(l.ListboxMultiSelectOptions, { ref: "listboxItemsRef", attrs: { items: e.items, "is-option-disabled": e.isOptionDisabled, "is-multi-level": l.isMultiLevelSelect, "static-categories": e.staticCategories, searching: e.searching, "selected-items-list": l.selectedItemsList }, on: { "toggle-checkbox-selection": function(
|
|
861
|
-
return l.toggleCheckboxSelection("select",
|
|
862
|
-
}, "select-category": l.selectAllCategory, "unselect-category": l.unselectAllCategory, "space-pressed": function(
|
|
863
|
-
return l.toggleCheckboxSelection(l.BentoListboxEvent.SPACE,
|
|
864
|
-
}, "tab-pressed": function(
|
|
865
|
-
return l.toggleCheckboxSelection(l.BentoListboxEvent.TAB,
|
|
866
|
-
}, "enter-pressed": function(
|
|
867
|
-
return l.toggleCheckboxSelection(l.BentoListboxEvent.ENTER,
|
|
868
|
-
} }, scopedSlots: e._u([e._l(l.slots, function(
|
|
869
|
-
return { key:
|
|
870
|
-
return [e._t(
|
|
869
|
+
}), 0), t("hr", { staticClass: "b-listbox-multi-select__divider" })]) : e._e(), t("div", e._g({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }] }, l.listboxListeners), [l.showSelectAllCheckbox ? t(l.BentoListboxOption, { ref: "selectAllListboxItemsRef", staticClass: "b-listbox-multi-select__option" }, [t(l.BentoCheckbox, { attrs: { "aria-label": l.selectAllCheckboxText, "model-value": l.isAllSelected, indeterminate: l.isIndeterminate, tabindex: l.focusedIndex === 0 ? 0 : -1 }, on: { "update:model-value": l.toggleSelectAll } }), t(l.BentoTypography, { attrs: { el: "span", "aria-hidden": "true" } }, [e._v(" " + e._s(l.selectAllCheckboxText) + " ")])], 1) : e._e(), l.showSelectAllCheckbox ? t("hr", { staticClass: "b-listbox-multi-select__divider" }) : e._e(), t(l.ListboxMultiSelectOptions, { ref: "listboxItemsRef", attrs: { items: e.items, "is-option-disabled": e.isOptionDisabled, "is-multi-level": l.isMultiLevelSelect, "static-categories": e.staticCategories, searching: e.searching, "selected-items-list": l.selectedItemsList, "focused-index": l.focusedIndex }, on: { "toggle-checkbox-selection": function(o) {
|
|
870
|
+
return l.toggleCheckboxSelection("select", o);
|
|
871
|
+
}, "select-category": l.selectAllCategory, "unselect-category": l.unselectAllCategory, "space-pressed": function(o) {
|
|
872
|
+
return l.toggleCheckboxSelection(l.BentoListboxEvent.SPACE, o);
|
|
873
|
+
}, "tab-pressed": function(o) {
|
|
874
|
+
return l.toggleCheckboxSelection(l.BentoListboxEvent.TAB, o);
|
|
875
|
+
}, "enter-pressed": function(o) {
|
|
876
|
+
return l.toggleCheckboxSelection(l.BentoListboxEvent.ENTER, o);
|
|
877
|
+
} }, scopedSlots: e._u([e._l(l.slots, function(o, n) {
|
|
878
|
+
return { key: n, fn: function(a) {
|
|
879
|
+
return [e._t(n, null, null, a)];
|
|
871
880
|
} };
|
|
872
|
-
})], null, !0) })], 1);
|
|
873
|
-
},
|
|
874
|
-
bt,
|
|
875
|
-
ft,
|
|
881
|
+
})], null, !0) })], 1)]);
|
|
882
|
+
}, _t = [], gt = /* @__PURE__ */ D(
|
|
876
883
|
vt,
|
|
884
|
+
mt,
|
|
885
|
+
_t,
|
|
877
886
|
!1,
|
|
878
887
|
null,
|
|
879
|
-
"
|
|
888
|
+
"57c7482e"
|
|
880
889
|
);
|
|
881
|
-
const ue =
|
|
890
|
+
const ue = gt.exports, pt = {
|
|
882
891
|
"en-US": {
|
|
883
892
|
loading: "Loading",
|
|
884
893
|
showMore: "Show more"
|
|
@@ -891,18 +900,18 @@ const ue = mt.exports, _t = {
|
|
|
891
900
|
loading: "Carregando",
|
|
892
901
|
showMore: "Mostrar mais"
|
|
893
902
|
}
|
|
894
|
-
},
|
|
903
|
+
}, yt = 36, Ct = P({
|
|
895
904
|
name: "bento-listbox",
|
|
896
905
|
components: {
|
|
897
|
-
BentoEmptyState:
|
|
898
|
-
BentoListboxSingleSelect:
|
|
906
|
+
BentoEmptyState: he,
|
|
907
|
+
BentoListboxSingleSelect: Qe,
|
|
899
908
|
BentoListboxMultiSelect: ue,
|
|
900
909
|
BentoTypography: G,
|
|
901
|
-
BentoLoadingIndicator:
|
|
902
|
-
BentoLoadingButton:
|
|
910
|
+
BentoLoadingIndicator: Se,
|
|
911
|
+
BentoLoadingButton: Te
|
|
903
912
|
},
|
|
904
|
-
directives: { BentoKeyboardNavigationDirective:
|
|
905
|
-
i18n: { messages:
|
|
913
|
+
directives: { BentoKeyboardNavigationDirective: Z },
|
|
914
|
+
i18n: { messages: pt },
|
|
906
915
|
props: {
|
|
907
916
|
/**
|
|
908
917
|
* Defines a string value that labels an interactive element.
|
|
@@ -958,8 +967,8 @@ const ue = mt.exports, _t = {
|
|
|
958
967
|
*/
|
|
959
968
|
lazyLoadType: {
|
|
960
969
|
type: String,
|
|
961
|
-
default:
|
|
962
|
-
validator: (s) => Object.values(
|
|
970
|
+
default: F.NONE,
|
|
971
|
+
validator: (s) => Object.values(F).includes(s)
|
|
963
972
|
},
|
|
964
973
|
/**
|
|
965
974
|
* Indicates the listbox is loading filtered items.
|
|
@@ -1003,130 +1012,130 @@ const ue = mt.exports, _t = {
|
|
|
1003
1012
|
}
|
|
1004
1013
|
},
|
|
1005
1014
|
emits: [
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1015
|
+
i.SELECT,
|
|
1016
|
+
i.SPACE,
|
|
1017
|
+
i.SHOW_MORE,
|
|
1018
|
+
i.ENTER,
|
|
1019
|
+
i.ESCAPE,
|
|
1020
|
+
i.TAB
|
|
1012
1021
|
],
|
|
1013
1022
|
setup(s, { emit: e, slots: t }) {
|
|
1014
|
-
const l = O([]),
|
|
1015
|
-
var
|
|
1016
|
-
return typeof (s == null ? void 0 : s.virtualScroll) == "object" && ((
|
|
1023
|
+
const l = O([]), o = w(s, "items"), { t: n } = X(), a = c(() => s.lazyLoadType !== F.AUTOMATIC), b = c(() => s.lazyLoadType === F.AUTOMATIC), v = () => {
|
|
1024
|
+
var R;
|
|
1025
|
+
return typeof (s == null ? void 0 : s.virtualScroll) == "object" && ((R = s == null ? void 0 : s.virtualScroll) != null && R.itemHeight) ? s.virtualScroll.itemHeight : yt;
|
|
1017
1026
|
}, {
|
|
1018
|
-
containerRef:
|
|
1019
|
-
containerProps:
|
|
1027
|
+
containerRef: r,
|
|
1028
|
+
containerProps: m,
|
|
1020
1029
|
onScroll: S,
|
|
1021
|
-
list:
|
|
1030
|
+
list: E,
|
|
1022
1031
|
wrapperProps: A
|
|
1023
|
-
} =
|
|
1024
|
-
itemHeight:
|
|
1032
|
+
} = Ie(o, {
|
|
1033
|
+
itemHeight: v(),
|
|
1025
1034
|
// Disable virtual scrolling if not enabled or if lazy loading is enabled or if multi-select
|
|
1026
1035
|
disabled: (s == null ? void 0 : s.multiple) || (s == null ? void 0 : s.virtualScroll) === !1 || (s == null ? void 0 : s.lazyLoadType) !== "none"
|
|
1027
|
-
}), T =
|
|
1036
|
+
}), T = c(
|
|
1028
1037
|
() => s.componentLoading !== void 0 || a.value ? "true" : void 0
|
|
1029
|
-
),
|
|
1038
|
+
), I = c(
|
|
1030
1039
|
() => a.value && s.loading || s.componentLoading ? "true" : "false"
|
|
1031
|
-
), f =
|
|
1040
|
+
), f = c(
|
|
1032
1041
|
() => a.value || s.componentLoading !== void 0 ? "polite" : void 0
|
|
1033
|
-
), d = (
|
|
1034
|
-
e(
|
|
1035
|
-
},
|
|
1036
|
-
e(
|
|
1037
|
-
}, L =
|
|
1038
|
-
const
|
|
1039
|
-
if (!
|
|
1042
|
+
), d = (R) => (U) => {
|
|
1043
|
+
e(R, U);
|
|
1044
|
+
}, C = () => {
|
|
1045
|
+
e(i.SHOW_MORE);
|
|
1046
|
+
}, L = xe(() => {
|
|
1047
|
+
const R = r.value;
|
|
1048
|
+
if (!R)
|
|
1040
1049
|
return;
|
|
1041
|
-
const U = Math.round(
|
|
1042
|
-
s.hasMoreItems && U && !s.loading &&
|
|
1043
|
-
}),
|
|
1050
|
+
const U = Math.round(R.scrollTop) + R.clientHeight >= R.scrollHeight;
|
|
1051
|
+
s.hasMoreItems && U && !s.loading && C();
|
|
1052
|
+
}), _ = () => {
|
|
1044
1053
|
b.value ? L() : S();
|
|
1045
|
-
}, x =
|
|
1046
|
-
var
|
|
1047
|
-
return ((
|
|
1048
|
-
}), B =
|
|
1049
|
-
() => s.lazyLoadType ===
|
|
1050
|
-
),
|
|
1054
|
+
}, x = c(() => {
|
|
1055
|
+
var R;
|
|
1056
|
+
return ((R = s.items) == null ? void 0 : R.length) === 0;
|
|
1057
|
+
}), B = c(
|
|
1058
|
+
() => s.lazyLoadType === F.BUTTON && s.hasMoreItems
|
|
1059
|
+
), $ = c(
|
|
1051
1060
|
() => s.loading ? ce.LOADING : ce.START
|
|
1052
|
-
),
|
|
1061
|
+
), Y = c(() => s.loading ? n("loading") : n("showMore")), W = c(() => ({
|
|
1053
1062
|
...s.emptyState,
|
|
1054
1063
|
variant: "condensed"
|
|
1055
|
-
})),
|
|
1056
|
-
[
|
|
1057
|
-
[
|
|
1058
|
-
[
|
|
1059
|
-
[
|
|
1064
|
+
})), K = {
|
|
1065
|
+
[i.SELECT]: d(i.SELECT),
|
|
1066
|
+
[i.SPACE]: d(i.SPACE),
|
|
1067
|
+
[i.TAB]: d(i.TAB),
|
|
1068
|
+
[i.ENTER]: d(i.ENTER)
|
|
1060
1069
|
};
|
|
1061
1070
|
return {
|
|
1062
1071
|
// Refs
|
|
1063
|
-
listboxRef:
|
|
1072
|
+
listboxRef: r,
|
|
1064
1073
|
listboxItemRef: l,
|
|
1065
1074
|
// a11y
|
|
1066
1075
|
ariaAtomic: T,
|
|
1067
|
-
ariaBusy:
|
|
1076
|
+
ariaBusy: I,
|
|
1068
1077
|
ariaLive: f,
|
|
1069
1078
|
// Values
|
|
1070
|
-
containerProps:
|
|
1079
|
+
containerProps: m,
|
|
1071
1080
|
isSearchResultEmpty: x,
|
|
1072
1081
|
limitedEmptyStateProps: W,
|
|
1073
|
-
loadingButtonState:
|
|
1082
|
+
loadingButtonState: $,
|
|
1074
1083
|
slots: t,
|
|
1075
1084
|
shouldDisplayShowMoreButton: B,
|
|
1076
|
-
showMoreButtonText:
|
|
1077
|
-
virtualisedItems:
|
|
1085
|
+
showMoreButtonText: Y,
|
|
1086
|
+
virtualisedItems: E,
|
|
1078
1087
|
wrapperProps: A,
|
|
1079
1088
|
// Enums
|
|
1080
1089
|
BentoKeyboardNavigationKeyDownEvent: k,
|
|
1081
|
-
BentoListboxEvent:
|
|
1090
|
+
BentoListboxEvent: i,
|
|
1082
1091
|
// Methods
|
|
1083
|
-
onListboxContainerScroll:
|
|
1092
|
+
onListboxContainerScroll: _,
|
|
1084
1093
|
onOptionSelected: d,
|
|
1085
|
-
emitShowMore:
|
|
1086
|
-
listboxListeners:
|
|
1094
|
+
emitShowMore: C,
|
|
1095
|
+
listboxListeners: K
|
|
1087
1096
|
};
|
|
1088
1097
|
}
|
|
1089
1098
|
});
|
|
1090
|
-
var
|
|
1099
|
+
var St = function() {
|
|
1091
1100
|
var l;
|
|
1092
1101
|
var e = this, t = e._self._c;
|
|
1093
|
-
return e._self._setupProxy, t("div", { directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], ref: "listboxRef", staticClass: "b-listbox", style: (l = e.containerProps) == null ? void 0 : l.style, attrs: { id: e.id, role: "listbox", tabindex: "-1", "aria-busy": e.ariaBusy, "aria-atomic": e.ariaAtomic, "aria-label": e.ariaLabel, "aria-live": e.ariaLive }, on: { scroll: e.onListboxContainerScroll } }, [t("div", e._b({}, "div", e.wrapperProps, !1), [e.componentLoading ? t("div", { staticClass: "b-listbox__loading-filtered-items" }, [t("bento-loading-indicator")], 1) : e.isSearchResultEmpty ? t("div", { staticClass: "b-listbox__empty-search-message" }, [e.emptyState ? t("bento-empty-state", e._b({}, "bento-empty-state", e.limitedEmptyStateProps, !1)) : t("bento-typography", { attrs: { el: "span" } }, [e._v(e._s(e.noResultsMessage))])], 1) : [e.multiple ? [t("bento-listbox-multi-select", e._g({ 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(
|
|
1094
|
-
return { key:
|
|
1095
|
-
return [e._t(
|
|
1102
|
+
return e._self._setupProxy, t("div", { directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], ref: "listboxRef", staticClass: "b-listbox", style: (l = e.containerProps) == null ? void 0 : l.style, attrs: { id: e.id, role: "listbox", tabindex: "-1", "aria-busy": e.ariaBusy, "aria-atomic": e.ariaAtomic, "aria-label": e.ariaLabel, "aria-live": e.ariaLive }, on: { scroll: e.onListboxContainerScroll } }, [t("div", e._b({}, "div", e.wrapperProps, !1), [e.componentLoading ? t("div", { staticClass: "b-listbox__loading-filtered-items" }, [t("bento-loading-indicator")], 1) : e.isSearchResultEmpty ? t("div", { staticClass: "b-listbox__empty-search-message" }, [e.emptyState ? t("bento-empty-state", e._b({}, "bento-empty-state", e.limitedEmptyStateProps, !1)) : t("bento-typography", { attrs: { el: "span" } }, [e._v(e._s(e.noResultsMessage))])], 1) : [e.multiple ? [t("bento-listbox-multi-select", e._g({ 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(o, n) {
|
|
1103
|
+
return { key: n, fn: function(a) {
|
|
1104
|
+
return [e._t(n, null, null, a)];
|
|
1096
1105
|
} };
|
|
1097
|
-
})], null, !0) }, e.listboxListeners))] : [t("bento-listbox-single-select", e._g({ 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(
|
|
1098
|
-
return { key:
|
|
1099
|
-
return [e._t(
|
|
1106
|
+
})], null, !0) }, e.listboxListeners))] : [t("bento-listbox-single-select", e._g({ 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(o, n) {
|
|
1107
|
+
return { key: n, fn: function(a) {
|
|
1108
|
+
return [e._t(n, null, null, a)];
|
|
1100
1109
|
} };
|
|
1101
|
-
})], null, !0) }, e.listboxListeners))], e.shouldDisplayShowMoreButton ? t("div", { staticClass: "b-listbox__lazy-load" }, [t("bento-loading-button", { attrs: { state: e.loadingButtonState, variant: "secondary" }, on: { "!click": function(
|
|
1110
|
+
})], null, !0) }, e.listboxListeners))], e.shouldDisplayShowMoreButton ? t("div", { staticClass: "b-listbox__lazy-load" }, [t("bento-loading-button", { attrs: { state: e.loadingButtonState, variant: "secondary" }, on: { "!click": function(o) {
|
|
1102
1111
|
return e.emitShowMore.apply(null, arguments);
|
|
1103
1112
|
} } }, [e._v(" " + e._s(e.showMoreButtonText) + " ")])], 1) : e.loading ? t("div", { staticClass: "b-listbox__lazy-load" }, [t("bento-loading-indicator")], 1) : e._e()]], 2)]);
|
|
1104
|
-
},
|
|
1105
|
-
pt,
|
|
1106
|
-
yt,
|
|
1113
|
+
}, ht = [], xt = /* @__PURE__ */ D(
|
|
1107
1114
|
Ct,
|
|
1115
|
+
St,
|
|
1116
|
+
ht,
|
|
1108
1117
|
!1,
|
|
1109
1118
|
null,
|
|
1110
1119
|
"37a9ab16"
|
|
1111
1120
|
);
|
|
1112
|
-
const
|
|
1121
|
+
const Ft = xt.exports, H = (s, e) => {
|
|
1113
1122
|
for (const t of s) {
|
|
1114
1123
|
if (t.value === e)
|
|
1115
1124
|
return t;
|
|
1116
1125
|
if (t.items) {
|
|
1117
|
-
const l =
|
|
1126
|
+
const l = H(t.items, e);
|
|
1118
1127
|
if (l)
|
|
1119
1128
|
return l;
|
|
1120
1129
|
}
|
|
1121
1130
|
}
|
|
1122
1131
|
return null;
|
|
1123
|
-
},
|
|
1124
|
-
const l = O([]),
|
|
1125
|
-
t.value ?
|
|
1126
|
-
}, a = (
|
|
1127
|
-
l.value =
|
|
1132
|
+
}, Gt = (s, e, t) => {
|
|
1133
|
+
const l = O([]), o = O(), n = (v) => {
|
|
1134
|
+
t.value ? o.value = v.map(({ value: r }) => r) : o.value = v.length > 0 ? v[0].value : null;
|
|
1135
|
+
}, a = (v) => {
|
|
1136
|
+
l.value = v, n(v);
|
|
1128
1137
|
}, b = () => {
|
|
1129
|
-
l.value = [],
|
|
1138
|
+
l.value = [], o.value = null;
|
|
1130
1139
|
};
|
|
1131
1140
|
return be(
|
|
1132
1141
|
() => e.value,
|
|
@@ -1135,34 +1144,34 @@ const wt = St.exports, j = (s, e) => {
|
|
|
1135
1144
|
b();
|
|
1136
1145
|
return;
|
|
1137
1146
|
}
|
|
1138
|
-
const
|
|
1147
|
+
const v = !Array.isArray(e.value), r = [...l.value];
|
|
1139
1148
|
b();
|
|
1140
|
-
const
|
|
1141
|
-
let
|
|
1142
|
-
|
|
1149
|
+
const m = (S) => {
|
|
1150
|
+
let E = H(s.value, S);
|
|
1151
|
+
E || (E = H(r, S)), E || (E = { value: S, label: S.toString() }), l.value.push(E);
|
|
1143
1152
|
};
|
|
1144
|
-
if (
|
|
1153
|
+
if (v) {
|
|
1145
1154
|
const S = e.value;
|
|
1146
|
-
|
|
1155
|
+
m(S), n(l.value);
|
|
1147
1156
|
return;
|
|
1148
1157
|
}
|
|
1149
|
-
e.value.forEach(
|
|
1158
|
+
e.value.forEach(m), n(l.value);
|
|
1150
1159
|
},
|
|
1151
1160
|
{ immediate: !0 }
|
|
1152
1161
|
), {
|
|
1153
1162
|
// Values
|
|
1154
1163
|
cachedSelectedListboxOptions: l,
|
|
1155
|
-
cachedListboxSelectedValues:
|
|
1164
|
+
cachedListboxSelectedValues: o,
|
|
1156
1165
|
// Methods
|
|
1157
1166
|
resetCache: b,
|
|
1158
1167
|
setCachedValues: a
|
|
1159
1168
|
};
|
|
1160
1169
|
};
|
|
1161
1170
|
export {
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1171
|
+
F as B,
|
|
1172
|
+
i as a,
|
|
1173
|
+
Ft as b,
|
|
1174
|
+
Gt as c,
|
|
1175
|
+
dt as u
|
|
1167
1176
|
};
|
|
1168
|
-
//# sourceMappingURL=use-cached-selected-values.
|
|
1177
|
+
//# sourceMappingURL=use-cached-selected-values.D6lOsd0o.js.map
|