@adyen/bento-vue2 1.44.0 → 1.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/index.d.ts +16661 -18847
- package/dist/action-bar.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-button.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/checkbox.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown-default-textbox.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/focus-trap.css +1 -1
- package/dist/assets/header.css +1 -1
- package/dist/assets/info-icon-with-popover.css +1 -0
- package/dist/assets/input-field.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/layout-row.css +1 -1
- package/dist/assets/link.css +1 -1
- package/dist/assets/menu.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/popover.css +1 -1
- package/dist/assets/popper-container.css +1 -1
- package/dist/assets/radio-input.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/step.css +1 -1
- package/dist/assets/tabs.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/chunks/{action-bar.Dx12xlEW.js → action-bar.e_2fmyN_.js} +6 -6
- package/dist/chunks/{action-bar.Dx12xlEW.js.map → action-bar.e_2fmyN_.js.map} +1 -1
- package/dist/chunks/{alert.D2Z_aiFC.js → alert.BcfhueIA.js} +2 -2
- package/dist/chunks/{alert.D2Z_aiFC.js.map → alert.BcfhueIA.js.map} +1 -1
- package/dist/chunks/{base-button.4UYC3kp2.js → base-button.BeMKxkgK.js} +2 -2
- package/dist/chunks/base-button.BeMKxkgK.js.map +1 -0
- package/dist/chunks/{base-modal.BrqNR-ah.js → base-modal.UPLi477L.js} +15 -15
- package/dist/chunks/{base-modal.BrqNR-ah.js.map → base-modal.UPLi477L.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.ptKgeQEb.js → button-actions-with-menu.CyNvhDxN.js} +4 -4
- package/dist/chunks/{button-actions-with-menu.ptKgeQEb.js.map → button-actions-with-menu.CyNvhDxN.js.map} +1 -1
- package/dist/chunks/{button-actions.BIQ3qA8q.js → button-actions.BaypoF5i.js} +3 -3
- package/dist/chunks/{button-actions.BIQ3qA8q.js.map → button-actions.BaypoF5i.js.map} +1 -1
- package/dist/chunks/{button.CufUNBkv.js → button.Bx8WC-dy.js} +12 -12
- package/dist/chunks/button.Bx8WC-dy.js.map +1 -0
- package/dist/chunks/{calendar.B9WZ8ub3.js → calendar.LXRuFfcw.js} +2 -2
- package/dist/chunks/{calendar.B9WZ8ub3.js.map → calendar.LXRuFfcw.js.map} +1 -1
- package/dist/chunks/{card.D9g7fZDX.js → card.INSvvGNH.js} +2 -2
- package/dist/chunks/{card.D9g7fZDX.js.map → card.INSvvGNH.js.map} +1 -1
- package/dist/chunks/{checkbox-group.Bcqac3y8.js → checkbox-group.BNVnOYKH.js} +4 -4
- package/dist/chunks/{checkbox-group.Bcqac3y8.js.map → checkbox-group.BNVnOYKH.js.map} +1 -1
- package/dist/chunks/{checkbox.B1qjI4R_.js → checkbox.CcwY2CMn.js} +4 -4
- package/dist/chunks/checkbox.CcwY2CMn.js.map +1 -0
- package/dist/chunks/{code-snippet.rmKiWrIv.js → code-snippet.Bs7wIGi8.js} +113 -83
- package/dist/chunks/code-snippet.Bs7wIGi8.js.map +1 -0
- package/dist/chunks/{codemirror.BlV6WO5w.js → codemirror.OjJ-3ixa.js} +4645 -4333
- package/dist/chunks/codemirror.OjJ-3ixa.js.map +1 -0
- package/dist/chunks/{controls-group.J8shO_JL.js → controls-group.CIdhlTk3.js} +2 -2
- package/dist/chunks/{controls-group.J8shO_JL.js.map → controls-group.CIdhlTk3.js.map} +1 -1
- package/dist/chunks/{copy.DgzxvExj.js → copy.BakPR7GI.js} +4 -4
- package/dist/chunks/{copy.DgzxvExj.js.map → copy.BakPR7GI.js.map} +1 -1
- package/dist/chunks/{country.CM5oZOyZ.js → country.BegULkAC.js} +2 -2
- package/dist/chunks/{country.CM5oZOyZ.js.map → country.BegULkAC.js.map} +1 -1
- package/dist/chunks/{country.types.Br0AjxGy.js → country.types.pilf5B3F.js} +483 -480
- package/dist/chunks/{country.types.Br0AjxGy.js.map → country.types.pilf5B3F.js.map} +1 -1
- package/dist/chunks/{dashboard-section._KVy37B0.js → dashboard-section.DUN8FB74.js} +4 -4
- package/dist/chunks/{dashboard-section._KVy37B0.js.map → dashboard-section.DUN8FB74.js.map} +1 -1
- package/dist/chunks/{dashed-underline.DX5QlK14.js → dashed-underline.BDK3yEtw.js} +3 -3
- package/dist/chunks/{dashed-underline.DX5QlK14.js.map → dashed-underline.BDK3yEtw.js.map} +1 -1
- package/dist/chunks/{data-grid-template.BgTUIoak.js → data-grid-template.BO2v-T1n.js} +3 -3
- package/dist/chunks/{data-grid-template.BgTUIoak.js.map → data-grid-template.BO2v-T1n.js.map} +1 -1
- package/dist/chunks/{data-grid.sAbzCVND.js → data-grid.NkQC0etq.js} +21 -21
- package/dist/chunks/{data-grid.sAbzCVND.js.map → data-grid.NkQC0etq.js.map} +1 -1
- package/dist/chunks/{date-picker.DrSWxADA.js → date-picker.DFgjvQgX.js} +5 -5
- package/dist/chunks/{date-picker.DrSWxADA.js.map → date-picker.DFgjvQgX.js.map} +1 -1
- package/dist/chunks/{date-range-picker.CFIOD59O.js → date-range-picker.BBC3TGYw.js} +9 -9
- package/dist/chunks/{date-range-picker.CFIOD59O.js.map → date-range-picker.BBC3TGYw.js.map} +1 -1
- package/dist/chunks/{dialog-page.CplkzZGZ.js → dialog-page.Da2cxzZm.js} +3 -3
- package/dist/chunks/dialog-page.Da2cxzZm.js.map +1 -0
- package/dist/chunks/{dropdown-default-textbox.ZAFh7KqG.js → dropdown-default-textbox.CrylDCEX.js} +87 -75
- package/dist/chunks/dropdown-default-textbox.CrylDCEX.js.map +1 -0
- package/dist/chunks/{dropdown-tag.Ntdp7P7W.js → dropdown-tag.xVgcIWXL.js} +5 -5
- package/dist/chunks/{dropdown-tag.Ntdp7P7W.js.map → dropdown-tag.xVgcIWXL.js.map} +1 -1
- package/dist/chunks/{dropdown.DC9un4VJ.js → dropdown.BkLc07G8.js} +185 -181
- package/dist/chunks/dropdown.BkLc07G8.js.map +1 -0
- package/dist/chunks/{empty-state.B8ZeRgDi.js → empty-state.B6wjtgR0.js} +2 -2
- package/dist/chunks/{empty-state.B8ZeRgDi.js.map → empty-state.B6wjtgR0.js.map} +1 -1
- package/dist/chunks/{error-message.B7uoqQpq.js → error-message.Brg-AZjT.js} +2 -2
- package/dist/chunks/{error-message.B7uoqQpq.js.map → error-message.Brg-AZjT.js.map} +1 -1
- package/dist/chunks/{es6.C-HLzYPA.js → es6.D11bE5vq.js} +7 -7
- package/dist/chunks/{es6.C-HLzYPA.js.map → es6.D11bE5vq.js.map} +1 -1
- package/dist/chunks/file-uploader.BePx7fcJ.js +1879 -0
- package/dist/chunks/file-uploader.BePx7fcJ.js.map +1 -0
- package/dist/chunks/{filter-bar.Dowrph-Z.js → filter-bar.BbVGpEJx.js} +20 -20
- package/dist/chunks/{filter-bar.Dowrph-Z.js.map → filter-bar.BbVGpEJx.js.map} +1 -1
- package/dist/chunks/{fixed-scroller.B880PL1J.js → fixed-scroller.BE1hWLr6.js} +2 -2
- package/dist/chunks/{fixed-scroller.B880PL1J.js.map → fixed-scroller.BE1hWLr6.js.map} +1 -1
- package/dist/chunks/focus-trap.DA_1lCcM.js +495 -0
- package/dist/chunks/focus-trap.DA_1lCcM.js.map +1 -0
- package/dist/chunks/{footer-actions.B3GJ1wNP.js → footer-actions.O24MYRgM.js} +3 -3
- package/dist/chunks/{footer-actions.B3GJ1wNP.js.map → footer-actions.O24MYRgM.js.map} +1 -1
- package/dist/chunks/{form-layout-title.BarHgyjC.js → form-layout-title.DRuBsptB.js} +2 -2
- package/dist/chunks/{form-layout-title.BarHgyjC.js.map → form-layout-title.DRuBsptB.js.map} +1 -1
- package/dist/chunks/header.Bbwnv6Ei.js +205 -0
- package/dist/chunks/header.Bbwnv6Ei.js.map +1 -0
- package/dist/chunks/{index.Gcw_BUVh.js → index.B5Tq465X.js} +2 -1
- package/dist/chunks/{index.Gcw_BUVh.js.map → index.B5Tq465X.js.map} +1 -1
- package/dist/chunks/info-icon-with-popover.Cd3RQWUu.js +71 -0
- package/dist/chunks/info-icon-with-popover.Cd3RQWUu.js.map +1 -0
- package/dist/chunks/{info-icon.p-28zHUJ.js → info-icon.BnSZeQm8.js} +3 -3
- package/dist/chunks/{info-icon.p-28zHUJ.js.map → info-icon.BnSZeQm8.js.map} +1 -1
- package/dist/chunks/{input-field-password.CgxF9jhq.js → input-field-password.CvKC9xjJ.js} +6 -6
- package/dist/chunks/{input-field-password.CgxF9jhq.js.map → input-field-password.CvKC9xjJ.js.map} +1 -1
- package/dist/chunks/input-field.Dgop3JWW.js +231 -0
- package/dist/chunks/input-field.Dgop3JWW.js.map +1 -0
- package/dist/chunks/{inspector.types.DaY6OOzz.js → inspector.types.j1usQ6FN.js} +3 -3
- package/dist/chunks/{inspector.types.DaY6OOzz.js.map → inspector.types.j1usQ6FN.js.map} +1 -1
- package/dist/chunks/{layout-row.DzS_XyyF.js → layout-row.DAeZh7Rv.js} +4 -4
- package/dist/chunks/layout-row.DAeZh7Rv.js.map +1 -0
- package/dist/chunks/{link.v-y0fKjn.js → link.B2DE2ryp.js} +6 -6
- package/dist/chunks/{link.v-y0fKjn.js.map → link.B2DE2ryp.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.BnX0H4HE.js → listbox-option-tag.drC_50fU.js} +2 -2
- package/dist/chunks/{listbox-option-tag.BnX0H4HE.js.map → listbox-option-tag.drC_50fU.js.map} +1 -1
- package/dist/chunks/{menu.B78fzH_k.js → menu.DCRfI10M.js} +4 -4
- package/dist/chunks/{menu.B78fzH_k.js.map → menu.DCRfI10M.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.DgftXCJe.js → modal-fullscreen.DgDk6uxS.js} +5 -5
- package/dist/chunks/{modal-fullscreen.DgftXCJe.js.map → modal-fullscreen.DgDk6uxS.js.map} +1 -1
- package/dist/chunks/{modal.BA745pfv.js → modal.B7giFLek.js} +5 -5
- package/dist/chunks/{modal.BA745pfv.js.map → modal.B7giFLek.js.map} +1 -1
- package/dist/chunks/{pagination.CfwtuZ7R.js → pagination.Dc0VbxFL.js} +3 -3
- package/dist/chunks/{pagination.CfwtuZ7R.js.map → pagination.Dc0VbxFL.js.map} +1 -1
- package/dist/chunks/{popover.ZlmaSYms.js → popover.D8pR_dbl.js} +4 -4
- package/dist/chunks/{popover.ZlmaSYms.js.map → popover.D8pR_dbl.js.map} +1 -1
- package/dist/chunks/{popper-container.CnWphJTN.js → popper-container.B9qZTf2V.js} +4 -4
- package/dist/chunks/popper-container.B9qZTf2V.js.map +1 -0
- package/dist/chunks/{promo-banner.cTUF9seG.js → promo-banner.Dd-JQMUD.js} +3 -3
- package/dist/chunks/{promo-banner.cTUF9seG.js.map → promo-banner.Dd-JQMUD.js.map} +1 -1
- package/dist/chunks/{radio-group.EnMXbuly.js → radio-group.D5GEIgYv.js} +5 -5
- package/dist/chunks/{radio-group.EnMXbuly.js.map → radio-group.D5GEIgYv.js.map} +1 -1
- package/dist/chunks/{radio-input.q980f8Uf.js → radio-input.C1DZbkcT.js} +5 -5
- package/dist/chunks/radio-input.C1DZbkcT.js.map +1 -0
- package/dist/chunks/{search-bar.lYuXPzBX.js → search-bar.BN4grqVO.js} +3 -3
- package/dist/chunks/{search-bar.lYuXPzBX.js.map → search-bar.BN4grqVO.js.map} +1 -1
- package/dist/chunks/{secondary-nav.CF6WPYn4.js → secondary-nav.C8UE8xly.js} +7 -7
- package/dist/chunks/{secondary-nav.CF6WPYn4.js.map → secondary-nav.C8UE8xly.js.map} +1 -1
- package/dist/chunks/{segmented-control.CVeUROYR.js → segmented-control.C6HPgkVm.js} +2 -2
- package/dist/chunks/{segmented-control.CVeUROYR.js.map → segmented-control.C6HPgkVm.js.map} +1 -1
- package/dist/chunks/{selection-card-group.CjuBQ2UA.js → selection-card-group.BT7FOlbF.js} +6 -6
- package/dist/chunks/{selection-card-group.CjuBQ2UA.js.map → selection-card-group.BT7FOlbF.js.map} +1 -1
- package/dist/chunks/{sidepanel.NUx7L5f1.js → sidepanel.PEMSN4Hj.js} +10 -10
- package/dist/chunks/{sidepanel.NUx7L5f1.js.map → sidepanel.PEMSN4Hj.js.map} +1 -1
- package/dist/chunks/{step.5g9BIi15.js → step.Dq4w23dP.js} +2 -2
- package/dist/chunks/{step.5g9BIi15.js.map → step.Dq4w23dP.js.map} +1 -1
- package/dist/chunks/{structured-list-item.BEhWyaVP.js → structured-list-item.-ch3UkPz.js} +5 -5
- package/dist/chunks/{structured-list-item.BEhWyaVP.js.map → structured-list-item.-ch3UkPz.js.map} +1 -1
- package/dist/chunks/{summary-grid-item-custom.CSXo4NjY.js → summary-grid-item-custom.CLVYmhnp.js} +4 -4
- package/dist/chunks/{summary-grid-item-custom.CSXo4NjY.js.map → summary-grid-item-custom.CLVYmhnp.js.map} +1 -1
- package/dist/chunks/{tabs.Casntai-.js → tabs.B0f1qiMR.js} +3 -3
- package/dist/chunks/{tabs.Casntai-.js.map → tabs.B0f1qiMR.js.map} +1 -1
- package/dist/chunks/{tag.wTXg-O7i.js → tag.d36UYSWd.js} +2 -2
- package/dist/chunks/{tag.wTXg-O7i.js.map → tag.d36UYSWd.js.map} +1 -1
- package/dist/chunks/{textarea.F-JyRtIw.js → textarea.DORWuAZn.js} +3 -3
- package/dist/chunks/{textarea.F-JyRtIw.js.map → textarea.DORWuAZn.js.map} +1 -1
- package/dist/chunks/{timeline-item.BJyB8-Wv.js → timeline-item.CUm_n51y.js} +7 -7
- package/dist/chunks/timeline-item.CUm_n51y.js.map +1 -0
- package/dist/chunks/{toast.BEipTIrz.js → toast.DCaWC_wv.js} +2 -2
- package/dist/chunks/{toast.BEipTIrz.js.map → toast.DCaWC_wv.js.map} +1 -1
- package/dist/chunks/{toggle-button.CYplDIO-.js → toggle-button.DJqs599a.js} +2 -2
- package/dist/chunks/{toggle-button.CYplDIO-.js.map → toggle-button.DJqs599a.js.map} +1 -1
- package/dist/chunks/{tooltip.DH8TqpYV.js → tooltip.CQGwmwt9.js} +2 -2
- package/dist/chunks/{tooltip.DH8TqpYV.js.map → tooltip.CQGwmwt9.js.map} +1 -1
- package/dist/chunks/{tutorial.DFvMZAN5.js → tutorial.B_8XNKvM.js} +5 -5
- package/dist/chunks/{tutorial.DFvMZAN5.js.map → tutorial.B_8XNKvM.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.BiqVX5O7.js → use-cached-selected-values.DJl7FKT5.js} +8 -8
- package/dist/chunks/use-cached-selected-values.DJl7FKT5.js.map +1 -0
- package/dist/chunks/{use-country-items.C25TI6tp.js → use-country-items.DPBbl1KK.js} +2 -2
- package/dist/chunks/{use-country-items.C25TI6tp.js.map → use-country-items.DPBbl1KK.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/country.js +2 -2
- package/dist/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/dropdown.js +4 -4
- package/dist/empty-state.js +1 -1
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +57 -57
- package/dist/info-icon.js +1 -1
- package/dist/input-field-password.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/inspector.js +1 -1
- package/dist/internal.js +27 -25
- package/dist/internal.js.map +1 -1
- package/dist/layout.js +1 -1
- package/dist/link.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/pagination.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/popper-container.js +1 -1
- package/dist/promo-banner.js +1 -1
- package/dist/radio-group.js +2 -2
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/stepper.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/styles/bento-dark.css +1 -0
- package/dist/styles/bento-light.css +1 -0
- package/dist/styles/bento.css +1 -0
- package/dist/styles/legacy.css +6 -5
- package/dist/styles/styleguide.css +1 -0
- 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 +4 -4
- package/package.json +13 -8
- package/dist/chunks/base-button.4UYC3kp2.js.map +0 -1
- package/dist/chunks/button.CufUNBkv.js.map +0 -1
- package/dist/chunks/checkbox.B1qjI4R_.js.map +0 -1
- package/dist/chunks/code-snippet.rmKiWrIv.js.map +0 -1
- package/dist/chunks/codemirror.BlV6WO5w.js.map +0 -1
- package/dist/chunks/dialog-page.CplkzZGZ.js.map +0 -1
- package/dist/chunks/dropdown-default-textbox.ZAFh7KqG.js.map +0 -1
- package/dist/chunks/dropdown.DC9un4VJ.js.map +0 -1
- package/dist/chunks/file-uploader.ItCr8Ezn.js +0 -729
- package/dist/chunks/file-uploader.ItCr8Ezn.js.map +0 -1
- package/dist/chunks/focus-trap.DSkLNO_i.js +0 -443
- package/dist/chunks/focus-trap.DSkLNO_i.js.map +0 -1
- package/dist/chunks/header.BLjdXtYJ.js +0 -266
- package/dist/chunks/header.BLjdXtYJ.js.map +0 -1
- package/dist/chunks/input-field.CcjqGkLs.js +0 -228
- package/dist/chunks/input-field.CcjqGkLs.js.map +0 -1
- package/dist/chunks/layout-row.DzS_XyyF.js.map +0 -1
- package/dist/chunks/popper-container.CnWphJTN.js.map +0 -1
- package/dist/chunks/radio-input.q980f8Uf.js.map +0 -1
- package/dist/chunks/timeline-item.BJyB8-Wv.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.BiqVX5O7.js.map +0 -1
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import { defineComponent as z, useAttrs as G, useSlots as Q, ref as y, provide as Z, inject as tt, toRef as et, computed as r, toRefs as at } from "vue";
|
|
2
|
-
import { a as ot, I as it, B as rt } from "./dropdown.DC9un4VJ.js";
|
|
3
|
-
import { p as nt, d as P, B as st } from "./typography.Bu_WAKdf.js";
|
|
4
|
-
import { g as u } from "./generate-uid.D-HFI38h.js";
|
|
5
|
-
import { g as dt } from "./get-slot-text.Cgn-E48s.js";
|
|
6
|
-
import { u as lt } from "./aria-label.CaUURpnB.js";
|
|
7
|
-
import { u as ut } from "./i18n.BQkEbtPM.js";
|
|
8
|
-
import { u as pt } from "./use-form-layout-loading.D3lALhtC.js";
|
|
9
|
-
import { u as ct } from "./use-has-slot.C9lQZ6nz.js";
|
|
10
|
-
import { E as ft, F as _t } from "./error-message.B7uoqQpq.js";
|
|
11
|
-
import { n as bt } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
12
|
-
import "../assets/input-field.css";
|
|
13
|
-
var s = /* @__PURE__ */ ((a) => (a.DEFAULT = "default", a.PAYMENT_METHOD = "payment-method", a.STATIC_VALUE = "static-value", a.DROPDOWN = "dropdown", a))(s || {}), n = /* @__PURE__ */ ((a) => (a.START = "start", a.END = "end", a))(n || {}), p = /* @__PURE__ */ ((a) => (a.CONDENSED = "condensed", a.DISABLED = "disabled", a.READONLY = "readonly", a.ERROR = "error", a))(p || {}), S = /* @__PURE__ */ ((a) => (a.SEARCH = "search", a.TEXT = "text", a.NUMBER = "number", a))(S || {}), yt = /* @__PURE__ */ ((a) => (a.INPUT = "input", a.ESCAPE_PRESSED = "escape-pressed", a.UPDATE_DROPDOWN = "update:dropdown", a.DROPDOWN_INPUT = "dropdown-input", a.FOCUS = "focus", a.CHANGE = "change", a.BLUR = "blur", a.KEYDOWN = "keydown", a))(yt || {});
|
|
14
|
-
const ht = {
|
|
15
|
-
"en-US": {
|
|
16
|
-
ariaLabelFallback: "Input field",
|
|
17
|
-
ariaLabelDropdownFallback: "{inputLabel} Dropdown"
|
|
18
|
-
}
|
|
19
|
-
}, vt = {
|
|
20
|
-
i18n: { messages: ht }
|
|
21
|
-
}, mt = /* @__PURE__ */ z({
|
|
22
|
-
...vt,
|
|
23
|
-
__name: "input-field",
|
|
24
|
-
props: {
|
|
25
|
-
/**
|
|
26
|
-
* Indicates whether the element is exposed to an accessibility API.
|
|
27
|
-
*/
|
|
28
|
-
ariaHidden: { type: Boolean, default: !0 },
|
|
29
|
-
/**
|
|
30
|
-
* @deprecated from version 2.0.0. Use the aria-label attribute instead.
|
|
31
|
-
*/
|
|
32
|
-
/**
|
|
33
|
-
* Text that labels an the input element
|
|
34
|
-
*/
|
|
35
|
-
ariaLabel: { type: String, default: void 0 },
|
|
36
|
-
/**
|
|
37
|
-
* Reduces height of the input
|
|
38
|
-
*/
|
|
39
|
-
condensed: { type: Boolean, default: !1 },
|
|
40
|
-
/**
|
|
41
|
-
* Disables the possibility of changing value in the input-field
|
|
42
|
-
*/
|
|
43
|
-
disabled: { type: Boolean, default: !1 },
|
|
44
|
-
/**
|
|
45
|
-
* Dropdown props for the small selectable dropdown menu.
|
|
46
|
-
* Properties supported:
|
|
47
|
-
*
|
|
48
|
-
* - `value`: Selected value of the dropdown
|
|
49
|
-
* - `items`: List of available items
|
|
50
|
-
* - `aria-label`: Text that labels the dropdown element
|
|
51
|
-
*
|
|
52
|
-
*/
|
|
53
|
-
dropdown: {
|
|
54
|
-
type: Object,
|
|
55
|
-
default: void 0
|
|
56
|
-
},
|
|
57
|
-
/**
|
|
58
|
-
* Position of the dropdown before or after input value
|
|
59
|
-
*/
|
|
60
|
-
dropdownPosition: {
|
|
61
|
-
type: String,
|
|
62
|
-
default: n.START,
|
|
63
|
-
validator: (a) => Object.values(n).includes(a)
|
|
64
|
-
},
|
|
65
|
-
/**
|
|
66
|
-
* Adds error validation class for outlining input-field.
|
|
67
|
-
*
|
|
68
|
-
* @deprecated Use "errorMessage" prop instead
|
|
69
|
-
*/
|
|
70
|
-
error: { type: Boolean, default: !1 },
|
|
71
|
-
/**
|
|
72
|
-
* Renders input-field with an error state and the error message beneath the input box
|
|
73
|
-
*/
|
|
74
|
-
errorMessage: { type: String, default: null },
|
|
75
|
-
/**
|
|
76
|
-
* Highlights the dropdown is optional.
|
|
77
|
-
*/
|
|
78
|
-
optional: { type: Boolean, default: !1 },
|
|
79
|
-
/**
|
|
80
|
-
* Text displayed as the placeholder of the input-field
|
|
81
|
-
*/
|
|
82
|
-
placeholder: { type: String, default: "" },
|
|
83
|
-
/**
|
|
84
|
-
* Highlights the dropdown is required.
|
|
85
|
-
*/
|
|
86
|
-
required: { type: Boolean, default: !1 },
|
|
87
|
-
/**
|
|
88
|
-
* Setting this property to true will set the input field to read only state.
|
|
89
|
-
*/
|
|
90
|
-
readonly: { type: Boolean, default: !1 },
|
|
91
|
-
/**
|
|
92
|
-
* Static text that displayed before or after input value
|
|
93
|
-
* Applicable to the Static Value variant
|
|
94
|
-
*/
|
|
95
|
-
staticValue: { type: String, default: "" },
|
|
96
|
-
/**
|
|
97
|
-
* Position of Static Value before or after input value
|
|
98
|
-
*/
|
|
99
|
-
staticValuePosition: {
|
|
100
|
-
type: String,
|
|
101
|
-
default: n.START,
|
|
102
|
-
validator: (a) => Object.values(n).includes(a)
|
|
103
|
-
},
|
|
104
|
-
/**
|
|
105
|
-
* Adds a info icon next to the label to display the passed tooltip message.
|
|
106
|
-
*/
|
|
107
|
-
tooltipText: { type: String, default: null },
|
|
108
|
-
/**
|
|
109
|
-
* A string specifying the type of control to render.
|
|
110
|
-
* All `input` types are available but only `search`, `text` and `number` are fully supported.
|
|
111
|
-
*
|
|
112
|
-
* If `type` is `search`, use `bento-search-bar` instead.
|
|
113
|
-
*/
|
|
114
|
-
type: {
|
|
115
|
-
type: String,
|
|
116
|
-
default: S.TEXT
|
|
117
|
-
},
|
|
118
|
-
/**
|
|
119
|
-
* Text displayed as the value of the input-field
|
|
120
|
-
*/
|
|
121
|
-
value: { type: [String, Number], default: void 0 },
|
|
122
|
-
/**
|
|
123
|
-
* Describes the different variants for the input element
|
|
124
|
-
*/
|
|
125
|
-
variant: {
|
|
126
|
-
type: String,
|
|
127
|
-
default: s.DEFAULT,
|
|
128
|
-
validator: (a) => Object.values(s).includes(a)
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
emits: ["update:dropdown", "blur", "change", "dropdown-input", "escape-pressed", "focus", "keydown", "keyup", "input"],
|
|
132
|
-
setup(a, { expose: e, emit: o }) {
|
|
133
|
-
const t = a, i = G(), c = Q(), { t: h } = ut(), f = ct(c), E = y(null), R = u("input"), v = u("input-dropdown"), m = u("input-static-value"), g = u("input-description"), A = u("input-error"), D = y(!1);
|
|
134
|
-
Z(ot, !0);
|
|
135
|
-
const B = tt(it, y(void 0)), k = () => {
|
|
136
|
-
D.value = !0, o("focus");
|
|
137
|
-
}, F = () => {
|
|
138
|
-
D.value = !1, o("blur");
|
|
139
|
-
}, { isReadOnly: _ } = pt(et(t, "readonly")), d = r(
|
|
140
|
-
() => t.variant === s.STATIC_VALUE && !!c.staticValue
|
|
141
|
-
), M = r(() => t.variant === s.DEFAULT), V = r(() => t.variant === s.PAYMENT_METHOD), U = r(
|
|
142
|
-
() => d.value && t.staticValuePosition === n.START
|
|
143
|
-
), x = r(
|
|
144
|
-
() => d.value && t.staticValuePosition === n.END
|
|
145
|
-
), l = r(() => t.variant === s.DROPDOWN && !!t.dropdown), H = r(
|
|
146
|
-
() => l.value && t.dropdownPosition === n.START
|
|
147
|
-
), $ = r(
|
|
148
|
-
() => l.value && t.dropdownPosition === n.END
|
|
149
|
-
), w = r(
|
|
150
|
-
() => !t.disabled && !_.value && (!!t.errorMessage || t.error)
|
|
151
|
-
), Y = r(() => l.value === !0 && d.value === !0 ? `${m} ${v}` : l.value === !0 ? `${v}` : d.value === !0 ? `${m}` : null), T = r(() => h("ariaLabelFallback")), I = r(
|
|
152
|
-
() => h("ariaLabelDropdownFallback", { inputLabel: N.value })
|
|
153
|
-
), O = y(i["aria-label"]), { ariaLabel: L } = at(t), N = lt({
|
|
154
|
-
ariaLabel: O.value,
|
|
155
|
-
// TODO: take this line away when the aria-label props is removed
|
|
156
|
-
label: L,
|
|
157
|
-
defaultFallback: f("default") ? dt(c)("default") : T
|
|
158
|
-
}), j = r(
|
|
159
|
-
() => `${f("description") ? g : ""} ${w.value && t.errorMessage ? A : ""}`
|
|
160
|
-
), W = r(() => ({
|
|
161
|
-
[`b-input-field--${p.CONDENSED}`]: t.condensed,
|
|
162
|
-
[`b-input-field--${p.DISABLED}`]: t.disabled,
|
|
163
|
-
[`b-input-field--${p.READONLY}`]: _.value,
|
|
164
|
-
[`b-input-field--${p.ERROR}`]: w.value
|
|
165
|
-
})), q = r(() => ({
|
|
166
|
-
"aria-label": I.value,
|
|
167
|
-
...t.dropdown
|
|
168
|
-
})), K = (b) => {
|
|
169
|
-
const X = b.target.value;
|
|
170
|
-
!t.disabled && !_.value && o("input", X);
|
|
171
|
-
}, J = (b) => {
|
|
172
|
-
o("dropdown-input", b), o("update:dropdown", { ...t == null ? void 0 : t.dropdown, value: b });
|
|
173
|
-
}, C = () => {
|
|
174
|
-
E.value.focus();
|
|
175
|
-
};
|
|
176
|
-
return e({
|
|
177
|
-
focusInput: C
|
|
178
|
-
}), Object.values(S).includes(t.type) || nt(`"bento-input-field" dropdown does not support the type ${t.type}`), t.error && P(
|
|
179
|
-
'BentoInputField "error" property',
|
|
180
|
-
`Use the BentoInputField "errorMessage" property instead to indicate that there is a modifier error.
|
|
181
|
-
Having the field as "undefined" will hide/remove the error.
|
|
182
|
-
<bento-dropdown errorMessage="Error message text" />`,
|
|
183
|
-
"2.0.0"
|
|
184
|
-
), f("defaultIconBefore") && P(
|
|
185
|
-
'BentoInputField "defaultIconBefore" slot',
|
|
186
|
-
`Use the BentoInputField "iconBefore" slot instead to add an icon at the left side of the input field
|
|
187
|
-
<bento-input-field>
|
|
188
|
-
<template #iconBefore>
|
|
189
|
-
<my-icon-goes-here />
|
|
190
|
-
</template>
|
|
191
|
-
</bento-input-field>`,
|
|
192
|
-
"2.0.0"
|
|
193
|
-
), { __sfc: !0, attrs: i, slots: c, props: t, emit: o, t: h, hasSlot: f, inputFieldElement: E, inputFieldId: R, dropdownId: v, staticValueId: m, descriptionId: g, errorId: A, isFocused: D, hint: B, onFocus: k, onBlur: F, isReadOnly: _, shouldShowStaticValue: d, isDefaultVariant: M, isPaymentMethodVariant: V, shouldDisplayStaticValueAtStart: U, shouldDisplayStaticValueAtEnd: x, shouldShowDropdown: l, shouldDisplayDropdownAtStart: H, shouldDisplayDropdownAtEnd: $, shouldShowError: w, computedAriaOwns: Y, computedAriaLabelFallbackMessage: T, computedAriaLabelDropdowFallback: I, ariaLabelAttribute: O, ariaLabel: L, computedAriaLabel: N, computedAriaDescribedBy: j, inputFieldConditionalClasses: W, inputFieldDropdownProps: q, onInput: K, onDropdownInput: J, focusInput: C, BentoDropdown: rt, BentoTypography: st, ErrorMessage: ft, FieldLabel: _t };
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
var Dt = function() {
|
|
197
|
-
var e = this, o = e._self._c, t = e._self._setupProxy;
|
|
198
|
-
return o(t.BentoTypography, { staticClass: "b-input-field", class: t.inputFieldConditionalClasses, attrs: { "data-testid": "input-text-container", el: "div", variant: "body" } }, [t.hasSlot("default") ? o(t.FieldLabel, { attrs: { for: t.inputFieldId, "data-testid": "input-field-label", "tooltip-text": e.tooltipText, optional: e.optional, required: e.required }, on: { click: t.focusInput } }, [e._t("default")], 2) : e._e(), o("div", { staticClass: "b-input-field__input-box", attrs: { "data-testid": "input-box", "aria-disabled": e.disabled }, on: { click: t.focusInput } }, [t.isDefaultVariant && (t.hasSlot("defaultIconBefore") || t.hasSlot("iconBefore")) ? o("span", { staticClass: "b-input-field__icon-before", attrs: { "aria-hidden": e.ariaHidden ? "true" : void 0 } }, [t.hasSlot("iconBefore") ? e._t("iconBefore") : e._e(), t.hasSlot("defaultIconBefore") && !t.hasSlot("iconBefore") ? e._t("defaultIconBefore") : e._e()], 2) : e._e(), t.isPaymentMethodVariant && t.hasSlot("paymentMethod") ? o("span", { staticClass: "b-input-field__payment-method", attrs: { "aria-hidden": e.ariaHidden ? "true" : void 0 } }, [e._t("paymentMethod")], 2) : e._e(), t.shouldDisplayDropdownAtStart ? o("div", { staticClass: "b-input-field__dropdown b-input-field__dropdown--start", attrs: { id: t.dropdownId }, on: { click: function(i) {
|
|
199
|
-
i.stopPropagation();
|
|
200
|
-
} } }, [e.dropdown ? o(t.BentoDropdown, e._b({ attrs: { disabled: e.disabled, readonly: t.isReadOnly }, on: { input: t.onDropdownInput } }, "bento-dropdown", t.inputFieldDropdownProps, !1)) : e._e()], 1) : e._e(), t.shouldDisplayStaticValueAtStart ? o(t.BentoTypography, { staticClass: "b-input-field__static-value b-input-field__static-value--start", attrs: { id: t.staticValueId, el: "span", variant: "body" } }, [e._t("staticValue")], 2) : e._e(), o("div", { staticClass: "b-input-field__input-container" }, [o("input", e._b({ ref: "inputFieldElement", staticClass: "b-input-field__input", attrs: { id: t.inputFieldId, "aria-label": t.computedAriaLabel, "aria-describedby": t.computedAriaDescribedBy, "aria-owns": t.computedAriaOwns, "aria-invalid": t.shouldShowError, placeholder: e.placeholder, type: e.type, disabled: e.disabled, readonly: t.isReadOnly }, domProps: { value: e.value }, on: { input: t.onInput, change: function(i) {
|
|
201
|
-
return t.emit("change");
|
|
202
|
-
}, focus: t.onFocus, blur: t.onBlur, keydown: [function(i) {
|
|
203
|
-
return t.emit("keydown", i);
|
|
204
|
-
}, function(i) {
|
|
205
|
-
return !i.type.indexOf("key") && e._k(i.keyCode, "esc", 27, i.key, ["Esc", "Escape"]) ? null : t.emit("escape-pressed");
|
|
206
|
-
}], keyup: function(i) {
|
|
207
|
-
return t.emit("keyup", i);
|
|
208
|
-
} } }, "input", t.attrs, !1)), t.hint && t.isFocused && e.value ? o(t.BentoTypography, { staticClass: "b-input-field__hint", attrs: { el: "span" } }, [e._v(" " + e._s(t.hint) + " ")]) : e._e()], 1), t.hasSlot("iconAfter") ? o("span", { staticClass: "b-input-field__icon-after", attrs: { "aria-hidden": e.ariaHidden ? "true" : void 0, "data-testid": "input-text__icon-after" } }, [e._t("iconAfter")], 2) : e._e(), t.shouldDisplayStaticValueAtEnd ? o(t.BentoTypography, { staticClass: "b-input-field__static-value b-input-field__static-value--end", attrs: { id: t.staticValueId, el: "span", variant: "body" } }, [e._t("staticValue")], 2) : e._e(), t.shouldDisplayDropdownAtEnd ? o("div", { staticClass: "b-input-field__dropdown b-input-field__dropdown--end", attrs: { id: t.dropdownId, "data-testid": "input-field-dropdown-container-end" }, on: { click: function(i) {
|
|
209
|
-
i.stopPropagation();
|
|
210
|
-
} } }, [e.dropdown ? o(t.BentoDropdown, e._b({ attrs: { id: t.dropdownId, disabled: e.disabled, readonly: t.isReadOnly }, on: { input: t.onDropdownInput } }, "bento-dropdown", t.inputFieldDropdownProps, !1)) : e._e()], 1) : e._e()], 1), t.shouldShowError && e.errorMessage ? o(t.ErrorMessage, { staticClass: "b-input-field__error-message", attrs: { id: t.errorId, "error-message": e.errorMessage } }) : e._e(), t.hasSlot("description") ? o("span", { staticClass: "b-input-field__description", attrs: { id: t.descriptionId }, on: { click: t.focusInput } }, [o(t.BentoTypography, { attrs: { el: "span", variant: "body" } }, [e._t("description", null, { id: "description" })], 2)], 1) : e._e()], 1);
|
|
211
|
-
}, wt = [], St = /* @__PURE__ */ bt(
|
|
212
|
-
mt,
|
|
213
|
-
Dt,
|
|
214
|
-
wt,
|
|
215
|
-
!1,
|
|
216
|
-
null,
|
|
217
|
-
"d3d017d1"
|
|
218
|
-
);
|
|
219
|
-
const Bt = St.exports;
|
|
220
|
-
export {
|
|
221
|
-
Bt as B,
|
|
222
|
-
s as a,
|
|
223
|
-
n as b,
|
|
224
|
-
p as c,
|
|
225
|
-
S as d,
|
|
226
|
-
yt as e
|
|
227
|
-
};
|
|
228
|
-
//# sourceMappingURL=input-field.CcjqGkLs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"input-field.CcjqGkLs.js","sources":["../../src/components/input-field/input-field.types.ts","../../src/components/input-field/input-field.vue"],"sourcesContent":["import { BentoDropdown } from '@/components/dropdown/';\nimport type { HTMLAttributes } from 'vue/types/jsx';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldVariant {\n DEFAULT = 'default',\n PAYMENT_METHOD = 'payment-method',\n STATIC_VALUE = 'static-value',\n DROPDOWN = 'dropdown',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldElementPosition {\n START = 'start',\n END = 'end',\n}\n\nexport enum BentoInputFieldStateClass {\n CONDENSED = 'condensed',\n DISABLED = 'disabled',\n READONLY = 'readonly',\n ERROR = 'error',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoInputFieldType {\n SEARCH = 'search',\n TEXT = 'text',\n NUMBER = 'number',\n}\n\nexport type BentoInputFieldValue = string | number;\n\ntype DropdownProps = InstanceType<typeof BentoDropdown>['$props'];\nexport type BentoInputDropdownProps = {\n items: DropdownProps['items'];\n value: DropdownProps['value'];\n dynamicFiltering?: DropdownProps['dynamicFiltering'];\n 'aria-label'?: HTMLAttributes['aria-label'];\n};\n\n/**\n * @deprecated The use of these enums is no longer supported.\n * Use `v-on:` or `@` to listen to the events being emitted.\n * This enum will be removed in 2.0.\n */\nexport enum BentoInputFieldEvent {\n INPUT = 'input',\n ESCAPE_PRESSED = 'escape-pressed',\n UPDATE_DROPDOWN = 'update:dropdown',\n DROPDOWN_INPUT = 'dropdown-input',\n FOCUS = 'focus',\n CHANGE = 'change',\n BLUR = 'blur',\n KEYDOWN = 'keydown',\n}\n","<template>\n <bento-typography\n class=\"b-input-field\"\n data-testid=\"input-text-container\"\n :class=\"inputFieldConditionalClasses\"\n el=\"div\"\n variant=\"body\"\n >\n <field-label\n v-if=\"hasSlot('default')\"\n :for=\"inputFieldId\"\n data-testid=\"input-field-label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n @click=\"focusInput\"\n >\n <slot></slot>\n </field-label>\n\n <div class=\"b-input-field__input-box\" data-testid=\"input-box\" :aria-disabled=\"disabled\" @click=\"focusInput\">\n <!-- Optional Icon for Default text variant -->\n <span\n v-if=\"isDefaultVariant && (hasSlot('defaultIconBefore') || hasSlot('iconBefore'))\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-before\"\n >\n <slot v-if=\"hasSlot('iconBefore')\" name=\"iconBefore\" />\n <slot v-if=\"hasSlot('defaultIconBefore') && !hasSlot('iconBefore')\" name=\"defaultIconBefore\" />\n </span>\n\n <!-- Mandatory Icon for Payment Method variant -->\n <span\n v-if=\"isPaymentMethodVariant && hasSlot('paymentMethod')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__payment-method\"\n >\n <slot name=\"paymentMethod\" />\n </span>\n\n <!-- Dropdown at start -->\n <div\n v-if=\"shouldDisplayDropdownAtStart\"\n :id=\"dropdownId\"\n class=\"b-input-field__dropdown b-input-field__dropdown--start\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n v-bind=\"inputFieldDropdownProps\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n\n <!-- Static Value at start -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtStart\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--start\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n <div class=\"b-input-field__input-container\">\n <input\n :id=\"inputFieldId\"\n v-bind=\"attrs\"\n ref=\"inputFieldElement\"\n class=\"b-input-field__input\"\n :aria-label=\"computedAriaLabel\"\n :aria-describedby=\"computedAriaDescribedBy\"\n :aria-owns=\"computedAriaOwns\"\n :aria-invalid=\"shouldShowError\"\n :placeholder=\"placeholder\"\n :type=\"type\"\n :value=\"value\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onInput\"\n @change=\"emit('change')\"\n @focus=\"onFocus\"\n @blur=\"onBlur\"\n @keydown=\"emit('keydown', $event)\"\n @keyup=\"emit('keyup', $event)\"\n @keydown.esc=\"emit('escape-pressed')\"\n />\n\n <!-- Hint at the end -->\n <bento-typography v-if=\"hint && isFocused && value\" el=\"span\" class=\"b-input-field__hint\">\n {{ hint }}\n </bento-typography>\n </div>\n\n <span\n v-if=\"hasSlot('iconAfter')\"\n :aria-hidden=\"ariaHidden ? 'true' : undefined\"\n class=\"b-input-field__icon-after\"\n data-testid=\"input-text__icon-after\"\n >\n <slot name=\"iconAfter\" />\n </span>\n\n <!-- Static Value at the end -->\n <bento-typography\n v-if=\"shouldDisplayStaticValueAtEnd\"\n :id=\"staticValueId\"\n class=\"b-input-field__static-value b-input-field__static-value--end\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"staticValue\" />\n </bento-typography>\n\n <!-- Dropdown at end -->\n <div\n v-if=\"shouldDisplayDropdownAtEnd\"\n :id=\"dropdownId\"\n data-testid=\"input-field-dropdown-container-end\"\n class=\"b-input-field__dropdown b-input-field__dropdown--end\"\n @click.stop\n >\n <bento-dropdown\n v-if=\"dropdown\"\n :id=\"dropdownId\"\n v-bind=\"inputFieldDropdownProps\"\n :disabled=\"disabled\"\n :readonly=\"isReadOnly\"\n @input=\"onDropdownInput\"\n />\n </div>\n </div>\n\n <error-message\n v-if=\"shouldShowError && !!errorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-input-field__error-message\"\n />\n\n <span v-if=\"hasSlot('description')\" :id=\"descriptionId\" class=\"b-input-field__description\" @click=\"focusInput\">\n <bento-typography el=\"span\" variant=\"body\">\n <slot id=\"description\" name=\"description\" />\n </bento-typography>\n </span>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, PropType, provide, Ref, ref, toRef, toRefs, useAttrs, useSlots } from 'vue';\n\n // Components\n import { BentoDropdown } from '@/components/dropdown';\n import { BentoTypography } from '@/components/typography';\n import { ErrorMessage, FieldLabel } from '@/internal';\n\n // Utils\n import { deprecate } from '@/utils/ts/deprecate';\n import { generateUid } from '@/core/utils/ts';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useI18n } from '@/utils/ts/i18n';\n import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\n import {\n INPUT_FIELD_COMPONENT_INJECTION_KEY,\n INPUT_FIELD_HINT_INJECTION_KEY,\n } from '@/components/input-field/input-field.keys';\n\n // Composables\n import { useFormLayoutFieldLoading, useHasSlot } from '@/composables';\n\n // Types\n import {\n BentoInputDropdownProps,\n BentoInputFieldElementPosition,\n BentoInputFieldStateClass,\n BentoInputFieldType,\n BentoInputFieldValue,\n BentoInputFieldVariant,\n } from './input-field.types';\n import { BentoListboxSelectedValue } from '@/types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n const slots = useSlots();\n\n const props = defineProps({\n /**\n * Indicates whether the element is exposed to an accessibility API.\n */\n ariaHidden: { type: Boolean, default: true },\n\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Text that labels an the input element\n */\n ariaLabel: { type: String, default: undefined },\n\n /**\n * Reduces height of the input\n */\n condensed: { type: Boolean, default: false },\n\n /**\n * Disables the possibility of changing value in the input-field\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Dropdown props for the small selectable dropdown menu.\n * Properties supported:\n *\n * - `value`: Selected value of the dropdown\n * - `items`: List of available items\n * - `aria-label`: Text that labels the dropdown element\n *\n */\n dropdown: {\n type: Object as PropType<BentoInputDropdownProps>,\n default: undefined,\n },\n\n /**\n * Position of the dropdown before or after input value\n */\n dropdownPosition: {\n type: String as PropType<BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`>,\n default: BentoInputFieldElementPosition.START,\n validator: (value: BentoInputFieldElementPosition) =>\n Object.values(BentoInputFieldElementPosition).includes(value),\n },\n\n /**\n * Adds error validation class for outlining input-field.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n error: { type: Boolean, default: false },\n\n /**\n * Renders input-field with an error state and the error message beneath the input box\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Highlights the dropdown is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Highlights the dropdown is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Setting this property to true will set the input field to read only state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Static text that displayed before or after input value\n * Applicable to the Static Value variant\n */\n staticValue: { type: String, default: '' },\n\n /**\n * Position of Static Value before or after input value\n */\n staticValuePosition: {\n type: String as PropType<BentoInputFieldElementPosition | `${BentoInputFieldElementPosition}`>,\n default: BentoInputFieldElementPosition.START,\n validator: (value: BentoInputFieldElementPosition) =>\n Object.values(BentoInputFieldElementPosition).includes(value),\n },\n\n /**\n * Adds a info icon next to the label to display the passed tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * A string specifying the type of control to render.\n * All `input` types are available but only `search`, `text` and `number` are fully supported.\n *\n * If `type` is `search`, use `bento-search-bar` instead.\n */\n type: {\n type: String as PropType<BentoInputFieldType | `${BentoInputFieldType}` | HTMLInputElement['type']>,\n default: BentoInputFieldType.TEXT,\n },\n\n /**\n * Text displayed as the value of the input-field\n */\n value: { type: [String, Number] as PropType<BentoInputFieldValue>, default: undefined },\n\n /**\n * Describes the different variants for the input element\n */\n variant: {\n type: String as PropType<BentoInputFieldVariant | `${BentoInputFieldVariant}`>,\n default: BentoInputFieldVariant.DEFAULT,\n validator: (value: BentoInputFieldVariant) => Object.values(BentoInputFieldVariant).includes(value),\n },\n });\n\n const emit = defineEmits([\"update:dropdown\", \"blur\", \"change\", \"dropdown-input\", \"escape-pressed\", \"focus\", \"keydown\", \"keyup\", \"input\"]);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const hasSlot = useHasSlot(slots);\n const inputFieldElement = ref(null);\n const inputFieldId = generateUid('input');\n const dropdownId = generateUid('input-dropdown');\n const staticValueId = generateUid('input-static-value');\n const descriptionId = generateUid('input-description');\n const errorId = generateUid('input-error');\n const isFocused = ref(false);\n\n // Provide INPUT_FIELD_COMPONENT_INJECTION_KEY as true, to set the input only dropdown size variant in the BentoDropdown comp\n provide(INPUT_FIELD_COMPONENT_INJECTION_KEY, true);\n // Renders the input with a hint if a string is provided\n const hint = inject<Ref<string | undefined>>(INPUT_FIELD_HINT_INJECTION_KEY, ref(undefined));\n\n const onFocus = () => {\n isFocused.value = true;\n emit('focus');\n };\n\n const onBlur = () => {\n isFocused.value = false;\n emit('blur');\n };\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const shouldShowStaticValue = computed(\n () => props.variant === BentoInputFieldVariant.STATIC_VALUE && !!slots.staticValue\n );\n\n const isDefaultVariant = computed(() => props.variant === BentoInputFieldVariant.DEFAULT);\n\n const isPaymentMethodVariant = computed(() => props.variant === BentoInputFieldVariant.PAYMENT_METHOD);\n\n const shouldDisplayStaticValueAtStart = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayStaticValueAtEnd = computed(\n () => shouldShowStaticValue.value && props.staticValuePosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowDropdown = computed(() => props.variant === BentoInputFieldVariant.DROPDOWN && !!props.dropdown);\n const shouldDisplayDropdownAtStart = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.START\n );\n const shouldDisplayDropdownAtEnd = computed(\n () => shouldShowDropdown.value && props.dropdownPosition === BentoInputFieldElementPosition.END\n );\n\n const shouldShowError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.error)\n );\n\n const computedAriaOwns = computed(() => {\n if (shouldShowDropdown.value === true && shouldShowStaticValue.value === true) {\n return `${staticValueId} ${dropdownId}`;\n }\n if (shouldShowDropdown.value === true) {\n return `${dropdownId}`;\n }\n if (shouldShowStaticValue.value === true) {\n return `${staticValueId}`;\n }\n return null;\n });\n\n // vue-i18n issue with t() used in script - direct usage in template works\n // requires either createI18n({ legacy: false }) or to be wrapped in computed()\n const computedAriaLabelFallbackMessage = computed(() => t('ariaLabelFallback'));\n const computedAriaLabelDropdowFallback = computed(() =>\n t('ariaLabelDropdownFallback', { inputLabel: computedAriaLabel.value })\n );\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: hasSlot('default')\n ? (getSlotText(slots)('default') as string)\n : computedAriaLabelFallbackMessage,\n });\n\n const computedAriaDescribedBy = computed(\n () =>\n `${hasSlot('description') ? descriptionId : ''} ${\n shouldShowError.value && !!props.errorMessage ? errorId : ''\n }`\n );\n\n const inputFieldConditionalClasses = computed(() => ({\n [`b-input-field--${BentoInputFieldStateClass.CONDENSED}`]: props.condensed,\n [`b-input-field--${BentoInputFieldStateClass.DISABLED}`]: props.disabled,\n [`b-input-field--${BentoInputFieldStateClass.READONLY}`]: isReadOnly.value,\n [`b-input-field--${BentoInputFieldStateClass.ERROR}`]: shouldShowError.value,\n }));\n\n const inputFieldDropdownProps = computed(() => ({\n 'aria-label': computedAriaLabelDropdowFallback.value,\n ...props.dropdown,\n }));\n\n const onInput = (event: Event) => {\n const inputValue = (event.target as HTMLInputElement).value;\n if (!props.disabled && !isReadOnly.value) {\n emit('input', inputValue);\n }\n };\n\n const onDropdownInput = (selectedValue: BentoListboxSelectedValue) => {\n emit('dropdown-input', selectedValue);\n emit('update:dropdown', { ...props?.dropdown, value: selectedValue });\n };\n\n const focusInput = () => {\n inputFieldElement.value.focus();\n };\n\n // Expose method so that other components can focus on it in Vue3\n defineExpose({\n focusInput,\n });\n\n if (!Object.values(BentoInputFieldType).includes(props.type as BentoInputFieldType)) {\n printDevelopmentWarning(`\"bento-input-field\" dropdown does not support the type ${props.type}`);\n }\n\n /**\n * Deprecations\n */\n if (props.error) {\n deprecate(\n 'BentoInputField \"error\" property',\n `Use the BentoInputField \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-dropdown errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n if (hasSlot('defaultIconBefore')) {\n deprecate(\n 'BentoInputField \"defaultIconBefore\" slot',\n `Use the BentoInputField \"iconBefore\" slot instead to add an icon at the left side of the input field\n <bento-input-field>\n \\t<template #iconBefore>\n \\t\\t<my-icon-goes-here />\n \\t</template>\n </bento-input-field>`,\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Input field component is used to create interactive controls for web-based\n * forms in order to accept data from the user.\n *\n * @example\n * import { BentoInputField } from '@adyen/bento-vue2'\n *\n * const inputValue = ref('');\n *\n * export default {\n * components: { BentoInputField },\n * tempate: `\n * <bento-input-field\n * :value=\"inputValue\"\n * :input=\"newValue => inputValue.value = newValue\"\n * >\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./input-field.scss\" />\n"],"names":["BentoInputFieldVariant","BentoInputFieldVariant2","BentoInputFieldElementPosition","BentoInputFieldElementPosition2","BentoInputFieldStateClass","BentoInputFieldStateClass2","BentoInputFieldType","BentoInputFieldType2","BentoInputFieldEvent","BentoInputFieldEvent2","__default__","messages","attrs","useAttrs","slots","useSlots","t","useI18n","hasSlot","useHasSlot","inputFieldElement","ref","inputFieldId","generateUid","dropdownId","staticValueId","descriptionId","errorId","isFocused","provide","INPUT_FIELD_COMPONENT_INJECTION_KEY","hint","inject","INPUT_FIELD_HINT_INJECTION_KEY","onFocus","emit","onBlur","isReadOnly","useFormLayoutFieldLoading","toRef","props","shouldShowStaticValue","computed","isDefaultVariant","isPaymentMethodVariant","shouldDisplayStaticValueAtStart","shouldDisplayStaticValueAtEnd","shouldShowDropdown","shouldDisplayDropdownAtStart","shouldDisplayDropdownAtEnd","shouldShowError","computedAriaOwns","computedAriaLabelFallbackMessage","computedAriaLabelDropdowFallback","computedAriaLabel","ariaLabelAttribute","ariaLabel","toRefs","useAriaLabel","getSlotText","computedAriaDescribedBy","inputFieldConditionalClasses","inputFieldDropdownProps","onInput","event","inputValue","onDropdownInput","selectedValue","focusInput","expose","printDevelopmentWarning","deprecate"],"mappings":";;;;;;;;;;;;AAMY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,iBAAA,kBACAA,EAAA,eAAA,gBACAA,EAAA,WAAA,YAJQA,IAAAD,KAAA,CAAA,CAAA,GAUAE,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,MAAA,OAFQA,IAAAD,KAAA,CAAA,CAAA,GAKAE,IAAA,kBAAAC,OACRA,EAAA,YAAA,aACAA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,QAAA,SAJQA,IAAAD,KAAA,CAAA,CAAA,GAUAE,IAAA,kBAAAC,OACRA,EAAA,SAAA,UACAA,EAAA,OAAA,QACAA,EAAA,SAAA,UAHQA,IAAAD,KAAA,CAAA,CAAA,GAqBAE,KAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,iBAA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A,SAAA,EAAA,GAAAoC,EAAA;AAAA,MACgB,CAAA,kBAAApC,EAAA,QAAA,EAAA,GAAAoC,EAAA;AAAA,MACD,CAAA,kBAAApC,EAAA,QAAA,EAAA,GAAAiC,EAAA;AAAA,MACK,CAAA,kBAAAjC,EAAA,KAAA,EAAA,GAAA8C,EAAA;AAAA,IACE,EAAA,GAG3EY,IAAApB,EAAA,OAAA;AAAA,MAAgD,cAAAW,EAAA;AAAA,MACG,GAAAb,EAAA;AAAA,IACtC,EAAA,GAGbuB,IAAA,CAAAC,MAAA;AACI,YAAAC,IAAAD,EAAA,OAAA;AACA,MAAA,CAAAxB,EAAA,YAAA,CAAAH,EAAA,SACIF,EAAA,SAAA8B,CAAA;AAAA,IACJ,GAGJC,IAAA,CAAAC,MAAA;AACI,MAAAhC,EAAA,kBAAAgC,CAAA,GACAhC,EAAA,mBAAA,EAAA,GAAAK,KAAA,gBAAAA,EAAA,UAAA,OAAA2B,EAAA,CAAA;AAAA,IAAoE,GAGxEC,IAAA,MAAA;AACI,MAAAhD,EAAA,MAAA,MAAA;AAAA,IAA8B;AAIlC,WAAAiD,EAAA;AAAA,MAAa,YAAAD;AAAA,IACT,CAAA,GAGJ,OAAA,OAAA9D,CAAA,EAAA,SAAAkC,EAAA,IAAA,KACI8B,GAAA,0DAAA9B,EAAA,IAAA,EAAA,GAMJA,EAAA,SACI+B;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA,MACA;AAAA,IAGA,GAIRrD,EAAA,mBAAA,KACIqD;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MACA;AAAA,IAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layout-row.DzS_XyyF.js","sources":["../../src/components/layout/layout.keys.ts","../../src/components/layout/layout.vue","../../src/components/layout/layout.types.ts","../../src/components/layout/components/layout-row/layout-row.vue"],"sourcesContent":["export const LAYOUT_SIZE_INJECTION_KEY = Symbol('Layout size inject key');\n","<template>\n <component :is=\"wrapperElement\" class=\"b-layout\" :class=\"conditionalClasses\">\n <slot />\n </component>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, provide, toRef } from 'vue';\n import { BentoLayoutProps } from './layout.types';\n import { LAYOUT_SIZE_INJECTION_KEY } from '@/components/layout/layout.keys';\n\n const props = defineProps({\n variant: { default: 'page' },\n size: { default: 'full-width' }\n});\n\n provide(LAYOUT_SIZE_INJECTION_KEY, toRef(props, 'size'));\n\n const conditionalClasses = computed(() => ({\n 'b-layout--component': props.variant === 'component',\n }));\n\n const wrapperElement = props.variant === 'page' ? 'main' : 'div';\n</script>\n\n<script lang=\"ts\">\n /**\n * Layout is a basic scaffolding of a page that defines spacing, some functionality and responsive behaviour of its top level sections.\n *\n * @example\n * import { BentoLayout, BentoLayoutRow } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoLayout, BentoLayoutRow },\n * template: `\n * <bento-layout size=\"narrow\">\n * <bento-layout-row>\n * Row 1\n * </bento-layout-row>\n * <bento-layout-row>\n * Row 2\n * </bento-layout-row>\n * </bento-layout>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./layout.scss\" />\n","/**\n * @private\n */\nexport const BentoLayoutVariantOptions = ['page', 'component'] as const;\nexport const BentoLayoutSizeOptions = ['full-width', 'narrow', 'half-width'] as const;\nexport const BentoLayoutRowColumnLayoutOptions = ['3-9', '9-3', '4-8', '8-4', '6-6'] as const;\n\n// Public\nexport type BentoLayoutVariant = (typeof BentoLayoutVariantOptions)[number];\nexport type BentoLayoutSize = (typeof BentoLayoutSizeOptions)[number];\nexport type BentoLayoutRowColumnLayout = (typeof BentoLayoutRowColumnLayoutOptions)[number];\n\nexport interface BentoLayoutProps {\n /** Defines if the layout is used in a page or only a section */\n variant?: BentoLayoutVariant;\n /** Defines the size of the page */\n size?: BentoLayoutSize;\n}\n\nexport interface BentoLayoutRowProps {\n /** Sets the layout of the columns when multiple columns are used */\n columnsLayout?: BentoLayoutRowColumnLayout;\n}\n","<template>\n <bento-typography el=\"div\" rich-text class=\"b-layout-row\" :class=\"conditionalRowClass\">\n <div v-if=\"hasSlot('default')\">\n <slot />\n </div>\n <div v-else-if=\"hasSlot('col-1') && hasSlot('col-2')\" ref=\"row\" :class=\"conditionalRowWithColumnsClass\">\n <div ref=\"col1\" :class=\"conditionalColumnClass.col1\">\n <slot name=\"col-1\"></slot>\n </div>\n <div ref=\"col2\" :class=\"conditionalColumnClass.col2\">\n <slot name=\"col-2\"></slot>\n </div>\n </div>\n </bento-typography>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, nextTick, onMounted, ref, Ref, useSlots, watch } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n import {\n BentoLayoutRowColumnLayoutOptions,\n type BentoLayoutRowProps,\n type BentoLayoutSize,\n } from '../../layout.types';\n import { useMediaQuery } from '@vueuse/core';\n\n import { LAYOUT_SIZE_INJECTION_KEY } from '@/components/layout/layout.keys';\n\n const props = defineProps({\n columnsLayout: { default: '6-6' }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const size = inject<Ref<BentoLayoutSize>>(LAYOUT_SIZE_INJECTION_KEY, ref('full-width'));\n\n const row = ref<HTMLElement>(null);\n const col1 = ref<HTMLElement>(null);\n const col2 = ref<HTMLElement>(null);\n\n const isFullWidth = computed(() => size.value === 'full-width');\n const isValidColumnLayout = computed(() => BentoLayoutRowColumnLayoutOptions.includes(props.columnsLayout));\n\n const conditionalRowClass = computed(() => `b-layout-row--${size.value}`);\n\n const conditionalRowWithColumnsClass = computed(() => ({\n 'b-layout-row__column-wrapper': isFullWidth.value,\n }));\n\n const conditionalColumnClass = computed(() => {\n const columns = isValidColumnLayout.value ? props.columnsLayout.split('-') : [6, 6];\n const getColumnModifier = index => (isFullWidth.value ? columns[index] : size.value);\n\n return {\n col1: `b-layout-row__column--${getColumnModifier(0)}`,\n col2: `b-layout-row__column--${getColumnModifier(1)}`,\n };\n });\n\n watch(\n useMediaQuery('(min-width: 768px)'),\n async isLargeScreen => {\n await nextTick();\n const areColumnsInTheRightOrder = row.value?.firstChild === col1.value;\n if (isLargeScreen && !areColumnsInTheRightOrder) {\n row.value?.prepend(col1.value);\n } else if (!isLargeScreen && (props.columnsLayout === '3-9' || props.columnsLayout === '4-8')) {\n row.value?.prepend(col2.value);\n }\n },\n { immediate: true }\n );\n\n onMounted(() => {\n if (!isFullWidth.value && (hasSlot('col-1') || hasSlot('col-2'))) {\n throw new Error(\n 'Column slots can only be used with the `full-width` size. Please check documentation for more info.'\n );\n }\n\n if (!isValidColumnLayout.value) {\n throw new Error(\n `${props.columnsLayout} is not a valid column layout. Please refer to the documentation for the list of available column layouts.`\n );\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Page row is subcomponent of Layout meant to be used to generate the row layout.\n *\n * @example\n * import { BentoLayout, BentoLayoutRow } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoLayout, BentoLayoutRow },\n * template: `\n * <bento-layout>\n * <bento-layout-row columns-layout=\"3-9\">\n * <template #col-1>Narrow 3-9</template>\n * <template #col-2>Wide 3-9</template>\n * </bento-layout-row>\n * <bento-layout-row>\n * <template #col-1>6-6</template>\n * <template #col-2>6-6</template>\n * </bento-layout-row>\n * </bento-layout>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./layout-row.scss\" />\n"],"names":["LAYOUT_SIZE_INJECTION_KEY","__default__$1","provide","toRef","props","conditionalClasses","computed","wrapperElement","BentoLayoutRowColumnLayoutOptions","__default__","slots","useSlots","hasSlot","useHasSlot","size","inject","ref","row","col1","col2","isFullWidth","isValidColumnLayout","conditionalRowClass","conditionalRowWithColumnsClass","conditionalColumnClass","columns","getColumnModifier","index","watch","useMediaQuery","isLargeScreen","nextTick","areColumnsInTheRightOrder","_a","_b","_c","onMounted"],"mappings":";;;;;;AAAa,MAAAA,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