@adyen/bento-vue2 1.26.0 → 1.27.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 (203) hide show
  1. package/dist/@types/components.d.ts +4 -0
  2. package/dist/@types/index.d.ts +513 -136
  3. package/dist/accordion.js +2 -2
  4. package/dist/action-bar.js +61 -146
  5. package/dist/action-bar.js.map +1 -1
  6. package/dist/alert.js +3 -3
  7. package/dist/assets/base-modal.css +1 -1
  8. package/dist/assets/button-actions.css +1 -1
  9. package/dist/assets/button.css +1 -1
  10. package/dist/assets/dialog-page.css +1 -1
  11. package/dist/assets/dropdown.css +1 -1
  12. package/dist/assets/index.css +1 -1
  13. package/dist/assets/index10.css +1 -1
  14. package/dist/assets/index11.css +1 -1
  15. package/dist/assets/index12.css +1 -1
  16. package/dist/assets/index13.css +1 -1
  17. package/dist/assets/index14.css +1 -1
  18. package/dist/assets/index15.css +1 -1
  19. package/dist/assets/index16.css +1 -1
  20. package/dist/assets/index17.css +1 -1
  21. package/dist/assets/index18.css +1 -1
  22. package/dist/assets/index19.css +1 -1
  23. package/dist/assets/index2.css +1 -1
  24. package/dist/assets/index20.css +1 -1
  25. package/dist/assets/index21.css +1 -1
  26. package/dist/assets/index22.css +1 -1
  27. package/dist/assets/index23.css +1 -1
  28. package/dist/assets/index24.css +1 -1
  29. package/dist/assets/index25.css +1 -1
  30. package/dist/assets/index26.css +1 -1
  31. package/dist/assets/index27.css +1 -1
  32. package/dist/assets/index28.css +1 -1
  33. package/dist/assets/index29.css +1 -1
  34. package/dist/assets/index3.css +1 -1
  35. package/dist/assets/index30.css +1 -1
  36. package/dist/assets/index31.css +1 -1
  37. package/dist/assets/index32.css +1 -1
  38. package/dist/assets/index33.css +1 -1
  39. package/dist/assets/index34.css +1 -1
  40. package/dist/assets/index35.css +1 -1
  41. package/dist/assets/index36.css +1 -1
  42. package/dist/assets/index37.css +1 -1
  43. package/dist/assets/index38.css +1 -1
  44. package/dist/assets/index39.css +1 -1
  45. package/dist/assets/index4.css +1 -1
  46. package/dist/assets/index40.css +1 -1
  47. package/dist/assets/index41.css +1 -1
  48. package/dist/assets/index42.css +1 -1
  49. package/dist/assets/index43.css +1 -1
  50. package/dist/assets/index44.css +1 -1
  51. package/dist/assets/index45.css +1 -1
  52. package/dist/assets/index46.css +1 -1
  53. package/dist/assets/index47.css +1 -1
  54. package/dist/assets/index48.css +1 -1
  55. package/dist/assets/index49.css +1 -0
  56. package/dist/assets/index5.css +1 -1
  57. package/dist/assets/index6.css +1 -1
  58. package/dist/assets/index7.css +1 -1
  59. package/dist/assets/index8.css +1 -1
  60. package/dist/assets/index9.css +1 -1
  61. package/dist/assets/use-cached-selected-values.css +1 -1
  62. package/dist/avatar-image.js +1 -1
  63. package/dist/badge.js +1 -1
  64. package/dist/button.js +5 -5
  65. package/dist/card.js +3 -3
  66. package/dist/checkbox.js +5 -5
  67. package/dist/chunks/{base-button.ad74b6f8.js → base-button.852204dc.js} +2 -2
  68. package/dist/chunks/{base-button.ad74b6f8.js.map → base-button.852204dc.js.map} +1 -1
  69. package/dist/chunks/{base-modal.1fff7abe.js → base-modal.4fb7528b.js} +6 -6
  70. package/dist/chunks/{base-modal.1fff7abe.js.map → base-modal.4fb7528b.js.map} +1 -1
  71. package/dist/chunks/{button-actions-with-menu.e845d77a.js → button-actions-with-menu.bf968959.js} +4 -4
  72. package/dist/chunks/{button-actions-with-menu.e845d77a.js.map → button-actions-with-menu.bf968959.js.map} +1 -1
  73. package/dist/chunks/{button-actions.81db18e8.js → button-actions.87e589e3.js} +31 -29
  74. package/dist/chunks/button-actions.87e589e3.js.map +1 -0
  75. package/dist/chunks/button.cb90b55c.js +101 -0
  76. package/dist/chunks/button.cb90b55c.js.map +1 -0
  77. package/dist/chunks/{calendar.640b8d25.js → calendar.f02e0a5a.js} +5 -5
  78. package/dist/chunks/{calendar.640b8d25.js.map → calendar.f02e0a5a.js.map} +1 -1
  79. package/dist/chunks/{checkbox.bfed007c.js → checkbox.9f9c978a.js} +3 -3
  80. package/dist/chunks/{checkbox.bfed007c.js.map → checkbox.9f9c978a.js.map} +1 -1
  81. package/dist/chunks/{controls-group.4fb50009.js → controls-group.121a307d.js} +3 -3
  82. package/dist/chunks/{controls-group.4fb50009.js.map → controls-group.121a307d.js.map} +1 -1
  83. package/dist/chunks/{copy.f85700c6.js → copy.6808b2dc.js} +4 -4
  84. package/dist/chunks/{copy.f85700c6.js.map → copy.6808b2dc.js.map} +1 -1
  85. package/dist/chunks/{dialog-page.73da22cf.js → dialog-page.7fd7d006.js} +3 -3
  86. package/dist/chunks/{dialog-page.73da22cf.js.map → dialog-page.7fd7d006.js.map} +1 -1
  87. package/dist/chunks/{dropdown-default-textbox.54ca1b18.js → dropdown-default-textbox.d0f17d96.js} +3 -3
  88. package/dist/chunks/{dropdown-default-textbox.54ca1b18.js.map → dropdown-default-textbox.d0f17d96.js.map} +1 -1
  89. package/dist/chunks/{dropdown.10c034aa.js → dropdown.a8037bca.js} +188 -197
  90. package/dist/chunks/dropdown.a8037bca.js.map +1 -0
  91. package/dist/chunks/{error-message.31ec12b7.js → error-message.bdcc1020.js} +2 -2
  92. package/dist/chunks/{error-message.31ec12b7.js.map → error-message.bdcc1020.js.map} +1 -1
  93. package/dist/chunks/{events.58c00e6d.js → events.f14a214b.js} +5 -5
  94. package/dist/chunks/events.f14a214b.js.map +1 -0
  95. package/dist/chunks/{fixed-scroller.4eb9a9ac.js → fixed-scroller.82ef6187.js} +2 -2
  96. package/dist/chunks/{fixed-scroller.4eb9a9ac.js.map → fixed-scroller.82ef6187.js.map} +1 -1
  97. package/dist/chunks/{footer-actions.a1e09b4f.js → footer-actions.58d14a16.js} +4 -4
  98. package/dist/chunks/{footer-actions.a1e09b4f.js.map → footer-actions.58d14a16.js.map} +1 -1
  99. package/dist/chunks/{index.15b088b9.js → index.0a30d358.js} +6 -6
  100. package/dist/chunks/{index.15b088b9.js.map → index.0a30d358.js.map} +1 -1
  101. package/dist/chunks/{index.d553d3d1.js → index.1deef79e.js} +2 -2
  102. package/dist/chunks/{index.d553d3d1.js.map → index.1deef79e.js.map} +1 -1
  103. package/dist/chunks/index.3c69be27.js +85 -0
  104. package/dist/chunks/index.3c69be27.js.map +1 -0
  105. package/dist/chunks/index.561786f6.js +126 -0
  106. package/dist/chunks/index.561786f6.js.map +1 -0
  107. package/dist/chunks/{index.b21197ca.js → index.614a5138.js} +2 -2
  108. package/dist/chunks/{index.b21197ca.js.map → index.614a5138.js.map} +1 -1
  109. package/dist/chunks/{index.8b8c3b16.js → index.854d6498.js} +9 -9
  110. package/dist/chunks/{index.8b8c3b16.js.map → index.854d6498.js.map} +1 -1
  111. package/dist/chunks/{index.885d05a9.js → index.939dd5cf.js} +2 -2
  112. package/dist/chunks/{index.885d05a9.js.map → index.939dd5cf.js.map} +1 -1
  113. package/dist/chunks/{index.1ea85d4a.js → index.a48e7f99.js} +6 -6
  114. package/dist/chunks/{index.1ea85d4a.js.map → index.a48e7f99.js.map} +1 -1
  115. package/dist/chunks/{index.317fca12.js → index.bd1d28d0.js} +3 -3
  116. package/dist/chunks/{index.317fca12.js.map → index.bd1d28d0.js.map} +1 -1
  117. package/dist/chunks/{index.671768a1.js → index.c8621e8e.js} +3 -3
  118. package/dist/chunks/{index.671768a1.js.map → index.c8621e8e.js.map} +1 -1
  119. package/dist/chunks/{index.7eefc59c.js → index.ccc7e8d7.js} +3 -3
  120. package/dist/chunks/{index.7eefc59c.js.map → index.ccc7e8d7.js.map} +1 -1
  121. package/dist/chunks/{index.dd30e538.js → index.e29a6907.js} +2 -2
  122. package/dist/chunks/{index.dd30e538.js.map → index.e29a6907.js.map} +1 -1
  123. package/dist/chunks/{keyboard-navigation.ca47dfa8.js → keyboard-navigation.bbc3d15c.js} +2 -2
  124. package/dist/chunks/{keyboard-navigation.ca47dfa8.js.map → keyboard-navigation.bbc3d15c.js.map} +1 -1
  125. package/dist/chunks/{listbox-option-tag.6bbb6bbe.js → listbox-option-tag.8708be60.js} +3 -3
  126. package/dist/chunks/{listbox-option-tag.6bbb6bbe.js.map → listbox-option-tag.8708be60.js.map} +1 -1
  127. package/dist/chunks/{loading-button.eafc9e1b.js → loading-button.692dbdc8.js} +2 -2
  128. package/dist/chunks/{loading-button.eafc9e1b.js.map → loading-button.692dbdc8.js.map} +1 -1
  129. package/dist/chunks/{payment-method.6c1ce07c.js → payment-method.c55dd352.js} +2 -2
  130. package/dist/chunks/{payment-method.6c1ce07c.js.map → payment-method.c55dd352.js.map} +1 -1
  131. package/dist/chunks/{tooltip.58ef3f4a.js → tooltip.efddb5f3.js} +4 -4
  132. package/dist/chunks/{tooltip.58ef3f4a.js.map → tooltip.efddb5f3.js.map} +1 -1
  133. package/dist/chunks/{use-bento-toast-controller.c3277f73.js → use-bento-toast-controller.5dac1f3c.js} +2 -2
  134. package/dist/chunks/{use-bento-toast-controller.c3277f73.js.map → use-bento-toast-controller.5dac1f3c.js.map} +1 -1
  135. package/dist/chunks/{use-cached-selected-values.69297473.js → use-cached-selected-values.98a9ed01.js} +225 -206
  136. package/dist/chunks/use-cached-selected-values.98a9ed01.js.map +1 -0
  137. package/dist/code-snippet.js +131 -129
  138. package/dist/code-snippet.js.map +1 -1
  139. package/dist/country.js +2 -2
  140. package/dist/currency.js +1 -1
  141. package/dist/dashboard-template.js +109 -0
  142. package/dist/dashboard-template.js.map +1 -0
  143. package/dist/data-grid-template.js +1 -1
  144. package/dist/data-grid.js +78 -70
  145. package/dist/data-grid.js.map +1 -1
  146. package/dist/date-picker.js +8 -8
  147. package/dist/date-range-picker.js +2 -2
  148. package/dist/date.js +1 -1
  149. package/dist/divider.js +1 -1
  150. package/dist/dropdown.js +7 -7
  151. package/dist/empty-state.js +3 -3
  152. package/dist/filter-bar.js +77 -75
  153. package/dist/filter-bar.js.map +1 -1
  154. package/dist/focus-trap.js +1 -1
  155. package/dist/form-layout.js +2 -2
  156. package/dist/header.js +4 -4
  157. package/dist/index.js +82 -79
  158. package/dist/index.js.map +1 -1
  159. package/dist/info-icon.js +3 -3
  160. package/dist/input-field.js +4 -4
  161. package/dist/internal.js +8 -8
  162. package/dist/link.js +1 -1
  163. package/dist/loading-indicator.js +1 -1
  164. package/dist/menu.js +1 -1
  165. package/dist/modal-fullscreen.js +6 -6
  166. package/dist/modal.js +6 -6
  167. package/dist/pagination.js +4 -4
  168. package/dist/payment-method.js +1 -1
  169. package/dist/popover.js +1 -1
  170. package/dist/popper-container.js +1 -1
  171. package/dist/radio-group.js +4 -4
  172. package/dist/search-bar.js +2 -2
  173. package/dist/secondary-nav.js +2 -2
  174. package/dist/segmented-control.js +40 -41
  175. package/dist/segmented-control.js.map +1 -1
  176. package/dist/selection-card.js +4 -4
  177. package/dist/sidepanel.js +6 -6
  178. package/dist/status.js +2 -2
  179. package/dist/stepper.js +4 -4
  180. package/dist/structured-list.js +1 -1
  181. package/dist/summary-grid.js +3 -3
  182. package/dist/tabs.js +68 -67
  183. package/dist/tabs.js.map +1 -1
  184. package/dist/tag.js +3 -3
  185. package/dist/textarea.js +4 -4
  186. package/dist/timeline.js +7 -7
  187. package/dist/toast.js +4 -4
  188. package/dist/toggle.js +2 -2
  189. package/dist/tutorial.js +68 -53
  190. package/dist/tutorial.js.map +1 -1
  191. package/dist/typography.js +1 -1
  192. package/dist/web-types.json +133 -70
  193. package/package.json +9 -6
  194. package/dist/chunks/button-actions.81db18e8.js.map +0 -1
  195. package/dist/chunks/button.9d6435ae.js +0 -100
  196. package/dist/chunks/button.9d6435ae.js.map +0 -1
  197. package/dist/chunks/checkmark.a6ed8f47.js +0 -26
  198. package/dist/chunks/checkmark.a6ed8f47.js.map +0 -1
  199. package/dist/chunks/dropdown.10c034aa.js.map +0 -1
  200. package/dist/chunks/events.58c00e6d.js.map +0 -1
  201. package/dist/chunks/index.aaf965f8.js +0 -147
  202. package/dist/chunks/index.aaf965f8.js.map +0 -1
  203. package/dist/chunks/use-cached-selected-values.69297473.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"dropdown.10c034aa.js","sources":["../../src/components/dropdown/dropdown.types.ts","../../src/components/dropdown/components/dropdown-options-container/composables/use-dropdown-options-listbox.ts","../../src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue","../../../../node_modules/@adyen/ui-assets-icons-16/dist/vue/chevron-down-small.vue","../../../../node_modules/@adyen/ui-assets-icons-16/dist/vue/chevron-up-small.vue","../../src/components/dropdown/components/dropdown-small-textbox/dropdown-small-textbox.vue","../../src/components/dropdown/composables/use-display-value.ts","../../src/components/dropdown/composables/use-keyboard-navigation.ts","../../src/components/search-bar/useSearchBarDataFilter.ts","../../src/components/input-field/input-field.keys.ts","../../src/components/dropdown/dropdown.vue"],"sourcesContent":["/**\n * @deprecated Do not use. Only 'default' size should be used.\n */\nexport enum BentoDropdownSize {\n DEFAULT = 'DropdownInputDefault',\n SMALL = 'DropdownInputSmall',\n}\n\nexport {\n /**\n * @deprecated since version 2.0. Use the string literal instead.\n */\n BentoListboxLazyLoadType as BentoDropdownLazyLoadType,\n BentoListboxEvent as BentoDropdownEvent,\n} from '@/types';\n\nexport type { BentoListboxSearchOptions as BentoDropdownSearchOptions } from '@/types';\nexport type { BentoListboxEmptyStateProps as BentoDropdownEmptyStateProps } from '@/types';\nexport type { BentoListboxVirtulisationOptions as BentoDropdownVirtulisationOptions } from '@/types';\n","import { computed, ref, Ref, watch } from 'vue';\nimport { BentoListboxEvent, BentoListboxOptions } from '@/types';\nimport { BentoDropdownEvent } from '../../../dropdown.types';\nimport { useI18n } from '@/utils/ts/i18n';\nimport messages from '../messages.json';\n\ntype MessageSchema = (typeof messages)['en-US'];\n\n/**\n * A composable that handles all dropdown options option selecting logic & listeners.\n * If single select dropdown then emits straight up to dropdown.\n * If multi select dropdown then stores selections in internal state and only emits when Apply button is pressed.\n *\n * @param selectedValue The selectedValue property passed into the dropdown options container component.\n * @param multiple The multiple property passed into the dropdown options container component.\n * @param isOpen The isOpen property passed into the dropdown options container component.\n * @param emit The emit function for the dropdown options container component.\n */\nexport const useDropdownOptionsListbox = (\n selectedValue: Ref<BentoListboxOptions>,\n multiple: Ref<boolean>,\n isOpen: Ref<boolean>,\n emit: (event: BentoListboxEvent | BentoDropdownEvent, selectedValue?: BentoListboxOptions) => void\n) => {\n const internalSelectedValue = ref(selectedValue.value);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n watch(selectedValue, () => {\n internalSelectedValue.value = selectedValue.value;\n });\n\n // Multi-select dropdown cancel and apply button logic\n const isApplyButtonDisabled = computed(\n () => JSON.stringify(internalSelectedValue.value) === JSON.stringify(selectedValue.value)\n );\n\n const onApplyClick = () => {\n emit(BentoListboxEvent.SELECT, internalSelectedValue.value);\n emit(BentoDropdownEvent.CLOSE_DROPDOWN);\n };\n\n const onCancelClick = () => {\n internalSelectedValue.value = selectedValue.value;\n emit(BentoDropdownEvent.CLOSE_DROPDOWN);\n };\n\n const onOutsideDropdownClick = () => {\n if (isOpen.value && multiple.value) {\n internalSelectedValue.value = selectedValue.value;\n }\n };\n\n const actions = computed(() => [\n {\n title: t('apply') as string,\n event: onApplyClick,\n disabled: isApplyButtonDisabled.value,\n },\n {\n title: t('cancel') as string,\n event: onCancelClick,\n },\n ]);\n\n // Click and keyboard navigation event listners\n const onOptionSelected = (newSelectedValue: BentoListboxOptions) => {\n internalSelectedValue.value = newSelectedValue;\n if (!multiple.value) {\n emit(BentoDropdownEvent.SELECT, newSelectedValue);\n }\n };\n\n const onTabKey = (newSelectedValue: BentoListboxOptions) => {\n onOptionSelected(newSelectedValue);\n emit(BentoDropdownEvent.TAB);\n };\n\n const onEnterKey = (newSelectedValue: BentoListboxOptions) => {\n onOptionSelected(newSelectedValue);\n emit(BentoDropdownEvent.ENTER);\n };\n\n const onSpaceKey = (newSelectedValue: BentoListboxOptions) => {\n onOptionSelected(newSelectedValue);\n emit(BentoDropdownEvent.SPACE);\n };\n\n const onEscapeKey = () => {\n onCancelClick();\n emit(BentoListboxEvent.ESCAPE);\n };\n\n const emitShowMoreEvent = () => {\n emit(BentoDropdownEvent.SHOW_MORE);\n };\n\n const listeners = {\n [BentoListboxEvent.SELECT]: onOptionSelected,\n [BentoListboxEvent.SHOW_MORE]: emitShowMoreEvent,\n [BentoListboxEvent.TAB]: onTabKey,\n [BentoListboxEvent.SPACE]: onSpaceKey,\n [BentoListboxEvent.ENTER]: onEnterKey,\n };\n\n return {\n // Values\n actions,\n internalSelectedValue,\n\n // Methods\n listeners,\n onEscapeKey,\n onOutsideDropdownClick,\n };\n};\n","<template>\n <component\n :is=\"popperContainerOrPopoverComponent\"\n class=\"b-dropdown-options-container\"\n :class=\"conditionalClasses\"\n v-bind=\"popperContainerOrPopoverProps\"\n >\n <div @keydown.esc=\"onEscapeKey\">\n <bento-listbox\n :id=\"id\"\n ref=\"dropdownOptionsListboxRef\"\n :aria-label=\"ariaLabel\"\n class=\"b-dropdown-options-container__listbox\"\n :class=\"conditionalListboxClasses\"\n :empty-state=\"emptyState\"\n :is-option-disabled=\"isOptionDisabled\"\n :items=\"items\"\n :selected-value=\"internalSelectedValue\"\n :multiple=\"multiple\"\n :static-categories=\"staticCategories\"\n :no-results-message=\"noResultsMessage\"\n :searching=\"searching\"\n :loading=\"loading\"\n :lazy-load-type=\"lazyLoadType\"\n :has-more-items=\"hasMoreItems\"\n :virtual-scroll=\"virtualScroll\"\n v-on=\"listeners\"\n >\n <template v-for=\"(_, innerSlot) of slots\" #[innerSlot]=\"scope\">\n <slot :name=\"innerSlot\" v-bind=\"scope\" />\n </template>\n </bento-listbox>\n </div>\n </component>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, PropType, ref, toRefs, useSlots } from 'vue';\n import { BentoListbox } from '@/internal';\n import { BentoListboxEvent, BentoListboxIsOptionDisabled, BentoListboxOptions } from '@/types';\n import { PopperContainer } from '@/components/popper-container';\n import {\n BentoDropdownEmptyStateProps,\n BentoDropdownEvent,\n BentoDropdownLazyLoadType,\n BentoDropdownSize,\n BentoDropdownVirtulisationOptions,\n } from '../../dropdown.types';\n import { useI18n } from '@/utils/ts/i18n';\n import { BentoPopover } from '@/components/popover';\n import { useDropdownOptionsListbox } from './composables/use-dropdown-options-listbox';\n import { generateUid } from '@/utils/ts/unique-id';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const slots = useSlots();\n\n const emit = defineEmits<{\n /**\n * Emitted when the dropdown is closing.\n */\n (e: BentoDropdownEvent.CLOSE_DROPDOWN);\n\n /**\n * Emitted when the `ENTER` key is pressed\n */\n (e: BentoListboxEvent.ENTER, newSelectedValue: BentoListboxOptions);\n\n /**\n * Emitted when the `ESCAPE` key is pressed\n */\n (e: BentoListboxEvent.ESCAPE);\n\n /**\n * Emitted when an item is selected\n */\n (e: BentoListboxEvent.SELECT, newSelectedValue: BentoListboxOptions);\n\n /**\n * Emitted when:\n * - `lazyLoad` is `automatic` and the scroll meets the end of the list\n * - `lazyload` is `button` and the button is clicked\n */\n (e: BentoDropdownEvent.SHOW_MORE);\n\n /**\n * Emitted when the `SPACE` key is pressed\n */\n (e: BentoListboxEvent.SPACE, newSelectedValue: BentoListboxOptions);\n\n /**\n * Emitted when the `TAB` key is pressed\n */\n (e: BentoListboxEvent.TAB, newSelectedValue: BentoListboxOptions);\n }>();\n\n const props = defineProps({\n /**\n * Defines a string value that labels an interactive element.\n */\n ariaLabel: { type: String, default: null },\n\n /**\n * Empty state props used with the inner empty state component which is displayed when no search results are found.\n */\n emptyState: {\n type: Object as PropType<BentoDropdownEmptyStateProps>,\n default: undefined,\n },\n\n /**\n * Disables dropdown functionality\n */\n disabled: { type: Boolean, default: false },\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 * Dropdown input size\n */\n inputSize: {\n type: String as PropType<BentoDropdownSize | `${BentoDropdownSize}`>,\n default: BentoDropdownSize.DEFAULT,\n validator: (value: BentoDropdownSize) => Object.values(BentoDropdownSize).includes(value),\n },\n\n /**\n * Function that allows the options to be disabled\n *\n * @type {BentoDropdownIsOptionDisabled}\n * @param {BentoDropdownOptionItem} option - Dropdown 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 dropdown with.\n * It must be an array of {@see BentoDropdownOptionItem }\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 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<BentoDropdownLazyLoadType | `${BentoDropdownLazyLoadType}`>,\n default: BentoDropdownLazyLoadType.AUTOMATIC,\n validator: (value: BentoDropdownLazyLoadType) => Object.values(BentoDropdownLazyLoadType).includes(value),\n },\n\n /**\n * Indicates if new options are loading.\n */\n loading: { 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 * Indicates if the dropdown is open so that\n * the container can be displayed.\n */\n open: { type: Boolean, required: true },\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: null,\n },\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: BentoListbox.props.searching,\n\n /**\n * If enabled, dropdown will display non-selectable, static categories\n */\n staticCategories: { type: Boolean, default: false },\n\n /**\n * Reference to the DOM element or Vue component for positioning\n * the Dropdown container.\n */\n targetElement: { type: PopperContainer.props.targetElement.type, required: true },\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<BentoDropdownVirtulisationOptions>,\n default: false,\n },\n });\n\n const { selectedValue, multiple } = toRefs(props);\n const dropdownOptionsListboxRef = ref(null);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const isDropdownOpen = computed(() => props.open && !props.disabled);\n const noResultsMessage = computed(() => t('noOptionsMatchThisSearch') as string);\n\n const conditionalClasses = computed(() => ({\n 'b-dropdown-options-container--single': !props?.multiple,\n }));\n\n const conditionalListboxClasses = computed(() => ({\n 'b-dropdown-options-container__listbox--small': props.inputSize === BentoDropdownSize.SMALL,\n 'b-dropdown-options-container__listbox--single': !props?.multiple,\n }));\n\n const { actions, internalSelectedValue, listeners, onEscapeKey, onOutsideDropdownClick } =\n useDropdownOptionsListbox(selectedValue, multiple, isDropdownOpen, emit);\n\n // Use different components depending on if the dropdown is a single or multi-select\n const popperContainerOrPopoverComponent = computed(() => (props?.multiple ? BentoPopover : PopperContainer));\n\n const popperContainerOrPopoverProps = computed(() => {\n const containerMinAndMaxWidth = {\n 'min-width': `${(props?.targetElement as HTMLElement)?.clientWidth}px`,\n 'max-width': 'min(500px, 95%)',\n };\n\n return props?.multiple\n ? ({\n actionsLayout: 'space-between',\n actions: actions.value,\n divider: true,\n fallbackPosition: ['top-start'],\n id: generateUid(`dropdown-options-${props.id}`),\n open: props.open,\n position: 'bottom-start',\n style: {\n width: 'auto',\n ...containerMinAndMaxWidth,\n },\n targetElement: props.targetElement,\n } as InstanceType<typeof BentoPopover>['$props'])\n : ({\n fallbackPosition: ['top-start'],\n offset: [0, 8],\n position: 'bottom-start',\n style: {\n display: isDropdownOpen.value ? 'block' : 'none',\n ...containerMinAndMaxWidth,\n },\n targetElement: props.targetElement,\n } as InstanceType<typeof PopperContainer>['$props']);\n });\n\n defineExpose({\n onOutsideDropdownClick,\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Dropdown options container.\n * It lists all the available options.\n *\n * @example\n * <bento-dropdown-options-container\n * v-if=\"inputContainerRef\" <!-- Ref to the input to match the width -->\n * :id=\"dropdownOptionsContainerId\"\n * :target-element=\"inputContainerRef\"\n * :aria-label=\"ariaLabel\"\n * :open=\"isDropdownOpen\"\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 */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-dropdown-options-container',\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./dropdown-options-container.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=\"#00112C\" d=\"M5.00011 5.43922L8.00011 8.43922L11.0001 5.43922L12.0608 6.49988L8.00011 10.5605L3.93945 6.49988L5.00011 5.43922Z\"/></svg>\n</template>\n<script>\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n<style>\n @import '../css/main.css';\n</style>\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=\"#00112C\" d=\"M10.9999 10.5608L7.9999 7.56077L4.9999 10.5608L3.93924 9.50011L7.9999 5.43945L12.0606 9.50011L10.9999 10.5608Z\"/></svg>\n</template>\n<script>\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n<style>\n @import '../css/main.css';\n</style>\n","<template>\n <div class=\"b-dropdown-small-textbox\" :class=\"conditionalClasses\">\n <dropdown-base-textbox\n v-bind=\"{ ...$attrs, ...$props }\"\n class=\"b-dropdown-small-textbox__textbox\"\n v-on=\"listeners\"\n >\n <template #icon>\n <div class=\"b-dropdown-small-textbox__chevron\">\n <chevron-up-small-icon v-show=\"isDropdownOpen\" svg-title=\"opened\" />\n <chevron-down-small-icon v-show=\"!isDropdownOpen\" svg-title=\"closed\" />\n </div>\n </template>\n </dropdown-base-textbox>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import {\n DropdownBaseTextboxEvent,\n DropdownBaseTextboxState,\n } from '@/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.types';\n import { Booleanish } from '@/types';\n import DropdownBaseTextbox from '@/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue';\n import ChevronDownSmallIcon from '@adyen/ui-assets-icons-16/vue/chevron-down-small';\n import ChevronUpSmallIcon from '@adyen/ui-assets-icons-16/vue/chevron-up-small';\n\n const emit = defineEmits<{\n /**\n * Emitted on click, space, enter and esc user events. It will close the dropdown.\n */\n (e: 'open');\n\n /**\n * Emitted on click, space and enter user events. It will open the dropdown.\n */\n (e: 'close');\n }>();\n\n const props = defineProps({\n /**\n * The number of additional items that have been selected in the dropdown.\n */\n additionalItemsSelected: { type: [Number, String] as PropType<number | string>, default: 0 },\n\n /**\n * Sets the aria-controls attribute on the textbox. This should correspond to the popover's id that the textbox triggers.\n */\n ariaControls: { type: String, required: true },\n\n /**\n * Indicates whether the content the textbox triggers is visible or not. Needs to be set accordingly when the textbox is used and changed every time the popover is shown/hidden.\n */\n ariaExpanded: {\n type: [String, Boolean] as PropType<Booleanish>,\n required: true,\n },\n\n /**\n * If no label element is used then the aria-label is be set should be set.\n */\n ariaLabel: { type: String, default: null },\n\n /**\n * Corresponds to the label's id that labels the textbox element.\n */\n ariaLabelledby: { type: String, default: null },\n\n /**\n * Custom debounce time. Default: 300\n */\n debounceTime: { type: Number, default: 300 },\n\n /**\n * Disables any textbox functionality\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Selected option's label\n */\n displayValue: { type: String, default: null },\n\n /**\n * Sets the possibility to type into the textbox\n */\n dynamicFiltering: { type: Boolean, default: false },\n\n /**\n * Marks the textbox as invalid, rendering an error state\n */\n isInvalid: { type: Boolean, default: false },\n\n /**\n * Indicates if the dropdown is open so that\n * the respective event can be emitted\n */\n open: { type: Boolean, default: false },\n\n /**\n * Sets the dropdown to readonly state\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * The input value\n */\n value: { type: String, default: '' },\n });\n\n const conditionalClasses = computed(() => ({\n [`b-dropdown-small-textbox--${DropdownBaseTextboxState.DISABLED}`]: props.disabled,\n [`b-dropdown-small-textbox--${DropdownBaseTextboxState.READONLY}`]: props.readonly,\n [`b-dropdown-small-textbox--${DropdownBaseTextboxState.OPENED}`]: props.open,\n }));\n\n const isDropdownOpen = computed(() => props.open && !props.disabled && !props.readonly);\n\n const openDropdown = () => {\n emit('open');\n };\n\n const closeDropdown = () => {\n emit('close');\n };\n\n const listeners = {\n [DropdownBaseTextboxEvent.OPEN]: openDropdown,\n [DropdownBaseTextboxEvent.CLOSE]: closeDropdown,\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * For internal use only, textbox component in its small variant used in the dropdown component.\n */\n export default defineComponent({\n name: 'dropdown-small-textbox',\n inheritAttrs: false,\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./dropdown-small-textbox.scss\" />\n","import { computed, Ref } from 'vue';\nimport { UseDisplayValueOptions } from './use-display-value.types';\nimport { BentoListboxOptions } from '@/types';\n\n/**\n * Generates the `displayValue` for the Category Multi Select based on\n * the selection, the placeholder or it can be empty if there's nothing to show.\n *\n * @param options Multi select options\n * @returns The text to be displayed by the dropdown\n */\nconst categoryMultiSelect = (selectedValues: Ref<BentoListboxOptions>, items: Ref<BentoListboxOptions>) =>\n items.value\n .reduce((acc, option) => {\n // Category items\n if (option.items) {\n const selectedCategoryOptions = option.items.filter(categoryOption =>\n selectedValues.value.find(selectedOption => selectedOption.value === categoryOption.value)\n );\n\n // If the category is fully selected add the category name\n const isCategoryFullySelected = selectedCategoryOptions.length === option.items.length;\n if (isCategoryFullySelected) {\n acc.push(option.label);\n } else {\n // If category is partially selected add each selected option and category\n selectedCategoryOptions.forEach(({ label }) => acc.push(label));\n }\n }\n\n // Non-category option\n if (selectedValues.value.find(selectedOption => selectedOption.value === option.value)) {\n acc.push(option.label);\n }\n\n return acc;\n }, [])\n .join(', ');\n\n/**\n * Generates the `displayValue` for the Dropdown based on\n * the selection, the placeholder or it can be empty if there's nothing to show.\n *\n * When there is a selected value but the value is not present in the list, the\n * value is then returned as there is no way to know what the text/label is.\n *\n * @param options Options needed to calculate the display value based on the type of Dropdown (single, multi, category)\n * @returns The text to be displayed by the dropdown\n */\nexport const useDisplayValue = ({ items, placeholder, selectedValues }: UseDisplayValueOptions) => {\n const isCategoryMultilevel = computed(() => items.value.find(option => option.items?.length));\n\n const displayValue = computed(() => {\n // If no value selected, return placeholder or nothing\n if (!selectedValues.value.length) {\n return placeholder.value || null;\n }\n\n // Category multi select\n if (isCategoryMultilevel.value) {\n return categoryMultiSelect(selectedValues, items);\n }\n\n return selectedValues.value.map(({ label }) => label).join(', ');\n });\n\n return displayValue;\n};\n","import { BentoKeyboardNavigationKeyDownEvent } from '@/types';\nimport { BentoListboxEvent } from '@/types/listbox';\nimport { computed, nextTick, Ref } from 'vue';\nimport {\n UseListboxKeyboardNavigationOptions,\n UseTextboxKeyboardNavigationOptions,\n} from './use-keyboard-navigation.types';\n\n/**\n * Returns the focus to the textbox of the dropdown if it exists\n * when the dropdown is being closed.\n * @param elementToFocusOn Reference to the input container\n */\nconst focusOnTextbox = (elementToFocusOn: Ref) => {\n elementToFocusOn.value.$children?.[0].$refs.textbox.focus();\n};\n\n/**\n * Controls the keyboard navigation inside the Dropdown's textbox for Single and Multi select.\n * Adds support for the keys:\n *\n * - Arrow up\n * - Arrow Down\n * - End key\n * - Home key\n * - Escape key\n * - Space key\n * - Enter Key\n *\n * @param options Options from the Dropdown to handle the navigation\n * @param toggleDropdown Function to open/close the Dropdown\n * @param openDropdown Function to open the Dropdown\n * @param closeDropdown Function to close the Dropdown\n * @returns List of event listeners available to the Dropdown's textbox\n */\nexport const useTextboxKeyboardNavigation = (\n {\n inputContainerRef,\n optionsContainerRef,\n selectedValueIndex,\n isDropdownOpen,\n isDynamicFltering,\n items,\n isMultiple,\n }: UseTextboxKeyboardNavigationOptions,\n toggleDropdown: () => void,\n openDropdown: () => void,\n closeDropdown: () => void\n) => {\n const onArrowDown = ({ detail: event }) => {\n event.preventDefault();\n if (!isDropdownOpen.value) {\n openDropdown();\n nextTick(() => {\n if (isMultiple) {\n optionsContainerRef.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children?.[0].$el.focus();\n } else {\n optionsContainerRef.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children?.[\n selectedValueIndex.value\n ].$el.focus();\n }\n });\n }\n };\n const onArrowUp = ({ detail: event }) => {\n event.preventDefault();\n if (!isDropdownOpen.value) {\n openDropdown();\n nextTick(() => {\n optionsContainerRef.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children?.[0].$el.focus();\n });\n }\n };\n\n const onEndKey = () => {\n if (!isDropdownOpen.value) {\n openDropdown();\n nextTick(() => {\n if (isMultiple) {\n const firstLayer =\n optionsContainerRef.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children;\n optionsContainerRef.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children?.[\n firstLayer.length - 1\n ].$children[items.length - 1].$el.focus();\n } else {\n optionsContainerRef.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children?.[\n items.length - 1\n ].$el.focus();\n }\n });\n }\n };\n\n const onEscapeKey = () => {\n if (isDropdownOpen.value) {\n closeDropdown();\n focusOnTextbox(inputContainerRef);\n }\n };\n\n const onHomeKey = () => {\n if (!isDropdownOpen.value) {\n openDropdown();\n }\n nextTick(() => {\n optionsContainerRef.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children?.[0].$el.focus();\n });\n };\n\n const onSpaceKey = ({ detail: event }) => {\n event.preventDefault();\n toggleDropdown();\n if (isDropdownOpen.value) {\n nextTick(() => {\n if (isMultiple) {\n optionsContainerRef.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children?.[0].$el.focus();\n } else {\n optionsContainerRef.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children?.[\n selectedValueIndex.value\n ].$el.focus();\n }\n });\n }\n };\n\n const onEnterKey = () => {\n toggleDropdown();\n if (isDropdownOpen.value) {\n nextTick(() => {\n if (isMultiple) {\n optionsContainerRef.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children?.[0].$el.focus();\n } else {\n optionsContainerRef.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children?.[\n selectedValueIndex.value\n ].$el.focus();\n }\n });\n }\n };\n\n const textboxKeyboardNavigationListeners = computed(() => ({\n ...(!isDynamicFltering.value ? { [BentoKeyboardNavigationKeyDownEvent.SPACE]: onSpaceKey } : {}),\n [BentoKeyboardNavigationKeyDownEvent.ENTER]: onEnterKey,\n [BentoKeyboardNavigationKeyDownEvent.ARROW_DOWN]: onArrowDown,\n [BentoKeyboardNavigationKeyDownEvent.ARROW_UP]: onArrowUp,\n [BentoKeyboardNavigationKeyDownEvent.END]: onEndKey,\n [BentoKeyboardNavigationKeyDownEvent.ESCAPE]: onEscapeKey,\n [BentoKeyboardNavigationKeyDownEvent.HOME]: onHomeKey,\n }));\n\n return textboxKeyboardNavigationListeners;\n};\n\n/**\n * Controls the keyboard navigation inside the Dropdown's listbox container for Single and Multi select.\n * Adds support for the keys:\n *\n * - Escape key\n * - Enter Key\n * - Tab\n * - Space key\n *\n * @param options Options from the Dropdown to handle the navigation inside the listbox\n * @param closeDropdown Function to close the Dropdown\n * @returns List of event listeners available to the Dropdown's listbox container\n */\nexport const useListboxKeyboardNavigation = (\n { inputContainerRef, isDropdownOpen }: UseListboxKeyboardNavigationOptions,\n closeDropdown: () => void\n) => {\n const closeDropdownAndFocusOnTextbox = () => {\n if (isDropdownOpen.value) {\n closeDropdown();\n }\n nextTick(() => {\n focusOnTextbox(inputContainerRef);\n });\n };\n\n const listboxKeyboardNavigationListeners = {\n [BentoListboxEvent.ENTER]: closeDropdownAndFocusOnTextbox,\n [BentoListboxEvent.ESCAPE]: closeDropdownAndFocusOnTextbox,\n [BentoListboxEvent.TAB]: closeDropdownAndFocusOnTextbox,\n [BentoListboxEvent.SPACE]: closeDropdownAndFocusOnTextbox,\n };\n\n return listboxKeyboardNavigationListeners;\n};\n","import { computed, ref, Ref, watch } from 'vue';\nimport { BentoSearchBarItem } from './search-bar.types';\n\n/**\n * Filters an array {@see BentoSearchBarData} containing elements of type {@see BentoSearchBarItem}\n * by the {@param searchTerm}.\n *\n * @param {Ref<String>} searchTerm - Text that satisfies the search criteria.\n * @param {Ref<BentoSearchBarData>} data - Array to be filtered by {@param searchTerm}\n * @returns {Ref<BentoSearchBarData>} New instance of the array filtered by the {@param searchTerm} text\n */\nexport function useSearchBarFilter<T extends BentoSearchBarItem>(\n searchTerm: Ref<string>,\n data: Ref<T[]>,\n searchEvent?: (searchValue: string) => void\n) {\n const searchTermRef = ref(searchTerm);\n const dataRef = ref(data);\n\n const findHits = (searchTermLowerCased: string, options: Array<BentoSearchBarItem> = []) =>\n options.flatMap(option => {\n if (option.label.toLocaleLowerCase().includes(searchTermLowerCased)) {\n return [option, ...findHits(searchTermLowerCased, option.items)];\n }\n\n if (option.items) {\n return [...findHits(searchTermLowerCased, option.items)];\n }\n\n return [];\n });\n\n // If search event exists trigger it on the search term changing\n watch(searchTermRef, () => {\n if (searchEvent !== undefined) {\n searchEvent(searchTermRef.value);\n }\n });\n\n const filterInputData = computed(() => {\n if (!searchTermRef.value) {\n return dataRef.value;\n }\n // If search event exists, emit the new search value into the event and do not manipulate data.\n if (searchEvent !== undefined) {\n return dataRef.value;\n }\n\n const searchTermLowerCased = searchTermRef.value.toLocaleLowerCase();\n const filtered = findHits(searchTermLowerCased, dataRef.value);\n return filtered;\n });\n\n return filterInputData;\n}\n","export const INPUT_FIELD_COMPONENT_INJECTION_KEY = Symbol('input field component injection key');\n","<!-- TODO: Remove aria props as these are part of JSX elements /vue/types/jsx.d.ts -->\n<!-- eslint-disable vue/attribute-hyphenation -->\n<template>\n <div v-bento-click-outside-directive=\"clickOutsideDropdown\" class=\"b-dropdown\" :class=\"conditionalClasses\">\n <field-label\n v-if=\"label\"\n :id=\"labelId\"\n :condensed=\"condensed\"\n :label=\"label\"\n :tooltip-text=\"tooltipText\"\n :optional=\"optional\"\n :required=\"required\"\n />\n <div\n ref=\"inputContainerRefWrapper\"\n v-bento-keyboard-navigation-directive\n v-on=\"textboxKeyboardNavigationListeners\"\n >\n <component\n :is=\"size\"\n ref=\"inputContainerRef\"\n :condensed=\"condensed\"\n :value=\"searchTerm\"\n :additional-items-selected=\"additionalItemsSelected\"\n :ariaControls=\"dropdownOptionsContainerId\"\n :ariaExpanded=\"isDropdownOpen\"\n :aria-labelledby=\"label ? labelId : null\"\n :aria-describedby=\"ariaDescribedBy\"\n :aria-label=\"computedAriaLabel\"\n :aria-readonly=\"isReadOnly\"\n :readonly=\"isReadOnly\"\n :disabled=\"disabled\"\n :display-value=\"displayValue\"\n :dynamic-filtering=\"dynamicFiltering\"\n :is-invalid=\"!!errorMessage || error\"\n :multiple=\"multiple\"\n :open=\"isDropdownOpen\"\n :selected-value-item=\"!isInputComponent ? selectedValueItem : undefined\"\n :show-slot-content-in-multiple=\"showSlotContentInMultiple\"\n @input=\"searchTerm = $event\"\n @open=\"toggleDropdown\"\n @close=\"toggleDropdown\"\n >\n <template v-for=\"(_, innerSlot) of slots\" #[innerSlot]=\"scope\">\n <slot :name=\"innerSlot\" v-bind=\"scope\" />\n </template>\n </component>\n </div>\n <bento-dropdown-options-container\n v-if=\"inputContainerRef\"\n :id=\"dropdownOptionsContainerId\"\n ref=\"optionsContainerRef\"\n :aria-label=\"computedAriaLabel\"\n :empty-state=\"emptyState\"\n :debounce-time=\"search?.debounceTime\"\n :disabled=\"disabled\"\n :input-size=\"size\"\n :is-option-disabled=\"isOptionDisabled\"\n :items=\"filteredItems\"\n :multiple=\"multiple\"\n :static-categories=\"staticCategories\"\n :open=\"isDropdownOpen\"\n :selected-value=\"cachedSelectedListboxOptions\"\n :searching=\"isSearching\"\n :target-element=\"inputContainerRefWrapper\"\n :loading=\"loading\"\n :has-more-items=\"hasMoreItems\"\n :lazy-load-type=\"lazyLoadType\"\n :virtual-scroll=\"virtualScroll\"\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-dropdown-options-container>\n <error-message\n v-if=\"!!errorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-dropdown__error-message\"\n />\n <bento-typography\n v-if=\"description || hasSlot('description')\"\n :id=\"descriptionId\"\n class=\"b-dropdown__description\"\n :class=\"descriptionConditionalClasses\"\n el=\"span\"\n >\n <slot name=\"description\">\n {{ description }}\n </slot>\n </bento-typography>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, inject, PropType, Ref, ref, toRef, toRefs, useAttrs, useSlots } from 'vue';\n\n // Components\n import { BentoDropdownOptionsContainer } from './components/dropdown-options-container';\n import { BentoTypography } from '@/components/typography';\n import { DropdownInputDefault, DropdownInputSmall } from './components';\n import { BentoListbox, ErrorMessage, FieldLabel, useCachedSelectedValues, useMultiLevelItems } from '@/internal';\n\n // Utils\n import { deprecate } from '@/utils/ts/deprecate';\n import { generateUid } from '@/utils/ts/unique-id';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { useI18n } from '@/utils/ts/i18n';\n\n // Composables\n import { useDisplayValue, useListboxKeyboardNavigation, useTextboxKeyboardNavigation } from './composables';\n\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n import { useSearchBarFilter } from '@/components/search-bar/useSearchBarDataFilter';\n\n // Directives\n import { BentoClickOutsideDirective as vBentoClickOutsideDirective } from '@/directives/click-outside';\n import { BentoKeyboardNavigationDirective as vBentoKeyboardNavigationDirective } from '@/directives';\n\n // Types\n import {\n BentoDropdownEmptyStateProps,\n BentoDropdownEvent,\n BentoDropdownLazyLoadType,\n BentoDropdownSearchOptions,\n BentoDropdownSize,\n BentoDropdownVirtulisationOptions,\n } from './dropdown.types';\n import {\n BentoListboxEvent,\n BentoListboxIsOptionDisabled,\n BentoListboxMultiSelectValue,\n BentoListboxOptions,\n BentoListboxSelectedValue,\n } from '@/types';\n\n import messages from './messages.json';\n import { useHasSlot } from '@/composables';\n import { INPUT_FIELD_COMPONENT_INJECTION_KEY } from '@/components/input-field/input-field.keys';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const attrs = useAttrs();\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const props = defineProps({\n /**\n * @deprecated from version 2.0.0. Use the aria-label attribute instead.\n */\n /**\n * Defines a string value that labels an interactive element.\n */\n ariaLabel: { type: String, default: null },\n\n /**\n * Renders the dropdown with a condensed style.\n */\n condensed: { type: Boolean, default: false },\n\n /**\n * Empty state props used with the inner empty state component which is displayed when no search results are found.\n */\n emptyState: {\n type: Object as PropType<BentoDropdownEmptyStateProps>,\n default: undefined,\n },\n\n /**\n * Disables dropdown functionality.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Sets the possibility to type into the textbox.\n */\n dynamicFiltering: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Highlights the dropdown in an erroneous state.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n error: { type: Boolean, default: false },\n\n /**\n * Highlights the dropdown in an erroneous state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Descriptive supporting text visbile underneath the dropdown.\n */\n description: { type: String, default: null },\n\n /**\n * Indicates whether there are more items to load\n */\n hasMoreItems: { type: Boolean, default: false },\n\n /**\n * Function that dertermines which options are disabled from interaction.\n *\n * @type {BentoListboxIsOptionDisabled}\n * @param {BentoListboxOptionItem} option - Dropdown 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 dropdown 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 default: () => [],\n },\n\n /**\n * Text that is displayed as a label above the element.\n */\n label: { type: String, default: null },\n\n /**\n * Indicates if new options are 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<BentoDropdownLazyLoadType | `${BentoDropdownLazyLoadType}`>,\n default: BentoListbox.props.lazyLoadType.default,\n validator: (value: BentoDropdownLazyLoadType) => Object.values(BentoDropdownLazyLoadType).includes(value),\n },\n\n /*\n * If enabled, the user will be able to select multiple items.\n */\n multiple: { type: Boolean, default: false },\n\n /**\n * Highlights the dropdown is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * Text that appears in the form control when it has no value set\n */\n placeholder: { type: String, default: null },\n\n /**\n * Sets the dropdown to readonly state\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Highlights the dropdown is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Dropdown search options and events.\n * @see BentoDropdownSearchOptions\n */\n search: {\n type: Object as PropType<BentoDropdownSearchOptions>,\n default: undefined,\n },\n\n /**\n * Toggles whether to use the slot content select items shown in the textbox in multiple mode.\n */\n showSlotContentInMultiple: { type: Boolean, default: false },\n\n /**\n * @deprecated Do not use. Only 'default' size should be used.\n */\n size: {\n type: String as PropType<BentoDropdownSize | `${BentoDropdownSize}`>,\n default: null,\n validator: (value: BentoDropdownSize) => Object.values(BentoDropdownSize).includes(value),\n },\n\n /**\n * If enabled, dropdown will display non-selectable, static categories\n */\n staticCategories: { type: Boolean, default: false },\n\n /**\n * Adds a info icon next to the label to display the passed tooltip message.\n */\n tooltipText: { type: String, default: null },\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 value: {\n type: [String, Number, Array] as PropType<BentoListboxSelectedValue>,\n default: null,\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<BentoDropdownVirtulisationOptions>,\n default: false,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when an option is clicked. Updates the selected option from the \"value\" property linked to the v-model.\n */\n (e: 'input', selectedValue: BentoListboxSelectedValue);\n\n /**\n * Emitted when:\n * - `lazyLoad` is `automatic` and the scroll meets the end of the list\n * - `lazyload` is `button` and the button is clicked\n */\n (e: 'show-more');\n }>();\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const inputContainerRef = ref(null);\n const inputContainerRefWrapper = ref(null);\n const optionsContainerRef: Ref<InstanceType<typeof BentoDropdownOptionsContainer>> = ref(null);\n const isDropdownOpen = ref(false);\n const dropdownOptionsContainerId = generateUid('bento-dropdown-options-container');\n const labelId = generateUid('dropdown-label');\n const descriptionId = generateUid('dropdown-description');\n const errorId = generateUid('dropdown-error');\n\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const { cachedSelectedListboxOptions, cachedListboxSelectedValues, setCachedValues } = useCachedSelectedValues(\n toRef(props, 'items'),\n toRef(props, 'value'),\n toRef(props, 'multiple')\n );\n\n const ariaLabelAttribute = ref(attrs['aria-label']);\n const { ariaLabel } = toRefs(props);\n const computedAriaLabel = useAriaLabel({\n ariaLabel: ariaLabelAttribute.value as string,\n // TODO: take this line away when the aria-label props is removed\n label: ariaLabel,\n defaultFallback: t('ariaLabelFallback'),\n });\n\n // Inject input field component key to change the dropdown size\n const isInputComponent =\n props.size === BentoDropdownSize.SMALL || inject(INPUT_FIELD_COMPONENT_INJECTION_KEY, false);\n const size = computed(() => (isInputComponent ? BentoDropdownSize.SMALL : BentoDropdownSize.DEFAULT));\n\n const conditionalClasses = computed(() => ({\n 'b-dropdown--condensed': props.condensed,\n }));\n\n // Description styles\n const descriptionConditionalClasses = computed(() => ({\n 'b-dropdown__description--error': !!props.errorMessage,\n }));\n\n // Filtering\n const searchTerm = ref('');\n const items = toRef(props, 'items');\n const filteredItems = useSearchBarFilter(searchTerm, items, props?.search?.searchEvent);\n const isSearching = computed(() => props.dynamicFiltering && !!searchTerm.value);\n\n const displayValue = useDisplayValue({\n items,\n placeholder: toRef(props, 'placeholder'),\n selectedValues: cachedSelectedListboxOptions,\n });\n\n const selectedValueItem = computed(() => {\n if (props?.multiple && Array.isArray(props.value)) {\n return props.items.filter(\n ({ value }) => props?.value && (props?.value as BentoListboxMultiSelectValue).includes(value)\n );\n }\n if (!props.multiple && props.staticCategories) {\n // Find the category that holds the selected value\n const category = props.items.find(categoryItem =>\n categoryItem.items.some(item => item.value === props.value)\n );\n // Find the specific item within the category\n const selectedCategoryItem = category ? category.items.find(item => item.value === props.value) : null;\n\n return selectedCategoryItem;\n }\n\n return props.items.find(({ value }) => value === props?.value);\n });\n\n const selectedValueIndex = computed(() => {\n const index = props.items.findIndex(({ value }) => props.value === value);\n return index > 0 ? index : 0;\n });\n\n const { isMultiLevelSelect, flattenedItemsList } = useMultiLevelItems(items);\n\n const additionalItemsSelected = computed(() => {\n if (props.multiple && !props.hasMoreItems) {\n const selectedItems = (props?.value as BentoListboxMultiSelectValue)?.length;\n const total = isMultiLevelSelect.value ? flattenedItemsList.value.length : items.value.length;\n return total === selectedItems ? t('all') : selectedItems;\n }\n\n return null;\n });\n\n // ARIA\n const ariaDescribedBy = computed(\n () => `${props.description ? descriptionId : ''} ${props.errorMessage ? errorId : ''}`.trim() || null\n );\n\n const openDropdown = () => {\n if (isReadOnly.value) {\n return;\n }\n isDropdownOpen.value = true;\n };\n\n const closeDropdown = () => {\n isDropdownOpen.value = false;\n };\n\n const toggleDropdown = () => {\n if (isReadOnly.value) {\n return;\n }\n isDropdownOpen.value = !isDropdownOpen.value;\n\n // Clear search\n if (isSearching.value) {\n searchTerm.value = '';\n }\n };\n\n const clickOutsideDropdown = () => {\n if (isSearching.value) {\n searchTerm.value = '';\n }\n\n if (isDropdownOpen.value) {\n isDropdownOpen.value = false;\n // Reset the internal dropdown options state\n optionsContainerRef.value.onOutsideDropdownClick();\n }\n };\n\n const onOptionSelected = (selectedValue: BentoListboxOptions) => {\n // Clear and close the dropdown on single selection\n if (!props.multiple) {\n searchTerm.value = '';\n isDropdownOpen.value = false;\n }\n\n setCachedValues(selectedValue);\n emit('input', cachedListboxSelectedValues.value);\n };\n\n const emitShowMoreEvent = () => {\n emit(BentoDropdownEvent.SHOW_MORE);\n };\n\n const textboxKeyboardNavigationListeners = useTextboxKeyboardNavigation(\n {\n inputContainerRef,\n optionsContainerRef,\n selectedValueIndex,\n isDropdownOpen,\n isDynamicFltering: toRef(props, 'dynamicFiltering'),\n items: props.items,\n isMultiple: props.multiple,\n },\n toggleDropdown,\n openDropdown,\n closeDropdown\n );\n\n const listboxKeyboardNavigationListeners = useListboxKeyboardNavigation(\n {\n inputContainerRef,\n isDropdownOpen,\n },\n closeDropdown\n );\n\n const listboxListeners = {\n [BentoListboxEvent.CLOSE_DROPDOWN]: closeDropdown,\n [BentoListboxEvent.SELECT]: onOptionSelected,\n [BentoListboxEvent.SHOW_MORE]: emitShowMoreEvent,\n ...listboxKeyboardNavigationListeners,\n };\n\n if (props.error) {\n deprecate(\n 'BentoDropdown \"error\" property',\n `Use the BentoDropdown \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-dropdown errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n if (props.size) {\n deprecate('BentoDropdown \"size\" property', `Do not use. Only 'default' size should be used.`, '2.0.0');\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * A Dropdown shows a selected option's.\n * Use a dropdown when you want users to select options\n * from a list of pre-defined options.\n *\n * @example\n * import { BentoDropdown } from '@adyen/bento-vue2';\n * import type { BentoDropdownOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdown },\n * template: `\n * <bento-dropdown\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :multiple=\"true\"\n * :isOptionsDisabled=\"option => option.value === 2\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref(2) // Default value\n * const options: BentoDropdownOptions = [\n * { label: 'Option 1', value: 1 },\n * { label: 'Option 2', value: 2 },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'b-dropdown',\n components: {\n DropdownInputDefault,\n DropdownInputSmall,\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./dropdown.scss\" />\n"],"names":["BentoDropdownSize","BentoDropdownSize2","useDropdownOptionsListbox","selectedValue","multiple","isOpen","emit","internalSelectedValue","ref","t","useI18n","watch","isApplyButtonDisabled","computed","onApplyClick","BentoListboxEvent","onCancelClick","onOutsideDropdownClick","actions","onOptionSelected","newSelectedValue","onTabKey","onEnterKey","onSpaceKey","onEscapeKey","emitShowMoreEvent","listeners","__default__$2","defineComponent","messages$1","slots","useSlots","toRefs","props","dropdownOptionsListboxRef","isDropdownOpen","noResultsMessage","conditionalClasses","conditionalListboxClasses","popperContainerOrPopoverComponent","BentoPopover","PopperContainer","popperContainerOrPopoverProps","containerMinAndMaxWidth","_a","generateUid","expose","uuid$1","_sfc_main$3","uuid","_sfc_main$2","__default__$1","DropdownBaseTextboxState","openDropdown","closeDropdown","DropdownBaseTextboxEvent","categoryMultiSelect","selectedValues","items","acc","option","selectedCategoryOptions","categoryOption","selectedOption","label","useDisplayValue","placeholder","isCategoryMultilevel","focusOnTextbox","elementToFocusOn","useTextboxKeyboardNavigation","inputContainerRef","optionsContainerRef","selectedValueIndex","isDynamicFltering","isMultiple","toggleDropdown","onArrowDown","event","nextTick","_b","onArrowUp","onEndKey","firstLayer","onHomeKey","BentoKeyboardNavigationKeyDownEvent","useListboxKeyboardNavigation","closeDropdownAndFocusOnTextbox","useSearchBarFilter","searchTerm","data","searchEvent","searchTermRef","dataRef","findHits","searchTermLowerCased","options","INPUT_FIELD_COMPONENT_INJECTION_KEY","__default__","messages","DropdownInputDefault","DropdownInputSmall","attrs","useAttrs","hasSlot","useHasSlot","inputContainerRefWrapper","dropdownOptionsContainerId","labelId","descriptionId","errorId","isReadOnly","useFormLayoutFieldLoading","toRef","cachedSelectedListboxOptions","cachedListboxSelectedValues","setCachedValues","useCachedSelectedValues","ariaLabelAttribute","ariaLabel","computedAriaLabel","useAriaLabel","isInputComponent","inject","size","descriptionConditionalClasses","filteredItems","isSearching","displayValue","selectedValueItem","value","category","categoryItem","item","index","isMultiLevelSelect","flattenedItemsList","useMultiLevelItems","additionalItemsSelected","selectedItems","ariaDescribedBy","clickOutsideDropdown","textboxKeyboardNavigationListeners","listboxKeyboardNavigationListeners","listboxListeners","deprecate"],"mappings":";;;;;;;;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,wBACAA,EAAA,QAAA,sBAFQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;GCeLE,KAAA,CAAAC,GAAAC,GAAAC,GAAAC,MAAA;AAMH,QAAAC,IAAAC,EAAAL,EAAA,KAAA,GACA,EAAA,GAAAM,EAAA,IAAAC,EAAA;AAEA,EAAAC,GAAAR,GAAA,MAAA;AACI,IAAAI,EAAA,QAAAJ,EAAA;AAAA,EAA4C,C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JiF,EAAAjH,CAAA,GACAG,EAAA,SAAA6G,EAAA,KAAA;AAAA,IAA+C,GAGnD1F,IAAA,MAAA;AACI,MAAAnB,EAAAS,EAAA,SAAA;AAAA,IAAiC,GAGrC+H,KAAAxE;AAAA,MAA2C;AAAA,QACvC,mBAAAC;AAAA,QACI,qBAAAC;AAAA,QACA,oBAAAC;AAAA,QACA,gBAAAtC;AAAA,QACA,mBAAA8E,EAAAhF,GAAA,kBAAA;AAAA,QACkD,OAAAA,EAAA;AAAA,QACrC,YAAAA,EAAA;AAAA,MACK;AAAA,MACtB2C;AAAA,MACAvB;AAAA,MACAC;AAAA,IACA,GAGJyF,IAAAzD;AAAA,MAA2C;AAAA,QACvC,mBAAAf;AAAA,QACI,gBAAApC;AAAA,MACA;AAAA,MACJmB;AAAA,IACA,GAGJ0F,KAAA;AAAA,MAAyB,CAAAjI,EAAA,cAAA,GAAAuC;AAAA,MACe,CAAAvC,EAAA,MAAA,GAAAI;AAAA,MACR,CAAAJ,EAAA,SAAA,GAAAU;AAAA,MACG,GAAAsH;AAAA,IAC5B;AAGP,WAAA9G,EAAA,SACIgH;AAAA,MAAA;AAAA,MACI;AAAA;AAAA;AAAA,MACA;AAAA,IAGA,GAIRhH,EAAA,QACIgH,EAAA,iCAAA,mDAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[3,4]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"events.58c00e6d.js","sources":["../../src/utils/ts/events.ts"],"sourcesContent":["import { ListenOptions } from '@/types/utils-events';\n\n/**\n * Browser event options object feature support\n * @type {object}\n * @property {boolean} capture\n * @property {boolean} passive\n * @property {boolean} once\n */\nconst optionsSupport = (() => {\n const support = {\n capture: false,\n passive: false,\n once: false,\n };\n\n try {\n // `addEventListener`/`removeEventListener` last argument can be boolean or Object.\n // Old browsers only support boolean, so passing an Object would make them evaluate are true.\n // To detect Object support and each feature, we provide an object with getters.\n // If the getter is invoked means that browser supports that specific feature.\n const options = {\n get capture() {\n support.capture = true;\n return false;\n },\n get passive() {\n support.passive = true;\n return false;\n },\n get once() {\n support.once = true;\n return false;\n },\n };\n // eslint-disable-next-line scanjs-rules/call_addEventListener\n document.addEventListener('test', null, options);\n document.removeEventListener('test', null, options);\n } catch {\n // ignored\n }\n\n return support;\n})();\n\n/**\n * Attach event listeners using options object (implementing browser fallbacks), easy cleanup\n *\n * @param {EventTarget} target - Target where the event will be attached\n * @param {string} type - Event type(s). Accepts multiple types separated by space\n * @param {EventHandler} listener - Handler function\n * @param {ListenOptions}[options] - Listener options\n * @param {boolean} [options.capture] - Capture event listener\n * @param {boolean} [options.passive] - Passive event listener\n * @param {boolean} [options.once] - Auto cleanup after event is fired for the first time\n * @param {boolean} [options.self] - Only trigger if the target of the event is itself\n * @param {Vue} [options.vm] - Auto cleanup when vue instance is destroyed\n * @param {Function} [options.onCleanup] - Callback function invoked after cleaning up\n * @return {Function} Cleanup function that removes the listener\n */\nexport function listen(target: EventTarget, type: string, listener: EventListener, options?: ListenOptions) {\n if (type.indexOf(' ') >= 0) {\n const cleanupBatch = type.split(' ').map(eventType => listen(target, eventType, listener, options));\n return () => cleanupBatch.forEach(cleanup => cleanup && cleanup());\n }\n\n let cleanup;\n let eventOptions: boolean | AddEventListenerOptions;\n let useNativeOnce = false;\n\n // Listener wrapper\n const eventListener = event => {\n if (options?.self && event.target !== target) {\n return;\n }\n try {\n listener(event);\n } finally {\n if (options?.once) {\n cleanup();\n }\n }\n };\n\n // Cleanup function\n cleanup = () => {\n if (!useNativeOnce) {\n target.removeEventListener(type, eventListener, eventOptions);\n }\n options?.vm?.$off('hook:beforeDestroy', cleanup);\n options?.onCleanup?.();\n };\n\n // addEventListener options adjustments\n if (options?.capture) {\n eventOptions = optionsSupport.capture ? { capture: true } : true;\n }\n\n if (options?.passive && optionsSupport.passive) {\n eventOptions = { ...(eventOptions as AddEventListenerOptions), passive: true };\n }\n\n if (options?.once && optionsSupport.once) {\n // `self`, `vm` and `onCleanup` options forces to skip native `once`\n if (!options?.self && !options?.vm && !options?.onCleanup) {\n useNativeOnce = true;\n eventOptions = { ...(eventOptions as AddEventListenerOptions), once: true };\n }\n }\n\n // TODO: vue 3 uses old vue event emitter, do we need this?\n // https://v3-migration.vuejs.org/breaking-changes/events-api.html#event-bus\n // if (options?.vm) {\n // if (!(options.vm instanceof Vue)) {\n // throw new TypeError('options.vm is not a Vue component instance');\n // }\n // options.vm.$once('hook:beforeDestroy', cleanup);\n // }\n // eslint-disable-next-line scanjs-rules/call_addEventListener\n target.addEventListener(type, eventListener, eventOptions);\n return cleanup;\n}\n\n/**\n * Prevents the event from bubbling\n * @param {Event} event - Triggered event\n */\nexport const stopEventPropagation = (event: Event) => {\n if (event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n event.stopPropagation();\n }\n};\n"],"names":["optionsSupport","support","options","listen","target","type","listener","cleanupBatch","eventType","cleanup","eventOptions","useNativeOnce","eventListener","event","_a","_b","stopEventPropagation"],"mappings":"AASA,MAAMA,KAAkB,MAAM;AAC1B,QAAMC,IAAU;AAAA,IACZ,SAAS;AAAA,IACT,SAAS;AAAA,IACT,MAAM;AAAA,EAAA;AAGN,MAAA;AAKA,UAAMC,IAAU;AAAA,MACZ,IAAI,UAAU;AACV,eAAAD,EAAQ,UAAU,IACX;AAAA,MACX;AAAA,MACA,IAAI,UAAU;AACV,eAAAA,EAAQ,UAAU,IACX;AAAA,MACX;AAAA,MACA,IAAI,OAAO;AACP,eAAAA,EAAQ,OAAO,IACR;AAAA,MACX;AAAA,IAAA;AAGK,aAAA,iBAAiB,QAAQ,MAAMC,CAAO,GACtC,SAAA,oBAAoB,QAAQ,MAAMA,CAAO;AAAA,EAAA,QACpD;AAAA,EAEF;AAEO,SAAAD;AACX;AAiBO,SAASE,EAAOC,GAAqBC,GAAcC,GAAyBJ,GAAyB;AACxG,MAAIG,EAAK,QAAQ,GAAG,KAAK,GAAG;AACxB,UAAME,IAAeF,EAAK,MAAM,GAAG,EAAE,IAAI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c } from "./_plugin-vue2_normalizer.71e2aa87.js";
3
- import { a as f } from "./button.9d6435ae.js";
4
- import { BentoInfoIcon as m } from "../info-icon.js";
5
- import { B as y } from "./index.dd30e538.js";
6
- import { C as b } from "./copy.f85700c6.js";
7
- import { S as v } from "./search.471270fe.js";
8
- import { b as h } from "./tooltip.58ef3f4a.js";
9
- import "../assets/index40.css";
10
- const _ = Symbol("structured list condensed style injection key"), u = Symbol("structured list labels width injection key"), i = ["25-75", "33-66", "42-58", "50-50"], S = {}, C = /* @__PURE__ */ l({
11
- ...S,
12
- __name: "structured-list",
13
- props: {
14
- /**
15
- * Width of the labels container, in pixels. Overrides layout prop.
16
- */
17
- labelsWidth: {
18
- type: Number,
19
- default: null
20
- },
21
- /**
22
- * The layout of the label value pair in percentage.
23
- * If labelsWidth is set, layout will be overriden by the static pixel value.
24
- *
25
- * If the value entered is not listed in the example
26
- * list below '33-66' will be applied
27
- * @example
28
- * '25-75'
29
- * '33-66'
30
- * '42-58'
31
- * '50-50'
32
- */
33
- layout: {
34
- type: String,
35
- default: "33-66",
36
- validator: (s) => i.includes(s)
37
- }
38
- },
39
- setup(s) {
40
- const t = s, e = n(_, !1), o = r(
41
- () => i.includes(t.layout) ? t.layout : "33-66"
42
- ), a = r(() => e ? "130px" : t.labelsWidth ? `${t.labelsWidth}px` : `${o.value.split("-")[0]}%`);
43
- return d(u, a), { __sfc: !0, props: t, isCondensed: e, computedLayout: o, computedLabelsWidth: a };
44
- }
45
- });
46
- var T = function() {
47
- var t = this, e = t._self._c;
48
- return t._self._setupProxy, e("dl", { staticClass: "b-structured-list" }, [t._t("default")], 2);
49
- }, I = [], L = /* @__PURE__ */ c(
50
- C,
51
- T,
52
- I,
53
- !1,
54
- null,
55
- "890955b6",
56
- null,
57
- null
58
- );
59
- const A = L.exports, g = {
60
- "en-US": {
61
- search: "Search"
62
- }
63
- }, x = "33%", B = l({
64
- i18n: { messages: g },
65
- name: "bento-structured-list-item",
66
- components: {
67
- BentoButton: f,
68
- BentoInfoIcon: m,
69
- BentoTypography: y,
70
- Copy: b,
71
- SearchIcon: v
72
- },
73
- directives: { BentoTooltipDirective: h },
74
- props: {
75
- /**
76
- * Label to display for the value
77
- */
78
- label: {
79
- type: String,
80
- required: !0
81
- },
82
- /**
83
- * Text to display in info icon tooltip in the label to display for the value
84
- */
85
- labelInfo: {
86
- type: String,
87
- default: void 0
88
- },
89
- /**
90
- * Text to copy when the user clicks `Copy` icon
91
- */
92
- copy: {
93
- type: String,
94
- default: void 0
95
- },
96
- /**
97
- * Function to trigger when user clicks `Search` icon
98
- */
99
- search: {
100
- type: Function,
101
- default: void 0
102
- },
103
- /**
104
- * Text to display when the user hovers over `Search` icon
105
- */
106
- searchTooltip: {
107
- type: String,
108
- default: void 0
109
- }
110
- },
111
- setup() {
112
- const s = n(_, !1), t = n(
113
- u,
114
- p(x)
115
- ), e = r(() => ({
116
- "b-structured-list-item--condensed": s
117
- })), o = r(() => s ? "caption" : "body");
118
- return {
119
- // Values
120
- conditionalClasses: e,
121
- labelTypographyVariant: o,
122
- labelsWidth: t
123
- };
124
- }
125
- });
126
- var E = function() {
127
- var t = this, e = t._self._c;
128
- return t._self._setupProxy, e("div", { staticClass: "b-structured-list-item", class: t.conditionalClasses }, [e("dt", { staticClass: "b-structured-list-item__label", style: `flex-basis:${t.labelsWidth}` }, [e("bento-typography", { attrs: { variant: t.labelTypographyVariant } }, [t._v(t._s(t.label))]), t.labelInfo ? e("bento-info-icon", { staticClass: "b-structured-list-item__icon", attrs: { "tooltip-text": t.labelInfo } }) : t._e()], 1), e("dd", { staticClass: "b-structured-list-item__value" }, [t._t("default"), t.copy ? e("copy", { staticClass: "b-structured-list-item__icon", attrs: { text: t.copy } }) : t._e(), t.search ? e("bento-button", { directives: [{ name: "bento-tooltip-directive", rawName: "v-bento-tooltip-directive:top", value: t.searchTooltip ? t.searchTooltip : t.$t("search"), expression: "searchTooltip ? searchTooltip : $t('search')", arg: "top" }], staticClass: "b-structured-list-item__icon", attrs: { variant: "tertiary" }, on: { click: t.search }, scopedSlots: t._u([{ key: "iconLeft", fn: function() {
129
- return [e("search-icon", { attrs: { "svg-title": t.$t("search") } })];
130
- }, proxy: !0 }], null, !1, 1678634924) }) : t._e()], 2)]);
131
- }, $ = [], D = /* @__PURE__ */ c(
132
- B,
133
- E,
134
- $,
135
- !1,
136
- null,
137
- "44984d3a",
138
- null,
139
- null
140
- );
141
- const w = D.exports;
142
- export {
143
- A as B,
144
- _ as S,
145
- w as a
146
- };
147
- //# sourceMappingURL=index.aaf965f8.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.aaf965f8.js","sources":["../../src/components/structured-list/structured-list.keys.ts","../../src/components/structured-list/structured-list.types.ts","../../src/components/structured-list/structured-list.vue","../../src/components/structured-list/components/structered-list-item/structured-list-item.vue"],"sourcesContent":["export const STRUCTURED_LIST_CONDENSED_INJECTION_KEY = Symbol('structured list condensed style injection key');\nexport const STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY = Symbol('structured list labels width injection key');\n","export type BentoStructuredListLayoutOptions = '25-75' | '33-66' | '42-58' | '50-50';\nexport const BentoStructuredListLayoutOptions = ['25-75', '33-66', '42-58', '50-50'];\n","<template>\n <dl class=\"b-structured-list\">\n <slot />\n </dl>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, PropType, provide } from 'vue';\n import {\n STRUCTURED_LIST_CONDENSED_INJECTION_KEY,\n STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY,\n } from '@/components/structured-list/structured-list.keys';\n import { BentoStructuredListLayoutOptions } from './structured-list.types';\n\n const props = defineProps({\n /**\n * Width of the labels container, in pixels. Overrides layout prop.\n */\n labelsWidth: {\n type: Number,\n default: null,\n },\n /**\n * The layout of the label value pair in percentage.\n * If labelsWidth is set, layout will be overriden by the static pixel value.\n *\n * If the value entered is not listed in the example\n * list below '33-66' will be applied\n * @example\n * '25-75'\n * '33-66'\n * '42-58'\n * '50-50'\n */\n layout: {\n type: String as PropType<BentoStructuredListLayoutOptions>,\n default: '33-66',\n validator: (value: BentoStructuredListLayoutOptions) => BentoStructuredListLayoutOptions.includes(value),\n },\n });\n\n const isCondensed = inject(STRUCTURED_LIST_CONDENSED_INJECTION_KEY, false);\n\n const computedLayout = computed(() =>\n BentoStructuredListLayoutOptions.includes(props.layout) ? props.layout : '33-66'\n );\n\n const computedLabelsWidth = computed(() => {\n if (isCondensed) {\n return '130px';\n }\n\n if (props.labelsWidth) {\n return `${props.labelsWidth}px`;\n }\n\n return `${computedLayout.value.split('-')[0]}%`;\n });\n\n provide(STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY, computedLabelsWidth);\n</script>\n\n<script lang=\"ts\">\n /**\n * This is a list used to display pairs of information in a clear and organized manner.\n * `BentoStructureListItem` should be used to pass the label/value pairs to the list.\n *\n * @example\n * import { BentoStructuredListItem, BentoStructuredListItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStructuredList, BentoStructuredListItem },\n * template: `\n * <bento-structured-list>\n * <bento-structured-list-item label=\"Payment\">\n * <bento-payment-method label=\"Klarna\" type=\"Klarna\" />\n * </bento-structured-list-item>\n * <bento-structured-list-item label=\"Amount\">\n * <bento-currency :currency=\"BentoCurrencyISOCode.USD\">\n * 123456\n * </bento-currency>\n * </bento-structured-list-item>\n * </bento-structured-list>\n * `\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./structured-list.scss\" />\n","<template>\n <div class=\"b-structured-list-item\" :class=\"conditionalClasses\">\n <dt class=\"b-structured-list-item__label\" :style=\"`flex-basis:${labelsWidth}`\">\n <bento-typography :variant=\"labelTypographyVariant\">{{ label }}</bento-typography>\n <bento-info-icon v-if=\"labelInfo\" class=\"b-structured-list-item__icon\" :tooltip-text=\"labelInfo\" />\n </dt>\n <dd class=\"b-structured-list-item__value\">\n <slot />\n <copy v-if=\"copy\" class=\"b-structured-list-item__icon\" :text=\"copy\" />\n <bento-button\n v-if=\"search\"\n v-bento-tooltip-directive:top=\"searchTooltip ? searchTooltip : $t('search')\"\n class=\"b-structured-list-item__icon\"\n variant=\"tertiary\"\n @click=\"search\"\n >\n <template #iconLeft>\n <search-icon :svg-title=\"$t('search')\" />\n </template>\n </bento-button>\n </dd>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, inject, PropType, ref, Ref } from 'vue';\n\n // Components\n import { BentoButton } from '@/components/button';\n import { BentoInfoIcon } from '@/components/info-icon';\n import { BentoTypography } from '@/components/typography';\n import Copy from '@/components/internal/copy/copy.vue';\n import SearchIcon from '@adyen/ui-assets-icons-16/vue/search';\n\n // Directives\n import { BentoTooltipDirective } from '@/directives';\n\n // Keys\n import {\n STRUCTURED_LIST_CONDENSED_INJECTION_KEY,\n STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY,\n } from '../../structured-list.keys';\n\n import messages from '../../messages.json';\n\n const DEFAULT_LABELS_WIDTH = '33%';\n\n /**\n * This is an item of the `BentoStructuredList` meant to be used only with that component.\n * It consists of a label/value pair, and also the optional copy and search modifiers.\n *\n * @example\n * import { BentoCurrencyISOCode, BentoStructuredListItem, BentoStructuredListItem } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStructuredListItem, BentoStructuredListItem },\n * template: `\n * <bento-structured-list>\n * <bento-structured-list-item label=\"Shopper\" search='searchShopper' search-tooltip='Find shopper'>\n * <bento-typography>\n * 143442642\n * </bento-status>\n * </bento-structured-list-item>\n * <bento-structured-list-item label=\"Amount\" copy='123456'>\n * <bento-currency :currency=\"BentoCurrencyISOCode.USD\">\n * 123456\n * </bento-currency>\n * </bento-structured-list-item>\n * </bento-structured-list>\n * `\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-structured-list-item',\n components: {\n BentoButton,\n BentoInfoIcon,\n BentoTypography,\n Copy,\n SearchIcon,\n },\n directives: { BentoTooltipDirective },\n props: {\n /**\n * Label to display for the value\n */\n label: {\n type: String,\n required: true,\n },\n /**\n * Text to display in info icon tooltip in the label to display for the value\n */\n labelInfo: {\n type: String,\n default: undefined,\n },\n /**\n * Text to copy when the user clicks `Copy` icon\n */\n copy: {\n type: String,\n default: undefined,\n },\n /**\n * Function to trigger when user clicks `Search` icon\n */\n search: {\n type: Function as PropType<(event: Event) => void>,\n default: undefined,\n },\n /**\n * Text to display when the user hovers over `Search` icon\n */\n searchTooltip: {\n type: String,\n default: undefined,\n },\n },\n setup() {\n const isCondensed = inject(STRUCTURED_LIST_CONDENSED_INJECTION_KEY, false);\n const labelsWidth = inject<Ref<string>>(\n STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY,\n ref(DEFAULT_LABELS_WIDTH)\n );\n const conditionalClasses = computed(() => ({\n 'b-structured-list-item--condensed': isCondensed,\n }));\n\n const labelTypographyVariant = computed(() => (isCondensed ? 'caption' : 'body'));\n\n return {\n // Values\n conditionalClasses,\n labelTypographyVariant,\n labelsWidth,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./structured-list-item.scss\" />\n"],"names":["STRUCTURED_LIST_CONDENSED_INJECTION_KEY","STRUCTURED_LIST_LABELS_WIDTH_INJECTION_KEY","BentoStructuredListLayoutOptions","__default__","isCondensed","inject","computedLayout","computed","props","computedLabelsWidth","provide","DEFAULT_LABELS_WIDTH","_sfc_main","defineComponent","messages","BentoButton","BentoInfoIcon","BentoTypography","Copy","SearchIcon","BentoTooltipDirective","labelsWidth","ref","conditionalClasses","labelTypographyVariant"],"mappings":";;;;;;;;;AAAa,MAAAA,IAAA,OAAA,+CAAA,GACAC,IAAA,OAAA,4CAAA,GCANC,IAAA,CAAA,SAAA,SAAA,SAAA,OAAA,GCqFHC,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA7CAC,IAAAC,EAAAL,GAAA,EAAA,GAEAM,IAAAC;AAAA,MAAuB,MAAAL,EAAA,SAAAM,EAAA,MAAA,IAAAA,EAAA,SAAA;AAAA,IACsD,GAG7EC,IAAAF,EAAA,MACIH,IACI,UAGJI,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