@adyen/bento-vue2 1.24.0 → 1.26.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 (190) hide show
  1. package/dist/@types/index.d.ts +484 -629
  2. package/dist/accordion.js +2 -2
  3. package/dist/action-bar.js +6 -6
  4. package/dist/alert.js +69 -104
  5. package/dist/alert.js.map +1 -1
  6. package/dist/assets/base-modal.css +1 -1
  7. package/dist/assets/dialog-page.css +1 -1
  8. package/dist/assets/dropdown.css +1 -1
  9. package/dist/assets/index10.css +1 -1
  10. package/dist/assets/index11.css +1 -1
  11. package/dist/assets/index12.css +1 -1
  12. package/dist/assets/index13.css +1 -1
  13. package/dist/assets/index14.css +1 -1
  14. package/dist/assets/index15.css +1 -1
  15. package/dist/assets/index16.css +1 -1
  16. package/dist/assets/index17.css +1 -1
  17. package/dist/assets/index18.css +1 -1
  18. package/dist/assets/index19.css +1 -1
  19. package/dist/assets/index2.css +1 -1
  20. package/dist/assets/index20.css +1 -1
  21. package/dist/assets/index21.css +1 -1
  22. package/dist/assets/index22.css +1 -1
  23. package/dist/assets/index23.css +1 -1
  24. package/dist/assets/index24.css +1 -1
  25. package/dist/assets/index25.css +1 -1
  26. package/dist/assets/index26.css +1 -1
  27. package/dist/assets/index27.css +1 -1
  28. package/dist/assets/index28.css +1 -1
  29. package/dist/assets/index29.css +1 -1
  30. package/dist/assets/index3.css +1 -1
  31. package/dist/assets/index30.css +1 -1
  32. package/dist/assets/index31.css +1 -1
  33. package/dist/assets/index32.css +1 -1
  34. package/dist/assets/index33.css +1 -1
  35. package/dist/assets/index34.css +1 -1
  36. package/dist/assets/index35.css +1 -1
  37. package/dist/assets/index36.css +1 -1
  38. package/dist/assets/index37.css +1 -1
  39. package/dist/assets/index38.css +1 -1
  40. package/dist/assets/index39.css +1 -1
  41. package/dist/assets/index4.css +1 -1
  42. package/dist/assets/index40.css +1 -1
  43. package/dist/assets/index41.css +1 -1
  44. package/dist/assets/index42.css +1 -1
  45. package/dist/assets/index43.css +1 -1
  46. package/dist/assets/index44.css +1 -1
  47. package/dist/assets/index45.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/assets/{listbox.css → use-cached-selected-values.css} +1 -1
  56. package/dist/avatar-image.js +1 -1
  57. package/dist/button.js +5 -5
  58. package/dist/card.js +83 -180
  59. package/dist/card.js.map +1 -1
  60. package/dist/checkbox.js +5 -5
  61. package/dist/chunks/{base-button.090f511d.js → base-button.ad74b6f8.js} +2 -2
  62. package/dist/chunks/{base-button.090f511d.js.map → base-button.ad74b6f8.js.map} +1 -1
  63. package/dist/chunks/{base-modal.aa09a60c.js → base-modal.1fff7abe.js} +6 -6
  64. package/dist/chunks/{base-modal.aa09a60c.js.map → base-modal.1fff7abe.js.map} +1 -1
  65. package/dist/chunks/{button-actions-with-menu.879c4573.js → button-actions-with-menu.e845d77a.js} +4 -4
  66. package/dist/chunks/{button-actions-with-menu.879c4573.js.map → button-actions-with-menu.e845d77a.js.map} +1 -1
  67. package/dist/chunks/{button-actions.239456cb.js → button-actions.81db18e8.js} +3 -3
  68. package/dist/chunks/{button-actions.239456cb.js.map → button-actions.81db18e8.js.map} +1 -1
  69. package/dist/chunks/{button.6e6324f0.js → button.9d6435ae.js} +3 -3
  70. package/dist/chunks/{button.6e6324f0.js.map → button.9d6435ae.js.map} +1 -1
  71. package/dist/chunks/{calendar.1e416969.js → calendar.640b8d25.js} +4 -4
  72. package/dist/chunks/{calendar.1e416969.js.map → calendar.640b8d25.js.map} +1 -1
  73. package/dist/chunks/{checkbox.f38276e6.js → checkbox.bfed007c.js} +3 -3
  74. package/dist/chunks/{checkbox.f38276e6.js.map → checkbox.bfed007c.js.map} +1 -1
  75. package/dist/chunks/{controls-group.f1dfa419.js → controls-group.4fb50009.js} +3 -3
  76. package/dist/chunks/{controls-group.f1dfa419.js.map → controls-group.4fb50009.js.map} +1 -1
  77. package/dist/chunks/{copy.acc9f1b0.js → copy.f85700c6.js} +4 -4
  78. package/dist/chunks/{copy.acc9f1b0.js.map → copy.f85700c6.js.map} +1 -1
  79. package/dist/chunks/dialog-page.73da22cf.js +133 -0
  80. package/dist/chunks/dialog-page.73da22cf.js.map +1 -0
  81. package/dist/chunks/{dropdown-default-textbox.c1f8fe5f.js → dropdown-default-textbox.54ca1b18.js} +2 -2
  82. package/dist/chunks/{dropdown-default-textbox.c1f8fe5f.js.map → dropdown-default-textbox.54ca1b18.js.map} +1 -1
  83. package/dist/chunks/dropdown.10c034aa.js +775 -0
  84. package/dist/chunks/dropdown.10c034aa.js.map +1 -0
  85. package/dist/chunks/{error-message.8734e591.js → error-message.31ec12b7.js} +2 -2
  86. package/dist/chunks/{error-message.8734e591.js.map → error-message.31ec12b7.js.map} +1 -1
  87. package/dist/chunks/{fixed-scroller.772ad033.js → fixed-scroller.4eb9a9ac.js} +2 -2
  88. package/dist/chunks/{fixed-scroller.772ad033.js.map → fixed-scroller.4eb9a9ac.js.map} +1 -1
  89. package/dist/chunks/{footer-actions.11071f12.js → footer-actions.a1e09b4f.js} +4 -4
  90. package/dist/chunks/{footer-actions.11071f12.js.map → footer-actions.a1e09b4f.js.map} +1 -1
  91. package/dist/chunks/{index.5d5f2200.js → index.15b088b9.js} +6 -6
  92. package/dist/chunks/{index.5d5f2200.js.map → index.15b088b9.js.map} +1 -1
  93. package/dist/chunks/{index.87180cdd.js → index.1ea85d4a.js} +138 -119
  94. package/dist/chunks/index.1ea85d4a.js.map +1 -0
  95. package/dist/chunks/{index.8e6bc325.js → index.317fca12.js} +3 -3
  96. package/dist/chunks/{index.8e6bc325.js.map → index.317fca12.js.map} +1 -1
  97. package/dist/chunks/{index.51308a21.js → index.671768a1.js} +3 -3
  98. package/dist/chunks/{index.51308a21.js.map → index.671768a1.js.map} +1 -1
  99. package/dist/chunks/{index.49ce3f6a.js → index.7eefc59c.js} +3 -3
  100. package/dist/chunks/{index.49ce3f6a.js.map → index.7eefc59c.js.map} +1 -1
  101. package/dist/chunks/{index.f19887a1.js → index.885d05a9.js} +2 -2
  102. package/dist/chunks/{index.f19887a1.js.map → index.885d05a9.js.map} +1 -1
  103. package/dist/chunks/{index.73abb1a9.js → index.8b8c3b16.js} +9 -9
  104. package/dist/chunks/{index.73abb1a9.js.map → index.8b8c3b16.js.map} +1 -1
  105. package/dist/chunks/{index.ff09389c.js → index.aaf965f8.js} +6 -6
  106. package/dist/chunks/{index.ff09389c.js.map → index.aaf965f8.js.map} +1 -1
  107. package/dist/chunks/{index.03ae22b4.js → index.b21197ca.js} +2 -2
  108. package/dist/chunks/{index.03ae22b4.js.map → index.b21197ca.js.map} +1 -1
  109. package/dist/chunks/{index.94980f50.js → index.d553d3d1.js} +2 -2
  110. package/dist/chunks/{index.94980f50.js.map → index.d553d3d1.js.map} +1 -1
  111. package/dist/chunks/{index.ba6c1040.js → index.dd30e538.js} +3 -3
  112. package/dist/chunks/index.dd30e538.js.map +1 -0
  113. package/dist/chunks/{listbox-option-tag.c0a56a95.js → listbox-option-tag.6bbb6bbe.js} +3 -3
  114. package/dist/chunks/{listbox-option-tag.c0a56a95.js.map → listbox-option-tag.6bbb6bbe.js.map} +1 -1
  115. package/dist/chunks/{loading-button.84a5529d.js → loading-button.eafc9e1b.js} +2 -2
  116. package/dist/chunks/{loading-button.84a5529d.js.map → loading-button.eafc9e1b.js.map} +1 -1
  117. package/dist/chunks/{payment-method.faa302de.js → payment-method.6c1ce07c.js} +2 -2
  118. package/dist/chunks/{payment-method.faa302de.js.map → payment-method.6c1ce07c.js.map} +1 -1
  119. package/dist/chunks/{tooltip.8e9d733c.js → tooltip.58ef3f4a.js} +3 -3
  120. package/dist/chunks/{tooltip.8e9d733c.js.map → tooltip.58ef3f4a.js.map} +1 -1
  121. package/dist/chunks/{use-bento-toast-controller.7d4436ad.js → use-bento-toast-controller.c3277f73.js} +2 -2
  122. package/dist/chunks/{use-bento-toast-controller.7d4436ad.js.map → use-bento-toast-controller.c3277f73.js.map} +1 -1
  123. package/dist/chunks/{listbox.e6e1bc90.js → use-cached-selected-values.69297473.js} +510 -448
  124. package/dist/chunks/use-cached-selected-values.69297473.js.map +1 -0
  125. package/dist/code-snippet.js +7 -7
  126. package/dist/code-snippet.js.map +1 -1
  127. package/dist/country.js +2 -2
  128. package/dist/currency.js +1 -1
  129. package/dist/data-grid-template.js +1 -1
  130. package/dist/data-grid.js +947 -885
  131. package/dist/data-grid.js.map +1 -1
  132. package/dist/date-picker.js +8 -8
  133. package/dist/date-range-picker.js +2 -2
  134. package/dist/date.js +1 -1
  135. package/dist/divider.js +1 -1
  136. package/dist/dropdown.js +7 -7
  137. package/dist/empty-state.js +3 -3
  138. package/dist/filter-bar.js +1115 -955
  139. package/dist/filter-bar.js.map +1 -1
  140. package/dist/focus-trap.js +1 -1
  141. package/dist/form-layout.js +15 -14
  142. package/dist/form-layout.js.map +1 -1
  143. package/dist/header.js +4 -4
  144. package/dist/index.js +177 -169
  145. package/dist/index.js.map +1 -1
  146. package/dist/info-icon.js +3 -3
  147. package/dist/input-field.js +31 -29
  148. package/dist/input-field.js.map +1 -1
  149. package/dist/internal.js +31 -78
  150. package/dist/internal.js.map +1 -1
  151. package/dist/link.js +1 -1
  152. package/dist/loading-indicator.js +1 -1
  153. package/dist/menu.js +1 -1
  154. package/dist/modal-fullscreen.js +6 -6
  155. package/dist/modal.js +6 -6
  156. package/dist/pagination.js +4 -4
  157. package/dist/payment-method.js +1 -1
  158. package/dist/popover.js +1 -1
  159. package/dist/popper-container.js +1 -1
  160. package/dist/radio-group.js +62 -62
  161. package/dist/radio-group.js.map +1 -1
  162. package/dist/search-bar.js +2 -2
  163. package/dist/secondary-nav.js +2 -2
  164. package/dist/segmented-control.js +2 -2
  165. package/dist/selection-card.js +4 -4
  166. package/dist/sidepanel.js +52 -50
  167. package/dist/sidepanel.js.map +1 -1
  168. package/dist/status.js +2 -2
  169. package/dist/stepper.js +3 -3
  170. package/dist/structured-list.js +1 -1
  171. package/dist/summary-grid.js +3 -3
  172. package/dist/tabs.js +52 -52
  173. package/dist/tabs.js.map +1 -1
  174. package/dist/tag.js +3 -3
  175. package/dist/textarea.js +4 -4
  176. package/dist/timeline.js +7 -7
  177. package/dist/toast.js +4 -4
  178. package/dist/toggle.js +2 -2
  179. package/dist/tutorial.js +88 -67
  180. package/dist/tutorial.js.map +1 -1
  181. package/dist/typography.js +1 -1
  182. package/dist/web-types.json +550 -266
  183. package/package.json +3 -2
  184. package/dist/chunks/dialog-page.75b295b7.js +0 -133
  185. package/dist/chunks/dialog-page.75b295b7.js.map +0 -1
  186. package/dist/chunks/dropdown.669b858b.js +0 -797
  187. package/dist/chunks/dropdown.669b858b.js.map +0 -1
  188. package/dist/chunks/index.87180cdd.js.map +0 -1
  189. package/dist/chunks/index.ba6c1040.js.map +0 -1
  190. package/dist/chunks/listbox.e6e1bc90.js.map +0 -1
