@adyen/bento-vue3 1.99.0 → 1.100.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 +19 -13
- package/dist/action-bar.js +1 -1
- package/dist/ai-tag.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/anchor-scroller.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/button.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/draggable-handle.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/file-uploader.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 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/navigation-menu-group.css +1 -1
- package/dist/assets/rich-text-editor.css +1 -1
- package/dist/assets/secondary-nav.css +1 -1
- package/dist/assets/selection-card-group.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/textarea.css +1 -1
- package/dist/button.js +3 -3
- package/dist/card.js +1 -1
- package/dist/chunks/{action-bar.Dd0rr7Sb.js → action-bar.C9A4LZXq.js} +4 -4
- package/dist/chunks/{action-bar.Dd0rr7Sb.js.map → action-bar.C9A4LZXq.js.map} +1 -1
- package/dist/chunks/{ai-button.1YJdI-sw.js → ai-button.B6_iVJrF.js} +2 -2
- package/dist/chunks/{ai-button.1YJdI-sw.js.map → ai-button.B6_iVJrF.js.map} +1 -1
- package/dist/chunks/{ai-tag.DOQ-UnnF.js → ai-tag.Brtsi-_Q.js} +2 -2
- package/dist/chunks/{ai-tag.DOQ-UnnF.js.map → ai-tag.Brtsi-_Q.js.map} +1 -1
- package/dist/chunks/{alert.V1imvtyI.js → alert.CQBxTuII.js} +2 -2
- package/dist/chunks/{alert.V1imvtyI.js.map → alert.CQBxTuII.js.map} +1 -1
- package/dist/chunks/{anchor-scroller.NRHfj2FY.js → anchor-scroller.ZMjZsvKe.js} +3 -3
- package/dist/chunks/{anchor-scroller.NRHfj2FY.js.map → anchor-scroller.ZMjZsvKe.js.map} +1 -1
- package/dist/chunks/{base-modal.BzbJbryi.js → base-modal.DtAGV7IJ.js} +5 -5
- package/dist/chunks/{base-modal.BzbJbryi.js.map → base-modal.DtAGV7IJ.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.DZdmQdah.js → button-actions-with-menu.CD1rzFcv.js} +2 -2
- package/dist/chunks/{button-actions-with-menu.DZdmQdah.js.map → button-actions-with-menu.CD1rzFcv.js.map} +1 -1
- package/dist/chunks/{button-actions.CgZbPzhi.js → button-actions.Cn0reO-q.js} +2 -2
- package/dist/chunks/{button-actions.CgZbPzhi.js.map → button-actions.Cn0reO-q.js.map} +1 -1
- package/dist/chunks/button.C6-bXf1h.js +130 -0
- package/dist/chunks/button.C6-bXf1h.js.map +1 -0
- package/dist/chunks/{calendar.B0XfOj2I.js → calendar.xS1f71Tj.js} +3 -3
- package/dist/chunks/{calendar.B0XfOj2I.js.map → calendar.xS1f71Tj.js.map} +1 -1
- package/dist/chunks/{card.BpPQzOoN.js → card.7rxK1PUi.js} +2 -2
- package/dist/chunks/{card.BpPQzOoN.js.map → card.7rxK1PUi.js.map} +1 -1
- package/dist/chunks/{code-snippet.DiBQjBoy.js → code-snippet.BNsYld-H.js} +5 -5
- package/dist/chunks/{code-snippet.DiBQjBoy.js.map → code-snippet.BNsYld-H.js.map} +1 -1
- package/dist/chunks/{copy.nnaqOH6I.js → copy.CFgvGhnT.js} +2 -2
- package/dist/chunks/{copy.nnaqOH6I.js.map → copy.CFgvGhnT.js.map} +1 -1
- package/dist/chunks/{dashboard-section.B82okI3e.js → dashboard-section._cJmCYmS.js} +3 -3
- package/dist/chunks/{dashboard-section.B82okI3e.js.map → dashboard-section._cJmCYmS.js.map} +1 -1
- package/dist/chunks/{dashed-underline.x_gU4d-A.js → dashed-underline.BX23F04p.js} +2 -2
- package/dist/chunks/{dashed-underline.x_gU4d-A.js.map → dashed-underline.BX23F04p.js.map} +1 -1
- package/dist/chunks/{data-grid-template.BdabDTqN.js → data-grid-template.D7XYAdGO.js} +4 -4
- package/dist/chunks/{data-grid-template.BdabDTqN.js.map → data-grid-template.D7XYAdGO.js.map} +1 -1
- package/dist/chunks/{data-grid.BNFwP2g7.js → data-grid.BRxL5jfA.js} +13 -13
- package/dist/chunks/{data-grid.BNFwP2g7.js.map → data-grid.BRxL5jfA.js.map} +1 -1
- package/dist/chunks/{date-picker.ClFHuglH.js → date-picker.HvI3aqn_.js} +6 -6
- package/dist/chunks/{date-picker.ClFHuglH.js.map → date-picker.HvI3aqn_.js.map} +1 -1
- package/dist/chunks/{date-range-picker.D3iAZN20.js → date-range-picker.CxJ-Dwy6.js} +8 -8
- package/dist/chunks/{date-range-picker.D3iAZN20.js.map → date-range-picker.CxJ-Dwy6.js.map} +1 -1
- package/dist/chunks/{dialog-page.BYMSk5DR.js → dialog-page.BFem0ZGE.js} +2 -2
- package/dist/chunks/{dialog-page.BYMSk5DR.js.map → dialog-page.BFem0ZGE.js.map} +1 -1
- package/dist/chunks/{draggable-handle.y_1hfypa.js → draggable-handle.BepmJZ8K.js} +270 -264
- package/dist/chunks/{draggable-handle.y_1hfypa.js.map → draggable-handle.BepmJZ8K.js.map} +1 -1
- package/dist/chunks/{draggable.5evQkGJ4.js → draggable.DWd19-Ke.js} +2 -2
- package/dist/chunks/{draggable.5evQkGJ4.js.map → draggable.DWd19-Ke.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.KO0gs2Lb.js → dropdown-tag.D5OzRb26.js} +2 -2
- package/dist/chunks/{dropdown-tag.KO0gs2Lb.js.map → dropdown-tag.D5OzRb26.js.map} +1 -1
- package/dist/chunks/{dropdown.DpqCHfi-.js → dropdown.DemBTBTo.js} +3 -3
- package/dist/chunks/{dropdown.DpqCHfi-.js.map → dropdown.DemBTBTo.js.map} +1 -1
- package/dist/chunks/{empty-state.DT4sFyjB.js → empty-state.C1SZznqL.js} +2 -2
- package/dist/chunks/{empty-state.DT4sFyjB.js.map → empty-state.C1SZznqL.js.map} +1 -1
- package/dist/chunks/{file-uploader.xzoJqcg1.js → file-uploader.1xbAOQVr.js} +3 -3
- package/dist/chunks/{file-uploader.xzoJqcg1.js.map → file-uploader.1xbAOQVr.js.map} +1 -1
- package/dist/chunks/{filter-bar.D3Lf7VJF.js → filter-bar.Du-a3Acn.js} +1812 -1733
- package/dist/chunks/filter-bar.Du-a3Acn.js.map +1 -0
- package/dist/chunks/{fixed-scroller.yVsaQzy5.js → fixed-scroller.C81gv4JS.js} +2 -2
- package/dist/chunks/{fixed-scroller.yVsaQzy5.js.map → fixed-scroller.C81gv4JS.js.map} +1 -1
- package/dist/chunks/{footer-actions.sEd1kzgV.js → footer-actions.Bxs91LNd.js} +3 -3
- package/dist/chunks/{footer-actions.sEd1kzgV.js.map → footer-actions.Bxs91LNd.js.map} +1 -1
- package/dist/chunks/{form-layout-title.CWw0poO8.js → form-layout-title.Cr27QPQx.js} +2 -2
- package/dist/chunks/{form-layout-title.CWw0poO8.js.map → form-layout-title.Cr27QPQx.js.map} +1 -1
- package/dist/chunks/{header-meta.DWWL88nm.js → header-meta.7O7dRg_a.js} +2 -2
- package/dist/chunks/{header-meta.DWWL88nm.js.map → header-meta.7O7dRg_a.js.map} +1 -1
- package/dist/chunks/{header-with-views.B-5VCTDp.js → header-with-views.DjS8uGm4.js} +8 -8
- package/dist/chunks/{header-with-views.B-5VCTDp.js.map → header-with-views.DjS8uGm4.js.map} +1 -1
- package/dist/chunks/{header.B6pGQk7G.js → header.BW-OkVwK.js} +3 -3
- package/dist/chunks/{header.B6pGQk7G.js.map → header.BW-OkVwK.js.map} +1 -1
- package/dist/chunks/{input-field-password.BCme16nn.js → input-field-password.KlvNwYqo.js} +4 -4
- package/dist/chunks/{input-field-password.BCme16nn.js.map → input-field-password.KlvNwYqo.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.BwVbTNcu.js → input-field-phone-number.byO-cUDL.js} +2 -2
- package/dist/chunks/{input-field-phone-number.BwVbTNcu.js.map → input-field-phone-number.byO-cUDL.js.map} +1 -1
- package/dist/chunks/{input-field.Cox9LW4Z.js → input-field.B-0d_T4g.js} +39 -29
- package/dist/chunks/{input-field.Cox9LW4Z.js.map → input-field.B-0d_T4g.js.map} +1 -1
- package/dist/chunks/{input-time.bHFZRv6T.js → input-time.nPazqbCJ.js} +3 -3
- package/dist/chunks/{input-time.bHFZRv6T.js.map → input-time.nPazqbCJ.js.map} +1 -1
- package/dist/chunks/{inspector.CTBNfXvo.js → inspector.04j4uhcL.js} +2 -2
- package/dist/chunks/{inspector.CTBNfXvo.js.map → inspector.04j4uhcL.js.map} +1 -1
- package/dist/chunks/{list-item.CqUFIXPC.js → list-item.Bh7YMPOT.js} +2 -2
- package/dist/chunks/{list-item.CqUFIXPC.js.map → list-item.Bh7YMPOT.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.T5PF8pWA.js → modal-fullscreen.Dsb7-HDn.js} +5 -5
- package/dist/chunks/{modal-fullscreen.T5PF8pWA.js.map → modal-fullscreen.Dsb7-HDn.js.map} +1 -1
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.BOOZl25a.js → modal.vue_vue_type_script_setup_true_lang.CwpOjtKq.js} +5 -5
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.BOOZl25a.js.map → modal.vue_vue_type_script_setup_true_lang.CwpOjtKq.js.map} +1 -1
- package/dist/chunks/{navigation-menu-group.CIV5BQJA.js → navigation-menu-group.ikwhk1TY.js} +2 -2
- package/dist/chunks/{navigation-menu-group.CIV5BQJA.js.map → navigation-menu-group.ikwhk1TY.js.map} +1 -1
- package/dist/chunks/{pagination.CMt-m_-T.js → pagination.DEjCJwaX.js} +3 -3
- package/dist/chunks/{pagination.CMt-m_-T.js.map → pagination.DEjCJwaX.js.map} +1 -1
- package/dist/chunks/{promo-banner.DICpj6e6.js → promo-banner.BonAKy1p.js} +2 -2
- package/dist/chunks/{promo-banner.DICpj6e6.js.map → promo-banner.BonAKy1p.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.D94Vaa4k.js → rich-text-editor.IxYsg6CI.js} +2 -2
- package/dist/chunks/{rich-text-editor.D94Vaa4k.js.map → rich-text-editor.IxYsg6CI.js.map} +1 -1
- package/dist/chunks/{search-bar.DSi5ti-s.js → search-bar.C-U8clpQ.js} +3 -3
- package/dist/chunks/{search-bar.DSi5ti-s.js.map → search-bar.C-U8clpQ.js.map} +1 -1
- package/dist/chunks/{secondary-nav.D5w22NJe.js → secondary-nav.Dk2uIEjb.js} +3 -3
- package/dist/chunks/{secondary-nav.D5w22NJe.js.map → secondary-nav.Dk2uIEjb.js.map} +1 -1
- package/dist/chunks/{sidepanel.DWgn0NNb.js → sidepanel.Comuu3ed.js} +5 -5
- package/dist/chunks/{sidepanel.DWgn0NNb.js.map → sidepanel.Comuu3ed.js.map} +1 -1
- package/dist/chunks/{structured-list-item.RunfI9Pj.js → structured-list-item.BqptGVDy.js} +3 -3
- package/dist/chunks/{structured-list-item.RunfI9Pj.js.map → structured-list-item.BqptGVDy.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.DiJtaVN-.js → summary-grid.types.CS7JxDEe.js} +3 -3
- package/dist/chunks/{summary-grid.types.DiJtaVN-.js.map → summary-grid.types.CS7JxDEe.js.map} +1 -1
- package/dist/chunks/{tab.CnvwN1lS.js → tab.BUeDKzsC.js} +2 -2
- package/dist/chunks/{tab.CnvwN1lS.js.map → tab.BUeDKzsC.js.map} +1 -1
- package/dist/chunks/{textarea.Cb6Fu5-u.js → textarea.CIVT8C_Z.js} +2 -2
- package/dist/chunks/{textarea.Cb6Fu5-u.js.map → textarea.CIVT8C_Z.js.map} +1 -1
- package/dist/chunks/{timeline-item.XpxLQwxK.js → timeline-item.Bva1ccQQ.js} +6 -6
- package/dist/chunks/{timeline-item.XpxLQwxK.js.map → timeline-item.Bva1ccQQ.js.map} +1 -1
- package/dist/chunks/{toast.De4MTkiH.js → toast.BQa5mK5U.js} +2 -2
- package/dist/chunks/{toast.De4MTkiH.js.map → toast.BQa5mK5U.js.map} +1 -1
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.DjvXPcvu.js → tutorial.vue_vue_type_script_setup_true_lang.X5GUFYKD.js} +2 -2
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.DjvXPcvu.js.map → tutorial.vue_vue_type_script_setup_true_lang.X5GUFYKD.js.map} +1 -1
- package/dist/chunks/{use-date-input-formatter.ovThcj9h.js → use-date-input-formatter.DvYZRRZi.js} +2 -2
- package/dist/chunks/{use-date-input-formatter.ovThcj9h.js.map → use-date-input-formatter.DvYZRRZi.js.map} +1 -1
- 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 +2 -2
- package/dist/date-range-picker.js +2 -2
- package/dist/date-time-picker.js +4 -4
- package/dist/draggable.js +2 -2
- package/dist/dropdown.js +2 -2
- package/dist/empty-state.js +1 -1
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/form-layout.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +49 -49
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/input-time.js +1 -1
- package/dist/inspector.js +1 -1
- package/dist/internal.js +8 -8
- package/dist/list.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/navigation-menu.js +1 -1
- package/dist/pagination.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/promo-banner.js +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +1 -1
- package/dist/tabs.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +3 -3
- package/dist/chunks/button.DWF7FSIw.js +0 -128
- package/dist/chunks/button.DWF7FSIw.js.map +0 -1
- package/dist/chunks/filter-bar.D3Lf7VJF.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as E, provide as T, toRef as A, useAttrs as P, ref as p, watch as F, openBlock as N, createElementBlock as y, createVNode as n, mergeProps as B, unref as t, createSlots as g, withCtx as h, createElementVNode as U, withKeys as m } from "vue";
|
|
2
|
-
import { g as L } from "./dropdown.
|
|
2
|
+
import { g as L } from "./dropdown.DemBTBTo.js";
|
|
3
3
|
import { u as R } from "./index.B875RXHM.js";
|
|
4
|
-
import { I as k, B as D } from "./input-field.
|
|
4
|
+
import { I as k, B as D } from "./input-field.B-0d_T4g.js";
|
|
5
5
|
import { S as K } from "./search.ClLmZAgC.js";
|
|
6
6
|
import { C as w } from "./cross-circle-fill.BWCKKn0E.js";
|
|
7
7
|
import { _ as V } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
@@ -110,4 +110,4 @@ export {
|
|
|
110
110
|
$ as a,
|
|
111
111
|
f as b
|
|
112
112
|
};
|
|
113
|
-
//# sourceMappingURL=search-bar.
|
|
113
|
+
//# sourceMappingURL=search-bar.C-U8clpQ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-bar.
|
|
1
|
+
{"version":3,"file":"search-bar.C-U8clpQ.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\nexport interface BentoSearchBarProps {\n /**\n * Text that labels an the search bar input element\n */\n inputFieldAriaLabel: string;\n\n /**\n * Reduces height of the search bar. Default: false\n */\n condensed?: boolean;\n\n /**\n * Custom debounce time. Default: 300\n */\n debounceTime?: number;\n\n /**\n * Disables the text input.\n */\n disabled?: boolean;\n\n /**\n * Text displayed as a hint when the field is not empty\n */\n hint?: string;\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder?: string;\n\n /**\n * Text displayed as the value being searched\n */\n value?: string;\n}\n","<template>\n <div class=\"b-search-bar\">\n <bento-input-field\n ref=\"bentoInputField\"\n v-bind=\"attrs\"\n :model-value=\"searchTerm\"\n type=\"search\"\n :condensed=\"condensed\"\n :aria-label=\"inputFieldAriaLabel\"\n :aria-hidden=\"false\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n @update:model-value=\"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 { provide, ref, toRef, useAttrs, watch } from 'vue';\n import { debounce } from '@/utils/ts/debounce';\n import { BentoSearchBarInternalEvent, type BentoSearchBarProps } from './search-bar.types';\n import { useI18n } from '@/utils/ts/i18n';\n import { INPUT_FIELD_HINT_INJECTION_KEY } from '@/components/input-field/input-field.keys';\n // eslint-disable-next-line @typescript-eslint/consistent-type-imports\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 = withDefaults(defineProps<BentoSearchBarProps>(), {\n condensed: false,\n debounceTime: 300,\n disabled: false,\n hint: '',\n placeholder: '',\n value: 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 provide(INPUT_FIELD_HINT_INJECTION_KEY, toRef(props, 'hint'));\n\n const attrs = useAttrs();\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 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","props","__props","emit","__emit","provide","INPUT_FIELD_HINT_INJECTION_KEY","toRef","attrs","useAttrs","searchTerm","ref","bentoInputField","watch","onClearSearch","debouncedEmit","debounce","onInputEvent","value","__expose"],"mappings":";;;;;;;;AAAO,IAAAA,IAAA,kBAAAC,OACHA,EAAA,QAAA,SACAA,EAAA,SAAA,kBACAA,EAAA,QAAA,SACAA,EAAA,SAAA,sBAJQA,IAAAD,KAAA,CAAA,CAAA,GAOLE,IAAA,kBAAAC,OACHA,EAAA,QAAA,gBACAA,EAAA,QAAA,gBACAA,EAAA,SAAA,sBAHQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;kCCyKRE,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;AA/HA,UAAA,EAAA,GAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAF,EAAA,CAAA,GAEAG,IAAAC,GASAC,IAAAC;AA2BA,IAAAC,EAAAC,GAAAC,EAAAN,GAAA,MAAA,CAAA;AAEA,UAAAO,IAAAC,EAAA,GACAC,IAAAC,EAAAV,EAAA,KAAA,GACAW,IAAAD,EAAA;AAEA,IAAAE;AAAA,MAAA,MAAAZ,EAAA;AAAA,MACgB,MAAA;AAER,QAAAS,EAAA,QAAAT,EAAA;AAAA,MAAyB;AAAA,MAC7B,EAAA,WAAA,GAAA;AAAA,IACkB;AAGtB,UAAAa,IAAA,MAAA;AACI,MAAAJ,EAAA,QAAA,IACAP,EAAA,OAAA,GACAA,EAAA,SAAA,EAAA;AAAA,IAAgB,GAGpBY,IAAAC,EAAA,MAAA;AACI,MAAAb,EAAA,SAAAO,EAAA,KAAA;AAAA,IAA8B,GAAAT,EAAA,YAAA,GAGlCgB,IAAA,CAAAC,MAAA;AACI,MAAAR,EAAA,QAAAQ,GACAH,EAAA;AAAA,IAAc;AASlB,WAAAI,EAAA;AAAA;AAAA;AAAA;AAAA,MAAa,OANb,MAAA;AAEI,QAAAP,EAAA,MAAA,WAAA;AAAA,MAAiC;AAAA,IAQjC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineComponent as R, inject as W, ref as F, computed as b, watch as H, resolveComponent as Z, openBlock as t, createElementBlock as c, createElementVNode as _, unref as o, normalizeClass as G, createVNode as p, withCtx as i, createTextVNode as x, toDisplayString as y, createBlock as C, createCommentVNode as M, withModifiers as ee, Transition as re, normalizeStyle as ae, Fragment as O, renderList as z, toRef as oe, readonly as te, provide as ne } from "vue";
|
|
2
|
-
import { B as se } from "./dropdown.
|
|
2
|
+
import { B as se } from "./dropdown.DemBTBTo.js";
|
|
3
3
|
import { B as $ } from "./typography.B3J6_tYk.js";
|
|
4
4
|
import { B as J } from "./tag.BDBpa51Z.js";
|
|
5
5
|
import { C as P } from "./cross-circle-fill.BWCKKn0E.js";
|
|
6
6
|
import { b as le } from "./index.DtuWfdhd.js";
|
|
7
7
|
import { u as X } from "./index.B875RXHM.js";
|
|
8
8
|
import { a as ie } from "./es6.Cu3DYUPA.js";
|
|
9
|
-
import { B as ue } from "./button.
|
|
9
|
+
import { B as ue } from "./button.C6-bXf1h.js";
|
|
10
10
|
import { C as ce } from "./chevron-down.XeE-LBV_.js";
|
|
11
11
|
import { C as de } from "./chevron-up.Cmgl2a3x.js";
|
|
12
12
|
import { g as ve } from "./generate-uid.DBWe4g6T.js";
|
|
@@ -312,4 +312,4 @@ const q = /* @__PURE__ */ Symbol("secondary nav state"), Q = {
|
|
|
312
312
|
export {
|
|
313
313
|
Je as s
|
|
314
314
|
};
|
|
315
|
-
//# sourceMappingURL=secondary-nav.
|
|
315
|
+
//# sourceMappingURL=secondary-nav.Dk2uIEjb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secondary-nav.D5w22NJe.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 { type InjectionKey } from 'vue';\nimport { type BentoSecondaryNavState } from './secondary-nav.types';\n\nexport const SECONDARY_NAV_STATE = Symbol('secondary nav state') as InjectionKey<BentoSecondaryNavState>;\n","<template>\n <div class=\"b-secondary-nav-item\">\n <div class=\"b-secondary-nav-item__wrapper\">\n <button\n class=\"b-secondary-nav-item__option\"\n :class=\"conditionalClasses\"\n :aria-current=\"isItemSelected ? 'page' : undefined\"\n :aria-expanded=\"expandleItemIsToggleOnly ? `${isOpen}` : undefined\"\n :aria-controls=\"expandleItemIsToggleOnly ? subItemsId : undefined\"\n @click=\"expandleItemIsToggleOnly ? onToggleClick() : onClick($event)\"\n >\n <bento-typography class=\"b-secondary-nav-item__title\" variant=\"body\" stronger>\n {{ label }}\n </bento-typography>\n <bento-tag v-if=\"errorCounter\" class=\"b-secondary-nav-item__error-counter\" variant=\"red\">\n <template #icon>\n <cross-circle-fill-icon aria-hidden=\"true\" />\n </template>\n <span>{{ errorCounter }}</span>\n <span class=\"b-secondary-nav-item__visually-hidden\">{{ tc('errorCount', errorCounter) }}</span>\n </bento-tag>\n </button>\n <bento-button\n v-if=\"hasSubItems\"\n :aria-hidden=\"expandleItemIsToggleOnly\"\n :tabindex=\"expandleItemIsToggleOnly ? -1 : undefined\"\n class=\"b-secondary-nav-item__toggle\"\n variant=\"tertiary\"\n :aria-label=\"isOpen ? `Collapse ${label}` : `Expand ${label}`\"\n :aria-expanded=\"!expandleItemIsToggleOnly ? `${isOpen}` : undefined\"\n :aria-controls=\"!expandleItemIsToggleOnly ? subItemsId : undefined\"\n @click.stop=\"onToggleClick\"\n >\n <template #iconLeft>\n <chevron-up-icon v-if=\"isOpen\" class=\"b-secondary-nav-item__icon\" aria-hidden=\"true\" />\n <chevron-down-icon v-else class=\"b-secondary-nav-item__icon\" aria-hidden=\"true\" />\n </template>\n </bento-button>\n </div>\n <Transition :name=\"CONTENT_TRANSITION_NAME\">\n <div v-if=\"hasSubItems && isOpen\" :id=\"subItemsId\" :style=\"subItemsMaxHeight\">\n <ul ref=\"subItemsRef\" class=\"b-secondary-nav-item__sub-items\">\n <li v-for=\"item in items\" :key=\"item.value\">\n <secondary-nav-item\n :label=\"item.label\"\n :value=\"item.value\"\n :items=\"item.items\"\n :error-counter=\"item.errorCounter\"\n is-sub-item\n />\n </li>\n </ul>\n </div>\n </Transition>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n import { SECONDARY_NAV_STATE } from '../../secondary-nav.keys';\n import { BentoButton } from '@/components/button';\n import { BentoTag } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n import ChevronDownIcon from '@adyen/ui-assets-icons-16/vue/chevron-down';\n import ChevronUpIcon from '@adyen/ui-assets-icons-16/vue/chevron-up';\n import CrossCircleFillIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill';\n import { computed, inject, ref, watch } from 'vue';\n import { useI18n } from '@/utils/ts/i18n';\n import { generateUid } from '@/core/utils/ts';\n import { type BentoSecondaryNavItemsItem } from '../../secondary-nav.types';\n import { useExpandableContentHeight } from '@/composables/use-expandable-content-height/use-expandable-content-height';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { tc } = useI18n<{ message: MessageSchema }>({ messages });\n const { activeItemValue, updateActiveItemValue, allowExpandableItemNavigation } = inject(SECONDARY_NAV_STATE);\n const CONTENT_TRANSITION_NAME = 'b-secondary-nav-item__animation--content';\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 * Nested sub-items for this item.\n */\n items?: Array<BentoSecondaryNavItemsItem>;\n\n /**\n * Defines if the item is a subitem\n */\n isSubItem?: boolean;\n\n /**\n * Defines the number of errors pertaining to this item\n */\n errorCounter?: number;\n }>();\n\n const isOpen = ref(false);\n const subItemsId = generateUid('secondary-nav-sub-items');\n const subItemsRef = ref<HTMLUListElement>(null);\n const hasSubItems = computed(() => !!props.items?.length);\n const isItemSelected = computed(() => activeItemValue.value === props.value);\n const expandleItemIsToggleOnly = computed(() => hasSubItems.value && !allowExpandableItemNavigation.value);\n const { contentHeight } = useExpandableContentHeight(subItemsRef, isOpen);\n const subItemsMaxHeight = computed(() => (contentHeight.value ? { 'max-height': contentHeight.value } : {}));\n\n const conditionalClasses = computed(() => ({\n 'b-secondary-nav-item__option--active': isItemSelected.value,\n 'b-secondary-nav-item__option--expandable': hasSubItems.value,\n 'b-secondary-nav-item__option--sub-item': props.isSubItem,\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\n const onToggleClick = () => {\n isOpen.value = !isOpen.value;\n };\n\n const hasActiveDescendant = (items: Array<BentoSecondaryNavItemsItem>, value: string): boolean => {\n return items.some(\n item => item.value === value || (item.items ? hasActiveDescendant(item.items, value) : false)\n );\n };\n\n const hasDescendantErrors = (items: Array<BentoSecondaryNavItemsItem>): boolean =>\n items.some(item => !!item.errorCounter || (item.items ? hasDescendantErrors(item.items) : false));\n\n watch(\n [activeItemValue, () => props.items],\n ([activeValue]) => {\n if (hasSubItems.value && props.items) {\n if (hasActiveDescendant(props.items, activeValue) || hasDescendantErrors(props.items)) {\n isOpen.value = true;\n }\n }\n },\n { immediate: true, deep: true }\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 { i18n: { messages } };\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\n :label=\"item.label\"\n :value=\"item.value\"\n :items=\"item.items\"\n :error-counter=\"item.errorCounter\"\n />\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 { type 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: Array<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=\"mobileDropdownItems\"\n :static-categories=\"hasCategories\"\n :model-value=\"activeItemValue\"\n :is-option-disabled=\"isMobileOptionDisabled\"\n @update:model-value=\"updateActiveItemValue\"\n >\n <template #display-value=\"{ label }\">\n <bento-typography el=\"span\">\n {{ label }}\n </bento-typography>\n </template>\n <template #default=\"{ label, data }\">\n <bento-typography\n el=\"div\"\n :class=\"{ 'b-secondary-nav__option': true, 'b-secondary-nav__nested-option': !!data?.level }\"\n >\n {{ label }}\n <bento-tag v-if=\"data?.errorCounter\" class=\"b-secondary-nav__error-counter\" variant=\"red\">\n <template #icon>\n <cross-circle-fill-icon aria-hidden=\"true\" />\n </template>\n <span>{{ data.errorCounter }}</span>\n <span class=\"b-secondary-nav__visually-hidden\">{{ tc('errorCount', data.errorCounter) }}</span>\n </bento-tag>\n </bento-typography>\n </template>\n </bento-dropdown>\n <ul v-else class=\"b-secondary-nav__list\">\n <li v-for=\"item in items\" :key=\"item.label\">\n <secondary-nav-category\n v-if=\"'items' in item && !('value' in item)\"\n :label=\"item.label\"\n :items=\"item.items\"\n />\n <secondary-nav-item\n v-else\n :label=\"item.label\"\n :value=\"item.value\"\n :items=\"item.items\"\n :error-counter=\"item.errorCounter\"\n />\n </li>\n </ul>\n </nav>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, provide, readonly, ref, toRef, 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 {\n type BentoSecondaryNavItems,\n type BentoSecondaryNavItemsCategory,\n type BentoSecondaryNavItemsItem,\n type BentoSecondaryNavState,\n } from './secondary-nav.types';\n import { BentoDropdown } from '@/components/dropdown';\n import { BentoTypography } from '@/components/typography';\n import { BentoTag } from '@/components/tag';\n import CrossCircleFillIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill';\n import { useBreakpoints } from '@vueuse/core';\n import { useI18n } from '@/utils/ts/i18n';\n import { type BentoListboxOptionItem, type BentoListboxOptions } from '@/types/listbox';\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, tc } = 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 * When true, items that contain subitems are also clickable and can be selected.\n * When false, those items only act as expand/collapse toggles.\n */\n allowExpandableItemNavigation?: boolean;\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 isCategory = (item: BentoSecondaryNavItems[number]): item is BentoSecondaryNavItemsCategory =>\n 'items' in item && !('value' in item);\n\n const mapNestedItems = (items: Array<BentoSecondaryNavItemsItem>, level = 0): BentoListboxOptions =>\n items.flatMap((item): BentoListboxOptions => {\n const currentItem: BentoListboxOptionItem = {\n label: item.label,\n value: item.value,\n data: { level, hasSubItems: !!item.items?.length, errorCounter: item.errorCounter },\n };\n\n if (item.items?.length) {\n return [currentItem, ...mapNestedItems(item.items, level + 1)];\n }\n\n return [currentItem];\n });\n\n const isMobileOptionDisabled = (option: BentoListboxOptionItem): boolean =>\n !props.allowExpandableItemNavigation && (option.data as { hasSubItems?: boolean })?.hasSubItems;\n\n const hasCategories = computed(() => props.items.some(item => isCategory(item)));\n const mobileDropdownItems = computed<BentoListboxOptions>(() => {\n return props.items.flatMap(item => {\n if (isCategory(item)) {\n return [\n {\n label: item.label,\n value: `category-${item.label}`,\n items: mapNestedItems(item.items),\n } satisfies BentoListboxOptionItem,\n ];\n }\n\n if (item.items?.length) {\n return mapNestedItems([item]);\n }\n\n return [\n {\n label: item.label,\n value: item.value,\n data: { level: 0, errorCounter: item.errorCounter },\n } satisfies BentoListboxOptionItem,\n ];\n });\n });\n\n const flattenNestedItems = (items: Array<BentoSecondaryNavItemsItem>): Array<BentoSecondaryNavItemsItem> =>\n items.flatMap(item => [item, ...(item.items?.length ? flattenNestedItems(item.items) : [])]);\n\n const findFirstSelectableNestedItemValue = (items: Array<BentoSecondaryNavItemsItem>): string =>\n flattenNestedItems(items).find(item => props.allowExpandableItemNavigation || !item.items?.length)?.value ?? '';\n\n const activeItemValueFallback = computed(() => {\n if (!props.items.length) {\n return '';\n }\n\n return findFirstSelectableNestedItemValue(\n props.items.flatMap(item =>\n isCategory(item) ? flattenNestedItems(item.items) : flattenNestedItems([item])\n )\n );\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 allowExpandableItemNavigation: toRef(props, 'allowExpandableItemNavigation'),\n };\n\n watch(\n () => props.value,\n value => {\n if (value !== undefined) {\n activeItemValue.value = value;\n }\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","messages$1","tc","useI18n","activeItemValue","updateActiveItemValue","allowExpandableItemNavigation","inject","CONTENT_TRANSITION_NAME","props","__props","isOpen","ref","subItemsId","generateUid","subItemsRef","hasSubItems","computed","isItemSelected","expandleItemIsToggleOnly","contentHeight","useExpandableContentHeight","subItemsMaxHeight","conditionalClasses","emit","__emit","onClick","e","onToggleClick","hasActiveDescendant","items","value","item","hasDescendantErrors","watch","activeValue","__default__$1","__default__","messages","t","isMobile","useBreakpoints","BMediaQuerySMax","isCategory","mapNestedItems","level","currentItem","isMobileOptionDisabled","option","hasCategories","mobileDropdownItems","flattenNestedItems","findFirstSelectableNestedItemValue","activeItemValueFallback","state","readonly","toRef","provide"],"mappings":";;;;;;;;;;;;;;;AAGO,MAAAA,IAAA,uBAAA,qBAAA;;;;;;;;;;;2NC6JHC,KAAA,EAAA,MAAA,EAAA,UAAAC,EAAA,EAAA;;;;;;;;;;;;AAtFA,UAAA,EAAA,IAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAF,EAAA,CAAA,GACA,EAAA,iBAAAG,GAAA,uBAAAC,GAAA,+BAAAC,EAAA,IAAAC,EAAAR,CAAA,GACAS,IAAA,4CAEAC,IAAAC,GAyBAC,IAAAC,EAAA,EAAA,GACAC,IAAAC,GAAA,yBAAA,GACAC,IAAAH,EAAA,IAAA,GACAI,IAAAC,EAAA,MAAA,CAAA,CAAAR,EAAA,OAAA,MAAA,GACAS,IAAAD,EAAA,MAAAb,EAAA,UAAAK,EAAA,KAAA,GACAU,IAAAF,EAAA,MAAAD,EAAA,SAAA,CAAAV,EAAA,KAAA,GACA,EAA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ArB,MAAAA,EAAA,QAAA,CAAAE,MAAA,CAAAA,GAAA,GAAAA,EAAA,OAAA,SAAAmB,EAAAnB,EAAA,KAAA,IAAA,CAAA,CAAA,CAAA,GAGAoB,IAAA,CAAAtB,MAAAqB,EAAArB,CAAA,EAAA,KAAA,CAAAE,MAAAvB,EAAA,iCAAA,CAAAuB,EAAA,OAAA,MAAA,GAAA,SAAA,IAGAqB,IAAApC,EAAA,MACIR,EAAA,MAAA,SAIA2C;AAAA,MAAO3C,EAAA,MAAA;AAAA,QACS,CAAAuB,MAAAW,EAAAX,CAAA,IAAAmB,EAAAnB,EAAA,KAAA,IAAAmB,EAAA,CAAAnB,CAAA,CAAA;AAAA,MACqE;AAAA,IACjF,IANA,EAOJ,GAGJ5B,IAAAQ,EAAAH,EAAA,SAAA4C,EAAA,KAAA,GACAhD,IAAA,CAAA0B,MAAA;AACI,MAAA3B,EAAA,QAAA2B,GACAP,EAAA,UAAAO,CAAA;AAAA,IAAoB,GAKxBuB,IAAA;AAAA,MAAsC,iBAAAC,GAAAnD,CAAA;AAAA,MACO,uBAAAC;AAAA,MACzC,+BAAAmD,GAAA/C,GAAA,+BAAA;AAAA,IAC2E;AAG/E,WAAAyB;AAAA,MAAA,MAAAzB,EAAA;AAAA,MACgB,CAAAsB,MAAA;AAER,QAAAA,MAAA,WACI3B,EAAA,QAAA2B;AAAA,MACJ;AAAA,IACJ,GAGJ0B,GAAA1D,GAAAuD,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"secondary-nav.Dk2uIEjb.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 { type InjectionKey } from 'vue';\nimport { type BentoSecondaryNavState } from './secondary-nav.types';\n\nexport const SECONDARY_NAV_STATE = Symbol('secondary nav state') as InjectionKey<BentoSecondaryNavState>;\n","<template>\n <div class=\"b-secondary-nav-item\">\n <div class=\"b-secondary-nav-item__wrapper\">\n <button\n class=\"b-secondary-nav-item__option\"\n :class=\"conditionalClasses\"\n :aria-current=\"isItemSelected ? 'page' : undefined\"\n :aria-expanded=\"expandleItemIsToggleOnly ? `${isOpen}` : undefined\"\n :aria-controls=\"expandleItemIsToggleOnly ? subItemsId : undefined\"\n @click=\"expandleItemIsToggleOnly ? onToggleClick() : onClick($event)\"\n >\n <bento-typography class=\"b-secondary-nav-item__title\" variant=\"body\" stronger>\n {{ label }}\n </bento-typography>\n <bento-tag v-if=\"errorCounter\" class=\"b-secondary-nav-item__error-counter\" variant=\"red\">\n <template #icon>\n <cross-circle-fill-icon aria-hidden=\"true\" />\n </template>\n <span>{{ errorCounter }}</span>\n <span class=\"b-secondary-nav-item__visually-hidden\">{{ tc('errorCount', errorCounter) }}</span>\n </bento-tag>\n </button>\n <bento-button\n v-if=\"hasSubItems\"\n :aria-hidden=\"expandleItemIsToggleOnly\"\n :tabindex=\"expandleItemIsToggleOnly ? -1 : undefined\"\n class=\"b-secondary-nav-item__toggle\"\n variant=\"tertiary\"\n :aria-label=\"isOpen ? `Collapse ${label}` : `Expand ${label}`\"\n :aria-expanded=\"!expandleItemIsToggleOnly ? `${isOpen}` : undefined\"\n :aria-controls=\"!expandleItemIsToggleOnly ? subItemsId : undefined\"\n @click.stop=\"onToggleClick\"\n >\n <template #iconLeft>\n <chevron-up-icon v-if=\"isOpen\" class=\"b-secondary-nav-item__icon\" aria-hidden=\"true\" />\n <chevron-down-icon v-else class=\"b-secondary-nav-item__icon\" aria-hidden=\"true\" />\n </template>\n </bento-button>\n </div>\n <Transition :name=\"CONTENT_TRANSITION_NAME\">\n <div v-if=\"hasSubItems && isOpen\" :id=\"subItemsId\" :style=\"subItemsMaxHeight\">\n <ul ref=\"subItemsRef\" class=\"b-secondary-nav-item__sub-items\">\n <li v-for=\"item in items\" :key=\"item.value\">\n <secondary-nav-item\n :label=\"item.label\"\n :value=\"item.value\"\n :items=\"item.items\"\n :error-counter=\"item.errorCounter\"\n is-sub-item\n />\n </li>\n </ul>\n </div>\n </Transition>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n import { SECONDARY_NAV_STATE } from '../../secondary-nav.keys';\n import { BentoButton } from '@/components/button';\n import { BentoTag } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n import ChevronDownIcon from '@adyen/ui-assets-icons-16/vue/chevron-down';\n import ChevronUpIcon from '@adyen/ui-assets-icons-16/vue/chevron-up';\n import CrossCircleFillIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill';\n import { computed, inject, ref, watch } from 'vue';\n import { useI18n } from '@/utils/ts/i18n';\n import { generateUid } from '@/core/utils/ts';\n import { type BentoSecondaryNavItemsItem } from '../../secondary-nav.types';\n import { useExpandableContentHeight } from '@/composables/use-expandable-content-height/use-expandable-content-height';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { tc } = useI18n<{ message: MessageSchema }>({ messages });\n const { activeItemValue, updateActiveItemValue, allowExpandableItemNavigation } = inject(SECONDARY_NAV_STATE);\n const CONTENT_TRANSITION_NAME = 'b-secondary-nav-item__animation--content';\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 * Nested sub-items for this item.\n */\n items?: Array<BentoSecondaryNavItemsItem>;\n\n /**\n * Defines if the item is a subitem\n */\n isSubItem?: boolean;\n\n /**\n * Defines the number of errors pertaining to this item\n */\n errorCounter?: number;\n }>();\n\n const isOpen = ref(false);\n const subItemsId = generateUid('secondary-nav-sub-items');\n const subItemsRef = ref<HTMLUListElement>(null);\n const hasSubItems = computed(() => !!props.items?.length);\n const isItemSelected = computed(() => activeItemValue.value === props.value);\n const expandleItemIsToggleOnly = computed(() => hasSubItems.value && !allowExpandableItemNavigation.value);\n const { contentHeight } = useExpandableContentHeight(subItemsRef, isOpen);\n const subItemsMaxHeight = computed(() => (contentHeight.value ? { 'max-height': contentHeight.value } : {}));\n\n const conditionalClasses = computed(() => ({\n 'b-secondary-nav-item__option--active': isItemSelected.value,\n 'b-secondary-nav-item__option--expandable': hasSubItems.value,\n 'b-secondary-nav-item__option--sub-item': props.isSubItem,\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\n const onToggleClick = () => {\n isOpen.value = !isOpen.value;\n };\n\n const hasActiveDescendant = (items: Array<BentoSecondaryNavItemsItem>, value: string): boolean => {\n return items.some(\n item => item.value === value || (item.items ? hasActiveDescendant(item.items, value) : false)\n );\n };\n\n const hasDescendantErrors = (items: Array<BentoSecondaryNavItemsItem>): boolean =>\n items.some(item => !!item.errorCounter || (item.items ? hasDescendantErrors(item.items) : false));\n\n watch(\n [activeItemValue, () => props.items],\n ([activeValue]) => {\n if (hasSubItems.value && props.items) {\n if (hasActiveDescendant(props.items, activeValue) || hasDescendantErrors(props.items)) {\n isOpen.value = true;\n }\n }\n },\n { immediate: true, deep: true }\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 { i18n: { messages } };\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\n :label=\"item.label\"\n :value=\"item.value\"\n :items=\"item.items\"\n :error-counter=\"item.errorCounter\"\n />\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 { type 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: Array<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=\"mobileDropdownItems\"\n :static-categories=\"hasCategories\"\n :model-value=\"activeItemValue\"\n :is-option-disabled=\"isMobileOptionDisabled\"\n @update:model-value=\"updateActiveItemValue\"\n >\n <template #display-value=\"{ label }\">\n <bento-typography el=\"span\">\n {{ label }}\n </bento-typography>\n </template>\n <template #default=\"{ label, data }\">\n <bento-typography\n el=\"div\"\n :class=\"{ 'b-secondary-nav__option': true, 'b-secondary-nav__nested-option': !!data?.level }\"\n >\n {{ label }}\n <bento-tag v-if=\"data?.errorCounter\" class=\"b-secondary-nav__error-counter\" variant=\"red\">\n <template #icon>\n <cross-circle-fill-icon aria-hidden=\"true\" />\n </template>\n <span>{{ data.errorCounter }}</span>\n <span class=\"b-secondary-nav__visually-hidden\">{{ tc('errorCount', data.errorCounter) }}</span>\n </bento-tag>\n </bento-typography>\n </template>\n </bento-dropdown>\n <ul v-else class=\"b-secondary-nav__list\">\n <li v-for=\"item in items\" :key=\"item.label\">\n <secondary-nav-category\n v-if=\"'items' in item && !('value' in item)\"\n :label=\"item.label\"\n :items=\"item.items\"\n />\n <secondary-nav-item\n v-else\n :label=\"item.label\"\n :value=\"item.value\"\n :items=\"item.items\"\n :error-counter=\"item.errorCounter\"\n />\n </li>\n </ul>\n </nav>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, provide, readonly, ref, toRef, 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 {\n type BentoSecondaryNavItems,\n type BentoSecondaryNavItemsCategory,\n type BentoSecondaryNavItemsItem,\n type BentoSecondaryNavState,\n } from './secondary-nav.types';\n import { BentoDropdown } from '@/components/dropdown';\n import { BentoTypography } from '@/components/typography';\n import { BentoTag } from '@/components/tag';\n import CrossCircleFillIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill';\n import { useBreakpoints } from '@vueuse/core';\n import { useI18n } from '@/utils/ts/i18n';\n import { type BentoListboxOptionItem, type BentoListboxOptions } from '@/types/listbox';\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, tc } = 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 * When true, items that contain subitems are also clickable and can be selected.\n * When false, those items only act as expand/collapse toggles.\n */\n allowExpandableItemNavigation?: boolean;\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 isCategory = (item: BentoSecondaryNavItems[number]): item is BentoSecondaryNavItemsCategory =>\n 'items' in item && !('value' in item);\n\n const mapNestedItems = (items: Array<BentoSecondaryNavItemsItem>, level = 0): BentoListboxOptions =>\n items.flatMap((item): BentoListboxOptions => {\n const currentItem: BentoListboxOptionItem = {\n label: item.label,\n value: item.value,\n data: { level, hasSubItems: !!item.items?.length, errorCounter: item.errorCounter },\n };\n\n if (item.items?.length) {\n return [currentItem, ...mapNestedItems(item.items, level + 1)];\n }\n\n return [currentItem];\n });\n\n const isMobileOptionDisabled = (option: BentoListboxOptionItem): boolean =>\n !props.allowExpandableItemNavigation && (option.data as { hasSubItems?: boolean })?.hasSubItems;\n\n const hasCategories = computed(() => props.items.some(item => isCategory(item)));\n const mobileDropdownItems = computed<BentoListboxOptions>(() => {\n return props.items.flatMap(item => {\n if (isCategory(item)) {\n return [\n {\n label: item.label,\n value: `category-${item.label}`,\n items: mapNestedItems(item.items),\n } satisfies BentoListboxOptionItem,\n ];\n }\n\n if (item.items?.length) {\n return mapNestedItems([item]);\n }\n\n return [\n {\n label: item.label,\n value: item.value,\n data: { level: 0, errorCounter: item.errorCounter },\n } satisfies BentoListboxOptionItem,\n ];\n });\n });\n\n const flattenNestedItems = (items: Array<BentoSecondaryNavItemsItem>): Array<BentoSecondaryNavItemsItem> =>\n items.flatMap(item => [item, ...(item.items?.length ? flattenNestedItems(item.items) : [])]);\n\n const findFirstSelectableNestedItemValue = (items: Array<BentoSecondaryNavItemsItem>): string =>\n flattenNestedItems(items).find(item => props.allowExpandableItemNavigation || !item.items?.length)?.value ?? '';\n\n const activeItemValueFallback = computed(() => {\n if (!props.items.length) {\n return '';\n }\n\n return findFirstSelectableNestedItemValue(\n props.items.flatMap(item =>\n isCategory(item) ? flattenNestedItems(item.items) : flattenNestedItems([item])\n )\n );\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 allowExpandableItemNavigation: toRef(props, 'allowExpandableItemNavigation'),\n };\n\n watch(\n () => props.value,\n value => {\n if (value !== undefined) {\n activeItemValue.value = value;\n }\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","messages$1","tc","useI18n","activeItemValue","updateActiveItemValue","allowExpandableItemNavigation","inject","CONTENT_TRANSITION_NAME","props","__props","isOpen","ref","subItemsId","generateUid","subItemsRef","hasSubItems","computed","isItemSelected","expandleItemIsToggleOnly","contentHeight","useExpandableContentHeight","subItemsMaxHeight","conditionalClasses","emit","__emit","onClick","e","onToggleClick","hasActiveDescendant","items","value","item","hasDescendantErrors","watch","activeValue","__default__$1","__default__","messages","t","isMobile","useBreakpoints","BMediaQuerySMax","isCategory","mapNestedItems","level","currentItem","isMobileOptionDisabled","option","hasCategories","mobileDropdownItems","flattenNestedItems","findFirstSelectableNestedItemValue","activeItemValueFallback","state","readonly","toRef","provide"],"mappings":";;;;;;;;;;;;;;;AAGO,MAAAA,IAAA,uBAAA,qBAAA;;;;;;;;;;;2NC6JHC,KAAA,EAAA,MAAA,EAAA,UAAAC,EAAA,EAAA;;;;;;;;;;;;AAtFA,UAAA,EAAA,IAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAF,EAAA,CAAA,GACA,EAAA,iBAAAG,GAAA,uBAAAC,GAAA,+BAAAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineComponent as y, openBlock as f, createBlock as S, unref as s, createSlots as V, withCtx as n, createElementVNode as h, createVNode as c, renderSlot as T, createTextVNode as x, toDisplayString as J, toRefs as Y, ref as o, computed as P, onMounted as z, onUnmounted as j, watch as H, provide as C, createElementBlock as b, withKeys as X, withModifiers as q, normalizeClass as Q, withDirectives as W, createCommentVNode as Z } from "vue";
|
|
2
2
|
import { B as D, d as ee } from "./typography.B3J6_tYk.js";
|
|
3
|
-
import { F as te } from "./footer-actions.
|
|
4
|
-
import { b as se, B as ae, D as ie, a as oe } from "./dialog-page.
|
|
3
|
+
import { F as te } from "./footer-actions.Bxs91LNd.js";
|
|
4
|
+
import { b as se, B as ae, D as ie, a as oe } from "./dialog-page.BFem0ZGE.js";
|
|
5
5
|
import { _ as N } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
6
|
-
import { B as ne } from "./button.
|
|
6
|
+
import { B as ne } from "./button.C6-bXf1h.js";
|
|
7
7
|
import { B as le } from "./focus-trap.3-5C2gYa.js";
|
|
8
8
|
import { C as re } from "./cross.CCHdi6v3.js";
|
|
9
|
-
import { S as ce } from "./button-actions.
|
|
9
|
+
import { S as ce } from "./button-actions.Cn0reO-q.js";
|
|
10
10
|
import { B as ue } from "./directive.D1-d-C2K.js";
|
|
11
11
|
import { u as de } from "./index.B875RXHM.js";
|
|
12
12
|
import { g as pe } from "./generate-uid.DBWe4g6T.js";
|
|
@@ -255,4 +255,4 @@ export {
|
|
|
255
255
|
Ue as a,
|
|
256
256
|
Le as s
|
|
257
257
|
};
|
|
258
|
-
//# sourceMappingURL=sidepanel.
|
|
258
|
+
//# sourceMappingURL=sidepanel.Comuu3ed.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidepanel.DWgn0NNb.js","sources":["../../../vue2/src/components/sidepanel/components/sidepanel-page.vue","../../../vue2/src/components/sidepanel/sidepanel.types.ts","../../../vue2/src/components/sidepanel/sidepanel.vue"],"sourcesContent":["<template>\n <dialog-page class=\"b-sidepanel-page\" :page-id=\"pageId\" :previous-page=\"previousPage\">\n <template #header>\n <div class=\"b-sidepanel-page__header\">\n <bento-typography class=\"b-sidepanel-page__title\" el=\"h2\" variant=\"title\">\n {{ title }}\n </bento-typography>\n </div>\n </template>\n <template #content>\n <div class=\"b-sidepanel-page__content\">\n <bento-typography el=\"div\" variant=\"body\">\n <slot />\n </bento-typography>\n </div>\n </template>\n <template v-if=\"actions && actions.length > 0\" #footer>\n <div class=\"b-sidepanel-page__actions\">\n <footer-actions\n :actions=\"actions\"\n :actions-label=\"actionsLabel\"\n :destructive-actions=\"destructiveActions\"\n />\n </div>\n </template>\n </dialog-page>\n</template>\n\n<script setup lang=\"ts\">\n import { type PropType } from 'vue';\n\n import { type BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { FooterActions } from '@/components/internal/footer-actions';\n import { DialogPage } from '@/internal';\n\n defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * Text label that is displayed left to the action buttons\n */\n actionsLabel: {\n type: String,\n default: null,\n },\n\n /**\n * If passed - sets first button color to red\n */\n destructiveActions: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Identifier of the page, used with activePage prop to handle sidepanel navigation\n */\n pageId: {\n type: String,\n default: undefined,\n },\n\n /**\n * ID of the page for the back button to navigate to. Only use it to overwrite the default back behavior\n * Used when the back button should not take the user to the natural previous page\n * Set to `null` to hide back button in the page\n */\n previousPage: {\n type: String,\n default: undefined,\n },\n\n /**\n * Title of the sidepanel page\n */\n title: {\n type: String,\n default: null,\n },\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * SidepanelPage is used to render different pages of Sidepanel component\n *\n * @example\n * import { BentoSidepanel, BentoSidepanelPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSidepanel, BentoSidepanelPage },\n * template: `\n * <bento-sidepanel active-page='step1' is-open='true'>\n * <bento-sidepanel-page\n * title='Step 1'\n * pageId='step1'\n * :actions=\"[\n * {\n * title: 'Next step',\n * event: () => {\n * activePage.value = 'step2';\n * },\n * }]\">\n * Step 1 info\n * </bento-sidepanel-page>\n * <bento-sidepanel-page\n * title='Step 2'\n * pageId='step2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Step 2 info\n * </bento-sidepanel-page>\n * </bento-sidepanel>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./sidepanel-page.scss\" />\n","export enum BentoSidepanelEvent {\n UPDATE_ACTIVE_PAGE = 'update:active-page',\n UPDATE_IS_OPEN = 'update:is-open',\n}\n","<template>\n <dialog\n ref=\"sidepanel\"\n class=\"b-sidepanel\"\n :class=\"conditionalClasses\"\n @animationend=\"closeSidepanelAfterAnimation\"\n @keydown.esc.prevent=\"isDismissible && startCloseSidepanelAnimation\"\n >\n <bento-focus-trap :id=\"sidepanelId\" v-bento-click-outside-directive=\"closeSidepanelOnClickOutside\">\n <div v-if=\"!computedHideCloseButton\" class=\"b-sidepanel__close-button\">\n <bento-button variant=\"tertiary\" @click=\"startCloseSidepanelAnimation\">\n <cross-icon :svg-title=\"t('close')\" />\n </bento-button>\n </div>\n <slot />\n </bento-focus-trap>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, onUnmounted, provide, ref, toRefs, watch } from 'vue';\n\n import { BentoButton } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { BentoSidepanelEvent } from './sidepanel.types';\n import {\n BentoDialogPageAnimation,\n type BentoDialogPageConfigData,\n type BentoDialogPageRegisterPage,\n DIALOG_PAGE_CONFIG_INJECTION_KEY,\n DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY,\n } from '@/internal';\n\n import { SIDEPANEL_DIALOG_ID_INJECTION_KEY } from './sidepanel.keys';\n\n import { BentoClickOutsideDirective as vBentoClickOutsideDirective } from '@/directives/click-outside';\n\n import { useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n import { generateUid } from '@/core/utils/ts';\n import { deprecate } from '@/utils/ts/deprecate';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n /**\n * The id of the current active page\n * Should be the same id as the BentoSidepanelPage to be displayed\n * If the component only has one page, it can be left null/undefined.\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * If set to true, it allows the sidepanel to be closed.\n * Shows close button when `true` and hides close button when `false`.\n *\n * _Note: This property will not set the visibility of the close button in v2.0.0_\n */\n isDismissible: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Controls the sidepanel's state from the outside. Set it to true to open the sidepanel.\n */\n isOpen: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Controls the visibility of close button on the sidepanel.\n * Defaults to `true` when `isDismissible=false`, and `true` when `isDimissible=true`.\n *\n * _Note: This property will be set to `false` by default, independent of `isDismissible` in v2.0.0_\n */\n hideCloseButton: {\n type: Boolean,\n default: null,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emits update event when page is changed internally\n */\n (e: BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, page: string): void;\n /**\n * Emits close-sidepanel event when the sidepanel is closed\n */\n (e: BentoSidepanelEvent.UPDATE_IS_OPEN, isOpen: boolean): void;\n }>();\n\n // Refs\n const { activePage, isOpen } = toRefs(props);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const sidepanel = ref(null);\n const pages = ref<Array<string>>([]);\n const previousPages = ref([]);\n const animation = ref(BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER);\n const isClosing = ref(false);\n const sidepanelId = generateUid('sidepanel');\n const internalIsOpen = ref(false);\n const isAnimationActive = ref(false);\n const isMounted = ref(false);\n\n // Animation styling\n const conditionalClasses = computed(() => ({\n 'b-sidepanel--hide': isClosing.value,\n 'b-sidepanel--animation': isAnimationActive.value,\n }));\n\n // Handle closing and closing animation for dialog element\n const closeSidepanelAfterAnimation = () => {\n if (isClosing.value && sidepanel.value) {\n sidepanel.value.close();\n if (previousPages.value[0]) {\n emit(BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, previousPages.value[0]);\n }\n previousPages.value = [];\n isClosing.value = false;\n internalIsOpen.value = false;\n emit(BentoSidepanelEvent.UPDATE_IS_OPEN, false);\n }\n };\n\n const startCloseSidepanelAnimation = () => {\n if (!sidepanel.value || !sidepanel.value.open) {\n return;\n }\n isClosing.value = true;\n };\n\n const closeSidepanelOnClickOutside = () => {\n if (props.isDismissible) {\n startCloseSidepanelAnimation();\n }\n };\n\n // TODO: Remove in upcoming major. See properties `hideCloseButton` and `isDismissible`.\n const computedHideCloseButton = computed(() => {\n if (props.hideCloseButton !== null) {\n return props.hideCloseButton;\n }\n\n return !props.isDismissible;\n });\n\n onMounted(() => {\n isMounted.value = true;\n });\n\n onUnmounted(() => {\n isMounted.value = false;\n });\n\n // Watching isOpen prop to toggle open/close the dialog element\n watch(\n [() => isOpen.value, sidepanel],\n ([newIsOpen, newSidepanelValue]) => {\n if (!isMounted.value || !newSidepanelValue) {\n return;\n }\n\n if (newIsOpen) {\n internalIsOpen.value = true;\n if (!newSidepanelValue.open) {\n newSidepanelValue.showModal();\n }\n if (!previousPages.value.length) {\n previousPages.value.push(activePage.value);\n }\n } else if (newSidepanelValue.open) {\n startCloseSidepanelAnimation();\n }\n },\n { immediate: true, flush: 'post' }\n );\n\n // Pages\n const updatePage = page => emit(BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, page);\n\n // unregister page if removed / destroyed\n const unregisterPage = (pageIdToRemove: string) => () => {\n pages.value = pages.value?.filter(pageId => pageId !== pageIdToRemove);\n };\n\n // Provide data and function to register page to subcomponent\n const registerPage: BentoDialogPageRegisterPage = pageId => {\n pages.value.push(pageId);\n\n return { unregisterPage: unregisterPage(pageId) };\n };\n\n provide<BentoDialogPageConfigData>(DIALOG_PAGE_CONFIG_INJECTION_KEY, {\n activePage,\n animation,\n isAnimationActive,\n isOpen: internalIsOpen,\n pages,\n previousPages,\n updatePage,\n });\n provide(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY, registerPage);\n\n // Let's Children components know they are inside a SidePanel (dialog element)\n provide(SIDEPANEL_DIALOG_ID_INJECTION_KEY, sidepanelId);\n\n if (!props.isDismissible && props.hideCloseButton === null) {\n deprecate(\n 'BentoSidepanel \"isDismissible\" property’s behavior',\n 'BentoSidepanel \"isDismissible\" will no longer hide the close button. Use \"hideCloseButton=true\" instead.',\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Sidepanel component is a slide-in panel that should be used for presenting actions, settings or features that are directly associated with a specific task or interaction on the main screen.\n *\n * @example\n * import { BentoSidepanel, BentoSidepanelPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSidepanel, BentoSidepanelPage },\n * template: `\n * <bento-sidepanel active-page='step1' is-open='true'>\n * <bento-sidepanel-page\n * title='Step 1'\n * pageId='step1'\n * :actions=\"[\n * {\n * title: 'Next step',\n * event: () => {\n * activePage.value = 'step2';\n * },\n * }]\">\n * Step 1 info\n * </bento-sidepanel-page>\n * <bento-sidepanel-page\n * title='Step 2'\n * pageId='step2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Step 2 info\n * </bento-sidepanel-page>\n * </bento-sidepanel>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n<style lang=\"scss\" scoped src=\"./sidepanel.scss\" />\n"],"names":["__default__$1","BentoSidepanelEvent","BentoSidepanelEvent2","__default__","messages","props","__props","emit","__emit","activePage","isOpen","toRefs","t","useI18n","sidepanel","ref","pages","previousPages","animation","BentoDialogPageAnimation","isClosing","sidepanelId","generateUid","internalIsOpen","isAnimationActive","isMounted","conditionalClasses","computed","closeSidepanelAfterAnimation","startCloseSidepanelAnimation","closeSidepanelOnClickOutside","computedHideCloseButton","onMounted","onUnmounted","watch","newIsOpen","newSidepanelValue","updatePage","page","unregisterPage","pageIdToRemove","pageId","registerPage","provide","DIALOG_PAGE_CONFIG_INJECTION_KEY","DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY","SIDEPANEL_DIALOG_ID_INJECTION_KEY","deprecate"],"mappings":";;;;;;;;;;;;;4IA2IIA,KAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3IG,IAAAC,IAAA,kBAAAC,OACHA,EAAA,qBAAA,sBACAA,EAAA,iBAAA,kBAFQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;GCqQRE,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAxNA,UAAAC,IAAAC,GA0CAC,IAAAC,GAYA,EAAA,YAAAC,GAAA,QAAAC,EAAA,IAAAC,EAAAN,CAAA,GACA,EAAA,GAAAO,EAAA,IAAAC,GAAA,EAAA,UAAAT,EAAA,CAAA,GACAU,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,CAAA,CAAA,GACAE,IAAAF,EAAA,CAAA,CAAA,GACAG,IAAAH,EAAAI,GAAA,uBAAA,GACAC,IAAAL,EAAA,EAAA,GACAM,IAAAC,GAAA,WAAA,GACAC,IAAAR,EAAA,EAAA,GACAS,IAAAT,EAAA,EAAA,GACAU,IAAAV,EAAA,EAAA,GAGAW,IAAAC,EAAA,OAA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AAA;AAAA,IAAqE,GAIzEE,IAAA,CAAAD,OACIzB,EAAA,MAAA,KAAAyB,CAAA,GAEA,EAAA,gBAAAF,EAAAE,CAAA,EAAA;AAGJ,WAAAE,EAAAC,IAAA;AAAA,MAAqE,YAAAnC;AAAA,MACjE,WAAAS;AAAA,MACA,mBAAAM;AAAA,MACA,QAAAD;AAAA,MACQ,OAAAP;AAAA,MACR,eAAAC;AAAA,MACA,YAAAoB;AAAA,IACA,CAAA,GAEJM,EAAAE,IAAAH,CAAA,GAGAC,EAAAG,IAAAzB,CAAA,GAEA,CAAAhB,EAAA,iBAAAA,EAAA,oBAAA,QACI0C;AAAA,MAAA;AAAA,MACI;AAAA,MACA;AAAA,IACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"sidepanel.Comuu3ed.js","sources":["../../../vue2/src/components/sidepanel/components/sidepanel-page.vue","../../../vue2/src/components/sidepanel/sidepanel.types.ts","../../../vue2/src/components/sidepanel/sidepanel.vue"],"sourcesContent":["<template>\n <dialog-page class=\"b-sidepanel-page\" :page-id=\"pageId\" :previous-page=\"previousPage\">\n <template #header>\n <div class=\"b-sidepanel-page__header\">\n <bento-typography class=\"b-sidepanel-page__title\" el=\"h2\" variant=\"title\">\n {{ title }}\n </bento-typography>\n </div>\n </template>\n <template #content>\n <div class=\"b-sidepanel-page__content\">\n <bento-typography el=\"div\" variant=\"body\">\n <slot />\n </bento-typography>\n </div>\n </template>\n <template v-if=\"actions && actions.length > 0\" #footer>\n <div class=\"b-sidepanel-page__actions\">\n <footer-actions\n :actions=\"actions\"\n :actions-label=\"actionsLabel\"\n :destructive-actions=\"destructiveActions\"\n />\n </div>\n </template>\n </dialog-page>\n</template>\n\n<script setup lang=\"ts\">\n import { type PropType } from 'vue';\n\n import { type BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { FooterActions } from '@/components/internal/footer-actions';\n import { DialogPage } from '@/internal';\n\n defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * Text label that is displayed left to the action buttons\n */\n actionsLabel: {\n type: String,\n default: null,\n },\n\n /**\n * If passed - sets first button color to red\n */\n destructiveActions: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Identifier of the page, used with activePage prop to handle sidepanel navigation\n */\n pageId: {\n type: String,\n default: undefined,\n },\n\n /**\n * ID of the page for the back button to navigate to. Only use it to overwrite the default back behavior\n * Used when the back button should not take the user to the natural previous page\n * Set to `null` to hide back button in the page\n */\n previousPage: {\n type: String,\n default: undefined,\n },\n\n /**\n * Title of the sidepanel page\n */\n title: {\n type: String,\n default: null,\n },\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * SidepanelPage is used to render different pages of Sidepanel component\n *\n * @example\n * import { BentoSidepanel, BentoSidepanelPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSidepanel, BentoSidepanelPage },\n * template: `\n * <bento-sidepanel active-page='step1' is-open='true'>\n * <bento-sidepanel-page\n * title='Step 1'\n * pageId='step1'\n * :actions=\"[\n * {\n * title: 'Next step',\n * event: () => {\n * activePage.value = 'step2';\n * },\n * }]\">\n * Step 1 info\n * </bento-sidepanel-page>\n * <bento-sidepanel-page\n * title='Step 2'\n * pageId='step2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Step 2 info\n * </bento-sidepanel-page>\n * </bento-sidepanel>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./sidepanel-page.scss\" />\n","export enum BentoSidepanelEvent {\n UPDATE_ACTIVE_PAGE = 'update:active-page',\n UPDATE_IS_OPEN = 'update:is-open',\n}\n","<template>\n <dialog\n ref=\"sidepanel\"\n class=\"b-sidepanel\"\n :class=\"conditionalClasses\"\n @animationend=\"closeSidepanelAfterAnimation\"\n @keydown.esc.prevent=\"isDismissible && startCloseSidepanelAnimation\"\n >\n <bento-focus-trap :id=\"sidepanelId\" v-bento-click-outside-directive=\"closeSidepanelOnClickOutside\">\n <div v-if=\"!computedHideCloseButton\" class=\"b-sidepanel__close-button\">\n <bento-button variant=\"tertiary\" @click=\"startCloseSidepanelAnimation\">\n <cross-icon :svg-title=\"t('close')\" />\n </bento-button>\n </div>\n <slot />\n </bento-focus-trap>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, onUnmounted, provide, ref, toRefs, watch } from 'vue';\n\n import { BentoButton } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { BentoSidepanelEvent } from './sidepanel.types';\n import {\n BentoDialogPageAnimation,\n type BentoDialogPageConfigData,\n type BentoDialogPageRegisterPage,\n DIALOG_PAGE_CONFIG_INJECTION_KEY,\n DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY,\n } from '@/internal';\n\n import { SIDEPANEL_DIALOG_ID_INJECTION_KEY } from './sidepanel.keys';\n\n import { BentoClickOutsideDirective as vBentoClickOutsideDirective } from '@/directives/click-outside';\n\n import { useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n import { generateUid } from '@/core/utils/ts';\n import { deprecate } from '@/utils/ts/deprecate';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n /**\n * The id of the current active page\n * Should be the same id as the BentoSidepanelPage to be displayed\n * If the component only has one page, it can be left null/undefined.\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * If set to true, it allows the sidepanel to be closed.\n * Shows close button when `true` and hides close button when `false`.\n *\n * _Note: This property will not set the visibility of the close button in v2.0.0_\n */\n isDismissible: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Controls the sidepanel's state from the outside. Set it to true to open the sidepanel.\n */\n isOpen: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Controls the visibility of close button on the sidepanel.\n * Defaults to `true` when `isDismissible=false`, and `true` when `isDimissible=true`.\n *\n * _Note: This property will be set to `false` by default, independent of `isDismissible` in v2.0.0_\n */\n hideCloseButton: {\n type: Boolean,\n default: null,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emits update event when page is changed internally\n */\n (e: BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, page: string): void;\n /**\n * Emits close-sidepanel event when the sidepanel is closed\n */\n (e: BentoSidepanelEvent.UPDATE_IS_OPEN, isOpen: boolean): void;\n }>();\n\n // Refs\n const { activePage, isOpen } = toRefs(props);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const sidepanel = ref(null);\n const pages = ref<Array<string>>([]);\n const previousPages = ref([]);\n const animation = ref(BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER);\n const isClosing = ref(false);\n const sidepanelId = generateUid('sidepanel');\n const internalIsOpen = ref(false);\n const isAnimationActive = ref(false);\n const isMounted = ref(false);\n\n // Animation styling\n const conditionalClasses = computed(() => ({\n 'b-sidepanel--hide': isClosing.value,\n 'b-sidepanel--animation': isAnimationActive.value,\n }));\n\n // Handle closing and closing animation for dialog element\n const closeSidepanelAfterAnimation = () => {\n if (isClosing.value && sidepanel.value) {\n sidepanel.value.close();\n if (previousPages.value[0]) {\n emit(BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, previousPages.value[0]);\n }\n previousPages.value = [];\n isClosing.value = false;\n internalIsOpen.value = false;\n emit(BentoSidepanelEvent.UPDATE_IS_OPEN, false);\n }\n };\n\n const startCloseSidepanelAnimation = () => {\n if (!sidepanel.value || !sidepanel.value.open) {\n return;\n }\n isClosing.value = true;\n };\n\n const closeSidepanelOnClickOutside = () => {\n if (props.isDismissible) {\n startCloseSidepanelAnimation();\n }\n };\n\n // TODO: Remove in upcoming major. See properties `hideCloseButton` and `isDismissible`.\n const computedHideCloseButton = computed(() => {\n if (props.hideCloseButton !== null) {\n return props.hideCloseButton;\n }\n\n return !props.isDismissible;\n });\n\n onMounted(() => {\n isMounted.value = true;\n });\n\n onUnmounted(() => {\n isMounted.value = false;\n });\n\n // Watching isOpen prop to toggle open/close the dialog element\n watch(\n [() => isOpen.value, sidepanel],\n ([newIsOpen, newSidepanelValue]) => {\n if (!isMounted.value || !newSidepanelValue) {\n return;\n }\n\n if (newIsOpen) {\n internalIsOpen.value = true;\n if (!newSidepanelValue.open) {\n newSidepanelValue.showModal();\n }\n if (!previousPages.value.length) {\n previousPages.value.push(activePage.value);\n }\n } else if (newSidepanelValue.open) {\n startCloseSidepanelAnimation();\n }\n },\n { immediate: true, flush: 'post' }\n );\n\n // Pages\n const updatePage = page => emit(BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, page);\n\n // unregister page if removed / destroyed\n const unregisterPage = (pageIdToRemove: string) => () => {\n pages.value = pages.value?.filter(pageId => pageId !== pageIdToRemove);\n };\n\n // Provide data and function to register page to subcomponent\n const registerPage: BentoDialogPageRegisterPage = pageId => {\n pages.value.push(pageId);\n\n return { unregisterPage: unregisterPage(pageId) };\n };\n\n provide<BentoDialogPageConfigData>(DIALOG_PAGE_CONFIG_INJECTION_KEY, {\n activePage,\n animation,\n isAnimationActive,\n isOpen: internalIsOpen,\n pages,\n previousPages,\n updatePage,\n });\n provide(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY, registerPage);\n\n // Let's Children components know they are inside a SidePanel (dialog element)\n provide(SIDEPANEL_DIALOG_ID_INJECTION_KEY, sidepanelId);\n\n if (!props.isDismissible && props.hideCloseButton === null) {\n deprecate(\n 'BentoSidepanel \"isDismissible\" property’s behavior',\n 'BentoSidepanel \"isDismissible\" will no longer hide the close button. Use \"hideCloseButton=true\" instead.',\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Sidepanel component is a slide-in panel that should be used for presenting actions, settings or features that are directly associated with a specific task or interaction on the main screen.\n *\n * @example\n * import { BentoSidepanel, BentoSidepanelPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSidepanel, BentoSidepanelPage },\n * template: `\n * <bento-sidepanel active-page='step1' is-open='true'>\n * <bento-sidepanel-page\n * title='Step 1'\n * pageId='step1'\n * :actions=\"[\n * {\n * title: 'Next step',\n * event: () => {\n * activePage.value = 'step2';\n * },\n * }]\">\n * Step 1 info\n * </bento-sidepanel-page>\n * <bento-sidepanel-page\n * title='Step 2'\n * pageId='step2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Step 2 info\n * </bento-sidepanel-page>\n * </bento-sidepanel>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n<style lang=\"scss\" scoped src=\"./sidepanel.scss\" />\n"],"names":["__default__$1","BentoSidepanelEvent","BentoSidepanelEvent2","__default__","messages","props","__props","emit","__emit","activePage","isOpen","toRefs","t","useI18n","sidepanel","ref","pages","previousPages","animation","BentoDialogPageAnimation","isClosing","sidepanelId","generateUid","internalIsOpen","isAnimationActive","isMounted","conditionalClasses","computed","closeSidepanelAfterAnimation","startCloseSidepanelAnimation","closeSidepanelOnClickOutside","computedHideCloseButton","onMounted","onUnmounted","watch","newIsOpen","newSidepanelValue","updatePage","page","unregisterPage","pageIdToRemove","pageId","registerPage","provide","DIALOG_PAGE_CONFIG_INJECTION_KEY","DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY","SIDEPANEL_DIALOG_ID_INJECTION_KEY","deprecate"],"mappings":";;;;;;;;;;;;;4IA2IIA,KAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC3IG,IAAAC,IAAA,kBAAAC,OACHA,EAAA,qBAAA,sBACAA,EAAA,iBAAA,kBAFQA,IAAAD,KAAA,C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A,MAAA;AACI,MAAAR,EAAA,QAAA;AAAA,IAAkB,CAAA,GAItBS;AAAA,MAAA,CAAA,MAAAxB,EAAA,OAAAI,CAAA;AAAA,MACkC,CAAA,CAAAqB,GAAAC,CAAA,MAAA;AAE1B,QAAA,CAAAX,EAAA,SAAA,CAAAW,MAIAD,KACIZ,EAAA,QAAA,IACAa,EAAA,QACIA,EAAA,UAAA,GAEJnB,EAAA,MAAA,UACIA,EAAA,MAAA,KAAAR,EAAA,KAAA,KACJ2B,EAAA,QAEAP,EAAA;AAAA,MACJ;AAAA,MACJ,EAAA,WAAA,IAAA,OAAA,OAAA;AAAA,IACiC;AAIrC,UAAAQ,IAAA,CAAAC,MAAA/B,EAAAN,EAAA,oBAAAqC,CAAA,GAGAC,IAAA,CAAAC,MAAA,MAAA;AACI,MAAAxB,EAAA,QAAAA,EAAA,OAAA,OAAA,CAAAyB,MAAAA,MAAAD,CAAA;AAAA,IAAqE,GAIzEE,IAAA,CAAAD,OACIzB,EAAA,MAAA,KAAAyB,CAAA,GAEA,EAAA,gBAAAF,EAAAE,CAAA,EAAA;AAGJ,WAAAE,EAAAC,IAAA;AAAA,MAAqE,YAAAnC;AAAA,MACjE,WAAAS;AAAA,MACA,mBAAAM;AAAA,MACA,QAAAD;AAAA,MACQ,OAAAP;AAAA,MACR,eAAAC;AAAA,MACA,YAAAoB;AAAA,IACA,CAAA,GAEJM,EAAAE,IAAAH,CAAA,GAGAC,EAAAG,IAAAzB,CAAA,GAEA,CAAAhB,EAAA,iBAAAA,EAAA,oBAAA,QACI0C;AAAA,MAAA;AAAA,MACI;AAAA,MACA;AAAA,IACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as b, inject as p, computed as o, provide as R, openBlock as r, createElementBlock as S, renderSlot as B, ref as U, normalizeClass as _, createElementVNode as h, normalizeStyle as $, createVNode as f, unref as e, withCtx as y, createTextVNode as g, toDisplayString as A, createBlock as u, createCommentVNode as d, withDirectives as V } from "vue";
|
|
2
2
|
import { _ as v } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
3
|
-
import { B as j } from "./button.
|
|
3
|
+
import { B as j } from "./button.C6-bXf1h.js";
|
|
4
4
|
import { B as F } from "./info-icon.DvhV1I7b.js";
|
|
5
5
|
import { B as O } from "./typography.B3J6_tYk.js";
|
|
6
|
-
import { C as w } from "./copy.
|
|
6
|
+
import { C as w } from "./copy.CFgvGhnT.js";
|
|
7
7
|
import { S as z } from "./search.ClLmZAgC.js";
|
|
8
8
|
import { u as H } from "./index.B875RXHM.js";
|
|
9
9
|
import { b as J } from "./tooltip.DaO3Jkem.js";
|
|
@@ -109,4 +109,4 @@ export {
|
|
|
109
109
|
C as S,
|
|
110
110
|
lt as a
|
|
111
111
|
};
|
|
112
|
-
//# sourceMappingURL=structured-list-item.
|
|
112
|
+
//# sourceMappingURL=structured-list-item.BqptGVDy.js.map
|
package/dist/chunks/{structured-list-item.RunfI9Pj.js.map → structured-list-item.BqptGVDy.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structured-list-item.RunfI9Pj.js","sources":["../../../vue2/src/components/structured-list/structured-list.keys.ts","../../../vue2/src/components/structured-list/structured-list.types.ts","../../../vue2/src/components/structured-list/structured-list.vue","../../../vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue"],"sourcesContent":["export const STRUCTURED_LIST_CONDENSED_INJECTION_KEY = Symbol('structured list condensed style injection key');\nexport const STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY = Symbol('structured list labels width injection key');\n","export type BentoStructuredListLayoutOptions = '25-75' | '33-66' | '42-58' | '50-50' | '75-25' | '66-33' | '58-42';\nexport const BentoStructuredListLayoutOptions = ['25-75', '33-66', '42-58', '50-50', '75-25', '66-33', '58-42'];\n","<template>\n <dl class=\"b-structured-list\">\n <slot />\n </dl>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, provide } from 'vue';\n import {\n STRUCTURED_LIST_CONDENSED_INJECTION_KEY,\n STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY,\n } from '@/components/structured-list/structured-list.keys';\n import { BentoStructuredListLayoutOptions } from './structured-list.types';\n\n const props = withDefaults(\n defineProps<{\n /**\n * Width of the labels container, in pixels. Overrides layout prop.\n */\n labelsWidth?: number;\n /**\n * The layout of the label value pair in percentage.\n * If labelsWidth is set, layout will be overriden by the static pixel value.\n *\n * If the value entered is not listed in the example\n * list below '33-66' will be applied\n * @example\n * '25-75'\n * '33-66'\n * '42-58'\n * '50-50'\n * '75-25'\n * '66-33'\n * '58-42'\n */\n layout?: BentoStructuredListLayoutOptions;\n }>(),\n {\n labelsWidth: null,\n layout: '33-66',\n }\n );\n\n const isCondensed = inject(STRUCTURED_LIST_CONDENSED_INJECTION_KEY, false);\n\n const computedLayout = computed(() =>\n BentoStructuredListLayoutOptions.includes(props.layout) ? props.layout : '33-66'\n );\n\n const computedLabelsWidth = computed(() => {\n if (isCondensed) {\n return '130px';\n }\n\n if (props.labelsWidth) {\n return `${props.labelsWidth}px`;\n }\n\n return `${computedLayout.value.split('-')[0]}%`;\n });\n\n provide(STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY, computedLabelsWidth);\n</script>\n\n<script lang=\"ts\">\n /**\n * This is a list used to display pairs of information in a clear and organized manner.\n * `BentoStructureListItem` should be used to pass the label/value pairs to the list.\n *\n * @example\n * import { BentoStructuredListItem, BentoStructuredListItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStructuredList, BentoStructuredListItem },\n * template: `\n * <bento-structured-list>\n * <bento-structured-list-item label=\"Payment\">\n * <bento-payment-method label=\"Klarna\" type=\"Klarna\" />\n * </bento-structured-list-item>\n * <bento-structured-list-item label=\"Amount\">\n * <bento-currency :currency=\"BentoCurrencyISOCode.USD\" :value=\"123456\" />\n * </bento-structured-list-item>\n * </bento-structured-list>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./structured-list.scss\" />\n","<template>\n <div class=\"b-structured-list-item\" :class=\"conditionalClasses\">\n <dt class=\"b-structured-list-item__label\" :style=\"computedLabelStyle\">\n <bento-typography :variant=\"labelTypographyVariant\">{{ label }}</bento-typography>\n <bento-info-icon v-if=\"labelInfo\" class=\"b-structured-list-item__icon\" :tooltip-text=\"labelInfo\" />\n </dt>\n <dd class=\"b-structured-list-item__value\" :class=\"valueConditionalClasses\">\n <slot />\n <copy v-if=\"copy\" class=\"b-structured-list-item__icon\" :text=\"copy\" @click=\"emitCopy\" />\n <bento-button\n v-if=\"search\"\n v-bento-tooltip-directive:top=\"searchTooltip ? searchTooltip : t('search')\"\n class=\"b-structured-list-item__icon\"\n variant=\"tertiary\"\n @click=\"search\"\n >\n <template #iconLeft>\n <search-icon :svg-title=\"t('search')\" />\n </template>\n </bento-button>\n </dd>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, ref, type Ref } from 'vue';\n\n // Components\n import { BentoButton } from '@/components/button';\n import { BentoInfoIcon } from '@/components/info-icon';\n import { BentoTypography } from '@/components/typography';\n import Copy from '@/components/internal/copy/copy.vue';\n import SearchIcon from '@adyen/ui-assets-icons-16/vue/search';\n\n // Utils\n import { useI18n } from '@/utils/ts/i18n';\n\n // Directives\n import { BentoTooltipDirective as vBentoTooltipDirective } from '@/directives';\n\n // Keys\n import {\n STRUCTURED_LIST_CONDENSED_INJECTION_KEY,\n STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY,\n } from '../../structured-list.keys';\n\n import messages from '../../messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const DEFAULT_LABELS_WIDTH = '33%';\n\n const props = defineProps<{\n /**\n * Label to display for the value\n */\n label: string;\n /**\n * Text to display in info icon tooltip in the label to display for the value\n */\n labelInfo?: string;\n /**\n * Text to copy when the user clicks `Copy` icon\n */\n copy?: string;\n /**\n * Function to trigger when user clicks `Search` icon\n */\n search?: (event: Event) => void;\n /**\n * Text to display when the user hovers over `Search` icon\n */\n searchTooltip?: string;\n /**\n * Truncates the value of the item\n */\n truncate?: boolean;\n }>();\n\n const emit = defineEmits<{\n /**\n * Emits copy event and value when copy button is clicked\n */\n (e: 'copy', value: string): void;\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const isCondensed = inject(STRUCTURED_LIST_CONDENSED_INJECTION_KEY, false);\n const labelsWidth = inject<Ref<string>>(STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY, ref(DEFAULT_LABELS_WIDTH));\n const computedLabelStyle = computed(() => `flex-basis:${labelsWidth.value}`);\n const conditionalClasses = computed(() => ({\n 'b-structured-list-item--condensed': isCondensed,\n }));\n\n const valueConditionalClasses = computed(() => ({\n 'b-structured-list-item__value--truncate': props.truncate,\n }));\n\n const emitCopy = () => {\n emit('copy', props.copy);\n };\n\n const labelTypographyVariant = computed(() => (isCondensed ? 'caption' : 'body'));\n</script>\n\n<script lang=\"ts\">\n /**\n * This is an item of the `BentoStructuredList` meant to be used only with that component.\n * It consists of a label/value pair, and also the optional copy and search modifiers.\n *\n * @example\n * import { BentoCurrencyISOCode, BentoStructuredListItem, BentoStructuredListItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStructuredListItem, BentoStructuredListItem },\n * template: `\n * <bento-structured-list>\n * <bento-structured-list-item label=\"Shopper\" search='searchShopper' search-tooltip='Find shopper'>\n * <bento-typography>\n * 143442642\n * </bento-status>\n * </bento-structured-list-item>\n * <bento-structured-list-item label=\"Amount\" copy='123456'>\n * <bento-currency :currency=\"BentoCurrencyISOCode.USD\" :value=\"123456\" />\n * </bento-structured-list-item>\n * </bento-structured-list>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./structured-list-item.scss\" />\n"],"names":["STRUCTURED_LIST_CONDENSED_INJECTION_KEY","STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY","BentoStructuredListLayoutOptions","__default__$1","props","__props","isCondensed","inject","computedLayout","computed","computedLabelsWidth","provide","__default__","messages","emit","__emit","t","useI18n","labelsWidth","ref","computedLabelStyle","conditionalClasses","valueConditionalClasses","emitCopy","labelTypographyVariant"],"mappings":";;;;;;;;;;AAAO,MAAAA,IAAA,uBAAA,+CAAA,GACAC,IAAA,uBAAA,4CAAA,GCAAC,IAAA,CAAA,SAAA,SAAA,SAAA,SAAA,SAAA,SAAA,OAAA,uCCqFHC,IAAA,CAAA;;;;;;;;AAxEA,UAAAC,IAAAC,GA6BAC,IAAAC,EAAAP,GAAA,EAAA,GAEAQ,IAAAC;AAAA,MAAuB,MAAAP,EAAA,SAAAE,EAAA,MAAA,IAAAA,EAAA,SAAA;AAAA,IACsD,GAG7EM,IAAAD,EAAA,MACIH,IACI,UAGJF,EAAA,cACI,GAAAA,EAAA,WAAA,OAGJ,GAAAI,EAAA,MAAA,MAAA,GAAA,EAAA,CAAA,CAAA,GAA4C;AAGhD,WAAAG,EAAAV,GAAAS,CAAA;;;;;;;;;;;;;;;GCoEAE,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;AA/EA,UAAAT,IAAAC,GA2BAS,IAAAC,GAOA,EAAA,GAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAJ,EAAA,CAAA,GACAP,IAAAC,EAAAP,GAAA,EAAA,GACAkB,IAAAX,EAAAN,GAAAkB,EAAA,KAAA,CAAA,GACAC,IAAAX,EAAA,MAAA,cAAAS,EAAA,KAAA,EAAA,GACAG,IAAAZ,EAAA,OAAA;AAAA,MAA2C,qCAAAH;AAAA,IACF,EAAA,GAGzCgB,IAAAb,EAAA,OAAA;AAAA,MAAgD,2CAAAL,EAAA;AAAA,IACK,EAAA,GAGrDmB,IAAA,MAAA;AACI,MAAAT,EAAA,QAAAV,EAAA,IAAA;AAAA,IAAuB,GAG3BoB,IAAAf,EAAA,MAAAH,IAAA,YAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"structured-list-item.BqptGVDy.js","sources":["../../../vue2/src/components/structured-list/structured-list.keys.ts","../../../vue2/src/components/structured-list/structured-list.types.ts","../../../vue2/src/components/structured-list/structured-list.vue","../../../vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue"],"sourcesContent":["export const STRUCTURED_LIST_CONDENSED_INJECTION_KEY = Symbol('structured list condensed style injection key');\nexport const STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY = Symbol('structured list labels width injection key');\n","export type BentoStructuredListLayoutOptions = '25-75' | '33-66' | '42-58' | '50-50' | '75-25' | '66-33' | '58-42';\nexport const BentoStructuredListLayoutOptions = ['25-75', '33-66', '42-58', '50-50', '75-25', '66-33', '58-42'];\n","<template>\n <dl class=\"b-structured-list\">\n <slot />\n </dl>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, provide } from 'vue';\n import {\n STRUCTURED_LIST_CONDENSED_INJECTION_KEY,\n STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY,\n } from '@/components/structured-list/structured-list.keys';\n import { BentoStructuredListLayoutOptions } from './structured-list.types';\n\n const props = withDefaults(\n defineProps<{\n /**\n * Width of the labels container, in pixels. Overrides layout prop.\n */\n labelsWidth?: number;\n /**\n * The layout of the label value pair in percentage.\n * If labelsWidth is set, layout will be overriden by the static pixel value.\n *\n * If the value entered is not listed in the example\n * list below '33-66' will be applied\n * @example\n * '25-75'\n * '33-66'\n * '42-58'\n * '50-50'\n * '75-25'\n * '66-33'\n * '58-42'\n */\n layout?: BentoStructuredListLayoutOptions;\n }>(),\n {\n labelsWidth: null,\n layout: '33-66',\n }\n );\n\n const isCondensed = inject(STRUCTURED_LIST_CONDENSED_INJECTION_KEY, false);\n\n const computedLayout = computed(() =>\n BentoStructuredListLayoutOptions.includes(props.layout) ? props.layout : '33-66'\n );\n\n const computedLabelsWidth = computed(() => {\n if (isCondensed) {\n return '130px';\n }\n\n if (props.labelsWidth) {\n return `${props.labelsWidth}px`;\n }\n\n return `${computedLayout.value.split('-')[0]}%`;\n });\n\n provide(STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY, computedLabelsWidth);\n</script>\n\n<script lang=\"ts\">\n /**\n * This is a list used to display pairs of information in a clear and organized manner.\n * `BentoStructureListItem` should be used to pass the label/value pairs to the list.\n *\n * @example\n * import { BentoStructuredListItem, BentoStructuredListItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStructuredList, BentoStructuredListItem },\n * template: `\n * <bento-structured-list>\n * <bento-structured-list-item label=\"Payment\">\n * <bento-payment-method label=\"Klarna\" type=\"Klarna\" />\n * </bento-structured-list-item>\n * <bento-structured-list-item label=\"Amount\">\n * <bento-currency :currency=\"BentoCurrencyISOCode.USD\" :value=\"123456\" />\n * </bento-structured-list-item>\n * </bento-structured-list>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./structured-list.scss\" />\n","<template>\n <div class=\"b-structured-list-item\" :class=\"conditionalClasses\">\n <dt class=\"b-structured-list-item__label\" :style=\"computedLabelStyle\">\n <bento-typography :variant=\"labelTypographyVariant\">{{ label }}</bento-typography>\n <bento-info-icon v-if=\"labelInfo\" class=\"b-structured-list-item__icon\" :tooltip-text=\"labelInfo\" />\n </dt>\n <dd class=\"b-structured-list-item__value\" :class=\"valueConditionalClasses\">\n <slot />\n <copy v-if=\"copy\" class=\"b-structured-list-item__icon\" :text=\"copy\" @click=\"emitCopy\" />\n <bento-button\n v-if=\"search\"\n v-bento-tooltip-directive:top=\"searchTooltip ? searchTooltip : t('search')\"\n class=\"b-structured-list-item__icon\"\n variant=\"tertiary\"\n @click=\"search\"\n >\n <template #iconLeft>\n <search-icon :svg-title=\"t('search')\" />\n </template>\n </bento-button>\n </dd>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, ref, type Ref } from 'vue';\n\n // Components\n import { BentoButton } from '@/components/button';\n import { BentoInfoIcon } from '@/components/info-icon';\n import { BentoTypography } from '@/components/typography';\n import Copy from '@/components/internal/copy/copy.vue';\n import SearchIcon from '@adyen/ui-assets-icons-16/vue/search';\n\n // Utils\n import { useI18n } from '@/utils/ts/i18n';\n\n // Directives\n import { BentoTooltipDirective as vBentoTooltipDirective } from '@/directives';\n\n // Keys\n import {\n STRUCTURED_LIST_CONDENSED_INJECTION_KEY,\n STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY,\n } from '../../structured-list.keys';\n\n import messages from '../../messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const DEFAULT_LABELS_WIDTH = '33%';\n\n const props = defineProps<{\n /**\n * Label to display for the value\n */\n label: string;\n /**\n * Text to display in info icon tooltip in the label to display for the value\n */\n labelInfo?: string;\n /**\n * Text to copy when the user clicks `Copy` icon\n */\n copy?: string;\n /**\n * Function to trigger when user clicks `Search` icon\n */\n search?: (event: Event) => void;\n /**\n * Text to display when the user hovers over `Search` icon\n */\n searchTooltip?: string;\n /**\n * Truncates the value of the item\n */\n truncate?: boolean;\n }>();\n\n const emit = defineEmits<{\n /**\n * Emits copy event and value when copy button is clicked\n */\n (e: 'copy', value: string): void;\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const isCondensed = inject(STRUCTURED_LIST_CONDENSED_INJECTION_KEY, false);\n const labelsWidth = inject<Ref<string>>(STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY, ref(DEFAULT_LABELS_WIDTH));\n const computedLabelStyle = computed(() => `flex-basis:${labelsWidth.value}`);\n const conditionalClasses = computed(() => ({\n 'b-structured-list-item--condensed': isCondensed,\n }));\n\n const valueConditionalClasses = computed(() => ({\n 'b-structured-list-item__value--truncate': props.truncate,\n }));\n\n const emitCopy = () => {\n emit('copy', props.copy);\n };\n\n const labelTypographyVariant = computed(() => (isCondensed ? 'caption' : 'body'));\n</script>\n\n<script lang=\"ts\">\n /**\n * This is an item of the `BentoStructuredList` meant to be used only with that component.\n * It consists of a label/value pair, and also the optional copy and search modifiers.\n *\n * @example\n * import { BentoCurrencyISOCode, BentoStructuredListItem, BentoStructuredListItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStructuredListItem, BentoStructuredListItem },\n * template: `\n * <bento-structured-list>\n * <bento-structured-list-item label=\"Shopper\" search='searchShopper' search-tooltip='Find shopper'>\n * <bento-typography>\n * 143442642\n * </bento-status>\n * </bento-structured-list-item>\n * <bento-structured-list-item label=\"Amount\" copy='123456'>\n * <bento-currency :currency=\"BentoCurrencyISOCode.USD\" :value=\"123456\" />\n * </bento-structured-list-item>\n * </bento-structured-list>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./structured-list-item.scss\" />\n"],"names":["STRUCTURED_LIST_CONDENSED_INJECTION_KEY","STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY","BentoStructuredListLayoutOptions","__default__$1","props","__props","isCondensed","inject","computedLayout","computed","computedLabelsWidth","provide","__default__","messages","emit","__emit","t","useI18n","labelsWidth","ref","computedLabelStyle","conditionalClasses","valueConditionalClasses","emitCopy","labelTypographyVariant"],"mappings":";;;;;;;;;;AAAO,MAAAA,IAAA,uBAAA,+CAAA,GACAC,IAAA,uBAAA,4CAAA,GCAAC,IAAA,CAAA,SAAA,SAAA,SAAA,SAAA,SAAA,SAAA,OAAA,uCCqFHC,IAAA,CAAA;;;;;;;;AAxEA,UAAAC,IAAAC,GA6BAC,IAAAC,EAAAP,GAAA,EAAA,GAEAQ,IAAAC;AAAA,MAAuB,MAAAP,EAAA,SAAAE,EAAA,MAAA,IAAAA,EAAA,SAAA;AAAA,IACsD,GAG7EM,IAAAD,EAAA,MACIH,IACI,UAGJF,EAAA,cACI,GAAAA,EAAA,WAAA,OAGJ,GAAAI,EAAA,MAAA,MAAA,GAAA,EAAA,CAAA,CAAA,GAA4C;AAGhD,WAAAG,EAAAV,GAAAS,CAAA;;;;;;;;;;;;;;;GCoEAE,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;AA/EA,UAAAT,IAAAC,GA2BAS,IAAAC,GAOA,EAAA,GAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAJ,EAAA,CAAA,GACAP,IAAAC,EAAAP,GAAA,EAAA,GACAkB,IAAAX,EAAAN,GAAAkB,EAAA,KAAA,CAAA,GACAC,IAAAX,EAAA,MAAA,cAAAS,EAAA,KAAA,EAAA,GACAG,IAAAZ,EAAA,OAAA;AAAA,MAA2C,qCAAAH;AAAA,IACF,EAAA,GAGzCgB,IAAAb,EAAA,OAAA;AAAA,MAAgD,2CAAAL,EAAA;AAAA,IACK,EAAA,GAGrDmB,IAAA,MAAA;AACI,MAAAT,EAAA,QAAAV,EAAA,IAAA;AAAA,IAAuB,GAG3BoB,IAAAf,EAAA,MAAAH,IAAA,YAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -5,10 +5,10 @@ import { G as x } from "./grid-layout.CCWNscU_.js";
|
|
|
5
5
|
import { _ as E } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
6
6
|
import { B as D } from "./typography.B3J6_tYk.js";
|
|
7
7
|
import { u as ee } from "./index.B875RXHM.js";
|
|
8
|
-
import { B as te } from "./dashed-underline.
|
|
8
|
+
import { B as te } from "./dashed-underline.BX23F04p.js";
|
|
9
9
|
import { B as oe } from "./info-icon.DvhV1I7b.js";
|
|
10
10
|
import { B as A } from "./tag.BDBpa51Z.js";
|
|
11
|
-
import { C as ne } from "./copy.
|
|
11
|
+
import { C as ne } from "./copy.CFgvGhnT.js";
|
|
12
12
|
import "../assets/summary-grid.css";
|
|
13
13
|
const ie = { class: "b-summary-grid" }, re = {}, le = /* @__PURE__ */ g({
|
|
14
14
|
...re,
|
|
@@ -486,4 +486,4 @@ export {
|
|
|
486
486
|
ge as e,
|
|
487
487
|
we as s
|
|
488
488
|
};
|
|
489
|
-
//# sourceMappingURL=summary-grid.types.
|
|
489
|
+
//# sourceMappingURL=summary-grid.types.CS7JxDEe.js.map
|