@adyen/bento-vue2 1.44.0 → 1.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/index.d.ts +17 -90
- package/dist/accordion.js +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-button.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/checkbox.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown-default-textbox.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/focus-trap.css +1 -1
- package/dist/assets/header.css +1 -1
- package/dist/assets/info-icon-with-popover.css +1 -0
- package/dist/assets/input-field.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/layout-row.css +1 -1
- package/dist/assets/link.css +1 -1
- package/dist/assets/menu.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/popover.css +1 -1
- package/dist/assets/popper-container.css +1 -1
- package/dist/assets/radio-input.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/tabs.css +1 -1
- package/dist/assets/use-cached-selected-values.css +1 -1
- package/dist/avatar.js +1 -1
- package/dist/button.js +3 -3
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{accordion-item.BjXzREaK.js → accordion-item.CzKttO4w.js} +5 -5
- package/dist/chunks/{accordion-item.BjXzREaK.js.map → accordion-item.CzKttO4w.js.map} +1 -1
- package/dist/chunks/{action-bar.Dx12xlEW.js → action-bar.BXemSuq4.js} +7 -7
- package/dist/chunks/{action-bar.Dx12xlEW.js.map → action-bar.BXemSuq4.js.map} +1 -1
- package/dist/chunks/{alert.D2Z_aiFC.js → alert.CAIp-87f.js} +3 -3
- package/dist/chunks/{alert.D2Z_aiFC.js.map → alert.CAIp-87f.js.map} +1 -1
- package/dist/chunks/{avatar.DXzyWKsI.js → avatar.BgwjpLQO.js} +2 -2
- package/dist/chunks/{avatar.DXzyWKsI.js.map → avatar.BgwjpLQO.js.map} +1 -1
- package/dist/chunks/{base-button.4UYC3kp2.js → base-button.-gx_u8Bd.js} +3 -3
- package/dist/chunks/base-button.-gx_u8Bd.js.map +1 -0
- package/dist/chunks/{base-modal.BrqNR-ah.js → base-modal.4JSNBM4T.js} +12 -12
- package/dist/chunks/{base-modal.BrqNR-ah.js.map → base-modal.4JSNBM4T.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.ptKgeQEb.js → button-actions-with-menu.ieopdfI7.js} +4 -4
- package/dist/chunks/{button-actions-with-menu.ptKgeQEb.js.map → button-actions-with-menu.ieopdfI7.js.map} +1 -1
- package/dist/chunks/{button-actions.BIQ3qA8q.js → button-actions.CtFB6iRj.js} +3 -3
- package/dist/chunks/{button-actions.BIQ3qA8q.js.map → button-actions.CtFB6iRj.js.map} +1 -1
- package/dist/chunks/{button.CufUNBkv.js → button.BX6ZJxF7.js} +13 -13
- package/dist/chunks/button.BX6ZJxF7.js.map +1 -0
- package/dist/chunks/{calendar.B9WZ8ub3.js → calendar.BouORZfb.js} +9 -9
- package/dist/chunks/{calendar.B9WZ8ub3.js.map → calendar.BouORZfb.js.map} +1 -1
- package/dist/chunks/{card.D9g7fZDX.js → card.BabmUkTG.js} +6 -6
- package/dist/chunks/{card.D9g7fZDX.js.map → card.BabmUkTG.js.map} +1 -1
- package/dist/chunks/{checkbox-group.Bcqac3y8.js → checkbox-group.DbLznnsa.js} +7 -7
- package/dist/chunks/{checkbox-group.Bcqac3y8.js.map → checkbox-group.DbLznnsa.js.map} +1 -1
- package/dist/chunks/{checkbox.B1qjI4R_.js → checkbox.fhQLs-NN.js} +6 -6
- package/dist/chunks/checkbox.fhQLs-NN.js.map +1 -0
- package/dist/chunks/{chevron-left.CtnrsqUy.js → chevron-left.PIu6yPqe.js} +3 -3
- package/dist/chunks/{chevron-left.CtnrsqUy.js.map → chevron-left.PIu6yPqe.js.map} +1 -1
- package/dist/chunks/{chevron-up.B2uWhZf7.js → chevron-up.DVfo78kV.js} +3 -3
- package/dist/chunks/{chevron-up.B2uWhZf7.js.map → chevron-up.DVfo78kV.js.map} +1 -1
- package/dist/chunks/{code-snippet.rmKiWrIv.js → code-snippet.5iJcUZSo.js} +20 -20
- package/dist/chunks/{code-snippet.rmKiWrIv.js.map → code-snippet.5iJcUZSo.js.map} +1 -1
- package/dist/chunks/{codemirror.BlV6WO5w.js → codemirror.CXFEqvAi.js} +2047 -2053
- package/dist/chunks/{codemirror.BlV6WO5w.js.map → codemirror.CXFEqvAi.js.map} +1 -1
- package/dist/chunks/{controls-group.J8shO_JL.js → controls-group.CnXzOQkX.js} +3 -3
- package/dist/chunks/{controls-group.J8shO_JL.js.map → controls-group.CnXzOQkX.js.map} +1 -1
- package/dist/chunks/{copy.DgzxvExj.js → copy.DN0tClPm.js} +4 -4
- package/dist/chunks/{copy.DgzxvExj.js.map → copy.DN0tClPm.js.map} +1 -1
- package/dist/chunks/{country.CM5oZOyZ.js → country.Bft91V1L.js} +3 -3
- package/dist/chunks/{country.CM5oZOyZ.js.map → country.Bft91V1L.js.map} +1 -1
- package/dist/chunks/{country.types.Br0AjxGy.js → country.types.pilf5B3F.js} +483 -480
- package/dist/chunks/{country.types.Br0AjxGy.js.map → country.types.pilf5B3F.js.map} +1 -1
- package/dist/chunks/{currency.P7Psn_SK.js → currency.BmI4Sqy5.js} +2 -2
- package/dist/chunks/{currency.P7Psn_SK.js.map → currency.BmI4Sqy5.js.map} +1 -1
- package/dist/chunks/{dashboard-section._KVy37B0.js → dashboard-section.DYXZhtop.js} +5 -5
- package/dist/chunks/{dashboard-section._KVy37B0.js.map → dashboard-section.DYXZhtop.js.map} +1 -1
- package/dist/chunks/{dashed-underline.DX5QlK14.js → dashed-underline.BvSZS1-m.js} +4 -4
- package/dist/chunks/{dashed-underline.DX5QlK14.js.map → dashed-underline.BvSZS1-m.js.map} +1 -1
- package/dist/chunks/{data-grid-template.BgTUIoak.js → data-grid-template.Du92TEFY.js} +4 -4
- package/dist/chunks/{data-grid-template.BgTUIoak.js.map → data-grid-template.Du92TEFY.js.map} +1 -1
- package/dist/chunks/{data-grid.sAbzCVND.js → data-grid.Kwtf1DMq.js} +46 -46
- package/dist/chunks/{data-grid.sAbzCVND.js.map → data-grid.Kwtf1DMq.js.map} +1 -1
- package/dist/chunks/{date-picker.DrSWxADA.js → date-picker.B7mTNghB.js} +11 -11
- package/dist/chunks/{date-picker.DrSWxADA.js.map → date-picker.B7mTNghB.js.map} +1 -1
- package/dist/chunks/{date-range-picker.CFIOD59O.js → date-range-picker.DPLri9D-.js} +241 -241
- package/dist/chunks/{date-range-picker.CFIOD59O.js.map → date-range-picker.DPLri9D-.js.map} +1 -1
- package/dist/chunks/{date.BQ29-2L1.js → date.1zs9CRhw.js} +2 -4
- package/dist/chunks/{date.BQ29-2L1.js.map → date.1zs9CRhw.js.map} +1 -1
- package/dist/chunks/{dialog-page.CplkzZGZ.js → dialog-page.DcJ7LaOE.js} +33 -32
- package/dist/chunks/dialog-page.DcJ7LaOE.js.map +1 -0
- package/dist/chunks/{dropdown-default-textbox.ZAFh7KqG.js → dropdown-default-textbox.DBoSso4J.js} +88 -76
- package/dist/chunks/dropdown-default-textbox.DBoSso4J.js.map +1 -0
- package/dist/chunks/{dropdown-tag.Ntdp7P7W.js → dropdown-tag.XIlES6IT.js} +8 -8
- package/dist/chunks/{dropdown-tag.Ntdp7P7W.js.map → dropdown-tag.XIlES6IT.js.map} +1 -1
- package/dist/chunks/{dropdown.DC9un4VJ.js → dropdown.BqsoncJr.js} +60 -60
- package/dist/chunks/dropdown.BqsoncJr.js.map +1 -0
- package/dist/chunks/{empty-state.B8ZeRgDi.js → empty-state.1TyzB5ju.js} +5 -5
- package/dist/chunks/{empty-state.B8ZeRgDi.js.map → empty-state.1TyzB5ju.js.map} +1 -1
- package/dist/chunks/{error-message.B7uoqQpq.js → error-message.Ccc1sTTp.js} +3 -3
- package/dist/chunks/{error-message.B7uoqQpq.js.map → error-message.Ccc1sTTp.js.map} +1 -1
- package/dist/chunks/{es6.C-HLzYPA.js → es6.jIyAPBgt.js} +4 -4
- package/dist/chunks/{es6.C-HLzYPA.js.map → es6.jIyAPBgt.js.map} +1 -1
- package/dist/chunks/{file-uploader.ItCr8Ezn.js → file-uploader.C6kcnhqp.js} +9 -9
- package/dist/chunks/{file-uploader.ItCr8Ezn.js.map → file-uploader.C6kcnhqp.js.map} +1 -1
- package/dist/chunks/{filter-bar.Dowrph-Z.js → filter-bar.DT_-lVmf.js} +48 -48
- package/dist/chunks/{filter-bar.Dowrph-Z.js.map → filter-bar.DT_-lVmf.js.map} +1 -1
- package/dist/chunks/{fixed-scroller.B880PL1J.js → fixed-scroller.IPM3AzHS.js} +4 -4
- package/dist/chunks/{fixed-scroller.B880PL1J.js.map → fixed-scroller.IPM3AzHS.js.map} +1 -1
- package/dist/chunks/focus-trap.CGypVwG6.js +495 -0
- package/dist/chunks/focus-trap.CGypVwG6.js.map +1 -0
- package/dist/chunks/{footer-actions.B3GJ1wNP.js → footer-actions.D0uH9JWq.js} +4 -4
- package/dist/chunks/{footer-actions.B3GJ1wNP.js.map → footer-actions.D0uH9JWq.js.map} +1 -1
- package/dist/chunks/{form-layout-title.BarHgyjC.js → form-layout-title.DN0jonFa.js} +3 -3
- package/dist/chunks/{form-layout-title.BarHgyjC.js.map → form-layout-title.DN0jonFa.js.map} +1 -1
- package/dist/chunks/{generate-uid.D-HFI38h.js → generate-uid.NJ8tVoha.js} +2 -2
- package/dist/chunks/{generate-uid.D-HFI38h.js.map → generate-uid.NJ8tVoha.js.map} +1 -1
- package/dist/chunks/header.BvZxtIOD.js +205 -0
- package/dist/chunks/header.BvZxtIOD.js.map +1 -0
- package/dist/chunks/{index.Gcw_BUVh.js → index.D8ivUe7P.js} +6 -5
- package/dist/chunks/{index.Gcw_BUVh.js.map → index.D8ivUe7P.js.map} +1 -1
- package/dist/chunks/info-icon-with-popover.DEjsASNU.js +71 -0
- package/dist/chunks/info-icon-with-popover.DEjsASNU.js.map +1 -0
- package/dist/chunks/{info-icon.p-28zHUJ.js → info-icon.0d0GzDe2.js} +3 -3
- package/dist/chunks/{info-icon.p-28zHUJ.js.map → info-icon.0d0GzDe2.js.map} +1 -1
- package/dist/chunks/{input-field-password.CgxF9jhq.js → input-field-password.HRDEb0jL.js} +10 -10
- package/dist/chunks/{input-field-password.CgxF9jhq.js.map → input-field-password.HRDEb0jL.js.map} +1 -1
- package/dist/chunks/{input-field.CcjqGkLs.js → input-field.D6N2kt7s.js} +6 -6
- package/dist/chunks/input-field.D6N2kt7s.js.map +1 -0
- package/dist/chunks/{inspector.types.DaY6OOzz.js → inspector.types.2YEArjPi.js} +5 -5
- package/dist/chunks/{inspector.types.DaY6OOzz.js.map → inspector.types.2YEArjPi.js.map} +1 -1
- package/dist/chunks/{layout-row.DzS_XyyF.js → layout-row.BfS-cPky.js} +5 -5
- package/dist/chunks/layout-row.BfS-cPky.js.map +1 -0
- package/dist/chunks/{link.v-y0fKjn.js → link.UOEUR35A.js} +7 -7
- package/dist/chunks/{link.v-y0fKjn.js.map → link.UOEUR35A.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.BnX0H4HE.js → listbox-option-tag.Co0ycEdQ.js} +3 -3
- package/dist/chunks/{listbox-option-tag.BnX0H4HE.js.map → listbox-option-tag.Co0ycEdQ.js.map} +1 -1
- package/dist/chunks/{menu.B78fzH_k.js → menu.CLaN9Eys.js} +9 -9
- package/dist/chunks/{menu.B78fzH_k.js.map → menu.CLaN9Eys.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.DgftXCJe.js → modal-fullscreen.B-qr1Szh.js} +7 -7
- package/dist/chunks/{modal-fullscreen.DgftXCJe.js.map → modal-fullscreen.B-qr1Szh.js.map} +1 -1
- package/dist/chunks/{modal.BA745pfv.js → modal.wU3uUJKq.js} +6 -6
- package/dist/chunks/{modal.BA745pfv.js.map → modal.wU3uUJKq.js.map} +1 -1
- package/dist/chunks/{pagination.CfwtuZ7R.js → pagination.BM3FhtxJ.js} +5 -5
- package/dist/chunks/{pagination.CfwtuZ7R.js.map → pagination.BM3FhtxJ.js.map} +1 -1
- package/dist/chunks/{payment-method.CoXB0ZAW.js → payment-method.UaERFtej.js} +2 -2
- package/dist/chunks/{payment-method.CoXB0ZAW.js.map → payment-method.UaERFtej.js.map} +1 -1
- package/dist/chunks/{popover.ZlmaSYms.js → popover.DsUymZWJ.js} +5 -5
- package/dist/chunks/{popover.ZlmaSYms.js.map → popover.DsUymZWJ.js.map} +1 -1
- package/dist/chunks/{popper-container.CnWphJTN.js → popper-container.B1iB2ovW.js} +5 -5
- package/dist/chunks/popper-container.B1iB2ovW.js.map +1 -0
- package/dist/chunks/{promo-banner.cTUF9seG.js → promo-banner.BXtIM4C9.js} +7 -7
- package/dist/chunks/{promo-banner.cTUF9seG.js.map → promo-banner.BXtIM4C9.js.map} +1 -1
- package/dist/chunks/{radio-group.EnMXbuly.js → radio-group.DMob8x2J.js} +15 -15
- package/dist/chunks/{radio-group.EnMXbuly.js.map → radio-group.DMob8x2J.js.map} +1 -1
- package/dist/chunks/{radio-input.q980f8Uf.js → radio-input.C1DZbkcT.js} +5 -5
- package/dist/chunks/radio-input.C1DZbkcT.js.map +1 -0
- package/dist/chunks/{search-bar.lYuXPzBX.js → search-bar.rubkdbcD.js} +3 -3
- package/dist/chunks/{search-bar.lYuXPzBX.js.map → search-bar.rubkdbcD.js.map} +1 -1
- package/dist/chunks/{secondary-nav.CF6WPYn4.js → secondary-nav.DKSjc5bn.js} +5 -5
- package/dist/chunks/{secondary-nav.CF6WPYn4.js.map → secondary-nav.DKSjc5bn.js.map} +1 -1
- package/dist/chunks/{segmented-control.CVeUROYR.js → segmented-control.DL0W7lJ_.js} +4 -4
- package/dist/chunks/{segmented-control.CVeUROYR.js.map → segmented-control.DL0W7lJ_.js.map} +1 -1
- package/dist/chunks/{selection-card-group.CjuBQ2UA.js → selection-card-group.iYyZ9yX4.js} +10 -10
- package/dist/chunks/{selection-card-group.CjuBQ2UA.js.map → selection-card-group.iYyZ9yX4.js.map} +1 -1
- package/dist/chunks/{sidepanel.NUx7L5f1.js → sidepanel.CQnLpV8A.js} +7 -7
- package/dist/chunks/{sidepanel.NUx7L5f1.js.map → sidepanel.CQnLpV8A.js.map} +1 -1
- package/dist/chunks/{status.types.B0jtv0c7.js → status.types.Cv6hHRMu.js} +2 -2
- package/dist/chunks/{status.types.B0jtv0c7.js.map → status.types.Cv6hHRMu.js.map} +1 -1
- package/dist/chunks/{step.5g9BIi15.js → step.BsIdWhaZ.js} +3 -3
- package/dist/chunks/{step.5g9BIi15.js.map → step.BsIdWhaZ.js.map} +1 -1
- package/dist/chunks/{structured-list-item.BEhWyaVP.js → structured-list-item.BhBbmkbw.js} +6 -6
- package/dist/chunks/{structured-list-item.BEhWyaVP.js.map → structured-list-item.BhBbmkbw.js.map} +1 -1
- package/dist/chunks/{summary-grid-item-custom.CSXo4NjY.js → summary-grid-item-custom.CicAOBVQ.js} +5 -5
- package/dist/chunks/{summary-grid-item-custom.CSXo4NjY.js.map → summary-grid-item-custom.CicAOBVQ.js.map} +1 -1
- package/dist/chunks/{tabs.Casntai-.js → tabs.9kObZry9.js} +5 -5
- package/dist/chunks/{tabs.Casntai-.js.map → tabs.9kObZry9.js.map} +1 -1
- package/dist/chunks/{tag.wTXg-O7i.js → tag.-YNhsBv7.js} +3 -3
- package/dist/chunks/{tag.wTXg-O7i.js.map → tag.-YNhsBv7.js.map} +1 -1
- package/dist/chunks/{textarea.F-JyRtIw.js → textarea.Cf21WMwL.js} +6 -6
- package/dist/chunks/{textarea.F-JyRtIw.js.map → textarea.Cf21WMwL.js.map} +1 -1
- package/dist/chunks/{timeline-item.BJyB8-Wv.js → timeline-item.Cu5b-Mqj.js} +12 -12
- package/dist/chunks/timeline-item.Cu5b-Mqj.js.map +1 -0
- package/dist/chunks/{toast.BEipTIrz.js → toast.DgJbW9CL.js} +4 -4
- package/dist/chunks/{toast.BEipTIrz.js.map → toast.DgJbW9CL.js.map} +1 -1
- package/dist/chunks/{toggle-button.CYplDIO-.js → toggle-button.Cf8C7p6e.js} +2 -2
- package/dist/chunks/{toggle-button.CYplDIO-.js.map → toggle-button.Cf8C7p6e.js.map} +1 -1
- package/dist/chunks/{toggle.INRYdQzz.js → toggle.CnS7qszG.js} +3 -3
- package/dist/chunks/{toggle.INRYdQzz.js.map → toggle.CnS7qszG.js.map} +1 -1
- package/dist/chunks/{tooltip.DH8TqpYV.js → tooltip.R2sqydIE.js} +4 -4
- package/dist/chunks/{tooltip.DH8TqpYV.js.map → tooltip.R2sqydIE.js.map} +1 -1
- package/dist/chunks/{tutorial.DFvMZAN5.js → tutorial.w2ZqeOh1.js} +9 -9
- package/dist/chunks/{tutorial.DFvMZAN5.js.map → tutorial.w2ZqeOh1.js.map} +1 -1
- package/dist/chunks/{typography.Bu_WAKdf.js → typography.J1v_SPG3.js} +2 -1
- package/dist/chunks/{typography.Bu_WAKdf.js.map → typography.J1v_SPG3.js.map} +1 -1
- package/dist/chunks/{use-bento-toast-controller.BVVMh0wc.js → use-bento-toast-controller.Cn_2Eogn.js} +3 -3
- package/dist/chunks/{use-bento-toast-controller.BVVMh0wc.js.map → use-bento-toast-controller.Cn_2Eogn.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.BiqVX5O7.js → use-cached-selected-values.impKjAIS.js} +22 -22
- package/dist/chunks/use-cached-selected-values.impKjAIS.js.map +1 -0
- package/dist/chunks/{use-country-items.C25TI6tp.js → use-country-items.DPBbl1KK.js} +2 -2
- package/dist/chunks/{use-country-items.C25TI6tp.js.map → use-country-items.DPBbl1KK.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/country.js +2 -2
- package/dist/currency.js +1 -1
- package/dist/dashboard-template.js +1 -1
- package/dist/dashed-underline.js +1 -1
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +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/focus-trap.js +1 -1
- package/dist/form-layout.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +69 -69
- 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.js +1 -1
- package/dist/inspector.js +1 -1
- package/dist/internal.js +27 -25
- package/dist/internal.js.map +1 -1
- package/dist/layout.js +1 -1
- package/dist/link.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/payment-method.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/popper-container.js +1 -1
- package/dist/promo-banner.js +1 -1
- package/dist/radio-group.js +2 -2
- 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/status.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/toggle.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/typography.js +1 -1
- package/dist/web-types.json +2 -2
- package/package.json +7 -6
- package/dist/chunks/base-button.4UYC3kp2.js.map +0 -1
- package/dist/chunks/button.CufUNBkv.js.map +0 -1
- package/dist/chunks/checkbox.B1qjI4R_.js.map +0 -1
- package/dist/chunks/dialog-page.CplkzZGZ.js.map +0 -1
- package/dist/chunks/dropdown-default-textbox.ZAFh7KqG.js.map +0 -1
- package/dist/chunks/dropdown.DC9un4VJ.js.map +0 -1
- package/dist/chunks/focus-trap.DSkLNO_i.js +0 -443
- package/dist/chunks/focus-trap.DSkLNO_i.js.map +0 -1
- package/dist/chunks/header.BLjdXtYJ.js +0 -266
- package/dist/chunks/header.BLjdXtYJ.js.map +0 -1
- package/dist/chunks/input-field.CcjqGkLs.js.map +0 -1
- package/dist/chunks/layout-row.DzS_XyyF.js.map +0 -1
- package/dist/chunks/popper-container.CnWphJTN.js.map +0 -1
- package/dist/chunks/radio-input.q980f8Uf.js.map +0 -1
- package/dist/chunks/timeline-item.BJyB8-Wv.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.BiqVX5O7.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.EnMXbuly.js","sources":["../../src/components/radio-group/components/radio-button/radio-button.vue","../../src/components/radio-group/radio-group.types.ts","../../src/components/radio-group/radio-group.vue"],"sourcesContent":["<template>\n <div class=\"b-radio-button\" data-testid=\"radio-button-container\" :class=\"conditionalClassContainer\">\n <radio-input\n :id=\"radioButtonId\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"hasSlot('description') ? descriptionId : ''\"\n :checked=\"isChecked\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :has-error=\"hasError\"\n :value=\"value\"\n :model-value=\"modelValue\"\n :name=\"name\"\n @update:model-value=\"onChange\"\n />\n <div>\n <label v-if=\"hasSlot('default')\" :for=\"radioButtonId\" class=\"b-radio-button__label-container\">\n <span v-if=\"hasSlot('default')\" class=\"b-radio-button__primary-label\">\n <bento-typography class=\"b-radio-button__label\" el=\"span\" variant=\"body\"><slot /></bento-typography>\n <bento-tag v-if=\"tag\" class=\"b-radio-button__label-tag\" v-bind=\"tag\" />\n </span>\n <bento-typography\n v-if=\"hasSlot('default') && hasSlot('description')\"\n :id=\"descriptionId\"\n class=\"b-radio-button__description\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"description\"></slot>\n </bento-typography>\n </label>\n <bento-typography v-if=\"hasSlot('content') && isChecked\" class=\"b-radio-button__content\" el=\"div\">\n <slot name=\"content\"></slot>\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTag } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n import { RadioInput } from '../../../internal/radio-input';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { generateUid } from '@/core/utils/ts';\n import { computed, ComputedRef, PropType, toRefs, useSlots } from 'vue';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { BentoRadioButtonStateClass, BentoRadioButtonTag, BentoRadioButtonValue } from './radio-button.types';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const props = defineProps({\n /**\n * Disable the radio button (optional)\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Shows bento-radio-button in error state (optional)\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * This property should not be used directly.\n * It will be used by v-model directive on radio component.\n */\n modelValue: {\n type: [String, Number] as PropType<BentoRadioButtonValue>,\n default: null,\n },\n\n /**\n * Sets the radio button to readonly (optional)\n */\n readonly: { 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<BentoRadioButtonTag>, default: undefined },\n\n /**\n * Indicates the value of the input that will be returned when it's checked\n */\n value: {\n type: [String, Number] as PropType<BentoRadioButtonValue>,\n required: true,\n },\n\n /**\n * Sets the name of the radio input.\n * Used for differentiating radio groups or accessing input via form submission.\n */\n name: {\n type: String,\n default: null,\n },\n });\n\n const emit = defineEmits([\"input\", \"update:model-value\"]);\n\n const { value } = toRefs(props);\n const radioButtonId = generateUid('bento-radio-button');\n const descriptionId = generateUid('description');\n\n useDefaultSlotValidator('bento-radio-button', slots.default, slots.description);\n\n const conditionalClassContainer = computed(() => ({\n [`b-radio-button--${BentoRadioButtonStateClass.DISABLED}`]: props.disabled,\n [`b-radio-button--${BentoRadioButtonStateClass.READONLY}`]: props.readonly,\n }));\n\n const ariaLabel = useAriaLabel({\n ariaLabel: getSlotText(slots)('default'),\n label: value.value as string,\n });\n\n const isChecked: ComputedRef<boolean> = computed(() => props.value === props.modelValue);\n\n const onChange = () => {\n if (!props.disabled && !props.readonly) {\n emit('update:model-value', props.value);\n emit('input', props.value);\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Radio buttons are used when two or more options are mutually exclusive,\n * the user can only select a single option from a list of pre-defined options.\n * The label tag area is also clickable.\n * Only to be used internally.\n *\n * @example\n * import { BentoRadioButton } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoRadioButton },\n * template: `\n * <bento-radio-button\n * disabled\n * value=\"inputRadio\"\n * model-value.sync=\"modelValue\"\n * >\n * Label text\n * <template #description>Description text below label</template>\n * <template #content>Content shown when checked</template>\n * </bento-radio-button>\n * `,\n * setup() {\n * const modelValue = ref('anyValue')\n * const value = 'option-value'\n *\n * return {\n * modelValue,\n * value,\n * }\n * }\n * }\n */\n export default {\n name: 'bento-radio-button',\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./radio-button.scss\" />\n","import type { BentoRadioButtonTag, BentoRadioButtonValue } from './components/radio-button';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoRadioGroupVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport type BentoRadioGroupValue = BentoRadioButtonValue;\n\nexport interface BentoRadioGroupItem {\n value: BentoRadioGroupValue;\n label: string;\n description?: string;\n disabled?: boolean;\n readonly?: boolean;\n hasError?: boolean;\n tag?: BentoRadioButtonTag;\n}\n\nexport type BentoRadioGroupItems = Array<BentoRadioGroupItem>;\n","<template>\n <div class=\"b-radio-group\">\n <controls-group\n class=\"b-radio-group__buttons\"\n :aria-describedby=\"shouldShowErrorMessage ? errorId : ''\"\n :component-name=\"COMPONENT_NAME\"\n :class=\"conditionalClasses\"\n :description=\"description\"\n :disabled=\"disabled\"\n :form=\"formId\"\n :label=\"label\"\n :optional=\"optional\"\n :required=\"required\"\n :hide-label=\"hideLabel\"\n :tooltip-text=\"tooltipText\"\n >\n <bento-radio-button\n v-for=\"item in items\"\n :key=\"item.value\"\n :model-value=\"inputValue\"\n :value=\"item.value\"\n :disabled=\"disabled || item.disabled\"\n :readonly=\"isReadOnly || item.readonly\"\n :has-error=\"shouldShowError || item.hasError\"\n :tag=\"item.tag\"\n :name=\"formId || label\"\n @update:model-value=\"onInput\"\n >\n <template #default>{{ item.label }}</template>\n <template v-if=\"item.description\" #description>{{ item.description }}</template>\n <template v-if=\"hasSlot('content') && isVertical\" #content>\n <slot name=\"content\"></slot>\n </template>\n </bento-radio-button>\n </controls-group>\n <error-message\n v-if=\"shouldShowErrorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-radio-group__error-message\"\n />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, toRef, useSlots, watch } from 'vue';\n import { ControlsGroup, ErrorMessage } from '@/components/internal';\n import { BentoRadioButton } from './components/radio-button';\n import { useHasSlot } from '@/composables';\n import { generateUid } from '@/core/utils/ts';\n import { deprecate } from '@/utils/ts/deprecate';\n import { BentoRadioGroupItems, BentoRadioGroupValue, BentoRadioGroupVariant } from './radio-group.types';\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n /**\n * The name of the component to be used in the Vue devtools and console warnings.\n */\n const COMPONENT_NAME = 'bento-radio-group';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const emit = defineEmits([\"input\", \"update:model-value\"]);\n\n const props = defineProps({\n /**\n * Descriptive supporting text visbile underneath the label.\n */\n description: { type: String, default: null },\n\n /**\n * If set to true, renders all bento-radio-buttons in the group in a disabled state.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * If passed as a prop, all bento-radio-buttons in an error state and renders the string beneath the buttons.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * The form id the radio group is associated with. Defaults to null, as a radio group can also be used standalone.\n */\n formId: { type: String, default: null },\n\n /**\n * If set to true, renders all bento-radio-buttons in the group in an error state.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * Shows/hides the group label.\n */\n hideLabel: { type: Boolean, default: null },\n\n /**\n * The radio group's items.\n */\n items: {\n type: Array as PropType<BentoRadioGroupItems>,\n required: true,\n },\n\n /**\n * The name associated with the group. Required for accessibility purposes.\n */\n label: { type: String, required: true },\n\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoRadioButtonItem's value.\n * Defaults to no value selected.\n */\n modelValue: {\n type: [Number, String] as PropType<BentoRadioGroupValue>,\n default: null,\n },\n\n /**\n * Indicates the field is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * If set to true, renders all bento-radio-button in the group in a readonly state.\n */\n readonly: { 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 * The radio group's layout. It can be vertical or horizontal. Defaults to vertical.\n */\n variant: {\n type: String as PropType<BentoRadioGroupVariant | `${BentoRadioGroupVariant}`>,\n default: BentoRadioGroupVariant.VERTICAL,\n validator: (value: BentoRadioGroupVariant) => Object.values(BentoRadioGroupVariant).includes(value),\n },\n });\n\n const inputValue = toRef(props, 'modelValue');\n const errorId = generateUid('error');\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const shouldShowError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.hasError)\n );\n const shouldShowErrorMessage = computed(() => !props.disabled && !isReadOnly.value && !!props.errorMessage);\n\n const conditionalClasses = computed(() => ({\n 'b-radio-group__buttons--horizontal': props.variant === BentoRadioGroupVariant.HORIZONTAL,\n }));\n\n // Content slot logic\n const isVertical = computed(() => props.variant === 'vertical');\n const shouldShowSlotError = computed(() => hasSlot('content') && !isVertical?.value);\n\n const onInput = value => {\n emit('update:model-value', value);\n emit('input', value);\n };\n\n if (props.hasError) {\n deprecate(\n 'BentoRadioGroup \"hasError\" property',\n `Use the BentoRadioGroup \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-radio-group errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n watch(\n shouldShowSlotError,\n newVal => {\n if (newVal) {\n throw new Error('The content slot is only available for the vertical radio group layout');\n }\n },\n {\n immediate: true,\n }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * A radio group component should be used whenever it is necessary to use a set of radio buttons\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * import { BentoRadioGroup } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { BentoRadioGroup },\n * template: `\n * <bento-radio-group\n * label=\"Your group label\"\n * :items=\"[\n * { value: 1, label: 'Your label' },\n * { value: 2, label: 'Another label', description: 'Your descriptive sub label' },\n * ]\"\n * variant=\"horizontal\"\n * />\n * `\n * };\n */\n export default {\n name: 'bento-radio-group',\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./radio-group.scss\" />\n"],"names":["__default__$1","slots","useSlots","hasSlot","useHasSlot","value","toRefs","props","radioButtonId","generateUid","descriptionId","useDefaultSlotValidator","conditionalClassContainer","computed","RadioInputStateClass","ariaLabel","useAriaLabel","getSlotText","isChecked","emit","BentoRadioGroupVariant","BentoRadioGroupVariant2","__default__","COMPONENT_NAME","inputValue","toRef","errorId","isReadOnly","useFormLayoutFieldLoading","shouldShowError","shouldShowErrorMessage","conditionalClasses","isVertical","shouldShowSlotError","onInput","deprecate","watch","newVal"],"mappings":";;;;;;;;;;;;;;AAkKI,MAAAA,IAAA;AAAA,EAAe,MAAA;AAAA,EACL,OAAA,EAAA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AhB;AAAA,MAAwB,MAAA,CAAAN,EAAA,YAAA,CAAAoB,EAAA,UAAA,CAAA,CAAApB,EAAA,gBAAAA,EAAA;AAAA,IACyD,GAEjFuB,IAAAjB,EAAA,MAAA,CAAAN,EAAA,YAAA,CAAAoB,EAAA,SAAA,CAAA,CAAApB,EAAA,YAAA,GAEAwB,IAAAlB,EAAA,OAAA;AAAA,MAA2C,sCAAAN,EAAA,YAAAa,EAAA;AAAA,IACwC,EAAA,GAInFY,IAAAnB,EAAA,MAAAN,EAAA,YAAA,UAAA,GACA0B,IAAApB,EAAA,MAAAV,EAAA,SAAA,KAAA,EAAA6B,KAAA,QAAAA,EAAA,MAAA,GAEAE,IAAA,CAAA7B,MAAA;AACI,MAAAc,EAAA,sBAAAd,CAAA,GACAc,EAAA,SAAAd,CAAA;AAAA,IAAmB;AAGvB,WAAAE,EAAA,YACI4B;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA,MACA;AAAA,IAGA,GAIRC;AAAA,MAAAH;AAAA,MACI,CAAAI,MAAA;AAEI,YAAAA;AACI,gBAAA,IAAA,MAAA,wEAAA;AAAA,MACJ;AAAA,MACJ;AAAA,QACA,WAAA;AAAA,MACe;AAAA,IACf;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"radio-group.DMob8x2J.js","sources":["../../src/components/radio-group/components/radio-button/radio-button.vue","../../src/components/radio-group/radio-group.types.ts","../../src/components/radio-group/radio-group.vue"],"sourcesContent":["<template>\n <div class=\"b-radio-button\" data-testid=\"radio-button-container\" :class=\"conditionalClassContainer\">\n <radio-input\n :id=\"radioButtonId\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"hasSlot('description') ? descriptionId : ''\"\n :checked=\"isChecked\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :has-error=\"hasError\"\n :value=\"value\"\n :model-value=\"modelValue\"\n :name=\"name\"\n @update:model-value=\"onChange\"\n />\n <div>\n <label v-if=\"hasSlot('default')\" :for=\"radioButtonId\" class=\"b-radio-button__label-container\">\n <span v-if=\"hasSlot('default')\" class=\"b-radio-button__primary-label\">\n <bento-typography class=\"b-radio-button__label\" el=\"span\" variant=\"body\"><slot /></bento-typography>\n <bento-tag v-if=\"tag\" class=\"b-radio-button__label-tag\" v-bind=\"tag\" />\n </span>\n <bento-typography\n v-if=\"hasSlot('default') && hasSlot('description')\"\n :id=\"descriptionId\"\n class=\"b-radio-button__description\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"description\"></slot>\n </bento-typography>\n </label>\n <bento-typography v-if=\"hasSlot('content') && isChecked\" class=\"b-radio-button__content\" el=\"div\">\n <slot name=\"content\"></slot>\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTag } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n import { RadioInput } from '../../../internal/radio-input';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { generateUid } from '@/core/utils/ts';\n import { computed, ComputedRef, PropType, toRefs, useSlots } from 'vue';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { BentoRadioButtonStateClass, BentoRadioButtonTag, BentoRadioButtonValue } from './radio-button.types';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const props = defineProps({\n /**\n * Disable the radio button (optional)\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Shows bento-radio-button in error state (optional)\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * This property should not be used directly.\n * It will be used by v-model directive on radio component.\n */\n modelValue: {\n type: [String, Number] as PropType<BentoRadioButtonValue>,\n default: null,\n },\n\n /**\n * Sets the radio button to readonly (optional)\n */\n readonly: { 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<BentoRadioButtonTag>, default: undefined },\n\n /**\n * Indicates the value of the input that will be returned when it's checked\n */\n value: {\n type: [String, Number] as PropType<BentoRadioButtonValue>,\n required: true,\n },\n\n /**\n * Sets the name of the radio input.\n * Used for differentiating radio groups or accessing input via form submission.\n */\n name: {\n type: String,\n default: null,\n },\n });\n\n const emit = defineEmits([\"input\", \"update:model-value\"]);\n\n const { value } = toRefs(props);\n const radioButtonId = generateUid('bento-radio-button');\n const descriptionId = generateUid('description');\n\n useDefaultSlotValidator('bento-radio-button', slots.default, slots.description);\n\n const conditionalClassContainer = computed(() => ({\n [`b-radio-button--${BentoRadioButtonStateClass.DISABLED}`]: props.disabled,\n [`b-radio-button--${BentoRadioButtonStateClass.READONLY}`]: props.readonly,\n }));\n\n const ariaLabel = useAriaLabel({\n ariaLabel: getSlotText(slots)('default'),\n label: value.value as string,\n });\n\n const isChecked: ComputedRef<boolean> = computed(() => props.value === props.modelValue);\n\n const onChange = () => {\n if (!props.disabled && !props.readonly) {\n emit('update:model-value', props.value);\n emit('input', props.value);\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Radio buttons are used when two or more options are mutually exclusive,\n * the user can only select a single option from a list of pre-defined options.\n * The label tag area is also clickable.\n * Only to be used internally.\n *\n * @example\n * import { BentoRadioButton } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoRadioButton },\n * template: `\n * <bento-radio-button\n * disabled\n * value=\"inputRadio\"\n * model-value.sync=\"modelValue\"\n * >\n * Label text\n * <template #description>Description text below label</template>\n * <template #content>Content shown when checked</template>\n * </bento-radio-button>\n * `,\n * setup() {\n * const modelValue = ref('anyValue')\n * const value = 'option-value'\n *\n * return {\n * modelValue,\n * value,\n * }\n * }\n * }\n */\n export default {\n name: 'bento-radio-button',\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./radio-button.scss\" />\n","import type { BentoRadioButtonTag, BentoRadioButtonValue } from './components/radio-button';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoRadioGroupVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport type BentoRadioGroupValue = BentoRadioButtonValue;\n\nexport interface BentoRadioGroupItem {\n value: BentoRadioGroupValue;\n label: string;\n description?: string;\n disabled?: boolean;\n readonly?: boolean;\n hasError?: boolean;\n tag?: BentoRadioButtonTag;\n}\n\nexport type BentoRadioGroupItems = Array<BentoRadioGroupItem>;\n","<template>\n <div class=\"b-radio-group\">\n <controls-group\n class=\"b-radio-group__buttons\"\n :aria-describedby=\"shouldShowErrorMessage ? errorId : ''\"\n :component-name=\"COMPONENT_NAME\"\n :class=\"conditionalClasses\"\n :description=\"description\"\n :disabled=\"disabled\"\n :form=\"formId\"\n :label=\"label\"\n :optional=\"optional\"\n :required=\"required\"\n :hide-label=\"hideLabel\"\n :tooltip-text=\"tooltipText\"\n >\n <bento-radio-button\n v-for=\"item in items\"\n :key=\"item.value\"\n :model-value=\"inputValue\"\n :value=\"item.value\"\n :disabled=\"disabled || item.disabled\"\n :readonly=\"isReadOnly || item.readonly\"\n :has-error=\"shouldShowError || item.hasError\"\n :tag=\"item.tag\"\n :name=\"formId || label\"\n @update:model-value=\"onInput\"\n >\n <template #default>{{ item.label }}</template>\n <template v-if=\"item.description\" #description>{{ item.description }}</template>\n <template v-if=\"hasSlot('content') && isVertical\" #content>\n <slot name=\"content\"></slot>\n </template>\n </bento-radio-button>\n </controls-group>\n <error-message\n v-if=\"shouldShowErrorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-radio-group__error-message\"\n />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, toRef, useSlots, watch } from 'vue';\n import { ControlsGroup, ErrorMessage } from '@/components/internal';\n import { BentoRadioButton } from './components/radio-button';\n import { useHasSlot } from '@/composables';\n import { generateUid } from '@/core/utils/ts';\n import { deprecate } from '@/utils/ts/deprecate';\n import { BentoRadioGroupItems, BentoRadioGroupValue, BentoRadioGroupVariant } from './radio-group.types';\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n /**\n * The name of the component to be used in the Vue devtools and console warnings.\n */\n const COMPONENT_NAME = 'bento-radio-group';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const emit = defineEmits([\"input\", \"update:model-value\"]);\n\n const props = defineProps({\n /**\n * Descriptive supporting text visbile underneath the label.\n */\n description: { type: String, default: null },\n\n /**\n * If set to true, renders all bento-radio-buttons in the group in a disabled state.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * If passed as a prop, all bento-radio-buttons in an error state and renders the string beneath the buttons.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * The form id the radio group is associated with. Defaults to null, as a radio group can also be used standalone.\n */\n formId: { type: String, default: null },\n\n /**\n * If set to true, renders all bento-radio-buttons in the group in an error state.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * Shows/hides the group label.\n */\n hideLabel: { type: Boolean, default: null },\n\n /**\n * The radio group's items.\n */\n items: {\n type: Array as PropType<BentoRadioGroupItems>,\n required: true,\n },\n\n /**\n * The name associated with the group. Required for accessibility purposes.\n */\n label: { type: String, required: true },\n\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoRadioButtonItem's value.\n * Defaults to no value selected.\n */\n modelValue: {\n type: [Number, String] as PropType<BentoRadioGroupValue>,\n default: null,\n },\n\n /**\n * Indicates the field is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * If set to true, renders all bento-radio-button in the group in a readonly state.\n */\n readonly: { 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 * The radio group's layout. It can be vertical or horizontal. Defaults to vertical.\n */\n variant: {\n type: String as PropType<BentoRadioGroupVariant | `${BentoRadioGroupVariant}`>,\n default: BentoRadioGroupVariant.VERTICAL,\n validator: (value: BentoRadioGroupVariant) => Object.values(BentoRadioGroupVariant).includes(value),\n },\n });\n\n const inputValue = toRef(props, 'modelValue');\n const errorId = generateUid('error');\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const shouldShowError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.hasError)\n );\n const shouldShowErrorMessage = computed(() => !props.disabled && !isReadOnly.value && !!props.errorMessage);\n\n const conditionalClasses = computed(() => ({\n 'b-radio-group__buttons--horizontal': props.variant === BentoRadioGroupVariant.HORIZONTAL,\n }));\n\n // Content slot logic\n const isVertical = computed(() => props.variant === 'vertical');\n const shouldShowSlotError = computed(() => hasSlot('content') && !isVertical?.value);\n\n const onInput = value => {\n emit('update:model-value', value);\n emit('input', value);\n };\n\n if (props.hasError) {\n deprecate(\n 'BentoRadioGroup \"hasError\" property',\n `Use the BentoRadioGroup \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-radio-group errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n watch(\n shouldShowSlotError,\n newVal => {\n if (newVal) {\n throw new Error('The content slot is only available for the vertical radio group layout');\n }\n },\n {\n immediate: true,\n }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * A radio group component should be used whenever it is necessary to use a set of radio buttons\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * import { BentoRadioGroup } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { BentoRadioGroup },\n * template: `\n * <bento-radio-group\n * label=\"Your group label\"\n * :items=\"[\n * { value: 1, label: 'Your label' },\n * { value: 2, label: 'Another label', description: 'Your descriptive sub label' },\n * ]\"\n * variant=\"horizontal\"\n * />\n * `\n * };\n */\n export default {\n name: 'bento-radio-group',\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./radio-group.scss\" />\n"],"names":["__default__$1","slots","useSlots","hasSlot","useHasSlot","value","toRefs","props","radioButtonId","generateUid","descriptionId","useDefaultSlotValidator","conditionalClassContainer","computed","RadioInputStateClass","ariaLabel","useAriaLabel","getSlotText","isChecked","emit","BentoRadioGroupVariant","BentoRadioGroupVariant2","__default__","COMPONENT_NAME","inputValue","toRef","errorId","isReadOnly","useFormLayoutFieldLoading","shouldShowError","shouldShowErrorMessage","conditionalClasses","isVertical","shouldShowSlotError","onInput","deprecate","watch","newVal"],"mappings":";;;;;;;;;;;;;;AAkKI,MAAAA,IAAA;AAAA,EAAe,MAAA;AAAA,EACL,OAAA,EAAA,MAAA,aAAA;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBApHAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAoDA,EAAA,OAAAI,EAAA,IAAAC,EAAAC,CAAA,GACAC,IAAAC,EAAA,oBAAA,GACAC,IAAAD,EAAA,aAAA;AAEA,IAAAE,EAAA,sBAAAV,EAAA,SAAAA,EAAA,WAAA;AAEA,UAAAW,IAAAC,EAAA,OAAA;AAAA,MAAkD,CAAA,mBAAAC,EAAA,QAAA,EAAA,GAAAP,EAAA;AAAA,MACoB,CAAA,mBAAAO,EAAA,QAAA,EAAA,GAAAP,EAAA;AAAA,IACA,EAAA,GAGtEQ,IAAAC,EAAA;AAAA,MAA+B,WAAAC,EAAAhB,CAAA,EAAA,SAAA;AAAA,MACY,OAAAI,EAAA;AAAA,IAC1B,CAAA,GAGjBa,IAAAL,EAAA,MAAAN,EAAA,UAAAA,EAAA,UAAA;mLAEA,MAAA;AACI,MAAA,CAAAA,EAAA,YAAA,CAAAA,EAAA,aACIY,EAAA,sBAAAZ,EAAA,KAAA,GACAY,EAAA,SAAAZ,EAAA,KAAA;AAAA,IACJ;;;;;;;;;;;;;;;ACvHI,IAAAa,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA;ACkNR,MAAAE,IAAA;AAAA,EAAe,MAAA;AAAA,EACL,OAAA,EAAA,MAAA,a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ttrs: !1
|
|
8
|
-
},
|
|
8
|
+
}, y = /* @__PURE__ */ c({
|
|
9
9
|
..._,
|
|
10
10
|
props: {
|
|
11
11
|
/**
|
|
@@ -67,20 +67,20 @@ const _ = {
|
|
|
67
67
|
} };
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
|
-
var
|
|
70
|
+
var b = function() {
|
|
71
71
|
var a = this, e = a._self._c, r = a._self._setupProxy;
|
|
72
72
|
return e("input", { ref: "inputRef", staticClass: "b-radio-input", class: r.conditionalClasses, attrs: { id: a.id, "aria-checked": r.isChecked, "aria-label": a.ariaLabel, "aria-invalid": r.ariaInvalid, "aria-describedby": a.ariaDescribedby, disabled: a.disabled, "aria-readonly": a.readonly ? a.readonly : void 0, name: a.name, type: "radio", role: "radio" }, domProps: { checked: r.isChecked, value: r.value }, on: { click: r.onClick, change: r.onChange } });
|
|
73
73
|
}, v = [], h = /* @__PURE__ */ m(
|
|
74
|
-
b,
|
|
75
74
|
y,
|
|
75
|
+
b,
|
|
76
76
|
v,
|
|
77
77
|
!1,
|
|
78
78
|
null,
|
|
79
|
-
"
|
|
79
|
+
"24c7ad5a"
|
|
80
80
|
);
|
|
81
81
|
const D = h.exports;
|
|
82
82
|
export {
|
|
83
83
|
l as R,
|
|
84
84
|
D as a
|
|
85
85
|
};
|
|
86
|
-
//# sourceMappingURL=radio-input.
|
|
86
|
+
//# sourceMappingURL=radio-input.C1DZbkcT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-input.C1DZbkcT.js","sources":["../../../core/src/components/radio-input/radio-input.types.ts","../../src/components/internal/radio-input/radio-input.vue"],"sourcesContent":["export type RadioInputValue = string | number;\n\nexport enum RadioInputStateClass {\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n","<template>\n <input\n :id=\"id\"\n ref=\"inputRef\"\n :aria-checked=\"isChecked\"\n :aria-label=\"ariaLabel\"\n :aria-invalid=\"ariaInvalid\"\n :aria-describedby=\"ariaDescribedby\"\n :checked=\"isChecked\"\n :disabled=\"disabled\"\n :aria-readonly=\"readonly ? readonly : undefined\"\n :value=\"value\"\n :name=\"name\"\n type=\"radio\"\n class=\"b-radio-input\"\n :class=\"conditionalClasses\"\n role=\"radio\"\n @click=\"onClick\"\n @change=\"onChange\"\n />\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ComputedRef, PropType, ref, toRefs } from 'vue';\n import { RadioInputStateClass, RadioInputValue } from '@/core/components/radio-input/radio-input.types';\n import type { HTMLAttributes } from 'vue/types/jsx.d.ts';\n\n const props = defineProps({\n /**\n * The aria label associated to the input checkbox.\n */\n ariaLabel: { type: String, default: '' },\n\n /**\n * An additional string that serves as description for the input checkbox (useful if the component shows a description).\n */\n ariaDescribedby: { type: String, default: '' },\n\n /**\n * Disable the radio button (optional)\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Shows bento-radio-button in error state (optional)\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * Sets the id of the radio input. Required for accessibility purposes\n */\n id: { type: String, default: null },\n\n /**\n * This property should not be used directly.\n * It will be used by v-model directive on radio component.\n */\n modelValue: {\n type: [String, Number] as PropType<RadioInputValue>,\n default: null,\n },\n\n /**\n * Sets the radio button to readonly (optional)\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Indicates the value of the input that will be returned when it's checked\n */\n value: {\n type: [String, Number] as PropType<RadioInputValue>,\n required: true,\n },\n\n /**\n * Sets the name of the radio input.\n * Used for differentiating radio groups or accessing input via form submission.\n */\n name: { type: String, default: null },\n });\n\n const emit = defineEmits([\"update:model-value\"]);\n\n const { value } = toRefs(props);\n\n const inputRef = ref(null);\n\n const conditionalClasses = computed(() => ({\n [`b-radio-input--${RadioInputStateClass.DISABLED}`]: props.disabled,\n [`b-radio-input--${RadioInputStateClass.ERROR}`]: props.hasError,\n [`b-radio-input--${RadioInputStateClass.READONLY}`]: props.readonly,\n }));\n\n const ariaInvalid = computed<HTMLAttributes['aria-invalid']>(() => props.hasError);\n\n const isChecked: ComputedRef<boolean> = computed(() => props.value === props.modelValue);\n\n const onChange = () => {\n if (!props.disabled && !props.readonly) {\n emit('update:model-value', props.value);\n }\n };\n\n // readonly attr doesn't work with radio button, so we need to manually ignore the click instead\n const onClick = event => {\n if (props.readonly) {\n event.preventDefault();\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Internal component that renders a radio input (without label)\n *\n * @example\n * import { RadioInput } from '@/internal/radio-input';\n *\n * export default {\n * components: { BentoCheckboxInput },\n * template: `\n * <label for=\"checkbox-id\">Your label</label>\n * <span id=\"description-id\">Description</span>\n * <radio-input id=\"checkbox-id\" aria=label=\"Your label\" aria-describedby=\"description-id\" />\n * `\n * }\n */\n export default {\n name: 'radio-input',\n inheritAttrs: false,\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/radio-input/radio-input.scss\" />\n"],"names":["RadioInputStateClass","RadioInputStateClass2","__default__","value","toRefs","props","inputRef","ref","conditionalClasses","computed","ariaInvalid","isChecked","emit","event"],"mappings":";;;AAEY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SAHQA,IAAAD,KAAA,CAAA,CAAA;AC8HR,MAAAE,IAAA;AAAA,EAAe,MAAA;AAAA,EACL,cAAA;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA/CA,EAAA,OAAAC,EAAA,IAAAC,EAAAC,CAAA,GAEAC,IAAAC,EAAA,IAAA,GAEAC,IAAAC,EAAA,OAAA;AAAA,MAA2C,CAAA,kBAAAT,EAAA,QAAA,EAAA,GAAAK,EAAA;AAAA,MACoB,CAAA,kBAAAL,EAAA,KAAA,EAAA,GAAAK,EAAA;AAAA,MACH,CAAA,kBAAAL,EAAA,QAAA,EAAA,GAAAK,EAAA;AAAA,IACG,EAAA,GAG/DK,IAAAD,EAAA,MAAAJ,EAAA,QAAA,GAEAM,IAAAF,EAAA,MAAAJ,EAAA,UAAAA,EAAA,UAAA;iIAEA,MAAA;AACI,MAAA,CAAAA,EAAA,YAAA,CAAAA,EAAA,YACIO,EAAA,sBAAAP,EAAA,KAAA;AAAA,IACJ,YAIJ,CAAAQ,MAAA;AACI,MAAAR,EAAA,YACIQ,EAAA,eAAA;AAAA,IACJ;;;;;;;;;;;;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as h, provide as _, toRef as b, useAttrs as y, ref as l, watch as C } from "vue";
|
|
2
2
|
import { d as v } from "./debounce.DUTu11PS.js";
|
|
3
3
|
import { u as I } from "./i18n.BQkEbtPM.js";
|
|
4
|
-
import { B as S } from "./input-field.
|
|
5
|
-
import { I as k } from "./dropdown.
|
|
4
|
+
import { B as S } from "./input-field.D6N2kt7s.js";
|
|
5
|
+
import { I as k } from "./dropdown.BqsoncJr.js";
|
|
6
6
|
import { S as T } from "./search.CBKhp7zB.js";
|
|
7
7
|
import { C as E } from "./cross-circle-fill.CnYH4R_h.js";
|
|
8
8
|
import { n as A } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
@@ -112,4 +112,4 @@ export {
|
|
|
112
112
|
i as a,
|
|
113
113
|
F as b
|
|
114
114
|
};
|
|
115
|
-
//# sourceMappingURL=search-bar.
|
|
115
|
+
//# sourceMappingURL=search-bar.rubkdbcD.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-bar.
|
|
1
|
+
{"version":3,"file":"search-bar.rubkdbcD.js","sources":["../../src/components/search-bar/search-bar.types.ts","../../src/components/search-bar/search-bar.vue"],"sourcesContent":["export enum BentoSearchBarInternalEvent {\n CLEAR = 'clear',\n ESCAPE = 'escape-pressed',\n INPUT = 'input',\n UPDATE = 'update:search-term',\n}\n\nexport enum BentoSearchBarEvent {\n CLEAR = 'search-clear',\n INPUT = 'search-input',\n UPDATE = 'update:search-term',\n}\n\nexport interface BentoSearchBarItem {\n label: string;\n items?: Array<BentoSearchBarItem>;\n}\n\nexport type BentoSearchBarData = Array<BentoSearchBarItem>;\n","<template>\n <div class=\"b-search-bar\">\n <bento-input-field\n ref=\"bentoInputField\"\n v-bind=\"attrs\"\n :value=\"searchTerm\"\n type=\"search\"\n :condensed=\"condensed\"\n :aria-label=\"inputFieldAriaLabel\"\n :aria-hidden=\"false\"\n :placeholder=\"placeholder\"\n @input=\"onInputEvent\"\n @focus=\"emit('focus')\"\n @blur=\"emit('blur')\"\n @escape-pressed=\"emit(BentoSearchBarInternalEvent.ESCAPE)\"\n >\n <template #iconBefore>\n <search-icon :svg-title=\"t('search')\" aria-hidden=\"true\" />\n </template>\n\n <template v-if=\"searchTerm\" #iconAfter>\n <div\n class=\"b-search-bar__clear-search\"\n tabindex=\"0\"\n data-testid=\"b-search-bar-clear-search-button\"\n @click=\"onClearSearch\"\n @keypress.enter=\"onClearSearch\"\n @keyup.space=\"onClearSearch\"\n >\n <cross-circle-fill-icon :svg-title=\"t('clearSearch')\" />\n </div>\n </template>\n </bento-input-field>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { provide, ref, toRef, watch } from 'vue';\n import { debounce } from '@/utils/ts/debounce';\n import { BentoSearchBarInternalEvent } from './search-bar.types';\n import { useI18n } from '@/utils/ts/i18n';\n import BentoInputField from '@/components/input-field/input-field.vue';\n import { INPUT_FIELD_HINT_INJECTION_KEY } from '@/components/input-field/input-field.keys';\n import SearchIcon from '@adyen/ui-assets-icons-16/vue/search';\n import CrossCircleFillIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill';\n import messages from './messages.json';\n import { useAttrs } from 'vue';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = defineProps({\n /**\n * Text that labels an the search bar input element\n */\n inputFieldAriaLabel: { type: String, required: true },\n\n /**\n * Reduces height of the search bar\n */\n condensed: { type: Boolean, default: false },\n\n /**\n * Custom debounce time. Default: 300\n */\n debounceTime: { type: Number, default: 300 },\n\n /**\n * Text displayed as a hint when the field is not empty\n */\n hint: { type: String, default: '' },\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Text displayed as the value being searched\n */\n value: { type: String, default: undefined },\n });\n\n const emit = defineEmits([\"input\", \"clear\", \"escape-pressed\", \"blur\", \"focus\"]);\n\n provide(INPUT_FIELD_HINT_INJECTION_KEY, toRef(props, 'hint'));\n\n const attrs = useAttrs();\n const searchTerm = ref(props.value);\n const bentoInputField = ref<InstanceType<typeof BentoInputField> | null>();\n\n watch(\n () => props.value,\n () => {\n searchTerm.value = props.value;\n },\n { immediate: true }\n );\n\n const onClearSearch = () => {\n searchTerm.value = '';\n emit('clear');\n emit('input', '');\n };\n\n const debouncedEmit = debounce(() => {\n emit('input', searchTerm.value);\n }, props.debounceTime);\n\n const onInputEvent = (value: string) => {\n searchTerm.value = value;\n debouncedEmit();\n };\n\n const focus = () => {\n bentoInputField.value.focusInput();\n };\n\n // Expose method so that it can be used to focus on the input from outside the component\n defineExpose({\n /**\n * Focus on the input field when called.\n */\n focus,\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Search functionality to help users find the desired data quicker.\n * When a user starts typing, the data is dynamically filtered to\n * only show the relevant results.\n *\n * Clearing the search field displays the entire list again.\n *\n * @example\n * import {\n * BentoSearchBar,\n * BentoSearchBarData,\n * useSearchBarFilter\n * } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSearchBar },\n * template: `\n * <bento-search-bar\n * input-field-aria-label=\"Search bar\"\n * v-model=\"searchTerm\"\n * @input=\"onInput\"\n * @clear=\"onClearSearch\"\n * />\n * // Render the filtered data\n * {{ filteredData }}\n * `,\n * setup() {\n * const searchTerm = ref('');\n * const data = ref<BentoSearchBarData>([]);\n * const filteredData = useSearchBarFilter(searchTerm, data);\n *\n * consdt onInput = () => {}\n * consdt onClearSearch = () => {}\n *\n * return {\n * searchTerm,\n * filteredData,\n * onInput,\n * onClearSearch,\n * };\n * }\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./search-bar.scss\" />\n"],"names":["BentoSearchBarInternalEvent","BentoSearchBarInternalEvent2","BentoSearchBarEvent","BentoSearchBarEvent2","__default__","messages","useI18n","provide","INPUT_FIELD_HINT_INJECTION_KEY","toRef","props","attrs","useAttrs","searchTerm","ref","bentoInputField","watch","onClearSearch","emit","debouncedEmit","debounce","onInputEvent","value","focus","expose"],"mappings":";;;;;;;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,SAAA,kBACAA,EAAA,QAAA,SACAA,EAAA,SAAA,sBAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,QAAA,gBACAA,EAAA,QAAA,gBACAA,EAAA,SAAA,sBAHQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;;;GCqKRE,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA5HA,EAAA,EAAA,IAAAC,EAAA;AAoCA,IAAAC,EAAAC,GAAAC,EAAAC,GAAA,MAAA,CAAA;AAEA,UAAAC,IAAAC,EAAA,GACAC,IAAAC,EAAAJ,EAAA,KAAA,GACAK,IAAAD,EAAA;AAEA,IAAAE;AAAA,MAAA,MAAAN,EAAA;AAAA,MACgB,MAAA;AAER,QAAAG,EAAA,QAAAH,EAAA;AAAA,MAAyB;AAAA,MAC7B,EAAA,WAAA,GAAA;AAAA,IACkB;AAGtB,UAAAO,IAAA,MAAA;AACI,MAAAJ,EAAA,QAAA,IACAK,EAAA,OAAA,GACAA,EAAA,SAAA,EAAA;AAAA,IAAgB,GAGpBC,IAAAC,EAAA,MAAA;AACI,MAAAF,EAAA,SAAAL,EAAA,KAAA;AAAA,IAA8B,GAAAH,EAAA,YAAA,GAGlCW,IAAA,CAAAC,MAAA;AACI,MAAAT,EAAA,QAAAS,GACAH,EAAA;AAAA,IAAc,GAGlBI,IAAA,MAAA;AACI,MAAAR,EAAA,MAAA,WAAA;AAAA,IAAiC;AAIrC,WAAAS,EAAA;AAAA;AAAA;AAAA;AAAA,MAAa,OAAAD;AAAA,IAIT,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as _, inject as C, computed as c, ref as g, readonly as I, watch as h, provide as k } from "vue";
|
|
2
|
-
import { B as w } from "./dropdown.
|
|
3
|
-
import { e as S } from "./index.
|
|
2
|
+
import { B as w } from "./dropdown.BqsoncJr.js";
|
|
3
|
+
import { e as S } from "./index.D8ivUe7P.js";
|
|
4
4
|
import { u as $ } from "./i18n.BQkEbtPM.js";
|
|
5
|
-
import { d as B } from "./es6.
|
|
6
|
-
import { B as f } from "./typography.
|
|
5
|
+
import { d as B } from "./es6.jIyAPBgt.js";
|
|
6
|
+
import { B as f } from "./typography.J1v_SPG3.js";
|
|
7
7
|
import { n as u } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
8
8
|
import "../assets/secondary-nav.css";
|
|
9
9
|
const y = Symbol("secondary nav state"), N = {}, V = /* @__PURE__ */ _({
|
|
@@ -109,4 +109,4 @@ const X = Q.exports;
|
|
|
109
109
|
export {
|
|
110
110
|
X as s
|
|
111
111
|
};
|
|
112
|
-
//# sourceMappingURL=secondary-nav.
|
|
112
|
+
//# sourceMappingURL=secondary-nav.DKSjc5bn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secondary-nav.
|
|
1
|
+
{"version":3,"file":"secondary-nav.DKSjc5bn.js","sources":["../../src/components/secondary-nav/secondary-nav.keys.ts","../../src/components/secondary-nav/components/secondary-nav-item/secondary-nav-item.vue","../../src/components/secondary-nav/components/secondary-nav-category/secondary-nav-category.vue","../../src/components/secondary-nav/secondary-nav.vue"],"sourcesContent":["import { InjectionKey } from 'vue';\nimport { BentoSecondaryNavState } from './secondary-nav.types';\n\nexport const SECONDARY_NAV_STATE = Symbol('secondary nav state') as InjectionKey<BentoSecondaryNavState>;\n","<template>\n <button class=\"b-secondary-nav-item\" :class=\"conditionalClasses\" @click=\"onClick\">\n <bento-typography class=\"b-secondary-nav-item__title\" variant=\"body\" stronger>\n {{ label }}\n </bento-typography>\n </button>\n</template>\n\n<script lang=\"ts\" setup>\n import { SECONDARY_NAV_STATE } from '../../secondary-nav.keys';\n import { BentoTypography } from '@/components/typography';\n import { computed, inject } from 'vue';\n\n const { activeItemValue, updateActiveItemValue } = inject(SECONDARY_NAV_STATE);\n\n const props = defineProps({\n label: null,\n value: null\n});\n\n const conditionalClasses = computed(() => ({\n 'b-secondary-nav-item--active': activeItemValue.value === props.value,\n }));\n\n const emit = defineEmits([\"click\"]);\n\n const onClick = (e: MouseEvent) => {\n emit('click', e);\n updateActiveItemValue(props.value);\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * This component shouldn't be used directly. It is internally used by {@see BentoSecondaryNav}\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav-item.scss\" />\n","<template>\n <section class=\"b-secondary-nav-category\" :aria-label=\"label\">\n <bento-typography el=\"h1\" class=\"b-secondary-nav-category__label\" variant=\"caption\" stronger>{{\n label\n }}</bento-typography>\n <ul class=\"b-secondary-nav__list\">\n <li v-for=\"item in items\" :key=\"item.value\">\n <secondary-nav-item :label=\"item.label\" :value=\"item.value\" />\n </li>\n </ul>\n </section>\n</template>\n\n<script lang=\"ts\" setup>\n import { BentoTypography } from '@/components/typography';\n import { SecondaryNavItem } from '../secondary-nav-item';\n import { BentoSecondaryNavItemsItem } from '../../secondary-nav.types';\n\n defineProps({\n label: null,\n items: null\n});\n</script>\n\n<script lang=\"ts\">\n /**\n * This component shouldn't be used directly. It is internally used by {@see BentoSecondaryNav}\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav-category.scss\" />\n","<template>\n <nav class=\"b-secondary-nav\">\n <bento-dropdown\n v-if=\"isMobile\"\n :aria-label=\"t('mobileDropdownAriaLabel')\"\n :items=\"dropdownItems\"\n :static-categories=\"hasCategories\"\n :value=\"activeItemValue\"\n @input=\"updateActiveItemValue\"\n />\n <ul v-else class=\"b-secondary-nav__list\">\n <li v-for=\"item in items\" :key=\"item.label\">\n <secondary-nav-category v-if=\"'items' in item\" :label=\"item.label\" :items=\"item.items\" />\n <secondary-nav-item v-else :label=\"item.label\" :value=\"item.value\" />\n </li>\n </ul>\n </nav>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, provide, readonly, ref, watch } from 'vue';\n import { SecondaryNavItem } from './components/secondary-nav-item';\n import { SecondaryNavCategory } from './components/secondary-nav-category';\n import { SECONDARY_NAV_STATE } from './secondary-nav.keys';\n import { BentoSecondaryNavItems, BentoSecondaryNavState } from './secondary-nav.types';\n import { BentoDropdown } from '@/components/dropdown';\n import { useBreakpoints } from '@vueuse/core';\n import { useI18n } from '@/utils/ts/i18n';\n import { BentoListboxOptions } from '@/types';\n import { BMediaQuerySMax } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const breakpoints = useBreakpoints({\n s: BMediaQuerySMax,\n });\n\n const isMobile = breakpoints.smallerOrEqual('s');\n const props = defineProps({\n items: null,\n value: null\n});\n\n const emit = defineEmits([\"change\"]);\n\n const hasCategories = computed(() => props.items.some(item => Object.hasOwn(item, 'items')));\n const dropdownItems = computed(() => props.items as BentoListboxOptions);\n\n const activeItemValueFallback = computed(() => {\n const firstDropdownItem = (dropdownItems.value as BentoSecondaryNavItems)[0];\n\n if ('items' in firstDropdownItem) {\n return firstDropdownItem.items[0].value;\n } else {\n return firstDropdownItem.value;\n }\n });\n const activeItemValue = ref(props.value ?? activeItemValueFallback.value);\n const updateActiveItemValue = (value: string) => {\n activeItemValue.value = value;\n emit('change', value);\n };\n\n // The component's state is inject on `secondary-nav-item` to determine the\n // current active item and to change its value\n const state: BentoSecondaryNavState = {\n activeItemValue: readonly(activeItemValue),\n updateActiveItemValue,\n };\n\n watch(\n () => props.value,\n value => {\n activeItemValue.value = value;\n }\n );\n\n provide(SECONDARY_NAV_STATE, state);\n</script>\n\n<script lang=\"ts\">\n /**\n * Secondary Nav offers users a structured way to access information.\n * It also provides a clear hierarchy for users to understand and navigate through various information.\n *\n * @example\n * import { BentoSecondaryNav } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSecondaryNav },\n * template: `\n * <bento-secondary-nav :value=\"value\" :items=\"items\" />\n * `,\n * setup() {\n * const value = ref(2) // Active item value\n * const items: BentoSecondaryNavItemInfo[] = [\n * { label: 'Option 1', value: 1 },\n * { label: 'Option 2', value: 2 },\n * ];\n * return { items, value };\n * }\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav.scss\" />\n"],"names":["SECONDARY_NAV_STATE","__default__$2","activeItemValue","updateActiveItemValue","inject","conditionalClasses","computed","props","e","emit","__default__$1","__default__","messages","useI18n","breakpoints","useBreakpoints","BMediaQuerySMax","isMobile","hasCategories","item","dropdownItems","activeItemValueFallback","firstDropdownItem","ref","value","state","readonly","watch","provide"],"mappings":";;;;;;;;AAGa,MAAAA,IAAA,OAAA,qBAAA,GCiCTC,IAAA,CAAA;;;;;;;;;iBAvBA,EAAA,iBAAAC,GAAA,uBAAAC,EAAA,IAAAC,EAAAJ,CAAA,GAOAK,IAAAC,EAAA,OAAA;AAAA,MAA2C,gCAAAJ,EAAA,UAAAK,EAAA;AAAA,IACyB,EAAA;yHAKpE,CAAAC,MAAA;AACI,MAAAC,EAAA,SAAAD,CAAA,GACAL,EAAAI,EAAA,KAAA;AAAA,IAAiC;;;;;;;;;;;;;;qBCArCG,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GC+EAC,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;iBA1EA,EAAA,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAA;AAAA,MAAmC,GAAAC;AAAA,IAC5B,CAAA,GAGPC,IAAAH,EAAA,eAAA,GAAA,GAQAI,IAAAZ,EAAA,MAAAC,EAAA,MAAA,KAAA,CAAAY,MAAA,OAAA,OAAAA,GAAA,OAAA,CAAA,CAAA,GACAC,IAAAd,EAAA,MAAAC,EAAA,KAAA,GAEAc,IAAAf,EAAA,MAAA;AACI,YAAAgB,IAAAF,EAAA,MAAA,CAAA;AAEA,aAAA,WAAAE,IACIA,EAAA,MAAA,CAAA,EAAA,QAEAA,EAAA;AAAA,IACJ,CAAA,GAEJpB,IAAAqB,EAAAhB,EAAA,SAAAc,EAAA,KAAA,GACAlB,IAAA,CAAAqB,MAAA;AACI,MAAAtB,EAAA,QAAAsB,GACAf,EAAA,UAAAe,CAAA;AAAA,IAAoB,GAKxBC,IAAA;AAAA,MAAsC,iBAAAC,EAAAxB,CAAA;AAAA,MACO,uBAAAC;AAAA,IACzC;AAGJ,WAAAwB;AAAA,MAAA,MAAApB,EAAA;AAAA,MACgB,CAAAiB,MAAA;AAER,QAAAtB,EAAA,QAAAsB;AAAA,MAAwB;AAAA,IAC5B,GAGJI,EAAA5B,GAAAyB,CAAA;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as p, ref as i, computed as d, toRef as g, watch as C, onMounted as h } from "vue";
|
|
2
|
-
import { B, p as y } from "./typography.
|
|
3
|
-
import { g as w } from "./generate-uid.
|
|
2
|
+
import { B, p as y } from "./typography.J1v_SPG3.js";
|
|
3
|
+
import { g as w } from "./generate-uid.NJ8tVoha.js";
|
|
4
4
|
import { n as f } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
5
5
|
import { o as $ } from "./resize.Bqks3WUm.js";
|
|
6
|
-
import { B as W } from "./tooltip.
|
|
6
|
+
import { B as W } from "./tooltip.R2sqydIE.js";
|
|
7
7
|
import "../assets/segmented-control.css";
|
|
8
8
|
const k = {
|
|
9
9
|
name: "bento-segmented-control-button"
|
|
@@ -108,4 +108,4 @@ const q = P.exports;
|
|
|
108
108
|
export {
|
|
109
109
|
q as B
|
|
110
110
|
};
|
|
111
|
-
//# sourceMappingURL=segmented-control.
|
|
111
|
+
//# sourceMappingURL=segmented-control.DL0W7lJ_.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmented-control.
|
|
1
|
+
{"version":3,"file":"segmented-control.DL0W7lJ_.js","sources":["../../src/components/segmented-control/components/segmented-control-button/segmented-control-button.vue","../../src/components/segmented-control/segmented-control.vue"],"sourcesContent":["<template>\n <div class=\"b-segmented-control-button\" :class=\"conditionalClasses\">\n <input\n :id=\"segmentedControlButtonId\"\n :aria-checked=\"isChecked\"\n :aria-label=\"label\"\n :checked=\"isChecked\"\n :disabled=\"disabled\"\n :value=\"value\"\n type=\"radio\"\n class=\"b-segmented-control-button__input\"\n role=\"radio\"\n @change=\"onClick\"\n />\n <label v-if=\"label\" :for=\"segmentedControlButtonId\" class=\"b-segmented-control-button__label-container\">\n <bento-typography\n ref=\"segmentedControlButtonLabel\"\n class=\"b-segmented-control-button__label\"\n el=\"span\"\n variant=\"body\"\n stronger\n >\n {{ label }}\n </bento-typography>\n </label>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTypography } from '@/components/typography';\n import { generateUid } from '@/core/utils/ts';\n import { computed, ComputedRef, ref } from 'vue';\n\n const props = defineProps({\n disabled: { type: Boolean, default: false },\n fullWidth: { type: Boolean, default: false },\n label: null,\n modelValue: { default: null },\n truncate: { type: Boolean, default: false },\n value: null,\n wrap: { type: Boolean, default: false }\n});\n\n const emit = defineEmits([\"update:model-value\"]);\n\n const segmentedControlButtonLabel = ref();\n const segmentedControlButtonId = generateUid('segmented-control-button');\n const isChecked: ComputedRef<boolean> = computed(() => props.value === props.modelValue);\n const conditionalClasses = computed(() => ({\n 'b-segmented-control-button--hug-content': !props.fullWidth,\n 'b-segmented-control-button--full-width': props.fullWidth,\n 'b-segmented-control-button--truncate': props.truncate,\n 'b-segmented-control-button--wrap': props.wrap && !props.truncate,\n }));\n const onClick = () => {\n if (!props.disabled) {\n emit('update:model-value', props.value);\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Internal component to be used within the BentoSegmentedControl component only\n */\n export default {\n name: 'bento-segmented-control-button',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./segmented-control-button.scss\" />\n","<template>\n <div ref=\"segmentedControlRef\" role=\"group\" class=\"b-segmented-control\" :class=\"conditionalClasses\">\n <segmented-control-button\n v-for=\"(item, index) in computedItems\"\n ref=\"segmentedControlButtonRef\"\n :key=\"`segmented-control-item-${index}-${item.label}`\"\n v-bento-tooltip-directive=\"item.tooltipText\"\n class=\"b-segmented-control__item\"\n :label=\"item.label\"\n :value=\"item.value\"\n :disabled=\"item.disabled\"\n :truncate=\"truncate\"\n :wrap=\"wrap\"\n :full-width=\"fullWidth\"\n :model-value=\"inputValue\"\n @update:model-value=\"onInput\"\n />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, ref, toRef, watch } from 'vue';\n import SegmentedControlButton from './components/segmented-control-button/segmented-control-button.vue';\n import { BentoSegmentedControlItem } from './segmented-control.types';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\n import { BentoTooltipDirective as vBentoTooltipDirective } from '@/directives';\n\n const emit = defineEmits([\"update:model-value\"]);\n\n const props = defineProps({\n ariaLabel: { default: null },\n fullWidth: { type: Boolean, default: false },\n items: null,\n modelValue: null,\n wrap: { type: Boolean, default: false }\n});\n\n const inputValue = toRef(props, 'modelValue');\n\n const segmentedControlRef = ref();\n const segmentedControlButtonRef = ref();\n const hasEllipsis = ref();\n\n const truncate = computed(() => !props.wrap);\n\n watch(\n () => props.items,\n () => {\n if (props.items.length > 5) {\n printDevelopmentWarning(\n 'Do not use when you need to provide more than 5 segments at a time. If you need to provide more options, use a dropdown component.'\n );\n }\n },\n { immediate: true }\n );\n\n onMounted(() => {\n observeSizeOfElement(segmentedControlRef.value, () => {\n if (segmentedControlRef.value) {\n hasEllipsis.value = segmentedControlButtonRef?.value?.map(\n el =>\n el.$refs.segmentedControlButtonLabel.$el.offsetWidth <\n el.$refs.segmentedControlButtonLabel.$el.scrollWidth\n );\n }\n });\n });\n\n const computedItems = computed(() =>\n props.items.map((el, index) => ({\n ...el,\n tooltipText: truncate.value && hasEllipsis?.value?.[index] ? el.label : undefined,\n }))\n );\n\n const onInput = value => {\n emit('update:model-value', value);\n };\n\n const conditionalClasses = computed(() => ({\n 'b-segmented-control--hug': !props.fullWidth,\n 'b-segmented-control--full-width': props.fullWidth,\n 'b-segmented-control--truncate': truncate.value,\n 'b-segmented-control--wrap': props.wrap,\n }));\n</script>\n\n<script lang=\"ts\">\n /**\n * @example\n * import { BentoSegmentedControl } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSegmentedControl },\n * template: `\n * <bento-segmented-control\n * :items=\"[{ label: 'Segment 1', value: 1 }, { label: 'Segment 2', value: 2 }, { label: 'Segment 3', value: 3, disabled: true }]\"\n * :model-value=\"1\"\n * @update:model-value=\"yourUpdateHandler\"\n * />\n * `\n * }\n */\n export default {\n name: 'bento-segmented-control',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./segmented-control.scss\" />\n"],"names":["__default__$1","segmentedControlButtonLabel","ref","segmentedControlButtonId","generateUid","isChecked","computed","props","conditionalClasses","emit","__default__","inputValue","toRef","segmentedControlRef","segmentedControlButtonRef","hasEllipsis","truncate","watch","printDevelopmentWarning","onMounted","observeSizeOfElement","_a","el","computedItems","index","onInput","value"],"mappings":";;;;;;;AAiEI,MAAAA,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;;;;;iBAtBAC,IAAAC,EAAA,GACAC,IAAAC,EAAA,0BAAA,GACAC,IAAAC,EAAA,MAAAC,EAAA,UAAAA,EA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IAAAF,EAAA,OAAA;AAAA,MAA2C,4BAAA,CAAAC,EAAA;AAAA,MACJ,mCAAAA,EAAA;AAAA,MACM,iCAAAS,EAAA;AAAA,MACC,6BAAAT,EAAA;AAAA,IACP,EAAA;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { defineComponent as G, useSlots as O, computed as n, inject as z, ref as m, watch as P, provide as W, onMounted as Y } from "vue";
|
|
2
|
-
import { a as F } from "./index.
|
|
3
|
-
import { d as Q, e as U } from "./es6.
|
|
4
|
-
import { B as H } from "./typography.
|
|
2
|
+
import { a as F } from "./index.D8ivUe7P.js";
|
|
3
|
+
import { d as Q, e as U } from "./es6.jIyAPBgt.js";
|
|
4
|
+
import { B as H } from "./typography.J1v_SPG3.js";
|
|
5
5
|
import { a as J } from "./checkbox-input.Bo4NxNOh.js";
|
|
6
6
|
import { u as K } from "./aria-label.CaUURpnB.js";
|
|
7
|
-
import { g as M } from "./generate-uid.
|
|
7
|
+
import { g as M } from "./generate-uid.NJ8tVoha.js";
|
|
8
8
|
import { u as X } from "./use-has-slot.C9lQZ6nz.js";
|
|
9
|
-
import { a as Z } from "./radio-input.
|
|
9
|
+
import { a as Z } from "./radio-input.C1DZbkcT.js";
|
|
10
10
|
import { n as D } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
11
|
-
import {
|
|
12
|
-
import { E as te } from "./error-message.
|
|
13
|
-
import {
|
|
11
|
+
import { G as ee } from "./grid-layout.HvTAa4to.js";
|
|
12
|
+
import { E as te } from "./error-message.Ccc1sTTp.js";
|
|
13
|
+
import { C as oe } from "./controls-group.CnXzOQkX.js";
|
|
14
14
|
import "../assets/selection-card-group.css";
|
|
15
15
|
var B = /* @__PURE__ */ ((c) => (c.DISABLED = "disabled", c.READONLY = "readonly", c.ERROR = "error", c))(B || {});
|
|
16
16
|
const N = Symbol("selection card radio input injection key"), ae = {
|
|
@@ -256,7 +256,7 @@ const ie = se.exports, ce = {}, ue = /* @__PURE__ */ G({
|
|
|
256
256
|
"itemsPerRow values must have a value between 2 and 6 items per row. Read the documentation for more information."
|
|
257
257
|
);
|
|
258
258
|
});
|
|
259
|
-
}), { __sfc: !0, props: t, emit: e, slots: o, hasSlot: a, conditionalItemsClasses: v, inputValue: s, errorMessageId: C, shouldShowGroupError: E, containerRef: x, width: _, smallBreakpoint: h, mediumBreakpoint: R, currentBreakpoint: y, computedItemsPerRow: r, computedRows: g, itemColumnWidth: p, computedColumnWidth: k, onInput: b, isRadioVariant: u, BentoSelectionCard: ie, ControlsGroup:
|
|
259
|
+
}), { __sfc: !0, props: t, emit: e, slots: o, hasSlot: a, conditionalItemsClasses: v, inputValue: s, errorMessageId: C, shouldShowGroupError: E, containerRef: x, width: _, smallBreakpoint: h, mediumBreakpoint: R, currentBreakpoint: y, computedItemsPerRow: r, computedRows: g, itemColumnWidth: p, computedColumnWidth: k, onInput: b, isRadioVariant: u, BentoSelectionCard: ie, ControlsGroup: oe, ErrorMessage: te, GridLayout: ee };
|
|
260
260
|
}
|
|
261
261
|
});
|
|
262
262
|
var de = function() {
|
|
@@ -296,4 +296,4 @@ export {
|
|
|
296
296
|
B as a,
|
|
297
297
|
Be as s
|
|
298
298
|
};
|
|
299
|
-
//# sourceMappingURL=selection-card-group.
|
|
299
|
+
//# sourceMappingURL=selection-card-group.iYyZ9yX4.js.map
|
package/dist/chunks/{selection-card-group.CjuBQ2UA.js.map → selection-card-group.iYyZ9yX4.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selection-card-group.CjuBQ2UA.js","sources":["../../src/components/selection-card/selection-card.types.ts","../../src/components/selection-card/selection-card.keys.ts","../../src/components/selection-card/selection-card.vue","../../src/components/selection-card/components/selection-card-group/selection-card-group.vue"],"sourcesContent":["import { RadioInputValue } from '@/components/internal/radio-input';\nimport { BentoCheckboxType } from '@/core/components/checkbox/checkbox.types';\nimport { VueNodeElement } from '@/types';\n\nexport enum BentoSelectionCardState {\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n\nexport type BentoSelectionCardValue = string | number;\n\nexport type BentoSelectionCardModelValue = BentoCheckboxType | RadioInputValue;\n\nexport interface BentoSelectionCardItem {\n content?: string | object;\n description?: string;\n disabled?: boolean;\n dynamicContent?: string | object;\n fullyClickable?: boolean;\n hasError?: boolean;\n icon?: VueNodeElement;\n readonly?: boolean;\n subtitle?: string;\n title: string;\n value: BentoSelectionCardValue;\n}\n","export const SELECTION_CARD_RADIO_INPUT_INJECTION_KEY = Symbol('selection card radio input injection key');\n","<template>\n <div class=\"b-selection-card\" :class=\"conditionalClasses\" @click=\"handleCardClick\">\n <div class=\"b-selection-card__container\" :class=\"containerConditionalClasses\">\n <div class=\"b-selection-card__checkbox-container\" :class=\"checkboxContainerConditionalClasses\">\n <div class=\"b-selection-card__checkbox-container-text\" :class=\"checkboxContainerTextConditionalClasses\">\n <div v-if=\"hasSlot('icon')\" class=\"b-selection-card__icon\" role=\"presentation\">\n <slot name=\"icon\" />\n </div>\n <label :for=\"inputId\" class=\"b-selection-card__text\" @click.stop.prevent=\"handleCardClick\">\n <bento-typography\n v-if=\"subtitle\"\n class=\"b-selection-card__description\"\n el=\"span\"\n variant=\"caption\"\n >\n {{ subtitle }}\n </bento-typography>\n <bento-typography el=\"span\" variant=\"title\">{{ title }}</bento-typography>\n <bento-typography\n v-if=\"description\"\n id=\"descriptionId\"\n class=\"b-selection-card__description\"\n el=\"span\"\n variant=\"body\"\n >\n {{ description }}\n </bento-typography>\n </label>\n </div>\n <radio-input\n v-if=\"isRadioInput\"\n :id=\"inputId\"\n ref=\"inputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"description ? descriptionId : undefined\"\n :disabled=\"disabled\"\n :has-error=\"hasError\"\n :aria-readonly=\"readonly ?? undefined\"\n :value=\"value\"\n :readonly=\"readonly\"\n :model-value=\"computedRadioInputModelValue\"\n />\n <checkbox-input\n v-else\n :id=\"inputId\"\n ref=\"inputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"description ? descriptionId : undefined\"\n :disabled=\"disabled\"\n :has-error=\"hasError\"\n :aria-readonly=\"readonly ?? undefined\"\n :value=\"value\"\n :readonly=\"readonly\"\n :model-value=\"computedCheckboxInputModelValue\"\n />\n </div>\n <bento-typography\n v-if=\"hasSlot('content')\"\n ref=\"slotRef\"\n el=\"div\"\n class=\"b-selection-card__slot\"\n :class=\"slotConditionalClasses\"\n >\n <slot name=\"content\" />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('dynamicContent') && isChecked\"\n ref=\"dynamicSlotRef\"\n el=\"div\"\n class=\"b-selection-card__slot\"\n :class=\"slotConditionalClasses\"\n >\n <slot name=\"dynamicContent\" />\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTypography } from '@/components/typography';\n import { BentoCheckboxType, BentoMultiCheckboxType, CheckboxInput } from '../internal/checkbox-input';\n import { RadioInput, RadioInputValue } from '../internal/radio-input';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { generateUid } from '@/core/utils/ts';\n import { computed, ComputedRef, inject, PropType, Ref, ref, useSlots } from 'vue';\n import { useHasSlot } from '@/composables';\n import type { BentoSelectionCardModelValue, BentoSelectionCardValue } from './selection-card.types';\n import { BentoSelectionCardState } from './selection-card.types';\n import { SELECTION_CARD_RADIO_INPUT_INJECTION_KEY } from './selection-card.keys';\n\n const props = defineProps({\n /**\n * The description of the selection card\n */\n description: {\n type: String,\n default: undefined,\n },\n\n /**\n * Disables the selection card\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Makes the entire selection card clickable. Clicking over interactive elements inside the card with this prop enabled will not be possible.\n */\n fullyClickable: { type: Boolean, default: false },\n\n /**\n * Shows the selection card in error state\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * This property should not be used directly.\n * It will be used by v-model directive on selection card component.\n *\n * When handling a single input, use a string or a number.\n *\n * When handling multiple inputs, use an array of keys.\n * These keys exist as a set \"value\" prop for each input.\n */\n modelValue: {\n type: [Boolean, String, Array] as PropType<BentoSelectionCardModelValue>,\n default: null,\n },\n\n /**\n * Sets the selection card to readonly\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * The subtitle of the selection card\n */\n subtitle: {\n type: String,\n default: undefined,\n },\n\n /**\n * The title of the selection card\n */\n title: {\n type: String,\n required: true,\n },\n\n /**\n * Indicates the value of the input that will be returned when it's checked.\n */\n value: {\n type: [String, Number] as PropType<BentoSelectionCardValue>,\n required: true,\n },\n });\n\n const emit = defineEmits([\"input\", \"update:model-value\"]);\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const inputId = generateUid('selection-card-input-id');\n const descriptionId = generateUid('selection-card-description');\n\n const computedRadioInputModelValue: ComputedRef<RadioInputValue> = computed(\n () => props.modelValue as RadioInputValue\n );\n const computedCheckboxInputModelValue: ComputedRef<BentoCheckboxType> = computed(\n () => props.modelValue as BentoCheckboxType\n );\n\n const conditionalClasses = computed(() => ({\n 'b-selection-card--checked': isChecked.value,\n 'b-selection-card--fully-clickable': props.fullyClickable,\n }));\n\n const containerConditionalClasses = computed(() => ({\n [`b-selection-card--${BentoSelectionCardState.DISABLED}`]: props.disabled,\n [`b-selection-card--${BentoSelectionCardState.ERROR}`]: props.hasError,\n [`b-selection-card--${BentoSelectionCardState.READONLY}`]: props.readonly,\n 'b-selection-card--center-aligned': isTitleOnly.value,\n }));\n\n const checkboxContainerConditionalClasses = computed(() => ({\n 'b-selection-card__checkbox-container--center-aligned': isTitleOnly.value,\n }));\n\n const checkboxContainerTextConditionalClasses = computed(() => ({\n 'b-selection-card__checkbox-container-text--center-aligned': isTitleOnly.value,\n }));\n\n const slotConditionalClasses = computed(() => ({\n 'b-selection-card__slot--with-icon': hasSlot('icon'),\n }));\n\n const ariaLabel = useAriaLabel({\n ariaLabel: props.title,\n label: props.value as string,\n });\n\n const isCheckboxGroup = computed(() => Array.isArray(props.modelValue));\n\n const isChecked: ComputedRef<boolean> = computed(() => {\n if (isRadioInput.value) {\n return props.value === props.modelValue;\n }\n if (!isCheckboxGroup.value) {\n return props.modelValue as boolean;\n }\n\n return (props.modelValue as BentoMultiCheckboxType).some(item => item === props.value);\n });\n\n const isRadioInput: Ref<boolean> = inject(SELECTION_CARD_RADIO_INPUT_INJECTION_KEY, ref(false));\n\n const isTitleOnly = computed(() => !props.subtitle && !props.description);\n\n const inputRef = ref<InstanceType<typeof RadioInput> | InstanceType<typeof CheckboxInput>>(null);\n const slotRef = ref(null);\n const dynamicSlotRef = ref(null);\n\n // Handle click on the whole card area\n const handleCardClick = (event: Event) => {\n if (inputRef.value.$refs.inputRef === event.target) {\n const newValue = toggleInput();\n onChange(newValue);\n return;\n }\n\n // Do nothing if disabled or readonly\n if (props.disabled && props.readonly) {\n return;\n }\n\n // If it's not fully clickable prevent selecting the card if the click\n // originated in a slot\n if (!props.fullyClickable) {\n // Check if the click originated from the slot - in that case, do nothng\n if (slotRef.value && slotRef.value?.$el?.contains(event.target)) {\n return;\n }\n // Check if the click originated from the dynamic slot - in that case, do nothng\n if (dynamicSlotRef.value && dynamicSlotRef.value?.$el?.contains(event.target)) {\n return;\n }\n // Check if the click originated from the input - in that case do nothing, as the input will emit the event already\n if (inputRef.value && inputRef.value?.$el?.contains(event.target as Node)) {\n return;\n }\n }\n\n // If the click originated outside of these two areas, emit the change event\n const newValue = toggleInput();\n\n onChange(newValue);\n };\n\n const toggleInput = (): BentoSelectionCardModelValue => {\n const currentValue: boolean = (inputRef.value?.$refs.inputRef as HTMLInputElement).checked;\n\n if (isCheckboxGroup.value) {\n const newCheckedList = [...(props.modelValue as BentoMultiCheckboxType)];\n const index = newCheckedList.indexOf(props.value);\n\n if (index === -1) {\n newCheckedList.push(props.value);\n } else {\n newCheckedList.splice(index, 1);\n }\n return newCheckedList;\n }\n\n if (isRadioInput.value) {\n return props.value;\n }\n return currentValue;\n };\n\n const onChange = newValue => {\n if (!props.disabled && !props.readonly) {\n emit('update:model-value', newValue);\n emit('input', newValue);\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Selection card component. If used standalone, only the checkbox variant can be used. If the checkbox variant is needed, please use the bento-selection-card-group component.\n *\n * @example\n * import { BentoSelectionCard } from '@adyen/bento-vue2';\n * import EmoticonHappyIcon from '@adyen/ui-assets-icons-16/vue/emoticon-happy';\n *\n * export default {\n * components: { BentoSelectionCard, EmoticonHappyIcon },\n * template: `\n * <bento-selection-card title=\"Card title\" :model-value.sync=\"yourModelValue\">\n * <template #icon>\n * <emoticon-happy-icon />\n * </template>\n * </bento-selection-card>\n * `\n * }\n */\n export default {\n name: 'bento-selection-card',\n };\n</script>\n<style lang=\"scss\" scoped src=\"./selection-card.scss\" />\n","<template>\n <controls-group\n ref=\"containerRef\"\n :aria-describedby=\"shouldShowGroupError ? errorMessageId : null\"\n :label=\"label\"\n :hide-label=\"hideLabel\"\n :description=\"description\"\n :disabled=\"disabled\"\n :tooltip-text=\"tooltipText\"\n :readonly=\"readonly\"\n :required=\"required\"\n :optional=\"optional\"\n class=\"b-selection-card-group\"\n component-name=\"selection-card-group\"\n >\n <div\n v-if=\"!itemsPerRow || layout === 'vertical'\"\n class=\"b-selection-card-group__items\"\n :class=\"conditionalItemsClasses\"\n >\n <bento-selection-card\n v-for=\"item in items\"\n :key=\"`selection-card-${item.value}`\"\n class=\"b-selection-card-group__item\"\n v-bind=\"item\"\n :model-value=\"inputValue\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowGroupError\"\n :disabled=\"disabled || item.disabled\"\n @update:model-value=\"onInput\"\n >\n <template v-if=\"hasSlot('icon') && item.icon\" #icon>\n <slot name=\"icon\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('content') && item.content\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('dynamicContent') && item.dynamicContent\" #dynamicContent>\n <slot name=\"dynamicContent\" v-bind=\"item\"></slot>\n </template>\n </bento-selection-card>\n </div>\n <template v-else>\n <div :key=\"`selection-card-group-layout-breakpoint-${currentBreakpoint}`\">\n <grid-layout\n v-for=\"(row, rowIndex) in computedRows\"\n :key=\"`selection-card-group-row-${rowIndex}-cols-${computedItemsPerRow}`\"\n class=\"b-selection-card-group__items--wrap\"\n :column-width=\"computedColumnWidth\"\n >\n <template v-for=\"(item, columnIndex) in row\" #[`col-${columnIndex+1}`]>\n <bento-selection-card\n :key=\"`selection-card-${item.value}`\"\n class=\"b-selection-card-group__item b-selection-card-group__item--full-height\"\n v-bind=\"item\"\n :model-value=\"inputValue\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowGroupError\"\n :disabled=\"disabled || item.disabled\"\n @update:model-value=\"onInput\"\n >\n <template v-if=\"hasSlot('icon') && item.icon\" #icon>\n <slot name=\"icon\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('content') && item.content\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('dynamicContent') && item.dynamicContent\" #dynamicContent>\n <slot name=\"dynamicContent\" v-bind=\"item\"></slot>\n </template>\n </bento-selection-card>\n </template>\n </grid-layout>\n </div>\n </template>\n <error-message\n v-if=\"shouldShowGroupError\"\n :id=\"errorMessageId\"\n :error-message=\"errorMessage\"\n class=\"b-selection-card-group__error-message\"\n />\n </controls-group>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, PropType, provide, ref, useSlots, watch } from 'vue';\n import { useElementSize } from '@vueuse/core';\n import { BMediaQueryMMax, BMediaQuerySMax } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n import {\n BentoSelectionCardGroupItemsPerRow,\n BentoSelectionCardGroupLayout,\n BentoSelectionCardGroupVariant,\n } from './selection-card-group.types';\n import BentoSelectionCard from '../../selection-card.vue';\n import { ControlsGroup, ErrorMessage, GridLayout } from '../../../internal';\n import { BentoSelectionCardItem, BentoSelectionCardModelValue } from '../../selection-card.types';\n import { SELECTION_CARD_RADIO_INPUT_INJECTION_KEY } from '../../selection-card.keys';\n import { generateUid } from '@/core/utils/ts';\n\n const props = defineProps({\n /**\n * Descriptive supporting text visbile underneath the label.\n */\n description: { type: String, default: null },\n\n /**\n * If set to true, renders all cards in the group in a disabled state.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Renders all cards in an error state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * The form id the selection card group is associated with. Defaults to null, as a selection card group can also be used standalone.\n */\n formId: { type: String, default: null },\n\n /**\n * Shows/hides the group label.\n */\n hideLabel: { type: Boolean, default: null },\n\n /**\n * Label of the group. Required for accessibility purposes, even if it's not shown\n */\n label: {\n type: String,\n required: true,\n },\n\n /**\n * The selection card group's layout. It can be vertical or horizontal. Defaults to vertical.\n * @values horizontal, vertical\n */\n layout: {\n type: String as PropType<BentoSelectionCardGroupLayout>,\n default: 'vertical',\n },\n\n /**\n * The selection card group's items.\n */\n items: {\n type: Array as PropType<BentoSelectionCardItem[]>,\n required: true,\n },\n\n /**\n * Sets the responsive number of items rendered in each row.\n */\n itemsPerRow: {\n type: Object as PropType<BentoSelectionCardGroupItemsPerRow>,\n default: undefined,\n },\n\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoSelectionCardItem's value.\n * Defaults to no value selected.\n */\n modelValue: {\n type: [Array, String, Number] as PropType<BentoSelectionCardModelValue>,\n default: null,\n },\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 * If set to true, renders all cards in the group in a readonly state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Renders the cards with a checkbox or a radio input. Selection logic will also apply in accordance.\n * @values checkbox, radio\n */\n variant: { type: String as PropType<BentoSelectionCardGroupVariant>, default: 'checkbox' },\n });\n\n const emit = defineEmits([\"input\", \"update:model-value\"]);\n const slots = useSlots();\n // Slots logic\n // Temporary, use-has-slots composable doesn't currently work for vue3 named scoped slots\n // We do the same in bento-checkbox-group\n const hasSlot = name => !!slots[name];\n\n const conditionalItemsClasses = computed(() => ({\n 'b-selection-card-group__items--horizontal': props.layout === 'horizontal',\n }));\n\n const inputValue = ref(props.modelValue);\n watch(\n () => props.modelValue,\n () => {\n inputValue.value = props.modelValue;\n }\n );\n\n // Error message logic\n const errorMessageId = generateUid('error');\n const shouldShowGroupError = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n // itemsPerRow logic\n const containerRef = ref<HTMLElement | null>(null);\n const { width } = useElementSize(containerRef);\n\n const smallBreakpoint = computed(() => BMediaQuerySMax.split('px')[0]);\n const mediumBreakpoint = computed(() => BMediaQueryMMax.split('px')[0]);\n\n const currentBreakpoint = computed(() => {\n if (width.value < smallBreakpoint.value) {\n return 'small';\n }\n if (width.value >= smallBreakpoint.value && width.value < mediumBreakpoint.value) {\n return 'medium';\n }\n return 'large';\n });\n\n const computedItemsPerRow = computed(() => {\n return (props.itemsPerRow?.[currentBreakpoint?.value] as number) || props.items.length;\n });\n\n const computedRows = computed(() => {\n if (!props.itemsPerRow) {\n return [];\n }\n const rows = [];\n for (let i = 0; i < props.items.length; i += computedItemsPerRow?.value) {\n rows.push(props.items.slice(i, i + computedItemsPerRow?.value));\n }\n return rows;\n });\n\n // We need to compute the column width on 12 because we're using a 12-column system for out grid-layout logic\n const itemColumnWidth = computed(() => 12 / computedItemsPerRow?.value);\n\n /**\n * Filling the columnWidth array with the same parameters per item to pass\n * to the `grid-layout` layout so the each card can have\n * the same width according to the screen size.\n */\n const computedColumnWidth = computed(() => {\n return computedItemsPerRow?.value\n ? new Array(computedItemsPerRow?.value).fill({\n // Instead of passing the actual screen sizes values, passing the same values per each screen size and recomputing it makes sure visually the change is smoother and not laggy\n small: itemColumnWidth.value,\n medium: itemColumnWidth.value,\n large: itemColumnWidth.value,\n })\n : [];\n });\n\n const onInput = value => {\n inputValue.value = value;\n emit('update:model-value', value);\n emit('input', value);\n };\n\n const isRadioVariant = computed(() => props.variant === 'radio');\n\n provide(SELECTION_CARD_RADIO_INPUT_INJECTION_KEY, isRadioVariant);\n\n onMounted(() => {\n if (props.itemsPerRow) {\n Object.values(props.itemsPerRow).forEach(el => {\n if (el && (el < 2 || el > 6)) {\n throw new Error(\n 'itemsPerRow values must have a value between 2 and 6 items per row. Read the documentation for more information.'\n );\n }\n });\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Group of bento-selection-cards.\n *\n * @example\n * import { BentoSelectionCardGroup } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSelectionCardGroup },\n * template: `\n * <bento-selection-card-group\n * :items=\"[\n * {\n * title: 'Card 1',\n * value: 'card-1',\n * content: 'Slot content 1',\n * icon: RetailIcon,\n * },\n * {\n * title: 'Card 2',\n * value: 'card-2',\n * content: 'Slot content 2',\n * icon: LeafIcon,\n * },\n * ]\"\n * >\n * <template #icon=\"{ icon }\">\n * <component :is=\"icon\"/>\n * </template>\n * <template #content=\"{ content }\">\n * <div>{{ content }}</div>\n * </template>\n * </bento-selection-card-group>\n * `,\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./selection-card-group.scss\" />\n"],"names":["BentoSelectionCardState","BentoSelectionCardState2","SELECTION_CARD_RADIO_INPUT_INJECTION_KEY","__default__$1","slots","useSlots","hasSlot","useHasSlot","inputId","generateUid","descriptionId","computedRadioInputModelValue","computed","props","computedCheckboxInputModelValue","conditionalClasses","isChecked","containerConditionalClasses","isTitleOnly","checkboxContainerConditionalClasses","checkboxContainerTextConditionalClasses","slotConditionalClasses","ariaLabel","useAriaLabel","isCheckboxGroup","isRadioInput","item","inject","ref","inputRef","slotRef","dynamicSlotRef","handleCardClick","event","newValue2","toggleInput","onChange","_b","_a","_d","_c","_f","_e","newValue","currentValue","newCheckedList","index","emit","__default__","name","conditionalItemsClasses","inputValue","watch","errorMessageId","shouldShowGroupError","containerRef","width","useElementSize","smallBreakpoint","BMediaQuerySMax","mediumBreakpoint","BMediaQueryMMax","currentBreakpoint","computedItemsPerRow","computedRows","rows","i","itemColumnWidth","computedColumnWidth","onInput","value","isRadioVariant","provide","onMounted","el"],"mappings":";;;;;;;;;;;;;;AAIY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SAHQA,IAAAD,KAAA,CAAA,CAAA;ACJC,MAAAE,IAAA,OAAA,0CAAA,GCmTTC,KAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBArJAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAA,yBAAA,GACAC,IAAAD,EAAA,4BAAA,GAEAE,IAAAC;AAAA,MAAmE,MAAAC,EAAA;AAAA,IACnD,GAEhBC,IAAAF;AAAA,MAAwE,MAAAC,EAAA;AAAA,IACxD,GAGhBE,IAAAH,EAAA,OAAA;AAAA,MAA2C,6BAAAI,EAAA;AAAA,MACA,qCAAAH,EAAA;AAAA,IACI,EAAA,GAG/CI,IAAAL,EAAA,OAAA;AAAA,MAAoD,CAAA,qBAAAZ,EAAA,QAAA,EAAA,GAAAa,EAAA;AAAA,MACiB,CAAA,qBAAAb,EAAA,KAAA,EAAA,GAAAa,EAAA;AAAA,MACH,CAAA,qBAAAb,EAAA,QAAA,EAAA,GAAAa,EAAA;AAAA,MACG,oCAAAK,EAAA;AAAA,IACjB,EAAA,GAGpDC,IAAAP,EAAA,OAAA;AAAA,MAA4D,wDAAAM,EAAA;AAAA,IACY,EAAA,GAGxEE,IAAAR,EAAA,OAAA;AAAA,MAAgE,6DAAAM,EAAA;AAAA,IACa,EAAA,GAG7EG,IAAAT,EAAA,OAAA;AAAA,MAA+C,qCAAAN,EAAA,MAAA;AAAA,IACQ,EAAA,GAGvDgB,IAAAC,EAAA;AAAA,MAA+B,WAAAV,EAAA;AAAA,MACV,OAAAA,EAAA;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EAAAwB,KAAA,gBAAAA,EAAA,WAAAjD,EAAA,MAAA;AAAA,IAAgF,CAAA,GAGpFmD,IAAApD,EAAA,MAAA;AACI,UAAA,CAAAC,EAAA;AACI,eAAA,CAAA;AAEJ,YAAAoD,IAAA,CAAA;AACA,eAAAC,IAAA,GAAAA,IAAArD,EAAA,MAAA,QAAAqD,KAAAH,KAAA,gBAAAA,EAAA;AACI,QAAAE,EAAA,KAAApD,EAAA,MAAA,MAAAqD,GAAAA,KAAAH,KAAA,gBAAAA,EAAA,MAAA,CAAA;AAEJ,aAAAE;AAAA,IAAO,CAAA,GAIXE,IAAAvD,EAAA,MAAA,MAAAmD,KAAA,gBAAAA,EAAA,MAAA,GAOAK,IAAAxD,EAAA,MACImD,KAAA,QAAAA,EAAA,QAAA,IAAA,MAAAA,KAAA,gBAAAA,EAAA,KAAA,EAAA,KAAA;AAAA;AAAA,MACiD,OAAAI,EAAA;AAAA,MAEhB,QAAAA,EAAA;AAAA,MACC,OAAAA,EAAA;AAAA,IACD,CAAA,IAAA,CAAA,CAE1B,GAGXE,IAAA,CAAAC,MAAA;AACI,MAAAnB,EAAA,QAAAmB,GACAvB,EAAA,sBAAAuB,CAAA,GACAvB,EAAA,SAAAuB,CAAA;AAAA,IAAmB,GAGvBC,IAAA3D,EAAA,MAAAC,EAAA,YAAA,OAAA;AAEA,WAAA2D,EAAAtE,GAAAqE,CAAA,GAEAE,EAAA,MAAA;AACI,MAAA5D,EAAA,eACI,OAAA,OAAAA,EAAA,WAAA,EAAA,QAAA,CAAA6D,MAAA;AACI,YAAAA,MAAAA,IAAA,KAAAA,IAAA;AACI,gBAAA,IAAA;AAAA,YAAU;AAAA,UACN;AAAA,MAER,CAAA;AAAA,IAER,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"selection-card-group.iYyZ9yX4.js","sources":["../../src/components/selection-card/selection-card.types.ts","../../src/components/selection-card/selection-card.keys.ts","../../src/components/selection-card/selection-card.vue","../../src/components/selection-card/components/selection-card-group/selection-card-group.vue"],"sourcesContent":["import { RadioInputValue } from '@/components/internal/radio-input';\nimport { BentoCheckboxType } from '@/core/components/checkbox/checkbox.types';\nimport { VueNodeElement } from '@/types';\n\nexport enum BentoSelectionCardState {\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n\nexport type BentoSelectionCardValue = string | number;\n\nexport type BentoSelectionCardModelValue = BentoCheckboxType | RadioInputValue;\n\nexport interface BentoSelectionCardItem {\n content?: string | object;\n description?: string;\n disabled?: boolean;\n dynamicContent?: string | object;\n fullyClickable?: boolean;\n hasError?: boolean;\n icon?: VueNodeElement;\n readonly?: boolean;\n subtitle?: string;\n title: string;\n value: BentoSelectionCardValue;\n}\n","export const SELECTION_CARD_RADIO_INPUT_INJECTION_KEY = Symbol('selection card radio input injection key');\n","<template>\n <div class=\"b-selection-card\" :class=\"conditionalClasses\" @click=\"handleCardClick\">\n <div class=\"b-selection-card__container\" :class=\"containerConditionalClasses\">\n <div class=\"b-selection-card__checkbox-container\" :class=\"checkboxContainerConditionalClasses\">\n <div class=\"b-selection-card__checkbox-container-text\" :class=\"checkboxContainerTextConditionalClasses\">\n <div v-if=\"hasSlot('icon')\" class=\"b-selection-card__icon\" role=\"presentation\">\n <slot name=\"icon\" />\n </div>\n <label :for=\"inputId\" class=\"b-selection-card__text\" @click.stop.prevent=\"handleCardClick\">\n <bento-typography\n v-if=\"subtitle\"\n class=\"b-selection-card__description\"\n el=\"span\"\n variant=\"caption\"\n >\n {{ subtitle }}\n </bento-typography>\n <bento-typography el=\"span\" variant=\"title\">{{ title }}</bento-typography>\n <bento-typography\n v-if=\"description\"\n id=\"descriptionId\"\n class=\"b-selection-card__description\"\n el=\"span\"\n variant=\"body\"\n >\n {{ description }}\n </bento-typography>\n </label>\n </div>\n <radio-input\n v-if=\"isRadioInput\"\n :id=\"inputId\"\n ref=\"inputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"description ? descriptionId : undefined\"\n :disabled=\"disabled\"\n :has-error=\"hasError\"\n :aria-readonly=\"readonly ?? undefined\"\n :value=\"value\"\n :readonly=\"readonly\"\n :model-value=\"computedRadioInputModelValue\"\n />\n <checkbox-input\n v-else\n :id=\"inputId\"\n ref=\"inputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"description ? descriptionId : undefined\"\n :disabled=\"disabled\"\n :has-error=\"hasError\"\n :aria-readonly=\"readonly ?? undefined\"\n :value=\"value\"\n :readonly=\"readonly\"\n :model-value=\"computedCheckboxInputModelValue\"\n />\n </div>\n <bento-typography\n v-if=\"hasSlot('content')\"\n ref=\"slotRef\"\n el=\"div\"\n class=\"b-selection-card__slot\"\n :class=\"slotConditionalClasses\"\n >\n <slot name=\"content\" />\n </bento-typography>\n <bento-typography\n v-if=\"hasSlot('dynamicContent') && isChecked\"\n ref=\"dynamicSlotRef\"\n el=\"div\"\n class=\"b-selection-card__slot\"\n :class=\"slotConditionalClasses\"\n >\n <slot name=\"dynamicContent\" />\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTypography } from '@/components/typography';\n import { BentoCheckboxType, BentoMultiCheckboxType, CheckboxInput } from '../internal/checkbox-input';\n import { RadioInput, RadioInputValue } from '../internal/radio-input';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { generateUid } from '@/core/utils/ts';\n import { computed, ComputedRef, inject, PropType, Ref, ref, useSlots } from 'vue';\n import { useHasSlot } from '@/composables';\n import type { BentoSelectionCardModelValue, BentoSelectionCardValue } from './selection-card.types';\n import { BentoSelectionCardState } from './selection-card.types';\n import { SELECTION_CARD_RADIO_INPUT_INJECTION_KEY } from './selection-card.keys';\n\n const props = defineProps({\n /**\n * The description of the selection card\n */\n description: {\n type: String,\n default: undefined,\n },\n\n /**\n * Disables the selection card\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Makes the entire selection card clickable. Clicking over interactive elements inside the card with this prop enabled will not be possible.\n */\n fullyClickable: { type: Boolean, default: false },\n\n /**\n * Shows the selection card in error state\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * This property should not be used directly.\n * It will be used by v-model directive on selection card component.\n *\n * When handling a single input, use a string or a number.\n *\n * When handling multiple inputs, use an array of keys.\n * These keys exist as a set \"value\" prop for each input.\n */\n modelValue: {\n type: [Boolean, String, Array] as PropType<BentoSelectionCardModelValue>,\n default: null,\n },\n\n /**\n * Sets the selection card to readonly\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * The subtitle of the selection card\n */\n subtitle: {\n type: String,\n default: undefined,\n },\n\n /**\n * The title of the selection card\n */\n title: {\n type: String,\n required: true,\n },\n\n /**\n * Indicates the value of the input that will be returned when it's checked.\n */\n value: {\n type: [String, Number] as PropType<BentoSelectionCardValue>,\n required: true,\n },\n });\n\n const emit = defineEmits([\"input\", \"update:model-value\"]);\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const inputId = generateUid('selection-card-input-id');\n const descriptionId = generateUid('selection-card-description');\n\n const computedRadioInputModelValue: ComputedRef<RadioInputValue> = computed(\n () => props.modelValue as RadioInputValue\n );\n const computedCheckboxInputModelValue: ComputedRef<BentoCheckboxType> = computed(\n () => props.modelValue as BentoCheckboxType\n );\n\n const conditionalClasses = computed(() => ({\n 'b-selection-card--checked': isChecked.value,\n 'b-selection-card--fully-clickable': props.fullyClickable,\n }));\n\n const containerConditionalClasses = computed(() => ({\n [`b-selection-card--${BentoSelectionCardState.DISABLED}`]: props.disabled,\n [`b-selection-card--${BentoSelectionCardState.ERROR}`]: props.hasError,\n [`b-selection-card--${BentoSelectionCardState.READONLY}`]: props.readonly,\n 'b-selection-card--center-aligned': isTitleOnly.value,\n }));\n\n const checkboxContainerConditionalClasses = computed(() => ({\n 'b-selection-card__checkbox-container--center-aligned': isTitleOnly.value,\n }));\n\n const checkboxContainerTextConditionalClasses = computed(() => ({\n 'b-selection-card__checkbox-container-text--center-aligned': isTitleOnly.value,\n }));\n\n const slotConditionalClasses = computed(() => ({\n 'b-selection-card__slot--with-icon': hasSlot('icon'),\n }));\n\n const ariaLabel = useAriaLabel({\n ariaLabel: props.title,\n label: props.value as string,\n });\n\n const isCheckboxGroup = computed(() => Array.isArray(props.modelValue));\n\n const isChecked: ComputedRef<boolean> = computed(() => {\n if (isRadioInput.value) {\n return props.value === props.modelValue;\n }\n if (!isCheckboxGroup.value) {\n return props.modelValue as boolean;\n }\n\n return (props.modelValue as BentoMultiCheckboxType).some(item => item === props.value);\n });\n\n const isRadioInput: Ref<boolean> = inject(SELECTION_CARD_RADIO_INPUT_INJECTION_KEY, ref(false));\n\n const isTitleOnly = computed(() => !props.subtitle && !props.description);\n\n const inputRef = ref<InstanceType<typeof RadioInput> | InstanceType<typeof CheckboxInput>>(null);\n const slotRef = ref(null);\n const dynamicSlotRef = ref(null);\n\n // Handle click on the whole card area\n const handleCardClick = (event: Event) => {\n if (inputRef.value.$refs.inputRef === event.target) {\n const newValue = toggleInput();\n onChange(newValue);\n return;\n }\n\n // Do nothing if disabled or readonly\n if (props.disabled && props.readonly) {\n return;\n }\n\n // If it's not fully clickable prevent selecting the card if the click\n // originated in a slot\n if (!props.fullyClickable) {\n // Check if the click originated from the slot - in that case, do nothng\n if (slotRef.value && slotRef.value?.$el?.contains(event.target)) {\n return;\n }\n // Check if the click originated from the dynamic slot - in that case, do nothng\n if (dynamicSlotRef.value && dynamicSlotRef.value?.$el?.contains(event.target)) {\n return;\n }\n // Check if the click originated from the input - in that case do nothing, as the input will emit the event already\n if (inputRef.value && inputRef.value?.$el?.contains(event.target as Node)) {\n return;\n }\n }\n\n // If the click originated outside of these two areas, emit the change event\n const newValue = toggleInput();\n\n onChange(newValue);\n };\n\n const toggleInput = (): BentoSelectionCardModelValue => {\n const currentValue: boolean = (inputRef.value?.$refs.inputRef as HTMLInputElement).checked;\n\n if (isCheckboxGroup.value) {\n const newCheckedList = [...(props.modelValue as BentoMultiCheckboxType)];\n const index = newCheckedList.indexOf(props.value);\n\n if (index === -1) {\n newCheckedList.push(props.value);\n } else {\n newCheckedList.splice(index, 1);\n }\n return newCheckedList;\n }\n\n if (isRadioInput.value) {\n return props.value;\n }\n return currentValue;\n };\n\n const onChange = newValue => {\n if (!props.disabled && !props.readonly) {\n emit('update:model-value', newValue);\n emit('input', newValue);\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Selection card component. If used standalone, only the checkbox variant can be used. If the checkbox variant is needed, please use the bento-selection-card-group component.\n *\n * @example\n * import { BentoSelectionCard } from '@adyen/bento-vue2';\n * import EmoticonHappyIcon from '@adyen/ui-assets-icons-16/vue/emoticon-happy';\n *\n * export default {\n * components: { BentoSelectionCard, EmoticonHappyIcon },\n * template: `\n * <bento-selection-card title=\"Card title\" :model-value.sync=\"yourModelValue\">\n * <template #icon>\n * <emoticon-happy-icon />\n * </template>\n * </bento-selection-card>\n * `\n * }\n */\n export default {\n name: 'bento-selection-card',\n };\n</script>\n<style lang=\"scss\" scoped src=\"./selection-card.scss\" />\n","<template>\n <controls-group\n ref=\"containerRef\"\n :aria-describedby=\"shouldShowGroupError ? errorMessageId : null\"\n :label=\"label\"\n :hide-label=\"hideLabel\"\n :description=\"description\"\n :disabled=\"disabled\"\n :tooltip-text=\"tooltipText\"\n :readonly=\"readonly\"\n :required=\"required\"\n :optional=\"optional\"\n class=\"b-selection-card-group\"\n component-name=\"selection-card-group\"\n >\n <div\n v-if=\"!itemsPerRow || layout === 'vertical'\"\n class=\"b-selection-card-group__items\"\n :class=\"conditionalItemsClasses\"\n >\n <bento-selection-card\n v-for=\"item in items\"\n :key=\"`selection-card-${item.value}`\"\n class=\"b-selection-card-group__item\"\n v-bind=\"item\"\n :model-value=\"inputValue\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowGroupError\"\n :disabled=\"disabled || item.disabled\"\n @update:model-value=\"onInput\"\n >\n <template v-if=\"hasSlot('icon') && item.icon\" #icon>\n <slot name=\"icon\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('content') && item.content\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('dynamicContent') && item.dynamicContent\" #dynamicContent>\n <slot name=\"dynamicContent\" v-bind=\"item\"></slot>\n </template>\n </bento-selection-card>\n </div>\n <template v-else>\n <div :key=\"`selection-card-group-layout-breakpoint-${currentBreakpoint}`\">\n <grid-layout\n v-for=\"(row, rowIndex) in computedRows\"\n :key=\"`selection-card-group-row-${rowIndex}-cols-${computedItemsPerRow}`\"\n class=\"b-selection-card-group__items--wrap\"\n :column-width=\"computedColumnWidth\"\n >\n <template v-for=\"(item, columnIndex) in row\" #[`col-${columnIndex+1}`]>\n <bento-selection-card\n :key=\"`selection-card-${item.value}`\"\n class=\"b-selection-card-group__item b-selection-card-group__item--full-height\"\n v-bind=\"item\"\n :model-value=\"inputValue\"\n :readonly=\"readonly || item.readonly\"\n :has-error=\"shouldShowGroupError\"\n :disabled=\"disabled || item.disabled\"\n @update:model-value=\"onInput\"\n >\n <template v-if=\"hasSlot('icon') && item.icon\" #icon>\n <slot name=\"icon\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('content') && item.content\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n <template v-if=\"hasSlot('dynamicContent') && item.dynamicContent\" #dynamicContent>\n <slot name=\"dynamicContent\" v-bind=\"item\"></slot>\n </template>\n </bento-selection-card>\n </template>\n </grid-layout>\n </div>\n </template>\n <error-message\n v-if=\"shouldShowGroupError\"\n :id=\"errorMessageId\"\n :error-message=\"errorMessage\"\n class=\"b-selection-card-group__error-message\"\n />\n </controls-group>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, PropType, provide, ref, useSlots, watch } from 'vue';\n import { useElementSize } from '@vueuse/core';\n import { BMediaQueryMMax, BMediaQuerySMax } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n import {\n BentoSelectionCardGroupItemsPerRow,\n BentoSelectionCardGroupLayout,\n BentoSelectionCardGroupVariant,\n } from './selection-card-group.types';\n import BentoSelectionCard from '../../selection-card.vue';\n import { ControlsGroup, ErrorMessage, GridLayout } from '../../../internal';\n import { BentoSelectionCardItem, BentoSelectionCardModelValue } from '../../selection-card.types';\n import { SELECTION_CARD_RADIO_INPUT_INJECTION_KEY } from '../../selection-card.keys';\n import { generateUid } from '@/core/utils/ts';\n\n const props = defineProps({\n /**\n * Descriptive supporting text visbile underneath the label.\n */\n description: { type: String, default: null },\n\n /**\n * If set to true, renders all cards in the group in a disabled state.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Renders all cards in an error state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * The form id the selection card group is associated with. Defaults to null, as a selection card group can also be used standalone.\n */\n formId: { type: String, default: null },\n\n /**\n * Shows/hides the group label.\n */\n hideLabel: { type: Boolean, default: null },\n\n /**\n * Label of the group. Required for accessibility purposes, even if it's not shown\n */\n label: {\n type: String,\n required: true,\n },\n\n /**\n * The selection card group's layout. It can be vertical or horizontal. Defaults to vertical.\n * @values horizontal, vertical\n */\n layout: {\n type: String as PropType<BentoSelectionCardGroupLayout>,\n default: 'vertical',\n },\n\n /**\n * The selection card group's items.\n */\n items: {\n type: Array as PropType<BentoSelectionCardItem[]>,\n required: true,\n },\n\n /**\n * Sets the responsive number of items rendered in each row.\n */\n itemsPerRow: {\n type: Object as PropType<BentoSelectionCardGroupItemsPerRow>,\n default: undefined,\n },\n\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoSelectionCardItem's value.\n * Defaults to no value selected.\n */\n modelValue: {\n type: [Array, String, Number] as PropType<BentoSelectionCardModelValue>,\n default: null,\n },\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 * If set to true, renders all cards in the group in a readonly state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Renders the cards with a checkbox or a radio input. Selection logic will also apply in accordance.\n * @values checkbox, radio\n */\n variant: { type: String as PropType<BentoSelectionCardGroupVariant>, default: 'checkbox' },\n });\n\n const emit = defineEmits([\"input\", \"update:model-value\"]);\n const slots = useSlots();\n // Slots logic\n // Temporary, use-has-slots composable doesn't currently work for vue3 named scoped slots\n // We do the same in bento-checkbox-group\n const hasSlot = name => !!slots[name];\n\n const conditionalItemsClasses = computed(() => ({\n 'b-selection-card-group__items--horizontal': props.layout === 'horizontal',\n }));\n\n const inputValue = ref(props.modelValue);\n watch(\n () => props.modelValue,\n () => {\n inputValue.value = props.modelValue;\n }\n );\n\n // Error message logic\n const errorMessageId = generateUid('error');\n const shouldShowGroupError = computed(() => !props.disabled && !props.readonly && !!props.errorMessage);\n\n // itemsPerRow logic\n const containerRef = ref<HTMLElement | null>(null);\n const { width } = useElementSize(containerRef);\n\n const smallBreakpoint = computed(() => BMediaQuerySMax.split('px')[0]);\n const mediumBreakpoint = computed(() => BMediaQueryMMax.split('px')[0]);\n\n const currentBreakpoint = computed(() => {\n if (width.value < smallBreakpoint.value) {\n return 'small';\n }\n if (width.value >= smallBreakpoint.value && width.value < mediumBreakpoint.value) {\n return 'medium';\n }\n return 'large';\n });\n\n const computedItemsPerRow = computed(() => {\n return (props.itemsPerRow?.[currentBreakpoint?.value] as number) || props.items.length;\n });\n\n const computedRows = computed(() => {\n if (!props.itemsPerRow) {\n return [];\n }\n const rows = [];\n for (let i = 0; i < props.items.length; i += computedItemsPerRow?.value) {\n rows.push(props.items.slice(i, i + computedItemsPerRow?.value));\n }\n return rows;\n });\n\n // We need to compute the column width on 12 because we're using a 12-column system for out grid-layout logic\n const itemColumnWidth = computed(() => 12 / computedItemsPerRow?.value);\n\n /**\n * Filling the columnWidth array with the same parameters per item to pass\n * to the `grid-layout` layout so the each card can have\n * the same width according to the screen size.\n */\n const computedColumnWidth = computed(() => {\n return computedItemsPerRow?.value\n ? new Array(computedItemsPerRow?.value).fill({\n // Instead of passing the actual screen sizes values, passing the same values per each screen size and recomputing it makes sure visually the change is smoother and not laggy\n small: itemColumnWidth.value,\n medium: itemColumnWidth.value,\n large: itemColumnWidth.value,\n })\n : [];\n });\n\n const onInput = value => {\n inputValue.value = value;\n emit('update:model-value', value);\n emit('input', value);\n };\n\n const isRadioVariant = computed(() => props.variant === 'radio');\n\n provide(SELECTION_CARD_RADIO_INPUT_INJECTION_KEY, isRadioVariant);\n\n onMounted(() => {\n if (props.itemsPerRow) {\n Object.values(props.itemsPerRow).forEach(el => {\n if (el && (el < 2 || el > 6)) {\n throw new Error(\n 'itemsPerRow values must have a value between 2 and 6 items per row. Read the documentation for more information.'\n );\n }\n });\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Group of bento-selection-cards.\n *\n * @example\n * import { BentoSelectionCardGroup } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSelectionCardGroup },\n * template: `\n * <bento-selection-card-group\n * :items=\"[\n * {\n * title: 'Card 1',\n * value: 'card-1',\n * content: 'Slot content 1',\n * icon: RetailIcon,\n * },\n * {\n * title: 'Card 2',\n * value: 'card-2',\n * content: 'Slot content 2',\n * icon: LeafIcon,\n * },\n * ]\"\n * >\n * <template #icon=\"{ icon }\">\n * <component :is=\"icon\"/>\n * </template>\n * <template #content=\"{ content }\">\n * <div>{{ content }}</div>\n * </template>\n * </bento-selection-card-group>\n * `,\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./selection-card-group.scss\" />\n"],"names":["BentoSelectionCardState","BentoSelectionCardState2","SELECTION_CARD_RADIO_INPUT_INJECTION_KEY","__default__$1","slots","useSlots","hasSlot","useHasSlot","inputId","generateUid","descriptionId","computedRadioInputModelValue","computed","props","computedCheckboxInputModelValue","conditionalClasses","isChecked","containerConditionalClasses","isTitleOnly","checkboxContainerConditionalClasses","checkboxContainerTextConditionalClasses","slotConditionalClasses","ariaLabel","useAriaLabel","isCheckboxGroup","isRadioInput","item","inject","ref","inputRef","slotRef","dynamicSlotRef","handleCardClick","event","newValue2","toggleInput","onChange","_b","_a","_d","_c","_f","_e","newValue","currentValue","newCheckedList","index","emit","__default__","name","conditionalItemsClasses","inputValue","watch","errorMessageId","shouldShowGroupError","containerRef","width","useElementSize","smallBreakpoint","BMediaQuerySMax","mediumBreakpoint","BMediaQueryMMax","currentBreakpoint","computedItemsPerRow","computedRows","rows","i","itemColumnWidth","computedColumnWidth","onInput","value","isRadioVariant","provide","onMounted","el"],"mappings":";;;;;;;;;;;;;;AAIY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SAHQA,IAAAD,KAAA,CAAA,CAAA;ACJC,MAAAE,IAAA,OAAA,0CAAA,GCmTTC,KAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBArJAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAA,yBAAA,GACAC,IAAAD,EAAA,4BAAA,GAEAE,IAAAC;AAAA,MAAmE,MAAAC,EAAA;AAAA,IACnD,GAEhBC,IAAAF;AAAA,MAAwE,MAAAC,EAAA;AAAA,IACxD,GAGhBE,IAAAH,EAAA,OAAA;AAAA,MAA2C,6BAAAI,EAAA;AAAA,MACA,qCAAAH,EAAA;AAAA,IACI,EAAA,GAG/CI,IAAAL,EAAA,OAAA;AAAA,MAAoD,CAAA,qBAAAZ,EAAA,QAAA,EAAA,GAAAa,EAAA;AAAA,MACiB,CAAA,qBAAAb,EAAA,KAAA,EAAA,GAAAa,EAAA;AAAA,MACH,CAAA,qBAAAb,EAAA,QAAA,EAAA,GAAAa,EAAA;AAAA,MACG,oCAAAK,EAAA;AAAA,IACjB,EAAA,GAGpDC,IAAAP,EAAA,OAAA;AAAA,MAA4D,wDAAAM,EAAA;AAAA,IACY,EAAA,GAGxEE,IAAAR,EAAA,OAAA;AAAA,MAAgE,6DA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CAAA;AAAA,IAER,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { defineComponent as P, toRefs as k, ref as o, computed as B, watch as N, nextTick as x, provide as v } from "vue";
|
|
2
|
-
import { B as G, d as F } from "./typography.
|
|
3
|
-
import { F as L } from "./footer-actions.
|
|
4
|
-
import { D as R, B as U, b as w, a as J } from "./dialog-page.
|
|
2
|
+
import { B as G, d as F } from "./typography.J1v_SPG3.js";
|
|
3
|
+
import { F as L } from "./footer-actions.D0uH9JWq.js";
|
|
4
|
+
import { D as R, B as U, b as w, a as J } from "./dialog-page.DcJ7LaOE.js";
|
|
5
5
|
import { n as b } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
6
|
-
import { B as V } from "./button.
|
|
7
|
-
import { B as K } from "./focus-trap.
|
|
6
|
+
import { B as V } from "./button.BX6ZJxF7.js";
|
|
7
|
+
import { B as K } from "./focus-trap.CGypVwG6.js";
|
|
8
8
|
import { C as Y } from "./cross.CsUPDmaA.js";
|
|
9
9
|
import { S as H } from "./sidepanel.keys.R0DKQuYx.js";
|
|
10
10
|
import { u as $ } from "./i18n.BQkEbtPM.js";
|
|
11
|
-
import { g as j } from "./generate-uid.
|
|
11
|
+
import { g as j } from "./generate-uid.NJ8tVoha.js";
|
|
12
12
|
import { B as z } from "./directive.O3yEdalv.js";
|
|
13
13
|
import "../assets/sidepanel.css";
|
|
14
14
|
const M = {}, q = /* @__PURE__ */ P({
|
|
@@ -207,4 +207,4 @@ export {
|
|
|
207
207
|
Ce as a,
|
|
208
208
|
ge as s
|
|
209
209
|
};
|
|
210
|
-
//# sourceMappingURL=sidepanel.
|
|
210
|
+
//# sourceMappingURL=sidepanel.CQnLpV8A.js.map
|