@adyen/bento-vue2 2.0.1 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-row.
|
|
1
|
+
{"version":3,"file":"layout-row.DYx7F4cb.js","sources":["../../src/components/layout/layout.keys.ts","../../src/components/layout/layout.vue","../../src/components/layout/layout.internal.types.ts","../../src/components/layout/components/layout-row/layout-row.vue"],"sourcesContent":["export const LAYOUT_SIZE_INJECTION_KEY = Symbol('Layout size inject key');\n","<template>\n <component :is=\"wrapperElement\" class=\"b-layout\" :class=\"conditionalClasses\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, provide, toRef } from 'vue';\n import { type BentoLayoutProps } from './layout.types';\n import { LAYOUT_SIZE_INJECTION_KEY } from '@/components/layout/layout.keys';\n\n const props = defineProps({\n variant: { default: 'page' },\n size: { default: 'full-width' }\n});\n\n provide(LAYOUT_SIZE_INJECTION_KEY, toRef(props, 'size'));\n\n const conditionalClasses = computed(() => ({\n 'b-layout--component': props.variant === 'component',\n }));\n\n const wrapperElement = props.variant === 'page' ? 'main' : 'div';\n</script>\n\n<script lang=\"ts\">\n /**\n * Layout is a basic scaffolding of a page that defines spacing, some functionality and responsive behavior of its top level sections.\n *\n * @example\n * import { BentoLayout, BentoLayoutRow } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoLayout, BentoLayoutRow },\n * template: `\n * <bento-layout size=\"narrow\">\n * <bento-layout-row>\n * Row 1\n * </bento-layout-row>\n * <bento-layout-row>\n * Row 2\n * </bento-layout-row>\n * </bento-layout>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./layout.scss\" />\n","export const BentoLayoutVariantOptions = ['page', 'component'] as const;\nexport const BentoLayoutSizeOptions = ['full-width', 'narrow', 'half-width'] as const;\nexport const BentoLayoutRowColumnLayoutOptions = ['3-9', '9-3', '4-8', '8-4', '6-6'] as const;\n","<template>\n <bento-typography el=\"div\" class=\"b-layout-row\" :class=\"conditionalRowClass\">\n <div v-if=\"hasSlot('default')\" class=\"b-layout-row__wrapper\">\n <slot />\n </div>\n <div v-else-if=\"hasSlot('col-1') && hasSlot('col-2')\" ref=\"row\" :class=\"conditionalRowWithColumnsClass\">\n <div ref=\"col1\" :class=\"conditionalColumnClass.col1\">\n <slot name=\"col-1\"></slot>\n </div>\n <div ref=\"col2\" :class=\"conditionalColumnClass.col2\">\n <slot name=\"col-2\"></slot>\n </div>\n </div>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, nextTick, onMounted, ref, type Ref, useSlots, watch } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n import { BentoLayoutRowColumnLayoutOptions } from '../../layout.internal.types';\n import { type BentoLayoutRowProps, type BentoLayoutSize } from '../../layout.types';\n import { useMediaQuery } from '@vueuse/core';\n\n import { LAYOUT_SIZE_INJECTION_KEY } from '@/components/layout/layout.keys';\n\n const props = defineProps({\n columnsLayout: { default: '6-6' },\n fullHeight: { type: Boolean, default: false }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const size = inject<Ref<BentoLayoutSize>>(LAYOUT_SIZE_INJECTION_KEY, ref('full-width'));\n\n const row = ref<HTMLElement>(null);\n const col1 = ref<HTMLElement>(null);\n const col2 = ref<HTMLElement>(null);\n\n const isFullWidth = computed(() => size.value === 'full-width');\n const isValidColumnLayout = computed(() => BentoLayoutRowColumnLayoutOptions.includes(props.columnsLayout));\n\n const conditionalRowClass = computed(() => ({\n [`b-layout-row--${size.value}`]: true,\n 'b-layout-row--full-height': props.fullHeight,\n }));\n\n const conditionalRowWithColumnsClass = computed(() => ({\n 'b-layout-row__column-wrapper': isFullWidth.value,\n }));\n\n const conditionalColumnClass = computed(() => {\n const columns = isValidColumnLayout.value ? props.columnsLayout.split('-') : [6, 6];\n const getColumnModifier = index => (isFullWidth.value ? columns[index] : size.value);\n\n return {\n col1: `b-layout-row__column--${getColumnModifier(0)}`,\n col2: `b-layout-row__column--${getColumnModifier(1)}`,\n };\n });\n\n watch(\n useMediaQuery('(min-width: 768px)'),\n async isLargeScreen => {\n await nextTick();\n const areColumnsInTheRightOrder = row.value?.firstChild === col1.value;\n if (isLargeScreen && !areColumnsInTheRightOrder) {\n row.value?.prepend(col1.value);\n } else if (!isLargeScreen && (props.columnsLayout === '3-9' || props.columnsLayout === '4-8')) {\n row.value?.prepend(col2.value);\n }\n },\n { immediate: true }\n );\n\n onMounted(() => {\n if (!isFullWidth.value && (hasSlot('col-1') || hasSlot('col-2'))) {\n throw new Error(\n 'Column slots can only be used with the `full-width` size. Please check documentation for more info.'\n );\n }\n\n if (!isValidColumnLayout.value) {\n throw new Error(\n `${props.columnsLayout} is not a valid column layout. Please refer to the documentation for the list of available column layouts.`\n );\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Page row is subcomponent of Layout meant to be used to generate the row layout.\n *\n * @example\n * import { BentoLayout, BentoLayoutRow } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoLayout, BentoLayoutRow },\n * template: `\n * <bento-layout>\n * <bento-layout-row columns-layout=\"3-9\">\n * <template #col-1>Narrow 3-9</template>\n * <template #col-2>Wide 3-9</template>\n * </bento-layout-row>\n * <bento-layout-row>\n * <template #col-1>6-6</template>\n * <template #col-2>6-6</template>\n * </bento-layout-row>\n * </bento-layout>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./layout-row.scss\" />\n"],"names":["LAYOUT_SIZE_INJECTION_KEY","__default__$1","provide","toRef","props","conditionalClasses","computed","wrapperElement","BentoLayoutRowColumnLayoutOptions","__default__","slots","useSlots","hasSlot","useHasSlot","size","inject","ref","row","col1","col2","isFullWidth","isValidColumnLayout","conditionalRowClass","conditionalRowWithColumnsClass","conditionalColumnClass","columns","getColumnModifier","index","watch","useMediaQuery","isLargeScreen","nextTick","areColumnsInTheRightOrder","onMounted"],"mappings":";;;;;;AAAO,MAAAA,IAAA,uBAAA,wBAAA,GC8CHC,IAAA,CAAA;;;;;;;;;AA9BA,IAAAC,EAAAF,GAAAG,EAAAC,GAAA,MAAA,CAAA;AAEA,UAAAC,IAAAC,EAAA,OAAA;AAAA,MAA2C,uBAAAF,EAAA,YAAA;AAAA,IACE,EAAA,GAG7CG,IAAAH,EAAA,YAAA,SAAA,SAAA;;;;;;;;;;;;;;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AA;AACI,UAAA,CAAAb,EAAA,UAAAR,EAAA,OAAA,KAAAA,EAAA,OAAA;AACI,cAAA,IAAA;AAAA,UAAU;AAAA,QACN;AAIR,UAAA,CAAAS,EAAA;AACI,cAAA,IAAA;AAAA,UAAU,GAAAjB,EAAA,aAAA;AAAA,QACgB;AAAA,IAE9B,CAAA;;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getCurrentInstance as b, defineComponent as v, computed as r } from "vue";
|
|
2
2
|
import { RouterLink as g } from "vue-router";
|
|
3
3
|
import { g as m } from "./generate-uid.DBWe4g6T.js";
|
|
4
|
-
import { B as y } from "./typography.
|
|
4
|
+
import { B as y } from "./typography.Cd386LC_.js";
|
|
5
5
|
import { u as T } from "./index.CPOlyau9.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
import { n as p } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
@@ -101,4 +101,4 @@ export {
|
|
|
101
101
|
w as E,
|
|
102
102
|
s as a
|
|
103
103
|
};
|
|
104
|
-
//# sourceMappingURL=link.
|
|
104
|
+
//# sourceMappingURL=link.iNnolG9W.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.Cls8XShm.js","sources":["../../src/components/link/link.types.ts","../../../ui-assets/icons-16/dist/vue/external-link.vue","../../src/components/link/link.vue"],"sourcesContent":["import type { Location } from 'vue-router/types/router.d.ts';\n// TODO: revert to import once fully migrated to Vue 3\n// import type { RouterLinkProps } from 'vue-router/types/router.d.ts';\n\n/**\n * Manually defined RouterLinkProps to ensure compatibility\n * with Vue Macros and Vue 2.7 / 3 monorepos.\n */\nexport interface RouterLinkProps {\n /**\n * Denotes the target route of the link. When clicked, the value of the `to` prop will be passed to\n * `router.push()` internally, so the value can be either a string or a location descriptor object.\n */\n to: string | Location;\n /**\n * Setting `replace` prop will call `router.replace()` instead of `router.push()` when clicked, so the navigation will\n * not create a new history record.\n *\n * @default false\n */\n replace?: boolean;\n /**\n * Setting `append` prop always appends the relative path to the current path. For example, assuming we are navigating\n * from `/a` to a relative link `b`, without `append` we will end up at `/b`, but with append we will end up at\n * `/a/b`.\n *\n * @default false\n */\n append?: boolean;\n /**\n * Sometimes we want <RouterLink> to render as another tag, e.g <li>. Then we can use tag prop to specify which tag to\n * render to, and it will still listen to click events for navigation.\n *\n * @default \"a\"\n */\n tag?: string;\n /**\n * Configure the active CSS class applied when the link is active. Note the default value can also be configured\n * globally via the `linkActiveClass` router constructor option.\n *\n * @default \"router-link-active\"\n */\n activeClass?: string;\n /**\n * The default active class matching behavior is **inclusive match**. For example, `<RouterLink to=\"/a\">` will get\n * this class applied as long as the current path starts with `/a/` or is `/a`.\n *\n * @default false\n */\n exact?: boolean;\n /**\n * Allows matching only using the `path` section of the url, effectively ignoring the `query` and the `hash` sections.\n *\n * @default false\n */\n exactPath?: boolean;\n /**\n * Configure the active CSS class applied when the link is active with exact path match. Note the default value can\n * also be configured globally via the `linkExactPathActiveClass` router constructor option.\n *\n * @default \"router-link-exact-path-active\"\n */\n exactPathActiveClass?: string;\n\n /**\n * Specify the event(s) that can trigger the link navigation.\n *\n * @default 'click'\n */\n event?: string | ReadonlyArray<string>;\n /**\n * Configure the active CSS class applied when the link is active with exact match. Note the default value can also be\n * configured globally via the `linkExactActiveClass` router constructor option.\n *\n * @default \"router-link-exact-active\"\n */\n exactActiveClass?: string;\n /**\n * Configure the value of `aria-current` when the link is active with exact match. It must be one of the allowed\n * values for [aria-current](https://www.w3.org/TR/wai-aria-1.2/#aria-current) in the ARIA spec. In most cases, the\n * default of page should be the best fit.\n *\n * @default \"page\"\n */\n ariaCurrentValue?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false';\n}\n\n/**\n * @deprecated Since v2.0.0. Use string literal instead.\n */\nexport enum BentoLinkVariant {\n DEFAULT = 'default',\n QUIET = 'quiet',\n}\n\nexport interface LinkProps {\n /**\n * Disable the default typography for the component. Only use this when the component is inside another typography component.\n */\n disableTypography?: boolean;\n\n /**\n * Set the rendered link to a regular external anchor link and renders an external link icon.\n */\n external?: boolean;\n\n /**\n * Set to true if used inside a `BentoButton` component.\n */\n isButton?: boolean;\n\n /**\n * Set the rendered link to a regular external anchor link.\n */\n isNotRouting?: boolean;\n\n /**\n * Sets the target of the rendered link.\n */\n target?: string;\n\n /**\n * Set to true to truncate link. Doesn't work with disableTypography.\n */\n truncate?: boolean;\n\n /**\n * Link variant type affecting visual style.\n * @values default, quiet\n */\n variant?: BentoLinkVariant | `${BentoLinkVariant}`;\n}\n\nexport type BentoLinkProps = RouterLinkProps & LinkProps;\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#001222\" d=\"M2.93933 11.9999L10.1893 4.74989H5.24999V3.24989H12.75V10.7499H11.25V5.81055L3.99999 13.0605L2.93933 11.9999Z\"/></svg>\n</template>\n<script setup>\n import { getCurrentInstance } from 'vue';\n import '../css/main.css';\n\n const instance = getCurrentInstance();\n const uuid = String(instance?.uid ?? instance?.proxy?._uid);\n</script>\n","<template>\n <a\n v-if=\"external || isNotRouting\"\n :class=\"conditionalClasses\"\n v-bind=\"$attrs\"\n :aria-describedby=\"external ? externalLinkId : null\"\n :href=\"$props.to.toString()\"\n :title=\"getAttributeTitle($attrs.title)\"\n :target=\"computedTarget\"\n @click=\"onClick\"\n >\n <bento-typography v-if=\"!disableTypography\" class=\"b-link__text\" el=\"span\" variant=\"body\">\n <slot />\n </bento-typography>\n <slot v-else />\n <span v-if=\"showExternalLinkIcon\" aria-hidden=\"true\" class=\"b-link__external-link-icon\">\n <external-link-icon />\n </span>\n <span v-if=\"external\" :id=\"externalLinkId\" class=\"b-link--visually-hidden\">{{ t('opensInNewTab') }}</span>\n </a>\n <router-link\n v-else\n v-bind=\"{ ...$attrs, ...$props, ...nonForwardedProps }\"\n :class=\"conditionalClasses\"\n :target=\"target\"\n :to=\"props.to\"\n custom\n @click.native=\"onClick\"\n >\n <bento-typography v-if=\"!disableTypography\" class=\"b-link__text\" el=\"span\" variant=\"body\">\n <slot />\n </bento-typography>\n <slot v-else />\n </router-link>\n</template>\n\n<script setup lang=\"ts\">\n import { RouterLink } from 'vue-router';\n import { computed } from 'vue';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { BentoTypography } from '@/components/typography';\n import { type BentoLinkProps, BentoLinkVariant } from './link.types';\n import { useI18n } from '@/utils/ts/i18n';\n import type { RouterLinkSlotArgument } from 'vue-router/types/router.d.ts';\n import ExternalLinkIcon from '@adyen/ui-assets-icons-16/vue/external-link';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = defineProps({\n to: null,\n replace: { type: Boolean },\n append: { type: Boolean },\n tag: null,\n activeClass: null,\n exact: { type: Boolean },\n exactPath: { type: Boolean },\n exactPathActiveClass: null,\n event: null,\n exactActiveClass: null,\n ariaCurrentValue: null,\n disableTypography: { type: Boolean },\n external: { type: Boolean },\n isButton: { type: Boolean },\n isNotRouting: { type: Boolean },\n target: { default: null },\n truncate: { type: Boolean },\n variant: { default: BentoLinkVariant.DEFAULT }\n});\n\n // Props that should not be forwarded to the underlying anchor element\n const nonForwardedProps = {\n variant: undefined,\n isButton: undefined,\n truncate: undefined,\n disableTypography: undefined,\n external: undefined,\n isNotRouting: undefined,\n };\n\n const externalLinkId = generateUid('external-link');\n\n const getAttributeTitle = (attributesTitle: unknown) => attributesTitle as string;\n\n const conditionalClasses = computed(() => ({\n 'b-link': !props.isButton,\n [`b-link--${BentoLinkVariant.QUIET}`]: props.variant === BentoLinkVariant.QUIET,\n [`b-link--truncate`]: props.truncate,\n }));\n\n const computedTarget = computed(() => (props.external ? (props.target ?? '_blank') : props.target));\n const showExternalLinkIcon = computed(() => !(props.isButton || props.isNotRouting));\n\n const emit = defineEmits([\"click\"]);\n\n const onClick = (e: MouseEvent, navigateCallback?: RouterLinkSlotArgument['navigate']) => {\n emit('click', e);\n if (navigateCallback) {\n navigateCallback();\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Extends the `router-link` from the `vue-router` NPM package.\n *\n * @example\n * import { BentoLink } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoLink },\n * template: `\n * <bento-link to=\"/\">\n * link\n * </bento-link>\n * `\n * }\n */\n export default {\n name: 'bento-link',\n inheritAttrs: false,\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./link.scss\" />\n"],"names":["BentoLinkVariant","BentoLinkVariant2","instance","getCurrentInstance","uuid","__default__","messages","t","useI18n","nonForwardedProps","externalLinkId","generateUid","getAttributeTitle","attributesTitle","conditionalClasses","computed","props","computedTarget","showExternalLinkIcon","e","navigateCallback","emit"],"mappings":";;;;;;;;AA0FO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,UAAA,WACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;;;;ACrFZ,UAAAE,IAAAC,EAAA,GAIAC,IAAA,OAAAF,GAAA,OAAAA,GAAA,OAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GCgHIG,IAAA;AAAA,EAAe,MAAA;AAAA,EACL,cAAA;AAAA,EACQ,MAAA,EAAA,UAAAC,EAAA;AAElB;;;;;;;;;;;;;;;;;;;;;;;;iBA5EA,EAAA,GAAAC,EAAA,IAAAC,EAAA,GAwBAC,IAAA;AAAA,MAA0B,SAAA;AAAA,MACb,UAAA;AAAA,MACC,UAAA;AAAA,MACA,mBAAA;AAAA,MACS,UAAA;AAAA,MACT,cAAA;AAAA,IACI,GAGlBC,IAAAC,EAAA,eAAA,GAEAC,IAAA,CAAAC,MAAAA,GAEAC,IAAAC,EAAA,OAAA;AAAA,MAA2C,UAAA,CAAAC,EAAA;AAAA,MACtB,CAAA,WAAAhB,EAAA,KAAA,EAAA,GAAAgB,EAAA,YAAAhB,EAAA;AAAA,MACyD,oBAAAgB,EAAA;AAAA,IAC9C,EAAA,GAGhCC,IAAAF,EAAA,MAAAC,EAAA,WAAAA,EAAA,UAAA,WAAAA,EAAA,MAAA,GACAE,IAAAH,EAAA,MAAA,EAAAC,EAAA,YAAAA,EAAA,aAAA;4LAIA,CAAAG,GAAAC,MAAA;AACI,MAAAC,EAAA,SAAAF,CAAA,GACAC,KACIA,EAAA;AAAA,IACJ;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"link.iNnolG9W.js","sources":["../../src/components/link/link.types.ts","../../../ui-assets/icons-16/dist/vue/external-link.vue","../../src/components/link/link.vue"],"sourcesContent":["import type { Location } from 'vue-router/types/router.d.ts';\n// TODO: revert to import once fully migrated to Vue 3\n// import type { RouterLinkProps } from 'vue-router/types/router.d.ts';\n\n/**\n * Manually defined RouterLinkProps to ensure compatibility\n * with Vue Macros and Vue 2.7 / 3 monorepos.\n */\nexport interface RouterLinkProps {\n /**\n * Denotes the target route of the link. When clicked, the value of the `to` prop will be passed to\n * `router.push()` internally, so the value can be either a string or a location descriptor object.\n */\n to: string | Location;\n /**\n * Setting `replace` prop will call `router.replace()` instead of `router.push()` when clicked, so the navigation will\n * not create a new history record.\n *\n * @default false\n */\n replace?: boolean;\n /**\n * Setting `append` prop always appends the relative path to the current path. For example, assuming we are navigating\n * from `/a` to a relative link `b`, without `append` we will end up at `/b`, but with append we will end up at\n * `/a/b`.\n *\n * @default false\n */\n append?: boolean;\n /**\n * Sometimes we want <RouterLink> to render as another tag, e.g <li>. Then we can use tag prop to specify which tag to\n * render to, and it will still listen to click events for navigation.\n *\n * @default \"a\"\n */\n tag?: string;\n /**\n * Configure the active CSS class applied when the link is active. Note the default value can also be configured\n * globally via the `linkActiveClass` router constructor option.\n *\n * @default \"router-link-active\"\n */\n activeClass?: string;\n /**\n * The default active class matching behavior is **inclusive match**. For example, `<RouterLink to=\"/a\">` will get\n * this class applied as long as the current path starts with `/a/` or is `/a`.\n *\n * @default false\n */\n exact?: boolean;\n /**\n * Allows matching only using the `path` section of the url, effectively ignoring the `query` and the `hash` sections.\n *\n * @default false\n */\n exactPath?: boolean;\n /**\n * Configure the active CSS class applied when the link is active with exact path match. Note the default value can\n * also be configured globally via the `linkExactPathActiveClass` router constructor option.\n *\n * @default \"router-link-exact-path-active\"\n */\n exactPathActiveClass?: string;\n\n /**\n * Specify the event(s) that can trigger the link navigation.\n *\n * @default 'click'\n */\n event?: string | ReadonlyArray<string>;\n /**\n * Configure the active CSS class applied when the link is active with exact match. Note the default value can also be\n * configured globally via the `linkExactActiveClass` router constructor option.\n *\n * @default \"router-link-exact-active\"\n */\n exactActiveClass?: string;\n /**\n * Configure the value of `aria-current` when the link is active with exact match. It must be one of the allowed\n * values for [aria-current](https://www.w3.org/TR/wai-aria-1.2/#aria-current) in the ARIA spec. In most cases, the\n * default of page should be the best fit.\n *\n * @default \"page\"\n */\n ariaCurrentValue?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false';\n}\n\n/**\n * @deprecated Since v3.0.0. Use string literal instead.\n */\nexport enum BentoLinkVariant {\n DEFAULT = 'default',\n QUIET = 'quiet',\n}\n\nexport interface LinkProps {\n /**\n * Disable the default typography for the component. Only use this when the component is inside another typography component.\n */\n disableTypography?: boolean;\n\n /**\n * Set the rendered link to a regular external anchor link and renders an external link icon.\n */\n external?: boolean;\n\n /**\n * Set to true if used inside a `BentoButton` component.\n */\n isButton?: boolean;\n\n /**\n * Set the rendered link to a regular external anchor link.\n */\n isNotRouting?: boolean;\n\n /**\n * Sets the target of the rendered link.\n */\n target?: string;\n\n /**\n * Set to true to truncate link. Doesn't work with disableTypography.\n */\n truncate?: boolean;\n\n /**\n * Link variant type affecting visual style.\n * @values default, quiet\n */\n variant?: BentoLinkVariant | `${BentoLinkVariant}`;\n}\n\nexport type BentoLinkProps = RouterLinkProps & LinkProps;\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#001222\" d=\"M2.93933 11.9999L10.1893 4.74989H5.24999V3.24989H12.75V10.7499H11.25V5.81055L3.99999 13.0605L2.93933 11.9999Z\"/></svg>\n</template>\n<script setup>\n import { getCurrentInstance } from 'vue';\n import '../css/main.css';\n\n const instance = getCurrentInstance();\n const uuid = String(instance?.uid ?? instance?.proxy?._uid);\n</script>\n","<template>\n <a\n v-if=\"external || isNotRouting\"\n :class=\"conditionalClasses\"\n v-bind=\"$attrs\"\n :aria-describedby=\"external ? externalLinkId : null\"\n :href=\"$props.to.toString()\"\n :title=\"getAttributeTitle($attrs.title)\"\n :target=\"computedTarget\"\n @click=\"onClick\"\n >\n <bento-typography v-if=\"!disableTypography\" class=\"b-link__text\" el=\"span\" variant=\"body\">\n <slot />\n </bento-typography>\n <slot v-else />\n <span v-if=\"showExternalLinkIcon\" aria-hidden=\"true\" class=\"b-link__external-link-icon\">\n <external-link-icon />\n </span>\n <span v-if=\"external\" :id=\"externalLinkId\" class=\"b-link--visually-hidden\">{{ t('opensInNewTab') }}</span>\n </a>\n <router-link\n v-else\n v-bind=\"{ ...$attrs, ...$props, ...nonForwardedProps }\"\n :class=\"conditionalClasses\"\n :target=\"target\"\n :to=\"props.to\"\n custom\n @click.native=\"onClick\"\n >\n <bento-typography v-if=\"!disableTypography\" class=\"b-link__text\" el=\"span\" variant=\"body\">\n <slot />\n </bento-typography>\n <slot v-else />\n </router-link>\n</template>\n\n<script setup lang=\"ts\">\n import { RouterLink } from 'vue-router';\n import { computed } from 'vue';\n import { generateUid } from '@/utils/ts/generate-uid';\n import { BentoTypography } from '@/components/typography';\n import { type BentoLinkProps, BentoLinkVariant } from './link.types';\n import { useI18n } from '@/utils/ts/i18n';\n import type { RouterLinkSlotArgument } from 'vue-router/types/router.d.ts';\n import ExternalLinkIcon from '@adyen/ui-assets-icons-16/vue/external-link';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = defineProps({\n to: null,\n replace: { type: Boolean },\n append: { type: Boolean },\n tag: null,\n activeClass: null,\n exact: { type: Boolean },\n exactPath: { type: Boolean },\n exactPathActiveClass: null,\n event: null,\n exactActiveClass: null,\n ariaCurrentValue: null,\n disableTypography: { type: Boolean },\n external: { type: Boolean },\n isButton: { type: Boolean },\n isNotRouting: { type: Boolean },\n target: { default: null },\n truncate: { type: Boolean },\n variant: { default: BentoLinkVariant.DEFAULT }\n});\n\n // Props that should not be forwarded to the underlying anchor element\n const nonForwardedProps = {\n variant: undefined,\n isButton: undefined,\n truncate: undefined,\n disableTypography: undefined,\n external: undefined,\n isNotRouting: undefined,\n };\n\n const externalLinkId = generateUid('external-link');\n\n const getAttributeTitle = (attributesTitle: unknown) => attributesTitle as string;\n\n const conditionalClasses = computed(() => ({\n 'b-link': !props.isButton,\n [`b-link--${BentoLinkVariant.QUIET}`]: props.variant === BentoLinkVariant.QUIET,\n [`b-link--truncate`]: props.truncate,\n }));\n\n const computedTarget = computed(() => (props.external ? (props.target ?? '_blank') : props.target));\n const showExternalLinkIcon = computed(() => !(props.isButton || props.isNotRouting));\n\n const emit = defineEmits([\"click\"]);\n\n const onClick = (e: MouseEvent, navigateCallback?: RouterLinkSlotArgument['navigate']) => {\n emit('click', e);\n if (navigateCallback) {\n navigateCallback();\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Extends the `router-link` from the `vue-router` NPM package.\n *\n * @example\n * import { BentoLink } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoLink },\n * template: `\n * <bento-link to=\"/\">\n * link\n * </bento-link>\n * `\n * }\n */\n export default {\n name: 'bento-link',\n inheritAttrs: false,\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./link.scss\" />\n"],"names":["BentoLinkVariant","BentoLinkVariant2","instance","getCurrentInstance","uuid","__default__","messages","t","useI18n","nonForwardedProps","externalLinkId","generateUid","getAttributeTitle","attributesTitle","conditionalClasses","computed","props","computedTarget","showExternalLinkIcon","e","navigateCallback","emit"],"mappings":";;;;;;;;AA0FO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,UAAA,WACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;;;;ACrFZ,UAAAE,IAAAC,EAAA,GAIAC,IAAA,OAAAF,GAAA,OAAAA,GAAA,OAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GCgHIG,IAAA;AAAA,EAAe,MAAA;AAAA,EACL,cAAA;AAAA,EACQ,MAAA,EAAA,UAAAC,EAAA;AAElB;;;;;;;;;;;;;;;;;;;;;;;;iBA5EA,EAAA,GAAAC,EAAA,IAAAC,EAAA,GAwBAC,IAAA;AAAA,MAA0B,SAAA;AAAA,MACb,UAAA;AAAA,MACC,UAAA;AAAA,MACA,mBAAA;AAAA,MACS,UAAA;AAAA,MACT,cAAA;AAAA,IACI,GAGlBC,IAAAC,EAAA,eAAA,GAEAC,IAAA,CAAAC,MAAAA,GAEAC,IAAAC,EAAA,OAAA;AAAA,MAA2C,UAAA,CAAAC,EAAA;AAAA,MACtB,CAAA,WAAAhB,EAAA,KAAA,EAAA,GAAAgB,EAAA,YAAAhB,EAAA;AAAA,MACyD,oBAAAgB,EAAA;AAAA,IAC9C,EAAA,GAGhCC,IAAAF,EAAA,MAAAC,EAAA,WAAAA,EAAA,UAAA,WAAAA,EAAA,MAAA,GACAE,IAAAH,EAAA,MAAA,EAAAC,EAAA,YAAAA,EAAA,aAAA;4LAIA,CAAAG,GAAAC,MAAA;AACI,MAAAC,EAAA,SAAAF,CAAA,GACAC,KACIA,EAAA;AAAA,IACJ;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineComponent as P, computed as r, ref as C, watch as L, provide as H, useSlots as F, inject as E } from "vue";
|
|
2
2
|
import { l as R } from "./index.CL3TXc0a.js";
|
|
3
|
-
import { u as k, a as U, B as A } from "./draggable-handle.
|
|
3
|
+
import { u as k, a as U, B as A } from "./draggable-handle.BM07OVdH.js";
|
|
4
4
|
import { n as D } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
5
5
|
import { C as $ } from "./chevron-right-small.zD3HHYEi.js";
|
|
6
|
-
import { B as z } from "./status.
|
|
7
|
-
import { B as N } from "./tag.
|
|
8
|
-
import { B as j } from "./typography.
|
|
6
|
+
import { B as z } from "./status.BdWYs5MK.js";
|
|
7
|
+
import { B as N } from "./tag.CgsX8v2m.js";
|
|
8
|
+
import { B as j } from "./typography.Cd386LC_.js";
|
|
9
9
|
import { u as G } from "./use-has-slot.C9lQZ6nz.js";
|
|
10
10
|
import { u as J } from "./index.CPOlyau9.js";
|
|
11
11
|
import "../assets/list-item.css";
|
|
@@ -163,4 +163,4 @@ export {
|
|
|
163
163
|
ge as a,
|
|
164
164
|
ue as l
|
|
165
165
|
};
|
|
166
|
-
//# sourceMappingURL=list-item.
|
|
166
|
+
//# sourceMappingURL=list-item.ByyA5h1d.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item.HjabBEb8.js","sources":["../../src/components/list/list.keys.ts","../../src/components/list/list.vue","../../src/components/list/components/list-item/list-item.vue"],"sourcesContent":["import type { ComputedRef } from 'vue';\nimport type { BentoDraggableDisabledMenus } from '@/components/draggable/composables/use-bento-draggable/use-bento-draggable';\n\nexport interface BentoListDraggableContext {\n isDraggable: ComputedRef<boolean>;\n moveItemUp: (element: HTMLElement | null) => void;\n moveItemDown: (element: HTMLElement | null) => void;\n moveItemTop: (element: HTMLElement | null) => void;\n moveItemBottom: (element: HTMLElement | null) => void;\n getDisabledMenus: (element: HTMLElement | null) => BentoDraggableDisabledMenus;\n}\n\nexport const BENTO_LIST_DRAGGABLE_INJECTION_KEY = Symbol('list draggable injection key');\n","<template>\n <div class=\"b-list\">\n <component :is=\"listElement\" ref=\"listRef\" v-bind=\"$attrs\" class=\"b-list__list\">\n <slot />\n </component>\n\n <div v-if=\"isDraggable\" class=\"b-list__announcement\" role=\"status\" aria-live=\"polite\">\n {{ announcementMessage }}\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { useMutationObserver } from '@vueuse/core';\n import { computed, provide, ref, watch } from 'vue';\n import { useBentoDraggable } from '@/components/draggable/composables/use-bento-draggable/use-bento-draggable';\n import { useDraggableAnnouncement } from '@/components/draggable/composables/use-draggable-announcement/use-draggable-announcement';\n import type { BentoDraggableOptions, BentoDraggableSortableEvent } from '@/components/draggable/draggable.types';\n import { BENTO_LIST_DRAGGABLE_INJECTION_KEY } from './list.keys';\n import type { BentoListDraggableContext } from './list.keys';\n import type { BentoListProps } from './list.types';\n\n // used for announcement composable\n import draggableMessages from '@/components/draggable/composables/use-draggable-announcement/messages.json';\n\n const ITEM_SELECTOR = '.b-list-item';\n\n const props = defineProps({\n type: { default: 'unordered' },\n draggable: { type: Boolean, default: false },\n draggableOptions: { default: () => ({}) }\n});\n\n const emit = defineEmits([\"reorder\"]);\n\n const listElement = computed(() => (props.type === 'ordered' ? 'ol' : 'ul'));\n const listRef = ref<HTMLElement | null>(null);\n const listItems = ref<Array<HTMLElement>>([]);\n const isDraggable = computed(() => props.draggable);\n\n const getListItems = (): Array<HTMLElement> =>\n listRef.value\n ? (Array.from(listRef.value.children).filter(child => child.matches(ITEM_SELECTOR)) as Array<HTMLElement>)\n : [];\n\n const syncListItems = () => {\n listItems.value = getListItems();\n };\n\n watch(\n listRef,\n newElement => {\n if (!newElement) {\n listItems.value = [];\n return;\n }\n\n syncListItems();\n },\n { immediate: true }\n );\n\n useMutationObserver(listRef, syncListItems, { childList: true });\n\n const getItemIndex = (el: HTMLElement | null) => (el ? listItems.value.indexOf(el) : -1);\n\n const getItemLabel = (el: HTMLElement | null, fallbackIndex: number) =>\n el?.querySelector('[data-list-item-label]')?.textContent?.trim() || `List item ${fallbackIndex + 1}`;\n\n const announceMoveAt = (fromIndex: number, toIndex: number) => {\n if (!isDraggable.value) {\n return;\n }\n\n const items = getListItems();\n announceMove({\n itemLabel: getItemLabel(items[toIndex] ?? null, toIndex),\n fromIndex,\n toIndex,\n total: items.length,\n announcement: props.draggableOptions?.dragAnnouncement,\n });\n };\n\n const moveItemDOM = (fromIndex: number, toIndex: number) => {\n const items = getListItems();\n const itemToMove = items[fromIndex];\n const targetItem = items[toIndex];\n\n if (fromIndex < toIndex) {\n listRef.value!.insertBefore(itemToMove, targetItem.nextSibling);\n } else {\n listRef.value!.insertBefore(itemToMove, targetItem);\n }\n\n syncListItems();\n announceMoveAt(fromIndex, toIndex);\n emit('reorder', { oldIndex: fromIndex, newIndex: toIndex });\n };\n\n const computedDraggableOptions = computed<BentoDraggableOptions>(() => ({\n ...props.draggableOptions,\n onSort: (event: BentoDraggableSortableEvent) => {\n syncListItems();\n if (event.oldIndex !== undefined && event.newIndex !== undefined) {\n announceMoveAt(event.oldIndex, event.newIndex);\n emit('reorder', { oldIndex: event.oldIndex, newIndex: event.newIndex });\n }\n props.draggableOptions?.onSort?.(event);\n },\n }));\n\n const { announcementMessage, announceMove } = useDraggableAnnouncement();\n\n const { moveItemUp, moveItemDown, moveItemTop, moveItemBottom, getDisabledMenus } = useBentoDraggable(\n listRef,\n computedDraggableOptions,\n {\n getItemCount: () => listItems.value.length,\n getItemIndex,\n onMoveItem: moveItemDOM,\n }\n );\n\n provide<BentoListDraggableContext>(BENTO_LIST_DRAGGABLE_INJECTION_KEY, {\n isDraggable,\n moveItemUp,\n moveItemDown,\n moveItemTop,\n moveItemBottom,\n getDisabledMenus,\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * `BentoList` renders an ordered or unordered list container for `BentoListItem` rows.\n *\n * @example\n * import { BentoList, BentoListItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoList, BentoListItem },\n * template: `\n * <bento-list>\n * <bento-list-item\n * label=\"Payment details\"\n * description=\"Updated 2 hours ago\"\n * :tag=\"{ label: 'Live', variant: 'green' }\"\n * show-bottom-divider\n * />\n * <bento-list-item\n * label=\"Risk configuration\"\n * description=\"Updated yesterday\"\n * :tag=\"{ label: 'Review', variant: 'orange' }\"\n * />\n * </bento-list>\n * `\n * }\n */\n\n export default {\n name: 'bento-list',\n inheritAttrs: false,\n i18n: { messages: draggableMessages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./list.scss\" />\n","<template>\n <li ref=\"itemRef\" class=\"b-list-item\" @click=\"onItemClick\" @keydown=\"onItemKeydown\">\n <bento-typography\n class=\"b-list-item__inner\"\n :class=\"conditionalClasses\"\n el=\"div\"\n :role=\"props.withChevron ? 'button' : undefined\"\n :tabindex=\"props.withChevron ? 0 : undefined\"\n >\n <div v-if=\"hasSlot('image')\" class=\"b-list-item__image\">\n <slot name=\"image\" />\n </div>\n\n <bento-draggable-handle\n v-if=\"showDragHandle\"\n condensed\n :label=\"dragHandleLabel\"\n :disabled-menus=\"disabledMenus\"\n :disabled=\"draggableOptions?.disabled\"\n @move-up=\"moveItemUp\"\n @move-down=\"moveItemDown\"\n @move-top=\"moveItemTop\"\n @move-bottom=\"moveItemBottom\"\n />\n\n <div v-if=\"hasSlot('start')\" class=\"b-list-item__start\">\n <slot v-if=\"hasSlot('start')\" name=\"start\" />\n </div>\n\n <div class=\"b-list-item__content\">\n <div v-if=\"hasSlot('content')\" class=\"b-list-item__label\" data-list-item-label>\n <slot name=\"content\" />\n </div>\n\n <template v-else>\n <div class=\"b-list-item__header\">\n <bento-typography\n v-if=\"props.label\"\n class=\"b-list-item__label\"\n data-list-item-label\n el=\"span\"\n stronger\n >\n {{ props.label }}\n </bento-typography>\n <bento-status\n v-if=\"props.showStatus\"\n class=\"b-list-item__status\"\n :variant=\"props.statusColor\"\n aria-hidden=\"true\"\n />\n <bento-tag v-if=\"props.tag\" v-bind=\"props.tag\" class=\"b-list-item__tag\" />\n </div>\n <span v-if=\"props.description\" class=\"b-list-item__description\">\n {{ props.description }}\n </span>\n </template>\n </div>\n\n <div v-if=\"hasSlot('end')\" class=\"b-list-item__end\">\n <slot name=\"end\" />\n </div>\n\n <chevron-right-icon v-if=\"props.withChevron\" class=\"b-list-item__chevron\" aria-hidden=\"true\" />\n </bento-typography>\n </li>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, ref, useSlots } from 'vue';\n import ChevronRightIcon from '@adyen/ui-assets-icons-16/vue/chevron-right-small';\n import { BentoDraggableHandle } from '@/components/draggable/components/draggable-handle';\n import { BentoStatus } from '@/components/status';\n import { BentoTag } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import { BENTO_LIST_DRAGGABLE_INJECTION_KEY } from '../../list.keys';\n import type { BentoListDraggableContext } from '../../list.keys';\n import type { BentoListItemProps } from './list-item.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const itemRef = ref<HTMLElement | null>(null);\n const draggableContext = inject<BentoListDraggableContext | null>(BENTO_LIST_DRAGGABLE_INJECTION_KEY, null);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = defineProps({\n label: null,\n description: null,\n draggableOptions: { default: null },\n showStatus: { type: Boolean, default: false },\n statusColor: { default: 'blue' },\n tag: { default: undefined },\n withChevron: { type: Boolean, default: false },\n showTopDivider: { type: Boolean, default: false },\n showBottomDivider: { type: Boolean, default: false }\n});\n\n const emit = defineEmits([\"click\", \"move-up\", \"move-down\", \"move-top\", \"move-bottom\"]);\n\n const onItemClick = (): void => {\n if (!props.withChevron) {\n return;\n }\n emit('click');\n };\n\n const onItemKeydown = (event: KeyboardEvent): void => {\n if (!props.withChevron) {\n return;\n }\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n emit('click');\n }\n };\n\n const conditionalClasses = computed(() => ({\n 'b-list-item__inner--clickable': props.withChevron,\n 'b-list-item__inner--top-divider': props.showTopDivider,\n 'b-list-item__inner--bottom-divider': props.showBottomDivider,\n }));\n\n const showDragHandle = computed(() => Boolean(draggableContext?.isDraggable.value));\n const dragHandleLabel = computed(() => props.draggableOptions?.label || props.label || t('listItem'));\n const disabledMenus = computed(() => {\n if (props.draggableOptions?.disabledMenus) {\n return props.draggableOptions.disabledMenus;\n }\n\n return draggableContext?.getDisabledMenus(itemRef.value);\n });\n\n const moveItemUp = () => {\n emit('move-up');\n (props.draggableOptions?.moveUp ?? (() => draggableContext?.moveItemUp(itemRef.value)))();\n };\n\n const moveItemDown = () => {\n emit('move-down');\n (props.draggableOptions?.moveDown ?? (() => draggableContext?.moveItemDown(itemRef.value)))();\n };\n\n const moveItemTop = () => {\n emit('move-top');\n (props.draggableOptions?.moveTop ?? (() => draggableContext?.moveItemTop(itemRef.value)))();\n };\n\n const moveItemBottom = () => {\n emit('move-bottom');\n (props.draggableOptions?.moveBottom ?? (() => draggableContext?.moveItemBottom(itemRef.value)))();\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * `BentoListItem` renders an item to be used inside `BentoList`.\n *\n * @example\n * import { BentoList, BentoListItem, BentoButton, BentoToggle } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoList, BentoListItem, BentoButton, BentoToggle },\n * template: `\n * <bento-list>\n * <bento-list-item\n * label=\"Payment details\"\n * description=\"Updated 2 hours ago\"\n * :tag=\"{ label: 'Live', variant: 'green' }\"\n * show-bottom-divider\n * >\n * <template #start>\n * <bento-toggle />\n * </template>\n * <template #end>\n * <bento-button variant=\"secondary\">Edit</bento-button>\n * </template>\n * </bento-list-item>\n * </bento-list>\n * `\n * }\n */\n\n export default {\n name: 'bento-list-item',\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./list-item.scss\" />\n"],"names":["BENTO_LIST_DRAGGABLE_INJECTION_KEY","__default__$1","draggableMessages","ITEM_SELECTOR","listElement","computed","props","listRef","ref","listItems","isDraggable","getListItems","child","syncListItems","watch","newElement","useMutationObserver","getItemIndex","el","getItemLabel","fallbackIndex","announceMoveAt","fromIndex","toIndex","items","announceMove","moveItemDOM","itemToMove","targetItem","emit","computedDraggableOptions","event","announcementMessage","useDraggableAnnouncement","moveItemUp","moveItemDown","moveItemTop","moveItemBottom","getDisabledMenus","useBentoDraggable","provide","__default__","messages","slots","useSlots","hasSlot","useHasSlot","itemRef","draggableContext","inject","t","useI18n","onItemClick","onItemKeydown","conditionalClasses","showDragHandle","dragHandleLabel","disabledMenus"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;GAYOA,IAAA,uBAAA,8BAAA,GCqJHC,IAAA;AAAA,EAAe,MAAA;AAAA,EACL,cAAA;AAAA,EACQ,MAAA,EAAA,UAAAC,EAAA;AAElB;;;;;;;;;iBA5IAC,IAAA,gBAUAC,IAAAC,EAAA,MAAAC,EAAA,SAAA,YAAA,OAAA,IAAA,GACAC,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,CAAA,CAAA,GACAE,IAAAL,EAAA,MAAAC,EAAA,SAAA,GAEAK,IAAA,MAAAJ,EAAA,QAAA,MAAA,KAAAA,EAAA,MAAA,QAAA,EAAA,OAAA,CAAAK,MAAAA,EAAA,QAAAT,CAAA,CAAA,IAAA,CAAA,GAKAU,IAAA,MAAA;AACI,MAAAJ,EAAA,QAAAE,EAAA;AAAA,IAA+B;AAGnC,IAAAG;AAAA,MAAAP;AAAA,MACI,CAAAQ,MAAA;AAEI,YAAA,CAAAA,GAAA;AACI,UAAAN,EAAA,QAAA,CAAA;AACA;AAAA,QAAA;AAGJ,QAAAI,EAAA;AAAA,MAAc;AAAA,MAClB,EAAA,WAAA,GAAA;AAAA,IACkB,GAGtBG,EAAAT,GAAAM,GAAA,EAAA,WAAA,GAAA,CAAA;AAEA,UAAAI,IAAA,CAAAC,MAAAA,IAAAT,EAAA,MAAA,QAAAS,CAAA,IAAA,IAEAC,IAAA,CAAAD,GAAAE,MAAAF,GAAA,cAAA,wBAAA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AA,aAAA,MAAA0C,GAAA,aAAAD,EAAA,KAAA,IAAA;AAAA,IAA4F,gBAGhG,MAAA;AACI,MAAAlB,EAAA,UAAA,IACAvB,EAAA,kBAAA,YAAA,MAAA0C,GAAA,YAAAD,EAAA,KAAA,IAAA;AAAA,IAA0F,mBAG9F,MAAA;AACI,MAAAlB,EAAA,aAAA,IACAvB,EAAA,kBAAA,eAAA,MAAA0C,GAAA,eAAAD,EAAA,KAAA,IAAA;AAAA,IAAgG;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"list-item.ByyA5h1d.js","sources":["../../src/components/list/list.keys.ts","../../src/components/list/list.vue","../../src/components/list/components/list-item/list-item.vue"],"sourcesContent":["import type { ComputedRef } from 'vue';\nimport type { BentoDraggableDisabledMenus } from '@/components/draggable/composables/use-bento-draggable/use-bento-draggable';\n\nexport interface BentoListDraggableContext {\n isDraggable: ComputedRef<boolean>;\n moveItemUp: (element: HTMLElement | null) => void;\n moveItemDown: (element: HTMLElement | null) => void;\n moveItemTop: (element: HTMLElement | null) => void;\n moveItemBottom: (element: HTMLElement | null) => void;\n getDisabledMenus: (element: HTMLElement | null) => BentoDraggableDisabledMenus;\n}\n\nexport const BENTO_LIST_DRAGGABLE_INJECTION_KEY = Symbol('list draggable injection key');\n","<template>\n <div class=\"b-list\">\n <component :is=\"listElement\" ref=\"listRef\" v-bind=\"$attrs\" class=\"b-list__list\">\n <slot />\n </component>\n\n <div v-if=\"isDraggable\" class=\"b-list__announcement\" role=\"status\" aria-live=\"polite\">\n {{ announcementMessage }}\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { useMutationObserver } from '@vueuse/core';\n import { computed, provide, ref, watch } from 'vue';\n import { useBentoDraggable } from '@/components/draggable/composables/use-bento-draggable/use-bento-draggable';\n import { useDraggableAnnouncement } from '@/components/draggable/composables/use-draggable-announcement/use-draggable-announcement';\n import type { BentoDraggableOptions, BentoDraggableSortableEvent } from '@/components/draggable/draggable.types';\n import { BENTO_LIST_DRAGGABLE_INJECTION_KEY } from './list.keys';\n import type { BentoListDraggableContext } from './list.keys';\n import type { BentoListProps } from './list.types';\n\n // used for announcement composable\n import draggableMessages from '@/components/draggable/composables/use-draggable-announcement/messages.json';\n\n const ITEM_SELECTOR = '.b-list-item';\n\n const props = defineProps({\n type: { default: 'unordered' },\n draggable: { type: Boolean, default: false },\n draggableOptions: { default: () => ({}) }\n});\n\n const emit = defineEmits([\"reorder\"]);\n\n const listElement = computed(() => (props.type === 'ordered' ? 'ol' : 'ul'));\n const listRef = ref<HTMLElement | null>(null);\n const listItems = ref<Array<HTMLElement>>([]);\n const isDraggable = computed(() => props.draggable);\n\n const getListItems = (): Array<HTMLElement> =>\n listRef.value\n ? (Array.from(listRef.value.children).filter(child => child.matches(ITEM_SELECTOR)) as Array<HTMLElement>)\n : [];\n\n const syncListItems = () => {\n listItems.value = getListItems();\n };\n\n watch(\n listRef,\n newElement => {\n if (!newElement) {\n listItems.value = [];\n return;\n }\n\n syncListItems();\n },\n { immediate: true }\n );\n\n useMutationObserver(listRef, syncListItems, { childList: true });\n\n const getItemIndex = (el: HTMLElement | null) => (el ? listItems.value.indexOf(el) : -1);\n\n const getItemLabel = (el: HTMLElement | null, fallbackIndex: number) =>\n el?.querySelector('[data-list-item-label]')?.textContent?.trim() || `List item ${fallbackIndex + 1}`;\n\n const announceMoveAt = (fromIndex: number, toIndex: number) => {\n if (!isDraggable.value) {\n return;\n }\n\n const items = getListItems();\n announceMove({\n itemLabel: getItemLabel(items[toIndex] ?? null, toIndex),\n fromIndex,\n toIndex,\n total: items.length,\n announcement: props.draggableOptions?.dragAnnouncement,\n });\n };\n\n const moveItemDOM = (fromIndex: number, toIndex: number) => {\n const items = getListItems();\n const itemToMove = items[fromIndex];\n const targetItem = items[toIndex];\n\n if (fromIndex < toIndex) {\n listRef.value!.insertBefore(itemToMove, targetItem.nextSibling);\n } else {\n listRef.value!.insertBefore(itemToMove, targetItem);\n }\n\n syncListItems();\n announceMoveAt(fromIndex, toIndex);\n emit('reorder', { oldIndex: fromIndex, newIndex: toIndex });\n };\n\n const computedDraggableOptions = computed<BentoDraggableOptions>(() => ({\n ...props.draggableOptions,\n onSort: (event: BentoDraggableSortableEvent) => {\n syncListItems();\n if (event.oldIndex !== undefined && event.newIndex !== undefined) {\n announceMoveAt(event.oldIndex, event.newIndex);\n emit('reorder', { oldIndex: event.oldIndex, newIndex: event.newIndex });\n }\n props.draggableOptions?.onSort?.(event);\n },\n }));\n\n const { announcementMessage, announceMove } = useDraggableAnnouncement();\n\n const { moveItemUp, moveItemDown, moveItemTop, moveItemBottom, getDisabledMenus } = useBentoDraggable(\n listRef,\n computedDraggableOptions,\n {\n getItemCount: () => listItems.value.length,\n getItemIndex,\n onMoveItem: moveItemDOM,\n }\n );\n\n provide<BentoListDraggableContext>(BENTO_LIST_DRAGGABLE_INJECTION_KEY, {\n isDraggable,\n moveItemUp,\n moveItemDown,\n moveItemTop,\n moveItemBottom,\n getDisabledMenus,\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * `BentoList` renders an ordered or unordered list container for `BentoListItem` rows.\n *\n * @example\n * import { BentoList, BentoListItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoList, BentoListItem },\n * template: `\n * <bento-list>\n * <bento-list-item\n * label=\"Payment details\"\n * description=\"Updated 2 hours ago\"\n * :tag=\"{ label: 'Live', variant: 'green' }\"\n * show-bottom-divider\n * />\n * <bento-list-item\n * label=\"Risk configuration\"\n * description=\"Updated yesterday\"\n * :tag=\"{ label: 'Review', variant: 'orange' }\"\n * />\n * </bento-list>\n * `\n * }\n */\n\n export default {\n name: 'bento-list',\n inheritAttrs: false,\n i18n: { messages: draggableMessages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./list.scss\" />\n","<template>\n <li ref=\"itemRef\" class=\"b-list-item\" @click=\"onItemClick\" @keydown=\"onItemKeydown\">\n <bento-typography\n class=\"b-list-item__inner\"\n :class=\"conditionalClasses\"\n el=\"div\"\n :role=\"props.withChevron ? 'button' : undefined\"\n :tabindex=\"props.withChevron ? 0 : undefined\"\n >\n <div v-if=\"hasSlot('image')\" class=\"b-list-item__image\">\n <slot name=\"image\" />\n </div>\n\n <bento-draggable-handle\n v-if=\"showDragHandle\"\n condensed\n :label=\"dragHandleLabel\"\n :disabled-menus=\"disabledMenus\"\n :disabled=\"draggableOptions?.disabled\"\n @move-up=\"moveItemUp\"\n @move-down=\"moveItemDown\"\n @move-top=\"moveItemTop\"\n @move-bottom=\"moveItemBottom\"\n />\n\n <div v-if=\"hasSlot('start')\" class=\"b-list-item__start\">\n <slot v-if=\"hasSlot('start')\" name=\"start\" />\n </div>\n\n <div class=\"b-list-item__content\">\n <div v-if=\"hasSlot('content')\" class=\"b-list-item__label\" data-list-item-label>\n <slot name=\"content\" />\n </div>\n\n <template v-else>\n <div class=\"b-list-item__header\">\n <bento-typography\n v-if=\"props.label\"\n class=\"b-list-item__label\"\n data-list-item-label\n el=\"span\"\n stronger\n >\n {{ props.label }}\n </bento-typography>\n <bento-status\n v-if=\"props.showStatus\"\n class=\"b-list-item__status\"\n :variant=\"props.statusColor\"\n aria-hidden=\"true\"\n />\n <bento-tag v-if=\"props.tag\" v-bind=\"props.tag\" class=\"b-list-item__tag\" />\n </div>\n <span v-if=\"props.description\" class=\"b-list-item__description\">\n {{ props.description }}\n </span>\n </template>\n </div>\n\n <div v-if=\"hasSlot('end')\" class=\"b-list-item__end\">\n <slot name=\"end\" />\n </div>\n\n <chevron-right-icon v-if=\"props.withChevron\" class=\"b-list-item__chevron\" aria-hidden=\"true\" />\n </bento-typography>\n </li>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, ref, useSlots } from 'vue';\n import ChevronRightIcon from '@adyen/ui-assets-icons-16/vue/chevron-right-small';\n import { BentoDraggableHandle } from '@/components/draggable/components/draggable-handle';\n import { BentoStatus } from '@/components/status';\n import { BentoTag } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import { BENTO_LIST_DRAGGABLE_INJECTION_KEY } from '../../list.keys';\n import type { BentoListDraggableContext } from '../../list.keys';\n import type { BentoListItemProps } from './list-item.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const itemRef = ref<HTMLElement | null>(null);\n const draggableContext = inject<BentoListDraggableContext | null>(BENTO_LIST_DRAGGABLE_INJECTION_KEY, null);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = defineProps({\n label: null,\n description: null,\n draggableOptions: { default: null },\n showStatus: { type: Boolean, default: false },\n statusColor: { default: 'blue' },\n tag: { default: undefined },\n withChevron: { type: Boolean, default: false },\n showTopDivider: { type: Boolean, default: false },\n showBottomDivider: { type: Boolean, default: false }\n});\n\n const emit = defineEmits([\"click\", \"move-up\", \"move-down\", \"move-top\", \"move-bottom\"]);\n\n const onItemClick = (): void => {\n if (!props.withChevron) {\n return;\n }\n emit('click');\n };\n\n const onItemKeydown = (event: KeyboardEvent): void => {\n if (!props.withChevron) {\n return;\n }\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n emit('click');\n }\n };\n\n const conditionalClasses = computed(() => ({\n 'b-list-item__inner--clickable': props.withChevron,\n 'b-list-item__inner--top-divider': props.showTopDivider,\n 'b-list-item__inner--bottom-divider': props.showBottomDivider,\n }));\n\n const showDragHandle = computed(() => Boolean(draggableContext?.isDraggable.value));\n const dragHandleLabel = computed(() => props.draggableOptions?.label || props.label || t('listItem'));\n const disabledMenus = computed(() => {\n if (props.draggableOptions?.disabledMenus) {\n return props.draggableOptions.disabledMenus;\n }\n\n return draggableContext?.getDisabledMenus(itemRef.value);\n });\n\n const moveItemUp = () => {\n emit('move-up');\n (props.draggableOptions?.moveUp ?? (() => draggableContext?.moveItemUp(itemRef.value)))();\n };\n\n const moveItemDown = () => {\n emit('move-down');\n (props.draggableOptions?.moveDown ?? (() => draggableContext?.moveItemDown(itemRef.value)))();\n };\n\n const moveItemTop = () => {\n emit('move-top');\n (props.draggableOptions?.moveTop ?? (() => draggableContext?.moveItemTop(itemRef.value)))();\n };\n\n const moveItemBottom = () => {\n emit('move-bottom');\n (props.draggableOptions?.moveBottom ?? (() => draggableContext?.moveItemBottom(itemRef.value)))();\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * `BentoListItem` renders an item to be used inside `BentoList`.\n *\n * @example\n * import { BentoList, BentoListItem, BentoButton, BentoToggle } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoList, BentoListItem, BentoButton, BentoToggle },\n * template: `\n * <bento-list>\n * <bento-list-item\n * label=\"Payment details\"\n * description=\"Updated 2 hours ago\"\n * :tag=\"{ label: 'Live', variant: 'green' }\"\n * show-bottom-divider\n * >\n * <template #start>\n * <bento-toggle />\n * </template>\n * <template #end>\n * <bento-button variant=\"secondary\">Edit</bento-button>\n * </template>\n * </bento-list-item>\n * </bento-list>\n * `\n * }\n */\n\n export default {\n name: 'bento-list-item',\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./list-item.scss\" />\n"],"names":["BENTO_LIST_DRAGGABLE_INJECTION_KEY","__default__$1","draggableMessages","ITEM_SELECTOR","listElement","computed","props","listRef","ref","listItems","isDraggable","getListItems","child","syncListItems","watch","newElement","useMutationObserver","getItemIndex","el","getItemLabel","fallbackIndex","announceMoveAt","fromIndex","toIndex","items","announceMove","moveItemDOM","itemToMove","targetItem","emit","computedDraggableOptions","event","announcementMessage","useDraggableAnnouncement","moveItemUp","moveItemDown","moveItemTop","moveItemBottom","getDisabledMenus","useBentoDraggable","provide","__default__","messages","slots","useSlots","hasSlot","useHasSlot","itemRef","draggableContext","inject","t","useI18n","onItemClick","onItemKeydown","conditionalClasses","showDragHandle","dragHandleLabel","disabledMenus"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;GAYOA,IAAA,uBAAA,8BAAA,GCqJHC,IAAA;AAAA,EAAe,MAAA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|
-
import { B as r } from "./typography.
|
|
2
|
+
import { B as s } from "./tag.CgsX8v2m.js";
|
|
3
|
+
import { B as r } from "./typography.Cd386LC_.js";
|
|
4
4
|
import { n as i } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
5
5
|
import "../assets/listbox-option-tag.css";
|
|
6
6
|
const p = n({
|
|
@@ -41,4 +41,4 @@ const v = m.exports;
|
|
|
41
41
|
export {
|
|
42
42
|
v as L
|
|
43
43
|
};
|
|
44
|
-
//# sourceMappingURL=listbox-option-tag.
|
|
44
|
+
//# sourceMappingURL=listbox-option-tag.Cp_W_p4z.js.map
|
package/dist/chunks/{listbox-option-tag.DhNxvqRO.js.map → listbox-option-tag.Cp_W_p4z.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listbox-option-tag.
|
|
1
|
+
{"version":3,"file":"listbox-option-tag.Cp_W_p4z.js","sources":["../../src/components/internal/listbox/components/listbox-option-tag/listbox-option-tag.vue"],"sourcesContent":["<template>\n <span class=\"b-listbox-tag-option\">\n <span :aria-hidden=\"!!option.label\">\n <bento-tag class=\"b-listbox-tag-option__tag\" :label=\"option.value.toString()\" :variant=\"variant\" />\n </span>\n <bento-typography v-if=\"option.label\" el=\"span\" class=\"b-listbox-tag-option__label\">\n {{ option.label }}\n </bento-typography>\n </span>\n</template>\n<script lang=\"ts\">\n import { computed, defineComponent, type PropType } from 'vue';\n import type { BentoListboxOptionItem } from '@/types/listbox';\n import { BentoTag, type BentoTagVariant } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n\n /**\n * A Tag Dropdown option item used in the Dropdown and Filter components.\n */\n export default defineComponent({\n name: 'listbox-tag-option',\n components: {\n BentoTag,\n BentoTypography,\n },\n props: {\n /**\n * The option item that contains all the option item's data.\n * @type {BentoListboxOptionItem}\n */\n option: {\n type: Object as PropType<BentoListboxOptionItem>,\n required: true,\n },\n },\n setup(props) {\n const variant = computed(() => props.option.data as BentoTagVariant);\n\n return {\n // Values\n variant,\n };\n },\n });\n</script>\n<style lang=\"scss\" scoped src=\"./listbox-option-tag.scss\" />\n"],"names":["_sfc_main","defineComponent","BentoTag","BentoTypography","props","computed"],"mappings":";;;;;AAmBA,MAAAA,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,UAAAC;AAAA,IACA,iBAAAC;AAAA,EACA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IACA,QAAA;AAAA,MAKA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,MAAAC,GAAA;AAIA,WAAA;AAAA;AAAA,MAAA,SAFAC,EAAA,MAAAD,EAAA,OAAA,IAAA;AAAA,IAIA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { defineComponent as T, useSlots as x, inject as L, onMounted as A, useListeners as h, getCurrentInstance as P, toRefs as w, ref as i, computed as J, onUnmounted as U, watch as K, provide as f } from "vue";
|
|
2
2
|
import "./index.Cl4_42j5.js";
|
|
3
|
-
import { B as Y } from "./toast.
|
|
3
|
+
import { B as Y } from "./toast.CjDkuh2x.js";
|
|
4
4
|
import { B as j } from "./focus-trap.fd6_d2EW.js";
|
|
5
|
-
import { B as $ } from "./button.
|
|
6
|
-
import { B as z } from "./typography.
|
|
5
|
+
import { B as $ } from "./button.tsTeQRcP.js";
|
|
6
|
+
import { B as z } from "./typography.Cd386LC_.js";
|
|
7
7
|
import { u as N } from "./use-has-slot.C9lQZ6nz.js";
|
|
8
8
|
import { u as H } from "./index.CPOlyau9.js";
|
|
9
|
-
import { i as F, j as D, B as X, k as q } from "./button-actions.
|
|
9
|
+
import { i as F, j as D, B as X, k as q } from "./button-actions.CdetBz3J.js";
|
|
10
10
|
import { C as Q } from "./cross.szJ_ZUTI.js";
|
|
11
|
-
import { D as W } from "./dialog-page.
|
|
11
|
+
import { D as W } from "./dialog-page.DORdXmEm.js";
|
|
12
12
|
import { n as M } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
13
13
|
import { g as O } from "./generate-uid.DBWe4g6T.js";
|
|
14
14
|
import { B as Z, D as V, a as ee } from "./dialog-page.keys.Dym9e6k3.js";
|
|
@@ -26,10 +26,10 @@ const te = {
|
|
|
26
26
|
"pt-BR": { close: "Fechar" },
|
|
27
27
|
"zh-CN": { close: "关闭" }
|
|
28
28
|
}, ae = {
|
|
29
|
-
i18n: { messages: te }
|
|
29
|
+
i18n: { messages: te },
|
|
30
|
+
name: "bento-modal-fullscreen-page"
|
|
30
31
|
}, se = /* @__PURE__ */ T({
|
|
31
32
|
...ae,
|
|
32
|
-
__name: "modal-fullscreen-page",
|
|
33
33
|
props: {
|
|
34
34
|
/**
|
|
35
35
|
* List of actions that will be used to render the buttons.
|
|
@@ -109,7 +109,7 @@ var le = function() {
|
|
|
109
109
|
oe,
|
|
110
110
|
!1,
|
|
111
111
|
null,
|
|
112
|
-
"
|
|
112
|
+
"a2c22c91"
|
|
113
113
|
);
|
|
114
114
|
const re = ne.exports;
|
|
115
115
|
function ie() {
|
|
@@ -228,4 +228,4 @@ export {
|
|
|
228
228
|
Oe as B,
|
|
229
229
|
re as a
|
|
230
230
|
};
|
|
231
|
-
//# sourceMappingURL=modal-fullscreen.
|
|
231
|
+
//# sourceMappingURL=modal-fullscreen.DG8Q-jHL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal-fullscreen.DG8Q-jHL.js","sources":["../../src/components/modal-fullscreen/components/modal-fullscreen-page.vue","../../src/composables/use-listeners/use-listener.ts","../../src/components/modal-fullscreen/modal-fullscreen.vue"],"sourcesContent":["<template>\n <dialog-page class=\"b-modal-fullscreen-page\" :page-id=\"pageId\" :previous-page=\"previousPage\" always-show-border>\n <template #header>\n <div class=\"b-modal-fullscreen-page__header\">\n <div class=\"b-modal-fullscreen-page__header-section b-modal-fullscreen-page__header-section--title\">\n <bento-typography\n v-if=\"title\"\n :id=\"computedTitleId\"\n el=\"h2\"\n variant=\"title\"\n class=\"b-modal-fullscreen-page__title\"\n :title=\"title\"\n >{{ title }}</bento-typography\n >\n </div>\n <div\n v-if=\"hasSlot('header')\"\n class=\"b-modal-fullscreen-page__header-section b-modal-fullscreen-page__header-section--slot\"\n >\n <slot name=\"header\" />\n </div>\n <div class=\"b-modal-fullscreen-page__header-section b-modal-fullscreen-page__header-section--actions\">\n <bento-typography\n v-if=\"contextualLabel\"\n class=\"b-modal-fullscreen-page__contextual-label\"\n el=\"span\"\n :title=\"contextualLabel\"\n >{{ contextualLabel }}</bento-typography\n >\n <bento-button-actions v-if=\"actions\" class=\"b-modal-fullscreen-page__actions\" :actions=\"actions\" />\n\n <div class=\"b-modal-fullscreen-page__separator\"></div>\n <div class=\"b-modal-fullscreen-page__close-button\">\n <bento-button variant=\"tertiary\" :aria-label=\"t('close')\" @click=\"handleClose\">\n <template #iconLeft><cross-icon :aria-hidden=\"true\" /></template>\n </bento-button>\n </div>\n </div>\n </div>\n </template>\n <template #content>\n <slot />\n </template>\n </dialog-page>\n</template>\n\n<script setup lang=\"ts\">\n import { inject, onMounted, type PropType, useSlots } from 'vue';\n\n import { BentoButton, BentoButtonActions, type BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { DialogPage } from '@/internal';\n\n import { useHasSlot } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import {\n MODAL_FULLSCREEN_CLOSE_INJECTION_KEY,\n MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY,\n } from '@/components/modal-fullscreen/modal-fullscreen.keys';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const props = 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 * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * Label shown next to the modal actions\n */\n contextualLabel: {\n type: String,\n default: null,\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 modal\n */\n title: {\n type: String,\n default: null,\n },\n\n /**\n * ID to be applied to the title to be used with aria-labelledby\n */\n titleId: {\n type: String,\n default: undefined,\n },\n });\n const emit = defineEmits([\"close\"]);\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const injectedTitleId = inject(MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY, undefined);\n const computedTitleId = props.titleId ?? injectedTitleId;\n\n const closeModal = inject(MODAL_FULLSCREEN_CLOSE_INJECTION_KEY, undefined);\n\n const handleClose = () => {\n emit('close');\n closeModal?.();\n };\n\n onMounted(() => {\n if (props.actions && props.actions.length > 2) {\n throw new Error('Not more than 2 action buttons may be provided in Bento Modal Fullscreen');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * ModalFullscreenPage is used to render different pages of ModalFullscreen component\n *\n * @example\n * import { BentoModalFullscreen, BentoModalFullscreenPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoModalFullscreen, BentoModalFullscreenPage },\n * template: `\n * <bento-modal-fullscreen active-page='page1' is-open='true'>\n * <bento-modal-fullscreen-page\n * title='Page 1'\n * pageId='page1'\n * contextual-label='Move to next page'\n * :actions=\"[\n * {\n * title: 'Next page',\n * event: () => {\n * activePage.value = 'page2';\n * },\n * }]\">\n * Page 1 info\n * </bento-modal-fullscreen-page>\n * <bento-modal-fullscreen-page\n * title='Page 2'\n * pageId='page2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Page 2 info\n * </bento-modal-fullscreen-page>\n * </bento-modal-fullscreen>\n * `\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-modal-fullscreen-page',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./modal-fullscreen-page.scss\" />\n","import { getCurrentInstance, useListeners as vueUseListeners } from 'vue';\n\n/**\n * A composable that provides access to the Vue2 component's listeners (see Vue3 implementation in packages/vue3/composables).\n * The listeners are kebab-case and the colons are removed (e.g. \"click\", \"update-value\").\n *\n * In environments where the Composition API is not available (e.g. during testing),\n * it falls back to using the component's non-reactive `$listeners` object.\n *\n * @returns The component's listeners.\n */\nexport function useListeners() {\n // Return nothing so tests don't require a mock of this function\n if (!window || (!vueUseListeners && !getCurrentInstance)) {\n return {};\n }\n\n if (vueUseListeners) {\n return vueUseListeners() as any;\n }\n\n const instance = getCurrentInstance();\n return instance?.proxy?.$listeners || {};\n}\n","<template>\n <dialog\n :id=\"modalFullscreenId\"\n ref=\"modal\"\n class=\"b-modal-fullscreen\"\n :class=\"conditionalClasses\"\n data-dialog-element=\"modal-fullscreen\"\n :aria-labelledby=\"titleId\"\n @animationend=\"closeModalAfterAnimation\"\n @keydown.esc.prevent=\"closeModal\"\n >\n <bento-focus-trap v-if=\"internalIsOpen\" class=\"b-modal-fullscreen__wrapper\">\n <template v-if=\"props.activePage\">\n <slot />\n </template>\n <bento-modal-fullscreen-page\n v-else\n :actions=\"actions\"\n :contextual-label=\"contextualLabel\"\n :title=\"title\"\n :title-id=\"titleId\"\n @close=\"closeModal\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot name=\"default\"></slot>\n </template>\n <template v-if=\"hasSlot('header')\" #header>\n <slot name=\"header\"></slot>\n </template>\n </bento-modal-fullscreen-page>\n </bento-focus-trap>\n\n <!-- Enable the toast inside the fullscreen-modal -->\n <template v-if=\"isOpen\">\n <bento-toast />\n </template>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, onUnmounted, type PropType, provide, ref, toRefs, useSlots, watch } from 'vue';\n import { isVue2 } from 'vue-demi';\n\n import { BentoToast } from '@/components/toast';\n import { type BentoButtonActionsList } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import BentoModalFullscreenPage from './components/modal-fullscreen-page.vue';\n\n import { generateUid } from '@/utils/ts/generate-uid';\n import { useHasSlot } from '@/composables';\n import { useListeners } from '@/composables/use-listeners';\n import {\n MODAL_FULLSCREEN_CLOSE_INJECTION_KEY,\n MODAL_FULLSCREEN_DIALOG_ID_INJECTION_KEY,\n MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY,\n } from '@/components/modal-fullscreen/modal-fullscreen.keys';\n\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 const props = 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 * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * The id of the current active page\n * Should be the same as the pageId of the BentoModalFullscreenPage to be displayed\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * Label shown next to the modal actions\n */\n contextualLabel: {\n type: String,\n default: null,\n },\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: {\n type: Boolean,\n default: null,\n },\n /**\n * Title of the modal\n */\n title: {\n type: String,\n default: null,\n },\n });\n\n const emit = defineEmits([\"before-close\", \"update:active-page\", \"update:is-open\"]);\n\n // Refs\n const { activePage, isOpen } = toRefs(props);\n const modal = ref(null);\n const isClosing = ref(false);\n const modalFullscreenId = generateUid('modal-fullscreen');\n const titleId = generateUid('modal-fullscreen-title');\n const internalIsOpen = ref(false);\n const isMounted = ref(false);\n\n const listeners = useListeners();\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n // Animation styling\n const conditionalClasses = computed(() => ({\n 'b-modal-fullscreen--hide': isClosing.value,\n }));\n\n // Handle closing and closing animation for dialog element\n const closeModalAfterAnimation = () => {\n if (isClosing.value && modal.value) {\n modal.value.close();\n if (previousPages.value[0]) {\n emit('update:active-page', previousPages.value[0]);\n }\n previousPages.value = [];\n isClosing.value = false;\n internalIsOpen.value = false;\n emit('update:is-open', false);\n }\n };\n\n /**\n * Emits the `beforeClose` event, if it is being listened to,\n * before closing the modal and omits the closing animation.\n * The animation will be triggered by the change of the `isOpen` prop instead.\n *\n * If no listener for the `before-close`, then the animation will be triggered,\n * which will close the modal and emit the `update:is-open` event instead, after it was closed.\n */\n function closeModal() {\n /**\n * Vue3 appends the prefix \"on\" and changes to camelCase\n */\n const eventName = isVue2 ? 'before-close' : 'onBeforeClose';\n if (listeners[eventName]) {\n emit('before-close');\n return;\n }\n startCloseModalAnimation();\n }\n\n const startCloseModalAnimation = () => {\n if (!modal.value || !modal.value.open) {\n return;\n }\n isClosing.value = true;\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, modal],\n ([newIsOpen, newModalValue]) => {\n if (!isMounted.value || !newModalValue) {\n return;\n }\n\n if (newIsOpen) {\n internalIsOpen.value = true;\n if (!newModalValue.open) {\n newModalValue.showModal();\n }\n if (!previousPages.value.length) {\n previousPages.value.push(activePage.value);\n }\n } else if (newModalValue.open) {\n startCloseModalAnimation();\n }\n },\n { immediate: true, flush: 'post' }\n );\n\n // lets children components know they are inside a Modal (dialog element)\n provide(MODAL_FULLSCREEN_DIALOG_ID_INJECTION_KEY, modalFullscreenId);\n provide(MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY, titleId);\n provide(MODAL_FULLSCREEN_CLOSE_INJECTION_KEY, closeModal);\n\n // Pages\n const animation = ref(BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER);\n const pages = ref<Array<string>>([]);\n const previousPages = ref([]);\n const updatePage = page => emit('update:active-page', page);\n\n provide<BentoDialogPageConfigData>(DIALOG_PAGE_CONFIG_INJECTION_KEY, {\n activePage,\n animation,\n isOpen: internalIsOpen,\n pages,\n previousPages,\n updatePage,\n });\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 if (pageId) {\n pages.value.push(pageId);\n }\n\n return { unregisterPage: unregisterPage(pageId) };\n };\n\n provide(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY, registerPage);\n</script>\n\n<script lang=\"ts\">\n /**\n * Fullscreen modal takes full available space (no content underneath is visible) and focuses the user's attention exclusively on one complex task or piece of complex information.\n *\n * @example\n * import { BentoModalFullscreen } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoModalFullscreen },\n * template: `\n * <bento-modal-fullscreen\n * :is-open=\"isOpen\"\n * @update:is-open=\"isOpen = $event\"\n * title='Fullscreen modal title'\n * contextual-label='Contextual label'\n * :actions=\"[{ title: 'Action', event: () => {}]\"\n * >\n * <template #header>{{ header slot }}</template>\n * {{ content }}\n * </bento-modal-fullscreen>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./modal-fullscreen.scss\" />\n"],"names":["__default__$1","messages","useI18n","slots","useSlots","hasSlot","useHasSlot","injectedTitleId","inject","MODAL_FULLSCREEN_TITLE_ID_INJECTION_KEY","computedTitleId","props","closeModal","MODAL_FULLSCREEN_CLOSE_INJECTION_KEY","handleClose","emit","onMounted","useListeners","useListeners$1","getCurrentInstance","__default__","activePage","isOpen","toRefs","modal","ref","isClosing","modalFullscreenId","generateUid","titleId","internalIsOpen","isMounted","listeners","conditionalClasses","computed","closeModalAfterAnimation","previousPages","startCloseModalAnimation","onUnmounted","watch","newIsOpen","newModalValue","provide","MODAL_FULLSCREEN_DIALOG_ID_INJECTION_KEY","animation","BentoDialogPageAnimation","pages","updatePage","page","DIALOG_PAGE_CONFIG_INJECTION_KEY","unregisterPage","pageIdToRemove","pageId","registerPage","DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;GAuLIA,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,GAAA;AAAA,EACM,MAAA;AAErB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA1HA,EAAA,EAAA,IAAAC,EAAA,GA6DAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAAC,GAAA,MAAA,GACAC,IAAAC,EAAA,WAAAJ,GAEAK,IAAAJ,EAAAK,GAAA,MAAA,GAEAC,IAAA,MAAA;AACI,MAAAC,EAAA,OAAA,GACAH,IAAA;AAAA,IAAa;AAGjB,WAAAI,EAAA,MAAA;AACI,UAAAL,EAAA,WAAAA,EAAA,QAAA,SAAA;AACI,cAAA,IAAA,MAAA,0EAAA;AAAA,IACJ,CAAA;;;;;;;;;;;;;;;;;;;;;AClID,SAAAM,KAAA;AAEH,SAAA,CAAA,UAAA,CAAAC,KAAA,CAAAC,IACI,CAAA,IAGJD,IACIA,EAAA,IAGJC,EAAA,GACA,OAAA,cAAA,CAAA;AACJ;ACkPI,MAAAC,KAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBArJA,EAAA,YAAAC,GAAA,QAAAC,EAAA,IAAAC,EAAAZ,CAAA,GACAa,I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A;AAAA,IACiC,GAIrCK,EAAAC,GAAAhB,CAAA,GACAe,EAAAjC,GAAAoB,CAAA,GACAa,EAAA7B,GAAAD,CAAA;AAGA,UAAAgC,IAAAnB,EAAAoB,EAAA,uBAAA,GACAC,IAAArB,EAAA,CAAA,CAAA,GACAW,IAAAX,EAAA,CAAA,CAAA,GACAsB,IAAA,CAAAC,MAAAjC,EAAA,sBAAAiC,CAAA;AAEA,IAAAN,EAAAO,GAAA;AAAA,MAAqE,YAAA5B;AAAA,MACjE,WAAAuB;AAAA,MACA,QAAAd;AAAA,MACQ,OAAAgB;AAAA,MACR,eAAAV;AAAA,MACA,YAAAW;AAAA,IACA,CAAA;AAIJ,UAAAG,IAAA,CAAAC,MAAA,MAAA;AACI,MAAAL,EAAA,QAAAA,EAAA,OAAA,OAAA,CAAAM,MAAAA,MAAAD,CAAA;AAAA,IAAqE,GAIzEE,IAAA,CAAAD,OACIA,KACIN,EAAA,MAAA,KAAAM,CAAA,GAGJ,EAAA,gBAAAF,EAAAE,CAAA,EAAA;AAGJ,WAAAV,EAAAY,IAAAD,CAAA;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineComponent as c, useSlots as v, onMounted as S, toRefs as w, ref as D, computed as u, useAttrs as E } from "vue";
|
|
2
|
-
import { B as _, h as M, a as r, d as L, e as b, g as p, f as P } from "./base-modal.
|
|
2
|
+
import { B as _, h as M, a as r, d as L, e as b, g as p, f as P } from "./base-modal._-Cc6jfi.js";
|
|
3
3
|
import { u as g } from "./use-has-slot.C9lQZ6nz.js";
|
|
4
|
-
import { F as x } from "./footer-actions.
|
|
4
|
+
import { F as x } from "./footer-actions.B8f-gEQV.js";
|
|
5
5
|
import { n as B } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
6
|
-
import { b as h } from "./button.
|
|
6
|
+
import { b as h } from "./button.tsTeQRcP.js";
|
|
7
7
|
import { u as R } from "./index.CPOlyau9.js";
|
|
8
|
-
import { B as z } from "./button-actions.
|
|
9
|
-
import { d as T } from "./typography.
|
|
8
|
+
import { B as z } from "./button-actions.CdetBz3J.js";
|
|
9
|
+
import { d as T } from "./typography.Cd386LC_.js";
|
|
10
10
|
const K = c({
|
|
11
11
|
name: "bento-modal-default"
|
|
12
12
|
}), N = /* @__PURE__ */ c({
|
|
@@ -407,7 +407,7 @@ const H = Y.exports, J = c({
|
|
|
407
407
|
'BentoModal "overflow-visible" property',
|
|
408
408
|
`"overflow-visible" property was made redundant. BentoModal can work correctly without the need to pass the propery.
|
|
409
409
|
Remove the "overflow-visible" prop from BentoModal to remove this error.`,
|
|
410
|
-
"
|
|
410
|
+
"3.0.0"
|
|
411
411
|
), { __sfc: !0, slots: e, hasSlot: a, attrs: l, emit: t, props: o, computedVariant: i, customProps: s, onCloseModal: d };
|
|
412
412
|
}
|
|
413
413
|
});
|
|
@@ -436,4 +436,4 @@ const ut = tt.exports;
|
|
|
436
436
|
export {
|
|
437
437
|
ut as B
|
|
438
438
|
};
|
|
439
|
-
//# sourceMappingURL=modal.
|
|
439
|
+
//# sourceMappingURL=modal.UkzON4bz.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.B3-pmL5s.js","sources":["../../src/components/modal/components/modal-default/modal-default.vue","../../src/components/modal/components/modal-dialog/modal-dialog.vue","../../src/components/modal/modal.vue"],"sourcesContent":["<template>\n <base-modal\n class=\"b-modal-default\"\n v-bind=\"$attrs\"\n :actions=\"actions\"\n :active-page=\"activePage\"\n :size=\"size\"\n :hide-close-button=\"hideCloseButton\"\n :columns-size=\"columnsSize\"\n :custom-padding=\"customPadding\"\n :is-dismissible=\"isDismissible\"\n :is-open=\"isOpen\"\n :with-column-layout=\"withColumnLayout\"\n :initially-open=\"initiallyOpen\"\n @update:active-page=\"emit('update:active-page', $event)\"\n @close-modal=\"onCloseModal\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot></slot>\n </template>\n <template v-if=\"hasSlot('content-col-1')\" #content-col-1><slot name=\"content-col-1\"></slot></template>\n <template v-if=\"hasSlot('content-col-2')\" #content-col-2><slot name=\"content-col-2\"></slot></template>\n <template v-if=\"hasSlot('content')\" #content><slot name=\"content\"></slot></template>\n\n <template v-if=\"actions && actions.length > 0\" #actions>\n <slot name=\"actions\">\n <footer-actions\n :actions=\"actions\"\n :actions-label=\"actionsLabel\"\n :destructive-actions=\"destructiveActions\"\n />\n </slot>\n </template>\n </base-modal>\n</template>\n\n<script setup lang=\"ts\">\n import { defineComponent, onMounted, type PropType, useSlots } from 'vue';\n import { BentoModalColumnLayoutVariant, type BentoModalSize } from '@/components/modal/modal.types';\n import { useHasSlot } from '@/composables';\n import { type BentoButtonActionsList } from '@/components/button';\n import { FooterActions } from '@/components/internal/footer-actions';\n import BaseModal from '@/components/modal/components/base-modal/base-modal.vue';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const emit = defineEmits([\"update:active-page\", \"close-modal\"]);\n\n const props = 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 * But you may change the color of 1-st action to red with 'critial' key\n * Not more than 3 action buttons can be provided\n * Or 2 action buttons and 1 Label for them\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',2\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: { type: String, default: null },\n\n /**\n * The id of the current active page\n * Should be the same id as the BentoModalPage to be displayed\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * If provided, manages the padding of the whole modal container\n */\n customPadding: { type: String, default: null },\n\n /**\n * If a column layout is provided, it renders the respective left column width variant. This can be smaller than the second column, the same size as the second column or bigger than the second column.\n */\n columnsSize: {\n type: String as PropType<BentoModalColumnLayoutVariant>,\n default: BentoModalColumnLayoutVariant.SMALLER,\n },\n\n /**\n * If passed - sets first button color to red\n */\n destructiveActions: { type: Boolean, default: false },\n\n /**\n * Hides a cross icon on the right side of the title\n */\n hideCloseButton: { type: Boolean, default: false },\n\n /**\n * Sets the open attribute on the dialog element, use isOpen instead to toggle modal visbility.\n */\n initiallyOpen: { type: Boolean, default: false },\n\n /**\n * If set to true, it allows the modal to be closed by clicking outside of it\n */\n isDismissible: { type: Boolean, required: true },\n\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: { type: Boolean, required: true },\n\n /**\n * Sets the width of the modal\n */\n size: {\n type: String as PropType<BentoModalSize | `${BentoModalSize}`>,\n required: true,\n },\n\n /**\n * If provided, renders the modal's content in a two-column layout an wth dividers separating its content\n */\n withColumnLayout: { type: Boolean, default: false },\n });\n\n const onCloseModal = () => {\n emit('close-modal');\n };\n\n onMounted(() => {\n if (!(hasSlot('content') || (hasSlot('content-col-1') && hasSlot('content-col-2'))) && !props.activePage) {\n throw new Error('Bento Modal default variant requires content slot or column slots');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Creates a Modal based off the `base-modal` component.\n * It allows two column modals as well as content modals.\n *\n * @example\n * import { BentoModalDefault } from '@/components/modal/components';\n *\n * export default {\n * components: { BentoModalDefault },\n * template: `\n * <bento-modal-default\n * :is-dismissible=\"false\"\n * :is-open=\"isOpen\"\n * @close-modal=\"isOpen = false\"\n * >\n * <template #content-col-1>\n * // Content on the left side column\n * </template>\n *\n * <template #content-col-2>\n * // Content on the right side column\n * </template>\n *\n * <template v-if=\"actions\" #actions>\n * <footer-actions :actions=\"actions\" />\n * </template>\n * </bento-modal-default>\n * `,\n * setup() {\n * const isOpen = ref(true)\n * const footerActions = [{\n * title: 'Primary action',\n * event: () => { ... }\n * }]\n * }\n * }\n */\n export default defineComponent({\n name: 'bento-modal-default',\n });\n</script>\n","<template>\n <base-modal\n ref=\"modalRef\"\n class=\"b-modal-dialog\"\n :actions=\"actions\"\n :active-page=\"activePage\"\n :class=\"modalDialogConditionalClasses\"\n :hide-close-button=\"true\"\n size=\"small\"\n :is-dismissible=\"isDismissible\"\n :is-open=\"isOpen\"\n :modal-role=\"BentoModalRole.ALERT_DIALOG\"\n :initially-open=\"initiallyOpen\"\n v-bind=\"$attrs\"\n @close-modal=\"onCloseModal\"\n >\n <template #default>\n <slot></slot>\n </template>\n <template #content>\n {{ content }}\n </template>\n\n <template #actions>\n <bento-button-actions\n v-if=\"dialogType === 'acknowledgement'\"\n :actions=\"acknowledgementDialogActions\"\n layout=\"buttons-end\"\n />\n\n <bento-button-actions v-else :actions=\"dialogActions\" layout=\"buttons-end\" />\n </template>\n </base-modal>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, onMounted, type PropType, type Ref, ref, toRefs, useSlots } from 'vue';\n import { BentoModalDialogType, BentoModalRole } from '@/components/modal/modal.types';\n import { useHasSlot } from '@/composables';\n import {\n type BentoButtonActionObject,\n BentoButtonActions,\n type BentoButtonActionsList,\n BentoButtonVariant,\n } from '@/components/button';\n import { useI18n } from '@/utils/ts/i18n';\n import BaseModal from '@/components/modal/components/base-modal/base-modal.vue';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const emit = defineEmits([\"close-modal\"]);\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * Only 1 action button is allowed for Modal Dialog\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',2\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * The id of the current active page\n * Should be the same id as the BentoModalPage to be displayed\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * Text that is displayed in the content section of modal\n */\n content: { type: String, required: true },\n\n /**\n * Sets different action buttons styling and appearance\n */\n dialogType: {\n type: String as PropType<BentoModalDialogType | `${BentoModalDialogType}`>,\n required: true,\n },\n\n /**\n * Sets the open attribute on the dialog element, use isOpen instead to toggle modal visbility.\n */\n initiallyOpen: { type: Boolean, default: false },\n\n /**\n * If set to true, it allows the modal to be closed by clicking outside of it\n */\n isDismissible: { type: Boolean, required: true },\n\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: { type: Boolean, required: true },\n });\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const { actions, dialogType } = toRefs(props);\n const modalRef: Ref<InstanceType<typeof BaseModal>> = ref(null);\n\n const onCloseModal = () => {\n emit('close-modal');\n };\n\n const onCloseActionButton = (event: Event) => {\n // Calls \"base-modal\" internal function to initialize the\n // \"close\" animation and trigger the \"close\" event.\n // This follows the same \"dialog\" pattern of calling \"dialog.close()\"\n modalRef.value.internalModalActionClose(event);\n };\n\n const acknowledgementDialogActions = computed(() => [\n {\n title: t('ok') as string,\n event: onCloseActionButton,\n variant: BentoButtonVariant.SECONDARY,\n },\n ]);\n\n const dialogActions = computed(() => {\n const mandatoryCancelActionButton: BentoButtonActionObject = {\n title: 'Cancel',\n event: onCloseActionButton,\n };\n const updatedPassedActionsObject: BentoButtonActionObject = actions?.value?.[0];\n\n if (dialogType.value === BentoModalDialogType.DESTRUCTIVE) {\n updatedPassedActionsObject.critical = true;\n } else if (dialogType.value === BentoModalDialogType.INFO) {\n updatedPassedActionsObject.variant = BentoButtonVariant.SECONDARY;\n }\n\n return [updatedPassedActionsObject, mandatoryCancelActionButton];\n });\n\n const modalDialogConditionalClasses = computed(() => ({\n [`b-modal-dialog--${dialogType.value}`]: dialogType.value,\n }));\n\n onMounted(() => {\n if (props.activePage) {\n throw new Error(\n 'Bento Modal Dialog cannot contain multiple pages. Use Bento Modal default variant instead.'\n );\n }\n\n if (!hasSlot('default') || (!props.content && !hasSlot('content'))) {\n throw new Error('Bento Modal Dialog requires header title and content');\n }\n\n if (actions?.value?.length > 1) {\n throw new Error('Not more than 1 action button may be provided to Modal Dialog');\n }\n\n if (dialogType.value !== BentoModalDialogType.ACKNOWLEDGEMENT && !actions?.value) {\n throw new Error('Modal Dialog, except ACKNOWLEDGEMENT type, always has to contain one action button');\n }\n\n if (dialogType.value === BentoModalDialogType.ACKNOWLEDGEMENT && actions?.value?.length) {\n throw new Error('Acknowledgement Modal Dialog does not accept action buttons');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Creates a \"dialog\" type of modal.\n * These are are modals that require a deliberate user action or acknowledgement\n * (confirmations or destructive actions).\n *\n * It’s not customizable and consists of title, description label and one action.\n *\n * @example\n * import { BentoModalDialog } from '@/components/modal/components';\n *\n * export default {\n * components: { BentoModalDialog },\n * template: `\n * <bento-modal-dialog\n * dialog-type=\"destructive\"\n * :is-dismissible=\"false\"\n * :is-open=\"isOpen\"\n * @close-modal=\"isOpen = false\"\n * >\n * Dialog content\n * </bento-modal-dialog>\n * `,\n * setup() {\n * const isOpen = ref(true)\n * }\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-modal-dialog',\n });\n</script>\n","<template>\n <component\n :is=\"computedVariant\"\n class=\"b-modal\"\n :is-open=\"isOpen\"\n :actions=\"actions\"\n :initially-open=\"initiallyOpen\"\n v-bind=\"customProps\"\n @close-modal=\"onCloseModal\"\n @update:active-page=\"emit('update:active-page', $event)\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot></slot>\n </template>\n <template v-if=\"hasSlot('content-col-1')\" #content-col-1><slot name=\"content-col-1\"></slot></template>\n <template v-if=\"hasSlot('content-col-2')\" #content-col-2><slot name=\"content-col-2\"></slot></template>\n <template v-if=\"hasSlot('content')\" #content><slot name=\"content\"></slot></template>\n </component>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, type PropType, useAttrs, useSlots } from 'vue';\n import {\n BentoModalColumnLayoutVariant,\n BentoModalDialogType,\n BentoModalSize,\n BentoModalVariant,\n BentoModalVariantMapping,\n } from './modal.types';\n import { BentoModalDefault, BentoModalDialog } from '@/components/modal/components';\n import { useHasSlot } from '@/composables';\n import { type BentoButtonActionsList } from '@/components/button';\n import { deprecate } from '@/utils/ts/deprecate';\n\n type BentoModalVariantProp = BentoModalVariant | `${BentoModalVariant}` | `${BentoModalVariantMapping}`;\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const attrs = useAttrs();\n const emit = defineEmits([\"update:active-page\", \"close-modal\"]);\n\n const props = 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 * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',2\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 * The id of the current active page\n * Should be the same id as the BentoModalPage to be displayed\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * Text label that is displayed left to the action buttons\n */\n actionsLabel: { type: String, default: null },\n\n /**\n * Text that will be displayed in the content section of Modal\n */\n content: { type: String, default: null },\n\n /**\n * If a column layout is provided, it renders the respective left column width variant. This can be smaller than the second column, the same size as the second column or bigger than the second column.\n */\n columnsSize: {\n type: String as PropType<BentoModalColumnLayoutVariant | `${BentoModalColumnLayoutVariant}`>,\n default: BentoModalColumnLayoutVariant.SMALLER,\n validator: (value: BentoModalColumnLayoutVariant) =>\n Object.values(BentoModalColumnLayoutVariant).includes(value),\n },\n\n /**\n * If provided, manages the padding of the whole modal container\n */\n customPadding: { type: String, default: null },\n\n /**\n * If passed - sets first button color to red\n */\n destructiveActions: { type: Boolean, default: false },\n\n /**\n * Changes the visual styling of action buttons\n */\n dialogType: {\n type: String as PropType<BentoModalDialogType | `${BentoModalDialogType}`>,\n default: BentoModalDialogType.CONFIRMATION,\n validator: (value: BentoModalDialogType) => Object.values(BentoModalDialogType).includes(value),\n },\n\n /**\n * Hides a cross icon on the right side of the title\n */\n hideCloseButton: { type: Boolean, default: false },\n\n /**\n * If set to true, it allows the modal to be closed without performing an action\n */\n isDismissible: { type: Boolean, default: null },\n\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the open attribute on the dialog element, use isOpen instead to toggle modal visbility.\n */\n initiallyOpen: { type: Boolean, default: false },\n\n /**\n * Sets the width of the modal\n */\n size: {\n type: String as PropType<BentoModalSize | `${BentoModalSize}`>,\n default: BentoModalSize.SMALL,\n validator: (value: BentoModalSize) => Object.values(BentoModalSize).includes(value),\n },\n\n /**\n * Choose between default or dialog versions of modal\n */\n variant: {\n type: String as PropType<BentoModalVariantProp>,\n default: 'default',\n validator: (value: BentoModalVariantProp) =>\n Object.values<BentoModalVariantProp>(BentoModalVariant).includes(value) ||\n Object.values<BentoModalVariantProp>(BentoModalVariantMapping).includes(value),\n },\n\n /**\n * If provided, renders the modal's content in a two-column layout an wth dividers separating its content\n */\n withColumnLayout: { type: Boolean, default: false },\n });\n\n const computedVariant = computed(() => {\n if (Object.values<BentoModalVariantProp>(BentoModalVariantMapping).includes(props.variant)) {\n return props.variant;\n }\n return BentoModalVariantMapping[props.variant.toUpperCase()];\n });\n\n const customProps = computed(() =>\n computedVariant.value === BentoModalVariantMapping.DEFAULT\n ? {\n activePage: props.activePage,\n hideCloseButton: props.hideCloseButton,\n size: props.size,\n customPadding: props.customPadding,\n actionsLabel: props.actionsLabel,\n destructiveActions: props.destructiveActions,\n isDismissible: props.isDismissible ?? true,\n withColumnLayout: props.withColumnLayout,\n columnsSize: props.columnsSize,\n ...attrs,\n }\n : {\n activePage: props.activePage,\n dialogType: props.dialogType,\n content: props.content,\n isDismissible: props.isDismissible ?? false,\n ...attrs,\n }\n );\n\n const onCloseModal = () => {\n emit('close-modal');\n };\n\n if (Object.keys(attrs).includes('overflow-visible')) {\n deprecate(\n 'BentoModal \"overflow-visible\" property',\n `\"overflow-visible\" property was made redundant. BentoModal can work correctly without the need to pass the propery.\n Remove the \"overflow-visible\" prop from BentoModal to remove this error.`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Modal is a window that appear over any other page content\n * and focus user attention exclusively on one task or piece of\n * information at the moment.\n *\n * @example\n * import { BentoModal } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoModal },\n * template: `\n * <bento-modal :isOpen=\"true\">\n * Title of the Modal\n * <template #content>\n * Mandatory content slot\n * </template>\n * </bento-modal>\n * `\n * };\n */\n export default defineComponent({\n components: { BentoModalDefault, BentoModalDialog },\n });\n</script>\n"],"names":["__default__","defineComponent","slots","useSlots","hasSlot","useHasSlot","onCloseModal","emit","onMounted","props","messages","t","useI18n","actions","dialogType","toRefs","modalRef","ref","onCloseActionButton","event","acknowledgementDialogActions","computed","BentoButtonVariant","dialogActions","mandatoryCancelActionButton","updatedPassedActionsObject","BentoModalDialogType","modalDialogConditionalClasses","BentoModalDefault","BentoModalDialog","attrs","useAttrs","computedVariant","BentoModalVariantMapping","customProps","deprecate"],"mappings":";;;;;;;;;AAqMI,MAAAA,IAAeC,EAAgB;AAAA,EAC3B,MAAM;AACV,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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QACrB,cAAcA,EAAM;AAAA,QACpB,oBAAoBA,EAAM;AAAA,QAC1B,eAAeA,EAAM,iBAAiB;AAAA,QACtC,kBAAkBA,EAAM;AAAA,QACxB,aAAaA,EAAM;AAAA,QACnB,GAAGqB;AAAA,MAAA,IAEP;AAAA,QACI,YAAYrB,EAAM;AAAA,QAClB,YAAYA,EAAM;AAAA,QAClB,SAASA,EAAM;AAAA,QACf,eAAeA,EAAM,iBAAiB;AAAA,QACtC,GAAGqB;AAAA,MAAA;AAAA,IACP,GAGJxB,IAAe,MAAM;AACvB,MAAAC,EAAK,aAAa;AAAA,IACtB;AAEA,WAAI,OAAO,KAAKuB,CAAK,EAAE,SAAS,kBAAkB,KAC9CK;AAAA,MACI;AAAA,MACA;AAAA;AAAA,MAEA;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"modal.UkzON4bz.js","sources":["../../src/components/modal/components/modal-default/modal-default.vue","../../src/components/modal/components/modal-dialog/modal-dialog.vue","../../src/components/modal/modal.vue"],"sourcesContent":["<template>\n <base-modal\n class=\"b-modal-default\"\n v-bind=\"$attrs\"\n :actions=\"actions\"\n :active-page=\"activePage\"\n :size=\"size\"\n :hide-close-button=\"hideCloseButton\"\n :columns-size=\"columnsSize\"\n :custom-padding=\"customPadding\"\n :is-dismissible=\"isDismissible\"\n :is-open=\"isOpen\"\n :with-column-layout=\"withColumnLayout\"\n :initially-open=\"initiallyOpen\"\n @update:active-page=\"emit('update:active-page', $event)\"\n @close-modal=\"onCloseModal\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot></slot>\n </template>\n <template v-if=\"hasSlot('content-col-1')\" #content-col-1><slot name=\"content-col-1\"></slot></template>\n <template v-if=\"hasSlot('content-col-2')\" #content-col-2><slot name=\"content-col-2\"></slot></template>\n <template v-if=\"hasSlot('content')\" #content><slot name=\"content\"></slot></template>\n\n <template v-if=\"actions && actions.length > 0\" #actions>\n <slot name=\"actions\">\n <footer-actions\n :actions=\"actions\"\n :actions-label=\"actionsLabel\"\n :destructive-actions=\"destructiveActions\"\n />\n </slot>\n </template>\n </base-modal>\n</template>\n\n<script setup lang=\"ts\">\n import { defineComponent, onMounted, type PropType, useSlots } from 'vue';\n import { BentoModalColumnLayoutVariant, type BentoModalSize } from '@/components/modal/modal.types';\n import { useHasSlot } from '@/composables';\n import { type BentoButtonActionsList } from '@/components/button';\n import { FooterActions } from '@/components/internal/footer-actions';\n import BaseModal from '@/components/modal/components/base-modal/base-modal.vue';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const emit = defineEmits([\"update:active-page\", \"close-modal\"]);\n\n const props = 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 * But you may change the color of 1-st action to red with 'critial' key\n * Not more than 3 action buttons can be provided\n * Or 2 action buttons and 1 Label for them\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',2\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: { type: String, default: null },\n\n /**\n * The id of the current active page\n * Should be the same id as the BentoModalPage to be displayed\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * If provided, manages the padding of the whole modal container\n */\n customPadding: { type: String, default: null },\n\n /**\n * If a column layout is provided, it renders the respective left column width variant. This can be smaller than the second column, the same size as the second column or bigger than the second column.\n */\n columnsSize: {\n type: String as PropType<BentoModalColumnLayoutVariant>,\n default: BentoModalColumnLayoutVariant.SMALLER,\n },\n\n /**\n * If passed - sets first button color to red\n */\n destructiveActions: { type: Boolean, default: false },\n\n /**\n * Hides a cross icon on the right side of the title\n */\n hideCloseButton: { type: Boolean, default: false },\n\n /**\n * Sets the open attribute on the dialog element, use isOpen instead to toggle modal visbility.\n */\n initiallyOpen: { type: Boolean, default: false },\n\n /**\n * If set to true, it allows the modal to be closed by clicking outside of it\n */\n isDismissible: { type: Boolean, required: true },\n\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: { type: Boolean, required: true },\n\n /**\n * Sets the width of the modal\n */\n size: {\n type: String as PropType<BentoModalSize | `${BentoModalSize}`>,\n required: true,\n },\n\n /**\n * If provided, renders the modal's content in a two-column layout an wth dividers separating its content\n */\n withColumnLayout: { type: Boolean, default: false },\n });\n\n const onCloseModal = () => {\n emit('close-modal');\n };\n\n onMounted(() => {\n if (!(hasSlot('content') || (hasSlot('content-col-1') && hasSlot('content-col-2'))) && !props.activePage) {\n throw new Error('Bento Modal default variant requires content slot or column slots');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Creates a Modal based off the `base-modal` component.\n * It allows two column modals as well as content modals.\n *\n * @example\n * import { BentoModalDefault } from '@/components/modal/components';\n *\n * export default {\n * components: { BentoModalDefault },\n * template: `\n * <bento-modal-default\n * :is-dismissible=\"false\"\n * :is-open=\"isOpen\"\n * @close-modal=\"isOpen = false\"\n * >\n * <template #content-col-1>\n * // Content on the left side column\n * </template>\n *\n * <template #content-col-2>\n * // Content on the right side column\n * </template>\n *\n * <template v-if=\"actions\" #actions>\n * <footer-actions :actions=\"actions\" />\n * </template>\n * </bento-modal-default>\n * `,\n * setup() {\n * const isOpen = ref(true)\n * const footerActions = [{\n * title: 'Primary action',\n * event: () => { ... }\n * }]\n * }\n * }\n */\n export default defineComponent({\n name: 'bento-modal-default',\n });\n</script>\n","<template>\n <base-modal\n ref=\"modalRef\"\n class=\"b-modal-dialog\"\n :actions=\"actions\"\n :active-page=\"activePage\"\n :class=\"modalDialogConditionalClasses\"\n :hide-close-button=\"true\"\n size=\"small\"\n :is-dismissible=\"isDismissible\"\n :is-open=\"isOpen\"\n :modal-role=\"BentoModalRole.ALERT_DIALOG\"\n :initially-open=\"initiallyOpen\"\n v-bind=\"$attrs\"\n @close-modal=\"onCloseModal\"\n >\n <template #default>\n <slot></slot>\n </template>\n <template #content>\n {{ content }}\n </template>\n\n <template #actions>\n <bento-button-actions\n v-if=\"dialogType === 'acknowledgement'\"\n :actions=\"acknowledgementDialogActions\"\n layout=\"buttons-end\"\n />\n\n <bento-button-actions v-else :actions=\"dialogActions\" layout=\"buttons-end\" />\n </template>\n </base-modal>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, onMounted, type PropType, type Ref, ref, toRefs, useSlots } from 'vue';\n import { BentoModalDialogType, BentoModalRole } from '@/components/modal/modal.types';\n import { useHasSlot } from '@/composables';\n import {\n type BentoButtonActionObject,\n BentoButtonActions,\n type BentoButtonActionsList,\n BentoButtonVariant,\n } from '@/components/button';\n import { useI18n } from '@/utils/ts/i18n';\n import BaseModal from '@/components/modal/components/base-modal/base-modal.vue';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const emit = defineEmits([\"close-modal\"]);\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * Only 1 action button is allowed for Modal Dialog\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',2\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * The id of the current active page\n * Should be the same id as the BentoModalPage to be displayed\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * Text that is displayed in the content section of modal\n */\n content: { type: String, required: true },\n\n /**\n * Sets different action buttons styling and appearance\n */\n dialogType: {\n type: String as PropType<BentoModalDialogType | `${BentoModalDialogType}`>,\n required: true,\n },\n\n /**\n * Sets the open attribute on the dialog element, use isOpen instead to toggle modal visbility.\n */\n initiallyOpen: { type: Boolean, default: false },\n\n /**\n * If set to true, it allows the modal to be closed by clicking outside of it\n */\n isDismissible: { type: Boolean, required: true },\n\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: { type: Boolean, required: true },\n });\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const { actions, dialogType } = toRefs(props);\n const modalRef: Ref<InstanceType<typeof BaseModal>> = ref(null);\n\n const onCloseModal = () => {\n emit('close-modal');\n };\n\n const onCloseActionButton = (event: Event) => {\n // Calls \"base-modal\" internal function to initialize the\n // \"close\" animation and trigger the \"close\" event.\n // This follows the same \"dialog\" pattern of calling \"dialog.close()\"\n modalRef.value.internalModalActionClose(event);\n };\n\n const acknowledgementDialogActions = computed(() => [\n {\n title: t('ok') as string,\n event: onCloseActionButton,\n variant: BentoButtonVariant.SECONDARY,\n },\n ]);\n\n const dialogActions = computed(() => {\n const mandatoryCancelActionButton: BentoButtonActionObject = {\n title: 'Cancel',\n event: onCloseActionButton,\n };\n const updatedPassedActionsObject: BentoButtonActionObject = actions?.value?.[0];\n\n if (dialogType.value === BentoModalDialogType.DESTRUCTIVE) {\n updatedPassedActionsObject.critical = true;\n } else if (dialogType.value === BentoModalDialogType.INFO) {\n updatedPassedActionsObject.variant = BentoButtonVariant.SECONDARY;\n }\n\n return [updatedPassedActionsObject, mandatoryCancelActionButton];\n });\n\n const modalDialogConditionalClasses = computed(() => ({\n [`b-modal-dialog--${dialogType.value}`]: dialogType.value,\n }));\n\n onMounted(() => {\n if (props.activePage) {\n throw new Error(\n 'Bento Modal Dialog cannot contain multiple pages. Use Bento Modal default variant instead.'\n );\n }\n\n if (!hasSlot('default') || (!props.content && !hasSlot('content'))) {\n throw new Error('Bento Modal Dialog requires header title and content');\n }\n\n if (actions?.value?.length > 1) {\n throw new Error('Not more than 1 action button may be provided to Modal Dialog');\n }\n\n if (dialogType.value !== BentoModalDialogType.ACKNOWLEDGEMENT && !actions?.value) {\n throw new Error('Modal Dialog, except ACKNOWLEDGEMENT type, always has to contain one action button');\n }\n\n if (dialogType.value === BentoModalDialogType.ACKNOWLEDGEMENT && actions?.value?.length) {\n throw new Error('Acknowledgement Modal Dialog does not accept action buttons');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Creates a \"dialog\" type of modal.\n * These are are modals that require a deliberate user action or acknowledgement\n * (confirmations or destructive actions).\n *\n * It’s not customizable and consists of title, description label and one action.\n *\n * @example\n * import { BentoModalDialog } from '@/components/modal/components';\n *\n * export default {\n * components: { BentoModalDialog },\n * template: `\n * <bento-modal-dialog\n * dialog-type=\"destructive\"\n * :is-dismissible=\"false\"\n * :is-open=\"isOpen\"\n * @close-modal=\"isOpen = false\"\n * >\n * Dialog content\n * </bento-modal-dialog>\n * `,\n * setup() {\n * const isOpen = ref(true)\n * }\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-modal-dialog',\n });\n</script>\n","<template>\n <component\n :is=\"computedVariant\"\n class=\"b-modal\"\n :is-open=\"isOpen\"\n :actions=\"actions\"\n :initially-open=\"initiallyOpen\"\n v-bind=\"customProps\"\n @close-modal=\"onCloseModal\"\n @update:active-page=\"emit('update:active-page', $event)\"\n >\n <template v-if=\"hasSlot('default')\" #default>\n <slot></slot>\n </template>\n <template v-if=\"hasSlot('content-col-1')\" #content-col-1><slot name=\"content-col-1\"></slot></template>\n <template v-if=\"hasSlot('content-col-2')\" #content-col-2><slot name=\"content-col-2\"></slot></template>\n <template v-if=\"hasSlot('content')\" #content><slot name=\"content\"></slot></template>\n </component>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, type PropType, useAttrs, useSlots } from 'vue';\n import {\n BentoModalColumnLayoutVariant,\n BentoModalDialogType,\n BentoModalSize,\n BentoModalVariant,\n BentoModalVariantMapping,\n } from './modal.types';\n import { BentoModalDefault, BentoModalDialog } from '@/components/modal/components';\n import { useHasSlot } from '@/composables';\n import { type BentoButtonActionsList } from '@/components/button';\n import { deprecate } from '@/utils/ts/deprecate';\n\n type BentoModalVariantProp = BentoModalVariant | `${BentoModalVariant}` | `${BentoModalVariantMapping}`;\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const attrs = useAttrs();\n const emit = defineEmits([\"update:active-page\", \"close-modal\"]);\n\n const props = 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 * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',2\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 * The id of the current active page\n * Should be the same id as the BentoModalPage to be displayed\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * Text label that is displayed left to the action buttons\n */\n actionsLabel: { type: String, default: null },\n\n /**\n * Text that will be displayed in the content section of Modal\n */\n content: { type: String, default: null },\n\n /**\n * If a column layout is provided, it renders the respective left column width variant. This can be smaller than the second column, the same size as the second column or bigger than the second column.\n */\n columnsSize: {\n type: String as PropType<BentoModalColumnLayoutVariant | `${BentoModalColumnLayoutVariant}`>,\n default: BentoModalColumnLayoutVariant.SMALLER,\n validator: (value: BentoModalColumnLayoutVariant) =>\n Object.values(BentoModalColumnLayoutVariant).includes(value),\n },\n\n /**\n * If provided, manages the padding of the whole modal container\n */\n customPadding: { type: String, default: null },\n\n /**\n * If passed - sets first button color to red\n */\n destructiveActions: { type: Boolean, default: false },\n\n /**\n * Changes the visual styling of action buttons\n */\n dialogType: {\n type: String as PropType<BentoModalDialogType | `${BentoModalDialogType}`>,\n default: BentoModalDialogType.CONFIRMATION,\n validator: (value: BentoModalDialogType) => Object.values(BentoModalDialogType).includes(value),\n },\n\n /**\n * Hides a cross icon on the right side of the title\n */\n hideCloseButton: { type: Boolean, default: false },\n\n /**\n * If set to true, it allows the modal to be closed without performing an action\n */\n isDismissible: { type: Boolean, default: null },\n\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the open attribute on the dialog element, use isOpen instead to toggle modal visbility.\n */\n initiallyOpen: { type: Boolean, default: false },\n\n /**\n * Sets the width of the modal\n */\n size: {\n type: String as PropType<BentoModalSize | `${BentoModalSize}`>,\n default: BentoModalSize.SMALL,\n validator: (value: BentoModalSize) => Object.values(BentoModalSize).includes(value),\n },\n\n /**\n * Choose between default or dialog versions of modal\n */\n variant: {\n type: String as PropType<BentoModalVariantProp>,\n default: 'default',\n validator: (value: BentoModalVariantProp) =>\n Object.values<BentoModalVariantProp>(BentoModalVariant).includes(value) ||\n Object.values<BentoModalVariantProp>(BentoModalVariantMapping).includes(value),\n },\n\n /**\n * If provided, renders the modal's content in a two-column layout an wth dividers separating its content\n */\n withColumnLayout: { type: Boolean, default: false },\n });\n\n const computedVariant = computed(() => {\n if (Object.values<BentoModalVariantProp>(BentoModalVariantMapping).includes(props.variant)) {\n return props.variant;\n }\n return BentoModalVariantMapping[props.variant.toUpperCase()];\n });\n\n const customProps = computed(() =>\n computedVariant.value === BentoModalVariantMapping.DEFAULT\n ? {\n activePage: props.activePage,\n hideCloseButton: props.hideCloseButton,\n size: props.size,\n customPadding: props.customPadding,\n actionsLabel: props.actionsLabel,\n destructiveActions: props.destructiveActions,\n isDismissible: props.isDismissible ?? true,\n withColumnLayout: props.withColumnLayout,\n columnsSize: props.columnsSize,\n ...attrs,\n }\n : {\n activePage: props.activePage,\n dialogType: props.dialogType,\n content: props.content,\n isDismissible: props.isDismissible ?? false,\n ...attrs,\n }\n );\n\n const onCloseModal = () => {\n emit('close-modal');\n };\n\n if (Object.keys(attrs).includes('overflow-visible')) {\n deprecate(\n 'BentoModal \"overflow-visible\" property',\n `\"overflow-visible\" property was made redundant. BentoModal can work correctly without the need to pass the propery.\n Remove the \"overflow-visible\" prop from BentoModal to remove this error.`,\n '3.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Modal is a window that appear over any other page content\n * and focus user attention exclusively on one task or piece of\n * information at the moment.\n *\n * @example\n * import { BentoModal } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoModal },\n * template: `\n * <bento-modal :isOpen=\"true\">\n * Title of the Modal\n * <template #content>\n * Mandatory content slot\n * </template>\n * </bento-modal>\n * `\n * };\n */\n export default defineComponent({\n components: { BentoModalDefault, BentoModalDialog },\n });\n</script>\n"],"names":["__default__","defineComponent","slots","useSlots","hasSlot","useHasSlot","onCloseModal","emit","onMounted","props","messages","t","useI18n","actions","dialogType","toRefs","modalRef","ref","onCloseActionButton","event","acknowledgementDialogActions","computed","BentoButtonVariant","dialogActions","mandatoryCancelActionButton","updatedPassedActionsObject","BentoModalDialogType","modalDialogConditionalClasses","BentoModalDefault","BentoModalDialog","attrs","useAttrs","computedVariant","BentoModalVariantMapping","customProps","deprecate"],"mappings":";;;;;;;;;AAqMI,MAAAA,IAAeC,EAAgB;AAAA,EAC3B,MAAM;AACV,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA3JKC,IAAQC,EAAA,GACRC,IAAUC,EAAWH,CAAK,GAuG1BI,IAAe,MAAM;AACvB,MAAAC,EAAK,aAAa;AAAA,IACtB;AAEA,WAAAC,EAAU,MAAM;AACZ,UAAI,EAAEJ,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