@adyen/bento-vue2 1.63.0 → 1.63.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/@types/index.d.ts +3 -9
  2. package/dist/action-bar.js +1 -1
  3. package/dist/assets/accordion-item.css +1 -1
  4. package/dist/assets/action-bar.css +1 -1
  5. package/dist/assets/base-modal.css +1 -1
  6. package/dist/assets/card.css +1 -1
  7. package/dist/assets/data-grid.css +1 -1
  8. package/dist/assets/date-picker.css +1 -1
  9. package/dist/assets/dialog-page.css +1 -1
  10. package/dist/assets/file-uploader.css +1 -1
  11. package/dist/assets/inspector.css +1 -1
  12. package/dist/assets/menu.css +1 -1
  13. package/dist/assets/modal-fullscreen.css +1 -1
  14. package/dist/assets/popover.css +1 -1
  15. package/dist/assets/sidepanel.css +1 -1
  16. package/dist/chunks/{action-bar.Dsp7iRxz.js → action-bar.DHdrZtmW.js} +2 -2
  17. package/dist/chunks/{action-bar.Dsp7iRxz.js.map → action-bar.DHdrZtmW.js.map} +1 -1
  18. package/dist/chunks/{button-actions-with-menu.CtW_16tY.js → button-actions-with-menu.CYkEoiee.js} +2 -2
  19. package/dist/chunks/{button-actions-with-menu.CtW_16tY.js.map → button-actions-with-menu.CYkEoiee.js.map} +1 -1
  20. package/dist/chunks/{dashboard-section.CspNW0CA.js → dashboard-section.Bz54Z6Hh.js} +2 -2
  21. package/dist/chunks/{dashboard-section.CspNW0CA.js.map → dashboard-section.Bz54Z6Hh.js.map} +1 -1
  22. package/dist/chunks/{data-grid-template.BhzgqkZp.js → data-grid-template.DtFRjaR8.js} +2 -2
  23. package/dist/chunks/{data-grid-template.BhzgqkZp.js.map → data-grid-template.DtFRjaR8.js.map} +1 -1
  24. package/dist/chunks/{data-grid.BfsBhYpW.js → data-grid.Cep-0zsO.js} +4 -4
  25. package/dist/chunks/{data-grid.BfsBhYpW.js.map → data-grid.Cep-0zsO.js.map} +1 -1
  26. package/dist/chunks/{date-picker.CPQ6WLZE.js → date-picker.D65ieFdN.js} +20 -20
  27. package/dist/chunks/{date-picker.CPQ6WLZE.js.map → date-picker.D65ieFdN.js.map} +1 -1
  28. package/dist/chunks/{filter-bar.D6HeYnzZ.js → filter-bar.DjUN3PeJ.js} +2 -2
  29. package/dist/chunks/{filter-bar.D6HeYnzZ.js.map → filter-bar.DjUN3PeJ.js.map} +1 -1
  30. package/dist/chunks/{header-with-views.Dkn8IDew.js → header-with-views.Csgl4PSQ.js} +3 -3
  31. package/dist/chunks/{header-with-views.Dkn8IDew.js.map → header-with-views.Csgl4PSQ.js.map} +1 -1
  32. package/dist/chunks/{header.DNzQO7u-.js → header.Cb644uAi.js} +2 -2
  33. package/dist/chunks/{header.DNzQO7u-.js.map → header.Cb644uAi.js.map} +1 -1
  34. package/dist/chunks/{menu.W_kuhRKI.js → menu.BCD4FW54.js} +2 -2
  35. package/dist/chunks/{menu.W_kuhRKI.js.map → menu.BCD4FW54.js.map} +1 -1
  36. package/dist/chunks/{tutorial.BNZh6N3h.js → tutorial.DJ_Cwp9i.js} +2 -2
  37. package/dist/chunks/{tutorial.BNZh6N3h.js.map → tutorial.DJ_Cwp9i.js.map} +1 -1
  38. package/dist/dashboard-template.js +1 -1
  39. package/dist/data-grid-template.js +1 -1
  40. package/dist/data-grid.js +1 -1
  41. package/dist/date-picker.js +1 -1
  42. package/dist/filter-bar.js +1 -1
  43. package/dist/header-with-views.js +1 -1
  44. package/dist/header.js +1 -1
  45. package/dist/index.js +10 -10
  46. package/dist/internal.js +1 -1
  47. package/dist/menu.js +1 -1
  48. package/dist/tutorial.js +1 -1
  49. package/dist/web-types.json +2 -2
  50. package/package.json +4 -4
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as x, computed as c, ref as b, toRefs as O, watch as g, provide as P, nextTick as B } from "vue";
2
2
  import { B as V } from "./button.hF-nD1Og.js";
3
3
  import { B as R } from "./typography.J1v_SPG3.js";
4
- import { B as F } from "./button-actions-with-menu.CtW_16tY.js";
4
+ import { B as F } from "./button-actions-with-menu.CYkEoiee.js";
5
5
  import { C as W } from "./cross.CC_B-vG-.js";
6
6
  import { u as L } from "./i18n.BQkEbtPM.js";
7
7
  import { u as k } from "./index.BdrLbvtJ.js";
@@ -158,4 +158,4 @@ const st = q.exports;
158
158
  export {
159
159
  st as B
160
160
  };
