@adyen/bento-vue3 1.62.0 → 1.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/dist/@types/index.d.ts +181 -235
  2. package/dist/accordion.js +1 -1
  3. package/dist/action-bar.js +1 -1
  4. package/dist/assets/accordion-item.css +1 -1
  5. package/dist/assets/action-bar.css +1 -1
  6. package/dist/assets/base-modal.css +1 -1
  7. package/dist/assets/card.css +1 -1
  8. package/dist/assets/checkbox-input.css +1 -1
  9. package/dist/assets/data-grid.css +1 -1
  10. package/dist/assets/date-range-picker.css +1 -1
  11. package/dist/assets/dialog-page.css +1 -1
  12. package/dist/assets/file-uploader.css +1 -1
  13. package/dist/assets/header-with-views.css +1 -1
  14. package/dist/assets/inspector.css +1 -1
  15. package/dist/assets/listbox-option-tag.css +1 -1
  16. package/dist/assets/menu.css +1 -1
  17. package/dist/assets/modal-fullscreen.css +1 -1
  18. package/dist/assets/popover.css +1 -1
  19. package/dist/assets/sidepanel.css +1 -1
  20. package/dist/assets/use-cached-selected-values.css +1 -1
  21. package/dist/card.js +1 -1
  22. package/dist/checkbox.js +3 -3
  23. package/dist/chunks/{accordion-item.QL3wdbhL.js → accordion-item.DOnW0OnU.js} +16 -15
  24. package/dist/chunks/{accordion-item.QL3wdbhL.js.map → accordion-item.DOnW0OnU.js.map} +1 -1
  25. package/dist/chunks/{action-bar.DZhxAMLL.js → action-bar.D8eibCuD.js} +2 -2
  26. package/dist/chunks/{action-bar.DZhxAMLL.js.map → action-bar.D8eibCuD.js.map} +1 -1
  27. package/dist/chunks/{button-actions-with-menu.DhqEdBBQ.js → button-actions-with-menu.BS4gewjn.js} +2 -2
  28. package/dist/chunks/{button-actions-with-menu.DhqEdBBQ.js.map → button-actions-with-menu.BS4gewjn.js.map} +1 -1
  29. package/dist/chunks/{calendar.DW8Uy3b_.js → calendar.CLpwW_-k.js} +2 -2
  30. package/dist/chunks/{calendar.DW8Uy3b_.js.map → calendar.CLpwW_-k.js.map} +1 -1
  31. package/dist/chunks/card.DiBtLuRU.js +227 -0
  32. package/dist/chunks/card.DiBtLuRU.js.map +1 -0
  33. package/dist/chunks/{checkbox-group.Dsmy9OW5.js → checkbox-group.Aqtco8Q5.js} +2 -2
  34. package/dist/chunks/{checkbox-group.Dsmy9OW5.js.map → checkbox-group.Aqtco8Q5.js.map} +1 -1
  35. package/dist/chunks/checkbox-input.DFkwZ4GM.js +144 -0
  36. package/dist/chunks/checkbox-input.DFkwZ4GM.js.map +1 -0
  37. package/dist/chunks/{checkbox.C4dJVYbB.js → checkbox.Hl6-8Sai.js} +22 -21
  38. package/dist/chunks/{checkbox.C4dJVYbB.js.map → checkbox.Hl6-8Sai.js.map} +1 -1
  39. package/dist/chunks/chevron-down.DCQ6ZLaq.js +29 -0
  40. package/dist/chunks/chevron-down.DCQ6ZLaq.js.map +1 -0
  41. package/dist/chunks/{chevron-left.Cfn1uGLH.js → chevron-right.Brdj0WlO.js} +5 -5
  42. package/dist/chunks/chevron-right.Brdj0WlO.js.map +1 -0
  43. package/dist/chunks/chevron-up.kfuLRpZb.js +29 -0
  44. package/dist/chunks/chevron-up.kfuLRpZb.js.map +1 -0
  45. package/dist/chunks/{code-snippet.Cn2Lcvup.js → code-snippet.DyAfzpUj.js} +2 -2
  46. package/dist/chunks/{code-snippet.Cn2Lcvup.js.map → code-snippet.DyAfzpUj.js.map} +1 -1
  47. package/dist/chunks/{dashboard-section.BEpgS9FV.js → dashboard-section.Bff7RNHI.js} +3 -3
  48. package/dist/chunks/{dashboard-section.BEpgS9FV.js.map → dashboard-section.Bff7RNHI.js.map} +1 -1
  49. package/dist/chunks/{data-grid-template.DCJc9gFg.js → data-grid-template.Dt-4ta3L.js} +3 -3
  50. package/dist/chunks/{data-grid-template.DCJc9gFg.js.map → data-grid-template.Dt-4ta3L.js.map} +1 -1
  51. package/dist/chunks/{data-grid.CMwzTU-b.js → data-grid.dnbCuBF7.js} +1266 -1278
  52. package/dist/chunks/data-grid.dnbCuBF7.js.map +1 -0
  53. package/dist/chunks/{date-picker.BcquOXbz.js → date-picker.Bfemi1um.js} +15 -15
  54. package/dist/chunks/{date-picker.BcquOXbz.js.map → date-picker.Bfemi1um.js.map} +1 -1
  55. package/dist/chunks/date-range-picker.BJm2xOoG.js +1209 -0
  56. package/dist/chunks/date-range-picker.BJm2xOoG.js.map +1 -0
  57. package/dist/chunks/{dropdown-default-textbox.CtsO8vqZ.js → dropdown-default-textbox.B05elQig.js} +7 -6
  58. package/dist/chunks/{dropdown-default-textbox.CtsO8vqZ.js.map → dropdown-default-textbox.B05elQig.js.map} +1 -1
  59. package/dist/chunks/{dropdown-tag.6DqQdI4d.js → dropdown-tag.CQMkfl3K.js} +3 -3
  60. package/dist/chunks/{dropdown-tag.6DqQdI4d.js.map → dropdown-tag.CQMkfl3K.js.map} +1 -1
  61. package/dist/chunks/{dropdown.OG72_pRK.js → dropdown.BPQS22Kl.js} +27 -27
  62. package/dist/chunks/{dropdown.OG72_pRK.js.map → dropdown.BPQS22Kl.js.map} +1 -1
  63. package/dist/chunks/es6.n1ewaW31.js.map +1 -1
  64. package/dist/chunks/{filter-bar.CV9gc16N.js → filter-bar.BNMR3HZ5.js} +15 -14
  65. package/dist/chunks/{filter-bar.CV9gc16N.js.map → filter-bar.BNMR3HZ5.js.map} +1 -1
  66. package/dist/chunks/{fixed-scroller.Cmi0TpjZ.js → fixed-scroller.D5nAPPbo.js} +31 -31
  67. package/dist/chunks/fixed-scroller.D5nAPPbo.js.map +1 -0
  68. package/dist/chunks/{header-with-views.B3WWqTtt.js → header-with-views.go02TaiU.js} +435 -435
  69. package/dist/chunks/header-with-views.go02TaiU.js.map +1 -0
  70. package/dist/chunks/{header.D94roWI-.js → header.CLg3TLJs.js} +2 -2
  71. package/dist/chunks/{header.D94roWI-.js.map → header.CLg3TLJs.js.map} +1 -1
  72. package/dist/chunks/{input-field-password.BsH_9lnw.js → input-field-password.B5zx9e4K.js} +3 -3
  73. package/dist/chunks/{input-field-password.BsH_9lnw.js.map → input-field-password.B5zx9e4K.js.map} +1 -1
  74. package/dist/chunks/{input-field-phone-number.CiicWtuZ.js → input-field-phone-number.DqfmWaJ2.js} +3 -3
  75. package/dist/chunks/{input-field-phone-number.CiicWtuZ.js.map → input-field-phone-number.DqfmWaJ2.js.map} +1 -1
  76. package/dist/chunks/{input-field.D3z0nJ43.js → input-field.CfsdWr4t.js} +2 -2
  77. package/dist/chunks/{input-field.D3z0nJ43.js.map → input-field.CfsdWr4t.js.map} +1 -1
  78. package/dist/chunks/listbox-option-tag.0fIXV0Bs.js +57 -0
  79. package/dist/chunks/listbox-option-tag.0fIXV0Bs.js.map +1 -0
  80. package/dist/chunks/menu.CCDxWQPw.js +679 -0
  81. package/dist/chunks/menu.CCDxWQPw.js.map +1 -0
  82. package/dist/chunks/minus-small.DYIyF5XW.js +32 -0
  83. package/dist/chunks/minus-small.DYIyF5XW.js.map +1 -0
  84. package/dist/chunks/{pagination.B_d4N-RQ.js → pagination.BKyr5hq_.js} +2 -2
  85. package/dist/chunks/{pagination.B_d4N-RQ.js.map → pagination.BKyr5hq_.js.map} +1 -1
  86. package/dist/chunks/{rich-text-editor.CnoXCpHV.js → rich-text-editor.BK2zdyOm.js} +2 -2
  87. package/dist/chunks/{rich-text-editor.CnoXCpHV.js.map → rich-text-editor.BK2zdyOm.js.map} +1 -1
  88. package/dist/chunks/{search-bar.BeOwzjq4.js → search-bar.DgOHq0ns.js} +3 -3
  89. package/dist/chunks/{search-bar.BeOwzjq4.js.map → search-bar.DgOHq0ns.js.map} +1 -1
  90. package/dist/chunks/{secondary-nav.GRqyqoMi.js → secondary-nav.BHpoi5U4.js} +2 -2
  91. package/dist/chunks/{secondary-nav.GRqyqoMi.js.map → secondary-nav.BHpoi5U4.js.map} +1 -1
  92. package/dist/chunks/{selection-card-group.0tHKJZ1M.js → selection-card-group.-8bXRhOW.js} +2 -2
  93. package/dist/chunks/{selection-card-group.0tHKJZ1M.js.map → selection-card-group.-8bXRhOW.js.map} +1 -1
  94. package/dist/chunks/{tabs.CkDHEdGa.js → tabs.Cq1fdzVh.js} +2 -2
  95. package/dist/chunks/{tabs.CkDHEdGa.js.map → tabs.Cq1fdzVh.js.map} +1 -1
  96. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.20XC06Eu.js → tutorial.vue_vue_type_script_setup_true_lang.BlSsK0Rr.js} +2 -2
  97. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.20XC06Eu.js.map → tutorial.vue_vue_type_script_setup_true_lang.BlSsK0Rr.js.map} +1 -1
  98. package/dist/chunks/{use-cached-selected-values.CUi4XfMa.js → use-cached-selected-values.swt0cdsA.js} +603 -571
  99. package/dist/chunks/use-cached-selected-values.swt0cdsA.js.map +1 -0
  100. package/dist/code-snippet.js +1 -1
  101. package/dist/dashboard-template.js +1 -1
  102. package/dist/data-grid-template.js +1 -1
  103. package/dist/data-grid.js +1 -1
  104. package/dist/date-picker.js +2 -2
  105. package/dist/date-range-picker.js +2 -2
  106. package/dist/dropdown.js +4 -4
  107. package/dist/filter-bar.js +1 -1
  108. package/dist/header-with-views.js +1 -1
  109. package/dist/header.js +1 -1
  110. package/dist/index.js +31 -31
  111. package/dist/input-field-password.js +1 -1
  112. package/dist/input-field-phone-number.js +1 -1
  113. package/dist/input-field.js +1 -1
  114. package/dist/internal.js +5 -5
  115. package/dist/menu.js +1 -1
  116. package/dist/pagination.js +1 -1
  117. package/dist/rich-text-editor.js +1 -1
  118. package/dist/search-bar.js +2 -2
  119. package/dist/secondary-nav.js +1 -1
  120. package/dist/selection-card.js +1 -1
  121. package/dist/styles/bento-dark.css +4 -0
  122. package/dist/styles/bento-light.css +4 -0
  123. package/dist/styles/bento.css +4 -0
  124. package/dist/styles/legacy.css +4 -0
  125. package/dist/styles/styleguide.css +4 -0
  126. package/dist/tabs.js +1 -1
  127. package/dist/tutorial.js +1 -1
  128. package/dist/web-types.json +1 -1
  129. package/package.json +6 -6
  130. package/dist/chunks/card.CxeuIcpZ.js +0 -213
  131. package/dist/chunks/card.CxeuIcpZ.js.map +0 -1
  132. package/dist/chunks/checkbox-input.BhAIj6Cq.js +0 -168
  133. package/dist/chunks/checkbox-input.BhAIj6Cq.js.map +0 -1
  134. package/dist/chunks/chevron-left.Cfn1uGLH.js.map +0 -1
  135. package/dist/chunks/chevron-up.MAa3Ksgd.js +0 -52
  136. package/dist/chunks/chevron-up.MAa3Ksgd.js.map +0 -1
  137. package/dist/chunks/data-grid.CMwzTU-b.js.map +0 -1
  138. package/dist/chunks/date-range-picker.DSgv57wo.js +0 -1181
  139. package/dist/chunks/date-range-picker.DSgv57wo.js.map +0 -1
  140. package/dist/chunks/fixed-scroller.Cmi0TpjZ.js.map +0 -1
  141. package/dist/chunks/header-with-views.B3WWqTtt.js.map +0 -1
  142. package/dist/chunks/listbox-option-tag.WzftYVP_.js +0 -55
  143. package/dist/chunks/listbox-option-tag.WzftYVP_.js.map +0 -1
  144. package/dist/chunks/menu.DOKYXlFy.js +0 -768
  145. package/dist/chunks/menu.DOKYXlFy.js.map +0 -1
  146. package/dist/chunks/use-cached-selected-values.CUi4XfMa.js.map +0 -1
