@adyen/bento-vue3 1.59.0 → 1.60.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/package.json +10 -6
- package/dist/@types/components.d.ts +0 -201
- package/dist/@types/index.d.ts +0 -17796
- package/dist/accordion.js +0 -6
- package/dist/accordion.js.map +0 -1
- package/dist/action-bar.js +0 -5
- package/dist/action-bar.js.map +0 -1
- package/dist/alert.js +0 -8
- package/dist/alert.js.map +0 -1
- package/dist/assets/accordion-item.css +0 -1
- package/dist/assets/action-bar.css +0 -1
- package/dist/assets/alert.css +0 -1
- package/dist/assets/avatar.css +0 -1
- package/dist/assets/base-button.css +0 -1
- package/dist/assets/base-modal.css +0 -1
- package/dist/assets/button-actions-with-menu.css +0 -1
- package/dist/assets/button-actions.css +0 -1
- package/dist/assets/button.css +0 -1
- package/dist/assets/calendar.css +0 -1
- package/dist/assets/card.css +0 -1
- package/dist/assets/checkbox-group.css +0 -1
- package/dist/assets/checkbox-input.css +0 -1
- package/dist/assets/checkbox.css +0 -1
- package/dist/assets/chip.css +0 -1
- package/dist/assets/code-snippet.css +0 -1
- package/dist/assets/controls-group.css +0 -1
- package/dist/assets/copy.css +0 -1
- package/dist/assets/country.css +0 -1
- package/dist/assets/currency.css +0 -1
- package/dist/assets/dashboard-section.css +0 -1
- package/dist/assets/dashed-underline.css +0 -1
- package/dist/assets/data-grid-template.css +0 -1
- package/dist/assets/data-grid.css +0 -1
- package/dist/assets/date-picker.css +0 -1
- package/dist/assets/date-range-picker.css +0 -1
- package/dist/assets/date.css +0 -1
- package/dist/assets/dialog-page.css +0 -1
- package/dist/assets/divider.css +0 -1
- package/dist/assets/dropdown-default-textbox.css +0 -1
- package/dist/assets/dropdown-tag.css +0 -1
- package/dist/assets/dropdown.css +0 -1
- package/dist/assets/empty-state.css +0 -1
- package/dist/assets/error-message.css +0 -1
- package/dist/assets/file-uploader.css +0 -1
- package/dist/assets/filter-bar.css +0 -1
- package/dist/assets/fixed-scroller.css +0 -1
- package/dist/assets/focus-trap.css +0 -1
- package/dist/assets/footer-actions.css +0 -1
- package/dist/assets/form-layout-title.css +0 -1
- package/dist/assets/grid-layout.css +0 -1
- package/dist/assets/header-with-views.css +0 -1
- package/dist/assets/header.css +0 -1
- package/dist/assets/info-icon-with-popover.css +0 -1
- package/dist/assets/info-icon.css +0 -1
- package/dist/assets/input-field-password.css +0 -1
- package/dist/assets/input-field-phone-number.css +0 -1
- package/dist/assets/input-field.css +0 -1
- package/dist/assets/inspector.css +0 -1
- package/dist/assets/layout-row.css +0 -1
- package/dist/assets/link.css +0 -1
- package/dist/assets/listbox-option-tag.css +0 -1
- package/dist/assets/loading-indicator.css +0 -1
- package/dist/assets/main.css +0 -1
- package/dist/assets/menu.css +0 -1
- package/dist/assets/modal-fullscreen.css +0 -1
- package/dist/assets/pagination.css +0 -1
- package/dist/assets/payment-method.css +0 -1
- package/dist/assets/popover.css +0 -1
- package/dist/assets/popper-container.css +0 -1
- package/dist/assets/promo-banner.css +0 -1
- package/dist/assets/radio-group.css +0 -1
- package/dist/assets/radio-input.css +0 -1
- package/dist/assets/rich-text-editor.css +0 -1
- package/dist/assets/search-bar.css +0 -1
- package/dist/assets/secondary-nav.css +0 -1
- package/dist/assets/segmented-control.css +0 -1
- package/dist/assets/selection-card-group.css +0 -1
- package/dist/assets/sidepanel.css +0 -1
- package/dist/assets/status.css +0 -1
- package/dist/assets/step.css +0 -1
- package/dist/assets/structured-list-item.css +0 -1
- package/dist/assets/summary-grid.css +0 -1
- package/dist/assets/tabs.css +0 -1
- package/dist/assets/tag.css +0 -1
- package/dist/assets/teleport.css +0 -1
- package/dist/assets/textarea.css +0 -1
- package/dist/assets/timeline-item.css +0 -1
- package/dist/assets/toast.css +0 -1
- package/dist/assets/toggle-button.css +0 -1
- package/dist/assets/toggle.css +0 -1
- package/dist/assets/tooltip.css +0 -1
- package/dist/assets/tutorial.css +0 -1
- package/dist/assets/typography.css +0 -1
- package/dist/assets/use-cached-selected-values.css +0 -1
- package/dist/avatar.js +0 -5
- package/dist/avatar.js.map +0 -1
- package/dist/button.js +0 -16
- package/dist/button.js.map +0 -1
- package/dist/card.js +0 -7
- package/dist/card.js.map +0 -1
- package/dist/checkbox.js +0 -11
- package/dist/checkbox.js.map +0 -1
- package/dist/chip.js +0 -5
- package/dist/chip.js.map +0 -1
- package/dist/chunks/1-generic-use.CZhwP2Yc.js +0 -5
- package/dist/chunks/1-generic-use.CZhwP2Yc.js.map +0 -1
- package/dist/chunks/1-generic-use.R6x8PEGA.js +0 -5
- package/dist/chunks/1-generic-use.R6x8PEGA.js.map +0 -1
- package/dist/chunks/2-generic-use.CNKjB4B7.js +0 -5
- package/dist/chunks/2-generic-use.CNKjB4B7.js.map +0 -1
- package/dist/chunks/2-generic-use.w0fUhovx.js +0 -5
- package/dist/chunks/2-generic-use.w0fUhovx.js.map +0 -1
- package/dist/chunks/3-generic-use.BLEzR04g.js +0 -5
- package/dist/chunks/3-generic-use.BLEzR04g.js.map +0 -1
- package/dist/chunks/3-generic-use.D3NFHgI4.js +0 -5
- package/dist/chunks/3-generic-use.D3NFHgI4.js.map +0 -1
- package/dist/chunks/4-generic-use.CULEpvgj.js +0 -5
- package/dist/chunks/4-generic-use.CULEpvgj.js.map +0 -1
- package/dist/chunks/4-generic-use.D82y3n39.js +0 -5
- package/dist/chunks/4-generic-use.D82y3n39.js.map +0 -1
- package/dist/chunks/_commonjsHelpers.C6fGbg64.js +0 -7
- package/dist/chunks/_commonjsHelpers.C6fGbg64.js.map +0 -1
- package/dist/chunks/_plugin-vue_export-helper.CHgC5LLL.js +0 -10
- package/dist/chunks/_plugin-vue_export-helper.CHgC5LLL.js.map +0 -1
- package/dist/chunks/accordion-item.CihL7JaZ.js +0 -142
- package/dist/chunks/accordion-item.CihL7JaZ.js.map +0 -1
- package/dist/chunks/action-bar.DHFGXPzd.js +0 -203
- package/dist/chunks/action-bar.DHFGXPzd.js.map +0 -1
- package/dist/chunks/adding-payment-methods.BJZLPxtM.js +0 -5
- package/dist/chunks/adding-payment-methods.BJZLPxtM.js.map +0 -1
- package/dist/chunks/adding-payment-methods.Dle8zt43.js +0 -5
- package/dist/chunks/adding-payment-methods.Dle8zt43.js.map +0 -1
- package/dist/chunks/adyen-giving.Ffw_DlJK.js +0 -5
- package/dist/chunks/adyen-giving.Ffw_DlJK.js.map +0 -1
- package/dist/chunks/adyen-giving.LiKHj_jY.js +0 -5
- package/dist/chunks/adyen-giving.LiKHj_jY.js.map +0 -1
- package/dist/chunks/alert.CjegN2iG.js +0 -169
- package/dist/chunks/alert.CjegN2iG.js.map +0 -1
- package/dist/chunks/aria-label.CaUURpnB.js +0 -13
- package/dist/chunks/aria-label.CaUURpnB.js.map +0 -1
- package/dist/chunks/avatar.B0-9jC6H.js +0 -94
- package/dist/chunks/avatar.B0-9jC6H.js.map +0 -1
- package/dist/chunks/base-button.DdNFlbgH.js +0 -115
- package/dist/chunks/base-button.DdNFlbgH.js.map +0 -1
- package/dist/chunks/base-modal.BXdrZf3U.js +0 -504
- package/dist/chunks/base-modal.BXdrZf3U.js.map +0 -1
- package/dist/chunks/base-modal.keys.C2PQXcE2.js +0 -5
- package/dist/chunks/base-modal.keys.C2PQXcE2.js.map +0 -1
- package/dist/chunks/bin.CA6UQCNZ.js +0 -37
- package/dist/chunks/bin.CA6UQCNZ.js.map +0 -1
- package/dist/chunks/button-actions-with-menu.DfnPv97A.js +0 -174
- package/dist/chunks/button-actions-with-menu.DfnPv97A.js.map +0 -1
- package/dist/chunks/button-actions.WnxN4KnV.js +0 -264
- package/dist/chunks/button-actions.WnxN4KnV.js.map +0 -1
- package/dist/chunks/button.CVZJTZv0.js +0 -120
- package/dist/chunks/button.CVZJTZv0.js.map +0 -1
- package/dist/chunks/calendar.BzN254pQ.js +0 -1288
- package/dist/chunks/calendar.BzN254pQ.js.map +0 -1
- package/dist/chunks/card.PFtc1o__.js +0 -213
- package/dist/chunks/card.PFtc1o__.js.map +0 -1
- package/dist/chunks/checkbox-group.Dsiyb1cX.js +0 -192
- package/dist/chunks/checkbox-group.Dsiyb1cX.js.map +0 -1
- package/dist/chunks/checkbox-input.DVayucaL.js +0 -168
- package/dist/chunks/checkbox-input.DVayucaL.js.map +0 -1
- package/dist/chunks/checkbox.DeNqOQ8F.js +0 -253
- package/dist/chunks/checkbox.DeNqOQ8F.js.map +0 -1
- package/dist/chunks/checkmark-circle-fill.jicbqe7k.js +0 -44
- package/dist/chunks/checkmark-circle-fill.jicbqe7k.js.map +0 -1
- package/dist/chunks/checkmark-small.D7l69yBf.js +0 -29
- package/dist/chunks/checkmark-small.D7l69yBf.js.map +0 -1
- package/dist/chunks/chevron-left.BF63HtOH.js +0 -52
- package/dist/chunks/chevron-left.BF63HtOH.js.map +0 -1
- package/dist/chunks/chevron-up.-0oLlHmh.js +0 -52
- package/dist/chunks/chevron-up.-0oLlHmh.js.map +0 -1
- package/dist/chunks/chip.BVCzNGaI.js +0 -71
- package/dist/chunks/chip.BVCzNGaI.js.map +0 -1
- package/dist/chunks/click-outside.C1Ud8AA2.js +0 -23
- package/dist/chunks/click-outside.C1Ud8AA2.js.map +0 -1
- package/dist/chunks/code-snippet.91V1hyL-.js +0 -334
- package/dist/chunks/code-snippet.91V1hyL-.js.map +0 -1
- package/dist/chunks/codemirror.Zv80n3Z2.js +0 -14628
- package/dist/chunks/codemirror.Zv80n3Z2.js.map +0 -1
- package/dist/chunks/controls-group.DzFmJYYp.js +0 -98
- package/dist/chunks/controls-group.DzFmJYYp.js.map +0 -1
- package/dist/chunks/copy.BNFlTYMb.js +0 -156
- package/dist/chunks/copy.BNFlTYMb.js.map +0 -1
- package/dist/chunks/country.BhAcCmRx.js +0 -99
- package/dist/chunks/country.BhAcCmRx.js.map +0 -1
- package/dist/chunks/country.types.C0Q_hhgJ.js +0 -269
- package/dist/chunks/country.types.C0Q_hhgJ.js.map +0 -1
- package/dist/chunks/cross-circle-fill-small.mY6ihJcA.js +0 -29
- package/dist/chunks/cross-circle-fill-small.mY6ihJcA.js.map +0 -1
- package/dist/chunks/cross-circle-fill.B7YpDLTK.js +0 -44
- package/dist/chunks/cross-circle-fill.B7YpDLTK.js.map +0 -1
- package/dist/chunks/cross-small.CFrBIeYK.js +0 -29
- package/dist/chunks/cross-small.CFrBIeYK.js.map +0 -1
- package/dist/chunks/cross.CbLEjiVy.js +0 -29
- package/dist/chunks/cross.CbLEjiVy.js.map +0 -1
- package/dist/chunks/currency.DagWnTry.js +0 -109
- package/dist/chunks/currency.DagWnTry.js.map +0 -1
- package/dist/chunks/dashboard-section.BTJ8h5Kd.js +0 -165
- package/dist/chunks/dashboard-section.BTJ8h5Kd.js.map +0 -1
- package/dist/chunks/dashed-underline.BpSS0BTl.js +0 -98
- package/dist/chunks/dashed-underline.BpSS0BTl.js.map +0 -1
- package/dist/chunks/data-grid-template.CnrbFvb3.js +0 -111
- package/dist/chunks/data-grid-template.CnrbFvb3.js.map +0 -1
- package/dist/chunks/data-grid-template.keys.2_AkxuNT.js +0 -5
- package/dist/chunks/data-grid-template.keys.2_AkxuNT.js.map +0 -1
- package/dist/chunks/data-grid.PAFw8voO.js +0 -3646
- package/dist/chunks/data-grid.PAFw8voO.js.map +0 -1
- package/dist/chunks/date-input.BqBdAO1E.js +0 -17
- package/dist/chunks/date-input.BqBdAO1E.js.map +0 -1
- package/dist/chunks/date-picker.CSn6F3aG.js +0 -315
- package/dist/chunks/date-picker.CSn6F3aG.js.map +0 -1
- package/dist/chunks/date-range-picker.ByQ_yM6z.js +0 -1170
- package/dist/chunks/date-range-picker.ByQ_yM6z.js.map +0 -1
- package/dist/chunks/date.CKXySBQv.js +0 -995
- package/dist/chunks/date.CKXySBQv.js.map +0 -1
- package/dist/chunks/debounce.DUTu11PS.js +0 -10
- package/dist/chunks/debounce.DUTu11PS.js.map +0 -1
- package/dist/chunks/dialog-page.C72BX6So.js +0 -175
- package/dist/chunks/dialog-page.C72BX6So.js.map +0 -1
- package/dist/chunks/directive.Cbdox5VL.js +0 -23
- package/dist/chunks/directive.Cbdox5VL.js.map +0 -1
- package/dist/chunks/divider.qUOSAbU6.js +0 -33
- package/dist/chunks/divider.qUOSAbU6.js.map +0 -1
- package/dist/chunks/dot.BW-xtyjC.js +0 -29
- package/dist/chunks/dot.BW-xtyjC.js.map +0 -1
- package/dist/chunks/dropdown-default-textbox.BNhy-QDH.js +0 -419
- package/dist/chunks/dropdown-default-textbox.BNhy-QDH.js.map +0 -1
- package/dist/chunks/dropdown-tag.D_oUoZBc.js +0 -202
- package/dist/chunks/dropdown-tag.D_oUoZBc.js.map +0 -1
- package/dist/chunks/dropdown.B8LbzSzW.js +0 -936
- package/dist/chunks/dropdown.B8LbzSzW.js.map +0 -1
- package/dist/chunks/empty-state.BGWjUH6G.js +0 -185
- package/dist/chunks/empty-state.BGWjUH6G.js.map +0 -1
- package/dist/chunks/error-message.BzDQxHUy.js +0 -158
- package/dist/chunks/error-message.BzDQxHUy.js.map +0 -1
- package/dist/chunks/es6.BA9GH7QZ.js +0 -11
- package/dist/chunks/es6.BA9GH7QZ.js.map +0 -1
- package/dist/chunks/events.FNmSWp_P.js +0 -52
- package/dist/chunks/events.FNmSWp_P.js.map +0 -1
- package/dist/chunks/expand.DusW7F7p.js +0 -33
- package/dist/chunks/expand.DusW7F7p.js.map +0 -1
- package/dist/chunks/file-uploader.HMZfzgaO.js +0 -2280
- package/dist/chunks/file-uploader.HMZfzgaO.js.map +0 -1
- package/dist/chunks/filter-bar.CKxLJDQE.js +0 -2976
- package/dist/chunks/filter-bar.CKxLJDQE.js.map +0 -1
- package/dist/chunks/fixed-scroller.BjxA_R63.js +0 -147
- package/dist/chunks/fixed-scroller.BjxA_R63.js.map +0 -1
- package/dist/chunks/focus-trap.BdrEB4Ld.js +0 -500
- package/dist/chunks/focus-trap.BdrEB4Ld.js.map +0 -1
- package/dist/chunks/footer-actions.DqKdjjjh.js +0 -110
- package/dist/chunks/footer-actions.DqKdjjjh.js.map +0 -1
- package/dist/chunks/form-layout-title.CsmjzAje.js +0 -206
- package/dist/chunks/form-layout-title.CsmjzAje.js.map +0 -1
- package/dist/chunks/form-layout.types.D3EKzbE7.js +0 -5
- package/dist/chunks/form-layout.types.D3EKzbE7.js.map +0 -1
- package/dist/chunks/generate-uid.NJ8tVoha.js +0 -32
- package/dist/chunks/generate-uid.NJ8tVoha.js.map +0 -1
- package/dist/chunks/get-date-locale.BN8xEjY0.js +0 -1735
- package/dist/chunks/get-date-locale.BN8xEjY0.js.map +0 -1
- package/dist/chunks/get-slot-text.DQlZEsId.js +0 -12
- package/dist/chunks/get-slot-text.DQlZEsId.js.map +0 -1
- package/dist/chunks/grid-layout.BTLE3rac.js +0 -114
- package/dist/chunks/grid-layout.BTLE3rac.js.map +0 -1
- package/dist/chunks/header-with-views.BVcLQi-H.js +0 -2354
- package/dist/chunks/header-with-views.BVcLQi-H.js.map +0 -1
- package/dist/chunks/header.CYPznLHg.js +0 -253
- package/dist/chunks/header.CYPznLHg.js.map +0 -1
- package/dist/chunks/i18n.B6g5VX0q.js +0 -3131
- package/dist/chunks/i18n.B6g5VX0q.js.map +0 -1
- package/dist/chunks/image.vue_vue_type_script_setup_true_lang.DQT2oNEF.js +0 -47
- package/dist/chunks/image.vue_vue_type_script_setup_true_lang.DQT2oNEF.js.map +0 -1
- package/dist/chunks/index.BDuTpjD8.js +0 -40
- package/dist/chunks/index.BDuTpjD8.js.map +0 -1
- package/dist/chunks/index.BxBB1rsx.js +0 -15
- package/dist/chunks/index.BxBB1rsx.js.map +0 -1
- package/dist/chunks/index.CVpo3mlK.js +0 -528
- package/dist/chunks/index.CVpo3mlK.js.map +0 -1
- package/dist/chunks/index.CWuzEfiV.js +0 -6
- package/dist/chunks/index.CWuzEfiV.js.map +0 -1
- package/dist/chunks/index.DD7TppDb.js +0 -10
- package/dist/chunks/index.DD7TppDb.js.map +0 -1
- package/dist/chunks/info-icon-with-popover.BUtJRYXy.js +0 -97
- package/dist/chunks/info-icon-with-popover.BUtJRYXy.js.map +0 -1
- package/dist/chunks/info-icon.MO6y9Dyv.js +0 -45
- package/dist/chunks/info-icon.MO6y9Dyv.js.map +0 -1
- package/dist/chunks/info.HK3R7Drc.js +0 -44
- package/dist/chunks/info.HK3R7Drc.js.map +0 -1
- package/dist/chunks/input-field-password.c6WXpF9U.js +0 -366
- package/dist/chunks/input-field-password.c6WXpF9U.js.map +0 -1
- package/dist/chunks/input-field-phone-number.DQxF-6wT.js +0 -3106
- package/dist/chunks/input-field-phone-number.DQxF-6wT.js.map +0 -1
- package/dist/chunks/input-field.BDEEGU2t.js +0 -298
- package/dist/chunks/input-field.BDEEGU2t.js.map +0 -1
- package/dist/chunks/inspector.types.BQnVv5HX.js +0 -187
- package/dist/chunks/inspector.types.BQnVv5HX.js.map +0 -1
- package/dist/chunks/internal-error.BLZodVBE.js +0 -5
- package/dist/chunks/internal-error.BLZodVBE.js.map +0 -1
- package/dist/chunks/internal-error.BmrwJFpR.js +0 -5
- package/dist/chunks/internal-error.BmrwJFpR.js.map +0 -1
- package/dist/chunks/keyboard-navigation.CqgGzfZQ.js +0 -66
- package/dist/chunks/keyboard-navigation.CqgGzfZQ.js.map +0 -1
- package/dist/chunks/layout-row.CRRLYA03.js +0 -100
- package/dist/chunks/layout-row.CRRLYA03.js.map +0 -1
- package/dist/chunks/link.CTH1xj0i.js +0 -116
- package/dist/chunks/link.CTH1xj0i.js.map +0 -1
- package/dist/chunks/listbox-option-tag.CTipR05e.js +0 -55
- package/dist/chunks/listbox-option-tag.CTipR05e.js.map +0 -1
- package/dist/chunks/loading-indicator.DEepb9Wl.js +0 -44
- package/dist/chunks/loading-indicator.DEepb9Wl.js.map +0 -1
- package/dist/chunks/menu.HVsIOPzt.js +0 -768
- package/dist/chunks/menu.HVsIOPzt.js.map +0 -1
- package/dist/chunks/modal-fullscreen.CN1dCmU-.js +0 -270
- package/dist/chunks/modal-fullscreen.CN1dCmU-.js.map +0 -1
- package/dist/chunks/modal-fullscreen.keys.CMba3hYp.js +0 -5
- package/dist/chunks/modal-fullscreen.keys.CMba3hYp.js.map +0 -1
- package/dist/chunks/modal.vue_vue_type_script_setup_true_lang._xN4vNxW.js +0 -501
- package/dist/chunks/modal.vue_vue_type_script_setup_true_lang._xN4vNxW.js.map +0 -1
- package/dist/chunks/no-results-found.Bg_ZcEid.js +0 -5
- package/dist/chunks/no-results-found.Bg_ZcEid.js.map +0 -1
- package/dist/chunks/no-results-found.BqvYsBR6.js +0 -5
- package/dist/chunks/no-results-found.BqvYsBR6.js.map +0 -1
- package/dist/chunks/notifications-cleared.BMZk37uf.js +0 -5
- package/dist/chunks/notifications-cleared.BMZk37uf.js.map +0 -1
- package/dist/chunks/notifications-cleared.C7W9ZXY7.js +0 -5
- package/dist/chunks/notifications-cleared.C7W9ZXY7.js.map +0 -1
- package/dist/chunks/on-click-outside.D9aY9g8G.js +0 -101
- package/dist/chunks/on-click-outside.D9aY9g8G.js.map +0 -1
- package/dist/chunks/page-not-found.COJLPVaU.js +0 -5
- package/dist/chunks/page-not-found.COJLPVaU.js.map +0 -1
- package/dist/chunks/page-not-found.DWW6W-PZ.js +0 -5
- package/dist/chunks/page-not-found.DWW6W-PZ.js.map +0 -1
- package/dist/chunks/pagination.Cv-jL5MP.js +0 -461
- package/dist/chunks/pagination.Cv-jL5MP.js.map +0 -1
- package/dist/chunks/payment-method.eazefwm6.js +0 -125
- package/dist/chunks/payment-method.eazefwm6.js.map +0 -1
- package/dist/chunks/payment-method.types.BqtH7RM2.js +0 -5
- package/dist/chunks/payment-method.types.BqtH7RM2.js.map +0 -1
- package/dist/chunks/planned-maintenance.C61sWB9h.js +0 -5
- package/dist/chunks/planned-maintenance.C61sWB9h.js.map +0 -1
- package/dist/chunks/planned-maintenance.jmWYTdet.js +0 -5
- package/dist/chunks/planned-maintenance.jmWYTdet.js.map +0 -1
- package/dist/chunks/popover.sXC1vaC4.js +0 -350
- package/dist/chunks/popover.sXC1vaC4.js.map +0 -1
- package/dist/chunks/popper-container.CWgM0skS.js +0 -1396
- package/dist/chunks/popper-container.CWgM0skS.js.map +0 -1
- package/dist/chunks/popper-container.types.BCZMbVFD.js +0 -9
- package/dist/chunks/popper-container.types.BCZMbVFD.js.map +0 -1
- package/dist/chunks/promo-banner.CoB1tBCC.js +0 -126
- package/dist/chunks/promo-banner.CoB1tBCC.js.map +0 -1
- package/dist/chunks/radio-group.BzLVfoL0.js +0 -321
- package/dist/chunks/radio-group.BzLVfoL0.js.map +0 -1
- package/dist/chunks/radio-input.DKfQGxtp.js +0 -96
- package/dist/chunks/radio-input.DKfQGxtp.js.map +0 -1
- package/dist/chunks/referrals.BvtT-kQS.js +0 -5
- package/dist/chunks/referrals.BvtT-kQS.js.map +0 -1
- package/dist/chunks/referrals.aX8WZigH.js +0 -5
- package/dist/chunks/referrals.aX8WZigH.js.map +0 -1
- package/dist/chunks/refresh.C20ROVDS.js +0 -29
- package/dist/chunks/refresh.C20ROVDS.js.map +0 -1
- package/dist/chunks/resize.Bqks3WUm.js +0 -15
- package/dist/chunks/resize.Bqks3WUm.js.map +0 -1
- package/dist/chunks/rich-text-editor.C5RIGjDX.js +0 -6221
- package/dist/chunks/rich-text-editor.C5RIGjDX.js.map +0 -1
- package/dist/chunks/search-bar.C8bAeztI.js +0 -114
- package/dist/chunks/search-bar.C8bAeztI.js.map +0 -1
- package/dist/chunks/search.CW_aTqip.js +0 -44
- package/dist/chunks/search.CW_aTqip.js.map +0 -1
- package/dist/chunks/secondary-nav.BZF_9ztn.js +0 -137
- package/dist/chunks/secondary-nav.BZF_9ztn.js.map +0 -1
- package/dist/chunks/segmented-control.types.BHRLV8KU.js +0 -5
- package/dist/chunks/segmented-control.types.BHRLV8KU.js.map +0 -1
- package/dist/chunks/segmented-control.u3a7Mssn.js +0 -144
- package/dist/chunks/segmented-control.u3a7Mssn.js.map +0 -1
- package/dist/chunks/selection-card-group.CSFQ-f8m.js +0 -474
- package/dist/chunks/selection-card-group.CSFQ-f8m.js.map +0 -1
- package/dist/chunks/show.ByWWaogc.js +0 -64
- package/dist/chunks/show.ByWWaogc.js.map +0 -1
- package/dist/chunks/sidepanel.keys.R0DKQuYx.js +0 -5
- package/dist/chunks/sidepanel.keys.R0DKQuYx.js.map +0 -1
- package/dist/chunks/sidepanel.kwEMG5ee.js +0 -254
- package/dist/chunks/sidepanel.kwEMG5ee.js.map +0 -1
- package/dist/chunks/status.types.Bdv2zuuh.js +0 -44
- package/dist/chunks/status.types.Bdv2zuuh.js.map +0 -1
- package/dist/chunks/step.7l-t-eN9.js +0 -264
- package/dist/chunks/step.7l-t-eN9.js.map +0 -1
- package/dist/chunks/structured-list-item.DLJp-ApS.js +0 -108
- package/dist/chunks/structured-list-item.DLJp-ApS.js.map +0 -1
- package/dist/chunks/success.DhioLvPD.js +0 -5
- package/dist/chunks/success.DhioLvPD.js.map +0 -1
- package/dist/chunks/success.nNwxJRBS.js +0 -5
- package/dist/chunks/success.nNwxJRBS.js.map +0 -1
- package/dist/chunks/summary-grid.keys.CxTf_FOc.js +0 -6
- package/dist/chunks/summary-grid.keys.CxTf_FOc.js.map +0 -1
- package/dist/chunks/summary-grid.types.DkyTeEAn.js +0 -466
- package/dist/chunks/summary-grid.types.DkyTeEAn.js.map +0 -1
- package/dist/chunks/tabs.Bn4YIjoy.js +0 -266
- package/dist/chunks/tabs.Bn4YIjoy.js.map +0 -1
- package/dist/chunks/tabs.keys.Bc2pSKRw.js +0 -7
- package/dist/chunks/tabs.keys.Bc2pSKRw.js.map +0 -1
- package/dist/chunks/tag.Me7nYLMe.js +0 -51
- package/dist/chunks/tag.Me7nYLMe.js.map +0 -1
- package/dist/chunks/teleport.CfGWjxe2.js +0 -129
- package/dist/chunks/teleport.CfGWjxe2.js.map +0 -1
- package/dist/chunks/textarea.BbSzCJ-3.js +0 -278
- package/dist/chunks/textarea.BbSzCJ-3.js.map +0 -1
- package/dist/chunks/timeline-item._h_dMFfm.js +0 -567
- package/dist/chunks/timeline-item._h_dMFfm.js.map +0 -1
- package/dist/chunks/toast.Ae5ZoWHb.js +0 -221
- package/dist/chunks/toast.Ae5ZoWHb.js.map +0 -1
- package/dist/chunks/toggle-button.Dv1t15yj.js +0 -80
- package/dist/chunks/toggle-button.Dv1t15yj.js.map +0 -1
- package/dist/chunks/toggle.hoD_i2Ey.js +0 -161
- package/dist/chunks/toggle.hoD_i2Ey.js.map +0 -1
- package/dist/chunks/tooltip.CGMSPub2.js +0 -205
- package/dist/chunks/tooltip.CGMSPub2.js.map +0 -1
- package/dist/chunks/truncate.BfIl_-71.js +0 -8
- package/dist/chunks/truncate.BfIl_-71.js.map +0 -1
- package/dist/chunks/tutorial.vue_vue_type_script_setup_true_lang.CysjLLSS.js +0 -423
- package/dist/chunks/tutorial.vue_vue_type_script_setup_true_lang.CysjLLSS.js.map +0 -1
- package/dist/chunks/typography.DN5eC5ch.js +0 -83
- package/dist/chunks/typography.DN5eC5ch.js.map +0 -1
- package/dist/chunks/upload-files.5wQwbfkp.js +0 -5
- package/dist/chunks/upload-files.5wQwbfkp.js.map +0 -1
- package/dist/chunks/upload-files.jTQY6y2X.js +0 -5
- package/dist/chunks/upload-files.jTQY6y2X.js.map +0 -1
- package/dist/chunks/use-bento-toast-controller.D3LA1FCd.js +0 -50
- package/dist/chunks/use-bento-toast-controller.D3LA1FCd.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.Dk0UxwFJ.js +0 -1475
- package/dist/chunks/use-cached-selected-values.Dk0UxwFJ.js.map +0 -1
- package/dist/chunks/use-click-outside.BnhTgpSt.js +0 -14
- package/dist/chunks/use-click-outside.BnhTgpSt.js.map +0 -1
- package/dist/chunks/use-country-items.4kZgVg_l.js +0 -30
- package/dist/chunks/use-country-items.4kZgVg_l.js.map +0 -1
- package/dist/chunks/use-country-phon-code.DVgE19zT.js +0 -5610
- package/dist/chunks/use-country-phon-code.DVgE19zT.js.map +0 -1
- package/dist/chunks/use-default-slot-validator.O02rzsob.js +0 -16
- package/dist/chunks/use-default-slot-validator.O02rzsob.js.map +0 -1
- package/dist/chunks/use-expandable-content-height.GkjjbmPy.js +0 -17
- package/dist/chunks/use-expandable-content-height.GkjjbmPy.js.map +0 -1
- package/dist/chunks/use-form-layout-loading.D3lALhtC.js +0 -12
- package/dist/chunks/use-form-layout-loading.D3lALhtC.js.map +0 -1
- package/dist/chunks/use-has-slot.B7eQSabc.js +0 -15
- package/dist/chunks/use-has-slot.B7eQSabc.js.map +0 -1
- package/dist/chunks/warning-filled.DmHh0nYG.js +0 -29
- package/dist/chunks/warning-filled.DmHh0nYG.js.map +0 -1
- package/dist/chunks/wrong-environment.BOsyKdRI.js +0 -5
- package/dist/chunks/wrong-environment.BOsyKdRI.js.map +0 -1
- package/dist/chunks/wrong-environment.BiHTPtbJ.js +0 -5
- package/dist/chunks/wrong-environment.BiHTPtbJ.js.map +0 -1
- package/dist/click-outside.js +0 -5
- package/dist/click-outside.js.map +0 -1
- package/dist/code-snippet.js +0 -8
- package/dist/code-snippet.js.map +0 -1
- package/dist/country.js +0 -12
- package/dist/country.js.map +0 -1
- package/dist/currency.js +0 -6
- package/dist/currency.js.map +0 -1
- package/dist/dashboard-template.js +0 -6
- package/dist/dashboard-template.js.map +0 -1
- package/dist/dashed-underline.js +0 -5
- package/dist/dashed-underline.js.map +0 -1
- package/dist/data-grid-template.js +0 -5
- package/dist/data-grid-template.js.map +0 -1
- package/dist/data-grid.js +0 -11
- package/dist/data-grid.js.map +0 -1
- package/dist/date-picker.js +0 -8
- package/dist/date-picker.js.map +0 -1
- package/dist/date-range-picker.js +0 -8
- package/dist/date-range-picker.js.map +0 -1
- package/dist/date.js +0 -6
- package/dist/date.js.map +0 -1
- package/dist/divider.js +0 -5
- package/dist/divider.js.map +0 -1
- package/dist/dropdown.js +0 -16
- package/dist/dropdown.js.map +0 -1
- package/dist/empty-state.js +0 -8
- package/dist/empty-state.js.map +0 -1
- package/dist/file-uploader.js +0 -5
- package/dist/file-uploader.js.map +0 -1
- package/dist/filter-bar.js +0 -8
- package/dist/filter-bar.js.map +0 -1
- package/dist/focus-trap.js +0 -5
- package/dist/focus-trap.js.map +0 -1
- package/dist/fonts/fonts.css +0 -2
- package/dist/form-layout.js +0 -8
- package/dist/form-layout.js.map +0 -1
- package/dist/header-with-views.js +0 -5
- package/dist/header-with-views.js.map +0 -1
- package/dist/header.js +0 -5
- package/dist/header.js.map +0 -1
- package/dist/image.js +0 -7
- package/dist/image.js.map +0 -1
- package/dist/index.js +0 -370
- package/dist/index.js.map +0 -1
- package/dist/info-icon.js +0 -5
- package/dist/info-icon.js.map +0 -1
- package/dist/input-field-password.js +0 -10
- package/dist/input-field-password.js.map +0 -1
- package/dist/input-field-phone-number.js +0 -5
- package/dist/input-field-phone-number.js.map +0 -1
- package/dist/input-field.js +0 -10
- package/dist/input-field.js.map +0 -1
- package/dist/inspector.js +0 -6
- package/dist/inspector.js.map +0 -1
- package/dist/internal.js +0 -43
- package/dist/internal.js.map +0 -1
- package/dist/layout.js +0 -6
- package/dist/layout.js.map +0 -1
- package/dist/link.js +0 -6
- package/dist/link.js.map +0 -1
- package/dist/loading-indicator.js +0 -6
- package/dist/loading-indicator.js.map +0 -1
- package/dist/menu.js +0 -6
- package/dist/menu.js.map +0 -1
- package/dist/modal-fullscreen.js +0 -6
- package/dist/modal-fullscreen.js.map +0 -1
- package/dist/modal.js +0 -14
- package/dist/modal.js.map +0 -1
- package/dist/pagination.js +0 -5
- package/dist/pagination.js.map +0 -1
- package/dist/payment-method.js +0 -7
- package/dist/payment-method.js.map +0 -1
- package/dist/popover.js +0 -6
- package/dist/popover.js.map +0 -1
- package/dist/popper-container.js +0 -10
- package/dist/popper-container.js.map +0 -1
- package/dist/promo-banner.js +0 -7
- package/dist/promo-banner.js.map +0 -1
- package/dist/radio-group.js +0 -9
- package/dist/radio-group.js.map +0 -1
- package/dist/rich-text-editor.js +0 -5
- package/dist/rich-text-editor.js.map +0 -1
- package/dist/search-bar.js +0 -9
- package/dist/search-bar.js.map +0 -1
- package/dist/secondary-nav.js +0 -5
- package/dist/secondary-nav.js.map +0 -1
- package/dist/segmented-control.js +0 -7
- package/dist/segmented-control.js.map +0 -1
- package/dist/selection-card.js +0 -7
- package/dist/selection-card.js.map +0 -1
- package/dist/sidepanel.js +0 -7
- package/dist/sidepanel.js.map +0 -1
- package/dist/status.js +0 -6
- package/dist/status.js.map +0 -1
- package/dist/stepper.js +0 -8
- package/dist/stepper.js.map +0 -1
- package/dist/structured-list.js +0 -6
- package/dist/structured-list.js.map +0 -1
- package/dist/styles/bento-dark.css +0 -2055
- package/dist/styles/bento-light.css +0 -2054
- package/dist/styles/bento.css +0 -2054
- package/dist/styles/legacy.css +0 -2209
- package/dist/styles/styleguide.css +0 -2109
- package/dist/styles/utility.css +0 -987
- package/dist/summary-grid.js +0 -12
- package/dist/summary-grid.js.map +0 -1
- package/dist/tabs.js +0 -6
- package/dist/tabs.js.map +0 -1
- package/dist/tag.js +0 -6
- package/dist/tag.js.map +0 -1
- package/dist/textarea.js +0 -5
- package/dist/textarea.js.map +0 -1
- package/dist/timeline.js +0 -10
- package/dist/timeline.js.map +0 -1
- package/dist/toast.js +0 -5
- package/dist/toast.js.map +0 -1
- package/dist/toggle.js +0 -7
- package/dist/toggle.js.map +0 -1
- package/dist/tutorial.js +0 -5
- package/dist/tutorial.js.map +0 -1
- package/dist/typography.js +0 -8
- package/dist/typography.js.map +0 -1
- package/dist/use-form-v4.js +0 -8300
- package/dist/use-form-v4.js.map +0 -1
- package/dist/web-types.json +0 -49
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { ref as m, watch as y, nextTick as f, defineComponent as A, toRef as B, computed as v, provide as b, createElementBlock as N, openBlock as h, createElementVNode as T, normalizeClass as w, createVNode as E, createBlock as k, createCommentVNode as C, unref as I } from "vue";
|
|
2
|
-
import { M as W, B as S } from "./menu.HVsIOPzt.js";
|
|
3
|
-
import { a as O } from "./popover.sXC1vaC4.js";
|
|
4
|
-
import { c as _, f as R, B as M } from "./button-actions.WnxN4KnV.js";
|
|
5
|
-
import { u as g } from "./index.CVpo3mlK.js";
|
|
6
|
-
import { _ as U } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
7
|
-
import "../assets/button-actions-with-menu.css";
|
|
8
|
-
const D = (a) => {
|
|
9
|
-
const { breakpoint: e, container: l, defaultActionsCount: c, offset: n } = a, { width: d } = g(), o = m(c), r = 150, u = async () => {
|
|
10
|
-
var s;
|
|
11
|
-
await f();
|
|
12
|
-
const i = l.value.clientWidth, t = r * o.value + (((s = n == null ? void 0 : n.value) == null ? void 0 : s.offsetWidth) ?? 0) + r;
|
|
13
|
-
i >= t && o.value < c && (o.value += 1, u());
|
|
14
|
-
}, p = async () => {
|
|
15
|
-
var s;
|
|
16
|
-
await f();
|
|
17
|
-
const i = l.value.clientWidth, t = r * o.value + (((s = n == null ? void 0 : n.value) == null ? void 0 : s.offsetWidth) ?? 0);
|
|
18
|
-
i < t && o.value > 0 && (o.value -= 1, p());
|
|
19
|
-
};
|
|
20
|
-
return y([d, l], async ([i, t], [s]) => {
|
|
21
|
-
if (!t || !c || i > e)
|
|
22
|
-
return;
|
|
23
|
-
await f(), i > s ? u() : p();
|
|
24
|
-
}), {
|
|
25
|
-
displayedActionsCount: o
|
|
26
|
-
};
|
|
27
|
-
}, L = { class: "b-button-actions-with-menu" }, x = {}, V = /* @__PURE__ */ A({
|
|
28
|
-
...x,
|
|
29
|
-
__name: "button-actions-with-menu",
|
|
30
|
-
props: {
|
|
31
|
-
/**
|
|
32
|
-
* List of actions that will be used to render the buttons.
|
|
33
|
-
* First element in the list will be rendered as "primary".
|
|
34
|
-
* All elements after the first will be rendered as "secondary".
|
|
35
|
-
*
|
|
36
|
-
* Each object in the list should have a `title`, an `event` and
|
|
37
|
-
* (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.
|
|
38
|
-
*
|
|
39
|
-
* `title`: Button's text.
|
|
40
|
-
*
|
|
41
|
-
* `event`: Event triggered when clicking the Button.
|
|
42
|
-
*
|
|
43
|
-
* `icon` (optional): Vue Icon from the library `@adyen/ui-assets-icons-16`.
|
|
44
|
-
*
|
|
45
|
-
* @see BentoButton for a list of all the other props supported by each button action.
|
|
46
|
-
*
|
|
47
|
-
* ```
|
|
48
|
-
* [{
|
|
49
|
-
* title: 'Primary',
|
|
50
|
-
* event: () => { ... },
|
|
51
|
-
* icon: FourPeopleIcon,
|
|
52
|
-
* link: {
|
|
53
|
-
variant: 'default',
|
|
54
|
-
external: true,
|
|
55
|
-
to: 'https://www.adyen.com/'
|
|
56
|
-
},
|
|
57
|
-
* }, {
|
|
58
|
-
* title: 'Secondary',
|
|
59
|
-
* event: () => { ... }
|
|
60
|
-
* disabled: true,
|
|
61
|
-
* variant: 'primary',
|
|
62
|
-
* critical: true
|
|
63
|
-
* }]
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
|
-
actions: {
|
|
67
|
-
type: Array,
|
|
68
|
-
required: !0
|
|
69
|
-
},
|
|
70
|
-
/**
|
|
71
|
-
* Defines the layout in which the button actions is presented.
|
|
72
|
-
*
|
|
73
|
-
* @see {@link BentoButtonActionsLayout}
|
|
74
|
-
*
|
|
75
|
-
*/
|
|
76
|
-
actionsLayout: {
|
|
77
|
-
type: String,
|
|
78
|
-
default: _.BUTTONS_END
|
|
79
|
-
},
|
|
80
|
-
/**
|
|
81
|
-
* The number of actions to be displayed. The rest of the actions will be collapsed in a menu component.
|
|
82
|
-
*/
|
|
83
|
-
disableResponsiveBehavior: {
|
|
84
|
-
type: Boolean,
|
|
85
|
-
default: !1
|
|
86
|
-
},
|
|
87
|
-
/**
|
|
88
|
-
* The number of actions to be displayed. The rest of the actions will be collapsed in a menu component.
|
|
89
|
-
*/
|
|
90
|
-
displayedActions: {
|
|
91
|
-
type: Number,
|
|
92
|
-
default: void 0
|
|
93
|
-
},
|
|
94
|
-
/**
|
|
95
|
-
* Set inverse color scheme to buttons and menu
|
|
96
|
-
*/
|
|
97
|
-
inverse: {
|
|
98
|
-
type: Boolean,
|
|
99
|
-
default: !1
|
|
100
|
-
},
|
|
101
|
-
/**
|
|
102
|
-
* The min-width breakpoint to hide the button actions.
|
|
103
|
-
*
|
|
104
|
-
* For example, a value of 200 means that buttons will be hidden at <= 200px.
|
|
105
|
-
*
|
|
106
|
-
* Defaults to 0 i.e. it shows all buttons.
|
|
107
|
-
*/
|
|
108
|
-
hideDisplayedActionsBreakpoint: {
|
|
109
|
-
type: Number,
|
|
110
|
-
default: 0
|
|
111
|
-
},
|
|
112
|
-
/**
|
|
113
|
-
* The position of where the menu should open.
|
|
114
|
-
*/
|
|
115
|
-
menuPosition: {
|
|
116
|
-
type: String,
|
|
117
|
-
default: "bottom-start",
|
|
118
|
-
validator: (a) => Object.values(O).includes(a)
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
setup(a) {
|
|
122
|
-
const e = a, l = B(e, "inverse"), c = m(null), n = m(null), d = m(!1), o = v(() => {
|
|
123
|
-
const t = e.hideDisplayedActionsBreakpoint ? u.value : e.displayedActions;
|
|
124
|
-
return e.actions.slice(0, t);
|
|
125
|
-
}), r = v(() => {
|
|
126
|
-
var t;
|
|
127
|
-
return (t = n == null ? void 0 : n.value) == null ? void 0 : t.$el;
|
|
128
|
-
}), { displayedActionsCount: u } = D({
|
|
129
|
-
breakpoint: e.hideDisplayedActionsBreakpoint,
|
|
130
|
-
container: c,
|
|
131
|
-
defaultActionsCount: e.displayedActions,
|
|
132
|
-
offset: r
|
|
133
|
-
});
|
|
134
|
-
b(W, l), e.disableResponsiveBehavior || b(R, { buttonActionsWithMenu: c, menu: n, stackButtons: d });
|
|
135
|
-
const p = v(() => ({
|
|
136
|
-
"b-button-actions-with-menu__container-wrapper--buttons-end": e.actionsLayout === _.BUTTONS_END,
|
|
137
|
-
"b-button-actions-with-menu__container-wrapper--buttons-start": e.actionsLayout === _.BUTTONS_START,
|
|
138
|
-
"b-button-actions-with-menu__container-wrapper--stacked-buttons": d.value
|
|
139
|
-
})), i = v(
|
|
140
|
-
() => u.value !== void 0 && u.value < e.actions.length ? e.actions.slice(u.value, e.actions.length).map((t) => ({
|
|
141
|
-
text: t.title,
|
|
142
|
-
handler: t.event,
|
|
143
|
-
icon: t.icon,
|
|
144
|
-
critical: t.critical,
|
|
145
|
-
disabled: t.disabled
|
|
146
|
-
})) : []
|
|
147
|
-
);
|
|
148
|
-
return (t, s) => (h(), N("div", L, [
|
|
149
|
-
T("div", {
|
|
150
|
-
ref_key: "buttonActionsWithMenu",
|
|
151
|
-
ref: c,
|
|
152
|
-
role: "group",
|
|
153
|
-
class: w(["b-button-actions-with-menu__container-wrapper", p.value])
|
|
154
|
-
}, [
|
|
155
|
-
E(I(M), {
|
|
156
|
-
actions: o.value,
|
|
157
|
-
inverse: a.inverse,
|
|
158
|
-
layout: a.actionsLayout
|
|
159
|
-
}, null, 8, ["actions", "inverse", "layout"]),
|
|
160
|
-
i.value.length ? (h(), k(S, {
|
|
161
|
-
key: 0,
|
|
162
|
-
ref_key: "menu",
|
|
163
|
-
ref: n,
|
|
164
|
-
data: i.value,
|
|
165
|
-
"menu-position": a.menuPosition
|
|
166
|
-
}, null, 8, ["data", "menu-position"])) : C("", !0)
|
|
167
|
-
], 2)
|
|
168
|
-
]));
|
|
169
|
-
}
|
|
170
|
-
}), q = /* @__PURE__ */ U(V, [["__scopeId", "data-v-0fd9bb45"]]);
|
|
171
|
-
export {
|
|
172
|
-
q as B
|
|
173
|
-
};
|
|
174
|
-
//# sourceMappingURL=button-actions-with-menu.DfnPv97A.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button-actions-with-menu.DfnPv97A.js","sources":["../../../vue2/src/components/internal/button-actions-with-menu/composables/use-responsive-actions.ts","../../../vue2/src/components/internal/button-actions-with-menu/button-actions-with-menu.vue"],"sourcesContent":["import { useWindowSize } from '@vueuse/core';\nimport { nextTick, Ref, ref, watch } from 'vue';\n\ninterface UseResponsiveActionsProps {\n breakpoint?: number;\n container: Ref<HTMLElement>;\n defaultActionsCount: number;\n offset?: Ref<HTMLElement>;\n}\n\nexport const useResponsiveActions = (props: UseResponsiveActionsProps) => {\n const { breakpoint, container, defaultActionsCount, offset } = props;\n\n const { width: windowWidth } = useWindowSize();\n\n const displayedActionsCount = ref<number>(defaultActionsCount);\n\n const AVERAGE_BUTTON_WIDTH = 150; // button size + gap\n\n const showActions = async () => {\n await nextTick();\n\n const availableSpace = container.value.clientWidth;\n const totalActionWidth =\n AVERAGE_BUTTON_WIDTH * displayedActionsCount.value +\n (offset?.value?.offsetWidth ?? 0) +\n AVERAGE_BUTTON_WIDTH;\n\n // Only add actions if there's enough space and we haven't reached max\n if (availableSpace >= totalActionWidth && displayedActionsCount.value < defaultActionsCount) {\n displayedActionsCount.value += 1;\n\n showActions(); // keep trying to show more\n }\n };\n\n const hideActions = async () => {\n await nextTick();\n\n const availableSpace = container.value.clientWidth;\n const totalActionWidth = AVERAGE_BUTTON_WIDTH * displayedActionsCount.value + (offset?.value?.offsetWidth ?? 0);\n\n // Hide actions if they overflow the container\n if (availableSpace < totalActionWidth && displayedActionsCount.value > 0) {\n displayedActionsCount.value -= 1;\n\n hideActions(); // keep hiding until it fits\n }\n };\n\n watch([windowWidth, container], async ([newWidth, containerEl], [oldWidth]) => {\n if (!containerEl || !defaultActionsCount || newWidth > breakpoint) {\n return;\n }\n\n await nextTick();\n\n const isIncreasing = newWidth > oldWidth;\n\n if (isIncreasing) {\n showActions();\n } else {\n hideActions();\n }\n });\n\n return {\n displayedActionsCount,\n };\n};\n","<template>\n <div class=\"b-button-actions-with-menu\">\n <div\n ref=\"buttonActionsWithMenu\"\n role=\"group\"\n class=\"b-button-actions-with-menu__container-wrapper\"\n :class=\"conditionalClasses\"\n >\n <bento-button-actions :actions=\"computedActions\" :inverse=\"inverse\" :layout=\"actionsLayout\" />\n <bento-menu\n v-if=\"computedMenuActions.length\"\n ref=\"menu\"\n :data=\"computedMenuActions\"\n :menu-position=\"menuPosition\"\n />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoButtonActions, BentoButtonActionsLayout, BentoButtonActionsList } from '@/components/button';\n import { BentoMenuItem } from '@/components/menu/components/menu-item/menu-item.types';\n import { MENU_INVERSE_INJECTION_KEY } from '@/components/menu/menu.keys';\n import BentoMenu from '@/components/menu/menu.vue';\n import { BentoPopoverPositions } from '@/components/popover';\n import { computed, PropType, provide, ref, toRef } from 'vue';\n import { BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY } from './button-actions-with-menu.keys';\n import { useResponsiveActions } from './composables/use-responsive-actions';\n\n /**\n * An internal button actions component with the option to display some of the actions in a menu.\n *\n * @example\n * <button-actions-with-menu\n * :actions=\"[\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\n * :displayedActions=\"2\"\n * />\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` (optional): Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n variant: 'default',\n external: true,\n to: 'https://www.adyen.com/'\n },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: 'primary',\n * critical: true\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n required: true,\n },\n\n /**\n * Defines the layout in which the button actions is presented.\n *\n * @see {@link BentoButtonActionsLayout}\n *\n */\n actionsLayout: {\n type: String as PropType<`${BentoButtonActionsLayout}`>,\n default: BentoButtonActionsLayout.BUTTONS_END,\n },\n\n /**\n * The number of actions to be displayed. The rest of the actions will be collapsed in a menu component.\n */\n disableResponsiveBehavior: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The number of actions to be displayed. The rest of the actions will be collapsed in a menu component.\n */\n displayedActions: {\n type: Number,\n default: undefined,\n },\n\n /**\n * Set inverse color scheme to buttons and menu\n */\n inverse: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The min-width breakpoint to hide the button actions.\n *\n * For example, a value of 200 means that buttons will be hidden at <= 200px.\n *\n * Defaults to 0 i.e. it shows all buttons.\n */\n hideDisplayedActionsBreakpoint: {\n type: Number,\n default: 0,\n },\n\n /**\n * The position of where the menu should open.\n */\n menuPosition: {\n type: String as PropType<BentoPopoverPositions | `${BentoPopoverPositions}`>,\n default: 'bottom-start',\n validator: (value: BentoPopoverPositions) => Object.values(BentoPopoverPositions).includes(value),\n },\n });\n\n const inverseRef = toRef(props, 'inverse');\n const buttonActionsWithMenu = ref<HTMLDivElement>(null);\n const menu = ref(null);\n const stackButtons = ref(false);\n\n const computedActions = computed(() => {\n const displayedActionsLimit = props.hideDisplayedActionsBreakpoint\n ? displayedActionsCount.value\n : props.displayedActions;\n\n return props.actions.slice(0, displayedActionsLimit);\n });\n const computedMenuRef = computed(() => menu?.value?.$el);\n\n const { displayedActionsCount } = useResponsiveActions({\n breakpoint: props.hideDisplayedActionsBreakpoint,\n container: buttonActionsWithMenu,\n defaultActionsCount: props.displayedActions,\n offset: computedMenuRef,\n });\n\n provide(MENU_INVERSE_INJECTION_KEY, inverseRef);\n\n if (!props.disableResponsiveBehavior) {\n provide(BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY, { buttonActionsWithMenu, menu, stackButtons });\n }\n\n const conditionalClasses = computed(() => ({\n [`b-button-actions-with-menu__container-wrapper--buttons-end`]:\n props.actionsLayout === BentoButtonActionsLayout.BUTTONS_END,\n [`b-button-actions-with-menu__container-wrapper--buttons-start`]:\n props.actionsLayout === BentoButtonActionsLayout.BUTTONS_START,\n [`b-button-actions-with-menu__container-wrapper--stacked-buttons`]: stackButtons.value,\n }));\n\n const computedMenuActions = computed(() =>\n displayedActionsCount.value !== undefined && displayedActionsCount.value < props.actions.length\n ? (props.actions.slice(displayedActionsCount.value, props.actions.length).map(el => ({\n text: el.title,\n handler: el.event,\n icon: el.icon,\n critical: el.critical,\n disabled: el.disabled,\n })) as BentoMenuItem[])\n : []\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * An internal button actions component with the option to display some of the actions in a menu.\n *\n * @example\n * <button-actions-with-menu\n * :actions=\"[\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\n * :displayedActions=\"2\"\n * />\n */\n\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./button-actions-with-menu.scss\" />\n"],"names":["useResponsiveActions","props","breakpoint","container","defaultActionsCount","offset","windowWidth","useWindowSize","displayedActionsCount","ref","AVERAGE_BUTTON_WIDTH","showActions","nextTick","availableSpace","totalActionWidth","_a","hideActions","watch","newWidth","containerEl","oldWidth","__default__","__props","inverseRef","toRef","buttonActionsWithMenu","menu","stackButtons","computedActions","computed","displayedActionsLimit","computedMenuRef","provide","MENU_INVERSE_INJECTION_KEY","BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY","conditionalClasses","BentoButtonActionsLayout","computedMenuActions","el"],"mappings":";;;;;;;AAUa,MAAAA,IAAA,CAAAC,MAAA;AACT,QAAA,EAAA,YAAAC,GAAA,WAAAC,GAAA,qBAAAC,GAAA,QAAAC,EAAA,IAAAJ,GAEA,EAAA,OAAAK,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAAL,CAAA,GAEAM,IAAA,KAEAC,IAAA,YAAA;;AACI,UAAAC,EAAA;AAEA,UAAAC,IAAAV,EAAA,MAAA,aACAW,IAAAJ,IAAAF,EAAA,WAAAO,IAAAV,KAAA,gBAAAA,EAAA,UAAA,gBAAAU,EAAA,gBAAA,KAAAL;AAMA,IAAAG,KAAAC,KAAAN,EAAA,QAAAJ,MACII,EAAA,SAAA,GAEAG,EAAA;AAAA,EACJ,GAGJK,IAAA,YAAA;;AACI,UAAAJ,EAAA;AAEA,UAAAC,IAAAV,EAAA,MAAA,aACAW,IAAAJ,IAAAF,EAAA,WAAAO,IAAAV,KAAA,gBAAAA,EAAA,UAAA,gBAAAU,EAAA,gBAAA;AAGA,IAAAF,IAAAC,KAAAN,EAAA,QAAA,MACIA,EAAA,SAAA,GAEAQ,EAAA;AAAA,EACJ;AAGJ,SAAAC,EAAA,CAAAX,GAAAH,CAAA,GAAA,OAAA,CAAAe,GAAAC,CAAA,GAAA,CAAAC,CAAA,MAAA;AACI,QAAA,CAAAD,KAAA,CAAAf,KAAAc,IAAAhB;AACI;AAGJ,UAAAU,EAAA,GAEAM,IAAAE,IAGIT,EAAA,IAEAK,EAAA;AAAA,EACJ,CAAA,GAGJ;AAAA,IAAO,uBAAAR;AAAA,EACH;AAER,gDC4JIa,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA5KA,UAAApB,IAAAqB,GAkGAC,IAAAC,EAAAvB,GAAA,SAAA,GACAwB,IAAAhB,EAAA,IAAA,GACAiB,IAAAjB,EAAA,IAAA,GACAkB,IAAAlB,EAAA,EAAA,GAEAmB,IAAAC,EAAA,MAAA;AACI,YAAAC,IAAA7B,EAAA,iCAAAO,EAAA,QAAAP,EAAA;AAIA,aAAAA,EAAA,QAAA,MAAA,GAAA6B,CAAA;AAAA,IAAmD,CAAA,GAEvDC,IAAAF,EAAA,MAAA;;AAAA,cAAAd,IAAAW,KAAA,gBAAAA,EAAA,UAAA,gBAAAX,EAAA;AAAA,KAAA,GAEA,EAAA,uBAAAP,EAAA,IAAAR,EAAA;AAAA,MAAuD,YAAAC,EAAA;AAAA,MACjC,WAAAwB;AAAA,MACP,qBAAAxB,EAAA;AAAA,MACgB,QAAA8B;AAAA,IACnB,CAAA;AAGZ,IAAAC,EAAAC,GAAAV,CAAA,GAEAtB,EAAA,6BACI+B,EAAAE,GAAA,EAAA,uBAAAT,GAAA,MAAAC,GAAA,cAAAC,EAAA,CAAA;AAGJ,UAAAQ,IAAAN,EAAA,OAAA;AAAA,MAA2C,8DAAA5B,EAAA,kBAAAmC,EAAA;AAAA,MAEc,gEAAAnC,EAAA,kBAAAmC,EAAA;AAAA,MAEA,kEAAAT,EAAA;AAAA,IAC4B,EAAA,GAGrFU,IAAAR;AAAA,MAA4B,MAAArB,EAAA,UAAA,UAAAA,EAAA,QAAAP,EAAA,QAAA,SAAAA,EAAA,QAAA,MAAAO,EAAA,OAAAP,EAAA,QAAA,MAAA,EAAA,IAAA,CAAAqC,OAAA;AAAA,QAEiE,MAAAA,EAAA;AAAA,QACtE,SAAAA,EAAA;AAAA,QACG,MAAAA,EAAA;AAAA,QACH,UAAAA,EAAA;AAAA,QACI,UAAAA,EAAA;AAAA,MACA,EAAA,IAAA,CAAA;AAAA,IAEhB;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
import { defineComponent as O, useSlots as P, computed as g, createBlock as v, openBlock as i, withModifiers as V, normalizeClass as R, createSlots as U, withCtx as y, renderSlot as N, unref as m, createElementVNode as W, createCommentVNode as j, ref as C, inject as x, watch as H, nextTick as z, onMounted as J, onUnmounted as K, createElementBlock as S, Fragment as Y, renderList as Q, mergeProps as A, toHandlers as b, createTextVNode as h, toDisplayString as B, resolveDynamicComponent as E } from "vue";
|
|
2
|
-
import { B as p } from "./button.CVZJTZv0.js";
|
|
3
|
-
import { o as q } from "./resize.Bqks3WUm.js";
|
|
4
|
-
import { f as X } from "./es6.BA9GH7QZ.js";
|
|
5
|
-
import { B as Z } from "./loading-indicator.DEepb9Wl.js";
|
|
6
|
-
import { C as ee } from "./cross-circle-fill.B7YpDLTK.js";
|
|
7
|
-
import { C as te } from "./checkmark-circle-fill.jicbqe7k.js";
|
|
8
|
-
import { u as ne } from "./use-has-slot.B7eQSabc.js";
|
|
9
|
-
import { u as ae } from "./i18n.B6g5VX0q.js";
|
|
10
|
-
import { _ as $ } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
11
|
-
import "../assets/button-actions.css";
|
|
12
|
-
var D = /* @__PURE__ */ ((e) => (e.BUTTONS_END = "buttons-end", e.FILL_CONTAINER = "fill-container", e.SPACE_BETWEEN = "space-between", e.VERTICAL_STACK = "vertical-stack", e))(D || {}), F = /* @__PURE__ */ ((e) => (e.BUTTONS_START = "buttons-start", e))(F || {});
|
|
13
|
-
const se = { ...D, ...F };
|
|
14
|
-
var s = /* @__PURE__ */ ((e) => (e.START = "start", e.LOADING = "loading", e.SUCCESS = "success", e.FAIL = "fail", e))(s || {});
|
|
15
|
-
const w = {
|
|
16
|
-
"en-US": {
|
|
17
|
-
failed: "Failed",
|
|
18
|
-
succeded: "Succeded"
|
|
19
|
-
},
|
|
20
|
-
"ja-JP": {
|
|
21
|
-
failed: "失敗しました"
|
|
22
|
-
},
|
|
23
|
-
"pt-BR": {
|
|
24
|
-
failed: "Falha"
|
|
25
|
-
}
|
|
26
|
-
}, ie = {
|
|
27
|
-
class: "b-loading-button__icon",
|
|
28
|
-
"data-testid": "loading-button-rotating-icon"
|
|
29
|
-
}, oe = {
|
|
30
|
-
i18n: { messages: w }
|
|
31
|
-
}, le = /* @__PURE__ */ O({
|
|
32
|
-
...oe,
|
|
33
|
-
__name: "loading-button",
|
|
34
|
-
props: {
|
|
35
|
-
/**
|
|
36
|
-
* Reduces sizing of button
|
|
37
|
-
*/
|
|
38
|
-
condensed: {
|
|
39
|
-
type: p.props.condensed.type,
|
|
40
|
-
default: !1
|
|
41
|
-
},
|
|
42
|
-
/**
|
|
43
|
-
* Displays loading-button as critical
|
|
44
|
-
*/
|
|
45
|
-
critical: {
|
|
46
|
-
type: p.props.critical.type,
|
|
47
|
-
default: !1
|
|
48
|
-
},
|
|
49
|
-
/**
|
|
50
|
-
* Disables button functonality
|
|
51
|
-
*/
|
|
52
|
-
disabled: {
|
|
53
|
-
type: p.props.disabled.type,
|
|
54
|
-
default: !1
|
|
55
|
-
},
|
|
56
|
-
/**
|
|
57
|
-
* Sets color set to inverse
|
|
58
|
-
*/
|
|
59
|
-
inverse: {
|
|
60
|
-
type: Boolean,
|
|
61
|
-
default: !1
|
|
62
|
-
},
|
|
63
|
-
/**
|
|
64
|
-
* State of the button.
|
|
65
|
-
* @values start, loading, success, fail
|
|
66
|
-
*/
|
|
67
|
-
state: {
|
|
68
|
-
type: String,
|
|
69
|
-
default: s.START,
|
|
70
|
-
validator: (e) => Object.values(s).includes(e)
|
|
71
|
-
},
|
|
72
|
-
/**
|
|
73
|
-
* Types of flavour of Button
|
|
74
|
-
*/
|
|
75
|
-
variant: {
|
|
76
|
-
type: p.props.variant.type,
|
|
77
|
-
default: "primary",
|
|
78
|
-
validator: p.props.variant.validator
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
emits: ["click"],
|
|
82
|
-
setup(e, { emit: l }) {
|
|
83
|
-
const n = e, c = l, r = P(), _ = ne(r), { t: d } = ae({ messages: w }), u = g(() => ({
|
|
84
|
-
[`b-loading-button--${n.variant}-${s.LOADING}`]: n.state === s.LOADING && !n.disabled,
|
|
85
|
-
"b-loading-button--loading": n.state === s.LOADING && !n.disabled,
|
|
86
|
-
[`b-loading-button--${n.variant}-${s.SUCCESS}`]: n.state === s.SUCCESS,
|
|
87
|
-
"b-loading-button--inverse": n.inverse
|
|
88
|
-
})), f = g(
|
|
89
|
-
() => n.variant === "primary" && !n.inverse || n.variant !== "primary" && n.inverse
|
|
90
|
-
), T = g(
|
|
91
|
-
() => n.critical && n.state === s.START || n.state === s.FAIL
|
|
92
|
-
), a = (o) => {
|
|
93
|
-
o.stopPropagation(), n.state !== s.LOADING && c("click", o);
|
|
94
|
-
};
|
|
95
|
-
return (o, t) => (i(), v(p, {
|
|
96
|
-
critical: T.value,
|
|
97
|
-
variant: e.variant,
|
|
98
|
-
condensed: e.condensed,
|
|
99
|
-
disabled: e.disabled,
|
|
100
|
-
inverse: e.inverse,
|
|
101
|
-
class: R(["b-loading-button", u.value]),
|
|
102
|
-
onClickCapture: V(a, ["stop"])
|
|
103
|
-
}, U({
|
|
104
|
-
default: y(() => [
|
|
105
|
-
N(o.$slots, "default", {}, void 0, !0)
|
|
106
|
-
]),
|
|
107
|
-
_: 2
|
|
108
|
-
}, [
|
|
109
|
-
e.state === "start" && m(_)("iconLeft") ? {
|
|
110
|
-
name: "iconLeft",
|
|
111
|
-
fn: y(() => [
|
|
112
|
-
N(o.$slots, "iconLeft", {}, void 0, !0)
|
|
113
|
-
]),
|
|
114
|
-
key: "0"
|
|
115
|
-
} : e.state !== "start" ? {
|
|
116
|
-
name: "iconLeft",
|
|
117
|
-
fn: y(() => [
|
|
118
|
-
W("span", ie, [
|
|
119
|
-
e.state === "fail" ? (i(), v(m(ee), {
|
|
120
|
-
key: 0,
|
|
121
|
-
"svg-title": m(d)("failed")
|
|
122
|
-
}, null, 8, ["svg-title"])) : e.state === "success" ? (i(), v(m(te), {
|
|
123
|
-
key: 1,
|
|
124
|
-
"svg-title": m(d)("succeded")
|
|
125
|
-
}, null, 8, ["svg-title"])) : e.state === "loading" ? (i(), v(m(Z), {
|
|
126
|
-
key: 2,
|
|
127
|
-
small: "",
|
|
128
|
-
inverse: f.value
|
|
129
|
-
}, null, 8, ["inverse"])) : j("", !0)
|
|
130
|
-
])
|
|
131
|
-
]),
|
|
132
|
-
key: "1"
|
|
133
|
-
} : void 0
|
|
134
|
-
]), 1032, ["critical", "variant", "condensed", "disabled", "inverse", "class"]));
|
|
135
|
-
}
|
|
136
|
-
}), ce = /* @__PURE__ */ $(le, [["__scopeId", "data-v-07b9c537"]]), re = Symbol(
|
|
137
|
-
"button actions with menu container injection key"
|
|
138
|
-
), de = 242, L = parseInt(X, 10), ue = (e, l, n) => {
|
|
139
|
-
const c = C(0);
|
|
140
|
-
let r = null;
|
|
141
|
-
const { buttonActionsWithMenu: _, menu: d, stackButtons: u } = x(re, {
|
|
142
|
-
buttonActionsWithMenu: C(null),
|
|
143
|
-
menu: C(null),
|
|
144
|
-
stackButtons: C(!1)
|
|
145
|
-
}), f = g(() => _.value ?? e.value), T = g(() => d.value ? [...l.value, d.value.$el] : l.value), a = (o) => {
|
|
146
|
-
var I;
|
|
147
|
-
const t = (I = T.value) == null ? void 0 : I.reduce(
|
|
148
|
-
(G, M) => G + M.clientWidth + L,
|
|
149
|
-
-L - 1
|
|
150
|
-
), k = f.value.clientWidth;
|
|
151
|
-
return o && (c.value = k >= de && !u.value ? t : 0), c.value > k;
|
|
152
|
-
};
|
|
153
|
-
return H(
|
|
154
|
-
() => n,
|
|
155
|
-
() => {
|
|
156
|
-
z(() => {
|
|
157
|
-
u.value = a(!0);
|
|
158
|
-
});
|
|
159
|
-
},
|
|
160
|
-
{ deep: !0 }
|
|
161
|
-
), J(() => {
|
|
162
|
-
r = q(f.value, () => {
|
|
163
|
-
u.value = a(c.value === 0);
|
|
164
|
-
});
|
|
165
|
-
}), K(() => {
|
|
166
|
-
r == null || r.disconnect();
|
|
167
|
-
}), u;
|
|
168
|
-
}, ve = {}, fe = /* @__PURE__ */ O({
|
|
169
|
-
...ve,
|
|
170
|
-
__name: "button-actions",
|
|
171
|
-
props: {
|
|
172
|
-
actions: {},
|
|
173
|
-
inverse: { type: Boolean, default: !1 },
|
|
174
|
-
layout: { default: se.BUTTONS_END }
|
|
175
|
-
},
|
|
176
|
-
setup(e) {
|
|
177
|
-
const l = e, n = C(null), c = C(null), r = ue(n, c, l.actions), _ = g(() => l.actions.slice().reverse()), d = (a) => {
|
|
178
|
-
const o = l.actions.length - 1;
|
|
179
|
-
return a === o ? "primary" : "secondary";
|
|
180
|
-
}, u = g(() => ({
|
|
181
|
-
[`b-button-actions--${l.layout}`]: !0,
|
|
182
|
-
"b-button-actions--stacked-buttons": r.value
|
|
183
|
-
})), f = (a) => (a == null ? void 0 : a.event) !== void 0 ? {
|
|
184
|
-
click: a.event
|
|
185
|
-
} : {}, T = (a) => a.iconOnly && (a.iconLeft || a.iconRight || a.icon);
|
|
186
|
-
return (a, o) => (i(), S("div", {
|
|
187
|
-
ref_key: "buttonActions",
|
|
188
|
-
ref: n,
|
|
189
|
-
class: "b-button-actions"
|
|
190
|
-
}, [
|
|
191
|
-
W("div", {
|
|
192
|
-
class: R(["b-button-actions__container-wrapper", u.value]),
|
|
193
|
-
role: "group"
|
|
194
|
-
}, [
|
|
195
|
-
(i(!0), S(Y, null, Q(_.value, (t, k) => (i(), S("div", {
|
|
196
|
-
key: k,
|
|
197
|
-
ref_for: !0,
|
|
198
|
-
ref_key: "buttons",
|
|
199
|
-
ref: c,
|
|
200
|
-
class: "b-button-actions__button-wrapper"
|
|
201
|
-
}, [
|
|
202
|
-
t.state ? (i(), v(m(ce), A({
|
|
203
|
-
key: 0,
|
|
204
|
-
condensed: t.condensed,
|
|
205
|
-
critical: t.critical,
|
|
206
|
-
disabled: t.disabled,
|
|
207
|
-
inverse: a.inverse,
|
|
208
|
-
state: t.state,
|
|
209
|
-
variant: t.variant || d(k)
|
|
210
|
-
}, b(f(t))), {
|
|
211
|
-
default: y(() => [
|
|
212
|
-
h(B(t.title), 1)
|
|
213
|
-
]),
|
|
214
|
-
_: 2
|
|
215
|
-
}, 1040, ["condensed", "critical", "disabled", "inverse", "state", "variant"])) : (i(), v(p, A({
|
|
216
|
-
key: 1,
|
|
217
|
-
condensed: t.condensed,
|
|
218
|
-
critical: t.critical,
|
|
219
|
-
disabled: t.disabled,
|
|
220
|
-
inverse: a.inverse,
|
|
221
|
-
link: t.link,
|
|
222
|
-
variant: t.variant || d(k)
|
|
223
|
-
}, b(f(t))), U({ _: 2 }, [
|
|
224
|
-
t.icon || t.iconLeft ? {
|
|
225
|
-
name: "iconLeft",
|
|
226
|
-
fn: y(() => [
|
|
227
|
-
(i(), v(E(t.icon || t.iconLeft), {
|
|
228
|
-
"svg-title": t.title
|
|
229
|
-
}, null, 8, ["svg-title"]))
|
|
230
|
-
]),
|
|
231
|
-
key: "0"
|
|
232
|
-
} : void 0,
|
|
233
|
-
T(t) ? void 0 : {
|
|
234
|
-
name: "default",
|
|
235
|
-
fn: y(() => [
|
|
236
|
-
h(B(t.title), 1)
|
|
237
|
-
]),
|
|
238
|
-
key: "1"
|
|
239
|
-
},
|
|
240
|
-
t.iconRight ? {
|
|
241
|
-
name: "iconRight",
|
|
242
|
-
fn: y(() => [
|
|
243
|
-
(i(), v(E(t.iconRight), {
|
|
244
|
-
"svg-title": t.title
|
|
245
|
-
}, null, 8, ["svg-title"]))
|
|
246
|
-
]),
|
|
247
|
-
key: "2"
|
|
248
|
-
} : void 0
|
|
249
|
-
]), 1040, ["condensed", "critical", "disabled", "inverse", "link", "variant"]))
|
|
250
|
-
]))), 128))
|
|
251
|
-
], 2)
|
|
252
|
-
], 512));
|
|
253
|
-
}
|
|
254
|
-
}), Ne = /* @__PURE__ */ $(fe, [["__scopeId", "data-v-0b415008"]]);
|
|
255
|
-
export {
|
|
256
|
-
Ne as B,
|
|
257
|
-
D as a,
|
|
258
|
-
F as b,
|
|
259
|
-
se as c,
|
|
260
|
-
ce as d,
|
|
261
|
-
s as e,
|
|
262
|
-
re as f
|
|
263
|
-
};
|
|
264
|
-
//# sourceMappingURL=button-actions.WnxN4KnV.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button-actions.WnxN4KnV.js","sources":["../../../core/src/components/button-actions/button-actions.types.ts","../../../core/src/components/loading-button/loading-button.types.ts","../../../vue2/src/components/button/components/loading-button/loading-button.vue","../../../vue2/src/components/internal/button-actions-with-menu/button-actions-with-menu.keys.ts","../../../vue2/src/components/button/components/button-actions/composables/use-stack-buttons/use-stack-buttons.ts","../../../vue2/src/components/button/components/button-actions/button-actions.vue"],"sourcesContent":["import type { BentoButtonProps } from '@/core/components/button/button.types';\nimport { BentoLoadingButtonState } from '@/core/components/loading-button/loading-button.types';\n\nexport interface BentoButtonActionObject<IconType = object> extends BentoButtonProps {\n title: string;\n event?: (event: Event) => void;\n icon?: IconType;\n iconLeft?: IconType;\n iconRight?: IconType;\n state?: BentoLoadingButtonState | `${BentoLoadingButtonState}`;\n iconOnly?: boolean;\n}\n\nexport type BentoButtonActionsList<IconType = object> = Array<BentoButtonActionObject<IconType>>;\n\nexport enum BentoButtonActionsLayoutBasic {\n BUTTONS_END = 'buttons-end',\n FILL_CONTAINER = 'fill-container',\n SPACE_BETWEEN = 'space-between',\n VERTICAL_STACK = 'vertical-stack',\n}\nexport enum BentoButtonActionsLayoutExtended {\n BUTTONS_START = 'buttons-start',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport const BentoButtonActionsLayout = { ...BentoButtonActionsLayoutBasic, ...BentoButtonActionsLayoutExtended };\nexport type BentoButtonActionsLayout = BentoButtonActionsLayoutBasic | BentoButtonActionsLayoutExtended;\n","export enum BentoLoadingButtonState {\n START = 'start',\n LOADING = 'loading',\n SUCCESS = 'success',\n FAIL = 'fail',\n}\n\nexport type BentoLoadingButtonIconState = Partial<{ [key in BentoLoadingButtonState]: string }>;\n","<template>\n <bento-button\n :critical=\"isCritical\"\n :variant=\"variant\"\n :condensed=\"condensed\"\n :disabled=\"disabled\"\n :inverse=\"inverse\"\n class=\"b-loading-button\"\n :class=\"conditionalClasses\"\n @click.capture.stop=\"onClick\"\n >\n <slot></slot>\n\n <template v-if=\"state === 'start' && hasSlot('iconLeft')\" #iconLeft>\n <slot name=\"iconLeft\"></slot>\n </template>\n <template v-else-if=\"state !== 'start'\" #iconLeft>\n <span class=\"b-loading-button__icon\" data-testid=\"loading-button-rotating-icon\">\n <cross v-if=\"state === 'fail'\" :svg-title=\"t('failed')\" />\n <checkmark v-else-if=\"state === 'success'\" :svg-title=\"t('succeded')\" />\n <!-- TODO: Replace with new loading-indicator component -->\n <bento-loading-indicator v-else-if=\"state === 'loading'\" small :inverse=\"isInverseLoadingIndicator\" />\n </span>\n </template>\n </bento-button>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, useSlots } from 'vue';\n import { BentoLoadingButtonState } from '@/core/components/loading-button/loading-button.types';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import BentoButton from '@/components/button/button.vue';\n import Cross from '@adyen/ui-assets-icons-16/vue/cross-circle-fill';\n import Checkmark from '@adyen/ui-assets-icons-16/vue/checkmark-circle-fill';\n import { useHasSlot } from '@/composables/use-has-slot/use-has-slot';\n\n import { useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n /**\n * Reduces sizing of button\n */\n condensed: {\n type: BentoButton.props.condensed.type,\n default: false,\n },\n\n /**\n * Displays loading-button as critical\n */\n critical: {\n type: BentoButton.props.critical.type,\n default: false,\n },\n\n /**\n * Disables button functonality\n */\n disabled: {\n type: BentoButton.props.disabled.type,\n default: false,\n },\n\n /**\n * Sets color set to inverse\n */\n inverse: {\n type: Boolean,\n default: false,\n },\n\n /**\n * State of the button.\n * @values start, loading, success, fail\n */\n state: {\n type: String as PropType<BentoLoadingButtonState | `${BentoLoadingButtonState}`>,\n default: BentoLoadingButtonState.START,\n validator: (value: BentoLoadingButtonState) => Object.values(BentoLoadingButtonState).includes(value),\n },\n\n /**\n * Types of flavour of Button\n */\n variant: {\n type: BentoButton.props.variant.type,\n default: 'primary',\n validator: BentoButton.props.variant.validator,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Click event handler\n */\n (e: 'click', event: MouseEvent): void;\n }>();\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const conditionalClasses = computed(() => ({\n [`b-loading-button--${props.variant}-${BentoLoadingButtonState.LOADING}`]:\n props.state === BentoLoadingButtonState.LOADING && !props.disabled,\n 'b-loading-button--loading': props.state === BentoLoadingButtonState.LOADING && !props.disabled,\n [`b-loading-button--${props.variant}-${BentoLoadingButtonState.SUCCESS}`]:\n props.state === BentoLoadingButtonState.SUCCESS,\n [`b-loading-button--inverse`]: props.inverse,\n }));\n\n const isInverseLoadingIndicator = computed(\n () => (props.variant === 'primary' && !props.inverse) || (props.variant !== 'primary' && props.inverse)\n );\n const isCritical = computed(\n () =>\n (props.critical && props.state === BentoLoadingButtonState.START) ||\n props.state === BentoLoadingButtonState.FAIL\n );\n\n const onClick = (e: MouseEvent) => {\n // Prevent Vue3 from triggering event twice\n e.stopPropagation();\n\n if (props.state !== BentoLoadingButtonState.LOADING) {\n emit('click', e);\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Loading Button component is used for cases where pressing a button starts an event that requires a loading state, e.g. when you have any sort of asynchronous action and are waiting for a response\n *\n * @example\n * import { BentoLoadingButton } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoLoadingButton },\n * template: `\n * <bento-loading-button state=\"loading\" variant=\"secondary\">\n * Loading\n * </bento-loading button>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/loading-button/loading-button.scss\" />\n","export const BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY = Symbol(\n 'button actions with menu container injection key'\n);\n","import { computed, inject, nextTick, onMounted, onUnmounted, ref, Ref, watch } from 'vue';\nimport { observeSizeOfElement } from '@/utils/ts/resize';\nimport { BButtonActionsButtonsEndColumnGap } from '@adyen/bento-design-tokens/dist/js/bento/es6';\nimport { BentoButtonActionsList } from '../../button-actions.types';\nimport { BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY } from '@/internal/button-actions-with-menu/button-actions-with-menu.keys';\n\nconst CONTAINER_QUERY = 242;\nconst BUTTONS_GAP = parseInt(BButtonActionsButtonsEndColumnGap, 10);\n\n/**\n * Calculates the width of the container and the buttons and decides if the buttons should be stacked or not\n *\n * @param buttonActions Reference to the container element\n * @param buttons Reference array of button elements\n * @param actions Button actions actions prop\n */\nexport const useStackButtons = (\n buttonActions: Ref<HTMLDivElement>,\n buttons: Ref<HTMLDivElement[]>,\n actions: BentoButtonActionsList\n) => {\n const originalButtonsWidth = ref(0);\n let containerObserver: ResizeObserver | null = null;\n\n const { buttonActionsWithMenu, menu, stackButtons } = inject(BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY, {\n buttonActionsWithMenu: ref(null),\n menu: ref(null),\n stackButtons: ref(false),\n });\n\n const container = computed(() => buttonActionsWithMenu.value ?? buttonActions.value);\n\n const computedButtons = computed(() => (menu.value ? [...buttons.value, menu.value.$el] : buttons.value));\n\n const areButtonsWiderThanContainer = (updateOriginalButtonsWidth?: boolean) => {\n const buttonsWidth = computedButtons.value?.reduce(\n (acc, button) => acc + button.clientWidth + BUTTONS_GAP,\n -BUTTONS_GAP - 1 // to remove the extra spacing, as if there's 3 buttons, only two will have a gap in between\n );\n\n const containersWidth = container.value.clientWidth;\n\n if (updateOriginalButtonsWidth) {\n originalButtonsWidth.value = containersWidth >= CONTAINER_QUERY && !stackButtons.value ? buttonsWidth : 0;\n }\n return originalButtonsWidth.value > containersWidth;\n };\n\n watch(\n () => actions,\n () => {\n nextTick(() => {\n stackButtons.value = areButtonsWiderThanContainer(true);\n });\n },\n { deep: true }\n );\n\n onMounted(() => {\n containerObserver = observeSizeOfElement(container.value, () => {\n stackButtons.value = areButtonsWiderThanContainer(originalButtonsWidth.value === 0);\n });\n });\n\n onUnmounted(() => {\n containerObserver?.disconnect();\n });\n\n return stackButtons;\n};\n","<template>\n <div ref=\"buttonActions\" class=\"b-button-actions\">\n <div class=\"b-button-actions__container-wrapper\" :class=\"conditionalClasses\" role=\"group\">\n <div\n v-for=\"(button, index) in reversedActionsList\"\n :key=\"index\"\n ref=\"buttons\"\n class=\"b-button-actions__button-wrapper\"\n >\n <bento-loading-button\n v-if=\"button.state\"\n :condensed=\"button.condensed\"\n :critical=\"button.critical\"\n :disabled=\"button.disabled\"\n :inverse=\"inverse\"\n :state=\"button.state\"\n :variant=\"button.variant || generateButtonVariantByIndex(index)\"\n v-on=\"generateButtonEvents(button)\"\n >\n {{ button.title }}\n </bento-loading-button>\n <bento-button\n v-else\n :condensed=\"button.condensed\"\n :critical=\"button.critical\"\n :disabled=\"button.disabled\"\n :inverse=\"inverse\"\n :link=\"button.link\"\n :variant=\"button.variant || generateButtonVariantByIndex(index)\"\n v-on=\"generateButtonEvents(button)\"\n >\n <template v-if=\"button.icon || button.iconLeft\" #iconLeft>\n <component :is=\"button.icon || button.iconLeft\" :svg-title=\"button.title\"></component>\n </template>\n <template v-if=\"!isIconOnly(button)\" #default>\n {{ button.title }}\n </template>\n <template v-if=\"button.iconRight\" #iconRight>\n <component :is=\"button.iconRight\" :svg-title=\"button.title\"></component>\n </template>\n </bento-button>\n </div>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref } from 'vue';\n import BentoButton from '../../button.vue';\n import {\n BentoButtonActionObject,\n BentoButtonActionsLayout,\n } from '@/core/components/button-actions/button-actions.types';\n import type { BentoButtonActionsProps } from './button-actions.types';\n import { BentoLoadingButton } from '../loading-button';\n import { useStackButtons } from '@/components/button/components/button-actions/composables/use-stack-buttons/use-stack-buttons';\n\n const props = withDefaults(defineProps<BentoButtonActionsProps>(), {\n inverse: false,\n layout: BentoButtonActionsLayout.BUTTONS_END,\n });\n\n const buttonActions = ref<HTMLDivElement>(null);\n const buttons = ref<HTMLDivElement[]>(null);\n const stackButtons = useStackButtons(buttonActions, buttons, props.actions);\n\n const reversedActionsList = computed(() => props.actions.slice().reverse());\n const generateButtonVariantByIndex = actionIndex => {\n const lastActionIndex = props.actions.length - 1;\n return actionIndex === lastActionIndex ? 'primary' : 'secondary';\n };\n\n const conditionalClasses = computed(() => ({\n [`b-button-actions--${props.layout}`]: true,\n [`b-button-actions--stacked-buttons`]: stackButtons.value,\n }));\n\n const generateButtonEvents = (button: BentoButtonActionObject) =>\n button?.event !== undefined\n ? {\n click: button.event,\n }\n : {};\n\n const isIconOnly = (button: BentoButtonActionObject) =>\n button.iconOnly && (button.iconLeft || button.iconRight || button.icon);\n</script>\n\n<script lang=\"ts\">\n /**\n * ButtonActions component manages a set of actions a user can choose from by displaying a group of buttons.\n *\n * @example\n * import { BentoButtonActions } from '@adyen/bento-vue2';\n * import MachineLearningIcon from '@adyen/ui-assets-icons-16/vue/machine-learning';\n *\n * const clickedAction = () => { //your action here }\n *\n * <template>\n * <bento-button-actions\n * :actions=\"[{\n * title: 'Primary',\n * event: clickedAction,\n * icon: MachineLearningIcon,\n * }, {\n * title: 'Secondary',\n * event: clickedAction,\n * }, {\n * title: 'Tertiary',\n * event: clickedAction,\n * }]\"\n * />\n * </template>\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/button-actions/button-actions.scss\" />\n"],"names":["BentoButtonActionsLayoutBasic","BentoButtonActionsLayoutBasic2","BentoButtonActionsLayoutExtended","BentoButtonActionsLayoutExtended2","BentoButtonActionsLayout","BentoLoadingButtonState","BentoLoadingButtonState2","__default__$1","messages","props","__props","emit","__emit","slots","useSlots","hasSlot","useHasSlot","t","useI18n","conditionalClasses","computed","isInverseLoadingIndicator","isCritical","onClick","e","BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY","CONTAINER_QUERY","BUTTONS_GAP","BButtonActionsButtonsEndColumnGap","useStackButtons","buttonActions","buttons","actions","originalButtonsWidth","ref","containerObserver","buttonActionsWithMenu","menu","stackButtons","inject","container","computedButtons","areButtonsWiderThanContainer","updateOriginalButtonsWidth","buttonsWidth","_a","acc","button","containersWidth","watch","nextTick","onMounted","observeSizeOfElement","onUnmounted","__default__","reversedActionsList","generateButtonVariantByIndex","actionIndex","lastActionIndex","generateButtonEvents","isIconOnly"],"mappings":";;;;;;;;;;;AAeY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,cAAA,eACAA,EAAA,iBAAA,kBACAA,EAAA,gBAAA,iBACAA,EAAA,iBAAA,kBAJQA,IAAAD,KAAA,CAAA,CAAA,GAMAE,IAAA,kBAAAC,OACRA,EAAA,gBAAA,iBADQA,IAAAD,KAAA,CAAA,CAAA;AAOL,MAAAE,KAAA,EAAA,GAAAJ,GAAA,GAAAE,EAAA;AC5BK,IAAAG,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,UAAA,WACAA,EAAA,UAAA,WACAA,EAAA,OAAA,QAJQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;GCsJRE,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA9GA,UAAAC,IAAAC,GAqDAC,IAAAC,GAOAC,IAAAC,EAAA,GACAC,IAAAC,GAAAH,CAAA,GACA,EAAA,GAAAI,EAAA,IAAAC,GAAA,EAAA,UAAAV,EAAA,CAAA,GAEAW,IAAAC,EAAA,OAAA;AAAA,MAA2C,CAAA,qBAAAX,EAAA,OAAA,IAAAJ,EAAA,OAAA,EAAA,GAAAI,EAAA,UAAAJ,EAAA,WAAA,CAAAI,EAAA;AAAA,MAEuB,6BAAAA,EAAA,UAAAJ,EAAA,WAAA,CAAAI,EAAA;AAAA,MACyB,CAAA,qBAAAA,EAAA,OAAA,IAAAJ,EAAA,OAAA,EAAA,GAAAI,EAAA,UAAAJ,EAAA;AAAA,MAE3C,6BAAAI,EAAA;AAAA,IACP,EAAA,GAGzCY,IAAAD;AAAA,MAAkC,MAAAX,EAAA,YAAA,aAAA,CAAAA,EAAA,WAAAA,EAAA,YAAA,aAAAA,EAAA;AAAA,IACiE,GAEnGa,IAAAF;AAAA,MAAmB,MAAAX,EAAA,YAAAA,EAAA,UAAAJ,EAAA,SAAAI,EAAA,UAAAJ,EAAA;AAAA,IAG6B,GAGhDkB,IAAA,CAAAC,MAAA;AAEI,MAAAA,EAAA,gBAAA,GAEAf,EAAA,UAAAJ,EAAA,WACIM,EAAA,SAAAa,CAAA;AAAA,IACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oEClIDC,KAAA;AAAA,EAAyD;AAEhE,GCIAC,KAAA,KACAC,IAAA,SAAAC,GAAA,EAAA,GASOC,KAAA,CAAAC,GAAAC,GAAAC,MAAA;AAKH,QAAAC,IAAAC,EAAA,CAAA;AACA,MAAAC,IAAA;AAEA,QAAA,EAAA,uBAAAC,GAAA,MAAAC,GAAA,cAAAC,EAAA,IAAAC,EAAAd,IAAA;AAAA,IAA+G,uBAAAS,EAAA,IAAA;AAAA,IAC5E,MAAAA,EAAA,IAAA;AAAA,IACjB,cAAAA,EAAA,EAAA;AAAA,EACS,CAAA,GAG3BM,IAAApB,EAAA,MAAAgB,EAAA,SAAAN,EAAA,KAAA,GAEAW,IAAArB,EAAA,MAAAiB,EAAA,QAAA,CAAA,GAAAN,EAAA,OAAAM,EAAA,MAAA,GAAA,IAAAN,EAAA,KAAA,GAEAW,IAAA,CAAAC,MAAA;;AACI,UAAAC,KAAAC,IAAAJ,EAAA,UAAA,gBAAAI,EAAA;AAAA,MAA4C,CAAAC,GAAAC,MAAAD,IAAAC,EAAA,cAAApB;AAAA,MACI,CAAAA,IAAA;AAAA,OAIhDqB,IAAAR,EAAA,MAAA;AAEA,WAAAG,MACIV,EAAA,QAAAe,KAAAtB,MAAA,CAAAY,EAAA,QAAAM,IAAA,IAEJX,EAAA,QAAAe;AAAA,EAAoC;AAGxC,SAAAC;AAAA,IAAA,MAAAjB;AAAA,IACU,MAAA;AAEF,MAAAkB,EAAA,MAAA;AACI,QAAAZ,EAAA,QAAAI,EAAA,EAAA;AAAA,MAAsD,CAAA;AAAA,IACzD;AAAA,IACL,EAAA,MAAA,GAAA;AAAA,EACa,GAGjBS,EAAA,MAAA;AACI,IAAAhB,IAAAiB,EAAAZ,EAAA,OAAA,MAAA;AACI,MAAAF,EAAA,QAAAI,EAAAT,EAAA,UAAA,CAAA;AAAA,IAAkF,CAAA;AAAA,EACrF,CAAA,GAGLoB,EAAA,MAAA;AACI,IAAAlB,KAAA,QAAAA,EAAA;AAAA,EAA8B,CAAA,GAGlCG;AACJ,GC6CIgB,KAAA,CAAA;;;;;;;;;AAzDA,UAAA7C,IAAAC,GAKAoB,IAAAI,EAAA,IAAA,GACAH,IAAAG,EAAA,IAAA,GACAI,IAAAT,GAAAC,GAAAC,GAAAtB,EAAA,OAAA,GAEA8C,IAAAnC,EAAA,MAAAX,EAAA,QAAA,MAAA,EAAA,QAAA,CAAA,GACA+C,IAAA,CAAAC,MAAA;AACI,YAAAC,IAAAjD,EAAA,QAAA,SAAA;AACA,aAAAgD,MAAAC,IAAA,YAAA;AAAA,IAAqD,GAGzDvC,IAAAC,EAAA,OAAA;AAAA,MAA2C,CAAA,qBAAAX,EAAA,MAAA,EAAA,GAAA;AAAA,MACA,qCAAA6B,EAAA;AAAA,IACa,EAAA,GAGxDqB,IAAA,CAAAZ,OAAAA,KAAA,gBAAAA,EAAA,WAAA,SAAA;AAAA,MAEU,OAAAA,EAAA;AAAA,IACkB,IAAA,CAAA,GAI5Ba,IAAA,CAAAb,MAAAA,EAAA,aAAAA,EAAA,YAAAA,EAAA,aAAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { defineComponent as I, useAttrs as C, useSlots as N, computed as i, createBlock as f, openBlock as r, resolveDynamicComponent as T, mergeProps as A, withCtx as m, createElementBlock as y, createCommentVNode as c, unref as n, renderSlot as d } from "vue";
|
|
2
|
-
import { B as O } from "./typography.DN5eC5ch.js";
|
|
3
|
-
import { u as $ } from "./use-has-slot.B7eQSabc.js";
|
|
4
|
-
import { B as L, a as Y } from "./link.CTH1xj0i.js";
|
|
5
|
-
import { _ as B } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
6
|
-
import "../assets/button.css";
|
|
7
|
-
var u = /* @__PURE__ */ ((t) => (t.PRIMARY = "primary", t.SECONDARY = "secondary", t.TERTIARY = "tertiary", t.TERTIARY_WITH_BACKGROUND = "tertiary-with-background", t))(u || {}), s = /* @__PURE__ */ ((t) => (t.CONDENSED = "condensed", t.DESTRUCTIVE = "critical", t.DISABLED = "disabled", t.ICON_ONLY = "icon-only", t.INVERSE = "inverse", t))(s || {});
|
|
8
|
-
const U = ["aria-hidden"], w = ["aria-hidden"], x = {
|
|
9
|
-
name: "bento-button"
|
|
10
|
-
}, V = /* @__PURE__ */ I({
|
|
11
|
-
...x,
|
|
12
|
-
props: {
|
|
13
|
-
/**
|
|
14
|
-
* Reduces sizing of button
|
|
15
|
-
*/
|
|
16
|
-
condensed: { type: Boolean, default: !1 },
|
|
17
|
-
/**
|
|
18
|
-
* Displays button as critical
|
|
19
|
-
*/
|
|
20
|
-
critical: { type: Boolean, default: !1 },
|
|
21
|
-
/**
|
|
22
|
-
* Disables button functionality
|
|
23
|
-
*/
|
|
24
|
-
disabled: { type: Boolean, default: !1 },
|
|
25
|
-
/**
|
|
26
|
-
* Sets color set to inverse
|
|
27
|
-
*/
|
|
28
|
-
inverse: { type: Boolean, default: !1 },
|
|
29
|
-
/**
|
|
30
|
-
* Object containing props passed on to the BentoLink component. @see BentoLink documentation for which properties you can pass.
|
|
31
|
-
*/
|
|
32
|
-
link: { type: Object, default: void 0 },
|
|
33
|
-
/**
|
|
34
|
-
* The default behavior of the button.
|
|
35
|
-
* Possible values are: 'button', 'reset', 'submit'
|
|
36
|
-
*/
|
|
37
|
-
type: {
|
|
38
|
-
type: String,
|
|
39
|
-
default: "button"
|
|
40
|
-
},
|
|
41
|
-
/**
|
|
42
|
-
* Types of flavour of Button
|
|
43
|
-
* @values primary, secondary, tertiary, tertiary-with-background
|
|
44
|
-
*/
|
|
45
|
-
variant: {
|
|
46
|
-
type: String,
|
|
47
|
-
default: u.PRIMARY,
|
|
48
|
-
validator: (t) => Object.values(u).includes(t)
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
emits: ["blur", "click", "focus", "keydown.esc"],
|
|
52
|
-
setup(t, { emit: v }) {
|
|
53
|
-
const e = t, _ = v, b = C(), E = N(), o = $(E), p = i(() => (e == null ? void 0 : e.link) !== void 0 ? L : "button"), k = i(() => {
|
|
54
|
-
var a, l;
|
|
55
|
-
return {
|
|
56
|
-
"aria-controls": (a = b["aria-controls"]) == null ? void 0 : a.toString(),
|
|
57
|
-
"aria-expanded": (l = b["aria-expanded"]) == null ? void 0 : l.toString()
|
|
58
|
-
};
|
|
59
|
-
}), S = i(
|
|
60
|
-
() => p.value === "button" ? {
|
|
61
|
-
...k.value,
|
|
62
|
-
disabled: e.disabled,
|
|
63
|
-
type: e.type
|
|
64
|
-
} : { ...e.link, disableTypography: !0, variant: Y.DEFAULT, isButton: !0 }
|
|
65
|
-
), h = i(() => ({
|
|
66
|
-
[`b-button--${e.variant}${e.critical ? `-${s.DESTRUCTIVE}` : ""}`]: !0
|
|
67
|
-
})), R = i(() => ({
|
|
68
|
-
...h.value,
|
|
69
|
-
[`b-button--${s.CONDENSED}`]: e.condensed,
|
|
70
|
-
[`b-button--${s.DISABLED}`]: e.disabled,
|
|
71
|
-
[`b-button--${s.INVERSE}`]: e.inverse
|
|
72
|
-
})), g = () => ({
|
|
73
|
-
[`b-button--${s.ICON_ONLY}`]: !o("default")
|
|
74
|
-
}), D = (a) => {
|
|
75
|
-
e.disabled ? (a.preventDefault(), a.stopPropagation()) : _("click", a);
|
|
76
|
-
};
|
|
77
|
-
return (a, l) => (r(), f(T(p.value), A(S.value, {
|
|
78
|
-
class: ["b-button", { ...R.value, ...g() }],
|
|
79
|
-
onClickCapture: D
|
|
80
|
-
}), {
|
|
81
|
-
default: m(() => [
|
|
82
|
-
n(o)("iconLeft") ? (r(), y("span", {
|
|
83
|
-
key: 0,
|
|
84
|
-
class: "b-button__icon-left",
|
|
85
|
-
"data-testid": "icon-button-left",
|
|
86
|
-
"aria-hidden": n(o)("default") ? "true" : null
|
|
87
|
-
}, [
|
|
88
|
-
d(a.$slots, "iconLeft", {}, void 0, !0)
|
|
89
|
-
], 8, U)) : c("", !0),
|
|
90
|
-
n(o)("default") ? (r(), f(n(O), {
|
|
91
|
-
key: 1,
|
|
92
|
-
el: "span",
|
|
93
|
-
variant: "body",
|
|
94
|
-
stronger: "",
|
|
95
|
-
class: "b-button__label"
|
|
96
|
-
}, {
|
|
97
|
-
default: m(() => [
|
|
98
|
-
d(a.$slots, "default", {}, void 0, !0)
|
|
99
|
-
]),
|
|
100
|
-
_: 3
|
|
101
|
-
})) : c("", !0),
|
|
102
|
-
n(o)("iconRight") ? (r(), y("span", {
|
|
103
|
-
key: 2,
|
|
104
|
-
class: "b-button__icon-right",
|
|
105
|
-
"data-testid": "icon-button-right",
|
|
106
|
-
"aria-hidden": n(o)("default") ? "true" : null
|
|
107
|
-
}, [
|
|
108
|
-
d(a.$slots, "iconRight", {}, void 0, !0)
|
|
109
|
-
], 8, w)) : c("", !0)
|
|
110
|
-
]),
|
|
111
|
-
_: 3
|
|
112
|
-
}, 16, ["class"]));
|
|
113
|
-
}
|
|
114
|
-
}), K = /* @__PURE__ */ B(V, [["__scopeId", "data-v-a2e09f98"]]);
|
|
115
|
-
export {
|
|
116
|
-
K as B,
|
|
117
|
-
u as a,
|
|
118
|
-
s as b
|
|
119
|
-
};
|
|
120
|
-
//# sourceMappingURL=button.CVZJTZv0.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button.CVZJTZv0.js","sources":["../../../core/src/components/button/button.types.ts","../../../vue2/src/components/button/button.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoButtonVariant {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n TERTIARY = 'tertiary',\n TERTIARY_WITH_BACKGROUND = 'tertiary-with-background',\n}\n\nexport enum BentoButtonPropClass {\n CONDENSED = 'condensed',\n DESTRUCTIVE = 'critical',\n DISABLED = 'disabled',\n ICON_ONLY = 'icon-only',\n INVERSE = 'inverse',\n}\n\nexport interface BentoButtonProps {\n condensed?: boolean;\n critical?: boolean;\n disabled?: boolean;\n inverse?: boolean;\n variant?: BentoButtonVariant | `${BentoButtonVariant}`;\n type?: string;\n link?: object;\n}\n","<template>\n <component\n :is=\"componentType\"\n v-bind=\"componentProps\"\n class=\"b-button\"\n :class=\"{ ...conditionalClasses, ...getIconOnlyClass() }\"\n @click.capture=\"onClickButton\"\n >\n <span\n v-if=\"hasSlot('iconLeft')\"\n class=\"b-button__icon-left\"\n data-testid=\"icon-button-left\"\n :aria-hidden=\"hasSlot('default') ? 'true' : null\"\n >\n <slot name=\"iconLeft\" />\n </span>\n <bento-typography v-if=\"hasSlot('default')\" el=\"span\" variant=\"body\" stronger class=\"b-button__label\">\n <slot />\n </bento-typography>\n <span\n v-if=\"hasSlot('iconRight')\"\n class=\"b-button__icon-right\"\n data-testid=\"icon-button-right\"\n :aria-hidden=\"hasSlot('default') ? 'true' : null\"\n >\n <slot name=\"iconRight\" />\n </span>\n </component>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, useAttrs, useSlots } from 'vue';\n import { BentoButtonPropClass, BentoButtonVariant } from '@/core/components/button/button.types';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables/use-has-slot/use-has-slot';\n import { Booleanish } from '@/types/prop-types';\n import type { RouterLinkProps } from 'vue-router/types/router.d.ts';\n import type { AnchorHTMLAttributes, ButtonHTMLAttributes } from 'vue/types/jsx.d.ts';\n import { BentoLink, BentoLinkVariant } from '@/components/link';\n\n // TODO: replace all this code when migrated to Vue 3 is complete as this is the only\n // current way to extend the `router-link` component in Vue 2 and Vue Router 3\n export interface LinkProps extends RouterLinkProps, AnchorHTMLAttributes {\n args?: { props: RouterLinkProps };\n\n /**\n * Set the rendered link to a regular external anchor link.\n */\n external: boolean;\n }\n\n const props = defineProps({\n /**\n * Reduces sizing of button\n */\n condensed: { type: Boolean, default: false },\n\n /**\n * Displays button as critical\n */\n critical: { type: Boolean, default: false },\n\n /**\n * Disables button functionality\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Sets color set to inverse\n */\n inverse: { type: Boolean, default: false },\n\n /**\n * Object containing props passed on to the BentoLink component. @see BentoLink documentation for which properties you can pass.\n */\n link: { type: Object, default: undefined },\n\n /**\n * The default behavior of the button.\n * Possible values are: 'button', 'reset', 'submit'\n */\n type: {\n type: String as PropType<ButtonHTMLAttributes['type']>,\n default: 'button',\n },\n\n /**\n * Types of flavour of Button\n * @values primary, secondary, tertiary, tertiary-with-background\n */\n variant: {\n type: String as PropType<BentoButtonVariant | `${BentoButtonVariant}`>,\n default: BentoButtonVariant.PRIMARY,\n validator: (value: BentoButtonVariant) => Object.values(BentoButtonVariant).includes(value),\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the element has lost focus\n */\n (e: 'blur');\n\n /**\n * Emitted when the button is clicked\n */\n (e: 'click', event: MouseEvent);\n\n /**\n * Emitted when the element has received focus\n */\n (e: 'focus');\n\n /**\n * Emitted when the \"ESC\" key is pressed\n */\n (e: 'keydown.esc');\n }>();\n\n const attrs = useAttrs();\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const componentType = computed(() => {\n if (props?.link !== undefined) {\n return BentoLink;\n }\n return 'button';\n });\n const ariaAttributes = computed(() => ({\n 'aria-controls': attrs['aria-controls']?.toString() as string,\n 'aria-expanded': attrs['aria-expanded']?.toString() as Booleanish,\n }));\n\n const componentProps = computed(() =>\n componentType.value === 'button'\n ? {\n ...ariaAttributes.value,\n disabled: props.disabled,\n type: props.type,\n }\n : { ...props.link, disableTypography: true, variant: BentoLinkVariant.DEFAULT, isButton: true }\n );\n\n const variantClass = computed(() => ({\n [`b-button--${props.variant}${props.critical ? `-${BentoButtonPropClass.DESTRUCTIVE}` : ''}`]: true,\n }));\n\n const conditionalClasses = computed(() => ({\n ...variantClass.value,\n [`b-button--${BentoButtonPropClass.CONDENSED}`]: props.condensed,\n [`b-button--${BentoButtonPropClass.DISABLED}`]: props.disabled,\n [`b-button--${BentoButtonPropClass.INVERSE}`]: props.inverse,\n }));\n\n const getIconOnlyClass = () => ({\n [`b-button--${BentoButtonPropClass.ICON_ONLY}`]: !hasSlot('default'),\n });\n\n const onClickButton = (e: MouseEvent) => {\n if (!props.disabled) {\n emit('click', e);\n } else {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Button component for all the various types of bento buttons.\n *\n * @example\n * import { BentoButton } from '@adyen/bento-vue2';\n * import { CheckMarkIcon } from '@adyen/ui-assets-icons-16';\n *\n * export default {\n * components: { BentoButton },\n * template: `\n * <bento-button\n * disabled\n * variant=\"secondary\"\n * >\n * <template #iconLeft>\n * <check-mark svg-title=\"checked\" />\n * </template>\n *\n * Button text\n *\n * <template #iconRight>\n * <check-mark svg-title=\"checked\" />\n * </template>\n * </bento-button>\n * `,\n * }\n */\n export default {\n name: 'bento-button',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/button/button.scss\" />\n"],"names":["BentoButtonVariant","BentoButtonVariant2","BentoButtonPropClass","BentoButtonPropClass2","__default__","props","__props","emit","__emit","attrs","useAttrs","slots","useSlots","hasSlot","useHasSlot","componentType","computed","BentoLink","ariaAttributes","_a","_b","componentProps","BentoLinkVariant","variantClass","conditionalClasses","getIconOnlyClass","onClickButton","e"],"mappings":";;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,YAAA,aACAA,EAAA,WAAA,YACAA,EAAA,2BAAA,4BAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,YAAA,aACAA,EAAA,cAAA,YACAA,EAAA,WAAA,YACAA,EAAA,YAAA,aACAA,EAAA,UAAA,WALQA,IAAAD,KAAA,CAAA,CAAA;gDC2LRE,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AApJA,UAAAC,IAAAC,GA8CAC,IAAAC,GAsBAC,IAAAC,EAAA,GACAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAA,OACIX,KAAA,gBAAAA,EAAA,UAAA,SACIY,IAEJ,QAAO,GAEXC,IAAAF,EAAA,MAAA;;AAAA;AAAA,QAAuC,kBAAAG,IAAAV,EAAA,eAAA,MAAA,gBAAAU,EAAA;AAAA,QACe,kBAAAC,IAAAX,EAAA,eAAA,MAAA,gBAAAW,EAAA;AAAA,MACA;AAAA,KAAA,GAGtDC,IAAAL;AAAA,MAAuB,MAAAD,EAAA,UAAA,WAAA;AAAA,QAEb,GAAAG,EAAA;AAAA,QACsB,UAAAb,EAAA;AAAA,QACF,MAAAA,EAAA;AAAA,MACJ,IAAA,EAAA,GAAAA,EAAA,MAAA,mBAAA,IAAA,SAAAiB,EAAA,SAAA,UAAA,GAAA;AAAA,IAE4E,GAGtGC,IAAAP,EAAA,OAAA;AAAA,MAAqC,CAAA,aAAAX,EAAA,OAAA,GAAAA,EAAA,WAAA,IAAAH,EAAA,WAAA,KAAA,EAAA,EAAA,GAAA;AAAA,IAC8D,EAAA,GAGnGsB,IAAAR,EAAA,OAAA;AAAA,MAA2C,GAAAO,EAAA;AAAA,MACvB,CAAA,aAAArB,EAAA,SAAA,EAAA,GAAAG,EAAA;AAAA,MACuC,CAAA,aAAAH,EAAA,QAAA,EAAA,GAAAG,EAAA;AAAA,MACD,CAAA,aAAAH,EAAA,OAAA,EAAA,GAAAG,EAAA;AAAA,IACD,EAAA,GAGzDoB,IAAA,OAAA;AAAA,MAAgC,CAAA,aAAAvB,EAAA,SAAA,EAAA,GAAA,CAAAW,EAAA,SAAA;AAAA,IACuC,IAGvEa,IAAA,CAAAC,MAAA;AACI,MAAAtB,EAAA,YAGIsB,EAAA,eAAA,GACAA,EAAA,gBAAA,KAHApB,EAAA,SAAAoB,CAAA;AAAA,IAIJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|