@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
@@ -1,768 +0,0 @@
1
- import { defineComponent as N, computed as _, resolveComponent as C, createBlock as B, openBlock as v, normalizeClass as Q, createSlots as x, withCtx as I, createVNode as E, createCommentVNode as O, createTextVNode as G, toDisplayString as U, resolveDynamicComponent as ie, ref as d, inject as ee, createElementBlock as L, mergeProps as j, toHandlers as ae, renderSlot as K, onMounted as re, Transition as de, createElementVNode as R, withKeys as g, withModifiers as H, Fragment as te, renderList as ne, watch as ce, nextTick as q, normalizeStyle as oe, provide as me } from "vue";
2
- import { g as X } from "./generate-uid.NJ8tVoha.js";
3
- import { a as Y, B as fe } from "./popover.maCMPyz8.js";
4
- import { B as se, D as pe } from "./divider.qUOSAbU6.js";
5
- import { u as ve } from "./use-click-outside.BnhTgpSt.js";
6
- import { u as be } from "./use-has-slot.B7eQSabc.js";
7
- import { u as ye } from "./i18n.B6g5VX0q.js";
8
- /* empty css */
9
- import { _ as T } from "./_plugin-vue_export-helper.CHgC5LLL.js";
10
- import { a as Ce, C as z } from "./chevron-left.Cfn1uGLH.js";
11
- import { a as J, B as he } from "./base-button.DdNFlbgH.js";
12
- import { B as Ie } from "./typography.DN5eC5ch.js";
13
- import { t as ge } from "./truncate.BfIl_-71.js";
14
- import { B as Me } from "./teleport.CfGWjxe2.js";
15
- import { B as ke } from "./toggle-button.NQwrfSr1.js";
16
- import "../assets/menu.css";
17
- const Be = Symbol("menu inverse style injection key"), _e = N({
18
- name: "menu-item",
19
- components: { BaseButton: he, BentoTypography: Ie, ChevronRightIcon: Ce },
20
- props: {
21
- /**
22
- * menu-item text that gets displayed as the main label
23
- */
24
- text: {
25
- type: String,
26
- required: !0
27
- },
28
- /**
29
- * menu-item action that gets executed when the MeniItem is clicked
30
- */
31
- handler: {
32
- type: Function,
33
- required: !0
34
- },
35
- /**
36
- * menu-item text that gets displayed as the secondary label
37
- */
38
- secondaryText: {
39
- type: String,
40
- default: null
41
- },
42
- /**
43
- * Optional chevron icon displayed to the right of the menu-item
44
- */
45
- chevron: {
46
- type: Boolean,
47
- default: !1
48
- },
49
- /**
50
- * Optional icon displayed to the left of the menu-item
51
- */
52
- icon: {
53
- // Types for Vue2 (Object) and Vue3 (Function)
54
- // TODO: Remove Object when fully migrated to Vue3
55
- type: [Object, Function],
56
- default: null
57
- },
58
- /**
59
- * Disables menu-item button functionality
60
- */
61
- disabled: {
62
- type: Boolean,
63
- default: !1
64
- },
65
- /**
66
- * Displays an indent variant od the menu-item
67
- */
68
- indent: {
69
- type: Boolean,
70
- default: !1
71
- },
72
- /**
73
- * Displays menu-item button as critical
74
- */
75
- critical: {
76
- type: Boolean,
77
- default: !1
78
- },
79
- /**
80
- * Renders the text in a bold variant
81
- */
82
- isTitle: {
83
- type: Boolean,
84
- default: !1
85
- }
86
- },
87
- emits: [J.CLICK],
88
- setup(e, { emit: t }) {
89
- const u = _(() => ({
90
- "b-menu-item--critical": e.critical,
91
- "b-menu-item--indent": e.indent
92
- })), m = _(() => ge(e.secondaryText, 10));
93
- return {
94
- // Values
95
- conditionalClasses: u,
96
- computedSecondaryText: m,
97
- // Methods
98
- onClick: (i) => {
99
- i.stopPropagation(), e.handler(), t(J.CLICK);
100
- }
101
- };
102
- }
103
- });
104
- function Se(e, t, p, u, m, c) {
105
- const i = C("bento-typography"), l = C("chevron-right-icon"), a = C("base-button");
106
- return v(), B(a, {
107
- class: Q(["b-menu-item", e.conditionalClasses]),
108
- role: "menuitem",
109
- disabled: e.disabled,
110
- tabindex: "-1",
111
- onClick: e.onClick
112
- }, x({
113
- default: I(() => [
114
- E(i, {
115
- el: "span",
116
- variant: "body",
117
- stronger: e.isTitle,
118
- class: "b-menu-item__primary-text"
119
- }, {
120
- default: I(() => [
121
- G(U(e.text), 1)
122
- ]),
123
- _: 1
124
- }, 8, ["stronger"]),
125
- e.computedSecondaryText ? (v(), B(i, {
126
- key: 0,
127
- el: "span",
128
- variant: "body",
129
- class: "b-menu-item__secondary-text"
130
- }, {
131
- default: I(() => [
132
- G(U(e.computedSecondaryText), 1)
133
- ]),
134
- _: 1
135
- })) : O("", !0)
136
- ]),
137
- _: 2
138
- }, [
139
- e.icon ? {
140
- name: "iconLeft",
141
- fn: I(() => [
142
- (v(), B(ie(e.icon), {
143
- class: "b-menu-item__icon-left",
144
- "aria-hidden": "true"
145
- }))
146
- ]),
147
- key: "0"
148
- } : void 0,
149
- e.chevron ? {
150
- name: "iconRight",
151
- fn: I(() => [
152
- E(l, { "aria-hidden": "true" })
153
- ]),
154
- key: "1"
155
- } : void 0
156
- ]), 1032, ["class", "disabled", "onClick"]);
157
- }
158
- const ue = /* @__PURE__ */ T(_e, [["render", Se], ["__scopeId", "data-v-4cecac65"]]);
159
- var M = /* @__PURE__ */ ((e) => (e.BACK = "back", e.CLOSE = "close", e.OPEN = "open", e))(M || {});
160
- const $e = Symbol("menu registering injection key"), Ee = {
161
- name: "bento-menu-list-container"
162
- }, Le = /* @__PURE__ */ N({
163
- ...Ee,
164
- setup(e) {
165
- const t = d(), p = d({}), u = ee(
166
- $e,
167
- !1
168
- );
169
- if (u) {
170
- const { registerMenuContainerElement: m } = u;
171
- m(t), p.value = {
172
- mouseleave: u == null ? void 0 : u.menuMouseLeave
173
- };
174
- }
175
- return (m, c) => (v(), L("div", j({
176
- ref_key: "menuListContainerRef",
177
- ref: t,
178
- class: "b-menu-list-container",
179
- "data-testid": "menu-list-container"
180
- }, ae(p.value, !0)), [
181
- K(m.$slots, "default", {}, void 0, !0)
182
- ], 16));
183
- }
184
- }), le = /* @__PURE__ */ T(Le, [["__scopeId", "data-v-02a3ca45"]]), V = {
185
- "en-US": {
186
- backButton: "Go back",
187
- menuButton: "Open menu"
188
- }
189
- }, we = N({
190
- i18n: { messages: V },
191
- name: "sub-menu-item-list",
192
- components: { BentoDivider: se, MenuItem: ue, MenuListContainer: le },
193
- props: {
194
- items: {
195
- type: Array,
196
- required: !0
197
- },
198
- title: {
199
- type: String,
200
- required: !0
201
- }
202
- },
203
- emits: [M.CLOSE, M.BACK],
204
- setup(e, { emit: t }) {
205
- const p = d(null), u = d(0), m = d(e.items.length), c = () => t(M.CLOSE), i = () => t(M.BACK), l = _(() => {
206
- var f;
207
- const s = (f = e.items) == null ? void 0 : f.map((b) => ({
208
- ...b,
209
- indent: !b.icon,
210
- isTitle: !1,
211
- clickHandler: c
212
- }));
213
- return [
214
- {
215
- text: e.title,
216
- secondaryText: null,
217
- critical: !1,
218
- icon: z,
219
- isTitle: !0,
220
- disabled: !1,
221
- indent: !1,
222
- handler: i,
223
- clickHandler: i,
224
- addDivider: !0
225
- },
226
- ...s
227
- ];
228
- }), a = async () => {
229
- var s, f, b, y, k;
230
- (k = (y = (b = (f = (s = p.value) == null ? void 0 : s.children) == null ? void 0 : f[u.value]) == null ? void 0 : b.children) == null ? void 0 : y[0]) == null || k.focus();
231
- };
232
- re(async () => {
233
- setTimeout(() => a(), 150);
234
- });
235
- const n = () => {
236
- u.value > 0 ? (u.value -= 1, l.value[u.value].disabled && n()) : u.value = m.value, a();
237
- }, o = () => {
238
- u.value < m.value ? (u.value += 1, l.value[u.value].disabled && o()) : u.value = 0, a();
239
- };
240
- return {
241
- // Enums
242
- BentoMenuEvent: M,
243
- // Values
244
- subMenuItemListRefLocal: p,
245
- subMenuFocusedIndex: u,
246
- ChevronLeftIcon: z,
247
- computedItems: l,
248
- // Methods
249
- closeMenu: c,
250
- onBackButton: i,
251
- focusPrevious: n,
252
- focusNext: o
253
- };
254
- }
255
- });
256
- function Oe(e, t, p, u, m, c) {
257
- const i = C("menu-item"), l = C("bento-divider"), a = C("menu-list-container");
258
- return v(), B(de, {
259
- name: "b-sub-menu-item-list__transition",
260
- appear: ""
261
- }, {
262
- default: I(() => [
263
- E(a, { class: "b-sub-menu-item-list" }, {
264
- default: I(() => [
265
- R("ul", {
266
- ref: "subMenuItemListRefLocal",
267
- role: "menu",
268
- class: "b-sub-menu-item-list__list",
269
- onKeydown: [
270
- t[0] || (t[0] = g(H((...n) => e.focusNext && e.focusNext(...n), ["stop"]), ["down"])),
271
- t[1] || (t[1] = g(H((...n) => e.focusPrevious && e.focusPrevious(...n), ["stop"]), ["up"])),
272
- t[2] || (t[2] = g(H((...n) => e.onBackButton && e.onBackButton(...n), ["stop"]), ["esc"]))
273
- ]
274
- }, [
275
- (v(!0), L(te, null, ne(e.computedItems, (n, o) => (v(), L("li", {
276
- key: `sub-menu-item-list-item-${o}`,
277
- role: "none"
278
- }, [
279
- E(i, {
280
- text: n.text,
281
- handler: n.handler,
282
- "secondary-text": n.secondaryText,
283
- icon: n.icon,
284
- "is-title": n.isTitle,
285
- disabled: n.disabled,
286
- critical: n.critical,
287
- indent: n.indent,
288
- tabindex: o === e.subMenuFocusedIndex ? "0" : "-1",
289
- onClick: n.clickHandler
290
- }, null, 8, ["text", "handler", "secondary-text", "icon", "is-title", "disabled", "critical", "indent", "tabindex", "onClick"]),
291
- n.addDivider ? (v(), B(l, {
292
- key: 0,
293
- class: "b-sub-menu-item-list__divider"
294
- })) : O("", !0)
295
- ]))), 128))
296
- ], 544)
297
- ]),
298
- _: 1
299
- })
300
- ]),
301
- _: 1
302
- });
303
- }
304
- const Te = /* @__PURE__ */ T(we, [["render", Oe], ["__scopeId", "data-v-621db243"]]);
305
- function Re(e, t, p) {
306
- const c = d(0), i = d(0), l = (n) => {
307
- if (!n || !n.parentElement)
308
- return;
309
- const o = n.parentElement, s = n.cloneNode(!0);
310
- s.style.position = "absolute", s.style.visibility = "hidden", o.appendChild(s), s.style.width = "max-content";
311
- const f = s.offsetWidth, b = Math.max(150, Math.min(f, 350));
312
- c.value = b, s.style.width = `${b}px`;
313
- const y = s.offsetHeight;
314
- i.value = y, o.removeChild(s), i.value = y;
315
- };
316
- return ce([t, p], async ([n]) => {
317
- var o, s;
318
- if (n !== null) {
319
- await q();
320
- const f = (s = (o = e.value) == null ? void 0 : o[0]) == null ? void 0 : s.$el;
321
- f && l(f);
322
- } else
323
- c.value = 0, i.value = 0;
324
- }), { computedStyle: _(() => {
325
- const n = { width: "max-content" };
326
- return p.value && (i.value > 0 && (n.height = `${i.value}px`), c.value > 0 && (n.width = `${c.value}px`)), n;
327
- }) };
328
- }
329
- const Ne = N({
330
- name: "menu-item-list",
331
- components: { BentoDivider: se, MenuItem: ue, MenuListContainer: le, SubMenuItemList: Te },
332
- props: {
333
- /**
334
- * The data to be displayed in the list
335
- */
336
- data: {
337
- type: Array,
338
- required: !0
339
- },
340
- /**
341
- * Displays the menu-items of the list in the indent variant. Only applies to elements that don't have an icon to their left.
342
- */
343
- indentItems: {
344
- type: Boolean,
345
- default: !1
346
- },
347
- /**
348
- * 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.
349
- */
350
- focusLastElement: {
351
- type: Boolean,
352
- default: !1
353
- },
354
- /**
355
- * If set to true, closes the menu when an item is clicked.
356
- */
357
- closeMenuOnItemSelect: {
358
- type: Boolean,
359
- default: !0
360
- }
361
- },
362
- emits: [M.CLOSE, "menu-item-click"],
363
- setup(e, { emit: t, expose: p }) {
364
- const u = d(null), m = d(null), c = d(null), i = d(null), l = d(!1), a = d(null), n = d(e.focusLastElement ? e.data.length - 1 : 0), o = d(0), s = d(e.data.length - 1), f = _(() => e.data.some((r) => r.icon)), b = _(() => e.indentItems || f.value ? e.data.map((r) => {
365
- let h = !1;
366
- return r.icon || (h = !0), {
367
- ...r,
368
- indent: h
369
- };
370
- }) : e.data), y = async () => {
371
- var r, h, $;
372
- await q(), ($ = (h = (r = m.value) == null ? void 0 : r.children[n.value]) == null ? void 0 : h.children[0]) == null || $.focus();
373
- }, k = () => t(M.CLOSE), S = (r, h) => {
374
- if (r.items) {
375
- a.value = h, l.value = !0;
376
- return;
377
- }
378
- a.value = h, l.value = !1, !r.skipClose && e.closeMenuOnItemSelect !== !1 && k(), t("menu-item-click");
379
- }, w = () => {
380
- n.value > 0 ? (n.value -= 1, b.value[n.value].disabled && w()) : n.value = s.value, y();
381
- }, D = () => {
382
- n.value < s.value ? (n.value += 1, b.value[n.value].disabled && D()) : n.value = 0, y();
383
- }, W = (r, h) => {
384
- var $;
385
- ($ = r == null ? void 0 : r.items) != null && $.length && (a.value = h, l.value = !0);
386
- }, A = () => {
387
- a.value && l.value && (a.value = null, l.value = !1);
388
- }, F = () => {
389
- l.value = !1, a.value = null, y();
390
- };
391
- p({
392
- focusItem: y
393
- });
394
- const { computedStyle: P } = Re(i, a, l);
395
- return {
396
- // Values
397
- menuItemListRef: m,
398
- menuItemListWrapperRef: c,
399
- subMenuItemListRef: i,
400
- menuItemRef: u,
401
- computedData: b,
402
- computedStyle: P,
403
- focusedIndex: n,
404
- subMenuFocusedIndex: o,
405
- showSubMenu: l,
406
- visibleSubMenuIndex: a,
407
- // Methods
408
- menuItemClick: S,
409
- closeMenu: k,
410
- focusPrevious: w,
411
- focusNext: D,
412
- focusRight: W,
413
- focusLeft: A,
414
- onBackButton: F
415
- };
416
- }
417
- }), De = ["onKeydown"];
418
- function Pe(e, t, p, u, m, c) {
419
- const i = C("menu-item"), l = C("bento-divider"), a = C("sub-menu-item-list"), n = C("menu-list-container");
420
- return v(), B(n, {
421
- ref: "menuItemListWrapperRef",
422
- style: oe(e.computedStyle)
423
- }, {
424
- default: I(() => [
425
- R("ul", {
426
- ref: "menuItemListRef",
427
- class: "b-menu-item-list",
428
- role: "menu",
429
- onKeydown: [
430
- t[1] || (t[1] = g((...o) => e.focusNext && e.focusNext(...o), ["down"])),
431
- t[2] || (t[2] = g((...o) => e.focusPrevious && e.focusPrevious(...o), ["up"])),
432
- t[3] || (t[3] = g((...o) => e.closeMenu && e.closeMenu(...o), ["esc"])),
433
- t[4] || (t[4] = g((...o) => e.closeMenu && e.closeMenu(...o), ["tab"]))
434
- ]
435
- }, [
436
- (v(!0), L(te, null, ne(e.computedData, (o, s) => {
437
- var f, b, y, k;
438
- return v(), L("li", {
439
- key: `menu-item-${s}`,
440
- ref_for: !0,
441
- ref: "menuItemRef",
442
- class: "b-menu-item-list__item",
443
- role: "none",
444
- onKeydown: [
445
- g((S) => e.focusRight(o, s), ["right"]),
446
- t[0] || (t[0] = g((S) => e.focusLeft(), ["left"]))
447
- ]
448
- }, [
449
- E(i, {
450
- text: o.text,
451
- handler: (f = o.items) != null && f.length ? () => null : o.handler,
452
- "secondary-text": o.secondaryText,
453
- icon: o.icon,
454
- chevron: !!((b = o.items) != null && b.length),
455
- disabled: o.disabled,
456
- critical: o.critical,
457
- indent: o.indent,
458
- tabindex: s === e.subMenuFocusedIndex ? "0" : "-1",
459
- "aria-haspopup": !!((y = o.items) != null && y.length),
460
- "aria-expanded": e.showSubMenu && e.visibleSubMenuIndex === s,
461
- onClick: (S) => e.menuItemClick(o, s)
462
- }, null, 8, ["text", "handler", "secondary-text", "icon", "chevron", "disabled", "critical", "indent", "tabindex", "aria-haspopup", "aria-expanded", "onClick"]),
463
- o.addDivider ? (v(), B(l, {
464
- key: 0,
465
- class: "b-menu-item-list__divider"
466
- })) : O("", !0),
467
- (k = o.items) != null && k.length && e.showSubMenu && e.visibleSubMenuIndex === s ? (v(), B(a, {
468
- key: 1,
469
- ref_for: !0,
470
- ref: "subMenuItemListRef",
471
- items: o.items,
472
- title: o.text,
473
- onBack: e.onBackButton,
474
- onClose: e.closeMenu
475
- }, null, 8, ["items", "title", "onBack", "onClose"])) : O("", !0)
476
- ], 40, De);
477
- }), 128))
478
- ], 544)
479
- ]),
480
- _: 1
481
- }, 8, ["style"]);
482
- }
483
- const Ke = /* @__PURE__ */ T(Ne, [["render", Pe], ["__scopeId", "data-v-999aa4e9"]]);
484
- let Z = 0;
485
- const We = {
486
- beforeCreate() {
487
- this.uuid = Z.toString(), Z += 1;
488
- }
489
- }, Ae = { key: 0 };
490
- function Fe(e, t, p, u, m, c) {
491
- return v(), L("svg", j({ role: "img" }, e.$attrs, {
492
- class: "ui-assets-icons-16",
493
- xmlns: "http://www.w3.org/2000/svg",
494
- width: "16",
495
- height: "16",
496
- fill: "none"
497
- }), [
498
- e.$attrs["svg-title"] ? (v(), L("title", Ae, U(e.$attrs["svg-title"]), 1)) : O("", !0),
499
- t[0] || (t[0] = R("path", {
500
- fill: "#001222",
501
- 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"
502
- }, null, -1)),
503
- t[1] || (t[1] = R("path", {
504
- fill: "#001222",
505
- 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"
506
- }, null, -1)),
507
- t[2] || (t[2] = R("path", {
508
- fill: "#001222",
509
- 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"
510
- }, null, -1))
511
- ], 16);
512
- }
513
- const He = /* @__PURE__ */ T(We, [["render", Fe]]), Ue = N({
514
- i18n: { messages: V },
515
- name: "bento-menu",
516
- components: { BentoToggleButton: ke, BentoPopover: fe, BentoTeleport: Me, MenuItemList: Ke, OptionsVerticalIcon: He },
517
- props: {
518
- /**
519
- * Object containing props to change the menu button appearance. Accepts the same props present in BentoButton.
520
- */
521
- button: {
522
- type: Object,
523
- default: () => ({
524
- variant: "secondary"
525
- })
526
- },
527
- /**
528
- * Controls if the menu should close when an item is clicked.
529
- * Defaults to `true`.
530
- */
531
- closeMenuOnItemSelect: {
532
- type: Boolean,
533
- default: !0
534
- },
535
- /**
536
- * The data to be displayed in the list
537
- */
538
- data: {
539
- type: Array,
540
- required: !0
541
- },
542
- /**
543
- * Disables opening the menu when the down arrow key is pressed.
544
- */
545
- disableArrowDownOpeningMenu: {
546
- type: Boolean,
547
- default: !1
548
- },
549
- /**
550
- * The position of where the menu should open.
551
- */
552
- menuPosition: {
553
- type: String,
554
- default: Y.BOTTOM_START,
555
- validator: (e) => Object.values(Y).includes(e)
556
- },
557
- /**
558
- * Instructs the menu popover to be visible outside of the containing container.
559
- * @see {@link https://floating-ui.com/docs/usefloating#strategy}
560
- */
561
- menuFixedPositioning: {
562
- type: Boolean,
563
- default: !1
564
- },
565
- /**
566
- * Sets a custom width for the menu popover.
567
- */
568
- menuWidth: {
569
- type: Number,
570
- default: null
571
- },
572
- /**
573
- * Returns focus to the menu button after popover is closed.
574
- * Disable if focus management is delegated to the parent component.
575
- * Defaults to `true`.
576
- */
577
- revertFocusToButton: {
578
- type: Boolean,
579
- default: !0
580
- },
581
- /**
582
- * Can be used to set the inner teleport component to render the menu's popover in the root `body` DOM node
583
- * (or `dialog` if popover is inside a dialog).
584
- */
585
- teleport: {
586
- type: Boolean,
587
- default: !1
588
- },
589
- /**
590
- * Can be used to set the inner teleport component to render the menu's popover in the root `body` DOM node
591
- * (or `dialog` if popover is inside a dialog).
592
- *
593
- * @see {@link OnClickOutsideOptions}
594
- */
595
- closeOnClickOutsideOptions: {
596
- type: Object,
597
- default: void 0
598
- }
599
- },
600
- emits: [M.CLOSE, M.OPEN, "menu-item-click", "click-outside"],
601
- setup(e, { emit: t, expose: p, slots: u }) {
602
- var P;
603
- const { t: m } = ye({ messages: V }), c = d(null), i = d(null), l = d(!1), a = d(!1), n = d(null), o = X("menu"), s = X("menu-popover"), f = ee(Be, d(!1));
604
- me(pe, f);
605
- const b = _(() => ({
606
- "b-menu--inverse": f.value
607
- })), y = _(() => e.menuWidth ? { width: `${e.menuWidth}px` } : null), k = _(() => {
608
- if (e != null && e.button)
609
- return {
610
- variant: "secondary",
611
- ...e.button
612
- };
613
- }), S = () => {
614
- l.value = !0, t(M.OPEN);
615
- }, w = async (r = e.revertFocusToButton) => {
616
- var h, $;
617
- l.value && (l.value = !1, r && (await q(), ($ = (h = c.value) == null ? void 0 : h.$el) == null || $.focus()), t(M.CLOSE));
618
- }, D = (r) => {
619
- r.stopPropagation(), l.value ? w() : S();
620
- }, W = (r) => {
621
- r.preventDefault(), a.value = !1, e.disableArrowDownOpeningMenu || S();
622
- }, A = (r) => {
623
- r.preventDefault(), a.value = !0, S();
624
- }, F = () => {
625
- t("menu-item-click");
626
- };
627
- return ve(
628
- n,
629
- () => {
630
- w(), t("click-outside");
631
- },
632
- {
633
- ...e.closeOnClickOutsideOptions,
634
- ignore: [c, ...((P = e.closeOnClickOutsideOptions) == null ? void 0 : P.ignore) ?? []]
635
- }
636
- ), p({
637
- /**
638
- * Control to enable programmatic closing of the menu
639
- */
640
- closeMenu: w
641
- }), {
642
- // Refs
643
- popoverRef: n,
644
- menuButtonRef: c,
645
- menuItemListRef: i,
646
- // Values
647
- menuId: o,
648
- popoverId: s,
649
- showMenu: l,
650
- computedButtonPropsWithDefaults: k,
651
- computedMenuWidth: y,
652
- isLastElementFocused: a,
653
- // Classes
654
- computedClasses: b,
655
- isInverseColorSet: f,
656
- // Methods
657
- hasSlot: be(u),
658
- onKeyDown: W,
659
- onKeyUp: A,
660
- closeMenu: w,
661
- menuItemClick: F,
662
- toggleShowMenu: D,
663
- // Translations
664
- t: m
665
- };
666
- }
667
- });
668
- function Ve(e, t, p, u, m, c) {
669
- const i = C("options-vertical-icon"), l = C("bento-toggle-button"), a = C("menu-item-list"), n = C("bento-popover"), o = C("bento-teleport");
670
- return v(), L("div", {
671
- class: Q([e.computedClasses, "b-menu"]),
672
- "data-testid": "menu",
673
- onKeydown: [
674
- t[0] || (t[0] = g((...s) => e.onKeyDown && e.onKeyDown(...s), ["down"])),
675
- t[1] || (t[1] = g((...s) => e.onKeyUp && e.onKeyUp(...s), ["up"])),
676
- t[2] || (t[2] = g((s) => e.closeMenu(), ["esc"]))
677
- ]
678
- }, [
679
- E(l, j({
680
- ref: "menuButtonRef",
681
- "aria-haspopup": "true"
682
- }, e.computedButtonPropsWithDefaults, {
683
- "aria-controls": e.showMenu ? e.menuId : null,
684
- toggled: e.showMenu,
685
- inverse: e.isInverseColorSet,
686
- onClick: e.toggleShowMenu
687
- }), x({ _: 2 }, [
688
- !e.hasSlot("default") || e.hasSlot("iconLeft") ? {
689
- name: "iconLeft",
690
- fn: I(() => [
691
- K(e.$slots, "iconLeft", {}, () => [
692
- E(i, {
693
- title: e.t("menuButton")
694
- }, null, 8, ["title"])
695
- ], !0)
696
- ]),
697
- key: "0"
698
- } : void 0,
699
- e.hasSlot("default") ? {
700
- name: "default",
701
- fn: I(() => [
702
- K(e.$slots, "default", {}, void 0, !0)
703
- ]),
704
- key: "1"
705
- } : void 0,
706
- e.hasSlot("iconRight") ? {
707
- name: "iconRight",
708
- fn: I(() => [
709
- K(e.$slots, "iconRight", {}, void 0, !0)
710
- ]),
711
- key: "2"
712
- } : void 0
713
- ]), 1040, ["aria-controls", "toggled", "inverse", "onClick"]),
714
- e.menuButtonRef ? (v(), B(o, {
715
- key: 0,
716
- disabled: !e.teleport
717
- }, {
718
- default: I(() => [
719
- e.menuButtonRef ? (v(), B(n, {
720
- key: 0,
721
- id: e.menuId,
722
- ref: "popoverRef",
723
- role: null,
724
- open: e.showMenu,
725
- class: "b-menu__popover",
726
- style: oe(e.computedMenuWidth),
727
- "target-element": e.menuButtonRef,
728
- position: e.menuPosition,
729
- "fixed-positioning": e.menuFixedPositioning,
730
- "fallback-position": [
731
- "bottom-start",
732
- "bottom-end",
733
- "top-start",
734
- "top-end",
735
- "right-start",
736
- "right-end",
737
- "left-start",
738
- "left-end"
739
- ],
740
- teleport: e.teleport,
741
- "without-space": ""
742
- }, {
743
- default: I(() => [
744
- E(a, {
745
- ref: "menuItemListRef",
746
- "close-menu-on-item-select": e.closeMenuOnItemSelect,
747
- data: e.data,
748
- "focus-last-element": e.isLastElementFocused,
749
- onClose: e.closeMenu,
750
- onMenuItemClick: e.menuItemClick
751
- }, null, 8, ["close-menu-on-item-select", "data", "focus-last-element", "onClose", "onMenuItemClick"])
752
- ]),
753
- _: 1
754
- }, 8, ["id", "open", "style", "target-element", "position", "fixed-positioning", "teleport"])) : O("", !0)
755
- ]),
756
- _: 1
757
- }, 8, ["disabled"])) : O("", !0)
758
- ], 34);
759
- }
760
- const ut = /* @__PURE__ */ T(Ue, [["render", Ve], ["__scopeId", "data-v-e0770132"]]);
761
- export {
762
- ut as B,
763
- $e as D,
764
- Be as M,
765
- He as O,
766
- M as a
767
- };
768
- //# sourceMappingURL=menu.DOKYXlFy.js.map