@adyen/bento-vue3 1.28.1 → 1.29.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 +4 -0
- package/dist/@types/packages/core/src/types/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/{internal/avatar → avatar}/avatar.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/{avatar-image → avatar/components/avatar-image}/avatar-image.vue.d.ts +15 -4
- package/dist/@types/packages/vue2/src/components/button/components/loading-button/index.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/button/components/loading-button/loading-button.vue.d.ts +2 -3
- package/dist/@types/packages/vue2/src/components/checkbox/checkbox.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue.d.ts +16 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-small-textbox/dropdown-small-textbox.vue.d.ts +10 -1
- package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +6 -2
- package/dist/@types/packages/vue2/src/components/filter-bar/components/base-filter/base-filter.vue.d.ts +6 -4
- package/dist/@types/packages/vue2/src/components/filter-bar/components/input-filter/input-filter.vue.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/input-field/input-field.types.d.ts +3 -0
- package/dist/@types/packages/vue2/src/components/input-field/input-field.vue.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/inspector/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/inspector/inspector.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/inspector/inspector.types.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/inspector/inspector.vue.d.ts +110 -0
- package/dist/@types/packages/vue2/src/components/internal/index.d.ts +0 -1
- package/dist/@types/packages/vue2/src/components/popover/popover.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/radio-group/components/radio-button/radio-button.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/radio-group/radio-group.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/search-bar/search-bar.vue.d.ts +12 -1
- package/dist/@types/packages/vue2/src/components/secondary-nav/secondary-nav.vue.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/stepper/stepper.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/tag/tag.vue.d.ts +4 -4
- package/dist/@types/packages/vue2/src/components/textarea/textarea.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/timeline/components/timeline-item/timeline-item.vue.d.ts +7 -7
- package/dist/@types/packages/vue2/src/components/tutorial/components/tutorial-popover/tutorial-popover.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/types/index.d.ts +1 -1
- package/dist/@types/packages/vue2/src/types/listbox.d.ts +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/avatar.css +1 -0
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/code-snippet.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/error-message.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/input-field.css +1 -1
- package/dist/assets/inspector.css +1 -0
- package/dist/assets/listbox-option-tag.css +1 -1
- package/dist/assets/loading-button.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/radio-group.css +1 -1
- package/dist/assets/search-bar.css +1 -1
- package/dist/assets/secondary-nav.css +1 -1
- package/dist/assets/segmented-control.css +1 -1
- package/dist/assets/selection-card-group.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/structured-list-item.css +1 -1
- package/dist/assets/textarea.css +1 -1
- package/dist/assets/timeline-item.css +1 -1
- package/dist/avatar.js +5 -0
- package/dist/avatar.js.map +1 -0
- package/dist/button.js +2 -2
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{action-bar.BvAtk-jI.js → action-bar.UcSSukRr.js} +5 -5
- package/dist/chunks/{action-bar.BvAtk-jI.js.map → action-bar.UcSSukRr.js.map} +1 -1
- package/dist/chunks/avatar.IHx0kN0u.js +94 -0
- package/dist/chunks/avatar.IHx0kN0u.js.map +1 -0
- package/dist/chunks/{base-modal.BgYlnM_Q.js → base-modal.CY-t-QYh.js} +2 -2
- package/dist/chunks/{base-modal.BgYlnM_Q.js.map → base-modal.CY-t-QYh.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.C14zvgVo.js → button-actions-with-menu.Dnyh1m51.js} +4 -4
- package/dist/chunks/{button-actions-with-menu.C14zvgVo.js.map → button-actions-with-menu.Dnyh1m51.js.map} +1 -1
- package/dist/chunks/{button-actions.hGhRdgC2.js → button-actions.BpLFzJJY.js} +2 -2
- package/dist/chunks/{button-actions.hGhRdgC2.js.map → button-actions.BpLFzJJY.js.map} +1 -1
- package/dist/chunks/{card.C7zLKdcy.js → card.DOQt8sH5.js} +2 -2
- package/dist/chunks/{card.C7zLKdcy.js.map → card.DOQt8sH5.js.map} +1 -1
- package/dist/chunks/{checkbox-group.BcT-eZ2p.js → checkbox-group.DS_f6k8E.js} +4 -4
- package/dist/chunks/{checkbox-group.BcT-eZ2p.js.map → checkbox-group.DS_f6k8E.js.map} +1 -1
- package/dist/chunks/{checkbox.xjIFibII.js → checkbox.C5cMvVMm.js} +3 -3
- package/dist/chunks/{checkbox.xjIFibII.js.map → checkbox.C5cMvVMm.js.map} +1 -1
- package/dist/chunks/{code-snippet.e8bxDBCO.js → code-snippet.68epWI-z.js} +184 -208
- package/dist/chunks/code-snippet.68epWI-z.js.map +1 -0
- package/dist/chunks/{controls-group.DWu8NqKL.js → controls-group.fAwpZLvA.js} +2 -2
- package/dist/chunks/{controls-group.DWu8NqKL.js.map → controls-group.fAwpZLvA.js.map} +1 -1
- package/dist/chunks/{copy.BhO7oRgC.js → copy.B6CXENok.js} +3 -3
- package/dist/chunks/{copy.BhO7oRgC.js.map → copy.B6CXENok.js.map} +1 -1
- package/dist/chunks/cross-circle-fill-small.DiZWEd7W.js +29 -0
- package/dist/chunks/cross-circle-fill-small.DiZWEd7W.js.map +1 -0
- package/dist/chunks/{dashboard-section.DKeDjvkB.js → dashboard-section.Bzj5vzTE.js} +3 -3
- package/dist/chunks/{dashboard-section.DKeDjvkB.js.map → dashboard-section.Bzj5vzTE.js.map} +1 -1
- package/dist/chunks/{dashed-underline.DGTW7Y_-.js → dashed-underline.SEXinixe.js} +3 -3
- package/dist/chunks/{dashed-underline.DGTW7Y_-.js.map → dashed-underline.SEXinixe.js.map} +1 -1
- package/dist/chunks/{data-grid-template.6Nls-D4o.js → data-grid-template.BRRSej-5.js} +2 -2
- package/dist/chunks/{data-grid-template.6Nls-D4o.js.map → data-grid-template.BRRSej-5.js.map} +1 -1
- package/dist/chunks/{data-grid.CTLlk_RW.js → data-grid.D0dri6Lc.js} +15 -15
- package/dist/chunks/{data-grid.CTLlk_RW.js.map → data-grid.D0dri6Lc.js.map} +1 -1
- package/dist/chunks/{date-picker.CoPmllNh.js → date-picker.NKXc916N.js} +15 -15
- package/dist/chunks/{date-picker.CoPmllNh.js.map → date-picker.NKXc916N.js.map} +1 -1
- package/dist/chunks/{date-range-picker.C36PxTCQ.js → date-range-picker.DXdh7SCV.js} +13 -13
- package/dist/chunks/{date-range-picker.C36PxTCQ.js.map → date-range-picker.DXdh7SCV.js.map} +1 -1
- package/dist/chunks/{dropdown-default-textbox.-Oy2eT40.js → dropdown-default-textbox.Bx0-dxhU.js} +112 -96
- package/dist/chunks/dropdown-default-textbox.Bx0-dxhU.js.map +1 -0
- package/dist/chunks/{dropdown-tag.C-LxVWlt.js → dropdown-tag.DPTV12uX.js} +14 -13
- package/dist/chunks/dropdown-tag.DPTV12uX.js.map +1 -0
- package/dist/chunks/{dropdown.CxBlK83Q.js → dropdown.CoVT4i0B.js} +360 -349
- package/dist/chunks/dropdown.CoVT4i0B.js.map +1 -0
- package/dist/chunks/{error-message.DyjHMyEZ.js → error-message.oV0CXm1m.js} +3 -3
- package/dist/chunks/{error-message.DyjHMyEZ.js.map → error-message.oV0CXm1m.js.map} +1 -1
- package/dist/chunks/es6.BvpG4Oi6.js +9 -0
- package/dist/chunks/es6.BvpG4Oi6.js.map +1 -0
- package/dist/chunks/expand.D1DTqaBO.js +33 -0
- package/dist/chunks/expand.D1DTqaBO.js.map +1 -0
- package/dist/chunks/{filter-bar.DmPkRBf4.js → filter-bar.d1IKC-Nr.js} +329 -320
- package/dist/chunks/filter-bar.d1IKC-Nr.js.map +1 -0
- package/dist/chunks/{footer-actions.D9nQFagi.js → footer-actions.Cuiq9UJH.js} +2 -2
- package/dist/chunks/{footer-actions.D9nQFagi.js.map → footer-actions.Cuiq9UJH.js.map} +1 -1
- package/dist/chunks/{header.Cr7115vM.js → header.B4il13uF.js} +3 -3
- package/dist/chunks/{header.Cr7115vM.js.map → header.B4il13uF.js.map} +1 -1
- package/dist/chunks/index.DKQuLmwu.js +182 -0
- package/dist/chunks/{index.Dytpif0G.js.map → index.DKQuLmwu.js.map} +1 -1
- package/dist/chunks/{info-icon.DvL1e5Iu.js → info-icon.B8AL324x.js} +3 -3
- package/dist/chunks/{info-icon.DvL1e5Iu.js.map → info-icon.B8AL324x.js.map} +1 -1
- package/dist/chunks/{input-field.iH1ICJkQ.js → input-field.CKh69yj2.js} +119 -113
- package/dist/chunks/input-field.CKh69yj2.js.map +1 -0
- package/dist/chunks/inspector.types.88WOdYA6.js +116 -0
- package/dist/chunks/inspector.types.88WOdYA6.js.map +1 -0
- package/dist/chunks/listbox-option-tag.m6aNQTJN.js +55 -0
- package/dist/chunks/listbox-option-tag.m6aNQTJN.js.map +1 -0
- package/dist/chunks/loading-button.BxDrDxmI.js +123 -0
- package/dist/chunks/loading-button.BxDrDxmI.js.map +1 -0
- package/dist/chunks/{menu.DN-xhDQU.js → menu.PtOT_BKl.js} +2 -2
- package/dist/chunks/{menu.DN-xhDQU.js.map → menu.PtOT_BKl.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.CeogBGfr.js → modal-fullscreen.BkuEaCdO.js} +2 -2
- package/dist/chunks/{modal-fullscreen.CeogBGfr.js.map → modal-fullscreen.BkuEaCdO.js.map} +1 -1
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.BBef1Rl9.js → modal.vue_vue_type_script_setup_true_lang.CQXfT4eW.js} +4 -4
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.BBef1Rl9.js.map → modal.vue_vue_type_script_setup_true_lang.CQXfT4eW.js.map} +1 -1
- package/dist/chunks/{pagination.BwG1MF4j.js → pagination.DeOBHgWf.js} +2 -2
- package/dist/chunks/{pagination.BwG1MF4j.js.map → pagination.DeOBHgWf.js.map} +1 -1
- package/dist/chunks/{popover.DRb2GW7t.js → popover.CvUTNkQG.js} +3 -3
- package/dist/chunks/{popover.DRb2GW7t.js.map → popover.CvUTNkQG.js.map} +1 -1
- package/dist/chunks/{popper-container.B76aE-3-.js → popper-container.50jF-_VU.js} +487 -435
- package/dist/chunks/popper-container.50jF-_VU.js.map +1 -0
- package/dist/chunks/{radio-group.B9HCffiZ.js → radio-group.r5U1kQIe.js} +95 -93
- package/dist/chunks/radio-group.r5U1kQIe.js.map +1 -0
- package/dist/chunks/search-bar.DmXr-0Ax.js +116 -0
- package/dist/chunks/search-bar.DmXr-0Ax.js.map +1 -0
- package/dist/chunks/secondary-nav.DnQPIiYO.js +137 -0
- package/dist/chunks/secondary-nav.DnQPIiYO.js.map +1 -0
- package/dist/chunks/{segmented-control.DyINOWUl.js → segmented-control.ClihHHOR.js} +2 -2
- package/dist/chunks/{segmented-control.DyINOWUl.js.map → segmented-control.ClihHHOR.js.map} +1 -1
- package/dist/chunks/{selection-card-group.C-YLePO4.js → selection-card-group.AkttDBv5.js} +3 -3
- package/dist/chunks/{selection-card-group.C-YLePO4.js.map → selection-card-group.AkttDBv5.js.map} +1 -1
- package/dist/chunks/{sidepanel.B-LtA15e.js → sidepanel.Dv73FrCn.js} +2 -2
- package/dist/chunks/{sidepanel.B-LtA15e.js.map → sidepanel.Dv73FrCn.js.map} +1 -1
- package/dist/chunks/{structured-list-item.DQiPKhOI.js → structured-list-item.DrYz5IsA.js} +4 -4
- package/dist/chunks/{structured-list-item.DQiPKhOI.js.map → structured-list-item.DrYz5IsA.js.map} +1 -1
- package/dist/chunks/{summary-grid-item-custom.B941Kdvq.js → summary-grid-item-custom.MloQOKnI.js} +4 -4
- package/dist/chunks/{summary-grid-item-custom.B941Kdvq.js.map → summary-grid-item-custom.MloQOKnI.js.map} +1 -1
- package/dist/chunks/{tag.CPhtHjDD.js → tag.D0imyBj_.js} +2 -2
- package/dist/chunks/{tag.CPhtHjDD.js.map → tag.D0imyBj_.js.map} +1 -1
- package/dist/chunks/textarea.meOoBSoa.js +267 -0
- package/dist/chunks/textarea.meOoBSoa.js.map +1 -0
- package/dist/chunks/{timeline-item.Cap9MXkH.js → timeline-item.BF6w6sUT.js} +181 -168
- package/dist/chunks/timeline-item.BF6w6sUT.js.map +1 -0
- package/dist/chunks/{tooltip.CTR3s-Rm.js → tooltip.C0jTO2wt.js} +2 -2
- package/dist/chunks/{tooltip.CTR3s-Rm.js.map → tooltip.C0jTO2wt.js.map} +1 -1
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.WNVsOZdp.js → tutorial.vue_vue_type_script_setup_true_lang.PX3UIJgR.js} +5 -5
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.WNVsOZdp.js.map → tutorial.vue_vue_type_script_setup_true_lang.PX3UIJgR.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.BQBWFTvi.js → use-cached-selected-values.Bh2VFRA-.js} +3 -3
- package/dist/chunks/use-cached-selected-values.Bh2VFRA-.js.map +1 -0
- package/dist/code-snippet.js +1 -1
- package/dist/dashboard-template.js +1 -1
- package/dist/dashed-underline.js +1 -1
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker.js +1 -1
- package/dist/dropdown.js +11 -10
- package/dist/dropdown.js.map +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +241 -236
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/inspector.js +6 -0
- package/dist/inspector.js.map +1 -0
- package/dist/internal.js +30 -31
- 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/radio-group.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/structured-list.js +1 -1
- package/dist/summary-grid.js +1 -1
- package/dist/tag.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +2 -2
- package/dist/assets/avatar-image.css +0 -1
- package/dist/avatar-image.js +0 -7
- package/dist/avatar-image.js.map +0 -1
- package/dist/chunks/avatar-image.DO4w_loj.js +0 -61
- package/dist/chunks/avatar-image.DO4w_loj.js.map +0 -1
- package/dist/chunks/code-snippet.e8bxDBCO.js.map +0 -1
- package/dist/chunks/dropdown-default-textbox.-Oy2eT40.js.map +0 -1
- package/dist/chunks/dropdown-tag.C-LxVWlt.js.map +0 -1
- package/dist/chunks/dropdown.CxBlK83Q.js.map +0 -1
- package/dist/chunks/filter-bar.DmPkRBf4.js.map +0 -1
- package/dist/chunks/index.Dytpif0G.js +0 -125
- package/dist/chunks/input-field.iH1ICJkQ.js.map +0 -1
- package/dist/chunks/listbox-option-tag.Bv4-hXnG.js +0 -94
- package/dist/chunks/listbox-option-tag.Bv4-hXnG.js.map +0 -1
- package/dist/chunks/loading-button.BI32pZiW.js +0 -117
- package/dist/chunks/loading-button.BI32pZiW.js.map +0 -1
- package/dist/chunks/popper-container.B76aE-3-.js.map +0 -1
- package/dist/chunks/radio-group.B9HCffiZ.js.map +0 -1
- package/dist/chunks/search-bar.DxskyM4e.js +0 -107
- package/dist/chunks/search-bar.DxskyM4e.js.map +0 -1
- package/dist/chunks/secondary-nav.D66nxbU-.js +0 -112
- package/dist/chunks/secondary-nav.D66nxbU-.js.map +0 -1
- package/dist/chunks/textarea.CJ8xiMjv.js +0 -288
- package/dist/chunks/textarea.CJ8xiMjv.js.map +0 -1
- package/dist/chunks/timeline-item.Cap9MXkH.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.BQBWFTvi.js.map +0 -1
- /package/dist/@types/packages/{vue2/src/components/button → core/src}/components/loading-button/loading-button.types.d.ts +0 -0
- /package/dist/@types/packages/{vue2 → core}/src/types/omit-strict.d.ts +0 -0
- /package/dist/@types/packages/vue2/src/components/{avatar-image → avatar/components/avatar-image}/avatar-image.types.d.ts +0 -0
- /package/dist/@types/packages/vue2/src/components/{avatar-image → avatar/components/avatar-image}/index.d.ts +0 -0
- /package/dist/@types/packages/vue2/src/components/{internal/avatar → avatar}/index.d.ts +0 -0
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as M, useSlots as O, toRefs as q, computed as n, openBlock as a, createElementBlock as
|
|
2
|
-
import { u as
|
|
1
|
+
import { defineComponent as M, useSlots as O, toRefs as q, computed as n, openBlock as a, createElementBlock as v, normalizeClass as A, unref as e, createVNode as I, createElementVNode as D, withCtx as s, renderSlot as S, createBlock as g, mergeProps as H, createCommentVNode as c, toRef as L, watch as U, Fragment as z, renderList as F, createSlots as G, createTextVNode as R, toDisplayString as N } from "vue";
|
|
2
|
+
import { u as j } from "./use-form-layout-loading.D3lALhtC.js";
|
|
3
3
|
import { u as $ } from "./use-has-slot.B7eQSabc.js";
|
|
4
|
-
import { g as
|
|
5
|
-
import { B as C, d as
|
|
6
|
-
import { C as
|
|
7
|
-
import { B as
|
|
8
|
-
import { u as
|
|
9
|
-
import { u as
|
|
10
|
-
import { g as
|
|
11
|
-
import { R as T, a as
|
|
4
|
+
import { g as V } from "./unique-id.XFfoKuc2.js";
|
|
5
|
+
import { B as C, d as P } from "./typography.D7onlQ9v.js";
|
|
6
|
+
import { C as Z } from "./controls-group.fAwpZLvA.js";
|
|
7
|
+
import { B as Y } from "./tag.D0imyBj_.js";
|
|
8
|
+
import { u as J } from "./aria-label.CaUURpnB.js";
|
|
9
|
+
import { u as K } from "./use-default-slot-validator.O02rzsob.js";
|
|
10
|
+
import { g as Q } from "./get-slot-text.D5WBGjic.js";
|
|
11
|
+
import { R as T, a as W } from "./radio-input.BEzK-fgR.js";
|
|
12
12
|
import { _ as w } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
13
|
-
import { E as
|
|
13
|
+
import { E as X } from "./error-message.oV0CXm1m.js";
|
|
14
14
|
import "../assets/radio-group.css";
|
|
15
|
-
const
|
|
15
|
+
const ee = ["for"], te = {
|
|
16
16
|
key: 0,
|
|
17
17
|
class: "b-radio-button__primary-label"
|
|
18
18
|
}, oe = {
|
|
19
19
|
name: "bento-radio-button",
|
|
20
20
|
model: { prop: "modelValue" }
|
|
21
|
-
},
|
|
21
|
+
}, ae = /* @__PURE__ */ M({
|
|
22
22
|
...oe,
|
|
23
23
|
props: {
|
|
24
24
|
/**
|
|
@@ -55,69 +55,71 @@ const X = ["for"], ee = {
|
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
emits: ["input", "update:model-value"],
|
|
58
|
-
setup(
|
|
59
|
-
const
|
|
60
|
-
|
|
58
|
+
setup(t, { emit: b }) {
|
|
59
|
+
const o = t, i = O(), l = $(i), { value: p } = q(o), h = V("bento-radio-button"), f = V("description");
|
|
60
|
+
K("bento-radio-button", i.default, i.description);
|
|
61
61
|
const m = n(() => ({
|
|
62
|
-
[`b-radio-button--${T.DISABLED}`]:
|
|
63
|
-
[`b-radio-button--${T.READONLY}`]:
|
|
64
|
-
})), E =
|
|
65
|
-
ariaLabel:
|
|
62
|
+
[`b-radio-button--${T.DISABLED}`]: o.disabled,
|
|
63
|
+
[`b-radio-button--${T.READONLY}`]: o.readonly
|
|
64
|
+
})), E = J({
|
|
65
|
+
ariaLabel: Q(i)("default"),
|
|
66
66
|
label: p.value
|
|
67
|
-
}), y = n(() =>
|
|
68
|
-
!
|
|
67
|
+
}), y = n(() => o.value === o.modelValue), k = () => {
|
|
68
|
+
!o.disabled && !o.readonly && (b("update:model-value", o.value), b("input", o.value));
|
|
69
69
|
};
|
|
70
|
-
return (d,
|
|
70
|
+
return (d, _) => (a(), v("div", {
|
|
71
71
|
class: A(["b-radio-button", e(m)]),
|
|
72
72
|
"data-testid": "radio-button-container"
|
|
73
73
|
}, [
|
|
74
|
-
I(e(
|
|
74
|
+
I(e(W), {
|
|
75
75
|
id: e(h),
|
|
76
76
|
"aria-label": e(E),
|
|
77
77
|
"aria-describedby": e(l)("description") ? e(f) : "",
|
|
78
78
|
checked: e(y),
|
|
79
|
-
disabled:
|
|
80
|
-
readonly:
|
|
81
|
-
"has-error":
|
|
79
|
+
disabled: t.disabled,
|
|
80
|
+
readonly: t.readonly,
|
|
81
|
+
"has-error": t.hasError,
|
|
82
82
|
value: e(p),
|
|
83
|
-
"model-value":
|
|
83
|
+
"model-value": t.modelValue,
|
|
84
84
|
"onUpdate:modelValue": k
|
|
85
85
|
}, null, 8, ["id", "aria-label", "aria-describedby", "checked", "disabled", "readonly", "has-error", "value", "model-value"]),
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
86
|
+
D("div", null, [
|
|
87
|
+
e(l)("default") ? (a(), v("label", {
|
|
88
|
+
key: 0,
|
|
89
|
+
for: e(h),
|
|
90
|
+
class: "b-radio-button__label-container"
|
|
91
|
+
}, [
|
|
92
|
+
e(l)("default") ? (a(), v("span", te, [
|
|
93
|
+
I(e(C), {
|
|
94
|
+
class: "b-radio-button__label",
|
|
95
|
+
el: "span",
|
|
96
|
+
variant: "body"
|
|
97
|
+
}, {
|
|
98
|
+
default: s(() => [
|
|
99
|
+
S(d.$slots, "default", {}, void 0, !0)
|
|
100
|
+
]),
|
|
101
|
+
_: 3
|
|
102
|
+
}),
|
|
103
|
+
t.tag ? (a(), g(e(Y), H({
|
|
104
|
+
key: 0,
|
|
105
|
+
class: "b-radio-button__label-tag"
|
|
106
|
+
}, t.tag), null, 16)) : c("", !0)
|
|
107
|
+
])) : c("", !0),
|
|
108
|
+
e(l)("default") && e(l)("description") ? (a(), g(e(C), {
|
|
109
|
+
key: 1,
|
|
110
|
+
id: e(f),
|
|
111
|
+
class: "b-radio-button__description",
|
|
94
112
|
el: "span",
|
|
95
113
|
variant: "body"
|
|
96
114
|
}, {
|
|
97
115
|
default: s(() => [
|
|
98
|
-
S(d.$slots, "
|
|
116
|
+
S(d.$slots, "description", {}, void 0, !0)
|
|
99
117
|
]),
|
|
100
118
|
_: 3
|
|
101
|
-
}),
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
class: "b-radio-button__label-tag"
|
|
105
|
-
}, o.tag), null, 16)) : c("", !0)
|
|
106
|
-
])) : c("", !0),
|
|
107
|
-
e(l)("default") && e(l)("description") ? (a(), v(e(C), {
|
|
119
|
+
}, 8, ["id"])) : c("", !0)
|
|
120
|
+
], 8, ee)) : c("", !0),
|
|
121
|
+
e(l)("content") && e(y) ? (a(), g(e(C), {
|
|
108
122
|
key: 1,
|
|
109
|
-
id: e(f),
|
|
110
|
-
class: "b-radio-button__description",
|
|
111
|
-
el: "span",
|
|
112
|
-
variant: "body"
|
|
113
|
-
}, {
|
|
114
|
-
default: s(() => [
|
|
115
|
-
S(d.$slots, "description", {}, void 0, !0)
|
|
116
|
-
]),
|
|
117
|
-
_: 3
|
|
118
|
-
}, 8, ["id"])) : c("", !0),
|
|
119
|
-
e(l)("content") && e(y) ? (a(), v(e(C), {
|
|
120
|
-
key: 2,
|
|
121
123
|
class: "b-radio-button__content",
|
|
122
124
|
el: "div"
|
|
123
125
|
}, {
|
|
@@ -126,16 +128,16 @@ const X = ["for"], ee = {
|
|
|
126
128
|
]),
|
|
127
129
|
_: 3
|
|
128
130
|
})) : c("", !0)
|
|
129
|
-
]
|
|
131
|
+
])
|
|
130
132
|
], 2));
|
|
131
133
|
}
|
|
132
|
-
}),
|
|
133
|
-
var B = /* @__PURE__ */ ((
|
|
134
|
-
const
|
|
134
|
+
}), re = /* @__PURE__ */ w(ae, [["__scopeId", "data-v-36918a5c"]]);
|
|
135
|
+
var B = /* @__PURE__ */ ((t) => (t.HORIZONTAL = "horizontal", t.VERTICAL = "vertical", t))(B || {});
|
|
136
|
+
const le = { class: "b-radio-group" }, de = {
|
|
135
137
|
name: "bento-radio-group",
|
|
136
138
|
model: { prop: "modelValue" }
|
|
137
|
-
},
|
|
138
|
-
...
|
|
139
|
+
}, ne = /* @__PURE__ */ M({
|
|
140
|
+
...de,
|
|
139
141
|
props: {
|
|
140
142
|
/**
|
|
141
143
|
* Descriptive supporting text visbile underneath the label.
|
|
@@ -204,26 +206,26 @@ const re = { class: "b-radio-group" }, le = {
|
|
|
204
206
|
variant: {
|
|
205
207
|
type: String,
|
|
206
208
|
default: B.VERTICAL,
|
|
207
|
-
validator: (
|
|
209
|
+
validator: (t) => Object.values(B).includes(t)
|
|
208
210
|
}
|
|
209
211
|
},
|
|
210
212
|
emits: ["input", "update:model-value"],
|
|
211
|
-
setup(
|
|
212
|
-
const
|
|
213
|
-
() => !
|
|
214
|
-
), y = n(() => !
|
|
215
|
-
"b-radio-group__buttons--horizontal":
|
|
216
|
-
})), d = n(() =>
|
|
213
|
+
setup(t, { emit: b }) {
|
|
214
|
+
const o = t, i = "bento-radio-group", l = O(), p = $(l), h = L(o, "modelValue"), f = V("error"), { isReadOnly: m } = j(L(o, "readonly")), E = n(
|
|
215
|
+
() => !o.disabled && !m.value && (!!o.errorMessage || o.hasError)
|
|
216
|
+
), y = n(() => !o.disabled && !m.value && !!o.errorMessage), k = n(() => ({
|
|
217
|
+
"b-radio-group__buttons--horizontal": o.variant === B.HORIZONTAL
|
|
218
|
+
})), d = n(() => o.variant === "vertical"), _ = n(() => p("content") && !(d != null && d.value)), x = (u) => {
|
|
217
219
|
b("update:model-value", u), b("input", u);
|
|
218
220
|
};
|
|
219
|
-
return
|
|
221
|
+
return o.hasError && P(
|
|
220
222
|
'BentoRadioGroup "hasError" property',
|
|
221
223
|
`Use the BentoRadioGroup "errorMessage" property instead to indicate that there is a modifier error.
|
|
222
224
|
Having the field as "undefined" will hide/remove the error.
|
|
223
225
|
<bento-radio-group errorMessage="Error message text" />`,
|
|
224
226
|
"2.0.0"
|
|
225
|
-
),
|
|
226
|
-
|
|
227
|
+
), U(
|
|
228
|
+
_,
|
|
227
229
|
(u) => {
|
|
228
230
|
if (u)
|
|
229
231
|
throw new Error("The content slot is only available for the vertical radio group layout");
|
|
@@ -231,40 +233,40 @@ const re = { class: "b-radio-group" }, le = {
|
|
|
231
233
|
{
|
|
232
234
|
immediate: !0
|
|
233
235
|
}
|
|
234
|
-
), (u,
|
|
235
|
-
I(e(
|
|
236
|
+
), (u, se) => (a(), v("div", le, [
|
|
237
|
+
I(e(Z), {
|
|
236
238
|
class: A(["b-radio-group__buttons", e(k)]),
|
|
237
239
|
"aria-describedby": e(y) ? e(f) : "",
|
|
238
240
|
"component-name": i,
|
|
239
|
-
description:
|
|
240
|
-
disabled:
|
|
241
|
-
form:
|
|
242
|
-
label:
|
|
243
|
-
optional:
|
|
244
|
-
required:
|
|
245
|
-
"hide-label":
|
|
246
|
-
"tooltip-text":
|
|
241
|
+
description: t.description,
|
|
242
|
+
disabled: t.disabled,
|
|
243
|
+
form: t.formId,
|
|
244
|
+
label: t.label,
|
|
245
|
+
optional: t.optional,
|
|
246
|
+
required: t.required,
|
|
247
|
+
"hide-label": t.hideLabel,
|
|
248
|
+
"tooltip-text": t.tooltipText
|
|
247
249
|
}, {
|
|
248
250
|
default: s(() => [
|
|
249
|
-
(a(!0),
|
|
251
|
+
(a(!0), v(z, null, F(t.items, (r) => (a(), g(e(re), {
|
|
250
252
|
key: r.value,
|
|
251
253
|
"model-value": e(h),
|
|
252
254
|
value: r.value,
|
|
253
|
-
disabled:
|
|
255
|
+
disabled: t.disabled || r.disabled,
|
|
254
256
|
readonly: e(m) || r.readonly,
|
|
255
257
|
"has-error": e(E) || r.hasError,
|
|
256
258
|
tag: r.tag,
|
|
257
259
|
"onUpdate:modelValue": x
|
|
258
|
-
},
|
|
260
|
+
}, G({
|
|
259
261
|
default: s(() => [
|
|
260
|
-
|
|
262
|
+
R(N(r.label), 1)
|
|
261
263
|
]),
|
|
262
264
|
_: 2
|
|
263
265
|
}, [
|
|
264
266
|
r.description ? {
|
|
265
267
|
name: "description",
|
|
266
268
|
fn: s(() => [
|
|
267
|
-
|
|
269
|
+
R(N(r.description), 1)
|
|
268
270
|
]),
|
|
269
271
|
key: "0"
|
|
270
272
|
} : void 0,
|
|
@@ -279,18 +281,18 @@ const re = { class: "b-radio-group" }, le = {
|
|
|
279
281
|
]),
|
|
280
282
|
_: 3
|
|
281
283
|
}, 8, ["aria-describedby", "class", "description", "disabled", "form", "label", "optional", "required", "hide-label", "tooltip-text"]),
|
|
282
|
-
e(y) ? (a(),
|
|
284
|
+
e(y) ? (a(), g(e(X), {
|
|
283
285
|
key: 0,
|
|
284
286
|
id: e(f),
|
|
285
|
-
"error-message":
|
|
287
|
+
"error-message": t.errorMessage,
|
|
286
288
|
class: "b-radio-group__error-message"
|
|
287
289
|
}, null, 8, ["id", "error-message"])) : c("", !0)
|
|
288
290
|
]));
|
|
289
291
|
}
|
|
290
|
-
}),
|
|
292
|
+
}), Ee = /* @__PURE__ */ w(ne, [["__scopeId", "data-v-69b7e4e3"]]);
|
|
291
293
|
export {
|
|
292
|
-
|
|
294
|
+
Ee as B,
|
|
293
295
|
B as a,
|
|
294
|
-
|
|
296
|
+
re as b
|
|
295
297
|
};
|
|
296
|
-
//# sourceMappingURL=radio-group.
|
|
298
|
+
//# sourceMappingURL=radio-group.r5U1kQIe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-group.r5U1kQIe.js","sources":["../../../vue2/src/components/radio-group/components/radio-button/radio-button.vue","../../../vue2/src/components/radio-group/radio-group.types.ts","../../../vue2/src/components/radio-group/radio-group.vue"],"sourcesContent":["<template>\n <div class=\"b-radio-button\" data-testid=\"radio-button-container\" :class=\"conditionalClassContainer\">\n <radio-input\n :id=\"radioButtonId\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"hasSlot('description') ? descriptionId : ''\"\n :checked=\"isChecked\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :has-error=\"hasError\"\n :value=\"value\"\n :model-value=\"modelValue\"\n @update:model-value=\"onChange\"\n />\n <div>\n <label v-if=\"hasSlot('default')\" :for=\"radioButtonId\" class=\"b-radio-button__label-container\">\n <span v-if=\"hasSlot('default')\" class=\"b-radio-button__primary-label\">\n <bento-typography class=\"b-radio-button__label\" el=\"span\" variant=\"body\"><slot /></bento-typography>\n <bento-tag v-if=\"tag\" class=\"b-radio-button__label-tag\" v-bind=\"tag\" />\n </span>\n <bento-typography\n v-if=\"hasSlot('default') && hasSlot('description')\"\n :id=\"descriptionId\"\n class=\"b-radio-button__description\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"description\"></slot>\n </bento-typography>\n </label>\n <bento-typography v-if=\"hasSlot('content') && isChecked\" class=\"b-radio-button__content\" el=\"div\">\n <slot name=\"content\"></slot>\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTag } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n import { RadioInput } from '../../../internal/radio-input';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { generateUid } from '@/utils/ts/unique-id';\n import { computed, ComputedRef, PropType, toRefs, useSlots } from 'vue';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { BentoRadioButtonStateClass, BentoRadioButtonTag, BentoRadioButtonValue } from './radio-button.types';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const props = defineProps({\n /**\n * Disable the radio button (optional)\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Shows bento-radio-button in error state (optional)\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * This property should not be used directly.\n * It will be used by v-model directive on radio component.\n */\n modelValue: {\n type: [String, Number] as PropType<BentoRadioButtonValue>,\n default: null,\n },\n\n /**\n * Sets the radio button to readonly (optional)\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Sets the properties of the BentoTag component that is placed next to the label.\n * {@see BentoTag}\n */\n tag: { type: Object as PropType<BentoRadioButtonTag>, default: undefined },\n\n /**\n * Indicates the value of the input that will be returned when it's checked\n */\n value: {\n type: [String, Number] as PropType<BentoRadioButtonValue>,\n required: true,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the radio button is clicked. Enables Vue2 \"v-model\"\n */\n (e: 'input', value: BentoRadioButtonValue);\n\n /**\n * Emitted when the radio button is clicked. Enables Vue3 \"v-model\"\n */\n (e: 'update:model-value', value: BentoRadioButtonValue);\n }>();\n\n const { value } = toRefs(props);\n const radioButtonId = generateUid('bento-radio-button');\n const descriptionId = generateUid('description');\n\n useDefaultSlotValidator('bento-radio-button', slots.default, slots.description);\n\n const conditionalClassContainer = computed(() => ({\n [`b-radio-button--${BentoRadioButtonStateClass.DISABLED}`]: props.disabled,\n [`b-radio-button--${BentoRadioButtonStateClass.READONLY}`]: props.readonly,\n }));\n\n const ariaLabel = useAriaLabel({\n ariaLabel: getSlotText(slots)('default'),\n label: value.value as string,\n });\n\n const isChecked: ComputedRef<boolean> = computed(() => props.value === props.modelValue);\n\n const onChange = () => {\n if (!props.disabled && !props.readonly) {\n emit('update:model-value', props.value);\n emit('input', props.value);\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Radio buttons are used when two or more options are mutually exclusive,\n * the user can only select a single option from a list of pre-defined options.\n * The label tag area is also clickable.\n * Only to be used internally.\n *\n * @example\n * import { BentoRadioButton } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoRadioButton },\n * template: `\n * <bento-radio-button\n * disabled\n * value=\"inputRadio\"\n * model-value.sync=\"modelValue\"\n * >\n * Label text\n * <template #description>Description text below label</template>\n * <template #content>Content shown when checked</template>\n * </bento-radio-button>\n * `,\n * setup() {\n * const modelValue = ref('anyValue')\n * const value = 'option-value'\n *\n * return {\n * modelValue,\n * value,\n * }\n * }\n * }\n */\n export default {\n name: 'bento-radio-button',\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./radio-button.scss\" />\n","import type { BentoRadioButtonTag, BentoRadioButtonValue } from './components/radio-button';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoRadioGroupVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport type BentoRadioGroupValue = BentoRadioButtonValue;\n\nexport interface BentoRadioGroupItem {\n value: BentoRadioGroupValue;\n label: string;\n description?: string;\n disabled?: boolean;\n readonly?: boolean;\n hasError?: boolean;\n tag?: BentoRadioButtonTag;\n}\n\nexport type BentoRadioGroupItems = Array<BentoRadioGroupItem>;\n","<template>\n <div class=\"b-radio-group\">\n <controls-group\n class=\"b-radio-group__buttons\"\n :aria-describedby=\"shouldShowErrorMessage ? errorId : ''\"\n :component-name=\"COMPONENT_NAME\"\n :class=\"conditionalClasses\"\n :description=\"description\"\n :disabled=\"disabled\"\n :form=\"formId\"\n :label=\"label\"\n :optional=\"optional\"\n :required=\"required\"\n :hide-label=\"hideLabel\"\n :tooltip-text=\"tooltipText\"\n >\n <bento-radio-button\n v-for=\"item in items\"\n :key=\"item.value\"\n :model-value=\"inputValue\"\n :value=\"item.value\"\n :disabled=\"disabled || item.disabled\"\n :readonly=\"isReadOnly || item.readonly\"\n :has-error=\"shouldShowError || item.hasError\"\n :tag=\"item.tag\"\n @update:model-value=\"onInput\"\n >\n <template #default>{{ item.label }}</template>\n <template v-if=\"item.description\" #description>{{ item.description }}</template>\n <template v-if=\"hasSlot('content') && isVertical\" #content>\n <slot name=\"content\"></slot>\n </template>\n </bento-radio-button>\n </controls-group>\n <error-message\n v-if=\"shouldShowErrorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-radio-group__error-message\"\n />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, toRef, useSlots, watch } from 'vue';\n import { ControlsGroup, ErrorMessage } from '@/components/internal';\n import { BentoRadioButton } from './components/radio-button';\n import { useHasSlot } from '@/composables';\n import { generateUid } from '@/utils/ts/unique-id';\n import { deprecate } from '@/utils/ts/deprecate';\n import { BentoRadioGroupItems, BentoRadioGroupValue, BentoRadioGroupVariant } from './radio-group.types';\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n /**\n * The name of the component to be used in the Vue devtools and console warnings.\n */\n const COMPONENT_NAME = 'bento-radio-group';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const emit = defineEmits<{\n /**\n * Emitted when an option inside the group is selected. Enables Vue2 \"v-model\"\n */\n (e: 'input', value: BentoRadioGroupValue);\n\n /**\n * Emitted when an option inside the group is selected. Enables Vue3 \"v-model\"\n */\n (e: 'update:model-value', value: BentoRadioGroupValue);\n }>();\n\n const props = defineProps({\n /**\n * Descriptive supporting text visbile underneath the label.\n */\n description: { type: String, default: null },\n\n /**\n * If set to true, renders all bento-radio-buttons in the group in a disabled state.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * If passed as a prop, all bento-radio-buttons in an error state and renders the string beneath the buttons.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * The form id the radio group is associated with. Defaults to null, as a radio group can also be used standalone.\n */\n formId: { type: String, default: null },\n\n /**\n * If set to true, renders all bento-radio-buttons in the group in an error state.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * Shows/hides the group label.\n */\n hideLabel: { type: Boolean, default: null },\n\n /**\n * The radio group's items.\n */\n items: {\n type: Array as PropType<BentoRadioGroupItems>,\n required: true,\n },\n\n /**\n * The name associated with the group. Required for accessibility purposes.\n */\n label: { type: String, required: true },\n\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoRadioButtonItem's value.\n * Defaults to no value selected.\n */\n modelValue: {\n type: [Number, String] as PropType<BentoRadioGroupValue>,\n default: null,\n },\n\n /**\n * Indicates the field is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * If set to true, renders all bento-radio-button in the group in a readonly state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Indicates the field is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * The radio group's layout. It can be vertical or horizontal. Defaults to vertical.\n */\n variant: {\n type: String as PropType<BentoRadioGroupVariant | `${BentoRadioGroupVariant}`>,\n default: BentoRadioGroupVariant.VERTICAL,\n validator: (value: BentoRadioGroupVariant) => Object.values(BentoRadioGroupVariant).includes(value),\n },\n });\n\n const inputValue = toRef(props, 'modelValue');\n const errorId = generateUid('error');\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const shouldShowError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.hasError)\n );\n const shouldShowErrorMessage = computed(() => !props.disabled && !isReadOnly.value && !!props.errorMessage);\n\n const conditionalClasses = computed(() => ({\n 'b-radio-group__buttons--horizontal': props.variant === BentoRadioGroupVariant.HORIZONTAL,\n }));\n\n // Content slot logic\n const isVertical = computed(() => props.variant === 'vertical');\n const shouldShowSlotError = computed(() => hasSlot('content') && !isVertical?.value);\n\n const onInput = value => {\n emit('update:model-value', value);\n emit('input', value);\n };\n\n if (props.hasError) {\n deprecate(\n 'BentoRadioGroup \"hasError\" property',\n `Use the BentoRadioGroup \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-radio-group errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n watch(\n shouldShowSlotError,\n newVal => {\n if (newVal) {\n throw new Error('The content slot is only available for the vertical radio group layout');\n }\n },\n {\n immediate: true,\n }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * A radio group component should be used whenever it is necessary to use a set of radio buttons\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * import { BentoRadioGroup } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { BentoRadioGroup },\n * template: `\n * <bento-radio-group\n * label=\"Your group label\"\n * :items=\"[\n * { value: 1, label: 'Your label' },\n * { value: 2, label: 'Another label', description: 'Your descriptive sub label' },\n * ]\"\n * variant=\"horizontal\"\n * />\n * `\n * };\n */\n export default {\n name: 'bento-radio-group',\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./radio-group.scss\" />\n"],"names":["__default__$1","slots","useSlots","hasSlot","useHasSlot","value","toRefs","props","radioButtonId","generateUid","descriptionId","useDefaultSlotValidator","conditionalClassContainer","computed","RadioInputStateClass","ariaLabel","useAriaLabel","getSlotText","isChecked","onChange","emit","BentoRadioGroupVariant","BentoRadioGroupVariant2","__default__","COMPONENT_NAME","inputValue","toRef","errorId","isReadOnly","useFormLayoutFieldLoading","shouldShowError","shouldShowErrorMessage","conditionalClasses","isVertical","shouldShowSlotError","onInput","deprecate","watch","newVal"],"mappings":";;;;;;;;;;;;;;;;;GAkKIA,KAAA;AAAA,EAAe,MAAA;AAAA,EACL,OAAA,EAAA,MAAA,aAAA;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBArHAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAqDA,EAAA,OAAAI,EAAA,IAAAC,EAAAC,CAAA,GACAC,IAAAC,EAAA,oBAAA,GACAC,IAAAD,EAAA,aAAA;AAEA,IAAAE,EAAA,sBAAAV,EAAA,SAAAA,EAAA,WAAA;AAEA,UAAAW,IAAAC,EAAA,OAAA;AAAA,MAAkD,CAAA,mBAAAC,EAAA,QAAA,EAAA,GAAAP,EAAA;AAAA,MACoB,CAAA,mBAAAO,EAAA,QAAA,EAAA,GAAAP,EAAA;AAAA,IACA,EAAA,GAGtEQ,IAAAC,EAAA;AAAA,MAA+B,WAAAC,EAAAhB,CAAA,EAAA,SAAA;AAAA,MACY,OAAAI,EAAA;AAAA,IAC1B,CAAA,GAGjBa,IAAAL,EAAA,MAAAN,EAAA,UAAAA,EAAA,UAAA,GAEAY,IAAA,MAAA;AACI,MAAA,CAAAZ,EAAA,YAAA,CAAAA,EAAA,aACIa,EAAA,sBAAAb,EAAA,KAAA,GACAa,EAAA,SAAAb,EAAA,KAAA;AAAA,IACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACvHI,IAAAc,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA;uCC2NRE,KAAA;AAAA,EAAe,MAAA;AAAA,EACL,OAAA,EAAA,MAAA,aAAA;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA3KAC,IAAA,qBAEAvB,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAmGAwB,IAAAC,EAAAnB,GAAA,YAAA,GACAoB,IAAAlB,EAAA,OAAA,GACA,EAAA,YAAAmB,EAAA,IAAAC,EAAAH,EAAAnB,GAAA,UAAA,CAAA,GAEAuB,IAAAjB;AAAA,MAAwB,MAAA,CAAAN,EAAA,YAAA,CAAAqB,EAAA,UAAA,CAAA,CAAArB,EAAA,gBAAAA,EAAA;AAAA,IACyD,GAEjFwB,IAAAlB,EAAA,MAAA,CAAAN,EAAA,YAAA,CAAAqB,EAAA,SAAA,CAAA,CAAArB,EAAA,YAAA,GAEAyB,IAAAnB,EAAA,OAAA;AAAA,MAA2C,sCAAAN,EAAA,YAAAc,EAAA;AAAA,IACwC,EAAA,GAInFY,IAAApB,EAAA,MAAAN,EAAA,YAAA,UAAA,GACA2B,IAAArB,EAAA,MAAAV,EAAA,SAAA,KAAA,EAAA8B,KAAA,QAAAA,EAAA,MAAA,GAEAE,IAAA,CAAA9B,MAAA;AACI,MAAAe,EAAA,sBAAAf,CAAA,GACAe,EAAA,SAAAf,CAAA;AAAA,IAAmB;AAGvB,WAAAE,EAAA,YACI6B;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA,MACA;AAAA,IAGA,GAIRC;AAAA,MAAAH;AAAA,MACI,CAAAI,MAAA;AAEI,YAAAA;AACI,gBAAA,IAAA,MAAA,wEAAA;AAAA,MACJ;AAAA,MACJ;AAAA,QACA,WAAA;AAAA,MACe;AAAA,IACf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { defineComponent as _, ref as p, watch as A, openBlock as I, createElementBlock as S, createVNode as c, unref as s, createSlots as g, withCtx as f, createElementVNode as E, withKeys as m } from "vue";
|
|
2
|
+
import { d as F } from "./debounce.DUTu11PS.js";
|
|
3
|
+
import { u as P } from "./i18n.DY5YXG5f.js";
|
|
4
|
+
import { B as T } from "./input-field.CKh69yj2.js";
|
|
5
|
+
import { S as k } from "./search.0lh99z1F.js";
|
|
6
|
+
import { C as x } from "./cross-circle-fill.vLaelNTN.js";
|
|
7
|
+
import { _ as K } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
8
|
+
import "../assets/search-bar.css";
|
|
9
|
+
var b = /* @__PURE__ */ ((e) => (e.CLEAR = "clear", e.ESCAPE = "escape-pressed", e.INPUT = "input", e.UPDATE = "update:search-term", e))(b || {}), N = /* @__PURE__ */ ((e) => (e.CLEAR = "search-clear", e.INPUT = "search-input", e.UPDATE = "update:search-term", e))(N || {});
|
|
10
|
+
const v = {
|
|
11
|
+
"en-US": {
|
|
12
|
+
search: "Search",
|
|
13
|
+
clearSearch: "Clear search"
|
|
14
|
+
}
|
|
15
|
+
}, U = { class: "b-search-bar" }, L = ["onKeypress", "onKeyup"], w = {
|
|
16
|
+
i18n: { messages: v }
|
|
17
|
+
}, $ = /* @__PURE__ */ _({
|
|
18
|
+
...w,
|
|
19
|
+
__name: "search-bar",
|
|
20
|
+
props: {
|
|
21
|
+
/**
|
|
22
|
+
* Text that labels an the search bar input element
|
|
23
|
+
*/
|
|
24
|
+
inputFieldAriaLabel: { type: String, required: !0 },
|
|
25
|
+
/**
|
|
26
|
+
* Reduces height of the search bar
|
|
27
|
+
*/
|
|
28
|
+
condensed: { type: Boolean, default: !1 },
|
|
29
|
+
/**
|
|
30
|
+
* Custom debounce time. Default: 300
|
|
31
|
+
*/
|
|
32
|
+
debounceTime: { type: Number, default: 300 },
|
|
33
|
+
/**
|
|
34
|
+
* Text displayed as the placeholder of the input-field
|
|
35
|
+
*/
|
|
36
|
+
placeholder: { type: String, default: "" },
|
|
37
|
+
/**
|
|
38
|
+
* Text displayed as the value being searched
|
|
39
|
+
*/
|
|
40
|
+
value: { type: String, default: void 0 }
|
|
41
|
+
},
|
|
42
|
+
emits: ["input", "clear", "escape-pressed", "blur", "focus"],
|
|
43
|
+
setup(e, { expose: h, emit: a }) {
|
|
44
|
+
const o = e, { t: l } = P({ messages: v }), r = p(o.value), u = p();
|
|
45
|
+
A(
|
|
46
|
+
() => o.value,
|
|
47
|
+
() => {
|
|
48
|
+
r.value = o.value;
|
|
49
|
+
},
|
|
50
|
+
{ immediate: !0 }
|
|
51
|
+
);
|
|
52
|
+
const n = () => {
|
|
53
|
+
r.value = "", a("clear"), a("input", "");
|
|
54
|
+
}, y = F(() => {
|
|
55
|
+
a("input", r.value);
|
|
56
|
+
}, o.debounceTime), C = (i) => {
|
|
57
|
+
r.value = i, y();
|
|
58
|
+
};
|
|
59
|
+
return h({
|
|
60
|
+
/**
|
|
61
|
+
* Focus on the input field when called.
|
|
62
|
+
*/
|
|
63
|
+
focus: () => {
|
|
64
|
+
u.value.focusInput();
|
|
65
|
+
}
|
|
66
|
+
}), (i, t) => (I(), S("div", U, [
|
|
67
|
+
c(T, {
|
|
68
|
+
ref_key: "bentoInputField",
|
|
69
|
+
ref: u,
|
|
70
|
+
value: r.value,
|
|
71
|
+
type: "search",
|
|
72
|
+
condensed: e.condensed,
|
|
73
|
+
"aria-label": e.inputFieldAriaLabel,
|
|
74
|
+
"aria-hidden": !1,
|
|
75
|
+
placeholder: e.placeholder,
|
|
76
|
+
onInput: C,
|
|
77
|
+
onFocus: t[0] || (t[0] = (d) => a("focus")),
|
|
78
|
+
onBlur: t[1] || (t[1] = (d) => a("blur")),
|
|
79
|
+
onEscapePressed: t[2] || (t[2] = (d) => a(s(b).ESCAPE))
|
|
80
|
+
}, g({
|
|
81
|
+
iconBefore: f(() => [
|
|
82
|
+
c(s(k), {
|
|
83
|
+
"svg-title": s(l)("search"),
|
|
84
|
+
"aria-hidden": "true"
|
|
85
|
+
}, null, 8, ["svg-title"])
|
|
86
|
+
]),
|
|
87
|
+
_: 2
|
|
88
|
+
}, [
|
|
89
|
+
r.value ? {
|
|
90
|
+
name: "iconAfter",
|
|
91
|
+
fn: f(() => [
|
|
92
|
+
E("div", {
|
|
93
|
+
class: "b-search-bar__clear-search",
|
|
94
|
+
tabindex: "0",
|
|
95
|
+
"data-testid": "b-search-bar-clear-search-button",
|
|
96
|
+
onClick: n,
|
|
97
|
+
onKeypress: m(n, ["enter"]),
|
|
98
|
+
onKeyup: m(n, ["space"])
|
|
99
|
+
}, [
|
|
100
|
+
c(s(x), {
|
|
101
|
+
"svg-title": s(l)("clearSearch")
|
|
102
|
+
}, null, 8, ["svg-title"])
|
|
103
|
+
], 40, L)
|
|
104
|
+
]),
|
|
105
|
+
key: "0"
|
|
106
|
+
} : void 0
|
|
107
|
+
]), 1032, ["value", "condensed", "aria-label", "placeholder"])
|
|
108
|
+
]));
|
|
109
|
+
}
|
|
110
|
+
}), H = /* @__PURE__ */ K($, [["__scopeId", "data-v-05badc7f"]]);
|
|
111
|
+
export {
|
|
112
|
+
H as B,
|
|
113
|
+
b as a,
|
|
114
|
+
N as b
|
|
115
|
+
};
|
|
116
|
+
//# sourceMappingURL=search-bar.DmXr-0Ax.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-bar.DmXr-0Ax.js","sources":["../../../vue2/src/components/search-bar/search-bar.types.ts","../../../vue2/src/components/search-bar/search-bar.vue"],"sourcesContent":["export enum BentoSearchBarInternalEvent {\n CLEAR = 'clear',\n ESCAPE = 'escape-pressed',\n INPUT = 'input',\n UPDATE = 'update:search-term',\n}\n\nexport enum BentoSearchBarEvent {\n CLEAR = 'search-clear',\n INPUT = 'search-input',\n UPDATE = 'update:search-term',\n}\n\nexport interface BentoSearchBarItem {\n label: string;\n items?: Array<BentoSearchBarItem>;\n}\n\nexport type BentoSearchBarData = Array<BentoSearchBarItem>;\n","<template>\n <div class=\"b-search-bar\">\n <bento-input-field\n ref=\"bentoInputField\"\n :value=\"searchTerm\"\n type=\"search\"\n :condensed=\"condensed\"\n :aria-label=\"inputFieldAriaLabel\"\n :aria-hidden=\"false\"\n :placeholder=\"placeholder\"\n @input=\"onInputEvent\"\n @focus=\"emit('focus')\"\n @blur=\"emit('blur')\"\n @escape-pressed=\"emit(BentoSearchBarInternalEvent.ESCAPE)\"\n >\n <template #iconBefore>\n <search-icon :svg-title=\"t('search')\" aria-hidden=\"true\" />\n </template>\n\n <template v-if=\"searchTerm\" #iconAfter>\n <div\n class=\"b-search-bar__clear-search\"\n tabindex=\"0\"\n data-testid=\"b-search-bar-clear-search-button\"\n @click=\"onClearSearch\"\n @keypress.enter=\"onClearSearch\"\n @keyup.space=\"onClearSearch\"\n >\n <cross-circle-fill-icon :svg-title=\"t('clearSearch')\" />\n </div>\n </template>\n </bento-input-field>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { ref, watch } from 'vue';\n import { debounce } from '@/utils/ts/debounce';\n import { BentoSearchBarInternalEvent } from './search-bar.types';\n import { useI18n } from '@/utils/ts/i18n';\n import BentoInputField from '@/components/input-field/input-field.vue';\n import SearchIcon from '@adyen/ui-assets-icons-16/vue/search';\n import CrossCircleFillIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = defineProps({\n /**\n * Text that labels an the search bar input element\n */\n inputFieldAriaLabel: { type: String, required: true },\n\n /**\n * Reduces height of the search bar\n */\n condensed: { type: Boolean, default: false },\n\n /**\n * Custom debounce time. Default: 300\n */\n debounceTime: { type: Number, default: 300 },\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder: { type: String, default: '' },\n\n /**\n * Text displayed as the value being searched\n */\n value: { type: String, default: undefined },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the input value changes by typing a search. Debounced by the `debounceTime` property\n */\n (e: 'input', inputValue: string): void;\n\n /**\n * Emitted when the \"clear search\" button is clicked\n */\n (e: 'clear'): void;\n\n /**\n * Emitted when the \"ESC\" key is pressed inside the Search Bar input\n */\n (e: 'escape-pressed'): void;\n\n /**\n * Emitted when the element has lost focus\n */\n (e: 'blur'): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: 'focus'): void;\n }>();\n\n const searchTerm = ref(props.value);\n const bentoInputField = ref<InstanceType<typeof BentoInputField> | null>();\n\n watch(\n () => props.value,\n () => {\n searchTerm.value = props.value;\n },\n { immediate: true }\n );\n\n const onClearSearch = () => {\n searchTerm.value = '';\n emit('clear');\n emit('input', '');\n };\n\n const debouncedEmit = debounce(() => {\n emit('input', searchTerm.value);\n }, props.debounceTime);\n\n const onInputEvent = (value: string) => {\n searchTerm.value = value;\n debouncedEmit();\n };\n\n const focus = () => {\n bentoInputField.value.focusInput();\n };\n\n // Expose method so that it can be used to focus on the input from outside the component\n defineExpose({\n /**\n * Focus on the input field when called.\n */\n focus,\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Search functionality to help users find the desired data quicker.\n * When a user starts typing, the data is dynamically filtered to\n * only show the relevant results.\n *\n * Clearing the search field displays the entire list again.\n *\n * @example\n * import {\n * BentoSearchBar,\n * BentoSearchBarData,\n * useSearchBarFilter\n * } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSearchBar },\n * template: `\n * <bento-search-bar\n * input-field-aria-label=\"Search bar\"\n * v-model=\"searchTerm\"\n * @input=\"onInput\"\n * @clear=\"onClearSearch\"\n * />\n * // Render the filtered data\n * {{ filteredData }}\n * `,\n * setup() {\n * const searchTerm = ref('');\n * const data = ref<BentoSearchBarData>([]);\n * const filteredData = useSearchBarFilter(searchTerm, data);\n *\n * consdt onInput = () => {}\n * consdt onClearSearch = () => {}\n *\n * return {\n * searchTerm,\n * filteredData,\n * onInput,\n * onClearSearch,\n * };\n * }\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./search-bar.scss\" />\n"],"names":["BentoSearchBarInternalEvent","BentoSearchBarInternalEvent2","BentoSearchBarEvent","BentoSearchBarEvent2","__default__","messages","t","useI18n","searchTerm","ref","props","bentoInputField","watch","onClearSearch","emit","debouncedEmit","debounce","onInputEvent","value","expose"],"mappings":";;;;;;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,SAAA,kBACAA,EAAA,QAAA,SACAA,EAAA,SAAA,sBAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,QAAA,gBACAA,EAAA,QAAA,gBACAA,EAAA,SAAA,sBAHQA,IAAAD,KAAA,CAAA,CAAA;;;;;;iECmLRE,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA7IA,EAAA,GAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAF,EAAA,CAAA,GAwDAG,IAAAC,EAAAC,EAAA,KAAA,GACAC,IAAAF,EAAA;AAEA,IAAAG;AAAA,MAAA,MAAAF,EAAA;AAAA,MACgB,MAAA;AAER,QAAAF,EAAA,QAAAE,EAAA;AAAA,MAAyB;AAAA,MAC7B,EAAA,WAAA,GAAA;AAAA,IACkB;AAGtB,UAAAG,IAAA,MAAA;AACI,MAAAL,EAAA,QAAA,IACAM,EAAA,OAAA,GACAA,EAAA,SAAA,EAAA;AAAA,IAAgB,GAGpBC,IAAAC,EAAA,MAAA;AACI,MAAAF,EAAA,SAAAN,EAAA,KAAA;AAAA,IAA8B,GAAAE,EAAA,YAAA,GAGlCO,IAAA,CAAAC,MAAA;AACI,MAAAV,EAAA,QAAAU,GACAH,EAAA;AAAA,IAAc;AAQlB,WAAAI,EAAA;AAAA;AAAA;AAAA;AAAA,MAAa,OALb,MAAA;AACI,QAAAR,EAAA,MAAA,WAAA;AAAA,MAAiC;AAAA,IAQjC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { defineComponent as p, inject as D, computed as m, openBlock as a, createElementBlock as n, normalizeClass as $, unref as t, createVNode as b, withCtx as h, createTextVNode as I, toDisplayString as V, createElementVNode as E, Fragment as w, renderList as B, ref as O, readonly as T, watch as L, provide as M, createBlock as _ } from "vue";
|
|
2
|
+
import { B as j } from "./dropdown.CoVT4i0B.js";
|
|
3
|
+
import { b as F } from "./index.DKQuLmwu.js";
|
|
4
|
+
import { u as q } from "./i18n.DY5YXG5f.js";
|
|
5
|
+
import { d as z } from "./es6.BvpG4Oi6.js";
|
|
6
|
+
import { B as N } from "./typography.D7onlQ9v.js";
|
|
7
|
+
import { _ as y } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
8
|
+
import "../assets/secondary-nav.css";
|
|
9
|
+
const x = Symbol("secondary nav state"), Q = {}, R = /* @__PURE__ */ p({
|
|
10
|
+
...Q,
|
|
11
|
+
__name: "secondary-nav-item",
|
|
12
|
+
props: {
|
|
13
|
+
label: null,
|
|
14
|
+
value: null
|
|
15
|
+
},
|
|
16
|
+
emits: ["click"],
|
|
17
|
+
setup(l, { emit: i }) {
|
|
18
|
+
const s = l, { activeItemValue: o, updateActiveItemValue: f } = D(x), d = m(() => ({
|
|
19
|
+
"b-secondary-nav-item--active": o.value === s.value
|
|
20
|
+
})), v = (r) => {
|
|
21
|
+
i("click", r), f(s.value);
|
|
22
|
+
};
|
|
23
|
+
return (r, g) => (a(), n("button", {
|
|
24
|
+
class: $(["b-secondary-nav-item", t(d)]),
|
|
25
|
+
onClick: v
|
|
26
|
+
}, [
|
|
27
|
+
b(t(N), {
|
|
28
|
+
class: "b-secondary-nav-item__title",
|
|
29
|
+
variant: "body",
|
|
30
|
+
stronger: ""
|
|
31
|
+
}, {
|
|
32
|
+
default: h(() => [
|
|
33
|
+
I(V(l.label), 1)
|
|
34
|
+
]),
|
|
35
|
+
_: 1
|
|
36
|
+
})
|
|
37
|
+
], 2));
|
|
38
|
+
}
|
|
39
|
+
}), C = /* @__PURE__ */ y(R, [["__scopeId", "data-v-aa44c602"]]), U = ["aria-label"], Y = { class: "b-secondary-nav__list" }, G = {}, H = /* @__PURE__ */ p({
|
|
40
|
+
...G,
|
|
41
|
+
__name: "secondary-nav-category",
|
|
42
|
+
props: {
|
|
43
|
+
label: null,
|
|
44
|
+
items: null
|
|
45
|
+
},
|
|
46
|
+
setup(l) {
|
|
47
|
+
return (i, s) => (a(), n("section", {
|
|
48
|
+
class: "b-secondary-nav-category",
|
|
49
|
+
"aria-label": l.label
|
|
50
|
+
}, [
|
|
51
|
+
b(t(N), {
|
|
52
|
+
el: "h1",
|
|
53
|
+
class: "b-secondary-nav-category__label",
|
|
54
|
+
variant: "caption",
|
|
55
|
+
stronger: ""
|
|
56
|
+
}, {
|
|
57
|
+
default: h(() => [
|
|
58
|
+
I(V(l.label), 1)
|
|
59
|
+
]),
|
|
60
|
+
_: 1
|
|
61
|
+
}),
|
|
62
|
+
E("ul", Y, [
|
|
63
|
+
(a(!0), n(w, null, B(l.items, (o) => (a(), n("li", {
|
|
64
|
+
key: o.value
|
|
65
|
+
}, [
|
|
66
|
+
b(t(C), {
|
|
67
|
+
label: o.label,
|
|
68
|
+
value: o.value
|
|
69
|
+
}, null, 8, ["label", "value"])
|
|
70
|
+
]))), 128))
|
|
71
|
+
])
|
|
72
|
+
], 8, U));
|
|
73
|
+
}
|
|
74
|
+
}), J = /* @__PURE__ */ y(H, [["__scopeId", "data-v-130510eb"]]), S = {
|
|
75
|
+
"en-US": {
|
|
76
|
+
mobileDropdownAriaLabel: "Navigation options dropdown"
|
|
77
|
+
}
|
|
78
|
+
}, K = { class: "b-secondary-nav" }, P = {
|
|
79
|
+
key: 1,
|
|
80
|
+
class: "b-secondary-nav__list"
|
|
81
|
+
}, W = {
|
|
82
|
+
i18n: { messages: S }
|
|
83
|
+
}, X = /* @__PURE__ */ p({
|
|
84
|
+
...W,
|
|
85
|
+
__name: "secondary-nav",
|
|
86
|
+
props: {
|
|
87
|
+
items: null,
|
|
88
|
+
value: null
|
|
89
|
+
},
|
|
90
|
+
emits: ["change"],
|
|
91
|
+
setup(l, { emit: i }) {
|
|
92
|
+
const s = l, { t: o } = q({ messages: S }), d = F({
|
|
93
|
+
s: z
|
|
94
|
+
}).smallerOrEqual("s"), v = m(() => s.items.some((e) => Object.hasOwn(e, "items"))), r = m(() => s.items), g = m(() => {
|
|
95
|
+
const e = r.value[0];
|
|
96
|
+
return "items" in e ? e.items[0].value : e.value;
|
|
97
|
+
}), u = O(s.value ?? g.value), k = (e) => {
|
|
98
|
+
u.value = e, i("change", e);
|
|
99
|
+
}, A = {
|
|
100
|
+
activeItemValue: T(u),
|
|
101
|
+
updateActiveItemValue: k
|
|
102
|
+
};
|
|
103
|
+
return L(
|
|
104
|
+
() => s.value,
|
|
105
|
+
(e) => {
|
|
106
|
+
u.value = e;
|
|
107
|
+
}
|
|
108
|
+
), M(x, A), (e, Z) => (a(), n("nav", K, [
|
|
109
|
+
t(d) ? (a(), _(t(j), {
|
|
110
|
+
key: 0,
|
|
111
|
+
"aria-label": t(o)("mobileDropdownAriaLabel"),
|
|
112
|
+
items: t(r),
|
|
113
|
+
"static-categories": t(v),
|
|
114
|
+
value: u.value,
|
|
115
|
+
onInput: k
|
|
116
|
+
}, null, 8, ["aria-label", "items", "static-categories", "value"])) : (a(), n("ul", P, [
|
|
117
|
+
(a(!0), n(w, null, B(l.items, (c) => (a(), n("li", {
|
|
118
|
+
key: c.label
|
|
119
|
+
}, [
|
|
120
|
+
"items" in c ? (a(), _(t(J), {
|
|
121
|
+
key: 0,
|
|
122
|
+
label: c.label,
|
|
123
|
+
items: c.items
|
|
124
|
+
}, null, 8, ["label", "items"])) : (a(), _(t(C), {
|
|
125
|
+
key: 1,
|
|
126
|
+
label: c.label,
|
|
127
|
+
value: c.value
|
|
128
|
+
}, null, 8, ["label", "value"]))
|
|
129
|
+
]))), 128))
|
|
130
|
+
]))
|
|
131
|
+
]));
|
|
132
|
+
}
|
|
133
|
+
}), ce = /* @__PURE__ */ y(X, [["__scopeId", "data-v-cd847f52"]]);
|
|
134
|
+
export {
|
|
135
|
+
ce as s
|
|
136
|
+
};
|
|
137
|
+
//# sourceMappingURL=secondary-nav.DnQPIiYO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secondary-nav.DnQPIiYO.js","sources":["../../../vue2/src/components/secondary-nav/secondary-nav.keys.ts","../../../vue2/src/components/secondary-nav/components/secondary-nav-item/secondary-nav-item.vue","../../../vue2/src/components/secondary-nav/components/secondary-nav-category/secondary-nav-category.vue","../../../vue2/src/components/secondary-nav/secondary-nav.vue"],"sourcesContent":["import { InjectionKey } from 'vue';\nimport { BentoSecondaryNavState } from './secondary-nav.types';\n\nexport const SECONDARY_NAV_STATE = Symbol('secondary nav state') as InjectionKey<BentoSecondaryNavState>;\n","<template>\n <button class=\"b-secondary-nav-item\" :class=\"conditionalClasses\" @click=\"onClick\">\n <bento-typography class=\"b-secondary-nav-item__title\" variant=\"body\" stronger>\n {{ label }}\n </bento-typography>\n </button>\n</template>\n\n<script lang=\"ts\" setup>\n import { SECONDARY_NAV_STATE } from '../../secondary-nav.keys';\n import { BentoTypography } from '@/components/typography';\n import { computed, inject } from 'vue';\n\n const { activeItemValue, updateActiveItemValue } = inject(SECONDARY_NAV_STATE);\n\n const props = defineProps<{\n /**\n * The display name of the navigation item\n */\n label: string;\n /**\n * The value of this item.\n */\n value: string;\n }>();\n\n const conditionalClasses = computed(() => ({\n 'b-secondary-nav-item--active': activeItemValue.value === props.value,\n }));\n\n const emit = defineEmits<{\n /**\n * Event emitted when this element is clicked\n */\n (e: 'click', clickEvent: MouseEvent): void;\n }>();\n\n const onClick = (e: MouseEvent) => {\n emit('click', e);\n updateActiveItemValue(props.value);\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * This component shouldn't be used directly. It is internally used by {@see BentoSecondaryNav}\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav-item.scss\" />\n","<template>\n <section class=\"b-secondary-nav-category\" :aria-label=\"label\">\n <bento-typography el=\"h1\" class=\"b-secondary-nav-category__label\" variant=\"caption\" stronger>{{\n label\n }}</bento-typography>\n <ul class=\"b-secondary-nav__list\">\n <li v-for=\"item in items\" :key=\"item.value\">\n <secondary-nav-item :label=\"item.label\" :value=\"item.value\" />\n </li>\n </ul>\n </section>\n</template>\n\n<script lang=\"ts\" setup>\n import { BentoTypography } from '@/components/typography';\n import { SecondaryNavItem } from '../secondary-nav-item';\n import { BentoSecondaryNavItemsItem } from '../../secondary-nav.types';\n\n defineProps<{\n /**\n * The display name of the category\n */\n label: string;\n /**\n * A list of {@see BentoSecondaryNavItemsItem} that belongs to this category\n */\n items: BentoSecondaryNavItemsItem[];\n }>();\n</script>\n\n<script lang=\"ts\">\n /**\n * This component shouldn't be used directly. It is internally used by {@see BentoSecondaryNav}\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav-category.scss\" />\n","<template>\n <nav class=\"b-secondary-nav\">\n <bento-dropdown\n v-if=\"isMobile\"\n :aria-label=\"t('mobileDropdownAriaLabel')\"\n :items=\"dropdownItems\"\n :static-categories=\"hasCategories\"\n :value=\"activeItemValue\"\n @input=\"updateActiveItemValue\"\n />\n <ul v-else class=\"b-secondary-nav__list\">\n <li v-for=\"item in items\" :key=\"item.label\">\n <secondary-nav-category v-if=\"'items' in item\" :label=\"item.label\" :items=\"item.items\" />\n <secondary-nav-item v-else :label=\"item.label\" :value=\"item.value\" />\n </li>\n </ul>\n </nav>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, provide, readonly, ref, watch } from 'vue';\n import { SecondaryNavItem } from './components/secondary-nav-item';\n import { SecondaryNavCategory } from './components/secondary-nav-category';\n import { SECONDARY_NAV_STATE } from './secondary-nav.keys';\n import { BentoSecondaryNavItems, BentoSecondaryNavState } from './secondary-nav.types';\n import { BentoDropdown } from '@/components/dropdown';\n import { useBreakpoints } from '@vueuse/core';\n import { useI18n } from '@/utils/ts/i18n';\n import { BentoListboxOptions } from '@/types';\n import { BMediaQuerySMax } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const breakpoints = useBreakpoints({\n s: BMediaQuerySMax,\n });\n\n const isMobile = breakpoints.smallerOrEqual('s');\n const props = defineProps<{\n /**\n * An array containing all the items on the nav. The array can have either {@see BentoSecondaryNavItemsCategory },\n * which is used to group different items or {@see BentoSecondaryNavItemsItem } if you don't need to group them.\n */\n items: BentoSecondaryNavItems;\n /**\n * The value of the selected item.\n * If nothing is passed, it defaults to the first item value in items.\n */\n value?: string;\n }>();\n\n const emit = defineEmits<{\n /**\n * Emmited when the current selected item changes\n */\n (e: 'change', category: string): void;\n }>();\n\n const hasCategories = computed(() => props.items.some(item => Object.hasOwn(item, 'items')));\n const dropdownItems = computed(() => props.items as BentoListboxOptions);\n\n const activeItemValueFallback = computed(() => {\n const firstDropdownItem = (dropdownItems.value as BentoSecondaryNavItems)[0];\n\n if ('items' in firstDropdownItem) {\n return firstDropdownItem.items[0].value;\n } else {\n return firstDropdownItem.value;\n }\n });\n const activeItemValue = ref(props.value ?? activeItemValueFallback.value);\n const updateActiveItemValue = (value: string) => {\n activeItemValue.value = value;\n emit('change', value);\n };\n\n // The component's state is inject on `secondary-nav-item` to determine the\n // current active item and to change its value\n const state: BentoSecondaryNavState = {\n activeItemValue: readonly(activeItemValue),\n updateActiveItemValue,\n };\n\n watch(\n () => props.value,\n value => {\n activeItemValue.value = value;\n }\n );\n\n provide(SECONDARY_NAV_STATE, state);\n</script>\n\n<script lang=\"ts\">\n /**\n * Secondary Nav offers users a structured way to access information.\n * It also provides a clear hierarchy for users to understand and navigate through various information.\n *\n * @example\n * import { BentoSecondaryNav } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSecondaryNav },\n * template: `\n * <bento-secondary-nav :value=\"value\" :items=\"items\" />\n * `,\n * setup() {\n * const value = ref(2) // Active item value\n * const items: BentoSecondaryNavItemInfo[] = [\n * { label: 'Option 1', value: 1 },\n * { label: 'Option 2', value: 2 },\n * ];\n * return { items, value };\n * }\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav.scss\" />\n"],"names":["SECONDARY_NAV_STATE","__default__$2","activeItemValue","updateActiveItemValue","inject","conditionalClasses","computed","props","onClick","e","emit","__default__$1","__default__","messages","t","useI18n","isMobile","useBreakpoints","BMediaQuerySMax","hasCategories","item","dropdownItems","activeItemValueFallback","firstDropdownItem","ref","value","state","readonly","watch","provide"],"mappings":";;;;;;;;AAGa,MAAAA,IAAA,OAAA,qBAAA,GC4CTC,IAAA,CAAA;;;;;;;;;iBAlCA,EAAA,iBAAAC,GAAA,uBAAAC,EAAA,IAAAC,EAAAJ,CAAA,GAaAK,IAAAC,EAAA,OAAA;AAAA,MAA2C,gCAAAJ,EAAA,UAAAK,EAAA;AAAA,IACyB,EAAA,GAUpEC,IAAA,CAAAC,MAAA;AACI,MAAAC,EAAA,SAAAD,CAAA,GACAN,EAAAI,EAAA,KAAA;AAAA,IAAiC;;;;;;;;;;;;;;;;;8HCLrCI,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GCsFAC,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;iBAvFA,EAAA,GAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAF,EAAA,CAAA,GAMAG,IAJAC,EAAA;AAAA,MAAmC,GAAAC;AAAA,IAC5B,CAAA,EAGP,eAAA,GAAA,GAqBAC,IAAAb,EAAA,MAAAC,EAAA,MAAA,KAAA,CAAAa,MAAA,OAAA,OAAAA,GAAA,OAAA,CAAA,CAAA,GACAC,IAAAf,EAAA,MAAAC,EAAA,KAAA,GAEAe,IAAAhB,EAAA,MAAA;AACI,YAAAiB,IAAAF,EAAA,MAAA,CAAA;AAEA,aAAA,WAAAE,IACIA,EAAA,MAAA,CAAA,EAAA,QAEAA,EAAA;AAAA,IACJ,CAAA,GAEJrB,IAAAsB,EAAAjB,EAAA,SAAAe,EAAA,KAAA,GACAnB,IAAA,CAAAsB,MAAA;AACI,MAAAvB,EAAA,QAAAuB,GACAf,EAAA,UAAAe,CAAA;AAAA,IAAoB,GAKxBC,IAAA;AAAA,MAAsC,iBAAAC,EAAAzB,CAAA;AAAA,MACO,uBAAAC;AAAA,IACzC;AAGJ,WAAAyB;AAAA,MAAA,MAAArB,EAAA;AAAA,MACgB,CAAAkB,MAAA;AAER,QAAAvB,EAAA,QAAAuB;AAAA,MAAwB;AAAA,IAC5B,GAGJI,EAAA7B,GAAA0B,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|