@@ -1,91 +1,91 @@
1
- import { computed as c, ref as L, onMounted as Z, onUnmounted as _e, watch as ee, defineComponent as D, toRef as V } from "vue";
2
- import { B as $ } from "./index.ba6c1040.js";
3
- import { BentoLoadingIndicator as be } from "../loading-indicator.js";
4
- import { BentoEmptyState as ve } from "../empty-state.js";
5
- import { u as z } from "./i18n.eb5b985b.js";
6
- import { d as me } from "./debounce.b5ef6acf.js";
1
+ import { computed as i, ref as A, onMounted as ee, onUnmounted as ve, watch as te, defineComponent as D, toRef as V } from "vue";
2
+ import { B as w } from "./index.dd30e538.js";
3
+ import { BentoLoadingIndicator as fe } from "../loading-indicator.js";
4
+ import { BentoEmptyState as ge } from "../empty-state.js";
5
+ import { u as Y } from "./i18n.eb5b985b.js";
6
+ import { d as ye } from "./debounce.b5ef6acf.js";
7
7
  import { n as N } from "./_plugin-vue2_normalizer.71e2aa87.js";
8
- import { C as fe } from "./checkmark.a6ed8f47.js";
9
- import { B as k, a as H } from "./keyboard-navigation.ca47dfa8.js";
10
- import { B as X } from "./checkbox.f38276e6.js";
8
+ import { C as pe } from "./checkmark.a6ed8f47.js";
9
+ import { B as k, a as X } from "./keyboard-navigation.ca47dfa8.js";
10
+ import { B as J } from "./checkbox.bfed007c.js";
11
11
  import "./index.4c062058.js";
