@adyen/bento-vue2 1.60.0 → 1.60.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/components.d.ts +201 -0
- package/dist/@types/index.d.ts +17710 -0
- package/dist/@types/use-form-v4.d.ts +86 -0
- package/dist/accordion.js +6 -0
- package/dist/accordion.js.map +1 -0
- package/dist/action-bar.js +5 -0
- package/dist/action-bar.js.map +1 -0
- package/dist/alert.js +8 -0
- package/dist/alert.js.map +1 -0
- package/dist/assets/accordion-item.css +1 -0
- package/dist/assets/action-bar.css +1 -0
- package/dist/assets/alert.css +1 -0
- package/dist/assets/avatar.css +1 -0
- package/dist/assets/base-button.css +1 -0
- package/dist/assets/base-modal.css +1 -0
- package/dist/assets/button-actions-with-menu.css +1 -0
- package/dist/assets/button-actions.css +1 -0
- package/dist/assets/button.css +1 -0
- package/dist/assets/calendar.css +1 -0
- package/dist/assets/card.css +1 -0
- package/dist/assets/checkbox-group.css +1 -0
- package/dist/assets/checkbox-input.css +1 -0
- package/dist/assets/checkbox.css +1 -0
- package/dist/assets/chip.css +1 -0
- package/dist/assets/code-snippet.css +1 -0
- package/dist/assets/controls-group.css +1 -0
- package/dist/assets/copy.css +1 -0
- package/dist/assets/country.css +1 -0
- package/dist/assets/currency.css +1 -0
- package/dist/assets/dashboard-section.css +1 -0
- package/dist/assets/dashed-underline.css +1 -0
- package/dist/assets/data-grid-template.css +1 -0
- package/dist/assets/data-grid.css +1 -0
- package/dist/assets/date-picker.css +1 -0
- package/dist/assets/date-range-picker.css +1 -0
- package/dist/assets/date.css +1 -0
- package/dist/assets/dialog-page.css +1 -0
- package/dist/assets/divider.css +1 -0
- package/dist/assets/dropdown-default-textbox.css +1 -0
- package/dist/assets/dropdown-tag.css +1 -0
- package/dist/assets/dropdown.css +1 -0
- package/dist/assets/empty-state.css +1 -0
- package/dist/assets/error-message.css +1 -0
- package/dist/assets/file-uploader.css +1 -0
- package/dist/assets/filter-bar.css +1 -0
- package/dist/assets/fixed-scroller.css +1 -0
- package/dist/assets/focus-trap.css +1 -0
- package/dist/assets/footer-actions.css +1 -0
- package/dist/assets/form-layout-title.css +1 -0
- package/dist/assets/grid-layout.css +1 -0
- package/dist/assets/header-with-views.css +1 -0
- package/dist/assets/header.css +1 -0
- package/dist/assets/info-icon-with-popover.css +1 -0
- package/dist/assets/info-icon.css +1 -0
- package/dist/assets/input-field-password.css +1 -0
- package/dist/assets/input-field-phone-number.css +1 -0
- package/dist/assets/input-field.css +1 -0
- package/dist/assets/inspector.css +1 -0
- package/dist/assets/layout-row.css +1 -0
- package/dist/assets/link.css +1 -0
- package/dist/assets/listbox-option-tag.css +1 -0
- package/dist/assets/loading-indicator.css +1 -0
- package/dist/assets/main.css +1 -0
- package/dist/assets/menu.css +1 -0
- package/dist/assets/modal-fullscreen.css +1 -0
- package/dist/assets/pagination.css +1 -0
- package/dist/assets/payment-method.css +1 -0
- package/dist/assets/popover.css +1 -0
- package/dist/assets/popper-container.css +1 -0
- package/dist/assets/promo-banner.css +1 -0
- package/dist/assets/radio-group.css +1 -0
- package/dist/assets/radio-input.css +1 -0
- package/dist/assets/rich-text-editor.css +1 -0
- package/dist/assets/search-bar.css +1 -0
- package/dist/assets/secondary-nav.css +1 -0
- package/dist/assets/segmented-control.css +1 -0
- package/dist/assets/selection-card-group.css +1 -0
- package/dist/assets/sidepanel.css +1 -0
- package/dist/assets/status.css +1 -0
- package/dist/assets/step.css +1 -0
- package/dist/assets/structured-list-item.css +1 -0
- package/dist/assets/summary-grid.css +1 -0
- package/dist/assets/tabs.css +1 -0
- package/dist/assets/tag.css +1 -0
- package/dist/assets/teleport.css +1 -0
- package/dist/assets/textarea.css +1 -0
- package/dist/assets/timeline-item.css +1 -0
- package/dist/assets/toast.css +1 -0
- package/dist/assets/toggle-button.css +1 -0
- package/dist/assets/toggle.css +1 -0
- package/dist/assets/tooltip.css +1 -0
- package/dist/assets/tutorial.css +1 -0
- package/dist/assets/typography.css +1 -0
- package/dist/assets/use-cached-selected-values.css +1 -0
- package/dist/avatar.js +5 -0
- package/dist/avatar.js.map +1 -0
- package/dist/button.js +16 -0
- package/dist/button.js.map +1 -0
- package/dist/card.js +7 -0
- package/dist/card.js.map +1 -0
- package/dist/checkbox.js +11 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/chip.js +5 -0
- package/dist/chip.js.map +1 -0
- package/dist/chunks/1-generic-use.CZhwP2Yc.js +5 -0
- package/dist/chunks/1-generic-use.CZhwP2Yc.js.map +1 -0
- package/dist/chunks/1-generic-use.R6x8PEGA.js +5 -0
- package/dist/chunks/1-generic-use.R6x8PEGA.js.map +1 -0
- package/dist/chunks/2-generic-use.CNKjB4B7.js +5 -0
- package/dist/chunks/2-generic-use.CNKjB4B7.js.map +1 -0
- package/dist/chunks/2-generic-use.w0fUhovx.js +5 -0
- package/dist/chunks/2-generic-use.w0fUhovx.js.map +1 -0
- package/dist/chunks/3-generic-use.BLEzR04g.js +5 -0
- package/dist/chunks/3-generic-use.BLEzR04g.js.map +1 -0
- package/dist/chunks/3-generic-use.D3NFHgI4.js +5 -0
- package/dist/chunks/3-generic-use.D3NFHgI4.js.map +1 -0
- package/dist/chunks/4-generic-use.CULEpvgj.js +5 -0
- package/dist/chunks/4-generic-use.CULEpvgj.js.map +1 -0
- package/dist/chunks/4-generic-use.D82y3n39.js +5 -0
- package/dist/chunks/4-generic-use.D82y3n39.js.map +1 -0
- package/dist/chunks/_commonjsHelpers.C6fGbg64.js +7 -0
- package/dist/chunks/_commonjsHelpers.C6fGbg64.js.map +1 -0
- package/dist/chunks/_plugin-vue2_normalizer.CeySl7Fu.js +11 -0
- package/dist/chunks/_plugin-vue2_normalizer.CeySl7Fu.js.map +1 -0
- package/dist/chunks/accordion-item.C4tyRMCt.js +116 -0
- package/dist/chunks/accordion-item.C4tyRMCt.js.map +1 -0
- package/dist/chunks/action-bar.CMqiD6vc.js +161 -0
- package/dist/chunks/action-bar.CMqiD6vc.js.map +1 -0
- package/dist/chunks/adding-payment-methods.BJZLPxtM.js +5 -0
- package/dist/chunks/adding-payment-methods.BJZLPxtM.js.map +1 -0
- package/dist/chunks/adding-payment-methods.Dle8zt43.js +5 -0
- package/dist/chunks/adding-payment-methods.Dle8zt43.js.map +1 -0
- package/dist/chunks/adyen-giving.Ffw_DlJK.js +5 -0
- package/dist/chunks/adyen-giving.Ffw_DlJK.js.map +1 -0
- package/dist/chunks/adyen-giving.LiKHj_jY.js +5 -0
- package/dist/chunks/adyen-giving.LiKHj_jY.js.map +1 -0
- package/dist/chunks/alert.Du9NfW-V.js +103 -0
- package/dist/chunks/alert.Du9NfW-V.js.map +1 -0
- package/dist/chunks/aria-label.CaUURpnB.js +13 -0
- package/dist/chunks/aria-label.CaUURpnB.js.map +1 -0
- package/dist/chunks/avatar.BgwjpLQO.js +71 -0
- package/dist/chunks/avatar.BgwjpLQO.js.map +1 -0
- package/dist/chunks/base-button.-gx_u8Bd.js +86 -0
- package/dist/chunks/base-button.-gx_u8Bd.js.map +1 -0
- package/dist/chunks/base-modal.keys.C2PQXcE2.js +5 -0
- package/dist/chunks/base-modal.keys.C2PQXcE2.js.map +1 -0
- package/dist/chunks/base-modal.xA_DhHx9.js +373 -0
- package/dist/chunks/base-modal.xA_DhHx9.js.map +1 -0
- package/dist/chunks/bin.DuebwJYu.js +24 -0
- package/dist/chunks/bin.DuebwJYu.js.map +1 -0
- package/dist/chunks/button-actions-with-menu.S7i4V-8E.js +166 -0
- package/dist/chunks/button-actions-with-menu.S7i4V-8E.js.map +1 -0
- package/dist/chunks/button-actions.BFtzsfNe.js +194 -0
- package/dist/chunks/button-actions.BFtzsfNe.js.map +1 -0
- package/dist/chunks/button.BuD-IsW5.js +99 -0
- package/dist/chunks/button.BuD-IsW5.js.map +1 -0
- package/dist/chunks/calendar.DQiq_EoU.js +1167 -0
- package/dist/chunks/calendar.DQiq_EoU.js.map +1 -0
- package/dist/chunks/card.Bk7Lz1GS.js +123 -0
- package/dist/chunks/card.Bk7Lz1GS.js.map +1 -0
- package/dist/chunks/checkbox-group.CossCRls.js +152 -0
- package/dist/chunks/checkbox-group.CossCRls.js.map +1 -0
- package/dist/chunks/checkbox-input.Dr1GS2BZ.js +137 -0
- package/dist/chunks/checkbox-input.Dr1GS2BZ.js.map +1 -0
- package/dist/chunks/checkbox.DkDqMVeb.js +176 -0
- package/dist/chunks/checkbox.DkDqMVeb.js.map +1 -0
- package/dist/chunks/checkmark-circle-fill.DZBl7CeY.js +24 -0
- package/dist/chunks/checkmark-circle-fill.DZBl7CeY.js.map +1 -0
- package/dist/chunks/checkmark-small.C8T8ISN6.js +24 -0
- package/dist/chunks/checkmark-small.C8T8ISN6.js.map +1 -0
- package/dist/chunks/chevron-left.DOMTgGel.js +43 -0
- package/dist/chunks/chevron-left.DOMTgGel.js.map +1 -0
- package/dist/chunks/chevron-up.CSVyoaTy.js +43 -0
- package/dist/chunks/chevron-up.CSVyoaTy.js.map +1 -0
- package/dist/chunks/chip.bZEhHfIk.js +63 -0
- package/dist/chunks/chip.bZEhHfIk.js.map +1 -0
- package/dist/chunks/click-outside.C1Ud8AA2.js +23 -0
- package/dist/chunks/click-outside.C1Ud8AA2.js.map +1 -0
- package/dist/chunks/code-snippet.BlYhf-Dt.js +259 -0
- package/dist/chunks/code-snippet.BlYhf-Dt.js.map +1 -0
- package/dist/chunks/codemirror.Zv80n3Z2.js +14628 -0
- package/dist/chunks/codemirror.Zv80n3Z2.js.map +1 -0
- package/dist/chunks/controls-group.C4CHrb6Y.js +81 -0
- package/dist/chunks/controls-group.C4CHrb6Y.js.map +1 -0
- package/dist/chunks/copy.Bod4H2Dk.js +129 -0
- package/dist/chunks/copy.Bod4H2Dk.js.map +1 -0
- package/dist/chunks/country.Df7erZov.js +94 -0
- package/dist/chunks/country.Df7erZov.js.map +1 -0
- package/dist/chunks/country.types.C0Q_hhgJ.js +269 -0
- package/dist/chunks/country.types.C0Q_hhgJ.js.map +1 -0
- package/dist/chunks/cross-circle-fill-small.YhLgeipP.js +24 -0
- package/dist/chunks/cross-circle-fill-small.YhLgeipP.js.map +1 -0
- package/dist/chunks/cross-circle-fill.Ra0-PIUo.js +24 -0
- package/dist/chunks/cross-circle-fill.Ra0-PIUo.js.map +1 -0
- package/dist/chunks/cross-small.CZqsjZDz.js +24 -0
- package/dist/chunks/cross-small.CZqsjZDz.js.map +1 -0
- package/dist/chunks/cross.CJ5EEL2c.js +24 -0
- package/dist/chunks/cross.CJ5EEL2c.js.map +1 -0
- package/dist/chunks/currency.B1F9YOIx.js +106 -0
- package/dist/chunks/currency.B1F9YOIx.js.map +1 -0
- package/dist/chunks/dashboard-section.Dx6eYon4.js +102 -0
- package/dist/chunks/dashboard-section.Dx6eYon4.js.map +1 -0
- package/dist/chunks/dashed-underline.CY5J4pZp.js +65 -0
- package/dist/chunks/dashed-underline.CY5J4pZp.js.map +1 -0
- package/dist/chunks/data-grid-template.CVl3PU0v.js +109 -0
- package/dist/chunks/data-grid-template.CVl3PU0v.js.map +1 -0
- package/dist/chunks/data-grid-template.keys.2_AkxuNT.js +5 -0
- package/dist/chunks/data-grid-template.keys.2_AkxuNT.js.map +1 -0
- package/dist/chunks/data-grid.BZaXKTLk.js +2782 -0
- package/dist/chunks/data-grid.BZaXKTLk.js.map +1 -0
- package/dist/chunks/date-input.BqBdAO1E.js +17 -0
- package/dist/chunks/date-input.BqBdAO1E.js.map +1 -0
- package/dist/chunks/date-picker.lrT6LXe-.js +235 -0
- package/dist/chunks/date-picker.lrT6LXe-.js.map +1 -0
- package/dist/chunks/date-range-picker.Djt5mYvh.js +977 -0
- package/dist/chunks/date-range-picker.Djt5mYvh.js.map +1 -0
- package/dist/chunks/date.dYFFEunA.js +987 -0
- package/dist/chunks/date.dYFFEunA.js.map +1 -0
- package/dist/chunks/debounce.DUTu11PS.js +10 -0
- package/dist/chunks/debounce.DUTu11PS.js.map +1 -0
- package/dist/chunks/dialog-page.C5r6tM57.js +131 -0
- package/dist/chunks/dialog-page.C5r6tM57.js.map +1 -0
- package/dist/chunks/directive.Cbdox5VL.js +23 -0
- package/dist/chunks/directive.Cbdox5VL.js.map +1 -0
- package/dist/chunks/divider.Cc4JFWG_.js +35 -0
- package/dist/chunks/divider.Cc4JFWG_.js.map +1 -0
- package/dist/chunks/dot.CnkXzRn3.js +24 -0
- package/dist/chunks/dot.CnkXzRn3.js.map +1 -0
- package/dist/chunks/dropdown-default-textbox.AUsF-RIc.js +348 -0
- package/dist/chunks/dropdown-default-textbox.AUsF-RIc.js.map +1 -0
- package/dist/chunks/dropdown-tag.CY3nZ50z.js +215 -0
- package/dist/chunks/dropdown-tag.CY3nZ50z.js.map +1 -0
- package/dist/chunks/dropdown.Cx-3TGBk.js +818 -0
- package/dist/chunks/dropdown.Cx-3TGBk.js.map +1 -0
- package/dist/chunks/empty-state.IvvHHQ35.js +151 -0
- package/dist/chunks/empty-state.IvvHHQ35.js.map +1 -0
- package/dist/chunks/error-message.BAE9B9-N.js +121 -0
- package/dist/chunks/error-message.BAE9B9-N.js.map +1 -0
- package/dist/chunks/es6.n1ewaW31.js +11 -0
- package/dist/chunks/es6.n1ewaW31.js.map +1 -0
- package/dist/chunks/events.CMzGybJJ.js +47 -0
- package/dist/chunks/events.CMzGybJJ.js.map +1 -0
- package/dist/chunks/expand.C263WARj.js +24 -0
- package/dist/chunks/expand.C263WARj.js.map +1 -0
- package/dist/chunks/file-uploader.E18P6eyS.js +1913 -0
- package/dist/chunks/file-uploader.E18P6eyS.js.map +1 -0
- package/dist/chunks/filter-bar.D6IL1UDu.js +2288 -0
- package/dist/chunks/filter-bar.D6IL1UDu.js.map +1 -0
- package/dist/chunks/fixed-scroller.D0a6q8_i.js +106 -0
- package/dist/chunks/fixed-scroller.D0a6q8_i.js.map +1 -0
- package/dist/chunks/focus-trap.C-wIQqpO.js +499 -0
- package/dist/chunks/focus-trap.C-wIQqpO.js.map +1 -0
- package/dist/chunks/footer-actions.BgpSnSSn.js +96 -0
- package/dist/chunks/footer-actions.BgpSnSSn.js.map +1 -0
- package/dist/chunks/form-layout-title.DBCY18f8.js +190 -0
- package/dist/chunks/form-layout-title.DBCY18f8.js.map +1 -0
- package/dist/chunks/form-layout.types.D3EKzbE7.js +5 -0
- package/dist/chunks/form-layout.types.D3EKzbE7.js.map +1 -0
- package/dist/chunks/generate-uid.NJ8tVoha.js +32 -0
- package/dist/chunks/generate-uid.NJ8tVoha.js.map +1 -0
- package/dist/chunks/get-date-locale.BN8xEjY0.js +1735 -0
- package/dist/chunks/get-date-locale.BN8xEjY0.js.map +1 -0
- package/dist/chunks/get-slot-text.BQS5Olxm.js +12 -0
- package/dist/chunks/get-slot-text.BQS5Olxm.js.map +1 -0
- package/dist/chunks/grid-layout.HvTAa4to.js +76 -0
- package/dist/chunks/grid-layout.HvTAa4to.js.map +1 -0
- package/dist/chunks/header-with-views.DAdbhhG9.js +1549 -0
- package/dist/chunks/header-with-views.DAdbhhG9.js.map +1 -0
- package/dist/chunks/header.8SId1U5r.js +187 -0
- package/dist/chunks/header.8SId1U5r.js.map +1 -0
- package/dist/chunks/i18n.BQkEbtPM.js +31 -0
- package/dist/chunks/i18n.BQkEbtPM.js.map +1 -0
- package/dist/chunks/image.C2D2hKat.js +56 -0
- package/dist/chunks/image.C2D2hKat.js.map +1 -0
- package/dist/chunks/index.BDuTpjD8.js +40 -0
- package/dist/chunks/index.BDuTpjD8.js.map +1 -0
- package/dist/chunks/index.BdrLbvtJ.js +529 -0
- package/dist/chunks/index.BdrLbvtJ.js.map +1 -0
- package/dist/chunks/index.BxBB1rsx.js +15 -0
- package/dist/chunks/index.BxBB1rsx.js.map +1 -0
- package/dist/chunks/index.Cl4_42j5.js +8 -0
- package/dist/chunks/index.Cl4_42j5.js.map +1 -0
- package/dist/chunks/index.DD7TppDb.js +10 -0
- package/dist/chunks/index.DD7TppDb.js.map +1 -0
- package/dist/chunks/info-icon-with-popover.XZqkxPsB.js +71 -0
- package/dist/chunks/info-icon-with-popover.XZqkxPsB.js.map +1 -0
- package/dist/chunks/info-icon.C1xOlhYj.js +41 -0
- package/dist/chunks/info-icon.C1xOlhYj.js.map +1 -0
- package/dist/chunks/info.4d_mJHvT.js +24 -0
- package/dist/chunks/info.4d_mJHvT.js.map +1 -0
- package/dist/chunks/input-field-password.lK0Im1eg.js +251 -0
- package/dist/chunks/input-field-password.lK0Im1eg.js.map +1 -0
- package/dist/chunks/input-field-phone-number.BnjBqUKg.js +3097 -0
- package/dist/chunks/input-field-phone-number.BnjBqUKg.js.map +1 -0
- package/dist/chunks/input-field.B8HxtNIv.js +152 -0
- package/dist/chunks/input-field.B8HxtNIv.js.map +1 -0
- package/dist/chunks/inspector.CegHqvEW.js +117 -0
- package/dist/chunks/inspector.CegHqvEW.js.map +1 -0
- package/dist/chunks/inspector.types.DyHwE18g.js +5 -0
- package/dist/chunks/inspector.types.DyHwE18g.js.map +1 -0
- package/dist/chunks/internal-error.BLZodVBE.js +5 -0
- package/dist/chunks/internal-error.BLZodVBE.js.map +1 -0
- package/dist/chunks/internal-error.BmrwJFpR.js +5 -0
- package/dist/chunks/internal-error.BmrwJFpR.js.map +1 -0
- package/dist/chunks/keyboard-navigation.pB8weElW.js +66 -0
- package/dist/chunks/keyboard-navigation.pB8weElW.js.map +1 -0
- package/dist/chunks/layout-row.C_F2wX6d.js +87 -0
- package/dist/chunks/layout-row.C_F2wX6d.js.map +1 -0
- package/dist/chunks/link.D0P79Toh.js +95 -0
- package/dist/chunks/link.D0P79Toh.js.map +1 -0
- package/dist/chunks/listbox-option-tag.CczGPhWH.js +44 -0
- package/dist/chunks/listbox-option-tag.CczGPhWH.js.map +1 -0
- package/dist/chunks/loading-indicator.z8COalOc.js +48 -0
- package/dist/chunks/loading-indicator.z8COalOc.js.map +1 -0
- package/dist/chunks/menu.CT0SIn4v.js +601 -0
- package/dist/chunks/menu.CT0SIn4v.js.map +1 -0
- package/dist/chunks/modal-fullscreen.keys.CMba3hYp.js +5 -0
- package/dist/chunks/modal-fullscreen.keys.CMba3hYp.js.map +1 -0
- package/dist/chunks/modal-fullscreen.tofT1h0P.js +202 -0
- package/dist/chunks/modal-fullscreen.tofT1h0P.js.map +1 -0
- package/dist/chunks/modal.CiYtGu6u.js +445 -0
- package/dist/chunks/modal.CiYtGu6u.js.map +1 -0
- package/dist/chunks/no-results-found.Bg_ZcEid.js +5 -0
- package/dist/chunks/no-results-found.Bg_ZcEid.js.map +1 -0
- package/dist/chunks/no-results-found.BqvYsBR6.js +5 -0
- package/dist/chunks/no-results-found.BqvYsBR6.js.map +1 -0
- package/dist/chunks/notifications-cleared.BMZk37uf.js +5 -0
- package/dist/chunks/notifications-cleared.BMZk37uf.js.map +1 -0
- package/dist/chunks/notifications-cleared.C7W9ZXY7.js +5 -0
- package/dist/chunks/notifications-cleared.C7W9ZXY7.js.map +1 -0
- package/dist/chunks/on-click-outside.D9aY9g8G.js +101 -0
- package/dist/chunks/on-click-outside.D9aY9g8G.js.map +1 -0
- package/dist/chunks/page-not-found.COJLPVaU.js +5 -0
- package/dist/chunks/page-not-found.COJLPVaU.js.map +1 -0
- package/dist/chunks/page-not-found.DWW6W-PZ.js +5 -0
- package/dist/chunks/page-not-found.DWW6W-PZ.js.map +1 -0
- package/dist/chunks/pagination.B-EP9Lkq.js +338 -0
- package/dist/chunks/pagination.B-EP9Lkq.js.map +1 -0
- package/dist/chunks/payment-method.Cx4nPDtE.js +76 -0
- package/dist/chunks/payment-method.Cx4nPDtE.js.map +1 -0
- package/dist/chunks/payment-method.types.BqtH7RM2.js +5 -0
- package/dist/chunks/payment-method.types.BqtH7RM2.js.map +1 -0
- package/dist/chunks/planned-maintenance.C61sWB9h.js +5 -0
- package/dist/chunks/planned-maintenance.C61sWB9h.js.map +1 -0
- package/dist/chunks/planned-maintenance.jmWYTdet.js +5 -0
- package/dist/chunks/planned-maintenance.jmWYTdet.js.map +1 -0
- package/dist/chunks/popover.COaHa4ES.js +295 -0
- package/dist/chunks/popover.COaHa4ES.js.map +1 -0
- package/dist/chunks/popper-container.DIFqmRsp.js +1393 -0
- package/dist/chunks/popper-container.DIFqmRsp.js.map +1 -0
- package/dist/chunks/promo-banner.DJpA7Whg.js +70 -0
- package/dist/chunks/promo-banner.DJpA7Whg.js.map +1 -0
- package/dist/chunks/radio-group.CzsbH4_F.js +229 -0
- package/dist/chunks/radio-group.CzsbH4_F.js.map +1 -0
- package/dist/chunks/radio-input.uJAhxKRs.js +90 -0
- package/dist/chunks/radio-input.uJAhxKRs.js.map +1 -0
- package/dist/chunks/referrals.BvtT-kQS.js +5 -0
- package/dist/chunks/referrals.BvtT-kQS.js.map +1 -0
- package/dist/chunks/referrals.aX8WZigH.js +5 -0
- package/dist/chunks/referrals.aX8WZigH.js.map +1 -0
- package/dist/chunks/refresh.Bc9FzGjJ.js +24 -0
- package/dist/chunks/refresh.Bc9FzGjJ.js.map +1 -0
- package/dist/chunks/resize.Bqks3WUm.js +15 -0
- package/dist/chunks/resize.Bqks3WUm.js.map +1 -0
- package/dist/chunks/rich-text-editor.C4NdjtLA.js +6203 -0
- package/dist/chunks/rich-text-editor.C4NdjtLA.js.map +1 -0
- package/dist/chunks/search-bar.B4u_IgiI.js +97 -0
- package/dist/chunks/search-bar.B4u_IgiI.js.map +1 -0
- package/dist/chunks/search.DLtglc02.js +24 -0
- package/dist/chunks/search.DLtglc02.js.map +1 -0
- package/dist/chunks/secondary-nav.EROJ_sJQ.js +112 -0
- package/dist/chunks/secondary-nav.EROJ_sJQ.js.map +1 -0
- package/dist/chunks/segmented-control.B-uxKqMN.js +112 -0
- package/dist/chunks/segmented-control.B-uxKqMN.js.map +1 -0
- package/dist/chunks/segmented-control.types.BHRLV8KU.js +5 -0
- package/dist/chunks/segmented-control.types.BHRLV8KU.js.map +1 -0
- package/dist/chunks/selection-card-group.CnvREAh5.js +299 -0
- package/dist/chunks/selection-card-group.CnvREAh5.js.map +1 -0
- package/dist/chunks/show.e4LEpZKG.js +43 -0
- package/dist/chunks/show.e4LEpZKG.js.map +1 -0
- package/dist/chunks/sidepanel.3EBWM8JV.js +210 -0
- package/dist/chunks/sidepanel.3EBWM8JV.js.map +1 -0
- package/dist/chunks/sidepanel.keys.R0DKQuYx.js +5 -0
- package/dist/chunks/sidepanel.keys.R0DKQuYx.js.map +1 -0
- package/dist/chunks/status.types.p_TCvoo0.js +36 -0
- package/dist/chunks/status.types.p_TCvoo0.js.map +1 -0
- package/dist/chunks/step.CuOpi-Ye.js +217 -0
- package/dist/chunks/step.CuOpi-Ye.js.map +1 -0
- package/dist/chunks/structured-list-item.rOTJM0uc.js +87 -0
- package/dist/chunks/structured-list-item.rOTJM0uc.js.map +1 -0
- package/dist/chunks/success.DhioLvPD.js +5 -0
- package/dist/chunks/success.DhioLvPD.js.map +1 -0
- package/dist/chunks/success.nNwxJRBS.js +5 -0
- package/dist/chunks/success.nNwxJRBS.js.map +1 -0
- package/dist/chunks/summary-grid.keys.CxTf_FOc.js +6 -0
- package/dist/chunks/summary-grid.keys.CxTf_FOc.js.map +1 -0
- package/dist/chunks/summary-grid.types.Bg1Y7i-F.js +301 -0
- package/dist/chunks/summary-grid.types.Bg1Y7i-F.js.map +1 -0
- package/dist/chunks/tabs.DX_Gq12z.js +205 -0
- package/dist/chunks/tabs.DX_Gq12z.js.map +1 -0
- package/dist/chunks/tabs.keys.Bc2pSKRw.js +7 -0
- package/dist/chunks/tabs.keys.Bc2pSKRw.js.map +1 -0
- package/dist/chunks/tag.DDjyf2hd.js +44 -0
- package/dist/chunks/tag.DDjyf2hd.js.map +1 -0
- package/dist/chunks/teleport.BV6zrDjA.js +128 -0
- package/dist/chunks/teleport.BV6zrDjA.js.map +1 -0
- package/dist/chunks/textarea.0PapD8Nl.js +200 -0
- package/dist/chunks/textarea.0PapD8Nl.js.map +1 -0
- package/dist/chunks/timeline-item.IFw76Qeh.js +386 -0
- package/dist/chunks/timeline-item.IFw76Qeh.js.map +1 -0
- package/dist/chunks/toast.B2u2W_TQ.js +171 -0
- package/dist/chunks/toast.B2u2W_TQ.js.map +1 -0
- package/dist/chunks/toggle-button.ChDbeBZ8.js +83 -0
- package/dist/chunks/toggle-button.ChDbeBZ8.js.map +1 -0
- package/dist/chunks/toggle.Q52IIKfi.js +121 -0
- package/dist/chunks/toggle.Q52IIKfi.js.map +1 -0
- package/dist/chunks/tooltip.DyZIyMZN.js +189 -0
- package/dist/chunks/tooltip.DyZIyMZN.js.map +1 -0
- package/dist/chunks/truncate.BfIl_-71.js +8 -0
- package/dist/chunks/truncate.BfIl_-71.js.map +1 -0
- package/dist/chunks/tutorial.suIRmXta.js +348 -0
- package/dist/chunks/tutorial.suIRmXta.js.map +1 -0
- package/dist/chunks/typography.J1v_SPG3.js +87 -0
- package/dist/chunks/typography.J1v_SPG3.js.map +1 -0
- package/dist/chunks/upload-files.5wQwbfkp.js +5 -0
- package/dist/chunks/upload-files.5wQwbfkp.js.map +1 -0
- package/dist/chunks/upload-files.jTQY6y2X.js +5 -0
- package/dist/chunks/upload-files.jTQY6y2X.js.map +1 -0
- package/dist/chunks/use-bento-toast-controller.Cn_2Eogn.js +52 -0
- package/dist/chunks/use-bento-toast-controller.Cn_2Eogn.js.map +1 -0
- package/dist/chunks/use-cached-selected-values.9OnD_j5F.js +1177 -0
- package/dist/chunks/use-cached-selected-values.9OnD_j5F.js.map +1 -0
- package/dist/chunks/use-click-outside.BnhTgpSt.js +14 -0
- package/dist/chunks/use-click-outside.BnhTgpSt.js.map +1 -0
- package/dist/chunks/use-country-items.HFnjuDsG.js +30 -0
- package/dist/chunks/use-country-items.HFnjuDsG.js.map +1 -0
- package/dist/chunks/use-country-phon-code.DVgE19zT.js +5610 -0
- package/dist/chunks/use-country-phon-code.DVgE19zT.js.map +1 -0
- package/dist/chunks/use-default-slot-validator.BDn0wkYP.js +13 -0
- package/dist/chunks/use-default-slot-validator.BDn0wkYP.js.map +1 -0
- package/dist/chunks/use-expandable-content-height.GkjjbmPy.js +17 -0
- package/dist/chunks/use-expandable-content-height.GkjjbmPy.js.map +1 -0
- package/dist/chunks/use-form-layout-loading.D3lALhtC.js +12 -0
- package/dist/chunks/use-form-layout-loading.D3lALhtC.js.map +1 -0
- package/dist/chunks/use-has-slot.C9lQZ6nz.js +6 -0
- package/dist/chunks/use-has-slot.C9lQZ6nz.js.map +1 -0
- package/dist/chunks/warning-filled.Cd0kVWwa.js +24 -0
- package/dist/chunks/warning-filled.Cd0kVWwa.js.map +1 -0
- package/dist/chunks/wrong-environment.BOsyKdRI.js +5 -0
- package/dist/chunks/wrong-environment.BOsyKdRI.js.map +1 -0
- package/dist/chunks/wrong-environment.BiHTPtbJ.js +5 -0
- package/dist/chunks/wrong-environment.BiHTPtbJ.js.map +1 -0
- package/dist/click-outside.js +5 -0
- package/dist/click-outside.js.map +1 -0
- package/dist/code-snippet.js +8 -0
- package/dist/code-snippet.js.map +1 -0
- package/dist/country.js +12 -0
- package/dist/country.js.map +1 -0
- package/dist/currency.js +6 -0
- package/dist/currency.js.map +1 -0
- package/dist/dashboard-template.js +6 -0
- package/dist/dashboard-template.js.map +1 -0
- package/dist/dashed-underline.js +5 -0
- package/dist/dashed-underline.js.map +1 -0
- package/dist/data-grid-template.js +5 -0
- package/dist/data-grid-template.js.map +1 -0
- package/dist/data-grid.js +11 -0
- package/dist/data-grid.js.map +1 -0
- package/dist/date-picker.js +8 -0
- package/dist/date-picker.js.map +1 -0
- package/dist/date-range-picker.js +8 -0
- package/dist/date-range-picker.js.map +1 -0
- package/dist/date.js +6 -0
- package/dist/date.js.map +1 -0
- package/dist/divider.js +5 -0
- package/dist/divider.js.map +1 -0
- package/dist/dropdown.js +16 -0
- package/dist/dropdown.js.map +1 -0
- package/dist/empty-state.js +8 -0
- package/dist/empty-state.js.map +1 -0
- package/dist/file-uploader.js +5 -0
- package/dist/file-uploader.js.map +1 -0
- package/dist/filter-bar.js +8 -0
- package/dist/filter-bar.js.map +1 -0
- package/dist/focus-trap.js +5 -0
- package/dist/focus-trap.js.map +1 -0
- package/dist/fonts/fonts.css +2 -0
- package/dist/form-layout.js +8 -0
- package/dist/form-layout.js.map +1 -0
- package/dist/header-with-views.js +5 -0
- package/dist/header-with-views.js.map +1 -0
- package/dist/header.js +5 -0
- package/dist/header.js.map +1 -0
- package/dist/image.js +7 -0
- package/dist/image.js.map +1 -0
- package/dist/index.js +372 -0
- package/dist/index.js.map +1 -0
- package/dist/info-icon.js +5 -0
- package/dist/info-icon.js.map +1 -0
- package/dist/input-field-password.js +10 -0
- package/dist/input-field-password.js.map +1 -0
- package/dist/input-field-phone-number.js +5 -0
- package/dist/input-field-phone-number.js.map +1 -0
- package/dist/input-field.js +10 -0
- package/dist/input-field.js.map +1 -0
- package/dist/inspector.js +7 -0
- package/dist/inspector.js.map +1 -0
- package/dist/internal.js +43 -0
- package/dist/internal.js.map +1 -0
- package/dist/layout.js +6 -0
- package/dist/layout.js.map +1 -0
- package/dist/link.js +6 -0
- package/dist/link.js.map +1 -0
- package/dist/loading-indicator.js +6 -0
- package/dist/loading-indicator.js.map +1 -0
- package/dist/menu.js +6 -0
- package/dist/menu.js.map +1 -0
- package/dist/modal-fullscreen.js +6 -0
- package/dist/modal-fullscreen.js.map +1 -0
- package/dist/modal.js +14 -0
- package/dist/modal.js.map +1 -0
- package/dist/pagination.js +5 -0
- package/dist/pagination.js.map +1 -0
- package/dist/payment-method.js +7 -0
- package/dist/payment-method.js.map +1 -0
- package/dist/popover.js +6 -0
- package/dist/popover.js.map +1 -0
- package/dist/popper-container.js +9 -0
- package/dist/popper-container.js.map +1 -0
- package/dist/promo-banner.js +7 -0
- package/dist/promo-banner.js.map +1 -0
- package/dist/radio-group.js +9 -0
- package/dist/radio-group.js.map +1 -0
- package/dist/rich-text-editor.js +5 -0
- package/dist/rich-text-editor.js.map +1 -0
- package/dist/search-bar.js +9 -0
- package/dist/search-bar.js.map +1 -0
- package/dist/secondary-nav.js +5 -0
- package/dist/secondary-nav.js.map +1 -0
- package/dist/segmented-control.js +7 -0
- package/dist/segmented-control.js.map +1 -0
- package/dist/selection-card.js +7 -0
- package/dist/selection-card.js.map +1 -0
- package/dist/sidepanel.js +7 -0
- package/dist/sidepanel.js.map +1 -0
- package/dist/status.js +6 -0
- package/dist/status.js.map +1 -0
- package/dist/stepper.js +8 -0
- package/dist/stepper.js.map +1 -0
- package/dist/structured-list.js +6 -0
- package/dist/structured-list.js.map +1 -0
- package/dist/styles/bento-dark.css +2055 -0
- package/dist/styles/bento-light.css +2054 -0
- package/dist/styles/bento.css +2054 -0
- package/dist/styles/legacy.css +2209 -0
- package/dist/styles/styleguide.css +2109 -0
- package/dist/styles/utility.css +987 -0
- package/dist/summary-grid.js +12 -0
- package/dist/summary-grid.js.map +1 -0
- package/dist/tabs.js +6 -0
- package/dist/tabs.js.map +1 -0
- package/dist/tag.js +6 -0
- package/dist/tag.js.map +1 -0
- package/dist/textarea.js +5 -0
- package/dist/textarea.js.map +1 -0
- package/dist/timeline.js +10 -0
- package/dist/timeline.js.map +1 -0
- package/dist/toast.js +5 -0
- package/dist/toast.js.map +1 -0
- package/dist/toggle.js +7 -0
- package/dist/toggle.js.map +1 -0
- package/dist/tutorial.js +5 -0
- package/dist/tutorial.js.map +1 -0
- package/dist/typography.js +8 -0
- package/dist/typography.js.map +1 -0
- package/dist/use-form-v4.js +8300 -0
- package/dist/use-form-v4.js.map +1 -0
- package/dist/web-types.json +15200 -0
- package/package.json +6 -6
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { defineComponent as B, ref as c, computed as d, watch as k, onMounted as P, nextTick as Y } from "vue";
|
|
2
|
+
import "./index.Cl4_42j5.js";
|
|
3
|
+
import { C as q } from "./cross-small.CZqsjZDz.js";
|
|
4
|
+
import { u as L } from "./i18n.BQkEbtPM.js";
|
|
5
|
+
import { B as N } from "./button.BuD-IsW5.js";
|
|
6
|
+
import { B as U } from "./typography.J1v_SPG3.js";
|
|
7
|
+
import { n as $ } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
8
|
+
import { u as O } from "./use-bento-toast-controller.Cn_2Eogn.js";
|
|
9
|
+
import "../assets/toast.css";
|
|
10
|
+
const M = {
|
|
11
|
+
"en-US": {
|
|
12
|
+
dismiss: "Dismiss"
|
|
13
|
+
},
|
|
14
|
+
"ja-JP": {
|
|
15
|
+
dismiss: "却下"
|
|
16
|
+
},
|
|
17
|
+
"pt-BR": {
|
|
18
|
+
dismiss: "Descartar"
|
|
19
|
+
}
|
|
20
|
+
}, W = {
|
|
21
|
+
i18n: { messages: M }
|
|
22
|
+
}, z = /* @__PURE__ */ B({
|
|
23
|
+
...W,
|
|
24
|
+
__name: "toast-item",
|
|
25
|
+
props: {
|
|
26
|
+
toast: { type: Object, required: !0 }
|
|
27
|
+
},
|
|
28
|
+
setup(m) {
|
|
29
|
+
const t = m, { t: e } = L();
|
|
30
|
+
return { __sfc: !0, props: t, t: e, onAction: () => {
|
|
31
|
+
typeof t.toast.action.handler == "function" && t.toast.action.handler(), t.toast.dismiss();
|
|
32
|
+
}, CrossIcon: q, BentoButton: N, BentoTypography: U };
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
var V = function() {
|
|
36
|
+
var t = this, e = t._self._c, s = t._self._setupProxy;
|
|
37
|
+
return e("div", { staticClass: "b-toast-item" }, [e("output", { staticClass: "b-toast-item__text", attrs: { role: "status" } }, [e(s.BentoTypography, { attrs: { title: t.toast.text, el: "span", variant: "body", strongest: "" } }, [t._v(" " + t._s(t.toast.text) + " ")])], 1), t.toast.action ? e(s.BentoButton, { staticClass: "b-toast-item__btn", attrs: { variant: "tertiary", "data-testid": "toast-item-action-btn" }, on: { click: s.onAction } }, [t._v(" " + t._s(t.toast.action.text) + " ")]) : t._e(), e(s.BentoButton, { staticClass: "b-toast-item__btn", attrs: { variant: "tertiary", "data-testid": "toast-item-close-btn" }, on: { click: function(o) {
|
|
38
|
+
return t.toast.dismiss();
|
|
39
|
+
} }, scopedSlots: t._u([{ key: "iconLeft", fn: function() {
|
|
40
|
+
return [e(s.CrossIcon, { attrs: { "svg-title": s.t("dismiss") } })];
|
|
41
|
+
}, proxy: !0 }]) })], 1);
|
|
42
|
+
}, j = [], E = /* @__PURE__ */ $(
|
|
43
|
+
z,
|
|
44
|
+
V,
|
|
45
|
+
j,
|
|
46
|
+
!1,
|
|
47
|
+
null,
|
|
48
|
+
"e4019e01"
|
|
49
|
+
);
|
|
50
|
+
const H = E.exports, F = /* @__PURE__ */ B({
|
|
51
|
+
__name: "toast-shadow-stack",
|
|
52
|
+
emits: ["update"],
|
|
53
|
+
setup(m, { emit: t }) {
|
|
54
|
+
const { stack: e } = O(), s = c(), o = c(), u = c(), _ = c(), f = [o, u, _], v = d(() => e.value.slice(0, 3)), r = async () => {
|
|
55
|
+
await Y();
|
|
56
|
+
const { top: h } = s.value.getBoundingClientRect(), T = e.value.map((b, y) => {
|
|
57
|
+
if (y > 2)
|
|
58
|
+
return { ...b, bottom: 0, height: 0 };
|
|
59
|
+
const { height: p, top: g } = f[y].value.$el.getBoundingClientRect();
|
|
60
|
+
return { ...b, height: p, bottom: g - h };
|
|
61
|
+
});
|
|
62
|
+
t("update", T);
|
|
63
|
+
};
|
|
64
|
+
return k(e, r), P(() => {
|
|
65
|
+
e.value.length > 0 && r();
|
|
66
|
+
}), { __sfc: !0, stack: e, emit: t, shadowStack: s, toast0: o, toast1: u, toast2: _, toastRefs: f, toasts: v, shareToastsWithDimensions: r, ToastItem: H };
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
var J = function() {
|
|
70
|
+
var t = this, e = t._self._c, s = t._self._setupProxy;
|
|
71
|
+
return e("div", { ref: "shadowStack", staticClass: "b-toast-shadow-stack" }, [s.toasts[0] ? e(s.ToastItem, { ref: "toast0", attrs: { toast: s.toasts[0] } }) : t._e(), s.toasts[1] ? e(s.ToastItem, { ref: "toast1", attrs: { toast: s.toasts[1] } }) : t._e(), s.toasts[2] ? e(s.ToastItem, { ref: "toast2", attrs: { toast: s.toasts[2] } }) : t._e()], 1);
|
|
72
|
+
}, X = [], G = /* @__PURE__ */ $(
|
|
73
|
+
F,
|
|
74
|
+
J,
|
|
75
|
+
X,
|
|
76
|
+
!1,
|
|
77
|
+
null,
|
|
78
|
+
"77dcc427"
|
|
79
|
+
);
|
|
80
|
+
const K = G.exports, Q = /* @__PURE__ */ B({
|
|
81
|
+
__name: "toast",
|
|
82
|
+
setup(m) {
|
|
83
|
+
const e = c(!1), { stack: s } = O();
|
|
84
|
+
k(
|
|
85
|
+
s,
|
|
86
|
+
(a) => {
|
|
87
|
+
a.length > 0 && !e.value && (e.value = !0);
|
|
88
|
+
},
|
|
89
|
+
{ immediate: !0 }
|
|
90
|
+
);
|
|
91
|
+
const o = c(!1), u = c([]), _ = 40, f = 10, v = d(() => u.value.length), r = d(() => Math.min(o.value ? 2 : 0, v.value - 1)), h = d(() => {
|
|
92
|
+
const a = u.value[r.value];
|
|
93
|
+
return a ? a.bottom + a.height : 0;
|
|
94
|
+
}), T = d(() => {
|
|
95
|
+
const a = h.value - _;
|
|
96
|
+
return u.value.map((n, l) => {
|
|
97
|
+
const D = l > r.value, R = !o.value && l > 1, S = D ? a + f * (R ? 2 : 1) : n.bottom;
|
|
98
|
+
return {
|
|
99
|
+
...n,
|
|
100
|
+
styles: {
|
|
101
|
+
height: `${D ? _ : n.height}px`,
|
|
102
|
+
transform: D ? `translateY(${S * -1}px) scaleX(${R ? "0.8" : "0.9"})` : `translateY(${S * -1}px)`,
|
|
103
|
+
"z-index": v.value - l
|
|
104
|
+
},
|
|
105
|
+
// first toast has different animation, and toasts above index 2/3 are not visible so no need for a custom animation
|
|
106
|
+
dismissTransform: l > 0 && l < (o.value ? 4 : 3) ? `translateY(${(S - n.height) * -1}px) scale(0.5, 0.1)` : null,
|
|
107
|
+
isFirst: l === 0,
|
|
108
|
+
isInert: l > (o.value ? 2 : 0)
|
|
109
|
+
};
|
|
110
|
+
});
|
|
111
|
+
}), b = (a) => {
|
|
112
|
+
a.dataset.dismissTransform && (a.style.transform = a.dataset.dismissTransform);
|
|
113
|
+
}, y = d(() => {
|
|
114
|
+
let a = 0;
|
|
115
|
+
if (r.value >= 0) {
|
|
116
|
+
const n = f * Math.min(v.value - 1 - r.value, o.value ? 1 : 2);
|
|
117
|
+
a = Math.min(h.value + n, document.body.parentElement.clientHeight);
|
|
118
|
+
}
|
|
119
|
+
return `${a}px`;
|
|
120
|
+
});
|
|
121
|
+
let p = null, g = null, i = 5e3;
|
|
122
|
+
const I = (a, n) => {
|
|
123
|
+
g = Date.now(), p = setTimeout(() => a.dismiss(), n);
|
|
124
|
+
}, A = (a) => {
|
|
125
|
+
clearTimeout(p), a ? (i = 5e3, o.value || I(a, i)) : i = 0;
|
|
126
|
+
};
|
|
127
|
+
k(
|
|
128
|
+
() => T.value[0],
|
|
129
|
+
(a, n) => {
|
|
130
|
+
(a == null ? void 0 : a.id) !== (n == null ? void 0 : n.id) && A(a);
|
|
131
|
+
},
|
|
132
|
+
{ immediate: !0 }
|
|
133
|
+
);
|
|
134
|
+
const C = () => {
|
|
135
|
+
i = i - Date.now() + g, clearTimeout(p);
|
|
136
|
+
}, x = () => {
|
|
137
|
+
i > 0 && I(T.value[0], i);
|
|
138
|
+
};
|
|
139
|
+
k(o, (a) => {
|
|
140
|
+
a ? C() : x();
|
|
141
|
+
});
|
|
142
|
+
const w = c();
|
|
143
|
+
return { __sfc: !0, TOAST_DISPLAY_DURATION: 5e3, renderToast: e, stack: s, hovered: o, toastsWithDimensions: u, collapsedToastHeight: _, stackIndicatorHeight: f, queueSize: v, lastVisibleToastIndex: r, lastVisibleToastBottom: h, queue: T, onBeforeToastLeave: b, stackHeight: y, dismissTimout: p, timeoutStart: g, remainingTimeToDismiss: i, startTimer: I, startNewDismissTimer: A, pauseDismissTimer: C, resumeDismissTimer: x, root: w, checkHover: () => setTimeout(() => {
|
|
144
|
+
o.value = o.value ? w.value.matches(":hover") : !1;
|
|
145
|
+
}), ToastShadowStack: K, ToastItem: H };
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
var Z = function() {
|
|
149
|
+
var t = this, e = t._self._c, s = t._self._setupProxy;
|
|
150
|
+
return s.renderToast ? e("div", { ref: "root", staticClass: "b-toast", style: { height: s.stackHeight }, attrs: { "data-testid": "toast" }, on: { mouseenter: function(o) {
|
|
151
|
+
s.hovered = !0;
|
|
152
|
+
}, mouseleave: function(o) {
|
|
153
|
+
s.hovered = !1;
|
|
154
|
+
} } }, [e(s.ToastShadowStack, { on: { update: function(o) {
|
|
155
|
+
s.toastsWithDimensions = o;
|
|
156
|
+
} } }), e("transition-group", { attrs: { name: "b-toast__queue", tag: "div", "aria-live": "polite", "enter-class": "b-toast__queue--enter", "leave-to-class": "b-toast__queue--leave-to" }, on: { "before-leave": s.onBeforeToastLeave, "after-leave": s.checkHover } }, t._l(s.queue, function(o) {
|
|
157
|
+
return e(s.ToastItem, t._b({ key: o.id, staticClass: "b-toast__item", class: { "b-toast__item--first": o.isFirst }, style: o.styles, attrs: { toast: o, inert: o.isInert, "data-testid": "toast-item" } }, "toast-item", { "data-dismiss-transform": o.dismissTransform }, !1));
|
|
158
|
+
}), 1)], 1) : t._e();
|
|
159
|
+
}, tt = [], st = /* @__PURE__ */ $(
|
|
160
|
+
Q,
|
|
161
|
+
Z,
|
|
162
|
+
tt,
|
|
163
|
+
!1,
|
|
164
|
+
null,
|
|
165
|
+
"9a3ea236"
|
|
166
|
+
);
|
|
167
|
+
const mt = st.exports;
|
|
168
|
+
export {
|
|
169
|
+
mt as t
|
|
170
|
+
};
|
|
171
|
+
//# sourceMappingURL=toast.B2u2W_TQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.B2u2W_TQ.js","sources":["../../src/components/toast/components/toast-item/toast-item.vue","../../src/components/toast/components/toast-shadow-stack/toast-shadow-stack.vue","../../src/components/toast/toast.vue"],"sourcesContent":["<template>\n <div class=\"b-toast-item\">\n <output class=\"b-toast-item__text\" role=\"status\">\n <bento-typography :title=\"toast.text\" el=\"span\" variant=\"body\" strongest>\n {{ toast.text }}\n </bento-typography>\n </output>\n <bento-button\n v-if=\"toast.action\"\n class=\"b-toast-item__btn\"\n variant=\"tertiary\"\n data-testid=\"toast-item-action-btn\"\n @click=\"onAction\"\n >\n {{ toast.action.text }}\n </bento-button>\n <bento-button\n class=\"b-toast-item__btn\"\n variant=\"tertiary\"\n data-testid=\"toast-item-close-btn\"\n @click=\"toast.dismiss()\"\n >\n <template #iconLeft>\n <cross-icon :svg-title=\"t('dismiss')\" />\n </template>\n </bento-button>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { PropType } from 'vue';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross-small';\n import { useI18n } from '@/utils/ts/i18n';\n import { BentoButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import type { BentoToastItem } from '@/composables';\n import messages from './messages.json';\n\n const props = defineProps({\n toast: { type: Object as PropType<BentoToastItem>, required: true },\n });\n\n type MessageSchema = (typeof messages)['en-US'];\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const onAction = () => {\n if (typeof props.toast.action.handler === 'function') {\n props.toast.action.handler();\n }\n props.toast.dismiss();\n };\n</script>\n\n<script lang=\"ts\">\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./toast-item.scss\" />\n","<template>\n <div ref=\"shadowStack\" class=\"b-toast-shadow-stack\">\n <!--\n since we only interested in the size of the last 3 toasts and order of the toast items\n is not guaranteed when we use ref with v-for (more info at the end of this section https://vuejs.org/guide/essentials/template-refs.html#refs-inside-v-for),\n toast items would be rendered independently with individual ref references.\n -->\n <toast-item v-if=\"toasts[0]\" ref=\"toast0\" :toast=\"toasts[0]\" />\n <toast-item v-if=\"toasts[1]\" ref=\"toast1\" :toast=\"toasts[1]\" />\n <toast-item v-if=\"toasts[2]\" ref=\"toast2\" :toast=\"toasts[2]\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n /**\n * This component will \"shadow-render\" ToastItems positioned relatively to each other,\n * would grab their positions and size and would emit augmented list of toasts with those\n * additional details. This would allow us to have perfect control over toasts positioning and animation\n * in the parent Toast component, where ToastItems would actually be visible.\n */\n import { computed, nextTick, onMounted, ref, watch } from 'vue';\n import { useBentoToastController } from '@/composables';\n import type { BentoToastItemWithDimensions } from './toast-shadow-stack.types';\n import ToastItem from '../toast-item/toast-item.vue';\n\n const { stack } = useBentoToastController();\n\n const emit = defineEmits([\"update\"]);\n\n const shadowStack = ref<HTMLElement>();\n const toast0 = ref<InstanceType<typeof ToastItem>>();\n const toast1 = ref<InstanceType<typeof ToastItem>>();\n const toast2 = ref<InstanceType<typeof ToastItem>>();\n const toastRefs = [toast0, toast1, toast2];\n\n // only get 3 last toast as only they would be rendered on the screen\n const toasts = computed(() => stack.value.slice(0, 3));\n\n const shareToastsWithDimensions = async () => {\n // Wait for all toasts to render, so we would be able to get their ClientRect\n await nextTick();\n\n // Parent container \"top\" value should be 0, but can be something else due to CSS. So have to account for it\n const { top: parentTop } = shadowStack.value.getBoundingClientRect();\n\n const toastsWithDimensions = stack.value.map((toast, index) => {\n if (index > 2) {\n return { ...toast, bottom: 0, height: 0 };\n }\n const { height, top } = toastRefs[index].value.$el.getBoundingClientRect();\n return { ...toast, height, bottom: top - parentTop };\n });\n emit('update', toastsWithDimensions);\n };\n\n watch(stack, shareToastsWithDimensions);\n\n onMounted(() => {\n // Refs would be null until component is mounted, so let's make sure we only do it after that\n if (stack.value.length > 0) {\n shareToastsWithDimensions();\n }\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./toast-shadow-stack.scss\" />\n","<template>\n <div\n v-if=\"renderToast\"\n ref=\"root\"\n class=\"b-toast\"\n data-testid=\"toast\"\n :style=\"{ height: stackHeight }\"\n @mouseenter=\"hovered = true\"\n @mouseleave=\"hovered = false\"\n >\n <toast-shadow-stack @update=\"toastsWithDimensions = $event\" />\n\n <transition-group\n name=\"b-toast__queue\"\n tag=\"div\"\n aria-live=\"polite\"\n enter-class=\"b-toast__queue--enter\"\n leave-to-class=\"b-toast__queue--leave-to\"\n @before-leave=\"onBeforeToastLeave\"\n @after-leave=\"checkHover\"\n >\n <toast-item\n v-for=\"toast in queue\"\n v-bind=\"{ 'data-dismiss-transform': toast.dismissTransform }\"\n :key=\"toast.id\"\n :toast=\"toast\"\n :style=\"toast.styles\"\n :class=\"{ 'b-toast__item--first': toast.isFirst }\"\n :inert=\"toast.isInert\"\n data-testid=\"toast-item\"\n class=\"b-toast__item\"\n />\n </transition-group>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref, watch } from 'vue';\n import { useBentoToastController } from '@/composables';\n import ToastShadowStack from './components/toast-shadow-stack/toast-shadow-stack.vue';\n import type { BentoToastItemWithDimensions } from './components/toast-shadow-stack/toast-shadow-stack.types';\n import ToastItem from './components/toast-item/toast-item.vue';\n\n // By design, top-most toast should be visible for 5 seconds before auto-dismiss\n const TOAST_DISPLAY_DURATION = 5000;\n\n // Delay first render of the toast until we actually need it, to skip all the positioning calculation logic\n // until we actually have anything to render.\n const renderToast = ref(false);\n const { stack } = useBentoToastController();\n\n watch(\n stack,\n toastStack => {\n if (toastStack.length > 0 && !renderToast.value) {\n renderToast.value = true;\n }\n },\n { immediate: true }\n );\n\n const hovered = ref(false);\n const toastsWithDimensions = ref<Array<BentoToastItemWithDimensions>>([]);\n // In collapsed mode we need for toast to \"stick out\", but not overflow another toast in the forefront.\n // Random number that satisfies this condition (single-line toast is roughly 52px height)\n const collapsedToastHeight = 40;\n // How much pixels of the stacked toast will be \"sticking out\" from the visible toast\n const stackIndicatorHeight = 10;\n\n const queueSize = computed(() => toastsWithDimensions.value.length);\n const lastVisibleToastIndex = computed(() => Math.min(hovered.value ? 2 : 0, queueSize.value - 1));\n const lastVisibleToastBottom = computed(() => {\n const toast = toastsWithDimensions.value[lastVisibleToastIndex.value];\n return toast ? toast.bottom + toast.height : 0;\n });\n\n const queue = computed(() => {\n const translateBaseValue = lastVisibleToastBottom.value - collapsedToastHeight;\n return toastsWithDimensions.value.map((toast, index) => {\n const collapsed = index > lastVisibleToastIndex.value;\n const isSmallerStack = !hovered.value && index > 1;\n const translateY = collapsed\n ? translateBaseValue + stackIndicatorHeight * (isSmallerStack ? 2 : 1)\n : toast.bottom;\n\n return {\n ...toast,\n styles: {\n height: `${collapsed ? collapsedToastHeight : toast.height}px`,\n transform: collapsed\n ? `translateY(${translateY * -1}px) scaleX(${isSmallerStack ? '0.8' : '0.9'})`\n : `translateY(${translateY * -1}px)`,\n 'z-index': queueSize.value - index,\n },\n // first toast has different animation, and toasts above index 2/3 are not visible so no need for a custom animation\n dismissTransform:\n index > 0 && index < (hovered.value ? 4 : 3)\n ? `translateY(${(translateY - toast.height) * -1}px) scale(0.5, 0.1)`\n : null,\n isFirst: index === 0,\n isInert: index > (hovered.value ? 2 : 0),\n };\n });\n });\n\n const onBeforeToastLeave = (el: HTMLElement) => {\n // We have to swap transformation on the toast element that is about to be removed\n // Unfortunately we cannot do it via transition classes as transformation function is\n // unique per toast, and we cannot use reactivity because it won't be applied for a toast\n // that is removed. So direct DOM manipulation is the only way it seems.\n if (el.dataset.dismissTransform) {\n /* eslint-disable no-param-reassign -- explicitly manipulating with DOM properties, no way around it unfortunately */\n el.style.transform = el.dataset.dismissTransform;\n }\n };\n\n const stackHeight = computed(() => {\n // Track stack container height, so that hover over would work without glitches\n // (when mouse is over space between toasts)\n let height = 0;\n if (lastVisibleToastIndex.value >= 0) {\n const stackIndicator =\n stackIndicatorHeight *\n Math.min(queueSize.value - 1 - lastVisibleToastIndex.value, hovered.value ? 1 : 2);\n height = Math.min(lastVisibleToastBottom.value + stackIndicator, document.body.parentElement.clientHeight);\n }\n return `${height}px`;\n });\n\n let dismissTimout = null;\n let timeoutStart = null;\n let remainingTimeToDismiss = TOAST_DISPLAY_DURATION;\n\n const startTimer = (toast, duration) => {\n timeoutStart = Date.now();\n dismissTimout = setTimeout(() => toast.dismiss(), duration);\n };\n\n const startNewDismissTimer = toast => {\n // stop previous timeouts, if any\n clearTimeout(dismissTimout);\n if (toast) {\n remainingTimeToDismiss = TOAST_DISPLAY_DURATION;\n if (!hovered.value) {\n startTimer(toast, remainingTimeToDismiss);\n }\n } else {\n remainingTimeToDismiss = 0;\n }\n };\n\n watch(\n () => queue.value[0],\n (firstToast, oldFirstToast) => {\n if (firstToast?.id === oldFirstToast?.id) {\n return;\n }\n startNewDismissTimer(firstToast);\n },\n { immediate: true }\n );\n\n const pauseDismissTimer = () => {\n remainingTimeToDismiss = remainingTimeToDismiss - Date.now() + timeoutStart;\n clearTimeout(dismissTimout);\n };\n\n const resumeDismissTimer = () => {\n if (remainingTimeToDismiss > 0) {\n startTimer(queue.value[0], remainingTimeToDismiss);\n }\n };\n\n watch(hovered, isHovered => {\n if (isHovered) {\n pauseDismissTimer();\n } else {\n resumeDismissTimer();\n }\n });\n\n const root = ref<HTMLElement>();\n // \"mouseleave\" event would be emitted for the root element when the mouse moves out of the root element,\n // but browser wouldn't emit this event when root element shrinks to the point when mouse is not over element anymore.\n // This can happen when user clicks on dismiss button the top-most toast and doesn't move the mouse during animation,\n // after which browser would think that root element is still hovered. This workaround addresses this particular issue.\n const checkHover = () =>\n setTimeout(() => {\n hovered.value = hovered.value ? root.value.matches(':hover') : false;\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./toast.scss\" />\n"],"names":["__default__","messages","t","useI18n","props","stack","useBentoToastController","shadowStack","ref","toast0","toast1","toast2","toastRefs","toasts","computed","shareToastsWithDimensions","nextTick","parentTop","toastsWithDimensions","toast","index","height","top","emit","watch","onMounted","renderToast","toastStack","hovered","collapsedToastHeight","stackIndicatorHeight","queueSize","lastVisibleToastIndex","lastVisibleToastBottom","queue","translateBaseValue","collapsed","isSmallerStack","translateY","onBeforeToastLeave","el","stackHeight","stackIndicator","dismissTimout","timeoutStart","remainingTimeToDismiss","startTimer","duration","startNewDismissTimer","firstToast","oldFirstToast","pauseDismissTimer","resumeDismissTimer","isHovered","root"],"mappings":";;;;;;;;;;;;;;;;;;;GAsDIA,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;iBAbA,EAAA,GAAAC,EAAA,IAAAC,EAAA;kDAEA,MAAA;AACI,MAAA,OAAAC,EAAA,MAAA,OAAA,WAAA,cACIA,EAAA,MAAA,OAAA,QAAA,GAEJA,EAAA,MAAA,QAAA;AAAA,IAAoB;;;;;;;;;;;;;;;;;;;;;;ACxBxB,UAAA,EAAA,OAAAC,EAAA,IAAAC,EAAA,GAIAC,IAAAC,EAAA,GACAC,IAAAD,EAAA,GACAE,IAAAF,EAAA,GACAG,IAAAH,EAAA,GACAI,IAAA,CAAAH,GAAAC,GAAAC,CAAA,GAGAE,IAAAC,EAAA,MAAAT,EAAA,MAAA,MAAA,GAAA,CAAA,CAAA,GAEAU,IAAA,YAAA;AAEI,YAAAC,EAAA;AAGA,YAAA,EAAA,KAAAC,EAAA,IAAAV,EAAA,MAAA,sBAAA,GAEAW,IAAAb,EAAA,MAAA,IAAA,CAAAc,GAAAC,MAAA;AACI,YAAAA,IAAA;AACI,iBAAA,EAAA,GAAAD,GAAA,QAAA,GAAA,QAAA,EAAA;AAEJ,cAAA,EAAA,QAAAE,GAAA,KAAAC,EAAA,IAAAV,EAAAQ,CAAA,EAAA,MAAA,IAAA,sBAAA;AACA,eAAA,EAAA,GAAAD,GAAA,QAAAE,GAAA,QAAAC,IAAAL,EAAA;AAAA,MAAmD,CAAA;AAEvD,MAAAM,EAAA,UAAAL,CAAA;AAAA,IAAmC;AAGvC,WAAAM,EAAAnB,GAAAU,CAAA,GAEAU,EAAA,MAAA;AAEI,MAAApB,EAAA,MAAA,SAAA,KACIU,EAAA;AAAA,IACJ,CAAA;;;;;;;;;;;;;;;;;ACbJ,UAAAW,IAAAlB,EAAA,EAAA,GACA,EAAA,OAAAH,EAAA,IAAAC,EAAA;AAEA,IAAAkB;AAAA,MAAAnB;AAAA,MACI,CAAAsB,MAAA;AAEI,QAAAA,EAAA,SAAA,KAAA,CAAAD,EAAA,UACIA,EAAA,QAAA;AAAA,MACJ;AAAA,MACJ,EAAA,WAAA,GAAA;AAAA,IACkB;AAGtB,UAAAE,IAAApB,EAAA,EAAA,GACAU,IAAAV,EAAA,CAAA,CAAA,GAGAqB,IAAA,IAEAC,IAAA,IAEAC,IAAAjB,EAAA,MAAAI,EAAA,MAAA,MAAA,GACAc,IAAAlB,EAAA,MAAA,KAAA,IAAAc,EAAA,QAAA,IAAA,GAAAG,EAAA,QAAA,CAAA,CAAA,GACAE,IAAAnB,EAAA,MAAA;AACI,YAAAK,IAAAD,EAAA,MAAAc,EAAA,KAAA;AACA,aAAAb,IAAAA,EAAA,SAAAA,EAAA,SAAA;AAAA,IAA6C,CAAA,GAGjDe,IAAApB,EAAA,MAAA;AACI,YAAAqB,IAAAF,EAAA,QAAAJ;AACA,aAAAX,EAAA,MAAA,IAAA,CAAAC,GAAAC,MAAA;AACI,cAAAgB,IAAAhB,IAAAY,EAAA,OACAK,IAAA,CAAAT,EAAA,SAAAR,IAAA,GACAkB,IAAAF,IAAAD,IAAAL,KAAAO,IAAA,IAAA,KAAAlB,EAAA;AAIA,eAAA;AAAA,UAAO,GAAAA;AAAA,UACA,QAAA;AAAA,YACK,QAAA,GAAAiB,IAAAP,IAAAV,EAAA,MAAA;AAAA,YACsD,WAAAiB,IAAA,cAAAE,IAAA,EAAA,cAAAD,IAAA,QAAA,KAAA,MAAA,cAAAC,IAAA,EAAA;AAAA,YAGvB,WAAAP,EAAA,QAAAX;AAAA,UACN;AAAA;AAAA,UACjC,kBAAAA,IAAA,KAAAA,KAAAQ,EAAA,QAAA,IAAA,KAAA,eAAAU,IAAAnB,EAAA,UAAA,EAAA,wBAAA;AAAA,UAKU,SAAAC,MAAA;AAAA,UACS,SAAAA,KAAAQ,EAAA,QAAA,IAAA;AAAA,QACmB;AAAA,MAC1C,CAAA;AAAA,IACH,CAAA,GAGLW,IAAA,CAAAC,MAAA;AAKI,MAAAA,EAAA,QAAA,qBAEIA,EAAA,MAAA,YAAAA,EAAA,QAAA;AAAA,IACJ,GAGJC,IAAA3B,EAAA,MAAA;AAGI,UAAAO,IAAA;AACA,UAAAW,EAAA,SAAA,GAAA;AACI,cAAAU,IAAAZ,IAAA,KAAA,IAAAC,EAAA,QAAA,IAAAC,EAAA,OAAAJ,EAAA,QAAA,IAAA,CAAA;AAGA,QAAAP,IAAA,KAAA,IAAAY,EAAA,QAAAS,GAAA,SAAA,KAAA,cAAA,YAAA;AAAA,MAAyG;AAE7G,aAAA,GAAArB,CAAA;AAAA,IAAgB,CAAA;AAGpB,QAAAsB,IAAA,MACAC,IAAA,MACAC,IAAA;AAEA,UAAAC,IAAA,CAAA3B,GAAA4B,MAAA;AACI,MAAAH,IAAA,KAAA,IAAA,GACAD,IAAA,WAAA,MAAAxB,EAAA,QAAA,GAAA4B,CAAA;AAAA,IAA0D,GAG9DC,IAAA,CAAA7B,MAAA;AAEI,mBAAAwB,CAAA,GACAxB,KACI0B,IAAA,KACAjB,EAAA,SACIkB,EAAA3B,GAAA0B,CAAA,KAGJA,IAAA;AAAA,IACJ;AAGJ,IAAArB;AAAA,MAAA,MAAAU,EAAA,MAAA,CAAA;AAAA,MACuB,CAAAe,GAAAC,MAAA;AAEf,SAAAD,KAAA,gBAAAA,EAAA,SAAAC,KAAA,gBAAAA,EAAA,OAGAF,EAAAC,CAAA;AAAA,MAA+B;AAAA,MACnC,EAAA,WAAA,GAAA;AAAA,IACkB;AAGtB,UAAAE,IAAA,MAAA;AACI,MAAAN,IAAAA,IAAA,KAAA,IAAA,IAAAD,GACA,aAAAD,CAAA;AAAA,IAA0B,GAG9BS,IAAA,MAAA;AACI,MAAAP,IAAA,KACIC,EAAAZ,EAAA,MAAA,CAAA,GAAAW,CAAA;AAAA,IACJ;AAGJ,IAAArB,EAAAI,GAAA,CAAAyB,MAAA;AACI,MAAAA,IACIF,EAAA,IAEAC,EAAA;AAAA,IACJ,CAAA;AAGJ,UAAAE,IAAA9C,EAAA;kcAKA,MAAA,WAAA,MAAA;AAEQ,MAAAoB,EAAA,QAAAA,EAAA,QAAA0B,EAAA,MAAA,QAAA,QAAA,IAAA;AAAA,IAA+D,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { defineComponent as u, computed as d, useSlots as c } from "vue";
|
|
2
|
+
import { B as a } from "./button.BuD-IsW5.js";
|
|
3
|
+
import "./index.Cl4_42j5.js";
|
|
4
|
+
import { n as p } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
5
|
+
import "../assets/toggle-button.css";
|
|
6
|
+
const g = {}, f = /* @__PURE__ */ u({
|
|
7
|
+
...g,
|
|
8
|
+
__name: "toggle-button",
|
|
9
|
+
props: {
|
|
10
|
+
/**
|
|
11
|
+
* Reduces sizing of button
|
|
12
|
+
*/
|
|
13
|
+
condensed: {
|
|
14
|
+
type: a.props.condensed.type,
|
|
15
|
+
default: !1
|
|
16
|
+
},
|
|
17
|
+
/**
|
|
18
|
+
* Disables button functonality
|
|
19
|
+
*/
|
|
20
|
+
disabled: {
|
|
21
|
+
type: a.props.disabled.type,
|
|
22
|
+
default: !1
|
|
23
|
+
},
|
|
24
|
+
/**
|
|
25
|
+
* Sets color set to inverse
|
|
26
|
+
*/
|
|
27
|
+
inverse: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: !1
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* Types of flavour of Button
|
|
33
|
+
* @values primary, secondary, tertiary
|
|
34
|
+
*/
|
|
35
|
+
variant: {
|
|
36
|
+
type: a.props.variant.type,
|
|
37
|
+
default: "primary",
|
|
38
|
+
validator: a.props.variant.validator
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* The state of the button whether it is toggled or not.
|
|
42
|
+
*/
|
|
43
|
+
toggled: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: !1
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
emits: ["click", "update:toggled"],
|
|
49
|
+
setup(r, { emit: t }) {
|
|
50
|
+
const e = r, o = d(
|
|
51
|
+
() => e.variant === "tertiary" ? "tertiary-with-background" : e.variant
|
|
52
|
+
), s = d(() => ({
|
|
53
|
+
"b-toggle-button--condensed": e == null ? void 0 : e.condensed,
|
|
54
|
+
[`b-toggle-button--${o.value}-toggled`]: e.toggled,
|
|
55
|
+
"b-toggle-button--inverse": e.inverse
|
|
56
|
+
})), n = (l) => {
|
|
57
|
+
l.stopPropagation(), e != null && e.disabled || (t("click", l), t("update:toggled", !e.toggled));
|
|
58
|
+
}, i = c();
|
|
59
|
+
return { __sfc: !0, props: e, emit: t, computedVariant: o, conditionalClasses: s, onClick: n, slots: i, getSlotKeyIfVue3: (l) => ({}), BentoButton: a };
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
var _ = function() {
|
|
63
|
+
var t = this, e = t._self._c, o = t._self._setupProxy;
|
|
64
|
+
return e(o.BentoButton, t._b({ staticClass: "b-toggle-button", class: o.conditionalClasses, attrs: { "aria-expanded": `${t.toggled}`, "aria-pressed": `${t.toggled}`, condensed: t.condensed, disabled: t.disabled, inverse: t.inverse, variant: o.computedVariant }, on: { "!click": function(s) {
|
|
65
|
+
return s.stopPropagation(), o.onClick.apply(null, arguments);
|
|
66
|
+
} }, scopedSlots: t._u([t._l(o.slots, function(s, n) {
|
|
67
|
+
return { key: n, fn: function() {
|
|
68
|
+
return [t._t(n, null, null, o.getSlotKeyIfVue3(n))];
|
|
69
|
+
}, proxy: !0 };
|
|
70
|
+
})], null, !0) }, "bento-button", t.$attrs, !1));
|
|
71
|
+
}, m = [], b = /* @__PURE__ */ p(
|
|
72
|
+
f,
|
|
73
|
+
_,
|
|
74
|
+
m,
|
|
75
|
+
!1,
|
|
76
|
+
null,
|
|
77
|
+
"3282eb05"
|
|
78
|
+
);
|
|
79
|
+
const x = b.exports;
|
|
80
|
+
export {
|
|
81
|
+
x as B
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=toggle-button.ChDbeBZ8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-button.ChDbeBZ8.js","sources":["../../src/components/button/components/toggle-button/toggle-button.vue"],"sourcesContent":["<template>\n <bento-button\n class=\"b-toggle-button\"\n v-bind=\"$attrs\"\n :aria-expanded=\"`${toggled}`\"\n :aria-pressed=\"`${toggled}`\"\n :condensed=\"condensed\"\n :class=\"conditionalClasses\"\n :disabled=\"disabled\"\n :inverse=\"inverse\"\n :variant=\"computedVariant\"\n @click.capture.stop=\"onClick\"\n >\n <template v-for=\"(_, innerSlot) of slots\" #[innerSlot]>\n <slot :name=\"innerSlot\" v-bind=\"getSlotKeyIfVue3(innerSlot)\" />\n </template>\n </bento-button>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, useSlots } from 'vue';\n import BentoButton from '@/components/button/button.vue';\n import { BentoButtonVariant } from '@/core/components/button/button.types';\n import { isVue3 } from 'vue-demi';\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 * 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 * Types of flavour of Button\n * @values primary, secondary, tertiary\n */\n variant: {\n type: BentoButton.props.variant.type,\n default: 'primary',\n validator: BentoButton.props.variant.validator,\n },\n\n /**\n * The state of the button whether it is toggled or not.\n */\n toggled: {\n type: Boolean,\n default: false,\n },\n });\n\n const emit = defineEmits([\"click\", \"update:toggled\"]);\n\n const computedVariant = computed(\n () => (props.variant === 'tertiary' ? 'tertiary-with-background' : props.variant) as BentoButtonVariant\n );\n\n const conditionalClasses = computed(() => ({\n [`b-toggle-button--condensed`]: props?.condensed,\n [`b-toggle-button--${computedVariant.value}-toggled`]: props.toggled,\n [`b-toggle-button--inverse`]: props.inverse,\n }));\n\n const onClick = (e: MouseEvent) => {\n // Prevent Vue3 from triggering event twice\n e.stopPropagation();\n if (!props?.disabled) {\n emit('click', e);\n emit('update:toggled', !props.toggled);\n }\n };\n\n const slots = useSlots();\n // If we don't provide a key to `slot` in vue 3, we will get type errors\n const getSlotKeyIfVue3 = (slotName: string | number) => (isVue3 ? { key: slotName } : {});\n</script>\n\n<script lang=\"ts\">\n /**\n * Toggle button is used to switch between two states (example: menu shown, menu hidden).\n * It functions as a regular button but retains its state to indicate whether the associated menu or element is active or inactive.\n *\n * @example\n * import { BentoToggleButton } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoToggleButton },\n * template: `\n * <bento-toggle-button state=\"toggled\" variant=\"secondary\">\n * Button that can be toggled\n * </bento-toggle-button>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./toggle-button.scss\" />\n"],"names":["__default__","computedVariant","computed","props","conditionalClasses","onClick","e","emit","slots","useSlots","slotName"],"mappings":";;;;;AAgHI,MAAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAzCAC,IAAAC;AAAA,MAAwB,MAAAC,EAAA,YAAA,aAAA,6BAAAA,EAAA;AAAA,IACqD,GAG7EC,IAAAF,EAAA,OAAA;AAAA,MAA2C,8BAAAC,KAAA,gBAAAA,EAAA;AAAA,MACA,CAAA,oBAAAF,EAAA,KAAA,UAAA,GAAAE,EAAA;AAAA,MACsB,4BAAAA,EAAA;AAAA,IACzB,EAAA,GAGxCE,IAAA,CAAAC,MAAA;AAEI,MAAAA,EAAA,gBAAA,GACAH,KAAA,QAAAA,EAAA,aACII,EAAA,SAAAD,CAAA,GACAC,EAAA,kBAAA,CAAAJ,EAAA,OAAA;AAAA,IACJ,GAGJK,IAAAC,EAAA;8HAEA,CAAAC,OAAA,CAAA;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { defineComponent as k, ref as p, computed as u, toRefs as I, watch as A } from "vue";
|
|
2
|
+
import { C as B } from "./checkmark-small.C8T8ISN6.js";
|
|
3
|
+
import { B as L } from "./typography.J1v_SPG3.js";
|
|
4
|
+
import { g as E } from "./generate-uid.NJ8tVoha.js";
|
|
5
|
+
import { u as F } from "./use-default-slot-validator.BDn0wkYP.js";
|
|
6
|
+
import { u as R } from "./use-has-slot.C9lQZ6nz.js";
|
|
7
|
+
import { g } from "./get-slot-text.BQS5Olxm.js";
|
|
8
|
+
import { u as x } from "./aria-label.CaUURpnB.js";
|
|
9
|
+
import { n as T } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
10
|
+
import "../assets/toggle.css";
|
|
11
|
+
var f = /* @__PURE__ */ ((t) => (t.LABEL_FIRST = "label-first", t))(f || {}), d = /* @__PURE__ */ ((t) => (t.BEFORE = "before", t.AFTER = "after", t))(d || {});
|
|
12
|
+
const D = k({
|
|
13
|
+
name: "bento-toggle",
|
|
14
|
+
components: { BentoTypography: L, CheckmarkSmall: B },
|
|
15
|
+
props: {
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated from version 2.0.0. Use the aria-label attribute instead.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Accessible name for the toggle. It is strongly recommended to pass such value when the toggle is used without a label
|
|
21
|
+
*/
|
|
22
|
+
ariaLabel: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: void 0
|
|
25
|
+
},
|
|
26
|
+
/**
|
|
27
|
+
* Disable the toggle (optional)
|
|
28
|
+
*/
|
|
29
|
+
disabled: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: !1
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* Position of the label relative to the toggle (optional)
|
|
35
|
+
* @values before, after
|
|
36
|
+
*/
|
|
37
|
+
labelPosition: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: d.BEFORE,
|
|
40
|
+
validator: (t) => Object.values(d).includes(t)
|
|
41
|
+
},
|
|
42
|
+
/**
|
|
43
|
+
* Setting this property to true will set the toggle to read only state.
|
|
44
|
+
*/
|
|
45
|
+
readonly: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: !1
|
|
48
|
+
},
|
|
49
|
+
/**
|
|
50
|
+
* Indicates if the switch is "on" or "off"
|
|
51
|
+
*/
|
|
52
|
+
value: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: !1
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
emits: ["input"],
|
|
58
|
+
setup(t, { attrs: e, slots: a, emit: n }) {
|
|
59
|
+
const l = R(a), r = p(t.value), i = E("toggle-description"), c = g(a)("default"), o = g(a)("description");
|
|
60
|
+
F("bento-toggle", a.default, a.description);
|
|
61
|
+
const b = u(() => l("default") ? g(a)("default") : null), m = p(e["aria-label"]), { ariaLabel: _ } = I(t), y = x({
|
|
62
|
+
ariaLabel: m.value,
|
|
63
|
+
// TODO: take this line away when the aria-label props is removed
|
|
64
|
+
label: _,
|
|
65
|
+
defaultFallback: b
|
|
66
|
+
}), h = u(() => i ?? null), v = u(() => ({
|
|
67
|
+
[`b-toggle--${f.LABEL_FIRST}`]: t.labelPosition === d.BEFORE,
|
|
68
|
+
"b-toggle--disabled": t.disabled,
|
|
69
|
+
"b-toggle--readonly": t.readonly
|
|
70
|
+
})), C = (s) => {
|
|
71
|
+
n("input", s.target.checked);
|
|
72
|
+
}, S = (s) => {
|
|
73
|
+
t.readonly && s.preventDefault();
|
|
74
|
+
};
|
|
75
|
+
return A(
|
|
76
|
+
() => t.value,
|
|
77
|
+
(s) => {
|
|
78
|
+
r.value = s;
|
|
79
|
+
}
|
|
80
|
+
), {
|
|
81
|
+
// Refs
|
|
82
|
+
toggleInput: r,
|
|
83
|
+
// Values
|
|
84
|
+
computedAriaLabel: y,
|
|
85
|
+
computedDescription: h,
|
|
86
|
+
defaultSlotValue: c,
|
|
87
|
+
descriptionSlotValue: o,
|
|
88
|
+
conditionalClasses: v,
|
|
89
|
+
descriptionId: i,
|
|
90
|
+
// Method
|
|
91
|
+
hasSlot: l,
|
|
92
|
+
onChange: C,
|
|
93
|
+
onClick: S
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
var O = function() {
|
|
98
|
+
var e = this, a = e._self._c;
|
|
99
|
+
return e._self._setupProxy, a("label", { staticClass: "b-toggle", class: e.conditionalClasses, attrs: { "data-testid": "label" } }, [a("input", { directives: [{ name: "model", rawName: "v-model", value: e.toggleInput, expression: "toggleInput" }], staticClass: "b-toggle__input", attrs: { "aria-label": e.computedAriaLabel, "aria-describedby": e.computedDescription, disabled: e.disabled, "aria-readonly": e.readonly, role: "switch", type: "checkbox" }, domProps: { checked: Array.isArray(e.toggleInput) ? e._i(e.toggleInput, null) > -1 : e.toggleInput }, on: { change: [function(n) {
|
|
100
|
+
var l = e.toggleInput, r = n.target, i = !!r.checked;
|
|
101
|
+
if (Array.isArray(l)) {
|
|
102
|
+
var c = null, o = e._i(l, c);
|
|
103
|
+
r.checked ? o < 0 && (e.toggleInput = l.concat([c])) : o > -1 && (e.toggleInput = l.slice(0, o).concat(l.slice(o + 1)));
|
|
104
|
+
} else
|
|
105
|
+
e.toggleInput = i;
|
|
106
|
+
}, (n) => e.onChange(n)], click: e.onClick } }), a("span", { staticClass: "b-toggle__track", attrs: { "aria-hidden": "true" } }, [a("span", { staticClass: "b-toggle__handle" }, [e.toggleInput ? a("checkmark-small") : e._e()], 1)]), e.hasSlot("default") ? a("span", { staticClass: "b-toggle__label-container" }, [e.hasSlot("default") ? a("bento-typography", { attrs: { el: "span", variant: "body", "data-testid": "inner-label" } }, [e._t("default")], 2) : e._e(), e.hasSlot("default") && e.hasSlot("description") ? a("bento-typography", { staticClass: "b-toggle__description", attrs: { id: e.descriptionId, el: "span", variant: "body" } }, [e._t("description")], 2) : e._e()], 1) : e._e()]);
|
|
107
|
+
}, w = [], P = /* @__PURE__ */ T(
|
|
108
|
+
D,
|
|
109
|
+
O,
|
|
110
|
+
w,
|
|
111
|
+
!1,
|
|
112
|
+
null,
|
|
113
|
+
"c80e6c06"
|
|
114
|
+
);
|
|
115
|
+
const K = P.exports;
|
|
116
|
+
export {
|
|
117
|
+
K as B,
|
|
118
|
+
f as a,
|
|
119
|
+
d as b
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=toggle.Q52IIKfi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.Q52IIKfi.js","sources":["../../src/components/toggle/toggle.types.ts","../../src/components/toggle/toggle.vue"],"sourcesContent":["export enum BentoTogglePropClass {\n LABEL_FIRST = 'label-first',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoToggleLabelPosition {\n BEFORE = 'before',\n AFTER = 'after',\n}\n","<template>\n <label class=\"b-toggle\" :class=\"conditionalClasses\" data-testid=\"label\">\n <input\n v-model=\"toggleInput\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"computedDescription\"\n :disabled=\"disabled\"\n :aria-readonly=\"readonly\"\n role=\"switch\"\n class=\"b-toggle__input\"\n type=\"checkbox\"\n @change=\"$event => onChange($event)\"\n @click=\"onClick\"\n />\n <span class=\"b-toggle__track\" aria-hidden=\"true\">\n <span class=\"b-toggle__handle\">\n <checkmark-small v-if=\"toggleInput\" />\n </span>\n </span>\n <span v-if=\"hasSlot('default')\" class=\"b-toggle__label-container\">\n <bento-typography v-if=\"hasSlot('default')\" el=\"span\" variant=\"body\" data-testid=\"inner-label\">\n <slot></slot>\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('default') && hasSlot('description')\"\n :id=\"descriptionId\"\n el=\"span\"\n variant=\"body\"\n class=\"b-toggle__description\"\n >\n <slot name=\"description\" />\n </bento-typography>\n </span>\n </label>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref, toRefs, watch } from 'vue';\n import CheckmarkSmall from '@adyen/ui-assets-icons-16/vue/checkmark-small';\n import { BentoToggleLabelPosition, BentoTogglePropClass } from './toggle.types';\n import { BentoTypography } from '@/components/typography';\n import { generateUid } from '@/core/utils/ts';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { getSlotText } from '@/utils/ts/get-slot-text/get-slot-text';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n\n /**\n * A wrapper around the bento toggle, providing checkbox functionality with a knob-like toggle\n *\n * @usage\n * import { BentoToggle, BentoLabelPosition } from '@adyen/adl-vue2';\n *\n * export default {\n * components: { BentoToggle },\n * template: `\n * <bento-toggle\n * :value=\"toggleValue\"`\n * label-position=\"LabelPosition.BEFORE\"\n * @input=\"optionalHandler($event)\"\n * >\n * Label Text\n * </bento-toggle>\n * `,\n * }\n */\n export default defineComponent({\n name: 'bento-toggle',\n components: { BentoTypography, CheckmarkSmall },\n props: {\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Accessible name for the toggle. It is strongly recommended to pass such value when the toggle is used without a label\n */\n ariaLabel: {\n type: String,\n default: undefined,\n },\n /**\n * Disable the toggle (optional)\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Position of the label relative to the toggle (optional)\n * @values before, after\n */\n labelPosition: {\n type: String as PropType<BentoToggleLabelPosition | `${BentoToggleLabelPosition}`>,\n default: BentoToggleLabelPosition.BEFORE,\n validator: (value: BentoToggleLabelPosition) => Object.values(BentoToggleLabelPosition).includes(value),\n },\n /**\n * Setting this property to true will set the toggle to read only state.\n */\n readonly: {\n type: Boolean,\n default: false,\n },\n /**\n * Indicates if the switch is \"on\" or \"off\"\n */\n value: {\n type: Boolean,\n default: false,\n },\n },\n emits: ['input'],\n setup(props, { attrs, slots, emit }) {\n const hasSlot = useHasSlot(slots);\n\n const toggleInput = ref(props.value);\n const descriptionId: string = generateUid('toggle-description');\n\n const defaultSlotValue = getSlotText(slots)('default');\n const descriptionSlotValue = getSlotText(slots)('description');\n\n useDefaultSlotValidator('bento-toggle', slots.default, slots.description);\n\n const labelSlot = computed((): string => (hasSlot('default') ? getSlotText(slots)('default') : null));\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: labelSlot,\n });\n\n const computedDescription = computed((): string | null => descriptionId ?? null);\n\n const conditionalClasses = computed((): { [key: string]: boolean } => ({\n [`b-toggle--${BentoTogglePropClass.LABEL_FIRST}`]:\n props.labelPosition === BentoToggleLabelPosition.BEFORE,\n 'b-toggle--disabled': props.disabled,\n 'b-toggle--readonly': props.readonly,\n }));\n\n const onChange = (event: Event) => {\n emit('input', (event.target as HTMLInputElement).checked);\n };\n\n // readonly attr doesn't work with checkbox, so we need to manually ignore the click instead\n const onClick = (event: Event) => {\n if (props.readonly) {\n event.preventDefault();\n }\n };\n\n watch(\n () => props.value,\n newValue => {\n toggleInput.value = newValue;\n }\n );\n\n return {\n // Refs\n toggleInput,\n\n // Values\n computedAriaLabel,\n computedDescription,\n defaultSlotValue,\n descriptionSlotValue,\n conditionalClasses,\n descriptionId,\n\n // Method\n hasSlot,\n onChange,\n onClick,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./toggle.scss\" />\n"],"names":["BentoTogglePropClass","BentoTogglePropClass2","BentoToggleLabelPosition","BentoToggleLabelPosition2","_sfc_main","defineComponent","BentoTypography","CheckmarkSmallIcon","value","props","attrs","slots","emit","hasSlot","useHasSlot","toggleInput","ref","descriptionId","generateUid","defaultSlotValue","getSlotText","descriptionSlotValue","useDefaultSlotValidator","labelSlot","computed","ariaLabelAttribute","ariaLabel","toRefs","computedAriaLabel","useAriaLabel","computedDescription","conditionalClasses","onChange","event","onClick","watch","newValue"],"mappings":";;;;;;;;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,cAAA,eADQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,SAAA,UACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;AC0DZ,MAAAE,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA,EAAA,iBAAAC,GAAA,gBAAAC,EAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IACA,WAAA;AAAA,MAOA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,UAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IACA,eAAA;AAAA,MAKA,MAAA;AAAA,MACA,SAAAL,EAAA;AAAA,MACA,WAAA,CAAAM,MAAA,OAAA,OAAAN,CAAA,EAAA,SAAAM,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,UAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,OAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,OAAA,CAAA,OAAA;AAAA,EACA,MAAAC,GAAA,EAAA,OAAAC,GAAA,OAAAC,GAAA,MAAAC,EAAA,GAAA;AAEA,UAAAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAAP,EAAA,KAAA,GACAQ,IAAAC,EAAA,oBAAA,GAEAC,IAAAC,EAAAT,CAAA,EAAA,SAAA,GACAU,IAAAD,EAAAT,CAAA,EAAA,aAAA;AAEA,IAAAW,EAAA,gBAAAX,EAAA,SAAAA,EAAA,WAAA;AAEA,UAAAY,IAAAC,EAAA,MAAAX,EAAA,SAAA,IAAAO,EAAAT,CAAA,EAAA,SAAA,IAAA,IAAA,GAEAc,IAAAT,EAAAN,EAAA,YAAA,CAAA,GACA,EAAA,WAAAgB,EAAA,IAAAC,EAAAlB,CAAA,GACAmB,IAAAC,EAAA;AAAA,MAAA,WAAAJ,EAAA;AAAA;AAAA,MACA,OAAAC;AAAA,MAEA,iBAAAH;AAAA,IACA,CAAA,GAGAO,IAAAN,EAAA,MAAAP,KAAA,IAAA,GAEAc,IAAAP,EAAA,OAAA;AAAA,MAAA,CAAA,aAAAxB,EAAA,WAAA,EAAA,GAAAS,EAAA,kBAAAP,EAAA;AAAA,MAEA,sBAAAO,EAAA;AAAA,MACA,sBAAAA,EAAA;AAAA,IACA,EAAA,GAGAuB,IAAA,CAAAC,MAAA;AACA,MAAArB,EAAA,SAAAqB,EAAA,OAAA,OAAA;AAAA,IAAA,GAIAC,IAAA,CAAAD,MAAA;AACA,MAAAxB,EAAA,YACAwB,EAAA,eAAA;AAAA,IACA;AAGA,WAAAE;AAAA,MAAA,MAAA1B,EAAA;AAAA,MACA,CAAA2B,MAAA;AAEA,QAAArB,EAAA,QAAAqB;AAAA,MAAA;AAAA,IACA,GAGA;AAAA;AAAA,MAAA,aAAArB;AAAA;AAAA,MAEA,mBAAAa;AAAA,MAGA,qBAAAE;AAAA,MACA,kBAAAX;AAAA,MACA,sBAAAE;AAAA,MACA,oBAAAU;AAAA,MACA,eAAAd;AAAA;AAAA,MACA,SAAAJ;AAAA,MAGA,UAAAmB;AAAA,MACA,SAAAE;AAAA,IACA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { defineComponent as A, computed as S, reactive as y, nextTick as O } from "vue";
|
|
2
|
+
import { l as a } from "./events.CMzGybJJ.js";
|
|
3
|
+
import { g as C } from "./generate-uid.NJ8tVoha.js";
|
|
4
|
+
import { a as R, P as D, c as B } from "./popper-container.DIFqmRsp.js";
|
|
5
|
+
import { V as N } from "./index.Cl4_42j5.js";
|
|
6
|
+
import { B as $ } from "./typography.J1v_SPG3.js";
|
|
7
|
+
import { n as k } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
8
|
+
import "../assets/tooltip.css";
|
|
9
|
+
const p = { ...R };
|
|
10
|
+
var _ = /* @__PURE__ */ ((t) => (t.HIDDEN = "hidden", t))(_ || {}), T = /* @__PURE__ */ ((t) => (t.ESCAPE = "Escape", t.ENTER = "Enter", t.ARROW_LEFT = "ArrowLeft", t.ARROW_UP = "ArrowUp", t.ARROW_RIGHT = "ArrowRight", t.ARROW_DOWN = "ArrowDown", t.PAGE_UP = "PageUp", t.PAGE_DOWN = "PageDown", t.END = "End", t.HOME = "Home", t))(T || {});
|
|
11
|
+
const I = A({
|
|
12
|
+
name: "tooltip",
|
|
13
|
+
components: { BentoTypography: $, PopperContainer: D },
|
|
14
|
+
props: {
|
|
15
|
+
/**
|
|
16
|
+
* The tooltip's id. Necessary for accessibility purposes.
|
|
17
|
+
*/
|
|
18
|
+
id: { type: String, default: null },
|
|
19
|
+
/**
|
|
20
|
+
* Tooltip's target reference to the DOM element or Vue component.
|
|
21
|
+
* The tooltip will position itself relatively to target element, in the specified position.
|
|
22
|
+
*/
|
|
23
|
+
targetElement: { type: [Element, Object], required: !0 },
|
|
24
|
+
/**
|
|
25
|
+
* Tooltip's position relative to the target element.
|
|
26
|
+
* Possible values are: 'top', 'bottom', 'left' and 'right'.
|
|
27
|
+
*/
|
|
28
|
+
position: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: p.TOP,
|
|
31
|
+
validator: (t) => Object.values(p).includes(t)
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* Tooltip's offset.
|
|
35
|
+
* If specified, the tooltip will have an offset in pixels between it and the target element
|
|
36
|
+
* in specified position.
|
|
37
|
+
*/
|
|
38
|
+
offset: { type: Number, default: 0 },
|
|
39
|
+
/**
|
|
40
|
+
* Tooltip's text content.
|
|
41
|
+
*/
|
|
42
|
+
content: { type: String, required: !0 },
|
|
43
|
+
/**
|
|
44
|
+
* Shows / Hides the Tooltip component
|
|
45
|
+
*/
|
|
46
|
+
isShown: { type: Boolean, default: !1 },
|
|
47
|
+
/**
|
|
48
|
+
* Allows to configure to fallback position to the one specified, it could be 'auto' or ['right', 'top', ...].
|
|
49
|
+
* Useful when not using auto as starting placement.
|
|
50
|
+
* @see {@link https://floating-ui.com/docs/flip#fallbackplacements}
|
|
51
|
+
*/
|
|
52
|
+
fallbackPosition: {
|
|
53
|
+
type: [Array, String],
|
|
54
|
+
default: () => ["top", "bottom", "right", "left"]
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* Disables focus-trap for tooltip.
|
|
58
|
+
* Useful for maintaining focus on the target element.
|
|
59
|
+
*/
|
|
60
|
+
disabledFocusTrap: { type: Boolean, default: !1 }
|
|
61
|
+
},
|
|
62
|
+
setup(t) {
|
|
63
|
+
const o = S(() => ({
|
|
64
|
+
[`b-tooltip--${_.HIDDEN}`]: !t.isShown
|
|
65
|
+
}));
|
|
66
|
+
return {
|
|
67
|
+
// Enums
|
|
68
|
+
PopperContainerAriaRole: B,
|
|
69
|
+
// Values
|
|
70
|
+
conditionalClasses: o
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
var x = function() {
|
|
75
|
+
var o = this, e = o._self._c;
|
|
76
|
+
return o._self._setupProxy, e("popper-container", { staticClass: "b-tooltip", class: o.conditionalClasses, attrs: { id: o.id, "aria-role": o.PopperContainerAriaRole.TOOLTIP, arrow: { classes: ["b-tooltip__arrow"] }, "fallback-position": o.fallbackPosition, "is-hidden": !o.isShown, offset: [0, 4], position: o.position, "target-element": o.targetElement, "disabled-focus-trap": o.disabledFocusTrap } }, [e("bento-typography", { attrs: { el: "span", variant: "caption" } }, [o._v(" " + o._s(o.content) + " ")])], 1);
|
|
77
|
+
}, U = [], W = /* @__PURE__ */ k(
|
|
78
|
+
I,
|
|
79
|
+
x,
|
|
80
|
+
U,
|
|
81
|
+
!1,
|
|
82
|
+
null,
|
|
83
|
+
"cca09a35"
|
|
84
|
+
);
|
|
85
|
+
const q = W.exports, s = [], b = "aria-describedby", m = C("tooltip");
|
|
86
|
+
let n, u = !1;
|
|
87
|
+
const r = y({
|
|
88
|
+
targetElement: null,
|
|
89
|
+
content: "START_MESSAGE",
|
|
90
|
+
id: m,
|
|
91
|
+
position: void 0,
|
|
92
|
+
isShown: !1
|
|
93
|
+
}), F = (t) => {
|
|
94
|
+
t.setAttribute("tabindex", "0");
|
|
95
|
+
{
|
|
96
|
+
const o = N.extend(q);
|
|
97
|
+
n = new o({ propsData: { targetElement: t, content: "", id: m } }).$mount(), document.body.appendChild(n.$el);
|
|
98
|
+
}
|
|
99
|
+
}, H = () => {
|
|
100
|
+
document.contains(n.$el) && document.body.removeChild(n.$el), n.$destroy(), n = void 0;
|
|
101
|
+
}, v = (t) => Object.values(p).includes(t.arg) ? t.arg : p.TOP, h = (t) => s.find(
|
|
102
|
+
(o) => (
|
|
103
|
+
// isEqualNode doesn't work correct for svg element, hence the second check here
|
|
104
|
+
o.target.isEqualNode(t) && o.target === t
|
|
105
|
+
)
|
|
106
|
+
), L = (t) => {
|
|
107
|
+
const o = h(t);
|
|
108
|
+
if (!o.content || !t)
|
|
109
|
+
return;
|
|
110
|
+
t && t.setAttribute(b, m);
|
|
111
|
+
let e = !1;
|
|
112
|
+
document.querySelectorAll("dialog").forEach((i) => {
|
|
113
|
+
e = (i == null ? void 0 : i.open) || e;
|
|
114
|
+
}), e && (t.after(n.$el), e = !1), u = !0, n.content = o.content, n.position = o.position, r.content = o.content, r.position = o.position, O(() => {
|
|
115
|
+
u && (n.targetElement = t, n.isShown = !0, r.targetElement = t, r.isShown = !0);
|
|
116
|
+
});
|
|
117
|
+
}, P = (t) => {
|
|
118
|
+
var o, e, i, l;
|
|
119
|
+
(e = (o = n.$el) == null ? void 0 : o.parentElement) != null && e.tagName && ((l = (i = n.$el) == null ? void 0 : i.parentElement) == null ? void 0 : l.tagName) !== "BODY" && document.body.appendChild(n.$el), u = !1, n.isShown = !1, r.isShown = !1, t && t.removeAttribute(b);
|
|
120
|
+
}, d = (t, o) => {
|
|
121
|
+
if (!o.hasOwnProperty("value") || o.value) {
|
|
122
|
+
s.length === 0 && F(t);
|
|
123
|
+
const e = () => L(t), i = () => P(t), l = {
|
|
124
|
+
target: t,
|
|
125
|
+
content: o.value,
|
|
126
|
+
position: v(o),
|
|
127
|
+
removeListeners: [
|
|
128
|
+
a(t, "mouseenter", e),
|
|
129
|
+
a(t, "mouseleave", i),
|
|
130
|
+
a(t, "focus", () => {
|
|
131
|
+
t.matches(":focus-visible") && e();
|
|
132
|
+
}),
|
|
133
|
+
a(t, "blur", (c) => {
|
|
134
|
+
var E;
|
|
135
|
+
((E = c.relatedTarget) == null ? void 0 : E.getAttribute("role")) !== "tooltip" && i();
|
|
136
|
+
}),
|
|
137
|
+
a(t, "keydown", (c) => {
|
|
138
|
+
c.key === T.ESCAPE && i();
|
|
139
|
+
})
|
|
140
|
+
]
|
|
141
|
+
};
|
|
142
|
+
s.push(l);
|
|
143
|
+
}
|
|
144
|
+
}, f = (t, o) => {
|
|
145
|
+
const e = h(t);
|
|
146
|
+
if (e) {
|
|
147
|
+
if ((e == null ? void 0 : e.content) !== o.value && (e.content = o.value, n.isShown && n.targetElement.isEqualNode(t) && (e.content ? n.content = o.value : n.isShown = !1)), e.position !== o.arg) {
|
|
148
|
+
const i = v(o);
|
|
149
|
+
e.position = i, n.position = i;
|
|
150
|
+
}
|
|
151
|
+
} else !e && o.value && d(t, o);
|
|
152
|
+
}, g = (t) => {
|
|
153
|
+
const o = h(t);
|
|
154
|
+
o && (o.removeListeners.forEach((e) => {
|
|
155
|
+
e();
|
|
156
|
+
}), P(), s.splice(s.indexOf(o), 1), s.length === 0 && H());
|
|
157
|
+
}, Q = {
|
|
158
|
+
// Vue 2 Directive hooks
|
|
159
|
+
bind(t, o) {
|
|
160
|
+
d(t, o);
|
|
161
|
+
},
|
|
162
|
+
update(t, o) {
|
|
163
|
+
f(t, o);
|
|
164
|
+
},
|
|
165
|
+
unbind(t) {
|
|
166
|
+
g(t);
|
|
167
|
+
},
|
|
168
|
+
// Vue 3 Directive hooks
|
|
169
|
+
beforeMount(t, o) {
|
|
170
|
+
d(t, o);
|
|
171
|
+
},
|
|
172
|
+
mounted(t, o) {
|
|
173
|
+
f(t, o);
|
|
174
|
+
},
|
|
175
|
+
updated(t, o) {
|
|
176
|
+
f(t, o);
|
|
177
|
+
},
|
|
178
|
+
unmounted(t) {
|
|
179
|
+
g(t);
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
export {
|
|
183
|
+
Q as B,
|
|
184
|
+
T as E,
|
|
185
|
+
q as T,
|
|
186
|
+
p as a,
|
|
187
|
+
_ as b
|
|
188
|
+
};
|
|
189
|
+
//# sourceMappingURL=tooltip.DyZIyMZN.js.map
|