@adyen/bento-vue3 1.9.0 → 1.10.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 (246) hide show
  1. package/dist/@types/packages/vue2/src/components/button/button.vue.d.ts +23 -2455
  2. package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.types.d.ts +2 -0
  3. package/dist/@types/packages/vue2/src/components/button/components/loading-button/loading-button.vue.d.ts +3 -3
  4. package/dist/@types/packages/vue2/src/components/checkbox/checkbox.vue.d.ts +2 -0
  5. package/dist/@types/packages/vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue.d.ts +2 -0
  6. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-cell-actions/data-grid-cell-actions.types.d.ts +14 -0
  7. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-cell-actions/data-grid-cell-actions.vue.d.ts +33 -0
  8. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns-types.d.ts +1 -0
  9. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns.vue.d.ts +21 -4
  10. package/dist/@types/packages/vue2/src/components/data-grid/components/index.d.ts +1 -0
  11. package/dist/@types/packages/vue2/src/components/data-grid/composables/useCalculateColumnWidth/useCalculateColumnWidth.d.ts +1 -0
  12. package/dist/@types/packages/vue2/src/components/data-grid/composables/useColumnReorderer/useColumnReorderer.d.ts +54 -0
  13. package/dist/@types/packages/vue2/src/components/data-grid/composables/useConfigSettings/useConfigSettings.d.ts +81 -0
  14. package/dist/@types/packages/vue2/src/components/data-grid/composables/useSelector.d.ts +1 -1
  15. package/dist/@types/packages/vue2/src/components/data-grid/data-grid.types.d.ts +5 -2
  16. package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +15 -5
  17. package/dist/@types/packages/vue2/src/components/divider/divider.keys.d.ts +1 -0
  18. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.types.d.ts +1 -1
  19. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue.d.ts +3 -3
  20. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-default-textbox/dropdown-default-textbox.vue.d.ts +3 -3
  21. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +15 -6
  22. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-small-textbox/dropdown-small-textbox.vue.d.ts +3 -3
  23. package/dist/@types/packages/vue2/src/components/dropdown/composables/useDisplayValue.types.d.ts +1 -0
  24. package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +11 -1
  25. package/dist/@types/packages/vue2/src/components/empty-state/empty-state.types.d.ts +1 -0
  26. package/dist/@types/packages/vue2/src/components/empty-state/empty-state.vue.d.ts +3 -3
  27. package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +84 -12
  28. package/dist/@types/packages/vue2/src/components/filter-bar/filter-bar.types.d.ts +3 -1
  29. package/dist/@types/packages/vue2/src/components/internal/controls-group/controls-group.vue.d.ts +8 -0
  30. package/dist/@types/packages/vue2/src/components/internal/copy/copy.types.d.ts +8 -0
  31. package/dist/@types/packages/vue2/src/components/internal/copy/copy.vue.d.ts +20 -0
  32. package/dist/@types/packages/vue2/src/components/internal/copy/index.d.ts +1 -0
  33. 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.types.d.ts +2 -1
  34. 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 +51 -0
  35. 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 +10 -0
  36. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/listbox-multi-select.vue.d.ts +9 -0
  37. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-single-select/components/listbox-single-select-category/index.d.ts +1 -0
  38. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-single-select/components/listbox-single-select-category/listbox-single-select-category.vue.d.ts +12 -0
  39. package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-single-select/listbox-single-select.vue.d.ts +10 -0
  40. package/dist/@types/packages/vue2/src/components/internal/listbox/composables/use-multi-level-items/use-multi-level-items.d.ts +6 -0
  41. package/dist/@types/packages/vue2/src/components/internal/listbox/index.d.ts +1 -0
  42. package/dist/@types/packages/vue2/src/components/internal/listbox/listbox.vue.d.ts +11 -2
  43. package/dist/@types/packages/vue2/src/components/menu/components/menu-item/menu-item.types.d.ts +1 -0
  44. package/dist/@types/packages/vue2/src/components/menu/components/menu-item/menu-item.vue.d.ts +1 -1
  45. package/dist/@types/packages/vue2/src/components/menu/components/sub-menu-item-list/sub-menu-item-list.vue.d.ts +2 -0
  46. package/dist/@types/packages/vue2/src/components/menu/menu.vue.d.ts +1 -0
  47. package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.vue.d.ts +1 -1
  48. package/dist/@types/packages/vue2/src/components/modal/components/modal-dialog/modal-dialog.vue.d.ts +316 -3
  49. package/dist/@types/packages/vue2/src/components/popover/popover.vue.d.ts +1 -1
  50. package/dist/@types/packages/vue2/src/components/radio-group/radio-group.vue.d.ts +1 -0
  51. package/dist/@types/packages/vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue.d.ts +3 -4
  52. package/dist/@types/packages/vue2/src/components/structured-list/structured-list.types.d.ts +2 -0
  53. package/dist/@types/packages/vue2/src/components/structured-list/structured-list.vue.d.ts +15 -2
  54. package/dist/@types/packages/vue2/src/components/timeline/components/timeline-item/timeline-item.vue.d.ts +15 -10
  55. package/dist/@types/packages/vue2/src/components/timeline/timeline.types.d.ts +9 -0
  56. package/dist/@types/packages/vue2/src/types/elements.d.ts +2 -1
  57. package/dist/accordion.js +2 -2
  58. package/dist/action-bar.js +5 -5
  59. package/dist/alert.js +24 -24
  60. package/dist/alert.js.map +1 -1
  61. package/dist/assets/base-modal.css +1 -1
  62. package/dist/assets/button.css +1 -1
  63. package/dist/assets/checkbox.css +1 -1
  64. package/dist/assets/controls-group.css +1 -1
  65. package/dist/assets/copy.css +1 -1
  66. package/dist/assets/dropdown-default-textbox.css +1 -1
  67. package/dist/assets/dropdown.css +1 -1
  68. package/dist/assets/index.css +1 -1
  69. package/dist/assets/index10.css +1 -1
  70. package/dist/assets/index11.css +1 -1
  71. package/dist/assets/index12.css +1 -1
  72. package/dist/assets/index13.css +1 -1
  73. package/dist/assets/index14.css +1 -1
  74. package/dist/assets/index16.css +1 -1
  75. package/dist/assets/index17.css +1 -1
  76. package/dist/assets/index18.css +1 -1
  77. package/dist/assets/index19.css +1 -1
  78. package/dist/assets/index2.css +1 -1
  79. package/dist/assets/index20.css +1 -1
  80. package/dist/assets/index21.css +1 -1
  81. package/dist/assets/index22.css +1 -1
  82. package/dist/assets/index23.css +1 -1
  83. package/dist/assets/index24.css +1 -1
  84. package/dist/assets/index25.css +1 -1
  85. package/dist/assets/index26.css +1 -1
  86. package/dist/assets/index27.css +1 -1
  87. package/dist/assets/index28.css +1 -1
  88. package/dist/assets/index29.css +1 -1
  89. package/dist/assets/index3.css +1 -1
  90. package/dist/assets/index30.css +1 -1
  91. package/dist/assets/index31.css +1 -1
  92. package/dist/assets/index32.css +1 -1
  93. package/dist/assets/index33.css +1 -1
  94. package/dist/assets/index34.css +1 -1
  95. package/dist/assets/index35.css +1 -1
  96. package/dist/assets/index36.css +1 -1
  97. package/dist/assets/index37.css +1 -1
  98. package/dist/assets/index38.css +1 -1
  99. package/dist/assets/index39.css +1 -1
  100. package/dist/assets/index40.css +1 -1
  101. package/dist/assets/index41.css +1 -1
  102. package/dist/assets/index42.css +1 -1
  103. package/dist/assets/index43.css +1 -1
  104. package/dist/assets/index44.css +1 -1
  105. package/dist/assets/index45.css +1 -1
  106. package/dist/assets/index46.css +1 -1
  107. package/dist/assets/index5.css +1 -1
  108. package/dist/assets/index6.css +1 -1
  109. package/dist/assets/index7.css +1 -1
  110. package/dist/assets/index8.css +1 -1
  111. package/dist/assets/index9.css +1 -1
  112. package/dist/assets/listbox.css +1 -1
  113. package/dist/assets/loading-button.css +1 -1
  114. package/dist/avatar-image.js +1 -1
  115. package/dist/badge.js +1 -1
  116. package/dist/button.js +56 -45
  117. package/dist/button.js.map +1 -1
  118. package/dist/card.js +1 -1
  119. package/dist/checkbox.js +72 -53
  120. package/dist/checkbox.js.map +1 -1
  121. package/dist/chunks/{base-button.aa085dfa.js → base-button.dfc0e32e.js} +2 -2
  122. package/dist/chunks/{base-button.aa085dfa.js.map → base-button.dfc0e32e.js.map} +1 -1
  123. package/dist/chunks/{base-modal.a629cb32.js → base-modal.8b323292.js} +86 -86
  124. package/dist/chunks/base-modal.8b323292.js.map +1 -0
  125. package/dist/chunks/{button-actions-with-menu.f6dfb14d.js → button-actions-with-menu.044fe230.js} +3 -3
  126. package/dist/chunks/{button-actions-with-menu.f6dfb14d.js.map → button-actions-with-menu.044fe230.js.map} +1 -1
  127. package/dist/chunks/button.6ca5cd14.js +118 -0
  128. package/dist/chunks/button.6ca5cd14.js.map +1 -0
  129. package/dist/chunks/{calendar.fa7712e8.js → calendar.b3c15dcd.js} +4 -4
  130. package/dist/chunks/{calendar.fa7712e8.js.map → calendar.b3c15dcd.js.map} +1 -1
  131. package/dist/chunks/checkbox.979b1aa4.js +278 -0
  132. package/dist/chunks/checkbox.979b1aa4.js.map +1 -0
  133. package/dist/chunks/{controls-group.d6543674.js → controls-group.2f6cbb21.js} +21 -17
  134. package/dist/chunks/controls-group.2f6cbb21.js.map +1 -0
  135. package/dist/chunks/copy.0fed8f42.js +145 -0
  136. package/dist/chunks/copy.0fed8f42.js.map +1 -0
  137. package/dist/chunks/{dropdown-default-textbox.4108b289.js → dropdown-default-textbox.839fe6f7.js} +25 -25
  138. package/dist/chunks/dropdown-default-textbox.839fe6f7.js.map +1 -0
  139. package/dist/chunks/{dropdown.63de9aac.js → dropdown.014ae3e3.js} +370 -331
  140. package/dist/chunks/dropdown.014ae3e3.js.map +1 -0
  141. package/dist/chunks/{field-label.3c19a29a.js → field-label.085966f6.js} +5 -5
  142. package/dist/chunks/{field-label.3c19a29a.js.map → field-label.085966f6.js.map} +1 -1
  143. package/dist/chunks/{fixed-scroller.bced60dd.js → fixed-scroller.96019461.js} +2 -2
  144. package/dist/chunks/{fixed-scroller.bced60dd.js.map → fixed-scroller.96019461.js.map} +1 -1
  145. package/dist/chunks/{footer-actions.cefaf1e2.js → footer-actions.52d5a453.js} +3 -3
  146. package/dist/chunks/{footer-actions.cefaf1e2.js.map → footer-actions.52d5a453.js.map} +1 -1
  147. package/dist/chunks/{index.75f3672e.js → index.10c545e2.js} +2 -2
  148. package/dist/chunks/{index.75f3672e.js.map → index.10c545e2.js.map} +1 -1
  149. package/dist/chunks/{index.4d2a13e1.js → index.4e3fb264.js} +2 -2
  150. package/dist/chunks/{index.4d2a13e1.js.map → index.4e3fb264.js.map} +1 -1
  151. package/dist/chunks/{index.89dfe209.js → index.5596079e.js} +2 -2
  152. package/dist/chunks/{index.89dfe209.js.map → index.5596079e.js.map} +1 -1
  153. package/dist/chunks/index.785d9829.js +21 -0
  154. package/dist/chunks/index.785d9829.js.map +1 -0
  155. package/dist/chunks/{index.85832db5.js → index.791fdd7d.js} +3 -3
  156. package/dist/chunks/{index.85832db5.js.map → index.791fdd7d.js.map} +1 -1
  157. package/dist/chunks/{index.0ee895e0.js → index.934e5485.js} +2 -2
  158. package/dist/chunks/{index.0ee895e0.js.map → index.934e5485.js.map} +1 -1
  159. package/dist/chunks/index.9424976e.js +622 -0
  160. package/dist/chunks/index.9424976e.js.map +1 -0
  161. package/dist/chunks/index.99d2c4e5.js +168 -0
  162. package/dist/chunks/index.99d2c4e5.js.map +1 -0
  163. package/dist/chunks/{index.98174339.js → index.a875e4b3.js} +5 -5
  164. package/dist/chunks/{index.98174339.js.map → index.a875e4b3.js.map} +1 -1
  165. package/dist/chunks/{index.c6fecf1c.js → index.fd70b861.js} +28 -28
  166. package/dist/chunks/{index.c6fecf1c.js.map → index.fd70b861.js.map} +1 -1
  167. package/dist/chunks/{listbox-option-tag.b1eb32bd.js → listbox-option-tag.854fcb0d.js} +3 -3
  168. package/dist/chunks/{listbox-option-tag.b1eb32bd.js.map → listbox-option-tag.854fcb0d.js.map} +1 -1
  169. package/dist/chunks/listbox.963589af.js +1419 -0
  170. package/dist/chunks/listbox.963589af.js.map +1 -0
  171. package/dist/chunks/{loading-button.4b88e24d.js → loading-button.09fa0115.js} +19 -19
  172. package/dist/chunks/{loading-button.4b88e24d.js.map → loading-button.09fa0115.js.map} +1 -1
  173. package/dist/chunks/{tooltip.27c32d36.js → tooltip.65868eae.js} +15 -15
  174. package/dist/chunks/tooltip.65868eae.js.map +1 -0
  175. package/dist/chunks/use-has-slot.4d98bf29.js.map +1 -1
  176. package/dist/code-snippet.js +7 -7
  177. package/dist/code-snippet.js.map +1 -1
  178. package/dist/country.js +2 -2
  179. package/dist/currency.js +1 -1
  180. package/dist/data-grid.js +1287 -983
  181. package/dist/data-grid.js.map +1 -1
  182. package/dist/date-picker.js +20 -20
  183. package/dist/date-picker.js.map +1 -1
  184. package/dist/date-range-picker.js +2 -2
  185. package/dist/date.js +1 -1
  186. package/dist/divider.js +2 -10
  187. package/dist/divider.js.map +1 -1
  188. package/dist/dropdown.js +3 -3
  189. package/dist/empty-state.js +23 -23
  190. package/dist/empty-state.js.map +1 -1
  191. package/dist/filter-bar.js +553 -541
  192. package/dist/filter-bar.js.map +1 -1
  193. package/dist/focus-trap.js +1 -1
  194. package/dist/form-layout.js +2 -2
  195. package/dist/header.js +3 -3
  196. package/dist/index.js +73 -72
  197. package/dist/info-icon.js +3 -3
  198. package/dist/input-field.js +4 -4
  199. package/dist/internal.js +17 -15
  200. package/dist/link.js +2 -2
  201. package/dist/loading-indicator.js +1 -1
  202. package/dist/menu.js +1 -1
  203. package/dist/modal.js +67 -64
  204. package/dist/modal.js.map +1 -1
  205. package/dist/pagination.js +4 -4
  206. package/dist/payment-method.js +2 -2
  207. package/dist/popover.js +1 -1
  208. package/dist/popper-container.js +1 -1
  209. package/dist/radio-group.js +69 -67
  210. package/dist/radio-group.js.map +1 -1
  211. package/dist/search-bar.js +8 -8
  212. package/dist/segmented-control.js +3 -3
  213. package/dist/sidepanel.js +5 -5
  214. package/dist/status.js +2 -2
  215. package/dist/stepper.js +3 -3
  216. package/dist/structured-list.js +1 -1
  217. package/dist/summary-grid.js +3 -3
  218. package/dist/tabs.js +3 -3
  219. package/dist/tag.js +3 -3
  220. package/dist/textarea.js +173 -161
  221. package/dist/textarea.js.map +1 -1
  222. package/dist/timeline.js +244 -237
  223. package/dist/timeline.js.map +1 -1
  224. package/dist/toast.js +3 -3
  225. package/dist/toggle.js +2 -2
  226. package/dist/tutorial.js +5 -5
  227. package/dist/typography.js +1 -1
  228. package/dist/web-types.json +1 -1
  229. package/package.json +2 -2
  230. package/dist/chunks/base-modal.a629cb32.js.map +0 -1
  231. package/dist/chunks/button.82ed953e.js +0 -148
  232. package/dist/chunks/button.82ed953e.js.map +0 -1
  233. package/dist/chunks/checkbox.731dc0ab.js +0 -264
  234. package/dist/chunks/checkbox.731dc0ab.js.map +0 -1
  235. package/dist/chunks/controls-group.d6543674.js.map +0 -1
  236. package/dist/chunks/copy.330d594e.js +0 -126
  237. package/dist/chunks/copy.330d594e.js.map +0 -1
  238. package/dist/chunks/dropdown-default-textbox.4108b289.js.map +0 -1
  239. package/dist/chunks/dropdown.63de9aac.js.map +0 -1
  240. package/dist/chunks/index.73ed22a7.js +0 -594
  241. package/dist/chunks/index.73ed22a7.js.map +0 -1
  242. package/dist/chunks/index.edcaf766.js +0 -150
  243. package/dist/chunks/index.edcaf766.js.map +0 -1
  244. package/dist/chunks/listbox.ac43f8ab.js +0 -1309
  245. package/dist/chunks/listbox.ac43f8ab.js.map +0 -1
  246. package/dist/chunks/tooltip.27c32d36.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.js","sources":["../../vue2/src/components/checkbox/components/checkbox-group/checkbox-group.types.ts","../../vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCheckboxGroupVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport interface BentoCheckboxGroupItem {\n value: string | number;\n label: string;\n description?: string;\n disabled?: boolean;\n hasError?: boolean;\n errorMessage?: string;\n readonly?: boolean;\n}\n\nexport type BentoCheckboxGroupItems = Array<BentoCheckboxGroupItem>;\n","<template>\n <div class=\"b-checkbox-group\">\n <controls-group\n class=\"b-checkbox-group__checkboxes\"\n :aria-describedby=\"shouldShowGroupErrorMessage ? errorId : ''\"\n :class=\"conditionalClasses\"\n :description=\"description\"\n :disabled=\"disabled\"\n :form=\"formId\"\n :hide-label=\"hideLabel\"\n :label=\"label\"\n :optional=\"optional\"\n :required=\"required\"\n :tooltip-text=\"tooltipText\"\n >\n <bento-checkbox\n v-for=\"item in items\"\n :key=\"item.value\"\n :model-value=\"inputValue\"\n :value=\"item.value\"\n :disabled=\"disabled || item.disabled\"\n :has-error=\"shouldShowGroupError || item.hasError\"\n :error-message=\"shouldShowGroupError ? null : item.errorMessage\"\n :readonly=\"isReadOnly || item.readonly\"\n @update:model-value=\"onInput\"\n >\n {{ item.label }}\n <template v-if=\"item.description\" #description>{{ item.description }}</template>\n </bento-checkbox>\n </controls-group>\n <error-message\n v-if=\"shouldShowGroupErrorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-checkbox-group__error-message\"\n />\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref, toRef, watch } from 'vue';\n import { ControlsGroup } from '@/components/internal/controls-group';\n import { ErrorMessage } from '@/components/internal/error-message';\n import { BentoCheckboxGroupItems, BentoCheckboxGroupVariant } from './checkbox-group.types';\n import BentoCheckbox from '@/components/checkbox/checkbox.vue';\n import { BentoCheckboxEvent } from '../../checkbox.types';\n import { generateUid } from '@/utils/ts/unique-id';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n /**\n * A checkbox group component should be used whenever it is necessary to group a set of checkboxes that are related together\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * import { BentoCheckboxGroup } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { BentoCheckboxGroup },\n * template: `\n * <bento-checkbox-group\n * label=\"Your group label\"\n * :items=\"[\n * { value: 1, label: 'Your label' },\n * { value: 2, label: 'Another label', description: 'Your sub label' },\n * ]\"\n * />\n * `\n * };\n */\n export default defineComponent({\n name: 'bento-checkbox-group',\n components: { BentoCheckbox, ControlsGroup, ErrorMessage },\n model: { prop: 'modelValue' },\n props: {\n /**\n * Descriptive supporting text visbile underneath the label.\n */\n description: { type: String, default: null },\n\n /**\n * If set to true, renders all checkboxes in the group in a disabled state.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Renders all checkboxes in an error state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * The form id the checkbox group is associated with. Defaults to null, as a checkbox group can also be used standalone.\n */\n formId: { type: String, default: null },\n\n /**\n * If set to true, renders all checkboxes in the group in an error state.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * Shows/hides the group label.\n */\n hideLabel: { type: Boolean, default: null },\n\n /**\n * The checkbox group's items.\n */\n items: { type: Array as PropType<BentoCheckboxGroupItems>, required: true },\n\n /**\n * The name associated with the group. Required for accessibility purposes.\n */\n label: { type: String, required: true },\n\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoCheckboxButtonItem's value.\n * Defaults to no value selected.\n */\n modelValue: { type: Array<number | string | null>, default: () => [] },\n\n /**\n * Indicates the field is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * If set to true, renders all checkboxes in the group in a readonly state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Indicates the field is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * The checkbox group's layout. It can be vertical or horizontal. Defaults to vertical.\n */\n variant: {\n type: String as PropType<BentoCheckboxGroupVariant | `${BentoCheckboxGroupVariant}`>,\n default: BentoCheckboxGroupVariant.VERTICAL,\n validator: (value: BentoCheckboxGroupVariant) =>\n Object.values(BentoCheckboxGroupVariant).includes(value),\n },\n },\n emits: [BentoCheckboxEvent.UPDATE, BentoCheckboxEvent.INPUT],\n setup(props, { emit }) {\n const errorId = generateUid('error');\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const shouldShowGroupError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.hasError)\n );\n const shouldShowGroupErrorMessage = computed(\n () => !props.disabled && !isReadOnly.value && !!props.errorMessage\n );\n\n const conditionalClasses = computed(() => ({\n 'b-checkbox-group__checkboxes--horizontal': props.variant === BentoCheckboxGroupVariant.HORIZONTAL,\n }));\n\n const inputValue = ref(props.modelValue);\n watch(\n () => props.modelValue,\n () => {\n inputValue.value = props.modelValue;\n }\n );\n\n const onInput = value => {\n inputValue.value = value;\n emit(BentoCheckboxEvent.UPDATE, value);\n emit(BentoCheckboxEvent.INPUT, value);\n };\n\n if (props.hasError) {\n deprecate(\n 'BentoCheckboxGroup \"hasError\" property',\n `Use the BentoCheckboxGroup \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-checkbox-group errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n return {\n // Values\n errorId,\n isReadOnly,\n shouldShowGroupError,\n shouldShowGroupErrorMessage,\n conditionalClasses,\n inputValue,\n\n // Methods\n onInput,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./checkbox-group.scss\" />\n"],"names":["BentoCheckboxGroupVariant","BentoCheckboxGroupVariant2","_sfc_main","defineComponent","BentoCheckbox","ControlsGroup","ErrorMessage","value","BentoCheckboxEvent","props","emit","errorId","generateUid","isReadOnly","useFormLayoutFieldLoading","toRef","shouldShowGroupError","computed","shouldShowGroupErrorMessage","conditionalClasses","inputValue","ref","watch","onInput","deprecate","openBlock","createElementBlock","_hoisted_1","createVNode","_component_controls_group","normalizeClass","_ctx","Fragment","renderList","item","createBlock","_component_bento_checkbox","createSlots","_component_error_message"],"mappings":";;;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA;ACkER,MAAAE,IAAAC,EAAA;AAAA,EAA+B,MAAA;AAAA,EACrB,YAAA,EAAA,eAAAC,GAAA,eAAAC,GAAA,cAAAC,EAAA;AAAA,EACmD,OAAA,EAAA,MAAA,aAAA;AAAA,EAC7B,OAAA;AAAA;AAAA;AAAA;AAAA,IACrB,aAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA,IAIwC,UAAA,EAAA,MAAA,SAAA,SAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAKD,cAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA,IAKE,QAAA,EAAA,MAAA,QAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKN,UAAA,EAAA,MAAA,SAAA,SAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAOI,WAAA,EAAA,MAAA,SAAA,SAAA,KAAA;AAAA;AAAA;AAAA;AAAA,IAKA,OAAA,EAAA,MAAA,OAAA,UAAA,GAAA;AAAA;AAAA;AAAA;AAAA,IAKgC,OAAA,EAAA,MAAA,QAAA,UAAA,GAA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A,IAAA,GAAA,GAAA,CAAA,oBAAA,SAAA,eAAA,YAAA,QAAA,cAAA,SAAA,YAAA,YAAA,cAAA,CAAA;AAAA,IAIRN,EAAA,+BAAAN,EAAA,GAAAU,EAAAG,GAAA;AAAA,MAHc,KAAA;AAAA,MACX,IAAAP,EAAA;AAAA,MACK,iBAAAA,EAAA;AAAA;;;;;"}