12
- import { C as ge, a as ye } from "./chevron-up.81185563.js";
13
- import { B as pe } from "./base-button.090f511d.js";
14
- import { C as xe } from "./cross-small.e851e0de.js";
15
- import { B as Se, a as J } from "./loading-button.84a5529d.js";
16
- import { o as Ce } from "./resize.a041304d.js";
17
- import "../assets/listbox.css";
18
- const te = (t, e, s, l) => {
19
- const n = c(
12
+ import { C as Se, a as xe } from "./chevron-up.81185563.js";
13
+ import { B as Ce } from "./base-button.ad74b6f8.js";
14
+ import { C as he } from "./cross-small.e851e0de.js";
15
+ import { B as Ee, a as Q } from "./loading-button.eafc9e1b.js";
16
+ import { o as Te } from "./resize.a041304d.js";
17
+ import "../assets/use-cached-selected-values.css";
18
+ const se = (t, e, s, l) => {
19
+ const n = i(
20
20
  () => {
21
- var a, b;
22
- return !!((a = t.value) != null && a.length) && ((b = t.value) == null ? void 0 : b.length) === e.value.length;
21
+ var d, r;
22
+ return !!((d = t.value) != null && d.length) && ((r = t.value) == null ? void 0 : r.length) === e.value.length;
23
23
  }
24
- ), o = c(() => {
25
- var a;
26
- return t.value == null || t.value.length === 0 ? !1 : ((a = t.value) == null ? void 0 : a.length) !== e.value.length;
24
+ ), o = i(() => {
25
+ var d;
26
+ return t.value == null || t.value.length === 0 ? !1 : ((d = t.value) == null ? void 0 : d.length) !== e.value.length;
27
27
  });
28
28
  return {
29
29
  isAllSelected: n,
30
30
  isIndeterminate: o,
31
- toggleSelectAll: (a) => {
32
- a ? s() : l();
31
+ toggleSelectAll: (d) => {
32
+ d ? s() : l();
33
33
  }
34
34
  };
35
35
  };
36
- function Ee(t, { disabled: e, itemHeight: s, overscan: l = 5, prefixHeight: n }) {
37
- const o = L(null), m = L([]), a = L(0), b = L(0), u = L(0);
38
- let S;
39
- const A = c(() => {
40
- const g = typeof s == "number" ? t.value.length * s : t.value.reduce((h, v, y) => h + s(y), 0), O = typeof s == "number" ? a.value * s : t.value.slice(0, a.value).reduce((h, v, y) => h + s(y), 0);
36
+ function Le(t, { disabled: e, itemHeight: s, overscan: l = 5, prefixHeight: n }) {
37
+ const o = A(null), _ = A([]), d = A(0), r = A(0), u = A(0);
38
+ let p;
39
+ const h = i(() => {
40
+ const S = typeof s == "number" ? t.value.length * s : t.value.reduce((L, m, x) => L + s(x), 0), O = typeof s == "number" ? d.value * s : t.value.slice(0, d.value).reduce((L, m, x) => L + s(x), 0);
41
41
  return {
42
42
  style: {
43
43
  marginTop: `${O}px`,
44
- height: `${g - O}px`
44
+ height: `${S - O}px`
45
45
  }
46
46
  };
47
- }), I = () => {
48
- const g = (n == null ? void 0 : n.value) ?? 0, O = Math.max(o.value.scrollTop - g, 0);
47
+ }), E = () => {
48
+ const S = (n == null ? void 0 : n.value) ?? 0, O = Math.max(o.value.scrollTop - S, 0);
49
49
  if (typeof s == "number")
50
50
  return Math.floor(O / s);
51
- let h = 0, v = 0;
52
- for (let y = 0; y < t.value.length; y += 1) {
53
- const R = s(y);
54
- if (h += R, h >= O) {
55
- v = y;
51
+ let L = 0, m = 0;
52
+ for (let x = 0; x < t.value.length; x += 1) {
53
+ const R = s(x);
54
+ if (L += R, L >= O) {
55
+ m = x;
56
56
  break;
57
57
  }
58
58
  }
59
- return v;
60
- }, d = () => {
59
+ return m;
60
+ }, v = () => {
61
61
  if (u.value = o.value.clientHeight, typeof s == "number")
62
62
  return Math.ceil(u.value / s);
63
- const g = a.value ?? 0;
64
- let O = 0, h = 0;
65
- for (let v = g; v < t.value.length; v += 1) {
66
- const y = s(v);
67
- if (O += y, h = v, O > u.value)
63
+ const S = d.value ?? 0;
64
+ let O = 0, L = 0;
65
+ for (let m = S; m < t.value.length; m += 1) {
66
+ const x = s(m);
67
+ if (O += x, L = m, O > u.value)
68
68
  break;
69
69
  }
70
- return h - g;
71
- }, x = () => {
70
+ return L - S;
71
+ }, y = () => {
72
72
  if (o.value) {
73
- const g = d();
74
- a.value = I(), b.value = Math.min(a.value + g + l, t.value.length), m.value = t.value.slice(a.value, b.value);
73
+ const S = v();
74
+ d.value = E(), r.value = Math.min(d.value + S + l, t.value.length), _.value = t.value.slice(d.value, r.value);
75
75
  }
76
- }, E = () => {
77
- x();
76
+ }, T = () => {
77
+ y();
78
78
  };
79
- e || (Z(() => {
80
- o.value && (u.value = o.value.clientHeight, S = Ce(o.value, ({ clientHeight: g }) => {
81
- u.value = g, x();
82
- }), x());
83
- }), _e(() => {
84
- S == null || S.disconnect();
85
- }), ee(
79
+ e || (ee(() => {
80
+ o.value && (u.value = o.value.clientHeight, p = Te(o.value, ({ clientHeight: S }) => {
81
+ u.value = S, y();
82
+ }), y());
83
+ }), ve(() => {
84
+ p == null || p.disconnect();
85
+ }), te(
86
86
  () => t.value,
87
87
  () => {
88
- x();
88
+ y();
89
89
  }
90
90
  ));
91
91
  const B = {
@@ -102,16 +102,16 @@ function Ee(t, { disabled: e, itemHeight: s, overscan: l = 5, prefixHeight: n })
102
102
  } : {
103
103
  containerRef: o,
104
104
  containerProps: B,
105
- onScroll: E,
106
- list: m,
107
- wrapperProps: A
105
+ onScroll: T,
106
+ list: _,
107
+ wrapperProps: h
108
108
  };
109
109
  }
110
- var i = /* @__PURE__ */ ((t) => (t.SELECT = "select", t.SHOW_MORE = "show-more", t.ESCAPE = "escape-pressed", t.CLICK = "click", t.ENTER = "enter-pressed", t.SPACE = "space-pressed", t.TAB = "tab-pressed", t.CLOSE_DROPDOWN = "close-dropdown", t))(i || {}), w = /* @__PURE__ */ ((t) => (t.AUTOMATIC = "automatic", t.BUTTON = "button", t.NONE = "none", t))(w || {});
111
- const he = D({
110
+ var a = /* @__PURE__ */ ((t) => (t.SELECT = "select", t.SHOW_MORE = "show-more", t.ESCAPE = "escape-pressed", t.CLICK = "click", t.ENTER = "enter-pressed", t.SPACE = "space-pressed", t.TAB = "tab-pressed", t.CLOSE_DROPDOWN = "close-dropdown", t))(a || {}), M = /* @__PURE__ */ ((t) => (t.AUTOMATIC = "automatic", t.BUTTON = "button", t.NONE = "none", t))(M || {});
111
+ const Oe = D({
112
112
  name: "bento-listbox-static-category",
113
113
  components: {
114
- BentoTypography: $
114
+ BentoTypography: w
115
115
  },
116
116
  props: {
117
117
  /**
@@ -123,20 +123,20 @@ const he = D({
123
123
  }
124
124
  }
125
125
  });
126
- var Oe = function() {
126
+ var Ae = function() {
127
127
  var e = this, s = e._self._c;
128
128
  return e._self._setupProxy, s("div", { staticClass: "b-listbox-single-select-category" }, [s("bento-typography", { staticClass: "b-listbox-single-select-category__label-text", attrs: { variant: "caption", el: "span" } }, [e._v(" " + e._s(e.categoryLabel) + " ")]), s("div", [e._t("default")], 2)], 1);
129
- }, Te = [], Le = /* @__PURE__ */ N(
130
- he,
129
+ }, Ie = [], Be = /* @__PURE__ */ N(
131
130
  Oe,
132
- Te,
131
+ Ae,
132
+ Ie,
133
133
  !1,
134
134
  null,
135
135
  "4aa8cc6e",
136
136
  null,
137
137
  null
138
138
  );
139
- const Ae = Le.exports, Ie = D({
139
+ const Re = Be.exports, ke = D({
140
140
  name: "bento-listbox-option",
141
141
  props: {
142
142
  /**
@@ -148,29 +148,29 @@ const Ae = Le.exports, Ie = D({
148
148
  */
149
149
  selected: { type: Boolean, default: !1 }
150
150
  },
151
- emits: [i.CLICK, i.ENTER, i.SPACE, i.TAB],
151
+ emits: [a.CLICK, a.ENTER, a.SPACE, a.TAB],
152
152
  setup(t, { emit: e }) {
153
- const s = c(() => ({
153
+ const s = i(() => ({
154
154
  "b-listbox-option--disabled": t.disabled,
155
155
  "b-listbox-option--selected": t.selected
156
156
  }));
157
157
  return {
158
158
  // Enums
159
159
  BentoKeyboardNavigationKeyDownEvent: k,
160
- BentoListboxEvent: i,
160
+ BentoListboxEvent: a,
161
161
  // Values
162
162
  conditionalClasses: s,
163
163
  // Events
164
164
  onClick: (o) => {
165
- e(i.CLICK, o);
165
+ e(a.CLICK, o);
166
166
  },
167
- onOptionSelected: (o, m) => {
168
- e(o, m);
167
+ onOptionSelected: (o, _) => {
168
+ e(o, _);
169
169
  }
170
170
  };
171
171
  }
172
172
  });
173
- var Be = function() {
173
+ var De = function() {
174
174
  var e = this, s = e._self._c;
175
175
  return e._self._setupProxy, s("label", e._b({ staticClass: "b-listbox-option", class: e.conditionalClasses, attrs: { role: "option" }, on: { click: e.onClick, keydown: [function(l) {
176
176
  return !l.type.indexOf("key") && e._k(l.keyCode, "enter", 13, l.key, "Enter") ? null : e.onOptionSelected(e.BentoListboxEvent.ENTER, l);
@@ -179,22 +179,22 @@ var Be = function() {
179
179
  }, function(l) {
180
180
  return !l.type.indexOf("key") && e._k(l.keyCode, "tab", 9, l.key, "Tab") ? null : e.onOptionSelected(e.BentoListboxEvent.TAB, l);
181
181
  }] } }, "label", e.$attrs, !1), [e._t("default")], 2);
182
- }, Re = [], ke = /* @__PURE__ */ N(
183
- Ie,
184
- Be,
185
- Re,
182
+ }, Ne = [], Pe = /* @__PURE__ */ N(
183
+ ke,
184
+ De,
185
+ Ne,
186
186
  !1,
187
187
  null,
188
188
  "d7fb415c",
189
189
  null,
190
190
  null
191
191
  );
192
- const W = ke.exports, De = D({
192
+ const q = Pe.exports, $e = D({
193
193
  name: "bento-listbox-single-select-option",
194
194
  components: {
195
- BentoListboxOption: W,
196
- BentoTypography: $,
197
- CheckmarkIcon: fe
195
+ BentoListboxOption: q,
196
+ BentoTypography: w,
197
+ CheckmarkIcon: pe
198
198
  },
199
199
  props: {
200
200
  /**
@@ -214,24 +214,24 @@ const W = ke.exports, De = D({
214
214
  */
215
215
  selected: { type: Boolean, default: !1 }
216
216
  },
217
- emits: [i.ENTER, i.SELECT, i.SPACE, i.TAB],
217
+ emits: [a.ENTER, a.SELECT, a.SPACE, a.TAB],
218
218
  setup(t, { emit: e }) {
219
- const s = (m) => {
220
- t.disabled || e(m, t.option.value);
221
- }, l = c(() => t.disabled ? !0 : null), n = c(() => t.selected ? !0 : null), o = c(() => t.disabled ? -1 : 0);
219
+ const s = (_) => {
220
+ t.disabled || e(_, t.option);
221
+ }, l = i(() => t.disabled ? !0 : null), n = i(() => t.selected ? !0 : null), o = i(() => t.disabled ? -1 : 0);
222
222
  return {
223
223
  // Values
224
224
  ariaDisabled: l,
225
225
  ariaSelected: n,
226
226
  tabIndex: o,
227
227
  // Enums
228
- BentoListboxEvent: i,
228
+ BentoListboxEvent: a,
229
229
  // Events
230
230
  onOptionSelected: s
231
231
  };
232
232
  }
233
233
  });
234
- var Ne = function() {
234
+ var Me = function() {
235
235
  var e = this, s = e._self._c;
236
236
  return e._self._setupProxy, s("bento-listbox-option", { staticClass: "b-listbox-single-select-option", attrs: { disabled: e.disabled, selected: e.selected, "aria-selected": e.ariaSelected, "aria-disabled": e.ariaDisabled, tabindex: e.tabIndex }, on: e._d({ click: function(l) {
237
237
  return e.onOptionSelected(e.BentoListboxEvent.SELECT);
@@ -244,23 +244,23 @@ var Ne = function() {
244
244
  }]) }, [e._t("default", function() {
245
245
  return [s("span", { staticClass: "b-listbox-single-select-option__text" }, [s("bento-typography", { attrs: { el: "span" } }, [e._v(e._s(e.option.label))]), e.option.description ? s("bento-typography", { staticClass: "b-listbox-single-select-option__description", attrs: { el: "span" } }, [e._v(" " + e._s(e.option.description) + " ")]) : e._e()], 1)];
246
246
  }, null, e.option), s("span", { staticClass: "b-listbox-single-select-option__check-icon" }, [s("checkmark-icon", { directives: [{ name: "show", rawName: "v-show", value: e.selected, expression: "selected" }], attrs: { "svg-title": "selected" } })], 1)], 2);
247
- }, Pe = [], $e = /* @__PURE__ */ N(
248
- De,
249
- Ne,
250
- Pe,
247
+ }, we = [], Fe = /* @__PURE__ */ N(
248
+ $e,
249
+ Me,
250
+ we,
251
251
  !1,
252
252
  null,
253
- "092ed5ee",
253
+ "3ba7da5b",
254
254
  null,
255
255
  null
256
256
  );
257
- const Me = $e.exports, se = ({ items: t, isOptionDisabled: e }, s) => {
258
- const l = c(() => t.value.length - 1), n = L(0);
259
- Z(() => {
260
- e && (n.value = t.value.findIndex((d) => !e(d)));
257
+ const Ge = Fe.exports, le = ({ items: t, isOptionDisabled: e }, s) => {
258
+ const l = i(() => t.value.length - 1), n = A(0);
259
+ ee(() => {
260
+ e && (n.value = t.value.findIndex((v) => !e(v)));
261
261
  });
262
- const o = (d) => !e || !!e && e(t.value[d]), m = (d) => !e || !!e && !e(t.value[d]), a = (d) => {
263
- switch (d) {
262
+ const o = (v) => !e || !!e && e(t.value[v]), _ = (v) => !e || !!e && !e(t.value[v]), d = (v) => {
263
+ switch (v) {
264
264
  case "increase":
265
265
  n.value += 1;
266
266
  break;
@@ -268,31 +268,31 @@ const Me = $e.exports, se = ({ items: t, isOptionDisabled: e }, s) => {
268
268
  n.value -= 1;
269
269
  break;
270
270
  }
271
- }, b = ({ edgeCaseItem: d, isItemBeforeEdgeCaseItem: x }, E, B) => {
272
- n.value !== d && (x ? m(d) && a(B) : (a(B), o(n.value) && E()), s(n.value));
273
- }, u = (d) => {
274
- var E;
275
- (E = d == null ? void 0 : d.detail) == null || E.preventDefault();
276
- const x = n.value === l.value - 2;
277
- b(
271
+ }, r = ({ edgeCaseItem: v, isItemBeforeEdgeCaseItem: y }, T, B) => {
272
+ n.value !== v && (y ? _(v) && d(B) : (d(B), o(n.value) && T()), s(n.value));
273
+ }, u = (v) => {
274
+ var T;
275
+ (T = v == null ? void 0 : v.detail) == null || T.preventDefault();
276
+ const y = n.value === l.value - 2;
277
+ r(
278
278
  {
279
- isItemBeforeEdgeCaseItem: x,
279
+ isItemBeforeEdgeCaseItem: y,
280
280
  edgeCaseItem: l.value
281
281
  },
282
282
  u,
283
283
  "increase"
284
284
  /* INCREASE */
285
285
  );
286
- }, S = (d) => {
287
- var E;
288
- (E = d == null ? void 0 : d.detail) == null || E.preventDefault();
289
- const x = n.value === 1;
290
- b(
286
+ }, p = (v) => {
287
+ var T;
288
+ (T = v == null ? void 0 : v.detail) == null || T.preventDefault();
289
+ const y = n.value === 1;
290
+ r(
291
291
  {
292
292
  edgeCaseItem: 0,
293
- isItemBeforeEdgeCaseItem: x
293
+ isItemBeforeEdgeCaseItem: y
294
294
  },
295
- S,
295
+ p,
296
296
  "decrease"
297
297
  /* DECREASE */
298
298
  );
@@ -302,18 +302,18 @@ const Me = $e.exports, se = ({ items: t, isOptionDisabled: e }, s) => {
302
302
  n.value = 0, o(n.value) ? u() : s(n.value);
303
303
  },
304
304
  moveToLastElement: () => {
305
- n.value = l.value, o(n.value) ? S() : s(n.value);
305
+ n.value = l.value, o(n.value) ? p() : s(n.value);
306
306
  },
307
307
  moveToNextElement: u,
308
- moveToPreviousElement: S
308
+ moveToPreviousElement: p
309
309
  };
310
- }, we = D({
310
+ }, Ue = D({
311
311
  name: "bento-listbox-single-select",
312
312
  components: {
313
- BentoListboxSingleSelectCategory: Ae,
314
- BentoListboxSingleSelectOption: Me
313
+ BentoListboxSingleSelectCategory: Re,
314
+ BentoListboxSingleSelectOption: Ge
315
315
  },
316
- directives: { BentoKeyboardNavigationDirective: H },
316
+ directives: { BentoKeyboardNavigationDirective: X },
317
317
  inheritAttrs: !1,
318
318
  props: {
319
319
  /**
@@ -346,7 +346,7 @@ const Me = $e.exports, se = ({ items: t, isOptionDisabled: e }, s) => {
346
346
  * Set to an empty string `''` if you don't want any of the available options to be selected
347
347
  */
348
348
  selectedValue: {
349
- type: [String, Number],
349
+ type: Array,
350
350
  default: void 0
351
351
  },
352
352
  /**
@@ -354,86 +354,90 @@ const Me = $e.exports, se = ({ items: t, isOptionDisabled: e }, s) => {
354
354
  */
355
355
  staticCategories: { type: Boolean, default: !1 }
356
356
  },
357
- emits: [i.SELECT, i.ENTER, i.SPACE, i.TAB],
357
+ emits: [a.SELECT, a.ENTER, a.SPACE, a.TAB],
358
358
  setup(t, { emit: e, slots: s }) {
359
- const l = L([]), n = c(() => !!t.items.find(({ items: d }) => !!d)), o = (d) => (x) => {
360
- e(d, x);
361
- }, m = (d) => l.value[d].$el.focus(), { moveToNextElement: a, moveToPreviousElement: b, moveToFirstElement: u, moveToLastElement: S } = se(
359
+ const l = A([]), n = i(() => {
360
+ var y;
361
+ return !!((y = t.selectedValue) != null && y.length) && t.selectedValue.at(0);
362
+ }), o = i(() => !!t.items.some(({ items: y }) => !!y)), _ = (y) => (T) => {
363
+ e(y, [T]);
364
+ }, d = (y) => l.value[y].$el.focus(), { moveToNextElement: r, moveToPreviousElement: u, moveToFirstElement: p, moveToLastElement: h } = le(
362
365
  {
363
366
  items: V(t, "items"),
364
367
  isOptionDisabled: t.isOptionDisabled
365
368
  },
366
- m
367
- ), A = {
368
- [k.ARROW_UP]: b,
369
- [k.ARROW_DOWN]: a,
370
- [k.HOME]: u,
371
- [k.END]: S
372
- }, I = {
373
- [i.SELECT]: o(i.SELECT),
374
- [i.SPACE]: o(i.SPACE),
375
- [i.TAB]: o(i.TAB),
376
- [i.ENTER]: o(i.ENTER)
369
+ d
370
+ ), E = {
371
+ [k.ARROW_UP]: u,
372
+ [k.ARROW_DOWN]: r,
373
+ [k.HOME]: p,
374
+ [k.END]: h
375
+ }, v = {
376
+ [a.SELECT]: _(a.SELECT),
377
+ [a.SPACE]: _(a.SPACE),
378
+ [a.TAB]: _(a.TAB),
379
+ [a.ENTER]: _(a.ENTER)
377
380
  };
378
381
  return {
379
382
  // Enums
380
- BentoListboxEvent: i,
383
+ BentoListboxEvent: a,
381
384
  // Values
382
385
  listboxItemRef: l,
386
+ selectedItem: n,
383
387
  slots: s,
384
388
  // Computed
385
- hasCategories: n,
389
+ hasCategories: o,
386
390
  // Methods
387
- onOptionSelected: o,
391
+ onOptionSelected: _,
388
392
  // Keyboard navigation
389
- listboxListeners: A,
390
- listboxOptionListeners: I
393
+ listboxListeners: E,
394
+ listboxOptionListeners: v
391
395
  };
392
396
  }
393
397
  });
394
- var Fe = function() {
398
+ var ze = function() {
395
399
  var e = this, s = e._self._c;
396
400
  return e._self._setupProxy, s("div", e._g({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }] }, e.listboxListeners), [e.hasCategories && e.staticCategories ? e._l(e.items, function(l) {
397
401
  return s("bento-listbox-single-select-category", { key: l.value, attrs: { "category-label": l.label, role: "group" } }, e._l(l.items, function(n) {
398
- return s("bento-listbox-single-select-option", e._g({ key: n.value, ref: "listboxItemRef", refInFor: !0, attrs: { role: "option", option: n, disabled: e.isOptionDisabled ? e.isOptionDisabled(n) : null, selected: n.value === e.selectedValue }, scopedSlots: e._u([e._l(e.slots, function(o, m) {
399
- return { key: m, fn: function(a) {
400
- return [e._t(m, null, null, a)];
402
+ return s("bento-listbox-single-select-option", e._g({ key: n.value, ref: "listboxItemRef", refInFor: !0, attrs: { role: "option", option: n, disabled: e.isOptionDisabled ? e.isOptionDisabled(n) : null, selected: n.value === e.selectedItem.value }, scopedSlots: e._u([e._l(e.slots, function(o, _) {
403
+ return { key: _, fn: function(d) {
404
+ return [e._t(_, null, null, d)];
401
405
  } };
402
406
  })], null, !0) }, e.listboxOptionListeners));
403
407
  }), 1);
404
408
  }) : e._l(e.items, function(l) {
405
- return s("bento-listbox-single-select-option", e._g({ key: l.value, ref: "listboxItemRef", refInFor: !0, attrs: { role: "option", option: l, disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null, selected: l.value === e.selectedValue }, scopedSlots: e._u([e._l(e.slots, function(n, o) {
406
- return { key: o, fn: function(m) {
407
- return [e._t(o, null, null, m)];
409
+ return s("bento-listbox-single-select-option", e._g({ key: l.value, ref: "listboxItemRef", refInFor: !0, attrs: { role: "option", option: l, disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null, selected: l.value === e.selectedItem.value }, scopedSlots: e._u([e._l(e.slots, function(n, o) {
410
+ return { key: o, fn: function(_) {
411
+ return [e._t(o, null, null, _)];
408
412
  } };
409
413
  })], null, !0) }, e.listboxOptionListeners));
410
414
  })], 2);
411
- }, Ge = [], Ue = /* @__PURE__ */ N(
412
- we,
413
- Fe,
414
- Ge,
415
+ }, Ve = [], Ye = /* @__PURE__ */ N(
416
+ Ue,
417
+ ze,
418
+ Ve,
415
419
  !1,
416
420
  null,
417
421
  null,
418
422
  null,
419
423
  null
420
424
  );
421
- const Ye = Ue.exports;
422
- var j = /* @__PURE__ */ ((t) => (t.DISABLED = "disabled", t.STATIC_CATEGORY = "static-category", t))(j || {}), Y = /* @__PURE__ */ ((t) => (t.SELECT_CATEGORY = "select-category", t.UNSELECT_CATEGORY = "unselect-category", t))(Y || {});
423
- const Ve = {
425
+ const qe = Ye.exports;
426
+ var j = /* @__PURE__ */ ((t) => (t.DISABLED = "disabled", t.STATIC_CATEGORY = "static-category", t))(j || {}), U = /* @__PURE__ */ ((t) => (t.SELECT_CATEGORY = "select-category", t.UNSELECT_CATEGORY = "unselect-category", t))(U || {});
427
+ const We = {
424
428
  "en-US": {
425
429
  categoryClosed: "{category} closed",
426
430
  categoryOpened: "{category} opened"
427
431
  }
428
- }, ze = D({
429
- i18n: { messages: Ve },
432
+ }, Ke = D({
433
+ i18n: { messages: We },
430
434
  name: "bento-listbox-multi-select-category",
431
435
  components: {
432
- BentoCheckbox: X,
433
- BentoTypography: $,
434
- BentoListboxOption: W,
435
- ChevronDownIcon: ge,
436
- ChevronUpIcon: ye
436
+ BentoCheckbox: J,
437
+ BentoTypography: w,
438
+ BentoListboxOption: q,
439
+ ChevronDownIcon: Se,
440
+ ChevronUpIcon: xe
437
441
  },
438
442
  props: {
439
443
  /**
@@ -474,94 +478,94 @@ const Ve = {
474
478
  */
475
479
  staticCategories: { type: Boolean, default: !1 }
476
480
  },
477
- emits: [Y.SELECT_CATEGORY, Y.UNSELECT_CATEGORY],
481
+ emits: [U.SELECT_CATEGORY, U.UNSELECT_CATEGORY],
478
482
  setup(t, { emit: e }) {
479
- const s = L(!1), { t: l } = z(), n = (v) => t.isOptionDisabled ? t.isOptionDisabled(v) : !1, o = c(
480
- () => t.category.items.every((v) => n(v))
481
- ), m = V(t, "staticCategories"), a = c(() => s.value || t.staticCategories), b = c(() => ({
483
+ const s = A(!1), { t: l } = Y(), n = (m) => t.isOptionDisabled ? t.isOptionDisabled(m) : !1, o = i(
484
+ () => t.category.items.every((m) => n(m))
485
+ ), _ = V(t, "staticCategories"), d = i(() => s.value || t.staticCategories), r = i(() => ({
482
486
  [`b-listbox-multi-select-category--${j.DISABLED}`]: o.value,
483
487
  [`b-listbox-multi-select-category--${j.STATIC_CATEGORY}`]: t.staticCategories
484
- })), u = (v) => {
485
- v.preventDefault(), s.value = !s.value;
486
- }, S = (v) => {
487
- var M;
488
- const y = n(v), R = ((M = t.selectedItemsList) == null ? void 0 : M.includes(v.value)) || !1;
489
- return { isDisabled: y, isPreSelected: R };
490
- }, A = c(
491
- () => t.category.items.filter((v) => {
492
- const { isDisabled: y, isPreSelected: R } = S(v);
493
- return y && R || !y;
488
+ })), u = (m) => {
489
+ m.preventDefault(), s.value = !s.value;
490
+ }, p = (m) => {
491
+ var F;
492
+ const x = n(m), R = ((F = t.selectedItemsList) == null ? void 0 : F.includes(m.value)) || !1;
493
+ return { isDisabled: x, isPreSelected: R };
494
+ }, h = i(
495
+ () => t.category.items.filter((m) => {
496
+ const { isDisabled: x, isPreSelected: R } = p(m);
497
+ return x && R || !x;
494
498
  })
495
- ), I = c(
499
+ ), E = i(
496
500
  () => {
497
- var v;
498
- return (v = A.value) == null ? void 0 : v.filter(
499
- ({ value: y }) => {
501
+ var m;
502
+ return (m = h.value) == null ? void 0 : m.filter(
503
+ ({ value: x }) => {
500
504
  var R;
501
- return (R = t.selectedItemsList) == null ? void 0 : R.includes(y);
505
+ return (R = t.selectedItemsList) == null ? void 0 : R.includes(x);
502
506
  }
503
507
  );
504
508
  }
505
- ), d = c(() => {
506
- const v = s.value ? "categoryOpened" : "categoryClosed";
507
- return l(v, { category: t.category.label });
508
- }), x = c(
509
+ ), v = i(() => {
510
+ const m = s.value ? "categoryOpened" : "categoryClosed";
511
+ return l(m, { category: t.category.label });
512
+ }), y = i(
509
513
  () => ({
510
514
  el: "span",
511
515
  variant: t.staticCategories ? "caption" : "body"
512
516
  })
513
- ), E = () => {
514
- e(Y.SELECT_CATEGORY);
517
+ ), T = () => {
518
+ e(U.SELECT_CATEGORY);
515
519
  }, B = () => {
516
- e(Y.UNSELECT_CATEGORY);
517
- }, { isAllSelected: g, isIndeterminate: O, toggleSelectAll: h } = te(
518
- I,
519
- A,
520
+ e(U.UNSELECT_CATEGORY);
521
+ }, { isAllSelected: S, isIndeterminate: O, toggleSelectAll: L } = se(
520
522
  E,
523
+ h,
524
+ T,
521
525
  B
522
526
  );
523
527
  return {
524
528
  // Values
525
- chevronTitle: d,
526
- conditionalClass: b,
529
+ chevronTitle: v,
530
+ conditionalClass: r,
527
531
  hasAllPropsDisabled: o,
528
532
  isOpen: s,
529
- isAllSelected: g,
533
+ isAllSelected: S,
530
534
  isIndeterminate: O,
531
- isStaticCategory: m,
535
+ isStaticCategory: _,
532
536
  // Computed
533
- showItemChildren: a,
534
- categoryLabelProps: x,
537
+ showItemChildren: d,
538
+ categoryLabelProps: y,
535
539
  // Methods
536
540
  toggleOpen: u,
537
- toggleSelectAll: h
541
+ toggleSelectAll: L
538
542
  };
539
543
  }
540
544
  });
541
- var We = function() {
545
+ var je = function() {
542
546
  var e = this, s = e._self._c;
543
547
  return e._self._setupProxy, s("div", [s("bento-listbox-option", { staticClass: "b-listbox-multi-select-category__option", class: e.conditionalClass }, [e.isStaticCategory ? e._e() : s("bento-checkbox", { attrs: { "model-value": e.isAllSelected, indeterminate: e.isIndeterminate, disabled: e.hasAllPropsDisabled, "aria-label": e.category.label, value: e.category.value }, on: { "update:model-value": e.toggleSelectAll } }), s("span", { staticClass: "b-listbox-multi-select-category__label" }, [s("bento-typography", e._b({ staticClass: "b-listbox-multi-select-category__label-text" }, "bento-typography", e.categoryLabelProps, !1), [e._v(" " + e._s(e.category.label) + " ")]), e.isStaticCategory ? e._e() : s("div", { staticClass: "b-listbox-multi-select-category__label-chevron", attrs: { "data-testid": "toggle-listbox" }, on: { "!click": function(l) {
544
548
  return e.toggleOpen.apply(null, arguments);
545
549
  } } }, [e.isOpen ? s("chevron-up-icon", { attrs: { "svg-title": e.chevronTitle } }) : s("chevron-down-icon", { attrs: { "svg-title": e.chevronTitle } })], 1)], 1)], 1), s("div", { directives: [{ name: "show", rawName: "v-show", value: e.showItemChildren, expression: "showItemChildren" }] }, [e._t("default")], 2)], 1);
546
- }, qe = [], Ke = /* @__PURE__ */ N(
547
- ze,
548
- We,
549
- qe,
550
+ }, He = [], Xe = /* @__PURE__ */ N(
551
+ Ke,
552
+ je,
553
+ He,
550
554
  !1,
551
555
  null,
552
556
  "f360ac3d",
553
557
  null,
554
558
  null
555
559
  );
556
- const je = Ke.exports;
557
- var P = /* @__PURE__ */ ((t) => (t.SELECT_CATEGORY = "select-category", t.TOGGLE_CHECKBOX_SELECTION = "toggle-checkbox-selection", t.UNSELECT_CATEGORY = "unselect-category", t))(P || {});
558
- const He = D({
560
+ const Je = Xe.exports;
561
+ var $ = /* @__PURE__ */ ((t) => (t.SELECT_CATEGORY = "select-category", t.TOGGLE_CHECKBOX_SELECTION = "toggle-checkbox-selection", t.UNSELECT_CATEGORY = "unselect-category", t))($ || {});
562
+ const Qe = D({
559
563
  name: "listbox-multi-select-options",
560
564
  components: {
561
- BentoCheckbox: X,
562
- BentoListboxOption: W,
563
- BentoTypography: $,
564
- ListboxMultiSelectCategory: je
565
+ BentoCheckbox: J,
566
+ BentoListboxOption: q,
567
+ BentoTypography: w,
568
+ ListboxMultiSelectCategory: Je
565
569
  },
566
570
  props: {
567
571
  /**
@@ -619,40 +623,39 @@ const He = D({
619
623
  staticCategories: { type: Boolean, default: !1 }
620
624
  },
621
625
  emits: [
622
- P.TOGGLE_CHECKBOX_SELECTION,
623
- P.SELECT_CATEGORY,
624
- P.UNSELECT_CATEGORY
626
+ $.TOGGLE_CHECKBOX_SELECTION,
627
+ $.SELECT_CATEGORY,
628
+ $.UNSELECT_CATEGORY
625
629
  ],
626
630
  setup(t, { emit: e }) {
627
- const s = (b) => {
628
- e(P.TOGGLE_CHECKBOX_SELECTION, b);
629
- }, l = (b) => !!b.items, n = (b) => {
631
+ const s = (r) => {
632
+ e($.TOGGLE_CHECKBOX_SELECTION, r);
633
+ }, l = (r) => !!r.items, n = (r) => {
630
634
  const u = t.isMultiLevel && t.searching;
631
- return b.description && (!t.isMultiLevel || u);
632
- }, o = (b) => b.items ? !!b.items.find((u) => t.selectedItemsList.includes(u.value)) : t.selectedItemsList.includes(b.value), m = (b, u) => {
635
+ return r.description && (!t.isMultiLevel || u);
636
+ }, o = (r) => r.items ? !!r.items.find((u) => t.selectedItemsList.includes(u.value)) : t.selectedItemsList.includes(r.value), _ = (r, u) => {
633
637
  if (l(u))
634
- return e(b ? P.SELECT_CATEGORY : P.UNSELECT_CATEGORY, u);
638
+ return e(r ? $.SELECT_CATEGORY : $.UNSELECT_CATEGORY, u);
635
639
  s(u.value);
636
640
  };
637
641
  return {
638
642
  // Values
639
- conditionalClasses: c(() => ({
643
+ conditionalClasses: i(() => ({
640
644
  "b-listbox-multi-select-options__static-category-option": t.staticCategories,
641
645
  "b-listbox-multi-select-options__category-option": t.categoryItems
642
646
  })),
643
647
  // Methods
644
- isCategory: l,
645
648
  isOptionSelected: o,
646
649
  shouldShowDescription: n,
647
650
  toggleCheckboxSelection: s,
648
- selectSearch: m,
651
+ selectSearch: _,
649
652
  // Enums
650
- BentoListboxEvent: i,
651
- ListboxMultiSelectOptionsEvent: P
653
+ BentoListboxEvent: a,
654
+ ListboxMultiSelectOptionsEvent: $
652
655
  };
653
656
  }
654
657
  });
655
- var Xe = function() {
658
+ var Ze = function() {
656
659
  var e = this, s = e._self._c;
657
660
  return e._self._setupProxy, s("div", e._l(e.items, function(l) {
658
661
  return s("div", { key: `selected-${l.value}` }, [e.searching && e.isMultiLevel ? [s("bento-listbox-option", { staticClass: "b-listbox-multi-select-options", class: e.conditionalClasses, attrs: { disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null } }, [s("bento-checkbox", { attrs: { "model-value": e.isOptionSelected(l), "aria-label": l.label, disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null, value: l.value }, on: { "update:model-value": (n) => e.selectSearch(n, l) } }), e._t("default", function() {
@@ -662,29 +665,29 @@ var Xe = function() {
662
665
  }, "unselect-category": function(n) {
663
666
  return e.$emit(e.ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY, l);
664
667
  } } }, [s("listbox-multi-select-options", { attrs: { "category-items": "", items: l.items, "is-option-disabled": e.isOptionDisabled, "is-multi-level": e.isMultiLevel, "static-categories": e.staticCategories, "selected-items-list": e.selectedItemsList, searching: e.searching }, on: { "toggle-checkbox-selection": (n) => e.toggleCheckboxSelection(n) } })], 1)] : s("bento-listbox-option", { staticClass: "b-listbox-multi-select-options", class: e.conditionalClasses, attrs: { disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null } }, [s("bento-checkbox", { attrs: { "model-value": e.selectedItemsList, "aria-label": l.label, disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null, value: l.value }, on: { "update:model-value": function(n) {
665
- return e.toggleCheckboxSelection(l.value);
668
+ return e.toggleCheckboxSelection(l);
666
669
  } } }), e._t("default", function() {
667
670
  return [s("span", { staticClass: "b-listbox-multi-select__option-text" }, [s("bento-typography", { attrs: { el: "span" } }, [e._v(e._s(l.label))]), e.shouldShowDescription(l) ? s("bento-typography", { staticClass: "b-listbox-multi-select__option-description", attrs: { el: "span" } }, [e._v(" " + e._s(l.description) + " ")]) : e._e()], 1)];
668
671
  }, null, l)], 2)]], 2);
669
672
  }), 0);
670
- }, Je = [], Qe = /* @__PURE__ */ N(
671
- He,
672
- Xe,
673
- Je,
673
+ }, et = [], tt = /* @__PURE__ */ N(
674
+ Qe,
675
+ Ze,
676
+ et,
674
677
  !1,
675
678
  null,
676
- "c9b2c61d",
679
+ "b2db9f50",
677
680
  null,
678
681
  null
679
682
  );
680
- const Ze = Qe.exports, et = {
683
+ const st = tt.exports, lt = {
681
684
  "en-US": {
682
685
  remove: "Remove"
683
686
  }
684
- }, tt = {
685
- i18n: { messages: et }
686
- }, st = /* @__PURE__ */ D({
687
- ...tt,
687
+ }, nt = {
688
+ i18n: { messages: lt }
689
+ }, ot = /* @__PURE__ */ D({
690
+ ...nt,
688
691
  __name: "listbox-multi-select-chips",
689
692
  props: {
690
693
  /**
@@ -708,11 +711,11 @@ const Ze = Qe.exports, et = {
708
711
  },
709
712
  emits: ["unselect-item", "unselect-category"],
710
713
  setup(t, { emit: e }) {
711
- const { t: s } = z();
712
- return { __sfc: !0, emit: e, t: s, unselectOption: (n) => n.items ? e("unselect-category", n) : e("unselect-item", n.value), BentoTypography: $, BaseButton: pe, CrossSmallIcon: xe };
714
+ const { t: s } = Y();
715
+ return { __sfc: !0, emit: e, t: s, unselectOption: (n) => n.items ? e("unselect-category", n) : e("unselect-item", n), BentoTypography: w, BaseButton: Ce, CrossSmallIcon: he };
713
716
  }
714
717
  });
715
- var lt = function() {
718
+ var at = function() {
716
719
  var e = this, s = e._self._c, l = e._self._setupProxy;
717
720
  return s("div", { staticClass: "b-listbox-multi-select-chips" }, e._l(e.items, function(n) {
718
721
  return s("div", { key: `selected-${n.value}` }, [s(l.BaseButton, { staticClass: "b-listbox-multi-select-chips__chip", attrs: { disabled: e.isOptionDisabled ? e.isOptionDisabled(n) : null }, on: { click: function(o) {
@@ -721,27 +724,28 @@ var lt = function() {
721
724
  return [s(l.CrossSmallIcon, { attrs: { "svg-title": l.t("remove") } })];
722
725
  }, proxy: !0 }], null, !0) }, [s(l.BentoTypography, { staticClass: "b-listbox-multi-select-chips__option-text", attrs: { el: "span", variant: "caption" } }, [e._v(e._s(n.label))])], 1)], 1);
723
726
  }), 0);
724
- }, nt = [], ot = /* @__PURE__ */ N(
725
- st,
726
- lt,
727
- nt,
727
+ }, it = [], ct = /* @__PURE__ */ N(
728
+ ot,
729
+ at,
730
+ it,
728
731
  !1,
729
732
  null,
730
- "7590db86",
733
+ "931e5246",
731
734
  null,
732
735
  null
733
736
  );
734
- const it = ot.exports, at = {
737
+ const rt = ct.exports, ut = {
735
738
  "en-US": {
736
739
  allSelected: "All selected ({total})",
737
740
  numberOfTotalSelected: "{number} of {total} selected",
741
+ numbersSelected: "{number} selected",
738
742
  selectAll: "Select all ({total})"
739
743
  }
740
- }, ct = (t) => {
741
- const e = c(() => {
744
+ }, dt = (t) => {
745
+ const e = i(() => {
742
746
  var l;
743
747
  return !!((l = t.value) != null && l.find(({ items: n }) => !!n));
744
- }), s = c(() => {
748
+ }), s = i(() => {
745
749
  var l;
746
750
  return e.value ? (l = t.value) == null ? void 0 : l.reduce((n, o) => (o.items ? n.push(...o.items.flat()) : n.push(o), n), []) : t.value;
747
751
  });
@@ -749,18 +753,22 @@ const it = ot.exports, at = {
749
753
  isMultiLevelSelect: e,
750
754
  flattenedItemsList: s
751
755
  };
752
- }, rt = D({
753
- i18n: { messages: at },
756
+ }, _t = D({
757
+ i18n: { messages: ut },
754
758
  name: "bento-listbox-multi-select",
755
759
  components: {
756
- BentoCheckbox: X,
757
- BentoListboxOption: W,
758
- BentoTypography: $,
759
- ListboxMultiSelectOptions: Ze,
760
- ListboxMultiSelectChips: it
760
+ BentoCheckbox: J,
761
+ BentoListboxOption: q,
762
+ BentoTypography: w,
763
+ ListboxMultiSelectOptions: st,
764
+ ListboxMultiSelectChips: rt
761
765
  },
762
- directives: { BentoKeyboardNavigationDirective: H },
766
+ directives: { BentoKeyboardNavigationDirective: X },
763
767
  props: {
768
+ /**
769
+ * Indicates whether there are more items to load
770
+ */
771
+ hasMoreItems: { type: Boolean, default: !1 },
764
772
  /**
765
773
  * Function that allows the options to be disabled
766
774
  *
@@ -785,6 +793,16 @@ const it = ot.exports, at = {
785
793
  type: Array,
786
794
  required: !0
787
795
  },
796
+ /**
797
+ * The type of `Lazy Load`.
798
+ * Type "automatic" will enable infinite scrolling
799
+ * Type "button" will enable lazy loading with "Show more" button
800
+ */
801
+ lazyLoadType: {
802
+ type: String,
803
+ default: M.NONE,
804
+ validator: (t) => Object.values(M).includes(t)
805
+ },
788
806
  /**
789
807
  * Flag that indicates that an external search it's being made
790
808
  * to filter out the items inside the the multi-select listbox
@@ -798,154 +816,152 @@ const it = ot.exports, at = {
798
816
  */
799
817
  selectedValues: {
800
818
  type: Array,
801
- default: () => []
819
+ required: !0
802
820
  },
803
821
  /**
804
822
  * If enabled, dropdown will display non-selectable, static categories
805
823
  */
806
824
  staticCategories: { type: Boolean, default: !1 }
807
825
  },
808
- emits: [i.SELECT],
826
+ emits: [a.SELECT],
809
827
  setup(t, { emit: e, slots: s }) {
810
- const { t: l } = z(), n = L(null), o = L(null), m = L(null), a = L();
811
- ee(
812
- () => t.selectedValues,
813
- () => {
814
- a.value = [...t.selectedValues ?? []];
815
- },
816
- {
817
- immediate: !0
818
- }
819
- );
820
- const { isMultiLevelSelect: b, flattenedItemsList: u } = ct(V(t, "items")), S = (r) => {
821
- var p;
822
- const _ = t.isOptionDisabled(r), f = ((p = a.value) == null ? void 0 : p.includes(r.value)) || !1;
823
- return { isDisabled: _, isPreSelected: f };
824
- }, A = c(
825
- () => t.searching && b ? t.items : u.value.filter((r) => {
826
- const { isDisabled: _, isPreSelected: f } = S(r);
827
- return _ && f || !_;
828
- })
829
- ), I = c(
828
+ const { t: l } = Y(), n = A(null), o = A(null), _ = A(null), d = i(
829
+ () => t.selectedValues.map(({ value: c }) => c)
830
+ ), { isMultiLevelSelect: r, flattenedItemsList: u } = dt(V(t, "items")), p = (c) => {
831
+ var C;
832
+ const b = t.isOptionDisabled(c), f = ((C = d.value) == null ? void 0 : C.includes(c.value)) || !1;
833
+ return { isDisabled: b, isPreSelected: f };
834
+ }, h = i(() => {
835
+ if (t.searching && r)
836
+ return t.items;
837
+ const c = u.value.filter((b) => {
838
+ const { isDisabled: f, isPreSelected: C } = p(b);
839
+ return f && C || !f;
840
+ });
841
+ return t.selectedValues.forEach((b) => {
842
+ c.find((f) => f.value === b.value) || c.push(b);
843
+ }), c;
844
+ }), E = i(
830
845
  () => {
831
- var r;
832
- return (r = A.value) == null ? void 0 : r.filter((_) => {
846
+ var c;
847
+ return (c = h.value) == null ? void 0 : c.filter((b) => {
833
848
  var f;
834
- return _.items && b.value && t.searching ? _.items.filter(
835
- (C) => (t.selectedValues ?? []).includes(
836
- C.value
837
- )
838
- ).length === _.items.length : (f = a.value) == null ? void 0 : f.includes(_.value);
849
+ return b.items && r.value && t.searching ? b.items.filter(
850
+ (g) => (t.selectedValues ?? []).includes(g.value)
851
+ ).length === b.items.length : (f = d.value) == null ? void 0 : f.includes(b.value);
839
852
  });
840
853
  }
841
- ), d = () => b.value && !t.searching ? u.value.length : t.items.length, x = c(() => {
842
- var p;
843
- const r = A.value.length, _ = d(), f = ((p = I.value) == null ? void 0 : p.length) || 0;
844
- return f === 0 ? l("selectAll", { total: r }) : f === _ ? l("allSelected", { total: _ }) : l("numberOfTotalSelected", { number: f, total: _ });
845
- }), E = (r) => {
846
- const _ = (p) => {
847
- const { isDisabled: C, isPreSelected: U } = S(p);
848
- return C && U || !C;
849
- }, f = r.filter(_).filter((p) => !a.value.includes(p.value)).map(({ value: p }) => p);
850
- a.value = [...a.value, ...f], e(i.SELECT, a.value);
851
- }, B = (r) => {
852
- const _ = (p) => {
853
- const { isDisabled: C, isPreSelected: U } = S(p);
854
- return !(C && U);
855
- }, f = r.filter(_).map(({ value: p }) => p);
856
- a.value = a.value.filter((p) => !(f != null && f.includes(p))), e(i.SELECT, a.value);
857
- }, g = () => {
858
- E(u.value);
854
+ ), v = () => r.value && !t.searching ? u.value.length : t.items.length, y = i(() => {
855
+ var C;
856
+ const c = h.value.length, b = v(), f = ((C = E.value) == null ? void 0 : C.length) || 0;
857
+ return f === 0 ? l("selectAll", { total: c }) : f === b ? l("allSelected", { total: b }) : f <= b ? l("numberOfTotalSelected", { number: f, total: b }) : l("numbersSelected", { number: f });
858
+ }), T = (c) => {
859
+ const b = (C) => {
860
+ const { isDisabled: g, isPreSelected: P } = p(C);
861
+ return g && P || !g;
862
+ }, f = c.filter(b).filter((C) => !d.value.includes(C.value));
863
+ e(a.SELECT, [...t.selectedValues, ...f]);
864
+ }, B = (c) => {
865
+ const b = (g) => {
866
+ const { isDisabled: P, isPreSelected: me } = p(g);
867
+ return !(P && me);
868
+ }, f = c.filter(b).map(({ value: g }) => g), C = t.selectedValues.filter((g) => !(f != null && f.includes(g.value)));
869
+ e(a.SELECT, C);
870
+ }, S = () => {
871
+ T(u.value);
859
872
  }, O = () => {
860
873
  B(u.value);
861
- }, { isAllSelected: h, isIndeterminate: v, toggleSelectAll: y } = te(
862
- I,
863
- A,
864
- g,
874
+ }, { isAllSelected: L, isIndeterminate: m, toggleSelectAll: x } = se(
875
+ E,
876
+ h,
877
+ S,
865
878
  O
866
- ), R = (r) => {
867
- E(r.items);
868
- }, M = (r) => {
869
- B(r.items);
870
- }, q = (r, _) => {
879
+ ), R = (c) => {
880
+ T(c.items);
881
+ }, F = (c) => {
882
+ B(c.items);
883
+ }, W = (c, b) => {
871
884
  let f = !1;
872
- a.value = a.value.filter((p) => _ === p ? (f = !0, !1) : !0), f || a.value.push(_), e(r, a.value);
873
- }, F = c(() => {
874
- const r = (C) => a.value.includes(C.value), _ = (C) => !t.staticCategories && C.every((U) => r(U));
885
+ const C = t.selectedValues.filter(({ value: g }) => b.value === g ? (f = !0, !1) : !0);
886
+ f || C.push(b), e(c, C);
887
+ }, z = i(() => {
888
+ if (!r.value)
889
+ return t.selectedValues;
890
+ const c = (g) => d.value.includes(g.value), b = (g) => !t.staticCategories && g.every((P) => c(P));
875
891
  return t.items.flatMap(
876
- (C) => C.items && !_(C.items) ? C.items : C
877
- ).filter((C) => C.items ? !0 : r(C));
878
- }), K = c(
879
- () => {
880
- var r, _, f;
881
- return ((r = F.value) == null ? void 0 : r.length) > 0 && ((_ = I.value) == null ? void 0 : _.length) !== ((f = u.value) == null ? void 0 : f.length);
882
- }
883
- ), T = c(
892
+ (g) => g.items && !b(g.items) ? g.items : g
893
+ ).filter((g) => g.items ? !0 : c(g));
894
+ }), K = i(() => {
895
+ var f, C, g, P;
896
+ const c = ["automatic", "button"].includes(t.lazyLoadType), b = ((f = t.selectedValues) == null ? void 0 : f.length) > 0 && ((C = E.value) == null ? void 0 : C.length) !== ((g = u.value) == null ? void 0 : g.length);
897
+ return c && t.hasMoreItems ? !!((P = t.selectedValues) != null && P.length) : b;
898
+ }), I = i(() => ["automatic", "button"].includes(t.lazyLoadType) ? !t.hasMoreItems : !0), G = i(
884
899
  () => n.value ? [n.value] : []
885
- ), G = c(
900
+ ), ne = i(
886
901
  () => {
887
- var r, _;
888
- return (_ = (r = o.value) == null ? void 0 : r.$children) != null && _.length ? o.value.$children : [];
902
+ var c, b;
903
+ return (b = (c = o.value) == null ? void 0 : c.$children) != null && b.length ? o.value.$children : [];
889
904
  }
890
- ), le = c(
905
+ ), oe = i(
891
906
  () => {
892
- var r, _;
893
- return (_ = (r = m.value) == null ? void 0 : r.$children) != null && _.length ? m.value.$children : [];
907
+ var c, b;
908
+ return (b = (c = _.value) == null ? void 0 : c.$children) != null && b.length ? _.value.$children : [];
894
909
  }
895
- ), ne = c(() => ({ label: x, value: h })), oe = c(() => [
896
- ne,
897
- ...F.value,
910
+ ), ae = i(() => ({ label: y, value: L })), ie = i(() => [
911
+ ae,
912
+ ...z.value,
898
913
  ...u.value
899
- ]), ie = (r) => {
914
+ ]), ce = (c) => {
900
915
  [
901
- ...T.value,
902
916
  ...G.value,
903
- ...le.value
904
- ][r].$el.focus();
905
- }, { moveToNextElement: ae, moveToPreviousElement: ce, moveToFirstElement: re, moveToLastElement: ue } = se(
917
+ ...ne.value,
918
+ ...oe.value
919
+ ][c].$el.focus();
920
+ }, { moveToNextElement: re, moveToPreviousElement: ue, moveToFirstElement: de, moveToLastElement: _e } = le(
906
921
  {
907
- items: L(oe),
922
+ items: A(ie),
908
923
  isOptionDisabled: t.isOptionDisabled
909
924
  },
910
- ie
911
- ), de = {
912
- [k.ARROW_UP]: (r) => ce(r),
913
- [k.ARROW_DOWN]: (r) => ae(r),
914
- [k.HOME]: re,
915
- [k.END]: ue
925
+ ce
926
+ ), be = {
927
+ [k.ARROW_UP]: (c) => ue(c),
928
+ [k.ARROW_DOWN]: (c) => re(c),
929
+ [k.HOME]: de,
930
+ [k.END]: _e
916
931
  };
917
932
  return {
918
933
  // Refs
919
934
  selectAllListboxItemsRef: n,
920
935
  selectedListboxItemsRef: o,
921
- listboxItemsRef: m,
936
+ listboxItemsRef: _,
922
937
  // Values
923
- isAllSelected: h,
938
+ isAllSelected: L,
924
939
  showSelectedItems: K,
925
- isIndeterminate: v,
926
- isMultiLevelSelect: b,
940
+ isIndeterminate: m,
941
+ isMultiLevelSelect: r,
927
942
  flattenedItemsList: u,
928
- selectedItemsList: a,
929
- selectAllCheckboxText: x,
930
- selectedOptions: F,
943
+ selectedItemsList: d,
944
+ selectAllCheckboxText: y,
945
+ selectedOptions: z,
946
+ showSelectAllCheckbox: I,
931
947
  slots: s,
932
948
  // Enums
933
- BentoListboxEvent: i,
949
+ BentoListboxEvent: a,
934
950
  // Methods
935
951
  selectAllCategory: R,
936
- toggleCheckboxSelection: q,
937
- toggleSelectAll: y,
938
- unselectAllCategory: M,
952
+ toggleCheckboxSelection: W,
953
+ toggleSelectAll: x,
954
+ unselectAllCategory: F,
939
955
  // Events
940
- listboxListeners: de
956
+ listboxListeners: be
941
957
  };
942
958
  }
943
959
  });
944
- var ut = function() {
960
+ var bt = function() {
945
961
  var e = this, s = e._self._c;
946
- return e._self._setupProxy, s("div", e._g({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], staticClass: "b-listbox-multi-select" }, e.listboxListeners), [s("bento-listbox-option", { ref: "selectAllListboxItemsRef", staticClass: "b-listbox-multi-select__option" }, [s("bento-checkbox", { attrs: { "aria-label": e.selectAllCheckboxText, "model-value": e.isAllSelected, indeterminate: e.isIndeterminate }, on: { "update:model-value": e.toggleSelectAll } }), s("bento-typography", { attrs: { el: "span" } }, [e._v(" " + e._s(e.selectAllCheckboxText) + " ")])], 1), e.showSelectedItems ? s("div", [s("hr", { staticClass: "b-listbox-multi-select__divider" }), s("listbox-multi-select-chips", { ref: "selectedListboxItemsRef", attrs: { items: e.selectedOptions, "is-option-disabled": e.isOptionDisabled }, on: { "unselect-category": e.unselectAllCategory, "unselect-item": function(l) {
962
+ return e._self._setupProxy, s("div", e._g({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], staticClass: "b-listbox-multi-select" }, e.listboxListeners), [e.showSelectAllCheckbox ? s("bento-listbox-option", { ref: "selectAllListboxItemsRef", staticClass: "b-listbox-multi-select__option" }, [s("bento-checkbox", { attrs: { "aria-label": e.selectAllCheckboxText, "model-value": e.isAllSelected, indeterminate: e.isIndeterminate }, on: { "update:model-value": e.toggleSelectAll } }), s("bento-typography", { attrs: { el: "span", "aria-hidden": "true" } }, [e._v(" " + e._s(e.selectAllCheckboxText) + " ")])], 1) : e._e(), e.showSelectAllCheckbox ? s("hr", { staticClass: "b-listbox-multi-select__divider" }) : e._e(), e.showSelectedItems ? s("div", [s("listbox-multi-select-chips", { ref: "selectedListboxItemsRef", attrs: { items: e.selectedOptions, "is-option-disabled": e.isOptionDisabled }, on: { "unselect-category": e.unselectAllCategory, "unselect-item": function(l) {
947
963
  return e.toggleCheckboxSelection(e.BentoListboxEvent.SELECT, l);
948
- } } })], 1) : e._e(), s("hr", { staticClass: "b-listbox-multi-select__divider" }), s("listbox-multi-select-options", { ref: "listboxItemsRef", attrs: { items: e.items, "is-option-disabled": e.isOptionDisabled, "is-multi-level": e.isMultiLevelSelect, "static-categories": e.staticCategories, searching: e.searching, "selected-items-list": e.selectedItemsList }, on: e._d({ "toggle-checkbox-selection": function(l) {
964
+ } } }), s("hr", { staticClass: "b-listbox-multi-select__divider" })], 1) : e._e(), s("listbox-multi-select-options", { ref: "listboxItemsRef", attrs: { items: e.items, "is-option-disabled": e.isOptionDisabled, "is-multi-level": e.isMultiLevelSelect, "static-categories": e.staticCategories, searching: e.searching, "selected-items-list": e.selectedItemsList }, on: e._d({ "toggle-checkbox-selection": function(l) {
949
965
  return e.toggleCheckboxSelection(e.BentoListboxEvent.SELECT, l);
950
966
  }, "select-category": e.selectAllCategory, "unselect-category": e.unselectAllCategory }, [e.BentoListboxEvent.SPACE, function(l) {
951
967
  return e.toggleCheckboxSelection(e.BentoListboxEvent.SPACE, l);
@@ -958,33 +974,33 @@ var ut = function() {
958
974
  return [e._t(n, null, null, o)];
959
975
  } };
960
976
  })], null, !0) })], 1);
961
- }, dt = [], _t = /* @__PURE__ */ N(
962
- rt,
963
- ut,
964
- dt,
977
+ }, mt = [], vt = /* @__PURE__ */ N(
978
+ _t,
979
+ bt,
980
+ mt,
965
981
  !1,
966
982
  null,
967
- "a2c4d112",
983
+ "8e21add2",
968
984
  null,
969
985
  null
970
986
  );
971
- const Q = _t.exports, bt = {
987
+ const Z = vt.exports, ft = {
972
988
  "en-US": {
973
989
  showMore: "Show more",
974
990
  loading: "Loading"
975
991
  }
976
- }, vt = 36, mt = D({
992
+ }, gt = 36, yt = D({
977
993
  name: "bento-listbox",
978
994
  components: {
979
- BentoEmptyState: ve,
980
- BentoListboxSingleSelect: Ye,
981
- BentoListboxMultiSelect: Q,
982
- BentoTypography: $,
983
- BentoLoadingIndicator: be,
984
- BentoLoadingButton: Se
995
+ BentoEmptyState: ge,
996
+ BentoListboxSingleSelect: qe,
997
+ BentoListboxMultiSelect: Z,
998
+ BentoTypography: w,
999
+ BentoLoadingIndicator: fe,
1000
+ BentoLoadingButton: Ee
985
1001
  },
986
- directives: { BentoKeyboardNavigationDirective: H },
987
- i18n: { messages: bt },
1002
+ directives: { BentoKeyboardNavigationDirective: X },
1003
+ i18n: { messages: ft },
988
1004
  props: {
989
1005
  /**
990
1006
  * Defines a string value that labels an interactive element.
@@ -1040,8 +1056,8 @@ const Q = _t.exports, bt = {
1040
1056
  */
1041
1057
  lazyLoadType: {
1042
1058
  type: String,
1043
- default: w.NONE,
1044
- validator: (t) => Object.values(w).includes(t)
1059
+ default: M.NONE,
1060
+ validator: (t) => Object.values(M).includes(t)
1045
1061
  },
1046
1062
  /**
1047
1063
  * If enabled, the user will be able to select multiple items.
@@ -1061,15 +1077,15 @@ const Q = _t.exports, bt = {
1061
1077
  *
1062
1078
  * If enabled, hides the "Select all" checkbox in "multiple" mode.
1063
1079
  */
1064
- searching: Q.props.searching,
1080
+ searching: Z.props.searching,
1065
1081
  /**
1066
1082
  * The `input` value.
1067
1083
  * Providing an empty string or empty array will select no options.
1068
1084
  * Set to an empty string `''` if you don't want any of the available options to be selected for single select
1069
1085
  */
1070
1086
  selectedValue: {
1071
- type: [String, Number, Array],
1072
- default: void 0
1087
+ type: Array,
1088
+ default: () => []
1073
1089
  },
1074
1090
  /**
1075
1091
  * Enables virtual scrolling if set to true or by providing an object with itemHeight function.
@@ -1081,93 +1097,93 @@ const Q = _t.exports, bt = {
1081
1097
  }
1082
1098
  },
1083
1099
  emits: [
1084
- i.SELECT,
1085
- i.SPACE,
1086
- i.SHOW_MORE,
1087
- i.ENTER,
1088
- i.ESCAPE,
1089
- i.TAB
1100
+ a.SELECT,
1101
+ a.SPACE,
1102
+ a.SHOW_MORE,
1103
+ a.ENTER,
1104
+ a.ESCAPE,
1105
+ a.TAB
1090
1106
  ],
1091
1107
  setup(t, { emit: e, slots: s }) {
1092
- const l = L([]), n = V(t, "items"), { t: o } = z(), m = c(() => t.lazyLoadType !== w.AUTOMATIC), a = c(() => t.lazyLoadType === w.AUTOMATIC), b = () => {
1093
- var T;
1094
- return typeof (t == null ? void 0 : t.virtualScroll) == "object" && ((T = t == null ? void 0 : t.virtualScroll) != null && T.itemHeight) ? t.virtualScroll.itemHeight : vt;
1108
+ const l = A([]), n = V(t, "items"), { t: o } = Y(), _ = i(() => t.lazyLoadType !== M.AUTOMATIC), d = i(() => t.lazyLoadType === M.AUTOMATIC), r = () => {
1109
+ var I;
1110
+ return typeof (t == null ? void 0 : t.virtualScroll) == "object" && ((I = t == null ? void 0 : t.virtualScroll) != null && I.itemHeight) ? t.virtualScroll.itemHeight : gt;
1095
1111
  }, {
1096
1112
  containerRef: u,
1097
- containerProps: S,
1098
- onScroll: A,
1099
- list: I,
1100
- wrapperProps: d
1101
- } = Ee(n, {
1102
- itemHeight: b(),
1113
+ containerProps: p,
1114
+ onScroll: h,
1115
+ list: E,
1116
+ wrapperProps: v
1117
+ } = Le(n, {
1118
+ itemHeight: r(),
1103
1119
  // Disable virtual scrolling if not enabled or if lazy loading is enabled or if multi-select
1104
1120
  disabled: (t == null ? void 0 : t.multiple) || (t == null ? void 0 : t.virtualScroll) === !1 || (t == null ? void 0 : t.lazyLoadType) !== "none"
1105
- }), x = c(
1106
- () => m.value ? "true" : void 0
1107
- ), E = c(
1108
- () => m.value && t.loading ? "true" : "false"
1109
- ), B = c(
1110
- () => m.value ? "polite" : void 0
1111
- ), g = (T) => (G) => {
1112
- e(T, G);
1121
+ }), y = i(
1122
+ () => _.value ? "true" : void 0
1123
+ ), T = i(
1124
+ () => _.value && t.loading ? "true" : "false"
1125
+ ), B = i(
1126
+ () => _.value ? "polite" : void 0
1127
+ ), S = (I) => (G) => {
1128
+ e(I, G);
1113
1129
  }, O = () => {
1114
- e(i.SHOW_MORE);
1115
- }, h = me(() => {
1116
- const T = u.value;
1117
- if (!T)
1130
+ e(a.SHOW_MORE);
1131
+ }, L = ye(() => {
1132
+ const I = u.value;
1133
+ if (!I)
1118
1134
  return;
1119
- const G = Math.round(T.scrollTop) + T.clientHeight >= T.scrollHeight;
1135
+ const G = Math.round(I.scrollTop) + I.clientHeight >= I.scrollHeight;
1120
1136
  t.hasMoreItems && G && !t.loading && O();
1121
- }), v = () => {
1122
- a.value ? h() : A();
1123
- }, y = c(() => {
1124
- var T;
1125
- return t.searching && ((T = t.items) == null ? void 0 : T.length) === 0;
1126
- }), R = c(
1127
- () => t.lazyLoadType === w.BUTTON && t.hasMoreItems
1128
- ), M = c(
1129
- () => t.loading ? J.LOADING : J.START
1130
- ), q = c(() => t.loading ? o("loading") : o("showMore")), F = c(() => ({
1137
+ }), m = () => {
1138
+ d.value ? L() : h();
1139
+ }, x = i(() => {
1140
+ var I;
1141
+ return t.searching && ((I = t.items) == null ? void 0 : I.length) === 0;
1142
+ }), R = i(
1143
+ () => t.lazyLoadType === M.BUTTON && t.hasMoreItems
1144
+ ), F = i(
1145
+ () => t.loading ? Q.LOADING : Q.START
1146
+ ), W = i(() => t.loading ? o("loading") : o("showMore")), z = i(() => ({
1131
1147
  ...t.emptyState,
1132
1148
  variant: "condensed"
1133
1149
  })), K = {
1134
- [i.SELECT]: g(i.SELECT),
1135
- [i.SPACE]: g(i.SPACE),
1136
- [i.TAB]: g(i.TAB),
1137
- [i.ENTER]: g(i.ENTER)
1150
+ [a.SELECT]: S(a.SELECT),
1151
+ [a.SPACE]: S(a.SPACE),
1152
+ [a.TAB]: S(a.TAB),
1153
+ [a.ENTER]: S(a.ENTER)
1138
1154
  };
1139
1155
  return {
1140
1156
  // Refs
1141
1157
  listboxRef: u,
1142
1158
  listboxItemRef: l,
1143
1159
  // a11y
1144
- ariaAtomic: x,
1145
- ariaBusy: E,
1160
+ ariaAtomic: y,
1161
+ ariaBusy: T,
1146
1162
  ariaLive: B,
1147
1163
  // Values
1148
- containerProps: S,
1149
- isSearchResultEmpty: y,
1150
- limitedEmptyStateProps: F,
1151
- loadingButtonState: M,
1164
+ containerProps: p,
1165
+ isSearchResultEmpty: x,
1166
+ limitedEmptyStateProps: z,
1167
+ loadingButtonState: F,
1152
1168
  slots: s,
1153
1169
  shouldDisplayShowMoreButton: R,
1154
- showMoreButtonText: q,
1155
- virtualisedItems: I,
1156
- wrapperProps: d,
1170
+ showMoreButtonText: W,
1171
+ virtualisedItems: E,
1172
+ wrapperProps: v,
1157
1173
  // Enums
1158
1174
  BentoKeyboardNavigationKeyDownEvent: k,
1159
- BentoListboxEvent: i,
1175
+ BentoListboxEvent: a,
1160
1176
  // Methods
1161
- onListboxContainerScroll: v,
1162
- onOptionSelected: g,
1177
+ onListboxContainerScroll: m,
1178
+ onOptionSelected: S,
1163
1179
  emitShowMore: O,
1164
1180
  listboxListeners: K
1165
1181
  };
1166
1182
  }
1167
1183
  });
1168
- var ft = function() {
1184
+ var pt = function() {
1169
1185
  var e = this, s = e._self._c;
1170
- return e._self._setupProxy, s("div", e._b({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], staticClass: "b-listbox", attrs: { id: e.id, role: "listbox", tabindex: "-1", "aria-busy": e.ariaBusy, "aria-atomic": e.ariaAtomic, "aria-label": e.ariaLabel, "aria-live": e.ariaLive }, on: { scroll: e.onListboxContainerScroll } }, "div", e.containerProps, !1), [s("div", e._b({}, "div", e.wrapperProps, !1), [e.isSearchResultEmpty ? s("div", { staticClass: "b-listbox__empty-search-message" }, [e.emptyState ? s("bento-empty-state", e._b({}, "bento-empty-state", e.limitedEmptyStateProps, !1)) : s("bento-typography", { attrs: { el: "span" } }, [e._v(e._s(e.noResultsMessage))])], 1) : [e.multiple ? [s("bento-listbox-multi-select", e._g({ ref: "listboxItemRef", attrs: { items: e.items, "static-categories": e.staticCategories, "selected-values": e.selectedValue, searching: e.searching, "is-option-disabled": e.isOptionDisabled }, scopedSlots: e._u([e._l(e.slots, function(l, n) {
1186
+ return e._self._setupProxy, s("div", e._b({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], staticClass: "b-listbox", attrs: { id: e.id, role: "listbox", tabindex: "-1", "aria-busy": e.ariaBusy, "aria-atomic": e.ariaAtomic, "aria-label": e.ariaLabel, "aria-live": e.ariaLive }, on: { scroll: e.onListboxContainerScroll } }, "div", e.containerProps, !1), [s("div", e._b({}, "div", e.wrapperProps, !1), [e.isSearchResultEmpty ? s("div", { staticClass: "b-listbox__empty-search-message" }, [e.emptyState ? s("bento-empty-state", e._b({}, "bento-empty-state", e.limitedEmptyStateProps, !1)) : s("bento-typography", { attrs: { el: "span" } }, [e._v(e._s(e.noResultsMessage))])], 1) : [e.multiple ? [s("bento-listbox-multi-select", e._g({ ref: "listboxItemRef", attrs: { "has-more-items": e.hasMoreItems, items: e.items, "lazy-load-type": e.lazyLoadType, "static-categories": e.staticCategories, "selected-values": e.selectedValue, searching: e.searching, "is-option-disabled": e.isOptionDisabled }, scopedSlots: e._u([e._l(e.slots, function(l, n) {
1171
1187
  return { key: n, fn: function(o) {
1172
1188
  return [e._t(n, null, null, o)];
1173
1189
  } };
@@ -1178,21 +1194,67 @@ var ft = function() {
1178
1194
  })], null, !0) }, e.listboxListeners))], e.shouldDisplayShowMoreButton ? s("div", { staticClass: "b-listbox__lazy-load" }, [s("bento-loading-button", { attrs: { state: e.loadingButtonState, variant: "secondary" }, on: { "!click": function(l) {
1179
1195
  return e.emitShowMore.apply(null, arguments);
1180
1196
  } } }, [e._v(" " + e._s(e.showMoreButtonText) + " ")])], 1) : e.loading ? s("div", { staticClass: "b-listbox__lazy-load" }, [s("bento-loading-indicator")], 1) : e._e()]], 2)]);
1181
- }, gt = [], yt = /* @__PURE__ */ N(
1182
- mt,
1183
- ft,
1184
- gt,
1197
+ }, St = [], xt = /* @__PURE__ */ N(
1198
+ yt,
1199
+ pt,
1200
+ St,
1185
1201
  !1,
1186
1202
  null,
1187
- "17128845",
1203
+ "28929030",
1188
1204
  null,
1189
1205
  null
1190
1206
  );
1191
- const Pt = yt.exports;
1207
+ const wt = xt.exports, H = (t, e) => {
1208
+ for (const s of t) {
1209
+ if (s.value === e)
1210
+ return s.label;
1211
+ if (s.items)
1212
+ return H(s.items, e);
1213
+ }
1214
+ return null;
1215
+ }, Ft = (t, e, s) => {
1216
+ const l = A([]), n = A(), o = (r) => {
1217
+ n.value = s.value ? r.map(({ value: u }) => u) : r[0].value;
1218
+ }, _ = (r) => {
1219
+ l.value = r, o(r);
1220
+ }, d = () => {
1221
+ l.value = [], n.value = null;
1222
+ };
1223
+ return te(
1224
+ () => e.value,
1225
+ () => {
1226
+ if (!e.value) {
1227
+ d();
1228
+ return;
1229
+ }
1230
+ const r = !Array.isArray(e.value), u = [...l.value];
1231
+ d();
1232
+ const p = (h) => {
1233
+ let E = H(t.value, h);
1234
+ E || (E = H(u, h)), E || (E = h.toString()), l.value.push({ value: h, label: E });
1235
+ };
1236
+ if (r) {
1237
+ const h = e.value;
1238
+ p(h), o(l.value);
1239
+ return;
1240
+ }
1241
+ e.value.forEach(p), o(l.value);
1242
+ },
1243
+ { immediate: !0 }
1244
+ ), {
1245
+ // Values
1246
+ cachedSelectedListboxOptions: l,
1247
+ cachedListboxSelectedValues: n,
1248
+ // Methods
1249
+ resetCache: d,
1250
+ setCachedValues: _
1251
+ };
1252
+ };
1192
1253
  export {
1193
- Pt as B,
1194
- w as a,
1195
- i as b,
1196
- ct as u
1254
+ wt as B,
1255
+ Ft as a,
1256
+ M as b,
1257
+ a as c,
1258
+ dt as u
1197
1259
  };
1198
- //# sourceMappingURL=listbox.e6e1bc90.js.map
1260
+ //# sourceMappingURL=use-cached-selected-values.69297473.js.map