161
- //# sourceMappingURL=action-bar.Dsp7iRxz.js.map
161
+ //# sourceMappingURL=action-bar.DHdrZtmW.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"action-bar.Dsp7iRxz.js","sources":["../../src/components/action-bar/action-bar.vue"],"sourcesContent":["<template>\n <Transition name=\"b-action-bar__animation\" appear>\n <section class=\"b-action-bar\" :class=\"conditionalClasses\" :aria-label=\"t('actionBar')\">\n <div ref=\"actionBar\" class=\"b-action-bar__container\">\n <div v-if=\"!isConfirmationVariant\" class=\"b-action-bar__close-button\">\n <bento-button variant=\"tertiary\" inverse :aria-label=\"t('close')\" @click=\"emit('close')\">\n <template #iconLeft><cross-icon :aria-hidden=\"true\" /></template>\n </bento-button>\n </div>\n <bento-typography el=\"span\" stronger class=\"b-action-bar__selection\">\n {{ itemCounter }} {{ isConfirmationVariant ? tc('unsavedChanges', itemCounter) : label }}\n </bento-typography>\n <bento-button-actions\n v-if=\"isConfirmationVariant\"\n :actions=\"confirmationActions\"\n class=\"b-action-bar__actions\"\n inverse\n />\n <button-actions-with-menu\n v-else\n :actions=\"actionsInternal\"\n class=\"b-action-bar__actions\"\n :displayed-actions=\"internalDisplayedActions\"\n menu-position=\"top-end\"\n disable-responsive-behavior\n inverse\n />\n </div>\n </section>\n </Transition>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, PropType, provide, ref, toRefs, watch } from 'vue';\n import { BentoButton, BentoButtonActions, BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n\n import { type BentoActionBarVariant } from '@/components/action-bar/action-bar.types';\n import ButtonActionsWithMenu from '@/components/internal/button-actions-with-menu/button-actions-with-menu.vue';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { useI18n } from '@/utils/ts/i18n';\n import { useWindowSize } from '@vueuse/core';\n\n import messages from './messages.json';\n import { POPOVER_OFFSET_INJECTION_KEY } from '@/components/popover/popover.keys';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n // Constants\n const AVERAGE_BUTTON_SIZE = 100;\n const MENU_OFFSET = 7;\n const RESPONSIVE_BREAKPOINT = 500;\n const SPACING = 32;\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * Required and used for the `default` variant.\n *\n * Each object in the list should have a `title`, an `event` and,\n * optionally, an `icon`.\n *\n * The component will display 4 actions and the hide the rest inside a menu.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: () => [],\n },\n /**\n * How many actions should be visible outside the menu, cannot be more than 4\n */\n visibleActions: {\n type: Number,\n default: 4,\n validator: (value: number) => value > 0 && value <= 4,\n },\n /**\n * Use when there are sticky elements at the bottom, like sticky pagination\n */\n extraBottomSpacing: {\n type: Boolean,\n default: false,\n },\n /**\n * Show how many items are selected\n */\n itemCounter: {\n type: Number,\n required: true,\n },\n /**\n * Label for the selection, e.g. 'selected'/'changed'\n */\n selectionLabel: {\n type: String,\n default: null,\n },\n /**\n * Variant for the action bar\n * @values default, confirmation\n */\n variant: {\n type: String as PropType<BentoActionBarVariant>,\n default: 'default',\n },\n });\n\n const emit = defineEmits([\"close\", \"cancel\", \"save\"]);\n\n const { t, tc } = useI18n<{ message: MessageSchema }>({ messages });\n const label = computed(() => (props.selectionLabel ? props.selectionLabel : t('selected')));\n\n // Refs\n const actionBar = ref<HTMLDivElement>(null);\n const { extraBottomSpacing, visibleActions } = toRefs(props);\n const { width } = useWindowSize();\n const internalDisplayedActions = ref(null);\n const internalVisibleActions = ref(null);\n\n const isConfirmationVariant = computed(() => props.variant === 'confirmation');\n\n watch(\n () => visibleActions.value,\n value => {\n internalVisibleActions.value = value <= 4 ? value : 4;\n internalDisplayedActions.value = internalVisibleActions.value;\n },\n { immediate: true }\n );\n\n // Styling\n const conditionalClasses = computed(() => ({\n 'b-action-bar--extra-spacing': extraBottomSpacing.value,\n 'b-action-bar--confirmation': isConfirmationVariant.value,\n }));\n\n // Provide POPOVER_OFFSET_INJECTION_KEY to change the value of the popover offset\n provide(POPOVER_OFFSET_INJECTION_KEY, MENU_OFFSET);\n\n // Manipulate actions array to display as intended\n const actionsInternal = computed(() => {\n // All buttons should be of type secondary in the action bar\n const actions = props.actions.map(action => ({\n ...action,\n variant: 'secondary',\n })) as BentoButtonActionsList;\n // Shown actions should display from left to right in action bar, instead of right to left which is the button actions default\n const shownActions = actions.slice(0, internalDisplayedActions.value).reverse();\n const hiddenActions = actions.slice(internalDisplayedActions.value);\n\n return [...shownActions, ...hiddenActions];\n });\n\n const confirmationActions = computed<BentoButtonActionsList>(() => [\n {\n title: t('save'),\n event: () => emit('save'),\n },\n {\n title: t('cancel'),\n variant: 'secondary',\n event: () => emit('cancel'),\n },\n ]);\n\n // Recursive functions to determine how many actions should be visible/hidden based on the screens width\n const showActions = async () => {\n await nextTick();\n if (\n width.value > actionBar.value.clientWidth + SPACING + AVERAGE_BUTTON_SIZE &&\n internalDisplayedActions.value < internalVisibleActions.value\n ) {\n internalDisplayedActions.value += 1;\n showActions();\n }\n };\n\n const hideActions = async () => {\n await nextTick();\n if (width.value < actionBar.value.clientWidth + SPACING && internalDisplayedActions.value > 0) {\n internalDisplayedActions.value -= 1;\n hideActions();\n }\n };\n\n // Screen width watcher to toggle hidden/visible actions\n watch(\n () => width.value,\n async (newValue, oldValue) => {\n await nextTick();\n if (!actionBar.value) {\n return;\n }\n const isIncreasing = newValue > oldValue;\n if (width.value < RESPONSIVE_BREAKPOINT) {\n internalDisplayedActions.value = 0;\n } else if (isIncreasing) {\n showActions();\n } else {\n hideActions();\n }\n },\n { immediate: true }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * Action bar is a floating bar that provides users with quick access to key actions that can be applied to one or multiple items.\n *\n * @example\n * import { BentoActionBar } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoActionBar },\n * template: `\n * <bento-action-bar\n * :actions='[\n * {\n * title: 'Delete',\n * critical: true,\n * icon: BinIcon,\n * event: () => true,\n * },\n * {\n * title: 'Edit',\n * icon: EditIcon,\n * event: () => true,\n * }\n * ]'\n * @close=\"closeAction\"\n * :item-counter=\"5\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./action-bar.scss\" />\n"],"names":["__default__","messages","AVERAGE_BUTTON_SIZE","MENU_OFFSET","RESPONSIVE_BREAKPOINT","SPACING","t","tc","useI18n","label","computed","props","actionBar","ref","extraBottomSpacing","visibleActions","toRefs","width","useWindowSize","internalDisplayedActions","internalVisibleActions","isConfirmationVariant","watch","value","conditionalClasses","provide","POPOVER_OFFSET_INJECTION_KEY","actionsInternal","actions","action","shownActions","hiddenActions","confirmationActions","emit","showActions","nextTick","hideActions","newValue","oldValue","isIncreasing"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+OIA,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA/LAC,IAAA,KACAC,IAAA,GACAC,IAAA,KACAC,IAAA,IA2DA,EAAA,GAAAC,GAAA,IAAAC,EAAA,IAAAC,EAAA,GACAC,IAAAC,EAAA,MAAAC,EAAA,iBAAAA,EAAA,iBAAAL,EAAA,UAAA,CAAA,GAGAM,IAAAC,EAAA,IAAA,GACA,EAAA,oBAAAC,GAAA,gBAAAC,EAAA,IAAAC,EAAAL,CAAA,GACA,EAAA,OAAAM,EAAA,IAAAC,EAAA,GACAC,IAAAN,EAAA,IAAA,GACAO,IAAAP,EAAA,IAAA,GAEAQ,IAAAX,EAAA,MAAAC,EAAA,YAAA,cAAA;AAEA,IAAAW;AAAA,MAAA,MAAAP,EAAA;AAAA,MACyB,CAAAQ,MAAA;AAEjB,QAAAH,EAAA,QAAAG,KAAA,IAAAA,IAAA,GACAJ,EAAA,QAAAC,EAAA;AAAA,MAAwD;AAAA,MAC5D,EAAA,WAAA,GAAA;AAAA,IACkB;AAItB,UAAAI,IAAAd,EAAA,OAAA;AAAA,MAA2C,+BAAAI,EAAA;AAAA,MACW,8BAAAO,EAAA;AAAA,IACE,EAAA;AAIxD,IAAAI,EAAAC,GAAAvB,CAAA;AAGA,UAAAwB,IAAAjB,EAAA,MAAA;AAEI,YAAAkB,IAAAjB,EAAA,QAAA,IAAA,CAAAkB,OAAA;AAAA,QAA6C,GAAAA;AAAA,QACtC,SAAA;AAAA,MACM,EAAA,GAGbC,IAAAF,EAAA,MAAA,GAAAT,EAAA,KAAA,EAAA,QAAA,GACAY,IAAAH,EAAA,MAAAT,EAAA,KAAA;AAEA,aAAA,CAAA,GAAAW,GAAA,GAAAC,CAAA;AAAA,IAAyC,CAAA,GAG7CC,IAAAtB,EAAA,MAAA;AAAA,MAAmE;AAAA,QAC/D,OAAAJ,EAAA,MAAA;AAAA,QACmB,OAAA,MAAA2B,EAAA,MAAA;AAAA,MACS;AAAA,MAC5B;AAAA,QACA,OAAA3B,EAAA,QAAA;AAAA,QACqB,SAAA;AAAA,QACR,OAAA,MAAA2B,EAAA,QAAA;AAAA,MACiB;AAAA,IAC9B,CAAA,GAIJC,IAAA,YAAA;AACI,YAAAC,EAAA,GACAlB,EAAA,QAAAL,EAAA,MAAA,cAAAP,IAAAH,KAAAiB,EAAA,QAAAC,EAAA,UAIID,EAAA,SAAA,GACAe,EAAA;AAAA,IACJ,GAGJE,IAAA,YAAA;AACI,YAAAD,EAAA,GACAlB,EAAA,QAAAL,EAAA,MAAA,cAAAP,KAAAc,EAAA,QAAA,MACIA,EAAA,SAAA,GACAiB,EAAA;AAAA,IACJ;AAIJ,WAAAd;AAAA,MAAA,MAAAL,EAAA;AAAA,MACgB,OAAAoB,GAAAC,MAAA;AAGR,YADA,MAAAH,EAAA,GACA,CAAAvB,EAAA;AACI;AAEJ,cAAA2B,IAAAF,IAAAC;AACA,QAAArB,EAAA,QAAAb,IACIe,EAAA,QAAA,IAAiCoB,IAEjCL,EAAA,IAEAE,EAAA;AAAA,MACJ;AAAA,MACJ,EAAA,WAAA,GAAA;AAAA,IACkB;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"action-bar.DHdrZtmW.js","sources":["../../src/components/action-bar/action-bar.vue"],"sourcesContent":["<template>\n <Transition name=\"b-action-bar__animation\" appear>\n <section class=\"b-action-bar\" :class=\"conditionalClasses\" :aria-label=\"t('actionBar')\">\n <div ref=\"actionBar\" class=\"b-action-bar__container\">\n <div v-if=\"!isConfirmationVariant\" class=\"b-action-bar__close-button\">\n <bento-button variant=\"tertiary\" inverse :aria-label=\"t('close')\" @click=\"emit('close')\">\n <template #iconLeft><cross-icon :aria-hidden=\"true\" /></template>\n </bento-button>\n </div>\n <bento-typography el=\"span\" stronger class=\"b-action-bar__selection\">\n {{ itemCounter }} {{ isConfirmationVariant ? tc('unsavedChanges', itemCounter) : label }}\n </bento-typography>\n <bento-button-actions\n v-if=\"isConfirmationVariant\"\n :actions=\"confirmationActions\"\n class=\"b-action-bar__actions\"\n inverse\n />\n <button-actions-with-menu\n v-else\n :actions=\"actionsInternal\"\n class=\"b-action-bar__actions\"\n :displayed-actions=\"internalDisplayedActions\"\n menu-position=\"top-end\"\n disable-responsive-behavior\n inverse\n />\n </div>\n </section>\n </Transition>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, PropType, provide, ref, toRefs, watch } from 'vue';\n import { BentoButton, BentoButtonActions, BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n\n import { type BentoActionBarVariant } from '@/components/action-bar/action-bar.types';\n import ButtonActionsWithMenu from '@/components/internal/button-actions-with-menu/button-actions-with-menu.vue';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { useI18n } from '@/utils/ts/i18n';\n import { useWindowSize } from '@vueuse/core';\n\n import messages from './messages.json';\n import { POPOVER_OFFSET_INJECTION_KEY } from '@/components/popover/popover.keys';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n // Constants\n const AVERAGE_BUTTON_SIZE = 100;\n const MENU_OFFSET = 7;\n const RESPONSIVE_BREAKPOINT = 500;\n const SPACING = 32;\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * Required and used for the `default` variant.\n *\n * Each object in the list should have a `title`, an `event` and,\n * optionally, an `icon`.\n *\n * The component will display 4 actions and the hide the rest inside a menu.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: () => [],\n },\n /**\n * How many actions should be visible outside the menu, cannot be more than 4\n */\n visibleActions: {\n type: Number,\n default: 4,\n validator: (value: number) => value > 0 && value <= 4,\n },\n /**\n * Use when there are sticky elements at the bottom, like sticky pagination\n */\n extraBottomSpacing: {\n type: Boolean,\n default: false,\n },\n /**\n * Show how many items are selected\n */\n itemCounter: {\n type: Number,\n required: true,\n },\n /**\n * Label for the selection, e.g. 'selected'/'changed'\n */\n selectionLabel: {\n type: String,\n default: null,\n },\n /**\n * Variant for the action bar\n * @values default, confirmation\n */\n variant: {\n type: String as PropType<BentoActionBarVariant>,\n default: 'default',\n },\n });\n\n const emit = defineEmits([\"close\", \"cancel\", \"save\"]);\n\n const { t, tc } = useI18n<{ message: MessageSchema }>({ messages });\n const label = computed(() => (props.selectionLabel ? props.selectionLabel : t('selected')));\n\n // Refs\n const actionBar = ref<HTMLDivElement>(null);\n const { extraBottomSpacing, visibleActions } = toRefs(props);\n const { width } = useWindowSize();\n const internalDisplayedActions = ref(null);\n const internalVisibleActions = ref(null);\n\n const isConfirmationVariant = computed(() => props.variant === 'confirmation');\n\n watch(\n () => visibleActions.value,\n value => {\n internalVisibleActions.value = value <= 4 ? value : 4;\n internalDisplayedActions.value = internalVisibleActions.value;\n },\n { immediate: true }\n );\n\n // Styling\n const conditionalClasses = computed(() => ({\n 'b-action-bar--extra-spacing': extraBottomSpacing.value,\n 'b-action-bar--confirmation': isConfirmationVariant.value,\n }));\n\n // Provide POPOVER_OFFSET_INJECTION_KEY to change the value of the popover offset\n provide(POPOVER_OFFSET_INJECTION_KEY, MENU_OFFSET);\n\n // Manipulate actions array to display as intended\n const actionsInternal = computed(() => {\n // All buttons should be of type secondary in the action bar\n const actions = props.actions.map(action => ({\n ...action,\n variant: 'secondary',\n })) as BentoButtonActionsList;\n // Shown actions should display from left to right in action bar, instead of right to left which is the button actions default\n const shownActions = actions.slice(0, internalDisplayedActions.value).reverse();\n const hiddenActions = actions.slice(internalDisplayedActions.value);\n\n return [...shownActions, ...hiddenActions];\n });\n\n const confirmationActions = computed<BentoButtonActionsList>(() => [\n {\n title: t('save'),\n event: () => emit('save'),\n },\n {\n title: t('cancel'),\n variant: 'secondary',\n event: () => emit('cancel'),\n },\n ]);\n\n // Recursive functions to determine how many actions should be visible/hidden based on the screens width\n const showActions = async () => {\n await nextTick();\n if (\n width.value > actionBar.value.clientWidth + SPACING + AVERAGE_BUTTON_SIZE &&\n internalDisplayedActions.value < internalVisibleActions.value\n ) {\n internalDisplayedActions.value += 1;\n showActions();\n }\n };\n\n const hideActions = async () => {\n await nextTick();\n if (width.value < actionBar.value.clientWidth + SPACING && internalDisplayedActions.value > 0) {\n internalDisplayedActions.value -= 1;\n hideActions();\n }\n };\n\n // Screen width watcher to toggle hidden/visible actions\n watch(\n () => width.value,\n async (newValue, oldValue) => {\n await nextTick();\n if (!actionBar.value) {\n return;\n }\n const isIncreasing = newValue > oldValue;\n if (width.value < RESPONSIVE_BREAKPOINT) {\n internalDisplayedActions.value = 0;\n } else if (isIncreasing) {\n showActions();\n } else {\n hideActions();\n }\n },\n { immediate: true }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * Action bar is a floating bar that provides users with quick access to key actions that can be applied to one or multiple items.\n *\n * @example\n * import { BentoActionBar } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoActionBar },\n * template: `\n * <bento-action-bar\n * :actions='[\n * {\n * title: 'Delete',\n * critical: true,\n * icon: BinIcon,\n * event: () => true,\n * },\n * {\n * title: 'Edit',\n * icon: EditIcon,\n * event: () => true,\n * }\n * ]'\n * @close=\"closeAction\"\n * :item-counter=\"5\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./action-bar.scss\" />\n"],"names":["__default__","messages","AVERAGE_BUTTON_SIZE","MENU_OFFSET","RESPONSIVE_BREAKPOINT","SPACING","t","tc","useI18n","label","computed","props","actionBar","ref","extraBottomSpacing","visibleActions","toRefs","width","useWindowSize","internalDisplayedActions","internalVisibleActions","isConfirmationVariant","watch","value","conditionalClasses","provide","POPOVER_OFFSET_INJECTION_KEY","actionsInternal","actions","action","shownActions","hiddenActions","confirmationActions","emit","showActions","nextTick","hideActions","newValue","oldValue","isIncreasing"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+OIA,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA/LAC,IAAA,KACAC,IAAA,GACAC,IAAA,KACAC,IAAA,IA2DA,EAAA,GAAAC,GAAA,IAAAC,EAAA,IAAAC,EAAA,GACAC,IAAAC,EAAA,MAAAC,EAAA,iBAAAA,EAAA,iBAAAL,EAAA,UAAA,CAAA,GAGAM,IAAAC,EAAA,IAAA,GACA,EAAA,oBAAAC,GAAA,gBAAAC,EAAA,IAAAC,EAAAL,CAAA,GACA,EAAA,OAAAM,EAAA,IAAAC,EAAA,GACAC,IAAAN,EAAA,IAAA,GACAO,IAAAP,EAAA,IAAA,GAEAQ,IAAAX,EAAA,MAAAC,EAAA,YAAA,cAAA;AAEA,IAAAW;AAAA,MAAA,MAAAP,EAAA;AAAA,MACyB,CAAAQ,MAAA;AAEjB,QAAAH,EAAA,QAAAG,KAAA,IAAAA,IAAA,GACAJ,EAAA,QAAAC,EAAA;AAAA,MAAwD;AAAA,MAC5D,EAAA,WAAA,GAAA;AAAA,IACkB;AAItB,UAAAI,IAAAd,EAAA,OAAA;AAAA,MAA2C,+BAAAI,EAAA;AAAA,MACW,8BAAAO,EAAA;AAAA,IACE,EAAA;AAIxD,IAAAI,EAAAC,GAAAvB,CAAA;AAGA,UAAAwB,IAAAjB,EAAA,MAAA;AAEI,YAAAkB,IAAAjB,EAAA,QAAA,IAAA,CAAAkB,OAAA;AAAA,QAA6C,GAAAA;AAAA,QACtC,SAAA;AAAA,MACM,EAAA,GAGbC,IAAAF,EAAA,MAAA,GAAAT,EAAA,KAAA,EAAA,QAAA,GACAY,IAAAH,EAAA,MAAAT,EAAA,KAAA;AAEA,aAAA,CAAA,GAAAW,GAAA,GAAAC,CAAA;AAAA,IAAyC,CAAA,GAG7CC,IAAAtB,EAAA,MAAA;AAAA,MAAmE;AAAA,QAC/D,OAAAJ,EAAA,MAAA;AAAA,QACmB,OAAA,MAAA2B,EAAA,MAAA;AAAA,MACS;AAAA,MAC5B;AAAA,QACA,OAAA3B,EAAA,QAAA;AAAA,QACqB,SAAA;AAAA,QACR,OAAA,MAAA2B,EAAA,QAAA;AAAA,MACiB;AAAA,IAC9B,CAAA,GAIJC,IAAA,YAAA;AACI,YAAAC,EAAA,GACAlB,EAAA,QAAAL,EAAA,MAAA,cAAAP,IAAAH,KAAAiB,EAAA,QAAAC,EAAA,UAIID,EAAA,SAAA,GACAe,EAAA;AAAA,IACJ,GAGJE,IAAA,YAAA;AACI,YAAAD,EAAA,GACAlB,EAAA,QAAAL,EAAA,MAAA,cAAAP,KAAAc,EAAA,QAAA,MACIA,EAAA,SAAA,GACAiB,EAAA;AAAA,IACJ;AAIJ,WAAAd;AAAA,MAAA,MAAAL,EAAA;AAAA,MACgB,OAAAoB,GAAAC,MAAA;AAGR,YADA,MAAAH,EAAA,GACA,CAAAvB,EAAA;AACI;AAEJ,cAAA2B,IAAAF,IAAAC;AACA,QAAArB,EAAA,QAAAb,IACIe,EAAA,QAAA,IAAiCoB,IAEjCL,EAAA,IAEAE,EAAA;AAAA,MACJ;AAAA,MACJ,EAAA,WAAA,GAAA;AAAA,IACkB;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { ref as v, watch as b, nextTick as m, defineComponent as h, toRef as y, computed as _, provide as A } from "vue";
2
- import { M as B, B as N } from "./menu.W_kuhRKI.js";
2
+ import { M as B, B as N } from "./menu.BCD4FW54.js";
3
3
  import { a as T } from "./popover.B05xkQ4e.js";
