@adyen/bento-vue2 1.89.2 → 1.91.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/components.d.ts +4 -0
- package/dist/@types/index.d.ts +381 -118
- 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/card.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-picker.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/draggable-handle.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/error-message.css +1 -1
- package/dist/assets/field-label.css +1 -0
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/form-layout-title.css +1 -1
- package/dist/assets/input-field.css +1 -1
- package/dist/assets/input-time.css +1 -0
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/secondary-nav.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/use-cached-selected-values.css +1 -1
- package/dist/button.js +3 -3
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chip.js +1 -1
- package/dist/chunks/accordion-item.D0WVCLec.js +145 -0
- package/dist/chunks/{accordion-item.BZDSJamR.js.map → accordion-item.D0WVCLec.js.map} +1 -1
- package/dist/chunks/action-bar.Dj830k6L.js +334 -0
- package/dist/chunks/{action-bar.CYGUYI0V.js.map → action-bar.Dj830k6L.js.map} +1 -1
- package/dist/chunks/{ai-button.CR_ePQRR.js → ai-button.7L9bANlk.js} +2 -2
- package/dist/chunks/{ai-button.CR_ePQRR.js.map → ai-button.7L9bANlk.js.map} +1 -1
- package/dist/chunks/ai-tag.AyG2UWCB.js +110 -0
- package/dist/chunks/{ai-tag.Cjf38mjR.js.map → ai-tag.AyG2UWCB.js.map} +1 -1
- package/dist/chunks/alert.CXRb-Smf.js +160 -0
- package/dist/chunks/{alert.QVQ6Zjbm.js.map → alert.CXRb-Smf.js.map} +1 -1
- package/dist/chunks/{anchor-scroller.CjJ26PJS.js → anchor-scroller.DWaykZQj.js} +66 -39
- package/dist/chunks/{anchor-scroller.CjJ26PJS.js.map → anchor-scroller.DWaykZQj.js.map} +1 -1
- package/dist/chunks/{base-modal.DmWkavtf.js → base-modal.C52VMtnd.js} +104 -67
- package/dist/chunks/{base-modal.DmWkavtf.js.map → base-modal.C52VMtnd.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.Bi_HXopk.js → button-actions-with-menu.OsPQ-POD.js} +2 -2
- package/dist/chunks/{button-actions-with-menu.Bi_HXopk.js.map → button-actions-with-menu.OsPQ-POD.js.map} +1 -1
- package/dist/chunks/{button-actions.BLk114As.js → button-actions.Bdbu0bvt.js} +222 -148
- package/dist/chunks/{button-actions.BLk114As.js.map → button-actions.Bdbu0bvt.js.map} +1 -1
- package/dist/chunks/{button.DxhJNOtr.js → button.C9b2AC9w.js} +2 -2
- package/dist/chunks/{button.DxhJNOtr.js.map → button.C9b2AC9w.js.map} +1 -1
- package/dist/chunks/{calendar.CXKhBF2f.js → calendar.CqsfThnC.js} +438 -346
- package/dist/chunks/calendar.CqsfThnC.js.map +1 -0
- package/dist/chunks/card.8z7UQeVK.js +165 -0
- package/dist/chunks/{card.GjhsXOT0.js.map → card.8z7UQeVK.js.map} +1 -1
- package/dist/chunks/{checkbox-group.B2BjU3ZN.js → checkbox-group.Dur2Edtw.js} +4 -4
- package/dist/chunks/{checkbox-group.B2BjU3ZN.js.map → checkbox-group.Dur2Edtw.js.map} +1 -1
- package/dist/chunks/{checkbox.CIv8WgGp.js → checkbox.vNjt6QDJ.js} +93 -56
- package/dist/chunks/{checkbox.CIv8WgGp.js.map → checkbox.vNjt6QDJ.js.map} +1 -1
- package/dist/chunks/chip.BFY_-VCz.js +84 -0
- package/dist/chunks/{chip.DTpENaGC.js.map → chip.BFY_-VCz.js.map} +1 -1
- package/dist/chunks/{click-outside.CDz_x8mN.js → click-outside.BG01Sm0A.js} +2 -2
- package/dist/chunks/{click-outside.CDz_x8mN.js.map → click-outside.BG01Sm0A.js.map} +1 -1
- package/dist/chunks/{code-snippet.YIm2oO_o.js → code-snippet.BVpFBhKq.js} +133 -76
- package/dist/chunks/{code-snippet.YIm2oO_o.js.map → code-snippet.BVpFBhKq.js.map} +1 -1
- package/dist/chunks/{controls-group.CqotnNEF.js → controls-group.DSm2Ujwt.js} +2 -2
- package/dist/chunks/{controls-group.CqotnNEF.js.map → controls-group.DSm2Ujwt.js.map} +1 -1
- package/dist/chunks/copy.qqGYFbKJ.js +133 -0
- package/dist/chunks/{copy.BVGQcf22.js.map → copy.qqGYFbKJ.js.map} +1 -1
- package/dist/chunks/{country.D20NCLLG.js → country.BEwW8TQo.js} +3 -3
- package/dist/chunks/{country.D20NCLLG.js.map → country.BEwW8TQo.js.map} +1 -1
- package/dist/chunks/country.types.jjXwaoMl.js +2537 -0
- package/dist/chunks/country.types.jjXwaoMl.js.map +1 -0
- package/dist/chunks/{dashboard-section.BubZyu8i.js → dashboard-section.DNxNVV44.js} +3 -3
- package/dist/chunks/{dashboard-section.BubZyu8i.js.map → dashboard-section.DNxNVV44.js.map} +1 -1
- package/dist/chunks/{dashed-underline.pjYTS0m1.js → dashed-underline.DL2_sik5.js} +3 -3
- package/dist/chunks/{dashed-underline.pjYTS0m1.js.map → dashed-underline.DL2_sik5.js.map} +1 -1
- package/dist/chunks/{data-grid-template.D8RhngPj.js → data-grid-template.BFv1zr6g.js} +4 -4
- package/dist/chunks/{data-grid-template.D8RhngPj.js.map → data-grid-template.BFv1zr6g.js.map} +1 -1
- package/dist/chunks/data-grid.ZHY5EzP3.js +4071 -0
- package/dist/chunks/data-grid.ZHY5EzP3.js.map +1 -0
- package/dist/chunks/date-picker.kl6aFlr1.js +237 -0
- package/dist/chunks/date-picker.kl6aFlr1.js.map +1 -0
- package/dist/chunks/date-range-picker.LCWVAa5R.js +1089 -0
- package/dist/chunks/date-range-picker.LCWVAa5R.js.map +1 -0
- package/dist/chunks/dialog-page.EdejG53a.js +143 -0
- package/dist/chunks/{dialog-page.oyG153fC.js.map → dialog-page.EdejG53a.js.map} +1 -1
- package/dist/chunks/{directive.rXUeDb8p.js → directive.Bfr4fuOy.js} +2 -2
- package/dist/chunks/{directive.rXUeDb8p.js.map → directive.Bfr4fuOy.js.map} +1 -1
- package/dist/chunks/draggable-handle.Ba28eM8o.js +245 -0
- package/dist/chunks/draggable-handle.Ba28eM8o.js.map +1 -0
- package/dist/chunks/{dropdown-tag.BRB-emd1.js → dropdown-tag.B61hPq5n.js} +5 -5
- package/dist/chunks/{dropdown-tag.BRB-emd1.js.map → dropdown-tag.B61hPq5n.js.map} +1 -1
- package/dist/chunks/dropdown.Ca-f8tdX.js +1140 -0
- package/dist/chunks/dropdown.Ca-f8tdX.js.map +1 -0
- package/dist/chunks/{empty-state.D_Ac-XXH.js → empty-state.DMV23IZy.js} +2 -2
- package/dist/chunks/{empty-state.D_Ac-XXH.js.map → empty-state.DMV23IZy.js.map} +1 -1
- package/dist/chunks/error-message.CyERcfdt.js +72 -0
- package/dist/chunks/error-message.CyERcfdt.js.map +1 -0
- package/dist/chunks/field-label.DjjjkcO6.js +97 -0
- package/dist/chunks/field-label.DjjjkcO6.js.map +1 -0
- package/dist/chunks/{file-uploader.D5Rjsx4k.js → file-uploader.DeWmLpfp.js} +751 -469
- package/dist/chunks/{file-uploader.D5Rjsx4k.js.map → file-uploader.DeWmLpfp.js.map} +1 -1
- package/dist/chunks/{filter-bar.zD_ctViU.js → filter-bar.Bd4ghW_B.js} +1596 -1039
- package/dist/chunks/filter-bar.Bd4ghW_B.js.map +1 -0
- package/dist/chunks/fixed-scroller.DR2E_No4.js +148 -0
- package/dist/chunks/{fixed-scroller.MerESbd_.js.map → fixed-scroller.DR2E_No4.js.map} +1 -1
- package/dist/chunks/{footer-actions.CiPj7hZG.js → footer-actions.CvUaoMzj.js} +3 -3
- package/dist/chunks/{footer-actions.CiPj7hZG.js.map → footer-actions.CvUaoMzj.js.map} +1 -1
- package/dist/chunks/form-layout-title.DzGajv4U.js +248 -0
- package/dist/chunks/form-layout-title.DzGajv4U.js.map +1 -0
- package/dist/chunks/{header-meta.Dq6TlNPw.js → header-meta.AXUGoqDd.js} +127 -73
- package/dist/chunks/{header-meta.Dq6TlNPw.js.map → header-meta.AXUGoqDd.js.map} +1 -1
- package/dist/chunks/{header-with-views.DaEhkSS8.js → header-with-views.Ba4dswJF.js} +1121 -680
- package/dist/chunks/{header-with-views.DaEhkSS8.js.map → header-with-views.Ba4dswJF.js.map} +1 -1
- package/dist/chunks/{header.DkC-KKWa.js → header.C7B7RBib.js} +3 -3
- package/dist/chunks/{header.DkC-KKWa.js.map → header.C7B7RBib.js.map} +1 -1
- package/dist/chunks/{info-icon.BF8KxU-k.js → info-icon.DCR42Kvm.js} +2 -2
- package/dist/chunks/{info-icon.BF8KxU-k.js.map → info-icon.DCR42Kvm.js.map} +1 -1
- package/dist/chunks/input-field-password.BNAtIn_D.js +381 -0
- package/dist/chunks/{input-field-password.BKT1mYUw.js.map → input-field-password.BNAtIn_D.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.BjRKjQOQ.js → input-field-phone-number.CEYx1s4b.js} +98 -71
- package/dist/chunks/{input-field-phone-number.BjRKjQOQ.js.map → input-field-phone-number.CEYx1s4b.js.map} +1 -1
- package/dist/chunks/input-field.Dh5W0Az-.js +211 -0
- package/dist/chunks/input-field.Dh5W0Az-.js.map +1 -0
- package/dist/chunks/input-time.BLuMfakv.js +135 -0
- package/dist/chunks/input-time.BLuMfakv.js.map +1 -0
- package/dist/chunks/inspector.BzBPlz-5.js +172 -0
- package/dist/chunks/{inspector.Bnm0hl_D.js.map → inspector.BzBPlz-5.js.map} +1 -1
- package/dist/chunks/{link.MhoM3zQj.js → link.DB5g6d48.js} +56 -29
- package/dist/chunks/{link.MhoM3zQj.js.map → link.DB5g6d48.js.map} +1 -1
- package/dist/chunks/{list-item.BnzU1LIu.js → list-item.DqTHh8-Z.js} +2 -2
- package/dist/chunks/{list-item.BnzU1LIu.js.map → list-item.DqTHh8-Z.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.BhPVuAjJ.js → listbox-option-tag.CvbE-EuG.js} +2 -2
- package/dist/chunks/{listbox-option-tag.BhPVuAjJ.js.map → listbox-option-tag.CvbE-EuG.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.CXOq6_Cv.js → modal-fullscreen.DTvg2NLk.js} +63 -36
- package/dist/chunks/{modal-fullscreen.CXOq6_Cv.js.map → modal-fullscreen.DTvg2NLk.js.map} +1 -1
- package/dist/chunks/{modal.o0KddMiG.js → modal.D_TcWTkf.js} +63 -36
- package/dist/chunks/{modal.o0KddMiG.js.map → modal.D_TcWTkf.js.map} +1 -1
- package/dist/chunks/on-click-outside.Cy1eFULD.js +109 -0
- package/dist/chunks/on-click-outside.Cy1eFULD.js.map +1 -0
- package/dist/chunks/{pagination.ZISqB4M_.js → pagination.D6BxMw5L.js} +221 -99
- package/dist/chunks/{pagination.ZISqB4M_.js.map → pagination.D6BxMw5L.js.map} +1 -1
- package/dist/chunks/promo-banner.Dc_kK1x9.js +91 -0
- package/dist/chunks/{promo-banner.Db2kh2qK.js.map → promo-banner.Dc_kK1x9.js.map} +1 -1
- package/dist/chunks/{radio-group.DnMy7brs.js → radio-group.Bb-L-0io.js} +4 -4
- package/dist/chunks/{radio-group.DnMy7brs.js.map → radio-group.Bb-L-0io.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.Cbv1DxXn.js → rich-text-editor.Dtdfh-0V.js} +1782 -1731
- package/dist/chunks/{rich-text-editor.Cbv1DxXn.js.map → rich-text-editor.Dtdfh-0V.js.map} +1 -1
- package/dist/chunks/search-bar.MVJS9-Mh.js +126 -0
- package/dist/chunks/{search-bar.DPjYDhja.js.map → search-bar.MVJS9-Mh.js.map} +1 -1
- package/dist/chunks/secondary-nav.C-nPZR-2.js +226 -0
- package/dist/chunks/secondary-nav.C-nPZR-2.js.map +1 -0
- package/dist/chunks/{segmented-control.BqIiX9hv.js → segmented-control.DDtjX-V5.js} +2 -2
- package/dist/chunks/{segmented-control.BqIiX9hv.js.map → segmented-control.DDtjX-V5.js.map} +1 -1
- package/dist/chunks/{selection-card-group.IPiouuot.js → selection-card-group.CLJPaknG.js} +3 -3
- package/dist/chunks/{selection-card-group.IPiouuot.js.map → selection-card-group.CLJPaknG.js.map} +1 -1
- package/dist/chunks/{sidepanel.BGMjjB3F.js → sidepanel.BTRfwGiS.js} +66 -39
- package/dist/chunks/{sidepanel.BGMjjB3F.js.map → sidepanel.BTRfwGiS.js.map} +1 -1
- package/dist/chunks/{step.QFER3tSj.js → step.TDm_ts1S.js} +92 -63
- package/dist/chunks/{step.QFER3tSj.js.map → step.TDm_ts1S.js.map} +1 -1
- package/dist/chunks/{structured-list-item.BDJKRC_8.js → structured-list-item.BBBtie1s.js} +58 -31
- package/dist/chunks/{structured-list-item.BDJKRC_8.js.map → structured-list-item.BBBtie1s.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.CIkArZf5.js → summary-grid.types.DUIqCmwg.js} +5 -5
- package/dist/chunks/{summary-grid.types.CIkArZf5.js.map → summary-grid.types.DUIqCmwg.js.map} +1 -1
- package/dist/chunks/{tab.CaXF0dho.js → tab.CNIZyfZt.js} +2 -2
- package/dist/chunks/{tab.CaXF0dho.js.map → tab.CNIZyfZt.js.map} +1 -1
- package/dist/chunks/{tag.CocLKztJ.js → tag.D2xagTJv.js} +2 -2
- package/dist/chunks/{tag.CocLKztJ.js.map → tag.D2xagTJv.js.map} +1 -1
- package/dist/chunks/textarea.CJS-1I41.js +219 -0
- package/dist/chunks/{textarea.D4X6Ss9q.js.map → textarea.CJS-1I41.js.map} +1 -1
- package/dist/chunks/timeline-item.BOUWkLi1.js +322 -0
- package/dist/chunks/{timeline-item.C8BxWdy1.js.map → timeline-item.BOUWkLi1.js.map} +1 -1
- package/dist/chunks/{toast.BRI3G7TL.js → toast.d8vg71CB.js} +81 -54
- package/dist/chunks/{toast.BRI3G7TL.js.map → toast.d8vg71CB.js.map} +1 -1
- package/dist/chunks/{tooltip.CbsNGnhw.js → tooltip.BxtnF3is.js} +38 -36
- package/dist/chunks/tooltip.BxtnF3is.js.map +1 -0
- package/dist/chunks/{tutorial.BzV6bHQJ.js → tutorial.CZt_mcuT.js} +190 -103
- package/dist/chunks/{tutorial.BzV6bHQJ.js.map → tutorial.CZt_mcuT.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.DqX2qsMC.js → use-cached-selected-values.BJbWbkEQ.js} +553 -417
- package/dist/chunks/use-cached-selected-values.BJbWbkEQ.js.map +1 -0
- package/dist/chunks/{use-country-items.CI8C7MLU.js → use-country-items.B4j8pAvW.js} +3 -3
- package/dist/chunks/{use-country-items.CI8C7MLU.js.map → use-country-items.B4j8pAvW.js.map} +1 -1
- package/dist/chunks/use-country-phon-code.ByqnuIni.js +6386 -0
- package/dist/chunks/use-country-phon-code.ByqnuIni.js.map +1 -0
- package/dist/chunks/{use-date-input-formatter.BYaTO3vz.js → use-date-input-formatter.Djf8AoLr.js} +2 -2
- package/dist/chunks/{use-date-input-formatter.BYaTO3vz.js.map → use-date-input-formatter.Djf8AoLr.js.map} +1 -1
- package/dist/chunks/use-touch-device.DTqFAbXh.js +11 -0
- package/dist/chunks/use-touch-device.DTqFAbXh.js.map +1 -0
- package/dist/click-outside.js +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/country.js +3 -3
- 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/draggable.js +1396 -0
- package/dist/draggable.js.map +1 -0
- package/dist/dropdown.js +11 -12
- package/dist/dropdown.js.map +1 -1
- package/dist/empty-state.js +1 -1
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/form-layout.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +280 -275
- 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 +5 -0
- package/dist/input-time.js.map +1 -0
- package/dist/inspector.js +1 -1
- package/dist/internal.js +26 -25
- package/dist/internal.js.map +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/pagination.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/promo-banner.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/stepper.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tag.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +297 -4
- package/package.json +10 -15
- package/dist/assets/dropdown-default-textbox.css +0 -1
- package/dist/chunks/accordion-item.BZDSJamR.js +0 -108
- package/dist/chunks/action-bar.CYGUYI0V.js +0 -207
- package/dist/chunks/ai-tag.Cjf38mjR.js +0 -73
- package/dist/chunks/alert.QVQ6Zjbm.js +0 -93
- package/dist/chunks/calendar.CXKhBF2f.js.map +0 -1
- package/dist/chunks/card.GjhsXOT0.js +0 -128
- package/dist/chunks/chip.DTpENaGC.js +0 -57
- package/dist/chunks/copy.BVGQcf22.js +0 -86
- package/dist/chunks/country.types.DxKjyd0S.js +0 -20
- package/dist/chunks/country.types.DxKjyd0S.js.map +0 -1
- package/dist/chunks/data-grid.DJG8Ty0A.js +0 -3194
- package/dist/chunks/data-grid.DJG8Ty0A.js.map +0 -1
- package/dist/chunks/date-picker.CnazYcSX.js +0 -155
- package/dist/chunks/date-picker.CnazYcSX.js.map +0 -1
- package/dist/chunks/date-range-picker.Bf9pRNL7.js +0 -811
- package/dist/chunks/date-range-picker.Bf9pRNL7.js.map +0 -1
- package/dist/chunks/debounce.DUTu11PS.js +0 -10
- package/dist/chunks/debounce.DUTu11PS.js.map +0 -1
- package/dist/chunks/dialog-page.oyG153fC.js +0 -116
- package/dist/chunks/dropdown-default-textbox.Dvzg0StF.js +0 -337
- package/dist/chunks/dropdown-default-textbox.Dvzg0StF.js.map +0 -1
- package/dist/chunks/dropdown.Ct7uhPr6.js +0 -696
- package/dist/chunks/dropdown.Ct7uhPr6.js.map +0 -1
- package/dist/chunks/error-message.RxdStT3S.js +0 -106
- package/dist/chunks/error-message.RxdStT3S.js.map +0 -1
- package/dist/chunks/filter-bar.zD_ctViU.js.map +0 -1
- package/dist/chunks/fixed-scroller.MerESbd_.js +0 -111
- package/dist/chunks/form-layout-title.Bw7VgOO5.js +0 -210
- package/dist/chunks/form-layout-title.Bw7VgOO5.js.map +0 -1
- package/dist/chunks/input-field-password.BKT1mYUw.js +0 -234
- package/dist/chunks/input-field.m1PMwa4C.js +0 -170
- package/dist/chunks/input-field.m1PMwa4C.js.map +0 -1
- package/dist/chunks/inspector.Bnm0hl_D.js +0 -105
- package/dist/chunks/on-click-outside.BW4rkhzG.js +0 -91
- package/dist/chunks/on-click-outside.BW4rkhzG.js.map +0 -1
- package/dist/chunks/promo-banner.Db2kh2qK.js +0 -64
- package/dist/chunks/search-bar.DPjYDhja.js +0 -89
- package/dist/chunks/secondary-nav.CwJjkJkj.js +0 -112
- package/dist/chunks/secondary-nav.CwJjkJkj.js.map +0 -1
- package/dist/chunks/textarea.D4X6Ss9q.js +0 -169
- package/dist/chunks/timeline-item.C8BxWdy1.js +0 -238
- package/dist/chunks/tooltip.CbsNGnhw.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.DqX2qsMC.js.map +0 -1
- package/dist/chunks/use-country-phon-code.C6orQNnM.js +0 -291
- package/dist/chunks/use-country-phon-code.C6orQNnM.js.map +0 -1
- package/dist/draggable-handle.js +0 -149
- package/dist/draggable-handle.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-fullscreen.CXOq6_Cv.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 };\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 '@/core/utils/ts';\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","instance","_a","__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;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAC,MAAA,MAAA;;AACI,MAAAL,EAAA,SAAA3B,IAAA2B,EAAA,UAAA,gBAAA3B,EAAA,OAAA,CAAAiC,MAAAA,MAAAD;AAAA,IAAqE,GAIzEE,IAAA,CAAAD,OACIA,KACIN,EAAA,MAAA,KAAAM,CAAA,GAGJ,EAAA,gBAAAF,EAAAE,CAAA,EAAA;AAGJ,WAAAV,EAAAY,IAAAD,CAAA;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"modal-fullscreen.DTvg2NLk.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 };\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 '@/core/utils/ts';\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","instance","_a","__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;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAzHA,EAAA,EAAA,IAAAC,EAAA,GA6DAC,IAAAC,EAAA,GACAC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,OAAA,CAAAiC,MAAAA,MAAAD;AAAA,IAAqE,GAIzEE,IAAA,CAAAD,OACIA,KACIN,EAAA,MAAA,KAAAM,CAAA,GAGJ,EAAA,gBAAAF,EAAAE,CAAA,EAAA;AAGJ,WAAAV,EAAAY,IAAAD,CAAA;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as p, useSlots as B, onMounted as
|
|
2
|
-
import { B as g, h as
|
|
3
|
-
import { u as
|
|
4
|
-
import { F as R } from "./footer-actions.
|
|
5
|
-
import { n as
|
|
6
|
-
import { b as M } from "./button.
|
|
1
|
+
import { defineComponent as p, useSlots as B, onMounted as O, toRefs as E, ref as k, computed as f, useAttrs as L, watch as P } from "vue";
|
|
2
|
+
import { B as g, h as A, a as d, d as x, e as C, g as v, f as T } from "./base-modal.C52VMtnd.js";
|
|
3
|
+
import { u as S } from "./use-has-slot.C9lQZ6nz.js";
|
|
4
|
+
import { F as R } from "./footer-actions.CvUaoMzj.js";
|
|
5
|
+
import { n as b } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
6
|
+
import { b as M } from "./button.C9b2AC9w.js";
|
|
7
7
|
import { u as z } from "./index.B6WW_F-J.js";
|
|
8
|
-
import { B as N } from "./button-actions.
|
|
8
|
+
import { B as N } from "./button-actions.Bdbu0bvt.js";
|
|
9
9
|
import { d as $ } from "./typography.C8lPlsbD.js";
|
|
10
|
-
const
|
|
10
|
+
const K = p({
|
|
11
11
|
name: "bento-modal-default"
|
|
12
|
-
}),
|
|
13
|
-
...
|
|
12
|
+
}), F = /* @__PURE__ */ p({
|
|
13
|
+
...K,
|
|
14
14
|
props: {
|
|
15
15
|
/**
|
|
16
16
|
* List of actions that will be used to render the buttons.
|
|
@@ -101,16 +101,16 @@ const F = p({
|
|
|
101
101
|
},
|
|
102
102
|
emits: ["update:active-page", "close-modal"],
|
|
103
103
|
setup(a, { emit: t }) {
|
|
104
|
-
const o = a, e = B(), l =
|
|
104
|
+
const o = a, e = B(), l = S(e), i = () => {
|
|
105
105
|
t("close-modal");
|
|
106
106
|
};
|
|
107
|
-
return
|
|
107
|
+
return O(() => {
|
|
108
108
|
if (!(l("content") || l("content-col-1") && l("content-col-2")) && !o.activePage)
|
|
109
109
|
throw new Error("Bento Modal default variant requires content slot or column slots");
|
|
110
|
-
}), { __sfc: !0, slots: e, hasSlot: l, emit: t, props: o, onCloseModal: i, FooterActions: R, BaseModal:
|
|
110
|
+
}), { __sfc: !0, slots: e, hasSlot: l, emit: t, props: o, onCloseModal: i, FooterActions: R, BaseModal: A };
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
|
-
var
|
|
113
|
+
var j = function() {
|
|
114
114
|
var t = this, o = t._self._c, e = t._self._setupProxy;
|
|
115
115
|
return o(e.BaseModal, t._b({ staticClass: "b-modal-default", attrs: { actions: t.actions, "active-page": t.activePage, size: t.size, "hide-close-button": t.hideCloseButton, "columns-size": t.columnsSize, "custom-padding": t.customPadding, "is-dismissible": t.isDismissible, "is-open": t.isOpen, "with-column-layout": t.withColumnLayout, "initially-open": t.initiallyOpen }, on: { "update:active-page": function(l) {
|
|
116
116
|
return e.emit("update:active-page", l);
|
|
@@ -127,23 +127,50 @@ var q = function() {
|
|
|
127
127
|
return [o(e.FooterActions, { attrs: { actions: t.actions, "actions-label": t.actionsLabel, "destructive-actions": t.destructiveActions } })];
|
|
128
128
|
})];
|
|
129
129
|
}, proxy: !0 } : null], null, !0) }, "base-modal", t.$attrs, !1));
|
|
130
|
-
},
|
|
130
|
+
}, q = [], I = /* @__PURE__ */ b(
|
|
131
|
+
F,
|
|
131
132
|
j,
|
|
132
133
|
q,
|
|
133
|
-
I,
|
|
134
134
|
!1,
|
|
135
135
|
null,
|
|
136
136
|
null
|
|
137
137
|
);
|
|
138
|
-
const
|
|
139
|
-
"
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
138
|
+
const V = I.exports, G = {
|
|
139
|
+
"de-DE": {
|
|
140
|
+
ok: "OK"
|
|
141
|
+
},
|
|
142
|
+
"en-GB": {
|
|
143
|
+
ok: "OK"
|
|
144
|
+
},
|
|
145
|
+
"en-US": {
|
|
146
|
+
ok: "OK"
|
|
147
|
+
},
|
|
148
|
+
"es-ES": {
|
|
149
|
+
ok: "OK"
|
|
150
|
+
},
|
|
151
|
+
"es-MX": {
|
|
152
|
+
ok: "OK"
|
|
153
|
+
},
|
|
154
|
+
"fr-FR": {
|
|
155
|
+
ok: "OK"
|
|
156
|
+
},
|
|
157
|
+
"it-IT": {
|
|
158
|
+
ok: "OK"
|
|
159
|
+
},
|
|
160
|
+
"ja-JP": {
|
|
161
|
+
ok: "OK"
|
|
162
|
+
},
|
|
163
|
+
"pt-BR": {
|
|
164
|
+
ok: "OK"
|
|
165
|
+
},
|
|
166
|
+
"zh-CN": {
|
|
167
|
+
ok: "确定"
|
|
168
|
+
}
|
|
169
|
+
}, U = p({
|
|
170
|
+
i18n: { messages: G },
|
|
144
171
|
name: "bento-modal-dialog"
|
|
145
172
|
}), W = /* @__PURE__ */ p({
|
|
146
|
-
...
|
|
173
|
+
...U,
|
|
147
174
|
props: {
|
|
148
175
|
/**
|
|
149
176
|
* List of actions that will be used to render the buttons.
|
|
@@ -204,7 +231,7 @@ const K = V.exports, U = {
|
|
|
204
231
|
},
|
|
205
232
|
emits: ["close-modal"],
|
|
206
233
|
setup(a, { emit: t }) {
|
|
207
|
-
const o = a, { t: e } = z(), l = B(), i =
|
|
234
|
+
const o = a, { t: e } = z(), l = B(), i = S(l), { actions: n, dialogType: s } = E(o), m = k(null), y = () => {
|
|
208
235
|
t("close-modal");
|
|
209
236
|
}, r = (u) => {
|
|
210
237
|
m.value.internalModalActionClose(u);
|
|
@@ -214,17 +241,17 @@ const K = V.exports, U = {
|
|
|
214
241
|
event: r,
|
|
215
242
|
variant: M.SECONDARY
|
|
216
243
|
}
|
|
217
|
-
]),
|
|
244
|
+
]), D = f(() => {
|
|
218
245
|
var h;
|
|
219
246
|
const u = {
|
|
220
247
|
title: "Cancel",
|
|
221
248
|
event: r
|
|
222
249
|
}, c = (h = n == null ? void 0 : n.value) == null ? void 0 : h[0];
|
|
223
250
|
return s.value === d.DESTRUCTIVE ? c.critical = !0 : s.value === d.INFO && (c.variant = M.SECONDARY), [c, u];
|
|
224
|
-
}),
|
|
251
|
+
}), w = f(() => ({
|
|
225
252
|
[`b-modal-dialog--${s.value}`]: s.value
|
|
226
253
|
}));
|
|
227
|
-
return
|
|
254
|
+
return O(() => {
|
|
228
255
|
var u, c;
|
|
229
256
|
if (o.activePage)
|
|
230
257
|
throw new Error(
|
|
@@ -238,7 +265,7 @@ const K = V.exports, U = {
|
|
|
238
265
|
throw new Error("Modal Dialog, except ACKNOWLEDGEMENT type, always has to contain one action button");
|
|
239
266
|
if (s.value === d.ACKNOWLEDGEMENT && ((c = n == null ? void 0 : n.value) != null && c.length))
|
|
240
267
|
throw new Error("Acknowledgement Modal Dialog does not accept action buttons");
|
|
241
|
-
}), { __sfc: !0, emit: t, props: o, t: e, slots: l, hasSlot: i, actions: n, dialogType: s, modalRef: m, onCloseModal: y, onCloseActionButton: r, acknowledgementDialogActions: _, dialogActions:
|
|
268
|
+
}), { __sfc: !0, emit: t, props: o, t: e, slots: l, hasSlot: i, actions: n, dialogType: s, modalRef: m, onCloseModal: y, onCloseActionButton: r, acknowledgementDialogActions: _, dialogActions: D, modalDialogConditionalClasses: w, BentoModalRole: x, BentoButtonActions: N, BaseModal: A };
|
|
242
269
|
}
|
|
243
270
|
});
|
|
244
271
|
var Y = function() {
|
|
@@ -250,7 +277,7 @@ var Y = function() {
|
|
|
250
277
|
}, proxy: !0 }, { key: "actions", fn: function() {
|
|
251
278
|
return [e.dialogType === "acknowledgement" ? o(e.BentoButtonActions, { attrs: { actions: e.acknowledgementDialogActions, layout: "buttons-end" } }) : o(e.BentoButtonActions, { attrs: { actions: e.dialogActions, layout: "buttons-end" } })];
|
|
252
279
|
}, proxy: !0 }], null, !0) }, "base-modal", t.$attrs, !1));
|
|
253
|
-
}, H = [], J = /* @__PURE__ */
|
|
280
|
+
}, H = [], J = /* @__PURE__ */ b(
|
|
254
281
|
W,
|
|
255
282
|
Y,
|
|
256
283
|
H,
|
|
@@ -258,10 +285,10 @@ var Y = function() {
|
|
|
258
285
|
null,
|
|
259
286
|
null
|
|
260
287
|
);
|
|
261
|
-
const
|
|
262
|
-
components: { BentoModalDefault:
|
|
288
|
+
const X = J.exports, Q = p({
|
|
289
|
+
components: { BentoModalDefault: V, BentoModalDialog: X }
|
|
263
290
|
}), Z = /* @__PURE__ */ p({
|
|
264
|
-
...
|
|
291
|
+
...Q,
|
|
265
292
|
__name: "modal",
|
|
266
293
|
props: {
|
|
267
294
|
/**
|
|
@@ -375,7 +402,7 @@ const Q = J.exports, X = p({
|
|
|
375
402
|
},
|
|
376
403
|
emits: ["update:active-page", "close-modal"],
|
|
377
404
|
setup(a, { emit: t }) {
|
|
378
|
-
const o = a, e = 500, l = B(), i =
|
|
405
|
+
const o = a, e = 500, l = B(), i = S(l), n = L(), s = f(() => Object.values(v).includes(o.variant) ? o.variant : v[o.variant.toUpperCase()]), m = f(
|
|
379
406
|
() => s.value === v.DEFAULT ? {
|
|
380
407
|
activePage: o.activePage,
|
|
381
408
|
hideCloseButton: o.hideCloseButton,
|
|
@@ -397,7 +424,7 @@ const Q = J.exports, X = p({
|
|
|
397
424
|
), y = () => {
|
|
398
425
|
t("close-modal");
|
|
399
426
|
};
|
|
400
|
-
return
|
|
427
|
+
return P(
|
|
401
428
|
() => o.actions,
|
|
402
429
|
() => {
|
|
403
430
|
var r, _;
|
|
@@ -424,7 +451,7 @@ var tt = function() {
|
|
|
424
451
|
}, proxy: !0 } : null, e.hasSlot("content") ? { key: "content", fn: function() {
|
|
425
452
|
return [t._t("content")];
|
|
426
453
|
}, proxy: !0 } : null], null, !0) }, "component", e.customProps, !1));
|
|
427
|
-
}, et = [], ot = /* @__PURE__ */
|
|
454
|
+
}, et = [], ot = /* @__PURE__ */ b(
|
|
428
455
|
Z,
|
|
429
456
|
tt,
|
|
430
457
|
et,
|
|
@@ -436,4 +463,4 @@ const pt = ot.exports;
|
|
|
436
463
|
export {
|
|
437
464
|
pt as B
|
|
438
465
|
};
|
|
439
|
-
//# sourceMappingURL=modal.
|
|
466
|
+
//# sourceMappingURL=modal.D_TcWTkf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.o0KddMiG.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, watch } 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 const LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME = 500;\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 the first button is a loading button then close the modal have 0.5 seconds\n // if the state is changed to 'success'.\n watch(\n () => props.actions,\n () => {\n if (props.actions?.[0]?.state === 'success') {\n setTimeout(onCloseModal, LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME);\n }\n }\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","_a","BentoModalDialogType","modalDialogConditionalClasses","_b","BentoModalDefault","BentoModalDialog","LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME","attrs","useAttrs","computedVariant","BentoModalVariantMapping","customProps","watch","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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A,EAAM,iBAAiB;AAAA,QACtC,kBAAkBA,EAAM;AAAA,QACxB,aAAaA,EAAM;AAAA,QACnB,GAAGwB;AAAA,MAAA,IAEP;AAAA,QACI,YAAYxB,EAAM;AAAA,QAClB,YAAYA,EAAM;AAAA,QAClB,SAASA,EAAM;AAAA,QACf,eAAeA,EAAM,iBAAiB;AAAA,QACtC,GAAGwB;AAAA,MAAA;AAAA,IACP,GAGJ3B,IAAe,MAAM;AACvB,MAAAC,EAAK,aAAa;AAAA,IACtB;AAIA,WAAA+B;AAAA,MACI,MAAM7B,EAAM;AAAA,MACZ,MAAM;;AACF,UAAIoB,KAAAH,IAAAjB,EAAM,YAAN,gBAAAiB,EAAgB,OAAhB,gBAAAG,EAAoB,WAAU,aAC9B,WAAWvB,GAAc0B,CAA0C;AAAA,MAE3E;AAAA,IAAA,GAGA,OAAO,KAAKC,CAAK,EAAE,SAAS,kBAAkB,KAC9CM;AAAA,MACI;AAAA,MACA;AAAA;AAAA,MAEA;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"modal.D_TcWTkf.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, watch } 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 const LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME = 500;\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 the first button is a loading button then close the modal have 0.5 seconds\n // if the state is changed to 'success'.\n watch(\n () => props.actions,\n () => {\n if (props.actions?.[0]?.state === 'success') {\n setTimeout(onCloseModal, LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME);\n }\n }\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","_a","BentoModalDialogType","modalDialogConditionalClasses","_b","BentoModalDefault","BentoModalDialog","LOADING_BTN_CLOS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v = (o) => typeof o == "string";
|
|
4
|
+
function y(...o) {
|
|
5
|
+
let n, i, r, d;
|
|
6
|
+
if (v(o[0]) || Array.isArray(o[0]) ? ([i, r, d] = o, n = L) : [n, i, r, d] = o, !n)
|
|
7
|
+
return w;
|
|
8
|
+
Array.isArray(i) || (i = [i]), Array.isArray(r) || (r = [r]);
|
|
9
|
+
const a = [], E = () => {
|
|
10
|
+
a.forEach((c) => c()), a.length = 0;
|
|
11
|
+
}, s = (c, l, h, e) => (c.addEventListener(l, h, e), () => c.removeEventListener(l, h, e)), p = k(
|
|
12
|
+
() => [u(n), I(d)],
|
|
13
|
+
([c, l]) => {
|
|
14
|
+
E(), c && a.push(
|
|
15
|
+
...i.flatMap(
|
|
16
|
+
(h) => r.map(
|
|
17
|
+
(e) => s(
|
|
18
|
+
c,
|
|
19
|
+
h,
|
|
20
|
+
e,
|
|
21
|
+
l
|
|
22
|
+
)
|
|
23
|
+
)
|
|
24
|
+
)
|
|
25
|
+
);
|
|
26
|
+
},
|
|
27
|
+
{ immediate: !0, flush: "post" }
|
|
28
|
+
);
|
|
29
|
+
return () => {
|
|
30
|
+
p(), E();
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
let P = !1;
|
|
34
|
+
function g(o, n, i = {}) {
|
|
35
|
+
const { window: r = L, ignore: d = [], capture: a = !0, detectIframe: E = !1 } = i;
|
|
36
|
+
if (!r)
|
|
37
|
+
return;
|
|
38
|
+
S && !P && (P = !0, Array.from(r.document.body.children).forEach((e) => e.addEventListener("click", w)));
|
|
39
|
+
let s = !0, p = !1;
|
|
40
|
+
const m = (e) => (
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
42
|
+
d.some((t) => {
|
|
43
|
+
if (typeof t == "string")
|
|
44
|
+
return Array.from(r.document.querySelectorAll(t)).some(
|
|
45
|
+
(A) => A === e.target || e.composedPath().includes(A)
|
|
46
|
+
);
|
|
47
|
+
const f = u(t);
|
|
48
|
+
return f && (e.target === f || e.composedPath().includes(f));
|
|
49
|
+
})
|
|
50
|
+
), l = [
|
|
51
|
+
y(r, "click", (e) => {
|
|
52
|
+
if (p) {
|
|
53
|
+
p = !1;
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const t = u(o);
|
|
57
|
+
if (!(!t || t === e.target || e.composedPath().includes(t))) {
|
|
58
|
+
if (e.detail === 0 && (s = !m(e)), !s) {
|
|
59
|
+
s = !0;
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
n(e);
|
|
63
|
+
}
|
|
64
|
+
}, { passive: !0, capture: a }),
|
|
65
|
+
// Handle touch events on mobile where `click` may not fire on non-interactive elements
|
|
66
|
+
y(
|
|
67
|
+
r,
|
|
68
|
+
"touchend",
|
|
69
|
+
(e) => {
|
|
70
|
+
if (p = !0, !s) {
|
|
71
|
+
s = !0;
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const t = u(o);
|
|
75
|
+
!t || e.composedPath().includes(t) || m(e) || n(e);
|
|
76
|
+
},
|
|
77
|
+
{ passive: !0, capture: a }
|
|
78
|
+
),
|
|
79
|
+
y(
|
|
80
|
+
r,
|
|
81
|
+
"pointerdown",
|
|
82
|
+
(e) => {
|
|
83
|
+
const t = u(o);
|
|
84
|
+
t && (s = !e.composedPath().includes(t) && !m(e));
|
|
85
|
+
},
|
|
86
|
+
{ passive: !0 }
|
|
87
|
+
),
|
|
88
|
+
y(
|
|
89
|
+
r,
|
|
90
|
+
"pointerup",
|
|
91
|
+
(e) => {
|
|
92
|
+
const t = u(o);
|
|
93
|
+
t && (s = s && !e.composedPath().includes(t) && !m(e));
|
|
94
|
+
},
|
|
95
|
+
{ passive: !0 }
|
|
96
|
+
),
|
|
97
|
+
E && y(r, "blur", (e) => {
|
|
98
|
+
var f;
|
|
99
|
+
const t = u(o);
|
|
100
|
+
((f = r.document.activeElement) == null ? void 0 : f.tagName) === "IFRAME" && !(t != null && t.contains(r.document.activeElement)) && n(e);
|
|
101
|
+
})
|
|
102
|
+
].filter(Boolean);
|
|
103
|
+
return () => l.forEach((e) => e());
|
|
104
|
+
}
|
|
105
|
+
export {
|
|
106
|
+
g as o,
|
|
107
|
+
y as u
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=on-click-outside.Cy1eFULD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"on-click-outside.Cy1eFULD.js","sources":["../../src/directives/click-outside/useEventListener/index.ts","../../src/directives/click-outside/on-click-outside.ts"],"sourcesContent":["import type { Fn } from '@/types/functions';\nimport type { MaybeComputedRef } from '@/types/refs';\nimport type { Arrayable, GeneralEventListener } from './types';\nimport { watch } from 'vue';\nimport { defaultWindow, noop, resolveUnref, unrefElement } from '../utils';\n\n/**\n * Verify type of input value\n * @param val Value to be evaluated as string\n * @returns {boolean} true if the value is a \"string\", false if it's something else\n */\nconst isString = (val: unknown): val is string => typeof val === 'string';\n\n/**\n * Register using addEventListener on mounted, and removeEventListener automatically on unmounted.\n *\n * Overload 1: Omitted Window target\n *\n * @see https://vueuse.org/useEventListener\n * @param event\n * @param listener\n * @param options\n */\nexport function useEventListener<E extends keyof WindowEventMap>(\n event: Arrayable<E>,\n listener: Arrayable<(this: Window, ev: WindowEventMap[E]) => unknown>,\n options?: MaybeComputedRef<boolean | AddEventListenerOptions>\n): Fn;\n\n/**\n * Register using addEventListener on mounted, and removeEventListener automatically on unmounted.\n *\n * Overload 2: Explicitly Window target\n *\n * @see https://vueuse.org/useEventListener\n * @param target\n * @param event\n * @param listener\n * @param options\n */\nexport function useEventListener<E extends keyof WindowEventMap>(\n target: Window,\n event: Arrayable<E>,\n listener: Arrayable<(this: Window, ev: WindowEventMap[E]) => unknown>,\n options?: MaybeComputedRef<boolean | AddEventListenerOptions>\n): Fn;\n\n/**\n * Register using addEventListener on mounted, and removeEventListener automatically on unmounted.\n *\n * Overload 3: Explicitly Document target\n *\n * @see https://vueuse.org/useEventListener\n * @param target\n * @param event\n * @param listener\n * @param options\n */\nexport function useEventListener<E extends keyof DocumentEventMap>(\n target: DocumentOrShadowRoot,\n event: Arrayable<E>,\n listener: Arrayable<(this: Document, ev: DocumentEventMap[E]) => unknown>,\n options?: MaybeComputedRef<boolean | AddEventListenerOptions>\n): Fn;\n\n/**\n * Register using addEventListener on mounted, and removeEventListener automatically on unmounted.\n *\n * Overload 4: Custom event target with event type infer\n *\n * @see https://vueuse.org/useEventListener\n * @param target\n * @param event\n * @param listener\n * @param options\n */\nexport function useEventListener<Names extends string, EventType = Event>(\n target: EventTarget,\n event: Arrayable<Names>,\n listener: Arrayable<GeneralEventListener<EventType>>,\n options?: MaybeComputedRef<boolean | AddEventListenerOptions>\n): Fn;\n\n/**\n * Register using addEventListener on mounted, and removeEventListener automatically on unmounted.\n *\n * Overload 5: Custom event target fallback\n *\n * @see https://vueuse.org/useEventListener\n * @param target\n * @param event\n * @param listener\n * @param options\n */\nexport function useEventListener<EventType = Event>(\n target: MaybeComputedRef<EventTarget | null | undefined>,\n event: Arrayable<string>,\n listener: Arrayable<GeneralEventListener<EventType>>,\n options?: MaybeComputedRef<boolean | AddEventListenerOptions>\n): Fn;\n\nexport function useEventListener(...args) {\n let target: MaybeComputedRef<EventTarget> | undefined;\n let events: Arrayable<string>;\n let listeners: Arrayable<EventListenerOrEventListenerObject>;\n let options: MaybeComputedRef<boolean | AddEventListenerOptions> | undefined;\n\n if (isString(args[0]) || Array.isArray(args[0])) {\n [events, listeners, options] = args;\n target = defaultWindow;\n } else {\n [target, events, listeners, options] = args;\n }\n\n if (!target) {\n return noop;\n }\n\n if (!Array.isArray(events)) {\n events = [events];\n }\n\n if (!Array.isArray(listeners)) {\n listeners = [listeners];\n }\n\n const cleanups: Array<() => void> = [];\n const cleanup = () => {\n cleanups.forEach(fn => fn());\n cleanups.length = 0;\n };\n\n const register = (\n el: EventTarget,\n event: string,\n listener: EventListenerOrEventListenerObject,\n registerOptions: boolean | AddEventListenerOptions\n ) => {\n // eslint-disable-next-line scanjs-rules/call_addEventListener\n el.addEventListener(event, listener, registerOptions);\n return () => el.removeEventListener(event, listener, registerOptions);\n };\n\n const stopWatch = watch(\n () => [unrefElement(target as any), resolveUnref(options)],\n ([el, stopWatchOptions]) => {\n cleanup();\n\n if (!el) {\n return;\n }\n\n cleanups.push(\n ...(events as Array<string>).flatMap(event =>\n (listeners as Array<EventListenerOrEventListenerObject>).map(listener =>\n register(\n el as EventTarget,\n event,\n listener as EventListenerOrEventListenerObject,\n stopWatchOptions as boolean | AddEventListenerOptions\n )\n )\n )\n );\n },\n { immediate: true, flush: 'post' }\n );\n\n const stop = () => {\n stopWatch();\n cleanup();\n };\n\n return stop;\n}\n","import type { Fn } from '@/types/functions';\nimport type { MaybeElementRef } from '@/types/elements';\nimport type { OnClickOutsideHandler, OnClickOutsideOptions } from './types';\nimport { useEventListener } from './useEventListener';\nimport { defaultWindow, isIOS, noop, unrefElement } from './utils';\n\n// eslint-disable-next-line no-underscore-dangle\nlet _iOSWorkaround = false;\n\n/**\n * Listen for clicks outside of an element.\n *\n * @see https://vueuse.org/onClickOutside\n * @param target\n * @param handler\n * @param options\n */\nexport function onClickOutside<T extends OnClickOutsideOptions>(\n target: MaybeElementRef,\n handler: OnClickOutsideHandler,\n options: T = {} as T\n) {\n const { window = defaultWindow, ignore = [], capture = true, detectIframe = false } = options;\n\n if (!window) {\n return;\n }\n\n // Fixes \"onClickOutside not working on Safari iOS\": https://github.com/vueuse/vueuse/issues/1520\n // How it works: https://stackoverflow.com/a/39712411\n if (isIOS && !_iOSWorkaround) {\n _iOSWorkaround = true;\n // eslint-disable-next-line scanjs-rules/call_addEventListener\n Array.from(window.document.body.children).forEach((el: Element) => el.addEventListener('click', noop));\n }\n\n let shouldListen = true;\n let touchHandled = false;\n\n const shouldIgnore = (event: PointerEvent) =>\n // eslint-disable-next-line @typescript-eslint/no-shadow\n ignore.some(target => {\n if (typeof target === 'string') {\n return Array.from(window.document.querySelectorAll(target)).some(\n (el: Element) => el === event.target || event.composedPath().includes(el)\n );\n }\n\n const el = unrefElement(target as any) as EventTarget;\n return el && (event.target === el || event.composedPath().includes(el));\n });\n\n const listener = (event: PointerEvent) => {\n // Skip if already handled by touchend to avoid double-firing on touch devices\n if (touchHandled) {\n touchHandled = false;\n return;\n }\n\n const el = unrefElement(target as any) as EventTarget;\n\n if (!el || el === event.target || event.composedPath().includes(el)) {\n return;\n }\n\n if (event.detail === 0) {\n shouldListen = !shouldIgnore(event);\n }\n\n if (!shouldListen) {\n shouldListen = true;\n return;\n }\n\n handler(event);\n };\n\n const cleanup = [\n useEventListener(window, 'click', listener, { passive: true, capture }),\n // Handle touch events on mobile where `click` may not fire on non-interactive elements\n useEventListener(\n window,\n 'touchend',\n (event: TouchEvent) => {\n touchHandled = true;\n\n if (!shouldListen) {\n shouldListen = true;\n return;\n }\n\n const el = unrefElement(target as any) as EventTarget;\n\n if (!el || event.composedPath().includes(el)) {\n return;\n }\n\n if (shouldIgnore(event as any)) {\n return;\n }\n\n handler(event as any);\n },\n { passive: true, capture }\n ),\n useEventListener(\n window,\n 'pointerdown',\n e => {\n const el = unrefElement(target as any) as EventTarget;\n if (el) {\n shouldListen = !e.composedPath().includes(el) && !shouldIgnore(e);\n }\n },\n { passive: true }\n ),\n useEventListener(\n window,\n 'pointerup',\n e => {\n const el = unrefElement(target as any) as EventTarget;\n if (el) {\n shouldListen = shouldListen && !e.composedPath().includes(el) && !shouldIgnore(e);\n }\n },\n { passive: true }\n ),\n detectIframe &&\n useEventListener(window, 'blur', event => {\n const el: Element = unrefElement(target as any);\n if (\n window.document.activeElement?.tagName === 'IFRAME' &&\n !el?.contains(window.document.activeElement)\n ) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n handler(event as any);\n }\n }),\n ].filter(Boolean) as Array<Fn>;\n\n const stop = () => cleanup.forEach(fn => fn());\n\n // eslint-disable-next-line consistent-return\n return stop;\n}\n"],"names":["isString","val","useEventListener","args","target","events","listeners","options","defaultWindow","noop","cleanups","cleanup","fn","register","el","event","listener","registerOptions","stopWatch","watch","unrefElement","resolveUnref","stopWatchOptions","_iOSWorkaround","onClickOutside","handler","window","ignore","capture","detectIframe","isIOS","shouldListen","touchHandled","shouldIgnore","_a"],"mappings":";;AAWA,MAAMA,IAAW,CAACC,MAAgC,OAAOA,KAAQ;AA0F1D,SAASC,KAAoBC,GAAM;AACtC,MAAIC,GACAC,GACAC,GACAC;AASJ,MAPIP,EAASG,EAAK,CAAC,CAAC,KAAK,MAAM,QAAQA,EAAK,CAAC,CAAC,KAC1C,CAACE,GAAQC,GAAWC,CAAO,IAAIJ,GAC/BC,IAASI,KAET,CAACJ,GAAQC,GAAQC,GAAWC,CAAO,IAAIJ,GAGvC,CAACC;AACD,WAAOK;AAGX,EAAK,MAAM,QAAQJ,CAAM,MACrBA,IAAS,CAACA,CAAM,IAGf,MAAM,QAAQC,CAAS,MACxBA,IAAY,CAACA,CAAS;AAG1B,QAAMI,IAA8B,CAAA,GAC9BC,IAAU,MAAM;AAClB,IAAAD,EAAS,QAAQ,CAAAE,MAAMA,EAAA,CAAI,GAC3BF,EAAS,SAAS;AAAA,EACtB,GAEMG,IAAW,CACbC,GACAC,GACAC,GACAC,OAGAH,EAAG,iBAAiBC,GAAOC,GAAUC,CAAe,GAC7C,MAAMH,EAAG,oBAAoBC,GAAOC,GAAUC,CAAe,IAGlEC,IAAYC;AAAA,IACd,MAAM,CAACC,EAAahB,CAAa,GAAGiB,EAAad,CAAO,CAAC;AAAA,IACzD,CAAC,CAACO,GAAIQ,CAAgB,MAAM;AAGxB,MAFAX,EAAA,GAEKG,KAILJ,EAAS;AAAA,QACL,GAAIL,EAAyB;AAAA,UAAQ,OAChCC,EAAwD;AAAA,YAAI,CAAAU,MACzDH;AAAA,cACIC;AAAA,cACAC;AAAA,cACAC;AAAA,cACAM;AAAA,YAAA;AAAA,UACJ;AAAA,QACJ;AAAA,MACJ;AAAA,IAER;AAAA,IACA,EAAE,WAAW,IAAM,OAAO,OAAA;AAAA,EAAO;AAQrC,SALa,MAAM;AAC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