1
+ {"version":3,"file":"checkbox.js","sources":["../../vue2/src/components/checkbox/components/checkbox-group/checkbox-group.types.ts","../../vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoCheckboxGroupVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport interface BentoCheckboxGroupItem {\n value: string | number;\n label: string;\n description?: string;\n disabled?: boolean;\n hasError?: boolean;\n errorMessage?: string;\n readonly?: boolean;\n}\n\nexport type BentoCheckboxGroupItems = Array<BentoCheckboxGroupItem>;\n","<template>\n <div class=\"b-checkbox-group\">\n <controls-group\n class=\"b-checkbox-group__checkboxes\"\n :aria-describedby=\"shouldShowGroupErrorMessage ? errorId : ''\"\n :component-name=\"COMPONENT_NAME\"\n :class=\"conditionalClasses\"\n :description=\"description\"\n :disabled=\"disabled\"\n :form=\"formId\"\n :hide-label=\"hideLabel\"\n :label=\"label\"\n :optional=\"optional\"\n :required=\"required\"\n :tooltip-text=\"tooltipText\"\n >\n <bento-checkbox\n v-for=\"item in items\"\n :key=\"item.value\"\n :model-value=\"inputValue\"\n :value=\"item.value\"\n :disabled=\"disabled || item.disabled\"\n :has-error=\"shouldShowGroupError || item.hasError\"\n :error-message=\"shouldShowGroupError ? null : item.errorMessage\"\n :readonly=\"isReadOnly || item.readonly\"\n @update:model-value=\"onInput\"\n >\n {{ item.label }}\n\n <template v-if=\"item.description\" #description>{{ item.description }}</template>\n\n <template v-if=\"hasContentSlot('content')\" #content>\n <slot name=\"content\" v-bind=\"item\"></slot>\n </template>\n </bento-checkbox>\n </controls-group>\n <error-message\n v-if=\"shouldShowGroupErrorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-checkbox-group__error-message\"\n />\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref, toRef, watch } from 'vue';\n import { ControlsGroup } from '@/components/internal/controls-group';\n import { ErrorMessage } from '@/components/internal/error-message';\n import { BentoCheckboxGroupItems, BentoCheckboxGroupVariant } from './checkbox-group.types';\n import BentoCheckbox from '@/components/checkbox/checkbox.vue';\n import { BentoCheckboxEvent } from '../../checkbox.types';\n import { generateUid } from '@/utils/ts/unique-id';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n /**\n * The name of the component to be used in the Vue devtools and console warnings.\n */\n const COMPONENT_NAME = 'bento-checkbox-group';\n\n /**\n * A checkbox group component should be used whenever it is necessary to group a set of checkboxes that are related together\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * import { BentoCheckboxGroup } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { BentoCheckboxGroup },\n * template: `\n * <bento-checkbox-group\n * label=\"Your group label\"\n * :items=\"[\n * { value: 1, label: 'Your label' },\n * { value: 2, label: 'Another label', description: 'Your sub label' },\n * ]\"\n * />\n * `\n * };\n */\n export default defineComponent({\n name: COMPONENT_NAME,\n components: { BentoCheckbox, ControlsGroup, ErrorMessage },\n model: { prop: 'modelValue' },\n props: {\n /**\n * Descriptive supporting text visbile underneath the label.\n */\n description: { type: String, default: null },\n\n /**\n * If set to true, renders all checkboxes in the group in a disabled state.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Renders all checkboxes in an error state with an error message.\n */\n errorMessage: { type: String, default: null },\n\n /**\n * The form id the checkbox group is associated with. Defaults to null, as a checkbox group can also be used standalone.\n */\n formId: { type: String, default: null },\n\n /**\n * If set to true, renders all checkboxes in the group in an error state.\n *\n * @deprecated Use \"errorMessage\" prop instead\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * Shows/hides the group label.\n */\n hideLabel: { type: Boolean, default: null },\n\n /**\n * The checkbox group's items.\n */\n items: { type: Array as PropType<BentoCheckboxGroupItems>, required: true },\n\n /**\n * The name associated with the group. Required for accessibility purposes.\n */\n label: { type: String, required: true },\n\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoCheckboxButtonItem's value.\n * Defaults to no value selected.\n */\n modelValue: { type: Array<number | string | null>, default: () => [] },\n\n /**\n * Indicates the field is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * If set to true, renders all checkboxes in the group in a readonly state.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Indicates the field is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Tooltip message.\n */\n tooltipText: { type: String, default: null },\n\n /**\n * The checkbox group's layout. It can be vertical or horizontal. Defaults to vertical.\n */\n variant: {\n type: String as PropType<BentoCheckboxGroupVariant | `${BentoCheckboxGroupVariant}`>,\n default: BentoCheckboxGroupVariant.VERTICAL,\n validator: (value: BentoCheckboxGroupVariant) =>\n Object.values(BentoCheckboxGroupVariant).includes(value),\n },\n },\n emits: [BentoCheckboxEvent.UPDATE, BentoCheckboxEvent.INPUT],\n setup(props, { emit, slots }) {\n const errorId = generateUid('error');\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n const shouldShowGroupError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.hasError)\n );\n const shouldShowGroupErrorMessage = computed(\n () => !props.disabled && !isReadOnly.value && !!props.errorMessage\n );\n\n const conditionalClasses = computed(() => ({\n 'b-checkbox-group__checkboxes--horizontal': props.variant === BentoCheckboxGroupVariant.HORIZONTAL,\n }));\n\n // Slots logic\n // Temporary, use-has-slots composable doesn't currently work for\n // vue3 named scoped slots\n const hasContentSlot = name => !!slots[name];\n const shouldShowSlotsError = computed(() => hasContentSlot('content') && props.variant !== 'vertical');\n\n watch(\n shouldShowSlotsError,\n newValue => {\n if (newValue) {\n throw new Error('The content slot is only available for the vertical checkbox group layout');\n }\n },\n { immediate: true }\n );\n\n const inputValue = ref(props.modelValue);\n watch(\n () => props.modelValue,\n () => {\n inputValue.value = props.modelValue;\n }\n );\n\n const onInput = value => {\n inputValue.value = value;\n emit(BentoCheckboxEvent.UPDATE, value);\n emit(BentoCheckboxEvent.INPUT, value);\n };\n\n if (props.hasError) {\n deprecate(\n 'BentoCheckboxGroup \"hasError\" property',\n `Use the BentoCheckboxGroup \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-checkbox-group errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n return {\n // Values\n COMPONENT_NAME,\n errorId,\n isReadOnly,\n shouldShowGroupError,\n shouldShowGroupErrorMessage,\n conditionalClasses,\n inputValue,\n hasContentSlot,\n\n // Methods\n onInput,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./checkbox-group.scss\" />\n"],"names":["BentoCheckboxGroupVariant","BentoCheckboxGroupVariant2","COMPONENT_NAME","_sfc_main","defineComponent","BentoCheckbox","ControlsGroup","ErrorMessage","value","BentoCheckboxEvent","props","emit","slots","errorId","generateUid","isReadOnly","useFormLayoutFieldLoading","toRef","shouldShowGroupError","computed","shouldShowGroupErrorMessage","conditionalClasses","hasContentSlot","name","shouldShowSlotsError","watch","newValue","inputValue","ref","onInput","deprecate","openBlock","createElementBlock","_hoisted_1","createVNode","_component_controls_group","normalizeClass","_ctx","Fragment","renderList","item","createBlock","_component_bento_checkbox","createSlots","withCtx","_component_error_message"],"mappings":";;;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,aAAA,cACAA,EAAA,WAAA,YAFQA,IAAAD,KAAA,CAAA,CAAA;ACwDR,MAAAE,IAAA,wBAqBAC,IAAAC,EAAA;AAAA,EAA+B,MAAAF;AAAA,EAC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IAIRP,EAAA,+BAAAN,EAAA,GAAAU,EAAAI,GAAA;AAAA,MAHc,KAAA;AAAA,MACX,IAAAR,EAAA;AAAA,MACK,iBAAAA,EAAA;AAAA;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as B, computed as C, ref as y, resolveComponent as _, openBlock as r, createElementBlock as l, normalizeClass as m, renderSlot as u, createCommentVNode as d, createBlock as S, withCtx as k } from "vue";
2
- import { B as g } from "./index.75f3672e.js";
2
+ import { B as g } from "./index.10c545e2.js";
3
3
  import { u as h } from "./use-has-slot.4d98bf29.js";
4
4
  import { _ as L } from "./_plugin-vue_export-helper.dad06003.js";
5
5
  import "../assets/base-button.css";
@@ -113,4 +113,4 @@ export {
113
113
  T as B,
114
114
  n as a
115
115
  };
116
- //# sourceMappingURL=base-button.aa085dfa.js.map
116
+ //# sourceMappingURL=base-button.dfc0e32e.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base-button.aa085dfa.js","sources":["../../../vue2/src/components/internal/base-button/base-button.types.ts","../../../vue2/src/components/internal/base-button/base-button.vue"],"sourcesContent":["export enum BentoBaseButtonPropClass {\n DESTRUCTIVE = 'critical',\n ICON_ONLY = 'icon-only',\n}\n\nexport enum BentoBaseButtonEvent {\n BLUR = 'blur',\n CLICK = 'click',\n FOCUS = 'focus',\n KEYDOWN_ESC = 'keydown.esc',\n}\n\nexport enum BaseButtonType {\n BUTTON = 'button',\n RESET = 'reset',\n SUBMIT = 'submit',\n}\n","<template>\n <button\n ref=\"bentoBaseButtonRef\"\n class=\"b-base-button\"\n :class=\"conditionalClasses\"\n :disabled=\"disabled\"\n :type=\"type\"\n :aria-expanded=\"ariaAttributes['aria-expanded']\"\n @click=\"onClickButton\"\n @focus=\"onFocusButton\"\n @blur=\"onBlurButton\"\n >\n <span v-if=\"hasSlot('iconLeft')\" class=\"b-base-button__icon-left\" data-testid=\"icon-button-left\">\n <slot name=\"iconLeft\" />\n </span>\n <bento-typography v-if=\"hasSlot('default')\" el=\"span\" variant=\"body\" stronger class=\"b-base-button__label\">\n <slot />\n </bento-typography>\n <span v-if=\"hasSlot('iconRight')\" class=\"b-base-button__icon-right\" data-testid=\"icon-button-right\">\n <slot name=\"iconRight\" />\n </span>\n </button>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref } from 'vue';\n import { BentoBaseButtonEvent, BentoBaseButtonPropClass } from './base-button.types';\n import type { ButtonHTMLAttributes } from 'vue/types/jsx';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n import { Booleanish } from '@/types';\n\n /**\n * Base button component to use as a base for all the various types of bento buttons. For internal use only.\n *\n * * @example\n * import { BaseButton, BaseButtonEvent } from '@/components/internal/base-button';\n * import YourImportedIcon from @adyen/ui-assets-icons-16/example-icon';\n *\n * export default {\n * components: { BaseButton, YourImportedIcon },\n * props: {\n * text:\n * },\n * template: `\n * <base-button class=\"your-custom-button-styles\" @click=\"onClick\">\n * <template #iconLeft><your-imported-icon></template>\n * Button text\n * <template #iconRight><your-imported-icon></template>\n * </base-button>\n * `,\n * emits: [BentoButtonEvent.CLICK],\n * setup: (prps, { emit }) => {\n * const onClick = value => emit(BaseButtonEvent.CLICK, value);\n *\n * return {\n * onClick,\n * };\n * }\n * }\n */\n export default defineComponent({\n name: 'base-button',\n components: { BentoTypography },\n props: {\n /**\n * Disables button functionality\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays button as critical\n */\n critical: {\n type: Boolean,\n default: false,\n },\n /**\n * The default behavior of the button.\n * Possible values are: 'button', 'reset', 'submit'\n */\n type: {\n type: String as PropType<ButtonHTMLAttributes['type']>,\n default: 'button',\n },\n },\n emits: [\n BentoBaseButtonEvent.CLICK,\n BentoBaseButtonEvent.FOCUS,\n BentoBaseButtonEvent.BLUR,\n BentoBaseButtonEvent.KEYDOWN_ESC,\n ],\n setup(props, { slots, emit, attrs }) {\n const ariaAttributes = computed(() => ({\n 'aria-expanded': attrs['aria-expanded']?.toString() as Booleanish,\n }));\n\n const bentoBaseButtonRef = ref(null);\n\n const conditionalClasses = computed(() => ({\n [`b-base-button--${BentoBaseButtonPropClass.DESTRUCTIVE}`]: props.critical,\n [`b-base-button--${BentoBaseButtonPropClass.ICON_ONLY}`]: !slots.default,\n }));\n\n const onClickButton = (e: MouseEvent) => {\n if (!props.disabled) {\n emit(BentoBaseButtonEvent.CLICK, e);\n } else {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n const onFocusButton = (e: FocusEvent) => {\n emit(BentoBaseButtonEvent.FOCUS, e);\n };\n\n const onBlurButton = (e: FocusEvent) => {\n emit(BentoBaseButtonEvent.BLUR, e);\n };\n\n return {\n // Values\n ariaAttributes,\n conditionalClasses,\n\n // Methods\n onClickButton,\n onFocusButton,\n onBlurButton,\n hasSlot: useHasSlot(slots),\n\n // Refs\n bentoBaseButtonRef,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./base-button.scss\" />\n"],"names":["BentoBaseButtonPropClass","BentoBaseButtonPropClass2","BentoBaseButtonEvent","BentoBaseButtonEvent2","_sfc_main","defineComponent","BentoTypography","props","slots","emit","attrs","ariaAttributes","computed","_a","bentoBaseButtonRef","ref","conditionalClasses","e","useHasSlot","openBlock","createElementBlock","normalizeClass","_ctx","_cache","args","createCommentVNode","createBlock","_component_bento_typography","_hoisted_3"],"mappings":";;;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,cAAA,YACAA,EAAA,YAAA,aAFQA,IAAAD,KAAA,CAAA,CAAA,GAKAE,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,QAAA,SACAA,EAAA,QAAA,SACAA,EAAA,cAAA,eAJQA,IAAAD,KAAA,CAAA,CAAA;ACwDR,MAAAE,IAAAC,EAAA;AAAA,EAA+B,MAAA;AAAA,EACrB,YAAA,EAAA,iBAAAC,EAAA;AAAA,EACwB,OAAA;AAAA;AAAA;AAAA;AAAA,IACvB,UAAA;AAAA,MAIO,MAAA;AAAA,MACA,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A;;;;AAf/D,SAAAK,EAAA,GAAAC,EAAA,UAAA;AAAA,IACG,KAAA;AAAA,IACP,OAAAC,EAAA,CAAA,iBAAAC,EAAA,kBAAA,CAAA;AAAA,IACU,UAAAA,EAAA;AAAA,IACG,MAAAA,EAAA;AAAA,IACR,iBAAAA,EAAA,eAAA,eAAA;AAAA,IACE,SAAAC,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,IAAAC,MAAAF,EAAA,iBAAAA,EAAA,cAAA,GAAAE,CAAA;AAAA,IACW,SAAAD,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,IAAAC,MAAAF,EAAA,iBAAAA,EAAA,cAAA,GAAAE,CAAA;AAAA;EAEA,GAAA;AAAA;;IAGK,CAAA,KAAAC,EAAA,IAAA,EAAA;AAAA,IAELH,EAAA,QAAA,SAAA,KAAAH,EAAA,GAAAO,EAAAC,GAAA;AAAA,MAFkC,KAAA;AAAA,MAAC,IAAA;AAAA,MAAe,SAAA;AAAA,MAAe,UAAA;AAAA;;;;;;;IAGpFL,EAAA,QAAA,WAAA,KAAAH,EAAA,GAAAC,EAAA,QAAAQ,GAAA;AAAA;;;;;"}
1
+ {"version":3,"file":"base-button.dfc0e32e.js","sources":["../../../vue2/src/components/internal/base-button/base-button.types.ts","../../../vue2/src/components/internal/base-button/base-button.vue"],"sourcesContent":["export enum BentoBaseButtonPropClass {\n DESTRUCTIVE = 'critical',\n ICON_ONLY = 'icon-only',\n}\n\nexport enum BentoBaseButtonEvent {\n BLUR = 'blur',\n CLICK = 'click',\n FOCUS = 'focus',\n KEYDOWN_ESC = 'keydown.esc',\n}\n\nexport enum BaseButtonType {\n BUTTON = 'button',\n RESET = 'reset',\n SUBMIT = 'submit',\n}\n","<template>\n <button\n ref=\"bentoBaseButtonRef\"\n class=\"b-base-button\"\n :class=\"conditionalClasses\"\n :disabled=\"disabled\"\n :type=\"type\"\n :aria-expanded=\"ariaAttributes['aria-expanded']\"\n @click=\"onClickButton\"\n @focus=\"onFocusButton\"\n @blur=\"onBlurButton\"\n >\n <span v-if=\"hasSlot('iconLeft')\" class=\"b-base-button__icon-left\" data-testid=\"icon-button-left\">\n <slot name=\"iconLeft\" />\n </span>\n <bento-typography v-if=\"hasSlot('default')\" el=\"span\" variant=\"body\" stronger class=\"b-base-button__label\">\n <slot />\n </bento-typography>\n <span v-if=\"hasSlot('iconRight')\" class=\"b-base-button__icon-right\" data-testid=\"icon-button-right\">\n <slot name=\"iconRight\" />\n </span>\n </button>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref } from 'vue';\n import { BentoBaseButtonEvent, BentoBaseButtonPropClass } from './base-button.types';\n import type { ButtonHTMLAttributes } from 'vue/types/jsx';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables';\n import { Booleanish } from '@/types';\n\n /**\n * Base button component to use as a base for all the various types of bento buttons. For internal use only.\n *\n * * @example\n * import { BaseButton, BaseButtonEvent } from '@/components/internal/base-button';\n * import YourImportedIcon from @adyen/ui-assets-icons-16/example-icon';\n *\n * export default {\n * components: { BaseButton, YourImportedIcon },\n * props: {\n * text:\n * },\n * template: `\n * <base-button class=\"your-custom-button-styles\" @click=\"onClick\">\n * <template #iconLeft><your-imported-icon></template>\n * Button text\n * <template #iconRight><your-imported-icon></template>\n * </base-button>\n * `,\n * emits: [BentoButtonEvent.CLICK],\n * setup: (prps, { emit }) => {\n * const onClick = value => emit(BaseButtonEvent.CLICK, value);\n *\n * return {\n * onClick,\n * };\n * }\n * }\n */\n export default defineComponent({\n name: 'base-button',\n components: { BentoTypography },\n props: {\n /**\n * Disables button functionality\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays button as critical\n */\n critical: {\n type: Boolean,\n default: false,\n },\n /**\n * The default behavior of the button.\n * Possible values are: 'button', 'reset', 'submit'\n */\n type: {\n type: String as PropType<ButtonHTMLAttributes['type']>,\n default: 'button',\n },\n },\n emits: [\n BentoBaseButtonEvent.CLICK,\n BentoBaseButtonEvent.FOCUS,\n BentoBaseButtonEvent.BLUR,\n BentoBaseButtonEvent.KEYDOWN_ESC,\n ],\n setup(props, { slots, emit, attrs }) {\n const ariaAttributes = computed(() => ({\n 'aria-expanded': attrs['aria-expanded']?.toString() as Booleanish,\n }));\n\n const bentoBaseButtonRef = ref(null);\n\n const conditionalClasses = computed(() => ({\n [`b-base-button--${BentoBaseButtonPropClass.DESTRUCTIVE}`]: props.critical,\n [`b-base-button--${BentoBaseButtonPropClass.ICON_ONLY}`]: !slots.default,\n }));\n\n const onClickButton = (e: MouseEvent) => {\n if (!props.disabled) {\n emit(BentoBaseButtonEvent.CLICK, e);\n } else {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n\n const onFocusButton = (e: FocusEvent) => {\n emit(BentoBaseButtonEvent.FOCUS, e);\n };\n\n const onBlurButton = (e: FocusEvent) => {\n emit(BentoBaseButtonEvent.BLUR, e);\n };\n\n return {\n // Values\n ariaAttributes,\n conditionalClasses,\n\n // Methods\n onClickButton,\n onFocusButton,\n onBlurButton,\n hasSlot: useHasSlot(slots),\n\n // Refs\n bentoBaseButtonRef,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./base-button.scss\" />\n"],"names":["BentoBaseButtonPropClass","BentoBaseButtonPropClass2","BentoBaseButtonEvent","BentoBaseButtonEvent2","_sfc_main","defineComponent","BentoTypography","props","slots","emit","attrs","ariaAttributes","computed","_a","bentoBaseButtonRef","ref","conditionalClasses","e","useHasSlot","openBlock","createElementBlock","normalizeClass","_ctx","_cache","args","createCommentVNode","createBlock","_component_bento_typography","_hoisted_3"],"mappings":";;;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,cAAA,YACAA,EAAA,YAAA,aAFQA,IAAAD,KAAA,CAAA,CAAA,GAKAE,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,QAAA,SACAA,EAAA,QAAA,SACAA,EAAA,cAAA,eAJQA,IAAAD,KAAA,CAAA,CAAA;ACwDR,MAAA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C,EAAAV,CAAA;AAAA;AAAA,MACyB,oBAAAM;AAAA,IAGzB;AAAA,EACJ;AAER,CAAA;;EA9H2C,KAAA;AAAA,EAA2B,OAAA;AAAA;;EAM1B,KAAA;AAAA,EAA4B,OAAA;AAAA;;;;AAf/D,SAAAK,EAAA,GAAAC,EAAA,UAAA;AAAA,IACG,KAAA;AAAA,IACP,OAAAC,EAAA,CAAA,iBAAAC,EAAA,kBAAA,CAAA;AAAA,IACU,UAAAA,EAAA;AAAA,IACG,MAAAA,EAAA;AAAA,IACR,iBAAAA,EAAA,eAAA,eAAA;AAAA,IACE,SAAAC,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,IAAAC,MAAAF,EAAA,iBAAAA,EAAA,cAAA,GAAAE,CAAA;AAAA,IACW,SAAAD,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,IAAAC,MAAAF,EAAA,iBAAAA,EAAA,cAAA,GAAAE,CAAA;AAAA;EAEA,GAAA;AAAA;;IAGK,CAAA,KAAAC,EAAA,IAAA,EAAA;AAAA,IAELH,EAAA,QAAA,SAAA,KAAAH,EAAA,GAAAO,EAAAC,GAAA;AAAA,MAFkC,KAAA;AAAA,MAAC,IAAA;AAAA,MAAe,SAAA;AAAA,MAAe,UAAA;AAAA;;;;;;;IAGpFL,EAAA,QAAA,WAAA,KAAAH,EAAA,GAAAC,EAAA,QAAAQ,GAAA;AAAA;;;;;"}
@@ -1,15 +1,15 @@
1
- import { defineComponent as K, useAttrs as V, ref as I, computed as i, watch as R, onMounted as W, resolveComponent as m, openBlock as l, createElementBlock as h, createElementVNode as f, normalizeClass as T, withKeys as H, createVNode as S, withCtx as c, normalizeStyle as E, renderSlot as _, createCommentVNode as d, createBlock as y } from "vue";
2
- import { B as Q } from "./index.75f3672e.js";
3
- import { a as Y } from "./button.82ed953e.js";
4
- import { BentoDivider as j } from "../divider.js";
5
- import { B as J } from "./index.4d2a13e1.js";
1
+ import { defineComponent as K, useAttrs as V, ref as G, computed as d, watch as I, onMounted as W, resolveComponent as m, openBlock as n, createElementBlock as S, createElementVNode as _, normalizeClass as R, withKeys as H, createBlock as c, withCtx as b, normalizeStyle as O, createVNode as T, renderSlot as y, createCommentVNode as i } from "vue";
2
+ import { B as Q } from "./index.10c545e2.js";
3
+ import { a as Y } from "./button.6ca5cd14.js";
4
+ import { B as j } from "./index.785d9829.js";
5
+ import { B as J } from "./index.4e3fb264.js";
6
6
  import { u as X } from "./use-has-slot.4d98bf29.js";
7
7
  import { u as Z } from "./i18n.6c402773.js";
8
8
  import { C as x } from "./cross.26509efc.js";
9
9
  import { G as ee, a as oe } from "./grid-layout.c2fe3057.js";
10
10
  import { _ as te } from "./_plugin-vue_export-helper.dad06003.js";
11
11
  import "../assets/base-modal.css";
12
- var ae = /* @__PURE__ */ ((e) => (e.DEFAULT = "BentoModalDefault", e.DIALOG = "BentoModalDialog", e))(ae || {}), O = /* @__PURE__ */ ((e) => (e.SMALL = "small", e.MEDIUM = "medium", e.LARGE = "large", e))(O || {}), v = /* @__PURE__ */ ((e) => (e.SMALLER = "smaller", e.EQUAL = "equal", e.BIGGER = "bigger", e))(v || {}), M = /* @__PURE__ */ ((e) => (e.DIALOG = "dialog", e.ALERT_DIALOG = "alertdialog", e))(M || {}), ne = /* @__PURE__ */ ((e) => (e.CONFIRMATION = "confirmation", e.DESTRUCTIVE = "destructive", e.INFO = "info", e.ACKNOWLEDGEMENT = "acknowledgement", e))(ne || {}), B = /* @__PURE__ */ ((e) => (e.CLOSE_MODAL = "close-modal", e))(B || {});
12
+ var ae = /* @__PURE__ */ ((e) => (e.DEFAULT = "BentoModalDefault", e.DIALOG = "BentoModalDialog", e))(ae || {}), E = /* @__PURE__ */ ((e) => (e.SMALL = "small", e.MEDIUM = "medium", e.LARGE = "large", e))(E || {}), v = /* @__PURE__ */ ((e) => (e.SMALLER = "smaller", e.EQUAL = "equal", e.BIGGER = "bigger", e))(v || {}), p = /* @__PURE__ */ ((e) => (e.DIALOG = "dialog", e.ALERT_DIALOG = "alertdialog", e))(p || {}), ne = /* @__PURE__ */ ((e) => (e.CONFIRMATION = "confirmation", e.DESTRUCTIVE = "destructive", e.INFO = "info", e.ACKNOWLEDGEMENT = "acknowledgement", e))(ne || {}), M = /* @__PURE__ */ ((e) => (e.CLOSE_MODAL = "close-modal", e))(M || {});
13
13
  const P = {
14
14
  "en-US": {
15
15
  ariaLabelFallback: "modal",
@@ -82,7 +82,7 @@ const P = {
82
82
  /**
83
83
  * Defines whether the modal will be an alert modal
84
84
  */
85
- modalRole: { type: String, default: M.DIALOG },
85
+ modalRole: { type: String, default: p.DIALOG },
86
86
  /**
87
87
  * Allows the inner elments to overflow the dialog
88
88
  */
@@ -92,51 +92,51 @@ const P = {
92
92
  */
93
93
  size: {
94
94
  type: String,
95
- default: O.SMALL
95
+ default: E.SMALL
96
96
  },
97
97
  /**
98
98
  * If provided, renders the modal's content in a two-column layout an wth dividers separating its content
99
99
  */
100
100
  withColumnLayout: { type: Boolean, default: !1 }
101
101
  },
102
- emits: [B.CLOSE_MODAL],
103
- setup(e, { slots: n, emit: k }) {
104
- const { t: p } = Z({ messages: P }), w = V(), r = X(n), t = I(null), u = I(!1), L = i(() => e.isDismissible && !e.hideCloseButton), C = i(() => {
102
+ emits: [M.CLOSE_MODAL],
103
+ setup(e, { slots: s, emit: B }) {
104
+ const { t: L } = Z({ messages: P }), k = V(), r = X(s), t = G(null), u = G(!1), A = d(() => e.isDismissible && !e.hideCloseButton), C = d(() => {
105
105
  if (!e.customPadding)
106
106
  return {};
107
107
  const o = {
108
108
  paddingLeft: e.customPadding,
109
109
  paddingRight: e.customPadding
110
- }, s = { ...o, paddingTop: void 0, paddingBottom: void 0 };
111
- return r("default") || (s.paddingTop = e.customPadding), r("actions") || (s.paddingBottom = e.customPadding), {
110
+ }, l = { ...o, paddingTop: void 0, paddingBottom: void 0 };
111
+ return r("default") || (l.paddingTop = e.customPadding), r("actions") || (l.paddingBottom = e.customPadding), {
112
112
  header: { ...o, paddingTop: e.customPadding },
113
- content: s,
113
+ content: l,
114
114
  actions: { ...o, paddingBottom: e.customPadding }
115
115
  };
116
- }), A = i(
117
- () => w["aria-label"] ?? p("ariaLabelFallback")
118
- ), b = i(() => e.withColumnLayout && e.size === O.LARGE), a = () => {
116
+ }), h = d(
117
+ () => k["aria-label"] ?? L("ariaLabelFallback")
118
+ ), f = d(() => e.withColumnLayout && e.size === E.LARGE), a = () => {
119
119
  t.value.showModal();
120
120
  }, D = () => {
121
- k(B.CLOSE_MODAL);
121
+ B(M.CLOSE_MODAL);
122
122
  }, N = () => {
123
123
  u.value && (t.value.close(), D(), u.value = !1);
124
124
  }, g = () => {
125
125
  t.value.open && (u.value = !0);
126
- }, G = (o) => {
127
- o && o.preventDefault(), e.isDismissible && g();
126
+ }, w = (o) => {
127
+ o && o.preventDefault(), !(!e.isDismissible && e.modalRole === p.DIALOG) && g();
128
128
  }, $ = ({ target: o }) => {
129
- o && o.tagName === M.DIALOG.toUpperCase() && G();
130
- }, F = i(() => ({
129
+ o && o.tagName === p.DIALOG.toUpperCase() && w();
130
+ }, F = d(() => ({
131
131
  [`b-modal-base__container--${e.size}`]: e.size,
132
132
  "b-modal-base__container--hide": u.value,
133
133
  "b-modal-base__container--overflow-visible": e.overflowVisible,
134
- "b-modal-base__container--column-layout": b.value
135
- })), z = i(() => ({
136
- "b-modal-base__content--column-layout": b.value,
134
+ "b-modal-base__container--column-layout": f.value
135
+ })), z = d(() => ({
136
+ "b-modal-base__content--column-layout": f.value,
137
137
  "b-modal-base__content--with-header": r("default"),
138
138
  "b-modal-base__content--with-actions": r("actions")
139
- })), U = i(() => e.columnsSize === v.SMALLER ? [
139
+ })), U = d(() => e.columnsSize === v.SMALLER ? [
140
140
  { small: 4, medium: 4, large: 4 },
141
141
  { small: 8, medium: 8, large: 8 }
142
142
  ] : e.columnsSize === v.BIGGER ? [
@@ -146,18 +146,18 @@ const P = {
146
146
  { small: 6, medium: 6, large: 6 },
147
147
  { small: 6, medium: 6, large: 6 }
148
148
  ]);
149
- return R(
149
+ return I(
150
150
  () => [e.isOpen, t.value],
151
- ([o, s], [, q]) => {
152
- if (!s)
151
+ ([o, l], [, q]) => {
152
+ if (!l)
153
153
  return;
154
154
  o ? a() : !q || g();
155
155
  }
156
- ), R(
156
+ ), I(
157
157
  () => e.actions,
158
158
  () => {
159
- var o, s;
160
- ((s = (o = e.actions) == null ? void 0 : o[0]) == null ? void 0 : s.state) === "success" && setTimeout(g, se);
159
+ var o, l;
160
+ ((l = (o = e.actions) == null ? void 0 : o[0]) == null ? void 0 : l.state) === "success" && setTimeout(g, se);
161
161
  },
162
162
  { deep: !0 }
163
163
  ), W(() => {
@@ -165,23 +165,23 @@ const P = {
165
165
  }), {
166
166
  // Refs
167
167
  modal: t,
168
- computedAriaLabel: A,
169
- showCloseButton: L,
168
+ computedAriaLabel: h,
169
+ showCloseButton: A,
170
170
  // Handling the state
171
171
  openModal: a,
172
172
  closeModalOnClickOutside: $,
173
173
  closeModalAfterAnimation: N,
174
174
  startCloseModalAnimation: g,
175
175
  // Methods
176
- internalModalActionClose: G,
176
+ internalModalActionClose: w,
177
177
  hasSlot: r,
178
178
  emitCloseEvent: D,
179
- t: p,
179
+ t: L,
180
180
  // Styles
181
181
  modalConditionalClasses: F,
182
182
  modalContentConditionalClasses: z,
183
183
  customPaddingStyles: C,
184
- hasColumnLayout: b,
184
+ hasColumnLayout: f,
185
185
  computedColumnWidth: U,
186
186
  // Enums
187
187
  GridLayoutContainerType: oe
@@ -192,119 +192,119 @@ const ie = { class: "b-modal-base" }, de = ["role", "aria-label", "open"], re =
192
192
  "aria-label": "modal actions",
193
193
  class: "b-modal-base__actions"
194
194
  };
195
- function ce(e, n, k, p, w, r) {
196
- const t = m("bento-typography"), u = m("cross-icon"), L = m("bento-button"), C = m("bento-divider"), A = m("grid-layout"), b = m("bento-focus-trap");
197
- return l(), h("div", ie, [
198
- f("dialog", {
195
+ function ce(e, s, B, L, k, r) {
196
+ const t = m("bento-typography"), u = m("cross-icon"), A = m("bento-button"), C = m("bento-divider"), h = m("grid-layout"), f = m("bento-focus-trap");
197
+ return n(), S("div", ie, [
198
+ _("dialog", {
199
199
  ref: "modal",
200
200
  role: e.modalRole,
201
201
  "aria-label": e.computedAriaLabel,
202
- class: T(["b-modal-base__container", e.modalConditionalClasses]),
202
+ class: R(["b-modal-base__container", e.modalConditionalClasses]),
203
203
  open: e.initiallyOpen,
204
- onAnimationend: n[0] || (n[0] = (...a) => e.closeModalAfterAnimation && e.closeModalAfterAnimation(...a)),
205
- onClick: n[1] || (n[1] = (a) => e.isDismissible && e.closeModalOnClickOutside(a)),
206
- onKeydown: n[2] || (n[2] = H((...a) => e.internalModalActionClose && e.internalModalActionClose(...a), ["esc"]))
204
+ onAnimationend: s[0] || (s[0] = (...a) => e.closeModalAfterAnimation && e.closeModalAfterAnimation(...a)),
205
+ onClick: s[1] || (s[1] = (a) => e.isDismissible && e.closeModalOnClickOutside(a)),
206
+ onKeydown: s[2] || (s[2] = H((...a) => e.internalModalActionClose && e.internalModalActionClose(...a), ["esc"]))
207
207
  }, [
208
- S(b, null, {
209
- default: c(() => [
210
- f("div", re, [
211
- e.hasSlot("default") || e.showCloseButton ? (l(), h("div", {
208
+ e.isOpen || e.initiallyOpen ? (n(), c(f, { key: 0 }, {
209
+ default: b(() => [
210
+ _("div", re, [
211
+ e.hasSlot("default") || e.showCloseButton ? (n(), S("div", {
212
212
  key: 0,
213
213
  class: "b-modal-base__header-container",
214
- style: E(e.customPaddingStyles.header)
214
+ style: O(e.customPaddingStyles.header)
215
215
  }, [
216
- f("div", ue, [
217
- S(t, {
216
+ _("div", ue, [
217
+ T(t, {
218
218
  class: "b-modal-base__title",
219
219
  "aria-label": "base modal title",
220
220
  el: "span",
221
221
  variant: "title",
222
222
  stronger: ""
223
223
  }, {
224
- default: c(() => [
225
- e.hasSlot("default") ? _(e.$slots, "default", { key: 0 }, void 0, !0) : d("", !0)
224
+ default: b(() => [
225
+ e.hasSlot("default") ? y(e.$slots, "default", { key: 0 }, void 0, !0) : i("", !0)
226
226
  ]),
227
227
  _: 3
228
228
  }),
229
- e.showCloseButton ? (l(), y(L, {
229
+ e.showCloseButton ? (n(), c(A, {
230
230
  key: 0,
231
231
  class: "b-modal-base__close-button",
232
232
  variant: "tertiary",
233
233
  type: "button",
234
234
  onClick: e.internalModalActionClose
235
235
  }, {
236
- default: c(() => [
237
- S(u, {
236
+ default: b(() => [
237
+ T(u, {
238
238
  "svg-title": e.t("close")
239
239
  }, null, 8, ["svg-title"])
240
240
  ]),
241
241
  _: 1
242
- }, 8, ["onClick"])) : d("", !0)
242
+ }, 8, ["onClick"])) : i("", !0)
243
243
  ]),
244
- e.hasColumnLayout ? (l(), y(C, {
244
+ e.hasColumnLayout ? (n(), c(C, {
245
245
  key: 0,
246
246
  class: "b-modal-base__divider"
247
- })) : d("", !0)
248
- ], 4)) : d("", !0),
249
- f("div", {
250
- class: T(["b-modal-base__content", e.modalContentConditionalClasses]),
251
- style: E(e.customPaddingStyles.content)
247
+ })) : i("", !0)
248
+ ], 4)) : i("", !0),
249
+ _("div", {
250
+ class: R(["b-modal-base__content", e.modalContentConditionalClasses]),
251
+ style: O(e.customPaddingStyles.content)
252
252
  }, [
253
- e.hasSlot("content") || e.hasSlot("content-col-1") && e.hasSlot("content-col-2") ? (l(), y(t, {
253
+ e.hasSlot("content") || e.hasSlot("content-col-1") && e.hasSlot("content-col-2") ? (n(), c(t, {
254
254
  key: 0,
255
255
  "aria-label": "base modal content",
256
256
  el: "div",
257
257
  variant: "body",
258
258
  stronger: ""
259
259
  }, {
260
- default: c(() => [
261
- e.hasColumnLayout ? (l(), y(A, {
260
+ default: b(() => [
261
+ e.hasColumnLayout ? (n(), c(h, {
262
262
  key: 0,
263
263
  "column-width": e.computedColumnWidth,
264
264
  "container-type": e.GridLayoutContainerType.NORMAL,
265
265
  "no-gap": "",
266
266
  class: "b-modal-base__grid"
267
267
  }, {
268
- "col-1": c(() => [
269
- _(e.$slots, "content-col-1", {}, void 0, !0)
268
+ "col-1": b(() => [
269
+ y(e.$slots, "content-col-1", {}, void 0, !0)
270
270
  ]),
271
- "col-2": c(() => [
272
- _(e.$slots, "content-col-2", {}, void 0, !0)
271
+ "col-2": b(() => [
272
+ y(e.$slots, "content-col-2", {}, void 0, !0)
273
273
  ]),
274
274
  _: 3
275
- }, 8, ["column-width", "container-type"])) : _(e.$slots, "content", { key: 1 }, void 0, !0)
275
+ }, 8, ["column-width", "container-type"])) : y(e.$slots, "content", { key: 1 }, void 0, !0)
276
276
  ]),
277
277
  _: 3
278
- })) : d("", !0)
278
+ })) : i("", !0)
279
279
  ], 6),
280
- e.hasSlot("actions") ? (l(), h("div", {
280
+ e.hasSlot("actions") ? (n(), S("div", {
281
281
  key: 1,
282
282
  class: "b-modal-base__actions-container",
283
- style: E(e.customPaddingStyles.actions)
283
+ style: O(e.customPaddingStyles.actions)
284
284
  }, [
285
- e.hasColumnLayout ? (l(), y(C, {
285
+ e.hasColumnLayout ? (n(), c(C, {
286
286
  key: 0,
287
287
  class: "b-modal-base__divider"
288
- })) : d("", !0),
289
- f("div", me, [
290
- _(e.$slots, "actions", {}, void 0, !0)
288
+ })) : i("", !0),
289
+ _("div", me, [
290
+ y(e.$slots, "actions", {}, void 0, !0)
291
291
  ])
292
- ], 4)) : d("", !0)
292
+ ], 4)) : i("", !0)
293
293
  ])
294
294
  ]),
295
295
  _: 3
296
- })
296
+ })) : i("", !0)
297
297
  ], 42, de)
298
298
  ]);
299
299
  }
300
- const Se = /* @__PURE__ */ te(le, [["render", ce], ["__scopeId", "data-v-06699875"]]);
300
+ const Se = /* @__PURE__ */ te(le, [["render", ce], ["__scopeId", "data-v-257ca979"]]);
301
301
  export {
302
302
  ae as B,
303
- O as a,
303
+ E as a,
304
304
  v as b,
305
- M as c,
305
+ p as c,
306
306
  ne as d,
307
- B as e,
307
+ M as e,
308
308
  Se as f
309
309
  };
310
- //# sourceMappingURL=base-modal.a629cb32.js.map
310
+ //# sourceMappingURL=base-modal.8b323292.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-modal.8b323292.js","sources":["../../../vue2/src/components/modal/modal.types.ts","../../../vue2/src/components/modal/components/base-modal/base-modal.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoModalVariant {\n DEFAULT = 'BentoModalDefault',\n DIALOG = 'BentoModalDialog',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoModalSize {\n SMALL = 'small',\n MEDIUM = 'medium',\n LARGE = 'large',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoModalColumnLayoutVariant {\n SMALLER = 'smaller',\n EQUAL = 'equal',\n BIGGER = 'bigger',\n}\n\nexport enum BentoModalRole {\n DIALOG = 'dialog',\n ALERT_DIALOG = 'alertdialog',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoModalDialogType {\n CONFIRMATION = 'confirmation',\n DESTRUCTIVE = 'destructive',\n INFO = 'info',\n ACKNOWLEDGEMENT = 'acknowledgement',\n}\n\nexport enum BentoModalEvent {\n CLOSE_MODAL = 'close-modal',\n}\n","<template>\n <div class=\"b-modal-base\">\n <dialog\n ref=\"modal\"\n :role=\"modalRole\"\n :aria-label=\"computedAriaLabel\"\n class=\"b-modal-base__container\"\n :class=\"modalConditionalClasses\"\n :open=\"initiallyOpen\"\n @animationend=\"closeModalAfterAnimation\"\n @click=\"isDismissible && closeModalOnClickOutside($event)\"\n @keydown.esc=\"internalModalActionClose\"\n >\n <bento-focus-trap v-if=\"isOpen || initiallyOpen\">\n <div class=\"b-modal-base__wrapper\">\n <div\n v-if=\"hasSlot('default') || showCloseButton\"\n class=\"b-modal-base__header-container\"\n :style=\"customPaddingStyles.header\"\n >\n <div class=\"b-modal-base__header\">\n <bento-typography\n class=\"b-modal-base__title\"\n aria-label=\"base modal title\"\n el=\"span\"\n variant=\"title\"\n stronger\n >\n <slot v-if=\"hasSlot('default')\" />\n </bento-typography>\n <bento-button\n v-if=\"showCloseButton\"\n class=\"b-modal-base__close-button\"\n variant=\"tertiary\"\n type=\"button\"\n @click=\"internalModalActionClose\"\n >\n <cross-icon :svg-title=\"t('close')\" />\n </bento-button>\n </div>\n\n <bento-divider v-if=\"hasColumnLayout\" class=\"b-modal-base__divider\" />\n </div>\n\n <div\n class=\"b-modal-base__content\"\n :class=\"modalContentConditionalClasses\"\n :style=\"customPaddingStyles.content\"\n >\n <bento-typography\n v-if=\"hasSlot('content') || (hasSlot('content-col-1') && hasSlot('content-col-2'))\"\n aria-label=\"base modal content\"\n el=\"div\"\n variant=\"body\"\n stronger\n >\n <grid-layout\n v-if=\"hasColumnLayout\"\n :column-width=\"computedColumnWidth\"\n :container-type=\"GridLayoutContainerType.NORMAL\"\n no-gap\n class=\"b-modal-base__grid\"\n >\n <template #col-1><slot name=\"content-col-1\"></slot></template>\n <template #col-2><slot name=\"content-col-2\"></slot></template>\n </grid-layout>\n <slot v-else name=\"content\" />\n </bento-typography>\n </div>\n\n <div\n v-if=\"hasSlot('actions')\"\n class=\"b-modal-base__actions-container\"\n :style=\"customPaddingStyles.actions\"\n >\n <bento-divider v-if=\"hasColumnLayout\" class=\"b-modal-base__divider\" />\n\n <div aria-label=\"modal actions\" class=\"b-modal-base__actions\">\n <slot name=\"actions\" />\n </div>\n </div>\n </div>\n </bento-focus-trap>\n </dialog>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, onMounted, PropType, ref, useAttrs, watch } from 'vue';\n import {\n BentoModalColumnLayoutVariant,\n BentoModalEvent,\n BentoModalRole,\n BentoModalSize,\n } from '@/components/modal/modal.types';\n\n import { BentoTypography } from '@/components/typography';\n import { BentoButton, BentoButtonActionsList } from '@/components/button';\n import { BentoDivider } from '@/components/divider';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import { GridLayout, GridLayoutContainerType } from '@/internal';\n import { useHasSlot } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n const LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME = 500;\n\n export default defineComponent({\n i18n: { messages },\n name: 'base-modal',\n components: { CrossIcon, BentoTypography, BentoButton, BentoDivider, BentoFocusTrap, GridLayout },\n props: {\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n * But you may change the color of 1-st action to red with 'critial' key\n * Not more than 3 action buttons can be provided\n * Or 2 action buttons and 1 Label for them\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',2\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * If a column layout is provided, it renders the respective left column width variant. This can be smaller than the second column, the same size as the second column or bigger than the second column.\n */\n columnsSize: {\n type: String as PropType<BentoModalColumnLayoutVariant>,\n default: BentoModalColumnLayoutVariant.SMALLER,\n },\n\n /**\n * If provided, manages the padding of the whole modal container\n */\n customPadding: { type: String, default: null },\n\n /**\n * Hides a cross icon on the right side of the title\n */\n hideCloseButton: { type: Boolean, required: true },\n\n /**\n * Sets the open attribute on the dialog element, use isOpen instead to toggle modal visbility.\n */\n initiallyOpen: { type: Boolean, default: false },\n\n /**\n * If set to true, it allows the modal to be closed by clicking outside of it\n */\n isDismissible: { type: Boolean, required: true },\n\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: { type: Boolean, required: true },\n\n /**\n * Defines whether the modal will be an alert modal\n */\n modalRole: { type: String, default: BentoModalRole.DIALOG },\n\n /**\n * Allows the inner elments to overflow the dialog\n */\n overflowVisible: { type: Boolean, default: false },\n\n /**\n * Sets the width of the modal\n */\n size: {\n type: String as PropType<BentoModalSize | `${BentoModalSize}`>,\n default: BentoModalSize.SMALL,\n },\n\n /**\n * If provided, renders the modal's content in a two-column layout an wth dividers separating its content\n */\n withColumnLayout: { type: Boolean, default: false },\n },\n emits: [BentoModalEvent.CLOSE_MODAL],\n setup(props, { slots, emit }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const attrs = useAttrs();\n const hasSlot = useHasSlot(slots);\n const modal = ref<HTMLDialogElement>(null);\n const isClosing = ref(false);\n\n const showCloseButton = computed(() => props.isDismissible && !props.hideCloseButton);\n\n const customPaddingStyles = computed(() => {\n if (!props.customPadding) {\n return {};\n }\n\n const xPadding = {\n paddingLeft: props.customPadding,\n paddingRight: props.customPadding,\n };\n\n const content = { ...xPadding, paddingTop: undefined, paddingBottom: undefined };\n\n if (!hasSlot('default')) {\n content.paddingTop = props.customPadding;\n }\n\n if (!hasSlot('actions')) {\n content.paddingBottom = props.customPadding;\n }\n\n return {\n header: { ...xPadding, paddingTop: props.customPadding },\n content,\n actions: { ...xPadding, paddingBottom: props.customPadding },\n };\n });\n\n const computedAriaLabel = computed(\n () => (attrs['aria-label'] as string) ?? (t('ariaLabelFallback') as string)\n );\n const hasColumnLayout = computed(() => props.withColumnLayout && props.size === BentoModalSize.LARGE);\n\n const openModal = (): void => {\n modal.value.showModal();\n };\n\n const emitCloseEvent = (): void => {\n emit(BentoModalEvent.CLOSE_MODAL);\n };\n\n // Handle closing and closing animation for dialog element\n const closeModalAfterAnimation = () => {\n if (isClosing.value) {\n modal.value.close();\n emitCloseEvent();\n isClosing.value = false;\n }\n };\n\n const startCloseModalAnimation = () => {\n if (!modal.value.open) {\n return;\n }\n isClosing.value = true;\n };\n\n /**\n * If the user has pressed escape, clicked outside or clicked the close icon.\n * Needs to be called from outside, following the \"dialog.close()\" pattern,\n * when the closing event is triggered outside of the \"base-modal\"\n * component (e.g. from a closing action).\n */\n const internalModalActionClose = (event?: Event) => {\n if (event) {\n event.preventDefault();\n }\n if (!props.isDismissible && props.modalRole === BentoModalRole.DIALOG) {\n return;\n }\n startCloseModalAnimation();\n };\n\n /**\n * Since the dialog HTML element doesn't automatically close when clicking outside, a check on when the user is clicking is needed.\n * If the click doesn't happen in the dialog box itself, the modal closes\n */\n const closeModalOnClickOutside = ({ target }: Event): void => {\n if (target && (target as HTMLElement).tagName === BentoModalRole.DIALOG.toUpperCase()) {\n internalModalActionClose();\n }\n };\n\n const modalConditionalClasses = computed(() => ({\n [`b-modal-base__container--${props.size}`]: props.size,\n 'b-modal-base__container--hide': isClosing.value,\n 'b-modal-base__container--overflow-visible': props.overflowVisible,\n 'b-modal-base__container--column-layout': hasColumnLayout.value,\n }));\n\n const modalContentConditionalClasses = computed(() => ({\n 'b-modal-base__content--column-layout': hasColumnLayout.value,\n 'b-modal-base__content--with-header': hasSlot('default'),\n 'b-modal-base__content--with-actions': hasSlot('actions'),\n }));\n\n const computedColumnWidth = computed(() => {\n if (props.columnsSize === BentoModalColumnLayoutVariant.SMALLER) {\n return [\n { small: 4, medium: 4, large: 4 },\n { small: 8, medium: 8, large: 8 },\n ];\n }\n if (props.columnsSize === BentoModalColumnLayoutVariant.BIGGER) {\n return [\n { small: 8, medium: 8, large: 8 },\n { small: 4, medium: 4, large: 4 },\n ];\n }\n return [\n { small: 6, medium: 6, large: 6 },\n { small: 6, medium: 6, large: 6 },\n ];\n });\n\n watch(\n () => [props.isOpen, modal.value],\n ([newIsOpen, newModalValue], [, oldModalValue]): void => {\n if (!newModalValue) {\n return;\n }\n\n const isFirstMutation = !oldModalValue;\n if (newIsOpen) {\n openModal();\n } else if (!isFirstMutation) {\n startCloseModalAnimation();\n }\n }\n );\n\n // If the first button is a loading button then close the modal have 0.5 seconds\n // if the state is changed to 'success'.\n watch(\n () => props.actions,\n () => {\n if (props.actions?.[0]?.state === 'success') {\n setTimeout(startCloseModalAnimation, LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME);\n }\n },\n { deep: true }\n );\n\n onMounted(() => {\n if (props.isOpen && modal.value) {\n openModal();\n }\n });\n\n return {\n // Refs\n modal,\n computedAriaLabel,\n showCloseButton,\n\n // Handling the state\n openModal,\n closeModalOnClickOutside,\n closeModalAfterAnimation,\n startCloseModalAnimation,\n\n // Methods\n internalModalActionClose,\n hasSlot,\n emitCloseEvent,\n t,\n\n // Styles\n modalConditionalClasses,\n modalContentConditionalClasses,\n customPaddingStyles,\n hasColumnLayout,\n computedColumnWidth,\n\n // Enums\n GridLayoutContainerType,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./base-modal.scss\" />\n"],"names":["BentoModalVariant","BentoModalVariant2","BentoModalSize","BentoModalSize2","BentoModalColumnLayoutVariant","BentoModalColumnLayoutVariant2","BentoModalRole","BentoModalRole2","BentoModalDialogType","BentoModalDialogType2","BentoModalEvent","BentoModalEvent2","LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME","_sfc_main","defineComponent","messages","CrossIcon","BentoTypography","BentoButton","BentoDivider","BentoFocusTrap","GridLayout","props","slots","emit","t","useI18n","attrs","useAttrs","hasSlot","useHasSlot","modal","ref","isClosing","showCloseButton","computed","customPaddingStyles","xPadding","content","computedAriaLabel","hasColumnLayout","openModal","emitCloseEvent","closeModalAfterAnimation","startCloseModalAnimation","internalModalActionClose","event","closeModalOnClickOutside","target","modalConditionalClasses","modalContentConditionalClasses","computedColumnWidth","watch","newIsOpen","newModalValue","oldModalValue","_b","_a","onMounted","GridLayoutContainerType","_hoisted_2","_hoisted_4","createElementVNode","_ctx","normalizeClass","_cache","args","$event","withKeys","withCtx","_hoisted_3","openBlock","createElementBlock","normalizeStyle","createVNode","_component_bento_typography","renderSlot","createCommentVNode","_component_cross_icon","createBlock","_component_grid_layout","_hoisted_5"],"mappings":";;;;;;;;;;;AAG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AAA;AAAA,cAC2Bf,EAAA,OAAAmB,IAAA;AAAA;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as d, computed as s, toRef as u, provide as l, openBlock as c, createElementBlock as p, createElementVNode as m, createVNode as _, unref as n, createBlock as f, createCommentVNode as v } from "vue";
2
- import { M as b, B as y } from "./index.73ed22a7.js";
3
- import { B as h } from "./index.98174339.js";
2
+ import { M as b, B as y } from "./index.9424976e.js";
3
+ import { B as h } from "./index.a875e4b3.js";
4
4
  import { BentoButtonActions as B } from "../button.js";
5
5
  import { _ as A } from "./_plugin-vue_export-helper.dad06003.js";
6
6
  import "../assets/button-actions-with-menu.css";
@@ -104,4 +104,4 @@ const C = /* @__PURE__ */ A(M, [["__scopeId", "data-v-f58eba13"]]);
104
104
  export {
105
105
  C as B
106
106
  };
107
- //# sourceMappingURL=button-actions-with-menu.f6dfb14d.js.map
107
+ //# sourceMappingURL=button-actions-with-menu.044fe230.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button-actions-with-menu.f6dfb14d.js","sources":["../../../vue2/src/components/internal/button-actions-with-menu/button-actions-with-menu.vue"],"sourcesContent":["<template>\n <div class=\"b-button-actions-with-menu\">\n <div role=\"group\" class=\"b-button-actions-with-menu__container-wrapper\">\n <bento-button-actions :actions=\"computedActions\" :inverse=\"inverse\" />\n <bento-menu v-if=\"computedMenuActions.length\" :data=\"computedMenuActions\" :menu-position=\"menuPosition\" />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, provide, toRef } from 'vue';\n import BentoMenu from '@/components/menu/menu.vue';\n import { BentoMenuItem } from '@/components/menu/components/menu-item/menu-item.types';\n import { BentoButtonActions, BentoButtonActionsList } from '@/components/button';\n import { MENU_INVERSE_INJECTION_KEY } from '@/components/menu/menu.keys';\n import { BentoPopoverPositions } from '@/components/popover';\n\n /**\n * An internal button actions component with the option to display some of the actions in a menu.\n *\n * @example\n * <button-actions-with-menu\n * :actions=\"[\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\n * :displayedActions=\"2\"\n * />\n */\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon` (optional): Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n variant: 'default',\n external: true,\n to: 'https://www.adyen.com/'\n },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: 'primary',\n * critical: true\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n required: true,\n },\n\n /**\n * The number of actions to be displayed. The rest of the actions will be collapsed in a menu component.\n */\n displayedActions: {\n type: Number,\n default: undefined,\n },\n\n /**\n * Set inverse color scheme to buttons and menu\n */\n inverse: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The position of where the menu should open.\n */\n menuPosition: {\n type: String as PropType<BentoPopoverPositions | `${BentoPopoverPositions}`>,\n default: 'bottom-start',\n validator: (value: BentoPopoverPositions) => Object.values(BentoPopoverPositions).includes(value),\n },\n });\n\n const computedActions = computed(() => props.actions.slice(0, props.displayedActions));\n const inverseRef = toRef(props, 'inverse');\n\n provide(MENU_INVERSE_INJECTION_KEY, inverseRef);\n\n const computedMenuActions = computed(() =>\n props.displayedActions !== undefined && props.displayedActions < props.actions.length\n ? (props.actions.slice(props.displayedActions, props.actions.length).map(el => ({\n text: el.title,\n handler: el.event,\n icon: el.icon,\n critical: el.critical,\n disabled: el.disabled,\n })) as BentoMenuItem[])\n : []\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * An internal button actions component with the option to display some of the actions in a menu.\n *\n * @example\n * <button-actions-with-menu\n * :actions=\"[\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\n * :displayedActions=\"2\"\n * />\n */\n\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./button-actions-with-menu.scss\" />\n"],"names":["__default__","computedActions","computed","props","inverseRef","toRef","provide","MENU_INVERSE_INJECTION_KEY","computedMenuActions","el"],"mappings":";;;;;;;;;GAwJIA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA5CAC,IAAAC,EAAA,MAAAC,EAAA,QAAA,MAAA,GAAAA,EAAA,gBAAA,CAAA,GACAC,IAAAC,EAAAF,GAAA,SAAA;AAEA,IAAAG,EAAAC,GAAAH,CAAA;AAEA,UAAAI,IAAAN;AAAA,MAA4B,MAAAC,EAAA,qBAAA,UAAAA,EAAA,mBAAAA,EAAA,QAAA,SAAAA,EAAA,QAAA,MAAAA,EAAA,kBAAAA,EAAA,QAAA,MAAA,EAAA,IAAA,CAAAM,OAAA;AAAA,QAE4D,MAAAA,EAAA;AAAA,QACjE,SAAAA,EAAA;AAAA,QACG,MAAAA,EAAA;AAAA,QACH,UAAAA,EAAA;AAAA,QACI,UAAAA,EAAA;AAAA,MACA,EAAA,IAAA,CAAA;AAAA,IAEhB;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"button-actions-with-menu.044fe230.js","sources":["../../../vue2/src/components/internal/button-actions-with-menu/button-actions-with-menu.vue"],"sourcesContent":["<template>\n <div class=\"b-button-actions-with-menu\">\n <div role=\"group\" class=\"b-button-actions-with-menu__container-wrapper\">\n <bento-button-actions :actions=\"computedActions\" :inverse=\"inverse\" />\n <bento-menu v-if=\"computedMenuActions.length\" :data=\"computedMenuActions\" :menu-position=\"menuPosition\" />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, provide, toRef } from 'vue';\n import BentoMenu from '@/components/menu/menu.vue';\n import { BentoMenuItem } from '@/components/menu/components/menu-item/menu-item.types';\n import { BentoButtonActions, BentoButtonActionsList } from '@/components/button';\n import { MENU_INVERSE_INJECTION_KEY } from '@/components/menu/menu.keys';\n import { BentoPopoverPositions } from '@/components/popover';\n\n /**\n * An internal button actions component with the option to display some of the actions in a menu.\n *\n * @example\n * <button-actions-with-menu\n * :actions=\"[\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\n * :displayedActions=\"2\"\n * />\n */\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon` (optional): Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n variant: 'default',\n external: true,\n to: 'https://www.adyen.com/'\n },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: 'primary',\n * critical: true\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n required: true,\n },\n\n /**\n * The number of actions to be displayed. The rest of the actions will be collapsed in a menu component.\n */\n displayedActions: {\n type: Number,\n default: undefined,\n },\n\n /**\n * Set inverse color scheme to buttons and menu\n */\n inverse: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The position of where the menu should open.\n */\n menuPosition: {\n type: String as PropType<BentoPopoverPositions | `${BentoPopoverPositions}`>,\n default: 'bottom-start',\n validator: (value: BentoPopoverPositions) => Object.values(BentoPopoverPositions).includes(value),\n },\n });\n\n const computedActions = computed(() => props.actions.slice(0, props.displayedActions));\n const inverseRef = toRef(props, 'inverse');\n\n provide(MENU_INVERSE_INJECTION_KEY, inverseRef);\n\n const computedMenuActions = computed(() =>\n props.displayedActions !== undefined && props.displayedActions < props.actions.length\n ? (props.actions.slice(props.displayedActions, props.actions.length).map(el => ({\n text: el.title,\n handler: el.event,\n icon: el.icon,\n critical: el.critical,\n disabled: el.disabled,\n })) as BentoMenuItem[])\n : []\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * An internal button actions component with the option to display some of the actions in a menu.\n *\n * @example\n * <button-actions-with-menu\n * :actions=\"[\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\n * :displayedActions=\"2\"\n * />\n */\n\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./button-actions-with-menu.scss\" />\n"],"names":["__default__","computedActions","computed","props","inverseRef","toRef","provide","MENU_INVERSE_INJECTION_KEY","computedMenuActions","el"],"mappings":";;;;;;;;;GAwJIA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA5CAC,IAAAC,EAAA,MAAAC,EAAA,QAAA,MAAA,GAAAA,EAAA,gBAAA,CAAA,GACAC,IAAAC,EAAAF,GAAA,SAAA;AAEA,IAAAG,EAAAC,GAAAH,CAAA;AAEA,UAAAI,IAAAN;AAAA,MAA4B,MAAAC,EAAA,qBAAA,UAAAA,EAAA,mBAAAA,EAAA,QAAA,SAAAA,EAAA,QAAA,MAAAA,EAAA,kBAAAA,EAAA,QAAA,MAAA,EAAA,IAAA,CAAAM,OAAA;AAAA,QAE4D,MAAAA,EAAA;AAAA,QACjE,SAAAA,EAAA;AAAA,QACG,MAAAA,EAAA;AAAA,QACH,UAAAA,EAAA;AAAA,QACI,UAAAA,EAAA;AAAA,MACA,EAAA,IAAA,CAAA;AAAA,IAEhB;;;;;;;;;;;;;;;;;"}