@adyen/bento-vue2 1.1.0 → 1.2.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 (299) hide show
  1. package/dist/@types/packages/vue2/src/components/alert/alert.vue.d.ts +15 -11
  2. package/dist/@types/packages/vue2/src/components/avatar-image/avatar-image.vue.d.ts +1 -1
  3. package/dist/@types/packages/vue2/src/components/button/button.vue.d.ts +14 -14
  4. package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.types.d.ts +2 -2
  5. package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.vue.d.ts +4 -4
  6. package/dist/@types/packages/vue2/src/components/button/components/loading-button/loading-button.vue.d.ts +4 -4
  7. package/dist/@types/packages/vue2/src/components/button/index.d.ts +1 -1
  8. package/dist/@types/packages/vue2/src/components/card/card.vue.d.ts +20 -16
  9. package/dist/@types/packages/vue2/src/components/checkbox/checkbox.vue.d.ts +1 -1
  10. package/dist/@types/packages/vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue.d.ts +3 -3
  11. package/dist/@types/packages/vue2/src/components/code-snippet/code-snippet.vue.d.ts +13 -9
  12. package/dist/@types/packages/vue2/src/components/code-snippet/composables/useLanguage.d.ts +2 -2
  13. package/dist/@types/packages/vue2/src/components/country/composables/useCountryCapital/useCountryCapital.d.ts +1 -1
  14. package/dist/@types/packages/vue2/src/components/country/composables/useCountryName/useCountryName.d.ts +1 -1
  15. package/dist/@types/packages/vue2/src/components/country/composables/useCountryPhoneCode/useCountryPhoneCode.d.ts +1 -1
  16. package/dist/@types/packages/vue2/src/components/country/country.vue.d.ts +9 -7
  17. package/dist/@types/packages/vue2/src/components/currency/currency.vue.d.ts +5 -5
  18. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns.vue.d.ts +3 -3
  19. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-config-settings/components/data-grid-config-settings-column-row/data-grid-config-settings-column-row.vue.d.ts +4 -4
  20. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-config-settings/data-grid-config-settings.vue.d.ts +4 -4
  21. package/dist/@types/packages/vue2/src/components/data-grid/composables/useCalculateColumnWidth/useCalculateColumnWidth.d.ts +1 -1
  22. package/dist/@types/packages/vue2/src/components/data-grid/composables/useColumnReorderer/useColumnReorderer.d.ts +1 -1
  23. package/dist/@types/packages/vue2/src/components/data-grid/composables/useConfigSettings/useConfigSettings.d.ts +1 -1
  24. package/dist/@types/packages/vue2/src/components/data-grid/data-grid.types.d.ts +1 -1
  25. package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +3 -3
  26. package/dist/@types/packages/vue2/src/components/date/date.vue.d.ts +7 -5
  27. package/dist/@types/packages/vue2/src/components/date-picker/date-picker.types.d.ts +2 -2
  28. package/dist/@types/packages/vue2/src/components/date-picker/date-picker.vue.d.ts +10 -10
  29. package/dist/@types/packages/vue2/src/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.vue.d.ts +13 -13
  30. package/dist/@types/packages/vue2/src/components/date-range-picker/composables/use-date-range-picker-calendar-text.d.ts +1 -1
  31. package/dist/@types/packages/vue2/src/components/date-range-picker/date-range-picker.types.d.ts +2 -2
  32. package/dist/@types/packages/vue2/src/components/date-range-picker/date-range-picker.vue.d.ts +10 -10
  33. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.types.d.ts +1 -1
  34. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue.d.ts +2 -2
  35. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-default-textbox/dropdown-default-textbox.vue.d.ts +1 -1
  36. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/composables/useDropdownOptionsListbox.d.ts +2 -2
  37. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +87 -85
  38. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-small-textbox/dropdown-small-textbox.vue.d.ts +2 -2
  39. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-avatar/dropdown-avatar.types.d.ts +1 -1
  40. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-avatar/dropdown-avatar.vue.d.ts +18 -16
  41. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/composables/useCountryItems.d.ts +3 -3
  42. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/dropdown-country.types.d.ts +2 -2
  43. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/dropdown-country.vue.d.ts +22 -20
  44. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-currency/dropdown-currency.types.d.ts +2 -2
  45. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-currency/dropdown-currency.vue.d.ts +17 -15
  46. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-payment-method/dropdown-payment-method.types.d.ts +2 -2
  47. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-payment-method/dropdown-payment-method.vue.d.ts +17 -15
  48. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-tag/dropdown-tag.types.d.ts +1 -1
  49. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-tag/dropdown-tag.vue.d.ts +8 -6
  50. package/dist/@types/packages/vue2/src/components/dropdown/composables/useDisplayValue.types.d.ts +1 -1
  51. package/dist/@types/packages/vue2/src/components/dropdown/composables/useDropdownSearchFilter.d.ts +1 -1
  52. package/dist/@types/packages/vue2/src/components/dropdown/dropdown.types.d.ts +2 -2
  53. package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +14 -12
  54. package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +26 -26
  55. package/dist/@types/packages/vue2/src/components/filter-bar/components/base-filter/base-filter.vue.d.ts +7 -7
  56. package/dist/@types/packages/vue2/src/components/filter-bar/components/base-filter-button/base-filter-button.vue.d.ts +2 -2
  57. package/dist/@types/packages/vue2/src/components/filter-bar/components/date-range-filter/date-range-filter.vue.d.ts +9 -9
  58. package/dist/@types/packages/vue2/src/components/filter-bar/components/range-filter/range-filter.vue.d.ts +1 -1
  59. package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/select-filter.vue.d.ts +2 -2
  60. package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-avatar-filter/select-avatar-filter.vue.d.ts +2 -2
  61. package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-country-filter/select-country-filter.vue.d.ts +8 -8
  62. package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-currency-filter/select-currency-filter.vue.d.ts +2 -2
  63. package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-payment-method-filter/select-payment-method-filter.vue.d.ts +2 -2
  64. package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-tag-filter/select-tag-filter.vue.d.ts +7 -7
  65. package/dist/@types/packages/vue2/src/components/filter-bar/filter-bar.types.d.ts +10 -10
  66. package/dist/@types/packages/vue2/src/components/filter-bar/filter-bar.vue.d.ts +2 -2
  67. package/dist/@types/packages/vue2/src/components/header/header.vue.d.ts +5 -5
  68. package/dist/@types/packages/vue2/src/components/info-icon/info-icon.vue.d.ts +8 -6
  69. package/dist/@types/packages/vue2/src/components/input-field/input-field.types.d.ts +1 -1
  70. package/dist/@types/packages/vue2/src/components/input-field/input-field.vue.d.ts +23 -15
  71. package/dist/@types/packages/vue2/src/components/internal/avatar/avatar.vue.d.ts +2 -2
  72. package/dist/@types/packages/vue2/src/components/internal/base-button/base-button.vue.d.ts +2 -2
  73. package/dist/@types/packages/vue2/src/components/internal/calendar/components/calendar-month/calendar-month.vue.d.ts +2 -2
  74. package/dist/@types/packages/vue2/src/components/internal/calendar/components/calendar-month/components/calendar-month-day/calendar-month-day.vue.d.ts +1 -1
  75. package/dist/@types/packages/vue2/src/components/internal/controls-group/controls-group.vue.d.ts +1 -1
  76. package/dist/@types/packages/vue2/src/components/internal/copy/copy.vue.d.ts +4 -4
  77. package/dist/@types/packages/vue2/src/components/internal/footer-actions/footer-actions.vue.d.ts +1 -1
  78. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/components/listbox-multi-select-category/listbox-multi-select-category.vue.d.ts +2 -2
  79. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/listbox-multi-select-options.vue.d.ts +2 -2
  80. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/listbox-multi-select.vue.d.ts +2 -2
  81. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-option/listbox-option.vue.d.ts +1 -1
  82. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-option-tag/listbox-option-tag.vue.d.ts +3 -3
  83. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-single-select/listbox-single-select.vue.d.ts +4 -4
  84. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-single-select-option/listbox-single-select-option.vue.d.ts +2 -2
  85. package/dist/@types/packages/vue2/src/components/internal/listbox/listbox.vue.d.ts +11 -9
  86. package/dist/@types/packages/vue2/src/components/link/index.d.ts +1 -1
  87. package/dist/@types/packages/vue2/src/components/link/link.vue.d.ts +3 -3
  88. package/dist/@types/packages/vue2/src/components/menu/components/menu-item/menu-item.types.d.ts +1 -1
  89. package/dist/@types/packages/vue2/src/components/menu/components/menu-item/menu-item.vue.d.ts +3 -3
  90. package/dist/@types/packages/vue2/src/components/menu/menu.vue.d.ts +5 -5
  91. package/dist/@types/packages/vue2/src/components/modal/components/base-modal/__mocks__/base-modal.vue.d.ts +3 -3
  92. package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.vue.d.ts +4 -4
  93. package/dist/@types/packages/vue2/src/components/modal/components/modal-default/modal-default.vue.d.ts +2 -2
  94. package/dist/@types/packages/vue2/src/components/modal/components/modal-dialog/modal-dialog.vue.d.ts +7 -7
  95. package/dist/@types/packages/vue2/src/components/modal/modal.vue.d.ts +24 -16
  96. package/dist/@types/packages/vue2/src/components/pagination/components/pagination-context/pagination-context.vue.d.ts +2 -2
  97. package/dist/@types/packages/vue2/src/components/pagination/components/pagination-controls/pagination-controls.vue.d.ts +1 -1
  98. package/dist/@types/packages/vue2/src/components/pagination/components/pagination-results-per-page/pagination-results-per-page.vue.d.ts +1 -1
  99. package/dist/@types/packages/vue2/src/components/payment-method/composables/usePaymentIcon.d.ts +1 -1
  100. package/dist/@types/packages/vue2/src/components/payment-method/payment-method.vue.d.ts +6 -4
  101. package/dist/@types/packages/vue2/src/components/popover/components/popover-dismiss-button/popover-dismiss-button.vue.d.ts +1 -1
  102. package/dist/@types/packages/vue2/src/components/popover/components/popover-title/popover-title.vue.d.ts +1 -1
  103. package/dist/@types/packages/vue2/src/components/popover/popover.vue.d.ts +12 -12
  104. package/dist/@types/packages/vue2/src/components/popper-container/popper-container.utils.d.ts +1 -1
  105. package/dist/@types/packages/vue2/src/components/popper-container/popper-container.vue.d.ts +4 -4
  106. package/dist/@types/packages/vue2/src/components/radio-group/components/radio-button/radio-button.vue.d.ts +1 -1
  107. package/dist/@types/packages/vue2/src/components/radio-group/radio-group.vue.d.ts +3 -3
  108. package/dist/@types/packages/vue2/src/components/search-bar/search-bar.vue.d.ts +62 -46
  109. package/dist/@types/packages/vue2/src/components/segmented-control/components/segmented-control-button/segmented-control-button.vue.d.ts +1 -1
  110. package/dist/@types/packages/vue2/src/components/status/status.vue.d.ts +3 -3
  111. package/dist/@types/packages/vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue.d.ts +2 -2
  112. package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item/summary-grid-item.vue.d.ts +38 -30
  113. package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-amount/summary-grid-item-amount.vue.d.ts +16 -10
  114. package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-numeric/summary-grid-item-numeric.vue.d.ts +16 -10
  115. package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-percentage/summary-grid-item-percentage.vue.d.ts +16 -10
  116. package/dist/@types/packages/vue2/src/components/summary-grid/summary-grid.types.d.ts +1 -1
  117. package/dist/@types/packages/vue2/src/components/tabs/tabs.vue.d.ts +1 -1
  118. package/dist/@types/packages/vue2/src/components/tag/tag.vue.d.ts +5 -5
  119. package/dist/@types/packages/vue2/src/components/textarea/textarea.vue.d.ts +8 -6
  120. package/dist/@types/packages/vue2/src/components/timeline/components/timeline-item/timeline-item.vue.d.ts +20 -20
  121. package/dist/@types/packages/vue2/src/components/timeline/timeline.types.d.ts +2 -2
  122. package/dist/@types/packages/vue2/src/components/toast/components/toast-item/toast-item.vue.d.ts +2 -2
  123. package/dist/@types/packages/vue2/src/components/toggle/toggle.types.d.ts +4 -0
  124. package/dist/@types/packages/vue2/src/components/toggle/toggle.vue.d.ts +9 -9
  125. package/dist/@types/packages/vue2/src/components/tooltip/tooltip.vue.d.ts +25 -25
  126. package/dist/@types/packages/vue2/src/components/typography/typography.vue.d.ts +6 -6
  127. package/dist/@types/packages/vue2/src/composables/initials.d.ts +1 -1
  128. package/dist/@types/packages/vue2/src/composables/use-checkbox-select-all/use-checkbox-select-all.d.ts +2 -2
  129. package/dist/@types/packages/vue2/src/composables/useDynamicImport.d.ts +1 -1
  130. package/dist/@types/packages/vue2/src/directives/click-outside/on-click-outside.d.ts +1 -1
  131. package/dist/@types/packages/vue2/src/directives/click-outside/types.d.ts +1 -1
  132. package/dist/@types/packages/vue2/src/directives/click-outside/useEventListener/index.d.ts +1 -1
  133. package/dist/@types/packages/vue2/src/directives/click-outside/utils.d.ts +1 -1
  134. package/dist/@types/packages/vue2/src/directives/tooltip/tooltip.types.d.ts +1 -1
  135. package/dist/@types/packages/vue2/src/plugins/toastController.d.ts +1 -1
  136. package/dist/@types/packages/vue2/src/types/index.d.ts +0 -1
  137. package/dist/@types/packages/vue2/src/types/listbox.d.ts +1 -1
  138. package/dist/@types/packages/vue2/src/utils/ts/aria-label.d.ts +1 -1
  139. package/dist/@types/packages/vue2/src/utils/ts/events.d.ts +1 -1
  140. package/dist/@types/packages/vue2/src/utils/ts/focus-trap.utils.d.ts +1 -1
  141. package/dist/accordion.js +1 -1
  142. package/dist/alert.js +34 -32
  143. package/dist/alert.js.map +1 -1
  144. package/dist/assets/button-actions.css +1 -1
  145. package/dist/assets/button.css +1 -1
  146. package/dist/assets/dropdown.css +1 -1
  147. package/dist/assets/index10.css +1 -1
  148. package/dist/assets/index11.css +1 -1
  149. package/dist/assets/index12.css +1 -1
  150. package/dist/assets/index13.css +1 -1
  151. package/dist/assets/index14.css +1 -1
  152. package/dist/assets/index15.css +1 -1
  153. package/dist/assets/index16.css +1 -1
  154. package/dist/assets/index17.css +1 -1
  155. package/dist/assets/index18.css +1 -1
  156. package/dist/assets/index19.css +1 -1
  157. package/dist/assets/index2.css +1 -1
  158. package/dist/assets/index20.css +1 -1
  159. package/dist/assets/index21.css +1 -1
  160. package/dist/assets/index22.css +1 -1
  161. package/dist/assets/index23.css +1 -1
  162. package/dist/assets/index24.css +1 -1
  163. package/dist/assets/index25.css +1 -1
  164. package/dist/assets/index26.css +1 -1
  165. package/dist/assets/index27.css +1 -1
  166. package/dist/assets/index28.css +1 -1
  167. package/dist/assets/index29.css +1 -1
  168. package/dist/assets/index3.css +1 -1
  169. package/dist/assets/index30.css +1 -1
  170. package/dist/assets/index31.css +1 -1
  171. package/dist/assets/index32.css +1 -1
  172. package/dist/assets/index33.css +1 -1
  173. package/dist/assets/index34.css +1 -1
  174. package/dist/assets/index35.css +1 -1
  175. package/dist/assets/index36.css +1 -1
  176. package/dist/assets/index37.css +1 -1
  177. package/dist/assets/index38.css +1 -1
  178. package/dist/assets/index39.css +1 -1
  179. package/dist/assets/index4.css +1 -1
  180. package/dist/assets/index5.css +1 -1
  181. package/dist/assets/index6.css +1 -1
  182. package/dist/assets/index7.css +1 -1
  183. package/dist/assets/index8.css +1 -1
  184. package/dist/assets/index9.css +1 -1
  185. package/dist/assets/listbox.css +1 -1
  186. package/dist/avatar-image.js +1 -1
  187. package/dist/button.js +3 -3
  188. package/dist/card.js +60 -51
  189. package/dist/card.js.map +1 -1
  190. package/dist/checkbox.js +10 -10
  191. package/dist/checkbox.js.map +1 -1
  192. package/dist/chunks/{base-button.e7630a1d.js → base-button.d4487ac9.js} +2 -2
  193. package/dist/chunks/{base-button.e7630a1d.js.map → base-button.d4487ac9.js.map} +1 -1
  194. package/dist/chunks/{button-actions.03751d96.js → button-actions.cf73ed47.js} +10 -10
  195. package/dist/chunks/{button-actions.03751d96.js.map → button-actions.cf73ed47.js.map} +1 -1
  196. package/dist/chunks/{button.f64585fc.js → button.c27a7ce2.js} +11 -11
  197. package/dist/chunks/button.c27a7ce2.js.map +1 -0
  198. package/dist/chunks/{calendar.c9cfce76.js → calendar.8f50a65a.js} +4 -4
  199. package/dist/chunks/{calendar.c9cfce76.js.map → calendar.8f50a65a.js.map} +1 -1
  200. package/dist/chunks/{checkbox.27fae2af.js → checkbox.c06daf12.js} +3 -3
  201. package/dist/chunks/{checkbox.27fae2af.js.map → checkbox.c06daf12.js.map} +1 -1
  202. package/dist/chunks/{controls-group.e4745546.js → controls-group.9d58a091.js} +2 -2
  203. package/dist/chunks/{controls-group.e4745546.js.map → controls-group.9d58a091.js.map} +1 -1
  204. package/dist/chunks/{copy.888486ff.js → copy.b62beae5.js} +3 -3
  205. package/dist/chunks/{copy.888486ff.js.map → copy.b62beae5.js.map} +1 -1
  206. package/dist/chunks/{dropdown-default-textbox.e425fc5b.js → dropdown-default-textbox.a5eca928.js} +2 -2
  207. package/dist/chunks/{dropdown-default-textbox.e425fc5b.js.map → dropdown-default-textbox.a5eca928.js.map} +1 -1
  208. package/dist/chunks/{dropdown.e298bb6c.js → dropdown.368486b1.js} +60 -58
  209. package/dist/chunks/dropdown.368486b1.js.map +1 -0
  210. package/dist/chunks/{error-message.4269d92b.js → error-message.a581a172.js} +2 -2
  211. package/dist/chunks/{error-message.4269d92b.js.map → error-message.a581a172.js.map} +1 -1
  212. package/dist/chunks/{index.e1fcc9e0.js → index.175f9e2d.js} +3 -3
  213. package/dist/chunks/index.175f9e2d.js.map +1 -0
  214. package/dist/chunks/{index.ada08445.js → index.3b6fc08a.js} +6 -6
  215. package/dist/chunks/{index.ada08445.js.map → index.3b6fc08a.js.map} +1 -1
  216. package/dist/chunks/{index.7bbd6611.js → index.3dfea3bd.js} +3 -3
  217. package/dist/chunks/{index.7bbd6611.js.map → index.3dfea3bd.js.map} +1 -1
  218. package/dist/chunks/{index.96e2f563.js → index.ad39b625.js} +2 -2
  219. package/dist/chunks/{index.96e2f563.js.map → index.ad39b625.js.map} +1 -1
  220. package/dist/chunks/{index.8d590c55.js → index.d07f9800.js} +33 -32
  221. package/dist/chunks/{index.8d590c55.js.map → index.d07f9800.js.map} +1 -1
  222. package/dist/chunks/{index.bc51abe9.js → index.f0d99471.js} +8 -8
  223. package/dist/chunks/{index.bc51abe9.js.map → index.f0d99471.js.map} +1 -1
  224. package/dist/chunks/{listbox-option-tag.aae99730.js → listbox-option-tag.c7e9a228.js} +3 -3
  225. package/dist/chunks/{listbox-option-tag.aae99730.js.map → listbox-option-tag.c7e9a228.js.map} +1 -1
  226. package/dist/chunks/{listbox.99d23071.js → listbox.f51e92cd.js} +28 -27
  227. package/dist/chunks/{listbox.99d23071.js.map → listbox.f51e92cd.js.map} +1 -1
  228. package/dist/chunks/{loading-button.f7768964.js → loading-button.6d34f66f.js} +2 -2
  229. package/dist/chunks/{loading-button.f7768964.js.map → loading-button.6d34f66f.js.map} +1 -1
  230. package/dist/chunks/{tooltip.1e7cda50.js → tooltip.9af34fba.js} +2 -2
  231. package/dist/chunks/{tooltip.1e7cda50.js.map → tooltip.9af34fba.js.map} +1 -1
  232. package/dist/chunks/useCountryItems.5d7b436e.js.map +1 -1
  233. package/dist/code-snippet.js +132 -130
  234. package/dist/code-snippet.js.map +1 -1
  235. package/dist/country.js +17 -16
  236. package/dist/country.js.map +1 -1
  237. package/dist/currency.js +1 -1
  238. package/dist/currency.js.map +1 -1
  239. package/dist/data-grid.js +112 -112
  240. package/dist/data-grid.js.map +1 -1
  241. package/dist/date-picker.js +7 -7
  242. package/dist/date-range-picker.js +2 -2
  243. package/dist/date.js +1 -1
  244. package/dist/divider.js +1 -1
  245. package/dist/dropdown.js +3 -3
  246. package/dist/dropdown.js.map +1 -1
  247. package/dist/filter-bar.js +13 -13
  248. package/dist/filter-bar.js.map +1 -1
  249. package/dist/focus-trap.js +1 -1
  250. package/dist/header.js +30 -30
  251. package/dist/header.js.map +1 -1
  252. package/dist/index.js +147 -147
  253. package/dist/info-icon.js +13 -12
  254. package/dist/info-icon.js.map +1 -1
  255. package/dist/input-field.js +45 -41
  256. package/dist/input-field.js.map +1 -1
  257. package/dist/internal.js +6 -6
  258. package/dist/link.js +12 -12
  259. package/dist/link.js.map +1 -1
  260. package/dist/loading-indicator.js +1 -1
  261. package/dist/menu.js +5 -5
  262. package/dist/menu.js.map +1 -1
  263. package/dist/modal.js +85 -81
  264. package/dist/modal.js.map +1 -1
  265. package/dist/pagination.js +4 -4
  266. package/dist/payment-method.js +12 -11
  267. package/dist/payment-method.js.map +1 -1
  268. package/dist/popover.js +5 -5
  269. package/dist/popover.js.map +1 -1
  270. package/dist/popper-container.js +14 -14
  271. package/dist/popper-container.js.map +1 -1
  272. package/dist/radio-group.js +14 -14
  273. package/dist/radio-group.js.map +1 -1
  274. package/dist/search-bar.js +2 -2
  275. package/dist/segmented-control.js +4 -4
  276. package/dist/status.js +9 -9
  277. package/dist/status.js.map +1 -1
  278. package/dist/structured-list.js +1 -1
  279. package/dist/summary-grid.js +101 -88
  280. package/dist/summary-grid.js.map +1 -1
  281. package/dist/tabs.js +2 -2
  282. package/dist/tag.js +13 -13
  283. package/dist/tag.js.map +1 -1
  284. package/dist/textarea.js +27 -23
  285. package/dist/textarea.js.map +1 -1
  286. package/dist/timeline.js +6 -6
  287. package/dist/timeline.js.map +1 -1
  288. package/dist/toast.js +3 -3
  289. package/dist/toggle.js +117 -2
  290. package/dist/toggle.js.map +1 -1
  291. package/dist/typography.js +1 -1
  292. package/dist/web-types.json +60 -60
  293. package/package.json +4 -3
  294. package/dist/@types/packages/vue2/src/types/label-position.d.ts +0 -4
  295. package/dist/chunks/button.f64585fc.js.map +0 -1
  296. package/dist/chunks/dropdown.e298bb6c.js.map +0 -1
  297. package/dist/chunks/index.4ec4409f.js +0 -121
  298. package/dist/chunks/index.4ec4409f.js.map +0 -1
  299. package/dist/chunks/index.e1fcc9e0.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"listbox.99d23071.js","sources":["../../src/composables/use-checkbox-select-all/use-checkbox-select-all.ts","../../src/types/listbox.ts","../../src/components/internal/listbox/components/listbox-option/listbox-option.vue","../../../../node_modules/@adyen/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/components/listbox-multi-select/listbox-multi-select.vue","../../src/components/internal/listbox/listbox.vue"],"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 { BentoSearchBarItem } from '@/components/search-bar';\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 items?: Array<BentoListboxOptionItem>; // Reference itself for multi-level options\n}\n\nexport type BentoListboxSelectedValue = BentoListboxValue | BentoListboxMultiSelectValue;\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\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","<template>\n <label\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 </label>\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\" 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\" fill-rule=\"evenodd\" d=\"M14.5303 4.53033C14.8232 4.23744 14.8232 3.76256 14.5303 3.46967C14.2374 3.17678 13.7626 3.17678 13.4697 3.46967L6 10.9393L2.53033 7.46967C2.23744 7.17678 1.76256 7.17678 1.46967 7.46967C1.17678 7.76256 1.17678 8.23744 1.46967 8.53033L5.46967 12.5303C5.50628 12.5669 5.54574 12.599 5.58732 12.6264C5.87844 12.8186 6.27405 12.7866 6.53033 12.5303L14.5303 4.53033Z\" clip-rule=\"evenodd\"/></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 scoped lang=\"scss\">\n svg {\n display: inline-flex;\n flex-shrink: 0;\n }\n \n svg,\n svg * {\n fill: currentcolor;\n }\n</style>\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 @[BentoListboxEvent.ENTER]=\"onOptionSelected(BentoListboxEvent.ENTER)\"\n @[BentoListboxEvent.SPACE]=\"onOptionSelected(BentoListboxEvent.SPACE)\"\n @[BentoListboxEvent.TAB]=\"onOptionSelected(BentoListboxEvent.TAB)\"\n >\n <slot v-bind=\"option\">\n <span class=\"b-listbox-single-select-option__text\">\n <bento-typography :el=\"BentoTypographyElement.SPAN\">{{ option.label }}</bento-typography>\n <bento-typography\n v-if=\"option.description\"\n class=\"b-listbox-single-select-option__description\"\n :el=\"BentoTypographyElement.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, BentoTypographyElement } 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.value);\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 BentoTypographyElement,\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, onMounted, ref } from 'vue';\n\nconst enum ListboxKeyboardNavigationMutationDirection {\n INCREASE = 'increase',\n DECREASE = 'decrease',\n}\n\nexport const useListboxKeyboardNavigation = ({ items, isOptionDisabled }, focusItem) => {\n const numberOfItems = computed(() => items.value.length - 1);\n const focusedIndex = ref(0);\n\n onMounted(() => {\n if (isOptionDisabled) {\n focusedIndex.value = items.value.findIndex(el => !isOptionDisabled(el));\n }\n });\n\n const isItemDisabled = (itemIndex: number) =>\n !isOptionDisabled || (!!isOptionDisabled && isOptionDisabled(items.value[itemIndex]));\n\n const isItemEnabled = (itemIndex: number) =>\n !isOptionDisabled || (!!isOptionDisabled && !isOptionDisabled(items.value[itemIndex]));\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, isItemBeforeEdgeCaseItem }, callback, direction) => {\n const isEdgeCaseItem = focusedIndex.value === edgeCaseItem;\n if (isEdgeCaseItem) {\n return;\n }\n if (isItemBeforeEdgeCaseItem) {\n if (isItemEnabled(edgeCaseItem)) {\n mutateFocusedIndex(direction);\n }\n } else {\n mutateFocusedIndex(direction);\n if (isItemDisabled(focusedIndex.value)) {\n callback();\n }\n }\n focusItem(focusedIndex.value);\n };\n\n const moveToNextElement = () => {\n const isIndexSecondToLastItemInArray = focusedIndex.value === numberOfItems.value - 2;\n calculateFocusedIndex(\n {\n isItemBeforeEdgeCaseItem: isIndexSecondToLastItemInArray,\n edgeCaseItem: numberOfItems.value,\n },\n moveToNextElement,\n ListboxKeyboardNavigationMutationDirection.INCREASE\n );\n };\n\n const moveToPreviousElement = () => {\n const IsIndexSecondItemInArray = focusedIndex.value === 1;\n calculateFocusedIndex(\n {\n edgeCaseItem: 0,\n isItemBeforeEdgeCaseItem: IsIndexSecondItemInArray,\n },\n moveToPreviousElement,\n ListboxKeyboardNavigationMutationDirection.DECREASE\n );\n };\n\n const moveToFirstElement = () => {\n focusedIndex.value = 0;\n if (isItemDisabled(focusedIndex.value)) {\n moveToNextElement();\n } else {\n focusItem(focusedIndex.value);\n }\n };\n\n const moveToLastElement = () => {\n focusedIndex.value = numberOfItems.value;\n if (isItemDisabled(focusedIndex.value)) {\n moveToPreviousElement();\n } else {\n focusItem(focusedIndex.value);\n }\n };\n\n return {\n moveToFirstElement,\n moveToLastElement,\n moveToNextElement,\n moveToPreviousElement,\n };\n};\n","<template>\n <div v-bento-keyboard-navigation-directive v-on=\"listboxListeners\">\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 === selectedValue\"\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 </div>\n</template>\n<script lang=\"ts\">\n import { defineComponent, PropType, ref, toRef } from 'vue';\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 BentoListboxSelectedValue,\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 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: [String, Number] as PropType<BentoListboxSelectedValue>,\n default: undefined,\n },\n },\n emits: [BentoListboxEvent.SELECT, BentoListboxEvent.ENTER, BentoListboxEvent.SPACE, BentoListboxEvent.TAB],\n setup(props, { emit, slots }) {\n const listboxItemRef = ref([]);\n\n const onOptionSelected = eventName => (selectedValue: BentoListboxSelectedValue) => {\n emit(eventName, selectedValue);\n };\n\n const focusItem = (nextFocusedItemIndex: number) => listboxItemRef.value[nextFocusedItemIndex].$el.focus();\n\n // Keyboard navigation\n const { moveToNextElement, moveToPreviousElement, moveToFirstElement, moveToLastElement } =\n useListboxKeyboardNavigation(\n {\n items: toRef(props, 'items'),\n isOptionDisabled: props.isOptionDisabled,\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 return {\n // Enums\n BentoListboxEvent,\n\n // Values\n listboxItemRef,\n slots,\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}\n\nexport enum ListboxMultiSelectCategoryEvent {\n SELECT_CATEGORY = 'select-category',\n UNSELECT_CATEGORY = 'unselect-category',\n}\n","<template>\n <div>\n <bento-listbox-option class=\"b-listbox-multi-select-category__option\" :class=\"conditionalClass\">\n <bento-checkbox\n :model-value=\"isAllSelected\"\n :indeterminate=\"isIndeterminate\"\n :disabled=\"hasAllPropsDisabled\"\n :aria-label=\"category.label\"\n :value=\"category.value\"\n @update:model-value=\"toggleSelectAll\"\n />\n <span class=\"b-listbox-multi-select-category__label\">\n <bento-typography :el=\"BentoTypographyElement.SPAN\" class=\"b-listbox-multi-select-category__label-text\">\n {{ category.label }}\n </bento-typography>\n <div\n class=\"b-listbox-multi-select-category__label-chevron\"\n data-testid=\"toggle-listbox\"\n @click.capture=\"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=\"isOpen\">\n <slot />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref } from 'vue';\n import { BentoCheckbox } from '@/components/checkbox';\n import { BentoTypography, BentoTypographyElement } 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 emits: [ListboxMultiSelectCategoryEvent.SELECT_CATEGORY, ListboxMultiSelectCategoryEvent.UNSELECT_CATEGORY],\n setup(props, { emit }) {\n const isOpen = ref(false);\n const { t } = useI18n();\n\n const hasAllPropsDisabled = computed(() =>\n props.category.items.every(option => props.isOptionDisabled(option))\n );\n\n const conditionalClass = computed(() => ({\n [`b-listbox-multi-select-category--${ListboxMultiSelectCategoryClass.DISABLED}`]:\n hasAllPropsDisabled.value,\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 = props.isOptionDisabled(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 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 return {\n // Values\n chevronTitle,\n conditionalClass,\n hasAllPropsDisabled,\n isOpen,\n isAllSelected,\n isIndeterminate,\n\n // Enums\n BentoTypographyElement,\n\n // Methods\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 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 >\n <bento-checkbox\n :model-value=\"isOptionSelected(option)\"\n :aria-label=\"option.label\"\n :disabled=\"isOptionDisabled ? isOptionDisabled(option) : null\"\n :value=\"option.value\"\n @update:model-value=\"value => selectSearch(value, option)\"\n />\n <slot v-bind=\"option\">\n <span class=\"b-listbox-multi-select__option-text\">\n <bento-typography :el=\"BentoTypographyElement.SPAN\">{{ option.label }}</bento-typography>\n <bento-typography\n v-if=\"shouldShowDescription(option)\"\n class=\"b-listbox-multi-select__option-description\"\n :el=\"BentoTypographyElement.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 :is-option-disabled=\"isOptionDisabled\"\n :selected-items-list=\"selectedItemsList\"\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 :is-multi-level=\"isMultiLevel\"\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 >\n <bento-checkbox\n :model-value=\"selectedItemsList\"\n :aria-label=\"option.label\"\n :disabled=\"isOptionDisabled ? isOptionDisabled(option) : null\"\n :value=\"option.value\"\n @update:model-value=\"toggleCheckboxSelection(option.value)\"\n />\n <slot v-bind=\"option\">\n <span class=\"b-listbox-multi-select__option-text\">\n <bento-typography :el=\"BentoTypographyElement.SPAN\">{{ option.label }}</bento-typography>\n <bento-typography\n v-if=\"shouldShowDescription(option)\"\n class=\"b-listbox-multi-select__option-description\"\n :el=\"BentoTypographyElement.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, BentoTypographyElement } 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 * 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 emits: [\n ListboxMultiSelectOptionsEvent.TOGGLE_CHECKBOX_SELECTION,\n ListboxMultiSelectOptionsEvent.SELECT_CATEGORY,\n ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY,\n ],\n setup(props, { emit }) {\n const toggleCheckboxSelection = (value: BentoListboxValue) => {\n emit(ListboxMultiSelectOptionsEvent.TOGGLE_CHECKBOX_SELECTION, value);\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 // eslint-disable-next-line consistent-return\n const selectSearch = (selectedValue, option) => {\n if (isCategory(option)) {\n return selectedValue\n ? emit(ListboxMultiSelectOptionsEvent.SELECT_CATEGORY, option)\n : emit(ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY, option);\n }\n\n toggleCheckboxSelection(option.value);\n };\n\n const conditionalClasses = computed(() => ({\n 'b-listbox-multi-select-options__category-option': props.categoryItems,\n }));\n\n return {\n // Values\n conditionalClasses,\n\n // Methods\n isCategory,\n isOptionSelected,\n shouldShowDescription,\n toggleCheckboxSelection,\n selectSearch,\n\n // Enums\n BentoListboxEvent,\n BentoTypographyElement,\n ListboxMultiSelectOptionsEvent,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./listbox-multi-select-options.scss\" />\n","<template>\n <div v-bento-keyboard-navigation-directive class=\"b-listbox-multi-select\" v-on=\"listboxListeners\">\n <!-- Select all -->\n <bento-listbox-option ref=\"selectAllListboxItemsRef\" class=\"b-listbox-multi-select__option\">\n <bento-checkbox\n :aria-label=\"selectAllCheckboxText\"\n :model-value=\"isAllSelected\"\n :indeterminate=\"isIndeterminate\"\n @update:model-value=\"toggleSelectAll\"\n />\n <bento-typography :el=\"BentoTypographyElement.SPAN\">\n {{ selectAllCheckboxText }}\n </bento-typography>\n </bento-listbox-option>\n\n <!-- Selected options -->\n <div v-if=\"isAnOptionSelected\">\n <hr class=\"b-listbox-multi-select__divider\" />\n\n <listbox-multi-select-options\n ref=\"selectedListboxItemsRef\"\n :items=\"selectedOptions\"\n :is-option-disabled=\"isOptionDisabled\"\n :is-multi-level=\"isMultiLevelSelect\"\n :searching=\"searching\"\n :selected-items-list=\"selectedItemsList\"\n @select-category=\"selectAllCategory\"\n @unselect-category=\"unselectAllCategory\"\n @toggle-checkbox-selection=\"toggleCheckboxSelection(BentoListboxEvent.SELECT, $event)\"\n @[BentoListboxEvent.SPACE]=\"toggleCheckboxSelection(BentoListboxEvent.SPACE, $event)\"\n @[BentoListboxEvent.TAB]=\"toggleCheckboxSelection(BentoListboxEvent.TAB, $event)\"\n @[BentoListboxEvent.ENTER]=\"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\n <!-- Available options -->\n <div v-show=\"!isAllItemsIncludingDisabled\">\n <hr class=\"b-listbox-multi-select__divider\" />\n\n <listbox-multi-select-options\n ref=\"listboxItemsRef\"\n :items=\"items\"\n :is-option-disabled=\"isOptionDisabled\"\n :is-multi-level=\"isMultiLevelSelect\"\n :searching=\"searching\"\n :selected-items-list=\"selectedItemsList\"\n @toggle-checkbox-selection=\"toggleCheckboxSelection(BentoListboxEvent.SELECT, $event)\"\n @select-category=\"selectAllCategory\"\n @unselect-category=\"unselectAllCategory\"\n @[BentoListboxEvent.SPACE]=\"toggleCheckboxSelection(BentoListboxEvent.SPACE, $event)\"\n @[BentoListboxEvent.TAB]=\"toggleCheckboxSelection(BentoListboxEvent.TAB, $event)\"\n @[BentoListboxEvent.ENTER]=\"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 lang=\"ts\">\n import { computed, defineComponent, PropType, ref, watch } from 'vue';\n import { BentoCheckbox } from '@/components/checkbox';\n import { BentoListboxOption } from '../listbox-option';\n import { BentoTypography, BentoTypographyElement } from '@/components/typography';\n import { useCheckboxSelectAll } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import {\n BentoKeyboardNavigationKeyDownEvent,\n BentoListboxEvent,\n BentoListboxIsOptionDisabled,\n BentoListboxMultiSelectValue,\n BentoListboxOptionItem,\n BentoListboxOptions,\n BentoListboxSelectedValue,\n BentoListboxValue,\n } from '@/types';\n import { BentoKeyboardNavigationDirective } from '@/directives';\n import { ListboxMultiSelectOptions } from './components/listbox-multi-select-options';\n\n import messages from './messages.json';\n import { useListboxKeyboardNavigation } from '../../composables/useListboxKeyboardNavigation';\n\n type MessageSchema = (typeof messages)['en-US'];\n\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 defineComponent({\n i18n: { messages },\n name: 'bento-listbox-multi-select',\n components: {\n BentoCheckbox,\n BentoListboxOption,\n BentoTypography,\n ListboxMultiSelectOptions,\n },\n directives: { BentoKeyboardNavigationDirective },\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 * 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 * The `input` value.\n * Providing an empty array will select no options.\n */\n selectedValues: {\n type: Array as PropType<BentoListboxSelectedValue>,\n default: () => [] as BentoListboxSelectedValue,\n },\n },\n emits: [BentoListboxEvent.SELECT],\n setup(props, { emit, slots }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const selectAllListboxItemsRef = ref(null);\n const selectedListboxItemsRef = ref(null);\n const listboxItemsRef = ref(null);\n\n const selectedItemsList = ref();\n watch(\n () => props.selectedValues,\n () => {\n selectedItemsList.value = ([...((props.selectedValues as Array<unknown>) ?? [])] ||\n []) as BentoListboxMultiSelectValue;\n },\n {\n immediate: true,\n }\n );\n\n const isMultiLevelSelect = computed(() => !!props.items.find(({ items }) => !!items));\n\n const flattenedItemsList = computed(() => {\n if (isMultiLevelSelect.value) {\n return props.items.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 props.items;\n });\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 props.searching && isMultiLevelSelect\n ? props.items\n : flattenedItemsList.value.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(option => {\n if (option.items && isMultiLevelSelect.value && props.searching) {\n const amountOfSelectedCategoryOptions = option.items.filter(categoryOption =>\n ((props.selectedValues as Array<BentoListboxSelectedValue>) ?? []).includes(\n categoryOption.value\n )\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 enabledItems.value.length;\n }\n\n return props.items.length;\n };\n\n const selectAllCheckboxText = computed(() => {\n const total = calculateTotalItems();\n const amountSelectedValues = visibleSelectedList.value?.length || 0;\n\n if (amountSelectedValues === 0) {\n return t('selectAll', { total });\n }\n\n return amountSelectedValues === total\n ? t('allSelected', { total })\n : t('numberOfTotalSelected', { number: amountSelectedValues, total });\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 .map(({ value }) => value);\n\n selectedItemsList.value = [...selectedItemsList.value, ...addOrRemoveList];\n emit(BentoListboxEvent.SELECT, selectedItemsList.value);\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\n .filter(findEnabledUnselectedItems)\n .map(({ value }) => value);\n selectedItemsList.value = selectedItemsList.value.filter(item => !unselectedItemsList?.includes(item));\n emit(BentoListboxEvent.SELECT, selectedItemsList.value);\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 selectAllCategory = (category: BentoListboxOptionItem) => {\n selectAll(category.items);\n };\n\n const unselectAllCategory = (category: BentoListboxOptionItem) => {\n unselectAll(category.items);\n };\n\n const toggleCheckboxSelection = (eventName, value: BentoListboxValue) => {\n let exists = false;\n selectedItemsList.value = selectedItemsList.value.filter(option => {\n if (value === option) {\n exists = true;\n return false;\n }\n\n return true;\n });\n\n if (!exists) {\n selectedItemsList.value.push(value);\n }\n emit(eventName, selectedItemsList.value);\n };\n\n const selectedOptions = computed(() => {\n const isOptionSelected = option =>\n (selectedItemsList.value as unknown as Array<string | number>).includes(option.value);\n const categoryOptionsSelected = categoryOptions =>\n !!categoryOptions.find(option => isOptionSelected(option));\n\n const options = props.items.filter(option => {\n // Check selected categories category\n if (option.items && categoryOptionsSelected(option.items)) {\n return true;\n }\n\n return isOptionSelected(option);\n });\n return options;\n });\n\n const isAnOptionSelected = computed(() => selectedOptions.value?.length > 0);\n\n const isAllItemsIncludingDisabled = computed(\n () => visibleSelectedList.value?.length === flattenedItemsList.value?.length\n );\n\n const computedSelectAllListboxItemsRefs = computed(() =>\n selectAllListboxItemsRef.value ? [selectAllListboxItemsRef.value] : []\n );\n\n // Keyboard navigation\n const computedselectedListboxItemsRefs = computed(() =>\n selectedListboxItemsRef.value?.$children?.length ? selectedListboxItemsRef.value.$children : []\n );\n\n const computedlistboxItems = computed(() =>\n listboxItemsRef.value?.$children?.length ? listboxItemsRef.value.$children : []\n );\n\n const computedselectAllItemRefs = computed(() => ({ label: selectAllCheckboxText, value: isAllSelected }));\n\n const computedItems = computed(() => [\n computedselectAllItemRefs,\n ...selectedOptions.value,\n ...flattenedItemsList.value,\n ]);\n\n const focusItem = (nextFocusedItemIndex: number) => {\n const multiSelectListboxItems = [\n ...computedSelectAllListboxItemsRefs.value,\n ...computedselectedListboxItemsRefs.value,\n ...computedlistboxItems.value,\n ];\n multiSelectListboxItems[nextFocusedItemIndex].$el.focus();\n };\n\n const { moveToNextElement, moveToPreviousElement, moveToFirstElement, moveToLastElement } =\n useListboxKeyboardNavigation(\n {\n items: ref(computedItems),\n isOptionDisabled: props.isOptionDisabled,\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 return {\n // Refs\n selectAllListboxItemsRef,\n selectedListboxItemsRef,\n listboxItemsRef,\n\n // Values\n isAllSelected,\n isAllItemsIncludingDisabled,\n isAnOptionSelected,\n isIndeterminate,\n isMultiLevelSelect,\n flattenedItemsList,\n selectedItemsList,\n selectAllCheckboxText,\n selectedOptions,\n slots,\n\n // Enums\n BentoTypographyElement,\n BentoListboxEvent,\n\n // Methods\n selectAllCategory,\n toggleCheckboxSelection,\n toggleSelectAll,\n unselectAllCategory,\n\n // Events\n listboxListeners,\n };\n },\n });\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 @scroll=\"() => (hasAutomaticLazyLoader ? emitShowMoreOnScrollEnd() : undefined)\"\n >\n <!-- Empty search message -->\n <div v-if=\"isSearchResultEmpty\" class=\"b-listbox__empty-search-message\">\n <bento-typography :el=\"BentoTypographyElement.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 :items=\"items\"\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=\"items\"\n :selected-value=\"selectedValue\"\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 <div v-if=\"shouldDisplayShowMoreButton\" class=\"b-listbox__lazy-load\">\n <bento-loading-button\n :state=\"loadingButtonState\"\n :variant=\"BentoButtonVariant.SECONDARY\"\n @click=\"emitShowMore\"\n >\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</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref } from 'vue';\n import {\n BentoKeyboardNavigationKeyDownEvent,\n BentoListboxEvent,\n BentoListboxIsOptionDisabled,\n BentoListboxLazyLoadType,\n BentoListboxOptions,\n BentoListboxSelectedValue,\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, BentoTypographyElement } from '@/components/typography';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import { BentoButtonVariant, BentoLoadingButton, BentoLoadingButtonState } from '@/components/button';\n import { useI18n } from '@/utils/ts/i18n';\n import { debounce } from '@/utils/ts/debounce';\n import type { HTMLAttributes } from 'vue/types/jsx';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\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 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 * 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 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>,\n default: BentoListboxLazyLoadType.NONE,\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 * 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: [String, Number, Array] as PropType<BentoListboxSelectedValue>,\n default: undefined,\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 { t } = useI18n<{ message: MessageSchema }>({ messages });\n const listboxRef = ref(null);\n const listboxItemRef = ref([]);\n const isLazyLoadListbox = computed(() => props.lazyLoadType !== BentoListboxLazyLoadType.AUTOMATIC);\n const hasAutomaticLazyLoader = computed(() => props.lazyLoadType === BentoListboxLazyLoadType.AUTOMATIC);\n\n // Aria a11y\n const ariaAtomic = computed<HTMLAttributes['aria-atomic']>(() =>\n isLazyLoadListbox.value ? 'true' : undefined\n );\n const ariaBusy = computed<HTMLAttributes['aria-busy']>(() =>\n isLazyLoadListbox.value && props.loading ? 'true' : 'false'\n );\n const ariaLive = computed<HTMLAttributes['aria-live']>(() =>\n isLazyLoadListbox.value ? 'polite' : undefined\n );\n\n const onOptionSelected = eventName => (selectedValue: BentoListboxSelectedValue) => {\n emit(eventName, selectedValue);\n };\n\n const emitShowMore = () => {\n emit(BentoListboxEvent.SHOW_MORE);\n };\n\n const emitShowMoreOnScrollEnd = debounce(() => {\n const container = listboxRef.value;\n const isAtBottom = container.scrollTop + container.clientHeight >= container.scrollHeight;\n\n if (props.hasMoreItems && isAtBottom && !props.loading) {\n emitShowMore();\n }\n });\n\n const isSearchResultEmpty = computed(() => props.searching && 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 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 hasAutomaticLazyLoader,\n isSearchResultEmpty,\n loadingButtonState,\n slots,\n shouldDisplayShowMoreButton,\n showMoreButtonText,\n\n // Enums\n BentoTypographyElement,\n BentoButtonVariant,\n BentoListboxLazyLoadType,\n BentoKeyboardNavigationKeyDownEvent,\n BentoListboxEvent,\n\n // Methods\n onOptionSelected,\n emitShowMoreOnScrollEnd,\n emitShowMore,\n listboxListeners,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./listbox.scss\" />\n"],"names":["useCheckboxSelectAll","selectedItemsList","items","selectAll","unselectAll","isAllSelected","computed","_a","_b","isIndeterminate","selectedValue","BentoListboxEvent","BentoListboxEvent2","BentoListboxLazyLoadType","BentoListboxLazyLoadType2","_sfc_main$7","defineComponent","props","emit","conditionalClasses","BentoKeyboardNavigationKeyDownEvent","e","eventName","uuid","_sfc_main$6","_sfc_main$5","BentoListboxOption","BentoTypography","CheckmarkIcon","onOptionSelected","ariaDisabled","ariaSelected","tabIndex","BentoTypographyElement","useListboxKeyboardNavigation","isOptionDisabled","focusItem","numberOfItems","focusedIndex","ref","onMounted","el","isItemDisabled","itemIndex","isItemEnabled","mutateFocusedIndex","direction","calculateFocusedIndex","edgeCaseItem","isItemBeforeEdgeCaseItem","callback","moveToNextElement","isIndexSecondToLastItemInArray","moveToPreviousElement","IsIndexSecondItemInArray","_sfc_main$4","BentoListboxSingleSelectOption","BentoKeyboardNavigationDirective","slots","listboxItemRef","nextFocusedItemIndex","moveToFirstElement","moveToLastElement","toRef","listboxListeners","listboxOptionListeners","ListboxMultiSelectCategoryClass","ListboxMultiSelectCategoryClass2","ListboxMultiSelectCategoryEvent","ListboxMultiSelectCategoryEvent2","_sfc_main$3","messages$2","BentoCheckbox","ChevronDownIcon","ChevronUpIcon","isOpen","t","useI18n","hasAllPropsDisabled","option","conditionalClass","toggleOpen","event","optionStates","isDisabled","isPreSelected","enabledItems","visibleSelectedList","value","chevronTitle","messageName","toggleSelectAll","ListboxMultiSelectOptionsEvent","ListboxMultiSelectOptionsEvent2","_sfc_main$2","ListboxMultiSelectCategory","toggleCheckboxSelection","isCategory","shouldShowDescription","isSearchingMultiLevel","isOptionSelected","item","selectSearch","_sfc_main$1","messages$1","ListboxMultiSelectOptions","selectAllListboxItemsRef","selectedListboxItemsRef","listboxItemsRef","watch","isMultiLevelSelect","flattenedItemsList","acc","val","categoryOption","calculateTotalItems","selectAllCheckboxText","total","amountSelectedValues","selectableItems","filterOutDisabledAndNotPreselectedOptions","addOrRemoveList","findEnabledUnselectedItems","unselectedItemsList","selectAllItems","unselectAllItems","selectAllCategory","category","unselectAllCategory","exists","selectedOptions","categoryOptionsSelected","categoryOptions","isAnOptionSelected","isAllItemsIncludingDisabled","computedSelectAllListboxItemsRefs","computedselectedListboxItemsRefs","computedlistboxItems","computedselectAllItemRefs","computedItems","_sfc_main","BentoListboxSingleSelect","BentoListboxMultiSelect","BentoLoadingIndicator","BentoLoadingButton","messages","listboxRef","isLazyLoadListbox","hasAutomaticLazyLoader","ariaAtomic","ariaBusy","ariaLive","emitShowMore","emitShowMoreOnScrollEnd","debounce","container","isAtBottom","isSearchResultEmpty","shouldDisplayShowMoreButton","loadingButtonState","BentoLoadingButtonState","showMoreButtonText","BentoButtonVariant"],"mappings":";;;;;;;;;;;AA8CO,MAAAA,IAAA,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,QAAAA,EAAA,MAAA,WAAA,IACI,OAGJM,IAAAN,EAAA,UAAA,gBAAAM,EAAA,YAAAL,EAAA,MAAA;AAAA,EAAuD,CAAA;AAW3D,SAAA;AAAA,IAAO,eAAAG;AAAA,IACH,iBAAAI;AAAA,IACA,iBAVJ,CAAAC,MAAA;AACI,MAAAA,IACIP,EAAA,IAEAC,EAAA;AAAA,IACJ;AAAA,EAOA;AAER;AC3DY,IAAAO,IAAA,kBAAAC,OACRA,EAAA,SAAA,UACAA,EAAA,YAAA,aACAA,EAAA,SAAA,kBACAA,EAAA,QAAA,SACAA,EAAA,QAAA,iBACAA,EAAA,QAAA,iBACAA,EAAA,MAAA,eACAA,EAAA,iBAAA,kBARQA,IAAAD,K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AAAA,MAAA,MAAAW,EAAA,UAAA+I,EAAA,UAAAA,EAAA;AAAA,IACA,GAGAC,IAAA3J,EAAA,MAAAW,EAAA,UAAA2D,EAAA,SAAA,IAAAA,EAAA,UAAA,CAAA,GAEAZ,IAAA;AAAA,MAAA,CAAArD,EAAA,MAAA,GAAAkB,EAAAlB,EAAA,MAAA;AAAA,MACA,CAAAA,EAAA,KAAA,GAAAkB,EAAAlB,EAAA,KAAA;AAAA,MACA,CAAAA,EAAA,GAAA,GAAAkB,EAAAlB,EAAA,GAAA;AAAA,MACA,CAAAA,EAAA,KAAA,GAAAkB,EAAAlB,EAAA,KAAA;AAAA,IACA;AAGA,WAAA;AAAA;AAAA,MAAA,YAAAuI;AAAA,MAEA,gBAAAvF;AAAA;AAAA,MACA,YAAA0F;AAAA,MAGA,UAAAC;AAAA,MACA,UAAAC;AAAA;AAAA,MACA,wBAAAH;AAAA,MAGA,qBAAAS;AAAA,MACA,oBAAAE;AAAA,MACA,OAAArG;AAAA,MACA,6BAAAoG;AAAA,MACA,oBAAAG;AAAA;AAAA,MACA,wBAAAhI;AAAA,MAGA,oBAAAiI;AAAA,MACA,0BAAArJ;AAAA,MACA,qCAAAO;AAAA,MACA,mBAAAT;AAAA;AAAA,MACA,kBAAAkB;AAAA,MAGA,yBAAA4H;AAAA,MACA,cAAAD;AAAA,MACA,kBAAAxF;AAAA,IACA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[3]}
