@adyen/bento-vue3 1.88.1 → 1.89.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/components.d.ts +4 -0
- package/dist/@types/index.d.ts +722 -524
- package/dist/accordion.js +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/ai-tag.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/anchor-scroller.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/ai-button.css +1 -1
- package/dist/assets/base-modal.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-input.css +1 -1
- package/dist/assets/data-grid-template.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/list-item.css +1 -0
- package/dist/assets/modal-fullscreen.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/timeline-item.css +1 -1
- package/dist/assets/use-cached-selected-values.css +1 -1
- package/dist/button.js +3 -3
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chip.js +1 -1
- package/dist/chunks/{accordion-item.QQ06tTjt.js → accordion-item.BX1KrLMl.js} +6 -15
- package/dist/chunks/{accordion-item.QQ06tTjt.js.map → accordion-item.BX1KrLMl.js.map} +1 -1
- package/dist/chunks/{action-bar.BS2cJzG_.js → action-bar.DLMaIUWW.js} +8 -34
- package/dist/chunks/{action-bar.BS2cJzG_.js.map → action-bar.DLMaIUWW.js.map} +1 -1
- package/dist/chunks/{ai-button.XfeGC4-Q.js → ai-button.1YJdI-sw.js} +3 -3
- package/dist/chunks/{ai-button.XfeGC4-Q.js.map → ai-button.1YJdI-sw.js.map} +1 -1
- package/dist/chunks/{ai-tag.DVCW-_vD.js → ai-tag.DK63ExDc.js} +6 -15
- package/dist/chunks/{ai-tag.DVCW-_vD.js.map → ai-tag.DK63ExDc.js.map} +1 -1
- package/dist/chunks/{alert.CDWtu0Hu.js → alert.C_8-VNi_.js} +6 -24
- package/dist/chunks/{alert.CDWtu0Hu.js.map → alert.C_8-VNi_.js.map} +1 -1
- package/dist/chunks/anchor-scroller.NhjLDBZI.js +207 -0
- package/dist/chunks/{anchor-scroller.BctgW0se.js.map → anchor-scroller.NhjLDBZI.js.map} +1 -1
- package/dist/chunks/{base-button.CRYAiuzn.js → base-button.CvHl36Ue.js} +24 -27
- package/dist/chunks/{base-button.CRYAiuzn.js.map → base-button.CvHl36Ue.js.map} +1 -1
- package/dist/chunks/base-modal.C2-JyHC_.js +424 -0
- package/dist/chunks/{base-modal.gZAtk-xP.js.map → base-modal.C2-JyHC_.js.map} +1 -1
- package/dist/chunks/button-actions-with-menu.BQFAgAI2.js +85 -0
- package/dist/chunks/{button-actions-with-menu.Tba1ME79.js.map → button-actions-with-menu.BQFAgAI2.js.map} +1 -1
- package/dist/chunks/{button-actions.BYBpjNqy.js → button-actions.cMQWyZne.js} +511 -542
- package/dist/chunks/{button-actions.BYBpjNqy.js.map → button-actions.cMQWyZne.js.map} +1 -1
- package/dist/chunks/{button.C6t9_lzm.js → button.DWF7FSIw.js} +42 -45
- package/dist/chunks/{button.C6t9_lzm.js.map → button.DWF7FSIw.js.map} +1 -1
- package/dist/chunks/calendar.DcCqkSNJ.js +1201 -0
- package/dist/chunks/{calendar.vM3abC8y.js.map → calendar.DcCqkSNJ.js.map} +1 -1
- package/dist/chunks/{card.Cw63i7Ul.js → card.CoxQ_L0w.js} +9 -21
- package/dist/chunks/{card.Cw63i7Ul.js.map → card.CoxQ_L0w.js.map} +1 -1
- package/dist/chunks/{checkbox-group.ODQy-ICn.js → checkbox-group.96n9Cc3W.js} +5 -5
- package/dist/chunks/{checkbox-group.ODQy-ICn.js.map → checkbox-group.96n9Cc3W.js.map} +1 -1
- package/dist/chunks/{checkbox-input.BZjSoCQW.js → checkbox-input.CVFQCfZM.js} +44 -51
- package/dist/chunks/{checkbox-input.BZjSoCQW.js.map → checkbox-input.CVFQCfZM.js.map} +1 -1
- package/dist/chunks/{checkbox.C3Ewfygy.js → checkbox.C6ATh8f5.js} +85 -94
- package/dist/chunks/{checkbox.C3Ewfygy.js.map → checkbox.C6ATh8f5.js.map} +1 -1
- package/dist/chunks/chevron-right-small.BCinNiMt.js +29 -0
- package/dist/chunks/chevron-right-small.BCinNiMt.js.map +1 -0
- package/dist/chunks/{chip.CyW1V8RU.js → chip.CdgpQyXN.js} +6 -12
- package/dist/chunks/{chip.CyW1V8RU.js.map → chip.CdgpQyXN.js.map} +1 -1
- package/dist/chunks/click-outside.BPylIosK.js +20 -0
- package/dist/chunks/{click-outside.CDz_x8mN.js.map → click-outside.BPylIosK.js.map} +1 -1
- package/dist/chunks/{code-snippet.BaJU2I5_.js → code-snippet.DgAuuZF5.js} +9 -24
- package/dist/chunks/{code-snippet.BaJU2I5_.js.map → code-snippet.DgAuuZF5.js.map} +1 -1
- package/dist/chunks/{codemirror.D2BAltnu.js → codemirror.Bzus_EPG.js} +15 -15
- package/dist/chunks/{codemirror.D2BAltnu.js.map → codemirror.Bzus_EPG.js.map} +1 -1
- package/dist/chunks/constructNow.D9uRk678.js +8 -0
- package/dist/chunks/{constructNow.CIc7d13I.js.map → constructNow.D9uRk678.js.map} +1 -1
- package/dist/chunks/{controls-group.Bu5lNTyH.js → controls-group.C7hOE1F4.js} +3 -3
- package/dist/chunks/{controls-group.Bu5lNTyH.js.map → controls-group.C7hOE1F4.js.map} +1 -1
- package/dist/chunks/{copy.C_BCNHYQ.js → copy.C2kQ1PbI.js} +7 -19
- package/dist/chunks/{copy.C_BCNHYQ.js.map → copy.C2kQ1PbI.js.map} +1 -1
- package/dist/chunks/{country.DJts6kCv.js → country.CaGc08Ps.js} +3 -3
- package/dist/chunks/{country.DJts6kCv.js.map → country.CaGc08Ps.js.map} +1 -1
- package/dist/chunks/country.types.DjpMGz7a.js +19 -0
- package/dist/chunks/{country.types.BBQbWkTY.js.map → country.types.DjpMGz7a.js.map} +1 -1
- package/dist/chunks/{currency.Afx8MVdY.js → currency.DuTEzR_W.js} +40 -42
- package/dist/chunks/{currency.Afx8MVdY.js.map → currency.DuTEzR_W.js.map} +1 -1
- package/dist/chunks/dashboard-section.UafHRkMa.js +161 -0
- package/dist/chunks/{dashboard-section.CgoLquLP.js.map → dashboard-section.UafHRkMa.js.map} +1 -1
- package/dist/chunks/dashed-underline.CcDV2Aks.js +108 -0
- package/dist/chunks/{dashed-underline.wbRHATeE.js.map → dashed-underline.CcDV2Aks.js.map} +1 -1
- package/dist/chunks/data-grid-template.CnC4TQvk.js +135 -0
- package/dist/chunks/{data-grid-template.D40V1cmi.js.map → data-grid-template.CnC4TQvk.js.map} +1 -1
- package/dist/chunks/data-grid.BSIXLRm7.js +4014 -0
- package/dist/chunks/{data-grid.C2nCCbeC.js.map → data-grid.BSIXLRm7.js.map} +1 -1
- package/dist/chunks/date-picker.dlzZ_-5f.js +231 -0
- package/dist/chunks/{date-picker.D5B_SECc.js.map → date-picker.dlzZ_-5f.js.map} +1 -1
- package/dist/chunks/date-range-picker.DC6CK0As.js +995 -0
- package/dist/chunks/{date-range-picker.B0q7Z4df.js.map → date-range-picker.DC6CK0As.js.map} +1 -1
- package/dist/chunks/{date.BtB1HyWQ.js → date.R2Wz6o7J.js} +28 -28
- package/dist/chunks/{date.BtB1HyWQ.js.map → date.R2Wz6o7J.js.map} +1 -1
- package/dist/chunks/{de.BJvo6njq.js → de.DXrHnkLX.js} +18 -18
- package/dist/chunks/{de.BJvo6njq.js.map → de.DXrHnkLX.js.map} +1 -1
- package/dist/chunks/{dialog-page.C1KUI51V.js → dialog-page.COfKqjT-.js} +7 -13
- package/dist/chunks/{dialog-page.C1KUI51V.js.map → dialog-page.COfKqjT-.js.map} +1 -1
- package/dist/chunks/differenceInMonths.s_znQQpw.js +43 -0
- package/dist/chunks/{differenceInMonths.CIYECBxK.js.map → differenceInMonths.s_znQQpw.js.map} +1 -1
- package/dist/chunks/{directive.rXUeDb8p.js → directive.Dpivxq_t.js} +2 -2
- package/dist/chunks/{directive.rXUeDb8p.js.map → directive.Dpivxq_t.js.map} +1 -1
- package/dist/chunks/{dropdown-default-textbox.CskseEho.js → dropdown-default-textbox.bq9AlGzJ.js} +55 -64
- package/dist/chunks/{dropdown-default-textbox.CskseEho.js.map → dropdown-default-textbox.bq9AlGzJ.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.Zj-exiup.js → dropdown-tag.Ysrac5GN.js} +82 -86
- package/dist/chunks/{dropdown-tag.Zj-exiup.js.map → dropdown-tag.Ysrac5GN.js.map} +1 -1
- package/dist/chunks/dropdown.MhmX1P9o.js +799 -0
- package/dist/chunks/{dropdown.CxjzXI-k.js.map → dropdown.MhmX1P9o.js.map} +1 -1
- package/dist/chunks/{empty-state.DqdPzU-g.js → empty-state.DT4sFyjB.js} +7 -14
- package/dist/chunks/{empty-state.DqdPzU-g.js.map → empty-state.DT4sFyjB.js.map} +1 -1
- package/dist/chunks/{en-GB.C3-QUpva.js → en-GB.CBpvhDYV.js} +2 -2
- package/dist/chunks/{en-GB.C3-QUpva.js.map → en-GB.CBpvhDYV.js.map} +1 -1
- package/dist/chunks/{en-US.YeSsZuOc.js → en-US.CCazFVNP.js} +30 -30
- package/dist/chunks/{en-US.YeSsZuOc.js.map → en-US.CCazFVNP.js.map} +1 -1
- package/dist/chunks/{error-message.oGiefI2-.js → error-message.DCgo8q20.js} +8 -20
- package/dist/chunks/{error-message.oGiefI2-.js.map → error-message.DCgo8q20.js.map} +1 -1
- package/dist/chunks/{es.DyUjjSL8.js → es.CoF2PB8b.js} +14 -14
- package/dist/chunks/{es.DyUjjSL8.js.map → es.CoF2PB8b.js.map} +1 -1
- package/dist/chunks/{file-uploader.BnmNI1O7.js → file-uploader.Bfd1uUMe.js} +575 -680
- package/dist/chunks/{file-uploader.BnmNI1O7.js.map → file-uploader.Bfd1uUMe.js.map} +1 -1
- package/dist/chunks/filter-bar.CkAjLQol.js +3675 -0
- package/dist/chunks/filter-bar.CkAjLQol.js.map +1 -0
- package/dist/chunks/fixed-scroller.DtkaGyMD.js +150 -0
- package/dist/chunks/{fixed-scroller.i1tmEmst.js.map → fixed-scroller.DtkaGyMD.js.map} +1 -1
- package/dist/chunks/{focus-trap.BxCwzLqN.js → focus-trap.BAiM_ywb.js} +70 -86
- package/dist/chunks/{focus-trap.BxCwzLqN.js.map → focus-trap.BAiM_ywb.js.map} +1 -1
- package/dist/chunks/{footer-actions.Ck6UztD8.js → footer-actions.BcYSsoUg.js} +3 -3
- package/dist/chunks/{footer-actions.Ck6UztD8.js.map → footer-actions.BcYSsoUg.js.map} +1 -1
- package/dist/chunks/{form-layout-title.CQfeGyVw.js → form-layout-title.DW5Kg1rh.js} +4 -6
- package/dist/chunks/{form-layout-title.CQfeGyVw.js.map → form-layout-title.DW5Kg1rh.js.map} +1 -1
- package/dist/chunks/{fr.JD_4GwS8.js → fr.CJXL-Ief.js} +16 -16
- package/dist/chunks/{fr.JD_4GwS8.js.map → fr.CJXL-Ief.js.map} +1 -1
- package/dist/chunks/{generate-uid.NJ8tVoha.js → generate-uid.DBWe4g6T.js} +15 -16
- package/dist/chunks/{generate-uid.NJ8tVoha.js.map → generate-uid.DBWe4g6T.js.map} +1 -1
- package/dist/chunks/get-slot-text.8Fbl1GOr.js +6 -0
- package/dist/chunks/{get-slot-text.CQRAP2_q.js.map → get-slot-text.8Fbl1GOr.js.map} +1 -1
- package/dist/chunks/{grid-layout.Vhv1_zFs.js → grid-layout.CCWNscU_.js} +11 -12
- package/dist/chunks/{grid-layout.Vhv1_zFs.js.map → grid-layout.CCWNscU_.js.map} +1 -1
- package/dist/chunks/{header-meta.lGt3HsyH.js → header-meta.Bym9AlQm.js} +84 -96
- package/dist/chunks/{header-meta.lGt3HsyH.js.map → header-meta.Bym9AlQm.js.map} +1 -1
- package/dist/chunks/{header-with-views.D_sy4I2A.js → header-with-views.Djba6iol.js} +1013 -1156
- package/dist/chunks/{header-with-views.D_sy4I2A.js.map → header-with-views.Djba6iol.js.map} +1 -1
- package/dist/chunks/{header.oXqwf2xN.js → header.o-7SyHtU.js} +4 -4
- package/dist/chunks/{header.oXqwf2xN.js.map → header.o-7SyHtU.js.map} +1 -1
- package/dist/chunks/{index.Dppy4qHk.js → index.DDwcHPb6.js} +12 -12
- package/dist/chunks/{index.Dppy4qHk.js.map → index.DDwcHPb6.js.map} +1 -1
- package/dist/chunks/{info-icon.DyPOv7Pi.js → info-icon.BUala_wq.js} +3 -3
- package/dist/chunks/{info-icon.DyPOv7Pi.js.map → info-icon.BUala_wq.js.map} +1 -1
- package/dist/chunks/input-field-password.DZytmp_p.js +346 -0
- package/dist/chunks/{input-field-password.C_h61CMn.js.map → input-field-password.DZytmp_p.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.KctRYA9p.js → input-field-phone-number.CxblrmaU.js} +720 -736
- package/dist/chunks/{input-field-phone-number.KctRYA9p.js.map → input-field-phone-number.CxblrmaU.js.map} +1 -1
- package/dist/chunks/{input-field.DPElUS0U.js → input-field.CfU0ZKtL.js} +42 -54
- package/dist/chunks/{input-field.DPElUS0U.js.map → input-field.CfU0ZKtL.js.map} +1 -1
- package/dist/chunks/{inspector.BjLhY3bE.js → inspector.B9k4tJWe.js} +9 -27
- package/dist/chunks/{inspector.BjLhY3bE.js.map → inspector.B9k4tJWe.js.map} +1 -1
- package/dist/chunks/isSameWeek.Dj6luS8h.js +14 -0
- package/dist/chunks/{isSameWeek.CzBCmu7d.js.map → isSameWeek.Dj6luS8h.js.map} +1 -1
- package/dist/chunks/{it.BlUnV-yA.js → it.20Y7h-bF.js} +8 -8
- package/dist/chunks/{it.BlUnV-yA.js.map → it.20Y7h-bF.js.map} +1 -1
- package/dist/chunks/{ja.nUwDmVf2.js → ja.DXlq0H98.js} +27 -27
- package/dist/chunks/{ja.nUwDmVf2.js.map → ja.DXlq0H98.js.map} +1 -1
- package/dist/chunks/layout-row.B5VJGEQH.js +99 -0
- package/dist/chunks/{layout-row.Da8nkm9z.js.map → layout-row.B5VJGEQH.js.map} +1 -1
- package/dist/chunks/link.D6D6YGsN.js +113 -0
- package/dist/chunks/{link.DTCn2EtX.js.map → link.D6D6YGsN.js.map} +1 -1
- package/dist/chunks/list-item.DO5uULke.js +128 -0
- package/dist/chunks/list-item.DO5uULke.js.map +1 -0
- package/dist/chunks/{listbox-option-tag.CoBUYwFG.js → listbox-option-tag.Cvplth7d.js} +2 -2
- package/dist/chunks/{listbox-option-tag.CoBUYwFG.js.map → listbox-option-tag.Cvplth7d.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.9ZDR_S29.js → modal-fullscreen.CuKVyTWb.js} +100 -108
- package/dist/chunks/{modal-fullscreen.9ZDR_S29.js.map → modal-fullscreen.CuKVyTWb.js.map} +1 -1
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.B0IdwV0R.js → modal.vue_vue_type_script_setup_true_lang.DmPw0l5Y.js} +134 -143
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.B0IdwV0R.js.map → modal.vue_vue_type_script_setup_true_lang.DmPw0l5Y.js.map} +1 -1
- package/dist/chunks/on-click-outside.ZUMLlxE_.js +90 -0
- package/dist/chunks/{on-click-outside.BW4rkhzG.js.map → on-click-outside.ZUMLlxE_.js.map} +1 -1
- package/dist/chunks/pagination.dpVc6Yt0.js +401 -0
- package/dist/chunks/pagination.dpVc6Yt0.js.map +1 -0
- package/dist/chunks/popover.types.D8tHtFl3.js +6 -0
- package/dist/chunks/{popover.types.DhALnOLQ.js.map → popover.types.D8tHtFl3.js.map} +1 -1
- package/dist/chunks/{popper-container.DAK7c9uS.js → popper-container.DMN8n5iC.js} +79 -86
- package/dist/chunks/{popper-container.DAK7c9uS.js.map → popper-container.DMN8n5iC.js.map} +1 -1
- package/dist/chunks/{promo-banner.aNwH6uQx.js → promo-banner.BzveHNOI.js} +7 -13
- package/dist/chunks/{promo-banner.aNwH6uQx.js.map → promo-banner.BzveHNOI.js.map} +1 -1
- package/dist/chunks/{pt-BR.BCU2Hj36.js → pt-BR.DmhmCzxE.js} +14 -14
- package/dist/chunks/{pt-BR.BCU2Hj36.js.map → pt-BR.DmhmCzxE.js.map} +1 -1
- package/dist/chunks/{radio-group.DEYzF6o7.js → radio-group.Cuiq4mxy.js} +46 -46
- package/dist/chunks/{radio-group.DEYzF6o7.js.map → radio-group.Cuiq4mxy.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.DH1d5Zcp.js → rich-text-editor.DLMiT4f5.js} +1018 -1024
- package/dist/chunks/{rich-text-editor.DH1d5Zcp.js.map → rich-text-editor.DLMiT4f5.js.map} +1 -1
- package/dist/chunks/{search-bar.Dtzx88Pv.js → search-bar.CsFyP0_I.js} +6 -15
- package/dist/chunks/{search-bar.Dtzx88Pv.js.map → search-bar.CsFyP0_I.js.map} +1 -1
- package/dist/chunks/{secondary-nav.Zs7dBoJv.js → secondary-nav.CLBdq98c.js} +6 -12
- package/dist/chunks/{secondary-nav.Zs7dBoJv.js.map → secondary-nav.CLBdq98c.js.map} +1 -1
- package/dist/chunks/{segmented-control.Aqquod8g.js → segmented-control.KeQ5kuR1.js} +47 -51
- package/dist/chunks/{segmented-control.Aqquod8g.js.map → segmented-control.KeQ5kuR1.js.map} +1 -1
- package/dist/chunks/selection-card-group.XM11Kk-4.js +412 -0
- package/dist/chunks/{selection-card-group.C7IK2Vl5.js.map → selection-card-group.XM11Kk-4.js.map} +1 -1
- package/dist/chunks/{sidepanel.DaXPcTHm.js → sidepanel.b2QZ1Jsx.js} +64 -71
- package/dist/chunks/{sidepanel.DaXPcTHm.js.map → sidepanel.b2QZ1Jsx.js.map} +1 -1
- package/dist/chunks/startOfWeek.Cvmo-f5J.js +9 -0
- package/dist/chunks/{startOfWeek.CXhhX-R7.js.map → startOfWeek.Cvmo-f5J.js.map} +1 -1
- package/dist/chunks/status.H00BAmRx.js +42 -0
- package/dist/chunks/status.H00BAmRx.js.map +1 -0
- package/dist/chunks/status.types.Dx8MDhEH.js +5 -0
- package/dist/chunks/status.types.Dx8MDhEH.js.map +1 -0
- package/dist/chunks/{step.BV7MsrRF.js → step.BlwoLfdw.js} +56 -68
- package/dist/chunks/{step.BV7MsrRF.js.map → step.BlwoLfdw.js.map} +1 -1
- package/dist/chunks/{structured-list-item.DAIaUMCY.js → structured-list-item.e-8kRleh.js} +8 -14
- package/dist/chunks/{structured-list-item.DAIaUMCY.js.map → structured-list-item.e-8kRleh.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.BZcZS_dW.js → summary-grid.types.CcvOC03H.js} +172 -179
- package/dist/chunks/{summary-grid.types.BZcZS_dW.js.map → summary-grid.types.CcvOC03H.js.map} +1 -1
- package/dist/chunks/tab.mR5uUSdp.js +265 -0
- package/dist/chunks/{tab.DRrnMCxe.js.map → tab.mR5uUSdp.js.map} +1 -1
- package/dist/chunks/{tag.CqWg6C3H.js → tag.DujMVFh-.js} +3 -3
- package/dist/chunks/{tag.CqWg6C3H.js.map → tag.DujMVFh-.js.map} +1 -1
- package/dist/chunks/textarea.CHV6Z8nt.js +247 -0
- package/dist/chunks/{textarea.CvI2InIB.js.map → textarea.CHV6Z8nt.js.map} +1 -1
- package/dist/chunks/timeline-item.CaGcRZbt.js +419 -0
- package/dist/chunks/timeline-item.CaGcRZbt.js.map +1 -0
- package/dist/chunks/{toast.Bbtq3Icj.js → toast.C2oehk9P.js} +72 -78
- package/dist/chunks/{toast.Bbtq3Icj.js.map → toast.C2oehk9P.js.map} +1 -1
- package/dist/chunks/{toggle.BupEBkIG.js → toggle.BQoprdX-.js} +5 -5
- package/dist/chunks/{toggle.BupEBkIG.js.map → toggle.BQoprdX-.js.map} +1 -1
- package/dist/chunks/tooltip.CbADa_4p.js +199 -0
- package/dist/chunks/{tooltip.Lwtlhv3u.js.map → tooltip.CbADa_4p.js.map} +1 -1
- package/dist/chunks/truncate.DmCXQmeb.js +8 -0
- package/dist/chunks/{truncate.BfIl_-71.js.map → truncate.DmCXQmeb.js.map} +1 -1
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.BL2QTKmV.js → tutorial.vue_vue_type_script_setup_true_lang.BOruzlTt.js} +100 -124
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.BL2QTKmV.js.map → tutorial.vue_vue_type_script_setup_true_lang.BOruzlTt.js.map} +1 -1
- package/dist/chunks/{use-bento-toast-controller.BFctDoMg.js → use-bento-toast-controller.D_NSnBxi.js} +2 -2
- package/dist/chunks/{use-bento-toast-controller.BFctDoMg.js.map → use-bento-toast-controller.D_NSnBxi.js.map} +1 -1
- package/dist/chunks/use-cached-selected-values.ClEJRFAd.js +1631 -0
- package/dist/chunks/{use-cached-selected-values.C4_X3vVj.js.map → use-cached-selected-values.ClEJRFAd.js.map} +1 -1
- package/dist/chunks/use-country-items.D_3LBe2I.js +30 -0
- package/dist/chunks/{use-country-items.BTzByPdQ.js.map → use-country-items.D_3LBe2I.js.map} +1 -1
- package/dist/chunks/use-country-phon-code.DoqTGkNr.js +287 -0
- package/dist/chunks/use-country-phon-code.DoqTGkNr.js.map +1 -0
- package/dist/chunks/use-date-input-formatter.CDRzd-hW.js +1629 -0
- package/dist/chunks/{use-date-input-formatter.dtbK-CEy.js.map → use-date-input-formatter.CDRzd-hW.js.map} +1 -1
- package/dist/chunks/use-default-slot-validator.BzHcrgmy.js +12 -0
- package/dist/chunks/{use-default-slot-validator.O02rzsob.js.map → use-default-slot-validator.BzHcrgmy.js.map} +1 -1
- package/dist/chunks/use-expandable-content-height.B5jjRvCz.js +16 -0
- package/dist/chunks/{use-expandable-content-height.GkjjbmPy.js.map → use-expandable-content-height.B5jjRvCz.js.map} +1 -1
- package/dist/chunks/use-has-slot.CyMiImRQ.js +14 -0
- package/dist/chunks/{use-has-slot.B7eQSabc.js.map → use-has-slot.CyMiImRQ.js.map} +1 -1
- package/dist/chunks/utils.DWmc2mUI.js +19 -0
- package/dist/chunks/{utils.BzUwtTXc.js.map → utils.DWmc2mUI.js.map} +1 -1
- package/dist/chunks/{zh-CN.ChYkuQAR.js → zh-CN.Ce34mXsX.js} +28 -28
- package/dist/chunks/{zh-CN.ChYkuQAR.js.map → zh-CN.Ce34mXsX.js.map} +1 -1
- package/dist/click-outside.js +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/country.js +3 -3
- 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/draggable-handle.js +4 -28
- package/dist/draggable-handle.js.map +1 -1
- package/dist/dropdown.js +4 -4
- package/dist/empty-state.js +1 -1
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +241 -241
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +1 -1
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/inspector.js +1 -1
- package/dist/internal.js +13 -13
- package/dist/layout.js +1 -1
- package/dist/link.js +1 -1
- package/dist/list.js +6 -0
- package/dist/list.js.map +1 -0
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/pagination.js +1 -1
- package/dist/popover.js +2 -2
- package/dist/popper-container.js +1 -1
- package/dist/promo-banner.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/status.js +4 -3
- package/dist/status.js.map +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/use-form-v4.js +331 -341
- package/dist/use-form-v4.js.map +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +7 -7
- package/dist/chunks/anchor-scroller.BctgW0se.js +0 -214
- package/dist/chunks/base-modal.gZAtk-xP.js +0 -443
- package/dist/chunks/button-actions-with-menu.Tba1ME79.js +0 -93
- package/dist/chunks/calendar.vM3abC8y.js +0 -1234
- package/dist/chunks/click-outside.CDz_x8mN.js +0 -23
- package/dist/chunks/constructNow.CIc7d13I.js +0 -8
- package/dist/chunks/country.types.BBQbWkTY.js +0 -773
- package/dist/chunks/dashboard-section.CgoLquLP.js +0 -165
- package/dist/chunks/dashed-underline.wbRHATeE.js +0 -114
- package/dist/chunks/data-grid-template.D40V1cmi.js +0 -144
- package/dist/chunks/data-grid.C2nCCbeC.js +0 -4368
- package/dist/chunks/date-picker.D5B_SECc.js +0 -251
- package/dist/chunks/date-range-picker.B0q7Z4df.js +0 -1084
- package/dist/chunks/differenceInMonths.CIYECBxK.js +0 -43
- package/dist/chunks/dropdown.CxjzXI-k.js +0 -837
- package/dist/chunks/filter-bar.DJ7O4zLX.js +0 -4036
- package/dist/chunks/filter-bar.DJ7O4zLX.js.map +0 -1
- package/dist/chunks/fixed-scroller.i1tmEmst.js +0 -161
- package/dist/chunks/get-slot-text.CQRAP2_q.js +0 -12
- package/dist/chunks/input-field-password.C_h61CMn.js +0 -402
- package/dist/chunks/isSameWeek.CzBCmu7d.js +0 -14
- package/dist/chunks/layout-row.Da8nkm9z.js +0 -100
- package/dist/chunks/link.DTCn2EtX.js +0 -116
- package/dist/chunks/on-click-outside.BW4rkhzG.js +0 -91
- package/dist/chunks/pagination.B32UgSoH.js +0 -488
- package/dist/chunks/pagination.B32UgSoH.js.map +0 -1
- package/dist/chunks/popover.types.DhALnOLQ.js +0 -6
- package/dist/chunks/selection-card-group.C7IK2Vl5.js +0 -417
- package/dist/chunks/startOfWeek.CXhhX-R7.js +0 -10
- package/dist/chunks/status.types.D3v3k-Q8.js +0 -44
- package/dist/chunks/status.types.D3v3k-Q8.js.map +0 -1
- package/dist/chunks/tab.DRrnMCxe.js +0 -273
- package/dist/chunks/textarea.CvI2InIB.js +0 -255
- package/dist/chunks/timeline-item.BooD99hL.js +0 -427
- package/dist/chunks/timeline-item.BooD99hL.js.map +0 -1
- package/dist/chunks/tooltip.Lwtlhv3u.js +0 -202
- package/dist/chunks/truncate.BfIl_-71.js +0 -8
- package/dist/chunks/use-cached-selected-values.C4_X3vVj.js +0 -1711
- package/dist/chunks/use-country-items.BTzByPdQ.js +0 -30
- package/dist/chunks/use-country-phon-code.Bui3zD6W.js +0 -5621
- package/dist/chunks/use-country-phon-code.Bui3zD6W.js.map +0 -1
- package/dist/chunks/use-date-input-formatter.dtbK-CEy.js +0 -1732
- package/dist/chunks/use-default-slot-validator.O02rzsob.js +0 -16
- package/dist/chunks/use-expandable-content-height.GkjjbmPy.js +0 -17
- package/dist/chunks/use-has-slot.B7eQSabc.js +0 -15
- package/dist/chunks/utils.BzUwtTXc.js +0 -21
|
@@ -1,30 +1,21 @@
|
|
|
1
|
-
import { defineComponent as _e, useAttrs as ke, useSlots as Te, ref as h, provide as Ne, inject as j, toRef as Ae, computed as d, toRefs as Le, openBlock as
|
|
2
|
-
import { a as Ie, I as Pe, b as Re, B as G } from "./dropdown.
|
|
1
|
+
import { defineComponent as _e, useAttrs as ke, useSlots as Te, ref as h, provide as Ne, inject as j, toRef as Ae, computed as d, toRefs as Le, openBlock as l, createBlock as u, unref as t, normalizeClass as ge, withCtx as b, renderSlot as p, createCommentVNode as r, createElementVNode as I, createElementBlock as v, withModifiers as z, mergeProps as P, withKeys as Oe, createTextVNode as X, toDisplayString as Z, createVNode as Se } from "vue";
|
|
2
|
+
import { a as Ie, I as Pe, b as Re, B as G } from "./dropdown.MhmX1P9o.js";
|
|
3
3
|
import { p as R, d as B, B as E } from "./typography.B3J6_tYk.js";
|
|
4
4
|
import { u as Be } from "./form-field.D_2g7vaP.js";
|
|
5
|
-
import { g as _ } from "./generate-uid.
|
|
6
|
-
import { g as Q } from "./get-slot-text.
|
|
5
|
+
import { g as _ } from "./generate-uid.DBWe4g6T.js";
|
|
6
|
+
import { g as Q } from "./get-slot-text.8Fbl1GOr.js";
|
|
7
7
|
import { u as Ce } from "./aria-label.CaUURpnB.js";
|
|
8
8
|
import { u as Fe } from "./index.B875RXHM.js";
|
|
9
9
|
import { u as Ve } from "./use-form-layout-loading.CWbjZiwP.js";
|
|
10
|
-
import { u as $e } from "./use-has-slot.
|
|
11
|
-
import { F as Me, E as Ue } from "./error-message.
|
|
10
|
+
import { u as $e } from "./use-has-slot.CyMiImRQ.js";
|
|
11
|
+
import { F as Me, E as Ue } from "./error-message.DCgo8q20.js";
|
|
12
12
|
import { _ as He } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
13
13
|
import "../assets/input-field.css";
|
|
14
14
|
var m = /* @__PURE__ */ ((a) => (a.DEFAULT = "default", a.PAYMENT_METHOD = "payment-method", a.STATIC_VALUE = "static-value", a.DROPDOWN = "dropdown", a))(m || {}), c = /* @__PURE__ */ ((a) => (a.START = "start", a.END = "end", a))(c || {}), k = /* @__PURE__ */ ((a) => (a.CONDENSED = "condensed", a.DISABLED = "disabled", a.READONLY = "readonly", a.ERROR = "error", a))(k || {}), C = /* @__PURE__ */ ((a) => (a.SEARCH = "search", a.TEXT = "text", a.NUMBER = "number", a))(C || {}), qe = /* @__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))(qe || {});
|
|
15
15
|
const x = {
|
|
16
|
-
"en-US": {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
"ja-JP": {
|
|
21
|
-
ariaLabelDropdownFallback: "{inputLabel}ドロップダウン",
|
|
22
|
-
ariaLabelFallback: "入力フィールド"
|
|
23
|
-
},
|
|
24
|
-
"pt-BR": {
|
|
25
|
-
ariaLabelDropdownFallback: "Menu suspenso {inputLabel}",
|
|
26
|
-
ariaLabelFallback: "Campo de entrada"
|
|
27
|
-
}
|
|
16
|
+
"en-US": { ariaLabelDropdownFallback: "{inputLabel} Dropdown", ariaLabelFallback: "Input field" },
|
|
17
|
+
"ja-JP": { ariaLabelDropdownFallback: "{inputLabel}ドロップダウン", ariaLabelFallback: "入力フィールド" },
|
|
18
|
+
"pt-BR": { ariaLabelDropdownFallback: "Menu suspenso {inputLabel}", ariaLabelFallback: "Campo de entrada" }
|
|
28
19
|
}, Ye = ["aria-disabled"], Ke = ["aria-hidden"], We = ["aria-hidden"], Je = ["id"], je = { class: "b-input-field__input-container" }, ze = ["id", "aria-label", "aria-describedby", "aria-owns", "aria-invalid", "placeholder", "required", "aria-required", "type", "value", "disabled", "readonly"], Xe = ["aria-hidden"], Ze = ["id"], Ge = ["id"], Qe = {
|
|
29
20
|
name: "bento-input-field",
|
|
30
21
|
model: { prop: "modelValue" },
|
|
@@ -64,13 +55,10 @@ const x = {
|
|
|
64
55
|
}, de = () => {
|
|
65
56
|
S.value = !1, n("blur");
|
|
66
57
|
}, { isReadOnly: w } = Ve(Ae(o, "readonly")), Y = d(
|
|
67
|
-
() =>
|
|
68
|
-
var e;
|
|
69
|
-
return w.value || ((e = o.dropdown) == null ? void 0 : e.readonly);
|
|
70
|
-
}
|
|
58
|
+
() => w.value || o.dropdown?.readonly
|
|
71
59
|
), A = d(
|
|
72
60
|
() => o.variant === m.STATIC_VALUE && !!T.staticValue
|
|
73
|
-
), ie = d(() => o.variant === m.DEFAULT),
|
|
61
|
+
), ie = d(() => o.variant === m.DEFAULT), re = d(() => o.variant === m.PAYMENT_METHOD), le = d(
|
|
74
62
|
() => A.value && o.staticValuePosition === c.START
|
|
75
63
|
), ne = d(
|
|
76
64
|
() => A.value && o.staticValuePosition === c.END
|
|
@@ -102,7 +90,7 @@ const x = {
|
|
|
102
90
|
const i = e.target.value;
|
|
103
91
|
!o.disabled && !w.value && ae(i);
|
|
104
92
|
}, J = (e) => {
|
|
105
|
-
n("dropdown-input", e), n("update:dropdown", { ...o
|
|
93
|
+
n("dropdown-input", e), n("update:dropdown", { ...o?.dropdown, value: e });
|
|
106
94
|
}, D = () => {
|
|
107
95
|
$.value.focus();
|
|
108
96
|
};
|
|
@@ -137,14 +125,14 @@ const x = {
|
|
|
137
125
|
`The use of "value" prop in "BentoInputField" is no longer supported.
|
|
138
126
|
Use the "v-model" or "model-value" property instead.`,
|
|
139
127
|
"2.0.0"
|
|
140
|
-
), (e, i) => (
|
|
128
|
+
), (e, i) => (l(), u(t(E), {
|
|
141
129
|
class: ge(["b-input-field", De.value]),
|
|
142
130
|
"data-testid": "input-text-container",
|
|
143
131
|
el: "div",
|
|
144
132
|
variant: "body"
|
|
145
133
|
}, {
|
|
146
134
|
default: b(() => [
|
|
147
|
-
t(s)("default") || e.label ? (
|
|
135
|
+
t(s)("default") || e.label ? (l(), u(t(Me), {
|
|
148
136
|
key: 0,
|
|
149
137
|
for: t(M),
|
|
150
138
|
"data-testid": "input-field-label",
|
|
@@ -158,36 +146,36 @@ const x = {
|
|
|
158
146
|
p(e.$slots, "default", {}, void 0, !0)
|
|
159
147
|
]),
|
|
160
148
|
_: 3
|
|
161
|
-
}, 8, ["for", "tooltip-text", "optional", "required", "label"])) :
|
|
149
|
+
}, 8, ["for", "tooltip-text", "optional", "required", "label"])) : r("", !0),
|
|
162
150
|
I("div", {
|
|
163
151
|
class: "b-input-field__input-box",
|
|
164
152
|
"data-testid": "input-box",
|
|
165
153
|
"aria-disabled": e.disabled,
|
|
166
154
|
onClick: D
|
|
167
155
|
}, [
|
|
168
|
-
ie.value && (t(s)("defaultIconBefore") || t(s)("iconBefore")) ? (
|
|
156
|
+
ie.value && (t(s)("defaultIconBefore") || t(s)("iconBefore")) ? (l(), v("span", {
|
|
169
157
|
key: 0,
|
|
170
158
|
"aria-hidden": e.ariaHidden ? "true" : void 0,
|
|
171
159
|
class: "b-input-field__icon-before"
|
|
172
160
|
}, [
|
|
173
|
-
t(s)("iconBefore") ? p(e.$slots, "iconBefore", { key: 0 }, void 0, !0) :
|
|
174
|
-
t(s)("defaultIconBefore") && !t(s)("iconBefore") ? p(e.$slots, "defaultIconBefore", { key: 1 }, void 0, !0) :
|
|
175
|
-
], 8, Ke)) :
|
|
176
|
-
|
|
161
|
+
t(s)("iconBefore") ? p(e.$slots, "iconBefore", { key: 0 }, void 0, !0) : r("", !0),
|
|
162
|
+
t(s)("defaultIconBefore") && !t(s)("iconBefore") ? p(e.$slots, "defaultIconBefore", { key: 1 }, void 0, !0) : r("", !0)
|
|
163
|
+
], 8, Ke)) : r("", !0),
|
|
164
|
+
re.value && t(s)("paymentMethod") ? (l(), v("span", {
|
|
177
165
|
key: 1,
|
|
178
166
|
"aria-hidden": e.ariaHidden ? "true" : void 0,
|
|
179
167
|
class: "b-input-field__payment-method"
|
|
180
168
|
}, [
|
|
181
169
|
p(e.$slots, "paymentMethod", {}, void 0, !0)
|
|
182
|
-
], 8, We)) :
|
|
183
|
-
se.value ? (
|
|
170
|
+
], 8, We)) : r("", !0),
|
|
171
|
+
se.value ? (l(), v("div", {
|
|
184
172
|
key: 2,
|
|
185
173
|
id: t(y),
|
|
186
174
|
class: "b-input-field__dropdown b-input-field__dropdown--start",
|
|
187
175
|
onClick: i[0] || (i[0] = z(() => {
|
|
188
176
|
}, ["stop"]))
|
|
189
177
|
}, [
|
|
190
|
-
e.dropdown ? (
|
|
178
|
+
e.dropdown ? (l(), u(t(G), P({
|
|
191
179
|
key: 0,
|
|
192
180
|
ref_key: "inputDropdownElement",
|
|
193
181
|
ref: O
|
|
@@ -195,9 +183,9 @@ const x = {
|
|
|
195
183
|
disabled: e.disabled,
|
|
196
184
|
readonly: Y.value,
|
|
197
185
|
"onUpdate:modelValue": J
|
|
198
|
-
}), null, 16, ["disabled", "readonly"])) :
|
|
199
|
-
], 8, Je)) :
|
|
200
|
-
|
|
186
|
+
}), null, 16, ["disabled", "readonly"])) : r("", !0)
|
|
187
|
+
], 8, Je)) : r("", !0),
|
|
188
|
+
le.value ? (l(), u(t(E), {
|
|
201
189
|
key: 3,
|
|
202
190
|
id: t(N),
|
|
203
191
|
class: "b-input-field__static-value b-input-field__static-value--start",
|
|
@@ -208,7 +196,7 @@ const x = {
|
|
|
208
196
|
p(e.$slots, "staticValue", {}, void 0, !0)
|
|
209
197
|
]),
|
|
210
198
|
_: 3
|
|
211
|
-
}, 8, ["id"])) :
|
|
199
|
+
}, 8, ["id"])) : r("", !0),
|
|
212
200
|
I("div", je, [
|
|
213
201
|
I("input", P({ id: t(M) }, t(F), {
|
|
214
202
|
ref_key: "inputFieldElement",
|
|
@@ -236,7 +224,7 @@ const x = {
|
|
|
236
224
|
onKeyup: i[3] || (i[3] = (f) => n("keyup", f)),
|
|
237
225
|
onClick: i[5] || (i[5] = (f) => n("click", f))
|
|
238
226
|
}), null, 16, ze),
|
|
239
|
-
t(q) && S.value && (e.modelValue || e.value) ? (
|
|
227
|
+
t(q) && S.value && (e.modelValue || e.value) ? (l(), u(t(E), {
|
|
240
228
|
key: 0,
|
|
241
229
|
el: "span",
|
|
242
230
|
class: "b-input-field__hint"
|
|
@@ -245,17 +233,17 @@ const x = {
|
|
|
245
233
|
X(Z(t(q)), 1)
|
|
246
234
|
]),
|
|
247
235
|
_: 1
|
|
248
|
-
})) :
|
|
236
|
+
})) : r("", !0)
|
|
249
237
|
]),
|
|
250
|
-
t(s)("iconAfter") ? (
|
|
238
|
+
t(s)("iconAfter") ? (l(), v("span", {
|
|
251
239
|
key: 4,
|
|
252
240
|
"aria-hidden": e.ariaHidden ? "true" : void 0,
|
|
253
241
|
class: "b-input-field__icon-after",
|
|
254
242
|
"data-testid": "input-text__icon-after"
|
|
255
243
|
}, [
|
|
256
244
|
p(e.$slots, "iconAfter", {}, void 0, !0)
|
|
257
|
-
], 8, Xe)) :
|
|
258
|
-
ne.value ? (
|
|
245
|
+
], 8, Xe)) : r("", !0),
|
|
246
|
+
ne.value ? (l(), u(t(E), {
|
|
259
247
|
key: 5,
|
|
260
248
|
id: t(N),
|
|
261
249
|
class: "b-input-field__static-value b-input-field__static-value--end",
|
|
@@ -266,8 +254,8 @@ const x = {
|
|
|
266
254
|
p(e.$slots, "staticValue", {}, void 0, !0)
|
|
267
255
|
]),
|
|
268
256
|
_: 3
|
|
269
|
-
}, 8, ["id"])) :
|
|
270
|
-
ue.value ? (
|
|
257
|
+
}, 8, ["id"])) : r("", !0),
|
|
258
|
+
ue.value ? (l(), v("div", {
|
|
271
259
|
key: 6,
|
|
272
260
|
id: t(y),
|
|
273
261
|
"data-testid": "input-field-dropdown-container-end",
|
|
@@ -275,7 +263,7 @@ const x = {
|
|
|
275
263
|
onClick: i[6] || (i[6] = z(() => {
|
|
276
264
|
}, ["stop"]))
|
|
277
265
|
}, [
|
|
278
|
-
e.dropdown ? (
|
|
266
|
+
e.dropdown ? (l(), u(t(G), P({
|
|
279
267
|
key: 0,
|
|
280
268
|
id: t(y),
|
|
281
269
|
ref_key: "inputDropdownElement",
|
|
@@ -284,16 +272,16 @@ const x = {
|
|
|
284
272
|
disabled: e.disabled,
|
|
285
273
|
readonly: Y.value,
|
|
286
274
|
"onUpdate:modelValue": J
|
|
287
|
-
}), null, 16, ["id", "disabled", "readonly"])) :
|
|
288
|
-
], 8, Ze)) :
|
|
275
|
+
}), null, 16, ["id", "disabled", "readonly"])) : r("", !0)
|
|
276
|
+
], 8, Ze)) : r("", !0)
|
|
289
277
|
], 8, Ye),
|
|
290
|
-
g.value && e.errorMessage ? (
|
|
278
|
+
g.value && e.errorMessage ? (l(), u(t(Ue), {
|
|
291
279
|
key: 1,
|
|
292
280
|
id: t(H),
|
|
293
281
|
"error-message": e.errorMessage,
|
|
294
282
|
class: "b-input-field__error-message"
|
|
295
|
-
}, null, 8, ["id", "error-message"])) :
|
|
296
|
-
t(s)("description") || e.description ? (
|
|
283
|
+
}, null, 8, ["id", "error-message"])) : r("", !0),
|
|
284
|
+
t(s)("description") || e.description ? (l(), v("span", {
|
|
297
285
|
key: 2,
|
|
298
286
|
id: t(U),
|
|
299
287
|
class: "b-input-field__description",
|
|
@@ -310,7 +298,7 @@ const x = {
|
|
|
310
298
|
]),
|
|
311
299
|
_: 3
|
|
312
300
|
})
|
|
313
|
-
], 8, Ge)) :
|
|
301
|
+
], 8, Ge)) : r("", !0)
|
|
314
302
|
]),
|
|
315
303
|
_: 3
|
|
316
304
|
}, 8, ["class"]));
|
|
@@ -324,4 +312,4 @@ export {
|
|
|
324
312
|
C as d,
|
|
325
313
|
m as e
|
|
326
314
|
};
|
|
327
|
-
//# sourceMappingURL=input-field.
|
|
315
|
+
//# sourceMappingURL=input-field.CfU0ZKtL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-field.DPElUS0U.js","sources":["../../../vue2/src/components/input-field/input-field.types.ts","../../../vue2/src/components/input-field/input-field.vue"],"sourcesContent":["import { type BentoDropdownProps } from '../dropdown/dropdown.types';\nimport { type FormField } from '../../types/form-field';\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 = BentoDropdownProps;\nexport interface BentoInputDropdownProps {\n /**\n * Text that labels the dropdown element\n */\n 'aria-label'?: string;\n /**\n * Enables dynamic filtering\n */\n dynamicFiltering?: DropdownProps['dynamicFiltering'];\n /**\n * List of available items\n */\n items: DropdownProps['items'];\n /**\n * Sets the dropdown in read-only mode\n */\n readonly?: DropdownProps['readonly'];\n /**\n * Selected value of the dropdown\n * @deprecated Use `model-value` instead.\n */\n value?: DropdownProps['value'];\n /**\n * Selected value of the dropdown\n */\n modelValue?: DropdownProps['modelValue'];\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\nexport interface BentoInputFieldProps extends FormField {\n /**\n * Indicates whether the element is exposed to an accessibility API.\n */\n ariaHidden?: boolean;\n\n /**\n * Text that labels an the input element\n *\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n ariaLabel?: string;\n\n /**\n * Reduces height of the input\n */\n condensed?: boolean;\n\n /**\n * Dropdown props for the small selectable dropdown menu.\n * Properties supported:\n *\n * - `aria-label`: Text that labels the dropdown element\n * - `dynamicFiltering`: Enables dynamic filtering\n * - `items`: List of available items\n * - `readonly`: Sets the dropdown in read-only mode\n * - `value`: Selected value of the dropdown\n */\n dropdown?: BentoInputDropdownProps;\n\n /**\n * Position of the dropdown before or after input value\n */\n dropdownPosition?: BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`;\n\n /**\n * Adds error validation class for outlining input-field.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n error?: boolean;\n\n /**\n * Text displayed as the value of the input-field\n */\n modelValue?: BentoInputFieldValue;\n\n /**\n * Renders a font numeric style with slashed zeros instead of normal ones.\n */\n slashedZero?: boolean;\n\n /**\n * Static text that displayed before or after input value\n * Applicable to the Static Value variant\n */\n staticValue?: string;\n\n /**\n * Position of Static Value before or after input value\n */\n staticValuePosition?: BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`;\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?: BentoInputFieldType | `${BentoInputFieldType}` | HTMLInputElement['type'];\n\n /**\n * Text displayed as the value of the input-field\n * @deprecated for usage with properties since version 2.0. Use `v-model` or `model-value` instead.\n */\n value?: BentoInputFieldValue;\n\n /**\n * Describes the different variants for the input element\n */\n variant?: BentoInputFieldVariant | `${BentoInputFieldVariant}`;\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') || label\"\n :for=\"inputFieldId\"\n data-testid=\"input-field-label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n :label=\"label\"\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 ref=\"inputDropdownElement\"\n v-bind=\"inputFieldDropdownProps\"\n :disabled=\"disabled\"\n :readonly=\"isDropdownReadOnly\"\n @update:model-value=\"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 :required=\"required\"\n :aria-required=\"required\"\n :type=\"type\"\n :value=\"modelValue ?? 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 @click=\"emit('click', $event)\"\n />\n\n <!-- Hint at the end -->\n <bento-typography\n v-if=\"hint && isFocused && (modelValue || value)\"\n el=\"span\"\n class=\"b-input-field__hint\"\n >\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 ref=\"inputDropdownElement\"\n v-bind=\"inputFieldDropdownProps\"\n :disabled=\"disabled\"\n :readonly=\"isDropdownReadOnly\"\n @update:model-value=\"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\n v-if=\"hasSlot('description') || description\"\n :id=\"descriptionId\"\n class=\"b-input-field__description\"\n @click=\"focusInput\"\n >\n <bento-typography el=\"span\" variant=\"body\">\n <slot id=\"description\" name=\"description\">\n {{ description }}\n </slot>\n </bento-typography>\n </span>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, provide, type 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 { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\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 INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY,\n } from '@/components/input-field/input-field.keys';\n import { type BentoListboxSelectedValue } from '@/types/listbox';\n\n // Composables\n import { useFormLayoutFieldLoading, useHasSlot } from '@/composables';\n\n // Types\n import {\n type BentoInputDropdownProps,\n BentoInputFieldElementPosition,\n type BentoInputFieldProps,\n BentoInputFieldStateClass,\n BentoInputFieldType,\n type BentoInputFieldValue,\n BentoInputFieldVariant,\n } from './input-field.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 = withDefaults(defineProps<BentoInputFieldProps>(), {\n ariaHidden: true,\n ariaLabel: undefined,\n condensed: false,\n description: '',\n disabled: false,\n dropdown: undefined,\n dropdownPosition: BentoInputFieldElementPosition.START,\n error: false,\n errorMessage: null,\n label: '',\n modelValue: undefined,\n optional: false,\n placeholder: '',\n required: false,\n readonly: false,\n slashedZero: false,\n staticValue: '',\n staticValuePosition: BentoInputFieldElementPosition.START,\n tooltipText: null,\n type: BentoInputFieldType.TEXT,\n value: undefined,\n variant: BentoInputFieldVariant.DEFAULT,\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the element has lost focus\n */\n (e: 'blur'): void;\n\n /**\n * Emitted when the input is clicked\n */\n (e: 'click', event: MouseEvent);\n\n /**\n * Emitted when the user modifies the element's value. Unlike the 'input' event, the change event is not necessarily fired for each alteration to an element's value\n */\n (e: 'change'): void;\n\n /**\n * Emitted when the Input Field's internal dropdown changes it's value\n */\n (e: 'dropdown-input', selectedValue: BentoListboxSelectedValue): void;\n\n /**\n * Emitted when the \"ESC\" key is pressed\n */\n (e: 'escape-pressed'): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: 'focus'): void;\n\n /**\n * Emitted when a key is pressed down\n */\n (e: 'keydown', event: KeyboardEvent): void;\n\n /**\n * Emitted when a key is pressed and lifted up\n */\n (e: 'keyup', event: KeyboardEvent): void;\n\n /**\n * Emitted when the component's model changes\n * @deprecated since version 2.0. Use `v-model` or `update:model-value` instead.\n */\n (e: 'input', inputValue: string): void;\n\n /**\n * Emitted when the Input Field's internal dropdown changes it's value. Contains every dropdown prop passed with the updated selected value as 'value'\n */\n (e: 'update:dropdown', updatedDropdownProps: BentoInputDropdownProps): void;\n\n /**\n * Emitted when the component's model changes\n */\n (e: 'update:model-value', inputValue: BentoInputFieldValue): void;\n }>();\n\n const { emitValue } = useFormFieldEmits<BentoInputFieldValue>(emit);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const hasSlot = useHasSlot(slots);\n const inputFieldElement = ref(null);\n const inputDropdownElement = 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 const isDropdownReadOnly = computed<BentoInputDropdownProps['readonly']>(\n () => isReadOnly.value || props.dropdown?.readonly\n );\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 computedLabel = computed(() => (getSlotText(slots)('default') as string) || props.label);\n const computedDescription = computed(() => (getSlotText(slots)('description') as string) || props.description);\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: computedLabel.value || computedAriaLabelFallbackMessage,\n });\n\n const computedAriaDescribedBy = computed(\n () =>\n `${computedDescription.value ? 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 [`b-input-field--slashed-zero`]: props.slashedZero,\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 emitValue(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 const focus = () => {\n if (props.variant === 'dropdown') {\n inputDropdownElement.value.focus();\n } else {\n focusInput();\n }\n };\n\n // Expose method so that other components can focus on it in Vue3\n defineExpose({\n focusInput,\n focus,\n });\n\n const inputFieldParentComponent = inject(INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY, '');\n\n if (!Object.values(BentoInputFieldType).includes(props.type as BentoInputFieldType) && !inputFieldParentComponent) {\n if (props.type === 'tel') {\n printDevelopmentWarning(\n `\"bento-input-field\" dropdown does not support the type '${props.type}', use \"bento-input-field-phone-number\" instead.`\n );\n } else if (props.type === 'password') {\n printDevelopmentWarning(\n `\"bento-input-field\" dropdown does not support the type '${props.type}', use \"bento-input-field-password\" instead.`\n );\n } else {\n printDevelopmentWarning(`\"bento-input-field\" dropdown does not support the type '${props.type}'`);\n }\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\n if (props.value) {\n deprecate(\n 'BentoInputField \"value\" property',\n `The use of \"value\" prop in \"BentoInputField\" is no longer supported.\n Use the \"v-model\" or \"model-value\" property instead.`,\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 * :model-value=\"inputValue\"\n * :@update:model-value=\"newValue => inputValue.value = newValue\"\n * >\n * }\n */\n export default {\n name: 'bento-input-field',\n model: { prop: 'modelValue' },\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","props","__props","emit","__emit","emitValue","useFormFieldEmits","t","useI18n","hasSlot","useHasSlot","inputFieldElement","ref","inputDropdownElement","inputFieldId","generateUid","dropdownId","staticValueId","descriptionId","errorId","isFocused","provide","INPUT_FIELD_COMPONENT_INJECTION_KEY","hint","inject","INPUT_FIELD_HINT_INJECTION_KEY","onFocus","onBlur","isReadOnly","useFormLayoutFieldLoading","toRef","isDropdownReadOnly","computed","_a","shouldShowStaticValue","isDefaultVariant","isPaymentMethodVariant","shouldDisplayStaticValueAtStart","shouldDisplayStaticValueAtEnd","shouldShowDropdown","shouldDisplayDropdownAtStart","shouldDisplayDropdownAtEnd","shouldShowError","computedLabel","getSlotText","computedDescription","computedAriaOwns","computedAriaLabelFallbackMessage","computedAriaLabelDropdowFallback","computedAriaLabel","ariaLabelAttribute","ariaLabel","toRefs","useAriaLabel","computedAriaDescribedBy","inputFieldConditionalClasses","inputFieldDropdownProps","onInput","event","inputValue","onDropdownInput","selectedValue","focusInput","__expose","inputFieldParentComponent","INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY","printDevelopmentWarning","deprecate"],"mappings":";;;;;;;;;;;;;AAMO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,UAAA,WACAA,EAAA,iBAAA,kBACAA,EAAA,eAAA,gBACAA,EAAA,WAAA,YAJQA,IAAAD,KAAA,CAAA,CAAA,GAULE,IAAA,kBAAAC,OACHA,EAAA,QAAA,SACAA,EAAA,MAAA,OAFQA,IAAAD,KAAA,CAAA,CAAA,GAKLE,IAAA,kBAAAC,OACHA,EAAA,YAAA,aACAA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SAJQA,IAAAD,KAAA,CAAA,CAAA,GAULE,IAAA,kBAAAC,OACHA,EAAA,SAAA,UACAA,EAAA,OAAA,QACAA,EAAA,SAAA,UAHQA,IAAAD,KAAA,CAAA,CAAA,GA0CLE,KAAA,kBAAAC,OACHA,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,CAAA;;;;;;;;;;;;;;uVCkbRE,KAAA;AAAA,EAAe,MAAA;AAA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DAAAjE,EAAA,IAAA;AAAA,IACyE,IAGzEiE,EAAA,2DAAAjE,EAAA,IAAA,GAAA,IAORA,EAAA,SACIkE;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA,MACA;AAAA,IAGA,GAIR1D,EAAA,mBAAA,KACI0D;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MACA;AAAA,IAMA,GAIRlE,EAAA,SACIkE;AAAA,MAAA;AAAA,MACI;AAAA;AAAA,MACA;AAAA,IAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"input-field.CfU0ZKtL.js","sources":["../../../vue2/src/components/input-field/input-field.types.ts","../../../vue2/src/components/input-field/input-field.vue"],"sourcesContent":["import { type BentoDropdownProps } from '../dropdown/dropdown.types';\nimport { type FormField } from '../../types/form-field';\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 = BentoDropdownProps;\nexport interface BentoInputDropdownProps {\n /**\n * Text that labels the dropdown element\n */\n 'aria-label'?: string;\n /**\n * Enables dynamic filtering\n */\n dynamicFiltering?: DropdownProps['dynamicFiltering'];\n /**\n * List of available items\n */\n items: DropdownProps['items'];\n /**\n * Sets the dropdown in read-only mode\n */\n readonly?: DropdownProps['readonly'];\n /**\n * Selected value of the dropdown\n * @deprecated Use `model-value` instead.\n */\n value?: DropdownProps['value'];\n /**\n * Selected value of the dropdown\n */\n modelValue?: DropdownProps['modelValue'];\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\nexport interface BentoInputFieldProps extends FormField {\n /**\n * Indicates whether the element is exposed to an accessibility API.\n */\n ariaHidden?: boolean;\n\n /**\n * Text that labels an the input element\n *\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n ariaLabel?: string;\n\n /**\n * Reduces height of the input\n */\n condensed?: boolean;\n\n /**\n * Dropdown props for the small selectable dropdown menu.\n * Properties supported:\n *\n * - `aria-label`: Text that labels the dropdown element\n * - `dynamicFiltering`: Enables dynamic filtering\n * - `items`: List of available items\n * - `readonly`: Sets the dropdown in read-only mode\n * - `value`: Selected value of the dropdown\n */\n dropdown?: BentoInputDropdownProps;\n\n /**\n * Position of the dropdown before or after input value\n */\n dropdownPosition?: BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`;\n\n /**\n * Adds error validation class for outlining input-field.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n error?: boolean;\n\n /**\n * Text displayed as the value of the input-field\n */\n modelValue?: BentoInputFieldValue;\n\n /**\n * Renders a font numeric style with slashed zeros instead of normal ones.\n */\n slashedZero?: boolean;\n\n /**\n * Static text that displayed before or after input value\n * Applicable to the Static Value variant\n */\n staticValue?: string;\n\n /**\n * Position of Static Value before or after input value\n */\n staticValuePosition?: BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`;\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?: BentoInputFieldType | `${BentoInputFieldType}` | HTMLInputElement['type'];\n\n /**\n * Text displayed as the value of the input-field\n * @deprecated for usage with properties since version 2.0. Use `v-model` or `model-value` instead.\n */\n value?: BentoInputFieldValue;\n\n /**\n * Describes the different variants for the input element\n */\n variant?: BentoInputFieldVariant | `${BentoInputFieldVariant}`;\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') || label\"\n :for=\"inputFieldId\"\n data-testid=\"input-field-label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n :label=\"label\"\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 ref=\"inputDropdownElement\"\n v-bind=\"inputFieldDropdownProps\"\n :disabled=\"disabled\"\n :readonly=\"isDropdownReadOnly\"\n @update:model-value=\"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 :required=\"required\"\n :aria-required=\"required\"\n :type=\"type\"\n :value=\"modelValue ?? 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 @click=\"emit('click', $event)\"\n />\n\n <!-- Hint at the end -->\n <bento-typography\n v-if=\"hint && isFocused && (modelValue || value)\"\n el=\"span\"\n class=\"b-input-field__hint\"\n >\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 ref=\"inputDropdownElement\"\n v-bind=\"inputFieldDropdownProps\"\n :disabled=\"disabled\"\n :readonly=\"isDropdownReadOnly\"\n @update:model-value=\"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\n v-if=\"hasSlot('description') || description\"\n :id=\"descriptionId\"\n class=\"b-input-field__description\"\n @click=\"focusInput\"\n >\n <bento-typography el=\"span\" variant=\"body\">\n <slot id=\"description\" name=\"description\">\n {{ description }}\n </slot>\n </bento-typography>\n </span>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, provide, type 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 { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\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 INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY,\n } from '@/components/input-field/input-field.keys';\n import { type BentoListboxSelectedValue } from '@/types/listbox';\n\n // Composables\n import { useFormLayoutFieldLoading, useHasSlot } from '@/composables';\n\n // Types\n import {\n type BentoInputDropdownProps,\n BentoInputFieldElementPosition,\n type BentoInputFieldProps,\n BentoInputFieldStateClass,\n BentoInputFieldType,\n type BentoInputFieldValue,\n BentoInputFieldVariant,\n } from './input-field.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 = withDefaults(defineProps<BentoInputFieldProps>(), {\n ariaHidden: true,\n ariaLabel: undefined,\n condensed: false,\n description: '',\n disabled: false,\n dropdown: undefined,\n dropdownPosition: BentoInputFieldElementPosition.START,\n error: false,\n errorMessage: null,\n label: '',\n modelValue: undefined,\n optional: false,\n placeholder: '',\n required: false,\n readonly: false,\n slashedZero: false,\n staticValue: '',\n staticValuePosition: BentoInputFieldElementPosition.START,\n tooltipText: null,\n type: BentoInputFieldType.TEXT,\n value: undefined,\n variant: BentoInputFieldVariant.DEFAULT,\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the element has lost focus\n */\n (e: 'blur'): void;\n\n /**\n * Emitted when the input is clicked\n */\n (e: 'click', event: MouseEvent);\n\n /**\n * Emitted when the user modifies the element's value. Unlike the 'input' event, the change event is not necessarily fired for each alteration to an element's value\n */\n (e: 'change'): void;\n\n /**\n * Emitted when the Input Field's internal dropdown changes it's value\n */\n (e: 'dropdown-input', selectedValue: BentoListboxSelectedValue): void;\n\n /**\n * Emitted when the \"ESC\" key is pressed\n */\n (e: 'escape-pressed'): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: 'focus'): void;\n\n /**\n * Emitted when a key is pressed down\n */\n (e: 'keydown', event: KeyboardEvent): void;\n\n /**\n * Emitted when a key is pressed and lifted up\n */\n (e: 'keyup', event: KeyboardEvent): void;\n\n /**\n * Emitted when the component's model changes\n * @deprecated since version 2.0. Use `v-model` or `update:model-value` instead.\n */\n (e: 'input', inputValue: string): void;\n\n /**\n * Emitted when the Input Field's internal dropdown changes it's value. Contains every dropdown prop passed with the updated selected value as 'value'\n */\n (e: 'update:dropdown', updatedDropdownProps: BentoInputDropdownProps): void;\n\n /**\n * Emitted when the component's model changes\n */\n (e: 'update:model-value', inputValue: BentoInputFieldValue): void;\n }>();\n\n const { emitValue } = useFormFieldEmits<BentoInputFieldValue>(emit);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const hasSlot = useHasSlot(slots);\n const inputFieldElement = ref(null);\n const inputDropdownElement = 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 const isDropdownReadOnly = computed<BentoInputDropdownProps['readonly']>(\n () => isReadOnly.value || props.dropdown?.readonly\n );\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 computedLabel = computed(() => (getSlotText(slots)('default') as string) || props.label);\n const computedDescription = computed(() => (getSlotText(slots)('description') as string) || props.description);\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: computedLabel.value || computedAriaLabelFallbackMessage,\n });\n\n const computedAriaDescribedBy = computed(\n () =>\n `${computedDescription.value ? 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 [`b-input-field--slashed-zero`]: props.slashedZero,\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 emitValue(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 const focus = () => {\n if (props.variant === 'dropdown') {\n inputDropdownElement.value.focus();\n } else {\n focusInput();\n }\n };\n\n // Expose method so that other components can focus on it in Vue3\n defineExpose({\n focusInput,\n focus,\n });\n\n const inputFieldParentComponent = inject(INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY, '');\n\n if (!Object.values(BentoInputFieldType).includes(props.type as BentoInputFieldType) && !inputFieldParentComponent) {\n if (props.type === 'tel') {\n printDevelopmentWarning(\n `\"bento-input-field\" dropdown does not support the type '${props.type}', use \"bento-input-field-phone-number\" instead.`\n );\n } else if (props.type === 'password') {\n printDevelopmentWarning(\n `\"bento-input-field\" dropdown does not support the type '${props.type}', use \"bento-input-field-password\" instead.`\n );\n } else {\n printDevelopmentWarning(`\"bento-input-field\" dropdown does not support the type '${props.type}'`);\n }\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\n if (props.value) {\n deprecate(\n 'BentoInputField \"value\" property',\n `The use of \"value\" prop in \"BentoInputField\" is no longer supported.\n Use the \"v-model\" or \"model-value\" property instead.`,\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 * :model-value=\"inputValue\"\n * :@update:model-value=\"newValue => inputValue.value = newValue\"\n * >\n * }\n */\n export default {\n name: 'bento-input-field',\n model: { prop: 'modelValue' },\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","props","__props","emit","__emit","emitValue","useFormFieldEmits","t","useI18n","hasSlot","useHasSlot","inputFieldElement","ref","inputDropdownElement","inputFieldId","generateUid","dropdownId","staticValueId","descriptionId","errorId","isFocused","provide","INPUT_FIELD_COMPONENT_INJECTION_KEY","hint","inject","INPUT_FIELD_HINT_INJECTION_KEY","onFocus","onBlur","isReadOnly","useFormLayoutFieldLoading","toRef","isDropdownReadOnly","computed","shouldShowStaticValue","isDefaultVariant","isPaymentMethodVariant","shouldDisplayStaticValueAtStart","shouldDisplayStaticValueAtEnd","shouldShowDropdown","shouldDisplayDropdownAtStart","shouldDisplayDropdownAtEnd","shouldShowError","computedLabel","getSlotText","computedDescription","computedAriaOwns","computedAriaLabelFallbackMessage","computedAriaLabelDropdowFallback","computedAriaLabel","ariaLabelAttribute","ariaLabel","toRefs","useAriaLabel","computedAriaDescribedBy","inputFieldConditionalClasses","inputFieldDropdownProps","onInput","event","inputValue","onDropdownInput","selectedValue","focusInput","__expose","inputFieldParentComponent","INPUT_FIELD_PARENT_COMPONENT_INJECTION_KEY","printDevelopmentWarning","deprecate"],"mappings":";;;;;;;;;;;;;AAMO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,UAAA,WACAA,EAAA,iBAAA,kBACAA,EAAA,eAAA,gBACAA,EAAA,WAAA,YAJQA,IAAAD,KAAA,CAAA,CAAA,GAULE,IAAA,kBAAAC,OACHA,EAAA,QAAA,SACAA,EAAA,MAAA,OAFQA,IAAAD,KAAA,CAAA,CAAA,GAKLE,IAAA,kBAAAC,OACHA,EAAA,YAAA,aACAA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SAJQA,IAAAD,KAAA,CAAA,CAAA,GAULE,IAAA,kBAAAC,OACHA,EAAA,SAAA,UACAA,EAAA,OAAA,QACAA,EAAA,SAAA,UAHQA,IAAAD,KAAA,CAAA,CAAA,GA0CLE,KAAA,kBAAAC,OACHA,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,CAAA;;;;;uVCkbRE,KAAA;AAAA,EAAe,MAAA;AAAA,EACL,OAAA,EAAA,MAAA,aAAA;AAAA,EACsB,MAAA,EAAA,UAAAC,EAAA;AAEhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA/SA,UAAAC,IAAAC,GAAA,GACAC,IAAAC,GAAA,GAEAC,IAAAC,GAyBAC,IAAAC,IA0DA,EAAA,WAAAC,GAAA,IAAAC,GAAAH,CAAA,GAEA,EAAA,GAAAI,EAAA,IAAA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,IAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ref as v, watch as x, defineComponent as $, computed as b, openBlock as f, createElementBlock as S, normalizeClass as N, createElementVNode as s, renderSlot as w, createVNode as i, Transition as K, withCtx as l, withKeys as z, unref as n, Fragment as G, createTextVNode as H, toDisplayString as T, createCommentVNode as E, createBlock as O, nextTick as Y } from "vue";
|
|
2
2
|
import { d as U, B as X } from "./typography.B3J6_tYk.js";
|
|
3
|
-
import { B as k } from "./button.
|
|
3
|
+
import { B as k } from "./button.DWF7FSIw.js";
|
|
4
4
|
import { B as j } from "./loading-indicator.BPol9I84.js";
|
|
5
|
-
import { B as q, s as J, g as W, a as Q, f as Z } from "./focus-trap.
|
|
5
|
+
import { B as q, s as J, g as W, a as Q, f as Z } from "./focus-trap.BAiM_ywb.js";
|
|
6
6
|
import { E as ee } from "./expand.BrywY9jl.js";
|
|
7
7
|
import { C as te } from "./cross.CCHdi6v3.js";
|
|
8
|
-
import { g as ne } from "./generate-uid.
|
|
8
|
+
import { g as ne } from "./generate-uid.DBWe4g6T.js";
|
|
9
9
|
import { u as oe } from "./index.B875RXHM.js";
|
|
10
|
-
import { a as ae, b as se } from "./index.
|
|
10
|
+
import { a as ae, b as se } from "./index.DDwcHPb6.js";
|
|
11
11
|
import { _ as ie } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
12
12
|
import "../assets/inspector.css";
|
|
13
13
|
function re(_) {
|
|
@@ -24,27 +24,9 @@ function re(_) {
|
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
const I = {
|
|
27
|
-
"en-US": {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
inspector: "Inspector",
|
|
31
|
-
returnToMainContent: "Return to main content (Ctrl+Shift+S)",
|
|
32
|
-
returnToMainContentDescription: "You can use Ctrl + Shift + S to navigate between the inspector and page sections."
|
|
33
|
-
},
|
|
34
|
-
"ja-JP": {
|
|
35
|
-
close: "閉じる",
|
|
36
|
-
expand: "展開",
|
|
37
|
-
inspector: "インスペクター",
|
|
38
|
-
returnToMainContent: "メインコンテンツに戻る(Ctrl+Shift+S)",
|
|
39
|
-
returnToMainContentDescription: "Ctrl + Shift + S を使用して、インスペクターとページセクション間を移動できます。"
|
|
40
|
-
},
|
|
41
|
-
"pt-BR": {
|
|
42
|
-
close: "Fechar",
|
|
43
|
-
expand: "Expandir",
|
|
44
|
-
inspector: "Inspetor",
|
|
45
|
-
returnToMainContent: "Voltar ao conteúdo principal (Ctrl+Shift+S)",
|
|
46
|
-
returnToMainContentDescription: "Você pode usar Ctrl + Shift + S para navegar entre as seções do inspetor e da página."
|
|
47
|
-
}
|
|
27
|
+
"en-US": { close: "Close", expand: "Expand", inspector: "Inspector", returnToMainContent: "Return to main content (Ctrl+Shift+S)", returnToMainContentDescription: "You can use Ctrl + Shift + S to navigate between the inspector and page sections." },
|
|
28
|
+
"ja-JP": { close: "閉じる", expand: "展開", inspector: "インスペクター", returnToMainContent: "メインコンテンツに戻る(Ctrl+Shift+S)", returnToMainContentDescription: "Ctrl + Shift + S を使用して、インスペクターとページセクション間を移動できます。" },
|
|
29
|
+
"pt-BR": { close: "Fechar", expand: "Expandir", inspector: "Inspetor", returnToMainContent: "Voltar ao conteúdo principal (Ctrl+Shift+S)", returnToMainContentDescription: "Você pode usar Ctrl + Shift + S para navegar entre as seções do inspetor e da página." }
|
|
48
30
|
}, ce = { class: "b-inspector__page" }, le = ["aria-label"], pe = { class: "b-inspector__container" }, ue = { class: "b-inspector__header" }, de = ["id"], fe = { class: "b-inspector__icons" }, ve = { class: "b-inspector__content" }, _e = { i18n: { messages: I } }, me = /* @__PURE__ */ $({
|
|
49
31
|
..._e,
|
|
50
32
|
__name: "inspector",
|
|
@@ -80,7 +62,7 @@ const I = {
|
|
|
80
62
|
}, F = () => {
|
|
81
63
|
Z(m.value) ? (C.value = document.activeElement, u(g.value ?? h()), r("update:active-page", void 0)) : u(C.value);
|
|
82
64
|
}, u = (e) => {
|
|
83
|
-
e && (e
|
|
65
|
+
e && (e?.focus(), document.activeElement !== e && u(e.parentElement));
|
|
84
66
|
};
|
|
85
67
|
return x(
|
|
86
68
|
() => t.activePage,
|
|
@@ -203,4 +185,4 @@ const I = {
|
|
|
203
185
|
export {
|
|
204
186
|
Me as B
|
|
205
187
|
};
|
|
206
|
-
//# sourceMappingURL=inspector.
|
|
188
|
+
//# sourceMappingURL=inspector.B9k4tJWe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspector.BjLhY3bE.js","sources":["../../../vue2/src/components/inspector/composables/use-focus-history/use-focus-history.ts","../../../vue2/src/components/inspector/inspector.vue"],"sourcesContent":["import { ref, type Ref } from 'vue';\nimport { useActiveElement } from '@vueuse/core';\nimport { watch } from 'vue';\n\n/**\n * A composable to track the focus history within a target element.\n * @param targetEl The stable parent element to monitor for focus changes.\n */\nexport function useFocusHistory(targetEl: Ref<HTMLElement | null>) {\n const MAX_HISTORY_LENGTH = 3;\n\n const focusHistory = ref<Array<Element>>([]);\n\n const currentActiveElement = useActiveElement();\n\n // Edge case 1:\n // While the inspector is opened, if user tabs through the data-grid to the inspector, and closes it,\n // it returns to the last element on the data grid regardless if it is a data-grid-cell.\n //\n // Edge case 2:\n // Buttons or actions teleported out of the data-grid may have the focus shifted into a different context.\n watch(currentActiveElement, newlyFocusedElement => {\n // Check if the newly focused element is a child of our target container.\n if (!targetEl.value || !newlyFocusedElement || !targetEl.value.contains(newlyFocusedElement)) {\n return;\n }\n\n // Add the focused element to the history\n focusHistory.value.unshift(newlyFocusedElement);\n\n if (focusHistory.value.length > MAX_HISTORY_LENGTH) {\n focusHistory.value.pop();\n }\n });\n\n /**\n * Iterates through the focus history to find the first valid element\n * that is still present in the DOM.\n * @returns The first valid historical element, or null if none are found.\n */\n const findValidFocusFallback = (): HTMLElement | null => {\n for (const el of focusHistory.value) {\n if (el && document.body.contains(el as Node)) {\n return el as HTMLElement;\n }\n }\n\n return null; // No valid fallback found\n };\n\n return {\n findValidFocusFallback,\n };\n}\n","<template>\n <div ref=\"wrapper\" class=\"b-inspector\" :class=\"conditionalClass\" @keydown=\"handleSectionFocus\">\n <div ref=\"page\" 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\n v-if=\"isOpen\"\n ref=\"inspector\"\n class=\"b-inspector__container-wrapper\"\n :aria-label=\"inspectorAriaLabel\"\n @keydown.tab=\"handleTabNavigation\"\n >\n <bento-focus-trap :disabled=\"!isCompact\">\n <div class=\"b-inspector__container\">\n <div class=\"b-inspector__header\">\n <template v-if=\"!isCompact\">\n <bento-button\n class=\"b-inspector__return-content\"\n variant=\"secondary\"\n condensed\n :aria-describedby=\"returnToMainContentDescriptionId\"\n @click=\"moveFocusBetweenSections\"\n >\n {{ t('returnToMainContent') }}\n </bento-button>\n <span\n :id=\"returnToMainContentDescriptionId\"\n class=\"b-inspector__return-content-description\"\n >{{ t('returnToMainContentDescription') }}</span\n >\n </template>\n <bento-typography 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 </div>\n </bento-focus-trap>\n </aside>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, ref, watch } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoButton } from '@/components/button';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import ExpandIcon from '@adyen/ui-assets-icons-16/vue/expand';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { generateUid } from '@/core/utils/ts';\n import { useI18n } from '@/utils/ts/i18n';\n import { deprecate } from '@/utils/ts/deprecate';\n import { getNextFocusableElement } from '@/utils/ts/focus-trap.utils';\n import { useElementSize } from '@vueuse/core';\n import moveFocusInside, { focusInside, getActiveElement } from 'focus-lock';\n\n import { type BentoInspectorProps } from './inspector.types';\n import { useFocusHistory } from './composables/use-focus-history/use-focus-history';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = withDefaults(defineProps<BentoInspectorProps>(), {\n activePage: '',\n expandable: false,\n isOpen: false,\n loading: false,\n size: 'small',\n relativeLayout: 'push-content',\n pageFocusAnchor: null,\n });\n\n const emit = defineEmits<{\n /**\n * Emits update to keep isOpen prop in sync\n */\n (e: 'update:is-open', value: boolean): void;\n /**\n * Emits update to keep activePage prop in sync\n */\n (e: 'update:active-page', value: string): void;\n /**\n * Emits event when user click expand button\n */\n (e: 'expand'): void;\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const returnToMainContentDescriptionId = generateUid('returnToMainContentDescription');\n const wrapper = ref<HTMLElement>(null);\n const inspector = ref<HTMLElement>(null);\n const page = ref<HTMLElement>(null);\n const inspectorLastFocusedElement = ref<HTMLElement>(null);\n\n const { width: wrapperWidth } = useElementSize(wrapper);\n\n const isCompact = computed(() => {\n const COMPACT_THRESHOLD_SMALL = 740;\n const COMPACT_THRESHOLD_LARGE = 915;\n\n // small inspector to occupy full screen if < 740px\n // large inspector to occupy full screen if < 915px\n const threshold = props.size === 'small' ? COMPACT_THRESHOLD_SMALL : COMPACT_THRESHOLD_LARGE;\n\n return wrapperWidth.value > 0 && wrapperWidth.value < threshold;\n });\n\n const computedPageLastFocusedElement = computed(() => props.pageFocusAnchor);\n\n const conditionalClass = computed(() => ({\n [`b-inspector--${props.size}`]: true,\n [`b-inspector--${props.relativeLayout}`]: true,\n [`b-inspector--is-compact`]: isCompact.value,\n }));\n\n const inspectorAriaLabel = computed(() => `${t('inspector')}, ${props.title}`);\n\n const { findValidFocusFallback } = useFocusHistory(page);\n\n const setFocus = async () => {\n if (props.isOpen) {\n await nextTick();\n moveFocusInside(inspector.value, computedPageLastFocusedElement.value);\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 focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n }\n };\n\n const handleTabNavigation = event => {\n if (isCompact.value) {\n return;\n }\n const direction = event.shiftKey ? -1 : 1;\n const focusableEl = getNextFocusableElement(direction, inspector.value);\n // If the nextfocusableEl is the same as the activeElement that means it's the last focusable element\n // inside the inspector, so the focus is moved back to the last focused element on the page\n if (getActiveElement() === focusableEl) {\n event.preventDefault();\n inspectorLastFocusedElement.value = document.activeElement as HTMLElement;\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n // Set active-page as undefined when focus is not on page\n emit('update:active-page', undefined);\n }\n };\n\n const handleSectionFocus = event => {\n const sectionShortcut = event.shiftKey && event.ctrlKey && event.key === 'S';\n if (props.isOpen && !isCompact.value && sectionShortcut) {\n moveFocusBetweenSections();\n }\n };\n\n const moveFocusBetweenSections = () => {\n if (focusInside(inspector.value)) {\n inspectorLastFocusedElement.value = document.activeElement as HTMLElement;\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n // Set active-page as undefined when focus is not on page\n emit('update:active-page', undefined);\n } else {\n focusElement(inspectorLastFocusedElement.value);\n }\n };\n\n const focusElement = (element: HTMLElement) => {\n if (!element) {\n return;\n }\n element?.focus();\n if (document.activeElement !== element) {\n focusElement(element.parentElement);\n }\n };\n\n watch(\n () => props.activePage,\n () => {\n if (props.activePage) {\n setFocus();\n }\n }\n );\n\n if (!props.activePage) {\n deprecate(\n 'BentoInspector \"active-page\" as optional',\n `Make sure to set the \"active-page\" prop and keep it in sync with \"update:active-page\".\n \"active-page\" prop will be required in the next version`,\n '2.0.0'\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 * :active-page=\"activePage\"\n * expandable\n * @update:is-open=\"isOpen = $event\"\n * @update:active-page=\"activePage = $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"],"names":["useFocusHistory","targetEl","focusHistory","ref","currentActiveElement","useActiveElement","watch","newlyFocusedElement","el","__default__","messages","props","__props","emit","__emit","t","useI18n","returnToMainContentDescriptionId","generateUid","wrapper","inspector","page","inspectorLastFocusedElement","wrapperWidth","useElementSize","isCompact","computed","threshold","computedPageLastFocusedElement","conditionalClass","inspectorAriaLabel","findValidFocusFallback","setFocus$1","nextTick","setFocus","focusElement","handleTabNavigation","event","direction","focusableEl","getNextFocusableElement","getActiveElement","handleSectionFocus","sectionShortcut","moveFocusBetweenSections","focusInside","element","deprecate"],"mappings":";;;;;;;;;;;;AAQO,SAAAA,GAAAC,GAAA;AAGH,QAAAC,IAAAC,EAAA,CAAA,CAAA,GAEAC,IAAAC,GA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"file":"inspector.B9k4tJWe.js","sources":["../../../vue2/src/components/inspector/composables/use-focus-history/use-focus-history.ts","../../../vue2/src/components/inspector/inspector.vue"],"sourcesContent":["import { ref, type Ref } from 'vue';\nimport { useActiveElement } from '@vueuse/core';\nimport { watch } from 'vue';\n\n/**\n * A composable to track the focus history within a target element.\n * @param targetEl The stable parent element to monitor for focus changes.\n */\nexport function useFocusHistory(targetEl: Ref<HTMLElement | null>) {\n const MAX_HISTORY_LENGTH = 3;\n\n const focusHistory = ref<Array<Element>>([]);\n\n const currentActiveElement = useActiveElement();\n\n // Edge case 1:\n // While the inspector is opened, if user tabs through the data-grid to the inspector, and closes it,\n // it returns to the last element on the data grid regardless if it is a data-grid-cell.\n //\n // Edge case 2:\n // Buttons or actions teleported out of the data-grid may have the focus shifted into a different context.\n watch(currentActiveElement, newlyFocusedElement => {\n // Check if the newly focused element is a child of our target container.\n if (!targetEl.value || !newlyFocusedElement || !targetEl.value.contains(newlyFocusedElement)) {\n return;\n }\n\n // Add the focused element to the history\n focusHistory.value.unshift(newlyFocusedElement);\n\n if (focusHistory.value.length > MAX_HISTORY_LENGTH) {\n focusHistory.value.pop();\n }\n });\n\n /**\n * Iterates through the focus history to find the first valid element\n * that is still present in the DOM.\n * @returns The first valid historical element, or null if none are found.\n */\n const findValidFocusFallback = (): HTMLElement | null => {\n for (const el of focusHistory.value) {\n if (el && document.body.contains(el as Node)) {\n return el as HTMLElement;\n }\n }\n\n return null; // No valid fallback found\n };\n\n return {\n findValidFocusFallback,\n };\n}\n","<template>\n <div ref=\"wrapper\" class=\"b-inspector\" :class=\"conditionalClass\" @keydown=\"handleSectionFocus\">\n <div ref=\"page\" 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\n v-if=\"isOpen\"\n ref=\"inspector\"\n class=\"b-inspector__container-wrapper\"\n :aria-label=\"inspectorAriaLabel\"\n @keydown.tab=\"handleTabNavigation\"\n >\n <bento-focus-trap :disabled=\"!isCompact\">\n <div class=\"b-inspector__container\">\n <div class=\"b-inspector__header\">\n <template v-if=\"!isCompact\">\n <bento-button\n class=\"b-inspector__return-content\"\n variant=\"secondary\"\n condensed\n :aria-describedby=\"returnToMainContentDescriptionId\"\n @click=\"moveFocusBetweenSections\"\n >\n {{ t('returnToMainContent') }}\n </bento-button>\n <span\n :id=\"returnToMainContentDescriptionId\"\n class=\"b-inspector__return-content-description\"\n >{{ t('returnToMainContentDescription') }}</span\n >\n </template>\n <bento-typography 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 </div>\n </bento-focus-trap>\n </aside>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, ref, watch } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoButton } from '@/components/button';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import ExpandIcon from '@adyen/ui-assets-icons-16/vue/expand';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { generateUid } from '@/core/utils/ts';\n import { useI18n } from '@/utils/ts/i18n';\n import { deprecate } from '@/utils/ts/deprecate';\n import { getNextFocusableElement } from '@/utils/ts/focus-trap.utils';\n import { useElementSize } from '@vueuse/core';\n import moveFocusInside, { focusInside, getActiveElement } from 'focus-lock';\n\n import { type BentoInspectorProps } from './inspector.types';\n import { useFocusHistory } from './composables/use-focus-history/use-focus-history';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = withDefaults(defineProps<BentoInspectorProps>(), {\n activePage: '',\n expandable: false,\n isOpen: false,\n loading: false,\n size: 'small',\n relativeLayout: 'push-content',\n pageFocusAnchor: null,\n });\n\n const emit = defineEmits<{\n /**\n * Emits update to keep isOpen prop in sync\n */\n (e: 'update:is-open', value: boolean): void;\n /**\n * Emits update to keep activePage prop in sync\n */\n (e: 'update:active-page', value: string): void;\n /**\n * Emits event when user click expand button\n */\n (e: 'expand'): void;\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const returnToMainContentDescriptionId = generateUid('returnToMainContentDescription');\n const wrapper = ref<HTMLElement>(null);\n const inspector = ref<HTMLElement>(null);\n const page = ref<HTMLElement>(null);\n const inspectorLastFocusedElement = ref<HTMLElement>(null);\n\n const { width: wrapperWidth } = useElementSize(wrapper);\n\n const isCompact = computed(() => {\n const COMPACT_THRESHOLD_SMALL = 740;\n const COMPACT_THRESHOLD_LARGE = 915;\n\n // small inspector to occupy full screen if < 740px\n // large inspector to occupy full screen if < 915px\n const threshold = props.size === 'small' ? COMPACT_THRESHOLD_SMALL : COMPACT_THRESHOLD_LARGE;\n\n return wrapperWidth.value > 0 && wrapperWidth.value < threshold;\n });\n\n const computedPageLastFocusedElement = computed(() => props.pageFocusAnchor);\n\n const conditionalClass = computed(() => ({\n [`b-inspector--${props.size}`]: true,\n [`b-inspector--${props.relativeLayout}`]: true,\n [`b-inspector--is-compact`]: isCompact.value,\n }));\n\n const inspectorAriaLabel = computed(() => `${t('inspector')}, ${props.title}`);\n\n const { findValidFocusFallback } = useFocusHistory(page);\n\n const setFocus = async () => {\n if (props.isOpen) {\n await nextTick();\n moveFocusInside(inspector.value, computedPageLastFocusedElement.value);\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 focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n }\n };\n\n const handleTabNavigation = event => {\n if (isCompact.value) {\n return;\n }\n const direction = event.shiftKey ? -1 : 1;\n const focusableEl = getNextFocusableElement(direction, inspector.value);\n // If the nextfocusableEl is the same as the activeElement that means it's the last focusable element\n // inside the inspector, so the focus is moved back to the last focused element on the page\n if (getActiveElement() === focusableEl) {\n event.preventDefault();\n inspectorLastFocusedElement.value = document.activeElement as HTMLElement;\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n // Set active-page as undefined when focus is not on page\n emit('update:active-page', undefined);\n }\n };\n\n const handleSectionFocus = event => {\n const sectionShortcut = event.shiftKey && event.ctrlKey && event.key === 'S';\n if (props.isOpen && !isCompact.value && sectionShortcut) {\n moveFocusBetweenSections();\n }\n };\n\n const moveFocusBetweenSections = () => {\n if (focusInside(inspector.value)) {\n inspectorLastFocusedElement.value = document.activeElement as HTMLElement;\n focusElement(computedPageLastFocusedElement.value ?? findValidFocusFallback());\n // Set active-page as undefined when focus is not on page\n emit('update:active-page', undefined);\n } else {\n focusElement(inspectorLastFocusedElement.value);\n }\n };\n\n const focusElement = (element: HTMLElement) => {\n if (!element) {\n return;\n }\n element?.focus();\n if (document.activeElement !== element) {\n focusElement(element.parentElement);\n }\n };\n\n watch(\n () => props.activePage,\n () => {\n if (props.activePage) {\n setFocus();\n }\n }\n );\n\n if (!props.activePage) {\n deprecate(\n 'BentoInspector \"active-page\" as optional',\n `Make sure to set the \"active-page\" prop and keep it in sync with \"update:active-page\".\n \"active-page\" prop will be required in the next version`,\n '2.0.0'\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 * :active-page=\"activePage\"\n * expandable\n * @update:is-open=\"isOpen = $event\"\n * @update:active-page=\"activePage = $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"],"names":["useFocusHistory","targetEl","focusHistory","ref","currentActiveElement","useActiveElement","watch","newlyFocusedElement","el","__default__","messages","props","__props","emit","__emit","t","useI18n","returnToMainContentDescriptionId","generateUid","wrapper","inspector","page","inspectorLastFocusedElement","wrapperWidth","useElementSize","isCompact","computed","threshold","computedPageLastFocusedElement","conditionalClass","inspectorAriaLabel","findValidFocusFallback","setFocus$1","nextTick","setFocus","focusElement","handleTabNavigation","event","direction","focusableEl","getNextFocusableElement","getActiveElement","handleSectionFocus","sectionShortcut","moveFocusBetweenSections","focusInside","element","deprecate"],"mappings":";;;;;;;;;;;;AAQO,SAAAA,GAAAC,GAAA;AAGH,QAAAC,IAAAC,EAAA,CAAA,CAAA,GAEAC,IAAAC,GAAA;AAQA,SAAAC,EAAAF,GAAA,CAAAG,MAAA;AAEI,IAAA,CAAAN,EAAA,SAAA,CAAAM,KAAA,CAAAN,EAAA,MAAA,SAAAM,CAAA,MAKAL,EAAA,MAAA,QAAAK,CAAA,GAEAL,EAAA,MAAA,SAAA,KACIA,EAAA,MAAA,IAAA;AAAA,EACJ,CAAA,GAkBJ;AAAA,IAAO,wBAVP,MAAA;AACI,iBAAAM,KAAAN,EAAA;AACI,YAAAM,KAAA,SAAA,KAAA,SAAAA,CAAA;AACI,iBAAAA;AAIR,aAAA;AAAA,IAAO;AAAA,EAIP;AAER;;;;;yOCuLIC,KAAA,EAAA,MAAA,EAAA,UAAAC,EAAA,EAAA;;;;;;;;;;;;;;;AA7JA,UAAAC,IAAAC,GAUAC,IAAAC,GAeA,EAAA,GAAAC,EAAA,I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,UAAA,CAAAc,EAAA,SAAAkB,KACIC,EAAA;AAAA,IACJ,GAGJA,IAAA,MAAA;AACI,MAAAC,EAAAzB,EAAA,KAAA,KACIE,EAAA,QAAA,SAAA,eACAa,EAAAP,EAAA,SAAAG,EAAA,CAAA,GAEAlB,EAAA,sBAAA,MAAA,KAEAsB,EAAAb,EAAA,KAAA;AAAA,IACJ,GAGJa,IAAA,CAAAW,MAAA;AACI,MAAAA,MAGAA,GAAA,MAAA,GACA,SAAA,kBAAAA,KACIX,EAAAW,EAAA,aAAA;AAAA,IACJ;AAGJ,WAAAxC;AAAA,MAAA,MAAAK,EAAA;AAAA,MACgB,MAAA;AAER,QAAAA,EAAA,cACIqB,EAAA;AAAA,MACJ;AAAA,IACJ,GAGJrB,EAAA,cACIoC;AAAA,MAAA;AAAA,MACI;AAAA;AAAA,MACA;AAAA,IAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { n as s } from "./en-US.CCazFVNP.js";
|
|
2
|
+
import { s as r } from "./startOfWeek.Cvmo-f5J.js";
|
|
3
|
+
function o(a, t, e) {
|
|
4
|
+
const [i, m] = s(
|
|
5
|
+
e?.in,
|
|
6
|
+
a,
|
|
7
|
+
t
|
|
8
|
+
);
|
|
9
|
+
return +r(i, e) == +r(m, e);
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
o as i
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=isSameWeek.Dj6luS8h.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isSameWeek.
|
|
1
|
+
{"version":3,"file":"isSameWeek.Dj6luS8h.js","sources":["../../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isSameWeek.js"],"sourcesContent":["import { normalizeDates } from \"./_lib/normalizeDates.js\";\nimport { startOfWeek } from \"./startOfWeek.js\";\n\n/**\n * The {@link isSameWeek} function options.\n */\n\n/**\n * @name isSameWeek\n * @category Week Helpers\n * @summary Are the given dates in the same week (and month and year)?\n *\n * @description\n * Are the given dates in the same week (and month and year)?\n *\n * @param laterDate - The first date to check\n * @param earlierDate - The second date to check\n * @param options - An object with options\n *\n * @returns The dates are in the same week (and month and year)\n *\n * @example\n * // Are 31 August 2014 and 4 September 2014 in the same week?\n * const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4))\n * //=> true\n *\n * @example\n * // If week starts with Monday,\n * // are 31 August 2014 and 4 September 2014 in the same week?\n * const result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4), {\n * weekStartsOn: 1\n * })\n * //=> false\n *\n * @example\n * // Are 1 January 2014 and 1 January 2015 in the same week?\n * const result = isSameWeek(new Date(2014, 0, 1), new Date(2015, 0, 1))\n * //=> false\n */\nexport function isSameWeek(laterDate, earlierDate, options) {\n const [laterDate_, earlierDate_] = normalizeDates(\n options?.in,\n laterDate,\n earlierDate,\n );\n return (\n +startOfWeek(laterDate_, options) === +startOfWeek(earlierDate_, options)\n );\n}\n\n// Fallback for modularized imports:\nexport default isSameWeek;\n"],"names":["isSameWeek","laterDate","earlierDate","options","laterDate_","earlierDate_","normalizeDates","startOfWeek"],"mappings":";;AAuCO,SAASA,EAAWC,GAAWC,GAAaC,GAAS;AAC1D,QAAM,CAACC,GAAYC,CAAY,IAAIC;AAAA,IACjCH,GAAS;AAAA,IACTF;AAAA,IACAC;AAAA,EACJ;AACE,SACE,CAACK,EAAYH,GAAYD,CAAO,KAAM,CAACI,EAAYF,GAAcF,CAAO;AAE5E;","x_google_ignoreList":[0]}
|