@adyen/bento-vue2 1.22.0 → 1.23.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 (207) hide show
  1. package/dist/@types/index.d.ts +111 -23
  2. package/dist/accordion.js +3 -3
  3. package/dist/action-bar.js +7 -7
  4. package/dist/alert.js +7 -7
  5. package/dist/assets/base-modal.css +1 -1
  6. package/dist/assets/button.css +1 -1
  7. package/dist/assets/dialog-page.css +1 -1
  8. package/dist/assets/index10.css +1 -1
  9. package/dist/assets/index11.css +1 -1
  10. package/dist/assets/index12.css +1 -1
  11. package/dist/assets/index13.css +1 -1
  12. package/dist/assets/index14.css +1 -1
  13. package/dist/assets/index15.css +1 -1
  14. package/dist/assets/index16.css +1 -1
  15. package/dist/assets/index17.css +1 -1
  16. package/dist/assets/index18.css +1 -1
  17. package/dist/assets/index19.css +1 -1
  18. package/dist/assets/index2.css +1 -1
  19. package/dist/assets/index20.css +1 -1
  20. package/dist/assets/index21.css +1 -1
  21. package/dist/assets/index22.css +1 -1
  22. package/dist/assets/index23.css +1 -1
  23. package/dist/assets/index24.css +1 -1
  24. package/dist/assets/index25.css +1 -1
  25. package/dist/assets/index26.css +1 -1
  26. package/dist/assets/index27.css +1 -1
  27. package/dist/assets/index28.css +1 -1
  28. package/dist/assets/index29.css +1 -1
  29. package/dist/assets/index3.css +1 -1
  30. package/dist/assets/index30.css +1 -1
  31. package/dist/assets/index31.css +1 -1
  32. package/dist/assets/index32.css +1 -1
  33. package/dist/assets/index33.css +1 -1
  34. package/dist/assets/index34.css +1 -1
  35. package/dist/assets/index35.css +1 -1
  36. package/dist/assets/index36.css +1 -1
  37. package/dist/assets/index37.css +1 -1
  38. package/dist/assets/index38.css +1 -1
  39. package/dist/assets/index39.css +1 -1
  40. package/dist/assets/index4.css +1 -1
  41. package/dist/assets/index40.css +1 -1
  42. package/dist/assets/index41.css +1 -1
  43. package/dist/assets/index42.css +1 -1
  44. package/dist/assets/index43.css +1 -1
  45. package/dist/assets/index44.css +1 -1
  46. package/dist/assets/index45.css +1 -1
  47. package/dist/assets/index46.css +1 -1
  48. package/dist/assets/index47.css +1 -1
  49. package/dist/assets/index48.css +1 -1
  50. package/dist/assets/index5.css +1 -1
  51. package/dist/assets/index6.css +1 -1
  52. package/dist/assets/index7.css +1 -1
  53. package/dist/assets/index8.css +1 -1
  54. package/dist/assets/index9.css +1 -1
  55. package/dist/avatar-image.js +1 -1
  56. package/dist/button.js +5 -5
  57. package/dist/card.js +4 -4
  58. package/dist/checkbox.js +6 -6
  59. package/dist/chunks/{base-button.6bd3ae4d.js → base-button.025269d7.js} +2 -2
  60. package/dist/chunks/{base-button.6bd3ae4d.js.map → base-button.025269d7.js.map} +1 -1
  61. package/dist/chunks/{base-modal.bf917e7d.js → base-modal.c354f456.js} +7 -7
  62. package/dist/chunks/{base-modal.bf917e7d.js.map → base-modal.c354f456.js.map} +1 -1
  63. package/dist/chunks/{button-actions-with-menu.ec7dfc53.js → button-actions-with-menu.15d22fa3.js} +4 -4
  64. package/dist/chunks/{button-actions-with-menu.ec7dfc53.js.map → button-actions-with-menu.15d22fa3.js.map} +1 -1
  65. package/dist/chunks/{button-actions.2bf1d9d1.js → button-actions.3882346f.js} +3 -3
  66. package/dist/chunks/{button-actions.2bf1d9d1.js.map → button-actions.3882346f.js.map} +1 -1
  67. package/dist/chunks/{button.80c3c527.js → button.a823da67.js} +3 -3
  68. package/dist/chunks/{button.80c3c527.js.map → button.a823da67.js.map} +1 -1
  69. package/dist/chunks/{calendar.8cbb911d.js → calendar.4ba3b251.js} +5 -5
  70. package/dist/chunks/{calendar.8cbb911d.js.map → calendar.4ba3b251.js.map} +1 -1
  71. package/dist/chunks/{checkbox-input.17e832f1.js → checkbox-input.1c3cc8ed.js} +2 -2
  72. package/dist/chunks/{checkbox-input.17e832f1.js.map → checkbox-input.1c3cc8ed.js.map} +1 -1
  73. package/dist/chunks/{checkbox.11454247.js → checkbox.1edcc4c0.js} +4 -4
  74. package/dist/chunks/{checkbox.11454247.js.map → checkbox.1edcc4c0.js.map} +1 -1
  75. package/dist/chunks/{checkmark-circle-fill.75b87a2c.js → checkmark-circle-fill.345311d2.js} +2 -2
  76. package/dist/chunks/{checkmark-circle-fill.75b87a2c.js.map → checkmark-circle-fill.345311d2.js.map} +1 -1
  77. package/dist/chunks/{checkmark-small.07adbfcb.js → checkmark-small.520f01b1.js} +2 -2
  78. package/dist/chunks/{checkmark-small.07adbfcb.js.map → checkmark-small.520f01b1.js.map} +1 -1
  79. package/dist/chunks/{checkmark.9979f1c1.js → checkmark.a6ed8f47.js} +2 -2
  80. package/dist/chunks/{checkmark.9979f1c1.js.map → checkmark.a6ed8f47.js.map} +1 -1
  81. package/dist/chunks/{chevron-left.64e168be.js → chevron-left.5edf02ac.js} +2 -2
  82. package/dist/chunks/{chevron-left.64e168be.js.map → chevron-left.5edf02ac.js.map} +1 -1
  83. package/dist/chunks/{chevron-up.628ac446.js → chevron-up.81185563.js} +2 -2
  84. package/dist/chunks/{chevron-up.628ac446.js.map → chevron-up.81185563.js.map} +1 -1
  85. package/dist/chunks/{controls-group.0892d082.js → controls-group.b17e40ad.js} +3 -3
  86. package/dist/chunks/{controls-group.0892d082.js.map → controls-group.b17e40ad.js.map} +1 -1
  87. package/dist/chunks/{copy.2d2c6b85.js → copy.b20b47f9.js} +4 -4
  88. package/dist/chunks/{copy.2d2c6b85.js.map → copy.b20b47f9.js.map} +1 -1
  89. package/dist/chunks/{cross-circle-fill.34e86c56.js → cross-circle-fill.27580c4b.js} +2 -2
  90. package/dist/chunks/{cross-circle-fill.34e86c56.js.map → cross-circle-fill.27580c4b.js.map} +1 -1
  91. package/dist/chunks/{cross-small.e3c016cb.js → cross-small.e851e0de.js} +2 -2
  92. package/dist/chunks/{cross-small.e3c016cb.js.map → cross-small.e851e0de.js.map} +1 -1
  93. package/dist/chunks/{cross.e5433f3b.js → cross.04678d81.js} +2 -2
  94. package/dist/chunks/{cross.e5433f3b.js.map → cross.04678d81.js.map} +1 -1
  95. package/dist/chunks/{dialog-page.21f1eb92.js → dialog-page.3965f89e.js} +3 -3
  96. package/dist/chunks/{dialog-page.21f1eb92.js.map → dialog-page.3965f89e.js.map} +1 -1
  97. package/dist/chunks/{dropdown-default-textbox.9c23c94d.js → dropdown-default-textbox.537c81a2.js} +57 -37
  98. package/dist/chunks/dropdown-default-textbox.537c81a2.js.map +1 -0
  99. package/dist/chunks/{dropdown.dad8cedd.js → dropdown.93a582cc.js} +20 -21
  100. package/dist/chunks/{dropdown.dad8cedd.js.map → dropdown.93a582cc.js.map} +1 -1
  101. package/dist/chunks/{error-message.5fdafd8c.js → error-message.7022fa86.js} +3 -3
  102. package/dist/chunks/{error-message.5fdafd8c.js.map → error-message.7022fa86.js.map} +1 -1
  103. package/dist/chunks/{fixed-scroller.e917ed3f.js → fixed-scroller.077a5709.js} +3 -3
  104. package/dist/chunks/{fixed-scroller.e917ed3f.js.map → fixed-scroller.077a5709.js.map} +1 -1
  105. package/dist/chunks/{footer-actions.599e5a1d.js → footer-actions.1f22f86d.js} +4 -4
  106. package/dist/chunks/{footer-actions.599e5a1d.js.map → footer-actions.1f22f86d.js.map} +1 -1
  107. package/dist/chunks/{index.5af5de46.js → index.0b534dc6.js} +3 -3
  108. package/dist/chunks/{index.5af5de46.js.map → index.0b534dc6.js.map} +1 -1
  109. package/dist/chunks/{index.73634ace.js → index.0be6a210.js} +31 -32
  110. package/dist/chunks/{index.73634ace.js.map → index.0be6a210.js.map} +1 -1
  111. package/dist/chunks/{index.d681cfda.js → index.19675c16.js} +12 -11
  112. package/dist/chunks/index.19675c16.js.map +1 -0
  113. package/dist/chunks/{index.929dda57.js → index.255c82a2.js} +107 -106
  114. package/dist/chunks/index.255c82a2.js.map +1 -0
  115. package/dist/chunks/{index.0c4a8dd9.js → index.59d76d6b.js} +3 -3
  116. package/dist/chunks/{index.0c4a8dd9.js.map → index.59d76d6b.js.map} +1 -1
  117. package/dist/chunks/{index.937a82c2.js → index.787ded40.js} +7 -7
  118. package/dist/chunks/{index.937a82c2.js.map → index.787ded40.js.map} +1 -1
  119. package/dist/chunks/{index.66c8d79f.js → index.7a59b0b8.js} +7 -7
  120. package/dist/chunks/{index.66c8d79f.js.map → index.7a59b0b8.js.map} +1 -1
  121. package/dist/chunks/{index.7d2ea1de.js → index.9d130872.js} +2 -2
  122. package/dist/chunks/{index.7d2ea1de.js.map → index.9d130872.js.map} +1 -1
  123. package/dist/chunks/{index.823243d9.js → index.b231f9ef.js} +2 -2
  124. package/dist/chunks/{index.823243d9.js.map → index.b231f9ef.js.map} +1 -1
  125. package/dist/chunks/{index.0c33067d.js → index.be6917c8.js} +2 -2
  126. package/dist/chunks/{index.0c33067d.js.map → index.be6917c8.js.map} +1 -1
  127. package/dist/chunks/{index.3ddbe834.js → index.f828081b.js} +2 -2
  128. package/dist/chunks/{index.3ddbe834.js.map → index.f828081b.js.map} +1 -1
  129. package/dist/chunks/{info-filled.ee9571d9.js → info-filled.c37e091d.js} +2 -2
  130. package/dist/chunks/{info-filled.ee9571d9.js.map → info-filled.c37e091d.js.map} +1 -1
  131. package/dist/chunks/{info.b11d377e.js → info.8b6328aa.js} +2 -2
  132. package/dist/chunks/{info.b11d377e.js.map → info.8b6328aa.js.map} +1 -1
  133. package/dist/chunks/{listbox-option-tag.52ca5a60.js → listbox-option-tag.e025da67.js} +3 -3
  134. package/dist/chunks/{listbox-option-tag.52ca5a60.js.map → listbox-option-tag.e025da67.js.map} +1 -1
  135. package/dist/chunks/{listbox.6d8bd2ae.js → listbox.f99c2f3e.js} +8 -8
  136. package/dist/chunks/{listbox.6d8bd2ae.js.map → listbox.f99c2f3e.js.map} +1 -1
  137. package/dist/chunks/{loading-button.73c0bd64.js → loading-button.5de13e50.js} +4 -4
  138. package/dist/chunks/{loading-button.73c0bd64.js.map → loading-button.5de13e50.js.map} +1 -1
  139. package/dist/chunks/{payment-method.eeb54552.js → payment-method.bf9e71a2.js} +2 -2
  140. package/dist/chunks/{payment-method.eeb54552.js.map → payment-method.bf9e71a2.js.map} +1 -1
  141. package/dist/chunks/{refresh.f8e1b23c.js → refresh.71a03998.js} +2 -2
  142. package/dist/chunks/{refresh.f8e1b23c.js.map → refresh.71a03998.js.map} +1 -1
  143. package/dist/chunks/{search.4b38a2ef.js → search.471270fe.js} +2 -2
  144. package/dist/chunks/{search.4b38a2ef.js.map → search.471270fe.js.map} +1 -1
  145. package/dist/chunks/{tooltip.a9133b59.js → tooltip.eb1eb37e.js} +3 -3
  146. package/dist/chunks/{tooltip.a9133b59.js.map → tooltip.eb1eb37e.js.map} +1 -1
  147. package/dist/chunks/use-click-outside.941d1600.js +14 -0
  148. package/dist/chunks/use-click-outside.941d1600.js.map +1 -0
  149. package/dist/code-snippet.js +7 -7
  150. package/dist/code-snippet.js.map +1 -1
  151. package/dist/country.js +2 -2
  152. package/dist/currency.js +1 -1
  153. package/dist/data-grid-template.js +1 -1
  154. package/dist/data-grid.js +857 -772
  155. package/dist/data-grid.js.map +1 -1
  156. package/dist/date-picker.js +39 -40
  157. package/dist/date-picker.js.map +1 -1
  158. package/dist/date-range-picker.js +2 -2
  159. package/dist/date.js +1 -1
  160. package/dist/divider.js +1 -1
  161. package/dist/dropdown.js +7 -7
  162. package/dist/empty-state.js +3 -3
  163. package/dist/filter-bar.js +424 -431
  164. package/dist/filter-bar.js.map +1 -1
  165. package/dist/focus-trap.js +1 -1
  166. package/dist/form-layout.js +2 -2
  167. package/dist/header.js +5 -5
  168. package/dist/index.js +20 -20
  169. package/dist/info-icon.js +4 -4
  170. package/dist/input-field.js +4 -4
  171. package/dist/internal.js +8 -8
  172. package/dist/link.js +1 -1
  173. package/dist/loading-indicator.js +1 -1
  174. package/dist/menu.js +1 -1
  175. package/dist/modal-fullscreen.js +7 -7
  176. package/dist/modal.js +6 -6
  177. package/dist/pagination.js +4 -4
  178. package/dist/payment-method.js +1 -1
  179. package/dist/popover.js +1 -1
  180. package/dist/popper-container.js +1 -1
  181. package/dist/radio-group.js +4 -4
  182. package/dist/search-bar.js +4 -4
  183. package/dist/secondary-nav.js +2 -2
  184. package/dist/segmented-control.js +4 -4
  185. package/dist/selection-card.js +5 -5
  186. package/dist/sidepanel.js +7 -7
  187. package/dist/status.js +2 -2
  188. package/dist/stepper.js +144 -133
  189. package/dist/stepper.js.map +1 -1
  190. package/dist/structured-list.js +1 -1
  191. package/dist/summary-grid.js +3 -3
  192. package/dist/tabs.js +3 -3
  193. package/dist/tag.js +3 -3
  194. package/dist/textarea.js +4 -4
  195. package/dist/timeline.js +7 -7
  196. package/dist/toast.js +5 -5
  197. package/dist/toggle.js +3 -3
  198. package/dist/tutorial.js +7 -7
  199. package/dist/typography.js +1 -1
  200. package/dist/web-types.json +41 -1
  201. package/package.json +3 -3
  202. package/dist/chunks/directive.0408e565.js +0 -23
  203. package/dist/chunks/directive.0408e565.js.map +0 -1
  204. package/dist/chunks/dropdown-default-textbox.9c23c94d.js.map +0 -1
  205. package/dist/chunks/index.929dda57.js.map +0 -1
  206. package/dist/chunks/index.d681cfda.js.map +0 -1
  207. /package/dist/assets/{cross-small.css → cross.css} +0 -0