1
+ {"version":3,"file":"listbox.f51e92cd.js","sources":["../../src/composables/use-checkbox-select-all/use-checkbox-select-all.ts","../../src/types/listbox.ts","../../src/components/internal/listbox/components/listbox-option/listbox-option.vue","../../../../node_modules/@adyen/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/components/listbox-multi-select/listbox-multi-select.vue","../../src/components/internal/listbox/listbox.vue"],"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 { BentoSearchBarItem } from '@/components/search-bar';\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 items?: Array<BentoListboxOptionItem>; // Reference itself for multi-level options\n}\n\nexport type BentoListboxSelectedValue = BentoListboxValue | BentoListboxMultiSelectValue;\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\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","<template>\n <label\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 </label>\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\" 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\" fill-rule=\"evenodd\" d=\"M14.5303 4.53033C14.8232 4.23744 14.8232 3.76256 14.5303 3.46967C14.2374 3.17678 13.7626 3.17678 13.4697 3.46967L6 10.9393L2.53033 7.46967C2.23744 7.17678 1.76256 7.17678 1.46967 7.46967C1.17678 7.76256 1.17678 8.23744 1.46967 8.53033L5.46967 12.5303C5.50628 12.5669 5.54574 12.599 5.58732 12.6264C5.87844 12.8186 6.27405 12.7866 6.53033 12.5303L14.5303 4.53033Z\" clip-rule=\"evenodd\"/></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 scoped lang=\"scss\">\n svg {\n display: inline-flex;\n flex-shrink: 0;\n }\n \n svg,\n svg * {\n fill: currentcolor;\n }\n</style>\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 @[BentoListboxEvent.ENTER]=\"onOptionSelected(BentoListboxEvent.ENTER)\"\n @[BentoListboxEvent.SPACE]=\"onOptionSelected(BentoListboxEvent.SPACE)\"\n @[BentoListboxEvent.TAB]=\"onOptionSelected(BentoListboxEvent.TAB)\"\n >\n <slot v-bind=\"option\">\n <span class=\"b-listbox-single-select-option__text\">\n <bento-typography :el=\"BentoTypographyElement.SPAN\">{{ option.label }}</bento-typography>\n <bento-typography\n v-if=\"option.description\"\n class=\"b-listbox-single-select-option__description\"\n :el=\"BentoTypographyElement.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, BentoTypographyElement } 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.value);\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 BentoTypographyElement,\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, onMounted, ref } from 'vue';\n\nconst enum ListboxKeyboardNavigationMutationDirection {\n INCREASE = 'increase',\n DECREASE = 'decrease',\n}\n\nexport const useListboxKeyboardNavigation = ({ items, isOptionDisabled }, focusItem) => {\n const numberOfItems = computed(() => items.value.length - 1);\n const focusedIndex = ref(0);\n\n onMounted(() => {\n if (isOptionDisabled) {\n focusedIndex.value = items.value.findIndex(el => !isOptionDisabled(el));\n }\n });\n\n const isItemDisabled = (itemIndex: number) =>\n !isOptionDisabled || (!!isOptionDisabled && isOptionDisabled(items.value[itemIndex]));\n\n const isItemEnabled = (itemIndex: number) =>\n !isOptionDisabled || (!!isOptionDisabled && !isOptionDisabled(items.value[itemIndex]));\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, isItemBeforeEdgeCaseItem }, callback, direction) => {\n const isEdgeCaseItem = focusedIndex.value === edgeCaseItem;\n if (isEdgeCaseItem) {\n return;\n }\n if (isItemBeforeEdgeCaseItem) {\n if (isItemEnabled(edgeCaseItem)) {\n mutateFocusedIndex(direction);\n }\n } else {\n mutateFocusedIndex(direction);\n if (isItemDisabled(focusedIndex.value)) {\n callback();\n }\n }\n focusItem(focusedIndex.value);\n };\n\n const moveToNextElement = () => {\n const isIndexSecondToLastItemInArray = focusedIndex.value === numberOfItems.value - 2;\n calculateFocusedIndex(\n {\n isItemBeforeEdgeCaseItem: isIndexSecondToLastItemInArray,\n edgeCaseItem: numberOfItems.value,\n },\n moveToNextElement,\n ListboxKeyboardNavigationMutationDirection.INCREASE\n );\n };\n\n const moveToPreviousElement = () => {\n const IsIndexSecondItemInArray = focusedIndex.value === 1;\n calculateFocusedIndex(\n {\n edgeCaseItem: 0,\n isItemBeforeEdgeCaseItem: IsIndexSecondItemInArray,\n },\n moveToPreviousElement,\n ListboxKeyboardNavigationMutationDirection.DECREASE\n );\n };\n\n const moveToFirstElement = () => {\n focusedIndex.value = 0;\n if (isItemDisabled(focusedIndex.value)) {\n moveToNextElement();\n } else {\n focusItem(focusedIndex.value);\n }\n };\n\n const moveToLastElement = () => {\n focusedIndex.value = numberOfItems.value;\n if (isItemDisabled(focusedIndex.value)) {\n moveToPreviousElement();\n } else {\n focusItem(focusedIndex.value);\n }\n };\n\n return {\n moveToFirstElement,\n moveToLastElement,\n moveToNextElement,\n moveToPreviousElement,\n };\n};\n","<template>\n <div v-bento-keyboard-navigation-directive v-on=\"listboxListeners\">\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 === selectedValue\"\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 </div>\n</template>\n<script lang=\"ts\">\n import { defineComponent, PropType, ref, toRef } from 'vue';\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 BentoListboxSelectedValue,\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 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: [String, Number] as PropType<BentoListboxSelectedValue>,\n default: undefined,\n },\n },\n emits: [BentoListboxEvent.SELECT, BentoListboxEvent.ENTER, BentoListboxEvent.SPACE, BentoListboxEvent.TAB],\n setup(props, { emit, slots }) {\n const listboxItemRef = ref([]);\n\n const onOptionSelected = eventName => (selectedValue: BentoListboxSelectedValue) => {\n emit(eventName, selectedValue);\n };\n\n const focusItem = (nextFocusedItemIndex: number) => listboxItemRef.value[nextFocusedItemIndex].$el.focus();\n\n // Keyboard navigation\n const { moveToNextElement, moveToPreviousElement, moveToFirstElement, moveToLastElement } =\n useListboxKeyboardNavigation(\n {\n items: toRef(props, 'items'),\n isOptionDisabled: props.isOptionDisabled,\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 return {\n // Enums\n BentoListboxEvent,\n\n // Values\n listboxItemRef,\n slots,\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}\n\nexport enum ListboxMultiSelectCategoryEvent {\n SELECT_CATEGORY = 'select-category',\n UNSELECT_CATEGORY = 'unselect-category',\n}\n","<template>\n <div>\n <bento-listbox-option class=\"b-listbox-multi-select-category__option\" :class=\"conditionalClass\">\n <bento-checkbox\n :model-value=\"isAllSelected\"\n :indeterminate=\"isIndeterminate\"\n :disabled=\"hasAllPropsDisabled\"\n :aria-label=\"category.label\"\n :value=\"category.value\"\n @update:model-value=\"toggleSelectAll\"\n />\n <span class=\"b-listbox-multi-select-category__label\">\n <bento-typography :el=\"BentoTypographyElement.SPAN\" class=\"b-listbox-multi-select-category__label-text\">\n {{ category.label }}\n </bento-typography>\n <div\n class=\"b-listbox-multi-select-category__label-chevron\"\n data-testid=\"toggle-listbox\"\n @click.capture=\"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=\"isOpen\">\n <slot />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref } from 'vue';\n import { BentoCheckbox } from '@/components/checkbox';\n import { BentoTypography, BentoTypographyElement } 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 emits: [ListboxMultiSelectCategoryEvent.SELECT_CATEGORY, ListboxMultiSelectCategoryEvent.UNSELECT_CATEGORY],\n setup(props, { emit }) {\n const isOpen = ref(false);\n const { t } = useI18n();\n\n const hasAllPropsDisabled = computed(() =>\n props.category.items.every(option => props.isOptionDisabled(option))\n );\n\n const conditionalClass = computed(() => ({\n [`b-listbox-multi-select-category--${ListboxMultiSelectCategoryClass.DISABLED}`]:\n hasAllPropsDisabled.value,\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 = props.isOptionDisabled(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 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 return {\n // Values\n chevronTitle,\n conditionalClass,\n hasAllPropsDisabled,\n isOpen,\n isAllSelected,\n isIndeterminate,\n\n // Enums\n BentoTypographyElement,\n\n // Methods\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 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 >\n <bento-checkbox\n :model-value=\"isOptionSelected(option)\"\n :aria-label=\"option.label\"\n :disabled=\"isOptionDisabled ? isOptionDisabled(option) : null\"\n :value=\"option.value\"\n @update:model-value=\"value => selectSearch(value, option)\"\n />\n <slot v-bind=\"option\">\n <span class=\"b-listbox-multi-select__option-text\">\n <bento-typography :el=\"BentoTypographyElement.SPAN\">{{ option.label }}</bento-typography>\n <bento-typography\n v-if=\"shouldShowDescription(option)\"\n class=\"b-listbox-multi-select__option-description\"\n :el=\"BentoTypographyElement.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 :is-option-disabled=\"isOptionDisabled\"\n :selected-items-list=\"selectedItemsList\"\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 :is-multi-level=\"isMultiLevel\"\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 >\n <bento-checkbox\n :model-value=\"selectedItemsList\"\n :aria-label=\"option.label\"\n :disabled=\"isOptionDisabled ? isOptionDisabled(option) : null\"\n :value=\"option.value\"\n @update:model-value=\"toggleCheckboxSelection(option.value)\"\n />\n <slot v-bind=\"option\">\n <span class=\"b-listbox-multi-select__option-text\">\n <bento-typography :el=\"BentoTypographyElement.SPAN\">{{ option.label }}</bento-typography>\n <bento-typography\n v-if=\"shouldShowDescription(option)\"\n class=\"b-listbox-multi-select__option-description\"\n :el=\"BentoTypographyElement.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, BentoTypographyElement } 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 * 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 emits: [\n ListboxMultiSelectOptionsEvent.TOGGLE_CHECKBOX_SELECTION,\n ListboxMultiSelectOptionsEvent.SELECT_CATEGORY,\n ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY,\n ],\n setup(props, { emit }) {\n const toggleCheckboxSelection = (value: BentoListboxValue) => {\n emit(ListboxMultiSelectOptionsEvent.TOGGLE_CHECKBOX_SELECTION, value);\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 // eslint-disable-next-line consistent-return\n const selectSearch = (selectedValue, option) => {\n if (isCategory(option)) {\n return selectedValue\n ? emit(ListboxMultiSelectOptionsEvent.SELECT_CATEGORY, option)\n : emit(ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY, option);\n }\n\n toggleCheckboxSelection(option.value);\n };\n\n const conditionalClasses = computed(() => ({\n 'b-listbox-multi-select-options__category-option': props.categoryItems,\n }));\n\n return {\n // Values\n conditionalClasses,\n\n // Methods\n isCategory,\n isOptionSelected,\n shouldShowDescription,\n toggleCheckboxSelection,\n selectSearch,\n\n // Enums\n BentoListboxEvent,\n BentoTypographyElement,\n ListboxMultiSelectOptionsEvent,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./listbox-multi-select-options.scss\" />\n","<template>\n <div v-bento-keyboard-navigation-directive class=\"b-listbox-multi-select\" v-on=\"listboxListeners\">\n <!-- Select all -->\n <bento-listbox-option ref=\"selectAllListboxItemsRef\" class=\"b-listbox-multi-select__option\">\n <bento-checkbox\n :aria-label=\"selectAllCheckboxText\"\n :model-value=\"isAllSelected\"\n :indeterminate=\"isIndeterminate\"\n @update:model-value=\"toggleSelectAll\"\n />\n <bento-typography :el=\"BentoTypographyElement.SPAN\">\n {{ selectAllCheckboxText }}\n </bento-typography>\n </bento-listbox-option>\n\n <!-- Selected options -->\n <div v-if=\"isAnOptionSelected\">\n <hr class=\"b-listbox-multi-select__divider\" />\n\n <listbox-multi-select-options\n ref=\"selectedListboxItemsRef\"\n :items=\"selectedOptions\"\n :is-option-disabled=\"isOptionDisabled\"\n :is-multi-level=\"isMultiLevelSelect\"\n :searching=\"searching\"\n :selected-items-list=\"selectedItemsList\"\n @select-category=\"selectAllCategory\"\n @unselect-category=\"unselectAllCategory\"\n @toggle-checkbox-selection=\"toggleCheckboxSelection(BentoListboxEvent.SELECT, $event)\"\n @[BentoListboxEvent.SPACE]=\"toggleCheckboxSelection(BentoListboxEvent.SPACE, $event)\"\n @[BentoListboxEvent.TAB]=\"toggleCheckboxSelection(BentoListboxEvent.TAB, $event)\"\n @[BentoListboxEvent.ENTER]=\"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\n <!-- Available options -->\n <div v-show=\"!isAllItemsIncludingDisabled\">\n <hr class=\"b-listbox-multi-select__divider\" />\n\n <listbox-multi-select-options\n ref=\"listboxItemsRef\"\n :items=\"items\"\n :is-option-disabled=\"isOptionDisabled\"\n :is-multi-level=\"isMultiLevelSelect\"\n :searching=\"searching\"\n :selected-items-list=\"selectedItemsList\"\n @toggle-checkbox-selection=\"toggleCheckboxSelection(BentoListboxEvent.SELECT, $event)\"\n @select-category=\"selectAllCategory\"\n @unselect-category=\"unselectAllCategory\"\n @[BentoListboxEvent.SPACE]=\"toggleCheckboxSelection(BentoListboxEvent.SPACE, $event)\"\n @[BentoListboxEvent.TAB]=\"toggleCheckboxSelection(BentoListboxEvent.TAB, $event)\"\n @[BentoListboxEvent.ENTER]=\"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 lang=\"ts\">\n import { computed, defineComponent, PropType, ref, watch } from 'vue';\n import { BentoCheckbox } from '@/components/checkbox';\n import { BentoListboxOption } from '../listbox-option';\n import { BentoTypography, BentoTypographyElement } from '@/components/typography';\n import { useCheckboxSelectAll } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import {\n BentoKeyboardNavigationKeyDownEvent,\n BentoListboxEvent,\n BentoListboxIsOptionDisabled,\n BentoListboxMultiSelectValue,\n BentoListboxOptionItem,\n BentoListboxOptions,\n BentoListboxSelectedValue,\n BentoListboxValue,\n } from '@/types';\n import { BentoKeyboardNavigationDirective } from '@/directives';\n import { ListboxMultiSelectOptions } from './components/listbox-multi-select-options';\n\n import messages from './messages.json';\n import { useListboxKeyboardNavigation } from '../../composables/useListboxKeyboardNavigation';\n\n type MessageSchema = (typeof messages)['en-US'];\n\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 defineComponent({\n i18n: { messages },\n name: 'bento-listbox-multi-select',\n components: {\n BentoCheckbox,\n BentoListboxOption,\n BentoTypography,\n ListboxMultiSelectOptions,\n },\n directives: { BentoKeyboardNavigationDirective },\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 * 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 * The `input` value.\n * Providing an empty array will select no options.\n */\n selectedValues: {\n type: Array as PropType<BentoListboxSelectedValue>,\n default: () => [] as BentoListboxSelectedValue,\n },\n },\n emits: [BentoListboxEvent.SELECT],\n setup(props, { emit, slots }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const selectAllListboxItemsRef = ref(null);\n const selectedListboxItemsRef = ref(null);\n const listboxItemsRef = ref(null);\n\n const selectedItemsList = ref();\n watch(\n () => props.selectedValues,\n () => {\n selectedItemsList.value = ([...((props.selectedValues as Array<unknown>) ?? [])] ||\n []) as BentoListboxMultiSelectValue;\n },\n {\n immediate: true,\n }\n );\n\n const isMultiLevelSelect = computed(() => !!props.items.find(({ items }) => !!items));\n\n const flattenedItemsList = computed(() => {\n if (isMultiLevelSelect.value) {\n return props.items.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 props.items;\n });\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 props.searching && isMultiLevelSelect\n ? props.items\n : flattenedItemsList.value.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(option => {\n if (option.items && isMultiLevelSelect.value && props.searching) {\n const amountOfSelectedCategoryOptions = option.items.filter(categoryOption =>\n ((props.selectedValues as Array<BentoListboxSelectedValue>) ?? []).includes(\n categoryOption.value\n )\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 enabledItems.value.length;\n }\n\n return props.items.length;\n };\n\n const selectAllCheckboxText = computed(() => {\n const total = calculateTotalItems();\n const amountSelectedValues = visibleSelectedList.value?.length || 0;\n\n if (amountSelectedValues === 0) {\n return t('selectAll', { total });\n }\n\n return amountSelectedValues === total\n ? t('allSelected', { total })\n : t('numberOfTotalSelected', { number: amountSelectedValues, total });\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 .map(({ value }) => value);\n\n selectedItemsList.value = [...selectedItemsList.value, ...addOrRemoveList];\n emit(BentoListboxEvent.SELECT, selectedItemsList.value);\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\n .filter(findEnabledUnselectedItems)\n .map(({ value }) => value);\n selectedItemsList.value = selectedItemsList.value.filter(item => !unselectedItemsList?.includes(item));\n emit(BentoListboxEvent.SELECT, selectedItemsList.value);\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 selectAllCategory = (category: BentoListboxOptionItem) => {\n selectAll(category.items);\n };\n\n const unselectAllCategory = (category: BentoListboxOptionItem) => {\n unselectAll(category.items);\n };\n\n const toggleCheckboxSelection = (eventName, value: BentoListboxValue) => {\n let exists = false;\n selectedItemsList.value = selectedItemsList.value.filter(option => {\n if (value === option) {\n exists = true;\n return false;\n }\n\n return true;\n });\n\n if (!exists) {\n selectedItemsList.value.push(value);\n }\n emit(eventName, selectedItemsList.value);\n };\n\n const selectedOptions = computed(() => {\n const isOptionSelected = option =>\n (selectedItemsList.value as unknown as Array<string | number>).includes(option.value);\n const categoryOptionsSelected = categoryOptions =>\n !!categoryOptions.find(option => isOptionSelected(option));\n\n const options = props.items.filter(option => {\n // Check selected categories category\n if (option.items && categoryOptionsSelected(option.items)) {\n return true;\n }\n\n return isOptionSelected(option);\n });\n return options;\n });\n\n const isAnOptionSelected = computed(() => selectedOptions.value?.length > 0);\n\n const isAllItemsIncludingDisabled = computed(\n () => visibleSelectedList.value?.length === flattenedItemsList.value?.length\n );\n\n const computedSelectAllListboxItemsRefs = computed(() =>\n selectAllListboxItemsRef.value ? [selectAllListboxItemsRef.value] : []\n );\n\n // Keyboard navigation\n const computedselectedListboxItemsRefs = computed(() =>\n selectedListboxItemsRef.value?.$children?.length ? selectedListboxItemsRef.value.$children : []\n );\n\n const computedlistboxItems = computed(() =>\n listboxItemsRef.value?.$children?.length ? listboxItemsRef.value.$children : []\n );\n\n const computedselectAllItemRefs = computed(() => ({ label: selectAllCheckboxText, value: isAllSelected }));\n\n const computedItems = computed(() => [\n computedselectAllItemRefs,\n ...selectedOptions.value,\n ...flattenedItemsList.value,\n ]);\n\n const focusItem = (nextFocusedItemIndex: number) => {\n const multiSelectListboxItems = [\n ...computedSelectAllListboxItemsRefs.value,\n ...computedselectedListboxItemsRefs.value,\n ...computedlistboxItems.value,\n ];\n multiSelectListboxItems[nextFocusedItemIndex].$el.focus();\n };\n\n const { moveToNextElement, moveToPreviousElement, moveToFirstElement, moveToLastElement } =\n useListboxKeyboardNavigation(\n {\n items: ref(computedItems),\n isOptionDisabled: props.isOptionDisabled,\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 return {\n // Refs\n selectAllListboxItemsRef,\n selectedListboxItemsRef,\n listboxItemsRef,\n\n // Values\n isAllSelected,\n isAllItemsIncludingDisabled,\n isAnOptionSelected,\n isIndeterminate,\n isMultiLevelSelect,\n flattenedItemsList,\n selectedItemsList,\n selectAllCheckboxText,\n selectedOptions,\n slots,\n\n // Enums\n BentoTypographyElement,\n BentoListboxEvent,\n\n // Methods\n selectAllCategory,\n toggleCheckboxSelection,\n toggleSelectAll,\n unselectAllCategory,\n\n // Events\n listboxListeners,\n };\n },\n });\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 @scroll=\"() => (hasAutomaticLazyLoader ? emitShowMoreOnScrollEnd() : undefined)\"\n >\n <!-- Empty search message -->\n <div v-if=\"isSearchResultEmpty\" class=\"b-listbox__empty-search-message\">\n <bento-typography :el=\"BentoTypographyElement.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 :items=\"items\"\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=\"items\"\n :selected-value=\"selectedValue\"\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 <div v-if=\"shouldDisplayShowMoreButton\" class=\"b-listbox__lazy-load\">\n <bento-loading-button\n :state=\"loadingButtonState\"\n :variant=\"BentoButtonVariant.SECONDARY\"\n @click=\"emitShowMore\"\n >\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</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref } from 'vue';\n import {\n BentoKeyboardNavigationKeyDownEvent,\n BentoListboxEvent,\n BentoListboxIsOptionDisabled,\n BentoListboxLazyLoadType,\n BentoListboxOptions,\n BentoListboxSelectedValue,\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, BentoTypographyElement } from '@/components/typography';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import { BentoButtonVariant, BentoLoadingButton, BentoLoadingButtonState } from '@/components/button';\n import { useI18n } from '@/utils/ts/i18n';\n import { debounce } from '@/utils/ts/debounce';\n import type { HTMLAttributes } from 'vue/types/jsx';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\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 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 * 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 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 * If enabled, the user will be able to select multiple items.\n */\n multiple: { 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: [String, Number, Array] as PropType<BentoListboxSelectedValue>,\n default: undefined,\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 { t } = useI18n<{ message: MessageSchema }>({ messages });\n const listboxRef = ref(null);\n const listboxItemRef = ref([]);\n const isLazyLoadListbox = computed(() => props.lazyLoadType !== BentoListboxLazyLoadType.AUTOMATIC);\n const hasAutomaticLazyLoader = computed(() => props.lazyLoadType === BentoListboxLazyLoadType.AUTOMATIC);\n\n // Aria a11y\n const ariaAtomic = computed<HTMLAttributes['aria-atomic']>(() =>\n isLazyLoadListbox.value ? 'true' : undefined\n );\n const ariaBusy = computed<HTMLAttributes['aria-busy']>(() =>\n isLazyLoadListbox.value && props.loading ? 'true' : 'false'\n );\n const ariaLive = computed<HTMLAttributes['aria-live']>(() =>\n isLazyLoadListbox.value ? 'polite' : undefined\n );\n\n const onOptionSelected = eventName => (selectedValue: BentoListboxSelectedValue) => {\n emit(eventName, selectedValue);\n };\n\n const emitShowMore = () => {\n emit(BentoListboxEvent.SHOW_MORE);\n };\n\n const emitShowMoreOnScrollEnd = debounce(() => {\n const container = listboxRef.value;\n const isAtBottom = container.scrollTop + container.clientHeight >= container.scrollHeight;\n\n if (props.hasMoreItems && isAtBottom && !props.loading) {\n emitShowMore();\n }\n });\n\n const isSearchResultEmpty = computed(() => props.searching && 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 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 hasAutomaticLazyLoader,\n isSearchResultEmpty,\n loadingButtonState,\n slots,\n shouldDisplayShowMoreButton,\n showMoreButtonText,\n\n // Enums\n BentoTypographyElement,\n BentoButtonVariant,\n BentoListboxLazyLoadType,\n BentoKeyboardNavigationKeyDownEvent,\n BentoListboxEvent,\n\n // Methods\n onOptionSelected,\n emitShowMoreOnScrollEnd,\n emitShowMore,\n listboxListeners,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./listbox.scss\" />\n"],"names":["useCheckboxSelectAll","selectedItemsList","items","selectAll","unselectAll","isAllSelected","computed","_a","_b","isIndeterminate","selectedValue","BentoListboxEvent","BentoListboxEvent2","BentoListboxLazyLoadType","BentoListboxLazyLoadType2","_sfc_main$7","defineComponent","props","emit","conditionalClasses","BentoKeyboardNavigationKeyDownEvent","e","eventName","uuid","_sfc_main$6","_sfc_main$5","BentoListboxOption","BentoTypography","CheckmarkIcon","onOptionSelected","ariaDisabled","ariaSelected","tabIndex","BentoTypographyElement","useListboxKeyboardNavigation","isOptionDisabled","focusItem","numberOfItems","focusedIndex","ref","onMounted","el","isItemDisabled","itemIndex","isItemEnabled","mutateFocusedIndex","direction","calculateFocusedIndex","edgeCaseItem","isItemBeforeEdgeCaseItem","callback","moveToNextElement","isIndexSecondToLastItemInArray","moveToPreviousElement","IsIndexSecondItemInArray","_sfc_main$4","BentoListboxSingleSelectOption","BentoKeyboardNavigationDirective","slots","listboxItemRef","nextFocusedItemIndex","moveToFirstElement","moveToLastElement","toRef","listboxListeners","listboxOptionListeners","ListboxMultiSelectCategoryClass","ListboxMultiSelectCategoryClass2","ListboxMultiSelectCategoryEvent","ListboxMultiSelectCategoryEvent2","_sfc_main$3","messages$2","BentoCheckbox","ChevronDownIcon","ChevronUpIcon","isOpen","t","useI18n","hasAllPropsDisabled","option","conditionalClass","toggleOpen","event","optionStates","isDisabled","isPreSelected","enabledItems","visibleSelectedList","value","chevronTitle","messageName","toggleSelectAll","ListboxMultiSelectOptionsEvent","ListboxMultiSelectOptionsEvent2","_sfc_main$2","ListboxMultiSelectCategory","toggleCheckboxSelection","isCategory","shouldShowDescription","isSearchingMultiLevel","isOptionSelected","item","selectSearch","_sfc_main$1","messages$1","ListboxMultiSelectOptions","selectAllListboxItemsRef","selectedListboxItemsRef","listboxItemsRef","watch","isMultiLevelSelect","flattenedItemsList","acc","val","categoryOption","calculateTotalItems","selectAllCheckboxText","total","amountSelectedValues","selectableItems","filterOutDisabledAndNotPreselectedOptions","addOrRemoveList","findEnabledUnselectedItems","unselectedItemsList","selectAllItems","unselectAllItems","selectAllCategory","category","unselectAllCategory","exists","selectedOptions","categoryOptionsSelected","categoryOptions","isAnOptionSelected","isAllItemsIncludingDisabled","computedSelectAllListboxItemsRefs","computedselectedListboxItemsRefs","computedlistboxItems","computedselectAllItemRefs","computedItems","_sfc_main","BentoListboxSingleSelect","BentoListboxMultiSelect","BentoLoadingIndicator","BentoLoadingButton","messages","listboxRef","isLazyLoadListbox","hasAutomaticLazyLoader","ariaAtomic","ariaBusy","ariaLive","emitShowMore","emitShowMoreOnScrollEnd","debounce","container","isAtBottom","isSearchResultEmpty","shouldDisplayShowMoreButton","loadingButtonState","BentoLoadingButtonState","showMoreButtonText","BentoButtonVariant"],"mappings":";;;;;;;;;;;AA8CO,MAAAA,IAAA,CAAAC,GAAAC,GAAAC,GAAAC,MAAA;AAMH,QAAAC,IAAAC;AAAA,IAAsB,MAAA;;AAAA,cAAA,GAAAC,IAAAN,EAAA,UAAA,QAAAM,EAAA,aAAAC,IAAAP,EAAA,UAAA,g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ACA,OAAArG;AAAA,MACA,6BAAAoG;AAAA,MACA,oBAAAG;AAAA;AAAA,MACA,wBAAAhI;AAAA,MAGA,oBAAAiI;AAAA,MACA,0BAAArJ;AAAA,MACA,qCAAAO;AAAA,MACA,mBAAAT;AAAA;AAAA,MACA,kBAAAkB;AAAA,MAGA,yBAAA4H;AAAA,MACA,cAAAD;AAAA,MACA,kBAAAxF;AAAA,IACA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[3]}
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as d, computed as s } from "vue";
2
- import { B as o, a as i } from "./button.f64585fc.js";
2
+ import { B as o, a as i } from "./button.c27a7ce2.js";
3
3
  import { BentoLoadingIndicator as l } from "../loading-indicator.js";
