@adyen/bento-vue3 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.CUDi5Po7.js → action-bar.CDOaDenE.js} +5 -5
- package/dist/chunks/{action-bar.CUDi5Po7.js.map → action-bar.CDOaDenE.js.map} +1 -1
- package/dist/chunks/{alert.DEf0borp.js → alert.4SefwHLO.js} +2 -2
- package/dist/chunks/{alert.DEf0borp.js.map → alert.4SefwHLO.js.map} +1 -1
- package/dist/chunks/{base-modal.BegK8cPb.js → base-modal.DZy1WuJs.js} +5 -5
- package/dist/chunks/{base-modal.BegK8cPb.js.map → base-modal.DZy1WuJs.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.CcoKss9T.js → button-actions-with-menu.DQRTu42W.js} +4 -4
- package/dist/chunks/{button-actions-with-menu.CcoKss9T.js.map → button-actions-with-menu.DQRTu42W.js.map} +1 -1
- package/dist/chunks/{button-actions.CdlXZ29B.js → button-actions.N99QthUv.js} +2 -2
- package/dist/chunks/{button-actions.CdlXZ29B.js.map → button-actions.N99QthUv.js.map} +1 -1
- package/dist/chunks/{button.6HMG0xEY.js → button.DEVuqLVT.js} +2 -2
- package/dist/chunks/button.DEVuqLVT.js.map +1 -0
- package/dist/chunks/{calendar.BRsV4rkQ.js → calendar.CNt90BvO.js} +2 -2
- package/dist/chunks/calendar.CNt90BvO.js.map +1 -0
- package/dist/chunks/{card.C5bSqYsB.js → card.E2xhS_6Z.js} +2 -2
- package/dist/chunks/{card.C5bSqYsB.js.map → card.E2xhS_6Z.js.map} +1 -1
- package/dist/chunks/{checkbox-group.D235-2lq.js → checkbox-group.BMzsgOeI.js} +4 -4
- package/dist/chunks/{checkbox-group.D235-2lq.js.map → checkbox-group.BMzsgOeI.js.map} +1 -1
- package/dist/chunks/{checkbox.Dts62P-X.js → checkbox.BIaD03Bg.js} +17 -17
- package/dist/chunks/{checkbox.Dts62P-X.js.map → checkbox.BIaD03Bg.js.map} +1 -1
- package/dist/chunks/{code-snippet.BPZLkv_Z.js → code-snippet.DJgiqDzZ.js} +6 -6
- package/dist/chunks/{code-snippet.BPZLkv_Z.js.map → code-snippet.DJgiqDzZ.js.map} +1 -1
- package/dist/chunks/{controls-group.DcbOWqxA.js → controls-group.DJqvAWte.js} +2 -2
- package/dist/chunks/{controls-group.DcbOWqxA.js.map → controls-group.DJqvAWte.js.map} +1 -1
- package/dist/chunks/{copy.CFhrpASp.js → copy.MId-I684.js} +11 -11
- package/dist/chunks/{copy.CFhrpASp.js.map → copy.MId-I684.js.map} +1 -1
- package/dist/chunks/dashboard-section.CrbSjoA8.js +165 -0
- package/dist/chunks/dashboard-section.CrbSjoA8.js.map +1 -0
- package/dist/chunks/{dashed-underline.BYAXhfnX.js → dashed-underline.DWhGZIhS.js} +3 -3
- package/dist/chunks/{dashed-underline.BYAXhfnX.js.map → dashed-underline.DWhGZIhS.js.map} +1 -1
- package/dist/chunks/data-grid-template.LlK-7o84.js +93 -0
- package/dist/chunks/data-grid-template.LlK-7o84.js.map +1 -0
- package/dist/chunks/data-grid.CsyayKK3.js +3490 -0
- package/dist/chunks/data-grid.CsyayKK3.js.map +1 -0
- package/dist/chunks/{date-picker.DU9L_7lU.js → date-picker.CjwoOQ3B.js} +5 -5
- package/dist/chunks/{date-picker.DU9L_7lU.js.map → date-picker.CjwoOQ3B.js.map} +1 -1
- package/dist/chunks/{date-range-picker.LJJE3q1u.js → date-range-picker.DGY91Rwc.js} +27 -24
- package/dist/chunks/date-range-picker.DGY91Rwc.js.map +1 -0
- package/dist/chunks/{dialog-page.CXQafL9G.js → dialog-page.BRlAYf5w.js} +2 -2
- package/dist/chunks/{dialog-page.CXQafL9G.js.map → dialog-page.BRlAYf5w.js.map} +1 -1
- package/dist/chunks/{dropdown-default-textbox.CwsgzDpx.js → dropdown-default-textbox.CTyt2klK.js} +30 -30
- package/dist/chunks/{dropdown-default-textbox.CwsgzDpx.js.map → dropdown-default-textbox.CTyt2klK.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.Deu1Ekpp.js → dropdown-tag.CJtSH5cZ.js} +3 -3
- package/dist/chunks/{dropdown-tag.Deu1Ekpp.js.map → dropdown-tag.CJtSH5cZ.js.map} +1 -1
- package/dist/chunks/{dropdown.BAwhx8jI.js → dropdown.CQvyjn6d.js} +8 -8
- package/dist/chunks/{dropdown.BAwhx8jI.js.map → dropdown.CQvyjn6d.js.map} +1 -1
- package/dist/chunks/{empty-state.BffIZp3a.js → empty-state.m0U14LVw.js} +2 -2
- package/dist/chunks/{empty-state.BffIZp3a.js.map → empty-state.m0U14LVw.js.map} +1 -1
- package/dist/chunks/{error-message.DH8Er2JS.js → error-message.CMgsMDny.js} +2 -2
- package/dist/chunks/{error-message.DH8Er2JS.js.map → error-message.CMgsMDny.js.map} +1 -1
- package/dist/chunks/es6.BtaxuP0b.js.map +1 -1
- package/dist/chunks/{file-uploader.DkQDzuzC.js → file-uploader.D3KUe-MO.js} +5 -5
- package/dist/chunks/{file-uploader.DkQDzuzC.js.map → file-uploader.D3KUe-MO.js.map} +1 -1
- package/dist/chunks/{filter-bar.CqO88Dv2.js → filter-bar.cRJmUX-v.js} +30 -27
- package/dist/chunks/filter-bar.cRJmUX-v.js.map +1 -0
- package/dist/chunks/{fixed-scroller.Bfk75Nei.js → fixed-scroller.BNP4SR5J.js} +2 -2
- package/dist/chunks/{fixed-scroller.Bfk75Nei.js.map → fixed-scroller.BNP4SR5J.js.map} +1 -1
- package/dist/chunks/{focus-trap.BFCzfiI_.js → focus-trap.D9cfQpl7.js} +6 -6
- package/dist/chunks/{focus-trap.BFCzfiI_.js.map → focus-trap.D9cfQpl7.js.map} +1 -1
- package/dist/chunks/{footer-actions.A9H5F5D-.js → footer-actions.DmGDpPBW.js} +3 -3
- package/dist/chunks/{footer-actions.A9H5F5D-.js.map → footer-actions.DmGDpPBW.js.map} +1 -1
- package/dist/chunks/{form-layout-title.BWCOZyay.js → form-layout-title.P5ajTo4C.js} +2 -2
- package/dist/chunks/{form-layout-title.BWCOZyay.js.map → form-layout-title.P5ajTo4C.js.map} +1 -1
- package/dist/chunks/{header-with-views.f5wHqHsF.js → header-with-views.BJIQZVAq.js} +13 -13
- package/dist/chunks/{header-with-views.f5wHqHsF.js.map → header-with-views.BJIQZVAq.js.map} +1 -1
- package/dist/chunks/{header.CoyUQXFL.js → header.vHSsdURt.js} +4 -4
- package/dist/chunks/{header.CoyUQXFL.js.map → header.vHSsdURt.js.map} +1 -1
- package/dist/chunks/i18n.D9azDLPe.js.map +1 -1
- package/dist/chunks/{info-icon-with-popover.CBi7CmUZ.js → info-icon-with-popover.CXaaxjeT.js} +2 -2
- package/dist/chunks/{info-icon-with-popover.CBi7CmUZ.js.map → info-icon-with-popover.CXaaxjeT.js.map} +1 -1
- package/dist/chunks/{info-icon.Bomzzcc5.js → info-icon.7uhGVIn5.js} +2 -2
- package/dist/chunks/{info-icon.Bomzzcc5.js.map → info-icon.7uhGVIn5.js.map} +1 -1
- package/dist/chunks/{input-field-password.DXIJ0Z3R.js → input-field-password.CWr26esx.js} +6 -6
- package/dist/chunks/{input-field-password.DXIJ0Z3R.js.map → input-field-password.CWr26esx.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.KS95qk92.js → input-field-phone-number.zf8WxBCn.js} +8 -12
- package/dist/chunks/{input-field-phone-number.KS95qk92.js.map → input-field-phone-number.zf8WxBCn.js.map} +1 -1
- package/dist/chunks/{input-field.DcudjNKs.js → input-field.CR262X1w.js} +3 -3
- package/dist/chunks/{input-field.DcudjNKs.js.map → input-field.CR262X1w.js.map} +1 -1
- package/dist/chunks/{inspector.types.Fs9URmPq.js → inspector.types.YK45k4D_.js} +3 -3
- package/dist/chunks/{inspector.types.Fs9URmPq.js.map → inspector.types.YK45k4D_.js.map} +1 -1
- package/dist/chunks/keyboard-navigation.CqgGzfZQ.js.map +1 -1
- package/dist/chunks/{listbox-option-tag.CqnkZr9x.js → listbox-option-tag.BJh2kEN1.js} +2 -2
- package/dist/chunks/{listbox-option-tag.CqnkZr9x.js.map → listbox-option-tag.BJh2kEN1.js.map} +1 -1
- package/dist/chunks/{menu.P_KG1J8b.js → menu.CVMSGvtb.js} +5 -6
- package/dist/chunks/menu.CVMSGvtb.js.map +1 -0
- package/dist/chunks/{modal-fullscreen.DxuMKagz.js → modal-fullscreen.Cqlf6PWo.js} +5 -5
- package/dist/chunks/{modal-fullscreen.DxuMKagz.js.map → modal-fullscreen.Cqlf6PWo.js.map} +1 -1
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.DfzxXSwn.js → modal.vue_vue_type_script_setup_true_lang.dXxru4S9.js} +5 -5
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.DfzxXSwn.js.map → modal.vue_vue_type_script_setup_true_lang.dXxru4S9.js.map} +1 -1
- package/dist/chunks/{pagination.DzwiWHUO.js → pagination.C65tc-nX.js} +3 -3
- package/dist/chunks/{pagination.DzwiWHUO.js.map → pagination.C65tc-nX.js.map} +1 -1
- package/dist/chunks/{popover.Csq1gQ6T.js → popover.DjbACET6.js} +4 -4
- package/dist/chunks/{popover.Csq1gQ6T.js.map → popover.DjbACET6.js.map} +1 -1
- package/dist/chunks/{popper-container.DnlxQ9eS.js → popper-container.CDsbQiOS.js} +3 -3
- package/dist/chunks/{popper-container.DnlxQ9eS.js.map → popper-container.CDsbQiOS.js.map} +1 -1
- package/dist/chunks/{promo-banner.CN-TTSov.js → promo-banner.ZCfJQh-S.js} +2 -2
- package/dist/chunks/{promo-banner.CN-TTSov.js.map → promo-banner.ZCfJQh-S.js.map} +1 -1
- package/dist/chunks/{radio-group.Vm-hmL1q.js → radio-group.Tgf3BF5X.js} +4 -4
- package/dist/chunks/{radio-group.Vm-hmL1q.js.map → radio-group.Tgf3BF5X.js.map} +1 -1
- package/dist/chunks/{search-bar.SNqRBGY7.js → search-bar.CTn5DIQZ.js} +3 -3
- package/dist/chunks/{search-bar.SNqRBGY7.js.map → search-bar.CTn5DIQZ.js.map} +1 -1
- package/dist/chunks/{secondary-nav.DKXHuspN.js → secondary-nav.CnE-aV2P.js} +2 -2
- package/dist/chunks/{secondary-nav.DKXHuspN.js.map → secondary-nav.CnE-aV2P.js.map} +1 -1
- package/dist/chunks/{segmented-control.DBy-nbYM.js → segmented-control.Dg_ktsiS.js} +2 -2
- package/dist/chunks/{segmented-control.DBy-nbYM.js.map → segmented-control.Dg_ktsiS.js.map} +1 -1
- package/dist/chunks/{selection-card-group.D9dyC6Z_.js → selection-card-group.C2OFZgKd.js} +11 -11
- package/dist/chunks/{selection-card-group.D9dyC6Z_.js.map → selection-card-group.C2OFZgKd.js.map} +1 -1
- package/dist/chunks/{sidepanel.Ds2CCG9L.js → sidepanel.Drn-lKR3.js} +5 -5
- package/dist/chunks/{sidepanel.Ds2CCG9L.js.map → sidepanel.Drn-lKR3.js.map} +1 -1
- package/dist/chunks/{structured-list-item.CygGTBVl.js → structured-list-item.CWiwoP5F.js} +5 -5
- package/dist/chunks/{structured-list-item.CygGTBVl.js.map → structured-list-item.CWiwoP5F.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.DzvuP-NU.js → summary-grid.types.DOYW579A.js} +5 -5
- package/dist/chunks/{summary-grid.types.DzvuP-NU.js.map → summary-grid.types.DOYW579A.js.map} +1 -1
- package/dist/chunks/tabs.DZk78MLK.js +266 -0
- package/dist/chunks/tabs.DZk78MLK.js.map +1 -0
- package/dist/chunks/{tag.C4SGN5Eb.js → tag.CmYkknFj.js} +2 -2
- package/dist/chunks/{tag.C4SGN5Eb.js.map → tag.CmYkknFj.js.map} +1 -1
- package/dist/chunks/{teleport.DfTpEQBR.js → teleport.zSiKZmRE.js} +5 -5
- package/dist/chunks/teleport.zSiKZmRE.js.map +1 -0
- package/dist/chunks/{textarea.bQwvvIkq.js → textarea.CR7su54i.js} +3 -3
- package/dist/chunks/{textarea.bQwvvIkq.js.map → textarea.CR7su54i.js.map} +1 -1
- package/dist/chunks/{timeline-item.Bxt_pNII.js → timeline-item.BhQp0ICP.js} +6 -6
- package/dist/chunks/{timeline-item.Bxt_pNII.js.map → timeline-item.BhQp0ICP.js.map} +1 -1
- package/dist/chunks/{toast.7D23cICy.js → toast.DxVfamh-.js} +2 -2
- package/dist/chunks/{toast.7D23cICy.js.map → toast.DxVfamh-.js.map} +1 -1
- package/dist/chunks/{toggle-button.7iAfO6Xx.js → toggle-button.D-9TFTy8.js} +2 -2
- package/dist/chunks/{toggle-button.7iAfO6Xx.js.map → toggle-button.D-9TFTy8.js.map} +1 -1
- package/dist/chunks/{tooltip.CyQxprBQ.js → tooltip.BkBDReK0.js} +2 -2
- package/dist/chunks/{tooltip.CyQxprBQ.js.map → tooltip.BkBDReK0.js.map} +1 -1
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.BtVT3Ltg.js → tutorial.vue_vue_type_script_setup_true_lang.ENhKvQLv.js} +5 -5
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.BtVT3Ltg.js.map → tutorial.vue_vue_type_script_setup_true_lang.ENhKvQLv.js.map} +1 -1
- package/dist/chunks/use-cached-selected-values.CQKeFUJd.js +1475 -0
- package/dist/chunks/use-cached-selected-values.CQKeFUJd.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 +1 -1
- package/package.json +4 -4
- package/dist/chunks/button.6HMG0xEY.js.map +0 -1
- package/dist/chunks/calendar.BRsV4rkQ.js.map +0 -1
- package/dist/chunks/dashboard-section.DpL72ax7.js +0 -167
- package/dist/chunks/dashboard-section.DpL72ax7.js.map +0 -1
- package/dist/chunks/data-grid-template.CJxPIu3E.js +0 -93
- package/dist/chunks/data-grid-template.CJxPIu3E.js.map +0 -1
- package/dist/chunks/data-grid.jRydtYyG.js +0 -3380
- package/dist/chunks/data-grid.jRydtYyG.js.map +0 -1
- package/dist/chunks/date-range-picker.LJJE3q1u.js.map +0 -1
- package/dist/chunks/filter-bar.CqO88Dv2.js.map +0 -1
- package/dist/chunks/menu.P_KG1J8b.js.map +0 -1
- package/dist/chunks/tabs.B8BRqQpv.js +0 -272
- package/dist/chunks/tabs.B8BRqQpv.js.map +0 -1
- package/dist/chunks/teleport.DfTpEQBR.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.DGfnlqdi.js +0 -1455
- package/dist/chunks/use-cached-selected-values.DGfnlqdi.js.map +0 -1
|
@@ -0,0 +1,1475 @@
|
|
|
1
|
+
import { computed as p, ref as M, onMounted as Ae, onUnmounted as Ke, watch as Ie, defineComponent as X, resolveComponent as $, createElementBlock as T, openBlock as d, createVNode as P, createElementVNode as K, withCtx as I, createTextVNode as z, toDisplayString as G, renderSlot as Y, mergeProps as U, withKeys as ve, createCommentVNode as W, 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 F, createSlots as ce, normalizeClass as fe, useSlots as je, unref as N, normalizeStyle as He } from "vue";
|
|
2
|
+
import { B as x, a as de } from "./keyboard-navigation.CqgGzfZQ.js";
|
|
3
|
+
import "./events.FNmSWp_P.js";
|
|
4
|
+
import { B as ne } from "./typography.DN5eC5ch.js";
|
|
5
|
+
import { B as Xe } from "./loading-indicator.DEepb9Wl.js";
|
|
6
|
+
import { B as Je } from "./empty-state.m0U14LVw.js";
|
|
7
|
+
import { u as ye } from "./i18n.D9azDLPe.js";
|
|
8
|
+
import { d as Ze } from "./debounce.DUTu11PS.js";
|
|
9
|
+
import { B as Se } from "./checkbox.BIaD03Bg.js";
|
|
10
|
+
import { B as Qe } from "./chip.3T0x6FuI.js";
|
|
11
|
+
import { _ as q } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
12
|
+
import { C as et, a as tt } from "./chevron-up.-0oLlHmh.js";
|
|
13
|
+
import { d as st, e as _e } from "./button-actions.N99QthUv.js";
|
|
14
|
+
/* empty css */
|
|
15
|
+
import { o as lt } from "./resize.Bqks3WUm.js";
|
|
16
|
+
import "../assets/use-cached-selected-values.css";
|
|
17
|
+
const Be = (e, t, s, r) => {
|
|
18
|
+
const b = p(
|
|
19
|
+
() => {
|
|
20
|
+
var m, g;
|
|
21
|
+
return !!((m = e.value) != null && m.length) && ((g = e.value) == null ? void 0 : g.length) === t.value.length;
|
|
22
|
+
}
|
|
23
|
+
), a = p(() => {
|
|
24
|
+
var m;
|
|
25
|
+
return e.value == null || e.value.length === 0 ? !1 : ((m = e.value) == null ? void 0 : m.length) !== t.value.length;
|
|
26
|
+
});
|
|
27
|
+
return {
|
|
28
|
+
isAllSelected: b,
|
|
29
|
+
isIndeterminate: a,
|
|
30
|
+
toggleSelectAll: (m) => {
|
|
31
|
+
m ? s() : r();
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
function ot(e, { disabled: t, itemHeight: s, overscan: r = 5, prefixHeight: b }) {
|
|
36
|
+
const a = M(null), l = M([]), m = M(0), g = M(0), n = M(0);
|
|
37
|
+
let v;
|
|
38
|
+
const o = p(() => {
|
|
39
|
+
const S = typeof s == "number" ? e.value.length * s : e.value.reduce((R, C, A) => R + s(A), 0), O = typeof s == "number" ? m.value * s : e.value.slice(0, m.value).reduce((R, C, A) => R + s(A), 0);
|
|
40
|
+
return {
|
|
41
|
+
style: {
|
|
42
|
+
marginTop: `${O}px`,
|
|
43
|
+
height: `${S - O}px`
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}), h = () => {
|
|
47
|
+
const S = (b == null ? void 0 : b.value) ?? 0, O = Math.max(a.value.scrollTop - S, 0);
|
|
48
|
+
if (typeof s == "number")
|
|
49
|
+
return Math.floor(O / s);
|
|
50
|
+
let R = 0, C = 0;
|
|
51
|
+
for (let A = 0; A < e.value.length; A += 1) {
|
|
52
|
+
const V = s(A);
|
|
53
|
+
if (R += V, R >= O) {
|
|
54
|
+
C = A;
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return C;
|
|
59
|
+
}, L = () => {
|
|
60
|
+
if (n.value = a.value.clientHeight, typeof s == "number")
|
|
61
|
+
return Math.ceil(n.value / s);
|
|
62
|
+
const S = m.value ?? 0;
|
|
63
|
+
let O = 0, R = 0;
|
|
64
|
+
for (let C = S; C < e.value.length; C += 1) {
|
|
65
|
+
const A = s(C);
|
|
66
|
+
if (O += A, R = C, O > n.value)
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
return R - S;
|
|
70
|
+
}, k = () => {
|
|
71
|
+
if (a.value) {
|
|
72
|
+
const S = L();
|
|
73
|
+
m.value = h(), g.value = Math.min(m.value + S + r, e.value.length), l.value = e.value.slice(m.value, g.value);
|
|
74
|
+
}
|
|
75
|
+
}, B = () => {
|
|
76
|
+
k();
|
|
77
|
+
};
|
|
78
|
+
t || (Ae(() => {
|
|
79
|
+
a.value && (n.value = a.value.clientHeight, v = lt(a.value, ({ clientHeight: S }) => {
|
|
80
|
+
n.value = S, k();
|
|
81
|
+
}), k());
|
|
82
|
+
}), Ke(() => {
|
|
83
|
+
v == null || v.disconnect();
|
|
84
|
+
}), Ie(
|
|
85
|
+
() => e.value,
|
|
86
|
+
() => {
|
|
87
|
+
k();
|
|
88
|
+
}
|
|
89
|
+
));
|
|
90
|
+
const y = {
|
|
91
|
+
ref: a,
|
|
92
|
+
style: { overflowY: "auto" }
|
|
93
|
+
};
|
|
94
|
+
return t ? {
|
|
95
|
+
containerRef: a,
|
|
96
|
+
containerProps: y,
|
|
97
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
98
|
+
onScroll: () => {
|
|
99
|
+
},
|
|
100
|
+
list: e
|
|
101
|
+
} : {
|
|
102
|
+
containerRef: a,
|
|
103
|
+
containerProps: y,
|
|
104
|
+
onScroll: B,
|
|
105
|
+
list: l,
|
|
106
|
+
wrapperProps: o
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
var u = /* @__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))(u || {}), se = /* @__PURE__ */ ((e) => (e.AUTOMATIC = "automatic", e.BUTTON = "button", e.NONE = "none", e))(se || {});
|
|
110
|
+
const nt = X({
|
|
111
|
+
name: "bento-listbox-static-category",
|
|
112
|
+
components: {
|
|
113
|
+
BentoTypography: ne
|
|
114
|
+
},
|
|
115
|
+
props: {
|
|
116
|
+
/**
|
|
117
|
+
* Category label text
|
|
118
|
+
*/
|
|
119
|
+
categoryLabel: {
|
|
120
|
+
type: String,
|
|
121
|
+
required: !0
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}), at = { class: "b-listbox-single-select-category" };
|
|
125
|
+
function it(e, t, s, r, b, a) {
|
|
126
|
+
const l = $("bento-typography");
|
|
127
|
+
return d(), T("div", at, [
|
|
128
|
+
P(l, {
|
|
129
|
+
variant: "caption",
|
|
130
|
+
el: "span",
|
|
131
|
+
class: "b-listbox-single-select-category__label-text"
|
|
132
|
+
}, {
|
|
133
|
+
default: I(() => [
|
|
134
|
+
z(G(e.categoryLabel), 1)
|
|
135
|
+
]),
|
|
136
|
+
_: 1
|
|
137
|
+
}),
|
|
138
|
+
K("div", null, [
|
|
139
|
+
Y(e.$slots, "default", {}, void 0, !0)
|
|
140
|
+
])
|
|
141
|
+
]);
|
|
142
|
+
}
|
|
143
|
+
const rt = /* @__PURE__ */ q(nt, [["render", it], ["__scopeId", "data-v-a90eff17"]]), ct = X({
|
|
144
|
+
name: "bento-listbox-option",
|
|
145
|
+
props: {
|
|
146
|
+
/**
|
|
147
|
+
* Setting this property to true will disable the option.
|
|
148
|
+
*/
|
|
149
|
+
disabled: { type: Boolean, default: !1 },
|
|
150
|
+
/**
|
|
151
|
+
* Indicates if the value is selected. Only one element can be selected at a time.
|
|
152
|
+
*/
|
|
153
|
+
selected: { type: Boolean, default: !1 }
|
|
154
|
+
},
|
|
155
|
+
emits: [u.CLICK, u.ENTER, u.SPACE, u.TAB],
|
|
156
|
+
setup(e, { emit: t }) {
|
|
157
|
+
const s = p(() => ({
|
|
158
|
+
"b-listbox-option--disabled": e.disabled,
|
|
159
|
+
"b-listbox-option--selected": e.selected
|
|
160
|
+
}));
|
|
161
|
+
return {
|
|
162
|
+
// Enums
|
|
163
|
+
BentoKeyboardNavigationKeyDownEvent: x,
|
|
164
|
+
BentoListboxEvent: u,
|
|
165
|
+
// Values
|
|
166
|
+
conditionalClasses: s,
|
|
167
|
+
// Events
|
|
168
|
+
onClick: (a) => {
|
|
169
|
+
t(u.CLICK, a);
|
|
170
|
+
},
|
|
171
|
+
onOptionSelected: (a, l) => {
|
|
172
|
+
t(a, l);
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
function ut(e, t, s, r, b, a) {
|
|
178
|
+
return d(), T("label", U({
|
|
179
|
+
class: ["b-listbox-option", e.conditionalClasses],
|
|
180
|
+
role: "option"
|
|
181
|
+
}, e.$attrs, {
|
|
182
|
+
onClick: t[0] || (t[0] = (...l) => e.onClick && e.onClick(...l)),
|
|
183
|
+
onKeydown: [
|
|
184
|
+
t[1] || (t[1] = ve((l) => e.onOptionSelected(e.BentoListboxEvent.ENTER, l), ["enter"])),
|
|
185
|
+
t[2] || (t[2] = ve((l) => e.onOptionSelected(e.BentoListboxEvent.SPACE, l), ["space"])),
|
|
186
|
+
t[3] || (t[3] = ve((l) => e.onOptionSelected(e.BentoListboxEvent.TAB, l), ["tab"]))
|
|
187
|
+
]
|
|
188
|
+
}), [
|
|
189
|
+
Y(e.$slots, "default", {}, void 0, !0)
|
|
190
|
+
], 16);
|
|
191
|
+
}
|
|
192
|
+
const be = /* @__PURE__ */ q(ct, [["render", ut], ["__scopeId", "data-v-18a61f5d"]]);
|
|
193
|
+
let Te = 0;
|
|
194
|
+
const dt = {
|
|
195
|
+
beforeCreate() {
|
|
196
|
+
this.uuid = Te.toString(), Te += 1;
|
|
197
|
+
}
|
|
198
|
+
}, bt = { key: 0 };
|
|
199
|
+
function mt(e, t, s, r, b, a) {
|
|
200
|
+
return d(), T("svg", U({ role: "img" }, e.$attrs, {
|
|
201
|
+
class: "ui-assets-icons-16",
|
|
202
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
203
|
+
width: "16",
|
|
204
|
+
height: "16",
|
|
205
|
+
fill: "none"
|
|
206
|
+
}), [
|
|
207
|
+
e.$attrs["svg-title"] ? (d(), T("title", bt, G(e.$attrs["svg-title"]), 1)) : W("", !0),
|
|
208
|
+
t[0] || (t[0] = K("path", {
|
|
209
|
+
fill: "#00112C",
|
|
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
|
+
}, null, -1))
|
|
212
|
+
], 16);
|
|
213
|
+
}
|
|
214
|
+
const vt = /* @__PURE__ */ q(dt, [["render", mt]]), ft = X({
|
|
215
|
+
name: "bento-listbox-single-select-option",
|
|
216
|
+
components: {
|
|
217
|
+
BentoListboxOption: be,
|
|
218
|
+
BentoTypography: ne,
|
|
219
|
+
CheckmarkIcon: vt
|
|
220
|
+
},
|
|
221
|
+
props: {
|
|
222
|
+
/**
|
|
223
|
+
* Setting this property to true will disable the option.
|
|
224
|
+
*/
|
|
225
|
+
disabled: { type: Boolean, default: !1 },
|
|
226
|
+
/**
|
|
227
|
+
* The option item that contains all the option item's data.
|
|
228
|
+
* @type {BentoListboxOptionItem}
|
|
229
|
+
*/
|
|
230
|
+
option: {
|
|
231
|
+
type: Object,
|
|
232
|
+
required: !0
|
|
233
|
+
},
|
|
234
|
+
/**
|
|
235
|
+
* Indicates if the value is selected. Only one element can be selected at a time.
|
|
236
|
+
*/
|
|
237
|
+
selected: { type: Boolean, default: !1 }
|
|
238
|
+
},
|
|
239
|
+
emits: [u.ENTER, u.SELECT, u.SPACE, u.TAB],
|
|
240
|
+
setup(e, { emit: t }) {
|
|
241
|
+
const s = (l) => {
|
|
242
|
+
e.disabled || t(l, e.option);
|
|
243
|
+
}, r = p(() => e.disabled ? !0 : null), b = p(() => e.selected ? !0 : null), a = p(() => e.disabled ? -1 : 0);
|
|
244
|
+
return {
|
|
245
|
+
// Values
|
|
246
|
+
ariaDisabled: r,
|
|
247
|
+
ariaSelected: b,
|
|
248
|
+
tabIndex: a,
|
|
249
|
+
// Enums
|
|
250
|
+
BentoListboxEvent: u,
|
|
251
|
+
// Events
|
|
252
|
+
onOptionSelected: s
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
}), gt = { class: "b-listbox-single-select-option__text" }, pt = { class: "b-listbox-single-select-option__check-icon" };
|
|
256
|
+
function yt(e, t, s, r, b, a) {
|
|
257
|
+
const l = $("bento-typography"), m = $("checkmark-icon"), g = $("bento-listbox-option");
|
|
258
|
+
return d(), D(g, {
|
|
259
|
+
class: "b-listbox-single-select-option",
|
|
260
|
+
disabled: e.disabled,
|
|
261
|
+
selected: e.selected,
|
|
262
|
+
"aria-selected": e.ariaSelected,
|
|
263
|
+
"aria-disabled": e.ariaDisabled,
|
|
264
|
+
tabindex: e.tabIndex,
|
|
265
|
+
onClick: t[0] || (t[0] = (n) => e.onOptionSelected(e.BentoListboxEvent.SELECT)),
|
|
266
|
+
onEnterPressed: t[1] || (t[1] = (n) => e.onOptionSelected(e.BentoListboxEvent.ENTER)),
|
|
267
|
+
onSpacePressed: t[2] || (t[2] = qe((n) => e.onOptionSelected(e.BentoListboxEvent.SPACE), ["prevent"])),
|
|
268
|
+
onTabPressed: t[3] || (t[3] = (n) => e.onOptionSelected(e.BentoListboxEvent.TAB))
|
|
269
|
+
}, {
|
|
270
|
+
default: I(() => [
|
|
271
|
+
Y(e.$slots, "default", le(re(e.option)), () => [
|
|
272
|
+
K("span", gt, [
|
|
273
|
+
P(l, { el: "span" }, {
|
|
274
|
+
default: I(() => [
|
|
275
|
+
z(G(e.option.label), 1)
|
|
276
|
+
]),
|
|
277
|
+
_: 1
|
|
278
|
+
}),
|
|
279
|
+
e.option.description ? (d(), D(l, {
|
|
280
|
+
key: 0,
|
|
281
|
+
class: "b-listbox-single-select-option__description",
|
|
282
|
+
el: "span"
|
|
283
|
+
}, {
|
|
284
|
+
default: I(() => [
|
|
285
|
+
z(G(e.option.description), 1)
|
|
286
|
+
]),
|
|
287
|
+
_: 1
|
|
288
|
+
})) : W("", !0)
|
|
289
|
+
])
|
|
290
|
+
], !0),
|
|
291
|
+
K("span", pt, [
|
|
292
|
+
oe(P(m, { "svg-title": "selected" }, null, 512), [
|
|
293
|
+
[$e, e.selected]
|
|
294
|
+
])
|
|
295
|
+
])
|
|
296
|
+
]),
|
|
297
|
+
_: 3
|
|
298
|
+
}, 8, ["disabled", "selected", "aria-selected", "aria-disabled", "tabindex"]);
|
|
299
|
+
}
|
|
300
|
+
const St = /* @__PURE__ */ q(ft, [["render", yt], ["__scopeId", "data-v-226f4c84"]]), Re = ({ items: e, isOptionDisabled: t, hasStaticCategories: s }, r) => {
|
|
301
|
+
const b = p(
|
|
302
|
+
() => s.value ? e.value.flatMap((y) => y.items) : e.value
|
|
303
|
+
), a = p(() => b.value.length - 1), l = M(0);
|
|
304
|
+
Ae(() => {
|
|
305
|
+
t && (l.value = e.value.findIndex((y) => !t(y)));
|
|
306
|
+
});
|
|
307
|
+
const m = (y) => {
|
|
308
|
+
var R, C;
|
|
309
|
+
const O = ((C = (R = e.value[y]) == null ? void 0 : R.items) == null ? void 0 : C.length) ? e.value[y].items.every((A) => t(A)) : t(e.value[y]);
|
|
310
|
+
return !t || !!t && O;
|
|
311
|
+
}, g = (y) => {
|
|
312
|
+
switch (y) {
|
|
313
|
+
case "increase":
|
|
314
|
+
l.value += 1;
|
|
315
|
+
break;
|
|
316
|
+
case "decrease":
|
|
317
|
+
l.value -= 1;
|
|
318
|
+
break;
|
|
319
|
+
}
|
|
320
|
+
}, n = ({ edgeCaseItem: y }, S, O) => {
|
|
321
|
+
l.value !== y && (g(O), m(l.value) && S(), r(l.value));
|
|
322
|
+
}, v = (y) => {
|
|
323
|
+
B(y), n(
|
|
324
|
+
{
|
|
325
|
+
edgeCaseItem: a.value
|
|
326
|
+
},
|
|
327
|
+
v,
|
|
328
|
+
"increase"
|
|
329
|
+
/* INCREASE */
|
|
330
|
+
);
|
|
331
|
+
}, o = (y) => {
|
|
332
|
+
B(y), n(
|
|
333
|
+
{
|
|
334
|
+
edgeCaseItem: 0
|
|
335
|
+
},
|
|
336
|
+
o,
|
|
337
|
+
"decrease"
|
|
338
|
+
/* DECREASE */
|
|
339
|
+
);
|
|
340
|
+
}, h = () => {
|
|
341
|
+
l.value = 0, m(l.value) ? v() : r(l.value);
|
|
342
|
+
}, L = () => {
|
|
343
|
+
l.value = a.value, m(l.value) ? o() : r(l.value);
|
|
344
|
+
}, k = (y) => {
|
|
345
|
+
l.value = y;
|
|
346
|
+
}, B = (y) => {
|
|
347
|
+
var S;
|
|
348
|
+
(S = y == null ? void 0 : y.detail) == null || S.preventDefault();
|
|
349
|
+
};
|
|
350
|
+
return {
|
|
351
|
+
moveToFirstElement: h,
|
|
352
|
+
moveToLastElement: L,
|
|
353
|
+
moveToNextElement: v,
|
|
354
|
+
moveToPreviousElement: o,
|
|
355
|
+
setListboxFocusedIndex: k,
|
|
356
|
+
preventDefault: B,
|
|
357
|
+
focusedIndex: l
|
|
358
|
+
};
|
|
359
|
+
}, Ct = X({
|
|
360
|
+
name: "bento-listbox-single-select",
|
|
361
|
+
components: {
|
|
362
|
+
BentoListboxSingleSelectCategory: rt,
|
|
363
|
+
BentoListboxSingleSelectOption: St
|
|
364
|
+
},
|
|
365
|
+
directives: { BentoKeyboardNavigationDirective: de },
|
|
366
|
+
inheritAttrs: !1,
|
|
367
|
+
props: {
|
|
368
|
+
/**
|
|
369
|
+
* Function that allows the options to be disabled
|
|
370
|
+
*
|
|
371
|
+
* @type {BentoListboxIsOptionDisabled}
|
|
372
|
+
* @param {BentoListboxOptionItem} option - listbox option object
|
|
373
|
+
* @param {string} option.label - Option's label text
|
|
374
|
+
* @param {string|number} option.value - Option's value
|
|
375
|
+
* @param {unknown} option.data - Option's extra data to be passed to the default slot
|
|
376
|
+
*/
|
|
377
|
+
isOptionDisabled: {
|
|
378
|
+
type: Function,
|
|
379
|
+
default: () => !1
|
|
380
|
+
},
|
|
381
|
+
/**
|
|
382
|
+
* The option elements to populate the listbox with.
|
|
383
|
+
* It must be an array of {@see BentoListboxOptionItem }.
|
|
384
|
+
*
|
|
385
|
+
* @property {string} value.label - Text to be displayed in the option
|
|
386
|
+
* @property {string,number} value.value - Value of the option
|
|
387
|
+
*/
|
|
388
|
+
items: {
|
|
389
|
+
type: Array,
|
|
390
|
+
required: !0
|
|
391
|
+
},
|
|
392
|
+
/**
|
|
393
|
+
* The `input` value.
|
|
394
|
+
* Providing an empty string will select no options.
|
|
395
|
+
* Set to an empty string `''` if you don't want any of the available options to be selected
|
|
396
|
+
*/
|
|
397
|
+
selectedValue: {
|
|
398
|
+
type: Array,
|
|
399
|
+
default: void 0
|
|
400
|
+
},
|
|
401
|
+
/**
|
|
402
|
+
* If enabled, dropdown will display non-selectable, static categories
|
|
403
|
+
*/
|
|
404
|
+
staticCategories: { type: Boolean, default: !1 }
|
|
405
|
+
},
|
|
406
|
+
emits: [u.SELECT, u.ENTER, u.SPACE, u.TAB],
|
|
407
|
+
setup(e, { emit: t, expose: s, slots: r }) {
|
|
408
|
+
const b = M(null), a = M([]), l = p(() => {
|
|
409
|
+
var S;
|
|
410
|
+
return !!((S = e.selectedValue) != null && S.length) && e.selectedValue.at(0);
|
|
411
|
+
}), m = p(() => !!e.items.some(({ items: S }) => !!S)), g = (S) => (O) => {
|
|
412
|
+
t(S, [O]);
|
|
413
|
+
}, n = (S) => {
|
|
414
|
+
var O;
|
|
415
|
+
(O = b.value.querySelectorAll('[role="option"]')[S]) == null || O.focus();
|
|
416
|
+
}, {
|
|
417
|
+
moveToNextElement: v,
|
|
418
|
+
moveToPreviousElement: o,
|
|
419
|
+
moveToFirstElement: h,
|
|
420
|
+
moveToLastElement: L,
|
|
421
|
+
setListboxFocusedIndex: k
|
|
422
|
+
} = Re(
|
|
423
|
+
{
|
|
424
|
+
items: Z(e, "items"),
|
|
425
|
+
isOptionDisabled: e.isOptionDisabled,
|
|
426
|
+
hasStaticCategories: Z(e, "staticCategories")
|
|
427
|
+
},
|
|
428
|
+
n
|
|
429
|
+
), B = {
|
|
430
|
+
[x.ARROW_UP]: o,
|
|
431
|
+
[x.ARROW_DOWN]: v,
|
|
432
|
+
[x.HOME]: h,
|
|
433
|
+
[x.END]: L
|
|
434
|
+
}, y = {
|
|
435
|
+
[u.SELECT]: g(u.SELECT),
|
|
436
|
+
[u.SPACE]: g(u.SPACE),
|
|
437
|
+
[u.TAB]: g(u.TAB),
|
|
438
|
+
[u.ENTER]: g(u.ENTER)
|
|
439
|
+
};
|
|
440
|
+
return s({
|
|
441
|
+
/**
|
|
442
|
+
* Reference for a single listbox item.
|
|
443
|
+
* Required for keyboard navigation in dropdown as $children is removed in vue@3
|
|
444
|
+
*/
|
|
445
|
+
listboxItemRef: a,
|
|
446
|
+
/**
|
|
447
|
+
* Method to set the index of the item to be focused on
|
|
448
|
+
* Used for focus management to be kept in-sync with parent e.g. dropdowns
|
|
449
|
+
*/
|
|
450
|
+
setListboxFocusedIndex: k
|
|
451
|
+
}), {
|
|
452
|
+
// Enums
|
|
453
|
+
BentoListboxEvent: u,
|
|
454
|
+
// Values
|
|
455
|
+
listboxRef: b,
|
|
456
|
+
listboxItemRef: a,
|
|
457
|
+
selectedItem: l,
|
|
458
|
+
slots: r,
|
|
459
|
+
// Computed
|
|
460
|
+
hasCategories: m,
|
|
461
|
+
// Methods
|
|
462
|
+
onOptionSelected: g,
|
|
463
|
+
// Keyboard navigation
|
|
464
|
+
listboxListeners: B,
|
|
465
|
+
listboxOptionListeners: y
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
});
|
|
469
|
+
function ht(e, t, s, r, b, a) {
|
|
470
|
+
const l = $("bento-listbox-single-select-option"), m = $("bento-listbox-single-select-category"), g = ke("bento-keyboard-navigation-directive");
|
|
471
|
+
return oe((d(), T("div", U({ ref: "listboxRef" }, Q(e.listboxListeners, !0)), [
|
|
472
|
+
e.hasCategories && e.staticCategories ? (d(!0), T(ee, { key: 0 }, F(e.items, (n) => (d(), D(m, {
|
|
473
|
+
key: n.value,
|
|
474
|
+
"category-label": n.label,
|
|
475
|
+
role: "group"
|
|
476
|
+
}, {
|
|
477
|
+
default: I(() => [
|
|
478
|
+
(d(!0), T(ee, null, F(n.items, (v) => (d(), D(l, U({
|
|
479
|
+
key: v.value,
|
|
480
|
+
ref_for: !0,
|
|
481
|
+
ref: "listboxItemRef",
|
|
482
|
+
role: "option",
|
|
483
|
+
option: v,
|
|
484
|
+
disabled: e.isOptionDisabled ? e.isOptionDisabled(v) : null,
|
|
485
|
+
selected: v.value === e.selectedItem.value
|
|
486
|
+
}, Q(e.listboxOptionListeners)), ce({ _: 2 }, [
|
|
487
|
+
F(e.slots, (o, h) => ({
|
|
488
|
+
name: h,
|
|
489
|
+
fn: I((L) => [
|
|
490
|
+
Y(e.$slots, h, U({ ref_for: !0 }, L))
|
|
491
|
+
])
|
|
492
|
+
}))
|
|
493
|
+
]), 1040, ["option", "disabled", "selected"]))), 128))
|
|
494
|
+
]),
|
|
495
|
+
_: 2
|
|
496
|
+
}, 1032, ["category-label"]))), 128)) : (d(!0), T(ee, { key: 1 }, F(e.items, (n) => (d(), D(l, U({
|
|
497
|
+
key: n.value,
|
|
498
|
+
ref_for: !0,
|
|
499
|
+
ref: "listboxItemRef",
|
|
500
|
+
role: "option",
|
|
501
|
+
option: n,
|
|
502
|
+
disabled: e.isOptionDisabled ? e.isOptionDisabled(n) : null,
|
|
503
|
+
selected: n.value === e.selectedItem.value
|
|
504
|
+
}, Q(e.listboxOptionListeners)), ce({ _: 2 }, [
|
|
505
|
+
F(e.slots, (v, o) => ({
|
|
506
|
+
name: o,
|
|
507
|
+
fn: I((h) => [
|
|
508
|
+
Y(e.$slots, o, U({ ref_for: !0 }, h))
|
|
509
|
+
])
|
|
510
|
+
}))
|
|
511
|
+
]), 1040, ["option", "disabled", "selected"]))), 128))
|
|
512
|
+
], 16)), [
|
|
513
|
+
[g]
|
|
514
|
+
]);
|
|
515
|
+
}
|
|
516
|
+
const Et = /* @__PURE__ */ q(Ct, [["render", ht]]);
|
|
517
|
+
var ge = /* @__PURE__ */ ((e) => (e.DISABLED = "disabled", e.STATIC_CATEGORY = "static-category", e))(ge || {}), ie = /* @__PURE__ */ ((e) => (e.SELECT_CATEGORY = "select-category", e.UNSELECT_CATEGORY = "unselect-category", e))(ie || {});
|
|
518
|
+
const _t = {
|
|
519
|
+
"en-US": {
|
|
520
|
+
categoryClosed: "{category} closed",
|
|
521
|
+
categoryOpened: "{category} opened"
|
|
522
|
+
}
|
|
523
|
+
}, Tt = X({
|
|
524
|
+
i18n: { messages: _t },
|
|
525
|
+
name: "bento-listbox-multi-select-category",
|
|
526
|
+
components: {
|
|
527
|
+
BentoCheckbox: Se,
|
|
528
|
+
BentoTypography: ne,
|
|
529
|
+
BentoListboxOption: be,
|
|
530
|
+
ChevronDownIcon: tt,
|
|
531
|
+
ChevronUpIcon: et
|
|
532
|
+
},
|
|
533
|
+
props: {
|
|
534
|
+
/**
|
|
535
|
+
* The option elements to populate the listbox with.
|
|
536
|
+
* It must be an array of {@see BentoListboxOptionItem }.
|
|
537
|
+
*
|
|
538
|
+
* @property {string} value.label - Text to be displayed in the option
|
|
539
|
+
* @property {string,number} value.value - Value of the option
|
|
540
|
+
* @property {BentoListboxOptionItem} value.items - Category items list
|
|
541
|
+
*/
|
|
542
|
+
category: {
|
|
543
|
+
type: Object,
|
|
544
|
+
required: !0
|
|
545
|
+
},
|
|
546
|
+
/**
|
|
547
|
+
* Function that allows the options to be disabled
|
|
548
|
+
*
|
|
549
|
+
* @type {BentoListboxIsOptionDisabled}
|
|
550
|
+
* @param {BentoListboxOptionItem} option - listbox option object
|
|
551
|
+
* @param {string} option.label - Option's label text
|
|
552
|
+
* @param {string|number} option.value - Option's value
|
|
553
|
+
* @param {unknown} option.data - Option's extra data to be passed to the default slot
|
|
554
|
+
*/
|
|
555
|
+
isOptionDisabled: {
|
|
556
|
+
type: [Function],
|
|
557
|
+
default: () => !1
|
|
558
|
+
},
|
|
559
|
+
/**
|
|
560
|
+
* The `input` value.
|
|
561
|
+
* Providing an empty array will select no options.
|
|
562
|
+
*/
|
|
563
|
+
selectedItemsList: {
|
|
564
|
+
type: Array,
|
|
565
|
+
default: () => []
|
|
566
|
+
},
|
|
567
|
+
/**
|
|
568
|
+
* If enabled, dropdown will display non-selectable, static categories
|
|
569
|
+
*/
|
|
570
|
+
staticCategories: { type: Boolean, default: !1 },
|
|
571
|
+
/**
|
|
572
|
+
* Category's tabindex
|
|
573
|
+
*/
|
|
574
|
+
tabindex: { type: Number, default: -1 }
|
|
575
|
+
},
|
|
576
|
+
emits: [ie.SELECT_CATEGORY, ie.UNSELECT_CATEGORY],
|
|
577
|
+
setup(e, { emit: t }) {
|
|
578
|
+
const s = M(!1), { t: r } = ye(), b = (C) => e.isOptionDisabled ? e.isOptionDisabled(C) : !1, a = p(
|
|
579
|
+
() => e.category.items.every((C) => b(C))
|
|
580
|
+
), l = Z(e, "staticCategories"), m = p(() => s.value || e.staticCategories), g = p(() => ({
|
|
581
|
+
[`b-listbox-multi-select-category--${ge.DISABLED}`]: a.value,
|
|
582
|
+
[`b-listbox-multi-select-category--${ge.STATIC_CATEGORY}`]: e.staticCategories
|
|
583
|
+
})), n = (C) => {
|
|
584
|
+
C.preventDefault(), s.value = !s.value;
|
|
585
|
+
}, v = (C) => {
|
|
586
|
+
var te;
|
|
587
|
+
const A = b(C), V = ((te = e.selectedItemsList) == null ? void 0 : te.includes(C.value)) || !1;
|
|
588
|
+
return { isDisabled: A, isPreSelected: V };
|
|
589
|
+
}, o = p(
|
|
590
|
+
() => e.category.items.filter((C) => {
|
|
591
|
+
const { isDisabled: A, isPreSelected: V } = v(C);
|
|
592
|
+
return A && V || !A;
|
|
593
|
+
})
|
|
594
|
+
), h = p(
|
|
595
|
+
() => {
|
|
596
|
+
var C;
|
|
597
|
+
return (C = o.value) == null ? void 0 : C.filter(
|
|
598
|
+
({ value: A }) => {
|
|
599
|
+
var V;
|
|
600
|
+
return (V = e.selectedItemsList) == null ? void 0 : V.includes(A);
|
|
601
|
+
}
|
|
602
|
+
);
|
|
603
|
+
}
|
|
604
|
+
), L = p(() => {
|
|
605
|
+
const C = s.value ? "categoryOpened" : "categoryClosed";
|
|
606
|
+
return r(C, { category: e.category.label });
|
|
607
|
+
}), k = p(
|
|
608
|
+
() => ({
|
|
609
|
+
el: "span",
|
|
610
|
+
variant: e.staticCategories ? "caption" : "body"
|
|
611
|
+
})
|
|
612
|
+
), B = () => {
|
|
613
|
+
t(ie.SELECT_CATEGORY);
|
|
614
|
+
}, y = () => {
|
|
615
|
+
t(ie.UNSELECT_CATEGORY);
|
|
616
|
+
}, { isAllSelected: S, isIndeterminate: O, toggleSelectAll: R } = Be(
|
|
617
|
+
h,
|
|
618
|
+
o,
|
|
619
|
+
B,
|
|
620
|
+
y
|
|
621
|
+
);
|
|
622
|
+
return {
|
|
623
|
+
// Values
|
|
624
|
+
chevronTitle: L,
|
|
625
|
+
conditionalClass: g,
|
|
626
|
+
hasAllPropsDisabled: a,
|
|
627
|
+
isOpen: s,
|
|
628
|
+
isAllSelected: S,
|
|
629
|
+
isIndeterminate: O,
|
|
630
|
+
isStaticCategory: l,
|
|
631
|
+
// Computed
|
|
632
|
+
showItemChildren: m,
|
|
633
|
+
categoryLabelProps: k,
|
|
634
|
+
// Methods
|
|
635
|
+
toggleOpen: n,
|
|
636
|
+
toggleSelectAll: R
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
}), Lt = { class: "b-listbox-multi-select-category__label" };
|
|
640
|
+
function Ot(e, t, s, r, b, a) {
|
|
641
|
+
const l = $("bento-checkbox"), m = $("bento-typography"), g = $("chevron-up-icon"), n = $("chevron-down-icon"), v = $("bento-listbox-option");
|
|
642
|
+
return d(), T("div", null, [
|
|
643
|
+
P(v, {
|
|
644
|
+
class: fe(["b-listbox-multi-select-category__option", e.conditionalClass])
|
|
645
|
+
}, {
|
|
646
|
+
default: I(() => [
|
|
647
|
+
e.isStaticCategory ? W("", !0) : (d(), D(l, {
|
|
648
|
+
key: 0,
|
|
649
|
+
"model-value": e.isAllSelected,
|
|
650
|
+
indeterminate: e.isIndeterminate,
|
|
651
|
+
disabled: e.hasAllPropsDisabled,
|
|
652
|
+
"aria-label": e.category.label,
|
|
653
|
+
value: e.category.value,
|
|
654
|
+
tabindex: e.tabindex,
|
|
655
|
+
"onUpdate:modelValue": e.toggleSelectAll
|
|
656
|
+
}, null, 8, ["model-value", "indeterminate", "disabled", "aria-label", "value", "tabindex", "onUpdate:modelValue"])),
|
|
657
|
+
K("span", Lt, [
|
|
658
|
+
P(m, U(e.categoryLabelProps, { class: "b-listbox-multi-select-category__label-text" }), {
|
|
659
|
+
default: I(() => [
|
|
660
|
+
z(G(e.category.label), 1)
|
|
661
|
+
]),
|
|
662
|
+
_: 1
|
|
663
|
+
}, 16),
|
|
664
|
+
e.isStaticCategory ? W("", !0) : (d(), T("div", {
|
|
665
|
+
key: 0,
|
|
666
|
+
class: "b-listbox-multi-select-category__label-chevron",
|
|
667
|
+
"data-testid": "toggle-listbox",
|
|
668
|
+
onClickCapture: t[0] || (t[0] = (...o) => e.toggleOpen && e.toggleOpen(...o))
|
|
669
|
+
}, [
|
|
670
|
+
e.isOpen ? (d(), D(g, {
|
|
671
|
+
key: 0,
|
|
672
|
+
"svg-title": e.chevronTitle
|
|
673
|
+
}, null, 8, ["svg-title"])) : (d(), D(n, {
|
|
674
|
+
key: 1,
|
|
675
|
+
"svg-title": e.chevronTitle
|
|
676
|
+
}, null, 8, ["svg-title"]))
|
|
677
|
+
], 32))
|
|
678
|
+
])
|
|
679
|
+
]),
|
|
680
|
+
_: 1
|
|
681
|
+
}, 8, ["class"]),
|
|
682
|
+
oe(K("div", null, [
|
|
683
|
+
Y(e.$slots, "default", {}, void 0, !0)
|
|
684
|
+
], 512), [
|
|
685
|
+
[$e, e.showItemChildren]
|
|
686
|
+
])
|
|
687
|
+
]);
|
|
688
|
+
}
|
|
689
|
+
const At = /* @__PURE__ */ q(Tt, [["render", Ot], ["__scopeId", "data-v-9681c80b"]]);
|
|
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
|
+
const It = X({
|
|
692
|
+
name: "listbox-multi-select-options",
|
|
693
|
+
components: {
|
|
694
|
+
BentoCheckbox: Se,
|
|
695
|
+
BentoListboxOption: be,
|
|
696
|
+
BentoTypography: ne,
|
|
697
|
+
ListboxMultiSelectCategory: At
|
|
698
|
+
},
|
|
699
|
+
props: {
|
|
700
|
+
/**
|
|
701
|
+
* Indicates if the items listed are inside a category
|
|
702
|
+
* so they can be padded to right by one level in recursion.
|
|
703
|
+
* Items of categories are automatically defined as "categoryItems"
|
|
704
|
+
*/
|
|
705
|
+
categoryItems: { type: Boolean, default: !1 },
|
|
706
|
+
/**
|
|
707
|
+
* Current focused option index
|
|
708
|
+
*/
|
|
709
|
+
focusedIndex: { type: Number, default: 0 },
|
|
710
|
+
/**
|
|
711
|
+
* Function that allows the options to be disabled
|
|
712
|
+
*
|
|
713
|
+
* @type {BentoListboxIsOptionDisabled}
|
|
714
|
+
* @param {BentoListboxOptionItem} option - listbox option object
|
|
715
|
+
* @param {string} option.label - Option's label text
|
|
716
|
+
* @param {string|number} option.value - Option's value
|
|
717
|
+
* @param {unknown} option.data - Option's extra data to be passed to the default slot
|
|
718
|
+
*/
|
|
719
|
+
isOptionDisabled: {
|
|
720
|
+
type: Function,
|
|
721
|
+
default: () => !1
|
|
722
|
+
},
|
|
723
|
+
/**
|
|
724
|
+
* The option elements to populate the listbox with.
|
|
725
|
+
* It must be an array of {@see BentoListboxOptionItem }.
|
|
726
|
+
*
|
|
727
|
+
* @property {string} value.label - Text to be displayed in the option
|
|
728
|
+
* @property {string,number} value.value - Value of the option
|
|
729
|
+
*/
|
|
730
|
+
items: {
|
|
731
|
+
type: Array,
|
|
732
|
+
required: !0
|
|
733
|
+
},
|
|
734
|
+
/**
|
|
735
|
+
* Indicates if the elements options are inside a multi-level category
|
|
736
|
+
*/
|
|
737
|
+
isMultiLevel: { type: Boolean, default: !1 },
|
|
738
|
+
/**
|
|
739
|
+
* Flag that indicates that an external search it's being made
|
|
740
|
+
* to filter out the items inside the the multi-select listbox
|
|
741
|
+
*
|
|
742
|
+
* If enabled, hides the "Select all" checkbox in "multiple" mode.
|
|
743
|
+
*/
|
|
744
|
+
searching: { type: Boolean, default: !1 },
|
|
745
|
+
/**
|
|
746
|
+
* List of selected items.
|
|
747
|
+
* Providing an empty array will select no options.
|
|
748
|
+
*/
|
|
749
|
+
selectedItemsList: {
|
|
750
|
+
type: Array,
|
|
751
|
+
default: () => []
|
|
752
|
+
},
|
|
753
|
+
/**
|
|
754
|
+
* If enabled, dropdown will display non-selectable, static categories
|
|
755
|
+
*/
|
|
756
|
+
staticCategories: { type: Boolean, default: !1 }
|
|
757
|
+
},
|
|
758
|
+
emits: [
|
|
759
|
+
H.TOGGLE_CHECKBOX_SELECTION,
|
|
760
|
+
H.SELECT_CATEGORY,
|
|
761
|
+
H.UNSELECT_CATEGORY
|
|
762
|
+
],
|
|
763
|
+
setup(e, { emit: t }) {
|
|
764
|
+
const s = (n) => {
|
|
765
|
+
t(H.TOGGLE_CHECKBOX_SELECTION, n);
|
|
766
|
+
}, r = (n) => !!n.items, b = (n) => {
|
|
767
|
+
const v = e.isMultiLevel && e.searching;
|
|
768
|
+
return n.description && (!e.isMultiLevel || v);
|
|
769
|
+
}, a = (n) => n.items ? !!n.items.find((v) => e.selectedItemsList.includes(v.value)) : e.selectedItemsList.includes(n.value), l = (n, v) => {
|
|
770
|
+
if (r(v))
|
|
771
|
+
return t(n ? H.SELECT_CATEGORY : H.UNSELECT_CATEGORY, v);
|
|
772
|
+
s(v.value);
|
|
773
|
+
};
|
|
774
|
+
return {
|
|
775
|
+
// Values
|
|
776
|
+
conditionalClasses: p(() => ({
|
|
777
|
+
"b-listbox-multi-select-options__static-category-option": e.staticCategories,
|
|
778
|
+
"b-listbox-multi-select-options__category-option": e.categoryItems
|
|
779
|
+
})),
|
|
780
|
+
// Methods
|
|
781
|
+
isOptionSelected: a,
|
|
782
|
+
shouldShowDescription: b,
|
|
783
|
+
toggleCheckboxSelection: s,
|
|
784
|
+
selectSearch: l,
|
|
785
|
+
computedTabindex: (n) => n + 1 === e.focusedIndex ? 0 : -1,
|
|
786
|
+
// Enums
|
|
787
|
+
BentoListboxEvent: u,
|
|
788
|
+
ListboxMultiSelectOptionsEvent: H
|
|
789
|
+
};
|
|
790
|
+
}
|
|
791
|
+
}), $t = { class: "b-listbox-multi-select__option-text" }, kt = { class: "b-listbox-multi-select__option-text" };
|
|
792
|
+
function Bt(e, t, s, r, b, a) {
|
|
793
|
+
const l = $("bento-checkbox"), m = $("bento-typography"), g = $("bento-listbox-option"), n = $("listbox-multi-select-options", !0), v = $("listbox-multi-select-category");
|
|
794
|
+
return d(), T("div", null, [
|
|
795
|
+
(d(!0), T(ee, null, F(e.items, (o, h) => (d(), T("div", {
|
|
796
|
+
key: `selected-${o.value}`
|
|
797
|
+
}, [
|
|
798
|
+
e.searching && e.isMultiLevel ? (d(), D(g, {
|
|
799
|
+
key: 0,
|
|
800
|
+
class: fe(["b-listbox-multi-select-options", e.conditionalClasses]),
|
|
801
|
+
disabled: e.isOptionDisabled ? e.isOptionDisabled(o) : null
|
|
802
|
+
}, {
|
|
803
|
+
default: I(() => [
|
|
804
|
+
P(l, {
|
|
805
|
+
"model-value": e.isOptionSelected(o),
|
|
806
|
+
"aria-label": o.label,
|
|
807
|
+
disabled: e.isOptionDisabled ? e.isOptionDisabled(o) : null,
|
|
808
|
+
value: o.value,
|
|
809
|
+
tabindex: e.computedTabindex(h),
|
|
810
|
+
"onUpdate:modelValue": (L) => e.selectSearch(L, o)
|
|
811
|
+
}, null, 8, ["model-value", "aria-label", "disabled", "value", "tabindex", "onUpdate:modelValue"]),
|
|
812
|
+
Y(e.$slots, "default", U({ ref_for: !0 }, o), () => [
|
|
813
|
+
K("span", $t, [
|
|
814
|
+
P(m, { el: "span" }, {
|
|
815
|
+
default: I(() => [
|
|
816
|
+
z(G(o.label), 1)
|
|
817
|
+
]),
|
|
818
|
+
_: 2
|
|
819
|
+
}, 1024),
|
|
820
|
+
e.shouldShowDescription(o) ? (d(), D(m, {
|
|
821
|
+
key: 0,
|
|
822
|
+
class: "b-listbox-multi-select__option-description",
|
|
823
|
+
el: "span"
|
|
824
|
+
}, {
|
|
825
|
+
default: I(() => [
|
|
826
|
+
z(G(o.description), 1)
|
|
827
|
+
]),
|
|
828
|
+
_: 2
|
|
829
|
+
}, 1024)) : W("", !0)
|
|
830
|
+
])
|
|
831
|
+
], !0)
|
|
832
|
+
]),
|
|
833
|
+
_: 2
|
|
834
|
+
}, 1032, ["class", "disabled"])) : (d(), T(ee, { key: 1 }, [
|
|
835
|
+
o.items ? (d(), D(v, {
|
|
836
|
+
key: 0,
|
|
837
|
+
category: o,
|
|
838
|
+
"static-categories": e.staticCategories,
|
|
839
|
+
"is-option-disabled": e.isOptionDisabled,
|
|
840
|
+
"selected-items-list": e.selectedItemsList,
|
|
841
|
+
tabindex: e.computedTabindex(h),
|
|
842
|
+
onSelectCategory: (L) => e.$emit(e.ListboxMultiSelectOptionsEvent.SELECT_CATEGORY, o),
|
|
843
|
+
onUnselectCategory: (L) => e.$emit(e.ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY, o)
|
|
844
|
+
}, {
|
|
845
|
+
default: I(() => [
|
|
846
|
+
P(n, {
|
|
847
|
+
"category-items": "",
|
|
848
|
+
items: o.items,
|
|
849
|
+
"is-option-disabled": e.isOptionDisabled,
|
|
850
|
+
"focused-index": e.focusedIndex,
|
|
851
|
+
"is-multi-level": e.isMultiLevel,
|
|
852
|
+
"static-categories": e.staticCategories,
|
|
853
|
+
"selected-items-list": e.selectedItemsList,
|
|
854
|
+
searching: e.searching,
|
|
855
|
+
onToggleCheckboxSelection: t[0] || (t[0] = (L) => e.toggleCheckboxSelection(L))
|
|
856
|
+
}, null, 8, ["items", "is-option-disabled", "focused-index", "is-multi-level", "static-categories", "selected-items-list", "searching"])
|
|
857
|
+
]),
|
|
858
|
+
_: 2
|
|
859
|
+
}, 1032, ["category", "static-categories", "is-option-disabled", "selected-items-list", "tabindex", "onSelectCategory", "onUnselectCategory"])) : (d(), D(g, {
|
|
860
|
+
key: 1,
|
|
861
|
+
class: fe(["b-listbox-multi-select-options", e.conditionalClasses]),
|
|
862
|
+
disabled: e.isOptionDisabled ? e.isOptionDisabled(o) : null
|
|
863
|
+
}, {
|
|
864
|
+
default: I(() => [
|
|
865
|
+
P(l, {
|
|
866
|
+
"model-value": e.selectedItemsList,
|
|
867
|
+
"aria-label": o.label,
|
|
868
|
+
disabled: e.isOptionDisabled ? e.isOptionDisabled(o) : null,
|
|
869
|
+
value: o.value,
|
|
870
|
+
tabindex: e.computedTabindex(h),
|
|
871
|
+
"onUpdate:modelValue": (L) => e.toggleCheckboxSelection(o)
|
|
872
|
+
}, null, 8, ["model-value", "aria-label", "disabled", "value", "tabindex", "onUpdate:modelValue"]),
|
|
873
|
+
Y(e.$slots, "default", U({ ref_for: !0 }, o), () => [
|
|
874
|
+
K("span", kt, [
|
|
875
|
+
P(m, { el: "span" }, {
|
|
876
|
+
default: I(() => [
|
|
877
|
+
z(G(o.label), 1)
|
|
878
|
+
]),
|
|
879
|
+
_: 2
|
|
880
|
+
}, 1024),
|
|
881
|
+
e.shouldShowDescription(o) ? (d(), D(m, {
|
|
882
|
+
key: 0,
|
|
883
|
+
class: "b-listbox-multi-select__option-description",
|
|
884
|
+
el: "span"
|
|
885
|
+
}, {
|
|
886
|
+
default: I(() => [
|
|
887
|
+
z(G(o.description), 1)
|
|
888
|
+
]),
|
|
889
|
+
_: 2
|
|
890
|
+
}, 1024)) : W("", !0)
|
|
891
|
+
])
|
|
892
|
+
], !0)
|
|
893
|
+
]),
|
|
894
|
+
_: 2
|
|
895
|
+
}, 1032, ["class", "disabled"]))
|
|
896
|
+
], 64))
|
|
897
|
+
]))), 128))
|
|
898
|
+
]);
|
|
899
|
+
}
|
|
900
|
+
const Rt = /* @__PURE__ */ q(It, [["render", Bt], ["__scopeId", "data-v-b83035ab"]]), Dt = (e) => {
|
|
901
|
+
const t = p(() => {
|
|
902
|
+
var r;
|
|
903
|
+
return !!((r = e.value) != null && r.find(({ items: b }) => !!b));
|
|
904
|
+
}), s = p(() => {
|
|
905
|
+
var r;
|
|
906
|
+
return t.value ? (r = e.value) == null ? void 0 : r.reduce((b, a) => (a.items ? b.push(...a.items.flat()) : b.push(a), b), []) : e.value;
|
|
907
|
+
});
|
|
908
|
+
return {
|
|
909
|
+
isMultiLevelSelect: t,
|
|
910
|
+
flattenedItemsList: s
|
|
911
|
+
};
|
|
912
|
+
}, De = {
|
|
913
|
+
"en-US": {
|
|
914
|
+
allSelected: "All selected ({total})",
|
|
915
|
+
numberOfTotalSelected: "{number} of {total} selected",
|
|
916
|
+
numbersSelected: "{number} selected",
|
|
917
|
+
selectAll: "Select all ({total})"
|
|
918
|
+
}
|
|
919
|
+
}, Nt = { class: "b-listbox-multi-select" }, Pt = { key: 0 }, Mt = {
|
|
920
|
+
key: 1,
|
|
921
|
+
class: "b-listbox-multi-select__divider"
|
|
922
|
+
}, wt = { i18n: { messages: De } }, Ut = /* @__PURE__ */ X({
|
|
923
|
+
...wt,
|
|
924
|
+
__name: "listbox-multi-select",
|
|
925
|
+
props: {
|
|
926
|
+
hasMoreItems: { type: Boolean, default: !1 },
|
|
927
|
+
isOptionDisabled: { type: Function, default: () => !1 },
|
|
928
|
+
items: {},
|
|
929
|
+
lazyLoadType: { default: "none" },
|
|
930
|
+
searching: { type: Boolean, default: !1 },
|
|
931
|
+
selectedValues: {},
|
|
932
|
+
staticCategories: { type: Boolean, default: !1 }
|
|
933
|
+
},
|
|
934
|
+
emits: ["select"],
|
|
935
|
+
setup(e, { emit: t }) {
|
|
936
|
+
const s = e, r = t, { t: b } = ye({ messages: De }), a = je(), l = M(null), m = M(null), g = M(null), n = p(() => s.selectedValues.map(({ value: c }) => c)), { isMultiLevelSelect: v, flattenedItemsList: o } = Dt(Z(s, "items")), h = (c) => {
|
|
937
|
+
var _;
|
|
938
|
+
const f = s.isOptionDisabled(c), i = ((_ = n.value) == null ? void 0 : _.includes(c.value)) || !1;
|
|
939
|
+
return { isDisabled: f, isPreSelected: i };
|
|
940
|
+
}, L = p(() => {
|
|
941
|
+
if (s.searching && v)
|
|
942
|
+
return s.items;
|
|
943
|
+
const c = o.value.filter((f) => {
|
|
944
|
+
const { isDisabled: i, isPreSelected: _ } = h(f);
|
|
945
|
+
return i && _ || !i;
|
|
946
|
+
});
|
|
947
|
+
return s.selectedValues.forEach((f) => {
|
|
948
|
+
c.find((i) => i.value === f.value) || c.push(f);
|
|
949
|
+
}), c;
|
|
950
|
+
}), k = p(
|
|
951
|
+
() => {
|
|
952
|
+
var c;
|
|
953
|
+
return (c = L.value) == null ? void 0 : c.filter((f) => {
|
|
954
|
+
var i;
|
|
955
|
+
return f.items && v.value && s.searching ? f.items.filter(
|
|
956
|
+
(E) => (s.selectedValues ?? []).includes(E.value)
|
|
957
|
+
).length === f.items.length : (i = n.value) == null ? void 0 : i.includes(f.value);
|
|
958
|
+
});
|
|
959
|
+
}
|
|
960
|
+
), B = () => v.value && !s.searching ? o.value.length : s.items.length, y = p(() => {
|
|
961
|
+
var _;
|
|
962
|
+
const c = L.value.length, f = B(), i = ((_ = k.value) == null ? void 0 : _.length) || 0;
|
|
963
|
+
return i === 0 ? b("selectAll", { total: c }) : i === f ? b("allSelected", { total: f }) : i <= f ? b("numberOfTotalSelected", { number: i, total: f }) : b("numbersSelected", { number: i });
|
|
964
|
+
}), S = (c) => {
|
|
965
|
+
const f = (_) => {
|
|
966
|
+
const { isDisabled: E, isPreSelected: j } = h(_);
|
|
967
|
+
return E && j || !E;
|
|
968
|
+
}, i = c.filter(f).filter((_) => !n.value.includes(_.value));
|
|
969
|
+
r("select", [...s.selectedValues, ...i]);
|
|
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", _);
|
|
976
|
+
}, R = () => {
|
|
977
|
+
S(o.value);
|
|
978
|
+
}, C = () => {
|
|
979
|
+
O(o.value);
|
|
980
|
+
}, { isAllSelected: A, isIndeterminate: V, toggleSelectAll: te } = Be(
|
|
981
|
+
k,
|
|
982
|
+
L,
|
|
983
|
+
R,
|
|
984
|
+
C
|
|
985
|
+
), me = (c) => {
|
|
986
|
+
S(c.items);
|
|
987
|
+
}, ue = (c) => {
|
|
988
|
+
O(c.items);
|
|
989
|
+
}, J = (c, f) => {
|
|
990
|
+
let i = !1;
|
|
991
|
+
const _ = s.selectedValues.filter(({ value: E }) => f.value === E ? (i = !0, !1) : !0);
|
|
992
|
+
i || _.push(f), r(c, _);
|
|
993
|
+
}, w = p(() => {
|
|
994
|
+
if (!v.value)
|
|
995
|
+
return s.selectedValues;
|
|
996
|
+
const c = (E) => n.value.includes(E.value), f = (E) => !s.staticCategories && E.every((j) => c(j));
|
|
997
|
+
return s.items.flatMap(
|
|
998
|
+
(E) => E.items && !f(E.items) ? E.items : E
|
|
999
|
+
).filter((E) => E.items ? !0 : c(E));
|
|
1000
|
+
}), ae = p(() => {
|
|
1001
|
+
var i, _, E, j;
|
|
1002
|
+
const c = ["automatic", "button"].includes(s.lazyLoadType), f = ((i = s.selectedValues) == null ? void 0 : i.length) > 0 && ((_ = k.value) == null ? void 0 : _.length) !== ((E = o.value) == null ? void 0 : E.length);
|
|
1003
|
+
return c && s.hasMoreItems ? !!((j = s.selectedValues) != null && j.length) : f;
|
|
1004
|
+
}), Ce = p(() => ["automatic", "button"].includes(s.lazyLoadType) ? !s.hasMoreItems : !0), Ne = p(
|
|
1005
|
+
() => l.value ? [l.value] : []
|
|
1006
|
+
), Pe = p(
|
|
1007
|
+
() => {
|
|
1008
|
+
var c, f;
|
|
1009
|
+
return (f = (c = g.value) == null ? void 0 : c.$children) != null && f.length ? g.value.$children : [];
|
|
1010
|
+
}
|
|
1011
|
+
), Me = p(() => ({ label: y, value: A })), we = p(() => [Me, ...Z(s, "items").value]), Ue = (c) => {
|
|
1012
|
+
var _;
|
|
1013
|
+
const f = [...Ne.value, ...Pe.value], i = f[c].$el;
|
|
1014
|
+
i.tagName === "LABEL" ? i.focus() : (_ = i.querySelector("label")) == null || _.focus(), f[c].$el.focus();
|
|
1015
|
+
}, {
|
|
1016
|
+
moveToNextElement: Ve,
|
|
1017
|
+
moveToPreviousElement: xe,
|
|
1018
|
+
moveToFirstElement: Ge,
|
|
1019
|
+
moveToLastElement: ze,
|
|
1020
|
+
preventDefault: he,
|
|
1021
|
+
focusedIndex: Ee
|
|
1022
|
+
} = Re(
|
|
1023
|
+
{
|
|
1024
|
+
items: M(we),
|
|
1025
|
+
isOptionDisabled: s.isOptionDisabled,
|
|
1026
|
+
hasStaticCategories: Z(s, "staticCategories")
|
|
1027
|
+
},
|
|
1028
|
+
Ue
|
|
1029
|
+
), Ye = {
|
|
1030
|
+
[x.ARROW_UP]: (c) => xe(c),
|
|
1031
|
+
[x.ARROW_DOWN]: (c) => Ve(c),
|
|
1032
|
+
[x.HOME]: Ge,
|
|
1033
|
+
[x.END]: ze
|
|
1034
|
+
}, Fe = {
|
|
1035
|
+
[x.ARROW_UP]: he,
|
|
1036
|
+
[x.ARROW_DOWN]: he
|
|
1037
|
+
};
|
|
1038
|
+
return (c, f) => (d(), T("div", Nt, [
|
|
1039
|
+
ae.value ? (d(), T("div", Pt, [
|
|
1040
|
+
oe((d(), T("ul", U({ class: "b-listbox-multi-select__chips" }, Q(Fe, !0)), [
|
|
1041
|
+
(d(!0), T(ee, null, F(w.value, (i) => (d(), T("li", {
|
|
1042
|
+
key: i.value
|
|
1043
|
+
}, [
|
|
1044
|
+
P(N(Qe), {
|
|
1045
|
+
ref_for: !0,
|
|
1046
|
+
ref_key: "selectedListboxItemsRef",
|
|
1047
|
+
ref: m,
|
|
1048
|
+
disabled: c.isOptionDisabled(i),
|
|
1049
|
+
label: i.label,
|
|
1050
|
+
condensed: "",
|
|
1051
|
+
onClick: (_) => i.items ? ue(i) : J("select", i)
|
|
1052
|
+
}, null, 8, ["disabled", "label", "onClick"])
|
|
1053
|
+
]))), 128))
|
|
1054
|
+
], 16)), [
|
|
1055
|
+
[N(de)]
|
|
1056
|
+
]),
|
|
1057
|
+
f[4] || (f[4] = K("hr", { class: "b-listbox-multi-select__divider" }, null, -1))
|
|
1058
|
+
])) : W("", !0),
|
|
1059
|
+
oe((d(), T("div", Q(Ye, !0), [
|
|
1060
|
+
Ce.value ? (d(), D(N(be), {
|
|
1061
|
+
key: 0,
|
|
1062
|
+
ref_key: "selectAllListboxItemsRef",
|
|
1063
|
+
ref: l,
|
|
1064
|
+
class: "b-listbox-multi-select__option"
|
|
1065
|
+
}, {
|
|
1066
|
+
default: I(() => [
|
|
1067
|
+
P(N(Se), {
|
|
1068
|
+
"aria-label": y.value,
|
|
1069
|
+
"model-value": N(A),
|
|
1070
|
+
indeterminate: N(V),
|
|
1071
|
+
tabindex: N(Ee) === 0 ? 0 : -1,
|
|
1072
|
+
"onUpdate:modelValue": N(te)
|
|
1073
|
+
}, null, 8, ["aria-label", "model-value", "indeterminate", "tabindex", "onUpdate:modelValue"]),
|
|
1074
|
+
P(N(ne), {
|
|
1075
|
+
el: "span",
|
|
1076
|
+
"aria-hidden": "true"
|
|
1077
|
+
}, {
|
|
1078
|
+
default: I(() => [
|
|
1079
|
+
z(G(y.value), 1)
|
|
1080
|
+
]),
|
|
1081
|
+
_: 1
|
|
1082
|
+
})
|
|
1083
|
+
]),
|
|
1084
|
+
_: 1
|
|
1085
|
+
}, 512)) : W("", !0),
|
|
1086
|
+
Ce.value ? (d(), T("hr", Mt)) : W("", !0),
|
|
1087
|
+
P(N(Rt), {
|
|
1088
|
+
ref_key: "listboxItemsRef",
|
|
1089
|
+
ref: g,
|
|
1090
|
+
items: c.items,
|
|
1091
|
+
"is-option-disabled": c.isOptionDisabled,
|
|
1092
|
+
"is-multi-level": N(v),
|
|
1093
|
+
"static-categories": c.staticCategories,
|
|
1094
|
+
searching: c.searching,
|
|
1095
|
+
"selected-items-list": n.value,
|
|
1096
|
+
"focused-index": N(Ee),
|
|
1097
|
+
onToggleCheckboxSelection: f[0] || (f[0] = (i) => J("select", i)),
|
|
1098
|
+
onSelectCategory: me,
|
|
1099
|
+
onUnselectCategory: ue,
|
|
1100
|
+
onSpacePressed: f[1] || (f[1] = (i) => J(N(u).SPACE, i)),
|
|
1101
|
+
onTabPressed: f[2] || (f[2] = (i) => J(N(u).TAB, i)),
|
|
1102
|
+
onEnterPressed: f[3] || (f[3] = (i) => J(N(u).ENTER, i))
|
|
1103
|
+
}, ce({ _: 2 }, [
|
|
1104
|
+
F(N(a), (i, _) => ({
|
|
1105
|
+
name: _,
|
|
1106
|
+
fn: I((E) => [
|
|
1107
|
+
Y(c.$slots, _, le(re(E)), void 0, !0)
|
|
1108
|
+
])
|
|
1109
|
+
}))
|
|
1110
|
+
]), 1032, ["items", "is-option-disabled", "is-multi-level", "static-categories", "searching", "selected-items-list", "focused-index"])
|
|
1111
|
+
], 16)), [
|
|
1112
|
+
[N(de)]
|
|
1113
|
+
])
|
|
1114
|
+
]));
|
|
1115
|
+
}
|
|
1116
|
+
}), Le = /* @__PURE__ */ q(Ut, [["__scopeId", "data-v-98a72a10"]]), Oe = {
|
|
1117
|
+
"en-US": {
|
|
1118
|
+
loading: "Loading",
|
|
1119
|
+
showMore: "Show more"
|
|
1120
|
+
},
|
|
1121
|
+
"ja-JP": {
|
|
1122
|
+
loading: "読み込み中",
|
|
1123
|
+
showMore: "表示内容を増やす"
|
|
1124
|
+
},
|
|
1125
|
+
"pt-BR": {
|
|
1126
|
+
loading: "Carregando",
|
|
1127
|
+
showMore: "Mostrar mais"
|
|
1128
|
+
}
|
|
1129
|
+
}, Vt = 36, xt = X({
|
|
1130
|
+
name: "bento-listbox",
|
|
1131
|
+
components: {
|
|
1132
|
+
BentoEmptyState: Je,
|
|
1133
|
+
BentoListboxSingleSelect: Et,
|
|
1134
|
+
BentoListboxMultiSelect: Le,
|
|
1135
|
+
BentoTypography: ne,
|
|
1136
|
+
BentoLoadingIndicator: Xe,
|
|
1137
|
+
BentoLoadingButton: st
|
|
1138
|
+
},
|
|
1139
|
+
directives: { BentoKeyboardNavigationDirective: de },
|
|
1140
|
+
i18n: { messages: Oe },
|
|
1141
|
+
props: {
|
|
1142
|
+
/**
|
|
1143
|
+
* Defines a string value that labels an interactive element.
|
|
1144
|
+
*/
|
|
1145
|
+
ariaLabel: { type: String, default: null },
|
|
1146
|
+
/**
|
|
1147
|
+
* Empty state props that will be used with the inner empty state component to be displayed when no search results are found.
|
|
1148
|
+
*/
|
|
1149
|
+
emptyState: {
|
|
1150
|
+
type: Object,
|
|
1151
|
+
default: void 0
|
|
1152
|
+
},
|
|
1153
|
+
/**
|
|
1154
|
+
* Indicates whether there are more items to load
|
|
1155
|
+
*/
|
|
1156
|
+
hasMoreItems: { type: Boolean, default: !1 },
|
|
1157
|
+
/**
|
|
1158
|
+
* Identifies the listbox whose contents are controlled by the the combobox on which the aria-controls attribute is set.
|
|
1159
|
+
*/
|
|
1160
|
+
id: { type: String, required: !0 },
|
|
1161
|
+
/**
|
|
1162
|
+
* Function that allows the options to be disabled
|
|
1163
|
+
*
|
|
1164
|
+
* @type {BentoListboxIsOptionDisabled}
|
|
1165
|
+
* @param {BentoListboxOptionItem} option - Listbox option object
|
|
1166
|
+
* @param {string} option.label - Option's label text
|
|
1167
|
+
* @param {string|number} option.value - Option's value
|
|
1168
|
+
* @param {unknown} option.data - Option's extra data to be passed to the default slot
|
|
1169
|
+
*/
|
|
1170
|
+
isOptionDisabled: {
|
|
1171
|
+
type: Function,
|
|
1172
|
+
default: () => {
|
|
1173
|
+
}
|
|
1174
|
+
},
|
|
1175
|
+
/**
|
|
1176
|
+
* The option elements to populate the listbox with.
|
|
1177
|
+
* It must be an array of {@see BentoListboxOptionItem }
|
|
1178
|
+
* * @property {string} value.label - Text to be displayed in the option
|
|
1179
|
+
* * @property {string,number} value.value - Value of the option
|
|
1180
|
+
*/
|
|
1181
|
+
items: {
|
|
1182
|
+
type: Array,
|
|
1183
|
+
required: !0
|
|
1184
|
+
},
|
|
1185
|
+
/**
|
|
1186
|
+
* Indicates if new options are lazy loading.
|
|
1187
|
+
*/
|
|
1188
|
+
loading: { type: Boolean, default: !1 },
|
|
1189
|
+
/**
|
|
1190
|
+
* The type of `Lazy Load`.
|
|
1191
|
+
* Type "automatic" will enable infinite scrolling
|
|
1192
|
+
* Type "button" will enable lazy loading with "Show more" button
|
|
1193
|
+
*/
|
|
1194
|
+
lazyLoadType: {
|
|
1195
|
+
type: String,
|
|
1196
|
+
default: se.NONE,
|
|
1197
|
+
validator: (e) => Object.values(se).includes(e)
|
|
1198
|
+
},
|
|
1199
|
+
/**
|
|
1200
|
+
* Indicates the listbox is loading filtered items.
|
|
1201
|
+
*/
|
|
1202
|
+
componentLoading: { type: Boolean, default: !1 },
|
|
1203
|
+
/**
|
|
1204
|
+
* If enabled, the user will be able to select multiple items.
|
|
1205
|
+
*/
|
|
1206
|
+
multiple: { type: Boolean, default: !1 },
|
|
1207
|
+
/**
|
|
1208
|
+
* If enabled, dropdown will display non-selectable, static categories
|
|
1209
|
+
*/
|
|
1210
|
+
staticCategories: { type: Boolean, default: !1 },
|
|
1211
|
+
/**
|
|
1212
|
+
* Messaged displayed when no items are listed in the listbox
|
|
1213
|
+
*/
|
|
1214
|
+
noResultsMessage: { type: String, required: !0 },
|
|
1215
|
+
/**
|
|
1216
|
+
* Flag that indicates that an external search it's being made
|
|
1217
|
+
* to filter out the items inside the the multi-select listbox
|
|
1218
|
+
*
|
|
1219
|
+
* If enabled, hides the "Select all" checkbox in "multiple" mode.
|
|
1220
|
+
*/
|
|
1221
|
+
searching: Le.props.searching,
|
|
1222
|
+
/**
|
|
1223
|
+
* The `input` value.
|
|
1224
|
+
* Providing an empty string or empty array will select no options.
|
|
1225
|
+
* Set to an empty string `''` if you don't want any of the available options to be selected for single select
|
|
1226
|
+
*/
|
|
1227
|
+
selectedValue: {
|
|
1228
|
+
type: Array,
|
|
1229
|
+
default: () => []
|
|
1230
|
+
},
|
|
1231
|
+
/**
|
|
1232
|
+
* Enables virtual scrolling if set to true or by providing an object with itemHeight function.
|
|
1233
|
+
* The itemHeight function is used to calculate the height of rendered item given it's index.
|
|
1234
|
+
*/
|
|
1235
|
+
virtualScroll: {
|
|
1236
|
+
type: [Boolean, Object],
|
|
1237
|
+
default: !1
|
|
1238
|
+
}
|
|
1239
|
+
},
|
|
1240
|
+
emits: [
|
|
1241
|
+
u.SELECT,
|
|
1242
|
+
u.SPACE,
|
|
1243
|
+
u.SHOW_MORE,
|
|
1244
|
+
u.ENTER,
|
|
1245
|
+
u.ESCAPE,
|
|
1246
|
+
u.TAB
|
|
1247
|
+
],
|
|
1248
|
+
setup(e, { emit: t, slots: s }) {
|
|
1249
|
+
const r = M([]), b = Z(e, "items"), { t: a } = ye({ messages: Oe }), l = p(() => e.lazyLoadType !== se.AUTOMATIC), m = p(() => e.lazyLoadType === se.AUTOMATIC), g = () => {
|
|
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 : Vt;
|
|
1252
|
+
}, {
|
|
1253
|
+
containerRef: n,
|
|
1254
|
+
containerProps: v,
|
|
1255
|
+
onScroll: o,
|
|
1256
|
+
list: h,
|
|
1257
|
+
wrapperProps: L
|
|
1258
|
+
} = ot(b, {
|
|
1259
|
+
itemHeight: g(),
|
|
1260
|
+
// Disable virtual scrolling if not enabled or if lazy loading is enabled or if multi-select
|
|
1261
|
+
disabled: (e == null ? void 0 : e.multiple) || (e == null ? void 0 : e.virtualScroll) === !1 || (e == null ? void 0 : e.lazyLoadType) !== "none"
|
|
1262
|
+
}), k = p(
|
|
1263
|
+
() => e.componentLoading !== void 0 || l.value ? "true" : void 0
|
|
1264
|
+
), B = p(
|
|
1265
|
+
() => l.value && e.loading || e.componentLoading ? "true" : "false"
|
|
1266
|
+
), y = p(
|
|
1267
|
+
() => l.value || e.componentLoading !== void 0 ? "polite" : void 0
|
|
1268
|
+
), S = (w) => (ae) => {
|
|
1269
|
+
t(w, ae);
|
|
1270
|
+
}, O = () => {
|
|
1271
|
+
t(u.SHOW_MORE);
|
|
1272
|
+
}, R = Ze(() => {
|
|
1273
|
+
const w = n.value;
|
|
1274
|
+
if (!w)
|
|
1275
|
+
return;
|
|
1276
|
+
const ae = Math.round(w.scrollTop) + w.clientHeight >= w.scrollHeight;
|
|
1277
|
+
e.hasMoreItems && ae && !e.loading && O();
|
|
1278
|
+
}), C = () => {
|
|
1279
|
+
m.value ? R() : o();
|
|
1280
|
+
}, A = p(() => {
|
|
1281
|
+
var w;
|
|
1282
|
+
return ((w = e.items) == null ? void 0 : w.length) === 0;
|
|
1283
|
+
}), V = p(
|
|
1284
|
+
() => e.lazyLoadType === se.BUTTON && e.hasMoreItems
|
|
1285
|
+
), te = p(
|
|
1286
|
+
() => e.loading ? _e.LOADING : _e.START
|
|
1287
|
+
), me = p(() => e.loading ? a("loading") : a("showMore")), ue = p(() => ({
|
|
1288
|
+
...e.emptyState,
|
|
1289
|
+
variant: "condensed"
|
|
1290
|
+
})), J = {
|
|
1291
|
+
[u.SELECT]: S(u.SELECT),
|
|
1292
|
+
[u.SPACE]: S(u.SPACE),
|
|
1293
|
+
[u.TAB]: S(u.TAB),
|
|
1294
|
+
[u.ENTER]: S(u.ENTER)
|
|
1295
|
+
};
|
|
1296
|
+
return {
|
|
1297
|
+
// Refs
|
|
1298
|
+
listboxRef: n,
|
|
1299
|
+
listboxItemRef: r,
|
|
1300
|
+
// a11y
|
|
1301
|
+
ariaAtomic: k,
|
|
1302
|
+
ariaBusy: B,
|
|
1303
|
+
ariaLive: y,
|
|
1304
|
+
// Values
|
|
1305
|
+
containerProps: v,
|
|
1306
|
+
isSearchResultEmpty: A,
|
|
1307
|
+
limitedEmptyStateProps: ue,
|
|
1308
|
+
loadingButtonState: te,
|
|
1309
|
+
slots: s,
|
|
1310
|
+
shouldDisplayShowMoreButton: V,
|
|
1311
|
+
showMoreButtonText: me,
|
|
1312
|
+
virtualisedItems: h,
|
|
1313
|
+
wrapperProps: L,
|
|
1314
|
+
// Enums
|
|
1315
|
+
BentoKeyboardNavigationKeyDownEvent: x,
|
|
1316
|
+
BentoListboxEvent: u,
|
|
1317
|
+
// Methods
|
|
1318
|
+
onListboxContainerScroll: C,
|
|
1319
|
+
onOptionSelected: S,
|
|
1320
|
+
emitShowMore: O,
|
|
1321
|
+
listboxListeners: J
|
|
1322
|
+
};
|
|
1323
|
+
}
|
|
1324
|
+
}), Gt = ["id", "aria-busy", "aria-atomic", "aria-label", "aria-live"], zt = {
|
|
1325
|
+
key: 0,
|
|
1326
|
+
class: "b-listbox__loading-filtered-items"
|
|
1327
|
+
}, Yt = {
|
|
1328
|
+
key: 1,
|
|
1329
|
+
class: "b-listbox__empty-search-message"
|
|
1330
|
+
}, Ft = {
|
|
1331
|
+
key: 2,
|
|
1332
|
+
class: "b-listbox__lazy-load"
|
|
1333
|
+
}, Wt = {
|
|
1334
|
+
key: 3,
|
|
1335
|
+
class: "b-listbox__lazy-load"
|
|
1336
|
+
};
|
|
1337
|
+
function Kt(e, t, s, r, b, a) {
|
|
1338
|
+
var L;
|
|
1339
|
+
const l = $("bento-loading-indicator"), m = $("bento-empty-state"), g = $("bento-typography"), n = $("bento-listbox-multi-select"), v = $("bento-listbox-single-select"), o = $("bento-loading-button"), h = ke("bento-keyboard-navigation-directive");
|
|
1340
|
+
return oe((d(), T("div", {
|
|
1341
|
+
id: e.id,
|
|
1342
|
+
ref: "listboxRef",
|
|
1343
|
+
class: "b-listbox",
|
|
1344
|
+
role: "listbox",
|
|
1345
|
+
tabindex: "-1",
|
|
1346
|
+
"aria-busy": e.ariaBusy,
|
|
1347
|
+
"aria-atomic": e.ariaAtomic,
|
|
1348
|
+
"aria-label": e.ariaLabel,
|
|
1349
|
+
"aria-live": e.ariaLive,
|
|
1350
|
+
style: He((L = e.containerProps) == null ? void 0 : L.style),
|
|
1351
|
+
onScroll: t[0] || (t[0] = (...k) => e.onListboxContainerScroll && e.onListboxContainerScroll(...k))
|
|
1352
|
+
}, [
|
|
1353
|
+
K("div", le(re(e.wrapperProps)), [
|
|
1354
|
+
e.componentLoading ? (d(), T("div", zt, [
|
|
1355
|
+
P(l)
|
|
1356
|
+
])) : e.isSearchResultEmpty ? (d(), T("div", Yt, [
|
|
1357
|
+
e.emptyState ? (d(), D(m, le(U({ key: 0 }, e.limitedEmptyStateProps)), null, 16)) : (d(), D(g, {
|
|
1358
|
+
key: 1,
|
|
1359
|
+
el: "span"
|
|
1360
|
+
}, {
|
|
1361
|
+
default: I(() => [
|
|
1362
|
+
z(G(e.noResultsMessage), 1)
|
|
1363
|
+
]),
|
|
1364
|
+
_: 1
|
|
1365
|
+
}))
|
|
1366
|
+
])) : (d(), T(ee, { key: 2 }, [
|
|
1367
|
+
e.multiple ? (d(), D(n, U({
|
|
1368
|
+
key: 0,
|
|
1369
|
+
ref: "listboxItemRef",
|
|
1370
|
+
"has-more-items": e.hasMoreItems,
|
|
1371
|
+
items: e.items,
|
|
1372
|
+
"lazy-load-type": e.lazyLoadType,
|
|
1373
|
+
"static-categories": e.staticCategories,
|
|
1374
|
+
"selected-values": e.selectedValue,
|
|
1375
|
+
searching: e.searching,
|
|
1376
|
+
"is-option-disabled": e.isOptionDisabled
|
|
1377
|
+
}, Q(e.listboxListeners)), ce({ _: 2 }, [
|
|
1378
|
+
F(e.slots, (k, B) => ({
|
|
1379
|
+
name: B,
|
|
1380
|
+
fn: I((y) => [
|
|
1381
|
+
Y(e.$slots, B, le(re(y)), void 0, !0)
|
|
1382
|
+
])
|
|
1383
|
+
}))
|
|
1384
|
+
]), 1040, ["has-more-items", "items", "lazy-load-type", "static-categories", "selected-values", "searching", "is-option-disabled"])) : (d(), D(v, U({
|
|
1385
|
+
key: 1,
|
|
1386
|
+
ref: "listboxItemRef",
|
|
1387
|
+
items: e.virtualisedItems,
|
|
1388
|
+
"selected-value": e.selectedValue,
|
|
1389
|
+
"static-categories": e.staticCategories,
|
|
1390
|
+
"is-option-disabled": e.isOptionDisabled
|
|
1391
|
+
}, Q(e.listboxListeners)), ce({ _: 2 }, [
|
|
1392
|
+
F(e.slots, (k, B) => ({
|
|
1393
|
+
name: B,
|
|
1394
|
+
fn: I((y) => [
|
|
1395
|
+
Y(e.$slots, B, le(re(y)), void 0, !0)
|
|
1396
|
+
])
|
|
1397
|
+
}))
|
|
1398
|
+
]), 1040, ["items", "selected-value", "static-categories", "is-option-disabled"])),
|
|
1399
|
+
e.shouldDisplayShowMoreButton ? (d(), T("div", Ft, [
|
|
1400
|
+
P(o, {
|
|
1401
|
+
state: e.loadingButtonState,
|
|
1402
|
+
variant: "secondary",
|
|
1403
|
+
onClickCapture: e.emitShowMore
|
|
1404
|
+
}, {
|
|
1405
|
+
default: I(() => [
|
|
1406
|
+
z(G(e.showMoreButtonText), 1)
|
|
1407
|
+
]),
|
|
1408
|
+
_: 1
|
|
1409
|
+
}, 8, ["state", "onClickCapture"])
|
|
1410
|
+
])) : e.loading ? (d(), T("div", Wt, [
|
|
1411
|
+
P(l)
|
|
1412
|
+
])) : W("", !0)
|
|
1413
|
+
], 64))
|
|
1414
|
+
], 16)
|
|
1415
|
+
], 44, Gt)), [
|
|
1416
|
+
[h]
|
|
1417
|
+
]);
|
|
1418
|
+
}
|
|
1419
|
+
const rs = /* @__PURE__ */ q(xt, [["render", Kt], ["__scopeId", "data-v-7b74fe4e"]]), pe = (e, t) => {
|
|
1420
|
+
for (const s of e) {
|
|
1421
|
+
if (s.value === t)
|
|
1422
|
+
return s;
|
|
1423
|
+
if (s.items) {
|
|
1424
|
+
const r = pe(s.items, t);
|
|
1425
|
+
if (r)
|
|
1426
|
+
return r;
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
return null;
|
|
1430
|
+
}, cs = (e, t, s) => {
|
|
1431
|
+
const r = M([]), b = M(), a = (g) => {
|
|
1432
|
+
s.value ? b.value = g.map(({ value: n }) => n) : b.value = g.length > 0 ? g[0].value : null;
|
|
1433
|
+
}, l = (g) => {
|
|
1434
|
+
r.value = g, a(g);
|
|
1435
|
+
}, m = () => {
|
|
1436
|
+
r.value = [], b.value = null;
|
|
1437
|
+
};
|
|
1438
|
+
return Ie(
|
|
1439
|
+
() => t.value,
|
|
1440
|
+
() => {
|
|
1441
|
+
if (!t.value && t.value !== 0) {
|
|
1442
|
+
m();
|
|
1443
|
+
return;
|
|
1444
|
+
}
|
|
1445
|
+
const g = !Array.isArray(t.value), n = [...r.value];
|
|
1446
|
+
m();
|
|
1447
|
+
const v = (o) => {
|
|
1448
|
+
let h = pe(e.value, o);
|
|
1449
|
+
h || (h = pe(n, o)), h || (h = { value: o, label: o.toString() }), r.value.push(h);
|
|
1450
|
+
};
|
|
1451
|
+
if (g) {
|
|
1452
|
+
const o = t.value;
|
|
1453
|
+
v(o), a(r.value);
|
|
1454
|
+
return;
|
|
1455
|
+
}
|
|
1456
|
+
t.value.forEach(v), a(r.value);
|
|
1457
|
+
},
|
|
1458
|
+
{ immediate: !0 }
|
|
1459
|
+
), {
|
|
1460
|
+
// Values
|
|
1461
|
+
cachedSelectedListboxOptions: r,
|
|
1462
|
+
cachedListboxSelectedValues: b,
|
|
1463
|
+
// Methods
|
|
1464
|
+
resetCache: m,
|
|
1465
|
+
setCachedValues: l
|
|
1466
|
+
};
|
|
1467
|
+
};
|
|
1468
|
+
export {
|
|
1469
|
+
se as B,
|
|
1470
|
+
u as a,
|
|
1471
|
+
rs as b,
|
|
1472
|
+
cs as c,
|
|
1473
|
+
Dt as u
|
|
1474
|
+
};
|
|
1475
|
+
//# sourceMappingURL=use-cached-selected-values.CQKeFUJd.js.map
|