package/dist/tutorial.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import { defineComponent as g, ref as d, computed as a, isRef as R, watch as F, nextTick as $ } from "vue";
2
- import { B as I } from "./chunks/index.929dda57.js";
3
- import { B as S, a as P } from "./chunks/index.937a82c2.js";
4
- import { B as k } from "./chunks/index.0c33067d.js";
2
+ import { B as I } from "./chunks/index.255c82a2.js";
3
+ import { B as S, a as P } from "./chunks/index.787ded40.js";
4
+ import { B as k } from "./chunks/index.be6917c8.js";
5
5
  import { BentoImage as w } from "./image.js";
6
6
  import { u as A } from "./chunks/i18n.eb5b985b.js";
7
- import { R as N } from "./chunks/refresh.f8e1b23c.js";
7
+ import { R as N } from "./chunks/refresh.71a03998.js";
8
8
  import { n as f } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
9
- import { a as T, h as D, o as M } from "./chunks/index.0c4a8dd9.js";
10
- import { B as V } from "./chunks/button-actions.2bf1d9d1.js";
11
- import "./assets/index39.css";
9
+ import { a as T, h as D, o as M } from "./chunks/index.59d76d6b.js";
10
+ import { B as V } from "./chunks/button-actions.3882346f.js";
11
+ import "./assets/index44.css";
12
12
  var E;
13
13
  const j = /* @__PURE__ */ g({
14
14
  __name: "tutorial-indicator",
@@ -1,4 +1,4 @@
1
- import { B as p, c as e, b as r, a as y } from "./chunks/index.0c33067d.js";
1
+ import { B as p, c as e, b as r, a as y } from "./chunks/index.be6917c8.js";
2
2
  export {
3
3
  p as BentoTypography,
4
4
  e as BentoTypographyElement,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "@adyen/bento-vue2",
4
- "version": "1.22.0",
4
+ "version": "1.23.0",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -4900,6 +4900,24 @@
4900
4900
  "symbol": "default"
4901
4901
  }
4902
4902
  },
4903
+ {
4904
+ "name": "conditional-stepper-stub",
4905
+ "description": "",
4906
+ "attributes": [
4907
+ {
4908
+ "name": "withExtraSteps",
4909
+ "required": true,
4910
+ "value": {
4911
+ "kind": "expression",
4912
+ "type": "boolean"
4913
+ }
4914
+ }
4915
+ ],
4916
+ "source": {
4917
+ "module": "./src/components/stepper/__tests__/conditional-stepper-stub.vue",
4918
+ "symbol": "default"
4919
+ }
4920
+ },
4903
4921
  {
4904
4922
  "name": "controls-group",
4905
4923
  "description": "",
@@ -5398,6 +5416,15 @@
5398
5416
  },
5399
5417
  "default": "(item: BentoDatagridDataItem) => item.id"
5400
5418
  },
5419
+ {
5420
+ "name": "hoveredOverColumnState",
5421
+ "required": true,
5422
+ "description": "The column hovered over state and whether the hovered over column should show a border right or left.",
5423
+ "value": {
5424
+ "kind": "expression",
5425
+ "type": "DatagridColumnHoveringState"
5426
+ }
5427
+ },
5401
5428
  {
5402
5429
  "name": "isDataItemDisabled",
5403
5430
  "description": "A customisable method to determine if a row is not selectable.\nThe default is that every row is selectable.",
@@ -5588,6 +5615,15 @@
5588
5615
  },
5589
5616
  "default": "false"
5590
5617
  },
5618
+ {
5619
+ "name": "hoveredOverColumnState",
5620
+ "required": true,
5621
+ "description": "The column hovered over state and whether the hovered over column should show a border right or left.",
5622
+ "value": {
5623
+ "kind": "expression",
5624
+ "type": "DatagridColumnHoveringState"
5625
+ }
5626
+ },
5591
5627
  {
5592
5628
  "name": "isMeasuringColunWidths",
5593
5629
  "description": "Toggled to true when the DataGrid has auto width columns and is measuring the",
@@ -5664,6 +5700,10 @@
5664
5700
  "events": [
5665
5701
  {
5666
5702
  "name": "<undefined>"
5703
+ },
5704
+ {
5705
+ "name": "column-hover",
5706
+ "description": "Emitted when a column header is hovered over."
5667
5707
  }
5668
5708
  ],
5669
5709
  "slots": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adyen/bento-vue2",
3
- "version": "1.22.0",
3
+ "version": "1.23.0",
4
4
  "description": "Adyen Bento Vue2 components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -62,7 +62,7 @@
62
62
  "url": "git@github.com:Adyen/bento.git"
63
63
  },