4
4
  import { C as c } from "./cross-circle-fill.d5e9ae44.js";
5
5
  import { C as u } from "./checkmark-circle-fill.2cfbb81b.js";
@@ -81,4 +81,4 @@ export {
81
81
  A as B,
82
82
  a
83
83
  };
84
- //# sourceMappingURL=loading-button.f7768964.js.map
84
+ //# sourceMappingURL=loading-button.6d34f66f.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"loading-button.f7768964.js","sources":["../../src/components/button/components/loading-button/loading-button.types.ts","../../src/components/button/components/loading-button/loading-button.vue"],"sourcesContent":["export enum BentoLoadingButtonState {\n START = 'start',\n LOADING = 'loading',\n SUCCESS = 'success',\n FAIL = 'fail',\n}\n\nexport type BentoLoadingButtonIconState = Partial<{ [key in BentoLoadingButtonState]: string }>;\n","<template>\n <div class=\"b-loading-button\" data-testid=\"loading-button\" :class=\"conditionalClasses\">\n <bento-button\n :critical=\"state === BentoLoadingButtonState.FAIL\"\n :variant=\"variant\"\n :condensed=\"condensed\"\n :disabled=\"disabled\"\n @click=\"onClick\"\n >\n <slot></slot>\n <template v-if=\"state !== BentoLoadingButtonState.START\" #iconLeft>\n <span class=\"b-loading-button__icon\" data-testid=\"loading-button-rotating-icon\">\n <cross v-if=\"state === BentoLoadingButtonState.FAIL\" svg-title=\"failed\" />\n <checkmark v-else-if=\"state === BentoLoadingButtonState.SUCCESS\" svg-title=\"succeded\" />\n <!-- TODO: Replace with new loading-indicator component -->\n <bento-loading-indicator\n v-else-if=\"state === BentoLoadingButtonState.LOADING\"\n small\n :inverse=\"isInverseLoadingIndicator\"\n />\n </span>\n </template>\n </bento-button>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoButtonVariant } from '@/core/components/button/button.types';\n import { BentoLoadingButtonState } from './loading-button.types';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import BentoButton from '@/components/button/button.vue';\n import Cross from '@adyen/ui-assets-icons-16/vue/cross-circle-fill';\n import Checkmark from '@adyen/ui-assets-icons-16/vue/checkmark-circle-fill';\n\n export default defineComponent({\n name: 'bento-loading-button',\n components: { BentoButton, Cross, Checkmark, BentoLoadingIndicator },\n props: {\n /**\n * Reduces sizing of button\n */\n condensed: {\n type: BentoButton.props.condensed.type,\n default: false,\n },\n\n /**\n * Disables button functonality\n */\n disabled: {\n type: BentoButton.props.disabled.type,\n default: false,\n },\n\n /**\n * State of the button.\n * @values start, loading, success, fail\n */\n state: {\n type: String as PropType<BentoLoadingButtonState>,\n default: BentoLoadingButtonState.START,\n validator: (value: BentoLoadingButtonState) => Object.values(BentoLoadingButtonState).includes(value),\n },\n\n /**\n * Types of flavour of Button\n * @values primary, secondary, tertiary\n */\n variant: {\n type: BentoButton.props.variant.type,\n default: BentoButtonVariant.PRIMARY,\n validator: BentoButton.props.variant.validator,\n },\n },\n setup(props, { emit }) {\n const conditionalClasses = computed(() => ({\n [`b-loading-button--${props.variant}-${BentoLoadingButtonState.LOADING}`]:\n props.state === BentoLoadingButtonState.LOADING && !props.disabled,\n [`b-loading-button--${props.variant}-${BentoLoadingButtonState.SUCCESS}`]:\n props.state === BentoLoadingButtonState.SUCCESS,\n }));\n\n const isInverseLoadingIndicator = computed(() => props.variant === BentoButtonVariant.PRIMARY);\n\n const onClick = () => {\n if (props.state !== BentoLoadingButtonState.LOADING) {\n emit('click');\n }\n };\n\n return {\n // Enums\n BentoLoadingButtonState,\n\n // Functions\n onClick,\n\n // Values\n conditionalClasses,\n isInverseLoadingIndicator,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./loading-button.scss\" />\n"],"names":["BentoLoadingButtonState","BentoLoadingButtonState2","_sfc_main","defineComponent","BentoButton","CrossCircleIcon","CheckedCircleIcon","BentoLoadingIndicator","value","BentoButtonVariant","props","emit","conditionalClasses","computed","isInverseLoadingIndicator"],"mappings":";;;;;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,UAAA,WACAA,EAAA,UAAA,WACAA,EAAA,OAAA,QAJQA,IAAAD,KAAA,CAAA,CAAA;ACmCZ,MAAAE,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA,EAAA,aAAAC,GAAA,OAAAC,GAAA,WAAAC,GAAA,uBAAAC,EAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IACA,WAAA;AAAA,MAIA,MAAAH,EAAA,MAAA,UAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,UAAA;AAAA,MAKA,MAAAA,EAAA,MAAA,SAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IACA,OAAA;AAAA,MAMA,MAAA;AAAA,MACA,SAAAJ,EAAA;AAAA,MACA,WAAA,CAAAQ,MAAA,OAAA,OAAAR,CAAA,EAAA,SAAAQ,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IACA,SAAA;AAAA,MAMA,MAAAJ,EAAA,MAAA,QAAA;AAAA,MACA,SAAAK,EAAA;AAAA,MACA,WAAAL,EAAA,MAAA,QAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,MAAAM,GAAA,EAAA,MAAAC,EAAA,GAAA;AAEA,UAAAC,IAAAC,EAAA,OAAA;AAAA,MAAA,CAAA,qBAAAH,EAAA,WAAAV,EAAA,SAAA,GAAAU,EAAA,UAAAV,EAAA,WAAA,CAAAU,EAAA;AAAA,MAEA,CAAA,qBAAAA,EAAA,WAAAV,EAAA,SAAA,GAAAU,EAAA,UAAAV,EAAA;AAAA,IAEA,EAAA,GAGAc,IAAAD,EAAA,MAAAH,EAAA,YAAAD,EAAA,OAAA;AAQA,WAAA;AAAA;AAAA,MAAA,yBAAAT;AAAA;AAAA,MAEA,SARA,MAAA;AACA,QAAAU,EAAA,UAAAV,EAAA,WACAW,EAAA,OAAA;AAAA,MACA;AAAA;AAAA,MAQA,oBAAAC;AAAA,MAGA,2BAAAE;AAAA,IACA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"loading-button.6d34f66f.js","sources":["../../src/components/button/components/loading-button/loading-button.types.ts","../../src/components/button/components/loading-button/loading-button.vue"],"sourcesContent":["export enum BentoLoadingButtonState {\n START = 'start',\n LOADING = 'loading',\n SUCCESS = 'success',\n FAIL = 'fail',\n}\n\nexport type BentoLoadingButtonIconState = Partial<{ [key in BentoLoadingButtonState]: string }>;\n","<template>\n <div class=\"b-loading-button\" data-testid=\"loading-button\" :class=\"conditionalClasses\">\n <bento-button\n :critical=\"state === BentoLoadingButtonState.FAIL\"\n :variant=\"variant\"\n :condensed=\"condensed\"\n :disabled=\"disabled\"\n @click=\"onClick\"\n >\n <slot></slot>\n <template v-if=\"state !== BentoLoadingButtonState.START\" #iconLeft>\n <span class=\"b-loading-button__icon\" data-testid=\"loading-button-rotating-icon\">\n <cross v-if=\"state === BentoLoadingButtonState.FAIL\" svg-title=\"failed\" />\n <checkmark v-else-if=\"state === BentoLoadingButtonState.SUCCESS\" svg-title=\"succeded\" />\n <!-- TODO: Replace with new loading-indicator component -->\n <bento-loading-indicator\n v-else-if=\"state === BentoLoadingButtonState.LOADING\"\n small\n :inverse=\"isInverseLoadingIndicator\"\n />\n </span>\n </template>\n </bento-button>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoButtonVariant } from '@/core/components/button/button.types';\n import { BentoLoadingButtonState } from './loading-button.types';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import BentoButton from '@/components/button/button.vue';\n import Cross from '@adyen/ui-assets-icons-16/vue/cross-circle-fill';\n import Checkmark from '@adyen/ui-assets-icons-16/vue/checkmark-circle-fill';\n\n export default defineComponent({\n name: 'bento-loading-button',\n components: { BentoButton, Cross, Checkmark, BentoLoadingIndicator },\n props: {\n /**\n * Reduces sizing of button\n */\n condensed: {\n type: BentoButton.props.condensed.type,\n default: false,\n },\n\n /**\n * Disables button functonality\n */\n disabled: {\n type: BentoButton.props.disabled.type,\n default: false,\n },\n\n /**\n * State of the button.\n * @values start, loading, success, fail\n */\n state: {\n type: String as PropType<BentoLoadingButtonState>,\n default: BentoLoadingButtonState.START,\n validator: (value: BentoLoadingButtonState) => Object.values(BentoLoadingButtonState).includes(value),\n },\n\n /**\n * Types of flavour of Button\n * @values primary, secondary, tertiary\n */\n variant: {\n type: BentoButton.props.variant.type,\n default: BentoButtonVariant.PRIMARY,\n validator: BentoButton.props.variant.validator,\n },\n },\n setup(props, { emit }) {\n const conditionalClasses = computed(() => ({\n [`b-loading-button--${props.variant}-${BentoLoadingButtonState.LOADING}`]:\n props.state === BentoLoadingButtonState.LOADING && !props.disabled,\n [`b-loading-button--${props.variant}-${BentoLoadingButtonState.SUCCESS}`]:\n props.state === BentoLoadingButtonState.SUCCESS,\n }));\n\n const isInverseLoadingIndicator = computed(() => props.variant === BentoButtonVariant.PRIMARY);\n\n const onClick = () => {\n if (props.state !== BentoLoadingButtonState.LOADING) {\n emit('click');\n }\n };\n\n return {\n // Enums\n BentoLoadingButtonState,\n\n // Functions\n onClick,\n\n // Values\n conditionalClasses,\n isInverseLoadingIndicator,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./loading-button.scss\" />\n"],"names":["BentoLoadingButtonState","BentoLoadingButtonState2","_sfc_main","defineComponent","BentoButton","CrossCircleIcon","CheckedCircleIcon","BentoLoadingIndicator","value","BentoButtonVariant","props","emit","conditionalClasses","computed","isInverseLoadingIndicator"],"mappings":";;;;;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,UAAA,WACAA,EAAA,UAAA,WACAA,EAAA,OAAA,QAJQA,IAAAD,KAAA,CAAA,CAAA;ACmCZ,MAAAE,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA,EAAA,aAAAC,GAAA,OAAAC,GAAA,WAAAC,GAAA,uBAAAC,EAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IACA,WAAA;AAAA,MAIA,MAAAH,EAAA,MAAA,UAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,UAAA;AAAA,MAKA,MAAAA,EAAA,MAAA,SAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IACA,OAAA;AAAA,MAMA,MAAA;AAAA,MACA,SAAAJ,EAAA;AAAA,MACA,WAAA,CAAAQ,MAAA,OAAA,OAAAR,CAAA,EAAA,SAAAQ,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IACA,SAAA;AAAA,MAMA,MAAAJ,EAAA,MAAA,QAAA;AAAA,MACA,SAAAK,EAAA;AAAA,MACA,WAAAL,EAAA,MAAA,QAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,MAAAM,GAAA,EAAA,MAAAC,EAAA,GAAA;AAEA,UAAAC,IAAAC,EAAA,OAAA;AAAA,MAAA,CAAA,qBAAAH,EAAA,WAAAV,EAAA,SAAA,GAAAU,EAAA,UAAAV,EAAA,WAAA,CAAAU,EAAA;AAAA,MAEA,CAAA,qBAAAA,EAAA,WAAAV,EAAA,SAAA,GAAAU,EAAA,UAAAV,EAAA;AAAA,IAEA,EAAA,GAGAc,IAAAD,EAAA,MAAAH,EAAA,YAAAD,EAAA,OAAA;AAQA,WAAA;AAAA;AAAA,MAAA,yBAAAT;AAAA;AAAA,MAEA,SARA,MAAA;AACA,QAAAU,EAAA,UAAAV,EAAA,WACAW,EAAA,OAAA;AAAA,MACA;AAAA;AAAA,MAQA,oBAAAC;AAAA,MAGA,2BAAAE;AAAA,IACA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;;;"}
@@ -3,7 +3,7 @@ import { l as s } from "./events.58c00e6d.js";
3
3
  import { g as S } from "./unique-id.a2a2b458.js";
4
4
  import { PopperContainerPositionBasic as v, PopperContainer as N, PopperContainerAriaRole as D, PopperContainerPositionExtended as W } from "../popper-container.js";
5
5
  import { V as B } from "./index.af05ced4.js";
6
- import { B as x, a as I, b as U } from "./index.e1fcc9e0.js";
6
+ import { B as x, a as I, b as U } from "./index.175f9e2d.js";
7
7
  import { n as G } from "./_plugin-vue2_normalizer.71e2aa87.js";
8
8
  import "../assets/tooltip.css";
9
9
  const l = { ...v };
@@ -170,4 +170,4 @@ export {
170
170
  A as a,
171
171
  tt as b
172
172
  };
173
- //# sourceMappingURL=tooltip.1e7cda50.js.map
173
+ //# sourceMappingURL=tooltip.9af34fba.js.map