@adyen/bento-vue2 1.89.2 → 1.91.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/components.d.ts +4 -0
- package/dist/@types/index.d.ts +381 -118
- package/dist/accordion.js +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/ai-tag.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/anchor-scroller.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-picker.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/draggable-handle.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/error-message.css +1 -1
- package/dist/assets/field-label.css +1 -0
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/form-layout-title.css +1 -1
- package/dist/assets/input-field.css +1 -1
- package/dist/assets/input-time.css +1 -0
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/secondary-nav.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/use-cached-selected-values.css +1 -1
- package/dist/button.js +3 -3
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chip.js +1 -1
- package/dist/chunks/accordion-item.D0WVCLec.js +145 -0
- package/dist/chunks/{accordion-item.BZDSJamR.js.map → accordion-item.D0WVCLec.js.map} +1 -1
- package/dist/chunks/action-bar.Dj830k6L.js +334 -0
- package/dist/chunks/{action-bar.CYGUYI0V.js.map → action-bar.Dj830k6L.js.map} +1 -1
- package/dist/chunks/{ai-button.CR_ePQRR.js → ai-button.7L9bANlk.js} +2 -2
- package/dist/chunks/{ai-button.CR_ePQRR.js.map → ai-button.7L9bANlk.js.map} +1 -1
- package/dist/chunks/ai-tag.AyG2UWCB.js +110 -0
- package/dist/chunks/{ai-tag.Cjf38mjR.js.map → ai-tag.AyG2UWCB.js.map} +1 -1
- package/dist/chunks/alert.CXRb-Smf.js +160 -0
- package/dist/chunks/{alert.QVQ6Zjbm.js.map → alert.CXRb-Smf.js.map} +1 -1
- package/dist/chunks/{anchor-scroller.CjJ26PJS.js → anchor-scroller.DWaykZQj.js} +66 -39
- package/dist/chunks/{anchor-scroller.CjJ26PJS.js.map → anchor-scroller.DWaykZQj.js.map} +1 -1
- package/dist/chunks/{base-modal.DmWkavtf.js → base-modal.C52VMtnd.js} +104 -67
- package/dist/chunks/{base-modal.DmWkavtf.js.map → base-modal.C52VMtnd.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.Bi_HXopk.js → button-actions-with-menu.OsPQ-POD.js} +2 -2
- package/dist/chunks/{button-actions-with-menu.Bi_HXopk.js.map → button-actions-with-menu.OsPQ-POD.js.map} +1 -1
- package/dist/chunks/{button-actions.BLk114As.js → button-actions.Bdbu0bvt.js} +222 -148
- package/dist/chunks/{button-actions.BLk114As.js.map → button-actions.Bdbu0bvt.js.map} +1 -1
- package/dist/chunks/{button.DxhJNOtr.js → button.C9b2AC9w.js} +2 -2
- package/dist/chunks/{button.DxhJNOtr.js.map → button.C9b2AC9w.js.map} +1 -1
- package/dist/chunks/{calendar.CXKhBF2f.js → calendar.CqsfThnC.js} +438 -346
- package/dist/chunks/calendar.CqsfThnC.js.map +1 -0
- package/dist/chunks/card.8z7UQeVK.js +165 -0
- package/dist/chunks/{card.GjhsXOT0.js.map → card.8z7UQeVK.js.map} +1 -1
- package/dist/chunks/{checkbox-group.B2BjU3ZN.js → checkbox-group.Dur2Edtw.js} +4 -4
- package/dist/chunks/{checkbox-group.B2BjU3ZN.js.map → checkbox-group.Dur2Edtw.js.map} +1 -1
- package/dist/chunks/{checkbox.CIv8WgGp.js → checkbox.vNjt6QDJ.js} +93 -56
- package/dist/chunks/{checkbox.CIv8WgGp.js.map → checkbox.vNjt6QDJ.js.map} +1 -1
- package/dist/chunks/chip.BFY_-VCz.js +84 -0
- package/dist/chunks/{chip.DTpENaGC.js.map → chip.BFY_-VCz.js.map} +1 -1
- package/dist/chunks/{click-outside.CDz_x8mN.js → click-outside.BG01Sm0A.js} +2 -2
- package/dist/chunks/{click-outside.CDz_x8mN.js.map → click-outside.BG01Sm0A.js.map} +1 -1
- package/dist/chunks/{code-snippet.YIm2oO_o.js → code-snippet.BVpFBhKq.js} +133 -76
- package/dist/chunks/{code-snippet.YIm2oO_o.js.map → code-snippet.BVpFBhKq.js.map} +1 -1
- package/dist/chunks/{controls-group.CqotnNEF.js → controls-group.DSm2Ujwt.js} +2 -2
- package/dist/chunks/{controls-group.CqotnNEF.js.map → controls-group.DSm2Ujwt.js.map} +1 -1
- package/dist/chunks/copy.qqGYFbKJ.js +133 -0
- package/dist/chunks/{copy.BVGQcf22.js.map → copy.qqGYFbKJ.js.map} +1 -1
- package/dist/chunks/{country.D20NCLLG.js → country.BEwW8TQo.js} +3 -3
- package/dist/chunks/{country.D20NCLLG.js.map → country.BEwW8TQo.js.map} +1 -1
- package/dist/chunks/country.types.jjXwaoMl.js +2537 -0
- package/dist/chunks/country.types.jjXwaoMl.js.map +1 -0
- package/dist/chunks/{dashboard-section.BubZyu8i.js → dashboard-section.DNxNVV44.js} +3 -3
- package/dist/chunks/{dashboard-section.BubZyu8i.js.map → dashboard-section.DNxNVV44.js.map} +1 -1
- package/dist/chunks/{dashed-underline.pjYTS0m1.js → dashed-underline.DL2_sik5.js} +3 -3
- package/dist/chunks/{dashed-underline.pjYTS0m1.js.map → dashed-underline.DL2_sik5.js.map} +1 -1
- package/dist/chunks/{data-grid-template.D8RhngPj.js → data-grid-template.BFv1zr6g.js} +4 -4
- package/dist/chunks/{data-grid-template.D8RhngPj.js.map → data-grid-template.BFv1zr6g.js.map} +1 -1
- package/dist/chunks/data-grid.ZHY5EzP3.js +4071 -0
- package/dist/chunks/data-grid.ZHY5EzP3.js.map +1 -0
- package/dist/chunks/date-picker.kl6aFlr1.js +237 -0
- package/dist/chunks/date-picker.kl6aFlr1.js.map +1 -0
- package/dist/chunks/date-range-picker.LCWVAa5R.js +1089 -0
- package/dist/chunks/date-range-picker.LCWVAa5R.js.map +1 -0
- package/dist/chunks/dialog-page.EdejG53a.js +143 -0
- package/dist/chunks/{dialog-page.oyG153fC.js.map → dialog-page.EdejG53a.js.map} +1 -1
- package/dist/chunks/{directive.rXUeDb8p.js → directive.Bfr4fuOy.js} +2 -2
- package/dist/chunks/{directive.rXUeDb8p.js.map → directive.Bfr4fuOy.js.map} +1 -1
- package/dist/chunks/draggable-handle.Ba28eM8o.js +245 -0
- package/dist/chunks/draggable-handle.Ba28eM8o.js.map +1 -0
- package/dist/chunks/{dropdown-tag.BRB-emd1.js → dropdown-tag.B61hPq5n.js} +5 -5
- package/dist/chunks/{dropdown-tag.BRB-emd1.js.map → dropdown-tag.B61hPq5n.js.map} +1 -1
- package/dist/chunks/dropdown.Ca-f8tdX.js +1140 -0
- package/dist/chunks/dropdown.Ca-f8tdX.js.map +1 -0
- package/dist/chunks/{empty-state.D_Ac-XXH.js → empty-state.DMV23IZy.js} +2 -2
- package/dist/chunks/{empty-state.D_Ac-XXH.js.map → empty-state.DMV23IZy.js.map} +1 -1
- package/dist/chunks/error-message.CyERcfdt.js +72 -0
- package/dist/chunks/error-message.CyERcfdt.js.map +1 -0
- package/dist/chunks/field-label.DjjjkcO6.js +97 -0
- package/dist/chunks/field-label.DjjjkcO6.js.map +1 -0
- package/dist/chunks/{file-uploader.D5Rjsx4k.js → file-uploader.DeWmLpfp.js} +751 -469
- package/dist/chunks/{file-uploader.D5Rjsx4k.js.map → file-uploader.DeWmLpfp.js.map} +1 -1
- package/dist/chunks/{filter-bar.zD_ctViU.js → filter-bar.Bd4ghW_B.js} +1596 -1039
- package/dist/chunks/filter-bar.Bd4ghW_B.js.map +1 -0
- package/dist/chunks/fixed-scroller.DR2E_No4.js +148 -0
- package/dist/chunks/{fixed-scroller.MerESbd_.js.map → fixed-scroller.DR2E_No4.js.map} +1 -1
- package/dist/chunks/{footer-actions.CiPj7hZG.js → footer-actions.CvUaoMzj.js} +3 -3
- package/dist/chunks/{footer-actions.CiPj7hZG.js.map → footer-actions.CvUaoMzj.js.map} +1 -1
- package/dist/chunks/form-layout-title.DzGajv4U.js +248 -0
- package/dist/chunks/form-layout-title.DzGajv4U.js.map +1 -0
- package/dist/chunks/{header-meta.Dq6TlNPw.js → header-meta.AXUGoqDd.js} +127 -73
- package/dist/chunks/{header-meta.Dq6TlNPw.js.map → header-meta.AXUGoqDd.js.map} +1 -1
- package/dist/chunks/{header-with-views.DaEhkSS8.js → header-with-views.Ba4dswJF.js} +1121 -680
- package/dist/chunks/{header-with-views.DaEhkSS8.js.map → header-with-views.Ba4dswJF.js.map} +1 -1
- package/dist/chunks/{header.DkC-KKWa.js → header.C7B7RBib.js} +3 -3
- package/dist/chunks/{header.DkC-KKWa.js.map → header.C7B7RBib.js.map} +1 -1
- package/dist/chunks/{info-icon.BF8KxU-k.js → info-icon.DCR42Kvm.js} +2 -2
- package/dist/chunks/{info-icon.BF8KxU-k.js.map → info-icon.DCR42Kvm.js.map} +1 -1
- package/dist/chunks/input-field-password.BNAtIn_D.js +381 -0
- package/dist/chunks/{input-field-password.BKT1mYUw.js.map → input-field-password.BNAtIn_D.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.BjRKjQOQ.js → input-field-phone-number.CEYx1s4b.js} +98 -71
- package/dist/chunks/{input-field-phone-number.BjRKjQOQ.js.map → input-field-phone-number.CEYx1s4b.js.map} +1 -1
- package/dist/chunks/input-field.Dh5W0Az-.js +211 -0
- package/dist/chunks/input-field.Dh5W0Az-.js.map +1 -0
- package/dist/chunks/input-time.BLuMfakv.js +135 -0
- package/dist/chunks/input-time.BLuMfakv.js.map +1 -0
- package/dist/chunks/inspector.BzBPlz-5.js +172 -0
- package/dist/chunks/{inspector.Bnm0hl_D.js.map → inspector.BzBPlz-5.js.map} +1 -1
- package/dist/chunks/{link.MhoM3zQj.js → link.DB5g6d48.js} +56 -29
- package/dist/chunks/{link.MhoM3zQj.js.map → link.DB5g6d48.js.map} +1 -1
- package/dist/chunks/{list-item.BnzU1LIu.js → list-item.DqTHh8-Z.js} +2 -2
- package/dist/chunks/{list-item.BnzU1LIu.js.map → list-item.DqTHh8-Z.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.BhPVuAjJ.js → listbox-option-tag.CvbE-EuG.js} +2 -2
- package/dist/chunks/{listbox-option-tag.BhPVuAjJ.js.map → listbox-option-tag.CvbE-EuG.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.CXOq6_Cv.js → modal-fullscreen.DTvg2NLk.js} +63 -36
- package/dist/chunks/{modal-fullscreen.CXOq6_Cv.js.map → modal-fullscreen.DTvg2NLk.js.map} +1 -1
- package/dist/chunks/{modal.o0KddMiG.js → modal.D_TcWTkf.js} +63 -36
- package/dist/chunks/{modal.o0KddMiG.js.map → modal.D_TcWTkf.js.map} +1 -1
- package/dist/chunks/on-click-outside.Cy1eFULD.js +109 -0
- package/dist/chunks/on-click-outside.Cy1eFULD.js.map +1 -0
- package/dist/chunks/{pagination.ZISqB4M_.js → pagination.D6BxMw5L.js} +221 -99
- package/dist/chunks/{pagination.ZISqB4M_.js.map → pagination.D6BxMw5L.js.map} +1 -1
- package/dist/chunks/promo-banner.Dc_kK1x9.js +91 -0
- package/dist/chunks/{promo-banner.Db2kh2qK.js.map → promo-banner.Dc_kK1x9.js.map} +1 -1
- package/dist/chunks/{radio-group.DnMy7brs.js → radio-group.Bb-L-0io.js} +4 -4
- package/dist/chunks/{radio-group.DnMy7brs.js.map → radio-group.Bb-L-0io.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.Cbv1DxXn.js → rich-text-editor.Dtdfh-0V.js} +1782 -1731
- package/dist/chunks/{rich-text-editor.Cbv1DxXn.js.map → rich-text-editor.Dtdfh-0V.js.map} +1 -1
- package/dist/chunks/search-bar.MVJS9-Mh.js +126 -0
- package/dist/chunks/{search-bar.DPjYDhja.js.map → search-bar.MVJS9-Mh.js.map} +1 -1
- package/dist/chunks/secondary-nav.C-nPZR-2.js +226 -0
- package/dist/chunks/secondary-nav.C-nPZR-2.js.map +1 -0
- package/dist/chunks/{segmented-control.BqIiX9hv.js → segmented-control.DDtjX-V5.js} +2 -2
- package/dist/chunks/{segmented-control.BqIiX9hv.js.map → segmented-control.DDtjX-V5.js.map} +1 -1
- package/dist/chunks/{selection-card-group.IPiouuot.js → selection-card-group.CLJPaknG.js} +3 -3
- package/dist/chunks/{selection-card-group.IPiouuot.js.map → selection-card-group.CLJPaknG.js.map} +1 -1
- package/dist/chunks/{sidepanel.BGMjjB3F.js → sidepanel.BTRfwGiS.js} +66 -39
- package/dist/chunks/{sidepanel.BGMjjB3F.js.map → sidepanel.BTRfwGiS.js.map} +1 -1
- package/dist/chunks/{step.QFER3tSj.js → step.TDm_ts1S.js} +92 -63
- package/dist/chunks/{step.QFER3tSj.js.map → step.TDm_ts1S.js.map} +1 -1
- package/dist/chunks/{structured-list-item.BDJKRC_8.js → structured-list-item.BBBtie1s.js} +58 -31
- package/dist/chunks/{structured-list-item.BDJKRC_8.js.map → structured-list-item.BBBtie1s.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.CIkArZf5.js → summary-grid.types.DUIqCmwg.js} +5 -5
- package/dist/chunks/{summary-grid.types.CIkArZf5.js.map → summary-grid.types.DUIqCmwg.js.map} +1 -1
- package/dist/chunks/{tab.CaXF0dho.js → tab.CNIZyfZt.js} +2 -2
- package/dist/chunks/{tab.CaXF0dho.js.map → tab.CNIZyfZt.js.map} +1 -1
- package/dist/chunks/{tag.CocLKztJ.js → tag.D2xagTJv.js} +2 -2
- package/dist/chunks/{tag.CocLKztJ.js.map → tag.D2xagTJv.js.map} +1 -1
- package/dist/chunks/textarea.CJS-1I41.js +219 -0
- package/dist/chunks/{textarea.D4X6Ss9q.js.map → textarea.CJS-1I41.js.map} +1 -1
- package/dist/chunks/timeline-item.BOUWkLi1.js +322 -0
- package/dist/chunks/{timeline-item.C8BxWdy1.js.map → timeline-item.BOUWkLi1.js.map} +1 -1
- package/dist/chunks/{toast.BRI3G7TL.js → toast.d8vg71CB.js} +81 -54
- package/dist/chunks/{toast.BRI3G7TL.js.map → toast.d8vg71CB.js.map} +1 -1
- package/dist/chunks/{tooltip.CbsNGnhw.js → tooltip.BxtnF3is.js} +38 -36
- package/dist/chunks/tooltip.BxtnF3is.js.map +1 -0
- package/dist/chunks/{tutorial.BzV6bHQJ.js → tutorial.CZt_mcuT.js} +190 -103
- package/dist/chunks/{tutorial.BzV6bHQJ.js.map → tutorial.CZt_mcuT.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.DqX2qsMC.js → use-cached-selected-values.BJbWbkEQ.js} +553 -417
- package/dist/chunks/use-cached-selected-values.BJbWbkEQ.js.map +1 -0
- package/dist/chunks/{use-country-items.CI8C7MLU.js → use-country-items.B4j8pAvW.js} +3 -3
- package/dist/chunks/{use-country-items.CI8C7MLU.js.map → use-country-items.B4j8pAvW.js.map} +1 -1
- package/dist/chunks/use-country-phon-code.ByqnuIni.js +6386 -0
- package/dist/chunks/use-country-phon-code.ByqnuIni.js.map +1 -0
- package/dist/chunks/{use-date-input-formatter.BYaTO3vz.js → use-date-input-formatter.Djf8AoLr.js} +2 -2
- package/dist/chunks/{use-date-input-formatter.BYaTO3vz.js.map → use-date-input-formatter.Djf8AoLr.js.map} +1 -1
- package/dist/chunks/use-touch-device.DTqFAbXh.js +11 -0
- package/dist/chunks/use-touch-device.DTqFAbXh.js.map +1 -0
- package/dist/click-outside.js +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/country.js +3 -3
- package/dist/dashboard-template.js +1 -1
- package/dist/dashed-underline.js +1 -1
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/date-range-picker.js +2 -2
- package/dist/draggable.js +1396 -0
- package/dist/draggable.js.map +1 -0
- package/dist/dropdown.js +11 -12
- package/dist/dropdown.js.map +1 -1
- package/dist/empty-state.js +1 -1
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/form-layout.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +280 -275
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +1 -1
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/input-time.js +5 -0
- package/dist/input-time.js.map +1 -0
- package/dist/inspector.js +1 -1
- package/dist/internal.js +26 -25
- package/dist/internal.js.map +1 -1
- package/dist/link.js +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/pagination.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/promo-banner.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/stepper.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tag.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +297 -4
- package/package.json +10 -15
- package/dist/assets/dropdown-default-textbox.css +0 -1
- package/dist/chunks/accordion-item.BZDSJamR.js +0 -108
- package/dist/chunks/action-bar.CYGUYI0V.js +0 -207
- package/dist/chunks/ai-tag.Cjf38mjR.js +0 -73
- package/dist/chunks/alert.QVQ6Zjbm.js +0 -93
- package/dist/chunks/calendar.CXKhBF2f.js.map +0 -1
- package/dist/chunks/card.GjhsXOT0.js +0 -128
- package/dist/chunks/chip.DTpENaGC.js +0 -57
- package/dist/chunks/copy.BVGQcf22.js +0 -86
- package/dist/chunks/country.types.DxKjyd0S.js +0 -20
- package/dist/chunks/country.types.DxKjyd0S.js.map +0 -1
- package/dist/chunks/data-grid.DJG8Ty0A.js +0 -3194
- package/dist/chunks/data-grid.DJG8Ty0A.js.map +0 -1
- package/dist/chunks/date-picker.CnazYcSX.js +0 -155
- package/dist/chunks/date-picker.CnazYcSX.js.map +0 -1
- package/dist/chunks/date-range-picker.Bf9pRNL7.js +0 -811
- package/dist/chunks/date-range-picker.Bf9pRNL7.js.map +0 -1
- package/dist/chunks/debounce.DUTu11PS.js +0 -10
- package/dist/chunks/debounce.DUTu11PS.js.map +0 -1
- package/dist/chunks/dialog-page.oyG153fC.js +0 -116
- package/dist/chunks/dropdown-default-textbox.Dvzg0StF.js +0 -337
- package/dist/chunks/dropdown-default-textbox.Dvzg0StF.js.map +0 -1
- package/dist/chunks/dropdown.Ct7uhPr6.js +0 -696
- package/dist/chunks/dropdown.Ct7uhPr6.js.map +0 -1
- package/dist/chunks/error-message.RxdStT3S.js +0 -106
- package/dist/chunks/error-message.RxdStT3S.js.map +0 -1
- package/dist/chunks/filter-bar.zD_ctViU.js.map +0 -1
- package/dist/chunks/fixed-scroller.MerESbd_.js +0 -111
- package/dist/chunks/form-layout-title.Bw7VgOO5.js +0 -210
- package/dist/chunks/form-layout-title.Bw7VgOO5.js.map +0 -1
- package/dist/chunks/input-field-password.BKT1mYUw.js +0 -234
- package/dist/chunks/input-field.m1PMwa4C.js +0 -170
- package/dist/chunks/input-field.m1PMwa4C.js.map +0 -1
- package/dist/chunks/inspector.Bnm0hl_D.js +0 -105
- package/dist/chunks/on-click-outside.BW4rkhzG.js +0 -91
- package/dist/chunks/on-click-outside.BW4rkhzG.js.map +0 -1
- package/dist/chunks/promo-banner.Db2kh2qK.js +0 -64
- package/dist/chunks/search-bar.DPjYDhja.js +0 -89
- package/dist/chunks/secondary-nav.CwJjkJkj.js +0 -112
- package/dist/chunks/secondary-nav.CwJjkJkj.js.map +0 -1
- package/dist/chunks/textarea.D4X6Ss9q.js +0 -169
- package/dist/chunks/timeline-item.C8BxWdy1.js +0 -238
- package/dist/chunks/tooltip.CbsNGnhw.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.DqX2qsMC.js.map +0 -1
- package/dist/chunks/use-country-phon-code.C6orQNnM.js +0 -291
- package/dist/chunks/use-country-phon-code.C6orQNnM.js.map +0 -1
- package/dist/draggable-handle.js +0 -149
- package/dist/draggable-handle.js.map +0 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { s as
|
|
3
|
-
import { c as
|
|
4
|
-
import { B as pe } from "./dropdown.
|
|
5
|
-
import { B as ue } from "./button.
|
|
1
|
+
import { defineComponent as Q, useAttrs as Y, ref as g, computed as l, shallowRef as E, onMounted as V, watch as W, watchEffect as j } from "vue";
|
|
2
|
+
import { s as Z, H as z, t as e, L as H, a as J, b as F, c as U, p as G, j as X, d as q, x as K, e as ee, E as te, h as ne, k as ae, i as oe, C as f, f as P, g as _, l as se, m as ie } from "./codemirror.D2BAltnu.js";
|
|
3
|
+
import { c as re, d as le, e as ce, f as de } from "./es6.C1DXQV6f.js";
|
|
4
|
+
import { B as pe } from "./dropdown.Ca-f8tdX.js";
|
|
5
|
+
import { B as ue } from "./button.C9b2AC9w.js";
|
|
6
6
|
import { B as ge } from "./typography.C8lPlsbD.js";
|
|
7
7
|
import { B as fe } from "./loading-indicator.PxbRzshH.js";
|
|
8
|
-
import { u as
|
|
9
|
-
import { E as
|
|
10
|
-
import { h as be } from "./base-modal.
|
|
11
|
-
import { C as _e } from "./copy.
|
|
8
|
+
import { u as he } from "./index.B6WW_F-J.js";
|
|
9
|
+
import { E as me } from "./expand.Bbielaja.js";
|
|
10
|
+
import { h as be } from "./base-modal.C52VMtnd.js";
|
|
11
|
+
import { C as _e } from "./copy.qqGYFbKJ.js";
|
|
12
12
|
import { n as Oe } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
13
13
|
import "../assets/code-snippet.css";
|
|
14
|
-
const
|
|
15
|
-
red:
|
|
14
|
+
const ye = {
|
|
15
|
+
red: re,
|
|
16
16
|
orange: de,
|
|
17
17
|
green: le,
|
|
18
18
|
blue: ce,
|
|
19
19
|
invalid: "#ffffff"
|
|
20
|
-
},
|
|
20
|
+
}, ve = (t, n) => z.define([
|
|
21
21
|
{
|
|
22
22
|
tag: e.keyword,
|
|
23
23
|
color: t.red
|
|
@@ -84,9 +84,9 @@ const ve = {
|
|
|
84
84
|
tag: e.invalid,
|
|
85
85
|
color: t.invalid
|
|
86
86
|
}
|
|
87
|
-
]),
|
|
88
|
-
var O = /* @__PURE__ */ ((t) => (t.INLINE = "inline", t.SINGLELINE = "singleline", t.MULTILINE = "multiline", t))(O || {}),
|
|
89
|
-
const
|
|
87
|
+
]), Ce = (t) => Z(ve(ye, t));
|
|
88
|
+
var O = /* @__PURE__ */ ((t) => (t.INLINE = "inline", t.SINGLELINE = "singleline", t.MULTILINE = "multiline", t))(O || {}), i = /* @__PURE__ */ ((t) => (t.JSON = "json", t.XML = "xml", t.JAVA = "java", t.JAVASCRIPT = "javascript", t.PYTHON = "python", t.CSV = "csv", t))(i || {}), c = /* @__PURE__ */ ((t) => (t.ACTION = "action", t.CHANGE = "change", t))(c || {});
|
|
89
|
+
const Se = U.deserialize({
|
|
90
90
|
version: 14,
|
|
91
91
|
states: "nQVQPOOOOQO'#Ce'#CeOOQO'#Ca'#CaQVQPOOOOQO-E6_-E6_",
|
|
92
92
|
stateData: "g~OWOS~OQPORPOSPO~OQRSR~",
|
|
@@ -99,10 +99,10 @@ const Le = G.deserialize({
|
|
|
99
99
|
tokenizers: [0],
|
|
100
100
|
topRules: { Program: [0, 1] },
|
|
101
101
|
tokenPrec: 18
|
|
102
|
-
}),
|
|
103
|
-
parser:
|
|
102
|
+
}), xe = J.define({
|
|
103
|
+
parser: Se.configure({
|
|
104
104
|
props: [
|
|
105
|
-
|
|
105
|
+
F({
|
|
106
106
|
Separator: e.separator,
|
|
107
107
|
Value: e.string,
|
|
108
108
|
String: e.string,
|
|
@@ -112,25 +112,25 @@ const Le = G.deserialize({
|
|
|
112
112
|
]
|
|
113
113
|
})
|
|
114
114
|
});
|
|
115
|
-
function
|
|
116
|
-
return new
|
|
115
|
+
function Le() {
|
|
116
|
+
return new H(xe);
|
|
117
117
|
}
|
|
118
118
|
const Te = {
|
|
119
|
-
[
|
|
120
|
-
[
|
|
121
|
-
[
|
|
122
|
-
[
|
|
123
|
-
[
|
|
124
|
-
[
|
|
125
|
-
}, Ne = (t) => async () => Te[t],
|
|
119
|
+
[i.JSON]: ee,
|
|
120
|
+
[i.XML]: K,
|
|
121
|
+
[i.JAVASCRIPT]: q,
|
|
122
|
+
[i.JAVA]: X,
|
|
123
|
+
[i.PYTHON]: G,
|
|
124
|
+
[i.CSV]: Le
|
|
125
|
+
}, Ne = (t) => async () => Te[t], Ee = (t, n) => {
|
|
126
126
|
const a = t.doc.lineAt(n.from), o = /^\s*/.exec(a.text);
|
|
127
127
|
return o ? o[0] : "";
|
|
128
|
-
},
|
|
128
|
+
}, Pe = {
|
|
129
129
|
key: "Enter",
|
|
130
130
|
run: ({ state: t, dispatch: n }) => {
|
|
131
131
|
const a = t.changeByRange((o) => {
|
|
132
132
|
const d = `
|
|
133
|
-
${
|
|
133
|
+
${Ee(t, o)}`;
|
|
134
134
|
return {
|
|
135
135
|
changes: { from: o.from, to: o.to, insert: d },
|
|
136
136
|
range: te.cursor(o.from + d.length)
|
|
@@ -138,89 +138,146 @@ ${Pe(t, o)}`;
|
|
|
138
138
|
});
|
|
139
139
|
return n(t.update(a, { scrollIntoView: !0, userEvent: "input" })), !0;
|
|
140
140
|
}
|
|
141
|
-
},
|
|
142
|
-
"
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
141
|
+
}, ke = {
|
|
142
|
+
"de-DE": {
|
|
143
|
+
codeSnippet: "Codeausschnitt",
|
|
144
|
+
expand: "Anzeigen",
|
|
145
|
+
nothingToDisplay: "Nichts anzuzeigen",
|
|
146
|
+
run: "Lauf"
|
|
147
|
+
},
|
|
148
|
+
"en-GB": {
|
|
149
|
+
codeSnippet: "Code snippet",
|
|
150
|
+
expand: "Expand",
|
|
151
|
+
nothingToDisplay: "Nothing to display",
|
|
152
|
+
run: "Run"
|
|
153
|
+
},
|
|
154
|
+
"en-US": {
|
|
155
|
+
codeSnippet: "Code snippet",
|
|
156
|
+
expand: "Expand",
|
|
157
|
+
nothingToDisplay: "Nothing to display",
|
|
158
|
+
run: "Run"
|
|
159
|
+
},
|
|
160
|
+
"es-ES": {
|
|
161
|
+
codeSnippet: "Fragmento de código",
|
|
162
|
+
expand: "Ampliar",
|
|
163
|
+
nothingToDisplay: "No hay nada que mostrar",
|
|
164
|
+
run: "Ejecutar"
|
|
165
|
+
},
|
|
166
|
+
"es-MX": {
|
|
167
|
+
codeSnippet: "Fragmento de código",
|
|
168
|
+
expand: "Ampliar",
|
|
169
|
+
nothingToDisplay: "Nada que mostrar",
|
|
170
|
+
run: "Ejecutar"
|
|
171
|
+
},
|
|
172
|
+
"fr-FR": {
|
|
173
|
+
codeSnippet: "Extrait de code",
|
|
174
|
+
expand: "Développer",
|
|
175
|
+
nothingToDisplay: "Rien à afficher",
|
|
176
|
+
run: "Exécuter"
|
|
177
|
+
},
|
|
178
|
+
"it-IT": {
|
|
179
|
+
codeSnippet: "Frammento di codice",
|
|
180
|
+
expand: "Espandi",
|
|
181
|
+
nothingToDisplay: "Niente da visualizzare",
|
|
182
|
+
run: "Corri"
|
|
183
|
+
},
|
|
184
|
+
"ja-JP": {
|
|
185
|
+
codeSnippet: "コードスニペット",
|
|
186
|
+
expand: "展開",
|
|
187
|
+
nothingToDisplay: "表示するものがありません",
|
|
188
|
+
run: "実行"
|
|
189
|
+
},
|
|
190
|
+
"pt-BR": {
|
|
191
|
+
codeSnippet: "Trecho de código",
|
|
192
|
+
expand: "Expandir",
|
|
193
|
+
nothingToDisplay: "Nada a mostrar",
|
|
194
|
+
run: "Executar"
|
|
195
|
+
},
|
|
196
|
+
"zh-CN": {
|
|
197
|
+
codeSnippet: "代码片段",
|
|
198
|
+
expand: "展开",
|
|
199
|
+
nothingToDisplay: "暂无内容可显示",
|
|
200
|
+
run: "运行"
|
|
201
|
+
}
|
|
202
|
+
}, Ae = {
|
|
203
|
+
i18n: { messages: ke },
|
|
147
204
|
name: "bento-code-snippet"
|
|
148
|
-
},
|
|
149
|
-
...
|
|
205
|
+
}, Be = /* @__PURE__ */ Q({
|
|
206
|
+
...Ae,
|
|
150
207
|
props: {
|
|
151
208
|
actionable: { type: Boolean, default: !1 },
|
|
152
209
|
actionableText: { default: null },
|
|
153
210
|
content: { default: "" },
|
|
154
211
|
expandable: { type: Boolean, default: !1 },
|
|
155
212
|
editable: { type: Boolean, default: !1 },
|
|
156
|
-
lang: { default:
|
|
213
|
+
lang: { default: i.JSON },
|
|
157
214
|
langLabel: { default: null },
|
|
158
215
|
loading: { type: Boolean, default: !1 },
|
|
159
216
|
variant: { default: O.MULTILINE }
|
|
160
217
|
},
|
|
161
218
|
emits: [c.ACTION, c.CHANGE],
|
|
162
219
|
setup(t, { emit: n }) {
|
|
163
|
-
const a = t, o =
|
|
164
|
-
},
|
|
220
|
+
const a = t, o = Y(), { t: s } = he(), d = g(null), k = [], A = () => {
|
|
221
|
+
}, B = l(() => a.langLabel ?? a.lang.toUpperCase()), p = l(() => a.variant === O.INLINE), I = l(() => ({
|
|
165
222
|
"b-code-snippet--inline": p.value,
|
|
166
223
|
"b-code-snippet--scrollable": !p.value
|
|
167
|
-
})),
|
|
224
|
+
})), R = l(() => ({
|
|
168
225
|
"b-code-snippet__code-area-content--editable": a.editable
|
|
169
|
-
})),
|
|
170
|
-
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
const
|
|
174
|
-
|
|
226
|
+
})), y = Ne(a.lang), v = E(), h = E(), C = new f(), S = new f(), x = new f(), L = new f(), r = g(null), u = g(0), w = l(() => a.actionableText || s("run"));
|
|
227
|
+
V(async () => {
|
|
228
|
+
const m = await y();
|
|
229
|
+
r.value = a.content;
|
|
230
|
+
const M = ({ state: b }) => {
|
|
231
|
+
r.value = b.doc.toString();
|
|
175
232
|
}, T = [
|
|
176
233
|
ne(),
|
|
177
|
-
ae.of([oe,
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
234
|
+
ae.of([oe, Pe]),
|
|
235
|
+
C.of(m()),
|
|
236
|
+
S.of(Ce(a.lang)),
|
|
237
|
+
x.of(P.readOnly.of(!a.editable)),
|
|
238
|
+
L.of(
|
|
182
239
|
_.contentAttributes.of({
|
|
183
240
|
"aria-label": o["aria-label"] ?? s("codeSnippet"),
|
|
184
241
|
...!p.value && { tabindex: "0" }
|
|
185
242
|
})
|
|
186
243
|
),
|
|
187
|
-
_.updateListener.of((b) =>
|
|
244
|
+
_.updateListener.of((b) => M(b))
|
|
188
245
|
];
|
|
189
|
-
a.variant === "multiline" && T.push([se(),
|
|
190
|
-
const N =
|
|
246
|
+
a.variant === "multiline" && T.push([se(), ie()]);
|
|
247
|
+
const N = P.create({
|
|
191
248
|
doc: a.content,
|
|
192
249
|
extensions: [...T]
|
|
193
250
|
});
|
|
194
|
-
u.value = N.doc.length,
|
|
251
|
+
u.value = N.doc.length, h.value = new _({
|
|
195
252
|
state: N,
|
|
196
|
-
parent:
|
|
253
|
+
parent: v.value
|
|
197
254
|
});
|
|
198
|
-
}),
|
|
255
|
+
}), W(
|
|
199
256
|
() => a.content,
|
|
200
257
|
() => {
|
|
201
|
-
if (a.content !==
|
|
202
|
-
const
|
|
203
|
-
|
|
258
|
+
if (a.content !== r.value) {
|
|
259
|
+
const m = a.content.length;
|
|
260
|
+
h.value.dispatch({
|
|
204
261
|
changes: {
|
|
205
262
|
from: 0,
|
|
206
263
|
to: u.value,
|
|
207
264
|
insert: a.content
|
|
208
265
|
}
|
|
209
|
-
}), u.value =
|
|
266
|
+
}), u.value = m;
|
|
210
267
|
}
|
|
211
268
|
}
|
|
212
269
|
);
|
|
213
|
-
const
|
|
214
|
-
n(c.ACTION,
|
|
270
|
+
const D = () => {
|
|
271
|
+
n(c.ACTION, r.value);
|
|
215
272
|
};
|
|
216
|
-
|
|
217
|
-
|
|
273
|
+
j(() => {
|
|
274
|
+
r.value !== null && n(c.CHANGE, r.value);
|
|
218
275
|
});
|
|
219
|
-
const
|
|
220
|
-
return { __sfc: !0, props: a, emit: n, attrs: o, t: s, selectedLanguage: d, availableLanguages:
|
|
276
|
+
const $ = g(!1);
|
|
277
|
+
return { __sfc: !0, props: a, emit: n, attrs: o, t: s, selectedLanguage: d, availableLanguages: k, handleChangeLanguage: A, displayedLang: B, isInlineVariant: p, conditionalClasses: I, codeAreaContentConditionalClasses: R, loadLang: y, container: v, editor: h, languageConf: C, editorTheme: S, editorReadOnly: x, editorAttributes: L, currentContents: r, contentLength: u, runText: w, onActionClicked: D, showModal: $, BentoDropdown: pe, BentoButton: ue, BentoTypography: ge, BentoLoadingIndicator: fe, Copy: _e, ExpandIcon: me, BaseModal: be };
|
|
221
278
|
}
|
|
222
279
|
});
|
|
223
|
-
var
|
|
280
|
+
var Ie = function() {
|
|
224
281
|
var n = this, a = n._self._c, o = n._self._setupProxy;
|
|
225
282
|
return a("div", { staticClass: "b-code-snippet", class: o.conditionalClasses }, [o.isInlineVariant ? n._e() : a("section", { staticClass: "b-code-snippet__action-bar" }, [a("div", { staticClass: "b-code-snippet__action-bar--start" }, [o.availableLanguages.length > 0 ? a(o.BentoDropdown, n._b({ staticClass: "b-code-snippet__language-picker", attrs: { disabled: o.availableLanguages.length === 1, items: o.availableLanguages }, on: { input: o.handleChangeLanguage }, model: { value: o.selectedLanguage, callback: function(s) {
|
|
226
283
|
o.selectedLanguage = s;
|
|
@@ -237,19 +294,19 @@ var Ae = function() {
|
|
|
237
294
|
} }, scopedSlots: n._u([{ key: "content", fn: function() {
|
|
238
295
|
return [a("bento-code-snippet", n._b({}, "bento-code-snippet", { ...n.$props, expandable: !1 }, !1))];
|
|
239
296
|
}, proxy: !0 }], null, !1, 3343589027) }) : n._e()], 1);
|
|
240
|
-
},
|
|
297
|
+
}, Re = [], we = /* @__PURE__ */ Oe(
|
|
298
|
+
Be,
|
|
241
299
|
Ie,
|
|
242
|
-
|
|
243
|
-
we,
|
|
300
|
+
Re,
|
|
244
301
|
!1,
|
|
245
302
|
null,
|
|
246
303
|
"3d4802ff"
|
|
247
304
|
);
|
|
248
|
-
const
|
|
305
|
+
const Fe = we.exports;
|
|
249
306
|
export {
|
|
250
307
|
c as B,
|
|
251
|
-
|
|
308
|
+
i as a,
|
|
252
309
|
O as b,
|
|
253
|
-
|
|
310
|
+
Fe as c
|
|
254
311
|
};
|
|
255
|
-
//# sourceMappingURL=code-snippet.
|
|
312
|
+
//# sourceMappingURL=code-snippet.BVpFBhKq.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-snippet.YIm2oO_o.js","sources":["../../src/components/code-snippet/highlight.ts","../../src/components/code-snippet/code-snippet.types.ts","../../../../node_modules/.pnpm/codemirror-lang-csv@0.1.1/node_modules/codemirror-lang-csv/dist/index.js","../../src/components/code-snippet/utils/get-lang-loader.ts","../../src/components/code-snippet/utils/indent-same-as-line-before-extension.ts","../../src/components/code-snippet/code-snippet.vue"],"sourcesContent":["import { HighlightStyle, syntaxHighlighting } from '@codemirror/language';\nimport { tags as t } from '@lezer/highlight';\nimport {\n BColorLabelOnBackgroundCriticalWeak,\n BColorLabelOnBackgroundHighlightWeak,\n BColorLabelOnBackgroundSuccessWeak,\n BColorLabelOnBackgroundWarningWeak,\n} from '@adyen/bento-design-tokens/dist/js/bento/es6';\nimport { type BentoCodeSnippetSupportedLanguage } from './code-snippet.types';\n\nconst lightThemeColors = {\n red: BColorLabelOnBackgroundCriticalWeak,\n orange: BColorLabelOnBackgroundWarningWeak,\n green: BColorLabelOnBackgroundSuccessWeak,\n blue: BColorLabelOnBackgroundHighlightWeak,\n invalid: '#ffffff',\n};\n\nconst highlightStyle = (colors, language: BentoCodeSnippetSupportedLanguage | `${BentoCodeSnippetSupportedLanguage}`) =>\n HighlightStyle.define([\n {\n tag: t.keyword,\n color: colors.red,\n },\n {\n tag: [t.name, t.deleted, t.character, t.propertyName, t.macroName],\n color: colors.green,\n },\n {\n tag: [t.function(t.variableName), t.labelName],\n color: colors.blue,\n },\n {\n tag: [t.color, t.constant(t.name), t.standard(t.name)],\n color: colors.red,\n },\n {\n tag: [t.definition(t.name), ...(language !== 'json' ? [t.separator] : [])],\n color: colors.red,\n },\n {\n tag: [t.typeName, t.className, t.number, t.changed, t.annotation, t.modifier, t.self, t.namespace],\n color: colors.orange,\n },\n {\n tag: [t.operator, t.operatorKeyword, t.url, t.escape, t.regexp, t.link, t.special(t.string)],\n color: colors.blue,\n },\n {\n tag: [t.meta, t.comment],\n color: colors.orange,\n },\n {\n tag: t.strong,\n fontWeight: 'bold',\n },\n {\n tag: t.emphasis,\n fontStyle: 'italic',\n },\n {\n tag: t.strikethrough,\n textDecoration: 'line-through',\n },\n {\n tag: t.link,\n color: colors.orange,\n textDecoration: 'underline',\n },\n {\n tag: t.heading,\n fontWeight: 'bold',\n color: colors.blue,\n },\n {\n tag: [t.atom, t.bool, t.special(t.variableName)],\n color: colors.red,\n },\n {\n tag: [t.processingInstruction, t.string, t.inserted],\n color: colors.blue,\n },\n {\n tag: t.invalid,\n color: colors.invalid,\n },\n ]);\n\nexport const lightThemeHighlight = (\n language: BentoCodeSnippetSupportedLanguage | `${BentoCodeSnippetSupportedLanguage}`\n) => syntaxHighlighting(highlightStyle(lightThemeColors, language));\n","/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCodeSnippetVariant {\n INLINE = 'inline',\n SINGLELINE = 'singleline',\n MULTILINE = 'multiline',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCodeSnippetSupportedLanguage {\n JSON = 'json',\n XML = 'xml',\n JAVA = 'java',\n JAVASCRIPT = 'javascript',\n PYTHON = 'python',\n CSV = 'csv',\n}\n\nexport enum BentoCodeSnippetEvent {\n ACTION = 'action',\n CHANGE = 'change',\n}\n\nexport interface BentoCodeSnippetProps {\n /**\n * Displays a button that when clicked will emit an action event\n * Leaves to the parent component the logic of what to do with it\n */\n actionable?: boolean;\n\n /**\n * Displays a button that when clicked will emit a run event\n * Leaves to the parent component the logic of what to do with it\n */\n actionableText?: string;\n\n /**\n * The code content\n */\n content?: string;\n\n /**\n * Displays a button that can expand the codeblock into a modal to easily\n * view large blocks of code.\n */\n expandable?: boolean;\n\n /**\n * Allows editing of the code-snippet content by the user\n */\n editable?: boolean;\n\n /**\n * Language name for syntax highlighting rules\n */\n lang?: BentoCodeSnippetSupportedLanguage | `${BentoCodeSnippetSupportedLanguage}`;\n\n /**\n * Label to show in the action-bar, describing the language\n */\n langLabel?: string;\n\n /**\n * Toggles the loading indicator within the action bar\n */\n loading?: boolean;\n\n /**\n * Defines the variant of code-snippet\n */\n variant?: BentoCodeSnippetVariant | `${BentoCodeSnippetVariant}`;\n}\n","import { LRParser } from '@lezer/lr';\nimport { LRLanguage, LanguageSupport } from '@codemirror/language';\nimport { styleTags, tags } from '@lezer/highlight';\n\n// This file was generated by lezer-generator. You probably shouldn't edit it.\nconst parser = LRParser.deserialize({\n version: 14,\n states: \"nQVQPOOOOQO'#Ce'#CeOOQO'#Ca'#CaQVQPOOOOQO-E6_-E6_\",\n stateData: \"g~OWOS~OQPORPOSPO~OQRSR~\",\n goto: \"eYPPPPPZPPPaQRORSRTQOR\",\n nodeNames: \"⚠ Program String Separator Value\",\n maxTerm: 9,\n skippedNodes: [0],\n repeatNodeCount: 1,\n tokenData: \"'Y~RZOYtYZ!cZrtrs!hs|t|}'T}!]t!]!^'T!^;'St;'S;=`!]<%lOt~yUS~OYtZ|t}!]t!^;'St;'S;=`!]<%lOt~!`P;=`<%lt~!hOW~~!m]S~OY!hYZ#fZr!hrs%Ss|!h|}#f}!]!h!]!^#f!^#O!h#O#P%m#P;'S!h;'S;=`&}<%lO!h~#iVOr#frs$Os#O#f#O#P$T#P;'S#f;'S;=`$|<%lO#f~$TOQ~~$WRO;'S#f;'S;=`$a;=`O#f~$dWOr#frs$Os#O#f#O#P$T#P;'S#f;'S;=`$|;=`<%l#f<%lO#f~%PP;=`<%l#f~%ZUQ~S~OYtZ|t}!]t!^;'St;'S;=`!]<%lOt~%rYS~OY!hYZ#fZ|!h|}#f}!]!h!]!^#f!^;'S!h;'S;=`&b;=`<%l#f<%lO!h~&eWOr#frs$Os#O#f#O#P$T#P;'S#f;'S;=`$|;=`<%l!h<%lO#f~'QP;=`<%l!h~'YOR~\",\n tokenizers: [0],\n topRules: {\"Program\":[0,1]},\n tokenPrec: 18\n});\n\nconst csvLanguage = LRLanguage.define({\n parser: parser.configure({\n props: [\n styleTags({\n Separator: tags.separator,\n Value: tags.string,\n String: tags.string,\n LineComment: tags.lineComment,\n \"( )\": tags.paren,\n }),\n ],\n }),\n});\nfunction csv() {\n return new LanguageSupport(csvLanguage);\n}\n\nexport { csv, csvLanguage };\n","import { BentoCodeSnippetSupportedLanguage } from '@/components/code-snippet/code-snippet.types';\nimport { json } from '@codemirror/lang-json';\nimport { xml } from '@codemirror/lang-xml';\nimport { javascript } from '@codemirror/lang-javascript';\nimport { java } from '@codemirror/lang-java';\nimport { python } from '@codemirror/lang-python';\nimport { csv } from 'codemirror-lang-csv';\nimport type { LanguageSupport } from '@codemirror/language';\n\n/**\n * TODO: This should be handled with dynamic imports,\n * without relying on importing every single language/package available.\n * These supported types need to be kept in line with the ones in packages/vue2/src/components/code-snippet/code-snippet.types.ts enum\n */\nconst importsMap: Record<BentoCodeSnippetSupportedLanguage, () => LanguageSupport> = {\n [BentoCodeSnippetSupportedLanguage.JSON]: json,\n [BentoCodeSnippetSupportedLanguage.XML]: xml,\n [BentoCodeSnippetSupportedLanguage.JAVASCRIPT]: javascript,\n [BentoCodeSnippetSupportedLanguage.JAVA]: java,\n [BentoCodeSnippetSupportedLanguage.PYTHON]: python,\n [BentoCodeSnippetSupportedLanguage.CSV]: csv,\n};\n\n/**\n * Returns a language loder for `CodeMirror`.\n * Supported languages: json, xml, javascript & java\n *\n * @param language Language to be used\n * @returns Language configuration loader to be used in codemirror\n */\nexport const getLangLoader = (language: BentoCodeSnippetSupportedLanguage | `${BentoCodeSnippetSupportedLanguage}`) => {\n const loadLang = async () => importsMap[language];\n\n return loadLang;\n};\n","import { EditorSelection, type EditorState, type SelectionRange } from '@codemirror/state';\n\n/**\n * Calculate indentation for a new line based on line before it.\n * @param state - The editor state\n * @param line - the selection range, in this case one line\n * @returns the indentation string to be pre-pended on a new line.\n */\nconst getIndentation = (state: EditorState, line: SelectionRange) => {\n const currentLine = state.doc.lineAt(line.from);\n const indentMatch = /^\\s*/.exec(currentLine.text);\n return indentMatch ? indentMatch[0] : '';\n};\n\n/**\n * This extension to codemirror will, upon pressing the 'Enter' key, indent the new line\n * the same as the line before it.\n */\nexport const INDENT_SAME_AS_LINE_BEFORE = {\n key: 'Enter',\n run: ({ state, dispatch }) => {\n const changes = state.changeByRange(range => {\n const indentation = getIndentation(state, range);\n const newText = `\\n${indentation}`;\n return {\n changes: { from: range.from, to: range.to, insert: newText },\n range: EditorSelection.cursor(range.from + newText.length),\n };\n });\n dispatch(state.update(changes, { scrollIntoView: true, userEvent: 'input' }));\n return true;\n },\n};\n\nexport default INDENT_SAME_AS_LINE_BEFORE;\n","<template>\n <div class=\"b-code-snippet\" :class=\"conditionalClasses\">\n <section v-if=\"!isInlineVariant\" class=\"b-code-snippet__action-bar\">\n <div class=\"b-code-snippet__action-bar--start\">\n <bento-dropdown\n v-if=\"availableLanguages.length > 0\"\n v-model=\"selectedLanguage\"\n v-bind=\"$props\"\n :disabled=\"availableLanguages.length === 1\"\n :items=\"availableLanguages\"\n class=\"b-code-snippet__language-picker\"\n @input=\"handleChangeLanguage\"\n />\n <bento-typography el=\"span\" stronger>\n {{ displayedLang }}\n </bento-typography>\n </div>\n <div class=\"b-code-snippet__action-bar--end\">\n <bento-loading-indicator v-if=\"loading\" />\n <copy v-if=\"currentContents !== null\" class=\"b-structured-list__icon\" :text=\"currentContents\" />\n <bento-button\n v-if=\"expandable\"\n variant=\"tertiary\"\n condensed\n :aria-label=\"t('expand')\"\n @click=\"showModal = true\"\n >\n <template #iconLeft>\n <expand-icon />\n </template>\n </bento-button>\n <bento-button v-if=\"actionable\" variant=\"primary\" tertiary condensed @click=\"onActionClicked\">\n <template #iconLeft>\n <bento-typography el=\"span\" class=\"b-code-snippet__action-button\">\n {{ runText }}\n </bento-typography>\n </template>\n </bento-button>\n </div>\n </section>\n <code v-if=\"content || editable\" class=\"b-code-snippet__code-area\">\n <div ref=\"container\" class=\"b-code-snippet__code-area-content\" :class=\"codeAreaContentConditionalClasses\" />\n </code>\n <section v-else>\n <slot name=\"empty-state\">\n <!-- TODO: switch with empty-state component when ready -->\n <div class=\"b-code-snippet__empty-state\">{{ t('nothingToDisplay') }}</div>\n </slot>\n </section>\n <base-modal\n v-if=\"expandable\"\n class=\"b-code-snippet__modal\"\n :hide-close-button=\"true\"\n :custom-padding=\"'0px'\"\n :is-dismissible=\"true\"\n :is-open=\"showModal\"\n size=\"large\"\n @close-modal=\"showModal = false\"\n >\n <template #content>\n <bento-code-snippet v-bind=\"{ ...$props, expandable: false }\" />\n </template>\n </base-modal>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, type HTMLAttributes, onMounted, ref, shallowRef, useAttrs, watch, watchEffect } from 'vue';\n import { EditorView, highlightActiveLine, keymap, lineNumbers } from '@codemirror/view';\n import { Compartment, EditorState } from '@codemirror/state';\n import { history, indentWithTab } from '@codemirror/commands';\n import { lightThemeHighlight } from './highlight';\n import { getLangLoader, INDENT_SAME_AS_LINE_BEFORE } from './utils';\n import { BentoDropdown } from '@/components/dropdown';\n import { BentoButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import { useI18n } from '@/utils/ts/i18n';\n import { Copy } from '@/internal';\n import {\n BentoCodeSnippetEvent,\n type BentoCodeSnippetProps,\n BentoCodeSnippetSupportedLanguage,\n BentoCodeSnippetVariant,\n } from './code-snippet.types';\n import ExpandIcon from '@adyen/ui-assets-icons-16/vue/expand';\n import BaseModal from '@/components/modal/components/base-modal/base-modal.vue';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n actionable: { type: Boolean, default: false },\n actionableText: { default: null },\n content: { default: '' },\n expandable: { type: Boolean, default: false },\n editable: { type: Boolean, default: false },\n lang: { default: BentoCodeSnippetSupportedLanguage.JSON },\n langLabel: { default: null },\n loading: { type: Boolean, default: false },\n variant: { default: BentoCodeSnippetVariant.MULTILINE }\n});\n\n const emit = defineEmits([BentoCodeSnippetEvent.ACTION, BentoCodeSnippetEvent.CHANGE]);\n\n const attrs = useAttrs();\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n // language\n const selectedLanguage = ref<string | null>(null);\n const availableLanguages = []; // TODO: implement\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n const handleChangeLanguage = () => {};\n const displayedLang = computed(() => props.langLabel ?? props.lang.toUpperCase());\n\n const isInlineVariant = computed(() => props.variant === BentoCodeSnippetVariant.INLINE);\n\n const conditionalClasses = computed(() => ({\n 'b-code-snippet--inline': isInlineVariant.value,\n 'b-code-snippet--scrollable': !isInlineVariant.value,\n }));\n\n const codeAreaContentConditionalClasses = computed(() => ({\n 'b-code-snippet__code-area-content--editable': props.editable,\n }));\n\n const loadLang = getLangLoader(props.lang);\n\n const container = shallowRef<HTMLDivElement>();\n const editor = shallowRef<EditorView>();\n const languageConf = new Compartment();\n const editorTheme = new Compartment();\n const editorReadOnly = new Compartment();\n const editorAttributes = new Compartment();\n\n const currentContents = ref(null);\n const contentLength = ref(0);\n\n const runText = computed(() => props.actionableText || t('run'));\n\n onMounted(async () => {\n const language = await loadLang();\n\n // alongside the updateListener plugin it acts as a watcher of changes to the editor state\n currentContents.value = props.content;\n const updateCurrentContents = ({ state }) => {\n currentContents.value = state.doc.toString();\n };\n\n const extensions = [\n highlightActiveLine(),\n keymap.of([indentWithTab, INDENT_SAME_AS_LINE_BEFORE]),\n languageConf.of(language()),\n editorTheme.of(lightThemeHighlight(props.lang)),\n editorReadOnly.of(EditorState.readOnly.of(!props.editable)),\n editorAttributes.of(\n EditorView.contentAttributes.of({\n 'aria-label': (attrs['aria-label'] as HTMLAttributes['aria-label']) ?? t('codeSnippet'),\n ...(!isInlineVariant.value && { tabindex: '0' }),\n })\n ),\n EditorView.updateListener.of(content => updateCurrentContents(content)),\n ];\n\n if (props.variant === 'multiline') {\n extensions.push([lineNumbers(), history()]);\n }\n\n const state = EditorState.create({\n doc: props.content,\n extensions: [...extensions],\n });\n contentLength.value = state.doc.length;\n\n editor.value = new EditorView({\n state,\n parent: container.value,\n });\n });\n watch(\n () => props.content,\n () => {\n if (props.content !== currentContents.value) {\n const upcomingContentLength = props.content.length;\n editor.value.dispatch({\n changes: {\n from: 0,\n to: contentLength.value,\n insert: props.content,\n },\n });\n contentLength.value = upcomingContentLength;\n }\n }\n );\n\n const onActionClicked = () => {\n emit(BentoCodeSnippetEvent.ACTION, currentContents.value);\n };\n\n watchEffect(() => {\n if (currentContents.value !== null) {\n emit(BentoCodeSnippetEvent.CHANGE, currentContents.value);\n }\n });\n\n const showModal = ref(false);\n</script>\n\n<script lang=\"ts\">\n /**\n * A code-snippet is a container to display code in a readable way.\n * Come with added functionalities like syntax highlighting, editing and actioning the code\n *\n * @example\n * import { BentoCodeSnippet } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCodeSnippet },\n * template: `\n * <bento-code-snippet :variant=\"BentoCodeSnippetVariant.MULTILINE\" content=\"{ example: 1234 }\" />\n * `\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-code-snippet',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./code-snippet.scss\"></style>\n"],"names":["lightThemeColors","BColorLabelOnBackgroundCriticalWeak","BColorLabelOnBackgroundWarningWeak","BColorLabelOnBackgroundSuccessWeak","BColorLabelOnBackgroundHighlightWeak","highlightStyle","colors","language","HighlightStyle","tags","lightThemeHighlight","syntaxHighlighting","BentoCodeSnippetVariant","BentoCodeSnippetVariant2","BentoCodeSnippetSupportedLanguage","BentoCodeSnippetSupportedLanguage2","BentoCodeSnippetEvent","BentoCodeSnippetEvent2","parser","LRParser","csvLanguage","LRLanguage","styleTags","csv","LanguageSupport","importsMap","json","xml","javascript","java","python","getLangLoader","getIndentation","state","line","currentLine","indentMatch","INDENT_SAME_AS_LINE_BEFORE","dispatch","changes","range","newText","EditorSelection","__default__","messages","attrs","useAttrs","t","useI18n","selectedLanguage","ref","availableLanguages","handleChangeLanguage","displayedLang","computed","props","isInlineVariant","conditionalClasses","codeAreaContentConditionalClasses","loadLang","container","shallowRef","editor","languageConf","Compartment","editorTheme","editorReadOnly","editorAttributes","currentContents","contentLength","runText","onMounted","updateCurrentContents","state2","extensions","highlightActiveLine","keymap","indentWithTab","EditorState","EditorView","content","lineNumbers","history","watch","upcomingContentLength","onActionClicked","emit","watchEffect","showModal"],"mappings":";;;;;;;;;;;;;AAUA,MAAAA,KAAA;AAAA,EAAyB,KAAAC;AAAA,EAChB,QAAAC;AAAA,EACG,OAAAC;AAAA,EACD,MAAAC;AAAA,EACD,SAAA;AAEV,GAEAC,KAAA,CAAAC,GAAAC,MAAAC,EAAA,OAAA;AAAA,EAC0B;AAAA,IAClB,KAAAC,EAAA;AAAA,IACW,OAAAH,EAAA;AAAA,EACO;AAAA,EAClB;AAAA,IACA,KAAA,CAAAG,EAAA,MAAAA,EAAA,SAAAA,EAAA,WAAAA,EAAA,cAAAA,EAAA,SAAA;AAAA,IACqE,OAAAH,EAAA;AAAA,EACnD;AAAA,EAClB;AAAA,IACA,KAAA,CAAAG,EAAA,SAAAA,EAAA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AAA;AAAA,YAC0D,GAAA,CAAAS,EAAA,SAAA,EAAA,UAAA,IAAA;AAAA,UACxC,CAAA;AAAA,QACjD;AAAA,QACLuB,EAAA,eAAA,GAAA,CAAAC,MAAAR,EAAAQ,CAAA,CAAA;AAAA,MACsE;AAG1E,MAAAzB,EAAA,YAAA,eACImB,EAAA,KAAA,CAAAO,GAAA,GAAAC,GAAA,CAAA,CAAA;AAGJ,YAAAjD,IAAA6C,EAAA,OAAA;AAAA,QAAiC,KAAAvB,EAAA;AAAA,QAClB,YAAA,CAAA,GAAAmB,CAAA;AAAA,MACe,CAAA;AAE9B,MAAAL,EAAA,QAAApC,EAAA,IAAA,QAEA6B,EAAA,QAAA,IAAAiB,EAAA;AAAA,QAA8B,OAAA9C;AAAA,QAC1B,QAAA2B,EAAA;AAAA,MACkB,CAAA;AAAA,IACrB,CAAA,GAELuB;AAAA,MAAA,MAAA5B,EAAA;AAAA,MACgB,MAAA;AAER,YAAAA,EAAA,YAAAa,EAAA,OAAA;AACI,gBAAAgB,IAAA7B,EAAA,QAAA;AACA,UAAAO,EAAA,MAAA,SAAA;AAAA,YAAsB,SAAA;AAAA,cACT,MAAA;AAAA,cACC,IAAAO,EAAA;AAAA,cACY,QAAAd,EAAA;AAAA,YACJ;AAAA,UAClB,CAAA,GAEJc,EAAA,QAAAe;AAAA,QAAsB;AAAA,MAC1B;AAAA,IACJ;AAGJ,UAAAC,IAAA,MAAA;AACI,MAAAC,EAAAtE,EAAA,QAAAoD,EAAA,KAAA;AAAA,IAAwD;AAG5D,IAAAmB,EAAA,MAAA;AACI,MAAAnB,EAAA,UAAA,QACIkB,EAAAtE,EAAA,QAAAoD,EAAA,KAAA;AAAA,IACJ,CAAA;AAGJ,UAAAoB,IAAAtC,EAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[2]}
|
|
1
|
+
{"version":3,"file":"code-snippet.BVpFBhKq.js","sources":["../../src/components/code-snippet/highlight.ts","../../src/components/code-snippet/code-snippet.types.ts","../../../../node_modules/.pnpm/codemirror-lang-csv@0.1.1/node_modules/codemirror-lang-csv/dist/index.js","../../src/components/code-snippet/utils/get-lang-loader.ts","../../src/components/code-snippet/utils/indent-same-as-line-before-extension.ts","../../src/components/code-snippet/code-snippet.vue"],"sourcesContent":["import { HighlightStyle, syntaxHighlighting } from '@codemirror/language';\nimport { tags as t } from '@lezer/highlight';\nimport {\n BColorLabelOnBackgroundCriticalWeak,\n BColorLabelOnBackgroundHighlightWeak,\n BColorLabelOnBackgroundSuccessWeak,\n BColorLabelOnBackgroundWarningWeak,\n} from '@adyen/bento-design-tokens/dist/js/bento/es6';\nimport { type BentoCodeSnippetSupportedLanguage } from './code-snippet.types';\n\nconst lightThemeColors = {\n red: BColorLabelOnBackgroundCriticalWeak,\n orange: BColorLabelOnBackgroundWarningWeak,\n green: BColorLabelOnBackgroundSuccessWeak,\n blue: BColorLabelOnBackgroundHighlightWeak,\n invalid: '#ffffff',\n};\n\nconst highlightStyle = (colors, language: BentoCodeSnippetSupportedLanguage | `${BentoCodeSnippetSupportedLanguage}`) =>\n HighlightStyle.define([\n {\n tag: t.keyword,\n color: colors.red,\n },\n {\n tag: [t.name, t.deleted, t.character, t.propertyName, t.macroName],\n color: colors.green,\n },\n {\n tag: [t.function(t.variableName), t.labelName],\n color: colors.blue,\n },\n {\n tag: [t.color, t.constant(t.name), t.standard(t.name)],\n color: colors.red,\n },\n {\n tag: [t.definition(t.name), ...(language !== 'json' ? [t.separator] : [])],\n color: colors.red,\n },\n {\n tag: [t.typeName, t.className, t.number, t.changed, t.annotation, t.modifier, t.self, t.namespace],\n color: colors.orange,\n },\n {\n tag: [t.operator, t.operatorKeyword, t.url, t.escape, t.regexp, t.link, t.special(t.string)],\n color: colors.blue,\n },\n {\n tag: [t.meta, t.comment],\n color: colors.orange,\n },\n {\n tag: t.strong,\n fontWeight: 'bold',\n },\n {\n tag: t.emphasis,\n fontStyle: 'italic',\n },\n {\n tag: t.strikethrough,\n textDecoration: 'line-through',\n },\n {\n tag: t.link,\n color: colors.orange,\n textDecoration: 'underline',\n },\n {\n tag: t.heading,\n fontWeight: 'bold',\n color: colors.blue,\n },\n {\n tag: [t.atom, t.bool, t.special(t.variableName)],\n color: colors.red,\n },\n {\n tag: [t.processingInstruction, t.string, t.inserted],\n color: colors.blue,\n },\n {\n tag: t.invalid,\n color: colors.invalid,\n },\n ]);\n\nexport const lightThemeHighlight = (\n language: BentoCodeSnippetSupportedLanguage | `${BentoCodeSnippetSupportedLanguage}`\n) => syntaxHighlighting(highlightStyle(lightThemeColors, language));\n","/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCodeSnippetVariant {\n INLINE = 'inline',\n SINGLELINE = 'singleline',\n MULTILINE = 'multiline',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCodeSnippetSupportedLanguage {\n JSON = 'json',\n XML = 'xml',\n JAVA = 'java',\n JAVASCRIPT = 'javascript',\n PYTHON = 'python',\n CSV = 'csv',\n}\n\nexport enum BentoCodeSnippetEvent {\n ACTION = 'action',\n CHANGE = 'change',\n}\n\nexport interface BentoCodeSnippetProps {\n /**\n * Displays a button that when clicked will emit an action event\n * Leaves to the parent component the logic of what to do with it\n */\n actionable?: boolean;\n\n /**\n * Displays a button that when clicked will emit a run event\n * Leaves to the parent component the logic of what to do with it\n */\n actionableText?: string;\n\n /**\n * The code content\n */\n content?: string;\n\n /**\n * Displays a button that can expand the codeblock into a modal to easily\n * view large blocks of code.\n */\n expandable?: boolean;\n\n /**\n * Allows editing of the code-snippet content by the user\n */\n editable?: boolean;\n\n /**\n * Language name for syntax highlighting rules\n */\n lang?: BentoCodeSnippetSupportedLanguage | `${BentoCodeSnippetSupportedLanguage}`;\n\n /**\n * Label to show in the action-bar, describing the language\n */\n langLabel?: string;\n\n /**\n * Toggles the loading indicator within the action bar\n */\n loading?: boolean;\n\n /**\n * Defines the variant of code-snippet\n */\n variant?: BentoCodeSnippetVariant | `${BentoCodeSnippetVariant}`;\n}\n","import { LRParser } from '@lezer/lr';\nimport { LRLanguage, LanguageSupport } from '@codemirror/language';\nimport { styleTags, tags } from '@lezer/highlight';\n\n// This file was generated by lezer-generator. You probably shouldn't edit it.\nconst parser = LRParser.deserialize({\n version: 14,\n states: \"nQVQPOOOOQO'#Ce'#CeOOQO'#Ca'#CaQVQPOOOOQO-E6_-E6_\",\n stateData: \"g~OWOS~OQPORPOSPO~OQRSR~\",\n goto: \"eYPPPPPZPPPaQRORSRTQOR\",\n nodeNames: \"⚠ Program String Separator Value\",\n maxTerm: 9,\n skippedNodes: [0],\n repeatNodeCount: 1,\n tokenData: \"'Y~RZOYtYZ!cZrtrs!hs|t|}'T}!]t!]!^'T!^;'St;'S;=`!]<%lOt~yUS~OYtZ|t}!]t!^;'St;'S;=`!]<%lOt~!`P;=`<%lt~!hOW~~!m]S~OY!hYZ#fZr!hrs%Ss|!h|}#f}!]!h!]!^#f!^#O!h#O#P%m#P;'S!h;'S;=`&}<%lO!h~#iVOr#frs$Os#O#f#O#P$T#P;'S#f;'S;=`$|<%lO#f~$TOQ~~$WRO;'S#f;'S;=`$a;=`O#f~$dWOr#frs$Os#O#f#O#P$T#P;'S#f;'S;=`$|;=`<%l#f<%lO#f~%PP;=`<%l#f~%ZUQ~S~OYtZ|t}!]t!^;'St;'S;=`!]<%lOt~%rYS~OY!hYZ#fZ|!h|}#f}!]!h!]!^#f!^;'S!h;'S;=`&b;=`<%l#f<%lO!h~&eWOr#frs$Os#O#f#O#P$T#P;'S#f;'S;=`$|;=`<%l!h<%lO#f~'QP;=`<%l!h~'YOR~\",\n tokenizers: [0],\n topRules: {\"Program\":[0,1]},\n tokenPrec: 18\n});\n\nconst csvLanguage = LRLanguage.define({\n parser: parser.configure({\n props: [\n styleTags({\n Separator: tags.separator,\n Value: tags.string,\n String: tags.string,\n LineComment: tags.lineComment,\n \"( )\": tags.paren,\n }),\n ],\n }),\n});\nfunction csv() {\n return new LanguageSupport(csvLanguage);\n}\n\nexport { csv, csvLanguage };\n","import { BentoCodeSnippetSupportedLanguage } from '@/components/code-snippet/code-snippet.types';\nimport { json } from '@codemirror/lang-json';\nimport { xml } from '@codemirror/lang-xml';\nimport { javascript } from '@codemirror/lang-javascript';\nimport { java } from '@codemirror/lang-java';\nimport { python } from '@codemirror/lang-python';\nimport { csv } from 'codemirror-lang-csv';\nimport type { LanguageSupport } from '@codemirror/language';\n\n/**\n * TODO: This should be handled with dynamic imports,\n * without relying on importing every single language/package available.\n * These supported types need to be kept in line with the ones in packages/vue2/src/components/code-snippet/code-snippet.types.ts enum\n */\nconst importsMap: Record<BentoCodeSnippetSupportedLanguage, () => LanguageSupport> = {\n [BentoCodeSnippetSupportedLanguage.JSON]: json,\n [BentoCodeSnippetSupportedLanguage.XML]: xml,\n [BentoCodeSnippetSupportedLanguage.JAVASCRIPT]: javascript,\n [BentoCodeSnippetSupportedLanguage.JAVA]: java,\n [BentoCodeSnippetSupportedLanguage.PYTHON]: python,\n [BentoCodeSnippetSupportedLanguage.CSV]: csv,\n};\n\n/**\n * Returns a language loder for `CodeMirror`.\n * Supported languages: json, xml, javascript & java\n *\n * @param language Language to be used\n * @returns Language configuration loader to be used in codemirror\n */\nexport const getLangLoader = (language: BentoCodeSnippetSupportedLanguage | `${BentoCodeSnippetSupportedLanguage}`) => {\n const loadLang = async () => importsMap[language];\n\n return loadLang;\n};\n","import { EditorSelection, type EditorState, type SelectionRange } from '@codemirror/state';\n\n/**\n * Calculate indentation for a new line based on line before it.\n * @param state - The editor state\n * @param line - the selection range, in this case one line\n * @returns the indentation string to be pre-pended on a new line.\n */\nconst getIndentation = (state: EditorState, line: SelectionRange) => {\n const currentLine = state.doc.lineAt(line.from);\n const indentMatch = /^\\s*/.exec(currentLine.text);\n return indentMatch ? indentMatch[0] : '';\n};\n\n/**\n * This extension to codemirror will, upon pressing the 'Enter' key, indent the new line\n * the same as the line before it.\n */\nexport const INDENT_SAME_AS_LINE_BEFORE = {\n key: 'Enter',\n run: ({ state, dispatch }) => {\n const changes = state.changeByRange(range => {\n const indentation = getIndentation(state, range);\n const newText = `\\n${indentation}`;\n return {\n changes: { from: range.from, to: range.to, insert: newText },\n range: EditorSelection.cursor(range.from + newText.length),\n };\n });\n dispatch(state.update(changes, { scrollIntoView: true, userEvent: 'input' }));\n return true;\n },\n};\n\nexport default INDENT_SAME_AS_LINE_BEFORE;\n","<template>\n <div class=\"b-code-snippet\" :class=\"conditionalClasses\">\n <section v-if=\"!isInlineVariant\" class=\"b-code-snippet__action-bar\">\n <div class=\"b-code-snippet__action-bar--start\">\n <bento-dropdown\n v-if=\"availableLanguages.length > 0\"\n v-model=\"selectedLanguage\"\n v-bind=\"$props\"\n :disabled=\"availableLanguages.length === 1\"\n :items=\"availableLanguages\"\n class=\"b-code-snippet__language-picker\"\n @input=\"handleChangeLanguage\"\n />\n <bento-typography el=\"span\" stronger>\n {{ displayedLang }}\n </bento-typography>\n </div>\n <div class=\"b-code-snippet__action-bar--end\">\n <bento-loading-indicator v-if=\"loading\" />\n <copy v-if=\"currentContents !== null\" class=\"b-structured-list__icon\" :text=\"currentContents\" />\n <bento-button\n v-if=\"expandable\"\n variant=\"tertiary\"\n condensed\n :aria-label=\"t('expand')\"\n @click=\"showModal = true\"\n >\n <template #iconLeft>\n <expand-icon />\n </template>\n </bento-button>\n <bento-button v-if=\"actionable\" variant=\"primary\" tertiary condensed @click=\"onActionClicked\">\n <template #iconLeft>\n <bento-typography el=\"span\" class=\"b-code-snippet__action-button\">\n {{ runText }}\n </bento-typography>\n </template>\n </bento-button>\n </div>\n </section>\n <code v-if=\"content || editable\" class=\"b-code-snippet__code-area\">\n <div ref=\"container\" class=\"b-code-snippet__code-area-content\" :class=\"codeAreaContentConditionalClasses\" />\n </code>\n <section v-else>\n <slot name=\"empty-state\">\n <!-- TODO: switch with empty-state component when ready -->\n <div class=\"b-code-snippet__empty-state\">{{ t('nothingToDisplay') }}</div>\n </slot>\n </section>\n <base-modal\n v-if=\"expandable\"\n class=\"b-code-snippet__modal\"\n :hide-close-button=\"true\"\n :custom-padding=\"'0px'\"\n :is-dismissible=\"true\"\n :is-open=\"showModal\"\n size=\"large\"\n @close-modal=\"showModal = false\"\n >\n <template #content>\n <bento-code-snippet v-bind=\"{ ...$props, expandable: false }\" />\n </template>\n </base-modal>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, type HTMLAttributes, onMounted, ref, shallowRef, useAttrs, watch, watchEffect } from 'vue';\n import { EditorView, highlightActiveLine, keymap, lineNumbers } from '@codemirror/view';\n import { Compartment, EditorState } from '@codemirror/state';\n import { history, indentWithTab } from '@codemirror/commands';\n import { lightThemeHighlight } from './highlight';\n import { getLangLoader, INDENT_SAME_AS_LINE_BEFORE } from './utils';\n import { BentoDropdown } from '@/components/dropdown';\n import { BentoButton } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import { useI18n } from '@/utils/ts/i18n';\n import { Copy } from '@/internal';\n import {\n BentoCodeSnippetEvent,\n type BentoCodeSnippetProps,\n BentoCodeSnippetSupportedLanguage,\n BentoCodeSnippetVariant,\n } from './code-snippet.types';\n import ExpandIcon from '@adyen/ui-assets-icons-16/vue/expand';\n import BaseModal from '@/components/modal/components/base-modal/base-modal.vue';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n actionable: { type: Boolean, default: false },\n actionableText: { default: null },\n content: { default: '' },\n expandable: { type: Boolean, default: false },\n editable: { type: Boolean, default: false },\n lang: { default: BentoCodeSnippetSupportedLanguage.JSON },\n langLabel: { default: null },\n loading: { type: Boolean, default: false },\n variant: { default: BentoCodeSnippetVariant.MULTILINE }\n});\n\n const emit = defineEmits([BentoCodeSnippetEvent.ACTION, BentoCodeSnippetEvent.CHANGE]);\n\n const attrs = useAttrs();\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n // language\n const selectedLanguage = ref<string | null>(null);\n const availableLanguages = []; // TODO: implement\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n const handleChangeLanguage = () => {};\n const displayedLang = computed(() => props.langLabel ?? props.lang.toUpperCase());\n\n const isInlineVariant = computed(() => props.variant === BentoCodeSnippetVariant.INLINE);\n\n const conditionalClasses = computed(() => ({\n 'b-code-snippet--inline': isInlineVariant.value,\n 'b-code-snippet--scrollable': !isInlineVariant.value,\n }));\n\n const codeAreaContentConditionalClasses = computed(() => ({\n 'b-code-snippet__code-area-content--editable': props.editable,\n }));\n\n const loadLang = getLangLoader(props.lang);\n\n const container = shallowRef<HTMLDivElement>();\n const editor = shallowRef<EditorView>();\n const languageConf = new Compartment();\n const editorTheme = new Compartment();\n const editorReadOnly = new Compartment();\n const editorAttributes = new Compartment();\n\n const currentContents = ref(null);\n const contentLength = ref(0);\n\n const runText = computed(() => props.actionableText || t('run'));\n\n onMounted(async () => {\n const language = await loadLang();\n\n // alongside the updateListener plugin it acts as a watcher of changes to the editor state\n currentContents.value = props.content;\n const updateCurrentContents = ({ state }) => {\n currentContents.value = state.doc.toString();\n };\n\n const extensions = [\n highlightActiveLine(),\n keymap.of([indentWithTab, INDENT_SAME_AS_LINE_BEFORE]),\n languageConf.of(language()),\n editorTheme.of(lightThemeHighlight(props.lang)),\n editorReadOnly.of(EditorState.readOnly.of(!props.editable)),\n editorAttributes.of(\n EditorView.contentAttributes.of({\n 'aria-label': (attrs['aria-label'] as HTMLAttributes['aria-label']) ?? t('codeSnippet'),\n ...(!isInlineVariant.value && { tabindex: '0' }),\n })\n ),\n EditorView.updateListener.of(content => updateCurrentContents(content)),\n ];\n\n if (props.variant === 'multiline') {\n extensions.push([lineNumbers(), history()]);\n }\n\n const state = EditorState.create({\n doc: props.content,\n extensions: [...extensions],\n });\n contentLength.value = state.doc.length;\n\n editor.value = new EditorView({\n state,\n parent: container.value,\n });\n });\n watch(\n () => props.content,\n () => {\n if (props.content !== currentContents.value) {\n const upcomingContentLength = props.content.length;\n editor.value.dispatch({\n changes: {\n from: 0,\n to: contentLength.value,\n insert: props.content,\n },\n });\n contentLength.value = upcomingContentLength;\n }\n }\n );\n\n const onActionClicked = () => {\n emit(BentoCodeSnippetEvent.ACTION, currentContents.value);\n };\n\n watchEffect(() => {\n if (currentContents.value !== null) {\n emit(BentoCodeSnippetEvent.CHANGE, currentContents.value);\n }\n });\n\n const showModal = ref(false);\n</script>\n\n<script lang=\"ts\">\n /**\n * A code-snippet is a container to display code in a readable way.\n * Come with added functionalities like syntax highlighting, editing and actioning the code\n *\n * @example\n * import { BentoCodeSnippet } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCodeSnippet },\n * template: `\n * <bento-code-snippet :variant=\"BentoCodeSnippetVariant.MULTILINE\" content=\"{ example: 1234 }\" />\n * `\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-code-snippet',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./code-snippet.scss\"></style>\n"],"names":["lightThemeColors","BColorLabelOnBackgroundCriticalWeak","BColorLabelOnBackgroundWarningWeak","BColorLabelOnBackgroundSuccessWeak","BColorLabelOnBackgroundHighlightWeak","highlightStyle","colors","language","HighlightStyle","tags","lightThemeHighlight","syntaxHighlighting","BentoCodeSnippetVariant","BentoCodeSnippetVariant2","BentoCodeSnippetSupportedLanguage","BentoCodeSnippetSupportedLanguage2","BentoCodeSnippetEvent","BentoCodeSnippetEvent2","parser","LRParser","csvLanguage","LRLanguage","styleTags","csv","LanguageSupport","importsMap","json","xml","javascript","java","python","getLangLoader","getIndentation","state","line","currentLine","indentMatch","INDENT_SAME_AS_LINE_BEFORE","dispatch","changes","range","newText","EditorSelection","__default__","messages","attrs","useAttrs","t","useI18n","selectedLanguage","ref","availableLanguages","handleChangeLanguage","displayedLang","computed","props","isInlineVariant","conditionalClasses","codeAreaContentConditionalClasses","loadLang","container","shallowRef","editor","languageConf","Compartment","editorTheme","editorReadOnly","editorAttributes","currentContents","contentLength","runText","onMounted","updateCurrentContents","state2","extensions","highlightActiveLine","keymap","indentWithTab","EditorState","EditorView","content","lineNumbers","history","watch","upcomingContentLength","onActionClicked","emit","watchEffect","showModal"],"mappings":";;;;;;;;;;;;;AAUA,MAAAA,KAAA;AAAA,EAAyB,KAAAC;AAAA,EAChB,QAAAC;AAAA,EACG,OAAAC;AAAA,EACD,MAAAC;AAAA,EACD,SAAA;AAEV,GAEAC,KAAA,CAAAC,GAAAC,MAAAC,EAAA,OAAA;AAAA,EAC0B;AAAA,IAClB,KAAAC,EAAA;AAAA,IACW,OAAAH,EAAA;AAAA,EACO;AAAA,EAClB;AAAA,IACA,KAAA,CAAAG,EAAA,MAAAA,EAAA,SAAAA,EAAA,WAAAA,EAAA,cAAAA,EAAA,SAAA;AAAA,IACqE,OAAAH,EAAA;AAAA,EACnD;AAAA,EAClB;AAAA,IACA,KAAA,CAAAG,EAAA,SAAAA,EAAA,YAAA,GAAAA,EAAA,SAAA;AAAA,IACiD,OAAAH,EAAA;AAAA,EAC/B;AAAA,EAClB;AAAA,IACA,KAAA,CAAAG,EAAA,OAAAA,EAAA,SAAAA,EAAA,IAAA,GAAAA,EAAA,SAAAA,EAAA,IAAA,CAAA;AAAA,IACyD,OAAAH,EAAA;AAAA,EACvC;AAAA,EAClB;AAAA,IACA,KAAA,CAAAG,EAAA,WAAAA,EAAA,IAAA,GAAA,GAAAF,MAAA,SAAA,CAAAE,EAAA,SAAA,IAAA,CAAA,CAAA;AAAA,IAC6E,OAAAH,EAAA;AAAA,EAC3D;AAAA,EAClB;AAAA,IACA,KAAA,CAAAG,EAAA,UAAAA,EAAA,WAAAA,EAAA,QAAAA,EAAA,SAAAA,EAAA,YAAAA,EAAA,UAAAA,EAAA,MAAAA,EAAA,SAAA;AAAA,IACqG,OAAAH,EAAA;AAAA,EACnF;AAAA,EAClB;AAAA,IACA,KAAA,CAAAG,EAAA,UAAAA,EAAA,iBAAAA,EAAA,KAAAA,EAAA,QAAAA,EAAA,QAAAA,EAAA,MAAAA,EAAA,QAAAA,EAAA,MAA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BAAAgB,IAAA7B,EAAA,QAAA;AACA,UAAAO,EAAA,MAAA,SAAA;AAAA,YAAsB,SAAA;AAAA,cACT,MAAA;AAAA,cACC,IAAAO,EAAA;AAAA,cACY,QAAAd,EAAA;AAAA,YACJ;AAAA,UAClB,CAAA,GAEJc,EAAA,QAAAe;AAAA,QAAsB;AAAA,MAC1B;AAAA,IACJ;AAGJ,UAAAC,IAAA,MAAA;AACI,MAAAC,EAAAtE,EAAA,QAAAoD,EAAA,KAAA;AAAA,IAAwD;AAG5D,IAAAmB,EAAA,MAAA;AACI,MAAAnB,EAAA,UAAA,QACIkB,EAAAtE,EAAA,QAAAoD,EAAA,KAAA;AAAA,IACJ,CAAA;AAGJ,UAAAoB,IAAAtC,EAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[2]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as d, useAttrs as p, useSlots as c, computed as a } from "vue";
|
|
2
2
|
import { d as u, B as b } from "./typography.C8lPlsbD.js";
|
|
3
3
|
import { u as f } from "./use-has-slot.C9lQZ6nz.js";
|
|
4
|
-
import { F as _ } from "./
|
|
4
|
+
import { F as _ } from "./field-label.DjjjkcO6.js";
|
|
5
5
|
import { n as m } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
6
6
|
import "../assets/controls-group.css";
|
|
7
7
|
const h = {}, y = /* @__PURE__ */ d({
|
|
@@ -76,4 +76,4 @@ const A = S.exports;
|
|
|
76
76
|
export {
|
|
77
77
|
A as C
|
|
78
78
|
};
|
|
79
|
-
//# sourceMappingURL=controls-group.
|
|
79
|
+
//# sourceMappingURL=controls-group.DSm2Ujwt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controls-group.
|
|
1
|
+
{"version":3,"file":"controls-group.DSm2Ujwt.js","sources":["../../src/components/internal/controls-group/controls-group.vue"],"sourcesContent":["<template>\n <fieldset class=\"b-controls-group\" v-bind=\"attrs\" :class=\"conditionalClasses\" :form=\"form\" :disabled=\"disabled\">\n <legend class=\"b-controls-group__label-container\" :class=\"legendConditionalClasses\">\n <field-label\n v-if=\"label\"\n class=\"b-controls-group__label\"\n :label=\"label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n />\n <bento-typography\n v-if=\"description || hasSlot('description')\"\n class=\"b-controls-group__description\"\n el=\"span\"\n >\n <slot name=\"description\">\n {{ description }}\n </slot>\n </bento-typography>\n </legend>\n <slot />\n </fieldset>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, useAttrs, useSlots } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { FieldLabel } from '@/components/internal/field-label';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useHasSlot } from '@/composables';\n\n const attrs = useAttrs();\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const props = defineProps({\n /**\n * Descriptive supporting text visbile underneath the label.\n */\n description: { type: String, default: null },\n\n /**\n * The name of the component to cite when throwing a depreacte error.\n */\n componentName: { type: String, required: true },\n\n /**\n * Sets all child controls of the <fieldset> as disabled.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * The value of the id attribute of a <form> element the <fieldset> is to part of, even if it is not inside the form itself.\n */\n form: { type: String, default: null },\n\n /**\n * Shows/hides the group label.\n */\n hideLabel: { type: Boolean, default: null },\n\n /**\n * The name associated with the group. Required for accessibility purposes.\n * The label is shown when `hideLabel` is set to `true` or if `description` is passed\n */\n label: { type: String, required: true },\n\n /**\n * Indicates the field is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Indicates the field is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Tooltip message.\n */\n tooltipText: { type: String, default: null },\n });\n\n const conditionalClasses = computed(() => ({\n 'b-controls-group--disabled': props.disabled,\n }));\n\n const legendConditionalClasses = computed(() => {\n const isLabelAndDescriptionPresent = props.label && (props.description || hasSlot('description'));\n const shouldShowLabel = isLabelAndDescriptionPresent || props.hideLabel === false;\n\n return {\n 'b-controls-group__label-container--hidden': !shouldShowLabel,\n };\n });\n\n // eslint-disable-next-line eqeqeq -- Needs to show deprecate message when hideLabel is not set and no description available\n const hasNoPropsDefined = !(props.description || hasSlot('description')) && props.hideLabel == undefined;\n if (hasNoPropsDefined) {\n deprecate(\n `${props.componentName}: The property \\`label\\` will always be rendered by default.`,\n `After version 2.0.0, the label will be shown by default.\n To continue hiding the label set \\`:hide-label=\"true\"\\`. Up until version 2.0.0, to display the label set \\`hide-label=\"false\"\\`.\n \\`label\\` will always be rendered when \\`description\\` is passed alongside with \\`label\\``,\n `2.0.0`\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * A controls group components should be used whenever it is necessary to group a set of controls (i.e. radio buttons or checkboxes)\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * NOTE: This component should not be used by itself but more implemented by other exported components\n * @example\n * import { ControlsGroup, BentoCheckbox, BentoRadioButton } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { ControlsGroup, BentoRadioButton },\n * template: `\n * <controls-group\n * label=\"Your group label\"\n * description=\"Description\"\n * >\n * <bento-radio-button\n * disabled\n * value=\"inputRadio\"\n * >\n * Label text\n * </bento-radio-button>\n * <bento-radio-button\n * value=\"inputRadio\"\n * >\n * Another label text\n * </bento-radio-button>\n * </controls-group>\n * `\n * };\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./controls-group.scss\" />\n"],"names":["__default__","attrs","useAttrs","slots","useSlots","hasSlot","useHasSlot","conditionalClasses","computed","props","legendConditionalClasses","hasNoPropsDefined","deprecate"],"mappings":";;;;;;AA6II,MAAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA7GAC,IAAAC,EAAA,GACAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAkDAI,IAAAC,EAAA,OAAA;AAAA,MAA2C,8BAAAC,EAAA;AAAA,IACH,EAAA,GAGxCC,IAAAF,EAAA,OAII;AAAA,MAAO,6CAAA,EAHPC,EAAA,UAAAA,EAAA,eAAAJ,EAAA,aAAA,MACAI,EAAA,cAAA;AAAA,IAGkD,EAClD,GAIJE,IAAA,EAAAF,EAAA,eAAAJ,EAAA,aAAA,MAAAI,EAAA,aAAA;AACA,WAAAE,KACIC;AAAA,MAAA,GAAAH,EAAA,aAAA;AAAA,MAC0B;AAAA,MACtB;AAAA,IAGA;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { defineComponent as f, ref as c, computed as s } from "vue";
|
|
2
|
+
import { B as v } from "./button.C9b2AC9w.js";
|
|
3
|
+
import { b as m } from "./popper-container.C_n9Ds1W.js";
|
|
4
|
+
import { u as x } from "./index.B6WW_F-J.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import { n as l } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
7
|
+
import { b as T } from "./tooltip.BxtnF3is.js";
|
|
8
|
+
import "../assets/copy.css";
|
|
9
|
+
var a = /* @__PURE__ */ ((i) => (i.DEFAULT = "default", i.COPYING = "copying", i.ERROR = "error", i))(a || {});
|
|
10
|
+
let p = 0;
|
|
11
|
+
const b = {
|
|
12
|
+
beforeCreate() {
|
|
13
|
+
this.uuid = p.toString(), p += 1;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
var g = function() {
|
|
17
|
+
var e = this, o = e._self._c;
|
|
18
|
+
return o("svg", e._b({ staticClass: "ui-assets-icons-16", attrs: { role: "img", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none" } }, "svg", e.$attrs, !1), [e.$attrs["svg-title"] ? o("title", [e._v(e._s(e.$attrs["svg-title"]))]) : e._e(), o("path", { attrs: { fill: "#001222", d: "M8 1.25C9.51878 1.25 10.75 2.48122 10.75 4V5.25H12C13.5188 5.25 14.75 6.48122 14.75 8V12C14.75 13.5188 13.5188 14.75 12 14.75H8C6.48122 14.75 5.25 13.5188 5.25 12V10.75H4C2.48122 10.75 1.25 9.51878 1.25 8V4C1.25 2.48122 2.48122 1.25 4 1.25H8ZM8 6.75C7.30964 6.75 6.75 7.30964 6.75 8V12C6.75 12.6904 7.30964 13.25 8 13.25H12C12.6904 13.25 13.25 12.6904 13.25 12V8C13.25 7.30964 12.6904 6.75 12 6.75H8ZM4 2.75C3.30964 2.75 2.75 3.30964 2.75 4V8C2.75 8.69036 3.30964 9.25 4 9.25H5.25V8C5.25 6.48122 6.48122 5.25 8 5.25H9.25V4C9.25 3.30964 8.69036 2.75 8 2.75H4Z" } })]);
|
|
19
|
+
}, h = [], F = /* @__PURE__ */ l(
|
|
20
|
+
b,
|
|
21
|
+
g,
|
|
22
|
+
h,
|
|
23
|
+
!1,
|
|
24
|
+
null,
|
|
25
|
+
null
|
|
26
|
+
);
|
|
27
|
+
const R = F.exports, P = {
|
|
28
|
+
"de-DE": {
|
|
29
|
+
copied: "Kopiert!",
|
|
30
|
+
copy: "Kopieren",
|
|
31
|
+
copyFailed: "Kopieren fehlgeschlagen. Versuchen Sie es manuell."
|
|
32
|
+
},
|
|
33
|
+
"en-GB": {
|
|
34
|
+
copied: "Copied!",
|
|
35
|
+
copy: "Copy",
|
|
36
|
+
copyFailed: "Copy failed. Try manually."
|
|
37
|
+
},
|
|
38
|
+
"en-US": {
|
|
39
|
+
copied: "Copied!",
|
|
40
|
+
copy: "Copy",
|
|
41
|
+
copyFailed: "Copy failed. Try manually."
|
|
42
|
+
},
|
|
43
|
+
"es-ES": {
|
|
44
|
+
copied: "¡Copiado!",
|
|
45
|
+
copy: "Copia",
|
|
46
|
+
copyFailed: "Error al copiar. Inténtalo manualmente."
|
|
47
|
+
},
|
|
48
|
+
"es-MX": {
|
|
49
|
+
copied: "¡Copiado!",
|
|
50
|
+
copy: "Copiar",
|
|
51
|
+
copyFailed: "Error al copiar. Inténtelo manualmente."
|
|
52
|
+
},
|
|
53
|
+
"fr-FR": {
|
|
54
|
+
copied: "Copié !",
|
|
55
|
+
copy: "Copier",
|
|
56
|
+
copyFailed: "Échec de la copie. Essayez manuellement."
|
|
57
|
+
},
|
|
58
|
+
"it-IT": {
|
|
59
|
+
copied: "Copiato!",
|
|
60
|
+
copy: "Copia",
|
|
61
|
+
copyFailed: "Copia non riuscita. Prova manualmente."
|
|
62
|
+
},
|
|
63
|
+
"ja-JP": {
|
|
64
|
+
copied: "コピーしました!",
|
|
65
|
+
copy: "コピー",
|
|
66
|
+
copyFailed: "コピーに失敗しました。手動で試してみてください。"
|
|
67
|
+
},
|
|
68
|
+
"pt-BR": {
|
|
69
|
+
copied: "Copiado!",
|
|
70
|
+
copy: "Copiar",
|
|
71
|
+
copyFailed: "Falha ao copiar. Tente manualmente."
|
|
72
|
+
},
|
|
73
|
+
"zh-CN": {
|
|
74
|
+
copied: "已复制!",
|
|
75
|
+
copy: "复制",
|
|
76
|
+
copyFailed: "复制失败。试试手动。"
|
|
77
|
+
}
|
|
78
|
+
}, w = {
|
|
79
|
+
i18n: { messages: P },
|
|
80
|
+
name: "copy"
|
|
81
|
+
}, E = /* @__PURE__ */ f({
|
|
82
|
+
...w,
|
|
83
|
+
props: {
|
|
84
|
+
button: { default: () => ({ variant: "tertiary" }) },
|
|
85
|
+
buttonText: { default: void 0 },
|
|
86
|
+
text: null,
|
|
87
|
+
tooltipPosition: { default: m.TOP }
|
|
88
|
+
},
|
|
89
|
+
emits: ["click"],
|
|
90
|
+
setup(i, { emit: e }) {
|
|
91
|
+
const o = i, { t } = x(), n = c(a.DEFAULT), r = c(!1), u = async (C) => {
|
|
92
|
+
try {
|
|
93
|
+
await navigator.clipboard.writeText(o.text), n.value = a.COPYING, r.value = !0;
|
|
94
|
+
} catch {
|
|
95
|
+
n.value = a.ERROR;
|
|
96
|
+
}
|
|
97
|
+
e("click", C);
|
|
98
|
+
}, d = () => {
|
|
99
|
+
n.value = a.DEFAULT, r.value = !1;
|
|
100
|
+
}, y = s(() => {
|
|
101
|
+
switch (n.value) {
|
|
102
|
+
case a.COPYING:
|
|
103
|
+
return t("copied");
|
|
104
|
+
case a.ERROR:
|
|
105
|
+
return t("copyFailed");
|
|
106
|
+
default:
|
|
107
|
+
return t("copy");
|
|
108
|
+
}
|
|
109
|
+
}), _ = s(() => o.buttonText ? void 0 : t("copy"));
|
|
110
|
+
return { __sfc: !0, emit: e, props: o, t, copyState: n, showScreenReaderAlert: r, onClickCopy: u, resetText: d, copyText: y, svgTitle: _, BentoButton: v, vBentoTooltipDirective: T, CopyIcon: R };
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
var V = function() {
|
|
114
|
+
var e = this, o = e._self._c, t = e._self._setupProxy;
|
|
115
|
+
return o("div", { staticClass: "b-copy", on: { mouseleave: t.resetText, focusout: t.resetText } }, [e.$slots.default ? o("span", { directives: [{ name: "bento-tooltip-directive", rawName: "v-bento-tooltip-directive:[tooltipPosition]", value: t.copyText, expression: "copyText", arg: e.tooltipPosition }], on: { click: t.onClickCopy } }, [e._t("default")], 2) : o(t.BentoButton, e._b({ directives: [{ name: "bento-tooltip-directive", rawName: "v-bento-tooltip-directive:[tooltipPosition]", value: t.copyText, expression: "copyText", arg: e.tooltipPosition }], on: { click: t.onClickCopy }, scopedSlots: e._u([{ key: "iconLeft", fn: function() {
|
|
116
|
+
return [o(t.CopyIcon, { attrs: { "svg-title": t.svgTitle } })];
|
|
117
|
+
}, proxy: !0 }, e.buttonText ? { key: "default", fn: function() {
|
|
118
|
+
return [e._v(" " + e._s(e.buttonText) + " ")];
|
|
119
|
+
}, proxy: !0 } : null], null, !0) }, "bento-button", e.button, !1)), t.showScreenReaderAlert ? o("div", { staticClass: "b-copy__screen-reader-alert", attrs: { role: "alert" } }, [e._v(e._s(t.t("copied")))]) : e._e()], 1);
|
|
120
|
+
}, k = [], B = /* @__PURE__ */ l(
|
|
121
|
+
E,
|
|
122
|
+
V,
|
|
123
|
+
k,
|
|
124
|
+
!1,
|
|
125
|
+
null,
|
|
126
|
+
"b9d54f2c"
|
|
127
|
+
);
|
|
128
|
+
const A = B.exports;
|
|
129
|
+
export {
|
|
130
|
+
A as C,
|
|
131
|
+
a
|
|
132
|
+
};
|
|
133
|
+
//# sourceMappingURL=copy.qqGYFbKJ.js.map
|