@adyen/bento-vue2 1.67.0 → 1.68.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.
Files changed (175) hide show
  1. package/dist/@types/index.d.ts +2066 -2264
  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/button-actions.css +1 -1
  7. package/dist/assets/card.css +1 -1
  8. package/dist/assets/checkbox.css +1 -1
  9. package/dist/assets/data-grid.css +1 -1
  10. package/dist/assets/dialog-page.css +1 -1
  11. package/dist/assets/dropdown.css +1 -1
  12. package/dist/assets/file-uploader.css +1 -1
  13. package/dist/assets/filter-bar.css +1 -1
  14. package/dist/assets/header-meta.css +1 -0
  15. package/dist/assets/header-with-views.css +1 -1
  16. package/dist/assets/header.css +1 -1
  17. package/dist/assets/input-field-phone-number.css +1 -1
  18. package/dist/assets/input-field.css +1 -1
  19. package/dist/assets/inspector.css +1 -1
  20. package/dist/assets/menu.css +1 -1
  21. package/dist/assets/modal-fullscreen.css +1 -1
  22. package/dist/assets/popover.css +1 -1
  23. package/dist/assets/sidepanel.css +1 -1
  24. package/dist/assets/summary-grid.css +1 -1
  25. package/dist/assets/textarea.css +1 -1
  26. package/dist/assets/use-cached-selected-values.css +1 -1
  27. package/dist/button.js +1 -1
  28. package/dist/card.js +1 -1
  29. package/dist/checkbox.js +2 -2
  30. package/dist/chunks/{action-bar.BxX3I27_.js → action-bar.Dy6tfK8c.js} +4 -4
  31. package/dist/chunks/{action-bar.BxX3I27_.js.map → action-bar.Dy6tfK8c.js.map} +1 -1
  32. package/dist/chunks/{base-modal.QGDM_kjG.js → base-modal.CkkfT6r6.js} +55 -118
  33. package/dist/chunks/base-modal.CkkfT6r6.js.map +1 -0
  34. package/dist/chunks/{button-actions-with-menu.itkbcqzk.js → button-actions-with-menu.CcxUTbsI.js} +3 -3
  35. package/dist/chunks/{button-actions-with-menu.itkbcqzk.js.map → button-actions-with-menu.CcxUTbsI.js.map} +1 -1
  36. package/dist/chunks/{button-actions.BKdI_ooV.js → button-actions.Ju27CRNG.js} +2 -2
  37. package/dist/chunks/button-actions.Ju27CRNG.js.map +1 -0
  38. package/dist/chunks/{card.BktfAMv5.js → card.CASAAsuJ.js} +2 -2
  39. package/dist/chunks/{card.BktfAMv5.js.map → card.CASAAsuJ.js.map} +1 -1
  40. package/dist/chunks/{checkbox-group.BVMGnokj.js → checkbox-group.QdX-NrSG.js} +2 -2
  41. package/dist/chunks/{checkbox-group.BVMGnokj.js.map → checkbox-group.QdX-NrSG.js.map} +1 -1
  42. package/dist/chunks/{checkbox.Bg5FM5Oa.js → checkbox.DCD6SSXC.js} +38 -37
  43. package/dist/chunks/checkbox.DCD6SSXC.js.map +1 -0
  44. package/dist/chunks/{code-snippet.DDiQ9R3o.js → code-snippet.dIKi0D7d.js} +3 -3
  45. package/dist/chunks/{code-snippet.DDiQ9R3o.js.map → code-snippet.dIKi0D7d.js.map} +1 -1
  46. package/dist/chunks/{country.Df7erZov.js → country.melpzEsY.js} +2 -2
  47. package/dist/chunks/{country.Df7erZov.js.map → country.melpzEsY.js.map} +1 -1
  48. package/dist/chunks/{dashboard-section.Beep1lY8.js → dashboard-section.DBT99mLj.js} +2 -2
  49. package/dist/chunks/{dashboard-section.Beep1lY8.js.map → dashboard-section.DBT99mLj.js.map} +1 -1
  50. package/dist/chunks/{dashed-underline.BQwLgzz6.js → dashed-underline.BbH6Lnd2.js} +2 -2
  51. package/dist/chunks/{dashed-underline.BQwLgzz6.js.map → dashed-underline.BbH6Lnd2.js.map} +1 -1
  52. package/dist/chunks/{data-grid-template.nkx0pCMA.js → data-grid-template.B2lDfM2o.js} +2 -2
  53. package/dist/chunks/{data-grid-template.nkx0pCMA.js.map → data-grid-template.B2lDfM2o.js.map} +1 -1
  54. package/dist/chunks/{data-grid.CkwZVy3a.js → data-grid.B7Z9_WDY.js} +1198 -1143
  55. package/dist/chunks/data-grid.B7Z9_WDY.js.map +1 -0
  56. package/dist/chunks/{date-picker.BLBXaDHv.js → date-picker.DGIS6Pp-.js} +2 -2
  57. package/dist/chunks/{date-picker.BLBXaDHv.js.map → date-picker.DGIS6Pp-.js.map} +1 -1
  58. package/dist/chunks/{date-range-picker.am63DgMj.js → date-range-picker.CIaKRXIQ.js} +5 -5
  59. package/dist/chunks/{date-range-picker.am63DgMj.js.map → date-range-picker.CIaKRXIQ.js.map} +1 -1
  60. package/dist/chunks/dropdown-default-textbox.94q6opSD.js.map +1 -1
  61. package/dist/chunks/dropdown-tag.BaosvGGZ.js +240 -0
  62. package/dist/chunks/dropdown-tag.BaosvGGZ.js.map +1 -0
  63. package/dist/chunks/{dropdown.HA6ISg2h.js → dropdown.DazYAy4B.js} +220 -363
  64. package/dist/chunks/dropdown.DazYAy4B.js.map +1 -0
  65. package/dist/chunks/es6.n1ewaW31.js.map +1 -1
  66. package/dist/chunks/{filter-bar.DbqsoAI1.js → filter-bar.DL19SXF1.js} +674 -669
  67. package/dist/chunks/filter-bar.DL19SXF1.js.map +1 -0
  68. package/dist/chunks/{footer-actions.BUfQFz7J.js → footer-actions.BE_zzX-e.js} +2 -2
  69. package/dist/chunks/{footer-actions.BUfQFz7J.js.map → footer-actions.BE_zzX-e.js.map} +1 -1
  70. package/dist/chunks/header-meta.CfloYa86.js +183 -0
  71. package/dist/chunks/header-meta.CfloYa86.js.map +1 -0
  72. package/dist/chunks/{header-with-views.JllLR2nW.js → header-with-views.Bxvu8mq_.js} +526 -520
  73. package/dist/chunks/header-with-views.Bxvu8mq_.js.map +1 -0
  74. package/dist/chunks/header.DvHS-PnC.js +103 -0
  75. package/dist/chunks/header.DvHS-PnC.js.map +1 -0
  76. package/dist/chunks/{input-field-password.BtOdV0gF.js → input-field-password.C1zTapiN.js} +4 -4
  77. package/dist/chunks/{input-field-password.BtOdV0gF.js.map → input-field-password.C1zTapiN.js.map} +1 -1
  78. package/dist/chunks/{input-field-phone-number.Dq-LnGag.js → input-field-phone-number.K8BYjWfa.js} +623 -607
  79. package/dist/chunks/{input-field-phone-number.Dq-LnGag.js.map → input-field-phone-number.K8BYjWfa.js.map} +1 -1
  80. package/dist/chunks/{input-field.Bg77qHT2.js → input-field.5S-pUNxA.js} +7 -7
  81. package/dist/chunks/input-field.5S-pUNxA.js.map +1 -0
  82. package/dist/chunks/{menu.EgYjFAku.js → menu.dX3_vU05.js} +154 -153
  83. package/dist/chunks/{menu.EgYjFAku.js.map → menu.dX3_vU05.js.map} +1 -1
  84. package/dist/chunks/{modal-fullscreen.BNTUOC7o.js → modal-fullscreen.DHotw1RI.js} +76 -63
  85. package/dist/chunks/modal-fullscreen.DHotw1RI.js.map +1 -0
  86. package/dist/chunks/{modal.OvB4kEGR.js → modal.eoNQ6E3U.js} +4 -4
  87. package/dist/chunks/{modal.OvB4kEGR.js.map → modal.eoNQ6E3U.js.map} +1 -1
  88. package/dist/chunks/{pagination.Dw153NzQ.js → pagination.4J7ZMyf5.js} +2 -2
  89. package/dist/chunks/{pagination.Dw153NzQ.js.map → pagination.4J7ZMyf5.js.map} +1 -1
  90. package/dist/chunks/popover.Bo4Bkudr.js +145 -0
  91. package/dist/chunks/popover.Bo4Bkudr.js.map +1 -0
  92. package/dist/chunks/popover.types.CBqyA4ly.js +6 -0
  93. package/dist/chunks/popover.types.CBqyA4ly.js.map +1 -0
  94. package/dist/chunks/{rich-text-editor.CRJRvfJn.js → rich-text-editor.BUKLdRkN.js} +2 -2
  95. package/dist/chunks/{rich-text-editor.CRJRvfJn.js.map → rich-text-editor.BUKLdRkN.js.map} +1 -1
  96. package/dist/chunks/{search-bar.BTZSePJh.js → search-bar.CuBj5FAE.js} +3 -3
  97. package/dist/chunks/{search-bar.BTZSePJh.js.map → search-bar.CuBj5FAE.js.map} +1 -1
  98. package/dist/chunks/{secondary-nav.BBhSBNn7.js → secondary-nav.C6usurfD.js} +2 -2
  99. package/dist/chunks/{secondary-nav.BBhSBNn7.js.map → secondary-nav.C6usurfD.js.map} +1 -1
  100. package/dist/chunks/{sidepanel.Dt-BnFzN.js → sidepanel.DyThBUgV.js} +2 -2
  101. package/dist/chunks/{sidepanel.Dt-BnFzN.js.map → sidepanel.DyThBUgV.js.map} +1 -1
  102. package/dist/chunks/{summary-grid.types.DsvtLg3D.js → summary-grid.types.D_FU3sUq.js} +4 -4
  103. package/dist/chunks/summary-grid.types.D_FU3sUq.js.map +1 -0
  104. package/dist/chunks/{textarea.RAU710Uw.js → textarea.UPM6N9V1.js} +7 -7
  105. package/dist/chunks/textarea.UPM6N9V1.js.map +1 -0
  106. package/dist/chunks/{timeline-item.Dz66luo5.js → timeline-item.DqLhj0Lb.js} +3 -3
  107. package/dist/chunks/{timeline-item.Dz66luo5.js.map → timeline-item.DqLhj0Lb.js.map} +1 -1
  108. package/dist/chunks/{tutorial.DAKO-fKz.js → tutorial.DRRfp81j.js} +7 -6
  109. package/dist/chunks/{tutorial.DAKO-fKz.js.map → tutorial.DRRfp81j.js.map} +1 -1
  110. package/dist/chunks/{use-cached-selected-values.DQPABFfG.js → use-cached-selected-values.0EeyFfyF.js} +413 -410
  111. package/dist/chunks/use-cached-selected-values.0EeyFfyF.js.map +1 -0
  112. package/dist/chunks/{use-country-items.HFnjuDsG.js → use-country-items.BllTb5MK.js} +2 -2
  113. package/dist/chunks/{use-country-items.HFnjuDsG.js.map → use-country-items.BllTb5MK.js.map} +1 -1
  114. package/dist/chunks/{use-country-phon-code.DVgE19zT.js → use-country-phon-code.BOaJ9PDl.js} +507 -498
  115. package/dist/chunks/{use-country-phon-code.DVgE19zT.js.map → use-country-phon-code.BOaJ9PDl.js.map} +1 -1
  116. package/dist/code-snippet.js +1 -1
  117. package/dist/country.js +2 -2
  118. package/dist/dashboard-template.js +1 -1
  119. package/dist/dashed-underline.js +1 -1
  120. package/dist/data-grid-template.js +1 -1
  121. package/dist/data-grid.js +1 -1
  122. package/dist/date-picker.js +1 -1
  123. package/dist/date-range-picker.js +1 -1
  124. package/dist/dropdown.js +3 -3
  125. package/dist/filter-bar.js +1 -1
  126. package/dist/header-with-views.js +1 -1
  127. package/dist/header.js +1 -1
  128. package/dist/index.js +155 -154
  129. package/dist/index.js.map +1 -1
  130. package/dist/input-field-password.js +1 -1
  131. package/dist/input-field-phone-number.js +1 -1
  132. package/dist/input-field.js +1 -1
  133. package/dist/internal.js +15 -14
  134. package/dist/menu.js +1 -1
  135. package/dist/modal-fullscreen.js +1 -1
  136. package/dist/modal.js +11 -11
  137. package/dist/pagination.js +1 -1
  138. package/dist/popover.js +3 -2
  139. package/dist/popover.js.map +1 -1
  140. package/dist/rich-text-editor.js +1 -1
  141. package/dist/search-bar.js +2 -2
  142. package/dist/secondary-nav.js +1 -1
  143. package/dist/sidepanel.js +1 -1
  144. package/dist/styles/bento-dark.css +10 -2
  145. package/dist/styles/bento-light.css +10 -2
  146. package/dist/styles/bento.css +10 -2
  147. package/dist/styles/legacy.css +10 -2
  148. package/dist/styles/styleguide.css +10 -2
  149. package/dist/summary-grid.js +1 -1
  150. package/dist/textarea.js +1 -1
  151. package/dist/timeline.js +1 -1
  152. package/dist/tutorial.js +1 -1
  153. package/dist/web-types.json +265 -51
  154. package/package.json +6 -6
  155. package/dist/assets/info-icon-with-popover.css +0 -1
  156. package/dist/chunks/base-modal.QGDM_kjG.js.map +0 -1
  157. package/dist/chunks/button-actions.BKdI_ooV.js.map +0 -1
  158. package/dist/chunks/checkbox.Bg5FM5Oa.js.map +0 -1
  159. package/dist/chunks/data-grid.CkwZVy3a.js.map +0 -1
  160. package/dist/chunks/dropdown-tag.DYIkCBa6.js +0 -215
  161. package/dist/chunks/dropdown-tag.DYIkCBa6.js.map +0 -1
  162. package/dist/chunks/dropdown.HA6ISg2h.js.map +0 -1
  163. package/dist/chunks/filter-bar.DbqsoAI1.js.map +0 -1
  164. package/dist/chunks/header-with-views.JllLR2nW.js.map +0 -1
  165. package/dist/chunks/header.04Y0unpy.js +0 -188
  166. package/dist/chunks/header.04Y0unpy.js.map +0 -1
  167. package/dist/chunks/info-icon-with-popover.B1DnkW4B.js +0 -71
  168. package/dist/chunks/info-icon-with-popover.B1DnkW4B.js.map +0 -1
  169. package/dist/chunks/input-field.Bg77qHT2.js.map +0 -1
  170. package/dist/chunks/modal-fullscreen.BNTUOC7o.js.map +0 -1
  171. package/dist/chunks/popover.BGHbPUOr.js +0 -295
  172. package/dist/chunks/popover.BGHbPUOr.js.map +0 -1
  173. package/dist/chunks/summary-grid.types.DsvtLg3D.js.map +0 -1
  174. package/dist/chunks/textarea.RAU710Uw.js.map +0 -1
  175. package/dist/chunks/use-cached-selected-values.DQPABFfG.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"menu.EgYjFAku.js","sources":["../../src/components/menu/menu.keys.ts","../../../ui-assets/icons-16/dist/vue/options-vertical.vue","../../src/components/menu/components/menu-item/menu-item.vue","../../src/components/menu/menu.types.ts","../../src/components/data-grid/components/data-grid-cell/data-grid-cell.keys.ts","../../src/components/menu/components/menu-list-container/menu-list-container.vue","../../src/components/menu/components/sub-menu-item-list/sub-menu-item-list.vue","../../src/components/menu/composables/use-dynamic-menu-size/use-dynamic-menu-size.ts","../../src/components/menu/components/menu-item-list/menu-item-list.vue","../../src/components/menu/menu.vue"],"sourcesContent":["export const MENU_INVERSE_INJECTION_KEY = Symbol('menu inverse style injection key');\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#001222\" d=\"M8 4C8.29667 4 8.58668 3.91203 8.83335 3.74721C9.08003 3.58238 9.27229 3.34811 9.38582 3.07403C9.49935 2.79994 9.52906 2.49834 9.47118 2.20737C9.4133 1.91639 9.27044 1.64912 9.06066 1.43934C8.85088 1.22956 8.58361 1.0867 8.29264 1.02882C8.00167 0.970945 7.70006 1.00065 7.42598 1.11418C7.15189 1.22771 6.91762 1.41997 6.7528 1.66665C6.58797 1.91332 6.5 2.20333 6.5 2.5C6.5 2.89783 6.65803 3.27936 6.93934 3.56066C7.22064 3.84197 7.60218 4 8 4Z\"/><path fill=\"#001222\" d=\"M8 15C8.29667 15 8.58668 14.912 8.83335 14.7472C9.08003 14.5824 9.27229 14.3481 9.38582 14.074C9.49935 13.7999 9.52906 13.4983 9.47118 13.2074C9.4133 12.9164 9.27044 12.6491 9.06066 12.4393C8.85088 12.2296 8.58361 12.0867 8.29264 12.0288C8.00167 11.9709 7.70006 12.0007 7.42598 12.1142C7.15189 12.2277 6.91762 12.42 6.7528 12.6666C6.58797 12.9133 6.5 13.2033 6.5 13.5C6.5 13.8978 6.65803 14.2794 6.93934 14.5607C7.22064 14.842 7.60218 15 8 15Z\"/><path fill=\"#001222\" d=\"M8.83335 9.24721C8.58668 9.41203 8.29667 9.5 8 9.5C7.60218 9.5 7.22064 9.34197 6.93934 9.06066C6.65803 8.77936 6.5 8.39783 6.5 8C6.5 7.70333 6.58797 7.41332 6.7528 7.16665C6.91762 6.91997 7.15189 6.72771 7.42598 6.61418C7.70006 6.50065 8.00167 6.47094 8.29264 6.52882C8.58361 6.5867 8.85088 6.72956 9.06066 6.93934C9.27044 7.14912 9.4133 7.41639 9.47118 7.70737C9.52906 7.99834 9.49935 8.29994 9.38582 8.57403C9.27229 8.84811 9.08003 9.08238 8.83335 9.24721Z\"/></svg>\n</template>\n<script>\n import '../css/main.css';\n\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n","<template>\n <base-button\n class=\"b-menu-item\"\n role=\"menuitem\"\n :class=\"conditionalClasses\"\n :disabled=\"disabled\"\n tabindex=\"-1\"\n @click=\"onClick\"\n >\n <template v-if=\"icon\" #iconLeft>\n <component :is=\"icon\" class=\"b-menu-item__icon-left\" aria-hidden=\"true\" />\n </template>\n <template #default>\n <bento-typography el=\"span\" variant=\"body\" :stronger=\"isTitle\" class=\"b-menu-item__primary-text\">\n {{ text }}\n </bento-typography>\n <bento-typography v-if=\"computedSecondaryText\" el=\"span\" variant=\"body\" class=\"b-menu-item__secondary-text\">\n {{ computedSecondaryText }}\n </bento-typography>\n </template>\n <template v-if=\"chevron\" #iconRight><chevron-right-icon aria-hidden=\"true\" /></template>\n </base-button>\n</template>\n\n<script lang=\"ts\">\n import { BaseButton, BentoBaseButtonEvent } from '@/components/internal/base-button';\n import { BentoTypography } from '@/components/typography';\n import { truncate } from '@/utils/ts/truncate';\n import ChevronRightIcon from '@adyen/ui-assets-icons-16/vue/chevron-right';\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoMenuItem } from './menu-item.types';\n\n /**\n * Menu item component to render items in a menu. For internal use only.\n */\n export default defineComponent({\n name: 'menu-item',\n components: { BaseButton, BentoTypography, ChevronRightIcon },\n props: {\n /**\n * menu-item text that gets displayed as the main label\n */\n text: {\n type: String,\n required: true,\n },\n /**\n * menu-item action that gets executed when the MeniItem is clicked\n */\n handler: {\n type: Function as PropType<BentoMenuItem['handler']>,\n required: true,\n },\n /**\n * menu-item text that gets displayed as the secondary label\n */\n secondaryText: {\n type: String,\n default: null,\n },\n /**\n * Optional chevron icon displayed to the right of the menu-item\n */\n chevron: {\n type: Boolean,\n default: false,\n },\n /**\n * Optional icon displayed to the left of the menu-item\n */\n icon: {\n // Types for Vue2 (Object) and Vue3 (Function)\n // TODO: Remove Object when fully migrated to Vue3\n type: [Object, Function] as PropType<BentoMenuItem['icon']>,\n default: null,\n },\n /**\n * Disables menu-item button functionality\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays an indent variant od the menu-item\n */\n indent: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays menu-item button as critical\n */\n critical: {\n type: Boolean,\n default: false,\n },\n /**\n * Renders the text in a bold variant\n */\n isTitle: {\n type: Boolean,\n default: false,\n },\n },\n emits: [BentoBaseButtonEvent.CLICK],\n setup(props, { emit }) {\n const MAX_SECONDARY_TEXT_LENGTH = 10;\n\n const conditionalClasses = computed(() => ({\n 'b-menu-item--critical': props.critical,\n 'b-menu-item--indent': props.indent,\n }));\n\n const computedSecondaryText = computed(() => truncate(props.secondaryText, MAX_SECONDARY_TEXT_LENGTH));\n\n const onClick = (e: MouseEvent) => {\n e.stopPropagation();\n props.handler();\n emit(BentoBaseButtonEvent.CLICK);\n };\n\n return {\n // Values\n conditionalClasses,\n computedSecondaryText,\n\n // Methods\n onClick,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu-item.scss\" />\n","import { OnClickOutsideOptions } from '@/directives/click-outside/types';\nimport { BentoButton } from '../button';\nimport { BentoPopoverPositions } from '../popover';\nimport { BentoMenuItem } from './components';\n\nexport * from './components/menu-item/menu-item.types';\n\nexport enum BentoMenuEvent {\n BACK = 'back',\n CLOSE = 'close',\n OPEN = 'open',\n}\n\ntype ButtonProps = InstanceType<typeof BentoButton>['$props'];\n\nexport type BentoMenuButtonProps = {\n variant?: ButtonProps['variant'];\n condensed?: ButtonProps['condensed'];\n disabled?: ButtonProps['disabled'];\n};\n\nexport interface BentoMenuProps {\n /**\n * Object containing props to change the menu button appearance. Accepts the same props present in BentoButton.\n */\n button?: BentoMenuButtonProps;\n /**\n * Controls if the menu should close when an item is clicked.\n * Defaults to `true`.\n */\n closeMenuOnItemSelect?: boolean;\n /**\n * The data to be displayed in the list\n */\n data: BentoMenuItem[];\n /**\n * Disables opening the menu when the down arrow key is pressed.\n */\n disableArrowDownOpeningMenu?: boolean;\n /**\n * The position of where the menu should open.\n */\n menuPosition?: BentoPopoverPositions | `${BentoPopoverPositions}`;\n /**\n * Instructs the menu popover to be visible outside of the containing container.\n * @see {@link https://floating-ui.com/docs/usefloating#strategy}\n */\n menuFixedPositioning?: boolean;\n /**\n * Sets a custom width for the menu popover.\n */\n menuWidth?: number;\n /**\n * Returns focus to the menu button after popover is closed.\n * Disable if focus management is delegated to the parent component.\n * Defaults to `true`.\n */\n revertFocusToButton?: boolean;\n /**\n * Can be used to set the inner teleport component to render the menu's popover in the root `body` DOM node\n * (or `dialog` if popover is inside a dialog).\n */\n teleport?: boolean;\n /**\n * Can be used to set the inner teleport component to render the menu's popover in the root `body` DOM node\n * (or `dialog` if popover is inside a dialog).\n *\n * @see {@link OnClickOutsideOptions}\n */\n closeOnClickOutsideOptions?: OnClickOutsideOptions;\n}\n","export const DATA_GRID_CELL_MENU_REGISTERING_INJECTION_KEY = Symbol('menu registering injection key');\n","<template>\n <div\n ref=\"menuListContainerRef\"\n class=\"b-menu-list-container\"\n data-testid=\"menu-list-container\"\n v-on=\"menuListContainerEvents\"\n ><slot></slot\n ></div>\n</template>\n\n<script setup lang=\"ts\">\n import { DATA_GRID_CELL_MENU_REGISTERING_INJECTION_KEY } from '@/components/data-grid/components/data-grid-cell/data-grid-cell.keys';\n import { inject, ref } from 'vue';\n import type { DataGridCellRegisterMenu } from '@/components/data-grid/components/data-grid-cell/data-grid-cell.types';\n\n const menuListContainerRef = ref<HTMLDivElement>();\n const menuListContainerEvents = ref({});\n const registeringAndMousingOut = inject<DataGridCellRegisterMenu | false>(\n DATA_GRID_CELL_MENU_REGISTERING_INJECTION_KEY,\n false\n );\n\n // This is needed by the DataGridCell component in order to keep track of if a teleported menu\n // is being hovered over in the DataGridCellActions.\n if (registeringAndMousingOut) {\n const { registerMenuContainerElement } = registeringAndMousingOut;\n registerMenuContainerElement(menuListContainerRef);\n menuListContainerEvents.value = {\n mouseleave: registeringAndMousingOut?.menuMouseLeave,\n };\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Menu list container component to set the correct styling in a menu list. For internal use only.\n */\n export default {\n name: 'bento-menu-list-container',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu-list-container.scss\" />\n","<template>\n <transition name=\"b-sub-menu-item-list__transition\" appear>\n <menu-list-container class=\"b-sub-menu-item-list\">\n <ul\n ref=\"subMenuItemListRefLocal\"\n role=\"menu\"\n class=\"b-sub-menu-item-list__list\"\n @keydown.down.stop=\"focusNext\"\n @keydown.up.stop=\"focusPrevious\"\n @keydown.esc.stop=\"onBackButton\"\n >\n <li v-for=\"(item, index) in computedItems\" :key=\"`sub-menu-item-list-item-${index}`\" role=\"none\">\n <menu-item\n :text=\"item.text\"\n :handler=\"item.handler\"\n :secondary-text=\"item.secondaryText\"\n :icon=\"item.icon\"\n :is-title=\"item.isTitle\"\n :disabled=\"item.disabled\"\n :critical=\"item.critical\"\n :indent=\"item.indent\"\n :tabindex=\"index === subMenuFocusedIndex ? '0' : '-1'\"\n @click=\"item.clickHandler\"\n />\n <bento-divider v-if=\"item.addDivider\" class=\"b-sub-menu-item-list__divider\" />\n </li>\n </ul>\n </menu-list-container>\n </transition>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, onMounted, PropType, ref } from 'vue';\n import { BentoDivider } from '@/components/divider';\n import { BentoMenuItem, MenuItem } from '../menu-item';\n import MenuListContainer from '../menu-list-container/menu-list-container.vue';\n import ChevronLeftIcon from '@adyen/ui-assets-icons-16/vue/chevron-left';\n import { BentoMenuEvent } from '../../menu.types';\n import messages from '../../messages.json';\n\n /**\n * SubMenuItemList component to render a submenu with the sliding transition. For internal use only.\n */\n export default defineComponent({\n i18n: { messages },\n name: 'sub-menu-item-list',\n components: { BentoDivider, MenuItem, MenuListContainer },\n props: {\n items: {\n type: Array as PropType<BentoMenuItem[]>,\n required: true,\n },\n title: {\n type: String,\n required: true,\n },\n },\n emits: [BentoMenuEvent.CLOSE, BentoMenuEvent.BACK],\n setup(props, { emit }) {\n const subMenuItemListRefLocal = ref(null);\n const subMenuFocusedIndex = ref(0);\n const numberOfItems = ref(props.items.length);\n\n const closeMenu = () => emit(BentoMenuEvent.CLOSE);\n\n const onBackButton = () => emit(BentoMenuEvent.BACK);\n\n const computedItems = computed(() => {\n const items = props.items?.map(el => ({\n ...el,\n indent: !el.icon,\n isTitle: false,\n clickHandler: closeMenu,\n }));\n return [\n {\n text: props.title,\n secondaryText: null,\n critical: false,\n icon: ChevronLeftIcon,\n isTitle: true,\n disabled: false,\n indent: false,\n handler: onBackButton,\n clickHandler: onBackButton,\n addDivider: true,\n },\n ...items,\n ];\n });\n\n const focusItem = async () => {\n subMenuItemListRefLocal.value?.children?.[subMenuFocusedIndex.value]?.children?.[0]?.focus();\n };\n\n onMounted(async () => {\n // Using setTimeout otherwise the sliding animation doesn't work anymore. The timeout imer is the same as the transition time (0.15s)\n setTimeout(() => focusItem(), 150);\n });\n\n const focusPrevious = () => {\n if (subMenuFocusedIndex.value > 0) {\n subMenuFocusedIndex.value -= 1;\n if (computedItems.value[subMenuFocusedIndex.value].disabled) {\n focusPrevious();\n }\n } else {\n subMenuFocusedIndex.value = numberOfItems.value;\n }\n focusItem();\n };\n\n const focusNext = () => {\n if (subMenuFocusedIndex.value < numberOfItems.value) {\n subMenuFocusedIndex.value += 1;\n if (computedItems.value[subMenuFocusedIndex.value].disabled) {\n focusNext();\n }\n } else {\n subMenuFocusedIndex.value = 0;\n }\n focusItem();\n };\n\n return {\n // Enums\n BentoMenuEvent,\n\n // Values\n subMenuItemListRefLocal,\n subMenuFocusedIndex,\n ChevronLeftIcon,\n computedItems,\n\n // Methods\n closeMenu,\n onBackButton,\n focusPrevious,\n focusNext,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./sub-menu-item-list.scss\" />\n","import { computed, type CSSProperties, nextTick, type Ref, ref, watch } from 'vue';\n\n// Helper type for the expected shape of the sub-menu ref\ninterface SubMenuRef {\n $el: HTMLElement;\n}\n\n/**\n * A composable that dynamically calculates the width and height for a menu container\n * based on the content of a conditionally rendered sub-menu.\n *\n * @param subMenuItemListRef A ref to the sub-menu component instance(s).\n * @param visibleSubMenuIndex A ref indicating which sub-menu is visible.\n * @param showSubMenu A ref indicating if any sub-menu is visible.\n * @returns A computed style object to be bound to the menu container.\n */\nexport function useDynamicMenuSize(\n subMenuItemListRef: Ref<SubMenuRef[] | null>,\n visibleSubMenuIndex: Ref<number | null>,\n showSubMenu: Ref<boolean>\n) {\n const MAX_MENU_WIDTH = 350;\n const MIN_MENU_WIDTH = 150;\n\n const subMenuWidth = ref(0);\n const subMenuHeight = ref(0);\n\n /**\n * Calculates an element's dimensions in stages using an invisible clone\n * to prevent visual flicker.\n *\n * 1. **Clone**: Creates a 'ghost' copy of the element and adds it to the\n * DOM invisibly.\n * 2. **Measure Ideal Width**: Sets the ghost's width to 'max-content' to find\n * its natural, unwrapped width.\n * 3. **Calculate Final Width**: Clamps the ideal width between the defined\n * MIN and MAX constants.\n * 4. **Measure Final Height**: Applies the final clamped width to the ghost,\n * allowing content to wrap, and then measures the resulting height.\n * 5. **Cleanup**: Removes the ghost element from the DOM.\n */\n const measureSubMenuStyle = (element: HTMLElement) => {\n if (!element || !element.parentElement) {\n return;\n }\n\n // Mount it on the parent element to allow proper height size, otherwise it will be 0\n const parent = element.parentElement;\n\n // Measure the unwrapped width\n const ghost = element.cloneNode(true) as HTMLElement;\n ghost.style.position = 'absolute';\n ghost.style.visibility = 'hidden';\n parent.appendChild(ghost);\n\n // Measure the unwrapped width\n ghost.style.width = 'max-content';\n const unwrappedWidth = ghost.offsetWidth;\n\n // Calculate and store the FINAL clamped width\n const clampedWidth = Math.max(MIN_MENU_WIDTH, Math.min(unwrappedWidth, MAX_MENU_WIDTH));\n subMenuWidth.value = clampedWidth;\n\n // Measure the wrapped height using the final width\n ghost.style.width = `${clampedWidth}px`;\n const height = ghost.offsetHeight;\n\n // Update the height ref with the correct, wrapped height\n subMenuHeight.value = height;\n\n parent.removeChild(ghost);\n // Update the height ref with the correct, wrapped height\n subMenuHeight.value = height;\n };\n\n watch([visibleSubMenuIndex, showSubMenu], async ([newIndex]) => {\n if (newIndex !== null) {\n await nextTick();\n\n const subMenuElement = subMenuItemListRef.value?.[0]?.$el;\n if (subMenuElement) {\n measureSubMenuStyle(subMenuElement);\n }\n } else {\n subMenuWidth.value = 0;\n subMenuHeight.value = 0;\n }\n });\n\n const computedStyle = computed<CSSProperties>(() => {\n const style: CSSProperties = { width: 'max-content' };\n\n if (showSubMenu.value) {\n if (subMenuHeight.value > 0) {\n style.height = `${subMenuHeight.value}px`;\n }\n if (subMenuWidth.value > 0) {\n style.width = `${subMenuWidth.value}px`;\n }\n }\n\n return style;\n });\n\n return { computedStyle };\n}\n","<template>\n <menu-list-container ref=\"menuItemListWrapperRef\" :style=\"computedStyle\">\n <ul\n ref=\"menuItemListRef\"\n class=\"b-menu-item-list\"\n role=\"menu\"\n @keydown.down=\"focusNext\"\n @keydown.up=\"focusPrevious\"\n @keydown.esc=\"closeMenu\"\n @keydown.tab=\"closeMenu\"\n >\n <li\n v-for=\"(item, index) in computedData\"\n :key=\"`menu-item-${index}`\"\n ref=\"menuItemRef\"\n class=\"b-menu-item-list__item\"\n role=\"none\"\n @keydown.right=\"focusRight(item, index)\"\n @keydown.left=\"focusLeft()\"\n >\n <menu-item\n :text=\"item.text\"\n :handler=\"!item.items?.length ? item.handler : () => null\"\n :secondary-text=\"item.secondaryText\"\n :icon=\"item.icon\"\n :chevron=\"!!item.items?.length\"\n :disabled=\"item.disabled\"\n :critical=\"item.critical\"\n :indent=\"item.indent\"\n :tabindex=\"index === subMenuFocusedIndex ? '0' : '-1'\"\n :aria-haspopup=\"!!item.items?.length\"\n :aria-expanded=\"showSubMenu && visibleSubMenuIndex === index\"\n @click=\"menuItemClick(item, index)\"\n />\n <bento-divider v-if=\"item.addDivider\" class=\"b-menu-item-list__divider\" />\n <sub-menu-item-list\n v-if=\"item.items?.length && showSubMenu && visibleSubMenuIndex === index\"\n ref=\"subMenuItemListRef\"\n :items=\"item.items\"\n :title=\"item.text\"\n @back=\"onBackButton\"\n @close=\"closeMenu\"\n />\n </li>\n </ul>\n </menu-list-container>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, nextTick, PropType, ref } from 'vue';\n import { isVue3 } from 'vue-demi';\n import { BentoDivider } from '@/components/divider';\n import { BentoMenuItem, MenuItem } from '../menu-item';\n import { BentoMenuEvent } from '../../menu.types';\n import MenuListContainer from '../menu-list-container/menu-list-container.vue';\n import SubMenuItemList from '../sub-menu-item-list/sub-menu-item-list.vue';\n import { useDynamicMenuSize } from '../../composables';\n\n /**\n * MenuItem list to be used in the Menu component. For internal use only.\n */\n export default defineComponent({\n name: 'menu-item-list',\n components: { BentoDivider, MenuItem, MenuListContainer, SubMenuItemList },\n props: {\n /**\n * The data to be displayed in the list\n */\n data: {\n type: Array as PropType<BentoMenuItem[]>,\n required: true,\n },\n /**\n * Displays the menu-items of the list in the indent variant. Only applies to elements that don't have an icon to their left.\n */\n indentItems: {\n type: Boolean,\n default: false,\n },\n /**\n * If set to true, focuses the last item on the list instead of the first. Used for accessibility purposes when the menu is opened with the 'up' arrow key.\n */\n focusLastElement: {\n type: Boolean,\n default: false,\n },\n /**\n * If set to true, closes the menu when an item is clicked.\n */\n closeMenuOnItemSelect: {\n type: Boolean,\n default: true,\n },\n },\n emits: [BentoMenuEvent.CLOSE, 'menu-item-click'],\n setup(props, { emit, expose }) {\n const menuItemRef = ref(null);\n const menuItemListRef = ref(null);\n const menuItemListWrapperRef = ref(null);\n const subMenuItemListRef = ref(null);\n const showSubMenu = ref(false);\n const visibleSubMenuIndex = ref(null);\n const focusedIndex = ref(props.focusLastElement ? props.data.length - 1 : 0);\n const subMenuFocusedIndex = ref(0);\n const numberOfItems = ref(props.data.length - 1);\n const hasMenuItemsWithIcon = computed(() => props.data.some(el => el.icon));\n\n const computedData = computed(() => {\n if (props.indentItems || hasMenuItemsWithIcon.value) {\n return props.data.map(el => {\n let indent = false;\n if (!el.icon) {\n indent = true;\n }\n return {\n ...el,\n indent,\n };\n });\n }\n return props.data;\n });\n\n const focusItem = async () => {\n // vue 3 requires nextTick to be called before an item can be focused\n // this function does not need to be awaited itself\n\n if (isVue3) {\n await nextTick();\n }\n\n menuItemListRef.value?.children[focusedIndex.value]?.children[0]?.focus();\n };\n\n const closeMenu = () => emit(BentoMenuEvent.CLOSE);\n\n const menuItemClick = (item: BentoMenuItem, index: number) => {\n if (item.items) {\n visibleSubMenuIndex.value = index;\n showSubMenu.value = true;\n\n return;\n }\n\n visibleSubMenuIndex.value = index;\n showSubMenu.value = false;\n\n if (!item.skipClose && props.closeMenuOnItemSelect !== false) {\n closeMenu();\n }\n\n emit('menu-item-click');\n };\n\n const focusPrevious = () => {\n if (focusedIndex.value > 0) {\n focusedIndex.value -= 1;\n if (computedData.value[focusedIndex.value].disabled) {\n focusPrevious();\n }\n } else {\n focusedIndex.value = numberOfItems.value;\n }\n focusItem();\n };\n\n const focusNext = () => {\n if (focusedIndex.value < numberOfItems.value) {\n focusedIndex.value += 1;\n if (computedData.value[focusedIndex.value].disabled) {\n focusNext();\n }\n } else {\n focusedIndex.value = 0;\n }\n focusItem();\n };\n\n const focusRight = (item, index) => {\n if (item?.items?.length) {\n visibleSubMenuIndex.value = index;\n showSubMenu.value = true;\n }\n };\n\n const focusLeft = () => {\n if (visibleSubMenuIndex.value && showSubMenu.value) {\n visibleSubMenuIndex.value = null;\n showSubMenu.value = false;\n }\n };\n\n const onBackButton = () => {\n showSubMenu.value = false;\n visibleSubMenuIndex.value = null;\n // Focus the right element\n focusItem();\n };\n\n expose({\n focusItem,\n });\n\n const { computedStyle } = useDynamicMenuSize(subMenuItemListRef, visibleSubMenuIndex, showSubMenu);\n\n return {\n // Values\n menuItemListRef,\n menuItemListWrapperRef,\n subMenuItemListRef,\n menuItemRef,\n\n computedData,\n computedStyle,\n\n focusedIndex,\n subMenuFocusedIndex,\n\n showSubMenu,\n visibleSubMenuIndex,\n\n // Methods\n menuItemClick,\n closeMenu,\n focusPrevious,\n focusNext,\n focusRight,\n focusLeft,\n onBackButton,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu-item-list.scss\" />\n","<template>\n <div\n :class=\"computedClasses\"\n class=\"b-menu\"\n data-testid=\"menu\"\n @keydown.down=\"onKeyDown\"\n @keydown.up=\"onKeyUp\"\n @keydown.esc=\"closeMenu()\"\n >\n <bento-toggle-button\n ref=\"menuButtonRef\"\n aria-haspopup=\"true\"\n v-bind=\"computedButtonPropsWithDefaults\"\n :aria-controls=\"showMenu ? menuId : null\"\n :toggled=\"showMenu\"\n :inverse=\"isInverseColorSet\"\n @click=\"toggleShowMenu\"\n >\n <template v-if=\"!hasSlot('default') || hasSlot('iconLeft')\" #iconLeft>\n <slot name=\"iconLeft\">\n <options-vertical-icon :title=\"t('menuButton')\" />\n </slot>\n </template>\n <template v-if=\"hasSlot('default')\" #default>\n <slot />\n </template>\n <template v-if=\"hasSlot('default')\" #iconRight>\n <chevron-down-icon />\n </template>\n </bento-toggle-button>\n\n <bento-teleport v-if=\"menuButtonRef\" :disabled=\"!teleport\">\n <bento-popover\n v-if=\"menuButtonRef\"\n :id=\"menuId\"\n ref=\"popoverRef\"\n :role=\"null\"\n :open=\"showMenu\"\n class=\"b-menu__popover\"\n :style=\"computedMenuWidth\"\n :target-element=\"menuButtonRef\"\n :position=\"menuPosition\"\n :fixed-positioning=\"menuFixedPositioning\"\n :fallback-position=\"[\n 'bottom-start',\n 'bottom-end',\n 'top-start',\n 'top-end',\n 'right-start',\n 'right-end',\n 'left-start',\n 'left-end',\n ]\"\n :teleport=\"teleport\"\n without-space\n >\n <menu-item-list\n ref=\"menuItemListRef\"\n :close-menu-on-item-select=\"closeMenuOnItemSelect\"\n :data=\"data\"\n :focus-last-element=\"isLastElementFocused\"\n @close=\"closeMenu\"\n @menu-item-click=\"menuItemClick\"\n />\n </bento-popover>\n </bento-teleport>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoToggleButton } from '@/components/button';\n import { DIVIDER_INVERSE_INJECTION_KEY } from '@/components/divider/divider.keys';\n import { BentoPopover, BentoPopoverPositions } from '@/components/popover';\n import { useClickOutside, useHasSlot } from '@/composables';\n import { generateUid } from '@/core/utils/ts';\n import { BentoTeleport } from '@/internal';\n import { useI18n } from '@/utils/ts/i18n';\n import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\n import ChevronDownIcon from '@adyen/ui-assets-icons-16/vue/chevron-down';\n import OptionsVerticalIcon from '@adyen/ui-assets-icons-16/vue/options-vertical';\n import { computed, inject, nextTick, onMounted, provide, ref, useSlots } from 'vue';\n import { MenuItemList } from './components';\n import { MENU_INVERSE_INJECTION_KEY } from './menu.keys';\n import { BentoMenuButtonProps, BentoMenuEvent, BentoMenuProps } from './menu.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n button: { default: () =>\n ({\n variant: 'secondary',\n }) as BentoMenuButtonProps },\n closeMenuOnItemSelect: { type: Boolean, default: true },\n data: null,\n disableArrowDownOpeningMenu: { type: Boolean, default: false },\n menuPosition: { default: BentoPopoverPositions.BOTTOM_START },\n menuFixedPositioning: { type: Boolean, default: false },\n menuWidth: { default: null },\n revertFocusToButton: { type: Boolean, default: true },\n teleport: { type: Boolean, default: false },\n closeOnClickOutsideOptions: { default: undefined }\n});\n\n const emit = defineEmits([\"menu-item-click\", \"click-outside\"]);\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const menuButtonRef = ref(null);\n const menuItemListRef = ref(null);\n const showMenu = ref(false);\n const isLastElementFocused = ref(false);\n const popoverRef = ref<HTMLElement>(null);\n const menuId = generateUid('menu');\n\n const isInverseColorSet = inject(MENU_INVERSE_INJECTION_KEY, ref(false));\n provide(DIVIDER_INVERSE_INJECTION_KEY, isInverseColorSet);\n\n const computedClasses = computed(() => ({\n 'b-menu--inverse': isInverseColorSet.value,\n }));\n\n const computedMenuWidth = computed(() => (props.menuWidth ? { width: `${props.menuWidth}px` } : null));\n const computedButtonPropsWithDefaults = computed<BentoMenuButtonProps>(() => {\n if (!props?.button) {\n return undefined;\n }\n return {\n variant: 'secondary',\n ...props.button,\n };\n });\n\n const openMenu = () => {\n showMenu.value = true;\n emit(BentoMenuEvent.OPEN);\n };\n\n const closeMenu = async (revertFocus = props.revertFocusToButton) => {\n if (!showMenu.value) {\n return;\n }\n\n showMenu.value = false;\n\n if (revertFocus) {\n // ensure that menu is closed and re-rendering is completed before focusing\n await nextTick();\n\n menuButtonRef.value?.$el?.focus();\n }\n\n emit(BentoMenuEvent.CLOSE);\n };\n\n const toggleShowMenu = (e: MouseEvent) => {\n e.stopPropagation();\n if (!showMenu.value) {\n openMenu();\n } else {\n closeMenu();\n }\n };\n\n const onKeyDown = (event: KeyboardEvent) => {\n event.preventDefault();\n\n isLastElementFocused.value = false;\n if (!props.disableArrowDownOpeningMenu) {\n openMenu();\n }\n };\n\n const onKeyUp = (event: KeyboardEvent) => {\n event.preventDefault();\n\n isLastElementFocused.value = true;\n openMenu();\n };\n\n const menuItemClick = () => {\n emit('menu-item-click');\n };\n\n // Ignore the events inside the Button and the Popover\n useClickOutside(\n popoverRef,\n () => {\n closeMenu();\n emit('click-outside');\n },\n {\n ...props.closeOnClickOutsideOptions,\n ignore: [menuButtonRef, ...(props.closeOnClickOutsideOptions?.ignore ?? [])],\n }\n );\n\n defineExpose({\n /**\n * Control to enable programmatic closing of the menu\n */\n closeMenu,\n });\n\n onMounted(() => {\n if (hasSlot('iconRight')) {\n printDevelopmentWarning(\n '\"bento-menu\" no longer supports the \"iconRight\" slot. The right-aligned icon is now fixed by design.'\n );\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Menu component to render a series of buttons. Csan render nested submenus.\n *\n * @example\n * import { BentoMenu } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoMenu },\n * template: `\n * <bento-menu\n * :data=[\n * { text: 'Menu item text', handler: () => { some code here } },\n * { text: 'Another menu item text', handler: () => { some other code here }, critical: true }\n * ]\n * />\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-menu',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu.scss\" />\n"],"names":["MENU_INVERSE_INJECTION_KEY","uuid","_sfc_main$5","_sfc_main$4","defineComponent","BaseButton","BentoTypography","ChevronRightIcon","BentoBaseButtonEvent","props","emit","conditionalClasses","computed","computedSecondaryText","truncate","e","BentoMenuEvent","BentoMenuEvent2","DATA_GRID_CELL_MENU_REGISTERING_INJECTION_KEY","__default__$1","menuListContainerRef","ref","menuListContainerEvents","registeringAndMousingOut","inject","registerMenuContainerElement","_sfc_main$2","messages","BentoDivider","MenuItem","MenuListContainer","subMenuItemListRefLocal","subMenuFocusedIndex","numberOfItems","closeMenu","onBackButton","computedItems","items","_a","el","ChevronLeftIcon","focusItem","_e","_d","_c","_b","onMounted","focusPrevious","focusNext","useDynamicMenuSize","subMenuItemListRef","visibleSubMenuIndex","showSubMenu","subMenuWidth","subMenuHeight","measureSubMenuStyle","element","parent","ghost","unwrappedWidth","clampedWidth","height","watch","newIndex","nextTick","subMenuElement","style","_sfc_main$1","SubMenuItemList","expose","menuItemRef","menuItemListRef","menuItemListWrapperRef","focusedIndex","hasMenuItemsWithIcon","computedData","indent","menuItemClick","item","index","focusRight","focusLeft","computedStyle","__default__","slots","useSlots","hasSlot","useHasSlot","t","useI18n","menuButtonRef","showMenu","isLastElementFocused","popoverRef","menuId","generateUid","isInverseColorSet","provide","DIVIDER_INVERSE_INJECTION_KEY","computedClasses","computedMenuWidth","computedButtonPropsWithDefaults","openMenu","revertFocus","toggleShowMenu","onKeyDown","event","onKeyUp","useClickOutside","printDevelopmentWarning"],"mappings":";;;;;;;;;;;;;;;;;;AAAa,MAAAA,KAAA,OAAA,kCAAA;ACOb,IAAAC,IAAA;AAEA,MAAAC,KAAA;AAAA,EACA,eAAA;AACA,SAAA,OAAAD,EAAA,SAAA,GACAA,KAAA;AAAA,EACA;AACA;;;;;;;;;;;;uBCqBAE,KAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA,EAAA,YAAAC,IAAA,iBAAAC,GAAA,kBAAAC,GAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IACA,MAAA;AAAA,MAIA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,SAAA;AAAA,MAIA,M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yB,GAG7BwF,IAAA,CAAAzF,MAAA;AACI,MAAAA,EAAA,gBAAA,GACA4E,EAAA,QAGIzD,EAAA,IAFAoE,EAAA;AAAA,IAGJ,GAGJG,IAAA,CAAAC,MAAA;AACI,MAAAA,EAAA,eAAA,GAEAd,EAAA,QAAA,IACAnF,EAAA,+BACI6F,EAAA;AAAA,IACJ,GAGJK,IAAA,CAAAD,MAAA;AACI,MAAAA,EAAA,eAAA,GAEAd,EAAA,QAAA,IACAU,EAAA;AAAA,IAAS,GAGbzB,IAAA,MAAA;AACI,MAAAnE,EAAA,iBAAA;AAAA,IAAsB;AAI1B,WAAAkG;AAAA,MAAAf;AAAA,MACI,MAAA;AAEI,QAAA3D,EAAA,GACAxB,EAAA,eAAA;AAAA,MAAoB;AAAA,MACxB;AAAA,QACA,GAAAD,EAAA;AAAA,QACa,QAAA,CAAAiF,GAAA,KAAApD,IAAA7B,EAAA,+BAAA,gBAAA6B,EAAA,WAAA,CAAA,CAAA;AAAA,MACkE;AAAA,IAC/E,GAGJ+B,EAAA;AAAA;AAAA;AAAA;AAAA,MAAa,WAAAnC;AAAA,IAIT,CAAA,GAGJY,EAAA,MAAA;AACI,MAAAwC,EAAA,WAAA,KACIuB;AAAA,QAAA;AAAA,MACI;AAAA,IAER,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"menu.dX3_vU05.js","sources":["../../src/components/menu/menu.keys.ts","../../../ui-assets/icons-16/dist/vue/options-vertical.vue","../../src/components/menu/components/menu-item/menu-item.vue","../../src/components/menu/menu.types.ts","../../src/components/data-grid/components/data-grid-cell/data-grid-cell.keys.ts","../../src/components/menu/components/menu-list-container/menu-list-container.vue","../../src/components/menu/components/sub-menu-item-list/sub-menu-item-list.vue","../../src/components/menu/composables/use-dynamic-menu-size/use-dynamic-menu-size.ts","../../src/components/menu/components/menu-item-list/menu-item-list.vue","../../src/components/menu/menu.vue"],"sourcesContent":["export const MENU_INVERSE_INJECTION_KEY = Symbol('menu inverse style injection key');\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#001222\" d=\"M8 4C8.29667 4 8.58668 3.91203 8.83335 3.74721C9.08003 3.58238 9.27229 3.34811 9.38582 3.07403C9.49935 2.79994 9.52906 2.49834 9.47118 2.20737C9.4133 1.91639 9.27044 1.64912 9.06066 1.43934C8.85088 1.22956 8.58361 1.0867 8.29264 1.02882C8.00167 0.970945 7.70006 1.00065 7.42598 1.11418C7.15189 1.22771 6.91762 1.41997 6.7528 1.66665C6.58797 1.91332 6.5 2.20333 6.5 2.5C6.5 2.89783 6.65803 3.27936 6.93934 3.56066C7.22064 3.84197 7.60218 4 8 4Z\"/><path fill=\"#001222\" d=\"M8 15C8.29667 15 8.58668 14.912 8.83335 14.7472C9.08003 14.5824 9.27229 14.3481 9.38582 14.074C9.49935 13.7999 9.52906 13.4983 9.47118 13.2074C9.4133 12.9164 9.27044 12.6491 9.06066 12.4393C8.85088 12.2296 8.58361 12.0867 8.29264 12.0288C8.00167 11.9709 7.70006 12.0007 7.42598 12.1142C7.15189 12.2277 6.91762 12.42 6.7528 12.6666C6.58797 12.9133 6.5 13.2033 6.5 13.5C6.5 13.8978 6.65803 14.2794 6.93934 14.5607C7.22064 14.842 7.60218 15 8 15Z\"/><path fill=\"#001222\" d=\"M8.83335 9.24721C8.58668 9.41203 8.29667 9.5 8 9.5C7.60218 9.5 7.22064 9.34197 6.93934 9.06066C6.65803 8.77936 6.5 8.39783 6.5 8C6.5 7.70333 6.58797 7.41332 6.7528 7.16665C6.91762 6.91997 7.15189 6.72771 7.42598 6.61418C7.70006 6.50065 8.00167 6.47094 8.29264 6.52882C8.58361 6.5867 8.85088 6.72956 9.06066 6.93934C9.27044 7.14912 9.4133 7.41639 9.47118 7.70737C9.52906 7.99834 9.49935 8.29994 9.38582 8.57403C9.27229 8.84811 9.08003 9.08238 8.83335 9.24721Z\"/></svg>\n</template>\n<script>\n import '../css/main.css';\n\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n","<template>\n <base-button\n class=\"b-menu-item\"\n role=\"menuitem\"\n :class=\"conditionalClasses\"\n :disabled=\"disabled\"\n tabindex=\"-1\"\n @click=\"onClick\"\n >\n <template v-if=\"icon\" #iconLeft>\n <component :is=\"icon\" class=\"b-menu-item__icon-left\" aria-hidden=\"true\" />\n </template>\n <template #default>\n <bento-typography el=\"span\" variant=\"body\" :stronger=\"isTitle\" class=\"b-menu-item__primary-text\">\n {{ text }}\n </bento-typography>\n <bento-typography v-if=\"computedSecondaryText\" el=\"span\" variant=\"body\" class=\"b-menu-item__secondary-text\">\n {{ computedSecondaryText }}\n </bento-typography>\n </template>\n <template v-if=\"chevron\" #iconRight><chevron-right-icon aria-hidden=\"true\" /></template>\n </base-button>\n</template>\n\n<script lang=\"ts\">\n import { BaseButton, BentoBaseButtonEvent } from '@/components/internal/base-button';\n import { BentoTypography } from '@/components/typography';\n import { truncate } from '@/utils/ts/truncate';\n import ChevronRightIcon from '@adyen/ui-assets-icons-16/vue/chevron-right';\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoMenuItem } from './menu-item.types';\n\n /**\n * Menu item component to render items in a menu. For internal use only.\n */\n export default defineComponent({\n name: 'menu-item',\n components: { BaseButton, BentoTypography, ChevronRightIcon },\n props: {\n /**\n * menu-item text that gets displayed as the main label\n */\n text: {\n type: String,\n required: true,\n },\n /**\n * menu-item action that gets executed when the MeniItem is clicked\n */\n handler: {\n type: Function as PropType<BentoMenuItem['handler']>,\n required: true,\n },\n /**\n * menu-item text that gets displayed as the secondary label\n */\n secondaryText: {\n type: String,\n default: null,\n },\n /**\n * Optional chevron icon displayed to the right of the menu-item\n */\n chevron: {\n type: Boolean,\n default: false,\n },\n /**\n * Optional icon displayed to the left of the menu-item\n */\n icon: {\n // Types for Vue2 (Object) and Vue3 (Function)\n // TODO: Remove Object when fully migrated to Vue3\n type: [Object, Function] as PropType<BentoMenuItem['icon']>,\n default: null,\n },\n /**\n * Disables menu-item button functionality\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays an indent variant od the menu-item\n */\n indent: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays menu-item button as critical\n */\n critical: {\n type: Boolean,\n default: false,\n },\n /**\n * Renders the text in a bold variant\n */\n isTitle: {\n type: Boolean,\n default: false,\n },\n },\n emits: [BentoBaseButtonEvent.CLICK],\n setup(props, { emit }) {\n const MAX_SECONDARY_TEXT_LENGTH = 10;\n\n const conditionalClasses = computed(() => ({\n 'b-menu-item--critical': props.critical,\n 'b-menu-item--indent': props.indent,\n }));\n\n const computedSecondaryText = computed(() => truncate(props.secondaryText, MAX_SECONDARY_TEXT_LENGTH));\n\n const onClick = (e: MouseEvent) => {\n e.stopPropagation();\n props.handler();\n emit(BentoBaseButtonEvent.CLICK);\n };\n\n return {\n // Values\n conditionalClasses,\n computedSecondaryText,\n\n // Methods\n onClick,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu-item.scss\" />\n","import { OnClickOutsideOptions } from '@/directives/click-outside/types';\nimport { BentoButton } from '../button';\nimport { BentoPopoverPositions } from '../popover';\nimport { BentoMenuItem } from './components';\n\nexport * from './components/menu-item/menu-item.types';\n\nexport enum BentoMenuEvent {\n BACK = 'back',\n CLOSE = 'close',\n OPEN = 'open',\n}\n\ntype ButtonProps = InstanceType<typeof BentoButton>['$props'];\n\nexport type BentoMenuButtonProps = {\n variant?: ButtonProps['variant'];\n condensed?: ButtonProps['condensed'];\n disabled?: ButtonProps['disabled'];\n};\n\nexport interface BentoMenuProps {\n /**\n * Object containing props to change the menu button appearance. Accepts the same props present in BentoButton.\n */\n button?: BentoMenuButtonProps;\n /**\n * Controls if the menu should close when an item is clicked.\n * Defaults to `true`.\n */\n closeMenuOnItemSelect?: boolean;\n /**\n * The data to be displayed in the list\n */\n data: BentoMenuItem[];\n /**\n * Disables opening the menu when the down arrow key is pressed.\n */\n disableArrowDownOpeningMenu?: boolean;\n /**\n * The position of where the menu should open.\n */\n menuPosition?: BentoPopoverPositions | `${BentoPopoverPositions}`;\n /**\n * Instructs the menu popover to be visible outside of the containing container.\n * @see {@link https://floating-ui.com/docs/usefloating#strategy}\n */\n menuFixedPositioning?: boolean;\n /**\n * Sets a custom width for the menu popover.\n */\n menuWidth?: number;\n /**\n * Returns focus to the menu button after popover is closed.\n * Disable if focus management is delegated to the parent component.\n * Defaults to `true`.\n */\n revertFocusToButton?: boolean;\n /**\n * Can be used to set the inner teleport component to render the menu's popover in the root `body` DOM node\n * (or `dialog` if popover is inside a dialog).\n */\n teleport?: boolean;\n /**\n * Can be used to set the inner teleport component to render the menu's popover in the root `body` DOM node\n * (or `dialog` if popover is inside a dialog).\n *\n * @see {@link OnClickOutsideOptions}\n */\n closeOnClickOutsideOptions?: OnClickOutsideOptions;\n}\n","export const DATA_GRID_CELL_MENU_REGISTERING_INJECTION_KEY = Symbol('menu registering injection key');\n","<template>\n <div\n ref=\"menuListContainerRef\"\n class=\"b-menu-list-container\"\n data-testid=\"menu-list-container\"\n v-on=\"menuListContainerEvents\"\n ><slot></slot\n ></div>\n</template>\n\n<script setup lang=\"ts\">\n import { DATA_GRID_CELL_MENU_REGISTERING_INJECTION_KEY } from '@/components/data-grid/components/data-grid-cell/data-grid-cell.keys';\n import { inject, ref } from 'vue';\n import type { DataGridCellRegisterMenu } from '@/components/data-grid/components/data-grid-cell/data-grid-cell.types';\n\n const menuListContainerRef = ref<HTMLDivElement>();\n const menuListContainerEvents = ref({});\n const registeringAndMousingOut = inject<DataGridCellRegisterMenu | false>(\n DATA_GRID_CELL_MENU_REGISTERING_INJECTION_KEY,\n false\n );\n\n // This is needed by the DataGridCell component in order to keep track of if a teleported menu\n // is being hovered over in the DataGridCellActions.\n if (registeringAndMousingOut) {\n const { registerMenuContainerElement } = registeringAndMousingOut;\n registerMenuContainerElement(menuListContainerRef);\n menuListContainerEvents.value = {\n mouseleave: registeringAndMousingOut?.menuMouseLeave,\n };\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * Menu list container component to set the correct styling in a menu list. For internal use only.\n */\n export default {\n name: 'bento-menu-list-container',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu-list-container.scss\" />\n","<template>\n <transition name=\"b-sub-menu-item-list__transition\" appear>\n <menu-list-container class=\"b-sub-menu-item-list\">\n <ul\n ref=\"subMenuItemListRefLocal\"\n role=\"menu\"\n class=\"b-sub-menu-item-list__list\"\n @keydown.down.stop=\"focusNext\"\n @keydown.up.stop=\"focusPrevious\"\n @keydown.esc.stop=\"onBackButton\"\n >\n <li v-for=\"(item, index) in computedItems\" :key=\"`sub-menu-item-list-item-${index}`\" role=\"none\">\n <menu-item\n :text=\"item.text\"\n :handler=\"item.handler\"\n :secondary-text=\"item.secondaryText\"\n :icon=\"item.icon\"\n :is-title=\"item.isTitle\"\n :disabled=\"item.disabled\"\n :critical=\"item.critical\"\n :indent=\"item.indent\"\n :tabindex=\"index === subMenuFocusedIndex ? '0' : '-1'\"\n @click=\"item.clickHandler\"\n />\n <bento-divider v-if=\"item.addDivider\" class=\"b-sub-menu-item-list__divider\" />\n </li>\n </ul>\n </menu-list-container>\n </transition>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, onMounted, PropType, ref } from 'vue';\n import { BentoDivider } from '@/components/divider';\n import { BentoMenuItem, MenuItem } from '../menu-item';\n import MenuListContainer from '../menu-list-container/menu-list-container.vue';\n import ChevronLeftIcon from '@adyen/ui-assets-icons-16/vue/chevron-left';\n import { BentoMenuEvent } from '../../menu.types';\n import messages from '../../messages.json';\n\n /**\n * SubMenuItemList component to render a submenu with the sliding transition. For internal use only.\n */\n export default defineComponent({\n i18n: { messages },\n name: 'sub-menu-item-list',\n components: { BentoDivider, MenuItem, MenuListContainer },\n props: {\n items: {\n type: Array as PropType<BentoMenuItem[]>,\n required: true,\n },\n title: {\n type: String,\n required: true,\n },\n },\n emits: [BentoMenuEvent.CLOSE, BentoMenuEvent.BACK],\n setup(props, { emit }) {\n const subMenuItemListRefLocal = ref(null);\n const subMenuFocusedIndex = ref(0);\n const numberOfItems = ref(props.items.length);\n\n const closeMenu = () => emit(BentoMenuEvent.CLOSE);\n\n const onBackButton = () => emit(BentoMenuEvent.BACK);\n\n const computedItems = computed(() => {\n const items = props.items?.map(el => ({\n ...el,\n indent: !el.icon,\n isTitle: false,\n clickHandler: closeMenu,\n }));\n return [\n {\n text: props.title,\n secondaryText: null,\n critical: false,\n icon: ChevronLeftIcon,\n isTitle: true,\n disabled: false,\n indent: false,\n handler: onBackButton,\n clickHandler: onBackButton,\n addDivider: true,\n },\n ...items,\n ];\n });\n\n const focusItem = async () => {\n subMenuItemListRefLocal.value?.children?.[subMenuFocusedIndex.value]?.children?.[0]?.focus();\n };\n\n onMounted(async () => {\n // Using setTimeout otherwise the sliding animation doesn't work anymore. The timeout imer is the same as the transition time (0.15s)\n setTimeout(() => focusItem(), 150);\n });\n\n const focusPrevious = () => {\n if (subMenuFocusedIndex.value > 0) {\n subMenuFocusedIndex.value -= 1;\n if (computedItems.value[subMenuFocusedIndex.value].disabled) {\n focusPrevious();\n }\n } else {\n subMenuFocusedIndex.value = numberOfItems.value;\n }\n focusItem();\n };\n\n const focusNext = () => {\n if (subMenuFocusedIndex.value < numberOfItems.value) {\n subMenuFocusedIndex.value += 1;\n if (computedItems.value[subMenuFocusedIndex.value].disabled) {\n focusNext();\n }\n } else {\n subMenuFocusedIndex.value = 0;\n }\n focusItem();\n };\n\n return {\n // Enums\n BentoMenuEvent,\n\n // Values\n subMenuItemListRefLocal,\n subMenuFocusedIndex,\n ChevronLeftIcon,\n computedItems,\n\n // Methods\n closeMenu,\n onBackButton,\n focusPrevious,\n focusNext,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./sub-menu-item-list.scss\" />\n","import { computed, type CSSProperties, nextTick, type Ref, ref, watch } from 'vue';\n\n// Helper type for the expected shape of the sub-menu ref\ninterface SubMenuRef {\n $el: HTMLElement;\n}\n\n/**\n * A composable that dynamically calculates the width and height for a menu container\n * based on the content of a conditionally rendered sub-menu.\n *\n * @param subMenuItemListRef A ref to the sub-menu component instance(s).\n * @param visibleSubMenuIndex A ref indicating which sub-menu is visible.\n * @param showSubMenu A ref indicating if any sub-menu is visible.\n * @returns A computed style object to be bound to the menu container.\n */\nexport function useDynamicMenuSize(\n subMenuItemListRef: Ref<SubMenuRef[] | null>,\n visibleSubMenuIndex: Ref<number | null>,\n showSubMenu: Ref<boolean>\n) {\n const MAX_MENU_WIDTH = 350;\n const MIN_MENU_WIDTH = 150;\n\n const subMenuWidth = ref(0);\n const subMenuHeight = ref(0);\n\n /**\n * Calculates an element's dimensions in stages using an invisible clone\n * to prevent visual flicker.\n *\n * 1. **Clone**: Creates a 'ghost' copy of the element and adds it to the\n * DOM invisibly.\n * 2. **Measure Ideal Width**: Sets the ghost's width to 'max-content' to find\n * its natural, unwrapped width.\n * 3. **Calculate Final Width**: Clamps the ideal width between the defined\n * MIN and MAX constants.\n * 4. **Measure Final Height**: Applies the final clamped width to the ghost,\n * allowing content to wrap, and then measures the resulting height.\n * 5. **Cleanup**: Removes the ghost element from the DOM.\n */\n const measureSubMenuStyle = (element: HTMLElement) => {\n if (!element || !element.parentElement) {\n return;\n }\n\n // Mount it on the parent element to allow proper height size, otherwise it will be 0\n const parent = element.parentElement;\n\n // Measure the unwrapped width\n const ghost = element.cloneNode(true) as HTMLElement;\n ghost.style.position = 'absolute';\n ghost.style.visibility = 'hidden';\n parent.appendChild(ghost);\n\n // Measure the unwrapped width\n ghost.style.width = 'max-content';\n const unwrappedWidth = ghost.offsetWidth;\n\n // Calculate and store the FINAL clamped width\n const clampedWidth = Math.max(MIN_MENU_WIDTH, Math.min(unwrappedWidth, MAX_MENU_WIDTH));\n subMenuWidth.value = clampedWidth;\n\n // Measure the wrapped height using the final width\n ghost.style.width = `${clampedWidth}px`;\n const height = ghost.offsetHeight;\n\n // Update the height ref with the correct, wrapped height\n subMenuHeight.value = height;\n\n parent.removeChild(ghost);\n // Update the height ref with the correct, wrapped height\n subMenuHeight.value = height;\n };\n\n watch([visibleSubMenuIndex, showSubMenu], async ([newIndex]) => {\n if (newIndex !== null) {\n await nextTick();\n\n const subMenuElement = subMenuItemListRef.value?.[0]?.$el;\n if (subMenuElement) {\n measureSubMenuStyle(subMenuElement);\n }\n } else {\n subMenuWidth.value = 0;\n subMenuHeight.value = 0;\n }\n });\n\n const computedStyle = computed<CSSProperties>(() => {\n const style: CSSProperties = { width: 'max-content' };\n\n if (showSubMenu.value) {\n if (subMenuHeight.value > 0) {\n style.height = `${subMenuHeight.value}px`;\n }\n if (subMenuWidth.value > 0) {\n style.width = `${subMenuWidth.value}px`;\n }\n }\n\n return style;\n });\n\n return { computedStyle };\n}\n","<template>\n <menu-list-container ref=\"menuItemListWrapperRef\" :style=\"computedStyle\">\n <ul\n ref=\"menuItemListRef\"\n class=\"b-menu-item-list\"\n role=\"menu\"\n @keydown.down=\"focusNext\"\n @keydown.up=\"focusPrevious\"\n @keydown.esc=\"closeMenu\"\n @keydown.tab=\"closeMenu\"\n >\n <li\n v-for=\"(item, index) in computedData\"\n :key=\"`menu-item-${index}`\"\n ref=\"menuItemRef\"\n class=\"b-menu-item-list__item\"\n role=\"none\"\n @keydown.right=\"focusRight(item, index)\"\n @keydown.left=\"focusLeft()\"\n >\n <menu-item\n :text=\"item.text\"\n :handler=\"!item.items?.length ? item.handler : () => null\"\n :secondary-text=\"item.secondaryText\"\n :icon=\"item.icon\"\n :chevron=\"!!item.items?.length\"\n :disabled=\"item.disabled\"\n :critical=\"item.critical\"\n :indent=\"item.indent\"\n :tabindex=\"index === subMenuFocusedIndex ? '0' : '-1'\"\n :aria-haspopup=\"!!item.items?.length\"\n :aria-expanded=\"showSubMenu && visibleSubMenuIndex === index\"\n @click=\"menuItemClick(item, index)\"\n />\n <bento-divider v-if=\"item.addDivider\" class=\"b-menu-item-list__divider\" />\n <sub-menu-item-list\n v-if=\"item.items?.length && showSubMenu && visibleSubMenuIndex === index\"\n ref=\"subMenuItemListRef\"\n :items=\"item.items\"\n :title=\"item.text\"\n @back=\"onBackButton\"\n @close=\"closeMenu\"\n />\n </li>\n </ul>\n </menu-list-container>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, nextTick, PropType, ref } from 'vue';\n import { isVue3 } from 'vue-demi';\n import { BentoDivider } from '@/components/divider';\n import { BentoMenuItem, MenuItem } from '../menu-item';\n import { BentoMenuEvent } from '../../menu.types';\n import MenuListContainer from '../menu-list-container/menu-list-container.vue';\n import SubMenuItemList from '../sub-menu-item-list/sub-menu-item-list.vue';\n import { useDynamicMenuSize } from '../../composables';\n\n /**\n * MenuItem list to be used in the Menu component. For internal use only.\n */\n export default defineComponent({\n name: 'menu-item-list',\n components: { BentoDivider, MenuItem, MenuListContainer, SubMenuItemList },\n props: {\n /**\n * The data to be displayed in the list\n */\n data: {\n type: Array as PropType<BentoMenuItem[]>,\n required: true,\n },\n /**\n * Displays the menu-items of the list in the indent variant. Only applies to elements that don't have an icon to their left.\n */\n indentItems: {\n type: Boolean,\n default: false,\n },\n /**\n * If set to true, focuses the last item on the list instead of the first. Used for accessibility purposes when the menu is opened with the 'up' arrow key.\n */\n focusLastElement: {\n type: Boolean,\n default: false,\n },\n /**\n * If set to true, closes the menu when an item is clicked.\n */\n closeMenuOnItemSelect: {\n type: Boolean,\n default: true,\n },\n },\n emits: [BentoMenuEvent.CLOSE, 'menu-item-click'],\n setup(props, { emit, expose }) {\n const menuItemRef = ref(null);\n const menuItemListRef = ref(null);\n const menuItemListWrapperRef = ref(null);\n const subMenuItemListRef = ref(null);\n const showSubMenu = ref(false);\n const visibleSubMenuIndex = ref(null);\n const focusedIndex = ref(props.focusLastElement ? props.data.length - 1 : 0);\n const subMenuFocusedIndex = ref(0);\n const numberOfItems = ref(props.data.length - 1);\n const hasMenuItemsWithIcon = computed(() => props.data.some(el => el.icon));\n\n const computedData = computed(() => {\n if (props.indentItems || hasMenuItemsWithIcon.value) {\n return props.data.map(el => {\n let indent = false;\n if (!el.icon) {\n indent = true;\n }\n return {\n ...el,\n indent,\n };\n });\n }\n return props.data;\n });\n\n const focusItem = async () => {\n // vue 3 requires nextTick to be called before an item can be focused\n // this function does not need to be awaited itself\n\n if (isVue3) {\n await nextTick();\n }\n\n menuItemListRef.value?.children[focusedIndex.value]?.children[0]?.focus();\n };\n\n const closeMenu = () => emit(BentoMenuEvent.CLOSE);\n\n const menuItemClick = (item: BentoMenuItem, index: number) => {\n if (item.items) {\n visibleSubMenuIndex.value = index;\n showSubMenu.value = true;\n\n return;\n }\n\n visibleSubMenuIndex.value = index;\n showSubMenu.value = false;\n\n if (!item.skipClose && props.closeMenuOnItemSelect !== false) {\n closeMenu();\n }\n\n emit('menu-item-click');\n };\n\n const focusPrevious = () => {\n if (focusedIndex.value > 0) {\n focusedIndex.value -= 1;\n if (computedData.value[focusedIndex.value].disabled) {\n focusPrevious();\n }\n } else {\n focusedIndex.value = numberOfItems.value;\n }\n focusItem();\n };\n\n const focusNext = () => {\n if (focusedIndex.value < numberOfItems.value) {\n focusedIndex.value += 1;\n if (computedData.value[focusedIndex.value].disabled) {\n focusNext();\n }\n } else {\n focusedIndex.value = 0;\n }\n focusItem();\n };\n\n const focusRight = (item, index) => {\n if (item?.items?.length) {\n visibleSubMenuIndex.value = index;\n showSubMenu.value = true;\n }\n };\n\n const focusLeft = () => {\n if (visibleSubMenuIndex.value && showSubMenu.value) {\n visibleSubMenuIndex.value = null;\n showSubMenu.value = false;\n }\n };\n\n const onBackButton = () => {\n showSubMenu.value = false;\n visibleSubMenuIndex.value = null;\n // Focus the right element\n focusItem();\n };\n\n expose({\n focusItem,\n });\n\n const { computedStyle } = useDynamicMenuSize(subMenuItemListRef, visibleSubMenuIndex, showSubMenu);\n\n return {\n // Values\n menuItemListRef,\n menuItemListWrapperRef,\n subMenuItemListRef,\n menuItemRef,\n\n computedData,\n computedStyle,\n\n focusedIndex,\n subMenuFocusedIndex,\n\n showSubMenu,\n visibleSubMenuIndex,\n\n // Methods\n menuItemClick,\n closeMenu,\n focusPrevious,\n focusNext,\n focusRight,\n focusLeft,\n onBackButton,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu-item-list.scss\" />\n","<template>\n <div\n :class=\"computedClasses\"\n class=\"b-menu\"\n data-testid=\"menu\"\n @keydown.down=\"onKeyDown\"\n @keydown.up=\"onKeyUp\"\n @keydown.esc=\"closeMenu()\"\n >\n <bento-toggle-button\n ref=\"menuButtonRef\"\n aria-haspopup=\"true\"\n v-bind=\"computedButtonPropsWithDefaults\"\n :aria-controls=\"showMenu ? menuId : null\"\n :aria-label=\"getAriaLabel($attrs)\"\n :toggled=\"showMenu\"\n :inverse=\"isInverseColorSet\"\n @click=\"toggleShowMenu\"\n >\n <template v-if=\"!hasSlot('default') || hasSlot('iconLeft')\" #iconLeft>\n <slot name=\"iconLeft\">\n <options-vertical-icon :title=\"t('menuButton')\" />\n </slot>\n </template>\n <template v-if=\"hasSlot('default')\" #default>\n <slot />\n </template>\n <template v-if=\"hasSlot('default')\" #iconRight>\n <chevron-down-icon />\n </template>\n </bento-toggle-button>\n\n <bento-teleport v-if=\"menuButtonRef\" :disabled=\"!teleport\">\n <bento-popover\n v-if=\"menuButtonRef\"\n :id=\"menuId\"\n ref=\"popoverRef\"\n :role=\"null\"\n :open=\"showMenu\"\n class=\"b-menu__popover\"\n :style=\"computedMenuWidth\"\n :target-element=\"menuButtonRef\"\n :position=\"menuPosition\"\n :fixed-positioning=\"menuFixedPositioning\"\n :fallback-position=\"[\n 'bottom-start',\n 'bottom-end',\n 'top-start',\n 'top-end',\n 'right-start',\n 'right-end',\n 'left-start',\n 'left-end',\n ]\"\n :teleport=\"teleport\"\n without-space\n >\n <menu-item-list\n ref=\"menuItemListRef\"\n :close-menu-on-item-select=\"closeMenuOnItemSelect\"\n :data=\"data\"\n :focus-last-element=\"isLastElementFocused\"\n @close=\"closeMenu\"\n @menu-item-click=\"menuItemClick\"\n />\n </bento-popover>\n </bento-teleport>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoToggleButton } from '@/components/button';\n import { DIVIDER_INVERSE_INJECTION_KEY } from '@/components/divider/divider.keys';\n import { BentoPopover, BentoPopoverPositions } from '@/components/popover';\n import { useClickOutside, useHasSlot } from '@/composables';\n import { generateUid } from '@/core/utils/ts';\n import { BentoTeleport } from '@/internal';\n import { useI18n } from '@/utils/ts/i18n';\n import { printDevelopmentWarning } from '@/utils/ts/print-development-warning';\n import ChevronDownIcon from '@adyen/ui-assets-icons-16/vue/chevron-down';\n import OptionsVerticalIcon from '@adyen/ui-assets-icons-16/vue/options-vertical';\n import { computed, type HTMLAttributes, inject, nextTick, onMounted, provide, ref, useSlots } from 'vue';\n import { MenuItemList } from './components';\n import { MENU_INVERSE_INJECTION_KEY } from './menu.keys';\n import { BentoMenuButtonProps, BentoMenuEvent, BentoMenuProps } from './menu.types';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n button: { default: () =>\n ({\n variant: 'secondary',\n }) as BentoMenuButtonProps },\n closeMenuOnItemSelect: { type: Boolean, default: true },\n data: null,\n disableArrowDownOpeningMenu: { type: Boolean, default: false },\n menuPosition: { default: BentoPopoverPositions.BOTTOM_START },\n menuFixedPositioning: { type: Boolean, default: false },\n menuWidth: { default: null },\n revertFocusToButton: { type: Boolean, default: true },\n teleport: { type: Boolean, default: false },\n closeOnClickOutsideOptions: { default: undefined }\n});\n\n const emit = defineEmits([\"menu-item-click\", \"click-outside\"]);\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const menuButtonRef = ref(null);\n const menuItemListRef = ref(null);\n const showMenu = ref(false);\n const isLastElementFocused = ref(false);\n const popoverRef = ref<HTMLElement>(null);\n const menuId = generateUid('menu');\n\n const isInverseColorSet = inject(MENU_INVERSE_INJECTION_KEY, ref(false));\n provide(DIVIDER_INVERSE_INJECTION_KEY, isInverseColorSet);\n\n const computedClasses = computed(() => ({\n 'b-menu--inverse': isInverseColorSet.value,\n }));\n\n const computedMenuWidth = computed(() => (props.menuWidth ? { width: `${props.menuWidth}px` } : null));\n const computedButtonPropsWithDefaults = computed<BentoMenuButtonProps>(() => {\n if (!props?.button) {\n return undefined;\n }\n return {\n variant: 'secondary',\n ...props.button,\n };\n });\n\n const getAriaLabel = (attributes: HTMLAttributes) => attributes?.['aria-label'];\n\n const openMenu = () => {\n showMenu.value = true;\n emit(BentoMenuEvent.OPEN);\n };\n\n const closeMenu = async (revertFocus = props.revertFocusToButton) => {\n if (!showMenu.value) {\n return;\n }\n\n showMenu.value = false;\n\n if (revertFocus) {\n // ensure that menu is closed and re-rendering is completed before focusing\n await nextTick();\n\n menuButtonRef.value?.$el?.focus();\n }\n\n emit(BentoMenuEvent.CLOSE);\n };\n\n const toggleShowMenu = (e: MouseEvent) => {\n e.stopPropagation();\n if (!showMenu.value) {\n openMenu();\n } else {\n closeMenu();\n }\n };\n\n const onKeyDown = (event: KeyboardEvent) => {\n event.preventDefault();\n\n isLastElementFocused.value = false;\n if (!props.disableArrowDownOpeningMenu) {\n openMenu();\n }\n };\n\n const onKeyUp = (event: KeyboardEvent) => {\n event.preventDefault();\n\n isLastElementFocused.value = true;\n openMenu();\n };\n\n const menuItemClick = () => {\n emit('menu-item-click');\n };\n\n // Ignore the events inside the Button and the Popover\n useClickOutside(\n popoverRef,\n () => {\n closeMenu();\n emit('click-outside');\n },\n {\n ...props.closeOnClickOutsideOptions,\n ignore: [menuButtonRef, ...(props.closeOnClickOutsideOptions?.ignore ?? [])],\n }\n );\n\n defineExpose({\n /**\n * Control to enable programmatic closing of the menu\n */\n closeMenu,\n });\n\n onMounted(() => {\n if (hasSlot('iconRight')) {\n printDevelopmentWarning(\n '\"bento-menu\" no longer supports the \"iconRight\" slot. The right-aligned icon is now fixed by design.'\n );\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Menu component to render a series of buttons. Csan render nested submenus.\n *\n * @example\n * import { BentoMenu } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoMenu },\n * template: `\n * <bento-menu\n * :data=[\n * { text: 'Menu item text', handler: () => { some code here } },\n * { text: 'Another menu item text', handler: () => { some other code here }, critical: true }\n * ]\n * />\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-menu',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu.scss\" />\n"],"names":["MENU_INVERSE_INJECTION_KEY","uuid","_sfc_main$5","_sfc_main$4","defineComponent","BaseButton","BentoTypography","ChevronRightIcon","BentoBaseButtonEvent","props","emit","conditionalClasses","computed","computedSecondaryText","truncate","e","BentoMenuEvent","BentoMenuEvent2","DATA_GRID_CELL_MENU_REGISTERING_INJECTION_KEY","__default__$1","menuListContainerRef","ref","menuListContainerEvents","registeringAndMousingOut","inject","registerMenuContainerElement","_sfc_main$2","messages","BentoDivider","MenuItem","MenuListContainer","subMenuItemListRefLocal","subMenuFocusedIndex","numberOfItems","closeMenu","onBackButton","computedItems","items","_a","el","ChevronLeftIcon","focusItem","_e","_d","_c","_b","onMounted","focusPrevious","focusNext","useDynamicMenuSize","subMenuItemListRef","visibleSubMenuIndex","showSubMenu","subMenuWidth","subMenuHeight","measureSubMenuStyle","element","parent","ghost","unwrappedWidth","clampedWidth","height","watch","newIndex","nextTick","subMenuElement","style","_sfc_main$1","SubMenuItemList","expose","menuItemRef","menuItemListRef","menuItemListWrapperRef","focusedIndex","hasMenuItemsWithIcon","computedData","indent","menuItemClick","item","index","focusRight","focusLeft","computedStyle","__default__","slots","useSlots","hasSlot","useHasSlot","t","useI18n","menuButtonRef","showMenu","isLastElementFocused","popoverRef","menuId","generateUid","isInverseColorSet","provide","DIVIDER_INVERSE_INJECTION_KEY","computedClasses","computedMenuWidth","computedButtonPropsWithDefaults","getAriaLabel","attributes","openMenu","revertFocus","toggleShowMenu","onKeyDown","event","onKeyUp","useClickOutside","printDevelopmentWarning"],"mappings":";;;;;;;;;;;;;;;;;;;AAAa,MAAAA,KAAA,OAAA,kCAAA;ACOb,IAAAC,IAAA;AAEA,MAAAC,KAAA;AAAA,EACA,eAAA;AACA,SAAA,OAAAD,EAAA,SAAA,GACAA,KAAA;AAAA,EACA;AACA;;;;;;;;;;;;uBCqBAE,KAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA,EAAA,YAAAC,IAAA,iBAAAC,GAAA,kBAAAC,GAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IACA,MAAA;AAAA,MAIA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,SAAA;AAAA,MAIA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,eAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,SAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,MAAA;AAAA;AAAA;AAAA,MAIA,MAAA,CAAA,QAAA,QAAA;AAAA,MAGA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,UAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,QAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,UAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,SAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,OAAA,CAAAC,EAAA,KAAA;AAAA,EACA,MAAAC,GAAA,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AAAA;AAAA;AAAA;AAAA,MAAa,WAAAnC;AAAA,IAIT,CAAA,GAGJY,EAAA,MAAA;AACI,MAAAwC,EAAA,WAAA,KACIyB;AAAA,QAAA;AAAA,MACI;AAAA,IAER,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,18 +1,19 @@
