@adyen/bento-vue2 1.90.0 → 1.92.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 +2 -0
- package/dist/@types/index.d.ts +372 -236
- package/dist/action-bar.js +1 -1
- package/dist/ai-tag.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/checkbox-group.css +1 -1
- package/dist/assets/checkbox.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 -1
- 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/toggle.css +1 -1
- package/dist/assets/use-cached-selected-values.css +1 -1
- package/dist/button.js +1 -1
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{action-bar.B63qIiiH.js → action-bar.ChuPTyQG.js} +3 -3
- package/dist/chunks/{action-bar.B63qIiiH.js.map → action-bar.ChuPTyQG.js.map} +1 -1
- package/dist/chunks/{ai-tag.CCJCOdXu.js → ai-tag.Dt8nijLW.js} +2 -2
- package/dist/chunks/{ai-tag.CCJCOdXu.js.map → ai-tag.Dt8nijLW.js.map} +1 -1
- package/dist/chunks/{alert.CXRb-Smf.js → alert.CLqcPN0Q.js} +73 -55
- package/dist/chunks/alert.CLqcPN0Q.js.map +1 -0
- package/dist/chunks/{base-modal.DpmeDmq-.js → base-modal.DMdzcBrq.js} +4 -4
- package/dist/chunks/base-modal.DMdzcBrq.js.map +1 -0
- package/dist/chunks/{button-actions-with-menu.ChTUOsZl.js → button-actions-with-menu.CXFziNUr.js} +2 -2
- package/dist/chunks/{button-actions-with-menu.ChTUOsZl.js.map → button-actions-with-menu.CXFziNUr.js.map} +1 -1
- package/dist/chunks/{button-actions.BmU1DngD.js → button-actions.CXD6_9qN.js} +5 -5
- package/dist/chunks/button-actions.CXD6_9qN.js.map +1 -0
- package/dist/chunks/button-actions.types.BptAXjD8.js.map +1 -1
- package/dist/chunks/button.C9b2AC9w.js.map +1 -1
- package/dist/chunks/calendar.rZsIZPxm.js +1232 -0
- package/dist/chunks/calendar.rZsIZPxm.js.map +1 -0
- package/dist/chunks/{card.WWUfBkqf.js → card.Brma5kdb.js} +2 -2
- package/dist/chunks/card.Brma5kdb.js.map +1 -0
- package/dist/chunks/{checkbox-group.CI0xDnql.js → checkbox-group.DWZvFkjz.js} +6 -6
- package/dist/chunks/checkbox-group.DWZvFkjz.js.map +1 -0
- package/dist/chunks/{checkbox.TsWA6O3Z.js → checkbox.BZP0wtnE.js} +20 -22
- package/dist/chunks/checkbox.BZP0wtnE.js.map +1 -0
- 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.4DX9iUV8.js → code-snippet.DHAymIXp.js} +3 -3
- package/dist/chunks/code-snippet.DHAymIXp.js.map +1 -0
- package/dist/chunks/constructNow.CK0ryPil.js +8 -0
- package/dist/chunks/{constructNow.CIc7d13I.js.map → constructNow.CK0ryPil.js.map} +1 -1
- package/dist/chunks/{controls-group.D_KE99mg.js → controls-group.DSm2Ujwt.js} +2 -2
- package/dist/chunks/{controls-group.D_KE99mg.js.map → controls-group.DSm2Ujwt.js.map} +1 -1
- package/dist/chunks/country.types.jjXwaoMl.js.map +1 -1
- package/dist/chunks/{dashboard-section.TWlLdQHG.js → dashboard-section.D9rS8myE.js} +2 -2
- package/dist/chunks/{dashboard-section.TWlLdQHG.js.map → dashboard-section.D9rS8myE.js.map} +1 -1
- package/dist/chunks/{dashed-underline.CpDuQ3Fo.js → dashed-underline.D_FhFRXM.js} +2 -2
- package/dist/chunks/{dashed-underline.CpDuQ3Fo.js.map → dashed-underline.D_FhFRXM.js.map} +1 -1
- package/dist/chunks/{data-grid-template.DZaE-kOS.js → data-grid-template.CRijG20n.js} +2 -2
- package/dist/chunks/{data-grid-template.DZaE-kOS.js.map → data-grid-template.CRijG20n.js.map} +1 -1
- package/dist/chunks/{data-grid.x6cEW0az.js → data-grid.hMM9F36T.js} +540 -538
- package/dist/chunks/data-grid.hMM9F36T.js.map +1 -0
- package/dist/chunks/date-picker.BSo6Cvum.js +237 -0
- package/dist/chunks/date-picker.BSo6Cvum.js.map +1 -0
- package/dist/chunks/date-picker.types.Ckt7zxGy.js.map +1 -1
- package/dist/chunks/date-range-picker.D90k5b8p.js +1097 -0
- package/dist/chunks/date-range-picker.D90k5b8p.js.map +1 -0
- package/dist/chunks/date-range-picker.types.Ckt7zxGy.js.map +1 -1
- package/dist/chunks/{de.BJvo6njq.js → de.pvjpUJ1o.js} +2 -2
- package/dist/chunks/{de.BJvo6njq.js.map → de.pvjpUJ1o.js.map} +1 -1
- package/dist/chunks/{differenceInMonths.CIYECBxK.js → differenceInMonths.CpwVtHZX.js} +3 -2
- package/dist/chunks/{differenceInMonths.CIYECBxK.js.map → differenceInMonths.CpwVtHZX.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/{draggable-handle.js → chunks/draggable-handle.BR_aQH5N.js} +49 -40
- package/dist/chunks/draggable-handle.BR_aQH5N.js.map +1 -0
- package/dist/chunks/{dropdown-tag.t3FlJUSy.js → dropdown-tag.z3rsxbpW.js} +4 -4
- package/dist/chunks/dropdown-tag.z3rsxbpW.js.map +1 -0
- package/dist/chunks/dropdown.BYJwx-JD.js +1148 -0
- package/dist/chunks/dropdown.BYJwx-JD.js.map +1 -0
- package/dist/chunks/{en-GB.C3-QUpva.js → en-GB.-Q7Oq-nY.js} +2 -2
- package/dist/chunks/{en-GB.C3-QUpva.js.map → en-GB.-Q7Oq-nY.js.map} +1 -1
- package/dist/chunks/{en-US.YeSsZuOc.js → en-US.BK5uiAND.js} +5 -5
- package/dist/chunks/{en-US.YeSsZuOc.js.map → en-US.BK5uiAND.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/{es.DyUjjSL8.js → es.2H4LvTyV.js} +2 -2
- package/dist/chunks/{es.DyUjjSL8.js.map → es.2H4LvTyV.js.map} +1 -1
- package/dist/chunks/field-label.DjjjkcO6.js +97 -0
- package/dist/chunks/field-label.DjjjkcO6.js.map +1 -0
- package/dist/chunks/{file-uploader.Cig5gDXT.js → file-uploader.Djl0xaDN.js} +4 -4
- package/dist/chunks/{file-uploader.Cig5gDXT.js.map → file-uploader.Djl0xaDN.js.map} +1 -1
- package/dist/chunks/{filter-bar.x445KK3y.js → filter-bar.C9rWMIWO.js} +899 -882
- package/dist/chunks/filter-bar.C9rWMIWO.js.map +1 -0
- package/dist/chunks/{footer-actions.CIkul1OD.js → footer-actions.D9mHwk5l.js} +2 -2
- package/dist/chunks/{footer-actions.CIkul1OD.js.map → footer-actions.D9mHwk5l.js.map} +1 -1
- package/dist/chunks/{form-layout-title.DR5M7GP3.js → form-layout-title.zZVLCyqe.js} +71 -62
- package/dist/chunks/form-layout-title.zZVLCyqe.js.map +1 -0
- package/dist/chunks/{fr.JD_4GwS8.js → fr.Cu0IIfBP.js} +2 -2
- package/dist/chunks/{fr.JD_4GwS8.js.map → fr.Cu0IIfBP.js.map} +1 -1
- package/dist/chunks/{header-meta.BC5fdpD1.js → header-meta.BSPnWWmi.js} +14 -14
- package/dist/chunks/{header-meta.BC5fdpD1.js.map → header-meta.BSPnWWmi.js.map} +1 -1
- package/dist/chunks/{header-with-views.-cvdi9-L.js → header-with-views.g6J7x6l2.js} +10 -10
- package/dist/chunks/{header-with-views.-cvdi9-L.js.map → header-with-views.g6J7x6l2.js.map} +1 -1
- package/dist/chunks/{header.DtmZjxiU.js → header.DyZG7qWe.js} +3 -3
- package/dist/chunks/header.DyZG7qWe.js.map +1 -0
- package/dist/chunks/{input-field-password.Bdlw4dzr.js → input-field-password.CiDdI6A_.js} +4 -4
- package/dist/chunks/input-field-password.CiDdI6A_.js.map +1 -0
- package/dist/chunks/{input-field-phone-number.DPuWxBBz.js → input-field-phone-number.DFS58acU.js} +3 -3
- package/dist/chunks/{input-field-phone-number.DPuWxBBz.js.map → input-field-phone-number.DFS58acU.js.map} +1 -1
- package/dist/chunks/input-field.CGLjYab8.js +222 -0
- package/dist/chunks/input-field.CGLjYab8.js.map +1 -0
- package/dist/chunks/input-time.BhAUyKZM.js +135 -0
- package/dist/chunks/input-time.BhAUyKZM.js.map +1 -0
- package/dist/chunks/isSameWeek.TrpUOIn5.js +14 -0
- package/dist/chunks/{isSameWeek.CzBCmu7d.js.map → isSameWeek.TrpUOIn5.js.map} +1 -1
- package/dist/chunks/{it.BlUnV-yA.js → it.B65snrJA.js} +3 -3
- package/dist/chunks/{it.BlUnV-yA.js.map → it.B65snrJA.js.map} +1 -1
- package/dist/chunks/{ja.nUwDmVf2.js → ja.xGVfFSzL.js} +2 -2
- package/dist/chunks/{ja.nUwDmVf2.js.map → ja.xGVfFSzL.js.map} +1 -1
- package/dist/chunks/link.DB5g6d48.js.map +1 -1
- package/dist/chunks/{modal-fullscreen.CaxuXW-H.js → modal-fullscreen.De6mevyD.js} +2 -2
- package/dist/chunks/{modal-fullscreen.CaxuXW-H.js.map → modal-fullscreen.De6mevyD.js.map} +1 -1
- package/dist/chunks/{modal.Brif0vAy.js → modal.BXxwn9H4.js} +93 -91
- package/dist/chunks/{modal.Brif0vAy.js.map → modal.BXxwn9H4.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.BmrU_sn_.js → pagination.BzsKZFnw.js} +37 -37
- package/dist/chunks/{pagination.BmrU_sn_.js.map → pagination.BzsKZFnw.js.map} +1 -1
- package/dist/chunks/payment-method.types.BqtH7RM2.js.map +1 -1
- package/dist/chunks/popover.types.hA13DZPg.js.map +1 -1
- package/dist/chunks/popper-container.C_n9Ds1W.js.map +1 -1
- package/dist/chunks/promo-banner.Dc_kK1x9.js.map +1 -1
- package/dist/chunks/{pt-BR.BCU2Hj36.js → pt-BR.D9FuAQZm.js} +2 -2
- package/dist/chunks/{pt-BR.BCU2Hj36.js.map → pt-BR.D9FuAQZm.js.map} +1 -1
- package/dist/chunks/{radio-group.5oS-AeYN.js → radio-group.Bb-L-0io.js} +3 -3
- package/dist/chunks/radio-group.Bb-L-0io.js.map +1 -0
- package/dist/chunks/{rich-text-editor.DSGTe8Zt.js → rich-text-editor.DPpIzYid.js} +7 -6
- package/dist/chunks/{rich-text-editor.DSGTe8Zt.js.map → rich-text-editor.DPpIzYid.js.map} +1 -1
- package/dist/chunks/{search-bar.CNfoeLLt.js → search-bar.BEOieKeA.js} +4 -4
- package/dist/chunks/{search-bar.CNfoeLLt.js.map → search-bar.BEOieKeA.js.map} +1 -1
- package/dist/chunks/{secondary-nav.IF5CgeIP.js → secondary-nav.BBL5zZPK.js} +2 -2
- package/dist/chunks/{secondary-nav.IF5CgeIP.js.map → secondary-nav.BBL5zZPK.js.map} +1 -1
- package/dist/chunks/segmented-control.types.BHRLV8KU.js.map +1 -1
- package/dist/chunks/{selection-card-group.DZjFeQKR.js → selection-card-group.CLJPaknG.js} +10 -10
- package/dist/chunks/{selection-card-group.DZjFeQKR.js.map → selection-card-group.CLJPaknG.js.map} +1 -1
- package/dist/chunks/{sidepanel.DZDXuyzg.js → sidepanel.nW0Bhk_u.js} +4 -4
- package/dist/chunks/{sidepanel.DZDXuyzg.js.map → sidepanel.nW0Bhk_u.js.map} +1 -1
- package/dist/chunks/{startOfWeek.CXhhX-R7.js → startOfWeek.Br5KM4z_.js} +2 -2
- package/dist/chunks/{startOfWeek.CXhhX-R7.js.map → startOfWeek.Br5KM4z_.js.map} +1 -1
- package/dist/chunks/status.types.Dx8MDhEH.js.map +1 -1
- package/dist/chunks/{summary-grid.types.CrPNQbX0.js → summary-grid.types.Dp_efYVN.js} +2 -2
- package/dist/chunks/{summary-grid.types.CrPNQbX0.js.map → summary-grid.types.Dp_efYVN.js.map} +1 -1
- package/dist/chunks/tag.D2xagTJv.js.map +1 -1
- package/dist/chunks/{textarea.Bi53QF5Q.js → textarea.CJS-1I41.js} +5 -4
- package/dist/chunks/textarea.CJS-1I41.js.map +1 -0
- package/dist/chunks/{timeline-item.C6Bi0eam.js → timeline-item.CF9jbIRr.js} +5 -5
- package/dist/chunks/timeline-item.CF9jbIRr.js.map +1 -0
- package/dist/chunks/{toggle.B1z1YPe_.js → toggle.Ca-MM3dt.js} +3 -5
- package/dist/chunks/toggle.Ca-MM3dt.js.map +1 -0
- package/dist/chunks/tooltip.BxtnF3is.js.map +1 -1
- package/dist/chunks/{tutorial.BCiZMLJE.js → tutorial.CoWDVs7_.js} +2 -2
- package/dist/chunks/{tutorial.BCiZMLJE.js.map → tutorial.CoWDVs7_.js.map} +1 -1
- package/dist/chunks/typography.C8lPlsbD.js.map +1 -1
- package/dist/chunks/use-cached-selected-values.Du8-wWR2.js +1520 -0
- package/dist/chunks/use-cached-selected-values.Du8-wWR2.js.map +1 -0
- package/dist/chunks/{use-date-input-formatter.DRMt9yR2.js → use-date-input-formatter.ibZeLD_V.js} +4 -4
- package/dist/chunks/{use-date-input-formatter.DRMt9yR2.js.map → use-date-input-formatter.ibZeLD_V.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/chunks/{zh-CN.ChYkuQAR.js → zh-CN.Be4pa3-g.js} +3 -3
- package/dist/chunks/{zh-CN.ChYkuQAR.js.map → zh-CN.Be4pa3-g.js.map} +1 -1
- package/dist/click-outside.js +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/dashboard-template.js +1 -1
- package/dist/dashed-underline.js +1 -1
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/date-range-picker.js +2 -2
- package/dist/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/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 +274 -271
- package/dist/index.js.map +1 -1
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/input-time.js +1 -1
- package/dist/internal.js +24 -23
- package/dist/internal.js.map +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/radio-group.js +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/summary-grid.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/toggle.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +144 -7
- package/package.json +8 -13
- package/dist/assets/dropdown-default-textbox.css +0 -1
- package/dist/chunks/alert.CXRb-Smf.js.map +0 -1
- package/dist/chunks/base-modal.DpmeDmq-.js.map +0 -1
- package/dist/chunks/button-actions.BmU1DngD.js.map +0 -1
- package/dist/chunks/calendar.uvIGF_jU.js +0 -1154
- package/dist/chunks/calendar.uvIGF_jU.js.map +0 -1
- package/dist/chunks/card.WWUfBkqf.js.map +0 -1
- package/dist/chunks/checkbox-group.CI0xDnql.js.map +0 -1
- package/dist/chunks/checkbox.TsWA6O3Z.js.map +0 -1
- package/dist/chunks/code-snippet.4DX9iUV8.js.map +0 -1
- package/dist/chunks/constructNow.CIc7d13I.js +0 -8
- package/dist/chunks/data-grid.x6cEW0az.js.map +0 -1
- package/dist/chunks/date-picker.Dln8ocL4.js +0 -222
- package/dist/chunks/date-picker.Dln8ocL4.js.map +0 -1
- package/dist/chunks/date-range-picker.DPGy2h-9.js +0 -1068
- package/dist/chunks/date-range-picker.DPGy2h-9.js.map +0 -1
- package/dist/chunks/debounce.DUTu11PS.js +0 -10
- package/dist/chunks/debounce.DUTu11PS.js.map +0 -1
- package/dist/chunks/dropdown-default-textbox.CjhLIxVq.js +0 -364
- package/dist/chunks/dropdown-default-textbox.CjhLIxVq.js.map +0 -1
- package/dist/chunks/dropdown-tag.t3FlJUSy.js.map +0 -1
- package/dist/chunks/dropdown.CvNI2V33.js +0 -790
- package/dist/chunks/dropdown.CvNI2V33.js.map +0 -1
- package/dist/chunks/error-message.BUNKRa_w.js +0 -160
- package/dist/chunks/error-message.BUNKRa_w.js.map +0 -1
- package/dist/chunks/filter-bar.x445KK3y.js.map +0 -1
- package/dist/chunks/form-layout-title.DR5M7GP3.js.map +0 -1
- package/dist/chunks/header.DtmZjxiU.js.map +0 -1
- package/dist/chunks/input-field-password.Bdlw4dzr.js.map +0 -1
- package/dist/chunks/input-field.DH25CU_G.js +0 -207
- package/dist/chunks/input-field.DH25CU_G.js.map +0 -1
- package/dist/chunks/input-time.6eJ4-QdU.js +0 -92
- package/dist/chunks/input-time.6eJ4-QdU.js.map +0 -1
- package/dist/chunks/isSameWeek.CzBCmu7d.js +0 -14
- package/dist/chunks/on-click-outside.BW4rkhzG.js +0 -91
- package/dist/chunks/on-click-outside.BW4rkhzG.js.map +0 -1
- package/dist/chunks/radio-group.5oS-AeYN.js.map +0 -1
- package/dist/chunks/textarea.Bi53QF5Q.js.map +0 -1
- package/dist/chunks/timeline-item.C6Bi0eam.js.map +0 -1
- package/dist/chunks/toggle.B1z1YPe_.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.Bn3Y8Iuq.js +0 -1450
- package/dist/chunks/use-cached-selected-values.Bn3Y8Iuq.js.map +0 -1
- package/dist/chunks/warning-filled.CbJ1pcB2.js +0 -24
- package/dist/chunks/warning-filled.CbJ1pcB2.js.map +0 -1
- package/dist/draggable-handle.js.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { B
|
|
3
|
-
import { u as
|
|
4
|
-
import { F as R } from "./footer-actions.
|
|
5
|
-
import { n as
|
|
1
|
+
import { defineComponent as d, useSlots as S, onMounted as A, toRefs as E, ref as k, computed as m, useAttrs as L, watch as P } from "vue";
|
|
2
|
+
import { B, h as D, a as c, d as x, e as O, g, f as T } from "./base-modal.DMdzcBrq.js";
|
|
3
|
+
import { u as b } from "./use-has-slot.C9lQZ6nz.js";
|
|
4
|
+
import { F as R } from "./footer-actions.D9mHwk5l.js";
|
|
5
|
+
import { n as h } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
6
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.CXD6_9qN.js";
|
|
9
9
|
import { d as $ } from "./typography.C8lPlsbD.js";
|
|
10
|
-
const K =
|
|
10
|
+
const K = d({
|
|
11
11
|
name: "bento-modal-default"
|
|
12
|
-
}), F = /* @__PURE__ */
|
|
12
|
+
}), F = /* @__PURE__ */ d({
|
|
13
13
|
...K,
|
|
14
14
|
props: {
|
|
15
15
|
/**
|
|
@@ -65,7 +65,7 @@ const K = p({
|
|
|
65
65
|
*/
|
|
66
66
|
columnsSize: {
|
|
67
67
|
type: String,
|
|
68
|
-
default:
|
|
68
|
+
default: B.SMALLER
|
|
69
69
|
},
|
|
70
70
|
/**
|
|
71
71
|
* If passed - sets first button color to red
|
|
@@ -101,41 +101,41 @@ const K = p({
|
|
|
101
101
|
},
|
|
102
102
|
emits: ["update:active-page", "close-modal"],
|
|
103
103
|
setup(a, { emit: t }) {
|
|
104
|
-
const
|
|
104
|
+
const e = a, o = S(), l = b(o), i = () => {
|
|
105
105
|
t("close-modal");
|
|
106
106
|
};
|
|
107
|
-
return
|
|
108
|
-
if (!(l("content") || l("content-col-1") && l("content-col-2")) && !
|
|
107
|
+
return A(() => {
|
|
108
|
+
if (!(l("content") || l("content-col-1") && l("content-col-2")) && !e.activePage)
|
|
109
109
|
throw new Error("Bento Modal default variant requires content slot or column slots");
|
|
110
|
-
}), { __sfc: !0, slots:
|
|
110
|
+
}), { __sfc: !0, slots: o, hasSlot: l, emit: t, props: e, onCloseModal: i, FooterActions: R, BaseModal: D };
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
|
-
var
|
|
114
|
-
var t = this,
|
|
115
|
-
return o
|
|
116
|
-
return
|
|
117
|
-
}, "close-modal":
|
|
113
|
+
var I = function() {
|
|
114
|
+
var t = this, e = t._self._c, o = t._self._setupProxy;
|
|
115
|
+
return e(o.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
|
+
return o.emit("update:active-page", l);
|
|
117
|
+
}, "close-modal": o.onCloseModal }, scopedSlots: t._u([o.hasSlot("default") ? { key: "default", fn: function() {
|
|
118
118
|
return [t._t("default")];
|
|
119
|
-
}, proxy: !0 } : null,
|
|
119
|
+
}, proxy: !0 } : null, o.hasSlot("content-col-1") ? { key: "content-col-1", fn: function() {
|
|
120
120
|
return [t._t("content-col-1")];
|
|
121
|
-
}, proxy: !0 } : null,
|
|
121
|
+
}, proxy: !0 } : null, o.hasSlot("content-col-2") ? { key: "content-col-2", fn: function() {
|
|
122
122
|
return [t._t("content-col-2")];
|
|
123
|
-
}, proxy: !0 } : null,
|
|
123
|
+
}, proxy: !0 } : null, o.hasSlot("content") ? { key: "content", fn: function() {
|
|
124
124
|
return [t._t("content")];
|
|
125
125
|
}, proxy: !0 } : null, t.actions && t.actions.length > 0 ? { key: "actions", fn: function() {
|
|
126
126
|
return [t._t("actions", function() {
|
|
127
|
-
return [o
|
|
127
|
+
return [e(o.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
|
+
}, j = [], q = /* @__PURE__ */ h(
|
|
131
131
|
F,
|
|
132
|
+
I,
|
|
132
133
|
j,
|
|
133
|
-
q,
|
|
134
134
|
!1,
|
|
135
135
|
null,
|
|
136
136
|
null
|
|
137
137
|
);
|
|
138
|
-
const V =
|
|
138
|
+
const V = q.exports, G = {
|
|
139
139
|
"de-DE": {
|
|
140
140
|
ok: "OK"
|
|
141
141
|
},
|
|
@@ -166,10 +166,10 @@ const V = I.exports, G = {
|
|
|
166
166
|
"zh-CN": {
|
|
167
167
|
ok: "确定"
|
|
168
168
|
}
|
|
169
|
-
}, U =
|
|
169
|
+
}, U = d({
|
|
170
170
|
i18n: { messages: G },
|
|
171
171
|
name: "bento-modal-dialog"
|
|
172
|
-
}), W = /* @__PURE__ */
|
|
172
|
+
}), W = /* @__PURE__ */ d({
|
|
173
173
|
...U,
|
|
174
174
|
props: {
|
|
175
175
|
/**
|
|
@@ -231,53 +231,53 @@ const V = I.exports, G = {
|
|
|
231
231
|
},
|
|
232
232
|
emits: ["close-modal"],
|
|
233
233
|
setup(a, { emit: t }) {
|
|
234
|
-
const
|
|
234
|
+
const e = a, { t: o } = z(), l = S(), i = b(l), { actions: n, dialogType: s } = E(e), y = k(null), p = () => {
|
|
235
235
|
t("close-modal");
|
|
236
|
-
},
|
|
237
|
-
|
|
238
|
-
}, _ =
|
|
236
|
+
}, f = (r) => {
|
|
237
|
+
y.value.internalModalActionClose(r);
|
|
238
|
+
}, _ = m(() => [
|
|
239
239
|
{
|
|
240
|
-
title:
|
|
241
|
-
event:
|
|
240
|
+
title: o("ok"),
|
|
241
|
+
event: f,
|
|
242
242
|
variant: M.SECONDARY
|
|
243
243
|
}
|
|
244
|
-
]),
|
|
245
|
-
var
|
|
246
|
-
const
|
|
244
|
+
]), v = m(() => {
|
|
245
|
+
var C;
|
|
246
|
+
const r = {
|
|
247
247
|
title: "Cancel",
|
|
248
|
-
event:
|
|
249
|
-
},
|
|
250
|
-
return s.value ===
|
|
251
|
-
}), w =
|
|
248
|
+
event: f
|
|
249
|
+
}, u = (C = n == null ? void 0 : n.value) == null ? void 0 : C[0];
|
|
250
|
+
return s.value === c.DESTRUCTIVE ? u.critical = !0 : s.value === c.INFO && (u.variant = M.SECONDARY), [u, r];
|
|
251
|
+
}), w = m(() => ({
|
|
252
252
|
[`b-modal-dialog--${s.value}`]: s.value
|
|
253
253
|
}));
|
|
254
|
-
return
|
|
255
|
-
var
|
|
256
|
-
if (
|
|
254
|
+
return A(() => {
|
|
255
|
+
var r, u;
|
|
256
|
+
if (e.activePage)
|
|
257
257
|
throw new Error(
|
|
258
258
|
"Bento Modal Dialog cannot contain multiple pages. Use Bento Modal default variant instead."
|
|
259
259
|
);
|
|
260
|
-
if (!i("default") || !
|
|
260
|
+
if (!i("default") || !e.content && !i("content"))
|
|
261
261
|
throw new Error("Bento Modal Dialog requires header title and content");
|
|
262
|
-
if (((
|
|
262
|
+
if (((r = n == null ? void 0 : n.value) == null ? void 0 : r.length) > 1)
|
|
263
263
|
throw new Error("Not more than 1 action button may be provided to Modal Dialog");
|
|
264
|
-
if (s.value !==
|
|
264
|
+
if (s.value !== c.ACKNOWLEDGEMENT && !(n != null && n.value))
|
|
265
265
|
throw new Error("Modal Dialog, except ACKNOWLEDGEMENT type, always has to contain one action button");
|
|
266
|
-
if (s.value ===
|
|
266
|
+
if (s.value === c.ACKNOWLEDGEMENT && ((u = n == null ? void 0 : n.value) != null && u.length))
|
|
267
267
|
throw new Error("Acknowledgement Modal Dialog does not accept action buttons");
|
|
268
|
-
}), { __sfc: !0, emit: t, props:
|
|
268
|
+
}), { __sfc: !0, emit: t, props: e, t: o, slots: l, hasSlot: i, actions: n, dialogType: s, modalRef: y, onCloseModal: p, onCloseActionButton: f, acknowledgementDialogActions: _, dialogActions: v, modalDialogConditionalClasses: w, BentoModalRole: x, BentoButtonActions: N, BaseModal: D };
|
|
269
269
|
}
|
|
270
270
|
});
|
|
271
271
|
var Y = function() {
|
|
272
|
-
var t = this,
|
|
273
|
-
return o
|
|
272
|
+
var t = this, e = t._self._c, o = t._self._setupProxy;
|
|
273
|
+
return e(o.BaseModal, t._b({ ref: "modalRef", staticClass: "b-modal-dialog", class: o.modalDialogConditionalClasses, attrs: { actions: o.actions, "active-page": t.activePage, "hide-close-button": !0, size: "small", "is-dismissible": t.isDismissible, "is-open": t.isOpen, "modal-role": o.BentoModalRole.ALERT_DIALOG, "initially-open": t.initiallyOpen }, on: { "close-modal": o.onCloseModal }, scopedSlots: t._u([{ key: "default", fn: function() {
|
|
274
274
|
return [t._t("default")];
|
|
275
275
|
}, proxy: !0 }, { key: "content", fn: function() {
|
|
276
276
|
return [t._v(" " + t._s(t.content) + " ")];
|
|
277
277
|
}, proxy: !0 }, { key: "actions", fn: function() {
|
|
278
|
-
return [
|
|
278
|
+
return [o.dialogType === "acknowledgement" ? e(o.BentoButtonActions, { attrs: { actions: o.acknowledgementDialogActions, layout: "buttons-end" } }) : e(o.BentoButtonActions, { attrs: { actions: o.dialogActions, layout: "buttons-end" } })];
|
|
279
279
|
}, proxy: !0 }], null, !0) }, "base-modal", t.$attrs, !1));
|
|
280
|
-
}, H = [], J = /* @__PURE__ */
|
|
280
|
+
}, H = [], J = /* @__PURE__ */ h(
|
|
281
281
|
W,
|
|
282
282
|
Y,
|
|
283
283
|
H,
|
|
@@ -285,9 +285,9 @@ var Y = function() {
|
|
|
285
285
|
null,
|
|
286
286
|
null
|
|
287
287
|
);
|
|
288
|
-
const X = J.exports, Q =
|
|
288
|
+
const X = J.exports, Q = d({
|
|
289
289
|
components: { BentoModalDefault: V, BentoModalDialog: X }
|
|
290
|
-
}), Z = /* @__PURE__ */
|
|
290
|
+
}), Z = /* @__PURE__ */ d({
|
|
291
291
|
...Q,
|
|
292
292
|
__name: "modal",
|
|
293
293
|
props: {
|
|
@@ -341,8 +341,8 @@ const X = J.exports, Q = p({
|
|
|
341
341
|
*/
|
|
342
342
|
columnsSize: {
|
|
343
343
|
type: String,
|
|
344
|
-
default:
|
|
345
|
-
validator: (a) => Object.values(
|
|
344
|
+
default: B.SMALLER,
|
|
345
|
+
validator: (a) => Object.values(B).includes(a)
|
|
346
346
|
},
|
|
347
347
|
/**
|
|
348
348
|
* If provided, manages the padding of the whole modal container
|
|
@@ -357,8 +357,8 @@ const X = J.exports, Q = p({
|
|
|
357
357
|
*/
|
|
358
358
|
dialogType: {
|
|
359
359
|
type: String,
|
|
360
|
-
default:
|
|
361
|
-
validator: (a) => Object.values(
|
|
360
|
+
default: c.CONFIRMATION,
|
|
361
|
+
validator: (a) => Object.values(c).includes(a)
|
|
362
362
|
},
|
|
363
363
|
/**
|
|
364
364
|
* Hides a cross icon on the right side of the title
|
|
@@ -384,8 +384,8 @@ const X = J.exports, Q = p({
|
|
|
384
384
|
*/
|
|
385
385
|
size: {
|
|
386
386
|
type: String,
|
|
387
|
-
default:
|
|
388
|
-
validator: (a) => Object.values(
|
|
387
|
+
default: O.SMALL,
|
|
388
|
+
validator: (a) => Object.values(O).includes(a)
|
|
389
389
|
},
|
|
390
390
|
/**
|
|
391
391
|
* Choose between default or dialog versions of modal
|
|
@@ -393,7 +393,7 @@ const X = J.exports, Q = p({
|
|
|
393
393
|
variant: {
|
|
394
394
|
type: String,
|
|
395
395
|
default: "default",
|
|
396
|
-
validator: (a) => Object.values(T).includes(a) || Object.values(
|
|
396
|
+
validator: (a) => Object.values(T).includes(a) || Object.values(g).includes(a)
|
|
397
397
|
},
|
|
398
398
|
/**
|
|
399
399
|
* If provided, renders the modal's content in a two-column layout an wth dividers separating its content
|
|
@@ -402,56 +402,58 @@ const X = J.exports, Q = p({
|
|
|
402
402
|
},
|
|
403
403
|
emits: ["update:active-page", "close-modal"],
|
|
404
404
|
setup(a, { emit: t }) {
|
|
405
|
-
const
|
|
406
|
-
() => s.value ===
|
|
407
|
-
activePage:
|
|
408
|
-
hideCloseButton:
|
|
409
|
-
size:
|
|
410
|
-
customPadding:
|
|
411
|
-
actionsLabel:
|
|
412
|
-
destructiveActions:
|
|
413
|
-
isDismissible:
|
|
414
|
-
withColumnLayout:
|
|
415
|
-
columnsSize:
|
|
405
|
+
const e = a, o = 500, l = S(), i = b(l), n = L(), s = m(() => Object.values(g).includes(e.variant) ? e.variant : g[e.variant.toUpperCase()]), y = m(
|
|
406
|
+
() => s.value === g.DEFAULT ? {
|
|
407
|
+
activePage: e.activePage,
|
|
408
|
+
hideCloseButton: e.hideCloseButton,
|
|
409
|
+
size: e.size,
|
|
410
|
+
customPadding: e.customPadding,
|
|
411
|
+
actionsLabel: e.actionsLabel,
|
|
412
|
+
destructiveActions: e.destructiveActions,
|
|
413
|
+
isDismissible: e.isDismissible ?? !0,
|
|
414
|
+
withColumnLayout: e.withColumnLayout,
|
|
415
|
+
columnsSize: e.columnsSize,
|
|
416
416
|
...n
|
|
417
417
|
} : {
|
|
418
|
-
activePage:
|
|
419
|
-
dialogType:
|
|
420
|
-
content:
|
|
421
|
-
isDismissible:
|
|
418
|
+
activePage: e.activePage,
|
|
419
|
+
dialogType: e.dialogType,
|
|
420
|
+
content: e.content,
|
|
421
|
+
isDismissible: e.isDismissible ?? !1,
|
|
422
422
|
...n
|
|
423
423
|
}
|
|
424
|
-
),
|
|
424
|
+
), p = () => {
|
|
425
425
|
t("close-modal");
|
|
426
|
+
}, f = () => {
|
|
427
|
+
e.isOpen && p();
|
|
426
428
|
};
|
|
427
429
|
return P(
|
|
428
|
-
() =>
|
|
430
|
+
() => e.actions,
|
|
429
431
|
() => {
|
|
430
|
-
var
|
|
431
|
-
((
|
|
432
|
+
var _, v;
|
|
433
|
+
((v = (_ = e.actions) == null ? void 0 : _[0]) == null ? void 0 : v.state) === "success" && setTimeout(p, o);
|
|
432
434
|
}
|
|
433
435
|
), Object.keys(n).includes("overflow-visible") && $(
|
|
434
436
|
'BentoModal "overflow-visible" property',
|
|
435
437
|
`"overflow-visible" property was made redundant. BentoModal can work correctly without the need to pass the propery.
|
|
436
438
|
Remove the "overflow-visible" prop from BentoModal to remove this error.`,
|
|
437
439
|
"2.0.0"
|
|
438
|
-
), { __sfc: !0, LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME:
|
|
440
|
+
), { __sfc: !0, LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME: o, slots: l, hasSlot: i, attrs: n, emit: t, props: e, computedVariant: s, customProps: y, onCloseModal: p, handleInternalClose: f };
|
|
439
441
|
}
|
|
440
442
|
});
|
|
441
443
|
var tt = function() {
|
|
442
|
-
var t = this,
|
|
443
|
-
return o
|
|
444
|
-
return
|
|
445
|
-
} }, scopedSlots: t._u([
|
|
444
|
+
var t = this, e = t._self._c, o = t._self._setupProxy;
|
|
445
|
+
return e(o.computedVariant, t._b({ tag: "component", staticClass: "b-modal", attrs: { "is-open": t.isOpen, actions: t.actions, "initially-open": t.initiallyOpen }, on: { "close-modal": o.handleInternalClose, "update:active-page": function(l) {
|
|
446
|
+
return o.emit("update:active-page", l);
|
|
447
|
+
} }, scopedSlots: t._u([o.hasSlot("default") ? { key: "default", fn: function() {
|
|
446
448
|
return [t._t("default")];
|
|
447
|
-
}, proxy: !0 } : null,
|
|
449
|
+
}, proxy: !0 } : null, o.hasSlot("content-col-1") ? { key: "content-col-1", fn: function() {
|
|
448
450
|
return [t._t("content-col-1")];
|
|
449
|
-
}, proxy: !0 } : null,
|
|
451
|
+
}, proxy: !0 } : null, o.hasSlot("content-col-2") ? { key: "content-col-2", fn: function() {
|
|
450
452
|
return [t._t("content-col-2")];
|
|
451
|
-
}, proxy: !0 } : null,
|
|
453
|
+
}, proxy: !0 } : null, o.hasSlot("content") ? { key: "content", fn: function() {
|
|
452
454
|
return [t._t("content")];
|
|
453
|
-
}, proxy: !0 } : null], null, !0) }, "component",
|
|
454
|
-
}, et = [], ot = /* @__PURE__ */
|
|
455
|
+
}, proxy: !0 } : null], null, !0) }, "component", o.customProps, !1));
|
|
456
|
+
}, et = [], ot = /* @__PURE__ */ h(
|
|
455
457
|
Z,
|
|
456
458
|
tt,
|
|
457
459
|
et,
|
|
@@ -463,4 +465,4 @@ const pt = ot.exports;
|
|
|
463
465
|
export {
|
|
464
466
|
pt as B
|
|
465
467
|
};
|
|
466
|
-
//# sourceMappingURL=modal.
|
|
468
|
+
//# sourceMappingURL=modal.BXxwn9H4.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.Brif0vAy.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,EAAQ,SAAS,KAAMA,EAAQ,eAAe,KAAKA,EAAQ,eAAe,MAAO,CAACK,EAAM;AAC1F,cAAM,IAAI,MAAM,mEAAmE;AAAA,IAE3F,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GC6DDT,IAAeC,EAAgB;AAAA,EAC3B,MAAM,EAAE,UAAAS,EAAA;AAAA,EACR,MAAM;AACV,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAtGK,EAAE,GAAAC,MAAMC,EAAgD,GAExDV,IAAQC,EAAA,GACRC,IAAUC,EAAWH,CAAK,GAC1B,EAAE,SAAAW,GAAS,YAAAC,MAAeC,EAAON,CAAK,GACtCO,IAAgDC,EAAI,IAAI,GAExDX,IAAe,MAAM;AACvB,MAAAC,EAAK,aAAa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KAAKC,CAAK,EAAE,SAAS,kBAAkB,KAC9CM;AAAA,MACI;AAAA,MACA;AAAA;AAAA,MAEA;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"modal.BXxwn9H4.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=\"handleInternalClose\"\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 const handleInternalClose = () => {\n // Only emit if the modal is still open to prevent double emission from animationend\n if (props.isOpen) {\n onCloseModal();\n }\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","handleInternalClose","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,EAAQ,SAAS,KAAMA,EA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1B,eAAeA,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,GAEM+B,IAAsB,MAAM;AAE9B,MAAI7B,EAAM,UACNH,EAAA;AAAA,IAER;AAIA,WAAAiC;AAAA,MACI,MAAM9B,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,KAC9CO;AAAA,MACI;AAAA,MACA;AAAA;AAAA,MAEA;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { watch as k } from "vue";
|
|
2
|
+
import { n as w, u, r as I, d as L, i as S } from "./utils.BzUwtTXc.js";
|
|
3
|
+
const 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,G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