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