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