@adyen/bento-vue3 1.89.2 → 1.90.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/components.d.ts +2 -0
- package/dist/@types/index.d.ts +403 -298
- package/dist/accordion.js +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/ai-tag.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/anchor-scroller.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/input-time.css +1 -0
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/secondary-nav.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/button.js +1 -1
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chip.js +1 -1
- package/dist/chunks/accordion-item.CZIxxSsH.js +141 -0
- package/dist/chunks/{accordion-item.BX1KrLMl.js.map → accordion-item.CZIxxSsH.js.map} +1 -1
- package/dist/chunks/action-bar.Pe_hvtja.js +336 -0
- package/dist/chunks/{action-bar.DLMaIUWW.js.map → action-bar.Pe_hvtja.js.map} +1 -1
- package/dist/chunks/ai-tag.BSlc78DU.js +137 -0
- package/dist/chunks/{ai-tag.DK63ExDc.js.map → ai-tag.BSlc78DU.js.map} +1 -1
- package/dist/chunks/{alert.C_8-VNi_.js → alert.CFWN2E0b.js} +86 -79
- package/dist/chunks/{alert.C_8-VNi_.js.map → alert.CFWN2E0b.js.map} +1 -1
- package/dist/chunks/anchor-scroller.DSfXK6vK.js +214 -0
- package/dist/chunks/{anchor-scroller.NhjLDBZI.js.map → anchor-scroller.DSfXK6vK.js.map} +1 -1
- package/dist/chunks/{base-modal.C2-JyHC_.js → base-modal.BjjDrx0z.js} +132 -125
- package/dist/chunks/{base-modal.C2-JyHC_.js.map → base-modal.BjjDrx0z.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.BQFAgAI2.js → button-actions-with-menu.DvkS16ur.js} +2 -2
- package/dist/chunks/{button-actions-with-menu.BQFAgAI2.js.map → button-actions-with-menu.DvkS16ur.js.map} +1 -1
- package/dist/chunks/{button-actions.cMQWyZne.js → button-actions.Bh_PZ_fV.js} +202 -188
- package/dist/chunks/{button-actions.cMQWyZne.js.map → button-actions.Bh_PZ_fV.js.map} +1 -1
- package/dist/chunks/{calendar.DcCqkSNJ.js → calendar.CH-1Vgeb.js} +343 -329
- package/dist/chunks/{calendar.DcCqkSNJ.js.map → calendar.CH-1Vgeb.js.map} +1 -1
- package/dist/chunks/card.BzCGCCzH.js +223 -0
- package/dist/chunks/{card.CoxQ_L0w.js.map → card.BzCGCCzH.js.map} +1 -1
- package/dist/chunks/{checkbox-group.96n9Cc3W.js → checkbox-group.D_fN6Glu.js} +4 -4
- package/dist/chunks/{checkbox-group.96n9Cc3W.js.map → checkbox-group.D_fN6Glu.js.map} +1 -1
- package/dist/chunks/{checkbox.C6ATh8f5.js → checkbox.BlAhQl9N.js} +78 -71
- package/dist/chunks/{checkbox.C6ATh8f5.js.map → checkbox.BlAhQl9N.js.map} +1 -1
- package/dist/chunks/chip.DFldnqfz.js +72 -0
- package/dist/chunks/{chip.CdgpQyXN.js.map → chip.DFldnqfz.js.map} +1 -1
- package/dist/chunks/{code-snippet.DgAuuZF5.js → code-snippet.BePxxR3q.js} +113 -106
- package/dist/chunks/{code-snippet.DgAuuZF5.js.map → code-snippet.BePxxR3q.js.map} +1 -1
- package/dist/chunks/{controls-group.C7hOE1F4.js → controls-group.Cxk-0fCy.js} +2 -2
- package/dist/chunks/{controls-group.C7hOE1F4.js.map → controls-group.Cxk-0fCy.js.map} +1 -1
- package/dist/chunks/copy.CL893i9-.js +114 -0
- package/dist/chunks/{copy.C2kQ1PbI.js.map → copy.CL893i9-.js.map} +1 -1
- package/dist/chunks/{country.CaGc08Ps.js → country.15m_ATbO.js} +3 -3
- package/dist/chunks/{country.CaGc08Ps.js.map → country.15m_ATbO.js.map} +1 -1
- package/dist/chunks/country.types.6a7xxZIR.js +26 -0
- package/dist/chunks/{country.types.DjpMGz7a.js.map → country.types.6a7xxZIR.js.map} +1 -1
- package/dist/chunks/{dashboard-section.UafHRkMa.js → dashboard-section.CiNDItU2.js} +3 -3
- package/dist/chunks/{dashboard-section.UafHRkMa.js.map → dashboard-section.CiNDItU2.js.map} +1 -1
- package/dist/chunks/{dashed-underline.CcDV2Aks.js → dashed-underline.CwdpUz76.js} +3 -3
- package/dist/chunks/{dashed-underline.CcDV2Aks.js.map → dashed-underline.CwdpUz76.js.map} +1 -1
- package/dist/chunks/{data-grid-template.CnC4TQvk.js → data-grid-template.nXn1dLCw.js} +4 -4
- package/dist/chunks/{data-grid-template.CnC4TQvk.js.map → data-grid-template.nXn1dLCw.js.map} +1 -1
- package/dist/chunks/data-grid.CXWaoqzi.js +4242 -0
- package/dist/chunks/data-grid.CXWaoqzi.js.map +1 -0
- package/dist/chunks/date-picker.DPjCROIP.js +238 -0
- package/dist/chunks/{date-picker.dlzZ_-5f.js.map → date-picker.DPjCROIP.js.map} +1 -1
- package/dist/chunks/date-range-picker.fyrfFd04.js +998 -0
- package/dist/chunks/date-range-picker.fyrfFd04.js.map +1 -0
- package/dist/chunks/dialog-page.Bh-7RAwX.js +163 -0
- package/dist/chunks/{dialog-page.COfKqjT-.js.map → dialog-page.Bh-7RAwX.js.map} +1 -1
- package/dist/chunks/{dropdown-default-textbox.bq9AlGzJ.js → dropdown-default-textbox.aYsTZDZ7.js} +69 -62
- package/dist/chunks/{dropdown-default-textbox.bq9AlGzJ.js.map → dropdown-default-textbox.aYsTZDZ7.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.Ysrac5GN.js → dropdown-tag.B7OA_Yv9.js} +5 -5
- package/dist/chunks/{dropdown-tag.Ysrac5GN.js.map → dropdown-tag.B7OA_Yv9.js.map} +1 -1
- package/dist/chunks/{dropdown.MhmX1P9o.js → dropdown.Do-mZiI6.js} +285 -271
- package/dist/chunks/{dropdown.MhmX1P9o.js.map → dropdown.Do-mZiI6.js.map} +1 -1
- package/dist/chunks/error-message.849uzpkq.js +157 -0
- package/dist/chunks/{error-message.DCgo8q20.js.map → error-message.849uzpkq.js.map} +1 -1
- package/dist/chunks/{file-uploader.Bfd1uUMe.js → file-uploader.BUvDU_cn.js} +604 -583
- package/dist/chunks/{file-uploader.Bfd1uUMe.js.map → file-uploader.BUvDU_cn.js.map} +1 -1
- package/dist/chunks/{filter-bar.CkAjLQol.js → filter-bar.fowl40RS.js} +998 -928
- package/dist/chunks/{filter-bar.CkAjLQol.js.map → filter-bar.fowl40RS.js.map} +1 -1
- package/dist/chunks/fixed-scroller.yVsaQzy5.js +157 -0
- package/dist/chunks/{fixed-scroller.DtkaGyMD.js.map → fixed-scroller.yVsaQzy5.js.map} +1 -1
- package/dist/chunks/{footer-actions.BcYSsoUg.js → footer-actions.uoNbOGAQ.js} +2 -2
- package/dist/chunks/{footer-actions.BcYSsoUg.js.map → footer-actions.uoNbOGAQ.js.map} +1 -1
- package/dist/chunks/form-layout-title.Cr3wdpK_.js +239 -0
- package/dist/chunks/{form-layout-title.DW5Kg1rh.js.map → form-layout-title.Cr3wdpK_.js.map} +1 -1
- package/dist/chunks/{header-meta.Bym9AlQm.js → header-meta.CmH6SnjE.js} +98 -84
- package/dist/chunks/{header-meta.Bym9AlQm.js.map → header-meta.CmH6SnjE.js.map} +1 -1
- package/dist/chunks/{header-with-views.Djba6iol.js → header-with-views.B2pPBcTf.js} +1091 -1070
- package/dist/chunks/{header-with-views.Djba6iol.js.map → header-with-views.B2pPBcTf.js.map} +1 -1
- package/dist/chunks/{header.o-7SyHtU.js → header.BVM8Usdi.js} +3 -3
- package/dist/chunks/{header.o-7SyHtU.js.map → header.BVM8Usdi.js.map} +1 -1
- package/dist/chunks/{info-icon.BUala_wq.js → info-icon.B3MDsjMu.js} +2 -2
- package/dist/chunks/{info-icon.BUala_wq.js.map → info-icon.B3MDsjMu.js.map} +1 -1
- package/dist/chunks/input-field-password.CHb2Ros_.js +353 -0
- package/dist/chunks/{input-field-password.DZytmp_p.js.map → input-field-password.CHb2Ros_.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.CxblrmaU.js → input-field-phone-number.DM2rmZkQ.js} +12 -5
- package/dist/chunks/{input-field-phone-number.CxblrmaU.js.map → input-field-phone-number.DM2rmZkQ.js.map} +1 -1
- package/dist/chunks/{input-field.CfU0ZKtL.js → input-field.DnYjM6yy.js} +118 -111
- package/dist/chunks/{input-field.CfU0ZKtL.js.map → input-field.DnYjM6yy.js.map} +1 -1
- package/dist/chunks/input-time.DeJ8lDio.js +103 -0
- package/dist/chunks/input-time.DeJ8lDio.js.map +1 -0
- package/dist/chunks/{inspector.B9k4tJWe.js → inspector.DMhKNW1K.js} +70 -63
- package/dist/chunks/{inspector.B9k4tJWe.js.map → inspector.DMhKNW1K.js.map} +1 -1
- package/dist/chunks/{list-item.DO5uULke.js → list-item.BHvXpqaS.js} +2 -2
- package/dist/chunks/{list-item.DO5uULke.js.map → list-item.BHvXpqaS.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.Cvplth7d.js → listbox-option-tag.CVxaZqbc.js} +2 -2
- package/dist/chunks/{listbox-option-tag.Cvplth7d.js.map → listbox-option-tag.CVxaZqbc.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.CuKVyTWb.js → modal-fullscreen.9CSTqFQc.js} +54 -47
- package/dist/chunks/{modal-fullscreen.CuKVyTWb.js.map → modal-fullscreen.9CSTqFQc.js.map} +1 -1
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.DmPw0l5Y.js → modal.vue_vue_type_script_setup_true_lang.BAxTkaQM.js} +48 -41
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.DmPw0l5Y.js.map → modal.vue_vue_type_script_setup_true_lang.BAxTkaQM.js.map} +1 -1
- package/dist/chunks/pagination.DL-h8OLF.js +413 -0
- package/dist/chunks/{pagination.dpVc6Yt0.js.map → pagination.DL-h8OLF.js.map} +1 -1
- package/dist/chunks/{promo-banner.BzveHNOI.js → promo-banner.-H4r_cwj.js} +39 -32
- package/dist/chunks/{promo-banner.BzveHNOI.js.map → promo-banner.-H4r_cwj.js.map} +1 -1
- package/dist/chunks/{radio-group.Cuiq4mxy.js → radio-group.DzhQgXv9.js} +4 -4
- package/dist/chunks/{radio-group.Cuiq4mxy.js.map → radio-group.DzhQgXv9.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.DLMiT4f5.js → rich-text-editor.Ij2t4pyI.js} +418 -411
- package/dist/chunks/{rich-text-editor.DLMiT4f5.js.map → rich-text-editor.Ij2t4pyI.js.map} +1 -1
- package/dist/chunks/search-bar.DfNwnjes.js +114 -0
- package/dist/chunks/{search-bar.CsFyP0_I.js.map → search-bar.DfNwnjes.js.map} +1 -1
- package/dist/chunks/secondary-nav.CvipTDRh.js +285 -0
- package/dist/chunks/secondary-nav.CvipTDRh.js.map +1 -0
- package/dist/chunks/{segmented-control.KeQ5kuR1.js → segmented-control.CQWOO1-J.js} +2 -2
- package/dist/chunks/{segmented-control.KeQ5kuR1.js.map → segmented-control.CQWOO1-J.js.map} +1 -1
- package/dist/chunks/{selection-card-group.XM11Kk-4.js → selection-card-group.CcOWQAUC.js} +11 -11
- package/dist/chunks/{selection-card-group.XM11Kk-4.js.map → selection-card-group.CcOWQAUC.js.map} +1 -1
- package/dist/chunks/{sidepanel.b2QZ1Jsx.js → sidepanel.BObSv8UU.js} +56 -49
- package/dist/chunks/{sidepanel.b2QZ1Jsx.js.map → sidepanel.BObSv8UU.js.map} +1 -1
- package/dist/chunks/step.AsX2jAeL.js +268 -0
- package/dist/chunks/{step.BlwoLfdw.js.map → step.AsX2jAeL.js.map} +1 -1
- package/dist/chunks/structured-list-item.CgJR_ufh.js +112 -0
- package/dist/chunks/{structured-list-item.e-8kRleh.js.map → structured-list-item.CgJR_ufh.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.CcvOC03H.js → summary-grid.types.DKPhtHw3.js} +5 -5
- package/dist/chunks/{summary-grid.types.CcvOC03H.js.map → summary-grid.types.DKPhtHw3.js.map} +1 -1
- package/dist/chunks/{tab.mR5uUSdp.js → tab.9nyNZiGw.js} +2 -2
- package/dist/chunks/{tab.mR5uUSdp.js.map → tab.9nyNZiGw.js.map} +1 -1
- package/dist/chunks/{tag.DujMVFh-.js → tag.YN2r-Pp3.js} +2 -2
- package/dist/chunks/{tag.DujMVFh-.js.map → tag.YN2r-Pp3.js.map} +1 -1
- package/dist/chunks/textarea.C-sBemuo.js +256 -0
- package/dist/chunks/{textarea.CHV6Z8nt.js.map → textarea.C-sBemuo.js.map} +1 -1
- package/dist/chunks/timeline-item.CHk8wXeT.js +433 -0
- package/dist/chunks/{timeline-item.CaGcRZbt.js.map → timeline-item.CHk8wXeT.js.map} +1 -1
- package/dist/chunks/{toast.C2oehk9P.js → toast.De4MTkiH.js} +64 -57
- package/dist/chunks/{toast.C2oehk9P.js.map → toast.De4MTkiH.js.map} +1 -1
- package/dist/chunks/{tooltip.CbADa_4p.js → tooltip.DHfG2aRt.js} +40 -38
- package/dist/chunks/tooltip.DHfG2aRt.js.map +1 -0
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.BOruzlTt.js → tutorial.vue_vue_type_script_setup_true_lang.CUDeriBU.js} +120 -113
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.BOruzlTt.js.map → tutorial.vue_vue_type_script_setup_true_lang.CUDeriBU.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.ClEJRFAd.js → use-cached-selected-values.DIbfa5F1.js} +381 -360
- package/dist/chunks/{use-cached-selected-values.ClEJRFAd.js.map → use-cached-selected-values.DIbfa5F1.js.map} +1 -1
- package/dist/chunks/{use-country-items.D_3LBe2I.js → use-country-items.Dp7X1r2e.js} +3 -3
- package/dist/chunks/{use-country-items.D_3LBe2I.js.map → use-country-items.Dp7X1r2e.js.map} +1 -1
- package/dist/chunks/{use-country-phon-code.DoqTGkNr.js → use-country-phon-code.BzcawGpE.js} +107 -104
- package/dist/chunks/{use-country-phon-code.DoqTGkNr.js.map → use-country-phon-code.BzcawGpE.js.map} +1 -1
- package/dist/chunks/{use-date-input-formatter.CDRzd-hW.js → use-date-input-formatter.BiIraXZZ.js} +2 -2
- package/dist/chunks/{use-date-input-formatter.CDRzd-hW.js.map → use-date-input-formatter.BiIraXZZ.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/country.js +3 -3
- package/dist/dashboard-template.js +1 -1
- package/dist/dashed-underline.js +1 -1
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/date-range-picker.js +2 -2
- package/dist/draggable-handle.js +51 -44
- package/dist/draggable-handle.js.map +1 -1
- package/dist/dropdown.js +4 -4
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/form-layout.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +205 -203
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +1 -1
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/input-time.js +5 -0
- package/dist/input-time.js.map +1 -0
- package/dist/inspector.js +1 -1
- package/dist/internal.js +12 -12
- package/dist/list.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/pagination.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/promo-banner.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/stepper.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tag.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +4 -4
- package/dist/chunks/accordion-item.BX1KrLMl.js +0 -134
- package/dist/chunks/action-bar.DLMaIUWW.js +0 -329
- package/dist/chunks/ai-tag.DK63ExDc.js +0 -130
- package/dist/chunks/anchor-scroller.NhjLDBZI.js +0 -207
- package/dist/chunks/card.CoxQ_L0w.js +0 -216
- package/dist/chunks/chip.CdgpQyXN.js +0 -65
- package/dist/chunks/copy.C2kQ1PbI.js +0 -107
- package/dist/chunks/country.types.DjpMGz7a.js +0 -19
- package/dist/chunks/data-grid.BSIXLRm7.js +0 -4014
- package/dist/chunks/data-grid.BSIXLRm7.js.map +0 -1
- package/dist/chunks/date-picker.dlzZ_-5f.js +0 -231
- package/dist/chunks/date-range-picker.DC6CK0As.js +0 -995
- package/dist/chunks/date-range-picker.DC6CK0As.js.map +0 -1
- package/dist/chunks/dialog-page.COfKqjT-.js +0 -156
- package/dist/chunks/error-message.DCgo8q20.js +0 -143
- package/dist/chunks/fixed-scroller.DtkaGyMD.js +0 -150
- package/dist/chunks/form-layout-title.DW5Kg1rh.js +0 -230
- package/dist/chunks/input-field-password.DZytmp_p.js +0 -346
- package/dist/chunks/pagination.dpVc6Yt0.js +0 -401
- package/dist/chunks/search-bar.CsFyP0_I.js +0 -107
- package/dist/chunks/secondary-nav.CLBdq98c.js +0 -138
- package/dist/chunks/secondary-nav.CLBdq98c.js.map +0 -1
- package/dist/chunks/step.BlwoLfdw.js +0 -259
- package/dist/chunks/structured-list-item.e-8kRleh.js +0 -105
- package/dist/chunks/textarea.CHV6Z8nt.js +0 -247
- package/dist/chunks/timeline-item.CaGcRZbt.js +0 -419
- package/dist/chunks/tooltip.CbADa_4p.js.map +0 -1
|
@@ -1,26 +1,33 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { a as Ie, I as
|
|
3
|
-
import { p as
|
|
4
|
-
import { u as
|
|
5
|
-
import { g as
|
|
1
|
+
import { defineComponent as he, useAttrs as Ee, useSlots as _e, ref as k, provide as Te, inject as j, toRef as Ne, computed as l, toRefs as Fe, openBlock as r, createBlock as u, unref as t, normalizeClass as Ae, withCtx as b, renderSlot as p, createCommentVNode as d, createElementVNode as I, createElementBlock as v, withModifiers as z, mergeProps as O, withKeys as ge, createTextVNode as X, toDisplayString as G, createVNode as Ce } from "vue";
|
|
2
|
+
import { a as Ie, I as Oe, b as Se, B as Z } from "./dropdown.Do-mZiI6.js";
|
|
3
|
+
import { p as S, d as R, B as L } from "./typography.B3J6_tYk.js";
|
|
4
|
+
import { u as Re } from "./form-field.D_2g7vaP.js";
|
|
5
|
+
import { g as h } from "./generate-uid.DBWe4g6T.js";
|
|
6
6
|
import { g as Q } from "./get-slot-text.8Fbl1GOr.js";
|
|
7
|
-
import { u as
|
|
8
|
-
import { u as
|
|
9
|
-
import { u as
|
|
10
|
-
import { u as
|
|
11
|
-
import { F as
|
|
7
|
+
import { u as Pe } from "./aria-label.CaUURpnB.js";
|
|
8
|
+
import { u as Be } from "./index.B875RXHM.js";
|
|
9
|
+
import { u as Me } from "./use-form-layout-loading.CWbjZiwP.js";
|
|
10
|
+
import { u as Ve } from "./use-has-slot.CyMiImRQ.js";
|
|
11
|
+
import { F as $e, E as Ue } from "./error-message.849uzpkq.js";
|
|
12
12
|
import { _ as He } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
13
13
|
import "../assets/input-field.css";
|
|
14
|
-
var m = /* @__PURE__ */ ((
|
|
14
|
+
var m = /* @__PURE__ */ ((o) => (o.DEFAULT = "default", o.PAYMENT_METHOD = "payment-method", o.STATIC_VALUE = "static-value", o.DROPDOWN = "dropdown", o))(m || {}), c = /* @__PURE__ */ ((o) => (o.START = "start", o.END = "end", o))(c || {}), E = /* @__PURE__ */ ((o) => (o.CONDENSED = "condensed", o.DISABLED = "disabled", o.READONLY = "readonly", o.ERROR = "error", o))(E || {}), P = /* @__PURE__ */ ((o) => (o.SEARCH = "search", o.TEXT = "text", o.NUMBER = "number", o))(P || {}), qe = /* @__PURE__ */ ((o) => (o.INPUT = "input", o.ESCAPE_PRESSED = "escape-pressed", o.UPDATE_DROPDOWN = "update:dropdown", o.DROPDOWN_INPUT = "dropdown-input", o.FOCUS = "focus", o.CHANGE = "change", o.BLUR = "blur", o.KEYDOWN = "keydown", o))(qe || {});
|
|
15
15
|
const x = {
|
|
16
|
+
"de-DE": { ariaLabelDropdownFallback: "{inputLabel} Dropdown", ariaLabelFallback: "Eingabefeld" },
|
|
17
|
+
"en-GB": { ariaLabelDropdownFallback: "{inputLabel} Drop-down", ariaLabelFallback: "Input field" },
|
|
16
18
|
"en-US": { ariaLabelDropdownFallback: "{inputLabel} Dropdown", ariaLabelFallback: "Input field" },
|
|
19
|
+
"es-ES": { ariaLabelDropdownFallback: "{inputLabel} desplegable", ariaLabelFallback: "Campo de entrada" },
|
|
20
|
+
"es-MX": { ariaLabelDropdownFallback: "{inputLabel} desplegable", ariaLabelFallback: "Campo de entrada" },
|
|
21
|
+
"fr-FR": { ariaLabelDropdownFallback: "Menu déroulant {inputLabel}", ariaLabelFallback: "Champ de saisie" },
|
|
22
|
+
"it-IT": { ariaLabelDropdownFallback: "Menu a discesa {inputLabel}", ariaLabelFallback: "Campo di immissione" },
|
|
17
23
|
"ja-JP": { ariaLabelDropdownFallback: "{inputLabel}ドロップダウン", ariaLabelFallback: "入力フィールド" },
|
|
18
|
-
"pt-BR": { ariaLabelDropdownFallback: "Menu suspenso {inputLabel}", ariaLabelFallback: "Campo de entrada" }
|
|
19
|
-
|
|
24
|
+
"pt-BR": { ariaLabelDropdownFallback: "Menu suspenso {inputLabel}", ariaLabelFallback: "Campo de entrada" },
|
|
25
|
+
"zh-CN": { ariaLabelDropdownFallback: "{inputLabel} 下拉菜单", ariaLabelFallback: "输入字段" }
|
|
26
|
+
}, 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"], Ge = ["id"], Ze = ["id"], Qe = {
|
|
20
27
|
name: "bento-input-field",
|
|
21
28
|
model: { prop: "modelValue" },
|
|
22
29
|
i18n: { messages: x }
|
|
23
|
-
}, xe = /* @__PURE__ */
|
|
30
|
+
}, xe = /* @__PURE__ */ he({
|
|
24
31
|
...Qe,
|
|
25
32
|
props: {
|
|
26
33
|
ariaHidden: { type: Boolean, default: !0 },
|
|
@@ -33,7 +40,7 @@ const x = {
|
|
|
33
40
|
slashedZero: { type: Boolean, default: !1 },
|
|
34
41
|
staticValue: { default: "" },
|
|
35
42
|
staticValuePosition: { default: c.START },
|
|
36
|
-
type: { default:
|
|
43
|
+
type: { default: P.TEXT },
|
|
37
44
|
value: { default: void 0 },
|
|
38
45
|
variant: { default: m.DEFAULT },
|
|
39
46
|
description: { default: "" },
|
|
@@ -47,71 +54,71 @@ const x = {
|
|
|
47
54
|
tooltipText: { default: null }
|
|
48
55
|
},
|
|
49
56
|
emits: ["blur", "click", "change", "dropdown-input", "escape-pressed", "focus", "keydown", "keyup", "input", "update:dropdown", "update:model-value"],
|
|
50
|
-
setup(
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
const q = j(
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
}, { isReadOnly: w } =
|
|
58
|
-
() => w.value ||
|
|
59
|
-
),
|
|
60
|
-
() =>
|
|
61
|
-
), ie =
|
|
62
|
-
() =>
|
|
63
|
-
), ne =
|
|
64
|
-
() =>
|
|
65
|
-
),
|
|
66
|
-
() =>
|
|
67
|
-
), ue =
|
|
68
|
-
() =>
|
|
69
|
-
),
|
|
70
|
-
() => !
|
|
71
|
-
), pe =
|
|
72
|
-
() =>
|
|
73
|
-
), me =
|
|
57
|
+
setup(o, { expose: ee, emit: ae }) {
|
|
58
|
+
const B = Ee(), _ = _e(), a = o, n = ae, { emitValue: oe } = Re(n), { t: M } = Be({ messages: x }), s = Ve(_), V = k(null), g = k(null), $ = h("input"), y = h("input-dropdown"), T = h("input-static-value"), U = h("input-description"), H = h("input-error"), C = k(!1);
|
|
59
|
+
Te(Ie, !0);
|
|
60
|
+
const q = j(Oe, k(void 0)), te = () => {
|
|
61
|
+
C.value = !0, n("focus");
|
|
62
|
+
}, le = () => {
|
|
63
|
+
C.value = !1, n("blur");
|
|
64
|
+
}, { isReadOnly: w } = Me(Ne(a, "readonly")), Y = l(
|
|
65
|
+
() => w.value || a.dropdown?.readonly
|
|
66
|
+
), N = l(
|
|
67
|
+
() => a.variant === m.STATIC_VALUE && !!_.staticValue
|
|
68
|
+
), ie = l(() => a.variant === m.DEFAULT), de = l(() => a.variant === m.PAYMENT_METHOD), re = l(
|
|
69
|
+
() => N.value && a.staticValuePosition === c.START
|
|
70
|
+
), ne = l(
|
|
71
|
+
() => N.value && a.staticValuePosition === c.END
|
|
72
|
+
), F = l(() => a.variant === m.DROPDOWN && !!a.dropdown), se = l(
|
|
73
|
+
() => F.value && a.dropdownPosition === c.START
|
|
74
|
+
), ue = l(
|
|
75
|
+
() => F.value && a.dropdownPosition === c.END
|
|
76
|
+
), A = l(
|
|
77
|
+
() => !a.disabled && !w.value && (!!a.errorMessage || a.error)
|
|
78
|
+
), pe = l(() => Q(_)("default") || a.label), fe = l(() => Q(_)("description") || a.description), ce = l(() => F.value === !0 && N.value === !0 ? `${T} ${y}` : F.value === !0 ? `${y}` : N.value === !0 ? `${T}` : null), be = l(() => M("ariaLabelFallback")), ve = l(
|
|
79
|
+
() => M("ariaLabelDropdownFallback", { inputLabel: K.value })
|
|
80
|
+
), me = k(B["aria-label"]), { ariaLabel: ye } = Fe(a), K = Pe({
|
|
74
81
|
ariaLabel: me.value,
|
|
75
82
|
// TODO: take this line away when the aria-label props is removed
|
|
76
83
|
label: ye,
|
|
77
84
|
defaultFallback: pe.value || be
|
|
78
|
-
}), we =
|
|
79
|
-
() => `${fe.value ? U : ""} ${
|
|
80
|
-
), De =
|
|
81
|
-
[`b-input-field--${
|
|
82
|
-
[`b-input-field--${
|
|
83
|
-
[`b-input-field--${
|
|
84
|
-
[`b-input-field--${
|
|
85
|
-
"b-input-field--slashed-zero":
|
|
86
|
-
})), W =
|
|
85
|
+
}), we = l(
|
|
86
|
+
() => `${fe.value ? U : ""} ${A.value && a.errorMessage ? H : ""}`
|
|
87
|
+
), De = l(() => ({
|
|
88
|
+
[`b-input-field--${E.CONDENSED}`]: a.condensed,
|
|
89
|
+
[`b-input-field--${E.DISABLED}`]: a.disabled,
|
|
90
|
+
[`b-input-field--${E.READONLY}`]: w.value,
|
|
91
|
+
[`b-input-field--${E.ERROR}`]: A.value,
|
|
92
|
+
"b-input-field--slashed-zero": a.slashedZero
|
|
93
|
+
})), W = l(() => ({
|
|
87
94
|
"aria-label": ve.value,
|
|
88
|
-
...
|
|
89
|
-
})),
|
|
95
|
+
...a.dropdown
|
|
96
|
+
})), ke = (e) => {
|
|
90
97
|
const i = e.target.value;
|
|
91
|
-
!
|
|
98
|
+
!a.disabled && !w.value && oe(i);
|
|
92
99
|
}, J = (e) => {
|
|
93
|
-
n("dropdown-input", e), n("update:dropdown", { ...
|
|
100
|
+
n("dropdown-input", e), n("update:dropdown", { ...a?.dropdown, value: e });
|
|
94
101
|
}, D = () => {
|
|
95
|
-
|
|
102
|
+
V.value.focus();
|
|
96
103
|
};
|
|
97
104
|
ee({
|
|
98
105
|
focusInput: D,
|
|
99
106
|
focus: () => {
|
|
100
|
-
|
|
107
|
+
a.variant === "dropdown" ? g.value.focus() : D();
|
|
101
108
|
}
|
|
102
109
|
});
|
|
103
|
-
const
|
|
104
|
-
return !Object.values(
|
|
105
|
-
`"bento-input-field" dropdown does not support the type '${
|
|
106
|
-
) :
|
|
107
|
-
`"bento-input-field" dropdown does not support the type '${
|
|
108
|
-
) :
|
|
110
|
+
const Le = j(Se, "");
|
|
111
|
+
return !Object.values(P).includes(a.type) && !Le && (a.type === "tel" ? S(
|
|
112
|
+
`"bento-input-field" dropdown does not support the type '${a.type}', use "bento-input-field-phone-number" instead.`
|
|
113
|
+
) : a.type === "password" ? S(
|
|
114
|
+
`"bento-input-field" dropdown does not support the type '${a.type}', use "bento-input-field-password" instead.`
|
|
115
|
+
) : S(`"bento-input-field" dropdown does not support the type '${a.type}'`)), a.error && R(
|
|
109
116
|
'BentoInputField "error" property',
|
|
110
117
|
`Use the BentoInputField "errorMessage" property instead to indicate that there is a modifier error.
|
|
111
118
|
Having the field as "undefined" will hide/remove the error.
|
|
112
119
|
<bento-dropdown errorMessage="Error message text" />`,
|
|
113
120
|
"2.0.0"
|
|
114
|
-
), s("defaultIconBefore") &&
|
|
121
|
+
), s("defaultIconBefore") && R(
|
|
115
122
|
'BentoInputField "defaultIconBefore" slot',
|
|
116
123
|
`Use the BentoInputField "iconBefore" slot instead to add an icon at the left side of the input field
|
|
117
124
|
<bento-input-field>
|
|
@@ -120,21 +127,21 @@ const x = {
|
|
|
120
127
|
</template>
|
|
121
128
|
</bento-input-field>`,
|
|
122
129
|
"2.0.0"
|
|
123
|
-
),
|
|
130
|
+
), a.value && R(
|
|
124
131
|
'BentoInputField "value" property',
|
|
125
132
|
`The use of "value" prop in "BentoInputField" is no longer supported.
|
|
126
133
|
Use the "v-model" or "model-value" property instead.`,
|
|
127
134
|
"2.0.0"
|
|
128
|
-
), (e, i) => (
|
|
129
|
-
class:
|
|
135
|
+
), (e, i) => (r(), u(t(L), {
|
|
136
|
+
class: Ae(["b-input-field", De.value]),
|
|
130
137
|
"data-testid": "input-text-container",
|
|
131
138
|
el: "div",
|
|
132
139
|
variant: "body"
|
|
133
140
|
}, {
|
|
134
141
|
default: b(() => [
|
|
135
|
-
t(s)("default") || e.label ? (
|
|
142
|
+
t(s)("default") || e.label ? (r(), u(t($e), {
|
|
136
143
|
key: 0,
|
|
137
|
-
for: t(
|
|
144
|
+
for: t($),
|
|
138
145
|
"data-testid": "input-field-label",
|
|
139
146
|
"tooltip-text": e.tooltipText,
|
|
140
147
|
optional: e.optional,
|
|
@@ -146,48 +153,48 @@ const x = {
|
|
|
146
153
|
p(e.$slots, "default", {}, void 0, !0)
|
|
147
154
|
]),
|
|
148
155
|
_: 3
|
|
149
|
-
}, 8, ["for", "tooltip-text", "optional", "required", "label"])) :
|
|
156
|
+
}, 8, ["for", "tooltip-text", "optional", "required", "label"])) : d("", !0),
|
|
150
157
|
I("div", {
|
|
151
158
|
class: "b-input-field__input-box",
|
|
152
159
|
"data-testid": "input-box",
|
|
153
160
|
"aria-disabled": e.disabled,
|
|
154
161
|
onClick: D
|
|
155
162
|
}, [
|
|
156
|
-
ie.value && (t(s)("defaultIconBefore") || t(s)("iconBefore")) ? (
|
|
163
|
+
ie.value && (t(s)("defaultIconBefore") || t(s)("iconBefore")) ? (r(), v("span", {
|
|
157
164
|
key: 0,
|
|
158
165
|
"aria-hidden": e.ariaHidden ? "true" : void 0,
|
|
159
166
|
class: "b-input-field__icon-before"
|
|
160
167
|
}, [
|
|
161
|
-
t(s)("iconBefore") ? p(e.$slots, "iconBefore", { key: 0 }, void 0, !0) :
|
|
162
|
-
t(s)("defaultIconBefore") && !t(s)("iconBefore") ? p(e.$slots, "defaultIconBefore", { key: 1 }, void 0, !0) :
|
|
163
|
-
], 8, Ke)) :
|
|
164
|
-
|
|
168
|
+
t(s)("iconBefore") ? p(e.$slots, "iconBefore", { key: 0 }, void 0, !0) : d("", !0),
|
|
169
|
+
t(s)("defaultIconBefore") && !t(s)("iconBefore") ? p(e.$slots, "defaultIconBefore", { key: 1 }, void 0, !0) : d("", !0)
|
|
170
|
+
], 8, Ke)) : d("", !0),
|
|
171
|
+
de.value && t(s)("paymentMethod") ? (r(), v("span", {
|
|
165
172
|
key: 1,
|
|
166
173
|
"aria-hidden": e.ariaHidden ? "true" : void 0,
|
|
167
174
|
class: "b-input-field__payment-method"
|
|
168
175
|
}, [
|
|
169
176
|
p(e.$slots, "paymentMethod", {}, void 0, !0)
|
|
170
|
-
], 8, We)) :
|
|
171
|
-
se.value ? (
|
|
177
|
+
], 8, We)) : d("", !0),
|
|
178
|
+
se.value ? (r(), v("div", {
|
|
172
179
|
key: 2,
|
|
173
180
|
id: t(y),
|
|
174
181
|
class: "b-input-field__dropdown b-input-field__dropdown--start",
|
|
175
182
|
onClick: i[0] || (i[0] = z(() => {
|
|
176
183
|
}, ["stop"]))
|
|
177
184
|
}, [
|
|
178
|
-
e.dropdown ? (
|
|
185
|
+
e.dropdown ? (r(), u(t(Z), O({
|
|
179
186
|
key: 0,
|
|
180
187
|
ref_key: "inputDropdownElement",
|
|
181
|
-
ref:
|
|
188
|
+
ref: g
|
|
182
189
|
}, W.value, {
|
|
183
190
|
disabled: e.disabled,
|
|
184
191
|
readonly: Y.value,
|
|
185
192
|
"onUpdate:modelValue": J
|
|
186
|
-
}), null, 16, ["disabled", "readonly"])) :
|
|
187
|
-
], 8, Je)) :
|
|
188
|
-
|
|
193
|
+
}), null, 16, ["disabled", "readonly"])) : d("", !0)
|
|
194
|
+
], 8, Je)) : d("", !0),
|
|
195
|
+
re.value ? (r(), u(t(L), {
|
|
189
196
|
key: 3,
|
|
190
|
-
id: t(
|
|
197
|
+
id: t(T),
|
|
191
198
|
class: "b-input-field__static-value b-input-field__static-value--start",
|
|
192
199
|
el: "span",
|
|
193
200
|
variant: "body"
|
|
@@ -196,16 +203,16 @@ const x = {
|
|
|
196
203
|
p(e.$slots, "staticValue", {}, void 0, !0)
|
|
197
204
|
]),
|
|
198
205
|
_: 3
|
|
199
|
-
}, 8, ["id"])) :
|
|
206
|
+
}, 8, ["id"])) : d("", !0),
|
|
200
207
|
I("div", je, [
|
|
201
|
-
I("input",
|
|
208
|
+
I("input", O({ id: t($) }, t(B), {
|
|
202
209
|
ref_key: "inputFieldElement",
|
|
203
|
-
ref:
|
|
210
|
+
ref: V,
|
|
204
211
|
class: "b-input-field__input",
|
|
205
212
|
"aria-label": t(K),
|
|
206
213
|
"aria-describedby": we.value,
|
|
207
214
|
"aria-owns": ce.value,
|
|
208
|
-
"aria-invalid":
|
|
215
|
+
"aria-invalid": A.value,
|
|
209
216
|
placeholder: e.placeholder,
|
|
210
217
|
required: e.required,
|
|
211
218
|
"aria-required": e.required,
|
|
@@ -213,39 +220,39 @@ const x = {
|
|
|
213
220
|
value: e.modelValue ?? e.value,
|
|
214
221
|
disabled: e.disabled,
|
|
215
222
|
readonly: t(w),
|
|
216
|
-
onInput:
|
|
223
|
+
onInput: ke,
|
|
217
224
|
onChange: i[1] || (i[1] = (f) => n("change")),
|
|
218
225
|
onFocus: te,
|
|
219
|
-
onBlur:
|
|
226
|
+
onBlur: le,
|
|
220
227
|
onKeydown: [
|
|
221
228
|
i[2] || (i[2] = (f) => n("keydown", f)),
|
|
222
|
-
i[4] || (i[4] =
|
|
229
|
+
i[4] || (i[4] = ge((f) => n("escape-pressed"), ["esc"]))
|
|
223
230
|
],
|
|
224
231
|
onKeyup: i[3] || (i[3] = (f) => n("keyup", f)),
|
|
225
232
|
onClick: i[5] || (i[5] = (f) => n("click", f))
|
|
226
233
|
}), null, 16, ze),
|
|
227
|
-
t(q) &&
|
|
234
|
+
t(q) && C.value && (e.modelValue || e.value) ? (r(), u(t(L), {
|
|
228
235
|
key: 0,
|
|
229
236
|
el: "span",
|
|
230
237
|
class: "b-input-field__hint"
|
|
231
238
|
}, {
|
|
232
239
|
default: b(() => [
|
|
233
|
-
X(
|
|
240
|
+
X(G(t(q)), 1)
|
|
234
241
|
]),
|
|
235
242
|
_: 1
|
|
236
|
-
})) :
|
|
243
|
+
})) : d("", !0)
|
|
237
244
|
]),
|
|
238
|
-
t(s)("iconAfter") ? (
|
|
245
|
+
t(s)("iconAfter") ? (r(), v("span", {
|
|
239
246
|
key: 4,
|
|
240
247
|
"aria-hidden": e.ariaHidden ? "true" : void 0,
|
|
241
248
|
class: "b-input-field__icon-after",
|
|
242
249
|
"data-testid": "input-text__icon-after"
|
|
243
250
|
}, [
|
|
244
251
|
p(e.$slots, "iconAfter", {}, void 0, !0)
|
|
245
|
-
], 8, Xe)) :
|
|
246
|
-
ne.value ? (
|
|
252
|
+
], 8, Xe)) : d("", !0),
|
|
253
|
+
ne.value ? (r(), u(t(L), {
|
|
247
254
|
key: 5,
|
|
248
|
-
id: t(
|
|
255
|
+
id: t(T),
|
|
249
256
|
class: "b-input-field__static-value b-input-field__static-value--end",
|
|
250
257
|
el: "span",
|
|
251
258
|
variant: "body"
|
|
@@ -254,8 +261,8 @@ const x = {
|
|
|
254
261
|
p(e.$slots, "staticValue", {}, void 0, !0)
|
|
255
262
|
]),
|
|
256
263
|
_: 3
|
|
257
|
-
}, 8, ["id"])) :
|
|
258
|
-
ue.value ? (
|
|
264
|
+
}, 8, ["id"])) : d("", !0),
|
|
265
|
+
ue.value ? (r(), v("div", {
|
|
259
266
|
key: 6,
|
|
260
267
|
id: t(y),
|
|
261
268
|
"data-testid": "input-field-dropdown-container-end",
|
|
@@ -263,53 +270,53 @@ const x = {
|
|
|
263
270
|
onClick: i[6] || (i[6] = z(() => {
|
|
264
271
|
}, ["stop"]))
|
|
265
272
|
}, [
|
|
266
|
-
e.dropdown ? (
|
|
273
|
+
e.dropdown ? (r(), u(t(Z), O({
|
|
267
274
|
key: 0,
|
|
268
275
|
id: t(y),
|
|
269
276
|
ref_key: "inputDropdownElement",
|
|
270
|
-
ref:
|
|
277
|
+
ref: g
|
|
271
278
|
}, W.value, {
|
|
272
279
|
disabled: e.disabled,
|
|
273
280
|
readonly: Y.value,
|
|
274
281
|
"onUpdate:modelValue": J
|
|
275
|
-
}), null, 16, ["id", "disabled", "readonly"])) :
|
|
276
|
-
], 8,
|
|
282
|
+
}), null, 16, ["id", "disabled", "readonly"])) : d("", !0)
|
|
283
|
+
], 8, Ge)) : d("", !0)
|
|
277
284
|
], 8, Ye),
|
|
278
|
-
|
|
285
|
+
A.value && e.errorMessage ? (r(), u(t(Ue), {
|
|
279
286
|
key: 1,
|
|
280
287
|
id: t(H),
|
|
281
288
|
"error-message": e.errorMessage,
|
|
282
289
|
class: "b-input-field__error-message"
|
|
283
|
-
}, null, 8, ["id", "error-message"])) :
|
|
284
|
-
t(s)("description") || e.description ? (
|
|
290
|
+
}, null, 8, ["id", "error-message"])) : d("", !0),
|
|
291
|
+
t(s)("description") || e.description ? (r(), v("span", {
|
|
285
292
|
key: 2,
|
|
286
293
|
id: t(U),
|
|
287
294
|
class: "b-input-field__description",
|
|
288
295
|
onClick: D
|
|
289
296
|
}, [
|
|
290
|
-
|
|
297
|
+
Ce(t(L), {
|
|
291
298
|
el: "span",
|
|
292
299
|
variant: "body"
|
|
293
300
|
}, {
|
|
294
301
|
default: b(() => [
|
|
295
302
|
p(e.$slots, "description", { id: "description" }, () => [
|
|
296
|
-
X(
|
|
303
|
+
X(G(e.description), 1)
|
|
297
304
|
], !0)
|
|
298
305
|
]),
|
|
299
306
|
_: 3
|
|
300
307
|
})
|
|
301
|
-
], 8,
|
|
308
|
+
], 8, Ze)) : d("", !0)
|
|
302
309
|
]),
|
|
303
310
|
_: 3
|
|
304
311
|
}, 8, ["class"]));
|
|
305
312
|
}
|
|
306
|
-
}),
|
|
313
|
+
}), ca = /* @__PURE__ */ He(xe, [["__scopeId", "data-v-9e4c1d53"]]);
|
|
307
314
|
export {
|
|
308
|
-
|
|
315
|
+
ca as B,
|
|
309
316
|
c as a,
|
|
310
317
|
qe as b,
|
|
311
|
-
|
|
312
|
-
|
|
318
|
+
E as c,
|
|
319
|
+
P as d,
|
|
313
320
|
m as e
|
|
314
321
|
};
|
|
315
|
-
//# sourceMappingURL=input-field.
|
|
322
|
+
//# sourceMappingURL=input-field.DnYjM6yy.js.map
|
|
@@ -1 +1 @@
|
|
|
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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ACT,OAVJ,MAAA;AACI,QAAA5D,EAAA,YAAA,aACIY,EAAA,MAAA,MAAA,IAEAgD,EAAA;AAAA,MACJ;AAAA,IAMA,CAAA;AAGJ,UAAAE,KAAAvC,EAAAwC,IAAA,EAAA;AAEA,WAAA,CAAA,OAAA,OAAAzE,CAAA,EAAA,SAAAU,EAAA,IAAA,KAAA,CAAA8D,OACI9D,EAAA,SAAA,QACIgE;AAAA,MAAA,2DAAAhE,EAAA,IAAA;AAAA,IACyE,IACzEA,EAAA,SAAA,aAEAgE;AAAA,MAAA,2DAAAhE,EAAA,IAAA;AAAA,IACyE,IAGzEgE,EAAA,2DAAAhE,EAAA,IAAA,GAAA,IAORA,EAAA,SACIiE;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA,MACA;AAAA,IAGA,GAIRzD,EAAA,mBAAA,KACIyD;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MACA;AAAA,IAMA,GAIRjE,EAAA,SACIiE;AAAA,MAAA;AAAA,MACI;AAAA;AAAA,MACA;AAAA,IAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"input-field.DnYjM6yy.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,EAA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