@adyen/bento-vue2 1.86.0 → 1.87.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/index.d.ts +1271 -1216
- package/dist/action-bar.js +1 -1
- package/dist/ai-tag.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/anchor-scroller.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/controls-group.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/dropdown-default-textbox.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/error-message.css +1 -1
- 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-phone-number.css +1 -1
- package/dist/assets/input-field.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/pagination.css +1 -1
- package/dist/assets/radio-group.css +1 -1
- package/dist/assets/rich-text-editor.css +1 -1
- package/dist/assets/selection-card-group.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/textarea.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.Dnkt4yn7.js → action-bar.ChMlt59Z.js} +4 -4
- package/dist/chunks/{action-bar.Dnkt4yn7.js.map → action-bar.ChMlt59Z.js.map} +1 -1
- package/dist/chunks/{ai-tag.s8TECgn_.js → ai-tag.D5fCswAm.js} +2 -2
- package/dist/chunks/{ai-tag.s8TECgn_.js.map → ai-tag.D5fCswAm.js.map} +1 -1
- package/dist/chunks/anchor-scroller.Cb22EJiL.js +177 -0
- package/dist/chunks/{anchor-scroller.3_idPubO.js.map → anchor-scroller.Cb22EJiL.js.map} +1 -1
- package/dist/chunks/{base-modal.09nAcnF_.js → base-modal.CUSvvYnk.js} +14 -14
- package/dist/chunks/{base-modal.09nAcnF_.js.map → base-modal.CUSvvYnk.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.C8tSTxrm.js → button-actions-with-menu.D14S1pym.js} +3 -3
- package/dist/chunks/{button-actions-with-menu.C8tSTxrm.js.map → button-actions-with-menu.D14S1pym.js.map} +1 -1
- package/dist/chunks/{button-actions.VSc47LLH.js → button-actions.DyPS54Yi.js} +134 -132
- package/dist/chunks/button-actions.DyPS54Yi.js.map +1 -0
- package/dist/chunks/{calendar.DiXkjQDP.js → calendar.BNg7mSj5.js} +398 -407
- package/dist/chunks/calendar.BNg7mSj5.js.map +1 -0
- package/dist/chunks/{card.BdjdBN36.js → card.9oGLUzev.js} +2 -2
- package/dist/chunks/{card.BdjdBN36.js.map → card.9oGLUzev.js.map} +1 -1
- package/dist/chunks/{checkbox-group.d6VQvZL7.js → checkbox-group.BtsDJN9I.js} +22 -22
- package/dist/chunks/checkbox-group.BtsDJN9I.js.map +1 -0
- package/dist/chunks/{checkbox.ClFNfhNh.js → checkbox.Dxvh9si9.js} +19 -22
- package/dist/chunks/checkbox.Dxvh9si9.js.map +1 -0
- package/dist/chunks/{code-snippet.DBNJgt1j.js → code-snippet.CaAEHdBl.js} +4 -4
- package/dist/chunks/{code-snippet.DBNJgt1j.js.map → code-snippet.CaAEHdBl.js.map} +1 -1
- package/dist/chunks/constructNow.CIc7d13I.js +8 -0
- package/dist/chunks/{constructNow.B8T1ljs6.js.map → constructNow.CIc7d13I.js.map} +1 -1
- package/dist/chunks/{controls-group.HUWlAOhG.js → controls-group.BCKGkHVl.js} +23 -28
- package/dist/chunks/controls-group.BCKGkHVl.js.map +1 -0
- package/dist/chunks/{copy.BXykYfg0.js → copy.DSNuoLZf.js} +3 -3
- package/dist/chunks/{copy.BXykYfg0.js.map → copy.DSNuoLZf.js.map} +1 -1
- package/dist/chunks/{dashboard-section.Cw2Ima3U.js → dashboard-section.DIesvnBa.js} +3 -3
- package/dist/chunks/{dashboard-section.Cw2Ima3U.js.map → dashboard-section.DIesvnBa.js.map} +1 -1
- package/dist/chunks/{dashed-underline.Dfw7cJ-9.js → dashed-underline.DauOBhSD.js} +3 -3
- package/dist/chunks/{dashed-underline.Dfw7cJ-9.js.map → dashed-underline.DauOBhSD.js.map} +1 -1
- package/dist/chunks/{data-grid-template.6LR2Jqka.js → data-grid-template.T-6_zLby.js} +3 -3
- package/dist/chunks/{data-grid-template.6LR2Jqka.js.map → data-grid-template.T-6_zLby.js.map} +1 -1
- package/dist/chunks/{data-grid.B_uZEPDW.js → data-grid.ZjYQaN9_.js} +695 -695
- package/dist/chunks/{data-grid.B_uZEPDW.js.map → data-grid.ZjYQaN9_.js.map} +1 -1
- package/dist/chunks/date-picker.BLOqU7Z9.js +173 -0
- package/dist/chunks/date-picker.BLOqU7Z9.js.map +1 -0
- package/dist/chunks/date-range-picker.CJexeNJg.js +900 -0
- package/dist/chunks/date-range-picker.CJexeNJg.js.map +1 -0
- package/dist/chunks/{de.DvtL0g75.js → de.BJvo6njq.js} +2 -2
- package/dist/chunks/{de.DvtL0g75.js.map → de.BJvo6njq.js.map} +1 -1
- package/dist/chunks/{dialog-page.DA6E6qma.js → dialog-page.4deowaF2.js} +2 -2
- package/dist/chunks/{dialog-page.DA6E6qma.js.map → dialog-page.4deowaF2.js.map} +1 -1
- package/dist/chunks/{differenceInMonths.BR4Z2HIa.js → differenceInMonths.CIYECBxK.js} +7 -7
- package/dist/chunks/{differenceInMonths.BR4Z2HIa.js.map → differenceInMonths.CIYECBxK.js.map} +1 -1
- package/dist/chunks/{dropdown-default-textbox.5WjhJWdh.js → dropdown-default-textbox.CKnrDQ2z.js} +18 -16
- package/dist/chunks/dropdown-default-textbox.CKnrDQ2z.js.map +1 -0
- package/dist/chunks/{dropdown-tag.BnMuMIDk.js → dropdown-tag.DSCZALNp.js} +3 -3
- package/dist/chunks/{dropdown-tag.BnMuMIDk.js.map → dropdown-tag.DSCZALNp.js.map} +1 -1
- package/dist/chunks/{dropdown.DDPfKc74.js → dropdown.ET_mq1_P.js} +8 -8
- package/dist/chunks/{dropdown.DDPfKc74.js.map → dropdown.ET_mq1_P.js.map} +1 -1
- package/dist/chunks/{en-GB.DCGuCmAv.js → en-GB.C3-QUpva.js} +2 -2
- package/dist/chunks/{en-GB.DCGuCmAv.js.map → en-GB.C3-QUpva.js.map} +1 -1
- package/dist/chunks/{en-US.BZii9jNW.js → en-US.YeSsZuOc.js} +150 -100
- package/dist/chunks/en-US.YeSsZuOc.js.map +1 -0
- package/dist/chunks/{error-message.VenUl2OK.js → error-message.CYfT0Qsi.js} +19 -22
- package/dist/chunks/error-message.CYfT0Qsi.js.map +1 -0
- package/dist/chunks/{es.bz0mzkMq.js → es.DyUjjSL8.js} +2 -2
- package/dist/chunks/{es.bz0mzkMq.js.map → es.DyUjjSL8.js.map} +1 -1
- package/dist/chunks/{file-uploader.BU1V40qK.js → file-uploader.BSX-zpyP.js} +377 -353
- package/dist/chunks/file-uploader.BSX-zpyP.js.map +1 -0
- package/dist/chunks/filter-bar.DkKvGUEm.js +3229 -0
- package/dist/chunks/filter-bar.DkKvGUEm.js.map +1 -0
- package/dist/chunks/{focus-trap.DMc1wL3A.js → focus-trap.DRqjHzt6.js} +2 -2
- package/dist/chunks/{focus-trap.DMc1wL3A.js.map → focus-trap.DRqjHzt6.js.map} +1 -1
- package/dist/chunks/{footer-actions.z-api8J_.js → footer-actions.Dq82H1Oc.js} +2 -2
- package/dist/chunks/{footer-actions.z-api8J_.js.map → footer-actions.Dq82H1Oc.js.map} +1 -1
- package/dist/chunks/form-layout-title.vF9Bmbre.js +212 -0
- package/dist/chunks/{form-layout-title.Bbq05nMT.js.map → form-layout-title.vF9Bmbre.js.map} +1 -1
- package/dist/chunks/{match.CMBZxEs9.js → fr.JD_4GwS8.js} +98 -61
- package/dist/chunks/fr.JD_4GwS8.js.map +1 -0
- package/dist/chunks/{header-meta.CuMQSsOm.js → header-meta.ByA0tkZw.js} +88 -94
- package/dist/chunks/header-meta.ByA0tkZw.js.map +1 -0
- package/dist/chunks/{header-with-views.DX8EXLMJ.js → header-with-views.DLoIc0yO.js} +9 -9
- package/dist/chunks/{header-with-views.DX8EXLMJ.js.map → header-with-views.DLoIc0yO.js.map} +1 -1
- package/dist/chunks/{header.YECm2GAh.js → header.BG6XUNEs.js} +3 -3
- package/dist/chunks/{header.YECm2GAh.js.map → header.BG6XUNEs.js.map} +1 -1
- package/dist/chunks/{index.BkJqgYF1.js → index.CwzYJHw2.js} +204 -197
- package/dist/chunks/{index.BkJqgYF1.js.map → index.CwzYJHw2.js.map} +1 -1
- package/dist/chunks/{info-icon.DS9ax8ZD.js → info-icon.BF8KxU-k.js} +3 -3
- package/dist/chunks/{info-icon.DS9ax8ZD.js.map → info-icon.BF8KxU-k.js.map} +1 -1
- package/dist/chunks/{input-field-password.DrI6eF5u.js → input-field-password.TIzrVzR6.js} +6 -6
- package/dist/chunks/{input-field-password.DrI6eF5u.js.map → input-field-password.TIzrVzR6.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.Buh4x3pJ.js → input-field-phone-number.s2fP7BVR.js} +42 -42
- package/dist/chunks/{input-field-phone-number.Buh4x3pJ.js.map → input-field-phone-number.s2fP7BVR.js.map} +1 -1
- package/dist/chunks/{input-field.NEKXqT4R.js → input-field.CSCJTxk1.js} +10 -10
- package/dist/chunks/input-field.CSCJTxk1.js.map +1 -0
- package/dist/chunks/{inspector.BomNgVb-.js → inspector.DgI3voTk.js} +3 -3
- package/dist/chunks/{inspector.BomNgVb-.js.map → inspector.DgI3voTk.js.map} +1 -1
- package/dist/chunks/isSameWeek.CzBCmu7d.js +14 -0
- package/dist/chunks/{isSameWeek.DjeUtLwI.js.map → isSameWeek.CzBCmu7d.js.map} +1 -1
- package/dist/chunks/{it.DIafuXtH.js → it.BlUnV-yA.js} +3 -3
- package/dist/chunks/{it.DIafuXtH.js.map → it.BlUnV-yA.js.map} +1 -1
- package/dist/chunks/{ja.Cm9tJMi2.js → ja.nUwDmVf2.js} +8 -8
- package/dist/chunks/{ja.Cm9tJMi2.js.map → ja.nUwDmVf2.js.map} +1 -1
- package/dist/chunks/{layout-row.BxuMJU4E.js → layout-row.B_IQC9Nq.js} +2 -2
- package/dist/chunks/{layout-row.BxuMJU4E.js.map → layout-row.B_IQC9Nq.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.Cv3y0TvQ.js → listbox-option-tag.BhPVuAjJ.js} +2 -2
- package/dist/chunks/{listbox-option-tag.Cv3y0TvQ.js.map → listbox-option-tag.BhPVuAjJ.js.map} +1 -1
- package/dist/chunks/modal-fullscreen.DJtDO8TR.js +235 -0
- package/dist/chunks/modal-fullscreen.DJtDO8TR.js.map +1 -0
- package/dist/chunks/{modal.DOR8c0gy.js → modal.BbsIM3qp.js} +4 -4
- package/dist/chunks/{modal.DOR8c0gy.js.map → modal.BbsIM3qp.js.map} +1 -1
- package/dist/chunks/{pagination.wuEIlDcq.js → pagination.iN0eYByB.js} +157 -138
- package/dist/chunks/pagination.iN0eYByB.js.map +1 -0
- package/dist/chunks/popover.types.hA13DZPg.js +6 -0
- package/dist/chunks/{popover.types.DkiRUQ4Z.js.map → popover.types.hA13DZPg.js.map} +1 -1
- package/dist/chunks/{popper-container.D4dworD4.js → popper-container.C_n9Ds1W.js} +2 -2
- package/dist/chunks/{popper-container.D4dworD4.js.map → popper-container.C_n9Ds1W.js.map} +1 -1
- package/dist/chunks/{promo-banner.bjMDm76T.js → promo-banner.BQreywWK.js} +2 -2
- package/dist/chunks/{promo-banner.bjMDm76T.js.map → promo-banner.BQreywWK.js.map} +1 -1
- package/dist/chunks/{pt-BR.CiGdfP45.js → pt-BR.BCU2Hj36.js} +2 -2
- package/dist/chunks/{pt-BR.CiGdfP45.js.map → pt-BR.BCU2Hj36.js.map} +1 -1
- package/dist/chunks/{radio-group.DKRxfGtE.js → radio-group.5ZxqWguJ.js} +6 -6
- package/dist/chunks/radio-group.5ZxqWguJ.js.map +1 -0
- package/dist/chunks/{rich-text-editor.DiuS9alD.js → rich-text-editor.BJ-FvvNc.js} +132 -132
- package/dist/chunks/{rich-text-editor.DiuS9alD.js.map → rich-text-editor.BJ-FvvNc.js.map} +1 -1
- package/dist/chunks/{search-bar.UVSaoX0h.js → search-bar.GPl6NU_w.js} +3 -3
- package/dist/chunks/{search-bar.UVSaoX0h.js.map → search-bar.GPl6NU_w.js.map} +1 -1
- package/dist/chunks/{secondary-nav.C6ldQMZ2.js → secondary-nav.DMHDxGDq.js} +3 -3
- package/dist/chunks/{secondary-nav.C6ldQMZ2.js.map → secondary-nav.DMHDxGDq.js.map} +1 -1
- package/dist/chunks/{segmented-control.BLnuxgnJ.js → segmented-control.BqIiX9hv.js} +2 -2
- package/dist/chunks/{segmented-control.BLnuxgnJ.js.map → segmented-control.BqIiX9hv.js.map} +1 -1
- package/dist/chunks/{selection-card-group.CqGYskmS.js → selection-card-group.Hol_gJKN.js} +23 -23
- package/dist/chunks/selection-card-group.Hol_gJKN.js.map +1 -0
- package/dist/chunks/{sidepanel.BKE87Uef.js → sidepanel.CSA5e8AF.js} +5 -5
- package/dist/chunks/{sidepanel.BKE87Uef.js.map → sidepanel.CSA5e8AF.js.map} +1 -1
- package/dist/chunks/{startOfWeek.D8Yh4c0G.js → startOfWeek.CXhhX-R7.js} +2 -2
- package/dist/chunks/{startOfWeek.D8Yh4c0G.js.map → startOfWeek.CXhhX-R7.js.map} +1 -1
- package/dist/chunks/{structured-list-item.DRFRap_S.js → structured-list-item.C7W3zYcT.js} +4 -4
- package/dist/chunks/{structured-list-item.DRFRap_S.js.map → structured-list-item.C7W3zYcT.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.OldkhD7S.js → summary-grid.types.nrVagy9s.js} +5 -5
- package/dist/chunks/{summary-grid.types.OldkhD7S.js.map → summary-grid.types.nrVagy9s.js.map} +1 -1
- package/dist/chunks/{tag.Cy3XkSDQ.js → tag.CocLKztJ.js} +2 -2
- package/dist/chunks/{tag.Cy3XkSDQ.js.map → tag.CocLKztJ.js.map} +1 -1
- package/dist/chunks/{textarea.Bm9MZb_W.js → textarea.CpVhEv6I.js} +33 -33
- package/dist/chunks/textarea.CpVhEv6I.js.map +1 -0
- package/dist/chunks/{timeline-item.Cpbm8IUw.js → timeline-item.CSDdHboz.js} +52 -54
- package/dist/chunks/timeline-item.CSDdHboz.js.map +1 -0
- package/dist/chunks/{tooltip.DF11J3k3.js → tooltip.CbsNGnhw.js} +2 -2
- package/dist/chunks/{tooltip.DF11J3k3.js.map → tooltip.CbsNGnhw.js.map} +1 -1
- package/dist/chunks/{tutorial.D5xtZ1Pt.js → tutorial.3dTfBKtZ.js} +4 -4
- package/dist/chunks/{tutorial.D5xtZ1Pt.js.map → tutorial.3dTfBKtZ.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.wn2xnwYG.js → use-cached-selected-values.DiIjmiF_.js} +2 -2
- package/dist/chunks/{use-cached-selected-values.wn2xnwYG.js.map → use-cached-selected-values.DiIjmiF_.js.map} +1 -1
- package/dist/chunks/use-date-input-formatter.Dcjry8op.js +1732 -0
- package/dist/chunks/use-date-input-formatter.Dcjry8op.js.map +1 -0
- package/dist/chunks/{zh-CN.Bw_6j9Cd.js → zh-CN.ChYkuQAR.js} +3 -3
- package/dist/chunks/{zh-CN.Bw_6j9Cd.js.map → zh-CN.ChYkuQAR.js.map} +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-handle.js +1 -1
- package/dist/dropdown.js +4 -4
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/focus-trap.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 +50 -50
- 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/inspector.js +1 -1
- package/dist/internal.js +11 -11
- package/dist/layout.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 +2 -2
- package/dist/popper-container.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/structured-list.js +1 -1
- package/dist/summary-grid.js +1 -1
- package/dist/tag.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +104 -5
- package/package.json +6 -11
- package/dist/chunks/anchor-scroller.3_idPubO.js +0 -178
- package/dist/chunks/button-actions.VSc47LLH.js.map +0 -1
- package/dist/chunks/calendar.DiXkjQDP.js.map +0 -1
- package/dist/chunks/checkbox-group.d6VQvZL7.js.map +0 -1
- package/dist/chunks/checkbox.ClFNfhNh.js.map +0 -1
- package/dist/chunks/constructNow.B8T1ljs6.js +0 -8
- package/dist/chunks/controls-group.HUWlAOhG.js.map +0 -1
- package/dist/chunks/date-input.etw_pFpA.js +0 -20
- package/dist/chunks/date-input.etw_pFpA.js.map +0 -1
- package/dist/chunks/date-picker.CITeN8WH.js +0 -173
- package/dist/chunks/date-picker.CITeN8WH.js.map +0 -1
- package/dist/chunks/date-range-picker.DxVjXxap.js +0 -897
- package/dist/chunks/date-range-picker.DxVjXxap.js.map +0 -1
- package/dist/chunks/dropdown-default-textbox.5WjhJWdh.js.map +0 -1
- package/dist/chunks/en-US.BZii9jNW.js.map +0 -1
- package/dist/chunks/error-message.VenUl2OK.js.map +0 -1
- package/dist/chunks/file-uploader.BU1V40qK.js.map +0 -1
- package/dist/chunks/filter-bar.UdXQf_RN.js +0 -3321
- package/dist/chunks/filter-bar.UdXQf_RN.js.map +0 -1
- package/dist/chunks/form-layout-title.Bbq05nMT.js +0 -197
- package/dist/chunks/fr-CA.B1aPU8fp.js +0 -48
- package/dist/chunks/fr-CA.B1aPU8fp.js.map +0 -1
- package/dist/chunks/fr.Dj7wEToe.js +0 -47
- package/dist/chunks/fr.Dj7wEToe.js.map +0 -1
- package/dist/chunks/getTimezoneOffsetInMilliseconds.Tu2wlbTR.js +0 -51
- package/dist/chunks/getTimezoneOffsetInMilliseconds.Tu2wlbTR.js.map +0 -1
- package/dist/chunks/header-meta.CuMQSsOm.js.map +0 -1
- package/dist/chunks/input-field.NEKXqT4R.js.map +0 -1
- package/dist/chunks/isSameWeek.DjeUtLwI.js +0 -14
- package/dist/chunks/ko.Ceaof6EP.js +0 -348
- package/dist/chunks/ko.Ceaof6EP.js.map +0 -1
- package/dist/chunks/match.CMBZxEs9.js.map +0 -1
- package/dist/chunks/modal-fullscreen.6bAjPENL.js +0 -225
- package/dist/chunks/modal-fullscreen.6bAjPENL.js.map +0 -1
- package/dist/chunks/nl.B6vCf2B9.js +0 -327
- package/dist/chunks/nl.B6vCf2B9.js.map +0 -1
- package/dist/chunks/pagination.wuEIlDcq.js.map +0 -1
- package/dist/chunks/popover.types.DkiRUQ4Z.js +0 -6
- package/dist/chunks/radio-group.DKRxfGtE.js.map +0 -1
- package/dist/chunks/selection-card-group.CqGYskmS.js.map +0 -1
- package/dist/chunks/sv.f8EfZjMZ.js +0 -377
- package/dist/chunks/sv.f8EfZjMZ.js.map +0 -1
- package/dist/chunks/textarea.Bm9MZb_W.js.map +0 -1
- package/dist/chunks/timeline-item.Cpbm8IUw.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-bar.Dnkt4yn7.js","sources":["../../src/components/action-bar/action-bar.vue"],"sourcesContent":["<template>\n <Transition name=\"b-action-bar__animation\" appear>\n <section class=\"b-action-bar\" :class=\"conditionalClasses\" :aria-label=\"t('actionBar')\">\n <div ref=\"actionBar\" class=\"b-action-bar__container\">\n <div v-if=\"!isConfirmationVariant\" class=\"b-action-bar__close-button\">\n <bento-button variant=\"tertiary\" inverse :aria-label=\"t('close')\" @click=\"emit('close')\">\n <template #iconLeft><cross-icon :aria-hidden=\"true\" /></template>\n </bento-button>\n </div>\n <bento-typography el=\"span\" stronger class=\"b-action-bar__selection\">\n <template v-if=\"isConfirmationVariant && noItemCounter\">\n {{ tc('unsavedChanges', 0) }}\n </template>\n <template v-else>\n {{ n(itemCounter) }}\n {{ isConfirmationVariant ? tc('unsavedChanges', itemCounter) : label }}\n </template>\n </bento-typography>\n <bento-button-actions\n v-if=\"isConfirmationVariant\"\n :actions=\"confirmationActions\"\n class=\"b-action-bar__actions\"\n inverse\n />\n <button-actions-with-menu\n v-else\n :actions=\"actionsInternal\"\n class=\"b-action-bar__actions\"\n :displayed-actions=\"internalDisplayedActions\"\n menu-position=\"top-end\"\n disable-responsive-behavior\n inverse\n />\n </div>\n </section>\n </Transition>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, type PropType, provide, ref, toRefs, watch } from 'vue';\n import { BentoButton, BentoButtonActions, type BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n\n import { type BentoActionBarVariant } from '@/components/action-bar/action-bar.types';\n import ButtonActionsWithMenu from '@/components/internal/button-actions-with-menu/button-actions-with-menu.vue';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { useI18n } from '@/utils/ts/i18n';\n import { useWindowSize } from '@vueuse/core';\n\n import messages from './messages.json';\n import { POPOVER_OFFSET_INJECTION_KEY } from '@/components/popover/popover.keys';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n // Constants\n const AVERAGE_BUTTON_SIZE = 100;\n const MENU_OFFSET = 7;\n const RESPONSIVE_BREAKPOINT = 500;\n const SPACING = 32;\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * Required and used for the `default` variant.\n *\n * Each object in the list should have a `title`, an `event` and,\n * optionally, an `icon`.\n *\n * The component will display 4 actions and the hide the rest inside a menu.\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: () => [],\n },\n /**\n * How many actions should be visible outside the menu, cannot be more than 4\n */\n visibleActions: {\n type: Number,\n default: 4,\n validator: (value: number) => value > 0 && value <= 4,\n },\n /**\n * Use when there are sticky elements at the bottom, like sticky pagination\n */\n extraBottomSpacing: {\n type: Boolean,\n default: false,\n },\n /**\n * Show how many items are selected.\n * When omitted in the `confirmation` variant, a generic \"Unsaved changes\" label is displayed.\n */\n itemCounter: {\n type: Number,\n default: null,\n },\n /**\n * Label for the selection, e.g. 'selected'/'changed'\n */\n selectionLabel: {\n type: String,\n default: null,\n },\n /**\n * Variant for the action bar\n * @values default, confirmation\n */\n variant: {\n type: String as PropType<BentoActionBarVariant>,\n default: 'default',\n },\n });\n\n const emit = defineEmits([\"close\", \"cancel\", \"save\"]);\n\n const { t, tc, n } = useI18n<{ message: MessageSchema }>({ messages });\n const label = computed(() => (props.selectionLabel ? props.selectionLabel : t('selected')));\n\n // Refs\n const actionBar = ref<HTMLDivElement>(null);\n const { extraBottomSpacing, visibleActions } = toRefs(props);\n const { width } = useWindowSize();\n const internalDisplayedActions = ref(null);\n const internalVisibleActions = ref(null);\n\n const isConfirmationVariant = computed(() => props.variant === 'confirmation');\n\n watch(\n () => visibleActions.value,\n value => {\n internalVisibleActions.value = value <= 4 ? value : 4;\n internalDisplayedActions.value = internalVisibleActions.value;\n },\n { immediate: true }\n );\n\n // Styling\n const conditionalClasses = computed(() => ({\n 'b-action-bar--extra-spacing': extraBottomSpacing.value,\n 'b-action-bar--confirmation': isConfirmationVariant.value,\n }));\n\n // Provide POPOVER_OFFSET_INJECTION_KEY to change the value of the popover offset\n provide(POPOVER_OFFSET_INJECTION_KEY, MENU_OFFSET);\n\n // Manipulate actions array to display as intended\n const actionsInternal = computed(() => {\n // All buttons should be of type secondary in the action bar\n const actions = props.actions.map(action => ({\n ...action,\n variant: 'secondary',\n })) as BentoButtonActionsList;\n // Shown actions should display from left to right in action bar, instead of right to left which is the button actions default\n const shownActions = actions.slice(0, internalDisplayedActions.value).reverse();\n const hiddenActions = actions.slice(internalDisplayedActions.value);\n\n return [...shownActions, ...hiddenActions];\n });\n\n const confirmationActions = computed<BentoButtonActionsList>(() => [\n {\n title: t('save'),\n event: () => emit('save'),\n },\n {\n title: t('cancel'),\n variant: 'secondary',\n event: () => emit('cancel'),\n },\n ]);\n\n const noItemCounter = computed(() => {\n return props.itemCounter == null || props.itemCounter < 1;\n });\n\n // Recursive functions to determine how many actions should be visible/hidden based on the screens width\n const showActions = async () => {\n await nextTick();\n if (\n width.value > actionBar.value.clientWidth + SPACING + AVERAGE_BUTTON_SIZE &&\n internalDisplayedActions.value < internalVisibleActions.value\n ) {\n internalDisplayedActions.value += 1;\n showActions();\n }\n };\n\n const hideActions = async () => {\n await nextTick();\n if (width.value < actionBar.value.clientWidth + SPACING && internalDisplayedActions.value > 0) {\n internalDisplayedActions.value -= 1;\n hideActions();\n }\n };\n\n // Screen width watcher to toggle hidden/visible actions\n watch(\n () => width.value,\n async (newValue, oldValue) => {\n await nextTick();\n if (!actionBar.value) {\n return;\n }\n const isIncreasing = newValue > oldValue;\n if (width.value < RESPONSIVE_BREAKPOINT) {\n internalDisplayedActions.value = 0;\n } else if (isIncreasing) {\n showActions();\n } else {\n hideActions();\n }\n },\n { immediate: true }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * Action bar is a floating bar that provides users with quick access to key actions that can be applied to one or multiple items.\n *\n * @example\n * import { BentoActionBar } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoActionBar },\n * template: `\n * <bento-action-bar\n * :actions='[\n * {\n * title: 'Delete',\n * critical: true,\n * icon: BinIcon,\n * event: () => true,\n * },\n * {\n * title: 'Edit',\n * icon: EditIcon,\n * event: () => true,\n * }\n * ]'\n * @close=\"closeAction\"\n * :item-counter=\"5\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./action-bar.scss\" />\n"],"names":["__default__","messages","AVERAGE_BUTTON_SIZE","MENU_OFFSET","RESPONSIVE_BREAKPOINT","SPACING","t","tc","n","useI18n","label","computed","props","actionBar","ref","extraBottomSpacing","visibleActions","toRefs","width","useWindowSize","internalDisplayedActions","internalVisibleActions","isConfirmationVariant","watch","value","conditionalClasses","provide","POPOVER_OFFSET_INJECTION_KEY","actionsInternal","actions","action","shownActions","hiddenActions","confirmationActions","emit","noItemCounter","showActions","nextTick","hideActions","newValue","oldValue","isIncreasing"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0PIA,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBApMAC,IAAA,KACAC,IAAA,GACAC,IAAA,KACAC,IAAA,IA4DA,EAAA,GAAAC,GAAA,IAAAC,GAAA,GAAAC,EAAA,IAAAC,EAAA,GACAC,IAAAC,EAAA,MAAAC,EAAA,iBAAAA,EAAA,iBAAAN,EAAA,UAAA,CAAA,GAGAO,IAAAC,EAAA,IAAA,GACA,EAAA,oBAAAC,GAAA,gBAAAC,EAAA,IAAAC,EAAAL,CAAA,GACA,EAAA,OAAAM,EAAA,IAAAC,EAAA,GACAC,IAAAN,EAAA,IAAA,GACAO,IAAAP,EAAA,IAAA,GAEAQ,IAAAX,EAA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AA,QAAA,MACIA,EAAA,SAAA,GACAkB,EAAA;AAAA,IACJ;AAIJ,WAAAf;AAAA,MAAA,MAAAL,EAAA;AAAA,MACgB,OAAAqB,GAAAC,MAAA;AAGR,YADA,MAAAH,EAAA,GACA,CAAAxB,EAAA;AACI;AAEJ,cAAA4B,IAAAF,IAAAC;AACA,QAAAtB,EAAA,QAAAd,IACIgB,EAAA,QAAA,IAAiCqB,IAEjCL,EAAA,IAEAE,EAAA;AAAA,MACJ;AAAA,MACJ,EAAA,WAAA,GAAA;AAAA,IACkB;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"action-bar.ChMlt59Z.js","sources":["../../src/components/action-bar/action-bar.vue"],"sourcesContent":["<template>\n <Transition name=\"b-action-bar__animation\" appear>\n <section class=\"b-action-bar\" :class=\"conditionalClasses\" :aria-label=\"t('actionBar')\">\n <div ref=\"actionBar\" class=\"b-action-bar__container\">\n <div v-if=\"!isConfirmationVariant\" class=\"b-action-bar__close-button\">\n <bento-button variant=\"tertiary\" inverse :aria-label=\"t('close')\" @click=\"emit('close')\">\n <template #iconLeft><cross-icon :aria-hidden=\"true\" /></template>\n </bento-button>\n </div>\n <bento-typography el=\"span\" stronger class=\"b-action-bar__selection\">\n <template v-if=\"isConfirmationVariant && noItemCounter\">\n {{ tc('unsavedChanges', 0) }}\n </template>\n <template v-else>\n {{ n(itemCounter) }}\n {{ isConfirmationVariant ? tc('unsavedChanges', itemCounter) : label }}\n </template>\n </bento-typography>\n <bento-button-actions\n v-if=\"isConfirmationVariant\"\n :actions=\"confirmationActions\"\n class=\"b-action-bar__actions\"\n inverse\n />\n <button-actions-with-menu\n v-else\n :actions=\"actionsInternal\"\n class=\"b-action-bar__actions\"\n :displayed-actions=\"internalDisplayedActions\"\n menu-position=\"top-end\"\n disable-responsive-behavior\n inverse\n />\n </div>\n </section>\n </Transition>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, type PropType, provide, ref, toRefs, watch } from 'vue';\n import { BentoButton, BentoButtonActions, type BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n\n import { type BentoActionBarVariant } from '@/components/action-bar/action-bar.types';\n import ButtonActionsWithMenu from '@/components/internal/button-actions-with-menu/button-actions-with-menu.vue';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { useI18n } from '@/utils/ts/i18n';\n import { useWindowSize } from '@vueuse/core';\n\n import messages from './messages.json';\n import { POPOVER_OFFSET_INJECTION_KEY } from '@/components/popover/popover.keys';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n // Constants\n const AVERAGE_BUTTON_SIZE = 100;\n const MENU_OFFSET = 7;\n const RESPONSIVE_BREAKPOINT = 500;\n const SPACING = 32;\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * Required and used for the `default` variant.\n *\n * Each object in the list should have a `title`, an `event` and,\n * optionally, an `icon`.\n *\n * The component will display 4 actions and the hide the rest inside a menu.\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: () => [],\n },\n /**\n * How many actions should be visible outside the menu, cannot be more than 4\n */\n visibleActions: {\n type: Number,\n default: 4,\n validator: (value: number) => value > 0 && value <= 4,\n },\n /**\n * Use when there are sticky elements at the bottom, like sticky pagination\n */\n extraBottomSpacing: {\n type: Boolean,\n default: false,\n },\n /**\n * Show how many items are selected.\n * When omitted in the `confirmation` variant, a generic \"Unsaved changes\" label is displayed.\n */\n itemCounter: {\n type: Number,\n default: null,\n },\n /**\n * Label for the selection, e.g. 'selected'/'changed'\n */\n selectionLabel: {\n type: String,\n default: null,\n },\n /**\n * Variant for the action bar\n * @values default, confirmation\n */\n variant: {\n type: String as PropType<BentoActionBarVariant>,\n default: 'default',\n },\n });\n\n const emit = defineEmits([\"close\", \"cancel\", \"save\"]);\n\n const { t, tc, n } = useI18n<{ message: MessageSchema }>({ messages });\n const label = computed(() => (props.selectionLabel ? props.selectionLabel : t('selected')));\n\n // Refs\n const actionBar = ref<HTMLDivElement>(null);\n const { extraBottomSpacing, visibleActions } = toRefs(props);\n const { width } = useWindowSize();\n const internalDisplayedActions = ref(null);\n const internalVisibleActions = ref(null);\n\n const isConfirmationVariant = computed(() => props.variant === 'confirmation');\n\n watch(\n () => visibleActions.value,\n value => {\n internalVisibleActions.value = value <= 4 ? value : 4;\n internalDisplayedActions.value = internalVisibleActions.value;\n },\n { immediate: true }\n );\n\n // Styling\n const conditionalClasses = computed(() => ({\n 'b-action-bar--extra-spacing': extraBottomSpacing.value,\n 'b-action-bar--confirmation': isConfirmationVariant.value,\n }));\n\n // Provide POPOVER_OFFSET_INJECTION_KEY to change the value of the popover offset\n provide(POPOVER_OFFSET_INJECTION_KEY, MENU_OFFSET);\n\n // Manipulate actions array to display as intended\n const actionsInternal = computed(() => {\n // All buttons should be of type secondary in the action bar\n const actions = props.actions.map(action => ({\n ...action,\n variant: 'secondary',\n })) as BentoButtonActionsList;\n // Shown actions should display from left to right in action bar, instead of right to left which is the button actions default\n const shownActions = actions.slice(0, internalDisplayedActions.value).reverse();\n const hiddenActions = actions.slice(internalDisplayedActions.value);\n\n return [...shownActions, ...hiddenActions];\n });\n\n const confirmationActions = computed<BentoButtonActionsList>(() => [\n {\n title: t('save'),\n event: () => emit('save'),\n },\n {\n title: t('cancel'),\n variant: 'secondary',\n event: () => emit('cancel'),\n },\n ]);\n\n const noItemCounter = computed(() => {\n return props.itemCounter == null || props.itemCounter < 1;\n });\n\n // Recursive functions to determine how many actions should be visible/hidden based on the screens width\n const showActions = async () => {\n await nextTick();\n if (\n width.value > actionBar.value.clientWidth + SPACING + AVERAGE_BUTTON_SIZE &&\n internalDisplayedActions.value < internalVisibleActions.value\n ) {\n internalDisplayedActions.value += 1;\n showActions();\n }\n };\n\n const hideActions = async () => {\n await nextTick();\n if (width.value < actionBar.value.clientWidth + SPACING && internalDisplayedActions.value > 0) {\n internalDisplayedActions.value -= 1;\n hideActions();\n }\n };\n\n // Screen width watcher to toggle hidden/visible actions\n watch(\n () => width.value,\n async (newValue, oldValue) => {\n await nextTick();\n if (!actionBar.value) {\n return;\n }\n const isIncreasing = newValue > oldValue;\n if (width.value < RESPONSIVE_BREAKPOINT) {\n internalDisplayedActions.value = 0;\n } else if (isIncreasing) {\n showActions();\n } else {\n hideActions();\n }\n },\n { immediate: true }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * Action bar is a floating bar that provides users with quick access to key actions that can be applied to one or multiple items.\n *\n * @example\n * import { BentoActionBar } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoActionBar },\n * template: `\n * <bento-action-bar\n * :actions='[\n * {\n * title: 'Delete',\n * critical: true,\n * icon: BinIcon,\n * event: () => true,\n * },\n * {\n * title: 'Edit',\n * icon: EditIcon,\n * event: () => true,\n * }\n * ]'\n * @close=\"closeAction\"\n * :item-counter=\"5\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./action-bar.scss\" />\n"],"names":["__default__","messages","AVERAGE_BUTTON_SIZE","MENU_OFFSET","RESPONSIVE_BREAKPOINT","SPACING","t","tc","n","useI18n","label","computed","props","actionBar","ref","extraBottomSpacing","visibleActions","toRefs","width","useWindowSize","internalDisplayedActions","internalVisibleActions","isConfirmationVariant","watch","value","conditionalClasses","provide","POPOVER_OFFSET_INJECTION_KEY","actionsInternal","actions","action","shownActions","hiddenActions","confirmationActions","emit","noItemCounter","showActions","nextTick","hideActions","newValue","oldValue","isIncreasing"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0PIA,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBApMAC,IAAA,KACAC,IAAA,GACAC,IAAA,KACAC,IAAA,IA4DA,EAAA,GAAAC,GAAA,IAAAC,GAAA,GAAAC,EAAA,IAAAC,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A,QAAAA,EAAA,cAAA,CAAwD,GAI5DwB,IAAA,YAAA;AACI,YAAAC,EAAA,GACAnB,EAAA,QAAAL,EAAA,MAAA,cAAAR,IAAAH,KAAAkB,EAAA,QAAAC,EAAA,UAIID,EAAA,SAAA,GACAgB,EAAA;AAAA,IACJ,GAGJE,IAAA,YAAA;AACI,YAAAD,EAAA,GACAnB,EAAA,QAAAL,EAAA,MAAA,cAAAR,KAAAe,EAAA,QAAA,MACIA,EAAA,SAAA,GACAkB,EAAA;AAAA,IACJ;AAIJ,WAAAf;AAAA,MAAA,MAAAL,EAAA;AAAA,MACgB,OAAAqB,GAAAC,MAAA;AAGR,YADA,MAAAH,EAAA,GACA,CAAAxB,EAAA;AACI;AAEJ,cAAA4B,IAAAF,IAAAC;AACA,QAAAtB,EAAA,QAAAd,IACIgB,EAAA,QAAA,IAAiCqB,IAEjCL,EAAA,IAEAE,EAAA;AAAA,MACJ;AAAA,MACJ,EAAA,WAAA,GAAA;AAAA,IACkB;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as u, ref as i, watch as _, computed as f } from "vue";
|
|
2
|
-
import { u as v, c as m, h as y } from "./button-actions.
|
|
2
|
+
import { u as v, c as m, h as y } from "./button-actions.DyPS54Yi.js";
|
|
3
3
|
import { B as I } from "./typography.C8lPlsbD.js";
|
|
4
4
|
import "./index.Cl4_42j5.js";
|
|
5
5
|
import { u as A } from "./index.B6WW_F-J.js";
|
|
@@ -79,4 +79,4 @@ const D = P.exports;
|
|
|
79
79
|
export {
|
|
80
80
|
D as a
|
|
81
81
|
};
|
|
82
|
-
//# sourceMappingURL=ai-tag.
|
|
82
|
+
//# sourceMappingURL=ai-tag.D5fCswAm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-tag.
|
|
1
|
+
{"version":3,"file":"ai-tag.D5fCswAm.js","sources":["../../src/components/ai-tag/ai-tag.vue"],"sourcesContent":["<template>\n <div ref=\"aiTagRef\" class=\"b-ai-tag\" @keydown.esc=\"closePopover\">\n <bento-toggle-button\n ref=\"targetElement\"\n :toggled=\"toggled\"\n :aria-controls=\"popoverId\"\n variant=\"secondary\"\n condensed\n class=\"b-ai-tag__trigger\"\n @update:toggled=\"onToggle\"\n >\n <template #iconLeft>\n <artificial-intelligence-ai-icon class=\"b-ai-tag__trigger-icon\" :aria-hidden=\"true\" />\n </template>\n {{ t('ai') }}\n </bento-toggle-button>\n\n <bento-popover\n v-if=\"targetElement\"\n :id=\"popoverId\"\n :open=\"toggled\"\n :target-element=\"targetElement\"\n :actions=\"popoverActions\"\n actions-layout=\"fill-container\"\n :title=\"t('aiExplained')\"\n trap-all\n :trap-all-options=\"{ onDeactivate: closePopover, allowOutsideClick: true }\"\n fixed-positioning\n overflow-visible\n @dismiss=\"closePopover\"\n >\n <template #headerIcon>\n <artificial-intelligence-ai-icon class=\"b-ai-tag__popover-header-icon\" :aria-hidden=\"true\" />\n </template>\n <div class=\"b-ai-tag__popover-content\">\n <bento-typography v-if=\"influencedValue\" variant=\"title\" medium class=\"b-ai-tag__influenced-value\">\n {{ influencedValue }}\n </bento-typography>\n\n <bento-typography variant=\"title\">\n {{ title }}\n </bento-typography>\n\n <bento-typography>\n {{ description }}\n </bento-typography>\n </div>\n </bento-popover>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref, watch } from 'vue';\n import { BentoPopover } from '@/components/popover';\n import { BentoToggleButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { useClickOutside } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import { generateUid } from '@/core/utils/ts';\n import type { BentoButtonActionsList } from '@/components/button/components/button-actions/button-actions.types';\n import ArtificialIntelligenceAiIcon from '@adyen/ui-assets-icons-16/vue/artificial-intelligence-ai-filled';\n import type { BentoAiTagProps } from './ai-tag.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n title: null,\n description: null,\n influencedValue: { default: undefined },\n toggled: { type: Boolean, default: false },\n action: { default: undefined }\n});\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const toggled = ref(props.toggled);\n const aiTagRef = ref<HTMLElement | null>(null);\n const targetElement = ref<InstanceType<typeof BentoToggleButton> | null>(null);\n const popoverId = generateUid('b-ai-tag-popover');\n\n watch(\n () => props.toggled,\n value => {\n toggled.value = value;\n }\n );\n\n useClickOutside(aiTagRef, () => {\n closePopover();\n });\n\n const popoverActions = computed<BentoButtonActionsList>(() =>\n props.action\n ? [\n {\n ...props.action,\n variant: 'secondary',\n },\n ]\n : undefined\n );\n\n const emit = defineEmits([\"update:toggled\"]);\n\n const onToggle = (value: boolean) => {\n toggled.value = value;\n emit('update:toggled', value);\n };\n\n const closePopover = () => {\n if (toggled.value) {\n onToggle(false);\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * The AI tag is a component used to transparently identify content, data, or experiences that have been generated or\n * enhanced by artificial intelligence.\n *\n * @example\n * import { BentoAiTag } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoAiTag },\n * template: `\n * <bento-ai-tag\n * title=\"Input fields auto-filled by AI\"\n * description=\"Based on your documents uploaded, AI has auto-filled some information for you.\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./ai-tag.scss\" />\n"],"names":["__default__","messages","useI18n","toggled","ref","props","aiTagRef","targetElement","popoverId","generateUid","watch","value","useClickOutside","closePopover","popoverActions","computed","onToggle","emit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;GAuIIA,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;iBA/DA,EAAA,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAAC,EAAA,OAAA,GACAC,IAAAF,EAAA,IAAA,GACAG,IAAAH,EAAA,IAAA,GACAI,IAAAC,EAAA,kBAAA;AAEA,IAAAC;AAAA,MAAA,MAAAL,EAAA;AAAA,MACgB,CAAAM,MAAA;AAER,QAAAR,EAAA,QAAAQ;AAAA,MAAgB;AAAA,IACpB,GAGJC,EAAAN,GAAA,MAAA;AACI,MAAAO,EAAA;AAAA,IAAa,CAAA;AAGjB,UAAAC,IAAAC;AAAA,MAAuB,MAAAV,EAAA,SAAA;AAAA,QAEb;AAAA,UACI,GAAAA,EAAA;AAAA,UACa,SAAA;AAAA,QACA;AAAA,MACb,IAAA;AAAA,IAEJ,GAKVW,IAAA,CAAAL,MAAA;AACI,MAAAR,EAAA,QAAAQ,GACAM,EAAA,kBAAAN,CAAA;AAAA,IAA4B,GAGhCE,IAAA,MAAA;AACI,MAAAV,EAAA,SACIa,EAAA,EAAA;AAAA,IACJ;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { defineComponent as w, ref as x, computed as m, watch as h, watchEffect as S, toRef as T } from "vue";
|
|
2
|
+
import { f as A, d as B, u as R, g as D, t as y, h as F, r as L } from "./index.CwzYJHw2.js";
|
|
3
|
+
import { p as k, B as M } from "./typography.C8lPlsbD.js";
|
|
4
|
+
import { u as O } from "./index.B6WW_F-J.js";
|
|
5
|
+
import { g as j } from "./generate-uid.NJ8tVoha.js";
|
|
6
|
+
import { u as g } from "./utils.BzUwtTXc.js";
|
|
7
|
+
import { B as E } from "./button.Ctj3rkxw.js";
|
|
8
|
+
import { n as C } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
9
|
+
import { F as N } from "./fixed-scroller.BueAsyGk.js";
|
|
10
|
+
import "../assets/anchor-scroller.css";
|
|
11
|
+
const H = /* @__PURE__ */ w({
|
|
12
|
+
__name: "anchor-scroller-list",
|
|
13
|
+
props: {
|
|
14
|
+
activeIndex: { default: void 0 },
|
|
15
|
+
items: null,
|
|
16
|
+
scrollOffset: { default: void 0 }
|
|
17
|
+
},
|
|
18
|
+
setup(p) {
|
|
19
|
+
const e = p, n = x([]), t = m(
|
|
20
|
+
() => e.items.map((r, u) => ({ disabled: r.disabled, originalIndex: u })).filter(({ disabled: r }) => !r).map(({ originalIndex: r }) => r)
|
|
21
|
+
), {
|
|
22
|
+
state: c,
|
|
23
|
+
next: i,
|
|
24
|
+
prev: l
|
|
25
|
+
} = A(t, {
|
|
26
|
+
initialValue: e.activeIndex ?? t.value[0]
|
|
27
|
+
});
|
|
28
|
+
return h(c, async (r) => {
|
|
29
|
+
const u = n.value[r], a = g(u);
|
|
30
|
+
a && typeof a.focus == "function" && a.focus();
|
|
31
|
+
}), { __sfc: !0, props: e, listItemRefs: n, listIndices: t, focusedIndex: c, next: i, prev: l, scrollToSection: (r, u) => {
|
|
32
|
+
if (u)
|
|
33
|
+
return;
|
|
34
|
+
const a = g(r);
|
|
35
|
+
if (!a) {
|
|
36
|
+
k("[bento-anchor-scroller] element ref not found");
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (!a.style.scrollMarginTop && e.scrollOffset) {
|
|
40
|
+
const f = window.getComputedStyle(a).scrollMarginTop;
|
|
41
|
+
(f === "0px" || f === "") && (a.style.scrollMarginTop = `${e.scrollOffset}px`);
|
|
42
|
+
}
|
|
43
|
+
a.hasAttribute("tabindex") || a.setAttribute("tabindex", "-1"), a.scrollIntoView({
|
|
44
|
+
behavior: "smooth",
|
|
45
|
+
block: "start",
|
|
46
|
+
inline: "nearest"
|
|
47
|
+
}), a.focus({ preventScroll: !0 });
|
|
48
|
+
}, onKeydownNavigation: (r) => {
|
|
49
|
+
switch (r.key) {
|
|
50
|
+
case "ArrowRight":
|
|
51
|
+
r.preventDefault(), i();
|
|
52
|
+
break;
|
|
53
|
+
case "ArrowLeft":
|
|
54
|
+
r.preventDefault(), l();
|
|
55
|
+
break;
|
|
56
|
+
case "Home":
|
|
57
|
+
r.preventDefault(), c.value = 0;
|
|
58
|
+
break;
|
|
59
|
+
case "End":
|
|
60
|
+
r.preventDefault(), c.value = t.value.length - 1;
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
}, BentoButton: E };
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
var V = function() {
|
|
67
|
+
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
68
|
+
return n("ul", { staticClass: "b-anchor-scroller-list", on: { keydown: t.onKeydownNavigation } }, e._l(e.items, function({ title: c, disabled: i, elementRef: l }, d) {
|
|
69
|
+
return n("li", { key: d, staticClass: "b-anchor-scroller-list__item" }, [n(t.BentoButton, { ref: "listItemRefs", refInFor: !0, staticClass: "b-anchor-scroller-list__item-button", class: {
|
|
70
|
+
"b-anchor-scroller-list__item-button--active": e.activeIndex === d,
|
|
71
|
+
"b-anchor-scroller-list__item-button--disabled": i
|
|
72
|
+
}, attrs: { "aria-current": e.activeIndex === d ? "location" : null, "aria-disabled": i, tabindex: e.activeIndex === d ? null : "-1", variant: "tertiary-with-background" }, on: { click: function(s) {
|
|
73
|
+
return t.scrollToSection(l, i);
|
|
74
|
+
} }, nativeOn: { keydown: [function(s) {
|
|
75
|
+
return !s.type.indexOf("key") && e._k(s.keyCode, "space", 32, s.key, [" ", "Spacebar"]) ? null : (s.preventDefault(), t.scrollToSection(l, i));
|
|
76
|
+
}, function(s) {
|
|
77
|
+
return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : (s.preventDefault(), t.scrollToSection(l, i));
|
|
78
|
+
}] } }, [e._v(" " + e._s(c) + " ")])], 1);
|
|
79
|
+
}), 0);
|
|
80
|
+
}, K = [], P = /* @__PURE__ */ C(
|
|
81
|
+
H,
|
|
82
|
+
V,
|
|
83
|
+
K,
|
|
84
|
+
!1,
|
|
85
|
+
null,
|
|
86
|
+
"5668c5f7"
|
|
87
|
+
);
|
|
88
|
+
const W = P.exports, z = {
|
|
89
|
+
"en-US": {
|
|
90
|
+
jumpTo: "Jump to"
|
|
91
|
+
},
|
|
92
|
+
"ja-JP": {
|
|
93
|
+
jumpTo: "移動先"
|
|
94
|
+
},
|
|
95
|
+
"pt-BR": {
|
|
96
|
+
jumpTo: "Ir para"
|
|
97
|
+
}
|
|
98
|
+
}, J = (p, e) => {
|
|
99
|
+
var l;
|
|
100
|
+
const n = x(((l = e.default) == null ? void 0 : l.value) ?? -1), { y: t } = B(), { height: c } = R(), i = () => {
|
|
101
|
+
const d = y(p), s = c.value, r = s / 2;
|
|
102
|
+
let u = -1, a = 0;
|
|
103
|
+
for (let f = 0; f < d.length; f++) {
|
|
104
|
+
const v = d[f];
|
|
105
|
+
if (!v)
|
|
106
|
+
continue;
|
|
107
|
+
const o = v.getBoundingClientRect();
|
|
108
|
+
if (o.top > r)
|
|
109
|
+
continue;
|
|
110
|
+
const _ = Math.min(o.bottom, s) - Math.max(o.top, 0);
|
|
111
|
+
if (_ <= 0)
|
|
112
|
+
continue;
|
|
113
|
+
const I = _ / o.height;
|
|
114
|
+
I > a && (a = I, u = f);
|
|
115
|
+
}
|
|
116
|
+
u !== -1 && n.value !== u && (n.value = u);
|
|
117
|
+
};
|
|
118
|
+
return D([t, c], i, { throttle: 100, trailing: !0 }), S(() => {
|
|
119
|
+
y(p).length && i();
|
|
120
|
+
}), {
|
|
121
|
+
activeIndex: n
|
|
122
|
+
};
|
|
123
|
+
}, U = {
|
|
124
|
+
i18n: { messages: z },
|
|
125
|
+
name: "bento-anchor-scroller"
|
|
126
|
+
}, Y = /* @__PURE__ */ w({
|
|
127
|
+
...U,
|
|
128
|
+
props: {
|
|
129
|
+
activeIndex: { default: void 0 },
|
|
130
|
+
items: null
|
|
131
|
+
},
|
|
132
|
+
emits: ["update:active-index"],
|
|
133
|
+
setup(p, { emit: e }) {
|
|
134
|
+
const n = p, { t } = O(), c = x(null), i = m(() => n.items.map((o) => ({ ...o }))), l = m(
|
|
135
|
+
() => n.items.map((o, _) => ({
|
|
136
|
+
element: g(o.elementRef),
|
|
137
|
+
originalIndex: _,
|
|
138
|
+
disabled: o.disabled
|
|
139
|
+
})).filter(
|
|
140
|
+
(o) => !o.disabled && !!o.element
|
|
141
|
+
)
|
|
142
|
+
), { top: d, bottom: s } = F(c), r = m(() => l.value.map((o) => o.element)), u = m(() => ({
|
|
143
|
+
"b-anchor-scroller__navigation--pinned": d.value <= 1
|
|
144
|
+
})), { activeIndex: a } = J(r, {
|
|
145
|
+
default: T(n, "activeIndex")
|
|
146
|
+
}), f = L(a, 200), b = m(() => {
|
|
147
|
+
const o = l.value[f.value];
|
|
148
|
+
return o ? o.originalIndex : 0;
|
|
149
|
+
});
|
|
150
|
+
h(b, (o) => {
|
|
151
|
+
Number.isFinite(o) && e("update:active-index", o);
|
|
152
|
+
}), h(
|
|
153
|
+
() => n.activeIndex,
|
|
154
|
+
(o) => {
|
|
155
|
+
Number.isFinite(o) && i.value[o].disabled && k("[bento-anchor-scroller] activeIndex should not be a disabled item");
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
const v = j("bento-anchor-scroller-label");
|
|
159
|
+
return { __sfc: !0, t, props: n, emit: e, navigationRef: c, computedItems: i, enabledItems: l, top: d, bottom: s, scrollToTargets: r, navigationConditionalClasses: u, relativeActiveIndex: a, debouncedActiveIndex: f, currentActiveIndex: b, navLabelId: v, BentoTypography: M, FixedScroller: N, AnchorScrollerList: W };
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
var q = function() {
|
|
163
|
+
var e = this, n = e._self._c, t = e._self._setupProxy;
|
|
164
|
+
return t.computedItems.length ? n("div", { staticClass: "b-anchor-scroller" }, [n("nav", { ref: "navigationRef", staticClass: "b-anchor-scroller__navigation", class: t.navigationConditionalClasses, attrs: { "aria-labelledby": t.navLabelId } }, [n(t.FixedScroller, { attrs: { condensed: "", centered: "" } }, [n("div", { staticClass: "b-anchor-scroller__navigation-panel" }, [n(t.BentoTypography, { staticClass: "b-anchor-scroller__navigation-panel-label", attrs: { id: t.navLabelId, el: "span", stronger: "" } }, [e._v(" " + e._s(t.t("jumpTo")) + " ")]), n(t.AnchorScrollerList, { attrs: { items: t.computedItems, "active-index": t.currentActiveIndex, "scroll-offset": t.bottom } })], 1)])], 1), e._t("default")], 2) : e._e();
|
|
165
|
+
}, G = [], Q = /* @__PURE__ */ C(
|
|
166
|
+
Y,
|
|
167
|
+
q,
|
|
168
|
+
G,
|
|
169
|
+
!1,
|
|
170
|
+
null,
|
|
171
|
+
"ae16e25c"
|
|
172
|
+
);
|
|
173
|
+
const se = Q.exports;
|
|
174
|
+
export {
|
|
175
|
+
se as a
|
|
176
|
+
};
|
|
177
|
+
//# sourceMappingURL=anchor-scroller.Cb22EJiL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor-scroller.3_idPubO.js","sources":["../../src/components/anchor-scroller/components/anchor-scroller-list/anchor-scroller-list.vue","../../src/components/anchor-scroller/composables/use-scroll-spy/use-scroll-spy.ts","../../src/components/anchor-scroller/anchor-scroller.vue"],"sourcesContent":["<template>\n <ul class=\"b-anchor-scroller-list\" @keydown=\"onKeydownNavigation\">\n <li v-for=\"({ title, disabled, elementRef }, index) in items\" :key=\"index\" class=\"b-anchor-scroller-list__item\">\n <bento-button\n ref=\"listItemRefs\"\n :aria-current=\"activeIndex === index ? 'location' : null\"\n class=\"b-anchor-scroller-list__item-button\"\n :class=\"{\n 'b-anchor-scroller-list__item-button--active': activeIndex === index,\n 'b-anchor-scroller-list__item-button--disabled': disabled,\n }\"\n :aria-disabled=\"disabled\"\n :tabindex=\"activeIndex === index ? null : '-1'\"\n variant=\"tertiary-with-background\"\n @click=\"scrollToSection(elementRef, disabled)\"\n @keydown.space.native.prevent=\"scrollToSection(elementRef, disabled)\"\n @keydown.enter.native.prevent=\"scrollToSection(elementRef, disabled)\"\n >\n {{ title }}\n </bento-button>\n </li>\n </ul>\n</template>\n\n<script setup lang=\"ts\">\n import BentoButton from '@/components/button/button.vue';\n import { unrefElement } from '@/directives/click-outside/utils';\n import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\n import { type BentoAnchorScrollerItem } from '../../anchor-scroller.types';\n import { type AnchorScrollerListProps } from './anchor-scroller-list.types';\n import { computed, ref, watch } from 'vue';\n import { useCycleList } from '@vueuse/core';\n\n const props = defineProps({\n activeIndex: { default: undefined },\n items: null,\n scrollOffset: { default: undefined }\n});\n\n const listItemRefs = ref([]);\n const listIndices = computed(() =>\n props.items\n .map((item, index) => ({ disabled: item.disabled, originalIndex: index }))\n .filter(({ disabled }) => !disabled)\n .map(({ originalIndex }) => originalIndex)\n );\n\n const {\n state: focusedIndex,\n next,\n prev,\n } = useCycleList(listIndices, {\n initialValue: props.activeIndex ?? listIndices.value[0],\n });\n\n watch(focusedIndex, async newIndex => {\n const targetComponent = listItemRefs.value[newIndex];\n const el = unrefElement(targetComponent); // Handles Component or DOM node\n\n if (el && typeof el.focus === 'function') {\n el.focus();\n }\n });\n\n const scrollToSection = (elementRef: BentoAnchorScrollerItem['elementRef'], disabled?: boolean) => {\n if (disabled) {\n return;\n }\n\n const el = unrefElement(elementRef);\n\n if (!el) {\n printDevelopmentWarning(`[bento-anchor-scroller] element ref not found`);\n return;\n }\n\n if (!el.style.scrollMarginTop && props.scrollOffset) {\n const currentScrollMargin = window.getComputedStyle(el).scrollMarginTop;\n\n if (currentScrollMargin === '0px' || currentScrollMargin === '') {\n el.style.scrollMarginTop = `${props.scrollOffset}px`;\n }\n }\n\n if (!el.hasAttribute('tabindex')) {\n el.setAttribute('tabindex', '-1');\n }\n\n el.scrollIntoView({\n behavior: 'smooth',\n block: 'start',\n inline: 'nearest',\n });\n\n el.focus({ preventScroll: true });\n };\n\n const onKeydownNavigation = (e: KeyboardEvent) => {\n switch (e.key) {\n case 'ArrowRight':\n e.preventDefault();\n next();\n break;\n case 'ArrowLeft':\n e.preventDefault();\n prev();\n break;\n case 'Home':\n e.preventDefault();\n focusedIndex.value = 0;\n break;\n case 'End':\n e.preventDefault();\n focusedIndex.value = listIndices.value.length - 1;\n break;\n }\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./anchor-scroller-list.scss\" />\n","import { type Ref, ref, watchEffect } from 'vue';\nimport { type MaybeRef, toValue, useWindowScroll, useWindowSize, watchThrottled } from '@vueuse/core';\n\n/**\n * Options for the useScrollSpy composable.\n */\nexport interface useScrollSpyOptions {\n /**\n * The default active index to use when no item is active or initially.\n */\n default?: Ref<number>;\n}\n\n/**\n * Composable to spy on scroll position and determine the active item based on visibility.\n *\n * @param items - The list of elements to spy on.\n * @param options - Configuration options for the scroll spy.\n * @returns An object containing the active index.\n */\nexport const useScrollSpy = (items: MaybeRef<Array<Element>>, options: useScrollSpyOptions) => {\n const activeIndex = ref(options.default?.value ?? -1);\n\n const { y: scrollY } = useWindowScroll();\n const { height: windowHeight } = useWindowSize();\n\n // Logic to find the \"winner\" when there are multiple items on the same page\n const calculateActiveIndex = () => {\n const list = toValue(items);\n const viewportHeight = windowHeight.value;\n const midpoint = viewportHeight / 2;\n\n let winnerIndex = -1;\n let maxVisibleRatio = 0;\n\n for (let i = 0; i < list.length; i++) {\n const item = list[i];\n const el = item;\n\n if (!el) {\n continue;\n }\n\n const rect = el.getBoundingClientRect();\n\n // Constraint 1: Must pass midpoint\n if (rect.top > midpoint) {\n continue;\n }\n\n // Constraint 2: Must be visible\n const visibleHeight = Math.min(rect.bottom, viewportHeight) - Math.max(rect.top, 0);\n if (visibleHeight <= 0) {\n continue;\n }\n\n // Constraint 3: Highest visible % wins\n const ratio = visibleHeight / rect.height;\n\n if (ratio > maxVisibleRatio) {\n maxVisibleRatio = ratio;\n winnerIndex = i;\n }\n }\n\n // Only update if changed to avoid unnecessary patch triggers\n if (winnerIndex !== -1 && activeIndex.value !== winnerIndex) {\n activeIndex.value = winnerIndex;\n }\n };\n\n watchThrottled([scrollY, windowHeight], calculateActiveIndex, { throttle: 100, trailing: true });\n\n watchEffect(() => {\n if (toValue(items).length) {\n calculateActiveIndex();\n }\n });\n\n return {\n activeIndex,\n };\n};\n","<template>\n <div v-if=\"computedItems.length\" class=\"b-anchor-scroller\">\n <nav\n ref=\"navigationRef\"\n class=\"b-anchor-scroller__navigation\"\n :class=\"navigationConditionalClasses\"\n :aria-labelledby=\"navLabelId\"\n >\n <fixed-scroller condensed centered>\n <div class=\"b-anchor-scroller__navigation-panel\">\n <bento-typography\n :id=\"navLabelId\"\n el=\"span\"\n class=\"b-anchor-scroller__navigation-panel-label\"\n stronger\n >\n {{ t('jumpTo') }}\n </bento-typography>\n\n <anchor-scroller-list\n :items=\"computedItems\"\n :active-index=\"currentActiveIndex\"\n :scroll-offset=\"bottom\"\n />\n </div>\n </fixed-scroller>\n </nav>\n\n <slot />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref, toRef, watch } from 'vue';\n import { useElementBounding, watchDebounced } from '@vueuse/core';\n import BentoTypography from '@/components/typography/typography.vue';\n import { FixedScroller } from '@/internal';\n import { type BentoAnchorScrollerItem, type BentoAnchorScrollerProps } from './anchor-scroller.types';\n import { AnchorScrollerList } from './components/anchor-scroller-list';\n import { useI18n } from '@/utils/ts/i18n';\n import { generateUid } from '@/core/utils/ts';\n import { unrefElement } from '@/directives/click-outside/utils';\n import messages from './messages.json';\n import { useScrollSpy } from './composables';\n import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = defineProps({\n activeIndex: { default: undefined },\n items: null\n});\n\n const emit = defineEmits([\"update:active-index\"]);\n\n const navigationRef = ref(null);\n\n const computedItems = computed<Array<BentoAnchorScrollerItem>>(() => props.items.map(item => ({ ...item })));\n\n // Skip and cache only items that are enabled\n const enabledItems = computed(() =>\n props.items\n .map((item, originalIndex) => ({\n element: unrefElement(item.elementRef),\n originalIndex,\n disabled: item.disabled,\n }))\n .filter(\n (item): item is { element: Element; originalIndex: number; disabled: boolean } =>\n !item.disabled && !!item.element\n )\n );\n\n // Extract strictly the elements for the ScrollSpy to watch\n const scrollToTargets = computed(() => enabledItems.value.map(c => c.element));\n\n const navigationConditionalClasses = computed(() => ({\n 'b-anchor-scroller__navigation--pinned': top.value <= 1,\n }));\n\n const currentActiveIndex = computed(() => {\n const candidate = enabledItems.value[relativeActiveIndex.value];\n\n return candidate ? candidate.originalIndex : 0;\n });\n\n const { activeIndex: relativeActiveIndex } = useScrollSpy(scrollToTargets, {\n default: toRef(props, 'activeIndex'),\n });\n\n const { top, bottom } = useElementBounding(navigationRef);\n\n watchDebounced(\n currentActiveIndex,\n val => {\n if (Number.isFinite(val)) {\n emit('update:active-index', val);\n }\n },\n {\n debounce: 250, // ensure that if you are scrolling through multiple sections quickly, it fires only once.\n }\n );\n\n watch(\n () => props.activeIndex,\n val => {\n if (Number.isFinite(val) && computedItems.value[val].disabled) {\n printDevelopmentWarning(`[bento-anchor-scroller] activeIndex should not be a disabled item`);\n }\n }\n );\n\n const navLabelId = generateUid('bento-anchor-scroller-label');\n</script>\n\n<script lang=\"ts\">\n /**\n * A navigation component that tracks page scroll and allows jumping to sections.\n *\n * @example\n * import { BentoAnchorScroller } from '@adyen/bento-vue2';\n * import { ref } from 'vue';\n *\n * export default {\n * components: { BentoAnchorScroller },\n * template: `\n * <bento-anchor-scroller :items=\"items\">\n * <section ref=\"section1\">Section 1</section>\n * <section ref=\"section2\">Section 2</section>\n * </bento-anchor-scroller>\n * `,\n * setup() {\n * const section1 = ref(null);\n * const section2 = ref(null);\n * const items = ref([\n * { title: 'Section 1', elementRef: section1 },\n * { title: 'Section 2', elementRef: section2 },\n * ]);\n * return {\n * items,\n * section1,\n * section2,\n * }\n * }\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-anchor-scroller',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./anchor-scroller.scss\" />\n"],"names":["listItemRefs","ref","listIndices","computed","props","item","index","disabled","originalIndex","focusedIndex","next","prev","useCycleList","watch","newIndex","targetComponent","el","unrefElement","elementRef","printDevelopmentWarning","currentScrollMargin","e","useScrollSpy","items","options","activeIndex","_a","scrollY","useWindowScroll","windowHeight","useWindowSize","calculateActiveIndex","list","toValue","viewportHeight","midpoint","winnerIndex","maxVisibleRatio","i","rect","visibleHeight","ratio","watchThrottled","watchEffect","__default__","messages","useI18n","navigationRef","computedItems","enabledItems","scrollToTargets","c","navigationConditionalClasses","top","currentActiveIndex","candidate","relativeActiveIndex","toRef","bottom","useElementBounding","watchDebounced","val","emit","navLabelId","generateUid"],"mappings":";;;;;;;;;;;;;;;;;;iBAuCIA,IAAAC,EAAA,CAAA,CAAA,GACAC,IAAAC;AAAA,MAAoB,MAAAC,EAAA,MAAA,IAAA,CAAAC,GAAAC,OAAA,EAAA,UAAAD,EAAA,UAAA,eAAAC,EAAA,EAAA,EAAA,OAAA,CAAA,EAAA,UAAAC,EAAA,MAAA,CAAAA,CAAA,EAAA,IAAA,CAAA,EAAA,eAAAC,EAAA,MAAAA,CAAA;AAAA,IAI6B,GAGjD;AAAA,MAAM,OAAAC;AAAA,MACK,MAAAC;AAAA,MACP,MAAAC;AAAA,IACA,IAAAC,EAAAV,GAAA;AAAA,MAC0B,cAAAE,EAAA,eAAAF,EAAA,MAAA,CAAA;AAAA,IAC4B,CAAA;AAG1D,WAAAW,EAAAJ,GAAA,OAAAK,MAAA;AACI,YAAAC,IAAAf,EAAA,MAAAc,CAAA,GACAE,IAAAC,EAAAF,CAAA;AAEA,MAAAC,KAAA,OAAAA,EAAA,SAAA,cACIA,EAAA,MAAA;AAAA,IACJ,CAAA,+GAGJ,CAAAE,GAAAX,MAAA;AACI,UAAAA;AACI;AAGJ,YAAAS,IAAAC,EAAAC,CAAA;AAEA,UAAA,CAAAF,GAAA;AACI,QAAAG,EAAA,+CAAA;AACA;AAAA,MAAA;AAGJ,UAAA,CAAAH,EAAA,MAAA,mBAAAZ,EAAA,cAAA;AACI,cAAAgB,IAAA,OAAA,iBAAAJ,CAAA,EAAA;AAEA,SAAAI,MAAA,SAAAA,MAAA,QACIJ,EAAA,MAAA,kBAAA,GAAAZ,EAAA,YAAA;AAAA,MACJ;AAGJ,MAAAY,EAAA,aAAA,UAAA,KACIA,EAAA,aAAA,YAAA,IAAA,GAGJA,E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AAA;AAEA,IAAAa;AAAA,MAAAN;AAAA,MACI,CAAAO,MAAA;AAEI,QAAA,OAAA,SAAAA,CAAA,KACIC,EAAA,uBAAAD,CAAA;AAAA,MACJ;AAAA,MACJ;AAAA,QACA,UAAA;AAAA;AAAA,MACc;AAAA,IACd,GAGJhD;AAAA,MAAA,MAAAT,EAAA;AAAA,MACgB,CAAAyD,MAAA;AAER,QAAA,OAAA,SAAAA,CAAA,KAAAb,EAAA,MAAAa,CAAA,EAAA,YACI1C,EAAA,mEAAA;AAAA,MACJ;AAAA,IACJ;AAGJ,UAAA4C,IAAAC,EAAA,6BAAA;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"anchor-scroller.Cb22EJiL.js","sources":["../../src/components/anchor-scroller/components/anchor-scroller-list/anchor-scroller-list.vue","../../src/components/anchor-scroller/composables/use-scroll-spy/use-scroll-spy.ts","../../src/components/anchor-scroller/anchor-scroller.vue"],"sourcesContent":["<template>\n <ul class=\"b-anchor-scroller-list\" @keydown=\"onKeydownNavigation\">\n <li v-for=\"({ title, disabled, elementRef }, index) in items\" :key=\"index\" class=\"b-anchor-scroller-list__item\">\n <bento-button\n ref=\"listItemRefs\"\n :aria-current=\"activeIndex === index ? 'location' : null\"\n class=\"b-anchor-scroller-list__item-button\"\n :class=\"{\n 'b-anchor-scroller-list__item-button--active': activeIndex === index,\n 'b-anchor-scroller-list__item-button--disabled': disabled,\n }\"\n :aria-disabled=\"disabled\"\n :tabindex=\"activeIndex === index ? null : '-1'\"\n variant=\"tertiary-with-background\"\n @click=\"scrollToSection(elementRef, disabled)\"\n @keydown.space.native.prevent=\"scrollToSection(elementRef, disabled)\"\n @keydown.enter.native.prevent=\"scrollToSection(elementRef, disabled)\"\n >\n {{ title }}\n </bento-button>\n </li>\n </ul>\n</template>\n\n<script setup lang=\"ts\">\n import BentoButton from '@/components/button/button.vue';\n import { unrefElement } from '@/directives/click-outside/utils';\n import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\n import { type BentoAnchorScrollerItem } from '../../anchor-scroller.types';\n import { type AnchorScrollerListProps } from './anchor-scroller-list.types';\n import { computed, ref, watch } from 'vue';\n import { useCycleList } from '@vueuse/core';\n\n const props = defineProps({\n activeIndex: { default: undefined },\n items: null,\n scrollOffset: { default: undefined }\n});\n\n const listItemRefs = ref([]);\n const listIndices = computed(() =>\n props.items\n .map((item, index) => ({ disabled: item.disabled, originalIndex: index }))\n .filter(({ disabled }) => !disabled)\n .map(({ originalIndex }) => originalIndex)\n );\n\n const {\n state: focusedIndex,\n next,\n prev,\n } = useCycleList(listIndices, {\n initialValue: props.activeIndex ?? listIndices.value[0],\n });\n\n watch(focusedIndex, async newIndex => {\n const targetComponent = listItemRefs.value[newIndex];\n const el = unrefElement(targetComponent); // Handles Component or DOM node\n\n if (el && typeof el.focus === 'function') {\n el.focus();\n }\n });\n\n const scrollToSection = (elementRef: BentoAnchorScrollerItem['elementRef'], disabled?: boolean) => {\n if (disabled) {\n return;\n }\n\n const el = unrefElement(elementRef);\n\n if (!el) {\n printDevelopmentWarning(`[bento-anchor-scroller] element ref not found`);\n return;\n }\n\n if (!el.style.scrollMarginTop && props.scrollOffset) {\n const currentScrollMargin = window.getComputedStyle(el).scrollMarginTop;\n\n if (currentScrollMargin === '0px' || currentScrollMargin === '') {\n el.style.scrollMarginTop = `${props.scrollOffset}px`;\n }\n }\n\n if (!el.hasAttribute('tabindex')) {\n el.setAttribute('tabindex', '-1');\n }\n\n el.scrollIntoView({\n behavior: 'smooth',\n block: 'start',\n inline: 'nearest',\n });\n\n el.focus({ preventScroll: true });\n };\n\n const onKeydownNavigation = (e: KeyboardEvent) => {\n switch (e.key) {\n case 'ArrowRight':\n e.preventDefault();\n next();\n break;\n case 'ArrowLeft':\n e.preventDefault();\n prev();\n break;\n case 'Home':\n e.preventDefault();\n focusedIndex.value = 0;\n break;\n case 'End':\n e.preventDefault();\n focusedIndex.value = listIndices.value.length - 1;\n break;\n }\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./anchor-scroller-list.scss\" />\n","import { type Ref, ref, watchEffect } from 'vue';\nimport { type MaybeRef, toValue, useWindowScroll, useWindowSize, watchThrottled } from '@vueuse/core';\n\n/**\n * Options for the useScrollSpy composable.\n */\nexport interface useScrollSpyOptions {\n /**\n * The default active index to use when no item is active or initially.\n */\n default?: Ref<number>;\n}\n\n/**\n * Composable to spy on scroll position and determine the active item based on visibility.\n *\n * @param items - The list of elements to spy on.\n * @param options - Configuration options for the scroll spy.\n * @returns An object containing the active index.\n */\nexport const useScrollSpy = (items: MaybeRef<Array<Element>>, options: useScrollSpyOptions) => {\n const activeIndex = ref(options.default?.value ?? -1);\n\n const { y: scrollY } = useWindowScroll();\n const { height: windowHeight } = useWindowSize();\n\n // Logic to find the \"winner\" when there are multiple items on the same page\n const calculateActiveIndex = () => {\n const list = toValue(items);\n const viewportHeight = windowHeight.value;\n const midpoint = viewportHeight / 2;\n\n let winnerIndex = -1;\n let maxVisibleRatio = 0;\n\n for (let i = 0; i < list.length; i++) {\n const item = list[i];\n const el = item;\n\n if (!el) {\n continue;\n }\n\n const rect = el.getBoundingClientRect();\n\n // Constraint 1: Must pass midpoint\n if (rect.top > midpoint) {\n continue;\n }\n\n // Constraint 2: Must be visible\n const visibleHeight = Math.min(rect.bottom, viewportHeight) - Math.max(rect.top, 0);\n if (visibleHeight <= 0) {\n continue;\n }\n\n // Constraint 3: Highest visible % wins\n const ratio = visibleHeight / rect.height;\n\n if (ratio > maxVisibleRatio) {\n maxVisibleRatio = ratio;\n winnerIndex = i;\n }\n }\n\n // Only update if changed to avoid unnecessary patch triggers\n if (winnerIndex !== -1 && activeIndex.value !== winnerIndex) {\n activeIndex.value = winnerIndex;\n }\n };\n\n watchThrottled([scrollY, windowHeight], calculateActiveIndex, { throttle: 100, trailing: true });\n\n watchEffect(() => {\n if (toValue(items).length) {\n calculateActiveIndex();\n }\n });\n\n return {\n activeIndex,\n };\n};\n","<template>\n <div v-if=\"computedItems.length\" class=\"b-anchor-scroller\">\n <nav\n ref=\"navigationRef\"\n class=\"b-anchor-scroller__navigation\"\n :class=\"navigationConditionalClasses\"\n :aria-labelledby=\"navLabelId\"\n >\n <fixed-scroller condensed centered>\n <div class=\"b-anchor-scroller__navigation-panel\">\n <bento-typography\n :id=\"navLabelId\"\n el=\"span\"\n class=\"b-anchor-scroller__navigation-panel-label\"\n stronger\n >\n {{ t('jumpTo') }}\n </bento-typography>\n\n <anchor-scroller-list\n :items=\"computedItems\"\n :active-index=\"currentActiveIndex\"\n :scroll-offset=\"bottom\"\n />\n </div>\n </fixed-scroller>\n </nav>\n\n <slot />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref, toRef, watch } from 'vue';\n import { refDebounced, useElementBounding } from '@vueuse/core';\n import BentoTypography from '@/components/typography/typography.vue';\n import { FixedScroller } from '@/internal';\n import { type BentoAnchorScrollerItem, type BentoAnchorScrollerProps } from './anchor-scroller.types';\n import { AnchorScrollerList } from './components/anchor-scroller-list';\n import { useI18n } from '@/utils/ts/i18n';\n import { generateUid } from '@/core/utils/ts';\n import { unrefElement } from '@/directives/click-outside/utils';\n import messages from './messages.json';\n import { useScrollSpy } from './composables';\n import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = defineProps({\n activeIndex: { default: undefined },\n items: null\n});\n\n const emit = defineEmits([\"update:active-index\"]);\n\n const navigationRef = ref(null);\n\n const computedItems = computed<Array<BentoAnchorScrollerItem>>(() => props.items.map(item => ({ ...item })));\n\n // Skip and cache only items that are enabled\n const enabledItems = computed(() =>\n props.items\n .map((item, originalIndex) => ({\n element: unrefElement(item.elementRef),\n originalIndex,\n disabled: item.disabled,\n }))\n .filter(\n (item): item is { element: Element; originalIndex: number; disabled: boolean } =>\n !item.disabled && !!item.element\n )\n );\n\n const { top, bottom } = useElementBounding(navigationRef);\n\n // Extract strictly the elements for the ScrollSpy to watch\n const scrollToTargets = computed(() => enabledItems.value.map(c => c.element));\n\n const navigationConditionalClasses = computed(() => ({\n 'b-anchor-scroller__navigation--pinned': top.value <= 1,\n }));\n\n const { activeIndex: relativeActiveIndex } = useScrollSpy(scrollToTargets, {\n default: toRef(props, 'activeIndex'),\n });\n\n const debouncedActiveIndex = refDebounced(relativeActiveIndex, 200);\n\n const currentActiveIndex = computed(() => {\n const candidate = enabledItems.value[debouncedActiveIndex.value];\n\n return candidate ? candidate.originalIndex : 0;\n });\n\n watch(currentActiveIndex, val => {\n if (Number.isFinite(val)) {\n emit('update:active-index', val);\n }\n });\n\n watch(\n () => props.activeIndex,\n val => {\n if (Number.isFinite(val) && computedItems.value[val].disabled) {\n printDevelopmentWarning(`[bento-anchor-scroller] activeIndex should not be a disabled item`);\n }\n }\n );\n\n const navLabelId = generateUid('bento-anchor-scroller-label');\n</script>\n\n<script lang=\"ts\">\n /**\n * A navigation component that tracks page scroll and allows jumping to sections.\n *\n * @example\n * import { BentoAnchorScroller } from '@adyen/bento-vue2';\n * import { ref } from 'vue';\n *\n * export default {\n * components: { BentoAnchorScroller },\n * template: `\n * <bento-anchor-scroller :items=\"items\">\n * <section ref=\"section1\">Section 1</section>\n * <section ref=\"section2\">Section 2</section>\n * </bento-anchor-scroller>\n * `,\n * setup() {\n * const section1 = ref(null);\n * const section2 = ref(null);\n * const items = ref([\n * { title: 'Section 1', elementRef: section1 },\n * { title: 'Section 2', elementRef: section2 },\n * ]);\n * return {\n * items,\n * section1,\n * section2,\n * }\n * }\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-anchor-scroller',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./anchor-scroller.scss\" />\n"],"names":["listItemRefs","ref","listIndices","computed","props","item","index","disabled","originalIndex","focusedIndex","next","prev","useCycleList","watch","newIndex","targetComponent","el","unrefElement","elementRef","printDevelopmentWarning","currentScrollMargin","e","useScrollSpy","items","options","activeIndex","_a","scrollY","useWindowScroll","windowHeight","useWindowSize","calculateActiveIndex","list","toValue","viewportHeight","midpoint","winnerIndex","maxVisibleRatio","i","rect","visibleHeight","ratio","watchThrottled","watchEffect","__default__","messages","useI18n","navigationRef","computedItems","enabledItems","top","bottom","useElementBounding","scrollToTargets","c","navigationConditionalClasses","relativeActiveIndex","toRef","debouncedActiveIndex","refDebounced","currentActiveIndex","candidate","val","emit","navLabelId","generateUid"],"mappings":";;;;;;;;;;;;;;;;;;iBAuCIA,IAAAC,EAAA,CAAA,CAAA,GACAC,IAAAC;AAAA,MAAoB,MAAAC,EAAA,MAAA,IAAA,CAAAC,GAAAC,OAAA,EAAA,UAAAD,EAAA,UAAA,eAAAC,EAAA,EAAA,EAAA,OAAA,CAAA,EAAA,UAAAC,EAAA,MAAA,CAAAA,CAAA,EAAA,IAAA,CAAA,EAAA,eAAAC,EAAA,MAAAA,CAAA;AAAA,IAI6B,GAGjD;AAAA,MAAM,OAAAC;AAAA,MACK,MAAAC;AAAA,MACP,MAAAC;AAAA,IACA,IAAAC,EAAAV,GAAA;AAAA,MAC0B,cAAAE,EAAA,eAAAF,EAAA,MAAA,CAAA;AAAA,IAC4B,CAAA;AAG1D,WAAAW,EAAAJ,GAAA,OAAAK,MAAA;AACI,YAAAC,IAAAf,EAAA,MAAAc,CAAA,GACAE,IAAAC,EAAAF,CAAA;AAEA,MAAAC,KAAA,OAAAA,EAAA,SAAA,cACIA,EAAA,MAAA;AAAA,IACJ,CAAA,+GAGJ,CAAAE,GAAAX,MAAA;AACI,UAAAA;AACI;AAGJ,YAAAS,IAAAC,EAAAC,CAAA;AAEA,UAAA,CAAAF,GAAA;AACI,QAAAG,EAAA,+CAAA;AACA;AAAA,MAAA;AAGJ,UAAA,CAAAH,EAAA,MAAA,mBAAAZ,EAAA,cAAA;AACI,cAAAgB,IAAA,OAAA,iBAAAJ,CAAA,EAAA;AAEA,SAAAI,MAAA,SAAAA,MAAA,QACIJ,EAAA,MAAA,kBAAA,GAAAZ,EAAA,YAAA;AAAA,MACJ;AAGJ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A,MAAA;AACI,YAAA0D,IAAAZ,EAAA,MAAAS,EAAA,KAAA;AAEA,aAAAG,IAAAA,EAAA,gBAAA;AAAA,IAA6C,CAAA;AAGjD,IAAAhD,EAAA+C,GAAA,CAAAE,MAAA;AACI,MAAA,OAAA,SAAAA,CAAA,KACIC,EAAA,uBAAAD,CAAA;AAAA,IACJ,CAAA,GAGJjD;AAAA,MAAA,MAAAT,EAAA;AAAA,MACgB,CAAA0D,MAAA;AAER,QAAA,OAAA,SAAAA,CAAA,KAAAd,EAAA,MAAAc,CAAA,EAAA,YACI3C,EAAA,mEAAA;AAAA,MACJ;AAAA,IACJ;AAGJ,UAAA6C,IAAAC,EAAA,6BAAA;;;;;;;;;;;;;;;;"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { defineComponent as T, useSlots as Y, ref as r, computed as l, inject as Q, watch as w, nextTick as X, onUnmounted as Z, useAttrs as V, onMounted as tt, provide as D, toRefs as et } from "vue";
|
|
2
2
|
import { B as at } from "./button.Ctj3rkxw.js";
|
|
3
|
-
import { B as ot } from "./focus-trap.
|
|
4
|
-
import { u as
|
|
3
|
+
import { B as ot } from "./focus-trap.DRqjHzt6.js";
|
|
4
|
+
import { u as q } from "./use-has-slot.C9lQZ6nz.js";
|
|
5
5
|
import { u as nt } from "./index.B6WW_F-J.js";
|
|
6
|
-
import {
|
|
6
|
+
import { l as st } from "./button-actions.DyPS54Yi.js";
|
|
7
7
|
import { g as lt } from "./generate-uid.NJ8tVoha.js";
|
|
8
8
|
import { C as it } from "./cross.CC_B-vG-.js";
|
|
9
|
-
import { b as ut, B as ct, D as rt, a as dt } from "./dialog-page.
|
|
9
|
+
import { b as ut, B as ct, D as rt, a as dt } from "./dialog-page.4deowaF2.js";
|
|
10
10
|
import { B as mt } from "./typography.C8lPlsbD.js";
|
|
11
|
-
import { F as pt } from "./footer-actions.
|
|
11
|
+
import { F as pt } from "./footer-actions.Dq82H1Oc.js";
|
|
12
12
|
import { o as ft } from "./resize.Bqks3WUm.js";
|
|
13
13
|
import { a as gt, G as _t } from "./grid-layout.1aIiz2N_.js";
|
|
14
|
-
import { n as
|
|
14
|
+
import { n as W } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
15
15
|
import { B as vt } from "./directive.rXUeDb8p.js";
|
|
16
16
|
import "../assets/base-modal.css";
|
|
17
17
|
var yt = /* @__PURE__ */ ((a) => (a.DEFAULT = "default", a.DIALOG = "dialog", a))(yt || {}), Ct = /* @__PURE__ */ ((a) => (a.DEFAULT = "BentoModalDefault", a.DIALOG = "BentoModalDialog", a))(Ct || {}), G = /* @__PURE__ */ ((a) => (a.SMALL = "small", a.MEDIUM = "medium", a.LARGE = "large", a))(G || {}), E = /* @__PURE__ */ ((a) => (a.SMALLER = "smaller", a.EQUAL = "equal", a.BIGGER = "bigger", a))(E || {}), F = /* @__PURE__ */ ((a) => (a.DIALOG = "dialog", a.ALERT_DIALOG = "alertdialog", a))(F || {}), ht = /* @__PURE__ */ ((a) => (a.CONFIRMATION = "confirmation", a.DESTRUCTIVE = "destructive", a.INFO = "info", a.ACKNOWLEDGEMENT = "acknowledgement", a))(ht || {}), bt = /* @__PURE__ */ ((a) => (a.CLOSE_MODAL = "close-modal", a))(bt || {});
|
|
@@ -28,7 +28,7 @@ const Lt = {
|
|
|
28
28
|
ariaLabelFallback: "modal",
|
|
29
29
|
close: "Fechar"
|
|
30
30
|
}
|
|
31
|
-
},
|
|
31
|
+
}, j = /* @__PURE__ */ Symbol("modal config data injection key"), At = T({}), Pt = /* @__PURE__ */ T({
|
|
32
32
|
...At,
|
|
33
33
|
__name: "modal-page",
|
|
34
34
|
props: {
|
|
@@ -42,7 +42,7 @@ const Lt = {
|
|
|
42
42
|
previousPage: { default: void 0 }
|
|
43
43
|
},
|
|
44
44
|
setup(a) {
|
|
45
|
-
const e = a, o = 26, t = Y(), n =
|
|
45
|
+
const e = a, o = 26, t = Y(), n = q(t), d = r(null), O = l(() => ({
|
|
46
46
|
"b-modal-page--custom-padding": e.customPadding
|
|
47
47
|
})), I = l(() => {
|
|
48
48
|
var c;
|
|
@@ -77,7 +77,7 @@ const Lt = {
|
|
|
77
77
|
] : [
|
|
78
78
|
{ small: 6, medium: 6, large: 6 },
|
|
79
79
|
{ small: 6, medium: 6, large: 6 }
|
|
80
|
-
]), { activePage: g, height: _, isAnimationActive: m, pageCustomPadding: B, showCloseButton: x, size: L } = Q(
|
|
80
|
+
]), { activePage: g, height: _, isAnimationActive: m, pageCustomPadding: B, showCloseButton: x, size: L } = Q(j), h = l(() => g.value === e.pageId || !g.value);
|
|
81
81
|
let p = null;
|
|
82
82
|
return w(
|
|
83
83
|
() => g.value,
|
|
@@ -113,7 +113,7 @@ var St = function() {
|
|
|
113
113
|
}, proxy: !0 } : e.actions && e.actions.length > 0 ? { key: "footer", fn: function() {
|
|
114
114
|
return [o("div", { staticClass: "b-modal-page__actions-container", style: t.customPaddingStyles.actions }, [o(t.FooterActions, { attrs: { actions: e.actions, "actions-label": e.actionsLabel, "destructive-actions": e.destructiveActions } })], 1)];
|
|
115
115
|
}, proxy: !0 } : null], null, !0) });
|
|
116
|
-
}, Et = [], Ot = /* @__PURE__ */
|
|
116
|
+
}, Et = [], Ot = /* @__PURE__ */ W(
|
|
117
117
|
Pt,
|
|
118
118
|
St,
|
|
119
119
|
Et,
|
|
@@ -216,7 +216,7 @@ const It = Ot.exports, Bt = T({
|
|
|
216
216
|
},
|
|
217
217
|
emits: ["update:active-page", "close-modal"],
|
|
218
218
|
setup(a, { expose: e, emit: o }) {
|
|
219
|
-
const t = a, n = 500, { t: d } = nt(), O = Y(), I = V(), R =
|
|
219
|
+
const t = a, n = 500, { t: d } = nt(), O = Y(), I = V(), R = q(O), u = r(null), f = r(!1), g = lt("modal"), _ = l(() => t.isDismissible && !t.hideCloseButton), m = r(t.customPadding), B = l(() => m.value ? { top: m.value, right: m.value } : {}), x = l(() => I["aria-label"] ?? d("ariaLabelFallback")), L = l(() => t.withColumnLayout && t.size === G.LARGE), h = () => {
|
|
220
220
|
u.value.showModal();
|
|
221
221
|
}, p = () => {
|
|
222
222
|
o("close-modal");
|
|
@@ -257,7 +257,7 @@ const It = Ot.exports, Bt = T({
|
|
|
257
257
|
var C;
|
|
258
258
|
S.value = (C = S.value) == null ? void 0 : C.filter((N) => N !== s);
|
|
259
259
|
}, J = (s) => (s && S.value.push(s), { unregisterPage: H(s) }), K = r(""), M = r(!1);
|
|
260
|
-
return D(
|
|
260
|
+
return D(j, {
|
|
261
261
|
activePage: v,
|
|
262
262
|
height: K,
|
|
263
263
|
isAnimationActive: M,
|
|
@@ -289,7 +289,7 @@ var Dt = function() {
|
|
|
289
289
|
}, proxy: !0 } : null, t.hasSlot("actions") ? { key: "actions", fn: function() {
|
|
290
290
|
return [e._t("actions")];
|
|
291
291
|
}, proxy: !0 } : null], null, !0) })], 2) : e._e()], 1)]);
|
|
292
|
-
}, Gt = [], Tt = /* @__PURE__ */
|
|
292
|
+
}, Gt = [], Tt = /* @__PURE__ */ W(
|
|
293
293
|
kt,
|
|
294
294
|
Dt,
|
|
295
295
|
Gt,
|
|
@@ -309,4 +309,4 @@ export {
|
|
|
309
309
|
Ct as g,
|
|
310
310
|
Qt as h
|
|
311
311
|
};
|
|
312
|
-
//# sourceMappingURL=base-modal.
|
|
312
|
+
//# sourceMappingURL=base-modal.CUSvvYnk.js.map
|