@adyen/bento-vue2 1.89.2 → 1.90.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/components.d.ts +2 -0
- package/dist/@types/index.d.ts +198 -80
- 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-range-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/file-uploader.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/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.B63qIiiH.js +334 -0
- package/dist/chunks/{action-bar.CYGUYI0V.js.map → action-bar.B63qIiiH.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.CCJCOdXu.js +110 -0
- package/dist/chunks/{ai-tag.Cjf38mjR.js.map → ai-tag.CCJCOdXu.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.DpmeDmq-.js} +103 -66
- package/dist/chunks/{base-modal.DmWkavtf.js.map → base-modal.DpmeDmq-.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.Bi_HXopk.js → button-actions-with-menu.ChTUOsZl.js} +2 -2
- package/dist/chunks/{button-actions-with-menu.Bi_HXopk.js.map → button-actions-with-menu.ChTUOsZl.js.map} +1 -1
- package/dist/chunks/{button-actions.BLk114As.js → button-actions.BmU1DngD.js} +221 -147
- package/dist/chunks/{button-actions.BLk114As.js.map → button-actions.BmU1DngD.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.uvIGF_jU.js} +283 -209
- package/dist/chunks/{calendar.CXKhBF2f.js.map → calendar.uvIGF_jU.js.map} +1 -1
- package/dist/chunks/card.WWUfBkqf.js +165 -0
- package/dist/chunks/{card.GjhsXOT0.js.map → card.WWUfBkqf.js.map} +1 -1
- package/dist/chunks/{checkbox-group.B2BjU3ZN.js → checkbox-group.CI0xDnql.js} +4 -4
- package/dist/chunks/{checkbox-group.B2BjU3ZN.js.map → checkbox-group.CI0xDnql.js.map} +1 -1
- package/dist/chunks/{checkbox.CIv8WgGp.js → checkbox.TsWA6O3Z.js} +93 -56
- package/dist/chunks/{checkbox.CIv8WgGp.js.map → checkbox.TsWA6O3Z.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/{code-snippet.YIm2oO_o.js → code-snippet.4DX9iUV8.js} +133 -76
- package/dist/chunks/{code-snippet.YIm2oO_o.js.map → code-snippet.4DX9iUV8.js.map} +1 -1
- package/dist/chunks/{controls-group.CqotnNEF.js → controls-group.D_KE99mg.js} +2 -2
- package/dist/chunks/{controls-group.CqotnNEF.js.map → controls-group.D_KE99mg.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.TWlLdQHG.js} +3 -3
- package/dist/chunks/{dashboard-section.BubZyu8i.js.map → dashboard-section.TWlLdQHG.js.map} +1 -1
- package/dist/chunks/{dashed-underline.pjYTS0m1.js → dashed-underline.CpDuQ3Fo.js} +3 -3
- package/dist/chunks/{dashed-underline.pjYTS0m1.js.map → dashed-underline.CpDuQ3Fo.js.map} +1 -1
- package/dist/chunks/{data-grid-template.D8RhngPj.js → data-grid-template.DZaE-kOS.js} +4 -4
- package/dist/chunks/{data-grid-template.D8RhngPj.js.map → data-grid-template.DZaE-kOS.js.map} +1 -1
- package/dist/chunks/data-grid.x6cEW0az.js +4069 -0
- package/dist/chunks/data-grid.x6cEW0az.js.map +1 -0
- package/dist/chunks/date-picker.Dln8ocL4.js +222 -0
- package/dist/chunks/{date-picker.CnazYcSX.js.map → date-picker.Dln8ocL4.js.map} +1 -1
- package/dist/chunks/date-range-picker.DPGy2h-9.js +1068 -0
- package/dist/chunks/date-range-picker.DPGy2h-9.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/{dropdown-default-textbox.Dvzg0StF.js → dropdown-default-textbox.CjhLIxVq.js} +63 -36
- package/dist/chunks/{dropdown-default-textbox.Dvzg0StF.js.map → dropdown-default-textbox.CjhLIxVq.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.BRB-emd1.js → dropdown-tag.t3FlJUSy.js} +5 -5
- package/dist/chunks/{dropdown-tag.BRB-emd1.js.map → dropdown-tag.t3FlJUSy.js.map} +1 -1
- package/dist/chunks/{dropdown.Ct7uhPr6.js → dropdown.CvNI2V33.js} +329 -235
- package/dist/chunks/{dropdown.Ct7uhPr6.js.map → dropdown.CvNI2V33.js.map} +1 -1
- 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.BUNKRa_w.js +160 -0
- package/dist/chunks/{error-message.RxdStT3S.js.map → error-message.BUNKRa_w.js.map} +1 -1
- package/dist/chunks/{file-uploader.D5Rjsx4k.js → file-uploader.Cig5gDXT.js} +749 -468
- package/dist/chunks/{file-uploader.D5Rjsx4k.js.map → file-uploader.Cig5gDXT.js.map} +1 -1
- package/dist/chunks/{filter-bar.zD_ctViU.js → filter-bar.x445KK3y.js} +1301 -761
- package/dist/chunks/{filter-bar.zD_ctViU.js.map → filter-bar.x445KK3y.js.map} +1 -1
- 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.CIkul1OD.js} +3 -3
- package/dist/chunks/{footer-actions.CiPj7hZG.js.map → footer-actions.CIkul1OD.js.map} +1 -1
- package/dist/chunks/{form-layout-title.Bw7VgOO5.js → form-layout-title.DR5M7GP3.js} +77 -48
- package/dist/chunks/{form-layout-title.Bw7VgOO5.js.map → form-layout-title.DR5M7GP3.js.map} +1 -1
- package/dist/chunks/{header-meta.Dq6TlNPw.js → header-meta.BC5fdpD1.js} +127 -73
- package/dist/chunks/{header-meta.Dq6TlNPw.js.map → header-meta.BC5fdpD1.js.map} +1 -1
- package/dist/chunks/{header-with-views.DaEhkSS8.js → header-with-views.-cvdi9-L.js} +1120 -679
- package/dist/chunks/{header-with-views.DaEhkSS8.js.map → header-with-views.-cvdi9-L.js.map} +1 -1
- package/dist/chunks/{header.DkC-KKWa.js → header.DtmZjxiU.js} +3 -3
- package/dist/chunks/{header.DkC-KKWa.js.map → header.DtmZjxiU.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.Bdlw4dzr.js +381 -0
- package/dist/chunks/{input-field-password.BKT1mYUw.js.map → input-field-password.Bdlw4dzr.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.BjRKjQOQ.js → input-field-phone-number.DPuWxBBz.js} +98 -71
- package/dist/chunks/{input-field-phone-number.BjRKjQOQ.js.map → input-field-phone-number.DPuWxBBz.js.map} +1 -1
- package/dist/chunks/input-field.DH25CU_G.js +207 -0
- package/dist/chunks/{input-field.m1PMwa4C.js.map → input-field.DH25CU_G.js.map} +1 -1
- package/dist/chunks/input-time.6eJ4-QdU.js +92 -0
- package/dist/chunks/input-time.6eJ4-QdU.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.CaxuXW-H.js} +63 -36
- package/dist/chunks/{modal-fullscreen.CXOq6_Cv.js.map → modal-fullscreen.CaxuXW-H.js.map} +1 -1
- package/dist/chunks/{modal.o0KddMiG.js → modal.Brif0vAy.js} +63 -36
- package/dist/chunks/{modal.o0KddMiG.js.map → modal.Brif0vAy.js.map} +1 -1
- package/dist/chunks/{pagination.ZISqB4M_.js → pagination.BmrU_sn_.js} +221 -99
- package/dist/chunks/{pagination.ZISqB4M_.js.map → pagination.BmrU_sn_.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.5oS-AeYN.js} +4 -4
- package/dist/chunks/{radio-group.DnMy7brs.js.map → radio-group.5oS-AeYN.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.Cbv1DxXn.js → rich-text-editor.DSGTe8Zt.js} +1781 -1731
- package/dist/chunks/{rich-text-editor.Cbv1DxXn.js.map → rich-text-editor.DSGTe8Zt.js.map} +1 -1
- package/dist/chunks/search-bar.CNfoeLLt.js +126 -0
- package/dist/chunks/{search-bar.DPjYDhja.js.map → search-bar.CNfoeLLt.js.map} +1 -1
- package/dist/chunks/secondary-nav.IF5CgeIP.js +226 -0
- package/dist/chunks/secondary-nav.IF5CgeIP.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.DZjFeQKR.js} +10 -10
- package/dist/chunks/{selection-card-group.IPiouuot.js.map → selection-card-group.DZjFeQKR.js.map} +1 -1
- package/dist/chunks/{sidepanel.BGMjjB3F.js → sidepanel.DZDXuyzg.js} +66 -39
- package/dist/chunks/{sidepanel.BGMjjB3F.js.map → sidepanel.DZDXuyzg.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.CrPNQbX0.js} +5 -5
- package/dist/chunks/{summary-grid.types.CIkArZf5.js.map → summary-grid.types.CrPNQbX0.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.Bi53QF5Q.js +218 -0
- package/dist/chunks/{textarea.D4X6Ss9q.js.map → textarea.Bi53QF5Q.js.map} +1 -1
- package/dist/chunks/timeline-item.C6Bi0eam.js +322 -0
- package/dist/chunks/{timeline-item.C8BxWdy1.js.map → timeline-item.C6Bi0eam.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.BCiZMLJE.js} +190 -103
- package/dist/chunks/{tutorial.BzV6bHQJ.js.map → tutorial.BCiZMLJE.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.DqX2qsMC.js → use-cached-selected-values.Bn3Y8Iuq.js} +490 -359
- package/dist/chunks/{use-cached-selected-values.DqX2qsMC.js.map → use-cached-selected-values.Bn3Y8Iuq.js.map} +1 -1
- 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.DRMt9yR2.js} +2 -2
- package/dist/chunks/{use-date-input-formatter.BYaTO3vz.js.map → use-date-input-formatter.DRMt9yR2.js.map} +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-handle.js +160 -73
- package/dist/draggable-handle.js.map +1 -1
- package/dist/dropdown.js +4 -4
- 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 +215 -213
- 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 +12 -12
- 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 +198 -1
- package/package.json +9 -9
- 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/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-range-picker.Bf9pRNL7.js +0 -811
- package/dist/chunks/date-range-picker.Bf9pRNL7.js.map +0 -1
- package/dist/chunks/dialog-page.oyG153fC.js +0 -116
- package/dist/chunks/error-message.RxdStT3S.js +0 -106
- package/dist/chunks/fixed-scroller.MerESbd_.js +0 -111
- package/dist/chunks/input-field-password.BKT1mYUw.js +0 -234
- package/dist/chunks/input-field.m1PMwa4C.js +0 -170
- package/dist/chunks/inspector.Bnm0hl_D.js +0 -105
- 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-country-phon-code.C6orQNnM.js +0 -291
- package/dist/chunks/use-country-phon-code.C6orQNnM.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.CIv8WgGp.js","sources":["../../src/components/checkbox/checkbox.types.ts","../../src/components/checkbox/checkbox.vue"],"sourcesContent":["import type { BentoTagProps } from '../tag/tag.types';\nimport {\n CheckboxInputState as BentoCheckboxState,\n type CheckboxInputType as BentoCheckboxType,\n type MultiCheckboxInputType as BentoMultiCheckboxType,\n} from '@/internal/checkbox-input/checkbox-input.types';\n\nexport { BentoCheckboxState, BentoCheckboxType, BentoMultiCheckboxType };\n\nexport enum BentoCheckboxEvent {\n UPDATE = 'update:model-value',\n INPUT = 'input',\n}\n\nexport type BentoCheckboxTag = BentoTagProps;\n","<template>\n <label class=\"b-checkbox\" :class=\"conditionalClass\" v-bind=\"styleAttrs\" :aria-hidden=\"getAriaHidden($attrs)\">\n <checkbox-input\n v-bind=\"$attrs\"\n ref=\"input\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"ariaDescribedBy\"\n :aria-required=\"required\"\n :disabled=\"disabled\"\n :has-error=\"shouldShowError\"\n :indeterminate=\"isIndeterminate\"\n :value=\"value\"\n :model-value=\"modelValue\"\n :readonly=\"readonly\"\n @update:model-value=\"onChange\"\n />\n <span v-if=\"hasSlot('default') || shouldShowErrorMessage\" class=\"b-checkbox__text\">\n <bento-typography v-if=\"hasSlot('default')\" class=\"b-checkbox__label\" el=\"span\" variant=\"body\">\n <span><slot /></span>\n <bento-typography v-if=\"optional\" class=\"b-checkbox__label-requirement\" el=\"span\"\n >({{ t('optional') }})</bento-typography\n >\n <bento-typography v-else-if=\"required\" class=\"b-checkbox__label-requirement\" el=\"span\"\n >*</bento-typography\n >\n <bento-tag v-if=\"tag\" class=\"b-checkbox__label-tag\" v-bind=\"tag\" />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('default') && hasSlot('description')\"\n :id=\"descriptionId\"\n class=\"b-checkbox__description\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"description\"></slot>\n </bento-typography>\n <error-message v-if=\"shouldShowErrorMessage\" :id=\"errorId\" :error-message=\"errorMessage\" />\n\n <bento-typography v-if=\"contentSlotAvailable\" class=\"b-checkbox__content\" el=\"span\" variant=\"body\">\n <slot name=\"content\"></slot>\n </bento-typography>\n </span>\n </label>\n</template>\n\n<script lang=\"ts\">\n import {\n computed,\n defineComponent,\n type HTMLAttributes,\n onMounted,\n type PropType,\n ref,\n toRefs,\n useAttrs,\n } from 'vue';\n import {\n BentoCheckboxEvent,\n BentoCheckboxState,\n type BentoCheckboxTag,\n type BentoCheckboxType,\n type BentoMultiCheckboxType,\n } from './checkbox.types';\n import { BentoTypography } from '@/components/typography';\n import { CheckboxInput } from '@/components/internal/checkbox-input';\n import { ErrorMessage } from '@/components/internal/error-message';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { generateUid } from '@/core/utils/ts';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useI18n } from '@/utils/ts/i18n';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { BentoTag } from '@/components/tag';\n import { type BentoCheckboxGroupItems } from './components/checkbox-group/checkbox-group.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * Checkboxes are used to make a binary choice about an option.\n * The label tag area is also clickable.\n *\n * @usage\n * import { BentoCheckbox } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCheckbox },\n * template: `\n * <bento-checkbox>\n * Label text\n * <template #description>Sub label text</template>\n * </bento-checkbox>\n * `,\n * }\n */\n export default defineComponent({\n name: 'bento-checkbox',\n i18n: { messages },\n components: {\n BentoTag,\n BentoTypography,\n CheckboxInput,\n ErrorMessage,\n },\n inheritAttrs: false,\n model: { prop: 'modelValue' },\n props: {\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Accessible name for the radio button component. It is strongly recommended to pas this value in case this component is used without a label.\n */\n ariaLabel: { type: String, default: null },\n\n /**\n * Setting this property to true will disable the checkbox in your form.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Renders the checkbox in an error state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Setting this property to true will show the checkbox in error state.\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * The :indeterminate CSS pseudo-class represents any form element\n * whose state is indeterminate, such as checkboxes which have their HTML indeterminate attribute\n * set to true, radio buttons which are members of a group in which all radio buttons are unchecked,\n * and indeterminate <progress> elements. https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate\n * This property lets you control the input.indeterminate native property.\n */\n indeterminate: { type: Boolean, default: false },\n\n /**\n * When handling a single checkbox with a singular state, use a boolean.\n *\n * When handling multiple checkboxes, use an array of keys.\n * These keys exist as a set \"value\" prop for each checkbox.\n */\n modelValue: {\n type: [Boolean, Array] as PropType<BentoCheckboxType | BentoCheckboxGroupItems>,\n default: false,\n },\n\n /**\n * Highlights the checkbox is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Setting this property to true will set the checkbox to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Highlights the checkbox is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Sets the properties of the BentoTag component that is placed next to the label.\n * {@see BentoTag}\n */\n tag: { type: Object as PropType<BentoCheckboxTag>, default: undefined },\n\n /**\n * The value of the component. The DOM API casts this to a string.\n * The browser uses \"on\" as the default value.\n *\n * In the case of multiple checkboxes this value is used as a unique key.\n */\n value: { type: [String, Number], default: null },\n },\n emits: [BentoCheckboxEvent.UPDATE, BentoCheckboxEvent.INPUT],\n setup(props, { attrs, emit, slots }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const descriptionId = generateUid('description');\n const errorId = generateUid('error');\n const hasSlot = useHasSlot(slots);\n\n const { disabled, indeterminate, modelValue, readonly, value } = toRefs(props);\n\n const defaultSlotValue = getSlotText(slots)('default');\n const descriptionSlotValue = getSlotText(slots)('description');\n\n useDefaultSlotValidator('bento-checkbox', slots.default, slots.description);\n\n const isCheckboxGroup = computed(() => Array.isArray(modelValue.value));\n const isChecked = computed(() => {\n if (!isCheckboxGroup.value) {\n return modelValue.value as boolean;\n }\n\n return (modelValue.value as BentoMultiCheckboxType).some(item => item === value.value);\n });\n const isIndeterminate = computed(() => indeterminate.value);\n\n const shouldShowError = computed(\n () => !props.disabled && !props.readonly && (props.hasError || !!props.errorMessage)\n );\n const shouldShowErrorMessage = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n // Content slot logic\n const hasContentSlot = computed(() => hasSlot('content'));\n const isCheckedOrIntermediate = computed(() => isIndeterminate?.value || isChecked?.value);\n const contentSlotAvailable = computed(\n () => hasContentSlot?.value && isCheckboxGroup?.value && isCheckedOrIntermediate?.value\n );\n\n // ARIA fields\n const ariaDescribedBy = computed<HTMLAttributes['aria-describedby']>(\n () =>\n `${shouldShowErrorMessage.value ? errorId : ''} ${\n defaultSlotValue && descriptionSlotValue ? descriptionId : ''\n }`.trim() || null\n );\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const checkboxTranslation = ref();\n // Translations used in the script tag need to be inside onMounted otherwise they fail in Vue 3\n onMounted(() => {\n checkboxTranslation.value = t('checkbox');\n });\n // Only add aria-label if no label slot is present\n const computedAriaLabel = computed(\n () =>\n 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: hasSlot('default')\n ? (getSlotText(slots)('default') as string)\n : checkboxTranslation.value,\n }).value\n );\n const getAriaHidden = (attributes: HTMLAttributes) => attributes?.['aria-hidden'];\n\n const styleAttrs = computed(() => {\n const { style, class: cls } = useAttrs();\n return {\n class: cls as HTMLAttributes['class'],\n style: style as HTMLAttributes['style'],\n };\n });\n\n const conditionalClass = computed(() => ({\n [`b-checkbox--${BentoCheckboxState.DISABLED}`]: disabled.value,\n [`b-checkbox--${BentoCheckboxState.READONLY}`]: readonly.value,\n }));\n\n const onChange = (newValue: BentoCheckboxType | BentoCheckboxGroupItems) => {\n if (disabled.value) {\n return;\n }\n emit(BentoCheckboxEvent.UPDATE, newValue);\n emit(BentoCheckboxEvent.INPUT, newValue);\n };\n\n return {\n // Values\n descriptionId,\n errorId,\n ariaDescribedBy,\n computedAriaLabel,\n conditionalClass,\n defaultSlotValue,\n descriptionSlotValue,\n isIndeterminate,\n shouldShowError,\n shouldShowErrorMessage,\n contentSlotAvailable,\n hasContentSlot,\n styleAttrs,\n\n // Methods\n hasSlot,\n onChange,\n getAriaHidden,\n\n t,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./checkbox.scss\" />\n"],"names":["BentoCheckboxEvent","BentoCheckboxEvent2","_sfc_main","defineComponent","messages","BentoTag","BentoTypography","CheckboxInput","ErrorMessage","props","attrs","emit","slots","t","useI18n","descriptionId","generateUid","errorId","hasSlot","useHasSlot","disabled","indeterminate","modelValue","readonly","value","toRefs","defaultSlotValue","getSlotText","descriptionSlotValue","useDefaultSlotValidator","isCheckboxGroup","computed","isChecked","item","isIndeterminate","shouldShowError","shouldShowErrorMessage","hasContentSlot","isCheckedOrIntermediate","contentSlotAvailable","ariaDescribedBy","ariaLabelAttribute","ref","ariaLabel","checkboxTranslation","onMounted","computedAriaLabel","useAriaLabel","getAriaHidden","attributes","styleAttrs","style","cls","useAttrs","conditionalClass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wD,CAAA,GACA7C,EAAAX,EAAA,OAAAwD,CAAA;AAAA,MAAA;AAAA,MAqBA,eAAAR;AAAA,MACA,GAAAnC;AAAA,IAEA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"checkbox.TsWA6O3Z.js","sources":["../../src/components/checkbox/checkbox.types.ts","../../src/components/checkbox/checkbox.vue"],"sourcesContent":["import type { BentoTagProps } from '../tag/tag.types';\nimport {\n CheckboxInputState as BentoCheckboxState,\n type CheckboxInputType as BentoCheckboxType,\n type MultiCheckboxInputType as BentoMultiCheckboxType,\n} from '@/internal/checkbox-input/checkbox-input.types';\n\nexport { BentoCheckboxState, BentoCheckboxType, BentoMultiCheckboxType };\n\nexport enum BentoCheckboxEvent {\n UPDATE = 'update:model-value',\n INPUT = 'input',\n}\n\nexport type BentoCheckboxTag = BentoTagProps;\n","<template>\n <label class=\"b-checkbox\" :class=\"conditionalClass\" v-bind=\"styleAttrs\" :aria-hidden=\"getAriaHidden($attrs)\">\n <checkbox-input\n v-bind=\"$attrs\"\n ref=\"input\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"ariaDescribedBy\"\n :aria-required=\"required\"\n :disabled=\"disabled\"\n :has-error=\"shouldShowError\"\n :indeterminate=\"isIndeterminate\"\n :value=\"value\"\n :model-value=\"modelValue\"\n :readonly=\"readonly\"\n @update:model-value=\"onChange\"\n />\n <span v-if=\"hasSlot('default') || shouldShowErrorMessage\" class=\"b-checkbox__text\">\n <bento-typography v-if=\"hasSlot('default')\" class=\"b-checkbox__label\" el=\"span\" variant=\"body\">\n <span><slot /></span>\n <bento-typography v-if=\"optional\" class=\"b-checkbox__label-requirement\" el=\"span\"\n >({{ t('optional') }})</bento-typography\n >\n <bento-typography v-else-if=\"required\" class=\"b-checkbox__label-requirement\" el=\"span\"\n >*</bento-typography\n >\n <bento-tag v-if=\"tag\" class=\"b-checkbox__label-tag\" v-bind=\"tag\" />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('default') && hasSlot('description')\"\n :id=\"descriptionId\"\n class=\"b-checkbox__description\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"description\"></slot>\n </bento-typography>\n <error-message v-if=\"shouldShowErrorMessage\" :id=\"errorId\" :error-message=\"errorMessage\" />\n\n <bento-typography v-if=\"contentSlotAvailable\" class=\"b-checkbox__content\" el=\"span\" variant=\"body\">\n <slot name=\"content\"></slot>\n </bento-typography>\n </span>\n </label>\n</template>\n\n<script lang=\"ts\">\n import {\n computed,\n defineComponent,\n type HTMLAttributes,\n onMounted,\n type PropType,\n ref,\n toRefs,\n useAttrs,\n } from 'vue';\n import {\n BentoCheckboxEvent,\n BentoCheckboxState,\n type BentoCheckboxTag,\n type BentoCheckboxType,\n type BentoMultiCheckboxType,\n } from './checkbox.types';\n import { BentoTypography } from '@/components/typography';\n import { CheckboxInput } from '@/components/internal/checkbox-input';\n import { ErrorMessage } from '@/components/internal/error-message';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { generateUid } from '@/core/utils/ts';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useI18n } from '@/utils/ts/i18n';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { BentoTag } from '@/components/tag';\n import { type BentoCheckboxGroupItems } from './components/checkbox-group/checkbox-group.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * Checkboxes are used to make a binary choice about an option.\n * The label tag area is also clickable.\n *\n * @usage\n * import { BentoCheckbox } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoCheckbox },\n * template: `\n * <bento-checkbox>\n * Label text\n * <template #description>Sub label text</template>\n * </bento-checkbox>\n * `,\n * }\n */\n export default defineComponent({\n name: 'bento-checkbox',\n i18n: { messages },\n components: {\n BentoTag,\n BentoTypography,\n CheckboxInput,\n ErrorMessage,\n },\n inheritAttrs: false,\n model: { prop: 'modelValue' },\n props: {\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Accessible name for the radio button component. It is strongly recommended to pas this value in case this component is used without a label.\n */\n ariaLabel: { type: String, default: null },\n\n /**\n * Setting this property to true will disable the checkbox in your form.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Renders the checkbox in an error state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Setting this property to true will show the checkbox in error state.\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * The :indeterminate CSS pseudo-class represents any form element\n * whose state is indeterminate, such as checkboxes which have their HTML indeterminate attribute\n * set to true, radio buttons which are members of a group in which all radio buttons are unchecked,\n * and indeterminate <progress> elements. https://developer.mozilla.org/en-US/docs/Web/CSS/:indeterminate\n * This property lets you control the input.indeterminate native property.\n */\n indeterminate: { type: Boolean, default: false },\n\n /**\n * When handling a single checkbox with a singular state, use a boolean.\n *\n * When handling multiple checkboxes, use an array of keys.\n * These keys exist as a set \"value\" prop for each checkbox.\n */\n modelValue: {\n type: [Boolean, Array] as PropType<BentoCheckboxType | BentoCheckboxGroupItems>,\n default: false,\n },\n\n /**\n * Highlights the checkbox is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Setting this property to true will set the checkbox to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Highlights the checkbox is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Sets the properties of the BentoTag component that is placed next to the label.\n * {@see BentoTag}\n */\n tag: { type: Object as PropType<BentoCheckboxTag>, default: undefined },\n\n /**\n * The value of the component. The DOM API casts this to a string.\n * The browser uses \"on\" as the default value.\n *\n * In the case of multiple checkboxes this value is used as a unique key.\n */\n value: { type: [String, Number], default: null },\n },\n emits: [BentoCheckboxEvent.UPDATE, BentoCheckboxEvent.INPUT],\n setup(props, { attrs, emit, slots }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const descriptionId = generateUid('description');\n const errorId = generateUid('error');\n const hasSlot = useHasSlot(slots);\n\n const { disabled, indeterminate, modelValue, readonly, value } = toRefs(props);\n\n const defaultSlotValue = getSlotText(slots)('default');\n const descriptionSlotValue = getSlotText(slots)('description');\n\n useDefaultSlotValidator('bento-checkbox', slots.default, slots.description);\n\n const isCheckboxGroup = computed(() => Array.isArray(modelValue.value));\n const isChecked = computed(() => {\n if (!isCheckboxGroup.value) {\n return modelValue.value as boolean;\n }\n\n return (modelValue.value as BentoMultiCheckboxType).some(item => item === value.value);\n });\n const isIndeterminate = computed(() => indeterminate.value);\n\n const shouldShowError = computed(\n () => !props.disabled && !props.readonly && (props.hasError || !!props.errorMessage)\n );\n const shouldShowErrorMessage = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n // Content slot logic\n const hasContentSlot = computed(() => hasSlot('content'));\n const isCheckedOrIntermediate = computed(() => isIndeterminate?.value || isChecked?.value);\n const contentSlotAvailable = computed(\n () => hasContentSlot?.value && isCheckboxGroup?.value && isCheckedOrIntermediate?.value\n );\n\n // ARIA fields\n const ariaDescribedBy = computed<HTMLAttributes['aria-describedby']>(\n () =>\n `${shouldShowErrorMessage.value ? errorId : ''} ${\n defaultSlotValue && descriptionSlotValue ? descriptionId : ''\n }`.trim() || null\n );\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const checkboxTranslation = ref();\n // Translations used in the script tag need to be inside onMounted otherwise they fail in Vue 3\n onMounted(() => {\n checkboxTranslation.value = t('checkbox');\n });\n // Only add aria-label if no label slot is present\n const computedAriaLabel = computed(\n () =>\n 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: hasSlot('default')\n ? (getSlotText(slots)('default') as string)\n : checkboxTranslation.value,\n }).value\n );\n const getAriaHidden = (attributes: HTMLAttributes) => attributes?.['aria-hidden'];\n\n const styleAttrs = computed(() => {\n const { style, class: cls } = useAttrs();\n return {\n class: cls as HTMLAttributes['class'],\n style: style as HTMLAttributes['style'],\n };\n });\n\n const conditionalClass = computed(() => ({\n [`b-checkbox--${BentoCheckboxState.DISABLED}`]: disabled.value,\n [`b-checkbox--${BentoCheckboxState.READONLY}`]: readonly.value,\n }));\n\n const onChange = (newValue: BentoCheckboxType | BentoCheckboxGroupItems) => {\n if (disabled.value) {\n return;\n }\n emit(BentoCheckboxEvent.UPDATE, newValue);\n emit(BentoCheckboxEvent.INPUT, newValue);\n };\n\n return {\n // Values\n descriptionId,\n errorId,\n ariaDescribedBy,\n computedAriaLabel,\n conditionalClass,\n defaultSlotValue,\n descriptionSlotValue,\n isIndeterminate,\n shouldShowError,\n shouldShowErrorMessage,\n contentSlotAvailable,\n hasContentSlot,\n styleAttrs,\n\n // Methods\n hasSlot,\n onChange,\n getAriaHidden,\n\n t,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./checkbox.scss\" />\n"],"names":["BentoCheckboxEvent","BentoCheckboxEvent2","_sfc_main","defineComponent","messages","BentoTag","BentoTypography","CheckboxInput","ErrorMessage","props","attrs","emit","slots","t","useI18n","descriptionId","generateUid","errorId","hasSlot","useHasSlot","disabled","indeterminate","modelValue","readonly","value","toRefs","defaultSlotValue","getSlotText","descriptionSlotValue","useDefaultSlotValidator","isCheckboxGroup","computed","isChecked","item","isIndeterminate","shouldShowError","shouldShowErrorMessage","hasContentSlot","isCheckedOrIntermediate","contentSlotAvailable","ariaDescribedBy","ariaLabelAttribute","ref","ariaLabel","checkboxTranslation","onMounted","computedAriaLabel","useAriaLabel","getAriaHidden","attributes","styleAttrs","style","cls","useAttrs","conditionalClass","CheckboxInputState","newValue"],"mappings":";;;;;;;;;;;;;;AASO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,SAAA,sBACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GCqFZE,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,MAAA,EAAA,UAAAC,EAAA;AAAA,EACA,YAAA;AAAA,IACA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PrO0p.js";
|
|
3
|
+
import { B as m } from "./typography.C8lPlsbD.js";
|
|
4
|
+
import { C as p } from "./cross-small.CoQUe8SS.js";
|
|
5
|
+
import { u as d } from "./index.B6WW_F-J.js";
|
|
6
|
+
import { t as f } from "./truncate.BfIl_-71.js";
|
|
7
|
+
import { n as u } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
8
|
+
import "../assets/chip.css";
|
|
9
|
+
const _ = {
|
|
10
|
+
"de-DE": {
|
|
11
|
+
remove: "Entfernen"
|
|
12
|
+
},
|
|
13
|
+
"en-GB": {
|
|
14
|
+
remove: "Remove"
|
|
15
|
+
},
|
|
16
|
+
"en-US": {
|
|
17
|
+
remove: "Remove"
|
|
18
|
+
},
|
|
19
|
+
"es-ES": {
|
|
20
|
+
remove: "Eliminar"
|
|
21
|
+
},
|
|
22
|
+
"es-MX": {
|
|
23
|
+
remove: "Eliminar"
|
|
24
|
+
},
|
|
25
|
+
"fr-FR": {
|
|
26
|
+
remove: "Supprimer"
|
|
27
|
+
},
|
|
28
|
+
"it-IT": {
|
|
29
|
+
remove: "Rimuovi"
|
|
30
|
+
},
|
|
31
|
+
"ja-JP": {
|
|
32
|
+
remove: "削除"
|
|
33
|
+
},
|
|
34
|
+
"pt-BR": {
|
|
35
|
+
remove: "Retirar"
|
|
36
|
+
},
|
|
37
|
+
"zh-CN": {
|
|
38
|
+
remove: "移除"
|
|
39
|
+
}
|
|
40
|
+
}, v = { i18n: { messages: _ } }, y = /* @__PURE__ */ c({
|
|
41
|
+
...v,
|
|
42
|
+
__name: "chip",
|
|
43
|
+
props: {
|
|
44
|
+
label: null,
|
|
45
|
+
disabled: { type: Boolean, default: !1 },
|
|
46
|
+
readonly: { type: Boolean, default: !1 },
|
|
47
|
+
error: { type: Boolean, default: !1 },
|
|
48
|
+
condensed: { type: Boolean, default: !1 },
|
|
49
|
+
characterLimit: { default: null }
|
|
50
|
+
},
|
|
51
|
+
emits: ["click"],
|
|
52
|
+
setup(a, { emit: t }) {
|
|
53
|
+
const e = a, { t: o } = d(), n = r(
|
|
54
|
+
() => e.characterLimit ? f(e.label, e.characterLimit) : e.label
|
|
55
|
+
), s = r(
|
|
56
|
+
() => e.condensed ? "caption" : "body"
|
|
57
|
+
), i = r(() => ({
|
|
58
|
+
"b-chip--condensed": e.condensed,
|
|
59
|
+
"b-chip--readonly": e.readonly && !e.disabled,
|
|
60
|
+
"b-chip--error": e.error
|
|
61
|
+
}));
|
|
62
|
+
return { __sfc: !0, props: e, emit: t, t: o, computedLabel: n, computedTypographyVariant: s, conditionalClasses: i, BaseButton: l, BentoTypography: m, CrossSmallIcon: p };
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
var h = function() {
|
|
66
|
+
var t = this, e = t._self._c, o = t._self._setupProxy;
|
|
67
|
+
return e(o.BaseButton, { staticClass: "b-chip", class: o.conditionalClasses, attrs: { disabled: t.disabled }, on: { click: function(n) {
|
|
68
|
+
return o.emit("click");
|
|
69
|
+
} }, scopedSlots: t._u([{ key: "iconRight", fn: function() {
|
|
70
|
+
return [e(o.CrossSmallIcon, { staticClass: "b-chip__icon", attrs: { "svg-title": o.t("remove") } })];
|
|
71
|
+
}, proxy: !0 }]) }, [e(o.BentoTypography, { staticClass: "b-chip__text", attrs: { el: "span", variant: o.computedTypographyVariant } }, [t._v(" " + t._s(o.computedLabel) + " ")])], 1);
|
|
72
|
+
}, b = [], B = /* @__PURE__ */ u(
|
|
73
|
+
y,
|
|
74
|
+
h,
|
|
75
|
+
b,
|
|
76
|
+
!1,
|
|
77
|
+
null,
|
|
78
|
+
"fc6261ff"
|
|
79
|
+
);
|
|
80
|
+
const L = B.exports;
|
|
81
|
+
export {
|
|
82
|
+
L as B
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=chip.BFY_-VCz.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chip.
|
|
1
|
+
{"version":3,"file":"chip.BFY_-VCz.js","sources":["../../src/components/chip/chip.vue"],"sourcesContent":["<template>\n <base-button class=\"b-chip\" :disabled=\"disabled\" :class=\"conditionalClasses\" @click=\"emit('click')\">\n <bento-typography el=\"span\" :variant=\"computedTypographyVariant\" class=\"b-chip__text\">\n {{ computedLabel }}\n </bento-typography>\n <template #iconRight><cross-small-icon :svg-title=\"t('remove')\" class=\"b-chip__icon\" /></template>\n </base-button>\n</template>\n\n<script setup lang=\"ts\">\n import { BaseButton } from '@/components/internal/base-button';\n import { BentoTypography, type BentoTypographyVariant } from '@/components/typography';\n import CrossSmallIcon from '@adyen/ui-assets-icons-16/vue/cross-small';\n\n import { useI18n } from '@/utils/ts/i18n';\n import { truncate } from '@/utils/ts/truncate';\n\n import type { BentoChipProps } from './chip.types';\n\n import messages from './messages.json';\n import { computed } from 'vue';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n label: null,\n disabled: { type: Boolean, default: false },\n readonly: { type: Boolean, default: false },\n error: { type: Boolean, default: false },\n condensed: { type: Boolean, default: false },\n characterLimit: { default: null }\n});\n\n const emit = defineEmits([\"click\"]);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const computedLabel = computed(() =>\n props.characterLimit ? truncate(props.label, props.characterLimit) : props.label\n );\n\n const computedTypographyVariant = computed<`${BentoTypographyVariant}`>(() =>\n props.condensed ? 'caption' : 'body'\n );\n\n const conditionalClasses = computed(() => ({\n 'b-chip--condensed': props.condensed,\n 'b-chip--readonly': props.readonly && !props.disabled,\n 'b-chip--error': props.error,\n }));\n</script>\n\n<script lang=\"ts\">\n /**\n * Chip is a dismissible tag-like component that can be used to display selected items, which may need to be removed by the user.\n *\n * @example\n * import { BentoChip } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoChip },\n * template: `\n * <bento-chip\n * label=\"Label\"\n * :character-limit=\"20\"\n * condensed\n * @click=\"removeChip()\"\n *\n * />\n * `\n * }\n */\n export default { i18n: { messages } };\n</script>\n\n<style lang=\"scss\" scoped src=\"./chip.scss\" />\n"],"names":["__default__","messages","t","useI18n","computedLabel","computed","props","truncate","computedTypographyVariant","conditionalClasses"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEIA,IAAA,EAAA,MAAA,EAAA,UAAAC,EAAA,EAAA;;;;;;;;;;;;;iBArCA,EAAA,GAAAC,EAAA,IAAAC,EAAA,GAEAC,IAAAC;AAAA,MAAsB,MAAAC,EAAA,iBAAAC,EAAAD,EAAA,OAAAA,EAAA,cAAA,IAAAA,EAAA;AAAA,IACyD,GAG/EE,IAAAH;AAAA,MAAkC,MAAAC,EAAA,YAAA,YAAA;AAAA,IACA,GAGlCG,IAAAJ,EAAA,OAAA;AAAA,MAA2C,qBAAAC,EAAA;AAAA,MACZ,oBAAAA,EAAA,YAAA,CAAAA,EAAA;AAAA,MACkB,iBAAAA,EAAA;AAAA,IACtB,EAAA;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -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.CvNI2V33.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.DpmeDmq-.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.4DX9iUV8.js.map
|