1
- import { defineComponent as C, useSlots as B, onMounted as O, toRefs as F, ref as r, computed as k, watch as M, nextTick as T, provide as d } from "vue";
2
- import { B as D } from "./button.hF-nD1Og.js";
3
- import { B as N } from "./focus-trap.C-wIQqpO.js";
4
- import { B as w } from "./typography.J1v_SPG3.js";
5
- import { u as P } from "./use-has-slot.C9lQZ6nz.js";
6
- import { D as R, B as G, b as J, a as K } from "./dialog-page.CLHZqQeU.js";
7
- import { B as U } from "./button-actions.BKdI_ooV.js";
8
- import { n as E } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
9
- import { C as Y } from "./cross.CC_B-vG-.js";
10
- import { u as $ } from "./i18n.BQkEbtPM.js";
11
- import { g as j } from "./generate-uid.NJ8tVoha.js";
12
- import { M as z } from "./modal-fullscreen.keys.CMba3hYp.js";
1
+ import { defineComponent as B, useSlots as P, onMounted as M, useListeners as N, toRefs as k, ref as r, computed as T, watch as D, nextTick as w, provide as _ } from "vue";
2
+ import "./index.Cl4_42j5.js";
3
+ import { B as R } from "./button.hF-nD1Og.js";
4
+ import { B as G } from "./focus-trap.C-wIQqpO.js";
5
+ import { B as J } from "./typography.J1v_SPG3.js";
6
+ import { u as E } from "./use-has-slot.C9lQZ6nz.js";
7
+ import { D as K, B as U, b as Y, a as $ } from "./dialog-page.CLHZqQeU.js";
8
+ import { B as j } from "./button-actions.Ju27CRNG.js";
9
+ import { n as I } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
10
+ import { C as z } from "./cross.CC_B-vG-.js";
11
+ import { u as H } from "./i18n.BQkEbtPM.js";
12
+ import { g as V } from "./generate-uid.NJ8tVoha.js";
13
+ import { M as q } from "./modal-fullscreen.keys.CMba3hYp.js";
13
14
  import "../assets/modal-fullscreen.css";
