@adyen/bento-vue2 1.62.0 → 1.63.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 (145) hide show
  1. package/dist/@types/index.d.ts +181 -235
  2. package/dist/accordion.js +1 -1
  3. package/dist/action-bar.js +1 -1
  4. package/dist/assets/accordion-item.css +1 -1
  5. package/dist/assets/action-bar.css +1 -1
  6. package/dist/assets/base-modal.css +1 -1
  7. package/dist/assets/card.css +1 -1
  8. package/dist/assets/checkbox-input.css +1 -1
  9. package/dist/assets/data-grid.css +1 -1
  10. package/dist/assets/date-range-picker.css +1 -1
  11. package/dist/assets/dialog-page.css +1 -1
  12. package/dist/assets/file-uploader.css +1 -1
  13. package/dist/assets/header-with-views.css +1 -1
  14. package/dist/assets/inspector.css +1 -1
  15. package/dist/assets/listbox-option-tag.css +1 -1
  16. package/dist/assets/menu.css +1 -1
  17. package/dist/assets/modal-fullscreen.css +1 -1
  18. package/dist/assets/popover.css +1 -1
  19. package/dist/assets/sidepanel.css +1 -1
  20. package/dist/assets/use-cached-selected-values.css +1 -1
  21. package/dist/card.js +1 -1
  22. package/dist/checkbox.js +3 -3
  23. package/dist/chunks/{accordion-item.D1t0oHlP.js → accordion-item.BNtdoVto.js} +9 -8
  24. package/dist/chunks/{accordion-item.D1t0oHlP.js.map → accordion-item.BNtdoVto.js.map} +1 -1
  25. package/dist/chunks/{action-bar.whU1em8H.js → action-bar.Dsp7iRxz.js} +2 -2
  26. package/dist/chunks/{action-bar.whU1em8H.js.map → action-bar.Dsp7iRxz.js.map} +1 -1
  27. package/dist/chunks/{button-actions-with-menu.RoaQFPKT.js → button-actions-with-menu.CtW_16tY.js} +2 -2
  28. package/dist/chunks/{button-actions-with-menu.RoaQFPKT.js.map → button-actions-with-menu.CtW_16tY.js.map} +1 -1
  29. package/dist/chunks/{calendar.DoOFNX-Z.js → calendar.DbTC35rM.js} +2 -2
  30. package/dist/chunks/{calendar.DoOFNX-Z.js.map → calendar.DbTC35rM.js.map} +1 -1
  31. package/dist/chunks/card.CypgT0Ji.js +136 -0
  32. package/dist/chunks/card.CypgT0Ji.js.map +1 -0
  33. package/dist/chunks/{checkbox-group.B0IGYf1q.js → checkbox-group.6y92U6AF.js} +2 -2
  34. package/dist/chunks/{checkbox-group.B0IGYf1q.js.map → checkbox-group.6y92U6AF.js.map} +1 -1
  35. package/dist/chunks/checkbox-input.CNWigbX4.js +117 -0
  36. package/dist/chunks/checkbox-input.CNWigbX4.js.map +1 -0
  37. package/dist/chunks/{checkbox.DkCukYh0.js → checkbox.C9nJVvMq.js} +9 -8
  38. package/dist/chunks/{checkbox.DkCukYh0.js.map → checkbox.C9nJVvMq.js.map} +1 -1
  39. package/dist/chunks/chevron-down.eYtgv5ly.js +24 -0
  40. package/dist/chunks/chevron-down.eYtgv5ly.js.map +1 -0
  41. package/dist/chunks/{chevron-left.BS24hEFa.js → chevron-right.C--ZOC9j.js} +5 -5
  42. package/dist/chunks/chevron-right.C--ZOC9j.js.map +1 -0
  43. package/dist/chunks/chevron-up.d8cwIlA_.js +24 -0
  44. package/dist/chunks/chevron-up.d8cwIlA_.js.map +1 -0
  45. package/dist/chunks/{code-snippet.n93oYvH4.js → code-snippet.CBU8Tlbs.js} +2 -2
  46. package/dist/chunks/{code-snippet.n93oYvH4.js.map → code-snippet.CBU8Tlbs.js.map} +1 -1
  47. package/dist/chunks/{dashboard-section.BEw-n-XQ.js → dashboard-section.CspNW0CA.js} +3 -3
  48. package/dist/chunks/{dashboard-section.BEw-n-XQ.js.map → dashboard-section.CspNW0CA.js.map} +1 -1
  49. package/dist/chunks/{data-grid-template.DGFmCUII.js → data-grid-template.BhzgqkZp.js} +3 -3
  50. package/dist/chunks/{data-grid-template.DGFmCUII.js.map → data-grid-template.BhzgqkZp.js.map} +1 -1
  51. package/dist/chunks/{data-grid.BcGRXt9C.js → data-grid.BfsBhYpW.js} +451 -452
  52. package/dist/chunks/data-grid.BfsBhYpW.js.map +1 -0
  53. package/dist/chunks/{date-picker.Dc_HdQnr.js → date-picker.CPQ6WLZE.js} +3 -3
  54. package/dist/chunks/{date-picker.Dc_HdQnr.js.map → date-picker.CPQ6WLZE.js.map} +1 -1
  55. package/dist/chunks/date-range-picker.CNB28UaM.js +1005 -0
  56. package/dist/chunks/date-range-picker.CNB28UaM.js.map +1 -0
  57. package/dist/chunks/{dropdown-default-textbox.7PMxHqoa.js → dropdown-default-textbox.BNuuA4ES.js} +15 -14
  58. package/dist/chunks/{dropdown-default-textbox.7PMxHqoa.js.map → dropdown-default-textbox.BNuuA4ES.js.map} +1 -1
  59. package/dist/chunks/{dropdown-tag.qKSu6xYY.js → dropdown-tag.DmVsDrL_.js} +3 -3
  60. package/dist/chunks/{dropdown-tag.qKSu6xYY.js.map → dropdown-tag.DmVsDrL_.js.map} +1 -1
  61. package/dist/chunks/{dropdown.BNLPzKbr.js → dropdown.B_PWXFtT.js} +3 -3
  62. package/dist/chunks/{dropdown.BNLPzKbr.js.map → dropdown.B_PWXFtT.js.map} +1 -1
  63. package/dist/chunks/es6.n1ewaW31.js.map +1 -1
  64. package/dist/chunks/{filter-bar.TiqZofNt.js → filter-bar.D6HeYnzZ.js} +15 -14
  65. package/dist/chunks/{filter-bar.TiqZofNt.js.map → filter-bar.D6HeYnzZ.js.map} +1 -1
  66. package/dist/chunks/{fixed-scroller.Ctz5dFqz.js → fixed-scroller.XN-jvWqb.js} +12 -12
  67. package/dist/chunks/fixed-scroller.XN-jvWqb.js.map +1 -0
  68. package/dist/chunks/{header-with-views.MFHmiIXb.js → header-with-views.Dkn8IDew.js} +270 -270
  69. package/dist/chunks/header-with-views.Dkn8IDew.js.map +1 -0
  70. package/dist/chunks/{header.B1PrBQG0.js → header.DNzQO7u-.js} +2 -2
  71. package/dist/chunks/{header.B1PrBQG0.js.map → header.DNzQO7u-.js.map} +1 -1
  72. package/dist/chunks/{input-field-password.BlX3Icgt.js → input-field-password.CY3eRVpe.js} +3 -3
  73. package/dist/chunks/{input-field-password.BlX3Icgt.js.map → input-field-password.CY3eRVpe.js.map} +1 -1
  74. package/dist/chunks/{input-field-phone-number.Ofvi2A48.js → input-field-phone-number.CN5qZ0VL.js} +3 -3
  75. package/dist/chunks/{input-field-phone-number.Ofvi2A48.js.map → input-field-phone-number.CN5qZ0VL.js.map} +1 -1
  76. package/dist/chunks/{input-field.Dck9dAeK.js → input-field.DKhsSYF8.js} +2 -2
  77. package/dist/chunks/{input-field.Dck9dAeK.js.map → input-field.DKhsSYF8.js.map} +1 -1
  78. package/dist/chunks/{listbox-option-tag.EzSkn_lM.js → listbox-option-tag.DFmB_TuD.js} +9 -9
  79. package/dist/chunks/listbox-option-tag.DFmB_TuD.js.map +1 -0
  80. package/dist/chunks/menu.W_kuhRKI.js +514 -0
  81. package/dist/chunks/menu.W_kuhRKI.js.map +1 -0
  82. package/dist/chunks/minus-small.DJacLGTw.js +27 -0
  83. package/dist/chunks/minus-small.DJacLGTw.js.map +1 -0
  84. package/dist/chunks/{pagination.BvhUFgsT.js → pagination.DvP8FqiW.js} +2 -2
  85. package/dist/chunks/{pagination.BvhUFgsT.js.map → pagination.DvP8FqiW.js.map} +1 -1
  86. package/dist/chunks/{rich-text-editor.BTJpOiYL.js → rich-text-editor.aSOSl4Rz.js} +2 -2
  87. package/dist/chunks/{rich-text-editor.BTJpOiYL.js.map → rich-text-editor.aSOSl4Rz.js.map} +1 -1
  88. package/dist/chunks/{search-bar.Ch1dLZAb.js → search-bar.Sh4A8UId.js} +3 -3
  89. package/dist/chunks/{search-bar.Ch1dLZAb.js.map → search-bar.Sh4A8UId.js.map} +1 -1
  90. package/dist/chunks/{secondary-nav.DBssP9fQ.js → secondary-nav.BFtGx_IN.js} +2 -2
  91. package/dist/chunks/{secondary-nav.DBssP9fQ.js.map → secondary-nav.BFtGx_IN.js.map} +1 -1
  92. package/dist/chunks/{selection-card-group.CjFm-cAm.js → selection-card-group.CrWy35QU.js} +2 -2
  93. package/dist/chunks/{selection-card-group.CjFm-cAm.js.map → selection-card-group.CrWy35QU.js.map} +1 -1
  94. package/dist/chunks/{tabs.zkTl2PQR.js → tabs.Dx6teJGW.js} +2 -2
  95. package/dist/chunks/{tabs.zkTl2PQR.js.map → tabs.Dx6teJGW.js.map} +1 -1
  96. package/dist/chunks/{tutorial.C9PYfB4z.js → tutorial.BNZh6N3h.js} +2 -2
  97. package/dist/chunks/{tutorial.C9PYfB4z.js.map → tutorial.BNZh6N3h.js.map} +1 -1
  98. package/dist/chunks/{use-cached-selected-values.Da6xbfzO.js → use-cached-selected-values.CDBmVxYM.js} +514 -481
  99. package/dist/chunks/use-cached-selected-values.CDBmVxYM.js.map +1 -0
  100. package/dist/code-snippet.js +1 -1
  101. package/dist/dashboard-template.js +1 -1
  102. package/dist/data-grid-template.js +1 -1
  103. package/dist/data-grid.js +1 -1
  104. package/dist/date-picker.js +2 -2
  105. package/dist/date-range-picker.js +2 -2
  106. package/dist/dropdown.js +4 -4
  107. package/dist/filter-bar.js +1 -1
  108. package/dist/header-with-views.js +1 -1
  109. package/dist/header.js +1 -1
  110. package/dist/index.js +31 -31
  111. package/dist/input-field-password.js +1 -1
  112. package/dist/input-field-phone-number.js +1 -1
  113. package/dist/input-field.js +1 -1
  114. package/dist/internal.js +5 -5
  115. package/dist/menu.js +1 -1
  116. package/dist/pagination.js +1 -1
  117. package/dist/rich-text-editor.js +1 -1
  118. package/dist/search-bar.js +2 -2
  119. package/dist/secondary-nav.js +1 -1
  120. package/dist/selection-card.js +1 -1
  121. package/dist/styles/bento-dark.css +4 -0
  122. package/dist/styles/bento-light.css +4 -0
  123. package/dist/styles/bento.css +4 -0
  124. package/dist/styles/legacy.css +4 -0
  125. package/dist/styles/styleguide.css +4 -0
  126. package/dist/tabs.js +1 -1
  127. package/dist/tutorial.js +1 -1
  128. package/dist/web-types.json +176 -120
  129. package/package.json +7 -7
  130. package/dist/chunks/card.Cu6MicVI.js +0 -123
  131. package/dist/chunks/card.Cu6MicVI.js.map +0 -1
  132. package/dist/chunks/checkbox-input.B-4Rw5mp.js +0 -137
  133. package/dist/chunks/checkbox-input.B-4Rw5mp.js.map +0 -1
  134. package/dist/chunks/chevron-left.BS24hEFa.js.map +0 -1
  135. package/dist/chunks/chevron-up.CHK1E4p9.js +0 -43
  136. package/dist/chunks/chevron-up.CHK1E4p9.js.map +0 -1
  137. package/dist/chunks/data-grid.BcGRXt9C.js.map +0 -1
  138. package/dist/chunks/date-range-picker.D6xJAHoB.js +0 -977
  139. package/dist/chunks/date-range-picker.D6xJAHoB.js.map +0 -1
  140. package/dist/chunks/fixed-scroller.Ctz5dFqz.js.map +0 -1
  141. package/dist/chunks/header-with-views.MFHmiIXb.js.map +0 -1
  142. package/dist/chunks/listbox-option-tag.EzSkn_lM.js.map +0 -1
  143. package/dist/chunks/menu.CTVbNfuo.js +0 -601
  144. package/dist/chunks/menu.CTVbNfuo.js.map +0 -1
  145. package/dist/chunks/use-cached-selected-values.Da6xbfzO.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"menu.CTVbNfuo.js","sources":["../../src/components/menu/menu.keys.ts","../../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","../../../ui-assets/icons-16/dist/vue/options-vertical.vue","../../src/components/menu/menu.vue"],"sourcesContent":["export const MENU_INVERSE_INJECTION_KEY = Symbol('menu inverse style injection key');\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 { BentoButton } from '../button';\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","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","\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 <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('iconRight')\" #iconRight>\n <slot name=\"iconRight\" />\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 lang=\"ts\">\n import { computed, defineComponent, inject, nextTick, PropType, provide, ref } from 'vue';\n import { generateUid } from '@/core/utils/ts';\n import { BentoToggleButton } from '@/components/button';\n import { BentoPopover, BentoPopoverPositions } from '@/components/popover';\n import { BentoMenuItem, MenuItemList } from './components';\n import { BentoMenuButtonProps, BentoMenuEvent } from './menu.types';\n import { DIVIDER_INVERSE_INJECTION_KEY } from '@/components/divider/divider.keys';\n import { MENU_INVERSE_INJECTION_KEY } from './menu.keys';\n import { BentoTeleport } from '@/internal';\n import { useClickOutside, useHasSlot } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import OptionsVerticalIcon from '@adyen/ui-assets-icons-16/vue/options-vertical';\n import messages from './messages.json';\n import { OnClickOutsideOptions } from '@/directives/click-outside/types';\n\n type MessageSchema = (typeof messages)['en-US'];\n\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 defineComponent({\n i18n: { messages },\n name: 'bento-menu',\n components: { BentoToggleButton, BentoPopover, BentoTeleport, MenuItemList, OptionsVerticalIcon },\n props: {\n /**\n * Object containing props to change the menu button appearance. Accepts the same props present in BentoButton.\n */\n button: {\n type: Object as PropType<BentoMenuButtonProps>,\n default: () =>\n ({\n variant: 'secondary',\n }) as BentoMenuButtonProps,\n },\n\n /**\n * Controls if the menu should close when an item is clicked.\n * Defaults to `true`.\n */\n closeMenuOnItemSelect: {\n type: Boolean,\n default: true,\n },\n\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 /**\n * Disables opening the menu when the down arrow key is pressed.\n */\n disableArrowDownOpeningMenu: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The position of where the menu should open.\n */\n menuPosition: {\n type: String as PropType<BentoPopoverPositions | `${BentoPopoverPositions}`>,\n default: BentoPopoverPositions.BOTTOM_START,\n validator: (value: BentoPopoverPositions) => Object.values(BentoPopoverPositions).includes(value),\n },\n\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: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets a custom width for the menu popover.\n */\n menuWidth: {\n type: Number,\n default: null,\n },\n\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: {\n type: Boolean,\n default: true,\n },\n\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: {\n type: Boolean,\n default: false,\n },\n\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: {\n type: Object as PropType<OnClickOutsideOptions>,\n default: undefined,\n },\n },\n emits: [BentoMenuEvent.CLOSE, BentoMenuEvent.OPEN, 'menu-item-click', 'click-outside'],\n setup(props, { emit, expose, 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 const popoverId = generateUid('menu-popover');\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 expose({\n /**\n * Control to enable programmatic closing of the menu\n */\n closeMenu,\n });\n\n return {\n // Refs\n popoverRef,\n menuButtonRef,\n menuItemListRef,\n\n // Values\n menuId,\n popoverId,\n showMenu,\n computedButtonPropsWithDefaults,\n computedMenuWidth,\n isLastElementFocused,\n\n // Classes\n computedClasses,\n isInverseColorSet,\n\n // Methods\n hasSlot: useHasSlot(slots),\n onKeyDown,\n onKeyUp,\n closeMenu,\n menuItemClick,\n toggleShowMenu,\n\n // Translations\n t,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu.scss\" />\n"],"names":["MENU_INVERSE_INJECTION_KEY","_sfc_main$5","defineComponent","BaseButton","BentoTypography","ChevronRightIcon","BentoBaseButtonEvent","props","emit","conditionalClasses","computed","computedSecondaryText","truncate","e","BentoMenuEvent","BentoMenuEvent2","DATA_GRID_CELL_MENU_REGISTERING_INJECTION_KEY","__default__","menuListContainerRef","ref","menuListContainerEvents","registeringAndMousingOut","inject","registerMenuContainerElement","_sfc_main$3","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$2","SubMenuItemList","expose","menuItemRef","menuItemListRef","menuItemListWrapperRef","focusedIndex","hasMenuItemsWithIcon","computedData","indent","menuItemClick","item","index","focusRight","focusLeft","computedStyle","uuid","_sfc_main$1","_sfc_main","BentoToggleButton","BentoPopover","BentoTeleport","MenuItemList","OptionsVerticalIcon","BentoPopoverPositions","value","slots","t","useI18n","menuButtonRef","showMenu","isLastElementFocused","popoverRef","menuId","generateUid","popoverId","isInverseColorSet","provide","DIVIDER_INVERSE_INJECTION_KEY","computedClasses","computedMenuWidth","computedButtonPropsWithDefaults","openMenu","revertFocus","toggleShowMenu","onKeyDown","event","onKeyUp","useClickOutside","useHasSlot"],"mappings":";;;;;;;;;;;;;;;;;AAAa,MAAAA,KAAA,OAAA,kCAAA,GCmCbC,KAAAC,EAAA;AAAA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AGA,mBAAAH;AAAA;AAAA,MACA,SAAAa,EAAAvB,CAAA;AAAA,MAGA,WAAAmB;AAAA,MACA,SAAAE;AAAA,MACA,WAAAhF;AAAA,MACA,eAAA2C;AAAA,MACA,gBAAAkC;AAAA;AAAA,MACA,GAAAjB;AAAA,IAGA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-cached-selected-values.Da6xbfzO.js","sources":["../../src/composables/use-checkbox-select-all/use-checkbox-select-all.ts","../../src/composables/use-virtual-list/use-virtual-list.ts","../../src/types/listbox.ts","../../src/components/internal/listbox/components/listbox-single-select/components/listbox-single-select-category/listbox-single-select-category.vue","../../src/components/internal/listbox/components/listbox-option/listbox-option.vue","../../../ui-assets/icons-16/dist/vue/checkmark.vue","../../src/components/internal/listbox/components/listbox-single-select-option/listbox-single-select-option.vue","../../src/components/internal/listbox/composables/useListboxKeyboardNavigation.ts","../../src/components/internal/listbox/components/listbox-single-select/listbox-single-select.vue","../../src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/components/listbox-multi-select-category/listbox-multi-select-category.types.ts","../../src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/components/listbox-multi-select-category/listbox-multi-select-category.vue","../../src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/listbox-multi-select-options.types.ts","../../src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/listbox-multi-select-options.vue","../../src/components/internal/listbox/composables/use-multi-level-items/use-multi-level-items.ts","../../src/components/internal/listbox/components/listbox-multi-select/listbox-multi-select.vue","../../src/components/internal/listbox/listbox.vue","../../src/components/internal/listbox/composables/use-cached-selected-values/use-cached-selected-values.ts"],"sourcesContent":["import { computed } from 'vue';\nimport type { ComputedRef } from 'vue';\nimport type { BentoListboxMultiSelectValue, Fn } from '@/types';\nimport { BentoListboxOptions } from '@/types';\n\n/**\n * Callback function that alllows to select all the items when called\n * @callback selectAllCallback\n */\n\n/**\n * Callback function that alllows to select all the items when called\n * @callback unselectAllCallback\n */\n\n/**\n * @typedef {Object} UseCheckboxSelectAll\n * @property {Ref<boolean>} isAllSelected - Indicates if all values are selected. Pass this to the :value property.\n * @property {Ref<boolean>} isIndeterminate - Indicates if it is in an indeterminated state (not all values are selected nor unselected). Pass this to the :indeterminate property.\n * @property {(selectedValue: boolean) => void} toggleSelectAll - Handles the select all flow, selects or unselects all and nullifies the indeterminated state. Pass this to the @input method.\n */\n\n/**\n * Composable to handle a 3 way checkbox state that allows to manage\n * a \"select all\", \"unselect all\" and an intermediate state where\n * not all are selected.\n *\n * @example\n * const checkboxVModelRef = ref<number[]>([]);\n *\n * const { isAllSelected, isIndeterminate, toggleSelectAll, updateIndeterminate } = useCheckboxSelectAll(\n * checkboxVModelRef,\n * () => { checkboxVModelRef.value = [...] // select all logic },\n * () => { checkboxVModelRef.value = [] // unselect all logic },\n * );\n * toggleSelectAll(true|false); // Hook this to the @input method\n * updateIndeterminate(totalOfAvailableItems);\n *\n *\n * @param {ComputedRef<BentoListboxMultiSelectValue>} selectedItemsList - Reference to the list of selected values\n * @param {ComputedRef<BentoListboxOptions>} items - Reference to the list of all available items in the dropdown\n * @param {selectAllCallback} selectAll - Callback function that alllows to select all the items when called\n * @param {unselectAllCallback} unselectAll - Callback function that alllows to select all the items when called\n * @returns {UseCheckboxSelectAll} Values to be set to the bento-checkbox value and indeterminate props, as well as functions to update them accordingly\n *\n */\nexport const useCheckboxSelectAll = (\n selectedItemsList: ComputedRef<BentoListboxMultiSelectValue>,\n items: ComputedRef<BentoListboxOptions>,\n selectAll: Fn,\n unselectAll: Fn\n) => {\n const isAllSelected = computed(\n () => !!selectedItemsList.value?.length && selectedItemsList.value?.length === items.value.length\n );\n const isIndeterminate = computed(() => {\n // eslint-disable-next-line eqeqeq\n if (selectedItemsList.value == undefined || selectedItemsList.value.length === 0) {\n return false;\n }\n\n return selectedItemsList.value?.length !== items.value.length;\n });\n\n const toggleSelectAll = (selectedValue: boolean) => {\n if (selectedValue) {\n selectAll();\n } else {\n unselectAll();\n }\n };\n\n return {\n isAllSelected,\n isIndeterminate,\n\n toggleSelectAll,\n };\n};\n","import { computed, onMounted, onUnmounted, Ref, ref, UnwrapRef, watch } from 'vue';\nimport type {\n UseVirtualListContainerProps,\n UseVirtualListOptions,\n UseVirtualListWrapperProps,\n} from './use-virtual-list.types';\nimport { observeSizeOfElement } from '../../utils/ts/resize';\n\n/**\n * Sets up a virtual scrolling functionality on a container element and a list of items to virtually scroll over.\n * This composables returns the containerProps and wrapperProps objects that should be v-binded onto the container and wrapper elements\n * of the list you wish to virtually scroll.\n *\n * This will return a filtered down list object the user can render based on how much the user has scrolled on the container.\n *\n * @usage\n * <template>\n * <div v-bind=\"containerProps\" @scroll=\"onScroll\">\n * <ul v-bind=\"wrapperProps\">\n * <li v-for=\"item in list\" :key=\"item.index\" style=\"height: 22px\">\n * {{ item.label }}\n * </li>\n * </ul>\n * </div>\n * </template>\n *\n * <script setup lang=\"ts\"\n * import { useVirtualList } from '@adyen/bento-vue2';\n *\n * const DEFAULT_OPTIONS: { label: string }[] = new Array(100)\n * .fill(0)\n * .map((_, index) => ({ label: `Option ${index + 1}` }));\n * const ITEMS = ref(DEFAULT_OPTIONS);\n * const ITEM_HEIGHT = 30;\n *\n * const { containerProps, wrapperProps, list, onScroll } = useVirtualList(ITEMS, { itemHeight: ITEM_HEIGHT });\n * </script>\n *\n *\n * @param items - a reference to a list of items to virtually scroll over.\n * @param options - customises how the Virtual scroller list functions.\n * @param options.itemHeight - the height in pixel or a function that returns the height in pixels for each item.\n * @param options.overscan - number of pre-rendered DOM nodes. Prevents whitespace between items if you scroll very quickly.\n * @param options.prefixHeight - the prefix height of elements present the scrollable area but not present in the items property.\n * @param options.disabled - if set to true, disables the virtual scrolling functionality.\n */\nexport function useVirtualList<T>(\n items: Ref<T[]>,\n { disabled, itemHeight, overscan = 5, prefixHeight }: UseVirtualListOptions\n) {\n const containerRef: Ref<UnwrapRef<HTMLElement | null>> = ref<HTMLElement | null>(null);\n const list = ref<T[]>([]) as Ref<T[]>;\n const startIndex = ref(0);\n const endIndex = ref(0);\n const containerHeight = ref(0);\n let listObserver;\n\n const wrapperProps = computed<UseVirtualListWrapperProps>(() => {\n const totalHeight =\n typeof itemHeight === 'number'\n ? items.value.length * itemHeight\n : items.value.reduce((sum, _, index) => sum + itemHeight(index), 0);\n\n const offSetTop =\n typeof itemHeight === 'number'\n ? startIndex.value * itemHeight\n : items.value.slice(0, startIndex.value).reduce((sum, _, i) => sum + itemHeight(i), 0);\n\n return {\n style: {\n marginTop: `${offSetTop}px`,\n height: `${totalHeight - offSetTop}px`,\n },\n };\n });\n\n /**\n * Gets the offset for the first item to show within the visible area.\n * @returns offset number.\n */\n const getOffset = () => {\n const prefixHeightIfSet = prefixHeight?.value ?? 0;\n const scrollTop = Math.max(containerRef.value.scrollTop - prefixHeightIfSet, 0);\n if (typeof itemHeight === 'number') {\n return Math.floor(scrollTop / itemHeight);\n }\n\n let sum = 0;\n let offset = 0;\n\n for (let i = 0; i < items.value.length; i += 1) {\n const size = itemHeight(i);\n sum += size;\n if (sum >= scrollTop) {\n offset = i;\n break;\n }\n }\n return offset;\n };\n\n /**\n * Gets the visible number of items based on the container size and item heights.\n * @returns visible number of items.\n */\n const getVisibileNumberOfItems = () => {\n containerHeight.value = containerRef.value.clientHeight;\n if (typeof itemHeight === 'number') {\n return Math.ceil(containerHeight.value / itemHeight);\n }\n\n const start = startIndex.value ?? 0;\n let sum = 0;\n let capacity = 0;\n for (let i = start; i < items.value.length; i += 1) {\n const size = itemHeight(i);\n sum += size;\n capacity = i;\n if (sum > containerHeight.value) {\n break;\n }\n }\n return capacity - start;\n };\n\n const updateVisibleItems = () => {\n if (containerRef.value) {\n const visibleCount = getVisibileNumberOfItems();\n startIndex.value = getOffset();\n endIndex.value = Math.min(startIndex.value + visibleCount + overscan, items.value.length);\n list.value = items.value.slice(startIndex.value, endIndex.value);\n }\n };\n\n const onScroll = () => {\n updateVisibleItems();\n };\n\n if (!disabled) {\n onMounted(() => {\n if (containerRef.value) {\n containerHeight.value = containerRef.value.clientHeight;\n // When the listbox opens we need to update the height\n listObserver = observeSizeOfElement(containerRef.value, ({ clientHeight }) => {\n containerHeight.value = clientHeight;\n updateVisibleItems();\n });\n updateVisibleItems();\n }\n });\n\n onUnmounted(() => {\n listObserver?.disconnect();\n });\n\n watch(\n () => items.value,\n () => {\n updateVisibleItems();\n }\n );\n }\n\n const containerProps: UseVirtualListContainerProps = {\n ref: containerRef,\n style: { overflowY: 'auto' },\n };\n\n if (disabled) {\n return {\n containerRef,\n containerProps,\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onScroll: () => {},\n list: items,\n };\n }\n\n return {\n containerRef,\n containerProps,\n onScroll,\n list,\n wrapperProps,\n };\n}\n","import { BentoSearchBarItem } from '@/components/search-bar';\nimport { BentoEmptyState } from '@/components/empty-state';\nimport { OmitStrict } from '@/core/types/omit-strict';\nimport { BentoButtonActionObject } from '@/components/button';\nimport { UseVirtualListItemHeight } from '@/composables/use-virtual-list';\n\nexport type BentoListboxValue = string | number;\n\nexport type BentoListboxMultiSelectValue = BentoListboxValue[];\n\nexport interface BentoListboxOptionItem extends BentoSearchBarItem {\n data?: unknown;\n description?: string;\n value: BentoListboxValue;\n displayValue?: string;\n items?: Array<BentoListboxOptionItem>; // Reference itself for multi-level options\n}\n\nexport interface BentoListboxSelectedValueLabelPair {\n value: BentoListboxOptionItem['value'];\n label: BentoListboxOptionItem['label'];\n}\n\nexport type BentoListboxSelectedValue =\n | BentoListboxValue\n | BentoListboxMultiSelectValue\n | BentoListboxSelectedValueLabelPair\n | Array<BentoListboxSelectedValueLabelPair>;\n\nexport type BentoListboxOptions = Array<BentoListboxOptionItem>;\n\nexport type BentoListboxIsOptionDisabled = undefined | ((optionValue: BentoListboxOptionItem) => boolean);\n\nexport enum BentoListboxEvent {\n SELECT = 'select',\n SHOW_MORE = 'show-more',\n ESCAPE = 'escape-pressed',\n CLICK = 'click',\n ENTER = 'enter-pressed',\n SPACE = 'space-pressed',\n TAB = 'tab-pressed',\n CLOSE_DROPDOWN = 'close-dropdown',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoListboxLazyLoadType {\n AUTOMATIC = 'automatic',\n BUTTON = 'button',\n NONE = 'none',\n}\n\nexport interface BentoListboxSearchOptions {\n /**\n * Custom debounce time. Default: 300\n */\n debounceTime?: number;\n\n /**\n * The event that triggers upon user filtering the listbox items.\n */\n searchEvent: (searchValue: string) => void;\n}\n\nexport type BentoListboxEmptyStateProps = { action: { icon?: any } & BentoButtonActionObject } & OmitStrict<\n InstanceType<typeof BentoEmptyState>['$props'],\n 'variant' | 'image' | 'description'\n>;\n\nexport type BentoListboxVirtulisationOptions = boolean | { itemHeight: UseVirtualListItemHeight };\n","<template>\n <div class=\"b-listbox-single-select-category\">\n <bento-typography variant=\"caption\" el=\"span\" class=\"b-listbox-single-select-category__label-text\">\n {{ categoryLabel }}\n </bento-typography>\n <div>\n <slot />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent } from 'vue';\n import { BentoTypography } from '@/components/typography';\n\n export default defineComponent({\n name: 'bento-listbox-static-category',\n components: {\n BentoTypography,\n },\n props: {\n /**\n * Category label text\n */\n categoryLabel: {\n type: String,\n required: true,\n },\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./listbox-single-select-category.scss\" />\n","<template>\n <div\n class=\"b-listbox-option\"\n role=\"option\"\n :class=\"conditionalClasses\"\n v-bind=\"$attrs\"\n @click=\"onClick\"\n @keydown.enter=\"onOptionSelected(BentoListboxEvent.ENTER, $event)\"\n @keydown.space=\"onOptionSelected(BentoListboxEvent.SPACE, $event)\"\n @keydown.tab=\"onOptionSelected(BentoListboxEvent.TAB, $event)\"\n >\n <slot></slot>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent } from 'vue';\n import { BentoKeyboardNavigationKeyDownEvent, BentoListboxEvent } from '@/types';\n\n /**\n * listbox option wrapper.\n * Contains only styles and allows the Multi-Select and Single-Select DRY the styles.\n *\n * Options and Attributes are inherited (`inheritAttrs: true`)\n *\n * @example\n * <bento-listbox-option\n * ...props\n * ...attrs\n * />\n */\n export default defineComponent({\n name: 'bento-listbox-option',\n props: {\n /**\n * Setting this property to true will disable the option.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Indicates if the value is selected. Only one element can be selected at a time.\n */\n selected: { type: Boolean, default: false },\n },\n emits: [BentoListboxEvent.CLICK, BentoListboxEvent.ENTER, BentoListboxEvent.SPACE, BentoListboxEvent.TAB],\n setup(props, { emit }) {\n const conditionalClasses = computed(() => ({\n 'b-listbox-option--disabled': props.disabled,\n 'b-listbox-option--selected': props.selected,\n }));\n\n const onClick = (e: Event) => {\n emit(BentoListboxEvent.CLICK, e);\n };\n\n const onOptionSelected = (eventName, e: Event) => {\n emit(eventName, e);\n };\n\n return {\n // Enums\n BentoKeyboardNavigationKeyDownEvent,\n BentoListboxEvent,\n\n // Values\n conditionalClasses,\n\n // Events\n onClick,\n onOptionSelected,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./listbox-option.scss\" />\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=\"M15.0608 4.00011L14.0001 2.93945L6.00011 10.9395L2.00011 6.93945L0.939453 8.00011L6.00011 13.0608L15.0608 4.00011Z\"/></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 <bento-listbox-option\n class=\"b-listbox-single-select-option\"\n :disabled=\"disabled\"\n :selected=\"selected\"\n :aria-selected=\"ariaSelected\"\n :aria-disabled=\"ariaDisabled\"\n :tabindex=\"tabIndex\"\n @click=\"onOptionSelected(BentoListboxEvent.SELECT)\"\n @enter-pressed=\"onOptionSelected(BentoListboxEvent.ENTER)\"\n @space-pressed.prevent=\"onOptionSelected(BentoListboxEvent.SPACE)\"\n @tab-pressed=\"onOptionSelected(BentoListboxEvent.TAB)\"\n >\n <slot v-bind=\"option\">\n <span class=\"b-listbox-single-select-option__text\">\n <bento-typography el=\"span\">{{ option.label }}</bento-typography>\n <bento-typography\n v-if=\"option.description\"\n class=\"b-listbox-single-select-option__description\"\n el=\"span\"\n >\n {{ option.description }}\n </bento-typography>\n </span>\n </slot>\n <span class=\"b-listbox-single-select-option__check-icon\">\n <checkmark-icon v-show=\"selected\" svg-title=\"selected\" />\n </span>\n </bento-listbox-option>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoListboxOption } from '../listbox-option';\n import { BentoListboxEvent, BentoListboxOptionItem } from '@/types';\n import CheckmarkIcon from '@adyen/ui-assets-icons-16/vue/checkmark';\n\n /**\n * Listbox option element.\n *\n * @example\n * <bento-listbox-single-select-option\n * v-for=\"option in options\"\n * :key=\"option.value\"\n * :option=\"option\"\n * :selected=\"option.selected\"\n * @select=\"onOptionSelected\"\n * />\n */\n export default defineComponent({\n name: 'bento-listbox-single-select-option',\n components: {\n BentoListboxOption,\n BentoTypography,\n CheckmarkIcon,\n },\n props: {\n /**\n * Setting this property to true will disable the option.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * The option item that contains all the option item's data.\n * @type {BentoListboxOptionItem}\n */\n option: {\n type: Object as PropType<BentoListboxOptionItem>,\n required: true,\n },\n\n /**\n * Indicates if the value is selected. Only one element can be selected at a time.\n */\n selected: { type: Boolean, default: false },\n },\n emits: [BentoListboxEvent.ENTER, BentoListboxEvent.SELECT, BentoListboxEvent.SPACE, BentoListboxEvent.TAB],\n setup(props, { emit }) {\n const onOptionSelected = eventName => {\n if (props.disabled) {\n return;\n }\n\n /**\n * Trigerred when an option is clicked or selected via keyboard navigation.\n * Indicates which option was selected.\n *\n * @event {string} - The corresponding event\n * @property {number} selectedValue - Selected option's value\n */\n emit(eventName, props.option);\n };\n\n const ariaDisabled = computed(() => (props.disabled ? true : null));\n const ariaSelected = computed(() => (props.selected ? true : null));\n const tabIndex = computed(() => (props.disabled ? -1 : 0));\n\n return {\n // Values\n ariaDisabled,\n ariaSelected,\n tabIndex,\n\n // Enums\n BentoListboxEvent,\n\n // Events\n onOptionSelected,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./listbox-single-select-option.scss\" />\n","import { computed, ref } from 'vue';\n\nconst enum ListboxKeyboardNavigationMutationDirection {\n INCREASE = 'increase',\n DECREASE = 'decrease',\n}\n\nexport const useListboxKeyboardNavigation = ({ items, hasStaticCategories }, focusItem) => {\n // support static categories i.e. items in items\n // we currently only support one level of static categories\n const flattenItems = computed(() =>\n hasStaticCategories.value ? items.value.flatMap(item => item.items) : items.value\n );\n\n const numberOfItems = computed(() => flattenItems.value.length - 1);\n const focusedIndex = ref(0);\n\n const mutateFocusedIndex = (direction: ListboxKeyboardNavigationMutationDirection) => {\n switch (direction) {\n case ListboxKeyboardNavigationMutationDirection.INCREASE:\n focusedIndex.value += 1;\n break;\n case ListboxKeyboardNavigationMutationDirection.DECREASE:\n focusedIndex.value -= 1;\n break;\n default:\n break;\n }\n };\n\n const calculateFocusedIndex = ({ edgeCaseItem }, direction) => {\n const isEdgeCaseItem = focusedIndex.value === edgeCaseItem;\n if (isEdgeCaseItem) {\n return;\n }\n mutateFocusedIndex(direction);\n focusItem(focusedIndex.value);\n };\n\n const moveToNextElement = (event?: CustomEvent<KeyboardEvent>) => {\n // prevent arrow down to scroll down the container\n preventDefault(event);\n calculateFocusedIndex(\n {\n edgeCaseItem: numberOfItems.value,\n },\n ListboxKeyboardNavigationMutationDirection.INCREASE\n );\n };\n\n const moveToPreviousElement = (event?: CustomEvent<KeyboardEvent>) => {\n // prevent arrow up to scroll up the container\n preventDefault(event);\n calculateFocusedIndex(\n {\n edgeCaseItem: 0,\n },\n ListboxKeyboardNavigationMutationDirection.DECREASE\n );\n };\n\n const moveToFirstElement = () => {\n focusedIndex.value = 0;\n focusItem(focusedIndex.value);\n };\n\n const moveToLastElement = () => {\n focusedIndex.value = numberOfItems.value;\n focusItem(focusedIndex.value);\n };\n\n const setListboxFocusedIndex = (index: number) => {\n focusedIndex.value = index;\n };\n\n const preventDefault = (event?: CustomEvent<KeyboardEvent>) => {\n event?.detail?.preventDefault();\n };\n\n return {\n moveToFirstElement,\n moveToLastElement,\n moveToNextElement,\n moveToPreviousElement,\n setListboxFocusedIndex,\n preventDefault,\n focusedIndex,\n };\n};\n","<template>\n <div ref=\"listboxRef\" v-bento-keyboard-navigation-directive v-on=\"listboxListeners\">\n <template v-if=\"hasCategories && staticCategories\">\n <bento-listbox-single-select-category\n v-for=\"category in items\"\n :key=\"category.value\"\n :category-label=\"category.label\"\n role=\"group\"\n >\n <bento-listbox-single-select-option\n v-for=\"option in category.items\"\n :key=\"option.value\"\n ref=\"listboxItemRef\"\n role=\"option\"\n :option=\"option\"\n :disabled=\"isOptionDisabled ? isOptionDisabled(option) : null\"\n :selected=\"option.value === selectedItem.value\"\n v-on=\"listboxOptionListeners\"\n >\n <template v-for=\"(_, innerSlot) of slots\" #[innerSlot]=\"scope\">\n <slot :name=\"innerSlot\" v-bind=\"scope\" />\n </template>\n </bento-listbox-single-select-option>\n </bento-listbox-single-select-category>\n </template>\n <template v-else>\n <bento-listbox-single-select-option\n v-for=\"option in items\"\n :key=\"option.value\"\n ref=\"listboxItemRef\"\n role=\"option\"\n :option=\"option\"\n :disabled=\"isOptionDisabled ? isOptionDisabled(option) : null\"\n :selected=\"option.value === selectedItem.value\"\n v-on=\"listboxOptionListeners\"\n >\n <template v-for=\"(_, innerSlot) of slots\" #[innerSlot]=\"scope\">\n <slot :name=\"innerSlot\" v-bind=\"scope\" />\n </template>\n </bento-listbox-single-select-option>\n </template>\n </div>\n</template>\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref, toRef } from 'vue';\n import { BentoListboxSingleSelectCategory } from './components/listbox-single-select-category';\n import { BentoListboxSingleSelectOption } from '../listbox-single-select-option';\n import { useListboxKeyboardNavigation } from '../../composables/useListboxKeyboardNavigation';\n import {\n BentoKeyboardNavigationKeyDownEvent,\n BentoListboxEvent,\n BentoListboxIsOptionDisabled,\n BentoListboxOptions,\n } from '@/types';\n import { BentoKeyboardNavigationDirective } from '@/directives';\n\n /**\n * Listbox single-select options list\n *\n * @example\n * import { BentoListboxMultiSelect } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoListboxMultiSelect },\n * template: `\n * <bento-listbox-multi-select\n * :items=\"[{ label: 'Option 1', value: 'option-1' }]\"\n * :selected-values=\"['option-1']\"\n * />\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-listbox-single-select',\n components: {\n BentoListboxSingleSelectCategory,\n BentoListboxSingleSelectOption,\n },\n directives: { BentoKeyboardNavigationDirective },\n inheritAttrs: false,\n props: {\n /**\n * Function that allows the options to be disabled\n *\n * @type {BentoListboxIsOptionDisabled}\n * @param {BentoListboxOptionItem} option - listbox option object\n * @param {string} option.label - Option's label text\n * @param {string|number} option.value - Option's value\n * @param {unknown} option.data - Option's extra data to be passed to the default slot\n */\n isOptionDisabled: {\n type: Function as PropType<BentoListboxIsOptionDisabled>,\n default: () => false,\n },\n\n /**\n * The option elements to populate the listbox with.\n * It must be an array of {@see BentoListboxOptionItem }.\n *\n * @property {string} value.label - Text to be displayed in the option\n * @property {string,number} value.value - Value of the option\n */\n items: {\n type: Array as PropType<BentoListboxOptions>,\n required: true,\n },\n\n /**\n * The `input` value.\n * Providing an empty string will select no options.\n * Set to an empty string `''` if you don't want any of the available options to be selected\n */\n selectedValue: {\n type: Array as PropType<BentoListboxOptions>,\n default: undefined,\n },\n\n /**\n * If enabled, dropdown will display non-selectable, static categories\n */\n staticCategories: { type: Boolean, default: false },\n },\n emits: [BentoListboxEvent.SELECT, BentoListboxEvent.ENTER, BentoListboxEvent.SPACE, BentoListboxEvent.TAB],\n setup(props, { emit, expose, slots }) {\n const listboxRef = ref(null);\n const listboxItemRef = ref([]);\n const selectedItem = computed(() => !!props.selectedValue?.length && props.selectedValue.at(0));\n\n /**\n * Finds out if items have sub items\n */\n const hasCategories = computed(() => !!props.items.some(({ items }) => !!items));\n\n const onOptionSelected = eventName => (selectedOption: BentoListboxOptions) => {\n emit(eventName, [selectedOption]);\n };\n\n const focusItem = (nextFocusedItemIndex: number) => {\n // because of the way Vue handles reactivity, the order of the refs children is different than the DOM order\n // after filtering. using the DOM is better to ensure the correct order of the elements.\n listboxRef.value.querySelectorAll('[role=\"option\"]')[nextFocusedItemIndex]?.focus();\n };\n\n // Keyboard navigation\n const {\n moveToNextElement,\n moveToPreviousElement,\n moveToFirstElement,\n moveToLastElement,\n setListboxFocusedIndex,\n } = useListboxKeyboardNavigation(\n {\n items: toRef(props, 'items'),\n hasStaticCategories: toRef(props, 'staticCategories'),\n },\n focusItem\n );\n\n const listboxListeners = {\n [BentoKeyboardNavigationKeyDownEvent.ARROW_UP]: moveToPreviousElement,\n [BentoKeyboardNavigationKeyDownEvent.ARROW_DOWN]: moveToNextElement,\n [BentoKeyboardNavigationKeyDownEvent.HOME]: moveToFirstElement,\n [BentoKeyboardNavigationKeyDownEvent.END]: moveToLastElement,\n };\n\n const listboxOptionListeners = {\n [BentoListboxEvent.SELECT]: onOptionSelected(BentoListboxEvent.SELECT),\n [BentoListboxEvent.SPACE]: onOptionSelected(BentoListboxEvent.SPACE),\n [BentoListboxEvent.TAB]: onOptionSelected(BentoListboxEvent.TAB),\n [BentoListboxEvent.ENTER]: onOptionSelected(BentoListboxEvent.ENTER),\n };\n\n expose({\n /**\n * Reference for a single listbox item.\n * Required for keyboard navigation in dropdown as $children is removed in vue@3\n */\n listboxItemRef,\n /**\n * Method to set the index of the item to be focused on\n * Used for focus management to be kept in-sync with parent e.g. dropdowns\n */\n setListboxFocusedIndex,\n });\n\n return {\n // Enums\n BentoListboxEvent,\n\n // Values\n listboxRef,\n listboxItemRef,\n selectedItem,\n slots,\n\n // Computed\n hasCategories,\n\n // Methods\n onOptionSelected,\n\n // Keyboard navigation\n listboxListeners,\n listboxOptionListeners,\n };\n },\n });\n</script>\n","export enum ListboxMultiSelectCategoryClass {\n DISABLED = 'disabled',\n STATIC_CATEGORY = 'static-category',\n}\n\nexport enum ListboxMultiSelectCategoryEvent {\n SELECT_CATEGORY = 'select-category',\n UNSELECT_CATEGORY = 'unselect-category',\n}\n","<template>\n <div>\n <bento-listbox-option\n class=\"b-listbox-multi-select-category__option\"\n :class=\"conditionalClass\"\n :tabindex=\"tabindex\"\n @click=\"handleSelectAll\"\n @enter-pressed=\"handleSelectAll\"\n @space-pressed.prevent=\"handleSelectAll\"\n >\n <bento-checkbox\n v-if=\"!isStaticCategory\"\n :model-value=\"isAllSelected\"\n :indeterminate=\"isIndeterminate\"\n :disabled=\"hasAllPropsDisabled\"\n :aria-label=\"category.label\"\n :value=\"category.value\"\n :tabindex=\"-1\"\n />\n <span class=\"b-listbox-multi-select-category__label\">\n <bento-typography v-bind=\"categoryLabelProps\" class=\"b-listbox-multi-select-category__label-text\">\n {{ category.label }}\n </bento-typography>\n <div\n v-if=\"!isStaticCategory\"\n class=\"b-listbox-multi-select-category__label-chevron\"\n data-testid=\"toggle-listbox\"\n @click.capture.stop=\"toggleOpen\"\n >\n <chevron-up-icon v-if=\"isOpen\" :svg-title=\"chevronTitle\" />\n <chevron-down-icon v-else :svg-title=\"chevronTitle\" />\n </div>\n </span>\n </bento-listbox-option>\n\n <div v-show=\"showItemChildren\">\n <slot />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref, toRef, watch } from 'vue';\n import { BentoCheckbox } from '@/components/checkbox';\n import { BentoTypography } from '@/components/typography';\n import { BentoListboxOption } from '../../../../../listbox-option';\n import {\n BentoListboxIsOptionDisabled,\n BentoListboxMultiSelectValue,\n BentoListboxOptionItem,\n BentoListboxValue,\n } from '@/types';\n import { useCheckboxSelectAll } from '@/composables';\n import {\n ListboxMultiSelectCategoryClass,\n ListboxMultiSelectCategoryEvent,\n } from './listbox-multi-select-category.types';\n import { useI18n } from '@/utils/ts/i18n';\n import ChevronDownIcon from '@adyen/ui-assets-icons-16/vue/chevron-down';\n import ChevronUpIcon from '@adyen/ui-assets-icons-16/vue/chevron-up';\n import messages from './messages.json';\n\n /**\n * Listbox multi-select category list.\n * Allows the rendering of nested lists\n *\n * @example\n * import { ListboxMultiSelectCategory } from '@/internal/listbox';\n *\n * export default {\n * components: { BentoListboxMultiSelectCategory },\n * template: `\n * <listbox-multi-select-category\n * :category=\"option\"\n * :is-option-disabled=\"true\"\n * :selected-items-list=\"['option-1']\"\n * @select-category=\"$emit('select-category', option)\"\n * @unselect-category=\"$emit('unselect-category', option)\"\n * >\n * <listbox-multi-select-options\n * category-items\n * :items=\"[{ label: 'Option 1', value: 'option-1' }]\"\n * :is-multi-level=\"true\"\n * :selected-items-list=\"['option-']\"\n * :searching=\"false\"\n * @toggle-checkbox-selection=\"value => toggleCheckboxSelection(value)\"\n * />\n * </listbox-multi-select-category>\n * `\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-listbox-multi-select-category',\n components: {\n BentoCheckbox,\n BentoTypography,\n BentoListboxOption,\n ChevronDownIcon,\n ChevronUpIcon,\n },\n props: {\n /**\n * The option elements to populate the listbox with.\n * It must be an array of {@see BentoListboxOptionItem }.\n *\n * @property {string} value.label - Text to be displayed in the option\n * @property {string,number} value.value - Value of the option\n * @property {BentoListboxOptionItem} value.items - Category items list\n */\n category: {\n type: Object as PropType<BentoListboxOptionItem>,\n required: true,\n },\n\n /**\n * Function that allows the options to be disabled\n *\n * @type {BentoListboxIsOptionDisabled}\n * @param {BentoListboxOptionItem} option - listbox option object\n * @param {string} option.label - Option's label text\n * @param {string|number} option.value - Option's value\n * @param {unknown} option.data - Option's extra data to be passed to the default slot\n */\n isOptionDisabled: {\n type: [Function] as PropType<BentoListboxIsOptionDisabled>,\n default: () => false,\n },\n\n /**\n * The `input` value.\n * Providing an empty array will select no options.\n */\n selectedItemsList: {\n type: Array as PropType<BentoListboxValue[]>,\n default: () => [],\n },\n\n /**\n * If enabled, dropdown will display non-selectable, static categories\n */\n staticCategories: { type: Boolean, default: false },\n\n /**\n * Category's tabindex\n */\n tabindex: { type: Number, default: -1 },\n },\n emits: [ListboxMultiSelectCategoryEvent.SELECT_CATEGORY, ListboxMultiSelectCategoryEvent.UNSELECT_CATEGORY],\n setup(props, { emit }) {\n const isOpen = ref(false);\n const { t } = useI18n();\n\n // This method should be used to determine if an option is disabled as it works for both vue 2 & 3.\n const vue2Vue3FixedisOptionDisabled = option =>\n props.isOptionDisabled ? props.isOptionDisabled(option) : false;\n\n const hasAllPropsDisabled = computed(() =>\n props.category.items.every(option => vue2Vue3FixedisOptionDisabled(option))\n );\n\n const isStaticCategory = toRef(props, 'staticCategories');\n\n // Display item children if is open state or if static categories is enabled\n const showItemChildren = computed(() => isOpen.value || props.staticCategories);\n\n const conditionalClass = computed(() => ({\n [`b-listbox-multi-select-category--${ListboxMultiSelectCategoryClass.DISABLED}`]:\n hasAllPropsDisabled.value,\n [`b-listbox-multi-select-category--${ListboxMultiSelectCategoryClass.STATIC_CATEGORY}`]:\n props.staticCategories,\n }));\n\n const toggleOpen = (event: Event) => {\n event.preventDefault();\n isOpen.value = !isOpen.value;\n };\n\n const optionStates = (option: BentoListboxOptionItem) => {\n const isDisabled = vue2Vue3FixedisOptionDisabled(option);\n const isPreSelected =\n (props.selectedItemsList as BentoListboxMultiSelectValue)?.includes(option.value) || false;\n return { isDisabled, isPreSelected };\n };\n\n const enabledItems = computed(() =>\n props.category.items.filter(option => {\n const { isDisabled, isPreSelected } = optionStates(option);\n return (isDisabled && isPreSelected) || !isDisabled;\n })\n );\n\n const visibleSelectedList = computed(\n () =>\n enabledItems.value?.filter(({ value }) =>\n props.selectedItemsList?.includes(value)\n ) as unknown as BentoListboxMultiSelectValue\n );\n\n const chevronTitle = computed(() => {\n const messageName = isOpen.value ? 'categoryOpened' : 'categoryClosed';\n return t(messageName, { category: props.category.label }) as string;\n });\n\n const categoryLabelProps = computed(\n () =>\n ({\n el: 'span',\n variant: props.staticCategories ? 'caption' : 'body',\n }) as InstanceType<typeof BentoTypography>['$props']\n );\n\n const selectAll = () => {\n emit(ListboxMultiSelectCategoryEvent.SELECT_CATEGORY);\n };\n const unselectAll = () => {\n emit(ListboxMultiSelectCategoryEvent.UNSELECT_CATEGORY);\n };\n\n const { isAllSelected, isIndeterminate, toggleSelectAll } = useCheckboxSelectAll(\n visibleSelectedList,\n enabledItems,\n selectAll,\n unselectAll\n );\n\n const isSelectAllOn = ref(isAllSelected.value);\n\n const handleSelectAll = () => {\n isSelectAllOn.value = !isSelectAllOn.value;\n toggleSelectAll(isSelectAllOn.value);\n };\n\n watch(isAllSelected, () => {\n isSelectAllOn.value = isAllSelected.value;\n });\n\n return {\n // Values\n chevronTitle,\n conditionalClass,\n hasAllPropsDisabled,\n isOpen,\n isAllSelected,\n isIndeterminate,\n isStaticCategory,\n\n // Computed\n showItemChildren,\n categoryLabelProps,\n\n // Methods\n handleSelectAll,\n toggleOpen,\n toggleSelectAll,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./listbox-multi-select-category.scss\" />\n","export enum ListboxMultiSelectOptionsEvent {\n SELECT_CATEGORY = 'select-category',\n TOGGLE_CHECKBOX_SELECTION = 'toggle-checkbox-selection',\n UNSELECT_CATEGORY = 'unselect-category',\n}\n","<template>\n <div>\n <div v-for=\"(option, index) in items\" :key=\"`selected-${option.value}`\">\n <template v-if=\"searching && isMultiLevel\">\n <bento-listbox-option\n class=\"b-listbox-multi-select-options\"\n :class=\"conditionalClasses\"\n :disabled=\"isOptionDisabled ? isOptionDisabled(option) : null\"\n :tabindex=\"computedTabindex(index)\"\n @click=\"toggleSearchOption(option)\"\n @enter-pressed=\"toggleSearchOption(option)\"\n @space-pressed.prevent=\"toggleSearchOption(option)\"\n >\n <bento-checkbox\n :model-value=\"isOptionSelected(option)\"\n :aria-label=\"option.label\"\n :disabled=\"isOptionDisabled ? isOptionDisabled(option) : null\"\n :value=\"option.value\"\n tabindex=\"-1\"\n />\n <slot v-bind=\"option\">\n <span class=\"b-listbox-multi-select__option-text\">\n <bento-typography el=\"span\">{{ option.label }}</bento-typography>\n <bento-typography\n v-if=\"shouldShowDescription(option)\"\n class=\"b-listbox-multi-select__option-description\"\n el=\"span\"\n >\n {{ option.description }}\n </bento-typography>\n </span>\n </slot>\n </bento-listbox-option>\n </template>\n\n <template v-else>\n <!-- Category -->\n <template v-if=\"option.items\">\n <listbox-multi-select-category\n :category=\"option\"\n :static-categories=\"staticCategories\"\n :is-option-disabled=\"isOptionDisabled\"\n :selected-items-list=\"selectedItemsList\"\n :tabindex=\"computedTabindex(index)\"\n @select-category=\"$emit(ListboxMultiSelectOptionsEvent.SELECT_CATEGORY, option)\"\n @unselect-category=\"$emit(ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY, option)\"\n >\n <listbox-multi-select-options\n category-items\n :items=\"option.items\"\n :is-option-disabled=\"isOptionDisabled\"\n :focused-index=\"focusedIndex\"\n :is-multi-level=\"isMultiLevel\"\n :static-categories=\"staticCategories\"\n :selected-items-list=\"selectedItemsList\"\n :searching=\"searching\"\n @toggle-checkbox-selection=\"value => toggleCheckboxSelection(value)\"\n />\n </listbox-multi-select-category>\n </template>\n\n <!-- Option -->\n <bento-listbox-option\n v-else\n class=\"b-listbox-multi-select-options\"\n :class=\"conditionalClasses\"\n :disabled=\"isOptionDisabled ? isOptionDisabled(option) : null\"\n :tabindex=\"computedTabindex(index)\"\n @click=\"toggleCheckboxSelection(option)\"\n @enter-pressed=\"toggleCheckboxSelection(option)\"\n @space-pressed.prevent=\"toggleCheckboxSelection(option)\"\n >\n <bento-checkbox\n :model-value=\"selectedItemsList\"\n :aria-label=\"option.label\"\n :disabled=\"isOptionDisabled ? isOptionDisabled(option) : null\"\n :value=\"option.value\"\n :tabindex=\"-1\"\n />\n <slot v-bind=\"option\">\n <span class=\"b-listbox-multi-select__option-text\">\n <bento-typography el=\"span\">{{ option.label }}</bento-typography>\n <bento-typography\n v-if=\"shouldShowDescription(option)\"\n class=\"b-listbox-multi-select__option-description\"\n el=\"span\"\n >\n {{ option.description }}\n </bento-typography>\n </span>\n </slot>\n </bento-listbox-option>\n </template>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoCheckbox } from '@/components/checkbox';\n import { BentoListboxOption } from '../../../listbox-option';\n import { BentoTypography } from '@/components/typography';\n import { ListboxMultiSelectCategory } from './components/listbox-multi-select-category';\n import {\n BentoListboxEvent,\n BentoListboxIsOptionDisabled,\n BentoListboxOptionItem,\n BentoListboxOptions,\n BentoListboxValue,\n } from '@/types';\n import { ListboxMultiSelectOptionsEvent } from './listbox-multi-select-options.types';\n\n /**\n * Listbox multi-select options list\n *\n * @example\n * import { ListboxMultiSelectOptions } from './components/listbox-multi-select-options';\n *\n * export default {\n * components: { ListboxMultiSelect },\n * template: `\n * <listbox-multi-select\n * :items=\"[{ label: 'Option 1', value: 'option-1' }]\"\n * :selected-values=\"['option-1']\"\n * />\n * `\n * }\n */\n export default defineComponent({\n name: 'listbox-multi-select-options',\n components: {\n BentoCheckbox,\n BentoListboxOption,\n BentoTypography,\n ListboxMultiSelectCategory,\n },\n props: {\n /**\n * Indicates if the items listed are inside a category\n * so they can be padded to right by one level in recursion.\n * Items of categories are automatically defined as \"categoryItems\"\n */\n categoryItems: { type: Boolean, default: false },\n\n /**\n * Current focused option index\n */\n focusedIndex: { type: Number, default: 0 },\n\n /**\n * Function that allows the options to be disabled\n *\n * @type {BentoListboxIsOptionDisabled}\n * @param {BentoListboxOptionItem} option - listbox option object\n * @param {string} option.label - Option's label text\n * @param {string|number} option.value - Option's value\n * @param {unknown} option.data - Option's extra data to be passed to the default slot\n */\n isOptionDisabled: {\n type: Function as PropType<BentoListboxIsOptionDisabled>,\n default: () => false,\n },\n\n /**\n * The option elements to populate the listbox with.\n * It must be an array of {@see BentoListboxOptionItem }.\n *\n * @property {string} value.label - Text to be displayed in the option\n * @property {string,number} value.value - Value of the option\n */\n items: {\n type: Array as PropType<BentoListboxOptions>,\n required: true,\n },\n\n /**\n * Indicates if the elements options are inside a multi-level category\n */\n isMultiLevel: { type: Boolean, default: false },\n\n /**\n * Flag that indicates that an external search it's being made\n * to filter out the items inside the the multi-select listbox\n *\n * If enabled, hides the \"Select all\" checkbox in \"multiple\" mode.\n */\n searching: { type: Boolean, default: false },\n\n /**\n * List of selected items.\n * Providing an empty array will select no options.\n */\n selectedItemsList: {\n type: Array as PropType<BentoListboxValue[]>,\n default: () => [],\n },\n\n /**\n * If enabled, dropdown will display non-selectable, static categories\n */\n staticCategories: { type: Boolean, default: false },\n },\n emits: [\n ListboxMultiSelectOptionsEvent.TOGGLE_CHECKBOX_SELECTION,\n ListboxMultiSelectOptionsEvent.SELECT_CATEGORY,\n ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY,\n ],\n setup(props, { emit }) {\n const toggleCheckboxSelection = (option: BentoListboxOptionItem) => {\n if (props.isOptionDisabled(option)) {\n return;\n }\n emit(ListboxMultiSelectOptionsEvent.TOGGLE_CHECKBOX_SELECTION, option);\n };\n\n const isCategory = (option: BentoListboxOptionItem) => !!option.items;\n const shouldShowDescription = (option: BentoListboxOptionItem) => {\n const isSearchingMultiLevel = props.isMultiLevel && props.searching;\n\n return option.description && (!props.isMultiLevel || isSearchingMultiLevel);\n };\n\n const isOptionSelected = option => {\n if (option.items) {\n return !!option.items.find(item => props.selectedItemsList.includes(item.value));\n }\n return props.selectedItemsList.includes(option.value);\n };\n\n const toggleSearchOption = option => {\n if (isCategory(option)) {\n const event = isOptionSelected(option)\n ? ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY\n : ListboxMultiSelectOptionsEvent.SELECT_CATEGORY;\n emit(event, option);\n } else {\n toggleCheckboxSelection(option);\n }\n };\n\n const conditionalClasses = computed(() => ({\n 'b-listbox-multi-select-options__static-category-option': props.staticCategories,\n 'b-listbox-multi-select-options__category-option': props.categoryItems,\n }));\n\n const computedTabindex = index => (index + 1 === props.focusedIndex ? 0 : -1);\n\n return {\n // Values\n conditionalClasses,\n\n // Methods\n isOptionSelected,\n shouldShowDescription,\n toggleCheckboxSelection,\n toggleSearchOption,\n computedTabindex,\n\n // Enums\n BentoListboxEvent,\n ListboxMultiSelectOptionsEvent,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./listbox-multi-select-options.scss\" />\n","import { BentoListboxOptions } from '@/types/listbox';\nimport { computed, Ref } from 'vue';\n\n/**\n * Checks if items array is flat or has multi levels and converts items into a flat array if needed\n *\n * It receives a layout of type @see BentoLayoutGroupProportions to\n * generate the class and apply it to the children of the @see BentoFormLayoutGroup component\n *\n * @param {Ref<BentoListboxOptions>} itemsList - ref of the list of items for the listbox\n * @returns {ComputedRef<boolean>} isMultiLevelSelect - Indicates if items array is multi level\n * @returns {ComputedRef<any[]>} flattenedItemsList - list of items computed into a flat array\n */\nexport const useMultiLevelItems = (itemsList: Ref<BentoListboxOptions>) => {\n const isMultiLevelSelect = computed(() => !!itemsList.value?.find(({ items }) => !!items));\n\n const flattenedItemsList = computed(() => {\n if (isMultiLevelSelect.value) {\n return itemsList.value?.reduce((acc, val) => {\n if (val.items) {\n acc.push(...val.items.flat());\n } else {\n acc.push(val);\n }\n return acc;\n }, []);\n }\n\n return itemsList.value;\n });\n\n return {\n isMultiLevelSelect,\n flattenedItemsList,\n };\n};\n","<template>\n <div ref=\"listboxRef\" class=\"b-listbox-multi-select\">\n <!-- Selected options -->\n <div v-if=\"showSelectedItems\">\n <ul\n v-bento-keyboard-navigation-directive\n class=\"b-listbox-multi-select__chips\"\n v-on=\"chipsSectionListeners\"\n >\n <li v-for=\"item in selectedOptions\" :key=\"item.value\">\n <bento-chip\n ref=\"selectedListboxItemsRef\"\n :disabled=\"isOptionDisabled(item)\"\n :label=\"item.label\"\n condensed\n @click=\"item.items ? unselectAllCategory(item) : toggleCheckboxSelection('select', item)\"\n />\n </li>\n </ul>\n\n <hr class=\"b-listbox-multi-select__divider\" />\n </div>\n\n <div v-bento-keyboard-navigation-directive v-on=\"listboxListeners\">\n <!-- Select all -->\n <bento-listbox-option\n v-if=\"showSelectAllCheckbox\"\n ref=\"selectAllListboxItemsRef\"\n class=\"b-listbox-multi-select__option\"\n :tabindex=\"focusedIndex === 0 ? 0 : -1\"\n @click=\"handleSelectAll\"\n @enter-pressed=\"handleSelectAll\"\n @space-pressed.prevent=\"handleSelectAll\"\n >\n <bento-checkbox\n :aria-label=\"selectAllCheckboxText\"\n :model-value=\"isAllSelected\"\n :indeterminate=\"isIndeterminate\"\n :tabindex=\"-1\"\n />\n <bento-typography el=\"span\" aria-hidden=\"true\">\n {{ selectAllCheckboxText }}\n </bento-typography>\n </bento-listbox-option>\n <hr v-if=\"showSelectAllCheckbox\" class=\"b-listbox-multi-select__divider\" />\n\n <!-- Available options -->\n <listbox-multi-select-options\n ref=\"listboxItemsRef\"\n :items=\"items\"\n :is-option-disabled=\"isOptionDisabled\"\n :is-multi-level=\"isMultiLevelSelect\"\n :static-categories=\"staticCategories\"\n :searching=\"searching\"\n :selected-items-list=\"selectedItemsList\"\n :focused-index=\"focusedIndex\"\n @toggle-checkbox-selection=\"toggleCheckboxSelection('select', $event)\"\n @select-category=\"selectAllCategory\"\n @unselect-category=\"unselectAllCategory\"\n @space-pressed=\"toggleCheckboxSelection(BentoListboxEvent.SPACE, $event)\"\n @tab-pressed=\"toggleCheckboxSelection(BentoListboxEvent.TAB, $event)\"\n @enter-pressed=\"toggleCheckboxSelection(BentoListboxEvent.ENTER, $event)\"\n >\n <template v-for=\"(_, innerSlot) of slots\" #[innerSlot]=\"scope\">\n <slot :name=\"innerSlot\" v-bind=\"scope\" />\n </template>\n </listbox-multi-select-options>\n </div>\n </div>\n</template>\n<script setup lang=\"ts\">\n import { computed, ref, toRef, useSlots, watch } from 'vue';\n import { isVue2 } from 'vue-demi';\n\n import { BentoCheckbox } from '@/components/checkbox';\n import { BentoTypography } from '@/components/typography';\n import { BentoChip } from '@/components/chip';\n import { BentoListboxOption } from '../listbox-option';\n import { ListboxMultiSelectOptions } from './components/listbox-multi-select-options';\n\n import { useCheckboxSelectAll } from '@/composables';\n import { useListboxKeyboardNavigation } from '../../composables/useListboxKeyboardNavigation';\n import { useMultiLevelItems } from '../../composables/use-multi-level-items/use-multi-level-items';\n import { useI18n } from '@/utils/ts/i18n';\n import { BentoKeyboardNavigationDirective as vBentoKeyboardNavigationDirective } from '@/directives';\n\n import {\n BentoKeyboardNavigationKeyDownEvent,\n BentoListboxEvent,\n BentoListboxMultiSelectValue,\n BentoListboxOptionItem,\n BentoListboxOptions,\n BentoListboxValue,\n } from '@/types';\n import { ListboxMultiSelectProps } from './listbox-multi-select.types';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n hasMoreItems: { type: Boolean, default: false },\n isOptionDisabled: { default: isVue2 ? () => () => false : () => false },\n items: null,\n lazyLoadType: { default: 'none' },\n searching: { type: Boolean, default: false },\n selectedValues: null,\n staticCategories: { type: Boolean, default: false }\n});\n\n const emit = defineEmits([\"select\"]);\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const slots = useSlots();\n\n const listboxRef = ref(null);\n const selectAllListboxItemsRef = ref(null);\n const selectedListboxItemsRef = ref(null);\n const listboxItemsRef = ref(null);\n\n const selectedItemsList = computed<BentoListboxValue[]>(() => props.selectedValues.map(({ value }) => value));\n\n const { isMultiLevelSelect, flattenedItemsList } = useMultiLevelItems(toRef(props, 'items'));\n\n const optionStates = (option: BentoListboxOptionItem) => {\n const isDisabled = props.isOptionDisabled(option);\n const isPreSelected =\n (selectedItemsList.value as BentoListboxMultiSelectValue)?.includes(option.value) || false;\n return { isDisabled, isPreSelected };\n };\n\n // Items that are not disabled and pre-selected disabled items\n const enabledItems = computed(() => {\n if (props.searching && isMultiLevelSelect) {\n return props.items;\n }\n\n const fullItemsList = flattenedItemsList.value.filter(option => {\n const { isDisabled, isPreSelected } = optionStates(option);\n return (isDisabled && isPreSelected) || !isDisabled;\n });\n\n props.selectedValues.forEach(selectedValue => {\n if (!fullItemsList.find(item => item.value === selectedValue.value)) {\n fullItemsList.push(selectedValue);\n }\n });\n\n return fullItemsList;\n });\n\n const visibleSelectedList = computed(\n () =>\n enabledItems.value?.filter(option => {\n if (option.items && isMultiLevelSelect.value && props.searching) {\n const amountOfSelectedCategoryOptions = option.items.filter(categoryOption =>\n (props.selectedValues ?? []).includes(categoryOption.value)\n ).length;\n return amountOfSelectedCategoryOptions === option.items.length;\n }\n\n return selectedItemsList.value?.includes(option.value); // Check for category\n }) as BentoListboxMultiSelectValue\n );\n\n const calculateTotalItems = () => {\n if (isMultiLevelSelect.value && !props.searching) {\n return flattenedItemsList.value.length;\n }\n\n return props.items.length;\n };\n\n const selectAllCheckboxText = computed(() => {\n const possibleSelections = enabledItems.value.length;\n const total = calculateTotalItems();\n const amountSelectedValues = visibleSelectedList.value?.length || 0;\n\n if (amountSelectedValues === 0) {\n return t('selectAll', { total: possibleSelections });\n }\n\n if (amountSelectedValues === total) {\n return t('allSelected', { total });\n }\n\n return amountSelectedValues <= total\n ? t('numberOfTotalSelected', { number: amountSelectedValues, total })\n : t('numbersSelected', { number: amountSelectedValues });\n });\n\n const selectAll = (selectableItems: BentoListboxOptions) => {\n const filterOutDisabledAndNotPreselectedOptions = option => {\n const { isDisabled, isPreSelected } = optionStates(option);\n return (isDisabled && isPreSelected) || !isDisabled;\n };\n\n // Adding or removing this list of values\n const addOrRemoveList = selectableItems\n .filter(filterOutDisabledAndNotPreselectedOptions)\n .filter(item => !selectedItemsList.value.includes(item.value)); // MAKE SURE NOT TO ADD DUPLICATES\n\n emit('select', [...props.selectedValues, ...addOrRemoveList]);\n };\n\n const unselectAll = (selectableItems: BentoListboxOptions) => {\n const findEnabledUnselectedItems = option => {\n const { isDisabled, isPreSelected } = optionStates(option);\n return !(isDisabled && isPreSelected);\n };\n\n const unselectedItemsList = selectableItems.filter(findEnabledUnselectedItems).map(({ value }) => value);\n const newSelectedList = props.selectedValues.filter(item => !unselectedItemsList?.includes(item.value));\n emit('select', newSelectedList);\n };\n\n const selectAllItems = () => {\n selectAll(flattenedItemsList.value);\n };\n\n const unselectAllItems = () => {\n unselectAll(flattenedItemsList.value);\n };\n\n const { isAllSelected, isIndeterminate, toggleSelectAll } = useCheckboxSelectAll(\n visibleSelectedList,\n enabledItems,\n selectAllItems,\n unselectAllItems\n );\n\n const isSelectAllOn = ref(isAllSelected.value);\n\n const handleSelectAll = () => {\n isSelectAllOn.value = !isSelectAllOn.value;\n toggleSelectAll(isSelectAllOn.value);\n };\n\n watch(isAllSelected, () => {\n isSelectAllOn.value = isAllSelected.value;\n });\n\n const selectAllCategory = (category: BentoListboxOptionItem) => {\n selectAll(category.items);\n };\n\n const unselectAllCategory = (category: BentoListboxOptionItem) => {\n unselectAll(category.items);\n };\n\n const toggleCheckboxSelection = (eventName, selectedOption: BentoListboxOptionItem) => {\n let exists = false;\n const newSelectedList = props.selectedValues.filter(({ value }) => {\n if (selectedOption.value === value) {\n exists = true;\n return false;\n }\n\n return true;\n });\n\n if (!exists) {\n newSelectedList.push(selectedOption);\n }\n emit(eventName, newSelectedList);\n };\n\n const selectedOptions = computed(() => {\n if (!isMultiLevelSelect.value) {\n return props.selectedValues;\n }\n\n const isOptionSelected = (option: BentoListboxOptionItem): boolean =>\n (selectedItemsList.value as unknown as Array<string | number>).includes(option.value);\n\n const categoryOptionsSelected = (categoryOptions: BentoListboxOptionItem[]): boolean =>\n !props.staticCategories && categoryOptions.every(option => isOptionSelected(option));\n\n const optionsFlat = props.items.flatMap(option =>\n option.items && !categoryOptionsSelected(option.items) ? option.items : option\n );\n\n const options = optionsFlat.filter(option => {\n if (option.items) {\n return true;\n }\n return isOptionSelected(option);\n });\n\n return options;\n });\n\n const showSelectedItems = computed(() => {\n const isLazyLoad = ['automatic', 'button'].includes(props.lazyLoadType);\n const hasAllItemsSelected =\n props.selectedValues?.length > 0 && visibleSelectedList.value?.length !== flattenedItemsList.value?.length;\n\n if (isLazyLoad && props.hasMoreItems) {\n return !!props.selectedValues?.length;\n }\n\n return hasAllItemsSelected;\n });\n\n const showSelectAllCheckbox = computed(() => {\n const isLazyLoad = ['automatic', 'button'].includes(props.lazyLoadType);\n\n if (!isLazyLoad) {\n return true;\n }\n\n return !props.hasMoreItems;\n });\n\n // Keyboard navigation\n const computedselectAllItemRefs = computed(() => ({ label: selectAllCheckboxText, value: isAllSelected }));\n\n const computedItems = computed(() => [computedselectAllItemRefs, ...toRef(props, 'items').value]);\n\n const focusItem = (nextFocusedItemIndex: number) => {\n // because of the way Vue handles reactivity, the order of the refs children is different than the DOM order\n // after filtering. using the DOM is better to ensure the correct order of the elements.\n const visibleOptions = Array.from(\n listboxRef.value.querySelectorAll('[role=\"option\"]') as HTMLDivElement[]\n ).filter((option: HTMLDivElement) => option.checkVisibility());\n visibleOptions[nextFocusedItemIndex]?.focus();\n };\n\n const {\n moveToNextElement,\n moveToPreviousElement,\n moveToFirstElement,\n moveToLastElement,\n preventDefault,\n focusedIndex,\n } = useListboxKeyboardNavigation(\n {\n items: ref(computedItems),\n hasStaticCategories: toRef(props, 'staticCategories'),\n },\n focusItem\n );\n\n const listboxListeners = {\n [BentoKeyboardNavigationKeyDownEvent.ARROW_UP]: (event: CustomEvent<KeyboardEvent>) =>\n moveToPreviousElement(event),\n [BentoKeyboardNavigationKeyDownEvent.ARROW_DOWN]: (event: CustomEvent<KeyboardEvent>) =>\n moveToNextElement(event),\n [BentoKeyboardNavigationKeyDownEvent.HOME]: moveToFirstElement,\n [BentoKeyboardNavigationKeyDownEvent.END]: moveToLastElement,\n };\n\n const chipsSectionListeners = {\n [BentoKeyboardNavigationKeyDownEvent.ARROW_UP]: preventDefault,\n [BentoKeyboardNavigationKeyDownEvent.ARROW_DOWN]: preventDefault,\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Listbox multi-select options list\n *\n * @example\n * import { BentoListboxMultiSelect } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoListboxMultiSelect },\n * template: `\n * <bento-listbox-multi-select\n * :items=\"[{ label: 'Option 1', value: 'option-1' }]\"\n * :selected-values=\"['option-1']\"\n * />\n * `\n * }\n */\n export default { i18n: { messages } };\n</script>\n\n<style lang=\"scss\" scoped src=\"./listbox-multi-select.scss\" />\n","<template>\n <div\n :id=\"id\"\n ref=\"listboxRef\"\n v-bento-keyboard-navigation-directive\n class=\"b-listbox\"\n role=\"listbox\"\n tabindex=\"-1\"\n :aria-busy=\"ariaBusy\"\n :aria-atomic=\"ariaAtomic\"\n :aria-label=\"ariaLabel\"\n :aria-live=\"ariaLive\"\n :style=\"containerProps?.style\"\n @scroll=\"onListboxContainerScroll\"\n >\n <div v-bind=\"wrapperProps\">\n <!-- Loading filtered items loading -->\n <div v-if=\"componentLoading\" class=\"b-listbox__loading-filtered-items\">\n <bento-loading-indicator />\n </div>\n <!-- Empty search message -->\n <div v-else-if=\"isSearchResultEmpty\" class=\"b-listbox__empty-search-message\">\n <bento-empty-state v-if=\"emptyState\" v-bind=\"limitedEmptyStateProps\" />\n <bento-typography v-else el=\"span\">{{ noResultsMessage }}</bento-typography>\n </div>\n\n <template v-else>\n <!-- Multi select -->\n <template v-if=\"multiple\">\n <bento-listbox-multi-select\n ref=\"listboxItemRef\"\n :has-more-items=\"hasMoreItems\"\n :items=\"items\"\n :lazy-load-type=\"lazyLoadType\"\n :static-categories=\"staticCategories\"\n :selected-values=\"selectedValue\"\n :searching=\"searching\"\n :is-option-disabled=\"isOptionDisabled\"\n v-on=\"listboxListeners\"\n >\n <template v-for=\"(_, innerSlot) of slots\" #[innerSlot]=\"scope\">\n <slot :name=\"innerSlot\" v-bind=\"scope\" />\n </template>\n </bento-listbox-multi-select>\n </template>\n\n <!-- Single select -->\n <template v-else>\n <bento-listbox-single-select\n ref=\"listboxItemRef\"\n :items=\"virtualisedItems\"\n :selected-value=\"selectedValue\"\n :static-categories=\"staticCategories\"\n :is-option-disabled=\"isOptionDisabled\"\n v-on=\"listboxListeners\"\n >\n <template v-for=\"(_, innerSlot) of slots\" #[innerSlot]=\"scope\">\n <slot :name=\"innerSlot\" v-bind=\"scope\" />\n </template>\n </bento-listbox-single-select>\n </template>\n\n <!-- Lazy Loading -->\n <div v-if=\"shouldDisplayShowMoreButton\" class=\"b-listbox__lazy-load\">\n <bento-loading-button :state=\"loadingButtonState\" variant=\"secondary\" @click.capture=\"emitShowMore\">\n {{ showMoreButtonText }}\n </bento-loading-button>\n </div>\n <div v-else-if=\"loading\" class=\"b-listbox__lazy-load\">\n <bento-loading-indicator />\n </div>\n </template>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref, toRef } from 'vue';\n import {\n BentoKeyboardNavigationKeyDownEvent,\n BentoListboxEmptyStateProps,\n BentoListboxEvent,\n BentoListboxIsOptionDisabled,\n BentoListboxLazyLoadType,\n BentoListboxOptionItem,\n BentoListboxOptions,\n BentoListboxVirtulisationOptions,\n } from '@/types';\n import { BentoKeyboardNavigationDirective } from '@/directives';\n import { BentoListboxSingleSelect } from './components/listbox-single-select';\n import { BentoListboxMultiSelect } from './components/listbox-multi-select';\n import { BentoTypography } from '@/components/typography';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import { BentoLoadingButton, BentoLoadingButtonState } from '@/components/button';\n import { BentoEmptyState } from '@/components/empty-state';\n import { useI18n } from '@/utils/ts/i18n';\n import { debounce } from '@/utils/ts/debounce';\n import { useVirtualList } from '@/composables/use-virtual-list';\n import type { HTMLAttributes } from 'vue/types/jsx.d.ts';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n const DEFAULT_DROPDOWN_ITEM_HEIGHT = 36;\n\n /**\n * Listbox container.\n * It lists all the available options.\n *\n * @example\n * <bento-listbox\n * v-slot=\"{label, value}\"\n * :id=\"listboxOptionsContainerId\"\n * :aria-label=\"ariaLabel\"\n * :disabled=\"disabled\"\n * :multiple=\"multiple\"\n * :selected=\"value\"\n * :isOptionDisabled=\"option => option.value === 2\"\n * :items=\"[{\n * { label: 'Option 1', value: 1 },\n * { label: 'Option 2', value: 2 },\n * }]\"\n * @select=\"onOptionSelected\"\n * >\n * </bento-listbox>\n */\n export default defineComponent({\n name: 'bento-listbox',\n components: {\n BentoEmptyState,\n BentoListboxSingleSelect,\n BentoListboxMultiSelect,\n BentoTypography,\n BentoLoadingIndicator,\n BentoLoadingButton,\n },\n directives: { BentoKeyboardNavigationDirective },\n i18n: { messages },\n props: {\n /**\n * Defines a string value that labels an interactive element.\n */\n ariaLabel: { type: String, default: null },\n\n /**\n * Empty state props that will be used with the inner empty state component to be displayed when no search results are found.\n */\n emptyState: {\n type: Object as PropType<BentoListboxEmptyStateProps>,\n default: undefined,\n },\n\n /**\n * Indicates whether there are more items to load\n */\n hasMoreItems: { type: Boolean, default: false },\n\n /**\n * Identifies the listbox whose contents are controlled by the the combobox on which the aria-controls attribute is set.\n */\n id: { type: String, required: true },\n\n /**\n * Function that allows the options to be disabled\n *\n * @type {BentoListboxIsOptionDisabled}\n * @param {BentoListboxOptionItem} option - Listbox option object\n * @param {string} option.label - Option's label text\n * @param {string|number} option.value - Option's value\n * @param {unknown} option.data - Option's extra data to be passed to the default slot\n */\n isOptionDisabled: {\n type: Function as PropType<BentoListboxIsOptionDisabled>,\n default: () => undefined,\n },\n\n /**\n * The option elements to populate the listbox with.\n * It must be an array of {@see BentoListboxOptionItem }\n * * @property {string} value.label - Text to be displayed in the option\n * * @property {string,number} value.value - Value of the option\n */\n items: {\n type: Array as PropType<BentoListboxOptions>,\n required: true,\n },\n\n /**\n * Indicates if new options are lazy loading.\n */\n loading: { type: Boolean, default: false },\n\n /**\n * The type of `Lazy Load`.\n * Type \"automatic\" will enable infinite scrolling\n * Type \"button\" will enable lazy loading with \"Show more\" button\n */\n lazyLoadType: {\n type: String as PropType<BentoListboxLazyLoadType | `${BentoListboxLazyLoadType}`>,\n default: BentoListboxLazyLoadType.NONE,\n validator: (value: BentoListboxLazyLoadType) => Object.values(BentoListboxLazyLoadType).includes(value),\n },\n\n /**\n * Indicates the listbox is loading filtered items.\n */\n componentLoading: { type: Boolean, default: false },\n\n /**\n * If enabled, the user will be able to select multiple items.\n */\n multiple: { type: Boolean, default: false },\n\n /**\n * If enabled, dropdown will display non-selectable, static categories\n */\n staticCategories: { type: Boolean, default: false },\n\n /**\n * Messaged displayed when no items are listed in the listbox\n */\n noResultsMessage: { type: String, required: true },\n\n /**\n * Flag that indicates that an external search it's being made\n * to filter out the items inside the the multi-select listbox\n *\n * If enabled, hides the \"Select all\" checkbox in \"multiple\" mode.\n */\n searching: BentoListboxMultiSelect.props.searching,\n\n /**\n * The `input` value.\n * Providing an empty string or empty array will select no options.\n * Set to an empty string `''` if you don't want any of the available options to be selected for single select\n */\n selectedValue: {\n type: Array as PropType<BentoListboxOptions>,\n default: () => [],\n },\n\n /**\n * Enables virtual scrolling if set to true or by providing an object with itemHeight function.\n * The itemHeight function is used to calculate the height of rendered item given it's index.\n */\n virtualScroll: {\n type: [Boolean, Object] as PropType<BentoListboxVirtulisationOptions>,\n default: false,\n },\n },\n emits: [\n BentoListboxEvent.SELECT,\n BentoListboxEvent.SPACE,\n BentoListboxEvent.SHOW_MORE,\n BentoListboxEvent.ENTER,\n BentoListboxEvent.ESCAPE,\n BentoListboxEvent.TAB,\n ],\n setup(props, { emit, slots }) {\n const listboxItemRef = ref([]);\n const items = toRef(props, 'items');\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const isLazyLoadListbox = computed(() => props.lazyLoadType !== BentoListboxLazyLoadType.AUTOMATIC);\n const hasAutomaticLazyLoader = computed(() => props.lazyLoadType === BentoListboxLazyLoadType.AUTOMATIC);\n\n // Virtual scrolling\n const virtualScrollItemHeight = () => {\n if (typeof props?.virtualScroll === 'object' && props?.virtualScroll?.itemHeight) {\n return props.virtualScroll.itemHeight;\n }\n return DEFAULT_DROPDOWN_ITEM_HEIGHT;\n };\n const {\n containerRef: listboxRef,\n containerProps,\n onScroll: onContainerScroll,\n list: virtualisedItems,\n wrapperProps,\n } = useVirtualList<BentoListboxOptionItem>(items, {\n itemHeight: virtualScrollItemHeight(),\n // Disable virtual scrolling if not enabled or if lazy loading is enabled or if multi-select\n disabled: props?.multiple || props?.virtualScroll === false || props?.lazyLoadType !== 'none',\n });\n\n // Aria a11y\n const ariaAtomic = computed<HTMLAttributes['aria-atomic']>(() =>\n props.componentLoading !== undefined || isLazyLoadListbox.value ? 'true' : undefined\n );\n const ariaBusy = computed<HTMLAttributes['aria-busy']>(() =>\n (isLazyLoadListbox.value && props.loading) || props.componentLoading ? 'true' : 'false'\n );\n const ariaLive = computed<HTMLAttributes['aria-live']>(() =>\n isLazyLoadListbox.value || props.componentLoading !== undefined ? 'polite' : undefined\n );\n\n const onOptionSelected = eventName => (selectedItem: BentoListboxOptions) => {\n emit(eventName, selectedItem);\n };\n\n const emitShowMore = () => {\n emit(BentoListboxEvent.SHOW_MORE);\n };\n\n const emitShowMoreOnScrollEnd = debounce(() => {\n const container = listboxRef.value;\n\n if (!container) {\n return;\n }\n\n const isAtBottom = Math.round(container.scrollTop) + container.clientHeight >= container.scrollHeight;\n\n if (props.hasMoreItems && isAtBottom && !props.loading) {\n emitShowMore();\n }\n });\n\n const onListboxContainerScroll = () => {\n if (hasAutomaticLazyLoader.value) {\n emitShowMoreOnScrollEnd();\n } else {\n onContainerScroll();\n }\n };\n\n const isSearchResultEmpty = computed(() => props.items?.length === 0);\n\n const shouldDisplayShowMoreButton = computed(\n () => props.lazyLoadType === BentoListboxLazyLoadType.BUTTON && props.hasMoreItems\n );\n\n const loadingButtonState = computed(() =>\n props.loading ? BentoLoadingButtonState.LOADING : BentoLoadingButtonState.START\n );\n\n const showMoreButtonText = computed(() => (props.loading ? t('loading') : t('showMore')));\n\n const limitedEmptyStateProps = computed<InstanceType<typeof BentoEmptyState>['$props']>(() => ({\n ...props.emptyState,\n variant: 'condensed',\n }));\n\n const listboxListeners = {\n [BentoListboxEvent.SELECT]: onOptionSelected(BentoListboxEvent.SELECT),\n [BentoListboxEvent.SPACE]: onOptionSelected(BentoListboxEvent.SPACE),\n [BentoListboxEvent.TAB]: onOptionSelected(BentoListboxEvent.TAB),\n [BentoListboxEvent.ENTER]: onOptionSelected(BentoListboxEvent.ENTER),\n };\n\n return {\n // Refs\n listboxRef,\n listboxItemRef,\n\n // a11y\n ariaAtomic,\n ariaBusy,\n ariaLive,\n\n // Values\n containerProps,\n isSearchResultEmpty,\n limitedEmptyStateProps,\n loadingButtonState,\n slots,\n shouldDisplayShowMoreButton,\n showMoreButtonText,\n virtualisedItems,\n wrapperProps,\n\n // Enums\n BentoKeyboardNavigationKeyDownEvent,\n BentoListboxEvent,\n\n // Methods\n onListboxContainerScroll,\n onOptionSelected,\n emitShowMore,\n listboxListeners,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./listbox.scss\" />\n","import {\n BentoListboxMultiSelectValue,\n BentoListboxOptionItem,\n BentoListboxOptions,\n BentoListboxSelectedValue,\n BentoListboxSelectedValueLabelPair,\n BentoListboxValue,\n} from '@/types';\nimport { ref, Ref, watch } from 'vue';\n\n/**\n * Extracts an item's label from the items in the list of options\n * displayed in the Listbox.\n *\n * Searches through all items and their sub-items (categories).\n *\n * @param items List of options displayed in the Listbox\n * @param value Selected value that needs to be found in the list\n * @returns Label found\n */\nconst findItem = (items: BentoListboxOptions, value: BentoListboxValue): BentoListboxOptionItem => {\n for (const item of items) {\n if (item.value === value) {\n return item;\n }\n\n if (item.items) {\n // recursively look for the value and continue to the next item if value is not found\n const label = findItem(item.items, value);\n\n if (label) {\n return label;\n }\n }\n }\n\n return null;\n};\n\n/**\n * Type guard to check if a value is of type BentoListboxSelectedValueLabelPair.\n * @param value The value to check.\n * @returns True if the value is BentoListboxSelectedValueLabelPair, false otherwise.\n */\nconst isBentoListboxSelectedValueLabelPair = (\n value: BentoListboxSelectedValue\n): value is BentoListboxSelectedValueLabelPair => {\n return typeof value === 'object' && value !== null && 'value' in value && 'label' in value;\n};\n\n/**\n * Creates two lists (one with value/label pairs and one simply with values) that are\n * used to cache the internal option selections to preserve the `label` in case the\n * value is loaded from external sources and might not be found in the list of `items`\n * later on.\n *\n * This helps with external searches and lazy loaded lists.\n *\n * @param items List of options displayed in the Listbox\n * @param selectedValues Selected list of values\n * @param multiple Indicates if the Listbox is multi-select (true) or single-select (false)\n * @param enableValueLabelPair Indicates if the Listbox should emit value/label pairs.\n * @returns Two lists of cached items. One list with label/value pairs and one with only the values stored.\n */\nexport const useCachedSelectedValues = (\n items: Ref<BentoListboxOptions>,\n selectedValues: Ref<BentoListboxSelectedValue>,\n multiple: Ref<boolean>,\n enableValueLabelPair?: Ref<boolean>\n) => {\n const cachedSelectedListboxOptions = ref<BentoListboxOptions>([]);\n const cachedListboxSelectedValues = ref<BentoListboxSelectedValue>();\n\n /**\n * Sets the cached selected values based on a simple value (string or number).\n * It handles both single and multi-select modes.\n * @param newSelectedValues The new list of selected options.\n */\n const setSimpleSelectedValues = (newSelectedValues: BentoListboxOptions) => {\n if (multiple.value) {\n cachedListboxSelectedValues.value = newSelectedValues.map(({ value }) => value);\n } else {\n cachedListboxSelectedValues.value = newSelectedValues.length > 0 ? newSelectedValues[0].value : null;\n }\n };\n\n const setValueLabelPair = (newSelectedValues: BentoListboxOptions) => {\n if (multiple.value) {\n cachedListboxSelectedValues.value = newSelectedValues.map(({ value, label }) => ({ value, label }));\n } else {\n cachedListboxSelectedValues.value =\n newSelectedValues.length > 0\n ? { value: newSelectedValues[0].value, label: newSelectedValues[0].label }\n : null;\n }\n };\n\n const setCachedValues = (newSelectedValues: BentoListboxOptions) => {\n cachedSelectedListboxOptions.value = newSelectedValues;\n if (enableValueLabelPair?.value) {\n setValueLabelPair(newSelectedValues);\n } else {\n setSimpleSelectedValues(newSelectedValues);\n }\n };\n\n const resetCache = () => {\n cachedSelectedListboxOptions.value = [];\n cachedListboxSelectedValues.value = null;\n };\n\n watch(\n [() => items.value, () => selectedValues.value],\n () => {\n if (!selectedValues.value && selectedValues.value !== 0) {\n resetCache();\n return;\n }\n\n const isSingleSelect = !Array.isArray(selectedValues.value);\n // Make a copy of cache\n const cachedCopy = [...cachedSelectedListboxOptions.value];\n // Clear cache\n resetCache();\n\n const addValue = (value: BentoListboxSelectedValue) => {\n // When it's a value/label pair, add it immediately\n // Otherwise search if the value is available in the list\n // and create a value/label pair to be added to the list\n if (isBentoListboxSelectedValueLabelPair(value)) {\n cachedSelectedListboxOptions.value.push(value);\n } else {\n // Search label by value in \"items\"\n let selectedItem = findItem(items.value, value as BentoListboxValue);\n\n // Search in previous cache\n if (!selectedItem) {\n selectedItem = findItem(cachedCopy, value as BentoListboxValue);\n }\n\n // Transform value to label if not found anywhere\n if (!selectedItem) {\n selectedItem = { value: value as BentoListboxValue, label: value.toString() };\n }\n\n cachedSelectedListboxOptions.value.push(selectedItem);\n }\n };\n\n if (isSingleSelect) {\n const value = selectedValues.value as BentoListboxValue;\n\n addValue(value);\n if (enableValueLabelPair?.value) {\n setValueLabelPair(cachedSelectedListboxOptions.value);\n } else {\n setSimpleSelectedValues(cachedSelectedListboxOptions.value);\n }\n return;\n }\n\n // Multi-select\n (selectedValues.value as BentoListboxMultiSelectValue).forEach(addValue);\n // Add each selected value in the cache\n if (enableValueLabelPair?.value) {\n setValueLabelPair(cachedSelectedListboxOptions.value);\n } else {\n setSimpleSelectedValues(cachedSelectedListboxOptions.value);\n }\n },\n { immediate: true }\n );\n\n return {\n // Values\n cachedSelectedListboxOptions,\n cachedListboxSelectedValues,\n // Methods\n resetCache,\n setCachedValues,\n };\n};\n"],"names":["useCheckboxSelectAll","selectedItemsList","items","selectAll","unselectAll","isAllSelected","computed","_a","_b","isIndeterminate","selectedValue","useVirtualList","disabled","itemHeight","overscan","prefixHeight","containerRef","ref","list","startIndex","endIndex","containerHeight","listObserver","wrapperProps","totalHeight","sum","_","index","offSetTop","i","getOffset","prefixHeightIfSet","scrollTop","offset","size","getVisibileNumberOfItems","start","capacity","updateVisibleItems","visibleCount","onScroll","onMounted","observeSizeOfElement","clientHeight","onUnmounted","watch","containerProps","BentoListboxEvent","BentoListboxEvent2","BentoListboxLazyLoadType","BentoListboxLazyLoadType2","_sfc_main$8","defineComponent","BentoTypography","_sfc_main$7","props","emit","conditionalClasses","BentoKeyboardNavigationKeyDownEvent","e","eventName","uuid","_sfc_main$6","_sfc_main$5","BentoListboxOption","CheckmarkIcon","onOptionSelected","ariaDisabled","ariaSelected","tabIndex","useListboxKeyboardNavigation","hasStaticCategories","focusItem","flattenItems","item","numberOfItems","focusedIndex","mutateFocusedIndex","direction","calculateFocusedIndex","edgeCaseItem","moveToNextElement","event","preventDefault","moveToPreviousElement","moveToFirstElement","moveToLastElement","setListboxFocusedIndex","_sfc_main$4","BentoListboxSingleSelectCategory","BentoListboxSingleSelectOption","BentoKeyboardNavigationDirective","expose","slots","listboxRef","listboxItemRef","selectedItem","hasCategories","selectedOption","nextFocusedItemIndex","toRef","listboxListeners","listboxOptionListeners","ListboxMultiSelectCategoryClass","ListboxMultiSelectCategoryClass2","ListboxMultiSelectCategoryEvent","ListboxMultiSelectCategoryEvent2","_sfc_main$3","messages$2","BentoCheckbox","ChevronDownIcon","ChevronUpIcon","isOpen","t","useI18n","vue2Vue3FixedisOptionDisabled","option","hasAllPropsDisabled","isStaticCategory","showItemChildren","conditionalClass","toggleOpen","optionStates","isDisabled","isPreSelected","enabledItems","visibleSelectedList","value","chevronTitle","messageName","categoryLabelProps","toggleSelectAll","isSelectAllOn","handleSelectAll","ListboxMultiSelectOptionsEvent","ListboxMultiSelectOptionsEvent2","_sfc_main$2","ListboxMultiSelectCategory","toggleCheckboxSelection","isCategory","shouldShowDescription","isSearchingMultiLevel","isOptionSelected","toggleSearchOption","useMultiLevelItems","itemsList","isMultiLevelSelect","flattenedItemsList","acc","val","__default__","messages$1","useSlots","selectAllListboxItemsRef","selectedListboxItemsRef","listboxItemsRef","fullItemsList","categoryOption","calculateTotalItems","selectAllCheckboxText","possibleSelections","total","amountSelectedValues","selectableItems","filterOutDisabledAndNotPreselectedOptions","addOrRemoveList","findEnabledUnselectedItems","unselectedItemsList","newSelectedList","selectAllItems","unselectAllItems","selectAllCategory","category","unselectAllCategory","exists","selectedOptions","categoryOptionsSelected","categoryOptions","showSelectedItems","isLazyLoad","hasAllItemsSelected","_c","_d","showSelectAllCheckbox","computedselectAllItemRefs","computedItems","chipsSectionListeners","DEFAULT_DROPDOWN_ITEM_HEIGHT","_sfc_main","BentoEmptyState","BentoListboxSingleSelect","BentoListboxMultiSelect","BentoLoadingIndicator","BentoLoadingButton","messages","isLazyLoadListbox","hasAutomaticLazyLoader","virtualScrollItemHeight","onContainerScroll","virtualisedItems","ariaAtomic","ariaBusy","ariaLive","emitShowMore","emitShowMoreOnScrollEnd","debounce","container","isAtBottom","onListboxContainerScroll","isSearchResultEmpty","shouldDisplayShowMoreButton","loadingButtonState","BentoLoadingButtonState","showMoreButtonText","limitedEmptyStateProps","findItem","label","isBentoListboxSelectedValueLabelPair","useCachedSelectedValues","selectedValues","multiple","enableValueLabelPair","cachedSelectedListboxOptions","cachedListboxSelectedValues","setSimpleSelectedValues","newSelectedValues","setValueLabelPair","setCachedValues","resetCache","isSingleSelect","cachedCopy","addValue"],"mappings":";;;;;;;;;;;;;;;;AA8CO,MAAAA,KAAA,CAAAC,GAAAC,GAAAC,GAAAC,MAAA;AAMH,QAAAC,IAAAC;AAAA,IAAsB,MAAA;;AAAA,cAAA,GAAAC,IAAAN,EAAA,UAAA,QAAAM,EAAA,aAAAC,IAAAP,EAAA,UAAA,gBAAAO,EAAA,YAAAN,EAAA,MAAA;AAAA;AAAA,EACyE,GAE/FO,IAAAH,EAAA,MAAA;;AAEI,WAAAL,EAAA,SAAA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