64
64
  "dependencies": {
65
- "@adyen/bento-design-tokens": "1.22.0",
65
+ "@adyen/bento-design-tokens": "1.23.0",
66
66
  "@adyen/ui-assets-icons-16": "4.1.0",
67
67
  "@adyen/ui-assets-payment-method-icons": "6.1.0",
68
68
  "@codemirror/commands": "6.3.3",
@@ -89,7 +89,7 @@
89
89
  "react": "16.14.0"
90
90
  },
91
91
  "devDependencies": {
92
- "@adyen/bento-cli": "0.0.14",
92
+ "@adyen/bento-cli": "0.0.15",
93
93
  "@storybook/addon-a11y": "7.6.17",
94
94
  "@storybook/addon-essentials": "7.6.17",
95
95
  "@storybook/addon-storysource": "7.6.17",
@@ -1,23 +0,0 @@
1
- import { o as s } from "./on-click-outside.3e0c3e2a.js";
2
- const t = (o, i) => {
3
- const e = !i.modifiers.bubble;
4
- if (typeof i.value == "function")
5
- o.__onClickOutside_stop = s(o, i.value, { capture: e });
6
- else {
7
- const [c, n] = i.value;
8
- o.__onClickOutside_stop = s(o, c, { capture: e, ...n });
9
- }
10
- }, u = (o) => {
11
- o.__onClickOutside_stop();
12
- }, _ = {
13
- // Vue 2 Directive hooks
14
- inserted: t,
15
- unbind: u,
16
- // Vue 3 Directive hooks
17
- beforeMount: t,
18
- unmounted: u
19
- };
20
- export {
21
- _ as B
22
- };
23
- //# sourceMappingURL=directive.0408e565.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"directive.0408e565.js","sources":["../../src/directives/click-outside/directive.ts"],"sourcesContent":["import { onClickOutside } from './on-click-outside';\nimport type { DirectiveHook } from 'vue';\n\ntype Element = HTMLElement & { __onClickOutside_stop?: () => void };\n\n/**\n * Attaches the click outside listener to target element to register clicks outside the element.\n * @param targetElement Element to attach listener to.\n * @param binding\n */\nconst bindDirective: DirectiveHook<Element> = (targetElement, binding) => {\n const capture = !binding.modifiers.bubble;\n if (typeof binding.value === 'function') {\n // eslint-disable-next-line no-underscore-dangle, no-param-reassign\n targetElement.__onClickOutside_stop = onClickOutside(targetElement, binding.value, { capture });\n } else {\n const [handler, options] = binding.value;\n // eslint-disable-next-line no-underscore-dangle, no-param-reassign\n targetElement.__onClickOutside_stop = onClickOutside(targetElement, handler, { capture, ...options });\n }\n};\n\n/**\n * Removes click outside listener from the target element.\n * @param targetElement Element to detach listener from.\n */\nconst unbindDirective: DirectiveHook<Element> = targetElement => {\n // eslint-disable-next-line no-underscore-dangle\n targetElement.__onClickOutside_stop();\n};\n\nexport const BentoClickOutsideDirective = {\n // Vue 2 Directive hooks\n inserted: bindDirective,\n unbind: unbindDirective,\n\n // Vue 3 Directive hooks\n beforeMount: bindDirective,\n unmounted: unbindDirective,\n};\n"],"names":["bindDirective","targetElement","binding","capture","onClickOutside","handler","options","unbindDirective","BentoClickOutsideDirective"],"mappings":";AAUA,MAAMA,IAAwC,CAACC,GAAeC,MAAY;AAChE,QAAAC,IAAU,CAACD,EAAQ,UAAU;AAC/B,MAAA,OAAOA,EAAQ,SAAU;AAEzB,IAAAD,EAAc,wBAAwBG,EAAeH,GAAeC,EAAQ,OAAO,EAAE,SAAAC,GAAS;AAAA,OAC3F;AACH,UAAM,CAACE,GAASC,CAAO,IAAIJ,EAAQ;AAErB,IAAAD,EAAA,wBAAwBG,EAAeH,GAAeI,GAAS,EAAE,SAAAF,GAAS,GAAGG,GAAS;AAAA;AAE5G,GAMMC,IAA0C,CAAiBN,MAAA;AAE7D,EAAAA,EAAc,sBAAsB;AACxC,GAEaO,IAA6B;AAAA;AAAA,EAEtC,UAAUR;AAAA,EACV,QAAQO;AAAA;AAAA,EAGR,aAAaP;AAAA,EACb,WAAWO;AACf;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"dropdown-default-textbox.9c23c94d.js","sources":["../../src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.types.ts","../../src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue","../../src/components/dropdown/components/dropdown-default-textbox/dropdown-default-textbox.vue"],"sourcesContent":["import { PropType } from 'vue';\nimport { Booleanish } from '@/types';\n\n// TODO: Change this to script setup + Typescript interface\nexport const DropdownBaseTextboxProps = {\n /**\n * The number of additional items that have been selected in the dropdown.\n */\n additionalItemsSelected: { type: [Number, String] as PropType<number | string>, default: 0 },\n\n /**\n * Sets the possibility to type into the textbox\n */\n dynamicFiltering: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the aria-controls attribute on the textbox. This should correspond to the popover's id that the textbox triggers.\n */\n ariaControls: {\n type: String,\n required: true,\n },\n\n /**\n * Indicates whether the content the textbox triggers is visible or not. Needs to be set accordingly when the textbox is used and changed every time the popover is shown/hidden.\n */\n ariaExpanded: {\n type: [String, Boolean] as PropType<Booleanish>,\n required: true,\n },\n\n /**\n * Corresponds to the label's id that labels the textbox element.\n */\n ariaLabelledby: {\n type: String,\n default: null,\n },\n\n /**\n * Disables any textbox functionality\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Marks the textbox as invalid, rendering an error state\n */\n isInvalid: { type: Boolean, default: false },\n\n /**\n * Selected option's label\n */\n displayValue: { type: String, default: null },\n\n /**\n * Indicates if the dropdown is open so that\n * the respective event can be emitted\n */\n open: { type: Boolean, default: false },\n\n /**\n * The input value\n */\n value: { type: String, default: '' },\n\n /**\n * Custom debounce time. Default: 300\n */\n debounceTime: { type: Number, default: 300 },\n};\n\nexport enum DropdownBaseTextboxState {\n DISABLED = 'disabled',\n READONLY = 'readonly',\n HAS_ITEMS = 'has-items',\n OPENED = 'opened',\n ERROR = 'error',\n}\n\nexport enum DropdownBaseTextboxEvent {\n OPEN = 'dropdown-base-open',\n KEYDOWN = 'dropdown-base-keydown',\n CLOSE = 'dropdown-base-close',\n INPUT = 'dropdown-base-input',\n CLEAR = 'dropdown-base-clear',\n}\n\nexport default DropdownBaseTextboxProps;\n","<template>\n <div\n :class=\"$attrs.class\"\n data-testid=\"textbox-wrapper\"\n @click=\"onToggleDropdown\"\n @keydown.escape=\"onCloseDropdown\"\n >\n <bento-typography\n class=\"b-dropdown-base-textbox\"\n :class=\"conditionalClasses\"\n el=\"div\"\n data-testid=\"base-textbox\"\n >\n <input\n v-if=\"shouldShowInput\"\n v-bind=\"ariaAttributes\"\n :id=\"textboxId\"\n ref=\"textbox\"\n class=\"b-dropdown-base-textbox__input\"\n role=\"combobox\"\n type=\"text\"\n aria-autocomplete=\"list\"\n :value=\"open ? value : displayValue\"\n :disabled=\"disabled ? true : null\"\n :readonly=\"readonly\"\n @keydown=\"$emit(DropdownBaseTextboxEvent.KEYDOWN, $event)\"\n @keydown.enter=\"onToggleDropdown\"\n @input=\"onInputEvent\"\n />\n <div\n v-else\n :id=\"textboxId\"\n v-bind=\"ariaAttributes\"\n ref=\"textbox\"\n class=\"b-dropdown-base-textbox__input\"\n :class=\"comboboxConditionalClasses\"\n role=\"combobox\"\n :tabindex=\"0\"\n >\n <slot v-if=\"shouldShowSingleSelectSlot\" v-bind=\"selectedValueItem\">\n {{ displayValue }}\n </slot>\n <template v-else-if=\"shouldShowMultipleSlot\">\n <div class=\"b-dropdown-base-textbox__input-multiple-selected\">\n <div v-for=\"singleItem of selectedValueItems\" :key=\"singleItem.value\">\n <div class=\"b-dropdown-base-textbox__input-selected-element\">\n <slot v-bind=\"singleItem\">\n {{ displayValue }}\n </slot>\n </div>\n </div>\n </div>\n </template>\n <template v-else>{{ displayValue }}</template>\n </div>\n <span v-if=\"additionalItemsSelected\" class=\"b-dropdown-base-textbox__additional-items\">\n {{ additionalItemsSelected }}\n </span>\n <span v-if=\"hasSlot('icon') && !isFiltering\" class=\"b-dropdown-base-textbox__icon\" aria-hidden=\"true\">\n <slot name=\"icon\"></slot>\n </span>\n <span\n v-if=\"isFiltering\"\n class=\"b-dropdown-base-textbox__clear-search\"\n tabindex=\"0\"\n data-testid=\"clear-search-button\"\n @click.stop=\"onClearSearch\"\n @keydown.enter.stop=\"onClearSearch\"\n @keyup.space=\"onClearSearch\"\n >\n <cross-circle-fill-icon :svg-title=\"'clearSearch'\" />\n </span>\n </bento-typography>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, nextTick, PropType, ref, useAttrs, useSlots, watch } from 'vue';\n import { generateUid } from '@/utils/ts/unique-id';\n import { useHasSlot } from '@/composables';\n import { BentoTypography } from '@/components/typography';\n import { debounce } from '@/utils/ts/debounce';\n import { BentoListboxOptionItem, Booleanish } from '@/types';\n import type { HTMLAttributes } from 'vue/types/jsx';\n import { DropdownBaseTextboxEvent, DropdownBaseTextboxState } from './dropdown-base-textbox.types';\n import CrossCircleFillIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill';\n\n const attrs = useAttrs();\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const props = defineProps({\n /**\n * The number of additional items that have been selected in the dropdown.\n */\n additionalItemsSelected: { type: [Number, String] as PropType<number | string>, default: 0 },\n\n /**\n * If the combobox DOM element should be an `input` element.\n */\n alwaysComboboxIsInput: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the aria-controls attribute on the textbox. This should correspond to the popover's id that the textbox triggers.\n */\n ariaControls: { type: String, required: true },\n\n /**\n * Indicates whether the content the textbox triggers is visible or not. Needs to be set accordingly when the textbox is used and changed every time the popover is shown/hidden.\n */\n ariaExpanded: {\n type: [String, Boolean] as PropType<Booleanish>,\n required: true,\n },\n\n /**\n * If no label element is used then the aria-label is be set should be set.\n */\n ariaLabel: { type: String, default: null },\n\n /**\n * Corresponds to the label's id that labels the textbox element.\n */\n ariaLabelledby: { type: String, default: null },\n\n /**\n * Custom debounce time for the user type event.\n */\n debounceTime: { type: Number, default: 300 },\n\n /**\n * Disables any textbox functionality\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Selected option's label\n */\n displayValue: { type: String, default: null },\n\n /**\n * Sets the possibility to type into the textbox.\n */\n dynamicFiltering: { type: Boolean, default: false },\n\n /**\n * Marks the textbox as invalid, rendering an error state\n */\n isInvalid: { type: Boolean, default: false },\n\n /*\n * If enabled, the user will be able to select multiple items.\n */\n multiple: { type: Boolean, default: false },\n\n /**\n * Indicates if the dropdown is open so that\n * the respective event can be emitted\n */\n open: { type: Boolean, default: false },\n\n /**\n * Sets the dropdown to readonly state\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * The input value\n */\n value: { type: String, default: '' },\n\n /**\n * The selected value's list box item.\n */\n selectedValueItem: {\n type: [Object, Array] as PropType<BentoListboxOptionItem | BentoListboxOptionItem[]>,\n default: undefined,\n },\n\n /**\n * Toggles whether to use the slot content select items shown in the textbox in multiple mode.\n */\n showSlotContentInMultiple: { type: Boolean, default: false },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the \"clear\" button is clicked\n */\n (e: DropdownBaseTextboxEvent.CLEAR);\n\n /**\n * Emitted on click, space, enter and esc user events. It will close the dropdown.\n */\n (e: DropdownBaseTextboxEvent.CLOSE);\n\n /**\n * Emitted when `dynamicFiltering` is enabled and a search input is entered\n */\n (e: DropdownBaseTextboxEvent.INPUT, searchValue: string);\n\n /**\n * Emitted when any key is pressed and the focus is on the input field\n */\n (e: DropdownBaseTextboxEvent.KEYDOWN, event: KeyboardEvent);\n\n /**\n * Emitted on click, space and enter user events. It will open the dropdown.\n */\n (e: DropdownBaseTextboxEvent.OPEN);\n }>();\n\n const textbox = ref(null);\n const textboxId = generateUid('textbox');\n\n const conditionalClasses = computed(() => ({\n [`b-dropdown-base-textbox--${DropdownBaseTextboxState.DISABLED}`]: props.disabled,\n [`b-dropdown-base-textbox--${DropdownBaseTextboxState.READONLY}`]: props.readonly,\n [`b-dropdown-base-textbox--${DropdownBaseTextboxState.HAS_ITEMS}`]: !!props.additionalItemsSelected,\n }));\n\n const comboboxConditionalClasses = computed(() => ({\n [`b-dropdown-base-textbox__input--dynamic-filtering`]: props.dynamicFiltering,\n }));\n\n const isFiltering = computed(() => props.dynamicFiltering && !!props.value && props.open);\n\n const ariaAttributes = computed(\n () =>\n ({\n 'aria-haspopup': 'listbox',\n 'aria-controls': props.ariaControls,\n 'aria-describedby': attrs['aria-describedby']?.toString() as string,\n 'aria-expanded': props.ariaExpanded ? 'true' : 'false',\n 'aria-labelledby': props.ariaLabelledby,\n 'aria-label': props.ariaLabelledby ? null : props.ariaLabel,\n 'aria-invalid': props.isInvalid,\n 'aria-disabled': props.disabled ? true : null,\n } as HTMLAttributes)\n );\n // Cast selectedValueItem if it is an array of selected items\n const selectedValueItems = computed(() =>\n props.multiple ? (props.selectedValueItem as BentoListboxOptionItem[]) : []\n );\n\n const shouldShowInput = computed(() => props.dynamicFiltering && (props.open || props.alwaysComboboxIsInput));\n const shouldShowSingleSelectSlot = computed(() => props.selectedValueItem && !props.multiple);\n const shouldShowMultipleSlot = computed(\n () =>\n props.multiple &&\n props.selectedValueItem &&\n selectedValueItems.value.length > 0 &&\n props.showSlotContentInMultiple\n );\n\n watch(\n () => shouldShowInput.value,\n () => {\n if (shouldShowInput.value && !props.alwaysComboboxIsInput) {\n nextTick(() => {\n textbox.value.focus();\n });\n }\n }\n );\n\n const onOpenDropdown = () => {\n if (!props.disabled && !props.readonly) {\n textbox.value.focus();\n emit(DropdownBaseTextboxEvent.OPEN);\n }\n };\n\n const onCloseDropdown = () => {\n if (props.open) {\n textbox.value.focus();\n emit(DropdownBaseTextboxEvent.CLOSE);\n }\n };\n\n const onToggleDropdown = (event: Event) => {\n const isDynamicFilteringInputClickEvent = props.open && (event.target as HTMLDivElement).tagName === 'INPUT';\n if (isDynamicFilteringInputClickEvent) {\n /**\n * When there's a click even on the input during filtering\n * and the popover is open, do not toggle the popover.\n * Allow for click events inside the input field\n */\n return null;\n }\n\n return props.open ? onCloseDropdown() : onOpenDropdown();\n };\n\n const onClearSearch = () => {\n emit(DropdownBaseTextboxEvent.CLEAR);\n emit(DropdownBaseTextboxEvent.INPUT, '');\n textbox.value.focus();\n };\n const onInputEvent = debounce<(event: Event) => void>((event: Event) => {\n if (!props.readonly && !props.disabled) {\n emit(DropdownBaseTextboxEvent.INPUT, (event.target as HTMLInputElement).value);\n } else {\n event.preventDefault();\n event.stopPropagation();\n }\n }, props.debounceTime);\n</script>\n\n<script lang=\"ts\">\n /**\n * Only for internal use, implements the logic of the textbox element to be implemented in the combobox.\n */\n export default defineComponent({\n name: 'dropdown-base-textbox',\n inheritAttrs: false,\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./dropdown-base-textbox.scss\" />\n","<template>\n <div class=\"b-dropdown-default-textbox\" :class=\"conditionalClasses\" data-testid=\"default-textbox\">\n <dropdown-base-textbox\n v-bind=\"{ ...$attrs, ...$props }\"\n class=\"b-dropdown-default-textbox__textbox\"\n :value=\"value\"\n v-on=\"listeners\"\n >\n <template v-for=\"(_, innerSlot) of slots\" #[innerSlot]=\"scope\">\n <slot :name=\"innerSlot\" v-bind=\"scope\" />\n </template>\n <template #icon>\n <div class=\"b-dropdown-default-textbox__chevron\">\n <chevron-up-icon v-show=\"isDropdownOpen\" svg-title=\"opened\" />\n <chevron-down-icon v-show=\"!isDropdownOpen\" svg-title=\"closed\" />\n </div>\n </template>\n </dropdown-base-textbox>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n import { computed, defineComponent, PropType, useSlots } from 'vue';\n import DropdownBaseTextbox from '@/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue';\n import { BentoListboxOptionItem, Booleanish } from '@/types';\n import { stopEventPropagation } from '@/utils/ts/events';\n import {\n DropdownBaseTextboxEvent,\n DropdownBaseTextboxState,\n } from '../dropdown-base-textbox/dropdown-base-textbox.types';\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\n const emit = defineEmits<{\n /**\n * Emitted on clearing the input.\n */\n (e: 'clear');\n\n /**\n * Emitted on click, space and enter user events. It will open the dropdown.\n */\n (e: 'close');\n\n /**\n * Emitted on input event.\n */\n (e: 'input', newInput: string);\n\n /**\n * Emitted on keydown event.\n */\n (e: 'keydown', keydownEvent: KeyboardEvent);\n\n /**\n * Emitted on click, space, enter and esc user events. It will close the dropdown.\n */\n (e: 'open');\n }>();\n\n const slots = useSlots();\n\n const props = defineProps({\n /**\n * The number of additional items that have been selected in the dropdown.\n */\n additionalItemsSelected: { type: [Number, String] as PropType<number | string>, default: 0 },\n\n /**\n * Sets the aria-controls attribute on the textbox. This should correspond to the popover's id that the textbox triggers.\n */\n ariaControls: {\n type: String,\n required: true,\n },\n\n /**\n * Indicates whether the content the textbox triggers is visible or not. Needs to be set accordingly when the textbox is used and changed every time the popover is shown/hidden.\n */\n ariaExpanded: {\n type: [String, Boolean] as PropType<Booleanish>,\n required: true,\n },\n\n /**\n * If no label element is used then the aria-label is be set should be set.\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Corresponds to the label's id that labels the textbox element.\n */\n ariaLabelledby: {\n type: String,\n default: null,\n },\n\n /**\n * Renders the dropdown with a condensed style.\n */\n condensed: { type: Boolean, default: false },\n\n /**\n * Custom debounce time. Default: 300\n */\n debounceTime: { type: Number, default: 300 },\n\n /**\n * Disables any textbox functionality\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Selected option's label\n */\n displayValue: { type: String, default: null },\n\n /**\n * Sets the possibility to type into the textbox\n */\n dynamicFiltering: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Marks the textbox as invalid, rendering an error state\n */\n isInvalid: { type: Boolean, default: false },\n\n /**\n * Indicates if the dropdown is open so that\n * the respective event can be emitted\n */\n open: { type: Boolean, default: false },\n\n /**\n * Sets the dropdown to readonly state\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * The selected value's list box item.\n */\n selectedValueItem: {\n type: [Object, Array] as PropType<BentoListboxOptionItem | BentoListboxOptionItem[]>,\n default: undefined,\n },\n\n /**\n * Toggles whether to use the slot content select items shown in the textbox in multiple mode.\n */\n showSlotContentInMultiple: { type: Boolean, default: false },\n\n /**\n * The input value\n */\n value: { type: String, default: '' },\n\n /*\n * If enabled, the user will be able to select multiple items.\n */\n multiple: { type: Boolean, default: false },\n });\n\n const conditionalClasses = computed(() => ({\n [`b-dropdown-default-textbox--${DropdownBaseTextboxState.ERROR}`]:\n !props.disabled && !props.readonly && props.isInvalid,\n [`b-dropdown-default-textbox--${DropdownBaseTextboxState.DISABLED}`]: props.disabled,\n [`b-dropdown-default-textbox--${DropdownBaseTextboxState.READONLY}`]: props.readonly,\n [`b-dropdown-default-textbox--${DropdownBaseTextboxState.OPENED}`]: props.open,\n 'b-dropdown-default-textbox--condensed': props.condensed,\n }));\n\n const isDropdownOpen = computed(() => props.open && !props.disabled && !props.readonly);\n\n const onInput = (newInput: string) => {\n emit('input', newInput);\n };\n const onKeyDown = (e: KeyboardEvent) => {\n emit('keydown', e);\n };\n const openDropdown = (e: Event) => {\n stopEventPropagation(e);\n emit('open');\n };\n const closeDropdown = (e: Event) => {\n stopEventPropagation(e);\n emit('close');\n };\n const clearValue = (e: Event) => {\n stopEventPropagation(e);\n emit('clear');\n };\n\n const listeners = {\n [DropdownBaseTextboxEvent.INPUT]: onInput,\n [DropdownBaseTextboxEvent.OPEN]: openDropdown,\n [DropdownBaseTextboxEvent.CLOSE]: closeDropdown,\n [DropdownBaseTextboxEvent.CLEAR]: clearValue,\n [DropdownBaseTextboxEvent.KEYDOWN]: onKeyDown,\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * For internal use only, textbox component used in the dropdown component.\n */\n export default defineComponent({\n name: 'dropdown-default-textbox',\n inheritAttrs: false,\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./dropdown-default-textbox.scss\" />\n"],"names":["DropdownBaseTextboxState","DropdownBaseTextboxState2","DropdownBaseTextboxEvent","DropdownBaseTextboxEvent2","__default__$1","defineComponent","attrs","useAttrs","slots","useSlots","hasSlot","useHasSlot","textbox","ref","textboxId","generateUid","conditionalClasses","computed","props","comboboxConditionalClasses","isFiltering","ariaAttributes","_a","selectedValueItems","shouldShowInput","shouldShowSingleSelectSlot","shouldShowMultipleSlot","watch","nextTick","onOpenDropdown","emit","onCloseDropdown","onToggleDropdown","event","onClearSearch","onInputEvent","debounce","__default__","isDropdownOpen","onInput","newInput","onKeyDown","e","openDropdown","stopEventPropagation","closeDropdown","clearValue","listeners"],"mappings":";;;;;;;;;;AA0EY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,WAAA,YACAA,EAAA,WAAA,YACAA,EAAA,YAAA,aACAA,EAAA,SAAA,UACAA,EAAA,QAAA,SALQA,IAAAD,KAAA,CAAA,CAAA,GAQAE,IAAA,kBAAAC,OACRA,EAAA,OAAA,sBACAA,EAAA,UAAA,yBACAA,EAAA,QAAA,uBACAA,EAAA,QAAA,uBACAA,EAAA,QAAA,uBALQA,IAAAD,KAAA,CAAA,CAAA;ACyOR,MAAAE,IAAAC,EAAA;AAAA,EAA+B,MAAA;AAAA,EACrB,cAAA;AAEV,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;AAAA,MAC4B,CAAA,+BAAAlB,EAAA,UAAA,GAAAkB,EAAA;AAAA,MACA,CAAA,+BAAAlB,EAAA,QAAA,GAAAkB,EAAA;AAAA,MACF,yCAAAA,EAAA;AAAA,IAC3B,EAAA,GAGnDoB,IAAArB,EAAA,MAAAC,EAAA,QAAA,CAAAA,EAAA,YAAA,CAAAA,EAAA,QAAA,GAEAqB,IAAA,CAAAC,MAAA;AACI,MAAAV,EAAA,SAAAU,CAAA;AAAA,IAAsB,GAE1BC,IAAA,CAAAC,MAAA;AACI,MAAAZ,EAAA,WAAAY,CAAA;AAAA,IAAiB,GAErBC,IAAA,CAAAD,MAAA;AACI,MAAAE,EAAAF,CAAA,GACAZ,EAAA,MAAA;AAAA,IAAW,GAEfe,IAAA,CAAAH,MAAA;AACI,MAAAE,EAAAF,CAAA,GACAZ,EAAA,OAAA;AAAA,IAAY,GAEhBgB,IAAA,CAAAJ,MAAA;AACI,MAAAE,EAAAF,CAAA,GACAZ,EAAA,OAAA;AAAA,IAAY,GAGhBiB,IAAA;AAAA,MAAkB,CAAA7C,EAAA,KAAA,GAAAqC;AAAA,MACoB,CAAArC,EAAA,IAAA,GAAAyC;AAAA,MACD,CAAAzC,EAAA,KAAA,GAAA2C;AAAA,MACC,CAAA3C,EAAA,KAAA,GAAA4C;AAAA,MACA,CAAA5C,EAAA,OAAA,GAAAuC;AAAA,IACE;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.929dda57.js","sources":["../../src/components/menu/components/menu-item/menu-item.vue","../../src/components/menu/menu.types.ts","../../src/components/menu/components/menu-list-container/menu-list-container.vue","../../src/components/menu/components/sub-menu-item-list/sub-menu-item-list.vue","../../src/components/menu/components/menu-item-list/menu-item-list.vue","../../src/components/menu/menu.keys.ts","../../../../node_modules/@adyen/ui-assets-icons-16/dist/vue/options-vertical.vue","../../src/components/menu/menu.vue"],"sourcesContent":["<template>\n <base-button\n class=\"b-menu-item\"\n role=\"menuitem\"\n :class=\"conditionalClasses\"\n :disabled=\"disabled\"\n tabindex=\"-1\"\n @click=\"onClick\"\n >\n <template v-if=\"icon\" #iconLeft>\n <component :is=\"icon\" class=\"b-menu-item__icon-left\" aria-hidden=\"true\" />\n </template>\n <template #default>\n <bento-typography el=\"span\" variant=\"body\" :stronger=\"isTitle\" class=\"b-menu-item__primary-text\">\n {{ text }}\n </bento-typography>\n <bento-typography v-if=\"secondaryText\" el=\"span\" variant=\"body\" class=\"b-menu-item__secondary-text\">\n {{ secondaryText }}\n </bento-typography>\n </template>\n <template v-if=\"chevron\" #iconRight><chevron-right-icon aria-hidden=\"true\" /></template>\n </base-button>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import ChevronRightIcon from '@adyen/ui-assets-icons-16/vue/chevron-right';\n import { BaseButton, BentoBaseButtonEvent } from '@/components/internal/base-button';\n import { BentoTypography } from '@/components/typography';\n import { BentoMenuItem } from './menu-item.types';\n\n /**\n * Menu item component to render items in a menu. For internal use only.\n */\n export default defineComponent({\n name: 'menu-item',\n components: { BaseButton, BentoTypography, ChevronRightIcon },\n props: {\n /**\n * menu-item text that gets displayed as the main label\n */\n text: {\n type: String,\n required: true,\n },\n /**\n * menu-item action that gets executed when the MeniItem is clicked\n */\n handler: {\n type: Function as PropType<BentoMenuItem['handler']>,\n required: true,\n },\n /**\n * menu-item text that gets displayed as the secondary label\n */\n secondaryText: {\n type: String,\n default: null,\n },\n /**\n * Optional chevron icon displayed to the right of the menu-item\n */\n chevron: {\n type: Boolean,\n default: false,\n },\n /**\n * Optional icon displayed to the left of the menu-item\n */\n icon: {\n // Types for Vue2 (Object) and Vue3 (Function)\n // TODO: Remove Object when fully migrated to Vue3\n type: [Object, Function] as PropType<BentoMenuItem['icon']>,\n default: null,\n },\n /**\n * Disables menu-item button functionality\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays an indent variant od the menu-item\n */\n indent: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays menu-item button as critical\n */\n critical: {\n type: Boolean,\n default: false,\n },\n /**\n * Renders the text in a bold variant\n */\n isTitle: {\n type: Boolean,\n default: false,\n },\n },\n emits: [BentoBaseButtonEvent.CLICK],\n setup(props, { emit }) {\n const conditionalClasses = computed(() => ({\n 'b-menu-item--critical': props.critical,\n 'b-menu-item--indent': props.indent,\n }));\n\n const onClick = (e: MouseEvent) => {\n e.stopPropagation();\n props.handler();\n emit(BentoBaseButtonEvent.CLICK);\n };\n\n return {\n // Values\n conditionalClasses,\n\n // Methods\n onClick,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu-item.scss\" />\n","import { BentoButton } from '../button';\n\nexport enum BentoMenuEvent {\n BACK = 'back',\n CLOSE = 'close',\n OPEN = 'open',\n}\n\ntype ButtonProps = InstanceType<typeof BentoButton>['$props'];\n\nexport type BentoMenuButtonProps = {\n variant?: ButtonProps['variant'];\n condensed?: ButtonProps['condensed'];\n disabled?: ButtonProps['disabled'];\n};\n","<template>\n <div class=\"b-menu-list-container\"><slot></slot></div>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent } from 'vue';\n\n /**\n * Menu list container component to set the correct styling in a menu list. For internal use only.\n */\n export default defineComponent({\n name: 'bento-menu-list-container',\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu-list-container.scss\" />\n","<template>\n <transition name=\"b-sub-menu-item-list__transition\" appear>\n <menu-list-container class=\"b-sub-menu-item-list\">\n <ul\n ref=\"subMenuItemListRefLocal\"\n role=\"menu\"\n class=\"b-sub-menu-item-list__list\"\n @keydown.down.stop=\"focusNext\"\n @keydown.up.stop=\"focusPrevious\"\n @keydown.esc.stop=\"onBackButton\"\n >\n <li v-for=\"(item, index) in computedItems\" :key=\"`sub-menu-item-list-item-${index}`\" role=\"none\">\n <menu-item\n :text=\"item.text\"\n :handler=\"item.handler\"\n :secondary-text=\"item.secondaryText\"\n :icon=\"item.icon\"\n :is-title=\"item.isTitle\"\n :disabled=\"item.disabled\"\n :critical=\"item.critical\"\n :indent=\"item.indent\"\n :tabindex=\"index === subMenuFocusedIndex ? '0' : '-1'\"\n @click=\"item.clickHandler\"\n />\n <bento-divider v-if=\"item.addDivider\" class=\"b-sub-menu-item-list__divider\" />\n </li>\n </ul>\n </menu-list-container>\n </transition>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, onMounted, PropType, ref } from 'vue';\n import { BentoDivider } from '@/components/divider';\n import { BentoMenuItem, MenuItem } from '../menu-item';\n import MenuListContainer from '../menu-list-container/menu-list-container.vue';\n import ChevronLeftIcon from '@adyen/ui-assets-icons-16/vue/chevron-left';\n import { BentoMenuEvent } from '../../menu.types';\n import messages from '../../messages.json';\n\n /**\n * SubMenuItemList component to render a submenu with the sliding transition. For internal use only.\n */\n export default defineComponent({\n i18n: { messages },\n name: 'sub-menu-item-list',\n components: { BentoDivider, MenuItem, MenuListContainer },\n props: {\n items: {\n type: Array as PropType<BentoMenuItem[]>,\n required: true,\n },\n title: {\n type: String,\n required: true,\n },\n },\n emits: [BentoMenuEvent.CLOSE, BentoMenuEvent.BACK],\n setup(props, { emit }) {\n const subMenuItemListRefLocal = ref(null);\n const subMenuFocusedIndex = ref(0);\n const numberOfItems = ref(props.items.length);\n\n const closeMenu = () => emit(BentoMenuEvent.CLOSE);\n\n const onBackButton = () => emit(BentoMenuEvent.BACK);\n\n const computedItems = computed(() => {\n const items = props.items?.map(el => ({\n ...el,\n indent: !el.icon,\n isTitle: false,\n clickHandler: closeMenu,\n }));\n return [\n {\n text: props.title,\n secondaryText: null,\n critical: false,\n icon: ChevronLeftIcon,\n isTitle: true,\n disabled: false,\n indent: false,\n handler: onBackButton,\n clickHandler: onBackButton,\n addDivider: true,\n },\n ...items,\n ];\n });\n\n const focusItem = async () => {\n subMenuItemListRefLocal.value?.children?.[subMenuFocusedIndex.value]?.children?.[0]?.focus();\n };\n\n onMounted(async () => {\n // Using setTimeout otherwise the sliding animation doesn't work anymore. The timeout imer is the same as the transition time (0.15s)\n setTimeout(() => focusItem(), 150);\n });\n\n const focusPrevious = () => {\n if (subMenuFocusedIndex.value > 0) {\n subMenuFocusedIndex.value -= 1;\n if (computedItems.value[subMenuFocusedIndex.value].disabled) {\n focusPrevious();\n }\n } else {\n subMenuFocusedIndex.value = numberOfItems.value;\n }\n focusItem();\n };\n\n const focusNext = () => {\n if (subMenuFocusedIndex.value < numberOfItems.value) {\n subMenuFocusedIndex.value += 1;\n if (computedItems.value[subMenuFocusedIndex.value].disabled) {\n focusNext();\n }\n } else {\n subMenuFocusedIndex.value = 0;\n }\n focusItem();\n };\n\n return {\n // Enums\n BentoMenuEvent,\n\n // Values\n subMenuItemListRefLocal,\n subMenuFocusedIndex,\n ChevronLeftIcon,\n computedItems,\n\n // Methods\n closeMenu,\n onBackButton,\n focusPrevious,\n focusNext,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./sub-menu-item-list.scss\" />\n","<template>\n <menu-list-container ref=\"menuItemListWrapperRef\" :style=\"{ height: computedHeight }\">\n <ul\n ref=\"menuItemListRef\"\n class=\"b-menu-item-list\"\n role=\"menu\"\n @keydown.down=\"focusNext\"\n @keydown.up=\"focusPrevious\"\n @keydown.esc=\"closeMenu\"\n @keydown.tab=\"closeMenu\"\n >\n <li\n v-for=\"(item, index) in computedData\"\n :key=\"`menu-item-${index}`\"\n class=\"b-menu-item-list__item\"\n role=\"none\"\n @keydown.right=\"focusRight(item, index)\"\n @keydown.left=\"focusLeft()\"\n >\n <menu-item\n :text=\"item.text\"\n :handler=\"!item.items?.length ? item.handler : () => null\"\n :secondary-text=\"item.secondaryText\"\n :icon=\"item.icon\"\n :chevron=\"!!item.items?.length\"\n :disabled=\"item.disabled\"\n :critical=\"item.critical\"\n :indent=\"item.indent\"\n :tabindex=\"index === subMenuFocusedIndex ? '0' : '-1'\"\n :aria-haspopup=\"!!item.items?.length\"\n :aria-expanded=\"showSubMenu && visibleSubMenuIndex === index\"\n @click=\"toggleMenu(item, index)\"\n />\n <bento-divider v-if=\"item.addDivider\" class=\"b-menu-item-list__divider\" />\n <sub-menu-item-list\n v-if=\"item.items?.length && showSubMenu && visibleSubMenuIndex === index\"\n ref=\"subMenuItemListRef\"\n :items=\"item.items\"\n :title=\"item.text\"\n @back=\"onBackButton\"\n @close=\"closeMenu\"\n />\n </li>\n </ul>\n </menu-list-container>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref } from 'vue';\n import { BentoDivider } from '@/components/divider';\n import { BentoMenuItem, MenuItem } from '../menu-item';\n import { BentoMenuEvent } from '../../menu.types';\n import MenuListContainer from '../menu-list-container/menu-list-container.vue';\n import SubMenuItemList from '../sub-menu-item-list/sub-menu-item-list.vue';\n\n /**\n * MenuItem list to be used in the Menu component. For internal use only.\n */\n export default defineComponent({\n name: 'menu-item-list',\n components: { BentoDivider, MenuItem, MenuListContainer, SubMenuItemList },\n props: {\n /**\n * The data to be displayed in the list\n */\n data: {\n type: Array as PropType<BentoMenuItem[]>,\n required: true,\n },\n /**\n * Displays the menu-items of the list in the indent variant. Only applies to elements that don't have an icon to their left.\n */\n indentItems: {\n type: Boolean,\n default: false,\n },\n /**\n * If set to true, focuses the last item on the list instead of the first. Used for accessibility purposes when the menu is opened with the 'up' arrow key.\n */\n focusLastElement: {\n type: Boolean,\n default: false,\n },\n },\n emits: [BentoMenuEvent.CLOSE],\n setup(props, { emit }) {\n const menuItemListRef = ref(null);\n const menuItemListWrapperRef = ref(null);\n const subMenuItemListRef = ref(null);\n const showSubMenu = ref(false);\n const visibleSubMenuIndex = ref(null);\n const focusedIndex = ref(props.focusLastElement ? props.data.length - 1 : 0);\n const subMenuFocusedIndex = ref(0);\n const numberOfItems = ref(props.data.length - 1);\n const hasMenuItemsWithIcon = computed(() => props.data.some(el => el.icon));\n\n const computedData = computed(() => {\n if (props.indentItems || hasMenuItemsWithIcon.value) {\n return props.data.map(el => {\n let indent = false;\n if (!el.icon) {\n indent = true;\n }\n return {\n ...el,\n // eslint-disable-next-line no-param-reassign\n indent,\n };\n });\n }\n return props.data;\n });\n\n const focusItem = () => menuItemListRef.value?.children[focusedIndex.value]?.children[0]?.focus();\n\n const closeMenu = () => emit(BentoMenuEvent.CLOSE);\n\n const toggleMenu = async (item: BentoMenuItem, index: number) => {\n if (item.items) {\n visibleSubMenuIndex.value = index;\n showSubMenu.value = true;\n } else {\n visibleSubMenuIndex.value = index;\n showSubMenu.value = false;\n closeMenu();\n }\n };\n\n const focusPrevious = () => {\n if (focusedIndex.value > 0) {\n focusedIndex.value -= 1;\n if (computedData.value[focusedIndex.value].disabled) {\n focusPrevious();\n }\n } else {\n focusedIndex.value = numberOfItems.value;\n }\n focusItem();\n };\n\n const focusNext = () => {\n if (focusedIndex.value < numberOfItems.value) {\n focusedIndex.value += 1;\n if (computedData.value[focusedIndex.value].disabled) {\n focusNext();\n }\n } else {\n focusedIndex.value = 0;\n }\n focusItem();\n };\n\n const focusRight = (item, index) => {\n if (item?.items?.length) {\n visibleSubMenuIndex.value = index;\n showSubMenu.value = true;\n }\n };\n\n const focusLeft = () => {\n if (visibleSubMenuIndex.value && showSubMenu.value) {\n visibleSubMenuIndex.value = null;\n showSubMenu.value = false;\n }\n };\n\n const onBackButton = () => {\n showSubMenu.value = false;\n visibleSubMenuIndex.value = null;\n // Focus the right element\n focusItem();\n };\n\n const subMenuHeight = computed(() => subMenuItemListRef.value?.[0]?.$el?.offsetHeight);\n\n // When we show the sub menu we need to set the height of the container because of the way the submenus are handled,\n // but the main menu doesn't need a height, as the popover will generate it with the right height\n const computedHeight = computed(() => (showSubMenu.value ? `${subMenuHeight.value}px` : ''));\n\n return {\n // Values\n menuItemListRef,\n menuItemListWrapperRef,\n subMenuItemListRef,\n\n computedData,\n computedHeight,\n\n focusedIndex,\n subMenuFocusedIndex,\n\n showSubMenu,\n visibleSubMenuIndex,\n\n // Methods\n toggleMenu,\n closeMenu,\n focusPrevious,\n focusNext,\n focusRight,\n focusLeft,\n onBackButton,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu-item-list.scss\" />\n","export const MENU_INVERSE_INJECTION_KEY = Symbol('menu inverse style injection key');\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#00112C\" d=\"M8 4C8.29667 4 8.58668 3.91203 8.83335 3.74721C9.08003 3.58238 9.27229 3.34811 9.38582 3.07403C9.49935 2.79994 9.52906 2.49834 9.47118 2.20737C9.4133 1.91639 9.27044 1.64912 9.06066 1.43934C8.85088 1.22956 8.58361 1.0867 8.29264 1.02882C8.00167 0.970945 7.70006 1.00065 7.42598 1.11418C7.15189 1.22771 6.91762 1.41997 6.7528 1.66665C6.58797 1.91332 6.5 2.20333 6.5 2.5C6.5 2.89783 6.65803 3.27936 6.93934 3.56066C7.22064 3.84197 7.60218 4 8 4Z\"/><path fill=\"#00112C\" d=\"M8 15C8.29667 15 8.58668 14.912 8.83335 14.7472C9.08003 14.5824 9.27229 14.3481 9.38582 14.074C9.49935 13.7999 9.52906 13.4983 9.47118 13.2074C9.4133 12.9164 9.27044 12.6491 9.06066 12.4393C8.85088 12.2296 8.58361 12.0867 8.29264 12.0288C8.00167 11.9709 7.70006 12.0007 7.42598 12.1142C7.15189 12.2277 6.91762 12.42 6.7528 12.6666C6.58797 12.9133 6.5 13.2033 6.5 13.5C6.5 13.8978 6.65803 14.2794 6.93934 14.5607C7.22064 14.842 7.60218 15 8 15Z\"/><path fill=\"#00112C\" d=\"M8.83335 9.24721C8.58668 9.41203 8.29667 9.5 8 9.5C7.60218 9.5 7.22064 9.34197 6.93934 9.06066C6.65803 8.77936 6.5 8.39783 6.5 8C6.5 7.70333 6.58797 7.41332 6.7528 7.16665C6.91762 6.91997 7.15189 6.72771 7.42598 6.61418C7.70006 6.50065 8.00167 6.47094 8.29264 6.52882C8.58361 6.5867 8.85088 6.72956 9.06066 6.93934C9.27044 7.14912 9.4133 7.41639 9.47118 7.70737C9.52906 7.99834 9.49935 8.29994 9.38582 8.57403C9.27229 8.84811 9.08003 9.08238 8.83335 9.24721Z\"/></svg>\n</template>\n<script>\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n<style>\n @import '../css/main.css';\n</style>\n","<template>\n <div\n v-bento-click-outside-directive=\"closeMenu\"\n :class=\"computedClasses\"\n class=\"b-menu\"\n @keydown.down=\"onKeyDown\"\n @keydown.up=\"onKeyUp\"\n @keydown.esc=\"closeMenu\"\n >\n <bento-toggle-button\n ref=\"menuButtonRef\"\n aria-haspopup=\"true\"\n v-bind=\"computedButtonPropsWithDefaults\"\n :aria-controls=\"showMenu ? menuId : null\"\n :toggled=\"showMenu\"\n :inverse=\"isInverseColorSet\"\n @click=\"toggleShowMenu\"\n >\n <template v-if=\"!hasSlot('default') || hasSlot('iconLeft')\" #iconLeft>\n <slot name=\"iconLeft\">\n <options-vertical-icon :title=\"$t('menuButton')\" />\n </slot>\n </template>\n <template v-if=\"hasSlot('default')\" #default>\n <slot />\n </template>\n <template v-if=\"hasSlot('iconRight')\" #iconRight>\n <slot name=\"iconRight\" />\n </template>\n </bento-toggle-button>\n\n <bento-teleport v-if=\"menuButtonRef\" :disabled=\"!teleport\">\n <bento-popover\n v-if=\"menuButtonRef\"\n :id=\"menuId\"\n :open=\"showMenu\"\n class=\"b-menu__popover\"\n :style=\"computedMenuWidth\"\n :target-element=\"menuButtonRef\"\n :position=\"menuPosition\"\n :fixed-positioning=\"menuFixedPositioning\"\n :fallback-position=\"[\n 'bottom-start',\n 'bottom-end',\n 'top-start',\n 'top-end',\n 'right-start',\n 'right-end',\n 'left-start',\n 'left-end',\n ]\"\n :teleport=\"teleport\"\n without-space\n >\n <menu-item-list :data=\"data\" :focus-last-element=\"isLastElementFocused\" @close=\"closeMenu\" />\n </bento-popover>\n </bento-teleport>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, inject, PropType, provide, ref } from 'vue';\n import { generateUid } from '@/utils/ts/unique-id';\n import { BentoClickOutsideDirective } from '@/directives';\n import { BentoToggleButton } from '@/components/button';\n import { BentoPopover, BentoPopoverPositions } from '@/components/popover';\n import { BentoMenuItem, MenuItemList } from './components';\n import { BentoMenuButtonProps, BentoMenuEvent } from './menu.types';\n import { DIVIDER_INVERSE_INJECTION_KEY } from '@/components/divider/divider.keys';\n import { MENU_INVERSE_INJECTION_KEY } from './menu.keys';\n import { BentoTeleport } from '@/internal';\n import { useHasSlot } from '@/composables';\n import OptionsVerticalIcon from '@adyen/ui-assets-icons-16/vue/options-vertical';\n import messages from './messages.json';\n\n /**\n * Menu component to render a series of buttons. Csan render nested submenus.\n *\n * @example\n * import { BentoMenu } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoMenu },\n * template: `\n * <bento-menu\n * :data=[\n * { text: 'Menu item text', handler: () => { some code here } },\n * { text: 'Another menu item text', handler: () => { some other code here }, critical: true }\n * ]\n * />\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-menu',\n components: { BentoToggleButton, BentoPopover, BentoTeleport, MenuItemList, OptionsVerticalIcon },\n directives: { BentoClickOutsideDirective },\n props: {\n /**\n * Object containing props to change the menu button appearance. Accepts the same props present in BentoButton.\n */\n button: {\n type: Object as PropType<BentoMenuButtonProps>,\n default: () =>\n ({\n variant: 'secondary',\n } as BentoMenuButtonProps),\n },\n /**\n * The data to be displayed in the list\n */\n data: {\n type: Array as PropType<BentoMenuItem[]>,\n required: true,\n },\n\n /**\n * The position of where the menu should open.\n */\n menuPosition: {\n type: String as PropType<BentoPopoverPositions | `${BentoPopoverPositions}`>,\n default: BentoPopoverPositions.BOTTOM_START,\n validator: (value: BentoPopoverPositions) => Object.values(BentoPopoverPositions).includes(value),\n },\n\n /**\n * Instructs the menu popover to be visible outside of the containing container.\n * @see {@link https://floating-ui.com/docs/usefloating#strategy}\n */\n menuFixedPositioning: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets a custom width for the menu popover.\n */\n menuWidth: {\n type: Number,\n default: null,\n },\n\n /**\n * Can be used to set the inner teleport component to render the menu's popover in the root `body` DOM node\n * (or `dialog` if popover is inside a dialog).\n */\n teleport: {\n type: Boolean,\n default: false,\n },\n },\n emits: [BentoMenuEvent.CLOSE, BentoMenuEvent.OPEN],\n setup(props, { emit, slots }) {\n const menuButtonRef = ref(null);\n const showMenu = ref(false);\n const isLastElementFocused = ref(false);\n const menuId = generateUid('menu');\n const popoverId = generateUid('menu-popover');\n\n const isInverseColorSet = inject(MENU_INVERSE_INJECTION_KEY, ref(false));\n provide(DIVIDER_INVERSE_INJECTION_KEY, isInverseColorSet);\n\n const computedClasses = computed(() => ({\n 'b-menu--inverse': isInverseColorSet.value,\n }));\n\n const computedMenuWidth = computed(() => (props.menuWidth ? { width: `${props.menuWidth}px` } : null));\n const computedButtonPropsWithDefaults = computed<BentoMenuButtonProps>(() => {\n if (!props?.button) {\n return undefined;\n }\n return {\n variant: 'secondary',\n ...props.button,\n };\n });\n\n const openMenu = () => {\n showMenu.value = true;\n emit(BentoMenuEvent.OPEN);\n };\n\n const closeMenu = () => {\n if (showMenu.value) {\n showMenu.value = false;\n menuButtonRef.value.$el.focus();\n emit(BentoMenuEvent.CLOSE);\n }\n };\n\n const toggleShowMenu = (e: MouseEvent) => {\n e.stopPropagation();\n if (!showMenu.value) {\n openMenu();\n } else {\n closeMenu();\n }\n };\n\n const onKeyDown = () => {\n isLastElementFocused.value = false;\n openMenu();\n };\n\n const onKeyUp = () => {\n isLastElementFocused.value = true;\n openMenu();\n };\n\n return {\n // Values\n menuButtonRef,\n menuId,\n popoverId,\n showMenu,\n computedButtonPropsWithDefaults,\n computedMenuWidth,\n isLastElementFocused,\n\n // Classes\n computedClasses,\n isInverseColorSet,\n\n // Methods\n hasSlot: useHasSlot(slots),\n onKeyDown,\n onKeyUp,\n closeMenu,\n toggleShowMenu,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu.scss\" />\n"],"names":["_sfc_main$5","defineComponent","BaseButton","BentoTypography","ChevronRightIcon","BentoBaseButtonEvent","props","emit","computed","e","BentoMenuEvent","BentoMenuEvent2","_sfc_main$4","_sfc_main$3","messages","BentoDivider","MenuItem","MenuListContainer","subMenuItemListRefLocal","ref","subMenuFocusedIndex","numberOfItems","closeMenu","onBackButton","computedItems","items","_a","el","ChevronLeftIcon","focusItem","_e","_d","_c","_b","onMounted","focusPrevious","focusNext","_sfc_main$2","SubMenuItemList","menuItemListRef","menuItemListWrapperRef","subMenuItemListRef","showSubMenu","visibleSubMenuIndex","focusedIndex","hasMenuItemsWithIcon","computedData","indent","toggleMenu","item","index","focusRight","focusLeft","subMenuHeight","computedHeight","MENU_INVERSE_INJECTION_KEY","uuid","_sfc_main$1","_sfc_main","BentoToggleButton","BentoPopover","BentoTeleport","MenuItemList","OptionsVerticalIcon","BentoClickOutsideDirective","BentoPopoverPositions","value","slots","menuButtonRef","showMenu","isLastElementFocused","menuId","generateUid","popoverId","isInverseColorSet","inject","provide","DIVIDER_INVERSE_INJECTION_KEY","computedClasses","computedMenuWidth","computedButtonPropsWithDefaults","openMenu","toggleShowMenu","onKeyDown","onKeyUp","useHasSlot"],"mappings":";;;;;;;;;;;;;AAkCA,MAAAA,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA,EAAA,YAAAC,GAAA,iBAAAC,GAAA,kBAAAC,EAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IACA,MAAA;AAAA,MAIA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,SAAA;AAAA,MAIA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,eAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,SAAA;AAA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AAA,IAAA,GAGAY,IAAA,MAAA;AACA,MAAA+C,EAAA,UACAA,EAAA,QAAA,IACAD,EAAA,MAAA,IAAA,MAAA,GACA7D,EAAAG,EAAA,KAAA;AAAA,IACA,GAGAwE,IAAA,CAAAzE,MAAA;AACA,MAAAA,EAAA,gBAAA,GACA4D,EAAA,QAGA/C,EAAA,IAFA2D,EAAA;AAAA,IAGA,GAGAE,IAAA,MAAA;AACA,MAAAb,EAAA,QAAA,IACAW,EAAA;AAAA,IAAA,GAGAG,IAAA,MAAA;AACA,MAAAd,EAAA,QAAA,IACAW,EAAA;AAAA,IAAA;AAGA,WAAA;AAAA;AAAA,MAAA,eAAAb;AAAA,MAEA,QAAAG;AAAA,MACA,WAAAE;AAAA,MACA,UAAAJ;AAAA,MACA,iCAAAW;AAAA,MACA,mBAAAD;AAAA,MACA,sBAAAT;AAAA;AAAA,MACA,iBAAAQ;AAAA,MAGA,mBAAAJ;AAAA;AAAA,MACA,SAAAW,EAAAlB,CAAA;AAAA,MAGA,WAAAgB;AAAA,MACA,SAAAC;AAAA,MACA,WAAA9D;AAAA,MACA,gBAAA4D;AAAA,IACA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[6]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d681cfda.js","sources":["../../../core/src/components/link/link.types.ts","../../../../node_modules/@adyen/ui-assets-icons-16/dist/vue/external-link.vue","../../src/components/link/link.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoLinkVariant {\n DEFAULT = 'default',\n QUIET = 'quiet',\n}\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#00112C\" d=\"M2.93933 11.9999L10.1893 4.74989H5.24999V3.24989H12.75V10.7499H11.25V5.81055L3.99999 13.0605L2.93933 11.9999Z\"/></svg>\n</template>\n<script>\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n<style>\n @import '../css/main.css';\n</style>\n","<template>\n <a\n v-if=\"external || isNotRouting\"\n class=\"b-link\"\n :class=\"conditionalClasses\"\n v-bind=\"$attrs\"\n :href=\"$props.to.toString()\"\n :title=\"getAttributeTitle($attrs.title)\"\n :target=\"computedTarget\"\n @click=\"onClick\"\n >\n <bento-typography v-if=\"!disableTypography\" class=\"b-link__text\" el=\"span\" variant=\"body\">\n <slot />\n </bento-typography>\n <slot v-else />\n <span v-if=\"showExternalLinkIcon\" class=\"b-link__external-link-icon\">\n <external-link-icon />\n </span>\n </a>\n <router-link\n v-else\n v-bind=\"{ ...$attrs, ...$props }\"\n class=\"b-link\"\n :class=\"conditionalClasses\"\n :target=\"target\"\n :to=\"props.to\"\n custom\n @click.native=\"onClick\"\n >\n <bento-typography v-if=\"!disableTypography\" class=\"b-link__text\" el=\"span\" variant=\"body\">\n <slot />\n </bento-typography>\n <slot v-else />\n </router-link>\n</template>\n\n<script setup lang=\"ts\">\n import { RouterLink } from 'vue-router';\n import { computed } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoLinkVariant } from '@/core/components/link/link.types';\n import type { RouterLinkSlotArgument } from 'vue-router/types/router';\n import ExternalLinkIcon from '@adyen/ui-assets-icons-16/vue/external-link';\n\n /* eslint-disable vue/require-default-prop */ // Allow RouterLink to set the defaults\n /* eslint-disable @typescript-eslint/no-explicit-any */ // \"to\" needs to be any\n export interface LinkProps {\n /**\n * Denotes the target route of the link. When clicked, the value of the `to` prop will be passed to\n * `router.push()` internally, so the value can be either a \"string\" or a location\" descriptor object.\n */\n to: any;\n /* eslint-enable @typescript-eslint/no-explicit-any */\n\n /**\n * Setting `replace` prop will call `router.replace()` instead of `router.push()` when clicked, so the navigation will\n * not create a new history record.\n *\n * @default false\n */\n replace?: boolean;\n /**\n * Setting `append` prop always appends the relative path to the current path. For example, assuming we are navigating\n * from `/a` to a relative link `b`, without `append` we will end up at `/b`, but with append we will end up at\n * `/a/b`.\n *\n * @default false\n */\n append?: boolean;\n /**\n * Sometimes we want <RouterLink> to render as another tag, e.g <li>. Then we can use tag prop to specify which tag to\n * render to, and it will still listen to click events for navigation.\n *\n * @default \"a\"\n */\n tag?: string;\n /**\n * Configure the active CSS class applied when the link is active. Note the default value can also be configured\n * globally via the `linkActiveClass` router constructor option.\n *\n * @default \"router-link-active\"\n */\n activeClass?: string;\n /**\n * The default active class matching behavior is **inclusive match**. For example, `<RouterLink to=\"/a\">` will get\n * this class applied as long as the current path starts with `/a/` or is `/a`.\n *\n * @default false\n */\n exact?: boolean;\n /**\n * Allows matching only using the `path` section of the url, effectively ignoring the `query` and the `hash` sections.\n *\n * @default false\n */\n exactPath?: boolean;\n /**\n * Configure the active CSS class applied when the link is active with exact path match. Note the default value can\n * also be configured globally via the `linkExactPathActiveClass` router constructor option.\n *\n * @default \"router-link-exact-path-active\"\n */\n exactPathActiveClass?: string;\n\n /**\n * Specify the event(s) that can trigger the link navigation.\n *\n * @default 'click'\n */\n event?: string | ReadonlyArray<string>;\n /**\n * Configure the active CSS class applied when the link is active with exact match. Note the default value can also be\n * configured globally via the `linkExactActiveClass` router constructor option.\n *\n * @default \"router-link-exact-active\"\n */\n exactActiveClass?: string;\n /**\n * Configure the value of `aria-current` when the link is active with exact match. It must be one of the allowed\n * values for [aria-current](https://www.w3.org/TR/wai-aria-1.2/#aria-current) in the ARIA spec. In most cases, the\n * default of page should be the best fit.\n *\n * @default \"page\"\n */\n ariaCurrentValue?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false';\n\n /**\n * Custom Props\n */\n\n /**\n * Disable the default typography for the component. Only use this when the component is inside another typography component.\n */\n disableTypography?: boolean;\n\n /**\n * Set the rendered link to a regular external anchor link and renders an external link icon.\n */\n external?: boolean;\n\n /**\n * Set to true if used inside a `BentoButton` component.\n */\n isButton?: boolean;\n\n /**\n * Set the rendered link to a regular external anchor link.\n */\n isNotRouting?: boolean;\n\n /**\n * Sets the target of the rendered link.\n */\n target?: string;\n\n /**\n * Set to true to truncate link. Doesn't work with disableTypography.\n */\n truncate?: boolean;\n\n /**\n * Link variant type affecting visual style.\n * @values default, quiet\n */\n variant?: BentoLinkVariant | `${BentoLinkVariant}`;\n }\n\n const props = withDefaults(defineProps<LinkProps>(), {\n target: null,\n variant: BentoLinkVariant.DEFAULT,\n });\n\n const getAttributeTitle = (attributesTitle: unknown) => attributesTitle as string;\n\n const conditionalClasses = computed(() => ({\n [`b-link--${BentoLinkVariant.QUIET}`]: props.variant === BentoLinkVariant.QUIET,\n [`b-link--truncate`]: props.truncate,\n }));\n\n const computedTarget = computed(() => (props.external ? props.target ?? '_blank' : props.target));\n const showExternalLinkIcon = computed(() => !(props.isButton || props.isNotRouting));\n\n const emit = defineEmits<{\n (e: 'click', clickEvent: MouseEvent): void;\n }>();\n\n const onClick = (e: MouseEvent, navigateCallback?: RouterLinkSlotArgument['navigate']) => {\n emit('click', e);\n if (navigateCallback) {\n navigateCallback();\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Extends the `router-link` from the `vue-router` NPM package.\n *\n * @example\n * import { BentoLink } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoLink },\n * template: `\n * <bento-link to=\"/\">\n * link\n * </bento-link>\n * `\n * }\n */\n export default {\n name: 'bento-link',\n inheritAttrs: false,\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/link/link.scss\" />\n"],"names":["BentoLinkVariant","BentoLinkVariant2","uuid","_sfc_main$1","__default__","getAttributeTitle","attributesTitle","conditionalClasses","computed","props","computedTarget","showExternalLinkIcon","e","navigateCallback","emit"],"mappings":";;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA;ACEZ,IAAAE,IAAA;AAEA,MAAAC,IAAA;AAAA,EACA,eAAA;AACA,SAAA,OAAAD,EAAA,SAAA,GACAA,KAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;qBCsMIE,IAAA;AAAA,EAAe,MAAA;AAAA,EACL,cAAA;AAEV;;;;;;;;;;;;;;;;;;;;;;;;iBAzCAC,IAAA,CAAAC,MAAAA,GAEAC,IAAAC,EAAA,OAAA;AAAA,MAA2C,CAAA,WAAAR,EAAA,OAAA,GAAAS,EAAA,YAAAT,EAAA;AAAA,MACmC,CAAA,kBAAA,GAAAS,EAAA;AAAA,IAC9C,EAAA,GAGhCC,IAAAF,EAAA,MAAAC,EAAA,WAAAA,EAAA,UAAA,WAAAA,EAAA,MAAA,GACAE,IAAAH,EAAA,MAAA,EAAAC,EAAA,YAAAA,EAAA,aAAA;6IAMA,CAAAG,GAAAC,MAAA;AACI,MAAAC,EAAA,SAAAF,CAAA,GACAC,KACIA,EAAA;AAAA,IACJ;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[1]}
File without changes