4
4
  import { c as f, f as w, B as C } from "./button-actions._OIvTdKt.js";
5
5
  import { u as E } from "./index.BdrLbvtJ.js";
@@ -163,4 +163,4 @@ const H = g.exports;
163
163
  export {
164
164
  H as B
165
165
  };
166
- //# sourceMappingURL=button-actions-with-menu.CtW_16tY.js.map
166
+ //# sourceMappingURL=button-actions-with-menu.CYkEoiee.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button-actions-with-menu.CtW_16tY.js","sources":["../../src/components/internal/button-actions-with-menu/composables/use-responsive-actions.ts","../../src/components/internal/button-actions-with-menu/button-actions-with-menu.vue"],"sourcesContent":["import { useWindowSize } from '@vueuse/core';\nimport { nextTick, Ref, ref, watch } from 'vue';\n\ninterface UseResponsiveActionsProps {\n breakpoint?: number;\n container: Ref<HTMLElement>;\n defaultActionsCount: number;\n offset?: Ref<HTMLElement>;\n}\n\nexport const useResponsiveActions = (props: UseResponsiveActionsProps) => {\n const { breakpoint, container, defaultActionsCount, offset } = props;\n\n const { width: windowWidth } = useWindowSize();\n\n const displayedActionsCount = ref<number>(defaultActionsCount);\n\n const AVERAGE_BUTTON_WIDTH = 150; // button size + gap\n\n const showActions = async () => {\n await nextTick();\n\n const availableSpace = container.value.clientWidth;\n const totalActionWidth =\n AVERAGE_BUTTON_WIDTH * displayedActionsCount.value +\n (offset?.value?.offsetWidth ?? 0) +\n AVERAGE_BUTTON_WIDTH;\n\n // Only add actions if there's enough space and we haven't reached max\n if (availableSpace >= totalActionWidth && displayedActionsCount.value < defaultActionsCount) {\n displayedActionsCount.value += 1;\n\n showActions(); // keep trying to show more\n }\n };\n\n const hideActions = async () => {\n await nextTick();\n\n const availableSpace = container.value.clientWidth;\n const totalActionWidth = AVERAGE_BUTTON_WIDTH * displayedActionsCount.value + (offset?.value?.offsetWidth ?? 0);\n\n // Hide actions if they overflow the container\n if (availableSpace < totalActionWidth && displayedActionsCount.value > 0) {\n displayedActionsCount.value -= 1;\n\n hideActions(); // keep hiding until it fits\n }\n };\n\n watch([windowWidth, container], async ([newWidth, containerEl], [oldWidth]) => {\n if (!containerEl || !defaultActionsCount || newWidth > breakpoint) {\n return;\n }\n\n await nextTick();\n\n const isIncreasing = newWidth > oldWidth;\n\n if (isIncreasing) {\n showActions();\n } else {\n hideActions();\n }\n });\n\n return {\n displayedActionsCount,\n };\n};\n","<template>\n <div class=\"b-button-actions-with-menu\">\n <div\n ref=\"buttonActionsWithMenu\"\n role=\"group\"\n class=\"b-button-actions-with-menu__container-wrapper\"\n :class=\"conditionalClasses\"\n >\n <bento-button-actions :actions=\"computedActions\" :inverse=\"inverse\" :layout=\"actionsLayout\" />\n <bento-menu\n v-if=\"computedMenuActions.length\"\n ref=\"menu\"\n :data=\"computedMenuActions\"\n :menu-position=\"menuPosition\"\n />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoButtonActions, BentoButtonActionsLayout, BentoButtonActionsList } from '@/components/button';\n import { BentoMenuItem } from '@/components/menu/components/menu-item/menu-item.types';\n import { MENU_INVERSE_INJECTION_KEY } from '@/components/menu/menu.keys';\n import BentoMenu from '@/components/menu/menu.vue';\n import { BentoPopoverPositions } from '@/components/popover';\n import { computed, PropType, provide, ref, toRef } from 'vue';\n import { BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY } from './button-actions-with-menu.keys';\n import { useResponsiveActions } from './composables/use-responsive-actions';\n\n /**\n * An internal button actions component with the option to display some of the actions in a menu.\n *\n * @example\n * <button-actions-with-menu\n * :actions=\"[\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\n * :displayedActions=\"2\"\n * />\n */\n const props = 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 * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon` (optional): Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n variant: 'default',\n external: true,\n to: 'https://www.adyen.com/'\n },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: 'primary',\n * critical: true\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n required: true,\n },\n\n /**\n * Defines the layout in which the button actions is presented.\n *\n * @see {@link BentoButtonActionsLayout}\n *\n */\n actionsLayout: {\n type: String as PropType<`${BentoButtonActionsLayout}`>,\n default: BentoButtonActionsLayout.BUTTONS_END,\n },\n\n /**\n * The number of actions to be displayed. The rest of the actions will be collapsed in a menu component.\n */\n disableResponsiveBehavior: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The number of actions to be displayed. The rest of the actions will be collapsed in a menu component.\n */\n displayedActions: {\n type: Number,\n default: undefined,\n },\n\n /**\n * Set inverse color scheme to buttons and menu\n */\n inverse: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The min-width breakpoint to hide the button actions.\n *\n * For example, a value of 200 means that buttons will be hidden at <= 200px.\n *\n * Defaults to 0 i.e. it shows all buttons.\n */\n hideDisplayedActionsBreakpoint: {\n type: Number,\n default: 0,\n },\n\n /**\n * The position of where the menu should open.\n */\n menuPosition: {\n type: String as PropType<BentoPopoverPositions | `${BentoPopoverPositions}`>,\n default: 'bottom-start',\n validator: (value: BentoPopoverPositions) => Object.values(BentoPopoverPositions).includes(value),\n },\n });\n\n const inverseRef = toRef(props, 'inverse');\n const buttonActionsWithMenu = ref<HTMLDivElement>(null);\n const menu = ref(null);\n const stackButtons = ref(false);\n\n const computedActions = computed(() => {\n const displayedActionsLimit = props.hideDisplayedActionsBreakpoint\n ? displayedActionsCount.value\n : props.displayedActions;\n\n return props.actions.slice(0, displayedActionsLimit);\n });\n const computedMenuRef = computed(() => menu?.value?.$el);\n\n const { displayedActionsCount } = useResponsiveActions({\n breakpoint: props.hideDisplayedActionsBreakpoint,\n container: buttonActionsWithMenu,\n defaultActionsCount: props.displayedActions,\n offset: computedMenuRef,\n });\n\n provide(MENU_INVERSE_INJECTION_KEY, inverseRef);\n\n if (!props.disableResponsiveBehavior) {\n provide(BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY, { buttonActionsWithMenu, menu, stackButtons });\n }\n\n const conditionalClasses = computed(() => ({\n [`b-button-actions-with-menu__container-wrapper--buttons-end`]:\n props.actionsLayout === BentoButtonActionsLayout.BUTTONS_END,\n [`b-button-actions-with-menu__container-wrapper--buttons-start`]:\n props.actionsLayout === BentoButtonActionsLayout.BUTTONS_START,\n [`b-button-actions-with-menu__container-wrapper--stacked-buttons`]: stackButtons.value,\n }));\n\n const computedMenuActions = computed(() =>\n displayedActionsCount.value !== undefined && displayedActionsCount.value < props.actions.length\n ? (props.actions.slice(displayedActionsCount.value, props.actions.length).map(el => ({\n text: el.title,\n handler: el.event,\n icon: el.icon,\n critical: el.critical,\n disabled: el.disabled,\n })) as BentoMenuItem[])\n : []\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * An internal button actions component with the option to display some of the actions in a menu.\n *\n * @example\n * <button-actions-with-menu\n * :actions=\"[\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\n * :displayedActions=\"2\"\n * />\n */\n\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./button-actions-with-menu.scss\" />\n"],"names":["useResponsiveActions","props","breakpoint","container","defaultActionsCount","offset","windowWidth","useWindowSize","displayedActionsCount","ref","AVERAGE_BUTTON_WIDTH","showActions","nextTick","availableSpace","totalActionWidth","_a","hideActions","watch","newWidth","containerEl","oldWidth","__default__","inverseRef","toRef","buttonActionsWithMenu","menu","stackButtons","computedActions","computed","displayedActionsLimit","computedMenuRef","provide","MENU_INVERSE_INJECTION_KEY","BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY","conditionalClasses","BentoButtonActionsLayout","computedMenuActions","el"],"mappings":";;;;;;;AAUa,MAAAA,IAAA,CAAAC,MAAA;AACT,QAAA,EAAA,YAAAC,GAAA,WAAAC,GAAA,qBAAAC,GAAA,QAAAC,EAAA,IAAAJ,GAEA,EAAA,OAAAK,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAAL,CAAA,GAEAM,IAAA,KAEAC,IAAA,YAAA;;AACI,UAAAC,EAAA;AAEA,UAAAC,IAAAV,EAAA,MAAA,aACAW,IAAAJ,IAAAF,EAAA,WAAAO,IAAAV,KAAA,gBAAAA,EAAA,UAAA,gBAAAU,EAAA,gBAAA,KAAAL;AAMA,IAAAG,KAAAC,KAAAN,EAAA,QAAAJ,MACII,EAAA,SAAA,GAEAG,EAAA;AAAA,EACJ,GAGJK,IAAA,YAAA;;AACI,UAAAJ,EAAA;AAEA,UAAAC,IAAAV,EAAA,MAAA,aACAW,IAAAJ,IAAAF,EAAA,WAAAO,IAAAV,KAAA,gBAAAA,EAAA,UAAA,gBAAAU,EAAA,gBAAA;AAGA,IAAAF,IAAAC,KAAAN,EAAA,QAAA,MACIA,EAAA,SAAA,GAEAQ,EAAA;AAAA,EACJ;AAGJ,SAAAC,EAAA,CAAAX,GAAAH,CAAA,GAAA,OAAA,CAAAe,GAAAC,CAAA,GAAA,CAAAC,CAAA,MAAA;AACI,QAAA,CAAAD,KAAA,CAAAf,KAAAc,IAAAhB;AACI;AAGJ,UAAAU,EAAA,GAEAM,IAAAE,IAGIT,EAAA,IAEAK,EAAA;AAAA,EACJ,CAAA,GAGJ;AAAA,IAAO,uBAAAR;AAAA,EACH;AAER,GC4JIa,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA1EAC,IAAAC,EAAAtB,GAAA,SAAA,GACAuB,IAAAf,EAAA,IAAA,GACAgB,IAAAhB,EAAA,IAAA,GACAiB,IAAAjB,EAAA,EAAA,GAEAkB,IAAAC,EAAA,MAAA;AACI,YAAAC,IAAA5B,EAAA,iCAAAO,EAAA,QAAAP,EAAA;AAIA,aAAAA,EAAA,QAAA,MAAA,GAAA4B,CAAA;AAAA,IAAmD,CAAA,GAEvDC,IAAAF,EAAA,MAAA;;AAAA,cAAAb,IAAAU,KAAA,gBAAAA,EAAA,UAAA,gBAAAV,EAAA;AAAA,KAAA,GAEA,EAAA,uBAAAP,EAAA,IAAAR,EAAA;AAAA,MAAuD,YAAAC,EAAA;AAAA,MACjC,WAAAuB;AAAA,MACP,qBAAAvB,EAAA;AAAA,MACgB,QAAA6B;AAAA,IACnB,CAAA;AAGZ,IAAAC,EAAAC,GAAAV,CAAA,GAEArB,EAAA,6BACI8B,EAAAE,GAAA,EAAA,uBAAAT,GAAA,MAAAC,GAAA,cAAAC,EAAA,CAAA;AAGJ,UAAAQ,IAAAN,EAAA,OAAA;AAAA,MAA2C,8DAAA3B,EAAA,kBAAAkC,EAAA;AAAA,MAEc,gEAAAlC,EAAA,kBAAAkC,EAAA;AAAA,MAEA,kEAAAT,EAAA;AAAA,IAC4B,EAAA,GAGrFU,IAAAR;AAAA,MAA4B,MAAApB,EAAA,UAAA,UAAAA,EAAA,QAAAP,EAAA,QAAA,SAAAA,EAAA,QAAA,MAAAO,EAAA,OAAAP,EAAA,QAAA,MAAA,EAAA,IAAA,CAAAoC,OAAA;AAAA,QAEiE,MAAAA,EAAA;AAAA,QACtE,SAAAA,EAAA;AAAA,QACG,MAAAA,EAAA;AAAA,QACH,UAAAA,EAAA;AAAA,QACI,UAAAA,EAAA;AAAA,MACA,EAAA,IAAA,CAAA;AAAA,IAEhB;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"button-actions-with-menu.CYkEoiee.js","sources":["../../src/components/internal/button-actions-with-menu/composables/use-responsive-actions.ts","../../src/components/internal/button-actions-with-menu/button-actions-with-menu.vue"],"sourcesContent":["import { useWindowSize } from '@vueuse/core';\nimport { nextTick, Ref, ref, watch } from 'vue';\n\ninterface UseResponsiveActionsProps {\n breakpoint?: number;\n container: Ref<HTMLElement>;\n defaultActionsCount: number;\n offset?: Ref<HTMLElement>;\n}\n\nexport const useResponsiveActions = (props: UseResponsiveActionsProps) => {\n const { breakpoint, container, defaultActionsCount, offset } = props;\n\n const { width: windowWidth } = useWindowSize();\n\n const displayedActionsCount = ref<number>(defaultActionsCount);\n\n const AVERAGE_BUTTON_WIDTH = 150; // button size + gap\n\n const showActions = async () => {\n await nextTick();\n\n const availableSpace = container.value.clientWidth;\n const totalActionWidth =\n AVERAGE_BUTTON_WIDTH * displayedActionsCount.value +\n (offset?.value?.offsetWidth ?? 0) +\n AVERAGE_BUTTON_WIDTH;\n\n // Only add actions if there's enough space and we haven't reached max\n if (availableSpace >= totalActionWidth && displayedActionsCount.value < defaultActionsCount) {\n displayedActionsCount.value += 1;\n\n showActions(); // keep trying to show more\n }\n };\n\n const hideActions = async () => {\n await nextTick();\n\n const availableSpace = container.value.clientWidth;\n const totalActionWidth = AVERAGE_BUTTON_WIDTH * displayedActionsCount.value + (offset?.value?.offsetWidth ?? 0);\n\n // Hide actions if they overflow the container\n if (availableSpace < totalActionWidth && displayedActionsCount.value > 0) {\n displayedActionsCount.value -= 1;\n\n hideActions(); // keep hiding until it fits\n }\n };\n\n watch([windowWidth, container], async ([newWidth, containerEl], [oldWidth]) => {\n if (!containerEl || !defaultActionsCount || newWidth > breakpoint) {\n return;\n }\n\n await nextTick();\n\n const isIncreasing = newWidth > oldWidth;\n\n if (isIncreasing) {\n showActions();\n } else {\n hideActions();\n }\n });\n\n return {\n displayedActionsCount,\n };\n};\n","<template>\n <div class=\"b-button-actions-with-menu\">\n <div\n ref=\"buttonActionsWithMenu\"\n role=\"group\"\n class=\"b-button-actions-with-menu__container-wrapper\"\n :class=\"conditionalClasses\"\n >\n <bento-button-actions :actions=\"computedActions\" :inverse=\"inverse\" :layout=\"actionsLayout\" />\n <bento-menu\n v-if=\"computedMenuActions.length\"\n ref=\"menu\"\n :data=\"computedMenuActions\"\n :menu-position=\"menuPosition\"\n />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoButtonActions, BentoButtonActionsLayout, BentoButtonActionsList } from '@/components/button';\n import { BentoMenuItem } from '@/components/menu/components/menu-item/menu-item.types';\n import { MENU_INVERSE_INJECTION_KEY } from '@/components/menu/menu.keys';\n import BentoMenu from '@/components/menu/menu.vue';\n import { BentoPopoverPositions } from '@/components/popover';\n import { computed, PropType, provide, ref, toRef } from 'vue';\n import { BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY } from './button-actions-with-menu.keys';\n import { useResponsiveActions } from './composables/use-responsive-actions';\n\n /**\n * An internal button actions component with the option to display some of the actions in a menu.\n *\n * @example\n * <button-actions-with-menu\n * :actions=\"[\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\n * :displayedActions=\"2\"\n * />\n */\n const props = 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 * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon` (optional): Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n variant: 'default',\n external: true,\n to: 'https://www.adyen.com/'\n },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: 'primary',\n * critical: true\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n required: true,\n },\n\n /**\n * Defines the layout in which the button actions is presented.\n *\n * @see {@link BentoButtonActionsLayout}\n *\n */\n actionsLayout: {\n type: String as PropType<`${BentoButtonActionsLayout}`>,\n default: BentoButtonActionsLayout.BUTTONS_END,\n },\n\n /**\n * The number of actions to be displayed. The rest of the actions will be collapsed in a menu component.\n */\n disableResponsiveBehavior: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The number of actions to be displayed. The rest of the actions will be collapsed in a menu component.\n */\n displayedActions: {\n type: Number,\n default: undefined,\n },\n\n /**\n * Set inverse color scheme to buttons and menu\n */\n inverse: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The min-width breakpoint to hide the button actions.\n *\n * For example, a value of 200 means that buttons will be hidden at <= 200px.\n *\n * Defaults to 0 i.e. it shows all buttons.\n */\n hideDisplayedActionsBreakpoint: {\n type: Number,\n default: 0,\n },\n\n /**\n * The position of where the menu should open.\n */\n menuPosition: {\n type: String as PropType<BentoPopoverPositions | `${BentoPopoverPositions}`>,\n default: 'bottom-start',\n validator: (value: BentoPopoverPositions) => Object.values(BentoPopoverPositions).includes(value),\n },\n });\n\n const inverseRef = toRef(props, 'inverse');\n const buttonActionsWithMenu = ref<HTMLDivElement>(null);\n const menu = ref(null);\n const stackButtons = ref(false);\n\n const computedActions = computed(() => {\n const displayedActionsLimit = props.hideDisplayedActionsBreakpoint\n ? displayedActionsCount.value\n : props.displayedActions;\n\n return props.actions.slice(0, displayedActionsLimit);\n });\n const computedMenuRef = computed(() => menu?.value?.$el);\n\n const { displayedActionsCount } = useResponsiveActions({\n breakpoint: props.hideDisplayedActionsBreakpoint,\n container: buttonActionsWithMenu,\n defaultActionsCount: props.displayedActions,\n offset: computedMenuRef,\n });\n\n provide(MENU_INVERSE_INJECTION_KEY, inverseRef);\n\n if (!props.disableResponsiveBehavior) {\n provide(BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY, { buttonActionsWithMenu, menu, stackButtons });\n }\n\n const conditionalClasses = computed(() => ({\n [`b-button-actions-with-menu__container-wrapper--buttons-end`]:\n props.actionsLayout === BentoButtonActionsLayout.BUTTONS_END,\n [`b-button-actions-with-menu__container-wrapper--buttons-start`]:\n props.actionsLayout === BentoButtonActionsLayout.BUTTONS_START,\n [`b-button-actions-with-menu__container-wrapper--stacked-buttons`]: stackButtons.value,\n }));\n\n const computedMenuActions = computed(() =>\n displayedActionsCount.value !== undefined && displayedActionsCount.value < props.actions.length\n ? (props.actions.slice(displayedActionsCount.value, props.actions.length).map(el => ({\n text: el.title,\n handler: el.event,\n icon: el.icon,\n critical: el.critical,\n disabled: el.disabled,\n })) as BentoMenuItem[])\n : []\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * An internal button actions component with the option to display some of the actions in a menu.\n *\n * @example\n * <button-actions-with-menu\n * :actions=\"[\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\n * :displayedActions=\"2\"\n * />\n */\n\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./button-actions-with-menu.scss\" />\n"],"names":["useResponsiveActions","props","breakpoint","container","defaultActionsCount","offset","windowWidth","useWindowSize","displayedActionsCount","ref","AVERAGE_BUTTON_WIDTH","showActions","nextTick","availableSpace","totalActionWidth","_a","hideActions","watch","newWidth","containerEl","oldWidth","__default__","inverseRef","toRef","buttonActionsWithMenu","menu","stackButtons","computedActions","computed","displayedActionsLimit","computedMenuRef","provide","MENU_INVERSE_INJECTION_KEY","BUTTON_ACTIONS_WITH_MENU_CONTAINER_INJECTION_KEY","conditionalClasses","BentoButtonActionsLayout","computedMenuActions","el"],"mappings":";;;;;;;AAUa,MAAAA,IAAA,CAAAC,MAAA;AACT,QAAA,EAAA,YAAAC,GAAA,WAAAC,GAAA,qBAAAC,GAAA,QAAAC,EAAA,IAAAJ,GAEA,EAAA,OAAAK,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAAL,CAAA,GAEAM,IAAA,KAEAC,IAAA,YAAA;;AACI,UAAAC,EAAA;AAEA,UAAAC,IAAAV,EAAA,MAAA,aACAW,IAAAJ,IAAAF,EAAA,WAAAO,IAAAV,KAAA,gBAAAA,EAAA,UAAA,gBAAAU,EAAA,gBAAA,KAAAL;AAMA,IAAAG,KAAAC,KAAAN,EAAA,QAAAJ,MACII,EAAA,SAAA,GAEAG,EAAA;AAAA,EACJ,GAGJK,IAAA,YAAA;;AACI,UAAAJ,EAAA;AAEA,UAAAC,IAAAV,EAAA,MAAA,aACAW,IAAAJ,IAAAF,EAAA,WAAAO,IAAAV,KAAA,gBAAAA,EAAA,UAAA,gBAAAU,EAAA,gBAAA;AAGA,IAAAF,IAAAC,KAAAN,EAAA,QAAA,MACIA,EAAA,SAAA,GAEAQ,EAAA;AAAA,EACJ;AAGJ,SAAAC,EAAA,CAAAX,GAAAH,CAAA,GAAA,OAAA,CAAAe,GAAAC,CAAA,GAAA,CAAAC,CAAA,MAAA;AACI,QAAA,CAAAD,KAAA,CAAAf,KAAAc,IAAAhB;AACI;AAGJ,UAAAU,EAAA,GAEAM,IAAAE,IAGIT,EAAA,IAEAK,EAAA;AAAA,EACJ,CAAA,GAGJ;AAAA,IAAO,uBAAAR;AAAA,EACH;AAER,GC4JIa,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA1EAC,IAAAC,EAAAtB,GAAA,SAAA,GACAuB,IAAAf,EAAA,IAAA,GACAgB,IAAAhB,EAAA,IAAA,GACAiB,IAAAjB,EAAA,EAAA,GAEAkB,IAAAC,EAAA,MAAA;AACI,YAAAC,IAAA5B,EAAA,iCAAAO,EAAA,QAAAP,EAAA;AAIA,aAAAA,EAAA,QAAA,MAAA,GAAA4B,CAAA;AAAA,IAAmD,CAAA,GAEvDC,IAAAF,EAAA,MAAA;;AAAA,cAAAb,IAAAU,KAAA,gBAAAA,EAAA,UAAA,gBAAAV,EAAA;AAAA,KAAA,GAEA,EAAA,uBAAAP,EAAA,IAAAR,EAAA;AAAA,MAAuD,YAAAC,EAAA;AAAA,MACjC,WAAAuB;AAAA,MACP,qBAAAvB,EAAA;AAAA,MACgB,QAAA6B;AAAA,IACnB,CAAA;AAGZ,IAAAC,EAAAC,GAAAV,CAAA,GAEArB,EAAA,6BACI8B,EAAAE,GAAA,EAAA,uBAAAT,GAAA,MAAAC,GAAA,cAAAC,EAAA,CAAA;AAGJ,UAAAQ,IAAAN,EAAA,OAAA;AAAA,MAA2C,8DAAA3B,EAAA,kBAAAkC,EAAA;AAAA,MAEc,gEAAAlC,EAAA,kBAAAkC,EAAA;AAAA,MAEA,kEAAAT,EAAA;AAAA,IAC4B,EAAA,GAGrFU,IAAAR;AAAA,MAA4B,MAAApB,EAAA,UAAA,UAAAA,EAAA,QAAAP,EAAA,QAAA,SAAAA,EAAA,QAAA,MAAAO,EAAA,OAAAP,EAAA,QAAA,MAAA,EAAA,IAAA,CAAAoC,OAAA;AAAA,QAEiE,MAAAA,EAAA;AAAA,QACtE,SAAAA,EAAA;AAAA,QACG,MAAAA,EAAA;AAAA,QACH,UAAAA,EAAA;AAAA,QACI,UAAAA,EAAA;AAAA,MACA,EAAA,IAAA,CAAA;AAAA,IAEhB;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as v, useSlots as C, ref as _, computed as n, watch as m, onUnmounted as $, onMounted as I } from "vue";
2
- import { B as y } from "./header.DNzQO7u-.js";
2
+ import { B as y } from "./header.Cb644uAi.js";
3
3
  import { a as R, B as x } from "./tabs.Dx6teJGW.js";