@@ -0,0 +1,679 @@
1
+ import { createElementBlock as L, openBlock as p, mergeProps as X, createCommentVNode as w, createElementVNode as P, toDisplayString as V, defineComponent as W, computed as E, resolveComponent as B, createBlock as S, normalizeClass as Q, createSlots as ee, withCtx as I, createVNode as $, createTextVNode as j, resolveDynamicComponent as re, ref as c, inject as te, toHandlers as ce, renderSlot as G, onMounted as ne, Transition as de, withKeys as g, withModifiers as U, Fragment as oe, renderList as se, watch as me, nextTick as q, normalizeStyle as le, useSlots as fe, provide as pe, unref as h } from "vue";
2
+ import { B as ie, D as ve } from "./divider.qUOSAbU6.js";
3
+ import { a as be, B as ye } from "./popover.maCMPyz8.js";
4
+ import { u as Ce } from "./use-click-outside.BnhTgpSt.js";
5
+ import { u as he } from "./use-has-slot.B7eQSabc.js";
6
+ import { g as _e } from "./generate-uid.NJ8tVoha.js";
7
+ import { u as Ie } from "./i18n.B6g5VX0q.js";
8
+ import { B as ge, p as ke } from "./typography.DN5eC5ch.js";
9
+ import { C as Me } from "./chevron-down.DCQ6ZLaq.js";
10
+ /* empty css */
11
+ import { _ as R } from "./_plugin-vue_export-helper.CHgC5LLL.js";
12
+ import { B as Be } from "./toggle-button.NQwrfSr1.js";
13
+ import { B as Se } from "./teleport.CfGWjxe2.js";
14
+ import { a as $e, C as z } from "./chevron-right.Brdj0WlO.js";
15
+ import { a as J, B as Ee } from "./base-button.DdNFlbgH.js";
16
+ import { t as Le } from "./truncate.BfIl_-71.js";
17
+ import "../assets/menu.css";
18
+ const Te = Symbol("menu inverse style injection key");
19
+ let Z = 0;
20
+ const we = {
21
+ beforeCreate() {
22
+ this.uuid = Z.toString(), Z += 1;
23
+ }
24
+ }, Oe = { key: 0 };
25
+ function Ne(e, o, v, s, d, b) {
26
+ return p(), L("svg", X({ role: "img" }, e.$attrs, {
27
+ class: "ui-assets-icons-16",
28
+ xmlns: "http://www.w3.org/2000/svg",
29
+ width: "16",
30
+ height: "16",
31
+ fill: "none"
32
+ }), [
33
+ e.$attrs["svg-title"] ? (p(), L("title", Oe, V(e.$attrs["svg-title"]), 1)) : w("", !0),
34
+ o[0] || (o[0] = P("path", {
35
+ fill: "#001222",
36
+ 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"
37
+ }, null, -1)),
38
+ o[1] || (o[1] = P("path", {
39
+ fill: "#001222",
40
+ 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"
41
+ }, null, -1)),
42
+ o[2] || (o[2] = P("path", {
43
+ fill: "#001222",
44
+ 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"
45
+ }, null, -1))
46
+ ], 16);
47
+ }
48
+ const Re = /* @__PURE__ */ R(we, [["render", Ne]]), De = W({
49
+ name: "menu-item",
50
+ components: { BaseButton: Ee, BentoTypography: ge, ChevronRightIcon: $e },
51
+ props: {
52
+ /**
53
+ * menu-item text that gets displayed as the main label
54
+ */
55
+ text: {
56
+ type: String,
57
+ required: !0
58
+ },
59
+ /**
60
+ * menu-item action that gets executed when the MeniItem is clicked
61
+ */
62
+ handler: {
63
+ type: Function,
64
+ required: !0
65
+ },
66
+ /**
67
+ * menu-item text that gets displayed as the secondary label
68
+ */
69
+ secondaryText: {
70
+ type: String,
71
+ default: null
72
+ },
73
+ /**
74
+ * Optional chevron icon displayed to the right of the menu-item
75
+ */
76
+ chevron: {
77
+ type: Boolean,
78
+ default: !1
79
+ },
80
+ /**
81
+ * Optional icon displayed to the left of the menu-item
82
+ */
83
+ icon: {
84
+ // Types for Vue2 (Object) and Vue3 (Function)
85
+ // TODO: Remove Object when fully migrated to Vue3
86
+ type: [Object, Function],
87
+ default: null
88
+ },
89
+ /**
90
+ * Disables menu-item button functionality
91
+ */
92
+ disabled: {
93
+ type: Boolean,
94
+ default: !1
95
+ },
96
+ /**
97
+ * Displays an indent variant od the menu-item
98
+ */
99
+ indent: {
100
+ type: Boolean,
101
+ default: !1
102
+ },
103
+ /**
104
+ * Displays menu-item button as critical
105
+ */
106
+ critical: {
107
+ type: Boolean,
108
+ default: !1
109
+ },
110
+ /**
111
+ * Renders the text in a bold variant
112
+ */
113
+ isTitle: {
114
+ type: Boolean,
115
+ default: !1
116
+ }
117
+ },
118
+ emits: [J.CLICK],
119
+ setup(e, { emit: o }) {
120
+ const s = E(() => ({
121
+ "b-menu-item--critical": e.critical,
122
+ "b-menu-item--indent": e.indent
123
+ })), d = E(() => Le(e.secondaryText, 10));
124
+ return {
125
+ // Values
126
+ conditionalClasses: s,
127
+ computedSecondaryText: d,
128
+ // Methods
129
+ onClick: (i) => {
130
+ i.stopPropagation(), e.handler(), o(J.CLICK);
131
+ }
132
+ };
133
+ }
134
+ });
135
+ function Pe(e, o, v, s, d, b) {
136
+ const i = B("bento-typography"), a = B("chevron-right-icon"), u = B("base-button");
137
+ return p(), S(u, {
138
+ class: Q(["b-menu-item", e.conditionalClasses]),
139
+ role: "menuitem",
140
+ disabled: e.disabled,
141
+ tabindex: "-1",
142
+ onClick: e.onClick
143
+ }, ee({
144
+ default: I(() => [
145
+ $(i, {
146
+ el: "span",
147
+ variant: "body",
148
+ stronger: e.isTitle,
149
+ class: "b-menu-item__primary-text"
150
+ }, {
151
+ default: I(() => [
152
+ j(V(e.text), 1)
153
+ ]),
154
+ _: 1
155
+ }, 8, ["stronger"]),
156
+ e.computedSecondaryText ? (p(), S(i, {
157
+ key: 0,
158
+ el: "span",
159
+ variant: "body",
160
+ class: "b-menu-item__secondary-text"
161
+ }, {
162
+ default: I(() => [
163
+ j(V(e.computedSecondaryText), 1)
164
+ ]),
165
+ _: 1
166
+ })) : w("", !0)
167
+ ]),
168
+ _: 2
169
+ }, [
170
+ e.icon ? {
171
+ name: "iconLeft",
172
+ fn: I(() => [
173
+ (p(), S(re(e.icon), {
174
+ class: "b-menu-item__icon-left",
175
+ "aria-hidden": "true"
176
+ }))
177
+ ]),
178
+ key: "0"
179
+ } : void 0,
180
+ e.chevron ? {
181
+ name: "iconRight",
182
+ fn: I(() => [
183
+ $(a, { "aria-hidden": "true" })
184
+ ]),
185
+ key: "1"
186
+ } : void 0
187
+ ]), 1032, ["class", "disabled", "onClick"]);
188
+ }
189
+ const ue = /* @__PURE__ */ R(De, [["render", Pe], ["__scopeId", "data-v-4cecac65"]]);
190
+ var M = /* @__PURE__ */ ((e) => (e.BACK = "back", e.CLOSE = "close", e.OPEN = "open", e))(M || {});
191
+ const We = Symbol("menu registering injection key"), Ke = {
192
+ name: "bento-menu-list-container"
193
+ }, Ae = /* @__PURE__ */ W({
194
+ ...Ke,
195
+ setup(e) {
196
+ const o = c(), v = c({}), s = te(
197
+ We,
198
+ !1
199
+ );
200
+ if (s) {
201
+ const { registerMenuContainerElement: d } = s;
202
+ d(o), v.value = {
203
+ mouseleave: s == null ? void 0 : s.menuMouseLeave
204
+ };
205
+ }
206
+ return (d, b) => (p(), L("div", X({
207
+ ref_key: "menuListContainerRef",
208
+ ref: o,
209
+ class: "b-menu-list-container",
210
+ "data-testid": "menu-list-container"
211
+ }, ce(v.value, !0)), [
212
+ G(d.$slots, "default", {}, void 0, !0)
213
+ ], 16));
214
+ }
215
+ }), ae = /* @__PURE__ */ R(Ae, [["__scopeId", "data-v-02a3ca45"]]), Y = {
216
+ "en-US": {
217
+ backButton: "Go back",
218
+ menuButton: "Open menu"
219
+ }
220
+ }, xe = W({
221
+ i18n: { messages: Y },
222
+ name: "sub-menu-item-list",
223
+ components: { BentoDivider: ie, MenuItem: ue, MenuListContainer: ae },
224
+ props: {
225
+ items: {
226
+ type: Array,
227
+ required: !0
228
+ },
229
+ title: {
230
+ type: String,
231
+ required: !0
232
+ }
233
+ },
234
+ emits: [M.CLOSE, M.BACK],
235
+ setup(e, { emit: o }) {
236
+ const v = c(null), s = c(0), d = c(e.items.length), b = () => o(M.CLOSE), i = () => o(M.BACK), a = E(() => {
237
+ var m;
238
+ const l = (m = e.items) == null ? void 0 : m.map((f) => ({
239
+ ...f,
240
+ indent: !f.icon,
241
+ isTitle: !1,
242
+ clickHandler: b
243
+ }));
244
+ return [
245
+ {
246
+ text: e.title,
247
+ secondaryText: null,
248
+ critical: !1,
249
+ icon: z,
250
+ isTitle: !0,
251
+ disabled: !1,
252
+ indent: !1,
253
+ handler: i,
254
+ clickHandler: i,
255
+ addDivider: !0
256
+ },
257
+ ...l
258
+ ];
259
+ }), u = async () => {
260
+ var l, m, f, y, k;
261
+ (k = (y = (f = (m = (l = v.value) == null ? void 0 : l.children) == null ? void 0 : m[s.value]) == null ? void 0 : f.children) == null ? void 0 : y[0]) == null || k.focus();
262
+ };
263
+ ne(async () => {
264
+ setTimeout(() => u(), 150);
265
+ });
266
+ const n = () => {
267
+ s.value > 0 ? (s.value -= 1, a.value[s.value].disabled && n()) : s.value = d.value, u();
268
+ }, t = () => {
269
+ s.value < d.value ? (s.value += 1, a.value[s.value].disabled && t()) : s.value = 0, u();
270
+ };
271
+ return {
272
+ // Enums
273
+ BentoMenuEvent: M,
274
+ // Values
275
+ subMenuItemListRefLocal: v,
276
+ subMenuFocusedIndex: s,
277
+ ChevronLeftIcon: z,
278
+ computedItems: a,
279
+ // Methods
280
+ closeMenu: b,
281
+ onBackButton: i,
282
+ focusPrevious: n,
283
+ focusNext: t
284
+ };
285
+ }
286
+ });
287
+ function He(e, o, v, s, d, b) {
288
+ const i = B("menu-item"), a = B("bento-divider"), u = B("menu-list-container");
289
+ return p(), S(de, {
290
+ name: "b-sub-menu-item-list__transition",
291
+ appear: ""
292
+ }, {
293
+ default: I(() => [
294
+ $(u, { class: "b-sub-menu-item-list" }, {
295
+ default: I(() => [
296
+ P("ul", {
297
+ ref: "subMenuItemListRefLocal",
298
+ role: "menu",
299
+ class: "b-sub-menu-item-list__list",
300
+ onKeydown: [
301
+ o[0] || (o[0] = g(U((...n) => e.focusNext && e.focusNext(...n), ["stop"]), ["down"])),
302
+ o[1] || (o[1] = g(U((...n) => e.focusPrevious && e.focusPrevious(...n), ["stop"]), ["up"])),
303
+ o[2] || (o[2] = g(U((...n) => e.onBackButton && e.onBackButton(...n), ["stop"]), ["esc"]))
304
+ ]
305
+ }, [
306
+ (p(!0), L(oe, null, se(e.computedItems, (n, t) => (p(), L("li", {
307
+ key: `sub-menu-item-list-item-${t}`,
308
+ role: "none"
309
+ }, [
310
+ $(i, {
311
+ text: n.text,
312
+ handler: n.handler,
313
+ "secondary-text": n.secondaryText,
314
+ icon: n.icon,
315
+ "is-title": n.isTitle,
316
+ disabled: n.disabled,
317
+ critical: n.critical,
318
+ indent: n.indent,
319
+ tabindex: t === e.subMenuFocusedIndex ? "0" : "-1",
320
+ onClick: n.clickHandler
321
+ }, null, 8, ["text", "handler", "secondary-text", "icon", "is-title", "disabled", "critical", "indent", "tabindex", "onClick"]),
322
+ n.addDivider ? (p(), S(a, {
323
+ key: 0,
324
+ class: "b-sub-menu-item-list__divider"
325
+ })) : w("", !0)
326
+ ]))), 128))
327
+ ], 544)
328
+ ]),
329
+ _: 1
330
+ })
331
+ ]),
332
+ _: 1
333
+ });
334
+ }
335
+ const Fe = /* @__PURE__ */ R(xe, [["render", He], ["__scopeId", "data-v-621db243"]]);
336
+ function Ue(e, o, v) {
337
+ const b = c(0), i = c(0), a = (n) => {
338
+ if (!n || !n.parentElement)
339
+ return;
340
+ const t = n.parentElement, l = n.cloneNode(!0);
341
+ l.style.position = "absolute", l.style.visibility = "hidden", t.appendChild(l), l.style.width = "max-content";
342
+ const m = l.offsetWidth, f = Math.max(150, Math.min(m, 350));
343
+ b.value = f, l.style.width = `${f}px`;
344
+ const y = l.offsetHeight;
345
+ i.value = y, t.removeChild(l), i.value = y;
346
+ };
347
+ return me([o, v], async ([n]) => {
348
+ var t, l;
349
+ if (n !== null) {
350
+ await q();
351
+ const m = (l = (t = e.value) == null ? void 0 : t[0]) == null ? void 0 : l.$el;
352
+ m && a(m);
353
+ } else
354
+ b.value = 0, i.value = 0;
355
+ }), { computedStyle: E(() => {
356
+ const n = { width: "max-content" };
357
+ return v.value && (i.value > 0 && (n.height = `${i.value}px`), b.value > 0 && (n.width = `${b.value}px`)), n;
358
+ }) };
359
+ }
360
+ const Ve = W({
361
+ name: "menu-item-list",
362
+ components: { BentoDivider: ie, MenuItem: ue, MenuListContainer: ae, SubMenuItemList: Fe },
363
+ props: {
364
+ /**
365
+ * The data to be displayed in the list
366
+ */
367
+ data: {
368
+ type: Array,
369
+ required: !0
370
+ },
371
+ /**
372
+ * Displays the menu-items of the list in the indent variant. Only applies to elements that don't have an icon to their left.
373
+ */
374
+ indentItems: {
375
+ type: Boolean,
376
+ default: !1
377
+ },
378
+ /**
379
+ * 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.
380
+ */
381
+ focusLastElement: {
382
+ type: Boolean,
383
+ default: !1
384
+ },
385
+ /**
386
+ * If set to true, closes the menu when an item is clicked.
387
+ */
388
+ closeMenuOnItemSelect: {
389
+ type: Boolean,
390
+ default: !0
391
+ }
392
+ },
393
+ emits: [M.CLOSE, "menu-item-click"],
394
+ setup(e, { emit: o, expose: v }) {
395
+ const s = c(null), d = c(null), b = c(null), i = c(null), a = c(!1), u = c(null), n = c(e.focusLastElement ? e.data.length - 1 : 0), t = c(0), l = c(e.data.length - 1), m = E(() => e.data.some((C) => C.icon)), f = E(() => e.indentItems || m.value ? e.data.map((C) => {
396
+ let _ = !1;
397
+ return C.icon || (_ = !0), {
398
+ ...C,
399
+ indent: _
400
+ };
401
+ }) : e.data), y = async () => {
402
+ var C, _, r;
403
+ await q(), (r = (_ = (C = d.value) == null ? void 0 : C.children[n.value]) == null ? void 0 : _.children[0]) == null || r.focus();
404
+ }, k = () => o(M.CLOSE), O = (C, _) => {
405
+ if (C.items) {
406
+ u.value = _, a.value = !0;
407
+ return;
408
+ }
409
+ u.value = _, a.value = !1, !C.skipClose && e.closeMenuOnItemSelect !== !1 && k(), o("menu-item-click");
410
+ }, K = () => {
411
+ n.value > 0 ? (n.value -= 1, f.value[n.value].disabled && K()) : n.value = l.value, y();
412
+ }, N = () => {
413
+ n.value < l.value ? (n.value += 1, f.value[n.value].disabled && N()) : n.value = 0, y();
414
+ }, T = (C, _) => {
415
+ var r;
416
+ (r = C == null ? void 0 : C.items) != null && r.length && (u.value = _, a.value = !0);
417
+ }, A = () => {
418
+ u.value && a.value && (u.value = null, a.value = !1);
419
+ }, x = () => {
420
+ a.value = !1, u.value = null, y();
421
+ };
422
+ v({
423
+ focusItem: y
424
+ });
425
+ const { computedStyle: H } = Ue(i, u, a);
426
+ return {
427
+ // Values
428
+ menuItemListRef: d,
429
+ menuItemListWrapperRef: b,
430
+ subMenuItemListRef: i,
431
+ menuItemRef: s,
432
+ computedData: f,
433
+ computedStyle: H,
434
+ focusedIndex: n,
435
+ subMenuFocusedIndex: t,
436
+ showSubMenu: a,
437
+ visibleSubMenuIndex: u,
438
+ // Methods
439
+ menuItemClick: O,
440
+ closeMenu: k,
441
+ focusPrevious: K,
442
+ focusNext: N,
443
+ focusRight: T,
444
+ focusLeft: A,
445
+ onBackButton: x
446
+ };
447
+ }
448
+ }), Ge = ["onKeydown"];
449
+ function Xe(e, o, v, s, d, b) {
450
+ const i = B("menu-item"), a = B("bento-divider"), u = B("sub-menu-item-list"), n = B("menu-list-container");
451
+ return p(), S(n, {
452
+ ref: "menuItemListWrapperRef",
453
+ style: le(e.computedStyle)
454
+ }, {
455
+ default: I(() => [
456
+ P("ul", {
457
+ ref: "menuItemListRef",
458
+ class: "b-menu-item-list",
459
+ role: "menu",
460
+ onKeydown: [
461
+ o[1] || (o[1] = g((...t) => e.focusNext && e.focusNext(...t), ["down"])),
462
+ o[2] || (o[2] = g((...t) => e.focusPrevious && e.focusPrevious(...t), ["up"])),
463
+ o[3] || (o[3] = g((...t) => e.closeMenu && e.closeMenu(...t), ["esc"])),
464
+ o[4] || (o[4] = g((...t) => e.closeMenu && e.closeMenu(...t), ["tab"]))
465
+ ]
466
+ }, [
467
+ (p(!0), L(oe, null, se(e.computedData, (t, l) => {
468
+ var m, f, y, k;
469
+ return p(), L("li", {
470
+ key: `menu-item-${l}`,
471
+ ref_for: !0,
472
+ ref: "menuItemRef",
473
+ class: "b-menu-item-list__item",
474
+ role: "none",
475
+ onKeydown: [
476
+ g((O) => e.focusRight(t, l), ["right"]),
477
+ o[0] || (o[0] = g((O) => e.focusLeft(), ["left"]))
478
+ ]
479
+ }, [
480
+ $(i, {
481
+ text: t.text,
482
+ handler: (m = t.items) != null && m.length ? () => null : t.handler,
483
+ "secondary-text": t.secondaryText,
484
+ icon: t.icon,
485
+ chevron: !!((f = t.items) != null && f.length),
486
+ disabled: t.disabled,
487
+ critical: t.critical,
488
+ indent: t.indent,
489
+ tabindex: l === e.subMenuFocusedIndex ? "0" : "-1",
490
+ "aria-haspopup": !!((y = t.items) != null && y.length),
491
+ "aria-expanded": e.showSubMenu && e.visibleSubMenuIndex === l,
492
+ onClick: (O) => e.menuItemClick(t, l)
493
+ }, null, 8, ["text", "handler", "secondary-text", "icon", "chevron", "disabled", "critical", "indent", "tabindex", "aria-haspopup", "aria-expanded", "onClick"]),
494
+ t.addDivider ? (p(), S(a, {
495
+ key: 0,
496
+ class: "b-menu-item-list__divider"
497
+ })) : w("", !0),
498
+ (k = t.items) != null && k.length && e.showSubMenu && e.visibleSubMenuIndex === l ? (p(), S(u, {
499
+ key: 1,
500
+ ref_for: !0,
501
+ ref: "subMenuItemListRef",
502
+ items: t.items,
503
+ title: t.text,
504
+ onBack: e.onBackButton,
505
+ onClose: e.closeMenu
506
+ }, null, 8, ["items", "title", "onBack", "onClose"])) : w("", !0)
507
+ ], 40, Ge);
508
+ }), 128))
509
+ ], 544)
510
+ ]),
511
+ _: 1
512
+ }, 8, ["style"]);
513
+ }
514
+ const qe = /* @__PURE__ */ R(Ve, [["render", Xe], ["__scopeId", "data-v-999aa4e9"]]), Ye = {
515
+ i18n: { messages: Y },
516
+ name: "bento-menu"
517
+ }, je = /* @__PURE__ */ W({
518
+ ...Ye,
519
+ props: {
520
+ button: { default: () => ({
521
+ variant: "secondary"
522
+ }) },
523
+ closeMenuOnItemSelect: { type: Boolean, default: !0 },
524
+ data: {},
525
+ disableArrowDownOpeningMenu: { type: Boolean, default: !1 },
526
+ menuPosition: { default: be.BOTTOM_START },
527
+ menuFixedPositioning: { type: Boolean, default: !1 },
528
+ menuWidth: { default: null },
529
+ revertFocusToButton: { type: Boolean, default: !0 },
530
+ teleport: { type: Boolean, default: !1 },
531
+ closeOnClickOutsideOptions: { default: void 0 }
532
+ },
533
+ emits: ["menu-item-click", "click-outside"],
534
+ setup(e, { expose: o, emit: v }) {
535
+ var _;
536
+ const s = e, d = v, b = fe(), i = he(b), { t: a } = Ie({ messages: Y }), u = c(null), n = c(null), t = c(!1), l = c(!1), m = c(null), f = _e("menu"), y = te(Te, c(!1));
537
+ pe(ve, y);
538
+ const k = E(() => ({
539
+ "b-menu--inverse": y.value
540
+ })), O = E(() => s.menuWidth ? { width: `${s.menuWidth}px` } : null), K = E(() => {
541
+ if (s != null && s.button)
542
+ return {
543
+ variant: "secondary",
544
+ ...s.button
545
+ };
546
+ }), N = () => {
547
+ t.value = !0, d(M.OPEN);
548
+ }, T = async (r = s.revertFocusToButton) => {
549
+ var D, F;
550
+ t.value && (t.value = !1, r && (await q(), (F = (D = u.value) == null ? void 0 : D.$el) == null || F.focus()), d(M.CLOSE));
551
+ }, A = (r) => {
552
+ r.stopPropagation(), t.value ? T() : N();
553
+ }, x = (r) => {
554
+ r.preventDefault(), l.value = !1, s.disableArrowDownOpeningMenu || N();
555
+ }, H = (r) => {
556
+ r.preventDefault(), l.value = !0, N();
557
+ }, C = () => {
558
+ d("menu-item-click");
559
+ };
560
+ return Ce(
561
+ m,
562
+ () => {
563
+ T(), d("click-outside");
564
+ },
565
+ {
566
+ ...s.closeOnClickOutsideOptions,
567
+ ignore: [u, ...((_ = s.closeOnClickOutsideOptions) == null ? void 0 : _.ignore) ?? []]
568
+ }
569
+ ), o({
570
+ /**
571
+ * Control to enable programmatic closing of the menu
572
+ */
573
+ closeMenu: T
574
+ }), ne(() => {
575
+ i("iconRight") && ke(
576
+ '"bento-menu" no longer supports the "iconRight" slot. The right-aligned icon is now fixed by design.'
577
+ );
578
+ }), (r, D) => (p(), L("div", {
579
+ class: Q([k.value, "b-menu"]),
580
+ "data-testid": "menu",
581
+ onKeydown: [
582
+ g(x, ["down"]),
583
+ g(H, ["up"]),
584
+ D[0] || (D[0] = g((F) => T(), ["esc"]))
585
+ ]
586
+ }, [
587
+ $(h(Be), X({
588
+ ref_key: "menuButtonRef",
589
+ ref: u,
590
+ "aria-haspopup": "true"
591
+ }, K.value, {
592
+ "aria-controls": t.value ? h(f) : null,
593
+ toggled: t.value,
594
+ inverse: h(y),
595
+ onClick: A
596
+ }), ee({ _: 2 }, [
597
+ !h(i)("default") || h(i)("iconLeft") ? {
598
+ name: "iconLeft",
599
+ fn: I(() => [
600
+ G(r.$slots, "iconLeft", {}, () => [
601
+ $(h(Re), {
602
+ title: h(a)("menuButton")
603
+ }, null, 8, ["title"])
604
+ ], !0)
605
+ ]),
606
+ key: "0"
607
+ } : void 0,
608
+ h(i)("default") ? {
609
+ name: "default",
610
+ fn: I(() => [
611
+ G(r.$slots, "default", {}, void 0, !0)
612
+ ]),
613
+ key: "1"
614
+ } : void 0,
615
+ h(i)("default") ? {
616
+ name: "iconRight",
617
+ fn: I(() => [
618
+ $(h(Me))
619
+ ]),
620
+ key: "2"
621
+ } : void 0
622
+ ]), 1040, ["aria-controls", "toggled", "inverse"]),
623
+ u.value ? (p(), S(h(Se), {
624
+ key: 0,
625
+ disabled: !r.teleport
626
+ }, {
627
+ default: I(() => [
628
+ u.value ? (p(), S(h(ye), {
629
+ key: 0,
630
+ id: h(f),
631
+ ref_key: "popoverRef",
632
+ ref: m,
633
+ role: null,
634
+ open: t.value,
635
+ class: "b-menu__popover",
636
+ style: le(O.value),
637
+ "target-element": u.value,
638
+ position: r.menuPosition,
639
+ "fixed-positioning": r.menuFixedPositioning,
640
+ "fallback-position": [
641
+ "bottom-start",
642
+ "bottom-end",
643
+ "top-start",
644
+ "top-end",
645
+ "right-start",
646
+ "right-end",
647
+ "left-start",
648
+ "left-end"
649
+ ],
650
+ teleport: r.teleport,
651
+ "without-space": ""
652
+ }, {
653
+ default: I(() => [
654
+ $(h(qe), {
655
+ ref_key: "menuItemListRef",
656
+ ref: n,
657
+ "close-menu-on-item-select": r.closeMenuOnItemSelect,
658
+ data: r.data,
659
+ "focus-last-element": l.value,
660
+ onClose: T,
661
+ onMenuItemClick: C
662
+ }, null, 8, ["close-menu-on-item-select", "data", "focus-last-element"])
663
+ ]),
664
+ _: 1
665
+ }, 8, ["id", "open", "style", "target-element", "position", "fixed-positioning", "teleport"])) : w("", !0)
666
+ ]),
667
+ _: 1
668
+ }, 8, ["disabled"])) : w("", !0)
669
+ ], 34));
670
+ }
671
+ }), mt = /* @__PURE__ */ R(je, [["__scopeId", "data-v-dbf5b2bb"]]);
672
+ export {
673
+ mt as B,
674
+ We as D,
675
+ Te as M,
676
+ Re as O,
677
+ M as a
678
+ };
679
+ //# sourceMappingURL=menu.CCDxWQPw.js.map