@adyen/bento-vue2 2.0.1 → 2.1.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/README.md +2 -2
- package/dist/@types/index.d.ts +114 -82
- package/dist/accordion.js +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/ai-tag.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/anchor-scroller.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-actions.css +1 -1
- package/dist/assets/button.css +1 -1
- package/dist/assets/calendar.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/checkbox.css +1 -1
- package/dist/assets/chip.css +1 -1
- package/dist/assets/currency.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/draggable.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/header-with-views.css +1 -1
- package/dist/assets/input-field.css +1 -1
- package/dist/assets/input-time.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/navigation-menu-group.css +1 -1
- package/dist/assets/pagination.css +1 -1
- package/dist/assets/rich-text-editor.css +1 -1
- package/dist/assets/search-bar.css +1 -1
- package/dist/assets/secondary-nav.css +1 -1
- package/dist/assets/selection-card-group.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/step.css +1 -1
- package/dist/assets/structured-list-item.css +1 -1
- package/dist/assets/tab.css +1 -1
- package/dist/assets/textarea.css +1 -1
- package/dist/assets/toggle.css +1 -1
- package/dist/assets/typography.css +1 -1
- package/dist/avatar.js +1 -1
- package/dist/button.js +3 -3
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chip.js +1 -1
- package/dist/chunks/{accordion-item.B7lteJBu.js → accordion-item.C158YxId.js} +5 -5
- package/dist/chunks/{accordion-item.B7lteJBu.js.map → accordion-item.C158YxId.js.map} +1 -1
- package/dist/chunks/{action-bar.BsXW7BI2.js → action-bar.D29UQHoA.js} +15 -15
- package/dist/chunks/{action-bar.BsXW7BI2.js.map → action-bar.D29UQHoA.js.map} +1 -1
- package/dist/chunks/{ai-button.BnFk5CzK.js → ai-button.qEaHYybv.js} +3 -3
- package/dist/chunks/{ai-button.BnFk5CzK.js.map → ai-button.qEaHYybv.js.map} +1 -1
- package/dist/chunks/{ai-tag.D2Q0xhFK.js → ai-tag.BLi-Xoh_.js} +3 -3
- package/dist/chunks/{ai-tag.D2Q0xhFK.js.map → ai-tag.BLi-Xoh_.js.map} +1 -1
- package/dist/chunks/{alert.DJDHwVeR.js → alert.BddJPWMN.js} +3 -3
- package/dist/chunks/{alert.DJDHwVeR.js.map → alert.BddJPWMN.js.map} +1 -1
- package/dist/chunks/{anchor-scroller.BbvghQxZ.js → anchor-scroller.Clb_9RNz.js} +5 -5
- package/dist/chunks/{anchor-scroller.BbvghQxZ.js.map → anchor-scroller.Clb_9RNz.js.map} +1 -1
- package/dist/chunks/{avatar.CxPKc8Gy.js → avatar.BN4MI-42.js} +2 -2
- package/dist/chunks/{avatar.CxPKc8Gy.js.map → avatar.BN4MI-42.js.map} +1 -1
- package/dist/chunks/{base-button.DOhHyU7x.js → base-button.DYroENBg.js} +3 -3
- package/dist/chunks/{base-button.DOhHyU7x.js.map → base-button.DYroENBg.js.map} +1 -1
- package/dist/chunks/{base-modal.CcmoTJdc.js → base-modal._-Cc6jfi.js} +6 -6
- package/dist/chunks/{base-modal.CcmoTJdc.js.map → base-modal._-Cc6jfi.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.BY394ars.js → button-actions-with-menu.1vZJWN1K.js} +2 -2
- package/dist/chunks/{button-actions-with-menu.BY394ars.js.map → button-actions-with-menu.1vZJWN1K.js.map} +1 -1
- package/dist/chunks/{button-actions.bkcLUE1G.js → button-actions.CdetBz3J.js} +8 -8
- package/dist/chunks/button-actions.CdetBz3J.js.map +1 -0
- package/dist/chunks/button-actions.types.BptAXjD8.js.map +1 -1
- package/dist/chunks/{button.DII5Ifwa.js → button.tsTeQRcP.js} +3 -3
- package/dist/chunks/{button.DII5Ifwa.js.map → button.tsTeQRcP.js.map} +1 -1
- package/dist/chunks/{calendar.CXdLEeN4.js → calendar.BalfhApP.js} +293 -290
- package/dist/chunks/calendar.BalfhApP.js.map +1 -0
- package/dist/chunks/{card.BmpB0VbL.js → card.BhhC01dV.js} +7 -7
- package/dist/chunks/{card.BmpB0VbL.js.map → card.BhhC01dV.js.map} +1 -1
- package/dist/chunks/{checkbox-group.D1uyc3z3.js → checkbox-group.C-1v4X3c.js} +4 -4
- package/dist/chunks/{checkbox-group.D1uyc3z3.js.map → checkbox-group.C-1v4X3c.js.map} +1 -1
- package/dist/chunks/{checkbox.D5xZ5Nnh.js → checkbox.CnuIUi4-.js} +6 -6
- package/dist/chunks/{checkbox.D5xZ5Nnh.js.map → checkbox.CnuIUi4-.js.map} +1 -1
- package/dist/chunks/{chip.DRsJylWl.js → chip.Cc4f2vws.js} +14 -12
- package/dist/chunks/{chip.DRsJylWl.js.map → chip.Cc4f2vws.js.map} +1 -1
- package/dist/chunks/{code-snippet.CnThWqVb.js → code-snippet.Bkd8R0vf.js} +6 -6
- package/dist/chunks/{code-snippet.CnThWqVb.js.map → code-snippet.Bkd8R0vf.js.map} +1 -1
- package/dist/chunks/{controls-group.fdGc6epa.js → controls-group.Bku83Fm_.js} +3 -3
- package/dist/chunks/{controls-group.fdGc6epa.js.map → controls-group.Bku83Fm_.js.map} +1 -1
- package/dist/chunks/{copy.CSk1rCRo.js → copy.B12-P_8A.js} +3 -3
- package/dist/chunks/{copy.CSk1rCRo.js.map → copy.B12-P_8A.js.map} +1 -1
- package/dist/chunks/{country.UZbwr635.js → country._NpkT-91.js} +2 -2
- package/dist/chunks/{country.UZbwr635.js.map → country._NpkT-91.js.map} +1 -1
- package/dist/chunks/country.types.BCOrkmVK.js.map +1 -1
- package/dist/chunks/{currency.POwX-Trj.js → currency.BXsSGoWa.js} +4 -4
- package/dist/chunks/{currency.POwX-Trj.js.map → currency.BXsSGoWa.js.map} +1 -1
- package/dist/chunks/{dashboard-section.CYEoNH9Q.js → dashboard-section.yS2FNoIV.js} +3 -3
- package/dist/chunks/{dashboard-section.CYEoNH9Q.js.map → dashboard-section.yS2FNoIV.js.map} +1 -1
- package/dist/chunks/{dashed-underline.CzKc-fJW.js → dashed-underline.RcRbre03.js} +4 -4
- package/dist/chunks/{dashed-underline.CzKc-fJW.js.map → dashed-underline.RcRbre03.js.map} +1 -1
- package/dist/chunks/{data-grid-template.DCwzh2G7.js → data-grid-template.B5A9whlD.js} +4 -4
- package/dist/chunks/{data-grid-template.DCwzh2G7.js.map → data-grid-template.B5A9whlD.js.map} +1 -1
- package/dist/chunks/{data-grid.CMxQpfrY.js → data-grid.Pg5iM8CJ.js} +25 -25
- package/dist/chunks/{data-grid.CMxQpfrY.js.map → data-grid.Pg5iM8CJ.js.map} +1 -1
- package/dist/chunks/{date-picker.gDsw8bn1.js → date-picker.RFus1MVJ.js} +9 -9
- package/dist/chunks/{date-picker.gDsw8bn1.js.map → date-picker.RFus1MVJ.js.map} +1 -1
- package/dist/chunks/date-picker.types.Ckt7zxGy.js.map +1 -1
- package/dist/chunks/{date-range-picker.CqixIJxG.js → date-range-picker.B2B4hO6R.js} +411 -370
- package/dist/chunks/date-range-picker.B2B4hO6R.js.map +1 -0
- package/dist/chunks/date-range-picker.types.Ckt7zxGy.js.map +1 -1
- package/dist/chunks/{date-time-picker.Bktntun4.js → date-time-picker.DJxDa81N.js} +6 -6
- package/dist/chunks/{date-time-picker.Bktntun4.js.map → date-time-picker.DJxDa81N.js.map} +1 -1
- package/dist/chunks/{date.CPo8t1n9.js → date.P3Xx7JdV.js} +2 -2
- package/dist/chunks/{date.CPo8t1n9.js.map → date.P3Xx7JdV.js.map} +1 -1
- package/dist/chunks/{dialog-page.Bct3zOQO.js → dialog-page.DORdXmEm.js} +3 -3
- package/dist/chunks/{dialog-page.Bct3zOQO.js.map → dialog-page.DORdXmEm.js.map} +1 -1
- package/dist/chunks/{draggable-handle.DgVdGC1V.js → draggable-handle.BM07OVdH.js} +2 -2
- package/dist/chunks/{draggable-handle.DgVdGC1V.js.map → draggable-handle.BM07OVdH.js.map} +1 -1
- package/dist/chunks/{draggable.DYKdXdbj.js → draggable.BczXedk7.js} +59 -56
- package/dist/chunks/draggable.BczXedk7.js.map +1 -0
- package/dist/chunks/{dropdown-tag.Dk7SooVv.js → dropdown-tag.BmUNKoNw.js} +7 -7
- package/dist/chunks/{dropdown-tag.Dk7SooVv.js.map → dropdown-tag.BmUNKoNw.js.map} +1 -1
- package/dist/chunks/{dropdown.Bnq4kP7k.js → dropdown.CpZQYisR.js} +9 -9
- package/dist/chunks/{dropdown.Bnq4kP7k.js.map → dropdown.CpZQYisR.js.map} +1 -1
- package/dist/chunks/{empty-state.C2wjdE3y.js → empty-state.L3DTfiY7.js} +4 -4
- package/dist/chunks/{empty-state.C2wjdE3y.js.map → empty-state.L3DTfiY7.js.map} +1 -1
- package/dist/chunks/{error-message.DKnoUezI.js → error-message.B-n8wzFo.js} +2 -2
- package/dist/chunks/{error-message.DKnoUezI.js.map → error-message.B-n8wzFo.js.map} +1 -1
- package/dist/chunks/es6.yPcTMnSH.js.map +1 -1
- package/dist/chunks/{field-label.C7BCsofY.js → field-label.BQaDr37D.js} +3 -3
- package/dist/chunks/{field-label.C7BCsofY.js.map → field-label.BQaDr37D.js.map} +1 -1
- package/dist/chunks/{file-uploader.DllKBmP8.js → file-uploader.Bo17jWtf.js} +11 -11
- package/dist/chunks/{file-uploader.DllKBmP8.js.map → file-uploader.Bo17jWtf.js.map} +1 -1
- package/dist/chunks/{filter-bar.D7Lk7wlq.js → filter-bar.Bio9nf9V.js} +28 -27
- package/dist/chunks/filter-bar.Bio9nf9V.js.map +1 -0
- package/dist/chunks/{fixed-scroller.YC4bZifw.js → fixed-scroller.CHmrgoTQ.js} +2 -2
- package/dist/chunks/{fixed-scroller.YC4bZifw.js.map → fixed-scroller.CHmrgoTQ.js.map} +1 -1
- package/dist/chunks/{footer-actions.C9STwwcv.js → footer-actions.B8f-gEQV.js} +4 -4
- package/dist/chunks/{footer-actions.C9STwwcv.js.map → footer-actions.B8f-gEQV.js.map} +1 -1
- package/dist/chunks/{form-layout-group.D4T0Z5xk.js → form-layout-group.BSC2esG8.js} +2 -2
- package/dist/chunks/{form-layout-group.D4T0Z5xk.js.map → form-layout-group.BSC2esG8.js.map} +1 -1
- package/dist/chunks/{form-layout-title.C0lwzPZz.js → form-layout-title.b2BMYjnl.js} +3 -3
- package/dist/chunks/{form-layout-title.C0lwzPZz.js.map → form-layout-title.b2BMYjnl.js.map} +1 -1
- package/dist/chunks/{header-with-views.BqobE7IF.js → header-with-views.BJCjvhem.js} +16 -16
- package/dist/chunks/{header-with-views.BqobE7IF.js.map → header-with-views.BJCjvhem.js.map} +1 -1
- package/dist/chunks/{header.CmyqVXuG.js → header.CDiold9n.js} +5 -5
- package/dist/chunks/{header.CmyqVXuG.js.map → header.CDiold9n.js.map} +1 -1
- package/dist/chunks/{info-icon-with-popover.BvYyGm4D.js → info-icon-with-popover.BzGVcMqy.js} +3 -3
- package/dist/chunks/{info-icon-with-popover.BvYyGm4D.js.map → info-icon-with-popover.BzGVcMqy.js.map} +1 -1
- package/dist/chunks/{info-icon.B-FAeceD.js → info-icon.D11usblr.js} +2 -2
- package/dist/chunks/{info-icon.B-FAeceD.js.map → info-icon.D11usblr.js.map} +1 -1
- package/dist/chunks/{input-field-password.9bWhLud0.js → input-field-password.D4Jn2yCi.js} +6 -6
- package/dist/chunks/{input-field-password.9bWhLud0.js.map → input-field-password.D4Jn2yCi.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.CCn1N9St.js → input-field-phone-number.lV7yePoJ.js} +3 -3
- package/dist/chunks/{input-field-phone-number.CCn1N9St.js.map → input-field-phone-number.lV7yePoJ.js.map} +1 -1
- package/dist/chunks/{input-field.D912rZS_.js → input-field.90DWNO1a.js} +7 -7
- package/dist/chunks/{input-field.D912rZS_.js.map → input-field.90DWNO1a.js.map} +1 -1
- package/dist/chunks/input-time.D7IsprlH.js +157 -0
- package/dist/chunks/input-time.D7IsprlH.js.map +1 -0
- package/dist/chunks/{inspector-page.BRC_7uro.js → inspector-page.IoC9naSV.js} +4 -4
- package/dist/chunks/{inspector-page.BRC_7uro.js.map → inspector-page.IoC9naSV.js.map} +1 -1
- package/dist/chunks/{inspector.IOtNex1r.js → inspector.BwtV4rE9.js} +5 -5
- package/dist/chunks/{inspector.IOtNex1r.js.map → inspector.BwtV4rE9.js.map} +1 -1
- package/dist/chunks/{layout-row.LBn6aJv4.js → layout-row.DYx7F4cb.js} +2 -2
- package/dist/chunks/{layout-row.LBn6aJv4.js.map → layout-row.DYx7F4cb.js.map} +1 -1
- package/dist/chunks/{link.Cls8XShm.js → link.iNnolG9W.js} +2 -2
- package/dist/chunks/{link.Cls8XShm.js.map → link.iNnolG9W.js.map} +1 -1
- package/dist/chunks/{list-item.HjabBEb8.js → list-item.ByyA5h1d.js} +5 -5
- package/dist/chunks/{list-item.HjabBEb8.js.map → list-item.ByyA5h1d.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.DhNxvqRO.js → listbox-option-tag.Cp_W_p4z.js} +3 -3
- package/dist/chunks/{listbox-option-tag.DhNxvqRO.js.map → listbox-option-tag.Cp_W_p4z.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.Bi1bQs4Z.js → modal-fullscreen.DG8Q-jHL.js} +9 -9
- package/dist/chunks/modal-fullscreen.DG8Q-jHL.js.map +1 -0
- package/dist/chunks/{modal.B3-pmL5s.js → modal.UkzON4bz.js} +7 -7
- package/dist/chunks/{modal.B3-pmL5s.js.map → modal.UkzON4bz.js.map} +1 -1
- package/dist/chunks/{navigation-menu-group.BnHdXODQ.js → navigation-menu-group.BzKRuhrd.js} +8 -8
- package/dist/chunks/navigation-menu-group.BzKRuhrd.js.map +1 -0
- package/dist/chunks/{pagination.cI_pc6oE.js → pagination.DZEVT-CA.js} +8 -7
- package/dist/chunks/{pagination.cI_pc6oE.js.map → pagination.DZEVT-CA.js.map} +1 -1
- package/dist/chunks/{payment-method.DcAITDcK.js → payment-method.meF6XN_X.js} +2 -2
- package/dist/chunks/{payment-method.DcAITDcK.js.map → payment-method.meF6XN_X.js.map} +1 -1
- package/dist/chunks/payment-method.types.BqtH7RM2.js.map +1 -1
- package/dist/chunks/popover.types.DvIwSAAp.js.map +1 -1
- package/dist/chunks/popper-container.Cj3AWXSd.js.map +1 -1
- package/dist/chunks/{progress-bar.RlF3a0Gb.js → progress-bar.CaurNYsc.js} +4 -4
- package/dist/chunks/{progress-bar.RlF3a0Gb.js.map → progress-bar.CaurNYsc.js.map} +1 -1
- package/dist/chunks/{promo-banner.B5szTysj.js → promo-banner.CcYpFY9b.js} +3 -3
- package/dist/chunks/{promo-banner.B5szTysj.js.map → promo-banner.CcYpFY9b.js.map} +1 -1
- package/dist/chunks/{radio-group.CvsQDlHi.js → radio-group.CLbYlzD7.js} +5 -5
- package/dist/chunks/{radio-group.CvsQDlHi.js.map → radio-group.CLbYlzD7.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.rXoS7KGY.js → rich-text-editor.5SMm2BbC.js} +11 -11
- package/dist/chunks/{rich-text-editor.rXoS7KGY.js.map → rich-text-editor.5SMm2BbC.js.map} +1 -1
- package/dist/chunks/{scroll-to-section.DhW8SFy0.js → scroll-to-section.CzeBpNj4.js} +2 -2
- package/dist/chunks/{scroll-to-section.DhW8SFy0.js.map → scroll-to-section.CzeBpNj4.js.map} +1 -1
- package/dist/chunks/{search-bar.--4KVNkf.js → search-bar.DrIwlAQj.js} +8 -8
- package/dist/chunks/{search-bar.--4KVNkf.js.map → search-bar.DrIwlAQj.js.map} +1 -1
- package/dist/chunks/{secondary-nav.CgdV0QwZ.js → secondary-nav.DRs5yAve.js} +16 -16
- package/dist/chunks/{secondary-nav.CgdV0QwZ.js.map → secondary-nav.DRs5yAve.js.map} +1 -1
- package/dist/chunks/{segmented-control.nYpRQTGc.js → segmented-control.CcQoBTfT.js} +3 -3
- package/dist/chunks/{segmented-control.nYpRQTGc.js.map → segmented-control.CcQoBTfT.js.map} +1 -1
- package/dist/chunks/segmented-control.types.BHRLV8KU.js.map +1 -1
- package/dist/chunks/{selection-card-group.CmDuj1c7.js → selection-card-group.BYBAG8ig.js} +49 -48
- package/dist/chunks/{selection-card-group.CmDuj1c7.js.map → selection-card-group.BYBAG8ig.js.map} +1 -1
- package/dist/chunks/{sidepanel.CntIcmx-.js → sidepanel.CLbVkH7v.js} +14 -14
- package/dist/chunks/{sidepanel.CntIcmx-.js.map → sidepanel.CLbVkH7v.js.map} +1 -1
- package/dist/chunks/{status.DJ1Dfh5s.js → status.BdWYs5MK.js} +2 -2
- package/dist/chunks/{status.DJ1Dfh5s.js.map → status.BdWYs5MK.js.map} +1 -1
- package/dist/chunks/status.types.Dx8MDhEH.js.map +1 -1
- package/dist/chunks/{step.BCa9IOWB.js → step.SkRHgSxN.js} +5 -5
- package/dist/chunks/step.SkRHgSxN.js.map +1 -0
- package/dist/chunks/{structured-list-item.Bhe0CH1M.js → structured-list-item.BgcR0XlO.js} +10 -9
- package/dist/chunks/structured-list-item.BgcR0XlO.js.map +1 -0
- package/dist/chunks/{summary-grid.types.C70ED6WD.js → summary-grid.types.Do2PZQGm.js} +6 -6
- package/dist/chunks/{summary-grid.types.C70ED6WD.js.map → summary-grid.types.Do2PZQGm.js.map} +1 -1
- package/dist/chunks/{tab.BK1sIJAJ.js → tab.zeRxc-3T.js} +49 -48
- package/dist/chunks/tab.zeRxc-3T.js.map +1 -0
- package/dist/chunks/{table-of-contents.BTy95Rrs.js → table-of-contents.D4sF13f8.js} +3 -3
- package/dist/chunks/{table-of-contents.BTy95Rrs.js.map → table-of-contents.D4sF13f8.js.map} +1 -1
- package/dist/chunks/{tag.Dz1FQSZb.js → tag.CgsX8v2m.js} +3 -3
- package/dist/chunks/{tag.Dz1FQSZb.js.map → tag.CgsX8v2m.js.map} +1 -1
- package/dist/chunks/{textarea.CcV9U3I7.js → textarea.DMBnJaB1.js} +7 -7
- package/dist/chunks/textarea.DMBnJaB1.js.map +1 -0
- package/dist/chunks/{timeline-item.BG2by0xf.js → timeline-item.CS7TCdoU.js} +10 -10
- package/dist/chunks/{timeline-item.BG2by0xf.js.map → timeline-item.CS7TCdoU.js.map} +1 -1
- package/dist/chunks/{title-details.ChwPP7C5.js → title-details.BhR2nis-.js} +4 -4
- package/dist/chunks/{title-details.ChwPP7C5.js.map → title-details.BhR2nis-.js.map} +1 -1
- package/dist/chunks/{toast.CO6ByH3n.js → toast.CjDkuh2x.js} +4 -4
- package/dist/chunks/{toast.CO6ByH3n.js.map → toast.CjDkuh2x.js.map} +1 -1
- package/dist/chunks/{toggle.Dgh7aw1D.js → toggle.BL_w2xUm.js} +4 -4
- package/dist/chunks/{toggle.Dgh7aw1D.js.map → toggle.BL_w2xUm.js.map} +1 -1
- package/dist/chunks/{tooltip.DFYc5NKM.js → tooltip.BOe7LOfD.js} +2 -2
- package/dist/chunks/{tooltip.DFYc5NKM.js.map → tooltip.BOe7LOfD.js.map} +1 -1
- package/dist/chunks/{tutorial.K0aOQWIg.js → tutorial.DSbBx_2h.js} +3 -3
- package/dist/chunks/{tutorial.K0aOQWIg.js.map → tutorial.DSbBx_2h.js.map} +1 -1
- package/dist/chunks/{typography.D1OZJbEa.js → typography.Cd386LC_.js} +5 -5
- package/dist/chunks/{typography.D1OZJbEa.js.map → typography.Cd386LC_.js.map} +1 -1
- package/dist/chunks/{use-bento-toast-controller.A5xraVqa.js → use-bento-toast-controller.DMA9d_oD.js} +2 -2
- package/dist/chunks/{use-bento-toast-controller.A5xraVqa.js.map → use-bento-toast-controller.DMA9d_oD.js.map} +1 -1
- package/dist/chunks/{use-date-input-formatter.MgbFwUqJ.js → use-date-input-formatter.CouOE5tF.js} +2 -2
- package/dist/chunks/{use-date-input-formatter.MgbFwUqJ.js.map → use-date-input-formatter.CouOE5tF.js.map} +1 -1
- package/dist/chunks/{use-dynamic-date-fns-locale.Bpb2DeYR.js → use-dynamic-date-fns-locale.DGqfz_nF.js} +2 -2
- package/dist/chunks/{use-dynamic-date-fns-locale.Bpb2DeYR.js.map → use-dynamic-date-fns-locale.DGqfz_nF.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/country.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 +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/date-range-picker.js +2 -2
- package/dist/date-time-picker.js +1 -1
- package/dist/date.js +1 -1
- package/dist/draggable.js +2 -2
- package/dist/dropdown.js +2 -2
- 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 +2 -2
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +177 -152
- package/dist/index.js.map +1 -1
- 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/input-time.js +1 -1
- package/dist/inspector.js +2 -2
- package/dist/internal.js +14 -14
- package/dist/layout.js +1 -1
- package/dist/link.js +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/navigation-menu.js +1 -1
- package/dist/pagination.js +1 -1
- package/dist/payment-method.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/progress-bar.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/segmented-control.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/status.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/styles/utility.css +9 -0
- package/dist/summary-grid.js +1 -1
- package/dist/table-of-contents.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/typography.js +1 -1
- package/dist/web-types.json +1278 -46
- package/package.json +9 -9
- package/dist/chunks/button-actions.bkcLUE1G.js.map +0 -1
- package/dist/chunks/calendar.CXdLEeN4.js.map +0 -1
- package/dist/chunks/date-range-picker.CqixIJxG.js.map +0 -1
- package/dist/chunks/draggable.DYKdXdbj.js.map +0 -1
- package/dist/chunks/filter-bar.D7Lk7wlq.js.map +0 -1
- package/dist/chunks/input-time.CXMuvF9N.js +0 -105
- package/dist/chunks/input-time.CXMuvF9N.js.map +0 -1
- package/dist/chunks/modal-fullscreen.Bi1bQs4Z.js.map +0 -1
- package/dist/chunks/navigation-menu-group.BnHdXODQ.js.map +0 -1
- package/dist/chunks/step.BCa9IOWB.js.map +0 -1
- package/dist/chunks/structured-list-item.Bhe0CH1M.js.map +0 -1
- package/dist/chunks/tab.BK1sIJAJ.js.map +0 -1
- package/dist/chunks/textarea.CcV9U3I7.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as $, useSlots as L, computed as l, inject as G, ref as v, watch as A, provide as
|
|
2
|
-
import { h as
|
|
1
|
+
import { defineComponent as $, useSlots as L, computed as l, inject as G, ref as v, watch as A, provide as N, onMounted as O } from "vue";
|
|
2
|
+
import { h as D } from "./index.CL3TXc0a.js";
|
|
3
3
|
import { a as q, B as z } from "./es6.yPcTMnSH.js";
|
|
4
|
-
import { B as F } from "./typography.
|
|
4
|
+
import { B as F } from "./typography.Cd386LC_.js";
|
|
5
5
|
import { C as j } from "./checkbox-input.CIoy_QxO.js";
|
|
6
6
|
import { u as W } from "./aria-label.CaUURpnB.js";
|
|
7
7
|
import { g as M } from "./generate-uid.DBWe4g6T.js";
|
|
@@ -10,8 +10,8 @@ import { a as Q } from "./radio-input.CLlYadKI.js";
|
|
|
10
10
|
import { n as T } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
11
11
|
import { u as U } from "./form-field.B60VsF8d.js";
|
|
12
12
|
import { G as H } from "./grid-layout.BeCrjPgT.js";
|
|
13
|
-
import { E as J } from "./error-message.
|
|
14
|
-
import { C as K } from "./controls-group.
|
|
13
|
+
import { E as J } from "./error-message.B-n8wzFo.js";
|
|
14
|
+
import { C as K } from "./controls-group.Bku83Fm_.js";
|
|
15
15
|
import "../assets/selection-card-group.css";
|
|
16
16
|
var S = /* @__PURE__ */ ((i) => (i.DISABLED = "disabled", i.READONLY = "readonly", i.ERROR = "error", i))(S || {});
|
|
17
17
|
const P = /* @__PURE__ */ Symbol("selection card radio input injection key"), X = {
|
|
@@ -79,7 +79,7 @@ const P = /* @__PURE__ */ Symbol("selection card radio input injection key"), X
|
|
|
79
79
|
},
|
|
80
80
|
emits: ["input", "update:model-value"],
|
|
81
81
|
setup(i, { emit: e }) {
|
|
82
|
-
const t = i, o = L(), a = Y(o), h = M("selection-card-input-id"),
|
|
82
|
+
const t = i, o = L(), a = Y(o), h = M("selection-card-input-id"), n = M("selection-card-description"), p = l(
|
|
83
83
|
() => t.modelValue
|
|
84
84
|
), w = l(
|
|
85
85
|
() => t.modelValue
|
|
@@ -90,37 +90,37 @@ const P = /* @__PURE__ */ Symbol("selection card radio input injection key"), X
|
|
|
90
90
|
[`b-selection-card--${S.DISABLED}`]: t.disabled,
|
|
91
91
|
[`b-selection-card--${S.ERROR}`]: t.hasError,
|
|
92
92
|
[`b-selection-card--${S.READONLY}`]: t.readonly,
|
|
93
|
-
"b-selection-card--center-aligned":
|
|
94
|
-
})),
|
|
95
|
-
"b-selection-card__checkbox-container--center-aligned":
|
|
93
|
+
"b-selection-card--center-aligned": _.value
|
|
94
|
+
})), m = l(() => ({
|
|
95
|
+
"b-selection-card__checkbox-container--center-aligned": _.value
|
|
96
96
|
})), C = l(() => ({
|
|
97
|
-
"b-selection-card__checkbox-container-text--center-aligned":
|
|
97
|
+
"b-selection-card__checkbox-container-text--center-aligned": _.value
|
|
98
98
|
})), k = l(() => ({
|
|
99
99
|
"b-selection-card__slot--with-icon": a("icon")
|
|
100
100
|
})), R = W({
|
|
101
101
|
ariaLabel: t.title,
|
|
102
102
|
label: t.value
|
|
103
|
-
}),
|
|
104
|
-
if (
|
|
103
|
+
}), u = l(() => Array.isArray(t.modelValue)), x = l(() => d.value ? t.value === t.modelValue : u.value ? t.modelValue.some((s) => s === t.value) : t.modelValue), d = G(P, v(!1)), _ = l(() => !t.subtitle && !t.description), f = v(null), y = v(null), r = v(null), c = (s) => {
|
|
104
|
+
if (f.value.$refs.inputRef === s.target) {
|
|
105
105
|
const I = E();
|
|
106
106
|
V(I);
|
|
107
107
|
return;
|
|
108
108
|
}
|
|
109
|
-
if (t.disabled && t.readonly || !t.fullyClickable && (
|
|
109
|
+
if (t.disabled && t.readonly || !t.fullyClickable && (y.value && y.value?.$el?.contains(s.target) || r.value && r.value?.$el?.contains(s.target) || f.value && f.value?.$el?.contains(s.target)))
|
|
110
110
|
return;
|
|
111
111
|
const b = E();
|
|
112
112
|
V(b);
|
|
113
113
|
}, E = () => {
|
|
114
|
-
const s = (
|
|
115
|
-
if (
|
|
114
|
+
const s = (f.value?.$refs.inputRef).checked;
|
|
115
|
+
if (u.value) {
|
|
116
116
|
const b = [...t.modelValue], I = b.indexOf(t.value);
|
|
117
117
|
return I === -1 ? b.push(t.value) : b.splice(I, 1), b;
|
|
118
118
|
}
|
|
119
|
-
return
|
|
119
|
+
return d.value ? t.value : s;
|
|
120
120
|
}, V = (s) => {
|
|
121
121
|
!t.disabled && !t.readonly && (e("update:model-value", s), e("input", s));
|
|
122
122
|
};
|
|
123
|
-
return { __sfc: !0, props: t, emit: e, slots: o, hasSlot: a, inputId: h, descriptionId:
|
|
123
|
+
return { __sfc: !0, props: t, emit: e, slots: o, hasSlot: a, inputId: h, descriptionId: n, computedRadioInputModelValue: p, computedCheckboxInputModelValue: w, conditionalClasses: B, containerConditionalClasses: g, checkboxContainerConditionalClasses: m, checkboxContainerTextConditionalClasses: C, slotConditionalClasses: k, ariaLabel: R, isCheckboxGroup: u, isChecked: x, isRadioInput: d, isTitleOnly: _, inputRef: f, slotRef: y, dynamicSlotRef: r, handleCardClick: c, toggleInput: E, onChange: V, BentoTypography: F, CheckboxInput: j, RadioInput: Q };
|
|
124
124
|
}
|
|
125
125
|
});
|
|
126
126
|
var ee = function() {
|
|
@@ -161,38 +161,39 @@ const ae = oe.exports, le = {
|
|
|
161
161
|
},
|
|
162
162
|
emits: ["update:model-value"],
|
|
163
163
|
setup(i, { emit: e }) {
|
|
164
|
-
const t = i, { emitValue: o } = U(e), a = L(), h = (
|
|
164
|
+
const t = i, { emitValue: o } = U(e), a = L(), h = (r) => !!a[r], n = l(() => ({
|
|
165
165
|
"b-selection-card-group__items--horizontal": t.layout === "horizontal"
|
|
166
|
-
})),
|
|
166
|
+
})), p = v(t.modelValue);
|
|
167
167
|
A(
|
|
168
168
|
() => t.modelValue,
|
|
169
169
|
() => {
|
|
170
|
-
|
|
170
|
+
p.value = t.modelValue;
|
|
171
171
|
}
|
|
172
172
|
);
|
|
173
|
-
const w = M("error"), B = l(() => !t.disabled && !t.readonly && !!t.errorMessage), g = v(null), { width:
|
|
173
|
+
const w = M("error"), B = l(() => !t.disabled && !t.readonly && !!t.errorMessage), g = v(null), { width: m } = D(g), C = l(() => q.split("px")[0]), k = l(() => z.split("px")[0]), R = l(() => m.value < C.value ? "small" : m.value >= C.value && m.value < k.value ? "medium" : "large"), u = l(() => t.itemsPerRow?.[R?.value] || t.items.length), x = l(() => {
|
|
174
174
|
if (!t.itemsPerRow)
|
|
175
175
|
return [];
|
|
176
|
-
const
|
|
177
|
-
for (let
|
|
178
|
-
|
|
179
|
-
return
|
|
180
|
-
}),
|
|
176
|
+
const r = [];
|
|
177
|
+
for (let c = 0; c < t.items.length; c += u?.value)
|
|
178
|
+
r.push(t.items.slice(c, c + u?.value));
|
|
179
|
+
return r;
|
|
180
|
+
}), d = l(() => 12 / u?.value), _ = l(() => u?.value ? new Array(u?.value).fill({
|
|
181
181
|
// Instead of passing the actual screen sizes values, passing the same values per each screen size and recomputing it makes sure visually the change is smoother and not laggy
|
|
182
|
-
small:
|
|
183
|
-
medium:
|
|
184
|
-
large:
|
|
185
|
-
}) : []),
|
|
186
|
-
|
|
187
|
-
},
|
|
188
|
-
return
|
|
189
|
-
t.itemsPerRow && Object.values(t.itemsPerRow).forEach((
|
|
190
|
-
|
|
182
|
+
small: d.value,
|
|
183
|
+
medium: d.value,
|
|
184
|
+
large: d.value
|
|
185
|
+
}) : []), f = (r) => {
|
|
186
|
+
p.value = r, o(r);
|
|
187
|
+
}, y = l(() => t.variant === "radio");
|
|
188
|
+
return N(P, y), O(() => {
|
|
189
|
+
t.itemsPerRow && Object.values(t.itemsPerRow).forEach((r) => {
|
|
190
|
+
const c = Number(r);
|
|
191
|
+
if (!Number.isInteger(c) || c < 1 || c > 6)
|
|
191
192
|
throw new Error(
|
|
192
|
-
"itemsPerRow values must have a value between
|
|
193
|
+
"itemsPerRow values must have a value between 1 and 6 items per row. Read the documentation for more information."
|
|
193
194
|
);
|
|
194
195
|
});
|
|
195
|
-
}), { __sfc: !0, props: t, emit: e, emitValue: o, slots: a, hasSlot: h, conditionalItemsClasses:
|
|
196
|
+
}), { __sfc: !0, props: t, emit: e, emitValue: o, slots: a, hasSlot: h, conditionalItemsClasses: n, inputValue: p, errorMessageId: w, shouldShowGroupError: B, containerRef: g, width: m, smallBreakpoint: C, mediumBreakpoint: k, currentBreakpoint: R, computedItemsPerRow: u, computedRows: x, itemColumnWidth: d, computedColumnWidth: _, onInput: f, isRadioVariant: y, BentoSelectionCard: ae, ControlsGroup: K, ErrorMessage: J, GridLayout: H };
|
|
196
197
|
}
|
|
197
198
|
});
|
|
198
199
|
var re = function() {
|
|
@@ -206,15 +207,15 @@ var re = function() {
|
|
|
206
207
|
return [e._t("dynamicContent", null, null, a)];
|
|
207
208
|
}, proxy: !0 } : null], null, !0) }, "bento-selection-card", a, !1));
|
|
208
209
|
}), 1) : [t("div", { key: `selection-card-group-layout-breakpoint-${o.currentBreakpoint}` }, e._l(o.computedRows, function(a, h) {
|
|
209
|
-
return t(o.GridLayout, { key: `selection-card-group-row-${h}-cols-${o.computedItemsPerRow}`, staticClass: "b-selection-card-group__items--wrap", attrs: { "column-width": o.computedColumnWidth }, scopedSlots: e._u([e._l(a, function(
|
|
210
|
-
return { key: `col-${Number(
|
|
211
|
-
return [t(o.BentoSelectionCard, e._b({ key: `selection-card-${
|
|
212
|
-
return [e._t("icon", null, null,
|
|
213
|
-
}, proxy: !0 } : null, o.hasSlot("content") &&
|
|
214
|
-
return [e._t("content", null, null,
|
|
215
|
-
}, proxy: !0 } : null, o.hasSlot("dynamicContent") &&
|
|
216
|
-
return [e._t("dynamicContent", null, null,
|
|
217
|
-
}, proxy: !0 } : null], null, !0) }, "bento-selection-card",
|
|
210
|
+
return t(o.GridLayout, { key: `selection-card-group-row-${h}-cols-${o.computedItemsPerRow}`, staticClass: "b-selection-card-group__items--wrap", attrs: { "column-width": o.computedColumnWidth }, scopedSlots: e._u([e._l(a, function(n, p) {
|
|
211
|
+
return { key: `col-${Number(p) + 1}`, fn: function() {
|
|
212
|
+
return [t(o.BentoSelectionCard, e._b({ key: `selection-card-${n.value}`, staticClass: "b-selection-card-group__item b-selection-card-group__item--full-height", attrs: { "model-value": o.inputValue, readonly: e.readonly || n.readonly, "has-error": o.shouldShowGroupError, disabled: e.disabled || n.disabled }, on: { "update:model-value": o.onInput }, scopedSlots: e._u([o.hasSlot("icon") && n.icon ? { key: "icon", fn: function() {
|
|
213
|
+
return [e._t("icon", null, null, n)];
|
|
214
|
+
}, proxy: !0 } : null, o.hasSlot("content") && n.content ? { key: "content", fn: function() {
|
|
215
|
+
return [e._t("content", null, null, n)];
|
|
216
|
+
}, proxy: !0 } : null, o.hasSlot("dynamicContent") && n.dynamicContent ? { key: "dynamicContent", fn: function() {
|
|
217
|
+
return [e._t("dynamicContent", null, null, n)];
|
|
218
|
+
}, proxy: !0 } : null], null, !0) }, "bento-selection-card", n, !1))];
|
|
218
219
|
}, proxy: !0 };
|
|
219
220
|
})], null, !0) });
|
|
220
221
|
}), 1)], o.shouldShowGroupError ? t(o.ErrorMessage, { staticClass: "b-selection-card-group__error-message", attrs: { id: o.errorMessageId, "error-message": e.errorMessage } }) : e._e()], 2);
|
|
@@ -224,7 +225,7 @@ var re = function() {
|
|
|
224
225
|
se,
|
|
225
226
|
!1,
|
|
226
227
|
null,
|
|
227
|
-
"
|
|
228
|
+
"99ae2b9d"
|
|
228
229
|
);
|
|
229
230
|
const Re = ie.exports;
|
|
230
231
|
export {
|
|
@@ -232,4 +233,4 @@ export {
|
|
|
232
233
|
S as a,
|
|
233
234
|
Re as s
|
|
234
235
|
};
|
|
235
|
-
//# sourceMappingURL=selection-card-group.
|
|
236
|
+
//# sourceMappingURL=selection-card-group.BYBAG8ig.js.map
|
package/dist/chunks/{selection-card-group.CmDuj1c7.js.map → selection-card-group.BYBAG8ig.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selection-card-group.CmDuj1c7.js","sources":["../../src/components/selection-card/selection-card.types.ts","../../src/components/selection-card/selection-card.keys.ts","../../src/components/selection-card/selection-card.vue","../../src/components/selection-card/components/selection-card-group/selection-card-group.vue"],"sourcesContent":["import { type RadioInputValue } from '@/components/internal/radio-input';\nimport { type BentoCheckboxType } from '@/types/checkbox';\nimport { type VueNodeElement } from '@/types/elements';\n\nexport enum BentoSelectionCardState {\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n\nexport type BentoSelectionCardValue = string | number;\n\nexport type BentoSelectionCardModelValue = BentoCheckboxType | RadioInputValue;\n\nexport interface BentoSelectionCardItem {\n content?: string | object;\n description?: string;\n disabled?: boolean;\n dynamicContent?: string | object;\n fullyClickable?: boolean;\n hasError?: boolean;\n icon?: VueNodeElement;\n readonly?: boolean;\n subtitle?: string;\n title: string;\n value: BentoSelectionCardValue;\n}\n","export const SELECTION_CARD_RADIO_INPUT_INJECTION_KEY = Symbol('selection card radio input injection key');\n","<template>\n <div class=\"b-selection-card\" :class=\"conditionalClasses\" @click=\"handleCardClick\">\n <div class=\"b-selection-card__container\" :class=\"containerConditionalClasses\">\n <div class=\"b-selection-card__checkbox-container\" :class=\"checkboxContainerConditionalClasses\">\n <div class=\"b-selection-card__checkbox-container-text\" :class=\"checkboxContainerTextConditionalClasses\">\n <div v-if=\"hasSlot('icon')\" class=\"b-selection-card__icon\" role=\"presentation\" aria-hidden=\"true\">\n <slot name=\"icon\" />\n </div>\n <label :for=\"inputId\" class=\"b-selection-card__text\" @click.stop.prevent=\"handleCardClick\">\n <bento-typography\n v-if=\"subtitle\"\n class=\"b-selection-card__description\"\n el=\"span\"\n variant=\"caption\"\n >\n {{ subtitle }}\n </bento-typography>\n <bento-typography el=\"span\" variant=\"title\">{{ title }}</bento-typography>\n <bento-typography\n v-if=\"description\"\n id=\"descriptionId\"\n class=\"b-selection-card__description\"\n el=\"span\"\n variant=\"body\"\n >\n {{ description }}\n </bento-typography>\n </label>\n </div>\n <radio-input\n v-if=\"isRadioInput\"\n :id=\"inputId\"\n ref=\"inputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"description ? descriptionId : undefined\"\n :disabled=\"disabled\"\n :has-error=\"hasError\"\n :aria-readonly=\"readonly ?? undefined\"\n :value=\"value\"\n :readonly=\"readonly\"\n :model-value=\"computedRadioInputModelValue\"\n />\n <checkbox-input\n v-else\n :id=\"inputId\"\n ref=\"inputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"description ? descriptionId : undefined\"\n :disabled=\"disabled\"\n :has-error=\"hasError\"\n :aria-readonly=\"readonly ?? undefined\"\n :value=\"value\"\n :readonly=\"readonly\"\n :model-value=\"computedCheckboxInputModelValue\"\n />\n </div>\n <bento-typography\n v-if=\"hasSlot('content')\"\n ref=\"slotRef\"\n el=\"div\"\n class=\"b-selection-card__slot\"\n :class=\"slotConditionalClasses\"\n >\n <slot name=\"content\" />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('dynamicContent') && isChecked\"\n ref=\"dynamicSlotRef\"\n el=\"div\"\n class=\"b-selection-card__slot\"\n :class=\"slotConditionalClasses\"\n >\n <slot name=\"dynamicContent\" />\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTypography } from '@/components/typography';\n import { CheckboxInput } from '../internal/checkbox-input';\n import { RadioInput, type RadioInputValue } from '../internal/radio-input';\n import { type BentoCheckboxType, type BentoMultiCheckboxType } from '@/types/checkbox';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { computed, type ComputedRef, inject, type PropType, type Ref, ref, useSlots } from 'vue';\n import { useHasSlot } from '@/composables';\n import type { BentoSelectionCardModelValue, BentoSelectionCardValue } from './selection-card.types';\n import { BentoSelectionCardState } from './selection-card.types';\n import { SELECTION_CARD_RADIO_INPUT_INJECTION_KEY } from './selection-card.keys';\n\n const props = defineProps({\n /**\n * The description of the selection card\n */\n description: {\n type: String,\n default: undefined,\n },\n\n /**\n * Disables the selection card\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Makes the entire selection card clickable. Clicking over interactive elements inside the card with this prop enabled will not be possible.\n */\n fullyClickable: { type: Boolean, default: false },\n\n /**\n * Shows the selection card in error state\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * This property should not be used directly.\n * It will be used by v-model directive on selection card component.\n *\n * When handling a single input, use a string or a number.\n *\n * When handling multiple inputs, use an array of keys.\n * These keys exist as a set \"value\" prop for each input.\n */\n modelValue: {\n type: [Boolean, String, Array] as PropType<BentoSelectionCardModelValue>,\n default: null,\n },\n\n /**\n * Sets the selection card to readonly\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * The subtitle of the selection card\n */\n subtitle: {\n type: String,\n default: undefined,\n },\n\n /**\n * The title of the selection card\n */\n title: {\n type: String,\n required: true,\n },\n\n /**\n * Indicates the value of the input that will be returned when it's checked.\n */\n value: {\n type: [String, Number] as PropType<BentoSelectionCardValue>,\n required: true,\n },\n });\n\n const emit = defineEmits([\"input\", \"update:model-value\"]);\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const inputId = generateUid('selection-card-input-id');\n const descriptionId = generateUid('selection-card-description');\n\n const computedRadioInputModelValue: ComputedRef<RadioInputValue> = computed(\n () => props.modelValue as RadioInputValue\n );\n const computedCheckboxInputModelValue: ComputedRef<BentoCheckboxType> = computed(\n () => props.modelValue as BentoCheckboxType\n );\n\n const conditionalClasses = computed(() => ({\n 'b-selection-card--checked': isChecked.value,\n 'b-selection-card--fully-clickable': props.fullyClickable,\n }));\n\n const containerConditionalClasses = computed(() => ({\n [`b-selection-card--${BentoSelectionCardState.DISABLED}`]: props.disabled,\n [`b-selection-card--${BentoSelectionCardState.ERROR}`]: props.hasError,\n [`b-selection-card--${BentoSelectionCardState.READONLY}`]: props.readonly,\n 'b-selection-card--center-aligned': isTitleOnly.value,\n }));\n\n const checkboxContainerConditionalClasses = computed(() => ({\n 'b-selection-card__checkbox-container--center-aligned': isTitleOnly.value,\n }));\n\n const checkboxContainerTextConditionalClasses = computed(() => ({\n 'b-selection-card__checkbox-container-text--center-aligned': isTitleOnly.value,\n }));\n\n const slotConditionalClasses = computed(() => ({\n 'b-selection-card__slot--with-icon': hasSlot('icon'),\n }));\n\n const ariaLabel = useAriaLabel({\n ariaLabel: props.title,\n label: props.value as string,\n });\n\n const isCheckboxGroup = computed(() => Array.isArray(props.modelValue));\n\n const isChecked: ComputedRef<boolean> = computed(() => {\n if (isRadioInput.value) {\n return props.value === props.modelValue;\n }\n if (!isCheckboxGroup.value) {\n return props.modelValue as boolean;\n }\n\n return (props.modelValue as BentoMultiCheckboxType).some(item => item === props.value);\n });\n\n const isRadioInput: Ref<boolean> = inject(SELECTION_CARD_RADIO_INPUT_INJECTION_KEY, ref(false));\n\n const isTitleOnly = computed(() => !props.subtitle && !props.description);\n\n const inputRef = ref<InstanceType<typeof RadioInput> | InstanceType<typeof CheckboxInput>>(null);\n const slotRef = ref(null);\n const dynamicSlotRef = ref(null);\n\n // Handle click on the whole card area\n const handleCardClick = (event: Event) => {\n if (inputRef.value.$refs.inputRef === event.target) {\n const newValue = toggleInput();\n onChange(newValue);\n return;\n }\n\n // Do nothing if disabled or readonly\n if (props.disabled && props.readonly) {\n return;\n }\n\n // If it's not fully clickable prevent selecting the card if the click\n // originated in a slot\n if (!props.fullyClickable) {\n // Check if the click originated from the slot - in that case, do nothng\n if (slotRef.value && slotRef.value?.$el?.contains(event.target)) {\n return;\n }\n // Check if the click originated from the dynamic slot - in that case, do nothng\n if (dynamicSlotRef.value && dynamicSlotRef.value?.$el?.contains(event.target)) {\n return;\n }\n // Check if the click originated from the input - in that case do nothing, as the input will emit the event already\n if (inputRef.value && inputRef.value?.$el?.contains(event.target as Node)) {\n return;\n }\n }\n\n // If the click originated outside of these two areas, emit the change event\n const newValue = toggleInput();\n\n onChange(newValue);\n };\n\n const toggleInput = (): BentoSelectionCardModelValue => {\n const currentValue: boolean = (inputRef.value?.$refs.inputRef as HTMLInputElement).checked;\n\n if (isCheckboxGroup.value) {\n const newCheckedList = [...(props.modelValue as BentoMultiCheckboxType)];\n const index = newCheckedList.indexOf(props.value);\n\n if (index === -1) {\n newCheckedList.push(props.value);\n } else {\n newCheckedList.splice(index, 1);\n }\n return newCheckedList;\n }\n\n if (isRadioInput.value) {\n return props.value;\n }\n return currentValue;\n };\n\n const onChange = newValue => {\n if (!props.disabled && !props.readonly) {\n emit('update:model-value', newValue);\n emit('input', newValue);\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Selection card component. If used standalone, only the checkbox variant can be used. If the checkbox variant is needed, please use the bento-selection-card-group component.\n *\n * @example\n * import { BentoSelectionCard } from '@adyen/bento-vue2';\n * import EmoticonHappyIcon from '@adyen/ui-assets-icons-16/vue/emoticon-happy';\n *\n * export default {\n * components: { BentoSelectionCard, EmoticonHappyIcon },\n * template: `\n * <bento-selection-card title=\"Card title\" :model-value.sync=\"yourModelValue\">\n * <template #icon>\n * <emoticon-happy-icon />\n * </template>\n * </bento-selection-card>\n * `\n * }\n */\n export default {\n name: 'bento-selection-card',\n };\n</script>\n<style lang=\"scss\" scoped src=\"./selection-card.scss\" />\n","<template>\n <controls-group\n ref=\"containerRef\"\n :aria-describedby=\"shouldShowGroupError ? errorMessageId : null\"\n :aria-required=\"required\"\n :label=\"label\"\n :hide-label=\"hideLabel\"\n :description=\"description\"\n :disabled=\"disabled\"\n :tooltip-text=\"tooltipText\"\n :readonly=\"readonly\"\n :required=\"required\"\n :optional=\"optional\"\n class=\"b-selection-card-group\"\n component-name=\"selection-card-group\"\n >\n <div\n v-if=\"!itemsPerRow || layout === 'vertical'\"\n class=\"b-selection-card-group__items\"\n :class=\"conditionalItemsClasses\"\n >\n <bento-selection-card\n v-for=\"item in items\"\n :key=\"`selection-card-${item.value}`\"\n class=\"b-selection-card-group__item\"\n v-bind=\"item\"\n :model-value=\"inputValue\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowGroupError\"\n :disabled=\"disabled || item.disabled\"\n @update:model-value=\"onInput\"\n >\n <template v-if=\"hasSlot('icon') && item.icon\" #icon>\n <slot name=\"icon\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('content') && item.content\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('dynamicContent') && item.dynamicContent\" #dynamicContent>\n <slot name=\"dynamicContent\" v-bind=\"item\"></slot>\n </template>\n </bento-selection-card>\n </div>\n <template v-else>\n <div :key=\"`selection-card-group-layout-breakpoint-${currentBreakpoint}`\">\n <grid-layout\n v-for=\"(row, rowIndex) in computedRows\"\n :key=\"`selection-card-group-row-${rowIndex}-cols-${computedItemsPerRow}`\"\n class=\"b-selection-card-group__items--wrap\"\n :column-width=\"computedColumnWidth\"\n >\n <template v-for=\"(item, columnIndex) in row\" #[`col-${Number(columnIndex)+1}`]>\n <bento-selection-card\n :key=\"`selection-card-${item.value}`\"\n class=\"b-selection-card-group__item b-selection-card-group__item--full-height\"\n v-bind=\"item\"\n :model-value=\"inputValue\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowGroupError\"\n :disabled=\"disabled || item.disabled\"\n @update:model-value=\"onInput\"\n >\n <template v-if=\"hasSlot('icon') && item.icon\" #icon>\n <slot name=\"icon\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('content') && item.content\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('dynamicContent') && item.dynamicContent\" #dynamicContent>\n <slot name=\"dynamicContent\" v-bind=\"item\"></slot>\n </template>\n </bento-selection-card>\n </template>\n </grid-layout>\n </div>\n </template>\n <error-message\n v-if=\"shouldShowGroupError\"\n :id=\"errorMessageId\"\n :error-message=\"errorMessage\"\n class=\"b-selection-card-group__error-message\"\n />\n </controls-group>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, provide, ref, useSlots, watch } from 'vue';\n import { useElementSize } from '@vueuse/core';\n import { BMediaQueryMMax, BMediaQuerySMax } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n import { type BentoSelectionCardGroupEmits, type BentoSelectionCardGroupProps } from './selection-card-group.types';\n import BentoSelectionCard from '../../selection-card.vue';\n import { ControlsGroup, ErrorMessage, GridLayout } from '../../../internal';\n import { SELECTION_CARD_RADIO_INPUT_INJECTION_KEY } from '../../selection-card.keys';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n\n const props = defineProps({\n description: { default: null },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: null },\n label: { default: null },\n optional: { type: Boolean, default: false },\n placeholder: null,\n readonly: { type: Boolean, default: false },\n required: { type: Boolean, default: false },\n tooltipText: { default: null },\n formId: { default: null },\n hideLabel: { type: Boolean, default: null },\n layout: { default: 'vertical' },\n items: null,\n itemsPerRow: { default: undefined },\n modelValue: { default: null },\n variant: { default: 'checkbox' }\n});\n\n const emit = defineEmits([\"update:model-value\"]);\n\n const { emitValue } = useFormFieldEmits(emit);\n\n const slots = useSlots();\n // Slots logic\n // Temporary, use-has-slots composable doesn't currently work for vue3 named scoped slots\n // We do the same in bento-checkbox-group\n const hasSlot = name => !!slots[name];\n\n const conditionalItemsClasses = computed(() => ({\n 'b-selection-card-group__items--horizontal': props.layout === 'horizontal',\n }));\n\n const inputValue = ref(props.modelValue);\n watch(\n () => props.modelValue,\n () => {\n inputValue.value = props.modelValue;\n }\n );\n\n // Error message logic\n const errorMessageId = generateUid('error');\n const shouldShowGroupError = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n // itemsPerRow logic\n const containerRef = ref<HTMLElement | null>(null);\n const { width } = useElementSize(containerRef);\n\n const smallBreakpoint = computed(() => BMediaQuerySMax.split('px')[0]);\n const mediumBreakpoint = computed(() => BMediaQueryMMax.split('px')[0]);\n\n const currentBreakpoint = computed(() => {\n if (width.value < smallBreakpoint.value) {\n return 'small';\n }\n if (width.value >= smallBreakpoint.value && width.value < mediumBreakpoint.value) {\n return 'medium';\n }\n return 'large';\n });\n\n const computedItemsPerRow = computed(() => {\n return (props.itemsPerRow?.[currentBreakpoint?.value] as number) || props.items.length;\n });\n\n const computedRows = computed(() => {\n if (!props.itemsPerRow) {\n return [];\n }\n const rows = [];\n for (let i = 0; i < props.items.length; i += computedItemsPerRow?.value) {\n rows.push(props.items.slice(i, i + computedItemsPerRow?.value));\n }\n return rows;\n });\n\n // We need to compute the column width on 12 because we're using a 12-column system for out grid-layout logic\n const itemColumnWidth = computed(() => 12 / computedItemsPerRow?.value);\n\n /**\n * Filling the columnWidth array with the same parameters per item to pass\n * to the `grid-layout` layout so the each card can have\n * the same width according to the screen size.\n */\n const computedColumnWidth = computed(() => {\n return computedItemsPerRow?.value\n ? new Array(computedItemsPerRow?.value).fill({\n // Instead of passing the actual screen sizes values, passing the same values per each screen size and recomputing it makes sure visually the change is smoother and not laggy\n small: itemColumnWidth.value,\n medium: itemColumnWidth.value,\n large: itemColumnWidth.value,\n })\n : [];\n });\n\n const onInput = value => {\n inputValue.value = value;\n emitValue(value);\n };\n\n const isRadioVariant = computed(() => props.variant === 'radio');\n\n provide(SELECTION_CARD_RADIO_INPUT_INJECTION_KEY, isRadioVariant);\n\n onMounted(() => {\n if (props.itemsPerRow) {\n Object.values(props.itemsPerRow).forEach(el => {\n if (el && (el < 2 || el > 6)) {\n throw new Error(\n 'itemsPerRow values must have a value between 2 and 6 items per row. Read the documentation for more information.'\n );\n }\n });\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Group of bento-selection-cards.\n *\n * @example\n * import { BentoSelectionCardGroup } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSelectionCardGroup },\n * template: `\n * <bento-selection-card-group\n * :items=\"[\n * {\n * title: 'Card 1',\n * value: 'card-1',\n * content: 'Slot content 1',\n * icon: RetailIcon,\n * },\n * {\n * title: 'Card 2',\n * value: 'card-2',\n * content: 'Slot content 2',\n * icon: LeafIcon,\n * },\n * ]\"\n * >\n * <template #icon=\"{ icon }\">\n * <component :is=\"icon\"/>\n * </template>\n * <template #content=\"{ content }\">\n * <div>{{ content }}</div>\n * </template>\n * </bento-selection-card-group>\n * `,\n * }\n */\n export default {\n model: { prop: 'modelValue', event: 'update:model-value' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./selection-card-group.scss\" />\n"],"names":["BentoSelectionCardState","BentoSelectionCardState2","SELECTION_CARD_RADIO_INPUT_INJECTION_KEY","__default__$1","slots","useSlots","hasSlot","useHasSlot","inputId","generateUid","descriptionId","computedRadioInputModelValue","computed","props","computedCheckboxInputModelValue","conditionalClasses","isChecked","containerConditionalClasses","isTitleOnly","checkboxContainerConditionalClasses","checkboxContainerTextConditionalClasses","slotConditionalClasses","ariaLabel","useAriaLabel","isCheckboxGroup","isRadioInput","item","inject","ref","inputRef","slotRef","dynamicSlotRef","handleCardClick","event","newValue2","toggleInput","onChange","newValue","currentValue","newCheckedList","index","emit","__default__","emitValue","useFormFieldEmits","name","conditionalItemsClasses","inputValue","watch","errorMessageId","shouldShowGroupError","containerRef","width","useElementSize","smallBreakpoint","BMediaQuerySMax","mediumBreakpoint","BMediaQueryMMax","currentBreakpoint","computedItemsPerRow","computedRows","rows","i","itemColumnWidth","computedColumnWidth","onInput","value","isRadioVariant","provide","onMounted","el"],"mappings":";;;;;;;;;;;;;;;AAIO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SAHQA,IAAAD,KAAA,CAAA,CAAA;ACJL,MAAAE,IAAA,uBAAA,0CAAA,GCoTHC,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBArJAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAA,yBAAA,GACAC,IAAAD,EAAA,4BAAA,GAEAE,IAAAC;AAAA,MAAmE,MAAAC,EAAA;AAAA,IACnD,GAEhBC,IAAAF;AAAA,MAAwE,MAAAC,EAAA;AAAA,IACxD,GAGhBE,IAAAH,EAAA,OAAA;AAAA,MAA2C,6BAAAI,EAAA;AAAA,MACA,qCAAAH,EAA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yD,MAAA;AACI,YAAAA,MAAAA,IAAA,KAAAA,IAAA;AACI,gBAAA,IAAA;AAAA,YAAU;AAAA,UACN;AAAA,MAER,CAAA;AAAA,IAER,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"selection-card-group.BYBAG8ig.js","sources":["../../src/components/selection-card/selection-card.types.ts","../../src/components/selection-card/selection-card.keys.ts","../../src/components/selection-card/selection-card.vue","../../src/components/selection-card/components/selection-card-group/selection-card-group.vue"],"sourcesContent":["import { type RadioInputValue } from '@/components/internal/radio-input';\nimport { type BentoCheckboxType } from '@/types/checkbox';\nimport { type VueNodeElement } from '@/types/elements';\n\nexport enum BentoSelectionCardState {\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n\nexport type BentoSelectionCardValue = string | number;\n\nexport type BentoSelectionCardModelValue = BentoCheckboxType | RadioInputValue;\n\nexport interface BentoSelectionCardItem {\n content?: string | object;\n description?: string;\n disabled?: boolean;\n dynamicContent?: string | object;\n fullyClickable?: boolean;\n hasError?: boolean;\n icon?: VueNodeElement;\n readonly?: boolean;\n subtitle?: string;\n title: string;\n value: BentoSelectionCardValue;\n}\n","export const SELECTION_CARD_RADIO_INPUT_INJECTION_KEY = Symbol('selection card radio input injection key');\n","<template>\n <div class=\"b-selection-card\" :class=\"conditionalClasses\" @click=\"handleCardClick\">\n <div class=\"b-selection-card__container\" :class=\"containerConditionalClasses\">\n <div class=\"b-selection-card__checkbox-container\" :class=\"checkboxContainerConditionalClasses\">\n <div class=\"b-selection-card__checkbox-container-text\" :class=\"checkboxContainerTextConditionalClasses\">\n <div v-if=\"hasSlot('icon')\" class=\"b-selection-card__icon\" role=\"presentation\" aria-hidden=\"true\">\n <slot name=\"icon\" />\n </div>\n <label :for=\"inputId\" class=\"b-selection-card__text\" @click.stop.prevent=\"handleCardClick\">\n <bento-typography\n v-if=\"subtitle\"\n class=\"b-selection-card__description\"\n el=\"span\"\n variant=\"caption\"\n >\n {{ subtitle }}\n </bento-typography>\n <bento-typography el=\"span\" variant=\"title\">{{ title }}</bento-typography>\n <bento-typography\n v-if=\"description\"\n id=\"descriptionId\"\n class=\"b-selection-card__description\"\n el=\"span\"\n variant=\"body\"\n >\n {{ description }}\n </bento-typography>\n </label>\n </div>\n <radio-input\n v-if=\"isRadioInput\"\n :id=\"inputId\"\n ref=\"inputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"description ? descriptionId : undefined\"\n :disabled=\"disabled\"\n :has-error=\"hasError\"\n :aria-readonly=\"readonly ?? undefined\"\n :value=\"value\"\n :readonly=\"readonly\"\n :model-value=\"computedRadioInputModelValue\"\n />\n <checkbox-input\n v-else\n :id=\"inputId\"\n ref=\"inputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"description ? descriptionId : undefined\"\n :disabled=\"disabled\"\n :has-error=\"hasError\"\n :aria-readonly=\"readonly ?? undefined\"\n :value=\"value\"\n :readonly=\"readonly\"\n :model-value=\"computedCheckboxInputModelValue\"\n />\n </div>\n <bento-typography\n v-if=\"hasSlot('content')\"\n ref=\"slotRef\"\n el=\"div\"\n class=\"b-selection-card__slot\"\n :class=\"slotConditionalClasses\"\n >\n <slot name=\"content\" />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('dynamicContent') && isChecked\"\n ref=\"dynamicSlotRef\"\n el=\"div\"\n class=\"b-selection-card__slot\"\n :class=\"slotConditionalClasses\"\n >\n <slot name=\"dynamicContent\" />\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTypography } from '@/components/typography';\n import { CheckboxInput } from '../internal/checkbox-input';\n import { RadioInput, type RadioInputValue } from '../internal/radio-input';\n import { type BentoCheckboxType, type BentoMultiCheckboxType } from '@/types/checkbox';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { computed, type ComputedRef, inject, type PropType, type Ref, ref, useSlots } from 'vue';\n import { useHasSlot } from '@/composables';\n import type { BentoSelectionCardModelValue, BentoSelectionCardValue } from './selection-card.types';\n import { BentoSelectionCardState } from './selection-card.types';\n import { SELECTION_CARD_RADIO_INPUT_INJECTION_KEY } from './selection-card.keys';\n\n const props = defineProps({\n /**\n * The description of the selection card\n */\n description: {\n type: String,\n default: undefined,\n },\n\n /**\n * Disables the selection card\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Makes the entire selection card clickable. Clicking over interactive elements inside the card with this prop enabled will not be possible.\n */\n fullyClickable: { type: Boolean, default: false },\n\n /**\n * Shows the selection card in error state\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * This property should not be used directly.\n * It will be used by v-model directive on selection card component.\n *\n * When handling a single input, use a string or a number.\n *\n * When handling multiple inputs, use an array of keys.\n * These keys exist as a set \"value\" prop for each input.\n */\n modelValue: {\n type: [Boolean, String, Array] as PropType<BentoSelectionCardModelValue>,\n default: null,\n },\n\n /**\n * Sets the selection card to readonly\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * The subtitle of the selection card\n */\n subtitle: {\n type: String,\n default: undefined,\n },\n\n /**\n * The title of the selection card\n */\n title: {\n type: String,\n required: true,\n },\n\n /**\n * Indicates the value of the input that will be returned when it's checked.\n */\n value: {\n type: [String, Number] as PropType<BentoSelectionCardValue>,\n required: true,\n },\n });\n\n const emit = defineEmits([\"input\", \"update:model-value\"]);\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const inputId = generateUid('selection-card-input-id');\n const descriptionId = generateUid('selection-card-description');\n\n const computedRadioInputModelValue: ComputedRef<RadioInputValue> = computed(\n () => props.modelValue as RadioInputValue\n );\n const computedCheckboxInputModelValue: ComputedRef<BentoCheckboxType> = computed(\n () => props.modelValue as BentoCheckboxType\n );\n\n const conditionalClasses = computed(() => ({\n 'b-selection-card--checked': isChecked.value,\n 'b-selection-card--fully-clickable': props.fullyClickable,\n }));\n\n const containerConditionalClasses = computed(() => ({\n [`b-selection-card--${BentoSelectionCardState.DISABLED}`]: props.disabled,\n [`b-selection-card--${BentoSelectionCardState.ERROR}`]: props.hasError,\n [`b-selection-card--${BentoSelectionCardState.READONLY}`]: props.readonly,\n 'b-selection-card--center-aligned': isTitleOnly.value,\n }));\n\n const checkboxContainerConditionalClasses = computed(() => ({\n 'b-selection-card__checkbox-container--center-aligned': isTitleOnly.value,\n }));\n\n const checkboxContainerTextConditionalClasses = computed(() => ({\n 'b-selection-card__checkbox-container-text--center-aligned': isTitleOnly.value,\n }));\n\n const slotConditionalClasses = computed(() => ({\n 'b-selection-card__slot--with-icon': hasSlot('icon'),\n }));\n\n const ariaLabel = useAriaLabel({\n ariaLabel: props.title,\n label: props.value as string,\n });\n\n const isCheckboxGroup = computed(() => Array.isArray(props.modelValue));\n\n const isChecked: ComputedRef<boolean> = computed(() => {\n if (isRadioInput.value) {\n return props.value === props.modelValue;\n }\n if (!isCheckboxGroup.value) {\n return props.modelValue as boolean;\n }\n\n return (props.modelValue as BentoMultiCheckboxType).some(item => item === props.value);\n });\n\n const isRadioInput: Ref<boolean> = inject(SELECTION_CARD_RADIO_INPUT_INJECTION_KEY, ref(false));\n\n const isTitleOnly = computed(() => !props.subtitle && !props.description);\n\n const inputRef = ref<InstanceType<typeof RadioInput> | InstanceType<typeof CheckboxInput>>(null);\n const slotRef = ref(null);\n const dynamicSlotRef = ref(null);\n\n // Handle click on the whole card area\n const handleCardClick = (event: Event) => {\n if (inputRef.value.$refs.inputRef === event.target) {\n const newValue = toggleInput();\n onChange(newValue);\n return;\n }\n\n // Do nothing if disabled or readonly\n if (props.disabled && props.readonly) {\n return;\n }\n\n // If it's not fully clickable prevent selecting the card if the click\n // originated in a slot\n if (!props.fullyClickable) {\n // Check if the click originated from the slot - in that case, do nothng\n if (slotRef.value && slotRef.value?.$el?.contains(event.target)) {\n return;\n }\n // Check if the click originated from the dynamic slot - in that case, do nothng\n if (dynamicSlotRef.value && dynamicSlotRef.value?.$el?.contains(event.target)) {\n return;\n }\n // Check if the click originated from the input - in that case do nothing, as the input will emit the event already\n if (inputRef.value && inputRef.value?.$el?.contains(event.target as Node)) {\n return;\n }\n }\n\n // If the click originated outside of these two areas, emit the change event\n const newValue = toggleInput();\n\n onChange(newValue);\n };\n\n const toggleInput = (): BentoSelectionCardModelValue => {\n const currentValue: boolean = (inputRef.value?.$refs.inputRef as HTMLInputElement).checked;\n\n if (isCheckboxGroup.value) {\n const newCheckedList = [...(props.modelValue as BentoMultiCheckboxType)];\n const index = newCheckedList.indexOf(props.value);\n\n if (index === -1) {\n newCheckedList.push(props.value);\n } else {\n newCheckedList.splice(index, 1);\n }\n return newCheckedList;\n }\n\n if (isRadioInput.value) {\n return props.value;\n }\n return currentValue;\n };\n\n const onChange = newValue => {\n if (!props.disabled && !props.readonly) {\n emit('update:model-value', newValue);\n emit('input', newValue);\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Selection card component. If used standalone, only the checkbox variant can be used. If the checkbox variant is needed, please use the bento-selection-card-group component.\n *\n * @example\n * import { BentoSelectionCard } from '@adyen/bento-vue2';\n * import EmoticonHappyIcon from '@adyen/ui-assets-icons-16/vue/emoticon-happy';\n *\n * export default {\n * components: { BentoSelectionCard, EmoticonHappyIcon },\n * template: `\n * <bento-selection-card title=\"Card title\" :model-value.sync=\"yourModelValue\">\n * <template #icon>\n * <emoticon-happy-icon />\n * </template>\n * </bento-selection-card>\n * `\n * }\n */\n export default {\n name: 'bento-selection-card',\n };\n</script>\n<style lang=\"scss\" scoped src=\"./selection-card.scss\" />\n","<template>\n <controls-group\n ref=\"containerRef\"\n :aria-describedby=\"shouldShowGroupError ? errorMessageId : null\"\n :aria-required=\"required\"\n :label=\"label\"\n :hide-label=\"hideLabel\"\n :description=\"description\"\n :disabled=\"disabled\"\n :tooltip-text=\"tooltipText\"\n :readonly=\"readonly\"\n :required=\"required\"\n :optional=\"optional\"\n class=\"b-selection-card-group\"\n component-name=\"selection-card-group\"\n >\n <div\n v-if=\"!itemsPerRow || layout === 'vertical'\"\n class=\"b-selection-card-group__items\"\n :class=\"conditionalItemsClasses\"\n >\n <bento-selection-card\n v-for=\"item in items\"\n :key=\"`selection-card-${item.value}`\"\n class=\"b-selection-card-group__item\"\n v-bind=\"item\"\n :model-value=\"inputValue\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowGroupError\"\n :disabled=\"disabled || item.disabled\"\n @update:model-value=\"onInput\"\n >\n <template v-if=\"hasSlot('icon') && item.icon\" #icon>\n <slot name=\"icon\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('content') && item.content\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('dynamicContent') && item.dynamicContent\" #dynamicContent>\n <slot name=\"dynamicContent\" v-bind=\"item\"></slot>\n </template>\n </bento-selection-card>\n </div>\n <template v-else>\n <div :key=\"`selection-card-group-layout-breakpoint-${currentBreakpoint}`\">\n <grid-layout\n v-for=\"(row, rowIndex) in computedRows\"\n :key=\"`selection-card-group-row-${rowIndex}-cols-${computedItemsPerRow}`\"\n class=\"b-selection-card-group__items--wrap\"\n :column-width=\"computedColumnWidth\"\n >\n <template v-for=\"(item, columnIndex) in row\" #[`col-${Number(columnIndex)+1}`]>\n <bento-selection-card\n :key=\"`selection-card-${item.value}`\"\n class=\"b-selection-card-group__item b-selection-card-group__item--full-height\"\n v-bind=\"item\"\n :model-value=\"inputValue\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowGroupError\"\n :disabled=\"disabled || item.disabled\"\n @update:model-value=\"onInput\"\n >\n <template v-if=\"hasSlot('icon') && item.icon\" #icon>\n <slot name=\"icon\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('content') && item.content\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('dynamicContent') && item.dynamicContent\" #dynamicContent>\n <slot name=\"dynamicContent\" v-bind=\"item\"></slot>\n </template>\n </bento-selection-card>\n </template>\n </grid-layout>\n </div>\n </template>\n <error-message\n v-if=\"shouldShowGroupError\"\n :id=\"errorMessageId\"\n :error-message=\"errorMessage\"\n class=\"b-selection-card-group__error-message\"\n />\n </controls-group>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, provide, ref, useSlots, watch } from 'vue';\n import { useElementSize } from '@vueuse/core';\n import { BMediaQueryMMax, BMediaQuerySMax } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n import { type BentoSelectionCardGroupEmits, type BentoSelectionCardGroupProps } from './selection-card-group.types';\n import BentoSelectionCard from '../../selection-card.vue';\n import { ControlsGroup, ErrorMessage, GridLayout } from '../../../internal';\n import { SELECTION_CARD_RADIO_INPUT_INJECTION_KEY } from '../../selection-card.keys';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n\n const props = defineProps({\n description: { default: null },\n disabled: { type: Boolean, default: false },\n errorMessage: { default: null },\n label: { default: null },\n optional: { type: Boolean, default: false },\n placeholder: null,\n readonly: { type: Boolean, default: false },\n required: { type: Boolean, default: false },\n tooltipText: { default: null },\n formId: { default: null },\n hideLabel: { type: Boolean, default: null },\n layout: { default: 'vertical' },\n items: null,\n itemsPerRow: { default: undefined },\n modelValue: { default: null },\n variant: { default: 'checkbox' }\n});\n\n const emit = defineEmits([\"update:model-value\"]);\n\n const { emitValue } = useFormFieldEmits(emit);\n\n const slots = useSlots();\n // Slots logic\n // Temporary, use-has-slots composable doesn't currently work for vue3 named scoped slots\n // We do the same in bento-checkbox-group\n const hasSlot = name => !!slots[name];\n\n const conditionalItemsClasses = computed(() => ({\n 'b-selection-card-group__items--horizontal': props.layout === 'horizontal',\n }));\n\n const inputValue = ref(props.modelValue);\n watch(\n () => props.modelValue,\n () => {\n inputValue.value = props.modelValue;\n }\n );\n\n // Error message logic\n const errorMessageId = generateUid('error');\n const shouldShowGroupError = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n // itemsPerRow logic\n const containerRef = ref<HTMLElement | null>(null);\n const { width } = useElementSize(containerRef);\n\n const smallBreakpoint = computed(() => BMediaQuerySMax.split('px')[0]);\n const mediumBreakpoint = computed(() => BMediaQueryMMax.split('px')[0]);\n\n const currentBreakpoint = computed(() => {\n if (width.value < smallBreakpoint.value) {\n return 'small';\n }\n if (width.value >= smallBreakpoint.value && width.value < mediumBreakpoint.value) {\n return 'medium';\n }\n return 'large';\n });\n\n const computedItemsPerRow = computed(() => {\n return (props.itemsPerRow?.[currentBreakpoint?.value] as number) || props.items.length;\n });\n\n const computedRows = computed(() => {\n if (!props.itemsPerRow) {\n return [];\n }\n const rows = [];\n for (let i = 0; i < props.items.length; i += computedItemsPerRow?.value) {\n rows.push(props.items.slice(i, i + computedItemsPerRow?.value));\n }\n return rows;\n });\n\n // We need to compute the column width on 12 because we're using a 12-column system for out grid-layout logic\n const itemColumnWidth = computed(() => 12 / computedItemsPerRow?.value);\n\n /**\n * Filling the columnWidth array with the same parameters per item to pass\n * to the `grid-layout` layout so the each card can have\n * the same width according to the screen size.\n */\n const computedColumnWidth = computed(() => {\n return computedItemsPerRow?.value\n ? new Array(computedItemsPerRow?.value).fill({\n // Instead of passing the actual screen sizes values, passing the same values per each screen size and recomputing it makes sure visually the change is smoother and not laggy\n small: itemColumnWidth.value,\n medium: itemColumnWidth.value,\n large: itemColumnWidth.value,\n })\n : [];\n });\n\n const onInput = value => {\n inputValue.value = value;\n emitValue(value);\n };\n\n const isRadioVariant = computed(() => props.variant === 'radio');\n\n provide(SELECTION_CARD_RADIO_INPUT_INJECTION_KEY, isRadioVariant);\n\n onMounted(() => {\n if (props.itemsPerRow) {\n Object.values(props.itemsPerRow).forEach(value => {\n const numericValue = Number(value);\n if (!Number.isInteger(numericValue) || numericValue < 1 || numericValue > 6) {\n throw new Error(\n 'itemsPerRow values must have a value between 1 and 6 items per row. Read the documentation for more information.'\n );\n }\n });\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Group of bento-selection-cards.\n *\n * @example\n * import { BentoSelectionCardGroup } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSelectionCardGroup },\n * template: `\n * <bento-selection-card-group\n * :items=\"[\n * {\n * title: 'Card 1',\n * value: 'card-1',\n * content: 'Slot content 1',\n * icon: RetailIcon,\n * },\n * {\n * title: 'Card 2',\n * value: 'card-2',\n * content: 'Slot content 2',\n * icon: LeafIcon,\n * },\n * ]\"\n * >\n * <template #icon=\"{ icon }\">\n * <component :is=\"icon\"/>\n * </template>\n * <template #content=\"{ content }\">\n * <div>{{ content }}</div>\n * </template>\n * </bento-selection-card-group>\n * `,\n * }\n */\n export default {\n model: { prop: 'modelValue', event: 'update:model-value' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./selection-card-group.scss\" />\n"],"names":["BentoSelectionCardState","BentoSelectionCardState2","SELECTION_CARD_RADIO_INPUT_INJECTION_KEY","__default__$1","slots","useSlots","hasSlot","useHasSlot","inputId","generateUid","descriptionId","computedRadioInputModelValue","computed","props","computedCheckboxInputModelValue","conditionalClasses","isChecked","containerConditionalClasses","isTitleOnly","checkboxContainerConditionalClasses","checkboxContainerTextConditionalClasses","slotConditionalClasses","ariaLabel","useAriaLabel","isCheckboxGroup","isRadioInput","item","inject","ref","inputRef","slotRef","dynamicSlotRef","handleCardClick","event","newValue2","toggleInput","onChange","newValue","currentValue","newCheckedList","index","emit","__default__","emitValue","useFormFieldEmits","name","conditionalItemsClasses","inputValue","watch","errorMessageId","shouldShowGroupError","containerRef","width","useElementSize","smallBreakpoint","BMediaQuerySMax","mediumBreakpoint","BMediaQueryMMax","currentBreakpoint","computedItemsPerRow","computedRows","rows","i","itemColumnWidth","computedColumnWidth","onInput","value","isRadioVariant","provide","onMounted","numericValue"],"mappings":";;;;;;;;;;;;;;;AAIO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SAHQA,IAAAD,KAAA,CAAA,CAAA;ACJL,MAAAE,IAAA,uBAAA,0CAA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,GAAA,KAAA,EAAA,KAAA;AAAA;AAAA,MACiD,OAAAI,EAAA;AAAA,MAEhB,QAAAA,EAAA;AAAA,MACC,OAAAA,EAAA;AAAA,IACD,CAAA,IAAA,CAAA,CAE1B,GAGXE,IAAA,CAAAC,MAAA;AACI,MAAAnB,EAAA,QAAAmB,GACAvB,EAAAuB,CAAA;AAAA,IAAe,GAGnBC,IAAAvD,EAAA,MAAAC,EAAA,YAAA,OAAA;AAEA,WAAAuD,EAAAlE,GAAAiE,CAAA,GAEAE,EAAA,MAAA;AACI,MAAAxD,EAAA,eACI,OAAA,OAAAA,EAAA,WAAA,EAAA,QAAA,CAAAqD,MAAA;AACI,cAAAI,IAAA,OAAAJ,CAAA;AACA,YAAA,CAAA,OAAA,UAAAI,CAAA,KAAAA,IAAA,KAAAA,IAAA;AACI,gBAAA,IAAA;AAAA,YAAU;AAAA,UACN;AAAA,MAER,CAAA;AAAA,IAER,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineComponent as h, toRefs as k, ref as o, computed as P, onMounted as N, onUnmounted as G, watch as F, provide as g } from "vue";
|
|
2
|
-
import { B as x, d as R } from "./typography.
|
|
3
|
-
import { F as U } from "./footer-actions.
|
|
4
|
-
import { D as L } from "./dialog-page.
|
|
2
|
+
import { B as x, d as R } from "./typography.Cd386LC_.js";
|
|
3
|
+
import { F as U } from "./footer-actions.B8f-gEQV.js";
|
|
4
|
+
import { D as L } from "./dialog-page.DORdXmEm.js";
|
|
5
5
|
import { n as I } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
6
|
-
import { B as J } from "./button.
|
|
6
|
+
import { B as J } from "./button.tsTeQRcP.js";
|
|
7
7
|
import { B as M } from "./focus-trap.fd6_d2EW.js";
|
|
8
8
|
import { C as K } from "./cross.szJ_ZUTI.js";
|
|
9
|
-
import { S as Y } from "./button-actions.
|
|
9
|
+
import { S as Y } from "./button-actions.CdetBz3J.js";
|
|
10
10
|
import { u as w } from "./index.CPOlyau9.js";
|
|
11
11
|
import { g as z } from "./generate-uid.DBWe4g6T.js";
|
|
12
12
|
import { B as H, D as $, a as j } from "./dialog-page.keys.Dym9e6k3.js";
|
|
@@ -110,10 +110,10 @@ const ee = {
|
|
|
110
110
|
"pt-BR": { close: "Fechar" },
|
|
111
111
|
"zh-CN": { close: "关闭" }
|
|
112
112
|
}, te = {
|
|
113
|
-
i18n: { messages: ee }
|
|
113
|
+
i18n: { messages: ee },
|
|
114
|
+
name: "bento-sidepanel"
|
|
114
115
|
}, se = /* @__PURE__ */ h({
|
|
115
116
|
...te,
|
|
116
|
-
__name: "sidepanel",
|
|
117
117
|
props: {
|
|
118
118
|
/**
|
|
119
119
|
* The id of the current active page
|
|
@@ -128,7 +128,7 @@ const ee = {
|
|
|
128
128
|
* If set to true, it allows the sidepanel to be closed.
|
|
129
129
|
* Shows close button when `true` and hides close button when `false`.
|
|
130
130
|
*
|
|
131
|
-
* _Note: This property will not set the visibility of the close button in
|
|
131
|
+
* _Note: This property will not set the visibility of the close button in v3.0.0_
|
|
132
132
|
*/
|
|
133
133
|
isDismissible: {
|
|
134
134
|
type: Boolean,
|
|
@@ -145,7 +145,7 @@ const ee = {
|
|
|
145
145
|
* Controls the visibility of close button on the sidepanel.
|
|
146
146
|
* Defaults to `true` when `isDismissible=false`, and `true` when `isDimissible=true`.
|
|
147
147
|
*
|
|
148
|
-
* _Note: This property will be set to `false` by default, independent of `isDismissible` in
|
|
148
|
+
* _Note: This property will be set to `false` by default, independent of `isDismissible` in v3.0.0_
|
|
149
149
|
*/
|
|
150
150
|
hideCloseButton: {
|
|
151
151
|
type: Boolean,
|
|
@@ -154,7 +154,7 @@ const ee = {
|
|
|
154
154
|
},
|
|
155
155
|
emits: [],
|
|
156
156
|
setup(a, { emit: e }) {
|
|
157
|
-
const t = a, { activePage: s, isOpen: n } = k(t), { t:
|
|
157
|
+
const t = a, { activePage: s, isOpen: n } = k(t), { t: b } = w(), r = o(null), u = o([]), l = o([]), C = o(H.TRANSITION_LEVEL_DEEPER), p = o(!1), A = z("sidepanel"), d = o(!1), v = o(!1), _ = o(!1), D = P(() => ({
|
|
158
158
|
"b-sidepanel--hide": p.value,
|
|
159
159
|
"b-sidepanel--animation": v.value
|
|
160
160
|
})), O = () => {
|
|
@@ -189,8 +189,8 @@ const ee = {
|
|
|
189
189
|
}), g(j, B), g(Y, A), !t.isDismissible && t.hideCloseButton === null && R(
|
|
190
190
|
'BentoSidepanel "isDismissible" property’s behavior',
|
|
191
191
|
'BentoSidepanel "isDismissible" will no longer hide the close button. Use "hideCloseButton=true" instead.',
|
|
192
|
-
"
|
|
193
|
-
), { __sfc: !0, props: t, emit: e, activePage: s, isOpen: n, t:
|
|
192
|
+
"3.0.0"
|
|
193
|
+
), { __sfc: !0, props: t, emit: e, activePage: s, isOpen: n, t: b, sidepanel: r, pages: u, previousPages: l, animation: C, isClosing: p, sidepanelId: A, internalIsOpen: d, isAnimationActive: v, isMounted: _, conditionalClasses: D, closeSidepanelAfterAnimation: O, startCloseSidepanelAnimation: m, closeSidepanelOnClickOutside: S, computedHideCloseButton: T, updatePage: E, unregisterPage: y, registerPage: B, BentoButton: J, BentoFocusTrap: M, CrossIcon: K, vBentoClickOutsideDirective: V };
|
|
194
194
|
}
|
|
195
195
|
});
|
|
196
196
|
var ae = function() {
|
|
@@ -205,7 +205,7 @@ var ae = function() {
|
|
|
205
205
|
ie,
|
|
206
206
|
!1,
|
|
207
207
|
null,
|
|
208
|
-
"
|
|
208
|
+
"1b728c73"
|
|
209
209
|
);
|
|
210
210
|
const Ee = oe.exports;
|
|
211
211
|
export {
|
|
@@ -213,4 +213,4 @@ export {
|
|
|
213
213
|
Ae as a,
|
|
214
214
|
Ee as s
|
|
215
215
|
};
|
|
216
|
-
//# sourceMappingURL=sidepanel.
|
|
216
|
+
//# sourceMappingURL=sidepanel.CLbVkH7v.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidepanel.CntIcmx-.js","sources":["../../src/components/sidepanel/components/sidepanel-page.vue","../../src/components/sidepanel/sidepanel.types.ts","../../src/components/sidepanel/sidepanel.vue"],"sourcesContent":["<template>\n <dialog-page class=\"b-sidepanel-page\" :page-id=\"pageId\" :previous-page=\"previousPage\">\n <template #header>\n <div class=\"b-sidepanel-page__header\">\n <bento-typography class=\"b-sidepanel-page__title\" el=\"h2\" variant=\"title\">\n {{ title }}\n </bento-typography>\n </div>\n </template>\n <template #content>\n <div class=\"b-sidepanel-page__content\">\n <bento-typography el=\"div\" variant=\"body\">\n <slot />\n </bento-typography>\n </div>\n </template>\n <template v-if=\"actions && actions.length > 0\" #footer>\n <div class=\"b-sidepanel-page__actions\">\n <footer-actions\n :actions=\"actions\"\n :actions-label=\"actionsLabel\"\n :destructive-actions=\"destructiveActions\"\n />\n </div>\n </template>\n </dialog-page>\n</template>\n\n<script setup lang=\"ts\">\n import { type PropType } from 'vue';\n\n import { type BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { FooterActions } from '@/components/internal/footer-actions';\n import { DialogPage } from '@/internal';\n\n defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * Text label that is displayed left to the action buttons\n */\n actionsLabel: {\n type: String,\n default: null,\n },\n\n /**\n * If passed - sets first button color to red\n */\n destructiveActions: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Identifier of the page, used with activePage prop to handle sidepanel navigation\n */\n pageId: {\n type: String,\n default: undefined,\n },\n\n /**\n * ID of the page for the back button to navigate to. Only use it to overwrite the default back behavior\n * Used when the back button should not take the user to the natural previous page\n * Set to `null` to hide back button in the page\n */\n previousPage: {\n type: String,\n default: undefined,\n },\n\n /**\n * Title of the sidepanel page\n */\n title: {\n type: String,\n default: null,\n },\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * SidepanelPage is used to render different pages of Sidepanel component\n *\n * @example\n * import { BentoSidepanel, BentoSidepanelPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSidepanel, BentoSidepanelPage },\n * template: `\n * <bento-sidepanel active-page='step1' is-open='true'>\n * <bento-sidepanel-page\n * title='Step 1'\n * pageId='step1'\n * :actions=\"[\n * {\n * title: 'Next step',\n * event: () => {\n * activePage.value = 'step2';\n * },\n * }]\">\n * Step 1 info\n * </bento-sidepanel-page>\n * <bento-sidepanel-page\n * title='Step 2'\n * pageId='step2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Step 2 info\n * </bento-sidepanel-page>\n * </bento-sidepanel>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./sidepanel-page.scss\" />\n","export enum BentoSidepanelEvent {\n UPDATE_ACTIVE_PAGE = 'update:active-page',\n UPDATE_IS_OPEN = 'update:is-open',\n}\n","<template>\n <dialog\n ref=\"sidepanel\"\n class=\"b-sidepanel\"\n :class=\"conditionalClasses\"\n @animationend=\"closeSidepanelAfterAnimation\"\n @keydown.esc.prevent=\"isDismissible && startCloseSidepanelAnimation\"\n >\n <bento-focus-trap :id=\"sidepanelId\" v-bento-click-outside-directive=\"closeSidepanelOnClickOutside\">\n <div v-if=\"!computedHideCloseButton\" class=\"b-sidepanel__close-button\">\n <bento-button variant=\"tertiary\" @click=\"startCloseSidepanelAnimation\">\n <cross-icon :svg-title=\"t('close')\" />\n </bento-button>\n </div>\n <slot />\n </bento-focus-trap>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, onUnmounted, provide, ref, toRefs, watch } from 'vue';\n\n import { BentoButton } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { BentoSidepanelEvent } from './sidepanel.types';\n import {\n BentoDialogPageAnimation,\n type BentoDialogPageConfigData,\n type BentoDialogPageRegisterPage,\n DIALOG_PAGE_CONFIG_INJECTION_KEY,\n DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY,\n } from '@/internal';\n\n import { SIDEPANEL_DIALOG_ID_INJECTION_KEY } from './sidepanel.keys';\n\n import { BentoClickOutsideDirective as vBentoClickOutsideDirective } from '@/directives/click-outside';\n\n import { useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { deprecate } from '@/utils/ts/deprecate';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n /**\n * The id of the current active page\n * Should be the same id as the BentoSidepanelPage to be displayed\n * If the component only has one page, it can be left null/undefined.\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * If set to true, it allows the sidepanel to be closed.\n * Shows close button when `true` and hides close button when `false`.\n *\n * _Note: This property will not set the visibility of the close button in v2.0.0_\n */\n isDismissible: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Controls the sidepanel's state from the outside. Set it to true to open the sidepanel.\n */\n isOpen: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Controls the visibility of close button on the sidepanel.\n * Defaults to `true` when `isDismissible=false`, and `true` when `isDimissible=true`.\n *\n * _Note: This property will be set to `false` by default, independent of `isDismissible` in v2.0.0_\n */\n hideCloseButton: {\n type: Boolean,\n default: null,\n },\n });\n\n const emit = defineEmits([]);\n\n // Refs\n const { activePage, isOpen } = toRefs(props);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const sidepanel = ref(null);\n const pages = ref<Array<string>>([]);\n const previousPages = ref([]);\n const animation = ref(BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER);\n const isClosing = ref(false);\n const sidepanelId = generateUid('sidepanel');\n const internalIsOpen = ref(false);\n const isAnimationActive = ref(false);\n const isMounted = ref(false);\n\n // Animation styling\n const conditionalClasses = computed(() => ({\n 'b-sidepanel--hide': isClosing.value,\n 'b-sidepanel--animation': isAnimationActive.value,\n }));\n\n // Handle closing and closing animation for dialog element\n const closeSidepanelAfterAnimation = () => {\n if (isClosing.value && sidepanel.value) {\n sidepanel.value.close();\n if (previousPages.value[0]) {\n emit(BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, previousPages.value[0]);\n }\n previousPages.value = [];\n isClosing.value = false;\n internalIsOpen.value = false;\n emit(BentoSidepanelEvent.UPDATE_IS_OPEN, false);\n }\n };\n\n const startCloseSidepanelAnimation = () => {\n if (!sidepanel.value || !sidepanel.value.open) {\n return;\n }\n isClosing.value = true;\n };\n\n const closeSidepanelOnClickOutside = () => {\n if (props.isDismissible) {\n startCloseSidepanelAnimation();\n }\n };\n\n // TODO: Remove in upcoming major. See properties `hideCloseButton` and `isDismissible`.\n const computedHideCloseButton = computed(() => {\n if (props.hideCloseButton !== null) {\n return props.hideCloseButton;\n }\n\n return !props.isDismissible;\n });\n\n onMounted(() => {\n isMounted.value = true;\n });\n\n onUnmounted(() => {\n isMounted.value = false;\n });\n\n // Watching isOpen prop to toggle open/close the dialog element\n watch(\n [() => isOpen.value, sidepanel],\n ([newIsOpen, newSidepanelValue]) => {\n if (!isMounted.value || !newSidepanelValue) {\n return;\n }\n\n if (newIsOpen) {\n internalIsOpen.value = true;\n if (!newSidepanelValue.open) {\n newSidepanelValue.showModal();\n }\n if (!previousPages.value.length) {\n previousPages.value.push(activePage.value);\n }\n } else if (newSidepanelValue.open) {\n startCloseSidepanelAnimation();\n }\n },\n { immediate: true, flush: 'post' }\n );\n\n // Pages\n const updatePage = page => emit(BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, page);\n\n // unregister page if removed / destroyed\n const unregisterPage = (pageIdToRemove: string) => () => {\n pages.value = pages.value?.filter(pageId => pageId !== pageIdToRemove);\n };\n\n // Provide data and function to register page to subcomponent\n const registerPage: BentoDialogPageRegisterPage = pageId => {\n pages.value.push(pageId);\n\n return { unregisterPage: unregisterPage(pageId) };\n };\n\n provide<BentoDialogPageConfigData>(DIALOG_PAGE_CONFIG_INJECTION_KEY, {\n activePage,\n animation,\n isAnimationActive,\n isOpen: internalIsOpen,\n pages,\n previousPages,\n updatePage,\n });\n provide(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY, registerPage);\n\n // Let's Children components know they are inside a SidePanel (dialog element)\n provide(SIDEPANEL_DIALOG_ID_INJECTION_KEY, sidepanelId);\n\n if (!props.isDismissible && props.hideCloseButton === null) {\n deprecate(\n 'BentoSidepanel \"isDismissible\" property’s behavior',\n 'BentoSidepanel \"isDismissible\" will no longer hide the close button. Use \"hideCloseButton=true\" instead.',\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Sidepanel component is a slide-in panel that should be used for presenting actions, settings or features that are directly associated with a specific task or interaction on the main screen.\n *\n * @example\n * import { BentoSidepanel, BentoSidepanelPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSidepanel, BentoSidepanelPage },\n * template: `\n * <bento-sidepanel active-page='step1' is-open='true'>\n * <bento-sidepanel-page\n * title='Step 1'\n * pageId='step1'\n * :actions=\"[\n * {\n * title: 'Next step',\n * event: () => {\n * activePage.value = 'step2';\n * },\n * }]\">\n * Step 1 info\n * </bento-sidepanel-page>\n * <bento-sidepanel-page\n * title='Step 2'\n * pageId='step2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Step 2 info\n * </bento-sidepanel-page>\n * </bento-sidepanel>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n<style lang=\"scss\" scoped src=\"./sidepanel.scss\" />\n"],"names":["__default__$1","BentoSidepanelEvent","BentoSidepanelEvent2","__default__","messages","activePage","isOpen","toRefs","props","t","useI18n","sidepanel","ref","pages","previousPages","animation","BentoDialogPageAnimation","isClosing","sidepanelId","generateUid","internalIsOpen","isAnimationActive","isMounted","conditionalClasses","computed","closeSidepanelAfterAnimation","emit","startCloseSidepanelAnimation","closeSidepanelOnClickOutside","computedHideCloseButton","onMounted","onUnmounted","watch","newIsOpen","newSidepanelValue","updatePage","page","unregisterPage","pageIdToRemove","pageId","registerPage","provide","DIALOG_PAGE_CONFIG_INJECTION_KEY","DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY","SIDEPANEL_DIALOG_ID_INJECTION_KEY","deprecate"],"mappings":";;;;;;;;;;;;;;AA2II,MAAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3IG,IAAAC,IAAA,kBAAAC,OACHA,EAAA,qBAAA,sBACAA,EAAA,iBAAA,kBAFQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;;GC4PRE,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,GAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAlKA,EAAA,YAAAC,GAAA,QAAAC,EAAA,IAAAC,EAAAC,CAAA,GACA,EAAA,GAAAC,EAAA,IAAAC,EAAA,GACAC,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,CAAA,CAAA,GACAE,IAAAF,EAAA,CAAA,CAAA,GACAG,IAAAH,EAAAI,EAAA,uBAAA,GACAC,IAAAL,EAAA,EAAA,GACAM,IAAAC,EAAA,WAAA,GACAC,IAAAR,EAAA,EAAA,GACAS,IAAAT,EAAA,EAAA,GACAU,IAAAV,EAAA,EAAA,GAGAW,IAAAC,EAAA,OAAA;AAAA,MAA2C,qBAAAP,EAAA;AAAA,MACR,0BAAAI,EAAA;AAAA,IACa,EAAA,GAIhDI,IAAA,MAAA;AACI,MAAAR,EAAA,SAAAN,EAAA,UACIA,EAAA,MAAA,MAAA,GACAG,EAAA,MAAA,CAAA,KACIY,EAAAzB,EAAA,oBAAAa,EAAA,MAAA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AD;AAAA,MACQ,OAAAP;AAAA,MACR,eAAAC;AAAA,MACA,YAAAqB;AAAA,IACA,CAAA,GAEJM,EAAAE,GAAAH,CAAA,GAGAC,EAAAG,GAAA1B,CAAA,GAEA,CAAAV,EAAA,iBAAAA,EAAA,oBAAA,QACIqC;AAAA,MAAA;AAAA,MACI;AAAA,MACA;AAAA,IACA;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"sidepanel.CLbVkH7v.js","sources":["../../src/components/sidepanel/components/sidepanel-page.vue","../../src/components/sidepanel/sidepanel.types.ts","../../src/components/sidepanel/sidepanel.vue"],"sourcesContent":["<template>\n <dialog-page class=\"b-sidepanel-page\" :page-id=\"pageId\" :previous-page=\"previousPage\">\n <template #header>\n <div class=\"b-sidepanel-page__header\">\n <bento-typography class=\"b-sidepanel-page__title\" el=\"h2\" variant=\"title\">\n {{ title }}\n </bento-typography>\n </div>\n </template>\n <template #content>\n <div class=\"b-sidepanel-page__content\">\n <bento-typography el=\"div\" variant=\"body\">\n <slot />\n </bento-typography>\n </div>\n </template>\n <template v-if=\"actions && actions.length > 0\" #footer>\n <div class=\"b-sidepanel-page__actions\">\n <footer-actions\n :actions=\"actions\"\n :actions-label=\"actionsLabel\"\n :destructive-actions=\"destructiveActions\"\n />\n </div>\n </template>\n </dialog-page>\n</template>\n\n<script setup lang=\"ts\">\n import { type PropType } from 'vue';\n\n import { type BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { FooterActions } from '@/components/internal/footer-actions';\n import { DialogPage } from '@/internal';\n\n defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * Text label that is displayed left to the action buttons\n */\n actionsLabel: {\n type: String,\n default: null,\n },\n\n /**\n * If passed - sets first button color to red\n */\n destructiveActions: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Identifier of the page, used with activePage prop to handle sidepanel navigation\n */\n pageId: {\n type: String,\n default: undefined,\n },\n\n /**\n * ID of the page for the back button to navigate to. Only use it to overwrite the default back behavior\n * Used when the back button should not take the user to the natural previous page\n * Set to `null` to hide back button in the page\n */\n previousPage: {\n type: String,\n default: undefined,\n },\n\n /**\n * Title of the sidepanel page\n */\n title: {\n type: String,\n default: null,\n },\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * SidepanelPage is used to render different pages of Sidepanel component\n *\n * @example\n * import { BentoSidepanel, BentoSidepanelPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSidepanel, BentoSidepanelPage },\n * template: `\n * <bento-sidepanel active-page='step1' is-open='true'>\n * <bento-sidepanel-page\n * title='Step 1'\n * pageId='step1'\n * :actions=\"[\n * {\n * title: 'Next step',\n * event: () => {\n * activePage.value = 'step2';\n * },\n * }]\">\n * Step 1 info\n * </bento-sidepanel-page>\n * <bento-sidepanel-page\n * title='Step 2'\n * pageId='step2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Step 2 info\n * </bento-sidepanel-page>\n * </bento-sidepanel>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./sidepanel-page.scss\" />\n","export enum BentoSidepanelEvent {\n UPDATE_ACTIVE_PAGE = 'update:active-page',\n UPDATE_IS_OPEN = 'update:is-open',\n}\n","<template>\n <dialog\n ref=\"sidepanel\"\n class=\"b-sidepanel\"\n :class=\"conditionalClasses\"\n @animationend=\"closeSidepanelAfterAnimation\"\n @keydown.esc.prevent=\"isDismissible && startCloseSidepanelAnimation\"\n >\n <bento-focus-trap :id=\"sidepanelId\" v-bento-click-outside-directive=\"closeSidepanelOnClickOutside\">\n <div v-if=\"!computedHideCloseButton\" class=\"b-sidepanel__close-button\">\n <bento-button variant=\"tertiary\" @click=\"startCloseSidepanelAnimation\">\n <cross-icon :svg-title=\"t('close')\" />\n </bento-button>\n </div>\n <slot />\n </bento-focus-trap>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, onUnmounted, provide, ref, toRefs, watch } from 'vue';\n\n import { BentoButton } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { BentoSidepanelEvent } from './sidepanel.types';\n import {\n BentoDialogPageAnimation,\n type BentoDialogPageConfigData,\n type BentoDialogPageRegisterPage,\n DIALOG_PAGE_CONFIG_INJECTION_KEY,\n DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY,\n } from '@/internal';\n\n import { SIDEPANEL_DIALOG_ID_INJECTION_KEY } from './sidepanel.keys';\n\n import { BentoClickOutsideDirective as vBentoClickOutsideDirective } from '@/directives/click-outside';\n\n import { useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { deprecate } from '@/utils/ts/deprecate';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n /**\n * The id of the current active page\n * Should be the same id as the BentoSidepanelPage to be displayed\n * If the component only has one page, it can be left null/undefined.\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * If set to true, it allows the sidepanel to be closed.\n * Shows close button when `true` and hides close button when `false`.\n *\n * _Note: This property will not set the visibility of the close button in v3.0.0_\n */\n isDismissible: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Controls the sidepanel's state from the outside. Set it to true to open the sidepanel.\n */\n isOpen: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Controls the visibility of close button on the sidepanel.\n * Defaults to `true` when `isDismissible=false`, and `true` when `isDimissible=true`.\n *\n * _Note: This property will be set to `false` by default, independent of `isDismissible` in v3.0.0_\n */\n hideCloseButton: {\n type: Boolean,\n default: null,\n },\n });\n\n const emit = defineEmits([]);\n\n // Refs\n const { activePage, isOpen } = toRefs(props);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const sidepanel = ref(null);\n const pages = ref<Array<string>>([]);\n const previousPages = ref([]);\n const animation = ref(BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER);\n const isClosing = ref(false);\n const sidepanelId = generateUid('sidepanel');\n const internalIsOpen = ref(false);\n const isAnimationActive = ref(false);\n const isMounted = ref(false);\n\n // Animation styling\n const conditionalClasses = computed(() => ({\n 'b-sidepanel--hide': isClosing.value,\n 'b-sidepanel--animation': isAnimationActive.value,\n }));\n\n // Handle closing and closing animation for dialog element\n const closeSidepanelAfterAnimation = () => {\n if (isClosing.value && sidepanel.value) {\n sidepanel.value.close();\n if (previousPages.value[0]) {\n emit(BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, previousPages.value[0]);\n }\n previousPages.value = [];\n isClosing.value = false;\n internalIsOpen.value = false;\n emit(BentoSidepanelEvent.UPDATE_IS_OPEN, false);\n }\n };\n\n const startCloseSidepanelAnimation = () => {\n if (!sidepanel.value || !sidepanel.value.open) {\n return;\n }\n isClosing.value = true;\n };\n\n const closeSidepanelOnClickOutside = () => {\n if (props.isDismissible) {\n startCloseSidepanelAnimation();\n }\n };\n\n // TODO: Remove in upcoming major. See properties `hideCloseButton` and `isDismissible`.\n const computedHideCloseButton = computed(() => {\n if (props.hideCloseButton !== null) {\n return props.hideCloseButton;\n }\n\n return !props.isDismissible;\n });\n\n onMounted(() => {\n isMounted.value = true;\n });\n\n onUnmounted(() => {\n isMounted.value = false;\n });\n\n // Watching isOpen prop to toggle open/close the dialog element\n watch(\n [() => isOpen.value, sidepanel],\n ([newIsOpen, newSidepanelValue]) => {\n if (!isMounted.value || !newSidepanelValue) {\n return;\n }\n\n if (newIsOpen) {\n internalIsOpen.value = true;\n if (!newSidepanelValue.open) {\n newSidepanelValue.showModal();\n }\n if (!previousPages.value.length) {\n previousPages.value.push(activePage.value);\n }\n } else if (newSidepanelValue.open) {\n startCloseSidepanelAnimation();\n }\n },\n { immediate: true, flush: 'post' }\n );\n\n // Pages\n const updatePage = page => emit(BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, page);\n\n // unregister page if removed / destroyed\n const unregisterPage = (pageIdToRemove: string) => () => {\n pages.value = pages.value?.filter(pageId => pageId !== pageIdToRemove);\n };\n\n // Provide data and function to register page to subcomponent\n const registerPage: BentoDialogPageRegisterPage = pageId => {\n pages.value.push(pageId);\n\n return { unregisterPage: unregisterPage(pageId) };\n };\n\n provide<BentoDialogPageConfigData>(DIALOG_PAGE_CONFIG_INJECTION_KEY, {\n activePage,\n animation,\n isAnimationActive,\n isOpen: internalIsOpen,\n pages,\n previousPages,\n updatePage,\n });\n provide(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY, registerPage);\n\n // Let's Children components know they are inside a SidePanel (dialog element)\n provide(SIDEPANEL_DIALOG_ID_INJECTION_KEY, sidepanelId);\n\n if (!props.isDismissible && props.hideCloseButton === null) {\n deprecate(\n 'BentoSidepanel \"isDismissible\" property’s behavior',\n 'BentoSidepanel \"isDismissible\" will no longer hide the close button. Use \"hideCloseButton=true\" instead.',\n '3.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Sidepanel component is a slide-in panel that should be used for presenting actions, settings or features that are directly associated with a specific task or interaction on the main screen.\n *\n * @example\n * import { BentoSidepanel, BentoSidepanelPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSidepanel, BentoSidepanelPage },\n * template: `\n * <bento-sidepanel active-page='step1' is-open='true'>\n * <bento-sidepanel-page\n * title='Step 1'\n * pageId='step1'\n * :actions=\"[\n * {\n * title: 'Next step',\n * event: () => {\n * activePage.value = 'step2';\n * },\n * }]\">\n * Step 1 info\n * </bento-sidepanel-page>\n * <bento-sidepanel-page\n * title='Step 2'\n * pageId='step2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Step 2 info\n * </bento-sidepanel-page>\n * </bento-sidepanel>\n * `\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-sidepanel',\n };\n</script>\n<style lang=\"scss\" scoped src=\"./sidepanel.scss\" />\n"],"names":["__default__$1","BentoSidepanelEvent","BentoSidepanelEvent2","__default__","messages","activePage","isOpen","toRefs","props","t","useI18n","sidepanel","ref","pages","previousPages","animation","BentoDialogPageAnimation","isClosing","sidepanelId","generateUid","internalIsOpen","isAnimationActive","isMounted","conditionalClasses","computed","closeSidepanelAfterAnimation","emit","startCloseSidepanelAnimation","closeSidepanelOnClickOutside","computedHideCloseButton","onMounted","onUnmounted","watch","newIsOpen","newSidepanelValue","updatePage","page","unregisterPage","pageIdToRemove","pageId","registerPage","provide","DIALOG_PAGE_CONFIG_INJECTION_KEY","DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY","SIDEPANEL_DIALOG_ID_INJECTION_KEY","deprecate"],"mappings":";;;;;;;;;;;;;;AA2II,MAAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3IG,IAAAC,IAAA,kBAAAC,OACHA,EAAA,qBAAA,sBACAA,EAAA,iBAAA,kBAFQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;;GC4PRE,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,GAAA;AAAA,EACM,MAAA;AAErB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAnKA,EAAA,YAAAC,GAAA,QAAAC,EAAA,IAAAC,EAAAC,CAAA,GACA,EAAA,GAAAC,EAAA,IAAAC,EAAA,GACAC,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,CAAA,CAAA,GACAE,IAAAF,EAAA,CAAA,CAAA,GACAG,IAAAH,EAAAI,EAAA,uBAAA,GACAC,IAAAL,EAAA,EAAA,GACAM,IAAAC,EAAA,WAAA,GACAC,IAAAR,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AC,MAAA,MAAA;AACI,MAAAzB,EAAA,QAAAA,EAAA,OAAA,OAAA,CAAA0B,MAAAA,MAAAD,CAAA;AAAA,IAAqE,GAIzEE,IAAA,CAAAD,OACI1B,EAAA,MAAA,KAAA0B,CAAA,GAEA,EAAA,gBAAAF,EAAAE,CAAA,EAAA;AAGJ,WAAAE,EAAAC,GAAA;AAAA,MAAqE,YAAArC;AAAA,MACjE,WAAAU;AAAA,MACA,mBAAAM;AAAA,MACA,QAAAD;AAAA,MACQ,OAAAP;AAAA,MACR,eAAAC;AAAA,MACA,YAAAqB;AAAA,IACA,CAAA,GAEJM,EAAAE,GAAAH,CAAA,GAGAC,EAAAG,GAAA1B,CAAA,GAEA,CAAAV,EAAA,iBAAAA,EAAA,oBAAA,QACIqC;AAAA,MAAA;AAAA,MACI;AAAA,MACA;AAAA,IACA;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as r, computed as o } from "vue";
|
|
2
|
-
import { B as e } from "./typography.
|
|
2
|
+
import { B as e } from "./typography.Cd386LC_.js";
|
|
3
3
|
import { n as _ } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
4
4
|
import "../assets/status.css";
|
|
5
5
|
const i = {
|
|
@@ -31,4 +31,4 @@ const v = u.exports;
|
|
|
31
31
|
export {
|
|
32
32
|
v as B
|
|
33
33
|
};
|
|
34
|
-
//# sourceMappingURL=status.
|
|
34
|
+
//# sourceMappingURL=status.BdWYs5MK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.
|
|
1
|
+
{"version":3,"file":"status.BdWYs5MK.js","sources":["../../src/components/status/status.vue"],"sourcesContent":["<template>\n <div class=\"b-status\" role=\"status\">\n <div class=\"b-status__indicator-wrapper\">\n <span class=\"b-status__indicator\" :class=\"conditionalClass\" role=\"presentation\"></span>\n </div>\n <bento-typography class=\"b-status__label\" el=\"span\" variant=\"body\">\n <slot></slot>\n </bento-typography>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { type BentoStatusProps } from './status.types';\n\n const props = defineProps({\n variant: null\n});\n\n const conditionalClass = computed(() => ({\n [`b-status__indicator--${props.variant}`]: true,\n }));\n</script>\n\n<script lang=\"ts\">\n /**\n * A Status component is used to indicate a\n * passage of time or a particular step of a process.\n *\n * @example\n * import { BentoStatus } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStatus },\n * template: `\n * <bento-status variant=\"red\">\n * 1 week ago\n * </bento-status>\n * `\n * }\n */\n export default {\n name: 'bento-status',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./status.scss\" />\n"],"names":["__default__","conditionalClass","computed","props"],"mappings":";;;;AA0CI,MAAAA,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;iBAxBAC,IAAAC,EAAA,OAAA;AAAA,MAAyC,CAAA,wBAAAC,EAAA,OAAA,EAAA,GAAA;AAAA,IACM,EAAA;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.types.Dx8MDhEH.js","sources":["../../src/components/status/status.types.ts"],"sourcesContent":["/**\n * @deprecated Since
|
|
1
|
+
{"version":3,"file":"status.types.Dx8MDhEH.js","sources":["../../src/components/status/status.types.ts"],"sourcesContent":["/**\n * @deprecated Since v3.0.0. Use string literal instead.\n */\nexport enum BentoStatusVariant {\n BLUE = 'blue',\n GREEN = 'green',\n GREY = 'grey',\n ORANGE = 'orange',\n RED = 'red',\n YELLOW = 'yellow',\n}\n\nexport interface BentoStatusProps {\n /**\n * Defines the type and color of the Status\n */\n variant: BentoStatusVariant | `${BentoStatusVariant}`;\n}\n"],"names":["BentoStatusVariant"],"mappings":"AAGO,IAAKA,sBAAAA,OACRA,EAAA,OAAO,QACPA,EAAA,QAAQ,SACRA,EAAA,OAAO,QACPA,EAAA,SAAS,UACTA,EAAA,MAAM,OACNA,EAAA,SAAS,UANDA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as L, ref as l, computed as o, watch as h, provide as k, readonly as K, useSlots as W, inject as U, onMounted as Z, onBeforeUnmount as j } from "vue";
|
|
2
|
-
import { B as $ } from "./typography.
|
|
2
|
+
import { B as $ } from "./typography.Cd386LC_.js";
|
|
3
3
|
import { u as G } from "./index.CPOlyau9.js";
|
|
4
4
|
import { B as R, a as M } from "./keyboard-navigation.DWmhelVv.js";
|
|
5
5
|
import { n as w } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
6
|
-
import { B as J } from "./base-button.
|
|
6
|
+
import { B as J } from "./base-button.DYroENBg.js";
|
|
7
7
|
import { C as X } from "./checkmark-small.BlvuuCsU.js";
|
|
8
8
|
import { D as q } from "./dot.BzjMWDGe.js";
|
|
9
9
|
import "../assets/step.css";
|
|
@@ -53,7 +53,7 @@ const ee = {
|
|
|
53
53
|
"zh-CN": { step: "步骤 {currentIndex}/{totalSteps} {content}" }
|
|
54
54
|
}, te = {
|
|
55
55
|
i18n: { messages: ee },
|
|
56
|
-
name: "stepper"
|
|
56
|
+
name: "bento-stepper"
|
|
57
57
|
}, se = /* @__PURE__ */ L({
|
|
58
58
|
...te,
|
|
59
59
|
props: {
|
|
@@ -124,7 +124,7 @@ var ne = function() {
|
|
|
124
124
|
ae,
|
|
125
125
|
!1,
|
|
126
126
|
null,
|
|
127
|
-
"
|
|
127
|
+
"adc2da4f"
|
|
128
128
|
);
|
|
129
129
|
const xe = oe.exports, re = {
|
|
130
130
|
name: "step"
|
|
@@ -218,4 +218,4 @@ export {
|
|
|
218
218
|
V as b,
|
|
219
219
|
Ie as s
|
|
220
220
|
};
|
|
221
|
-
//# sourceMappingURL=step.
|
|
221
|
+
//# sourceMappingURL=step.SkRHgSxN.js.map
|