4
4
  import { c as H } from "./index.BdrLbvtJ.js";
5
5
  import { o as P } from "./resize.Bqks3WUm.js";
@@ -99,4 +99,4 @@ export {
99
99
  tt as a,
100
100
  Z as d
101
101
  };
102
- //# sourceMappingURL=dashboard-section.CspNW0CA.js.map
102
+ //# sourceMappingURL=dashboard-section.Bz54Z6Hh.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard-section.CspNW0CA.js","sources":["../../src/templates/dashboard-template/dashboard-template.vue","../../src/templates/dashboard-template/components/dashboard-section/dashboard-section.vue"],"sourcesContent":["<template>\n <main class=\"b-dashboard-template\">\n <bento-header v-bind=\"header\" variant=\"page\" class=\"b-dashboard-template__header\">\n <template v-if=\"hasSlot('infoIconTooltipContent')\" #infoIconTooltipContent>\n <slot name=\"infoIconTooltipContent\" />\n </template>\n </bento-header>\n <div class=\"b-dashboard-template__top-section\" :class=\"dashboardTopSectionConditionalClasses\">\n <div\n v-if=\"hasSlot('filters')\"\n ref=\"filtersRef\"\n class=\"b-dashboard-template__filters\"\n :class=\"dashboardFiltersConditionalClasses\"\n data-testid=\"filters\"\n >\n <slot name=\"filters\" />\n </div>\n\n <bento-tabs\n v-if=\"tabsSlots.length > 1\"\n ref=\"tabsRef\"\n :active-tab-index=\"tabs.activeTabIndex\"\n :sticky=\"stickyTabs\"\n :sticky-options=\"computedTabsOptions\"\n data-testid=\"tabs\"\n >\n <bento-tab v-for=\"(_item, index) in tabsSlots\" :key=\"`tab-${index}`\" :title=\"getTabTitle(index)\">\n <div class=\"b-dashboard-template__container b-dashboard-template__container--tabs\">\n <slot :name=\"`tab-${index + 1}`\" />\n </div>\n </bento-tab>\n </bento-tabs>\n <div v-else class=\"b-dashboard-template__container\">\n <slot />\n </div>\n </div>\n </main>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onUnmounted, ref, useSlots, watch } from 'vue';\n import { BentoHeader } from '@/components/header';\n import { BentoTab, BentoTabs } from '@/components/tabs';\n import { useWindowScroll } from '@vueuse/core';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { useHasSlot } from '@/composables';\n import type { BentoDashboardTemplateHeader, BentoDashboardTemplateTabs } from './dashboard-template.types';\n\n const props = defineProps({\n header: null,\n tabs: { default: undefined },\n stickyTabs: { type: Boolean, default: false },\n stickyFilters: { type: Boolean, default: false }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const tabsRef = ref<InstanceType<typeof BentoTabs>>();\n const filtersRef = ref<HTMLDivElement>(null);\n const isFiltersPinned = ref(false);\n let filtersElementObserver: ResizeObserver | null = null;\n const tabsPosition = ref(0);\n\n const hasStickyFilters = computed(() => filtersRef.value && props.stickyFilters);\n const hasStickyTabs = computed(() => tabsRef.value && props.stickyTabs);\n\n const dashboardFiltersConditionalClasses = computed(() => ({\n 'b-dashboard-template__filters--sticky': props.stickyFilters,\n 'b-dashboard-template__filters--show-border':\n hasStickyFilters.value && !hasStickyTabs.value && isFiltersPinned.value,\n }));\n\n const dashboardTopSectionConditionalClasses = computed(() => ({\n 'b-dashboard-template__top-section--sticky': props.stickyTabs || props.stickyFilters,\n }));\n\n const tabsSlots = computed(() => Object.keys(slots).filter(el => el?.includes('tab-')));\n\n const getTabTitle = (index: number) => props?.tabs.tabs?.[index]?.title ?? `Tab ${index + 1}`;\n\n const computedTabsOptions = computed(() => (tabsPosition.value ? { top: tabsPosition.value } : undefined));\n\n const { y } = useWindowScroll();\n\n watch(\n () => filtersRef.value,\n () => {\n if (!filtersElementObserver && filtersRef.value) {\n filtersElementObserver = observeSizeOfElement(filtersRef.value, () => {\n if (filtersRef.value && hasStickyTabs.value) {\n const filtersHeight = filtersRef.value.offsetHeight;\n tabsPosition.value = hasStickyFilters.value ? filtersHeight : 0;\n }\n });\n }\n }\n );\n\n watch(\n () => y.value,\n () => {\n if (hasStickyFilters.value) {\n isFiltersPinned.value = filtersRef.value?.getBoundingClientRect().top === 0;\n }\n }\n );\n\n onUnmounted(() => {\n filtersElementObserver?.disconnect();\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Dashboard template is a full page template used to visualize data on pages such as data dashboards and reports.\n *\n * @example\n * import { BentoDashboardTemplate, BentoDashboardSection } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDashboardTemplate, BentoDashboardSection },\n * template: `\n * <bento-dashboard-template :header=\"{ title: 'Dashboard'}\" :tabs=\"tabs: [{ title: 'Tab 1' }, { title: 'Tab 2' }]\" sticky-tabs sticky-filters>\n * <template #tab-1>\n * <bento-dashboard-section :header=\"{ title: 'Section'}\">\n * <template #controls>\n * // Add your controls here\n * </template>\n * // Add your content here\n * </bento-dashboard-section>\n * </template>\n * <template #tab-2>\n * <bento-dashboard-section :header=\"{ title: 'Section'}\">\n * // Add your content here\n * </bento-dashboard-section>\n * </template>\n * </bento-dashboard-template>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./dashboard-template.scss\" />\n","<template>\n <div class=\"b-dashboard-section\" :class=\"conditionalClasses\">\n <bento-header v-bind=\"header\" variant=\"component\" class=\"b-dashboard-template__header\">\n <template v-if=\"hasSlot('infoIconTooltipContent')\" #infoIconTooltipContent>\n <slot name=\"infoIconTooltipContent\" />\n </template>\n </bento-header>\n <div v-if=\"hasSlot('controls')\" class=\"b-dashboard-section__controls\">\n <slot name=\"controls\"></slot>\n </div>\n <div v-if=\"!hasSlot('content-col-1') && !hasSlot('content-col-2')\" class=\"b-dashboard-section__content\">\n <slot name=\"default\"></slot>\n </div>\n <div v-else class=\"b-dashboard-section__columns\">\n <div class=\"b-dashboard-section__content\"><slot name=\"content-col-1\"></slot></div>\n <div class=\"b-dashboard-section__content\"><slot name=\"content-col-2\"></slot></div>\n </div>\n <bento-divider class=\"b-dashboard-section__divider\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, useSlots } from 'vue';\n import { BentoHeader } from '@/components/header';\n import { BentoDivider } from '@/components/divider';\n import { useHasSlot } from '@/composables';\n import type { BentoDashboardTemplateHeader } from '../../dashboard-template.types';\n\n const props = defineProps({\n header: null,\n halfWidth: { type: Boolean, default: false }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const conditionalClasses = computed(() => ({\n 'b-dashboard-section--half-width': props.halfWidth,\n }));\n\n onMounted(() => {\n if ((hasSlot('content-col-1') || hasSlot('content-col-2')) && props.halfWidth) {\n throw new Error('`content-col-1` and `content-col-2` cannot be used with half-width prop');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Dashboard section is subcomponent of Dashboard template meant to be used to create the different sections within the page.\n *\n * @example\n * import { BentoDashboardSection } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDashboardSection },\n * template: `\n * <bento-dashboard-section :header=\"{ title: 'Section' }\" half-width>\n * <template #controls>\n * // Add your controls here\n * </template>\n * // You can render content with two cols\n * <template #content-col-1>\n * // Add your content here\n * </template>\n * <template #content-col-2>\n * // Add your content here\n * </template>\n * // Or you can render full width content by using default slot\n * // Add your content here\n * </bento-dashboard-section>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./dashboard-section.scss\" />\n"],"names":["__default__$1","slots","useSlots","hasSlot","useHasSlot","tabsRef","ref","filtersRef","isFiltersPinned","filtersElementObserver","tabsPosition","hasStickyFilters","computed","props","hasStickyTabs","dashboardFiltersConditionalClasses","dashboardTopSectionConditionalClasses","tabsSlots","el","getTabTitle","index","_b","_a","computedTabsOptions","y","useWindowScroll","watch","observeSizeOfElement","filtersHeight","onUnmounted","__default__","conditionalClasses","onMounted"],"mappings":";;;;;;;;;AA6II,MAAAA,IAAA,CAAA;;;;;;;;;;iBAtFAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAA,GACAC,IAAAD,EAAA,IAAA,GACAE,IAAAF,EAAA,EAAA;AACA,QAAAG,IAAA;AACA,UAAAC,IAAAJ,EAAA,CAAA,GAEAK,IAAAC,EAAA,MAAAL,EAAA,SAAAM,EAAA,aAAA,GACAC,IAAAF,EAAA,MAAAP,EAAA,SAAAQ,EAAA,UAAA,GAEAE,IAAAH,EAAA,OAAA;AAAA,MAA2D,yCAAAC,EAAA;AAAA,MACR,8CAAAF,EAAA,SAAA,CAAAG,EAAA,SAAAN,EAAA;AAAA,IAEuB,EAAA,GAG1EQ,IAAAJ,EAAA,OAAA;AAAA,MAA8D,6CAAAC,EAAA,cAAAA,EAAA;AAAA,IACa,EAAA,GAG3EI,IAAAL,EAAA,MAAA,OAAA,KAAAX,CAAA,EAAA,OAAA,CAAAiB,MAAAA,KAAA,gBAAAA,EAAA,SAAA,OAAA,CAAA,GAEAC,IAAA,CAAAC,MAAA;;AAAA,eAAAC,KAAAC,IAAAT,KAAA,gBAAAA,EAAA,KAAA,SAAA,gBAAAS,EAAAF,OAAA,gBAAAC,EAAA,UAAA,OAAAD,IAAA,CAAA;AAAA,OAEAG,IAAAX,EAAA,MAAAF,EAAA,QAAA,EAAA,KAAAA,EAAA,MAAA,IAAA,MAAA,GAEA,EAAA,GAAAc,EAAA,IAAAC,EAAA;AAEA,WAAAC;AAAA,MAAA,MAAAnB,EAAA;AAAA,MACqB,MAAA;AAEb,QAAA,CAAAE,KAAAF,EAAA,UACIE,IAAAkB,EAAApB,EAAA,OAAA,MAAA;AACI,cAAAA,EAAA,SAAAO,EAAA,OAAA;AACI,kBAAAc,IAAArB,EAAA,MAAA;AACA,YAAAG,EAAA,QAAAC,EAAA,QAAAiB,IAAA;AAAA,UAA8D;AAAA,QAClE,CAAA;AAAA,MAER;AAAA,IACJ,GAGJF;AAAA,MAAA,MAAAF,EAAA;AAAA,MACY,MAAA;;AAEJ,QAAAb,EAAA,UACIH,EAAA,UAAAc,IAAAf,EAAA,UAAA,gBAAAe,EAAA,wBAAA,SAAA;AAAA,MACJ;AAAA,IACJ,GAGJO,EAAA,MAAA;AACI,MAAApB,KAAA,QAAAA,EAAA;AAAA,IAAmC,CAAA;;;;;;;;;;;;;;;;;;qBCnCvCqB,IAAA,CAAA;;;;;;;;iBAzCA7B,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEA8B,IAAAnB,EAAA,OAAA;AAAA,MAA2C,mCAAAC,EAAA;AAAA,IACE,EAAA;AAG7C,WAAAmB,EAAA,MAAA;AACI,WAAA7B,EAAA,eAAA,KAAAA,EAAA,eAAA,MAAAU,EAAA;AACI,cAAA,IAAA,MAAA,yEAAA;AAAA,IACJ,CAAA;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"dashboard-section.Bz54Z6Hh.js","sources":["../../src/templates/dashboard-template/dashboard-template.vue","../../src/templates/dashboard-template/components/dashboard-section/dashboard-section.vue"],"sourcesContent":["<template>\n <main class=\"b-dashboard-template\">\n <bento-header v-bind=\"header\" variant=\"page\" class=\"b-dashboard-template__header\">\n <template v-if=\"hasSlot('infoIconTooltipContent')\" #infoIconTooltipContent>\n <slot name=\"infoIconTooltipContent\" />\n </template>\n </bento-header>\n <div class=\"b-dashboard-template__top-section\" :class=\"dashboardTopSectionConditionalClasses\">\n <div\n v-if=\"hasSlot('filters')\"\n ref=\"filtersRef\"\n class=\"b-dashboard-template__filters\"\n :class=\"dashboardFiltersConditionalClasses\"\n data-testid=\"filters\"\n >\n <slot name=\"filters\" />\n </div>\n\n <bento-tabs\n v-if=\"tabsSlots.length > 1\"\n ref=\"tabsRef\"\n :active-tab-index=\"tabs.activeTabIndex\"\n :sticky=\"stickyTabs\"\n :sticky-options=\"computedTabsOptions\"\n data-testid=\"tabs\"\n >\n <bento-tab v-for=\"(_item, index) in tabsSlots\" :key=\"`tab-${index}`\" :title=\"getTabTitle(index)\">\n <div class=\"b-dashboard-template__container b-dashboard-template__container--tabs\">\n <slot :name=\"`tab-${index + 1}`\" />\n </div>\n </bento-tab>\n </bento-tabs>\n <div v-else class=\"b-dashboard-template__container\">\n <slot />\n </div>\n </div>\n </main>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onUnmounted, ref, useSlots, watch } from 'vue';\n import { BentoHeader } from '@/components/header';\n import { BentoTab, BentoTabs } from '@/components/tabs';\n import { useWindowScroll } from '@vueuse/core';\n import { observeSizeOfElement } from '@/utils/ts/resize';\n import { useHasSlot } from '@/composables';\n import type { BentoDashboardTemplateHeader, BentoDashboardTemplateTabs } from './dashboard-template.types';\n\n const props = defineProps({\n header: null,\n tabs: { default: undefined },\n stickyTabs: { type: Boolean, default: false },\n stickyFilters: { type: Boolean, default: false }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const tabsRef = ref<InstanceType<typeof BentoTabs>>();\n const filtersRef = ref<HTMLDivElement>(null);\n const isFiltersPinned = ref(false);\n let filtersElementObserver: ResizeObserver | null = null;\n const tabsPosition = ref(0);\n\n const hasStickyFilters = computed(() => filtersRef.value && props.stickyFilters);\n const hasStickyTabs = computed(() => tabsRef.value && props.stickyTabs);\n\n const dashboardFiltersConditionalClasses = computed(() => ({\n 'b-dashboard-template__filters--sticky': props.stickyFilters,\n 'b-dashboard-template__filters--show-border':\n hasStickyFilters.value && !hasStickyTabs.value && isFiltersPinned.value,\n }));\n\n const dashboardTopSectionConditionalClasses = computed(() => ({\n 'b-dashboard-template__top-section--sticky': props.stickyTabs || props.stickyFilters,\n }));\n\n const tabsSlots = computed(() => Object.keys(slots).filter(el => el?.includes('tab-')));\n\n const getTabTitle = (index: number) => props?.tabs.tabs?.[index]?.title ?? `Tab ${index + 1}`;\n\n const computedTabsOptions = computed(() => (tabsPosition.value ? { top: tabsPosition.value } : undefined));\n\n const { y } = useWindowScroll();\n\n watch(\n () => filtersRef.value,\n () => {\n if (!filtersElementObserver && filtersRef.value) {\n filtersElementObserver = observeSizeOfElement(filtersRef.value, () => {\n if (filtersRef.value && hasStickyTabs.value) {\n const filtersHeight = filtersRef.value.offsetHeight;\n tabsPosition.value = hasStickyFilters.value ? filtersHeight : 0;\n }\n });\n }\n }\n );\n\n watch(\n () => y.value,\n () => {\n if (hasStickyFilters.value) {\n isFiltersPinned.value = filtersRef.value?.getBoundingClientRect().top === 0;\n }\n }\n );\n\n onUnmounted(() => {\n filtersElementObserver?.disconnect();\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Dashboard template is a full page template used to visualize data on pages such as data dashboards and reports.\n *\n * @example\n * import { BentoDashboardTemplate, BentoDashboardSection } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDashboardTemplate, BentoDashboardSection },\n * template: `\n * <bento-dashboard-template :header=\"{ title: 'Dashboard'}\" :tabs=\"tabs: [{ title: 'Tab 1' }, { title: 'Tab 2' }]\" sticky-tabs sticky-filters>\n * <template #tab-1>\n * <bento-dashboard-section :header=\"{ title: 'Section'}\">\n * <template #controls>\n * // Add your controls here\n * </template>\n * // Add your content here\n * </bento-dashboard-section>\n * </template>\n * <template #tab-2>\n * <bento-dashboard-section :header=\"{ title: 'Section'}\">\n * // Add your content here\n * </bento-dashboard-section>\n * </template>\n * </bento-dashboard-template>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./dashboard-template.scss\" />\n","<template>\n <div class=\"b-dashboard-section\" :class=\"conditionalClasses\">\n <bento-header v-bind=\"header\" variant=\"component\" class=\"b-dashboard-template__header\">\n <template v-if=\"hasSlot('infoIconTooltipContent')\" #infoIconTooltipContent>\n <slot name=\"infoIconTooltipContent\" />\n </template>\n </bento-header>\n <div v-if=\"hasSlot('controls')\" class=\"b-dashboard-section__controls\">\n <slot name=\"controls\"></slot>\n </div>\n <div v-if=\"!hasSlot('content-col-1') && !hasSlot('content-col-2')\" class=\"b-dashboard-section__content\">\n <slot name=\"default\"></slot>\n </div>\n <div v-else class=\"b-dashboard-section__columns\">\n <div class=\"b-dashboard-section__content\"><slot name=\"content-col-1\"></slot></div>\n <div class=\"b-dashboard-section__content\"><slot name=\"content-col-2\"></slot></div>\n </div>\n <bento-divider class=\"b-dashboard-section__divider\" />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, useSlots } from 'vue';\n import { BentoHeader } from '@/components/header';\n import { BentoDivider } from '@/components/divider';\n import { useHasSlot } from '@/composables';\n import type { BentoDashboardTemplateHeader } from '../../dashboard-template.types';\n\n const props = defineProps({\n header: null,\n halfWidth: { type: Boolean, default: false }\n});\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const conditionalClasses = computed(() => ({\n 'b-dashboard-section--half-width': props.halfWidth,\n }));\n\n onMounted(() => {\n if ((hasSlot('content-col-1') || hasSlot('content-col-2')) && props.halfWidth) {\n throw new Error('`content-col-1` and `content-col-2` cannot be used with half-width prop');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Dashboard section is subcomponent of Dashboard template meant to be used to create the different sections within the page.\n *\n * @example\n * import { BentoDashboardSection } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDashboardSection },\n * template: `\n * <bento-dashboard-section :header=\"{ title: 'Section' }\" half-width>\n * <template #controls>\n * // Add your controls here\n * </template>\n * // You can render content with two cols\n * <template #content-col-1>\n * // Add your content here\n * </template>\n * <template #content-col-2>\n * // Add your content here\n * </template>\n * // Or you can render full width content by using default slot\n * // Add your content here\n * </bento-dashboard-section>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./dashboard-section.scss\" />\n"],"names":["__default__$1","slots","useSlots","hasSlot","useHasSlot","tabsRef","ref","filtersRef","isFiltersPinned","filtersElementObserver","tabsPosition","hasStickyFilters","computed","props","hasStickyTabs","dashboardFiltersConditionalClasses","dashboardTopSectionConditionalClasses","tabsSlots","el","getTabTitle","index","_b","_a","computedTabsOptions","y","useWindowScroll","watch","observeSizeOfElement","filtersHeight","onUnmounted","__default__","conditionalClasses","onMounted"],"mappings":";;;;;;;;;AA6II,MAAAA,IAAA,CAAA;;;;;;;;;;iBAtFAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAA,GACAC,IAAAD,EAAA,IAAA,GACAE,IAAAF,EAAA,EAAA;AACA,QAAAG,IAAA;AACA,UAAAC,IAAAJ,EAAA,CAAA,GAEAK,IAAAC,EAAA,MAAAL,EAAA,SAAAM,EAAA,aAAA,GACAC,IAAAF,EAAA,MAAAP,EAAA,SAAAQ,EAAA,UAAA,GAEAE,IAAAH,EAAA,OAAA;AAAA,MAA2D,yCAAAC,EAAA;AAAA,MACR,8CAAAF,EAAA,SAAA,CAAAG,EAAA,SAAAN,EAAA;AAAA,IAEuB,EAAA,GAG1EQ,IAAAJ,EAAA,OAAA;AAAA,MAA8D,6CAAAC,EAAA,cAAAA,EAAA;AAAA,IACa,EAAA,GAG3EI,IAAAL,EAAA,MAAA,OAAA,KAAAX,CAAA,EAAA,OAAA,CAAAiB,MAAAA,KAAA,gBAAAA,EAAA,SAAA,OAAA,CAAA,GAEAC,IAAA,CAAAC,MAAA;;AAAA,eAAAC,KAAAC,IAAAT,KAAA,gBAAAA,EAAA,KAAA,SAAA,gBAAAS,EAAAF,OAAA,gBAAAC,EAAA,UAAA,OAAAD,IAAA,CAAA;AAAA,OAEAG,IAAAX,EAAA,MAAAF,EAAA,QAAA,EAAA,KAAAA,EAAA,MAAA,IAAA,MAAA,GAEA,EAAA,GAAAc,EAAA,IAAAC,EAAA;AAEA,WAAAC;AAAA,MAAA,MAAAnB,EAAA;AAAA,MACqB,MAAA;AAEb,QAAA,CAAAE,KAAAF,EAAA,UACIE,IAAAkB,EAAApB,EAAA,OAAA,MAAA;AACI,cAAAA,EAAA,SAAAO,EAAA,OAAA;AACI,kBAAAc,IAAArB,EAAA,MAAA;AACA,YAAAG,EAAA,QAAAC,EAAA,QAAAiB,IAAA;AAAA,UAA8D;AAAA,QAClE,CAAA;AAAA,MAER;AAAA,IACJ,GAGJF;AAAA,MAAA,MAAAF,EAAA;AAAA,MACY,MAAA;;AAEJ,QAAAb,EAAA,UACIH,EAAA,UAAAc,IAAAf,EAAA,UAAA,gBAAAe,EAAA,wBAAA,SAAA;AAAA,MACJ;AAAA,IACJ,GAGJO,EAAA,MAAA;AACI,MAAApB,KAAA,QAAAA,EAAA;AAAA,IAAmC,CAAA;;;;;;;;;;;;;;;;;;qBCnCvCqB,IAAA,CAAA;;;;;;;;iBAzCA7B,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEA8B,IAAAnB,EAAA,OAAA;AAAA,MAA2C,mCAAAC,EAAA;AAAA,IACE,EAAA;AAG7C,WAAAmB,EAAA,MAAA;AACI,WAAA7B,EAAA,eAAA,KAAAA,EAAA,eAAA,MAAAU,EAAA;AACI,cAAA,IAAA,MAAA,yEAAA;AAAA,IACJ,CAAA;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as R, useSlots as S, ref as d, computed as i, provide as I, toRef as b } from "vue";
2
- import { B } from "./header.DNzQO7u-.js";
2
+ import { B } from "./header.Cb644uAi.js";
3
3
  import { B as h } from "./inspector.BI28vKQz.js";