14
- const H = {}, V = /* @__PURE__ */ C({
15
- ...H,
15
+ const Q = {}, W = /* @__PURE__ */ B({
16
+ ...Q,
16
17
  __name: "modal-fullscreen-page",
17
18
  props: {
18
19
  /**
@@ -60,30 +61,34 @@ const H = {}, V = /* @__PURE__ */ C({
60
61
  default: null
61
62
  }
62
63
  },
63
- setup(i) {
64
- const e = i, a = B(), t = P(a);
65
- return O(() => {
64
+ setup(u) {
65
+ const e = u, a = P(), t = E(a);
66
+ return M(() => {
66
67
  if (e.actions && e.actions.length > 2)
67
68
  throw new Error("Not more than 2 action buttons may be provided in Bento Modal Fullscreen");
68
- }), { __sfc: !0, props: e, slots: a, hasSlot: t, BentoButtonActions: U, BentoTypography: w, DialogPage: R };
69
+ }), { __sfc: !0, props: e, slots: a, hasSlot: t, BentoButtonActions: j, BentoTypography: J, DialogPage: K };
69
70
  }
70
71
  });
71
- var q = function() {
72
+ var X = function() {
72
73
  var e = this, a = e._self._c, t = e._self._setupProxy;
73
74
  return a(t.DialogPage, { staticClass: "b-modal-fullscreen-page", attrs: { "page-id": e.pageId, "previous-page": e.previousPage, "always-show-border": "" }, scopedSlots: e._u([{ key: "header", fn: function() {
74
75
  return [a("div", { staticClass: "b-modal-fullscreen-page__header" }, [a("div", { staticClass: "b-modal-fullscreen-page__header-section b-modal-fullscreen-page__header-section--title" }, [e.title ? a(t.BentoTypography, { staticClass: "b-modal-fullscreen-page__title", attrs: { el: "h2", variant: "title", title: e.title } }, [e._v(e._s(e.title))]) : e._e()], 1), t.hasSlot("header") ? a("div", { staticClass: "b-modal-fullscreen-page__header-section b-modal-fullscreen-page__header-section--slot" }, [e._t("header")], 2) : e._e(), a("div", { staticClass: "b-modal-fullscreen-page__header-section b-modal-fullscreen-page__header-section--actions" }, [e.contextualLabel ? a(t.BentoTypography, { staticClass: "b-modal-fullscreen-page__contextual-label", attrs: { el: "span", title: e.contextualLabel } }, [e._v(e._s(e.contextualLabel))]) : e._e(), e.actions ? a(t.BentoButtonActions, { staticClass: "b-modal-fullscreen-page__actions", attrs: { actions: e.actions } }) : e._e(), a("div", { staticClass: "b-modal-fullscreen-page__separator" })], 1)])];
75
76
  }, proxy: !0 }, { key: "content", fn: function() {
76
77
  return [a("div", { staticClass: "b-modal-fullscreen-page__content" }, [e._t("default")], 2)];
77
78
  }, proxy: !0 }], null, !0) });
78
- }, Q = [], W = /* @__PURE__ */ E(
79
- V,
80
- q,
81
- Q,
79
+ }, Z = [], ee = /* @__PURE__ */ I(
80
+ W,
81
+ X,
82
+ Z,
82
83
  !1,
83
84
  null,
84
85
  "30654f2c"
85
86
  );
86
- const X = W.exports, Z = {
87
+ const te = ee.exports;
88
+ function ae() {
89
+ return N();
90
+ }
91
+ const se = {
87
92
  "en-US": {
88
93
  close: "Close"
89
94
  },
@@ -93,10 +98,10 @@ const X = W.exports, Z = {
93
98
  "pt-BR": {
94
99
  close: "Fechar"
95
100
  }
96
- }, ee = {
97
- i18n: { messages: Z }
98
- }, te = /* @__PURE__ */ C({
99
- ...ee,
101
+ }, le = {
102
+ i18n: { messages: se }
103
+ }, oe = /* @__PURE__ */ B({
104
+ ...le,
100
105
  __name: "modal-fullscreen",
101
106
  props: {
102
107
  /**
@@ -143,60 +148,68 @@ const X = W.exports, Z = {
143
148
  default: null
144
149
  }
145
150
  },
146
- emits: ["update:is-open", "update:active-page"],
147
- setup(i, { emit: e }) {
148
- const a = i, { activePage: t, isOpen: l } = F(a), { t: I } = $(), n = r(null), u = r(!1), _ = j("modal-fullscreen"), p = r(!1), f = B(), S = P(f), x = k(() => ({
149
- "b-modal-fullscreen--hide": u.value
150
- })), A = () => {
151
- u.value && (n.value.close(), s.value[0] && e("update:active-page", s.value[0]), s.value = [], u.value = !1, p.value = !1, e("update:is-open", !1));
152
- }, m = () => {
153
- n.value.open && (u.value = !0);
151
+ emits: ["before-close", "update:active-page", "update:is-open"],
152
+ setup(u, { emit: e }) {
153
+ const a = u, { activePage: t, isOpen: s } = k(a), { t: S } = H(), n = r(null), i = r(!1), f = V("modal-fullscreen"), p = r(!1), m = ae(), g = P(), x = E(g), A = T(() => ({
154
+ "b-modal-fullscreen--hide": i.value
155
+ })), L = () => {
156
+ i.value && (n.value.close(), o.value[0] && e("update:active-page", o.value[0]), o.value = [], i.value = !1, p.value = !1, e("update:is-open", !1));
154
157
  };
155
- M(
156
- () => l.value,
158
+ function O() {
159
+ if (m["before-close"]) {
160
+ e("before-close");
161
+ return;
162
+ }
163
+ d();
164
+ }
165
+ const d = () => {
166
+ n.value.open && (i.value = !0);
167
+ };
168
+ D(
169
+ () => s.value,
157
170
  async () => {
158
- await T(), n.value && (l.value ? (p.value = !0, n.value.showModal(), s.value.length || s.value.push(t.value)) : n.value.open && m());
171
+ await w(), n.value && (s.value ? (p.value = !0, n.value.showModal(), o.value.length || o.value.push(t.value)) : n.value.open && d());
159
172
  },
160
173
  { immediate: !0 }
161
- ), d(z, _);
162
- const g = r(G.TRANSITION_LEVEL_DEEPER), c = r([]), s = r([]), v = (o) => e("update:active-page", o);
163
- d(J, {
174
+ ), _(q, f);
175
+ const v = r(U.TRANSITION_LEVEL_DEEPER), c = r([]), o = r([]), y = (l) => e("update:active-page", l);
176
+ _(Y, {
164
177
  activePage: t,
165
- animation: g,
178
+ animation: v,
166
179
  isOpen: p,
167
180
  pages: c,
168
- previousPages: s,
169
- updatePage: v
181
+ previousPages: o,
182
+ updatePage: y
170
183
  });
171
- const y = (o) => () => {
172
- var b;
173
- c.value = (b = c.value) == null ? void 0 : b.filter((L) => L !== o);
174
- }, h = (o) => (o && c.value.push(o), { unregisterPage: y(o) });
175
- return d(K, h), { __sfc: !0, props: a, emit: e, activePage: t, isOpen: l, t: I, modal: n, isClosing: u, modalFullscreenId: _, internalIsOpen: p, slots: f, hasSlot: S, conditionalClasses: x, closeModalAfterAnimation: A, startCloseModalAnimation: m, animation: g, pages: c, previousPages: s, updatePage: v, unregisterPage: y, registerPage: h, BentoButton: D, BentoFocusTrap: N, BentoModalFullscreenPage: X, CrossIcon: Y };
184
+ const h = (l) => () => {
185
+ var C;
186
+ c.value = (C = c.value) == null ? void 0 : C.filter((F) => F !== l);
187
+ }, b = (l) => (l && c.value.push(l), { unregisterPage: h(l) });
188
+ return _($, b), { __sfc: !0, props: a, emit: e, activePage: t, isOpen: s, t: S, modal: n, isClosing: i, modalFullscreenId: f, internalIsOpen: p, listeners: m, slots: g, hasSlot: x, conditionalClasses: A, closeModalAfterAnimation: L, closeModal: O, startCloseModalAnimation: d, animation: v, pages: c, previousPages: o, updatePage: y, unregisterPage: h, registerPage: b, BentoButton: R, BentoFocusTrap: G, BentoModalFullscreenPage: te, CrossIcon: z };
176
189
  }
177
190
  });
178
- var ae = function() {
191
+ var ne = function() {
179
192
  var e = this, a = e._self._c, t = e._self._setupProxy;
180
- return a("dialog", { ref: "modal", staticClass: "b-modal-fullscreen", class: t.conditionalClasses, attrs: { id: t.modalFullscreenId }, on: { animationend: t.closeModalAfterAnimation, keydown: function(l) {
181
- return !l.type.indexOf("key") && e._k(l.keyCode, "esc", 27, l.key, ["Esc", "Escape"]) ? null : (l.preventDefault(), t.startCloseModalAnimation.apply(null, arguments));
193
+ return a("dialog", { ref: "modal", staticClass: "b-modal-fullscreen", class: t.conditionalClasses, attrs: { id: t.modalFullscreenId }, on: { animationend: t.closeModalAfterAnimation, keydown: function(s) {
194
+ return !s.type.indexOf("key") && e._k(s.keyCode, "esc", 27, s.key, ["Esc", "Escape"]) ? null : (s.preventDefault(), t.closeModal.apply(null, arguments));
182
195
  } } }, [t.internalIsOpen ? a(t.BentoFocusTrap, { staticClass: "b-modal-fullscreen__wrapper" }, [t.props.activePage ? [e._t("default")] : a(t.BentoModalFullscreenPage, { attrs: { actions: e.actions, "contextual-label": e.contextualLabel, title: e.title }, scopedSlots: e._u([t.hasSlot("default") ? { key: "default", fn: function() {
183
196
  return [e._t("default")];
184
197
  }, proxy: !0 } : null, t.hasSlot("header") ? { key: "header", fn: function() {
185
198
  return [e._t("header")];
186
- }, proxy: !0 } : null], null, !0) }), a("div", { staticClass: "b-modal-fullscreen__close-button" }, [a(t.BentoButton, { attrs: { variant: "tertiary", "aria-label": t.t("close") }, on: { click: t.startCloseModalAnimation }, scopedSlots: e._u([{ key: "iconLeft", fn: function() {
199
+ }, proxy: !0 } : null], null, !0) }), a("div", { staticClass: "b-modal-fullscreen__close-button" }, [a(t.BentoButton, { attrs: { variant: "tertiary", "aria-label": t.t("close") }, on: { click: t.closeModal }, scopedSlots: e._u([{ key: "iconLeft", fn: function() {
187
200
  return [a(t.CrossIcon, { attrs: { "aria-hidden": !0 } })];
188
201
  }, proxy: !0 }], null, !1, 4214210411) })], 1)], 2) : e._e()], 1);
189
- }, le = [], se = /* @__PURE__ */ E(
190
- te,
191
- ae,
192
- le,
202
+ }, re = [], ue = /* @__PURE__ */ I(
203
+ oe,
204
+ ne,
205
+ re,
193
206
  !1,
194
207
  null,
195
- "cfb8d3ae"
208
+ "5c2804e6"
196
209
  );
197
- const ve = se.exports;
210
+ const Be = ue.exports;
198
211
  export {
199
- X as B,
200
- ve as m
212
+ te as B,
213
+ Be as m
201
214
  };
202
- //# sourceMappingURL=modal-fullscreen.BNTUOC7o.js.map
215
+ //# sourceMappingURL=modal-fullscreen.DHotw1RI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modal-fullscreen.DHotw1RI.js","sources":["../../src/components/modal-fullscreen/components/modal-fullscreen-page.vue","../../src/composables/use-listeners/index.ts","../../src/components/modal-fullscreen/modal-fullscreen.vue"],"sourcesContent":["<template>\n <dialog-page class=\"b-modal-fullscreen-page\" :page-id=\"pageId\" :previous-page=\"previousPage\" always-show-border>\n <template #header>\n <div class=\"b-modal-fullscreen-page__header\">\n <div class=\"b-modal-fullscreen-page__header-section b-modal-fullscreen-page__header-section--title\">\n <bento-typography\n v-if=\"title\"\n el=\"h2\"\n variant=\"title\"\n class=\"b-modal-fullscreen-page__title\"\n :title=\"title\"\n >{{ title }}</bento-typography\n >\n </div>\n <div\n v-if=\"hasSlot('header')\"\n class=\"b-modal-fullscreen-page__header-section b-modal-fullscreen-page__header-section--slot\"\n >\n <slot name=\"header\" />\n </div>\n <div class=\"b-modal-fullscreen-page__header-section b-modal-fullscreen-page__header-section--actions\">\n <bento-typography\n v-if=\"contextualLabel\"\n class=\"b-modal-fullscreen-page__contextual-label\"\n el=\"span\"\n :title=\"contextualLabel\"\n >{{ contextualLabel }}</bento-typography\n >\n <bento-button-actions v-if=\"actions\" class=\"b-modal-fullscreen-page__actions\" :actions=\"actions\" />\n <div class=\"b-modal-fullscreen-page__separator\"></div>\n </div>\n </div>\n </template>\n <template #content>\n <div class=\"b-modal-fullscreen-page__content\">\n <slot />\n </div>\n </template>\n </dialog-page>\n</template>\n\n<script setup lang=\"ts\">\n import { onMounted, PropType, useSlots } from 'vue';\n\n import { BentoButtonActions, BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { DialogPage } from '@/internal';\n\n import { useHasSlot } from '@/composables';\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 * @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: null,\n },\n\n /**\n * Label shown next to the modal actions\n */\n contextualLabel: {\n type: String,\n default: null,\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 modal\n */\n title: {\n type: String,\n default: null,\n },\n });\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n onMounted(() => {\n if (props.actions && props.actions.length > 2) {\n throw new Error('Not more than 2 action buttons may be provided in Bento Modal Fullscreen');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * ModalFullscreenPage is used to render different pages of ModalFullscreen component\n *\n * @example\n * import { BentoModalFullscreen, BentoModalFullscreenPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoModalFullscreen, BentoModalFullscreenPage },\n * template: `\n * <bento-modal-fullscreen active-page='page1' is-open='true'>\n * <bento-modal-fullscreen-page\n * title='Page 1'\n * pageId='page1'\n * contextual-label='Move to next page'\n * :actions=\"[\n * {\n * title: 'Next page',\n * event: () => {\n * activePage.value = 'page2';\n * },\n * }]\">\n * Page 1 info\n * </bento-modal-fullscreen-page>\n * <bento-modal-fullscreen-page\n * title='Page 2'\n * pageId='page2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Page 2 info\n * </bento-modal-fullscreen-page>\n * </bento-modal-fullscreen>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./modal-fullscreen-page.scss\" />\n","import { useListeners as vueUseListeners } from 'vue';\n\n/**\n * A composable that provides access to the component's listeners.\n * The listeners are kebab-case and the colons are removed (e.g. \"click\", \"update-value\").\n * @returns The component's listeners.\n */\nexport function useListeners() {\n return vueUseListeners() as any;\n}\n","<template>\n <dialog\n :id=\"modalFullscreenId\"\n ref=\"modal\"\n class=\"b-modal-fullscreen\"\n :class=\"conditionalClasses\"\n @animationend=\"closeModalAfterAnimation\"\n @keydown.esc.prevent=\"closeModal\"\n >\n <bento-focus-trap v-if=\"internalIsOpen\" class=\"b-modal-fullscreen__wrapper\">\n <template v-if=\"props.activePage\">\n <slot />\n </template>\n <bento-modal-fullscreen-page v-else :actions=\"actions\" :contextual-label=\"contextualLabel\" :title=\"title\">\n <template v-if=\"hasSlot('default')\" #default>\n <slot name=\"default\"></slot>\n </template>\n <template v-if=\"hasSlot('header')\" #header>\n <slot name=\"header\"></slot>\n </template>\n </bento-modal-fullscreen-page>\n <div class=\"b-modal-fullscreen__close-button\">\n <bento-button variant=\"tertiary\" :aria-label=\"t('close')\" @click=\"closeModal\">\n <template #iconLeft><cross-icon :aria-hidden=\"true\" /></template>\n </bento-button>\n </div>\n </bento-focus-trap>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, PropType, provide, ref, toRefs, useSlots, watch } from 'vue';\n import { isVue2 } from 'vue-demi';\n\n import { BentoButton, BentoButtonActionsList } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import BentoModalFullscreenPage from './components/modal-fullscreen-page.vue';\n\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { useI18n } from '@/utils/ts/i18n';\n import { generateUid } from '@/core/utils/ts';\n import { useHasSlot } from '@/composables';\n import { useListeners } from '@/composables/use-listeners';\n import { MODAL_FULLSCREEN_DIALOG_ID_INJECTION_KEY } from '@/components/modal-fullscreen/modal-fullscreen.keys';\n\n import messages from './messages.json';\n import {\n BentoDialogPageAnimation,\n BentoDialogPageConfigData,\n BentoDialogPageRegisterPage,\n DIALOG_PAGE_CONFIG_INJECTION_KEY,\n DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY,\n } from '@/internal';\n\n type MessageSchema = (typeof messages)['en-US'];\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 * @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: null,\n },\n\n /**\n * The id of the current active page\n * Should be the same as the pageId of the BentoModalFullscreenPage to be displayed\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * Label shown next to the modal actions\n */\n contextualLabel: {\n type: String,\n default: null,\n },\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: {\n type: Boolean,\n default: null,\n },\n /**\n * Title of the modal\n */\n title: {\n type: String,\n default: null,\n },\n });\n\n const emit = defineEmits([\"before-close\", \"update:active-page\", \"update:is-open\"]);\n\n // Refs\n const { activePage, isOpen } = toRefs(props);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const modal = ref(null);\n const isClosing = ref(false);\n const modalFullscreenId = generateUid('modal-fullscreen');\n const internalIsOpen = ref(false);\n\n const listeners = useListeners();\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n // Animation styling\n const conditionalClasses = computed(() => ({\n 'b-modal-fullscreen--hide': isClosing.value,\n }));\n\n // Handle closing and closing animation for dialog element\n const closeModalAfterAnimation = () => {\n if (isClosing.value) {\n modal.value.close();\n if (previousPages.value[0]) {\n emit('update:active-page', previousPages.value[0]);\n }\n previousPages.value = [];\n isClosing.value = false;\n internalIsOpen.value = false;\n emit('update:is-open', false);\n }\n };\n\n /**\n * Emits the `beforeClose` event, if it is being listened to,\n * before closing the modal and omits the closing animation.\n * The animation will be triggered by the change of the `isOpen` prop instead.\n *\n * If no listener for the `before-close`, then the animation will be triggered,\n * which will close the modal and emit the `update:is-open` event instead, after it was closed.\n */\n function closeModal() {\n /**\n * Vue3 appends the prefix \"on\" and changes to camelCase\n */\n const eventName = isVue2 ? 'before-close' : 'onBeforeClose';\n if (listeners[eventName]) {\n emit('before-close');\n return;\n }\n startCloseModalAnimation();\n }\n\n const startCloseModalAnimation = () => {\n if (!modal.value.open) {\n return;\n }\n isClosing.value = true;\n };\n\n // Watching isOpen prop to toggle open/close the dialog element\n watch(\n () => isOpen.value,\n async () => {\n // Wait for modal ref to be created\n await nextTick();\n\n if (!modal.value) {\n return;\n }\n\n if (isOpen.value) {\n internalIsOpen.value = true;\n modal.value.showModal();\n if (!previousPages.value.length) {\n previousPages.value.push(activePage.value);\n }\n } else if (modal.value.open) {\n startCloseModalAnimation();\n }\n },\n { immediate: true }\n );\n\n // lets children components know they are inside a Modal (dialog element)\n provide(MODAL_FULLSCREEN_DIALOG_ID_INJECTION_KEY, modalFullscreenId);\n\n // Pages\n const animation = ref(BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER);\n const pages = ref<string[]>([]);\n const previousPages = ref([]);\n const updatePage = page => emit('update:active-page', page);\n\n provide<BentoDialogPageConfigData>(DIALOG_PAGE_CONFIG_INJECTION_KEY, {\n activePage,\n animation,\n isOpen: internalIsOpen,\n pages,\n previousPages,\n updatePage,\n });\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 if (pageId) {\n pages.value.push(pageId);\n }\n\n return { unregisterPage: unregisterPage(pageId) };\n };\n\n provide(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY, registerPage);\n</script>\n\n<script lang=\"ts\">\n /**\n * Fullscreen modal takes full available space (no content underneath is visible) and focuses the user's attention exclusively on one complex task or piece of complex information.\n *\n * @example\n * import { BentoModalFullscreen } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoModalFullscreen },\n * template: `\n * <bento-modal-fullscreen\n * :is-open=\"isOpen\"\n * @update:is-open=\"isOpen = $event\"\n * title='Fullscreen modal title'\n * contextual-label='Contextual label'\n * :actions=\"[{ title: 'Action', event: () => {}]\"\n * >\n * <template #header>{{ header slot }}</template>\n * {{ content }}\n * </bento-modal-fullscreen>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./modal-fullscreen.scss\" />\n"],"names":["__default__$1","slots","useSlots","hasSlot","useHasSlot","onMounted","props","useListeners","useListeners$1","__default__","messages","activePage","isOpen","toRefs","t","useI18n","modal","ref","isClosing","modalFullscreenId","generateUid","internalIsOpen","listeners","conditionalClasses","computed","closeModalAfterAnimation","previousPages","emit","closeModal","startCloseModalAnimation","watch","nextTick","provide","MODAL_FULLSCREEN_DIALOG_ID_INJECTION_KEY","animation","BentoDialogPageAnimation","pages","updatePage","page","DIALOG_PAGE_CONFIG_INJECTION_KEY","unregisterPage","pageIdToRemove","_a","pageId","registerPage","DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY"],"mappings":";;;;;;;;;;;;;;AAqJI,MAAAA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAhDAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA;AAEA,WAAAI,EAAA,MAAA;AACI,UAAAC,EAAA,WAAAA,EAAA,QAAA,SAAA;AACI,cAAA,IAAA,MAAA,0EAAA;AAAA,IACJ,CAAA;;;;;;;;;;;;;;;;;;;ACpGD,SAAAC,KAAA;AACH,SAAAC,EAAA;AACJ;;;;;;;;;;;GC8OIC,KAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,GAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA7IA,EAAA,YAAAC,GAAA,QAAAC,EAAA,IAAAC,EAAAP,CAAA,GACA,EAAA,GAAAQ,EAAA,IAAAC,EAAA,GACAC,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,EAAA,GACAE,IAAAC,EAAA,kBAAA,GACAC,IAAAJ,EAAA,EAAA,GAEAK,IAAAf,GAAA,GACAN,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAGAsB,IAAAC,EAAA,OAAA;AAAA,MAA2C,4BAAAN,EAAA;AAAA,IACD,EAAA,GAI1CO,IAAA,MAAA;AACI,MAAAP,EAAA,UACIF,EAAA,MAAA,MAAA,GACAU,EAAA,MAAA,CAAA,KACIC,EAAA,sBAAAD,EAAA,MAAA,CAAA,CAAA,GAEJA,EAAA,QAAA,CAAA,GACAR,EAAA,QAAA,IACAG,EAAA,QAAA,IACAM,EAAA,kBAAA,EAAA;AAAA,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ttrs as P, watch as k } from "vue";
2
- import { d as g, h as O, f as d, e as x, c as C, b as v, a as T } from "./base-modal.QGDM_kjG.js";
2
+ import { c as g, h as O, e as d, d as x, b as C, a as v, B as T } from "./base-modal.CkkfT6r6.js";
3
3
  import { u as b } from "./use-has-slot.C9lQZ6nz.js";
4
- import { F as R } from "./footer-actions.BUfQFz7J.js";
4
+ import { F as R } from "./footer-actions.BE_zzX-e.js";
5
5
  import { n as S } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
6
6
  import { a as M } from "./button.hF-nD1Og.js";
7
7
  import { u as z } from "./i18n.BQkEbtPM.js";
8
- import { B as N } from "./button-actions.BKdI_ooV.js";
8
+ import { B as N } from "./button-actions.Ju27CRNG.js";
9
9
  import { d as $ } from "./typography.J1v_SPG3.js";
10
10
  const F = p({
11
11
  name: "bento-modal-default"
@@ -442,4 +442,4 @@ const pt = ot.exports;
442
442
  export {
443
443
  pt as B
444
444
  };
445
- //# sourceMappingURL=modal.OvB4kEGR.js.map
445
+ //# sourceMappingURL=modal.eoNQ6E3U.js.map