@adyen/bento-vue2 1.43.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 +118 -143
- 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-actions-with-menu.css +1 -1
- package/dist/assets/button-actions.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/dropdown.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/selection-card-group.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/tabs.css +1 -1
- package/dist/assets/textarea.css +1 -1
- package/dist/assets/use-cached-selected-values.css +1 -1
- package/dist/avatar.js +1 -1
- package/dist/button.js +8 -9
- package/dist/button.js.map +1 -1
- 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.kPPYSgQK.js → action-bar.BXemSuq4.js} +18 -18
- package/dist/chunks/action-bar.BXemSuq4.js.map +1 -0
- 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.DroVbSCn.js → base-modal.4JSNBM4T.js} +12 -12
- package/dist/chunks/{base-modal.DroVbSCn.js.map → base-modal.4JSNBM4T.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.dp6C-PKX.js → button-actions-with-menu.ieopdfI7.js} +38 -29
- package/dist/chunks/button-actions-with-menu.ieopdfI7.js.map +1 -0
- package/dist/chunks/button-actions.CtFB6iRj.js +252 -0
- package/dist/chunks/button-actions.CtFB6iRj.js.map +1 -0
- 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.BcjxzwZV.js → card.BabmUkTG.js} +6 -6
- package/dist/chunks/{card.BcjxzwZV.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.DuZDA7gH.js → code-snippet.5iJcUZSo.js} +20 -20
- package/dist/chunks/{code-snippet.DuZDA7gH.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.CExqPbQb.js → dashboard-section.DYXZhtop.js} +5 -5
- package/dist/chunks/{dashboard-section.CExqPbQb.js.map → dashboard-section.DYXZhtop.js.map} +1 -1
- package/dist/chunks/{dashed-underline.dGO33Q_E.js → dashed-underline.BvSZS1-m.js} +4 -4
- package/dist/chunks/{dashed-underline.dGO33Q_E.js.map → dashed-underline.BvSZS1-m.js.map} +1 -1
- package/dist/chunks/{data-grid-template.BF7JMfoJ.js → data-grid-template.Du92TEFY.js} +4 -4
- package/dist/chunks/{data-grid-template.BF7JMfoJ.js.map → data-grid-template.Du92TEFY.js.map} +1 -1
- package/dist/chunks/{data-grid.BXB98JQr.js → data-grid.Kwtf1DMq.js} +46 -46
- package/dist/chunks/{data-grid.BXB98JQr.js.map → data-grid.Kwtf1DMq.js.map} +1 -1
- package/dist/chunks/{date-picker.Dfg1_eo6.js → date-picker.B7mTNghB.js} +11 -11
- package/dist/chunks/{date-picker.Dfg1_eo6.js.map → date-picker.B7mTNghB.js.map} +1 -1
- package/dist/chunks/{date-range-picker.xYGf0SRg.js → date-range-picker.DPLri9D-.js} +241 -241
- package/dist/chunks/{date-range-picker.xYGf0SRg.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.DPZmj7xJ.js → dropdown-default-textbox.DBoSso4J.js} +124 -104
- package/dist/chunks/dropdown-default-textbox.DBoSso4J.js.map +1 -0
- package/dist/chunks/{dropdown-tag.B4RMse5R.js → dropdown-tag.XIlES6IT.js} +8 -8
- package/dist/chunks/{dropdown-tag.B4RMse5R.js.map → dropdown-tag.XIlES6IT.js.map} +1 -1
- package/dist/chunks/{dropdown.BfzsI2Th.js → dropdown.BqsoncJr.js} +228 -222
- 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.jIyAPBgt.js +11 -0
- package/dist/chunks/{es6.b4enG1py.js.map → es6.jIyAPBgt.js.map} +1 -1
- package/dist/chunks/{file-uploader.CK-Frs_q.js → file-uploader.C6kcnhqp.js} +228 -227
- package/dist/chunks/file-uploader.C6kcnhqp.js.map +1 -0
- package/dist/chunks/{filter-bar.hBPWastb.js → filter-bar.DT_-lVmf.js} +54 -55
- package/dist/chunks/{filter-bar.hBPWastb.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.DwnLB4NW.js → footer-actions.D0uH9JWq.js} +4 -4
- package/dist/chunks/{footer-actions.DwnLB4NW.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.BmfOGkrH.js → input-field-password.HRDEb0jL.js} +10 -10
- package/dist/chunks/{input-field-password.BmfOGkrH.js.map → input-field-password.HRDEb0jL.js.map} +1 -1
- package/dist/chunks/{input-field.CHD3Fzzg.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.N41WnXc8.js → menu.CLaN9Eys.js} +83 -56
- package/dist/chunks/menu.CLaN9Eys.js.map +1 -0
- package/dist/chunks/{modal-fullscreen.BbNe6M9T.js → modal-fullscreen.B-qr1Szh.js} +7 -7
- package/dist/chunks/{modal-fullscreen.BbNe6M9T.js.map → modal-fullscreen.B-qr1Szh.js.map} +1 -1
- package/dist/chunks/{modal.Cb4zg5fN.js → modal.wU3uUJKq.js} +6 -6
- package/dist/chunks/{modal.Cb4zg5fN.js.map → modal.wU3uUJKq.js.map} +1 -1
- package/dist/chunks/{pagination.DORr-ox0.js → pagination.BM3FhtxJ.js} +5 -5
- package/dist/chunks/{pagination.DORr-ox0.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.Uy-vuQq5.js → popover.DsUymZWJ.js} +5 -5
- package/dist/chunks/{popover.Uy-vuQq5.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.BtFX4039.js → search-bar.rubkdbcD.js} +3 -3
- package/dist/chunks/{search-bar.BtFX4039.js.map → search-bar.rubkdbcD.js.map} +1 -1
- package/dist/chunks/{secondary-nav.DtnWRhFW.js → secondary-nav.DKSjc5bn.js} +5 -5
- package/dist/chunks/{secondary-nav.DtnWRhFW.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.B6XXbJsv.js → selection-card-group.iYyZ9yX4.js} +12 -12
- package/dist/chunks/{selection-card-group.B6XXbJsv.js.map → selection-card-group.iYyZ9yX4.js.map} +1 -1
- package/dist/chunks/{sidepanel.CRJN9Acz.js → sidepanel.CQnLpV8A.js} +7 -7
- package/dist/chunks/{sidepanel.CRJN9Acz.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/{teleport.CQKBJZU5.js → teleport.B5fwsT5y.js} +26 -17
- package/dist/chunks/teleport.B5fwsT5y.js.map +1 -0
- package/dist/chunks/textarea.Cf21WMwL.js +196 -0
- package/dist/chunks/{textarea.Y3yd_3ll.js.map → textarea.Cf21WMwL.js.map} +1 -1
- package/dist/chunks/{timeline-item.CCV4U3Zx.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.4r7MKNEU.js → tutorial.w2ZqeOh1.js} +9 -9
- package/dist/chunks/{tutorial.4r7MKNEU.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.CAlfyb_L.js → use-cached-selected-values.impKjAIS.js} +46 -46
- 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 +115 -116
- 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 +33 -27
- 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 +49 -3
- package/package.json +7 -6
- package/dist/assets/loading-button.css +0 -1
- package/dist/chunks/action-bar.kPPYSgQK.js.map +0 -1
- package/dist/chunks/base-button.4UYC3kp2.js.map +0 -1
- package/dist/chunks/button-actions-with-menu.dp6C-PKX.js.map +0 -1
- package/dist/chunks/button-actions.Cpx4PQp0.js +0 -111
- package/dist/chunks/button-actions.Cpx4PQp0.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.DPZmj7xJ.js.map +0 -1
- package/dist/chunks/dropdown.BfzsI2Th.js.map +0 -1
- package/dist/chunks/es6.b4enG1py.js +0 -10
- package/dist/chunks/file-uploader.CK-Frs_q.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.CAJtHW1k.js +0 -266
- package/dist/chunks/header.CAJtHW1k.js.map +0 -1
- package/dist/chunks/input-field.CHD3Fzzg.js.map +0 -1
- package/dist/chunks/layout-row.DzS_XyyF.js.map +0 -1
- package/dist/chunks/loading-button.CiPmvU7F.js +0 -113
- package/dist/chunks/loading-button.CiPmvU7F.js.map +0 -1
- package/dist/chunks/menu.N41WnXc8.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/teleport.CQKBJZU5.js.map +0 -1
- package/dist/chunks/textarea.Y3yd_3ll.js +0 -192
- package/dist/chunks/timeline-item.CCV4U3Zx.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.CAlfyb_L.js.map +0 -1
- package/dist/chunks/use-click-outside.D6aIgS15.js +0 -14
- package/dist/chunks/use-click-outside.D6aIgS15.js.map +0 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { defineComponent as l, ref as s } from "vue";
|
|
2
|
+
import { B as i } from "./popover.DsUymZWJ.js";
|
|
3
|
+
import { B as _ } from "./typography.J1v_SPG3.js";
|
|
4
|
+
import { u as v } from "./i18n.BQkEbtPM.js";
|
|
5
|
+
import { g as d } from "./generate-uid.NJ8tVoha.js";
|
|
6
|
+
import { I } from "./info.CyeBsLgt.js";
|
|
7
|
+
import { n as O } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
8
|
+
import "../assets/info-icon-with-popover.css";
|
|
9
|
+
const P = {
|
|
10
|
+
"en-US": {
|
|
11
|
+
moreInformation: "More information"
|
|
12
|
+
},
|
|
13
|
+
"pt-BR": {
|
|
14
|
+
moreInformation: "Mais informações"
|
|
15
|
+
},
|
|
16
|
+
"ja-JP": {
|
|
17
|
+
moreInformation: "詳細情報"
|
|
18
|
+
}
|
|
19
|
+
}, g = {
|
|
20
|
+
i18n: { messages: P }
|
|
21
|
+
}, E = /* @__PURE__ */ l({
|
|
22
|
+
...g,
|
|
23
|
+
__name: "info-icon-with-popover",
|
|
24
|
+
props: {
|
|
25
|
+
/**
|
|
26
|
+
* Text showed in the popover on hover
|
|
27
|
+
*/
|
|
28
|
+
popoverText: { type: String, default: null },
|
|
29
|
+
/**
|
|
30
|
+
* Position the popover should take if space is available
|
|
31
|
+
*/
|
|
32
|
+
popoverPosition: {
|
|
33
|
+
type: i.props.position.type,
|
|
34
|
+
default: i.props.position.default,
|
|
35
|
+
validator: i.props.position.validator
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
setup(f) {
|
|
39
|
+
const { t } = v(), o = s(), u = s(null), m = d("bento-info-icon-with-popover"), p = s(), r = s(), a = () => {
|
|
40
|
+
p.value = !0, r.value && clearTimeout(r.value);
|
|
41
|
+
}, c = () => {
|
|
42
|
+
const n = setTimeout(() => {
|
|
43
|
+
p.value = !1;
|
|
44
|
+
}, 200);
|
|
45
|
+
r.value = n;
|
|
46
|
+
};
|
|
47
|
+
return { __sfc: !0, CLOSING_POPOVER_DELAY_MS: 200, t, infoIconRef: o, targetElement: u, popoverId: m, isOpen: p, closingTimeOutId: r, openPopover: a, closePopover: c, infoIconOnFocus: () => {
|
|
48
|
+
a();
|
|
49
|
+
}, infoIconOnFocusOut: (n) => {
|
|
50
|
+
(!o.value || !((n == null ? void 0 : n.relatedTarget) instanceof Element) || !o.value.contains(n.relatedTarget)) && c();
|
|
51
|
+
}, BentoPopover: i, BentoTypography: _, InfoIcon: I };
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
var T = function() {
|
|
55
|
+
var e = this, t = e._self._c, o = e._self._setupProxy;
|
|
56
|
+
return t("div", { ref: "infoIconRef", staticClass: "b-info-icon-with-popover", attrs: { tabindex: "0", "data-testid": "info-icon-with-popover" }, on: { mouseenter: o.openPopover, mouseleave: o.closePopover, focus: o.infoIconOnFocus, focusout: o.infoIconOnFocusOut } }, [t(o.InfoIcon, { ref: "targetElement", staticClass: "b-info-icon-with-popover__svg", attrs: { "aria-expanded": o.isOpen, "aria-describedby": o.popoverId, "svg-title": o.t("moreInformation") } }), o.targetElement ? t(o.BentoPopover, { attrs: { open: o.isOpen, "target-element": o.targetElement, position: e.popoverPosition, role: "tooltip", "fit-content": "", "disable-focus-trap": "" } }, [t(o.BentoTypography, [e._t("default", function() {
|
|
57
|
+
return [e.popoverText ? t("div", [e._v(" " + e._s(e.popoverText) + " ")]) : e._e()];
|
|
58
|
+
})], 2)], 1) : e._e()], 1);
|
|
59
|
+
}, b = [], h = /* @__PURE__ */ O(
|
|
60
|
+
E,
|
|
61
|
+
T,
|
|
62
|
+
b,
|
|
63
|
+
!1,
|
|
64
|
+
null,
|
|
65
|
+
"4b25b21a"
|
|
66
|
+
);
|
|
67
|
+
const M = h.exports;
|
|
68
|
+
export {
|
|
69
|
+
M as I
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=info-icon-with-popover.DEjsASNU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info-icon-with-popover.DEjsASNU.js","sources":["../../src/components/internal/info-icon-with-popover/info-icon-with-popover.vue"],"sourcesContent":["<template>\n <div\n ref=\"infoIconRef\"\n class=\"b-info-icon-with-popover\"\n tabindex=\"0\"\n data-testid=\"info-icon-with-popover\"\n @mouseenter=\"openPopover\"\n @mouseleave=\"closePopover\"\n @focus=\"infoIconOnFocus\"\n @focusout=\"infoIconOnFocusOut\"\n >\n <info-icon\n ref=\"targetElement\"\n class=\"b-info-icon-with-popover__svg\"\n :aria-expanded=\"isOpen\"\n :aria-describedby=\"popoverId\"\n :svg-title=\"t('moreInformation')\"\n />\n <bento-popover\n v-if=\"targetElement\"\n :open=\"isOpen\"\n :target-element=\"targetElement\"\n :position=\"popoverPosition\"\n role=\"tooltip\"\n fit-content\n disable-focus-trap\n >\n <bento-typography>\n <slot>\n <div v-if=\"popoverText\">\n {{ popoverText }}\n </div>\n </slot>\n </bento-typography>\n </bento-popover>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { ref } from 'vue';\n import { BentoPopover } from '@/components/popover';\n import { BentoTypography } from '@/components/typography';\n import { useI18n } from '@/utils/ts/i18n';\n import { generateUid } from '@/core/utils/ts';\n import InfoIcon from '@adyen/ui-assets-icons-16/vue/info';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const CLOSING_POPOVER_DELAY_MS = 200;\n\n defineProps({\n /**\n * Text showed in the popover on hover\n */\n popoverText: { type: String, default: null },\n\n /**\n * Position the popover should take if space is available\n */\n popoverPosition: {\n type: BentoPopover.props.position.type,\n default: BentoPopover.props.position.default,\n validator: BentoPopover.props.position.validator,\n },\n });\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const infoIconRef = ref<HTMLDivElement>();\n const targetElement = ref(null);\n const popoverId = generateUid('bento-info-icon-with-popover');\n const isOpen = ref();\n const closingTimeOutId = ref();\n\n const openPopover = () => {\n isOpen.value = true;\n if (closingTimeOutId.value) {\n clearTimeout(closingTimeOutId.value);\n }\n };\n const closePopover = () => {\n // We want to delay closing for a couple of seconds so\n // it doesn't flicker if a user hovers over the icon and then inside the popover.\n const timeOutId = setTimeout(() => {\n isOpen.value = false;\n }, CLOSING_POPOVER_DELAY_MS);\n closingTimeOutId.value = timeOutId;\n };\n\n const infoIconOnFocus = () => {\n openPopover();\n };\n\n /**\n * Only close popover on blur if the newly focus element is not a child of this element\n * @param e - the event that contains the newly focused element\n */\n const infoIconOnFocusOut = (e: FocusEvent) => {\n if (\n !infoIconRef.value ||\n !(e?.relatedTarget instanceof Element) ||\n !infoIconRef.value.contains(e.relatedTarget)\n ) {\n closePopover();\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Internal component to be used whenever an info icon needs to be rendered with a popover instead of a tooltip.\n *\n * @example\n * import { BentoInfoIconWithPopover } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoInfoIconWithPopover },\n * template: `\n * <info-icon-with-popover popover-text=\"Content can be passed as a string like\" :popover-position=\"position\">\n * Content can also be rendered as a slot\n * </info-icon-with-popover>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./info-icon-with-popover.scss\" />\n"],"names":["__default__","messages","useI18n","infoIconRef","ref","targetElement","popoverId","generateUid","isOpen","closingTimeOutId","openPopover","closePopover","timeOutId","e"],"mappings":";;;;;;;;;;;;;;;;;;GA6HIA,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;AA5DA,UAAA,EAAA,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAA,GACAC,IAAAD,EAAA,IAAA,GACAE,IAAAC,EAAA,8BAAA,GACAC,IAAAJ,EAAA,GACAK,IAAAL,EAAA,GAEAM,IAAA,MAAA;AACI,MAAAF,EAAA,QAAA,IACAC,EAAA,SACI,aAAAA,EAAA,KAAA;AAAA,IACJ,GAEJE,IAAA,MAAA;AAGI,YAAAC,IAAA,WAAA,MAAA;AACI,QAAAJ,EAAA,QAAA;AAAA,MAAe,GAAA,GAAA;AAEnB,MAAAC,EAAA,QAAAG;AAAA,IAAyB;4LAG7B,MAAA;AACI,MAAAF,EAAA;AAAA,IAAY,uBAOhB,CAAAG,MAAA;AACI,OAAA,CAAAV,EAAA,SAAA,GAAAU,KAAA,gBAAAA,EAAA,0BAAA,YAAA,CAAAV,EAAA,MAAA,SAAAU,EAAA,aAAA,MAKIF,EAAA;AAAA,IACJ;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as n } from "vue";
|
|
2
|
-
import { d as i } from "./popper-container.
|
|
2
|
+
import { d as i } from "./popper-container.B1iB2ovW.js";
|
|
3
3
|
import { I as r } from "./info.CyeBsLgt.js";
|
|
4
|
-
import { B as s } from "./tooltip.
|
|
4
|
+
import { B as s } from "./tooltip.R2sqydIE.js";
|
|
5
5
|
import { n as a } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
6
6
|
import "../assets/info-icon.css";
|
|
7
7
|
const p = n({
|
|
@@ -38,4 +38,4 @@ const x = m.exports;
|
|
|
38
38
|
export {
|
|
39
39
|
x as B
|
|
40
40
|
};
|
|
41
|
-
//# sourceMappingURL=info-icon.
|
|
41
|
+
//# sourceMappingURL=info-icon.0d0GzDe2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info-icon.
|
|
1
|
+
{"version":3,"file":"info-icon.0d0GzDe2.js","sources":["../../src/components/info-icon/info-icon.vue"],"sourcesContent":["<template>\n <span v-bento-tooltip-directive:[tooltipPosition]=\"tooltipText\" :aria-label=\"tooltipText\" class=\"b-info-icon\">\n <info-icon :svg-title=\"tooltipText\" class=\"b-info-icon__svg\" />\n </span>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import { PopperContainerPosition } from '@/components/popper-container';\n import { BentoTooltipDirective } from '@/directives';\n import InfoIcon from '@adyen/ui-assets-icons-16/vue/info';\n\n /**\n * @example\n * import { BentoInfoIcon } from '@adyen/adl-vue-components';\n *\n * export default {\n * components: { BentoInfoIcon },\n * template: `\n * <bento-info-icon tooltip-text=\"Text on hover\" />\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-info-icon',\n components: { InfoIcon },\n directives: { BentoTooltipDirective },\n props: {\n /**\n * Text showed in the info-icon tooltip on hover\n */\n tooltipText: { type: String, required: true },\n\n /**\n * Position the tooltip should take if space is available. Defaults to 'auto'\n */\n tooltipPosition: {\n type: String as PropType<PopperContainerPosition | `${PopperContainerPosition}`>,\n default: PopperContainerPosition.AUTO,\n validator: (value: PopperContainerPosition) => Object.values(PopperContainerPosition).includes(value),\n },\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/info-icon/info-icon.scss\" />\n"],"names":["_sfc_main","defineComponent","InfoIcon","BentoTooltipDirective","PopperContainerPosition","value"],"mappings":";;;;;;AAuBA,MAAAA,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA,EAAA,UAAAC,EAAA;AAAA,EACA,YAAA,EAAA,uBAAAC,EAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IACA,aAAA,EAAA,MAAA,QAAA,UAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAIA,iBAAA;AAAA,MAKA,MAAA;AAAA,MACA,SAAAC,EAAA;AAAA,MACA,WAAA,CAAAC,MAAA,OAAA,OAAAD,CAAA,EAAA,SAAAC,CAAA;AAAA,IACA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { defineComponent as X, useAttrs as j, ref as o, computed as n, watch as A } from "vue";
|
|
2
|
-
import { B as J } from "./button.
|
|
2
|
+
import { B as J } from "./button.BX6ZJxF7.js";
|
|
3
3
|
import { B as G } from "./image.C2D2hKat.js";
|
|
4
|
-
import { B as K } from "./input-field.
|
|
5
|
-
import { B as Q } from "./popover.
|
|
6
|
-
import { B as Y } from "./typography.
|
|
4
|
+
import { B as K } from "./input-field.D6N2kt7s.js";
|
|
5
|
+
import { B as Q } from "./popover.DsUymZWJ.js";
|
|
6
|
+
import { B as Y } from "./typography.J1v_SPG3.js";
|
|
7
7
|
import { C as $ } from "./checkmark-circle-fill.Cn7JN_Tk.js";
|
|
8
8
|
import { D as ee } from "./dot.BCX4w7eT.js";
|
|
9
|
-
import {
|
|
10
|
-
import { c as ie, w as se } from "./index.
|
|
9
|
+
import { S as ae, H as te } from "./show.IEAxtCB7.js";
|
|
10
|
+
import { c as ie, w as se } from "./index.D8ivUe7P.js";
|
|
11
11
|
import { u as oe } from "./i18n.BQkEbtPM.js";
|
|
12
|
-
import { g as M } from "./generate-uid.
|
|
13
|
-
import { T as le } from "./tooltip.
|
|
12
|
+
import { g as M } from "./generate-uid.NJ8tVoha.js";
|
|
13
|
+
import { T as le } from "./tooltip.R2sqydIE.js";
|
|
14
14
|
import { n as ne } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
15
15
|
import "../assets/input-field-password.css";
|
|
16
16
|
var f = /* @__PURE__ */ ((i) => (i.TEXT = "text", i.PASSWORD = "password", i))(f || {});
|
|
@@ -155,7 +155,7 @@ const fe = {
|
|
|
155
155
|
},
|
|
156
156
|
// wait for 0.5s before checking validity OR 2s of continuous typing
|
|
157
157
|
{ debounce: e, maxWait: h }
|
|
158
|
-
), { __sfc: !0, DEBOUNCE_DURATION: e, DEBOUNCE_MAX_WAIT: h, TOOLTIP_TIMEOUT: d, t: l, props: t, emit: a, attrs: y, inputType: p, inputValue: c, isHintDisplayed: I, isTouched: g, passwordValidity: _, capsLockTooltipTimeoutID: r, isTooltipDisplayed: u, inputFieldPasswordRef: R, inputFieldPasswordInputRef: P, inputFieldPasswordCapsLockIconRef: F, isCapsLockOn: w, focused: T, validationListId: H, validationPopoverId: V, isPasswordReadable: B, computedErrorMessage: S, passwordValidityConditionalClass: D, tooltipConditionalClass: U, inputFieldArgs: x, computedValidations: C, hasErrors: b, hasValidations: k, checkCapsLock: O, toggleInputType: N, onInput: Z, checkValidity: L, handleCapsLockMouseLeave: z, handleCapsLockMouseEnter: W, BentoButton: J, BentoImage: G, BentoInputField: K, BentoPopover: Q, BentoTypography: Y, Tooltip: le, CheckmarkCircleFillIcon: $, DotIcon: ee, HideIcon:
|
|
158
|
+
), { __sfc: !0, DEBOUNCE_DURATION: e, DEBOUNCE_MAX_WAIT: h, TOOLTIP_TIMEOUT: d, t: l, props: t, emit: a, attrs: y, inputType: p, inputValue: c, isHintDisplayed: I, isTouched: g, passwordValidity: _, capsLockTooltipTimeoutID: r, isTooltipDisplayed: u, inputFieldPasswordRef: R, inputFieldPasswordInputRef: P, inputFieldPasswordCapsLockIconRef: F, isCapsLockOn: w, focused: T, validationListId: H, validationPopoverId: V, isPasswordReadable: B, computedErrorMessage: S, passwordValidityConditionalClass: D, tooltipConditionalClass: U, inputFieldArgs: x, computedValidations: C, hasErrors: b, hasValidations: k, checkCapsLock: O, toggleInputType: N, onInput: Z, checkValidity: L, handleCapsLockMouseLeave: z, handleCapsLockMouseEnter: W, BentoButton: J, BentoImage: G, BentoInputField: K, BentoPopover: Q, BentoTypography: Y, Tooltip: le, CheckmarkCircleFillIcon: $, DotIcon: ee, HideIcon: te, ShowIcon: ae, CapsLockIcon: re };
|
|
159
159
|
}
|
|
160
160
|
});
|
|
161
161
|
var _e = function() {
|
|
@@ -188,4 +188,4 @@ export {
|
|
|
188
188
|
de as m,
|
|
189
189
|
ce as r
|
|
190
190
|
};
|
|
191
|
-
//# sourceMappingURL=input-field-password.
|
|
191
|
+
//# sourceMappingURL=input-field-password.HRDEb0jL.js.map
|
package/dist/chunks/{input-field-password.BmfOGkrH.js.map → input-field-password.HRDEb0jL.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-field-password.BmfOGkrH.js","sources":["../../src/components/input-field-password/input-field-password.types.ts","../../src/components/input-field-password/assets/capslock.svg","../../src/components/input-field-password/utilities/input-field-password.validation.ts","../../src/components/input-field-password/input-field-password.vue"],"sourcesContent":["import { BentoInputField, BentoInputFieldValue } from '@/components/input-field';\n\n/**\n * Public\n */\n\nexport interface BentoInputFieldPasswordValidationListItem {\n label: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n validate: (value: BentoInputFieldValue, ...args: any[]) => boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n additionalArgs?: any[];\n}\n\nexport interface BentoInputFieldPasswordValidation {\n title?: string;\n suggestion?: string;\n list: BentoInputFieldPasswordValidationListItem[];\n}\n\nexport interface BentoInputFieldPasswordProps {\n /**\n * Reduces height of the input\n */\n condensed?: BentoInputFieldProps['condensed'];\n\n /**\n * Disables the possibility of changing value in the input-field\n */\n disabled?: BentoInputFieldProps['disabled'];\n\n /**\n * Renders input-field with an error state and the error message beneath the input box\n */\n errorMessage?: BentoInputFieldProps['errorMessage'];\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder?: BentoInputFieldProps['placeholder'];\n\n /**\n * Setting this property to true will set the input field to read only state.\n */\n readonly?: BentoInputFieldProps['readonly'];\n\n /**\n * Text displayed as the value of the input-field\n */\n value?: BentoInputFieldProps['value'];\n\n /**\n * Label to be shown with the input field\n */\n label?: string;\n\n /**\n * Configuration object for password field validation.\n *\n * This object defines the validation criteria and associated messages for a password field.\n * It includes the following properties:\n *\n * - `title`: The title displayed at the top of the validation hint.\n * - `suggestion`: The message displayed at the bottom of the validation hint, providing additional guidance.\n * - `list`: An array of callback functions to be executed on the value after each user input, validating the password against the specified rules.\n *\n * By default, the validation checks that:\n *\n * - The value has a minimum length of 8 characters.\n * - The value contains at least one lowercase letter.\n * - The value contains at least one uppercase letter.\n * - The value contains at least one numeric digit.\n * - The value contains at least one special character.\n *\n *\n */\n validation?: BentoInputFieldPasswordValidation;\n\n /**\n * Whether the password validation hint is displayed when the input field is activated via focus or input\n */\n withHint?: boolean;\n}\n\n/**\n * Private\n */\n\nexport enum BentoInputFieldPasswordType {\n TEXT = 'text',\n PASSWORD = 'password',\n}\n\nexport type BentoInputFieldProps = InstanceType<typeof BentoInputField>['$props'];\n","export default \"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='capslock'%3e%3cg%20id='Union'%3e%3cpath%20d='M13.75%205.63952L8%201.03952L2.25%205.63952V7.74999H4.75V11.75H11.25V7.74999H13.75V5.63952ZM6.25%206.24999H3.88809L8%202.96046L12.1119%206.24999H9.75V10.25H6.25V6.24999Z'%20fill='%2300112C'/%3e%3cpath%20d='M11.25%2014.75V13.25H4.75V14.75H11.25Z'%20fill='%2300112C'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e\"","import { BentoInputFieldValue } from '@/components/input-field';\n\nfunction stringifyValue(value: BentoInputFieldValue): string {\n return value?.toString() ?? '';\n}\n\n/**\n * Validates if the length of the provided value is greater than or equal to the specified length.\n *\n * @param value - The input value to check.\n * @param length - The minimum required length of the value. Defaults to 8.\n * @returns `true` if the length of the value is greater than or equal to the specified length, `false` otherwise.\n */\nexport function minLength(value: BentoInputFieldValue, length = 8): boolean {\n return stringifyValue(value).length >= length;\n}\n\n/**\n * Validates if the provided value contains at least one lowercase letter.\n *\n * @param value - The input value to check.\n * @returns `true` if the value contains at least one lowercase letter, `false` otherwise.\n */\nexport function requireLowercase(value: BentoInputFieldValue): boolean {\n return /[a-z]/.test(stringifyValue(value));\n}\n\n/**\n * Validates if the provided value contains at least one uppercase letter.\n *\n * @param value - The input value to check.\n * @returns `true` if the value contains at least one uppercase letter, `false` otherwise.\n */\nexport function requireUppercase(value: BentoInputFieldValue): boolean {\n return /[A-Z]/.test(stringifyValue(value));\n}\n\n/**\n * Validates if the provided value contains at least one numerical digit.\n *\n * @param value - The input value to check.\n * @returns `true` if the value contains at least one numerical digit, `false` otherwise.\n */\nexport function requireNumeric(value: BentoInputFieldValue): boolean {\n return /\\d/.test(stringifyValue(value));\n}\n\n/**\n * Validates if the provided value contains at least one special character (non-alphanumeric).\n *\n * @param value - The input value to check.\n * @returns `true` if the value contains at least one special character, `false` otherwise.\n */\nexport function requireSpecialCharacter(value: BentoInputFieldValue): boolean {\n return /[^a-zA-Z0-9]/.test(stringifyValue(value));\n}\n","<template>\n <div ref=\"inputFieldPasswordRef\">\n <bento-input-field\n ref=\"inputFieldPasswordInputRef\"\n v-bind=\"inputFieldArgs\"\n class=\"b-input-field-password__input\"\n spellcheck=\"false\"\n @input=\"onInput\"\n @keydown=\"checkCapsLock\"\n @keyup=\"checkCapsLock\"\n >\n <template #default>{{ label }}</template>\n\n <template v-if=\"isCapsLockOn\" #iconBefore>\n <div\n class=\"b-input-field-password__caps-lock-indicator\"\n @mouseenter=\"handleCapsLockMouseEnter\"\n @mouseleave=\"handleCapsLockMouseLeave\"\n >\n <bento-image\n ref=\"inputFieldPasswordCapsLockIconRef\"\n :src=\"CapsLockIcon\"\n :alt=\"t('capsLockEnabled')\"\n ></bento-image>\n </div>\n\n <tooltip\n v-if=\"inputFieldPasswordCapsLockIconRef\"\n :class=\"tooltipConditionalClass\"\n :content=\"t('capsLockEnabled')\"\n :disabled-focus-trap=\"true\"\n :fallback-position=\"['top', 'bottom']\"\n :is-shown=\"isTooltipDisplayed\"\n :target-element=\"inputFieldPasswordCapsLockIconRef\"\n ></tooltip>\n </template>\n\n <template v-if=\"!disabled\" #iconAfter>\n <bento-button variant=\"tertiary\" @click=\"toggleInputType\">\n <template #iconLeft>\n <show-icon v-if=\"!isPasswordReadable\" :svg-title=\"t('showPassword')\" />\n\n <hide-icon v-if=\"isPasswordReadable\" :svg-title=\"t('hidePassword')\" />\n </template>\n </bento-button>\n </template>\n </bento-input-field>\n\n <bento-popover\n v-if=\"hasValidations\"\n :open=\"isHintDisplayed\"\n :target-element=\"inputFieldPasswordInputRef\"\n :disable-focus-trap=\"true\"\n :aria-label=\"computedValidations.title\"\n :aria-describedby=\"validationListId\"\n position=\"right-start\"\n >\n <div :id=\"validationPopoverId\">\n <bento-typography v-if=\"computedValidations.title\" class=\"b-input-field-password__validation-title\">\n {{ computedValidations.title }}\n </bento-typography>\n\n <p v-if=\"!hasErrors\" class=\"b-input-field-password__validation-status--valid\" role=\"alert\">\n {{ t('validationValid') }}\n </p>\n\n <ul :id=\"validationListId\" class=\"b-input-field-password__validation-list\">\n <li\n v-for=\"(validation, index) in computedValidations.list\"\n :key=\"index\"\n :class=\"passwordValidityConditionalClass[index]\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n <span class=\"b-input-field-password__validation-list-icon\">\n <checkmark-circle-fill-icon\n v-if=\"passwordValidity[index]\"\n :svg-title=\"t('validationChecked')\"\n />\n\n <dot-icon v-else :svg-title=\"t('validationUnchecked')\" />\n </span>\n\n <bento-typography class=\"b-input-field-password__validation-list-text\" el=\"span\">\n {{ validation.label }}\n </bento-typography>\n </li>\n </ul>\n\n <bento-typography\n v-if=\"computedValidations.suggestion\"\n class=\"b-input-field-password__validation-suggestion\"\n >\n {{ computedValidations.suggestion }}\n </bento-typography>\n </div>\n </bento-popover>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoButton } from '@/components/button';\n import { BentoImage } from '@/components/image';\n import { BentoInputField } from '@/components/input-field';\n import { BentoPopover } from '@/components/popover';\n import { BentoTypography } from '@/components/typography';\n import { Tooltip } from '@/internal';\n import {\n BentoInputFieldPasswordProps,\n BentoInputFieldPasswordType,\n BentoInputFieldProps,\n } from './input-field-password.types';\n\n import CheckmarkCircleFillIcon from '@adyen/ui-assets-icons-16/vue/checkmark-circle-fill';\n import DotIcon from '@adyen/ui-assets-icons-16/vue/dot';\n import HideIcon from '@adyen/ui-assets-icons-16/vue/hide';\n import ShowIcon from '@adyen/ui-assets-icons-16/vue/show';\n import CapsLockIcon from './assets/capslock.svg';\n\n import { useFocusWithin, watchDebounced } from '@vueuse/core';\n import { computed, ref, SetupContext, useAttrs, watch } from 'vue';\n\n import { useI18n } from '@/utils/ts/i18n';\n\n import {\n minLength,\n requireLowercase,\n requireNumeric,\n requireSpecialCharacter,\n requireUppercase,\n } from '@/components/input-field-password/utilities/input-field-password.validation';\n import { generateUid } from '@/core/utils/ts';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const DEBOUNCE_DURATION = 500;\n const DEBOUNCE_MAX_WAIT = 2000;\n const TOOLTIP_TIMEOUT = 2000;\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = defineProps({\n condensed: { default: false },\n disabled: { default: false },\n errorMessage: { default: null },\n placeholder: { default: '' },\n readonly: { default: false },\n value: { default: undefined },\n label: { default: null },\n validation: { default: undefined },\n withHint: { type: Boolean, default: true }\n});\n\n const emit = defineEmits([\"input:valid\", \"input\"]);\n\n const attrs = useAttrs();\n\n const inputType = ref(BentoInputFieldPasswordType.PASSWORD);\n const inputValue = ref(props.value);\n const isHintDisplayed = ref(false);\n const isTouched = ref(false);\n const passwordValidity = ref<boolean[]>([]);\n const capsLockTooltipTimeoutID = ref<ReturnType<typeof setTimeout>>(null);\n const isTooltipDisplayed = ref(false);\n const inputFieldPasswordRef = ref(null);\n const inputFieldPasswordInputRef = ref(null);\n const inputFieldPasswordCapsLockIconRef = ref(null);\n const isCapsLockOn = ref(false);\n\n const { focused } = useFocusWithin(inputFieldPasswordRef);\n\n const validationListId = generateUid('validationListId');\n const validationPopoverId = generateUid('validationPopoverId');\n\n const isPasswordReadable = computed(() => inputType.value === BentoInputFieldPasswordType.TEXT);\n const computedErrorMessage = computed(() => (isTouched.value && hasErrors.value ? props.errorMessage : ''));\n\n const passwordValidityConditionalClass = computed(() =>\n passwordValidity.value.map(validity =>\n validity\n ? 'b-input-field-password__validation-list--valid'\n : 'b-input-field-password__validation-list--invalid'\n )\n );\n\n const tooltipConditionalClass = computed(() =>\n capsLockTooltipTimeoutID.value ? 'b-input-field-password__input-tooltip--timed' : ''\n );\n\n const inputFieldArgs = computed<BentoInputFieldProps & SetupContext['attrs']>(() => ({\n ariaHidden: false,\n condensed: props.condensed,\n disabled: props.disabled,\n errorMessage: computedErrorMessage.value,\n placeholder: props.placeholder,\n readonly: props.readonly,\n type: inputType.value,\n value: inputValue.value,\n\n 'aria-haspopup': hasValidations.value ? 'dialog' : false,\n 'aria-describedby': hasValidations.value ? validationPopoverId : '',\n\n ...attrs,\n }));\n\n const computedValidations = computed(() =>\n props.validation === undefined\n ? {\n title: t('validationTitle'),\n suggestion: t('validationSuggestion'),\n list: [\n { label: t('validationMinLength'), validate: minLength },\n { label: t('validationRequireLowercase'), validate: requireLowercase },\n { label: t('validationRequireUppercase'), validate: requireUppercase },\n { label: t('validationRequireNumeric'), validate: requireNumeric },\n { label: t('validationRequireSpecialCharacter'), validate: requireSpecialCharacter },\n ],\n }\n : props.validation\n );\n\n const hasErrors = computed(() => passwordValidity.value.some(validation => !validation));\n const hasValidations = computed(\n () => inputFieldPasswordInputRef.value && computedValidations.value?.list?.length > 0\n );\n\n const checkCapsLock = (e: KeyboardEvent) => {\n isCapsLockOn.value = e.getModifierState('CapsLock');\n };\n\n const toggleInputType = () => {\n if (isPasswordReadable.value) {\n inputType.value = BentoInputFieldPasswordType.PASSWORD;\n } else {\n inputType.value = BentoInputFieldPasswordType.TEXT;\n }\n };\n\n const onInput = (value: string) => {\n if (props.disabled) {\n return;\n }\n\n inputValue.value = value;\n\n emit('input', inputValue.value);\n };\n\n const checkValidity = (value: BentoInputFieldPasswordProps['value']) => {\n passwordValidity.value =\n computedValidations.value?.list?.map(validationItem =>\n validationItem.validate(value, validationItem.additionalArgs)\n ) ?? [];\n };\n\n const handleCapsLockMouseLeave = () => {\n isTooltipDisplayed.value = false;\n capsLockTooltipTimeoutID.value = null;\n };\n\n const handleCapsLockMouseEnter = () => {\n isTooltipDisplayed.value = true;\n };\n\n watch(focused, focused => {\n if (!props.withHint) {\n return;\n }\n\n isHintDisplayed.value = focused;\n\n if (!focused) {\n isTouched.value = true;\n } else {\n checkValidity(inputValue.value);\n }\n });\n\n watch(isCapsLockOn, isCapsLockOn => {\n if (!isCapsLockOn) {\n clearTimeout(capsLockTooltipTimeoutID.value);\n\n capsLockTooltipTimeoutID.value = null;\n isTooltipDisplayed.value = false;\n } else {\n isTooltipDisplayed.value = true;\n\n capsLockTooltipTimeoutID.value = setTimeout(() => {\n capsLockTooltipTimeoutID.value = null;\n isTooltipDisplayed.value = false;\n }, TOOLTIP_TIMEOUT);\n }\n });\n\n watchDebounced(\n inputValue,\n inputValue => {\n checkValidity(inputValue);\n\n if (!hasErrors.value) {\n emit('input:valid');\n }\n },\n // wait for 0.5s before checking validity OR 2s of continuous typing\n { debounce: DEBOUNCE_DURATION, maxWait: DEBOUNCE_MAX_WAIT }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * The input field password is a component designed to support users' preference for entering values securely.\n * This is an extension of the `bento-input-field` component.\n *\n * @example\n * import { BentoInputFieldPassword } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoInputFieldPassword },\n * template: `\n * <bento-input-field-password\n * label=\"Label\"\n * error-message=\"Error\"\n * :validation=\"{\n * title: 'Password must contain at least:',\n * suggestion: 'Avoid using currency symbols or accented letters.',\n * list: [\n * { label: '8 characters', validate: minLength, additionalArgs: [8] },\n * { label: '1 lowercase (a-z)', validate: requireLowercase },\n * { label: '1 uppercase (A-Z)', validate: requireUppercase },\n * { label: '1 numerical (0-9)', validate: requireNumeric },\n * { label: '1 special character', validate: requireSpecialCharacter },\n * {\n * label: 'Always true',\n * validate: () => {\n * const example = 'Example';\n *\n * return () => example.length > 1;\n * },\n * },\n * ],\n * }\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-input-field-password',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-field-password.scss\" />\n"],"names":["BentoInputFieldPasswordType","BentoInputFieldPasswordType2","CapsLockIcon","stringifyValue","value","minLength","length","requireLowercase","requireUppercase","requireNumeric","requireSpecialCharacter","__default__","messages","DEBOUNCE_DURATION","DEBOUNCE_MAX_WAIT","TOOLTIP_TIMEOUT","t","useI18n","attrs","useAttrs","inputType","ref","inputValue","props","isHintDisplayed","isTouched","passwordValidity","capsLockTooltipTimeoutID","isTooltipDisplayed","inputFieldPasswordRef","inputFieldPasswordInputRef","inputFieldPasswordCapsLockIconRef","isCapsLockOn","focused","useFocusWithin","validationListId","generateUid","validationPopoverId","isPasswordReadable","computed","computedErrorMessage","hasErrors","passwordValidityConditionalClass","validity","tooltipConditionalClass","inputFieldArgs","hasValidations","computedValidations","validation","_b","_a","checkCapsLock","e","toggleInputType","onInput","emit","checkValidity","validationItem","handleCapsLockMouseLeave","handleCapsLockMouseEnter","watch","focused2","isCapsLockOn2","watchDebounced","inputValue2"],"mappings":";;;;;;;;;;;;;;;AAwFY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA;ACxFZ,MAAAE,KAAA;ACEA,SAAAC,EAAAC,GAAA;AACI,UAAAA,KAAA,gBAAAA,EAAA,eAAA;AACJ;AASgB,SAAAC,GAAAD,GAAAE,IAAA,GAAA;AACZ,SAAAH,EAAAC,CAAA,EAAA,UAAAE;AACJ;AAQO,SAAAC,GAAAH,GAAA;AACH,SAAA,QAAA,KAAAD,EAAAC,CAAA,CAAA;AACJ;AAQO,SAAAI,GAAAJ,GAAA;AACH,SAAA,QAAA,KAAAD,EAAAC,CAAA,CAAA;AACJ;AAQO,SAAAK,GAAAL,GAAA;AACH,SAAA,KAAA,KAAAD,EAAAC,CAAA,CAAA;AACJ;AAQO,SAAAM,GAAAN,GAAA;AACH,SAAA,eAAA,KAAAD,EAAAC,CAAA,CAAA;AACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GCmSIO,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,GAAA;AAAA,EACM,MAAA;AAErB;;;;;;;;;;;;;;;iBArNAC,IAAA,KACAC,IAAA,KACAC,IAAA,KAEA,EAAA,GAAAC,EAAA,IAAAC,GAAA,GAgBAC,IAAAC,EAAA,GAEAC,IAAAC,EAAArB,EAAA,QAAA,GACAsB,IAAAD,EAAAE,EAAA,KAAA,GACAC,IAAAH,EAAA,EAAA,GACAI,IAAAJ,EA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GAGJmC,EAAA5B,GAAA,CAAA8B,MAAA;AACI,MAAAA,KAMIlC,EAAA,QAAA,IAEAD,EAAA,QAAA,WAAA,MAAA;AACI,QAAAA,EAAA,QAAA,MACAC,EAAA,QAAA;AAAA,MAA2B,GAAAb,CAAA,MAT/B,aAAAY,EAAA,KAAA,GAEAA,EAAA,QAAA,MACAC,EAAA,QAAA;AAAA,IAQJ,CAAA,GAGJmC;AAAA,MAAAzC;AAAA,MACI,CAAA0C,MAAA;AAEI,QAAAR,EAAAQ,CAAA,GAEAvB,EAAA,SACIc,EAAA,aAAA;AAAA,MACJ;AAAA;AAAA,MACJ,EAAA,UAAA1C,GAAA,SAAAC,EAAA;AAAA,IAE0D;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"input-field-password.HRDEb0jL.js","sources":["../../src/components/input-field-password/input-field-password.types.ts","../../src/components/input-field-password/assets/capslock.svg","../../src/components/input-field-password/utilities/input-field-password.validation.ts","../../src/components/input-field-password/input-field-password.vue"],"sourcesContent":["import { BentoInputField, BentoInputFieldValue } from '@/components/input-field';\n\n/**\n * Public\n */\n\nexport interface BentoInputFieldPasswordValidationListItem {\n label: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n validate: (value: BentoInputFieldValue, ...args: any[]) => boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n additionalArgs?: any[];\n}\n\nexport interface BentoInputFieldPasswordValidation {\n title?: string;\n suggestion?: string;\n list: BentoInputFieldPasswordValidationListItem[];\n}\n\nexport interface BentoInputFieldPasswordProps {\n /**\n * Reduces height of the input\n */\n condensed?: BentoInputFieldProps['condensed'];\n\n /**\n * Disables the possibility of changing value in the input-field\n */\n disabled?: BentoInputFieldProps['disabled'];\n\n /**\n * Renders input-field with an error state and the error message beneath the input box\n */\n errorMessage?: BentoInputFieldProps['errorMessage'];\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder?: BentoInputFieldProps['placeholder'];\n\n /**\n * Setting this property to true will set the input field to read only state.\n */\n readonly?: BentoInputFieldProps['readonly'];\n\n /**\n * Text displayed as the value of the input-field\n */\n value?: BentoInputFieldProps['value'];\n\n /**\n * Label to be shown with the input field\n */\n label?: string;\n\n /**\n * Configuration object for password field validation.\n *\n * This object defines the validation criteria and associated messages for a password field.\n * It includes the following properties:\n *\n * - `title`: The title displayed at the top of the validation hint.\n * - `suggestion`: The message displayed at the bottom of the validation hint, providing additional guidance.\n * - `list`: An array of callback functions to be executed on the value after each user input, validating the password against the specified rules.\n *\n * By default, the validation checks that:\n *\n * - The value has a minimum length of 8 characters.\n * - The value contains at least one lowercase letter.\n * - The value contains at least one uppercase letter.\n * - The value contains at least one numeric digit.\n * - The value contains at least one special character.\n *\n *\n */\n validation?: BentoInputFieldPasswordValidation;\n\n /**\n * Whether the password validation hint is displayed when the input field is activated via focus or input\n */\n withHint?: boolean;\n}\n\n/**\n * Private\n */\n\nexport enum BentoInputFieldPasswordType {\n TEXT = 'text',\n PASSWORD = 'password',\n}\n\nexport type BentoInputFieldProps = InstanceType<typeof BentoInputField>['$props'];\n","export default \"data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='capslock'%3e%3cg%20id='Union'%3e%3cpath%20d='M13.75%205.63952L8%201.03952L2.25%205.63952V7.74999H4.75V11.75H11.25V7.74999H13.75V5.63952ZM6.25%206.24999H3.88809L8%202.96046L12.1119%206.24999H9.75V10.25H6.25V6.24999Z'%20fill='%2300112C'/%3e%3cpath%20d='M11.25%2014.75V13.25H4.75V14.75H11.25Z'%20fill='%2300112C'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e\"","import { BentoInputFieldValue } from '@/components/input-field';\n\nfunction stringifyValue(value: BentoInputFieldValue): string {\n return value?.toString() ?? '';\n}\n\n/**\n * Validates if the length of the provided value is greater than or equal to the specified length.\n *\n * @param value - The input value to check.\n * @param length - The minimum required length of the value. Defaults to 8.\n * @returns `true` if the length of the value is greater than or equal to the specified length, `false` otherwise.\n */\nexport function minLength(value: BentoInputFieldValue, length = 8): boolean {\n return stringifyValue(value).length >= length;\n}\n\n/**\n * Validates if the provided value contains at least one lowercase letter.\n *\n * @param value - The input value to check.\n * @returns `true` if the value contains at least one lowercase letter, `false` otherwise.\n */\nexport function requireLowercase(value: BentoInputFieldValue): boolean {\n return /[a-z]/.test(stringifyValue(value));\n}\n\n/**\n * Validates if the provided value contains at least one uppercase letter.\n *\n * @param value - The input value to check.\n * @returns `true` if the value contains at least one uppercase letter, `false` otherwise.\n */\nexport function requireUppercase(value: BentoInputFieldValue): boolean {\n return /[A-Z]/.test(stringifyValue(value));\n}\n\n/**\n * Validates if the provided value contains at least one numerical digit.\n *\n * @param value - The input value to check.\n * @returns `true` if the value contains at least one numerical digit, `false` otherwise.\n */\nexport function requireNumeric(value: BentoInputFieldValue): boolean {\n return /\\d/.test(stringifyValue(value));\n}\n\n/**\n * Validates if the provided value contains at least one special character (non-alphanumeric).\n *\n * @param value - The input value to check.\n * @returns `true` if the value contains at least one special character, `false` otherwise.\n */\nexport function requireSpecialCharacter(value: BentoInputFieldValue): boolean {\n return /[^a-zA-Z0-9]/.test(stringifyValue(value));\n}\n","<template>\n <div ref=\"inputFieldPasswordRef\">\n <bento-input-field\n ref=\"inputFieldPasswordInputRef\"\n v-bind=\"inputFieldArgs\"\n class=\"b-input-field-password__input\"\n spellcheck=\"false\"\n @input=\"onInput\"\n @keydown=\"checkCapsLock\"\n @keyup=\"checkCapsLock\"\n >\n <template #default>{{ label }}</template>\n\n <template v-if=\"isCapsLockOn\" #iconBefore>\n <div\n class=\"b-input-field-password__caps-lock-indicator\"\n @mouseenter=\"handleCapsLockMouseEnter\"\n @mouseleave=\"handleCapsLockMouseLeave\"\n >\n <bento-image\n ref=\"inputFieldPasswordCapsLockIconRef\"\n :src=\"CapsLockIcon\"\n :alt=\"t('capsLockEnabled')\"\n ></bento-image>\n </div>\n\n <tooltip\n v-if=\"inputFieldPasswordCapsLockIconRef\"\n :class=\"tooltipConditionalClass\"\n :content=\"t('capsLockEnabled')\"\n :disabled-focus-trap=\"true\"\n :fallback-position=\"['top', 'bottom']\"\n :is-shown=\"isTooltipDisplayed\"\n :target-element=\"inputFieldPasswordCapsLockIconRef\"\n ></tooltip>\n </template>\n\n <template v-if=\"!disabled\" #iconAfter>\n <bento-button variant=\"tertiary\" @click=\"toggleInputType\">\n <template #iconLeft>\n <show-icon v-if=\"!isPasswordReadable\" :svg-title=\"t('showPassword')\" />\n\n <hide-icon v-if=\"isPasswordReadable\" :svg-title=\"t('hidePassword')\" />\n </template>\n </bento-button>\n </template>\n </bento-input-field>\n\n <bento-popover\n v-if=\"hasValidations\"\n :open=\"isHintDisplayed\"\n :target-element=\"inputFieldPasswordInputRef\"\n :disable-focus-trap=\"true\"\n :aria-label=\"computedValidations.title\"\n :aria-describedby=\"validationListId\"\n position=\"right-start\"\n >\n <div :id=\"validationPopoverId\">\n <bento-typography v-if=\"computedValidations.title\" class=\"b-input-field-password__validation-title\">\n {{ computedValidations.title }}\n </bento-typography>\n\n <p v-if=\"!hasErrors\" class=\"b-input-field-password__validation-status--valid\" role=\"alert\">\n {{ t('validationValid') }}\n </p>\n\n <ul :id=\"validationListId\" class=\"b-input-field-password__validation-list\">\n <li\n v-for=\"(validation, index) in computedValidations.list\"\n :key=\"index\"\n :class=\"passwordValidityConditionalClass[index]\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n >\n <span class=\"b-input-field-password__validation-list-icon\">\n <checkmark-circle-fill-icon\n v-if=\"passwordValidity[index]\"\n :svg-title=\"t('validationChecked')\"\n />\n\n <dot-icon v-else :svg-title=\"t('validationUnchecked')\" />\n </span>\n\n <bento-typography class=\"b-input-field-password__validation-list-text\" el=\"span\">\n {{ validation.label }}\n </bento-typography>\n </li>\n </ul>\n\n <bento-typography\n v-if=\"computedValidations.suggestion\"\n class=\"b-input-field-password__validation-suggestion\"\n >\n {{ computedValidations.suggestion }}\n </bento-typography>\n </div>\n </bento-popover>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoButton } from '@/components/button';\n import { BentoImage } from '@/components/image';\n import { BentoInputField } from '@/components/input-field';\n import { BentoPopover } from '@/components/popover';\n import { BentoTypography } from '@/components/typography';\n import { Tooltip } from '@/internal';\n import {\n BentoInputFieldPasswordProps,\n BentoInputFieldPasswordType,\n BentoInputFieldProps,\n } from './input-field-password.types';\n\n import CheckmarkCircleFillIcon from '@adyen/ui-assets-icons-16/vue/checkmark-circle-fill';\n import DotIcon from '@adyen/ui-assets-icons-16/vue/dot';\n import HideIcon from '@adyen/ui-assets-icons-16/vue/hide';\n import ShowIcon from '@adyen/ui-assets-icons-16/vue/show';\n import CapsLockIcon from './assets/capslock.svg';\n\n import { useFocusWithin, watchDebounced } from '@vueuse/core';\n import { computed, ref, SetupContext, useAttrs, watch } from 'vue';\n\n import { useI18n } from '@/utils/ts/i18n';\n\n import {\n minLength,\n requireLowercase,\n requireNumeric,\n requireSpecialCharacter,\n requireUppercase,\n } from '@/components/input-field-password/utilities/input-field-password.validation';\n import { generateUid } from '@/core/utils/ts';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const DEBOUNCE_DURATION = 500;\n const DEBOUNCE_MAX_WAIT = 2000;\n const TOOLTIP_TIMEOUT = 2000;\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = defineProps({\n condensed: { default: false },\n disabled: { default: false },\n errorMessage: { default: null },\n placeholder: { default: '' },\n readonly: { default: false },\n value: { default: undefined },\n label: { default: null },\n validation: { default: undefined },\n withHint: { type: Boolean, default: true }\n});\n\n const emit = defineEmits([\"input:valid\", \"input\"]);\n\n const attrs = useAttrs();\n\n const inputType = ref(BentoInputFieldPasswordType.PASSWORD);\n const inputValue = ref(props.value);\n const isHintDisplayed = ref(false);\n const isTouched = ref(false);\n const passwordValidity = ref<boolean[]>([]);\n const capsLockTooltipTimeoutID = ref<ReturnType<typeof setTimeout>>(null);\n const isTooltipDisplayed = ref(false);\n const inputFieldPasswordRef = ref(null);\n const inputFieldPasswordInputRef = ref(null);\n const inputFieldPasswordCapsLockIconRef = ref(null);\n const isCapsLockOn = ref(false);\n\n const { focused } = useFocusWithin(inputFieldPasswordRef);\n\n const validationListId = generateUid('validationListId');\n const validationPopoverId = generateUid('validationPopoverId');\n\n const isPasswordReadable = computed(() => inputType.value === BentoInputFieldPasswordType.TEXT);\n const computedErrorMessage = computed(() => (isTouched.value && hasErrors.value ? props.errorMessage : ''));\n\n const passwordValidityConditionalClass = computed(() =>\n passwordValidity.value.map(validity =>\n validity\n ? 'b-input-field-password__validation-list--valid'\n : 'b-input-field-password__validation-list--invalid'\n )\n );\n\n const tooltipConditionalClass = computed(() =>\n capsLockTooltipTimeoutID.value ? 'b-input-field-password__input-tooltip--timed' : ''\n );\n\n const inputFieldArgs = computed<BentoInputFieldProps & SetupContext['attrs']>(() => ({\n ariaHidden: false,\n condensed: props.condensed,\n disabled: props.disabled,\n errorMessage: computedErrorMessage.value,\n placeholder: props.placeholder,\n readonly: props.readonly,\n type: inputType.value,\n value: inputValue.value,\n\n 'aria-haspopup': hasValidations.value ? 'dialog' : false,\n 'aria-describedby': hasValidations.value ? validationPopoverId : '',\n\n ...attrs,\n }));\n\n const computedValidations = computed(() =>\n props.validation === undefined\n ? {\n title: t('validationTitle'),\n suggestion: t('validationSuggestion'),\n list: [\n { label: t('validationMinLength'), validate: minLength },\n { label: t('validationRequireLowercase'), validate: requireLowercase },\n { label: t('validationRequireUppercase'), validate: requireUppercase },\n { label: t('validationRequireNumeric'), validate: requireNumeric },\n { label: t('validationRequireSpecialCharacter'), validate: requireSpecialCharacter },\n ],\n }\n : props.validation\n );\n\n const hasErrors = computed(() => passwordValidity.value.some(validation => !validation));\n const hasValidations = computed(\n () => inputFieldPasswordInputRef.value && computedValidations.value?.list?.length > 0\n );\n\n const checkCapsLock = (e: KeyboardEvent) => {\n isCapsLockOn.value = e.getModifierState('CapsLock');\n };\n\n const toggleInputType = () => {\n if (isPasswordReadable.value) {\n inputType.value = BentoInputFieldPasswordType.PASSWORD;\n } else {\n inputType.value = BentoInputFieldPasswordType.TEXT;\n }\n };\n\n const onInput = (value: string) => {\n if (props.disabled) {\n return;\n }\n\n inputValue.value = value;\n\n emit('input', inputValue.value);\n };\n\n const checkValidity = (value: BentoInputFieldPasswordProps['value']) => {\n passwordValidity.value =\n computedValidations.value?.list?.map(validationItem =>\n validationItem.validate(value, validationItem.additionalArgs)\n ) ?? [];\n };\n\n const handleCapsLockMouseLeave = () => {\n isTooltipDisplayed.value = false;\n capsLockTooltipTimeoutID.value = null;\n };\n\n const handleCapsLockMouseEnter = () => {\n isTooltipDisplayed.value = true;\n };\n\n watch(focused, focused => {\n if (!props.withHint) {\n return;\n }\n\n isHintDisplayed.value = focused;\n\n if (!focused) {\n isTouched.value = true;\n } else {\n checkValidity(inputValue.value);\n }\n });\n\n watch(isCapsLockOn, isCapsLockOn => {\n if (!isCapsLockOn) {\n clearTimeout(capsLockTooltipTimeoutID.value);\n\n capsLockTooltipTimeoutID.value = null;\n isTooltipDisplayed.value = false;\n } else {\n isTooltipDisplayed.value = true;\n\n capsLockTooltipTimeoutID.value = setTimeout(() => {\n capsLockTooltipTimeoutID.value = null;\n isTooltipDisplayed.value = false;\n }, TOOLTIP_TIMEOUT);\n }\n });\n\n watchDebounced(\n inputValue,\n inputValue => {\n checkValidity(inputValue);\n\n if (!hasErrors.value) {\n emit('input:valid');\n }\n },\n // wait for 0.5s before checking validity OR 2s of continuous typing\n { debounce: DEBOUNCE_DURATION, maxWait: DEBOUNCE_MAX_WAIT }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * The input field password is a component designed to support users' preference for entering values securely.\n * This is an extension of the `bento-input-field` component.\n *\n * @example\n * import { BentoInputFieldPassword } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoInputFieldPassword },\n * template: `\n * <bento-input-field-password\n * label=\"Label\"\n * error-message=\"Error\"\n * :validation=\"{\n * title: 'Password must contain at least:',\n * suggestion: 'Avoid using currency symbols or accented letters.',\n * list: [\n * { label: '8 characters', validate: minLength, additionalArgs: [8] },\n * { label: '1 lowercase (a-z)', validate: requireLowercase },\n * { label: '1 uppercase (A-Z)', validate: requireUppercase },\n * { label: '1 numerical (0-9)', validate: requireNumeric },\n * { label: '1 special character', validate: requireSpecialCharacter },\n * {\n * label: 'Always true',\n * validate: () => {\n * const example = 'Example';\n *\n * return () => example.length > 1;\n * },\n * },\n * ],\n * }\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-input-field-password',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-field-password.scss\" />\n"],"names":["BentoInputFieldPasswordType","BentoInputFieldPasswordType2","CapsLockIcon","stringifyValue","value","minLength","length","requireLowercase","requireUppercase","requireNumeric","requireSpecialCharacter","__default__","messages","DEBOUNCE_DURATION","DEBOUNCE_MAX_WAIT","TOOLTIP_TIMEOUT","t","useI18n","attrs","useAttrs","inputType","ref","inputValue","props","isHintDisplayed","isTouched","passwordValidity","capsLockTooltipTimeoutID","isTooltipDisplayed","inputFieldPasswordRef","inputFieldPasswordInputRef","inputFieldPasswordCapsLockIconRef","isCapsLockOn","focused","useFocusWithin","validationListId","generateUid","validationPopoverId","isPasswordReadable","computed","computedErrorMessage","hasErrors","passwordValidityConditionalClass","validity","tooltipConditionalClass","inputFieldArgs","hasValidations","computedValidations","validation","_b","_a","checkCapsLock","e","toggleInputType","onInput","emit","checkValidity","validationItem","handleCapsLockMouseLeave","handleCapsLockMouseEnter","watch","focused2","isCapsLockOn2","watchDebounced","inputValue2"],"mappings":";;;;;;;;;;;;;;;AAwFY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA;ACxFZ,MAAAE,KAAA;ACEA,SAAAC,EAAAC,GAAA;AACI,UAAAA,KAAA,gBAAAA,EAAA,eAAA;AACJ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
|
|
|
1
1
|
import { defineComponent as z, useAttrs as G, useSlots as Q, ref as y, provide as Z, inject as tt, toRef as et, computed as r, toRefs as at } from "vue";
|
|
2
|
-
import { a as ot, I as it, B as rt } from "./dropdown.
|
|
3
|
-
import { p as nt, d as P, B as st } from "./typography.
|
|
4
|
-
import { g as u } from "./generate-uid.
|
|
2
|
+
import { a as ot, I as it, B as rt } from "./dropdown.BqsoncJr.js";
|
|
3
|
+
import { p as nt, d as P, B as st } from "./typography.J1v_SPG3.js";
|
|
4
|
+
import { g as u } from "./generate-uid.NJ8tVoha.js";
|
|
5
5
|
import { g as dt } from "./get-slot-text.Cgn-E48s.js";
|
|
6
6
|
import { u as lt } from "./aria-label.CaUURpnB.js";
|
|
7
7
|
import { u as ut } from "./i18n.BQkEbtPM.js";
|
|
8
8
|
import { u as pt } from "./use-form-layout-loading.D3lALhtC.js";
|
|
9
9
|
import { u as ct } from "./use-has-slot.C9lQZ6nz.js";
|
|
10
|
-
import {
|
|
10
|
+
import { F as ft, E as _t } from "./error-message.Ccc1sTTp.js";
|
|
11
11
|
import { n as bt } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
12
12
|
import "../assets/input-field.css";
|
|
13
13
|
var s = /* @__PURE__ */ ((a) => (a.DEFAULT = "default", a.PAYMENT_METHOD = "payment-method", a.STATIC_VALUE = "static-value", a.DROPDOWN = "dropdown", a))(s || {}), n = /* @__PURE__ */ ((a) => (a.START = "start", a.END = "end", a))(n || {}), p = /* @__PURE__ */ ((a) => (a.CONDENSED = "condensed", a.DISABLED = "disabled", a.READONLY = "readonly", a.ERROR = "error", a))(p || {}), S = /* @__PURE__ */ ((a) => (a.SEARCH = "search", a.TEXT = "text", a.NUMBER = "number", a))(S || {}), yt = /* @__PURE__ */ ((a) => (a.INPUT = "input", a.ESCAPE_PRESSED = "escape-pressed", a.UPDATE_DROPDOWN = "update:dropdown", a.DROPDOWN_INPUT = "dropdown-input", a.FOCUS = "focus", a.CHANGE = "change", a.BLUR = "blur", a.KEYDOWN = "keydown", a))(yt || {});
|
|
@@ -190,7 +190,7 @@ const ht = {
|
|
|
190
190
|
</template>
|
|
191
191
|
</bento-input-field>`,
|
|
192
192
|
"2.0.0"
|
|
193
|
-
), { __sfc: !0, attrs: i, slots: c, props: t, emit: o, t: h, hasSlot: f, inputFieldElement: E, inputFieldId: R, dropdownId: v, staticValueId: m, descriptionId: g, errorId: A, isFocused: D, hint: B, onFocus: k, onBlur: F, isReadOnly: _, shouldShowStaticValue: d, isDefaultVariant: M, isPaymentMethodVariant: V, shouldDisplayStaticValueAtStart: U, shouldDisplayStaticValueAtEnd: x, shouldShowDropdown: l, shouldDisplayDropdownAtStart: H, shouldDisplayDropdownAtEnd: $, shouldShowError: w, computedAriaOwns: Y, computedAriaLabelFallbackMessage: T, computedAriaLabelDropdowFallback: I, ariaLabelAttribute: O, ariaLabel: L, computedAriaLabel: N, computedAriaDescribedBy: j, inputFieldConditionalClasses: W, inputFieldDropdownProps: q, onInput: K, onDropdownInput: J, focusInput: C, BentoDropdown: rt, BentoTypography: st, ErrorMessage:
|
|
193
|
+
), { __sfc: !0, attrs: i, slots: c, props: t, emit: o, t: h, hasSlot: f, inputFieldElement: E, inputFieldId: R, dropdownId: v, staticValueId: m, descriptionId: g, errorId: A, isFocused: D, hint: B, onFocus: k, onBlur: F, isReadOnly: _, shouldShowStaticValue: d, isDefaultVariant: M, isPaymentMethodVariant: V, shouldDisplayStaticValueAtStart: U, shouldDisplayStaticValueAtEnd: x, shouldShowDropdown: l, shouldDisplayDropdownAtStart: H, shouldDisplayDropdownAtEnd: $, shouldShowError: w, computedAriaOwns: Y, computedAriaLabelFallbackMessage: T, computedAriaLabelDropdowFallback: I, ariaLabelAttribute: O, ariaLabel: L, computedAriaLabel: N, computedAriaDescribedBy: j, inputFieldConditionalClasses: W, inputFieldDropdownProps: q, onInput: K, onDropdownInput: J, focusInput: C, BentoDropdown: rt, BentoTypography: st, ErrorMessage: _t, FieldLabel: ft };
|
|
194
194
|
}
|
|
195
195
|
});
|
|
196
196
|
var Dt = function() {
|
|
@@ -225,4 +225,4 @@ export {
|
|
|
225
225
|
S as d,
|
|
226
226
|
yt as e
|
|
227
227
|
};
|
|
228
|
-
//# sourceMappingURL=input-field.
|
|
228
|
+
//# sourceMappingURL=input-field.D6N2kt7s.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-field.D6N2kt7s.js","sources":["../../src/components/input-field/input-field.types.ts","../../src/components/input-field/input-field.vue"],"sourcesContent":["import { BentoDropdown } from '@/components/dropdown/';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldVariant {\n DEFAULT = 'default',\n PAYMENT_METHOD = 'payment-method',\n STATIC_VALUE = 'static-value',\n DROPDOWN = 'dropdown',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldElementPosition {\n START = 'start',\n END = 'end',\n}\n\nexport enum BentoInputFieldStateClass {\n CONDENSED = 'condensed',\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldType {\n SEARCH = 'search',\n TEXT = 'text',\n NUMBER = 'number',\n}\n\nexport type BentoInputFieldValue = string | number;\n\ntype DropdownProps = InstanceType<typeof BentoDropdown>['$props'];\nexport type BentoInputDropdownProps = {\n items: DropdownProps['items'];\n value: DropdownProps['value'];\n dynamicFiltering?: DropdownProps['dynamicFiltering'];\n 'aria-label'?: string;\n};\n\n/**\n * @deprecated The use of these enums is no longer supported.\n * Use `v-on:` or `@` to listen to the events being emitted.\n * This enum will be removed in 2.0.\n */\nexport enum BentoInputFieldEvent {\n INPUT = 'input',\n ESCAPE_PRESSED = 'escape-pressed',\n UPDATE_DROPDOWN = 'update:dropdown',\n DROPDOWN_INPUT = 'dropdown-input',\n FOCUS = 'focus',\n CHANGE = 'change',\n BLUR = 'blur',\n KEYDOWN = 'keydown',\n}\n","<template>\n <bento-typography\n class=\"b-input-field\"\n data-testid=\"input-text-container\"\n :class=\"inputFieldConditionalClasses\"\n el=\"div\"\n variant=\"body\"\n >\n <field-label\n v-if=\"hasSlot('default')\"\n :for=\"inputFieldId\"\n data-testid=\"input-field-label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n @click=\"focusInput\"\n >\n <slot></slot>\n </field-label>\n\n <div class=\"b-input-field__input-box\" data-testid=\"input-box\" :aria-disabled=\"disabled\" @click=\"focusInput\">\n <!-- Optional Icon for Default text variant -->\n <span\n v-if=\"isDefaultVariant && (hasSlot('defaultIconBefore') || hasSlot('iconBefore'))\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-before\"\n >\n <slot v-if=\"hasSlot('iconBefore')\" name=\"iconBefore\" />\n <slot v-if=\"hasSlot('defaultIconBefore') && !hasSlot('iconBefore')\" name=\"defaultIconBefore\" />\n </span>\n\n <!-- Mandatory Icon for Payment Method variant -->\n <span\n v-if=\"isPaymentMethodVariant && hasSlot('paymentMethod')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__payment-method\"\n >\n <slot name=\"paymentMethod\" />\n </span>\n\n <!-- Dropdown at start -->\n <div\n v-if=\"shouldDisplayDropdownAtStart\"\n :id=\"dropdownId\"\n class=\"b-input-field__dropdown b-input-field__dropdown--start\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n v-bind=\"inputFieldDropdownProps\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n\n <!-- Static Value at start -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtStart\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--start\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n <div class=\"b-input-field__input-container\">\n <input\n :id=\"inputFieldId\"\n v-bind=\"attrs\"\n ref=\"inputFieldElement\"\n class=\"b-input-field__input\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"computedAriaDescribedBy\"\n :aria-owns=\"computedAriaOwns\"\n :aria-invalid=\"shouldShowError\"\n :placeholder=\"placeholder\"\n :type=\"type\"\n :value=\"value\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onInput\"\n @change=\"emit('change')\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n @keydown=\"emit('keydown', $event)\"\n @keyup=\"emit('keyup', $event)\"\n @keydown.esc=\"emit('escape-pressed')\"\n />\n\n <!-- Hint at the end -->\n <bento-typography v-if=\"hint && isFocused && value\" el=\"span\" class=\"b-input-field__hint\">\n {{ hint }}\n </bento-typography>\n </div>\n\n <span\n v-if=\"hasSlot('iconAfter')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-after\"\n data-testid=\"input-text__icon-after\"\n >\n <slot name=\"iconAfter\" />\n </span>\n\n <!-- Static Value at the end -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtEnd\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--end\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n\n <!-- Dropdown at end -->\n <div\n v-if=\"shouldDisplayDropdownAtEnd\"\n :id=\"dropdownId\"\n data-testid=\"input-field-dropdown-container-end\"\n class=\"b-input-field__dropdown b-input-field__dropdown--end\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n :id=\"dropdownId\"\n v-bind=\"inputFieldDropdownProps\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n </div>\n\n <error-message\n v-if=\"shouldShowError && !!errorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-input-field__error-message\"\n />\n\n <span v-if=\"hasSlot('description')\" :id=\"descriptionId\" class=\"b-input-field__description\" @click=\"focusInput\">\n <bento-typography el=\"span\" variant=\"body\">\n <slot id=\"description\" name=\"description\" />\n </bento-typography>\n </span>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, PropType, provide, Ref, ref, toRef, toRefs, useAttrs, useSlots } from 'vue';\n\n // Components\n import { BentoDropdown } from '@/components/dropdown';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage, FieldLabel } from '@/internal';\n\n // Utils\n import { deprecate } from '@/utils/ts/deprecate';\n import { generateUid } from '@/core/utils/ts';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useI18n } from '@/utils/ts/i18n';\n import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\n import {\n INPUT_FIELD_COMPONENT_INJECTION_KEY,\n INPUT_FIELD_HINT_INJECTION_KEY,\n } from '@/components/input-field/input-field.keys';\n\n // Composables\n import { useFormLayoutFieldLoading, useHasSlot } from '@/composables';\n\n // Types\n import {\n BentoInputDropdownProps,\n BentoInputFieldElementPosition,\n BentoInputFieldStateClass,\n BentoInputFieldType,\n BentoInputFieldValue,\n BentoInputFieldVariant,\n } from './input-field.types';\n import { BentoListboxSelectedValue } from '@/types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n const slots = useSlots();\n\n const props = defineProps({\n /**\n * Indicates whether the element is exposed to an accessibility API.\n */\n ariaHidden: { type: Boolean, default: true },\n\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Text that labels an the input element\n */\n ariaLabel: { type: String, default: undefined },\n\n /**\n * Reduces height of the input\n */\n condensed: { type: Boolean, default: false },\n\n /**\n * Disables the possibility of changing value in the input-field\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Dropdown props for the small selectable dropdown menu.\n * Properties supported:\n *\n * - `value`: Selected value of the dropdown\n * - `items`: List of available items\n * - `aria-label`: Text that labels the dropdown element\n *\n */\n dropdown: {\n type: Object as PropType<BentoInputDropdownProps>,\n default: undefined,\n },\n\n /**\n * Position of the dropdown before or after input value\n */\n dropdownPosition: {\n type: String as PropType<BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`>,\n default: BentoInputFieldElementPosition.START,\n validator: (value: BentoInputFieldElementPosition) =>\n Object.values(BentoInputFieldElementPosition).includes(value),\n },\n\n /**\n * Adds error validation class for outlining input-field.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n error: { type: Boolean, default: false },\n\n /**\n * Renders input-field with an error state and the error message beneath the input box\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Highlights the dropdown is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Highlights the dropdown is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Setting this property to true will set the input field to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Static text that displayed before or after input value\n * Applicable to the Static Value variant\n */\n staticValue: { type: String, default: '' },\n\n /**\n * Position of Static Value before or after input value\n */\n staticValuePosition: {\n type: String as PropType<BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`>,\n default: BentoInputFieldElementPosition.START,\n validator: (value: BentoInputFieldElementPosition) =>\n Object.values(BentoInputFieldElementPosition).includes(value),\n },\n\n /**\n * Adds a info icon next to the label to display the passed tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * A string specifying the type of control to render.\n * All `input` types are available but only `search`, `text` and `number` are fully supported.\n *\n * If `type` is `search`, use `bento-search-bar` instead.\n */\n type: {\n type: String as PropType<BentoInputFieldType | `${BentoInputFieldType}` | HTMLInputElement['type']>,\n default: BentoInputFieldType.TEXT,\n },\n\n /**\n * Text displayed as the value of the input-field\n */\n value: { type: [String, Number] as PropType<BentoInputFieldValue>, default: undefined },\n\n /**\n * Describes the different variants for the input element\n */\n variant: {\n type: String as PropType<BentoInputFieldVariant | `${BentoInputFieldVariant}`>,\n default: BentoInputFieldVariant.DEFAULT,\n validator: (value: BentoInputFieldVariant) => Object.values(BentoInputFieldVariant).includes(value),\n },\n });\n\n const emit = defineEmits([\"update:dropdown\", \"blur\", \"change\", \"dropdown-input\", \"escape-pressed\", \"focus\", \"keydown\", \"keyup\", \"input\"]);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const hasSlot = useHasSlot(slots);\n const inputFieldElement = ref(null);\n const inputFieldId = generateUid('input');\n const dropdownId = generateUid('input-dropdown');\n const staticValueId = generateUid('input-static-value');\n const descriptionId = generateUid('input-description');\n const errorId = generateUid('input-error');\n const isFocused = ref(false);\n\n // Provide INPUT_FIELD_COMPONENT_INJECTION_KEY as true, to set the input only dropdown size variant in the BentoDropdown comp\n provide(INPUT_FIELD_COMPONENT_INJECTION_KEY, true);\n // Renders the input with a hint if a string is provided\n const hint = inject<Ref<string | undefined>>(INPUT_FIELD_HINT_INJECTION_KEY, ref(undefined));\n\n const onFocus = () => {\n isFocused.value = true;\n emit('focus');\n };\n\n const onBlur = () => {\n isFocused.value = false;\n emit('blur');\n };\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const shouldShowStaticValue = computed(\n () => props.variant === BentoInputFieldVariant.STATIC_VALUE && !!slots.staticValue\n );\n\n const isDefaultVariant = computed(() => props.variant === BentoInputFieldVariant.DEFAULT);\n\n const isPaymentMethodVariant = computed(() => props.variant === BentoInputFieldVariant.PAYMENT_METHOD);\n\n const shouldDisplayStaticValueAtStart = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayStaticValueAtEnd = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowDropdown = computed(() => props.variant === BentoInputFieldVariant.DROPDOWN && !!props.dropdown);\n const shouldDisplayDropdownAtStart = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayDropdownAtEnd = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.error)\n );\n\n const computedAriaOwns = computed(() => {\n if (shouldShowDropdown.value === true && shouldShowStaticValue.value === true) {\n return `${staticValueId} ${dropdownId}`;\n }\n if (shouldShowDropdown.value === true) {\n return `${dropdownId}`;\n }\n if (shouldShowStaticValue.value === true) {\n return `${staticValueId}`;\n }\n return null;\n });\n\n // vue-i18n issue with t() used in script - direct usage in template works\n // requires either createI18n({ legacy: false }) or to be wrapped in computed()\n const computedAriaLabelFallbackMessage = computed(() => t('ariaLabelFallback'));\n const computedAriaLabelDropdowFallback = computed(() =>\n t('ariaLabelDropdownFallback', { inputLabel: computedAriaLabel.value })\n );\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: hasSlot('default')\n ? (getSlotText(slots)('default') as string)\n : computedAriaLabelFallbackMessage,\n });\n\n const computedAriaDescribedBy = computed(\n () =>\n `${hasSlot('description') ? descriptionId : ''} ${\n shouldShowError.value && !!props.errorMessage ? errorId : ''\n }`\n );\n\n const inputFieldConditionalClasses = computed(() => ({\n [`b-input-field--${BentoInputFieldStateClass.CONDENSED}`]: props.condensed,\n [`b-input-field--${BentoInputFieldStateClass.DISABLED}`]: props.disabled,\n [`b-input-field--${BentoInputFieldStateClass.READONLY}`]: isReadOnly.value,\n [`b-input-field--${BentoInputFieldStateClass.ERROR}`]: shouldShowError.value,\n }));\n\n const inputFieldDropdownProps = computed(() => ({\n 'aria-label': computedAriaLabelDropdowFallback.value,\n ...props.dropdown,\n }));\n\n const onInput = (event: Event) => {\n const inputValue = (event.target as HTMLInputElement).value;\n if (!props.disabled && !isReadOnly.value) {\n emit('input', inputValue);\n }\n };\n\n const onDropdownInput = (selectedValue: BentoListboxSelectedValue) => {\n emit('dropdown-input', selectedValue);\n emit('update:dropdown', { ...props?.dropdown, value: selectedValue });\n };\n\n const focusInput = () => {\n inputFieldElement.value.focus();\n };\n\n // Expose method so that other components can focus on it in Vue3\n defineExpose({\n focusInput,\n });\n\n if (!Object.values(BentoInputFieldType).includes(props.type as BentoInputFieldType)) {\n printDevelopmentWarning(`\"bento-input-field\" dropdown does not support the type ${props.type}`);\n }\n\n /**\n * Deprecations\n */\n if (props.error) {\n deprecate(\n 'BentoInputField \"error\" property',\n `Use the BentoInputField \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-dropdown errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n if (hasSlot('defaultIconBefore')) {\n deprecate(\n 'BentoInputField \"defaultIconBefore\" slot',\n `Use the BentoInputField \"iconBefore\" slot instead to add an icon at the left side of the input field\n <bento-input-field>\n \\t<template #iconBefore>\n \\t\\t<my-icon-goes-here />\n \\t</template>\n </bento-input-field>`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Input field component is used to create interactive controls for web-based\n * forms in order to accept data from the user.\n *\n * @example\n * import { BentoInputField } from '@adyen/bento-vue2'\n *\n * const inputValue = ref('');\n *\n * export default {\n * components: { BentoInputField },\n * tempate: `\n * <bento-input-field\n * :value=\"inputValue\"\n * :input=\"newValue => inputValue.value = newValue\"\n * >\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-field.scss\" />\n"],"names":["BentoInputFieldVariant","BentoInputFieldVariant2","BentoInputFieldElementPosition","BentoInputFieldElementPosition2","BentoInputFieldStateClass","BentoInputFieldStateClass2","BentoInputFieldType","BentoInputFieldType2","BentoInputFieldEvent","BentoInputFieldEvent2","__default__","messages","attrs","useAttrs","slots","useSlots","t","useI18n","hasSlot","useHasSlot","inputFieldElement","ref","inputFieldId","generateUid","dropdownId","staticValueId","descriptionId","errorId","isFocused","provide","INPUT_FIELD_COMPONENT_INJECTION_KEY","hint","inject","INPUT_FIELD_HINT_INJECTION_KEY","onFocus","emit","onBlur","isReadOnly","useFormLayoutFieldLoading","toRef","props","shouldShowStaticValue","computed","isDefaultVariant","isPaymentMethodVariant","shouldDisplayStaticValueAtStart","shouldDisplayStaticValueAtEnd","shouldShowDropdown","shouldDisplayDropdownAtStart","shouldDisplayDropdownAtEnd","shouldShowError","computedAriaOwns","computedAriaLabelFallbackMessage","computedAriaLabelDropdowFallback","computedAriaLabel","ariaLabelAttribute","ariaLabel","toRefs","useAriaLabel","getSlotText","computedAriaDescribedBy","inputFieldConditionalClasses","inputFieldDropdownProps","onInput","event","inputValue","onDropdownInput","selectedValue","focusInput","expose","printDevelopmentWarning","deprecate"],"mappings":";;;;;;;;;;;;AAKY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,iBAAA,kBACAA,EAAA,eAAA,gBACAA,EAAA,WAAA,YAJQA,IAAAD,KAAA,CAAA,CAAA,GAUAE,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,MAAA,OAFQA,IAAAD,KAAA,CAAA,CAAA,GAKAE,IAAA,kBAAAC,OACRA,EAAA,YAAA,aACAA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SAJQA,IAAAD,KAAA,CAAA,CAAA,GAUAE,IAAA,kBAAAC,OACRA,EAAA,SAAA,UACAA,EAAA,OAAA,QACAA,EAAA,SAAA,UAHQA,IAAAD,KAAA,CAAA,CAAA,GAqBAE,KAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,iBAAA,kBACAA,EAAA,kBAAA,mBACAA,EAAA,iBAAA,kBACAA,EAAA,QAAA,SACAA,EAAA,SAAA,UACAA,EAAA,OAAA,QACAA,EAAA,UAAA,WARQA,IAAAD,MAAA,CAAA,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AA;AAAA,MACK,CAAA,kBAAAjC,EAAA,KAAA,EAAA,GAAA8C,EAAA;AAAA,IACE,EAAA,GAG3EY,IAAApB,EAAA,OAAA;AAAA,MAAgD,cAAAW,EAAA;AAAA,MACG,GAAAb,EAAA;AAAA,IACtC,EAAA,GAGbuB,IAAA,CAAAC,MAAA;AACI,YAAAC,IAAAD,EAAA,OAAA;AACA,MAAA,CAAAxB,EAAA,YAAA,CAAAH,EAAA,SACIF,EAAA,SAAA8B,CAAA;AAAA,IACJ,GAGJC,IAAA,CAAAC,MAAA;AACI,MAAAhC,EAAA,kBAAAgC,CAAA,GACAhC,EAAA,mBAAA,EAAA,GAAAK,KAAA,gBAAAA,EAAA,UAAA,OAAA2B,EAAA,CAAA;AAAA,IAAoE,GAGxEC,IAAA,MAAA;AACI,MAAAhD,EAAA,MAAA,MAAA;AAAA,IAA8B;AAIlC,WAAAiD,EAAA;AAAA,MAAa,YAAAD;AAAA,IACT,CAAA,GAGJ,OAAA,OAAA9D,CAAA,EAAA,SAAAkC,EAAA,IAAA,KACI8B,GAAA,0DAAA9B,EAAA,IAAA,EAAA,GAMJA,EAAA,SACI+B;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA,MACA;AAAA,IAGA,GAIRrD,EAAA,mBAAA,KACIqD;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MACA;AAAA,IAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineComponent as c, ref as l, computed as p } from "vue";
|
|
2
|
-
import { B as d } from "./typography.
|
|
3
|
-
import { B as _ } from "./button.
|
|
4
|
-
import { B as u } from "./focus-trap.
|
|
2
|
+
import { B as d } from "./typography.J1v_SPG3.js";
|
|
3
|
+
import { B as _ } from "./button.BX6ZJxF7.js";
|
|
4
|
+
import { B as u } from "./focus-trap.CGypVwG6.js";
|
|
5
5
|
import { B as f } from "./loading-indicator.z8COalOc.js";
|
|
6
6
|
import { E as m } from "./expand.CwwKq7Uc.js";
|
|
7
7
|
import { C as v } from "./cross.CsUPDmaA.js";
|
|
8
|
-
import { g as B } from "./generate-uid.
|
|
8
|
+
import { g as B } from "./generate-uid.NJ8tVoha.js";
|
|
9
9
|
import { u as C } from "./i18n.BQkEbtPM.js";
|
|
10
10
|
import { n as b } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
11
11
|
import "../assets/inspector.css";
|
|
@@ -67,4 +67,4 @@ export {
|
|
|
67
67
|
j as B,
|
|
68
68
|
U as i
|
|
69
69
|
};
|
|
70
|
-
//# sourceMappingURL=inspector.types.
|
|
70
|
+
//# sourceMappingURL=inspector.types.2YEArjPi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspector.types.
|
|
1
|
+
{"version":3,"file":"inspector.types.2YEArjPi.js","sources":["../../src/components/inspector/inspector.vue","../../src/components/inspector/inspector.types.ts"],"sourcesContent":["<template>\n <div class=\"b-inspector\" :class=\"conditionalClass\">\n <div class=\"b-inspector__page-wrapper\">\n <div class=\"b-inspector__page\">\n <slot name=\"page\" />\n </div>\n </div>\n <Transition name=\"b-inspector__animation\" mode=\"out-in\" @before-enter=\"setFocus\" @after-leave=\"setFocus\">\n <aside v-if=\"isOpen\" class=\"b-inspector__container-wrapper\" :aria-labelledby=\"titleId\">\n <bento-focus-trap class=\"b-inspector__container\">\n <div class=\"b-inspector__header\">\n <bento-typography :id=\"titleId\" el=\"h2\" variant=\"title\" class=\"b-inspector__title\">\n {{ title }}\n </bento-typography>\n <div class=\"b-inspector__icons\">\n <bento-button v-if=\"expandable\" variant=\"tertiary\" @click=\"emit('expand')\">\n <template #iconLeft><expand-icon :svg-title=\"t('expand')\"></expand-icon></template>\n </bento-button>\n <bento-button variant=\"tertiary\" @click=\"emit('update:is-open', false)\">\n <template #iconLeft><cross-icon :svg-title=\"t('close')\"></cross-icon></template>\n </bento-button>\n </div>\n </div>\n <div class=\"b-inspector__content\">\n <bento-loading-indicator v-if=\"loading\" large class=\"b-inspector__loading-indicator\" />\n <slot v-else name=\"content\" />\n </div>\n </bento-focus-trap>\n </aside>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoButton } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import ExpandIcon from '@adyen/ui-assets-icons-16/vue/expand';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n import { generateUid } from '@/core/utils/ts';\n import { useI18n } from '@/utils/ts/i18n';\n import { BentoInspectorSize } from './inspector.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n expandable: { type: Boolean, default: false },\n isOpen: { type: Boolean, default: false },\n loading: { type: Boolean, default: false },\n size: { default: 'small' },\n title: null\n});\n\n const emit = defineEmits([\"update:is-open\", \"expand\"]);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const titleId = generateUid('inspectorTitle');\n const lastFocusedElement = ref<HTMLElement>(null);\n\n const conditionalClass = computed(() => ({\n [`b-inspector--${props.size}`]: true,\n }));\n\n const setFocus = () => {\n if (props.isOpen) {\n lastFocusedElement.value = document.activeElement as HTMLElement;\n } else {\n // This doesn't work with data grid cell actions, as the button gets destroyed once is not being hovered.\n // To be reviewed after LevelAccess revision\n lastFocusedElement.value?.focus();\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Inspector allows users to access additional information or details of an object/item. The inspector opens adjacent to the main content, pushing it aside to maintain visibility and accessibility to both the main content and inspector.\n *\n * @example\n * import { BentoInspector } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoInspector },\n * template: `\n * <bento-inspector\n * title=\"Inspector\"\n * size=\"large\"\n * :is-open=\"isOpen\"\n * @update:is-open=\"isOpen = $event\"\n * >\n * <template #page>Content of the page</template>\n * <template #content>Content of the inspector</template>\n * </bento-inspector>\n * `\n * }\n */\n export default { i18n: { messages } };\n</script>\n\n<style lang=\"scss\" scoped src=\"./inspector.scss\" />\n","export const BentoInspectorSizeOptions = ['small', 'large'] as const;\n\nexport type BentoInspectorSize = (typeof BentoInspectorSizeOptions)[number];\n"],"names":["__default__","messages","t","useI18n","titleId","generateUid","lastFocusedElement","ref","conditionalClass","computed","props","_a","BentoInspectorSizeOptions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;GAmGIA,IAAA,EAAA,MAAA,EAAA,UAAAC,EAAA,EAAA;;;;;;;;;;;;iBAzCA,EAAA,GAAAC,EAAA,IAAAC,EAAA,GACAC,IAAAC,EAAA,gBAAA,GACAC,IAAAC,EAAA,IAAA,GAEAC,IAAAC,EAAA,OAAA;AAAA,MAAyC,CAAA,gBAAAC,EAAA,IAAA,EAAA,GAAA;AAAA,IACL,EAAA;mHAGpC,MAAA;;AACI,MAAAA,EAAA,SACIJ,EAAA,QAAA,SAAA,iBAIAK,IAAAL,EAAA,UAAA,QAAAK,EAAA;AAAA,IACJ;;;;;;;;;;;;;;;;;;;;;;qBCzEKC,IAAA,CAAA,SAAA,OAAA;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as y, provide as R, toRef as $, computed as s, useSlots as x, inject as E, ref as _, watch as S, nextTick as g, onMounted as z } from "vue";
|
|
2
2
|
import { n as w } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
3
|
-
import { B as T } from "./typography.
|
|
3
|
+
import { B as T } from "./typography.J1v_SPG3.js";
|
|
4
4
|
import { u as B } from "./use-has-slot.C9lQZ6nz.js";
|
|
5
|
-
import { d as I } from "./index.
|
|
5
|
+
import { d as I } from "./index.D8ivUe7P.js";
|
|
6
6
|
import "../assets/layout-row.css";
|
|
7
7
|
const h = Symbol("Layout size inject key"), O = {}, P = /* @__PURE__ */ y({
|
|
8
8
|
...O,
|
|
@@ -70,18 +70,18 @@ const Z = M.exports, W = ["3-9", "9-3", "4-8", "8-4", "6-6"], j = {}, N = /* @__
|
|
|
70
70
|
});
|
|
71
71
|
var Y = function() {
|
|
72
72
|
var o = this, l = o._self._c, t = o._self._setupProxy;
|
|
73
|
-
return l(t.BentoTypography, { staticClass: "b-layout-row", class: t.conditionalRowClass, attrs: { el: "div"
|
|
73
|
+
return l(t.BentoTypography, { staticClass: "b-layout-row", class: t.conditionalRowClass, attrs: { el: "div" } }, [t.hasSlot("default") ? l("div", [o._t("default")], 2) : t.hasSlot("col-1") && t.hasSlot("col-2") ? l("div", { ref: "row", class: t.conditionalRowWithColumnsClass }, [l("div", { ref: "col1", class: t.conditionalColumnClass.col1 }, [o._t("col-1")], 2), l("div", { ref: "col2", class: t.conditionalColumnClass.col2 }, [o._t("col-2")], 2)]) : o._e()]);
|
|
74
74
|
}, A = [], H = /* @__PURE__ */ w(
|
|
75
75
|
N,
|
|
76
76
|
Y,
|
|
77
77
|
A,
|
|
78
78
|
!1,
|
|
79
79
|
null,
|
|
80
|
-
"
|
|
80
|
+
"3dbcb27f"
|
|
81
81
|
);
|
|
82
82
|
const q = H.exports;
|
|
83
83
|
export {
|
|
84
84
|
q as a,
|
|
85
85
|
Z as l
|
|
86
86
|
};
|
|
87
|
-
//# sourceMappingURL=layout-row.
|
|
87
|
+
//# sourceMappingURL=layout-row.BfS-cPky.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-row.BfS-cPky.js","sources":["../../src/components/layout/layout.keys.ts","../../src/components/layout/layout.vue","../../src/components/layout/layout.types.ts","../../src/components/layout/components/layout-row/layout-row.vue"],"sourcesContent":["export const LAYOUT_SIZE_INJECTION_KEY = Symbol('Layout size inject key');\n","<template>\n <component :is=\"wrapperElement\" class=\"b-layout\" :class=\"conditionalClasses\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, provide, toRef } from 'vue';\n import { BentoLayoutProps } from './layout.types';\n import { LAYOUT_SIZE_INJECTION_KEY } from '@/components/layout/layout.keys';\n\n const props = defineProps({\n variant: { default: 'page' },\n size: { default: 'full-width' }\n});\n\n provide(LAYOUT_SIZE_INJECTION_KEY, toRef(props, 'size'));\n\n const conditionalClasses = computed(() => ({\n 'b-layout--component': props.variant === 'component',\n }));\n\n const wrapperElement = props.variant === 'page' ? 'main' : 'div';\n</script>\n\n<script lang=\"ts\">\n /**\n * Layout is a basic scaffolding of a page that defines spacing, some functionality and responsive behaviour of its top level sections.\n *\n * @example\n * import { BentoLayout, BentoLayoutRow } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoLayout, BentoLayoutRow },\n * template: `\n * <bento-layout size=\"narrow\">\n * <bento-layout-row>\n * Row 1\n * </bento-layout-row>\n * <bento-layout-row>\n * Row 2\n * </bento-layout-row>\n * </bento-layout>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./layout.scss\" />\n","/**\n * @private\n */\nexport const BentoLayoutVariantOptions = ['page', 'component'] as const;\nexport const BentoLayoutSizeOptions = ['full-width', 'narrow', 'half-width'] as const;\nexport const BentoLayoutRowColumnLayoutOptions = ['3-9', '9-3', '4-8', '8-4', '6-6'] as const;\n\n// Public\nexport type BentoLayoutVariant = (typeof BentoLayoutVariantOptions)[number];\nexport type BentoLayoutSize = (typeof BentoLayoutSizeOptions)[number];\nexport type BentoLayoutRowColumnLayout = (typeof BentoLayoutRowColumnLayoutOptions)[number];\n\nexport interface BentoLayoutProps {\n /** Defines if the layout is used in a page or only a section */\n variant?: BentoLayoutVariant;\n /** Defines the size of the page */\n size?: BentoLayoutSize;\n}\n\nexport interface BentoLayoutRowProps {\n /** Sets the layout of the columns when multiple columns are used */\n columnsLayout?: BentoLayoutRowColumnLayout;\n}\n","<template>\n <bento-typography el=\"div\" class=\"b-layout-row\" :class=\"conditionalRowClass\">\n <div v-if=\"hasSlot('default')\">\n <slot />\n </div>\n <div v-else-if=\"hasSlot('col-1') && hasSlot('col-2')\" ref=\"row\" :class=\"conditionalRowWithColumnsClass\">\n <div ref=\"col1\" :class=\"conditionalColumnClass.col1\">\n <slot name=\"col-1\"></slot>\n </div>\n <div ref=\"col2\" :class=\"conditionalColumnClass.col2\">\n <slot name=\"col-2\"></slot>\n </div>\n </div>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, nextTick, onMounted, ref, Ref, useSlots, watch } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n import {\n BentoLayoutRowColumnLayoutOptions,\n type BentoLayoutRowProps,\n type BentoLayoutSize,\n } from '../../layout.types';\n import { useMediaQuery } from '@vueuse/core';\n\n import { LAYOUT_SIZE_INJECTION_KEY } from '@/components/layout/layout.keys';\n\n const props = defineProps({\n columnsLayout: { default: '6-6' }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const size = inject<Ref<BentoLayoutSize>>(LAYOUT_SIZE_INJECTION_KEY, ref('full-width'));\n\n const row = ref<HTMLElement>(null);\n const col1 = ref<HTMLElement>(null);\n const col2 = ref<HTMLElement>(null);\n\n const isFullWidth = computed(() => size.value === 'full-width');\n const isValidColumnLayout = computed(() => BentoLayoutRowColumnLayoutOptions.includes(props.columnsLayout));\n\n const conditionalRowClass = computed(() => `b-layout-row--${size.value}`);\n\n const conditionalRowWithColumnsClass = computed(() => ({\n 'b-layout-row__column-wrapper': isFullWidth.value,\n }));\n\n const conditionalColumnClass = computed(() => {\n const columns = isValidColumnLayout.value ? props.columnsLayout.split('-') : [6, 6];\n const getColumnModifier = index => (isFullWidth.value ? columns[index] : size.value);\n\n return {\n col1: `b-layout-row__column--${getColumnModifier(0)}`,\n col2: `b-layout-row__column--${getColumnModifier(1)}`,\n };\n });\n\n watch(\n useMediaQuery('(min-width: 768px)'),\n async isLargeScreen => {\n await nextTick();\n const areColumnsInTheRightOrder = row.value?.firstChild === col1.value;\n if (isLargeScreen && !areColumnsInTheRightOrder) {\n row.value?.prepend(col1.value);\n } else if (!isLargeScreen && (props.columnsLayout === '3-9' || props.columnsLayout === '4-8')) {\n row.value?.prepend(col2.value);\n }\n },\n { immediate: true }\n );\n\n onMounted(() => {\n if (!isFullWidth.value && (hasSlot('col-1') || hasSlot('col-2'))) {\n throw new Error(\n 'Column slots can only be used with the `full-width` size. Please check documentation for more info.'\n );\n }\n\n if (!isValidColumnLayout.value) {\n throw new Error(\n `${props.columnsLayout} is not a valid column layout. Please refer to the documentation for the list of available column layouts.`\n );\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Page row is subcomponent of Layout meant to be used to generate the row layout.\n *\n * @example\n * import { BentoLayout, BentoLayoutRow } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoLayout, BentoLayoutRow },\n * template: `\n * <bento-layout>\n * <bento-layout-row columns-layout=\"3-9\">\n * <template #col-1>Narrow 3-9</template>\n * <template #col-2>Wide 3-9</template>\n * </bento-layout-row>\n * <bento-layout-row>\n * <template #col-1>6-6</template>\n * <template #col-2>6-6</template>\n * </bento-layout-row>\n * </bento-layout>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./layout-row.scss\" />\n"],"names":["LAYOUT_SIZE_INJECTION_KEY","__default__$1","provide","toRef","props","conditionalClasses","computed","wrapperElement","BentoLayoutRowColumnLayoutOptions","__default__","slots","useSlots","hasSlot","useHasSlot","size","inject","ref","row","col1","col2","isFullWidth","isValidColumnLayout","conditionalRowClass","conditionalRowWithColumnsClass","conditionalColumnClass","columns","getColumnModifier","index","watch","useMediaQuery","isLargeScreen","nextTick","areColumnsInTheRightOrder","_a","_b","_c","onMounted"],"mappings":";;;;;;AAAa,MAAAA,IAAA,OAAA,wBAAA,GC8CTC,IAAA,CAAA;;;;;;;;;AA9BA,IAAAC,EAAAF,GAAAG,EAAAC,GAAA,MAAA,CAAA;AAEA,UAAAC,IAAAC,EAAA,OAAA;AAAA,MAA2C,uBAAAF,EAAA,YAAA;AAAA,IACE,EAAA,GAG7CG,IAAAH,EAAA,YAAA,SAAA,SAAA;;;;;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,MAAA;AACI,UAAA,CAAAhB,EAAA,UAAAR,EAAA,OAAA,KAAAA,EAAA,OAAA;AACI,cAAA,IAAA;AAAA,UAAU;AAAA,QACN;AAIR,UAAA,CAAAS,EAAA;AACI,cAAA,IAAA;AAAA,UAAU,GAAAjB,EAAA,aAAA;AAAA,QACgB;AAAA,IAE9B,CAAA;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as f, computed as l } from "vue";
|
|
2
2
|
import { RouterLink as d } from "vue-router";
|
|
3
|
-
import { B as g } from "./typography.
|
|
3
|
+
import { B as g } from "./typography.J1v_SPG3.js";
|
|
4
4
|
import { n as p } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
5
5
|
import "../assets/link.css";
|
|
6
6
|
var s = /* @__PURE__ */ ((a) => (a.DEFAULT = "default", a.QUIET = "quiet", a))(s || {});
|
|
@@ -21,11 +21,11 @@ var v = function() {
|
|
|
21
21
|
null,
|
|
22
22
|
null
|
|
23
23
|
);
|
|
24
|
-
const h = k.exports,
|
|
24
|
+
const h = k.exports, b = {
|
|
25
25
|
name: "bento-link",
|
|
26
26
|
inheritAttrs: !1
|
|
27
|
-
},
|
|
28
|
-
...
|
|
27
|
+
}, x = /* @__PURE__ */ f({
|
|
28
|
+
...b,
|
|
29
29
|
props: {
|
|
30
30
|
to: null,
|
|
31
31
|
replace: { type: Boolean },
|
|
@@ -64,12 +64,12 @@ var C = function() {
|
|
|
64
64
|
return n.onClick.apply(null, arguments);
|
|
65
65
|
} } }, "router-link", { ...t.$attrs, ...t.$props }, !1), [t.disableTypography ? t._t("default") : e(n.BentoTypography, { staticClass: "b-link__text", attrs: { el: "span", variant: "body" } }, [t._t("default")], 2)], 2);
|
|
66
66
|
}, B = [], T = /* @__PURE__ */ p(
|
|
67
|
-
|
|
67
|
+
x,
|
|
68
68
|
C,
|
|
69
69
|
B,
|
|
70
70
|
!1,
|
|
71
71
|
null,
|
|
72
|
-
"
|
|
72
|
+
"e0617c9b"
|
|
73
73
|
);
|
|
74
74
|
const I = T.exports;
|
|
75
75
|
export {
|
|
@@ -77,4 +77,4 @@ export {
|
|
|
77
77
|
h as E,
|
|
78
78
|
s as a
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=link.
|
|
80
|
+
//# sourceMappingURL=link.UOEUR35A.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.
|
|
1
|
+
{"version":3,"file":"link.UOEUR35A.js","sources":["../../../core/src/components/link/link.types.ts","../../../../node_modules/.pnpm/@adyen+ui-assets-icons-16@4.1.0_vue@2.7.16/node_modules/@adyen/ui-assets-icons-16/dist/vue/external-link.vue","../../src/components/link/link.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoLinkVariant {\n DEFAULT = 'default',\n QUIET = 'quiet',\n}\n\nexport interface LinkProps {\n /**\n * Disable the default typography for the component. Only use this when the component is inside another typography component.\n */\n disableTypography?: boolean;\n\n /**\n * Set the rendered link to a regular external anchor link and renders an external link icon.\n */\n external?: boolean;\n\n /**\n * Set to true if used inside a `BentoButton` component.\n */\n isButton?: boolean;\n\n /**\n * Set the rendered link to a regular external anchor link.\n */\n isNotRouting?: boolean;\n\n /**\n * Sets the target of the rendered link.\n */\n target?: string;\n\n /**\n * Set to true to truncate link. Doesn't work with disableTypography.\n */\n truncate?: boolean;\n\n /**\n * Link variant type affecting visual style.\n * @values default, quiet\n */\n variant?: BentoLinkVariant | `${BentoLinkVariant}`;\n}\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#00112C\" d=\"M2.93933 11.9999L10.1893 4.74989H5.24999V3.24989H12.75V10.7499H11.25V5.81055L3.99999 13.0605L2.93933 11.9999Z\"/></svg>\n</template>\n<script>\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n<style>\n @import '../css/main.css';\n</style>\n","<template>\n <a\n v-if=\"external || isNotRouting\"\n :class=\"conditionalClasses\"\n v-bind=\"$attrs\"\n :href=\"$props.to.toString()\"\n :title=\"getAttributeTitle($attrs.title)\"\n :target=\"computedTarget\"\n @click=\"onClick\"\n >\n <bento-typography v-if=\"!disableTypography\" class=\"b-link__text\" el=\"span\" variant=\"body\">\n <slot />\n </bento-typography>\n <slot v-else />\n <span v-if=\"showExternalLinkIcon\" class=\"b-link__external-link-icon\">\n <external-link-icon />\n </span>\n </a>\n <router-link\n v-else\n v-bind=\"{ ...$attrs, ...$props }\"\n :class=\"conditionalClasses\"\n :target=\"target\"\n :to=\"props.to\"\n custom\n @click.native=\"onClick\"\n >\n <bento-typography v-if=\"!disableTypography\" class=\"b-link__text\" el=\"span\" variant=\"body\">\n <slot />\n </bento-typography>\n <slot v-else />\n </router-link>\n</template>\n\n<script setup lang=\"ts\">\n import { RouterLink } from 'vue-router';\n import { computed } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoLinkVariant } from '@/core/components/link/link.types';\n import type { RouterLinkSlotArgument } from 'vue-router/types/router.d.ts';\n import ExternalLinkIcon from '@adyen/ui-assets-icons-16/vue/external-link';\n import type { BentoLinkProps } from './link.types';\n\n const props = defineProps({\n to: null,\n replace: { type: Boolean },\n append: { type: Boolean },\n tag: null,\n activeClass: null,\n exact: { type: Boolean },\n exactPath: { type: Boolean },\n exactPathActiveClass: null,\n event: null,\n exactActiveClass: null,\n ariaCurrentValue: null,\n disableTypography: { type: Boolean },\n external: { type: Boolean },\n isButton: { type: Boolean },\n isNotRouting: { type: Boolean },\n target: { default: null },\n truncate: { type: Boolean },\n variant: { default: BentoLinkVariant.DEFAULT }\n});\n\n const getAttributeTitle = (attributesTitle: unknown) => attributesTitle as string;\n\n const conditionalClasses = computed(() => ({\n 'b-link': !props.isButton,\n [`b-link--${BentoLinkVariant.QUIET}`]: props.variant === BentoLinkVariant.QUIET,\n [`b-link--truncate`]: props.truncate,\n }));\n\n const computedTarget = computed(() => (props.external ? props.target ?? '_blank' : props.target));\n const showExternalLinkIcon = computed(() => !(props.isButton || props.isNotRouting));\n\n const emit = defineEmits([\"click\"]);\n\n const onClick = (e: MouseEvent, navigateCallback?: RouterLinkSlotArgument['navigate']) => {\n emit('click', e);\n if (navigateCallback) {\n navigateCallback();\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Extends the `router-link` from the `vue-router` NPM package.\n *\n * @example\n * import { BentoLink } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoLink },\n * template: `\n * <bento-link to=\"/\">\n * link\n * </bento-link>\n * `\n * }\n */\n export default {\n name: 'bento-link',\n inheritAttrs: false,\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/link/link.scss\" />\n"],"names":["BentoLinkVariant","BentoLinkVariant2","uuid","_sfc_main$1","__default__","getAttributeTitle","attributesTitle","conditionalClasses","computed","props","computedTarget","showExternalLinkIcon","e","navigateCallback","emit"],"mappings":";;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;ACEZ,IAAAE,IAAA;AAEA,MAAAC,IAAA;AAAA,EACA,eAAA;AACA,SAAA,OAAAD,EAAA,SAAA,GACAA,KAAA;AAAA,EACA;AACA;;;;;;;;;;;;qBCyFIE,IAAA;AAAA,EAAe,MAAA;AAAA,EACL,cAAA;AAEV;;;;;;;;;;;;;;;;;;;;;;;;iBAxCAC,IAAA,CAAAC,MAAAA,GAEAC,IAAAC,EAAA,OAAA;AAAA,MAA2C,UAAA,CAAAC,EAAA;AAAA,MACtB,CAAA,WAAAT,EAAA,KAAA,EAAA,GAAAS,EAAA,YAAAT,EAAA;AAAA,MACyD,oBAAAS,EAAA;AAAA,IAC9C,EAAA,GAGhCC,IAAAF,EAAA,MAAAC,EAAA,WAAAA,EAAA,UAAA,WAAAA,EAAA,MAAA,GACAE,IAAAH,EAAA,MAAA,EAAAC,EAAA,YAAAA,EAAA,aAAA;6IAIA,CAAAG,GAAAC,MAAA;AACI,MAAAC,EAAA,SAAAF,CAAA,GACAC,KACIA,EAAA;AAAA,IACJ;;;;;;;;;;;;;;;;;","x_google_ignoreList":[1]}
|