4
4
  import { a as x, B as A } from "./tabs.Dx6teJGW.js";
5
5
  import { u as E } from "./use-has-slot.C9lQZ6nz.js";
@@ -106,4 +106,4 @@ const Y = $.exports;
106
106
  export {
107
107
  Y as d
108
108
  };
109
- //# sourceMappingURL=data-grid-template.BhzgqkZp.js.map
109
+ //# sourceMappingURL=data-grid-template.DtFRjaR8.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-grid-template.BhzgqkZp.js","sources":["../../src/templates/data-grid-template/data-grid-template.vue"],"sourcesContent":["<template>\n <main class=\"b-data-grid-template\">\n <bento-inspector v-bind=\"computedInspectorProps\" ref=\"inspectorRef\" v-on=\"inspectorEvents\">\n <template #page>\n <bento-header v-bind=\"header\" variant=\"component\" class=\"b-data-grid-template__header\">\n <template v-if=\"hasSlot('infoIconTooltipContent')\" #infoIconTooltipContent>\n <slot name=\"infoIconTooltipContent\" />\n </template>\n </bento-header>\n\n <div\n v-if=\"hasSlot('additionalContent')\"\n ref=\"additionalContentRef\"\n class=\"b-data-grid-template__additional-content\"\n :class=\"additionalContentConditionalClasses\"\n >\n <slot name=\"additionalContent\" />\n </div>\n\n <bento-tabs\n v-if=\"tabsSlots.length > 1\"\n ref=\"tabsRef\"\n :active-tab-index=\"tabs.activeTabIndex\"\n :sticky=\"stickyTabs\"\n :sticky-options=\"stickyAdditionalContent ? { top: computedStickyAdditionalContentHeight } : null\"\n @update:active-tab-index=\"emitTabs\"\n >\n <bento-tab v-for=\"(_item, index) in tabsSlots\" :key=\"`tab-${index}`\" :title=\"getTabTitle(index)\">\n <slot :name=\"`tab-${index + 1}`\" />\n </bento-tab>\n </bento-tabs>\n\n <slot v-else />\n </template>\n\n <template #content>\n <slot name=\"inspector-content\" />\n </template>\n </bento-inspector>\n </main>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoHeader } from '@/components/header';\n import { BentoInspector } from '@/components/inspector';\n import { BentoTab, BentoTabs } from '@/components/tabs';\n import { useHasSlot } from '@/composables';\n import { computed, PropType, provide, Ref, ref, toRef, UnwrapRef, useSlots } from 'vue';\n import { DATA_GRID_REGISTER_TEMPLATE_INJECTION_KEY } from './data-grid-template.keys';\n import type {\n BentoDataGridTemplateDataGrid,\n BentoDataGridTemplateHeader,\n BentoDataGridTemplateInspector,\n BentoDataGridTemplateTabs,\n } from './data-grid-template.types';\n\n const props = defineProps({\n /**\n * The header that goes to the top of the template\n */\n header: {\n type: Object as PropType<BentoDataGridTemplateHeader>,\n required: true,\n },\n\n /**\n * All the tab properties that can be set on the inner tab components.\n * - tabs.activeTabIndex: the currenly active tab index.\n * - tabs.tabs: an array of BentoTab props, the first item in the array will affect the `tab-1` slot and so on.\n */\n tabs: {\n type: Object as PropType<BentoDataGridTemplateTabs>,\n default: undefined,\n },\n\n /**\n * Renders the additional content slot with a sticky positioning\n */\n stickyAdditionalContent: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Renders the tabs with a sticky positioning\n */\n stickyTabs: {\n type: Boolean,\n default: false,\n },\n\n /**\n * All the inspector properties that can be set on the inner inspector component.\n */\n inspector: {\n type: Object as PropType<BentoDataGridTemplateInspector>,\n default: undefined,\n },\n });\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const emit = defineEmits([\"update:tabs\", \"update:is-open:inspector\", \"update:active-page:inspector\", \"expand:inspector\"]);\n\n const tabsRef = ref(null);\n const additionalContentRef = ref(null);\n const inspectorRef = ref(null);\n\n const additionalContentConditionalClasses = computed(() => ({\n 'b-data-grid-template__additional-content--sticky': props.stickyAdditionalContent,\n }));\n\n const computedInspectorProps = computed(() => ({\n title: '',\n ...props.inspector,\n }));\n\n const computedStickyAdditionalContentHeight = computed(() => additionalContentRef?.value?.offsetHeight);\n\n const computedTabsRef = computed(() => tabsRef.value?.$refs?.tablistwrapper);\n\n const tabsSlots = computed(() => Object.keys(slots).filter(el => el?.includes('tab-')));\n\n const inspectorEvents = computed(() => ({\n 'update:is-open': (value: boolean) => emit('update:is-open:inspector', value),\n 'update:active-page': (value: string) => emit('update:active-page:inspector', value),\n expand: (value: boolean) => emit('expand:inspector', value),\n }));\n\n const emitTabs = (newActiveTabIndex: number) => {\n emit('update:tabs', { ...props.tabs, activeTabIndex: newActiveTabIndex });\n };\n\n const getTabTitle = (index: number) => props?.tabs.tabs?.[index]?.title ?? `Tab ${index + 1}`;\n\n const registerDatagridInDataGridTemplate: BentoDataGridTemplateDataGrid = () => {\n const isDataGridTemplate = true;\n const stickyTabs: Ref<boolean> = toRef(props, 'stickyTabs');\n const stickyAdditionalContent: Ref<boolean> = toRef(props, 'stickyAdditionalContent');\n const tabsRef: Ref<UnwrapRef<HTMLDivElement>> | null = computedTabsRef;\n const additionalContentSlotRef: Ref<UnwrapRef<HTMLDivElement>> | null = additionalContentRef;\n\n // return values to the Tab component\n return {\n isDataGridTemplate,\n stickyTabs,\n tabsRef,\n stickyAdditionalContent,\n additionalContentSlotRef,\n };\n };\n\n provide(DATA_GRID_REGISTER_TEMPLATE_INJECTION_KEY, registerDatagridInDataGridTemplate);\n</script>\n\n<script lang=\"ts\">\n /**\n * The data grid template is a restrictive, full-page data grid used to display information from a data set.\n * You can use this data grid template when your user needs a clear overview of data or a way of organizing and analyzing the data in their own way.\n * This data grid template shouldn’t be confused with the data grid.\n *\n * @example\n * import { BentoDataGridTemplate } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDataGridTemplate },\n * template: `\n * // If you want to display multiple data grids in the same page (they will be rendered in different tabs)\n * <bento-data-grid-template>\n * <template #tab-1><bento-data-grid v-bind=\"your-data-grid-args\" title=\"Title for tab 1\"/></template>\n * <template #tab-2><bento-data-grid v-bind=\"your-data-grid-args\" title=\"Title for tab 2\"/></template>\n * </bento-data-grid-template>\n * // Alternatively, if you only want to pass one data grid to your template:\n * <bento-data-grid-template>\n * <template #default><bento-data-grid v-bind=\"your-data-grid-args\"/></template>\n * </bento-data-grid-template>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./data-grid-template.scss\" />\n"],"names":["__default__","slots","useSlots","hasSlot","useHasSlot","tabsRef","ref","additionalContentRef","inspectorRef","additionalContentConditionalClasses","computed","props","computedInspectorProps","computedStickyAdditionalContentHeight","_a","computedTabsRef","_b","tabsSlots","el","inspectorEvents","value","emit","emitTabs","newActiveTabIndex","getTabTitle","index","registerDatagridInDataGridTemplate","stickyTabs","toRef","stickyAdditionalContent","provide","DATA_GRID_REGISTER_TEMPLATE_INJECTION_KEY"],"mappings":";;;;;;;;AAmLI,MAAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAhFAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAIAI,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,IAAA,GACAE,IAAAF,EAAA,IAAA,GAEAG,IAAAC,EAAA,OAAA;AAAA,MAA4D,oDAAAC,EAAA;AAAA,IACE,EAAA,GAG9DC,IAAAF,EAAA,OAAA;AAAA,MAA+C,OAAA;AAAA,MACpC,GAAAC,EAAA;AAAA,IACE,EAAA,GAGbE,IAAAH,EAAA,MAAA;;AAAA,cAAAI,IAAAP,KAAA,gBAAAA,EAAA,UAAA,gBAAAO,EAAA;AAAA,KAAA,GAEAC,IAAAL,EAAA,MAAA;;AAAA,cAAAM,KAAAF,IAAAT,EAAA,UAAA,gBAAAS,EAAA,UAAA,gBAAAE,EAAA;AAAA,KAAA,GAEAC,IAAAP,EAAA,MAAA,OAAA,KAAAT,CAAA,EAAA,OAAA,CAAAiB,MAAAA,KAAA,gBAAAA,EAAA,SAAA,OAAA,CAAA,GAEAC,IAAAT,EAAA,OAAA;AAAA,MAAwC,kBAAA,CAAAU,MAAAC,EAAA,4BAAAD,CAAA;AAAA,MACwC,sBAAA,CAAAA,MAAAC,EAAA,gCAAAD,CAAA;AAAA,MACO,QAAA,CAAAA,MAAAC,EAAA,oBAAAD,CAAA;AAAA,IACzB,EAAA,GAG9DE,IAAA,CAAAC,MAAA;AACI,MAAAF,EAAA,eAAA,EAAA,GAAAV,EAAA,MAAA,gBAAAY,EAAA,CAAA;AAAA,IAAwE,GAG5EC,IAAA,CAAAC,MAAA;;AAAA,eAAAT,KAAAF,IAAAH,KAAA,gBAAAA,EAAA,KAAA,SAAA,gBAAAG,EAAAW,OAAA,gBAAAT,EAAA,UAAA,OAAAS,IAAA,CAAA;AAAA,OAEAC,IAAA,MAAA;AAEI,YAAAC,IAAAC,EAAAjB,GAAA,YAAA,GACAkB,IAAAD,EAAAjB,GAAA,yBAAA;AAKA,aAAA;AAAA,QAAO;AAAA,QACH,YAAAgB;AAAA,QACA,SANJZ;AAAA,QAOI,yBAAAc;AAAA,QACA,0BAPJtB;AAAA,MAQI;AAAA,IACJ;AAGJ,WAAAuB,EAAAC,GAAAL,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"data-grid-template.DtFRjaR8.js","sources":["../../src/templates/data-grid-template/data-grid-template.vue"],"sourcesContent":["<template>\n <main class=\"b-data-grid-template\">\n <bento-inspector v-bind=\"computedInspectorProps\" ref=\"inspectorRef\" v-on=\"inspectorEvents\">\n <template #page>\n <bento-header v-bind=\"header\" variant=\"component\" class=\"b-data-grid-template__header\">\n <template v-if=\"hasSlot('infoIconTooltipContent')\" #infoIconTooltipContent>\n <slot name=\"infoIconTooltipContent\" />\n </template>\n </bento-header>\n\n <div\n v-if=\"hasSlot('additionalContent')\"\n ref=\"additionalContentRef\"\n class=\"b-data-grid-template__additional-content\"\n :class=\"additionalContentConditionalClasses\"\n >\n <slot name=\"additionalContent\" />\n </div>\n\n <bento-tabs\n v-if=\"tabsSlots.length > 1\"\n ref=\"tabsRef\"\n :active-tab-index=\"tabs.activeTabIndex\"\n :sticky=\"stickyTabs\"\n :sticky-options=\"stickyAdditionalContent ? { top: computedStickyAdditionalContentHeight } : null\"\n @update:active-tab-index=\"emitTabs\"\n >\n <bento-tab v-for=\"(_item, index) in tabsSlots\" :key=\"`tab-${index}`\" :title=\"getTabTitle(index)\">\n <slot :name=\"`tab-${index + 1}`\" />\n </bento-tab>\n </bento-tabs>\n\n <slot v-else />\n </template>\n\n <template #content>\n <slot name=\"inspector-content\" />\n </template>\n </bento-inspector>\n </main>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoHeader } from '@/components/header';\n import { BentoInspector } from '@/components/inspector';\n import { BentoTab, BentoTabs } from '@/components/tabs';\n import { useHasSlot } from '@/composables';\n import { computed, PropType, provide, Ref, ref, toRef, UnwrapRef, useSlots } from 'vue';\n import { DATA_GRID_REGISTER_TEMPLATE_INJECTION_KEY } from './data-grid-template.keys';\n import type {\n BentoDataGridTemplateDataGrid,\n BentoDataGridTemplateHeader,\n BentoDataGridTemplateInspector,\n BentoDataGridTemplateTabs,\n } from './data-grid-template.types';\n\n const props = defineProps({\n /**\n * The header that goes to the top of the template\n */\n header: {\n type: Object as PropType<BentoDataGridTemplateHeader>,\n required: true,\n },\n\n /**\n * All the tab properties that can be set on the inner tab components.\n * - tabs.activeTabIndex: the currenly active tab index.\n * - tabs.tabs: an array of BentoTab props, the first item in the array will affect the `tab-1` slot and so on.\n */\n tabs: {\n type: Object as PropType<BentoDataGridTemplateTabs>,\n default: undefined,\n },\n\n /**\n * Renders the additional content slot with a sticky positioning\n */\n stickyAdditionalContent: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Renders the tabs with a sticky positioning\n */\n stickyTabs: {\n type: Boolean,\n default: false,\n },\n\n /**\n * All the inspector properties that can be set on the inner inspector component.\n */\n inspector: {\n type: Object as PropType<BentoDataGridTemplateInspector>,\n default: undefined,\n },\n });\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const emit = defineEmits([\"update:tabs\", \"update:is-open:inspector\", \"update:active-page:inspector\", \"expand:inspector\"]);\n\n const tabsRef = ref(null);\n const additionalContentRef = ref(null);\n const inspectorRef = ref(null);\n\n const additionalContentConditionalClasses = computed(() => ({\n 'b-data-grid-template__additional-content--sticky': props.stickyAdditionalContent,\n }));\n\n const computedInspectorProps = computed(() => ({\n title: '',\n ...props.inspector,\n }));\n\n const computedStickyAdditionalContentHeight = computed(() => additionalContentRef?.value?.offsetHeight);\n\n const computedTabsRef = computed(() => tabsRef.value?.$refs?.tablistwrapper);\n\n const tabsSlots = computed(() => Object.keys(slots).filter(el => el?.includes('tab-')));\n\n const inspectorEvents = computed(() => ({\n 'update:is-open': (value: boolean) => emit('update:is-open:inspector', value),\n 'update:active-page': (value: string) => emit('update:active-page:inspector', value),\n expand: (value: boolean) => emit('expand:inspector', value),\n }));\n\n const emitTabs = (newActiveTabIndex: number) => {\n emit('update:tabs', { ...props.tabs, activeTabIndex: newActiveTabIndex });\n };\n\n const getTabTitle = (index: number) => props?.tabs.tabs?.[index]?.title ?? `Tab ${index + 1}`;\n\n const registerDatagridInDataGridTemplate: BentoDataGridTemplateDataGrid = () => {\n const isDataGridTemplate = true;\n const stickyTabs: Ref<boolean> = toRef(props, 'stickyTabs');\n const stickyAdditionalContent: Ref<boolean> = toRef(props, 'stickyAdditionalContent');\n const tabsRef: Ref<UnwrapRef<HTMLDivElement>> | null = computedTabsRef;\n const additionalContentSlotRef: Ref<UnwrapRef<HTMLDivElement>> | null = additionalContentRef;\n\n // return values to the Tab component\n return {\n isDataGridTemplate,\n stickyTabs,\n tabsRef,\n stickyAdditionalContent,\n additionalContentSlotRef,\n };\n };\n\n provide(DATA_GRID_REGISTER_TEMPLATE_INJECTION_KEY, registerDatagridInDataGridTemplate);\n</script>\n\n<script lang=\"ts\">\n /**\n * The data grid template is a restrictive, full-page data grid used to display information from a data set.\n * You can use this data grid template when your user needs a clear overview of data or a way of organizing and analyzing the data in their own way.\n * This data grid template shouldn’t be confused with the data grid.\n *\n * @example\n * import { BentoDataGridTemplate } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDataGridTemplate },\n * template: `\n * // If you want to display multiple data grids in the same page (they will be rendered in different tabs)\n * <bento-data-grid-template>\n * <template #tab-1><bento-data-grid v-bind=\"your-data-grid-args\" title=\"Title for tab 1\"/></template>\n * <template #tab-2><bento-data-grid v-bind=\"your-data-grid-args\" title=\"Title for tab 2\"/></template>\n * </bento-data-grid-template>\n * // Alternatively, if you only want to pass one data grid to your template:\n * <bento-data-grid-template>\n * <template #default><bento-data-grid v-bind=\"your-data-grid-args\"/></template>\n * </bento-data-grid-template>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./data-grid-template.scss\" />\n"],"names":["__default__","slots","useSlots","hasSlot","useHasSlot","tabsRef","ref","additionalContentRef","inspectorRef","additionalContentConditionalClasses","computed","props","computedInspectorProps","computedStickyAdditionalContentHeight","_a","computedTabsRef","_b","tabsSlots","el","inspectorEvents","value","emit","emitTabs","newActiveTabIndex","getTabTitle","index","registerDatagridInDataGridTemplate","stickyTabs","toRef","stickyAdditionalContent","provide","DATA_GRID_REGISTER_TEMPLATE_INJECTION_KEY"],"mappings":";;;;;;;;AAmLI,MAAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAhFAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAIAI,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,IAAA,GACAE,IAAAF,EAAA,IAAA,GAEAG,IAAAC,EAAA,OAAA;AAAA,MAA4D,oDAAAC,EAAA;AAAA,IACE,EAAA,GAG9DC,IAAAF,EAAA,OAAA;AAAA,MAA+C,OAAA;AAAA,MACpC,GAAAC,EAAA;AAAA,IACE,EAAA,GAGbE,IAAAH,EAAA,MAAA;;AAAA,cAAAI,IAAAP,KAAA,gBAAAA,EAAA,UAAA,gBAAAO,EAAA;AAAA,KAAA,GAEAC,IAAAL,EAAA,MAAA;;AAAA,cAAAM,KAAAF,IAAAT,EAAA,UAAA,gBAAAS,EAAA,UAAA,gBAAAE,EAAA;AAAA,KAAA,GAEAC,IAAAP,EAAA,MAAA,OAAA,KAAAT,CAAA,EAAA,OAAA,CAAAiB,MAAAA,KAAA,gBAAAA,EAAA,SAAA,OAAA,CAAA,GAEAC,IAAAT,EAAA,OAAA;AAAA,MAAwC,kBAAA,CAAAU,MAAAC,EAAA,4BAAAD,CAAA;AAAA,MACwC,sBAAA,CAAAA,MAAAC,EAAA,gCAAAD,CAAA;AAAA,MACO,QAAA,CAAAA,MAAAC,EAAA,oBAAAD,CAAA;AAAA,IACzB,EAAA,GAG9DE,IAAA,CAAAC,MAAA;AACI,MAAAF,EAAA,eAAA,EAAA,GAAAV,EAAA,MAAA,gBAAAY,EAAA,CAAA;AAAA,IAAwE,GAG5EC,IAAA,CAAAC,MAAA;;AAAA,eAAAT,KAAAF,IAAAH,KAAA,gBAAAA,EAAA,KAAA,SAAA,gBAAAG,EAAAW,OAAA,gBAAAT,EAAA,UAAA,OAAAS,IAAA,CAAA;AAAA,OAEAC,IAAA,MAAA;AAEI,YAAAC,IAAAC,EAAAjB,GAAA,YAAA,GACAkB,IAAAD,EAAAjB,GAAA,yBAAA;AAKA,aAAA;AAAA,QAAO;AAAA,QACH,YAAAgB;AAAA,QACA,SANJZ;AAAA,QAOI,yBAAAc;AAAA,QACA,0BAPJtB;AAAA,MAQI;AAAA,IACJ;AAGJ,WAAAuB,EAAAC,GAAAL,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -10,13 +10,13 @@ import { E as re, B as En, a as Ln, T as Rn } from "./tooltip.DyZIyMZN.js";
10
10
  import { B as An } from "./dashed-underline.DD24UDCz.js";
11
11
  import { B as Ce, p as vt } from "./typography.J1v_SPG3.js";
12
12
  import { u as ue } from "./i18n.BQkEbtPM.js";
13
- import { B as On } from "./action-bar.Dsp7iRxz.js";
13
+ import { B as On } from "./action-bar.DHdrZtmW.js";
14
14
  import { B as Tn } from "./pagination.DvP8FqiW.js";
15
15
  import { B as Fe } from "./loading-indicator.z8COalOc.js";
16
16
  import { u as Me } from "./use-has-slot.C9lQZ6nz.js";
17
17
  import { u as Nn } from "./aria-label.CaUURpnB.js";
18
18
  import { g as In } from "./get-slot-text.BQS5Olxm.js";
19
- import { B as Le } from "./filter-bar.D6HeYnzZ.js";
19
+ import { B as Le } from "./filter-bar.DjUN3PeJ.js";
20
20
  import { B as Dn } from "./empty-state.mtXfb1BB.js";
21
21
  import { E as xn } from "./tabs.keys.Bc2pSKRw.js";
22
22
  import { D as Fn } from "./data-grid-template.keys.2_AkxuNT.js";
@@ -26,7 +26,7 @@ import { b as Mn } from "./focus-trap.C-wIQqpO.js";
26
26
  import { u as Bn } from "./use-expandable-content-height.GkjjbmPy.js";
27
27
  import { g as Oe } from "./generate-uid.NJ8tVoha.js";
28
28
  import { B as mt } from "./button.hF-nD1Og.js";
29
- import { B as Ct, O as $n, D as Pn } from "./menu.W_kuhRKI.js";
29
+ import { B as Ct, O as $n, D as Pn } from "./menu.BCD4FW54.js";
30
30
  import { E as Un } from "./link.CXy_LoFI.js";
31
31
  import { C as zn } from "./copy.Co1MMqtM.js";
32
32
  import { B as ht } from "./checkbox.C9nJVvMq.js";
@@ -2862,4 +2862,4 @@ export {
2862
2862
  T as f,
2863
2863
  he as g
2864
2864
  };
2865
- //# sourceMappingURL=data-grid.BfsBhYpW.js.map
2865
+ //# sourceMappingURL=data-grid.Cep-0zsO.js.map