@adyen/bento-vue2 1.64.1 → 1.66.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 (183) hide show
  1. package/dist/@types/index.d.ts +416 -234
  2. package/dist/action-bar.js +1 -1
  3. package/dist/assets/accordion-item.css +1 -1
  4. package/dist/assets/action-bar.css +1 -1
  5. package/dist/assets/base-modal.css +1 -1
  6. package/dist/assets/button-actions-with-menu.css +1 -1
  7. package/dist/assets/card.css +1 -1
  8. package/dist/assets/copy.css +1 -1
  9. package/dist/assets/data-grid-template.css +1 -1
  10. package/dist/assets/data-grid.css +1 -1
  11. package/dist/assets/date.css +1 -1
  12. package/dist/assets/dialog-page.css +1 -1
  13. package/dist/assets/dropdown.css +1 -1
  14. package/dist/assets/file-uploader.css +1 -1
  15. package/dist/assets/filter-bar.css +1 -1
  16. package/dist/assets/header.css +1 -1
  17. package/dist/assets/info-icon.css +1 -1
  18. package/dist/assets/input-field-password.css +1 -1
  19. package/dist/assets/inspector.css +1 -1
  20. package/dist/assets/menu.css +1 -1
  21. package/dist/assets/modal-fullscreen.css +1 -1
  22. package/dist/assets/pagination.css +1 -1
  23. package/dist/assets/popover.css +1 -1
  24. package/dist/assets/sidepanel.css +1 -1
  25. package/dist/assets/step.css +1 -1
  26. package/dist/assets/summary-grid.css +1 -1
  27. package/dist/assets/tab.css +1 -0
  28. package/dist/assets/textarea.css +1 -1
  29. package/dist/assets/use-cached-selected-values.css +1 -1
  30. package/dist/checkbox.js +2 -2
  31. package/dist/chunks/{action-bar.DHdrZtmW.js → action-bar.C8zeHAJG.js} +31 -31
  32. package/dist/chunks/action-bar.C8zeHAJG.js.map +1 -0
  33. package/dist/chunks/button-actions-with-menu.BVU1NS0m.js +83 -0
  34. package/dist/chunks/button-actions-with-menu.BVU1NS0m.js.map +1 -0
  35. package/dist/chunks/calendar.DvIQEYwN.js +2086 -0
  36. package/dist/chunks/calendar.DvIQEYwN.js.map +1 -0
  37. package/dist/chunks/{checkbox-group.DVX0GFm9.js → checkbox-group.BVMGnokj.js} +4 -4
  38. package/dist/chunks/{checkbox-group.DVX0GFm9.js.map → checkbox-group.BVMGnokj.js.map} +1 -1
  39. package/dist/chunks/{checkbox.nHrvoKfp.js → checkbox.Bg5FM5Oa.js} +2 -2
  40. package/dist/chunks/{checkbox.nHrvoKfp.js.map → checkbox.Bg5FM5Oa.js.map} +1 -1
  41. package/dist/chunks/{code-snippet.y-fe04wy.js → code-snippet.BcoVTIs2.js} +3 -3
  42. package/dist/chunks/{code-snippet.y-fe04wy.js.map → code-snippet.BcoVTIs2.js.map} +1 -1
  43. package/dist/chunks/{controls-group.BWAmz7Tg.js → controls-group.CccuLkgP.js} +2 -2
  44. package/dist/chunks/{controls-group.BWAmz7Tg.js.map → controls-group.CccuLkgP.js.map} +1 -1
  45. package/dist/chunks/copy.CF8Fzu2Y.js +96 -0
  46. package/dist/chunks/copy.CF8Fzu2Y.js.map +1 -0
  47. package/dist/chunks/{dashboard-section.Bz54Z6Hh.js → dashboard-section.CcEIwDqX.js} +3 -3
  48. package/dist/chunks/{dashboard-section.Bz54Z6Hh.js.map → dashboard-section.CcEIwDqX.js.map} +1 -1
  49. package/dist/chunks/{data-grid-template.DtFRjaR8.js → data-grid-template.DJQcVuPs.js} +16 -14
  50. package/dist/chunks/data-grid-template.DJQcVuPs.js.map +1 -0
  51. package/dist/chunks/{data-grid.DCPJKAXM.js → data-grid.t4fCoE2Y.js} +70 -64
  52. package/dist/chunks/{data-grid.DCPJKAXM.js.map → data-grid.t4fCoE2Y.js.map} +1 -1
  53. package/dist/chunks/{date-picker.k0g6anfy.js → date-picker.DOAWsba5.js} +6 -7
  54. package/dist/chunks/{date-picker.k0g6anfy.js.map → date-picker.DOAWsba5.js.map} +1 -1
  55. package/dist/chunks/{date-range-picker.C1NVoQMD.js → date-range-picker.DYxZygbL.js} +22 -23
  56. package/dist/chunks/{date-range-picker.C1NVoQMD.js.map → date-range-picker.DYxZygbL.js.map} +1 -1
  57. package/dist/chunks/date.BfyWX2PY.js +160 -0
  58. package/dist/chunks/date.BfyWX2PY.js.map +1 -0
  59. package/dist/chunks/{dropdown-tag.Bz9wsYt7.js → dropdown-tag.DYg5l6HT.js} +2 -2
  60. package/dist/chunks/{dropdown-tag.Bz9wsYt7.js.map → dropdown-tag.DYg5l6HT.js.map} +1 -1
  61. package/dist/chunks/{dropdown.9xELPCKZ.js → dropdown.BWsU98dn.js} +273 -267
  62. package/dist/chunks/dropdown.BWsU98dn.js.map +1 -0
  63. package/dist/chunks/{error-message.1Em7Lis3.js → error-message.BgxnwPLF.js} +2 -2
  64. package/dist/chunks/{error-message.1Em7Lis3.js.map → error-message.BgxnwPLF.js.map} +1 -1
  65. package/dist/chunks/es6.n1ewaW31.js.map +1 -1
  66. package/dist/chunks/{file-uploader.DyjdNLOa.js → file-uploader.BPslxGI8.js} +323 -323
  67. package/dist/chunks/file-uploader.BPslxGI8.js.map +1 -0
  68. package/dist/chunks/{filter-bar.u3zmwRsM.js → filter-bar.Bx3wivl8.js} +664 -649
  69. package/dist/chunks/{filter-bar.u3zmwRsM.js.map → filter-bar.Bx3wivl8.js.map} +1 -1
  70. package/dist/chunks/{get-date-locale.BN8xEjY0.js → get-date-locale.CAyOIbcp.js} +288 -649
  71. package/dist/chunks/get-date-locale.CAyOIbcp.js.map +1 -0
  72. package/dist/chunks/{header-with-views.piXHBTLd.js → header-with-views.B6mwBJjk.js} +13 -13
  73. package/dist/chunks/{header-with-views.piXHBTLd.js.map → header-with-views.B6mwBJjk.js.map} +1 -1
  74. package/dist/chunks/{header.Cb644uAi.js → header.hTMmMN8n.js} +25 -24
  75. package/dist/chunks/{header.Cb644uAi.js.map → header.hTMmMN8n.js.map} +1 -1
  76. package/dist/chunks/index.BrH1t1iu.js +407 -0
  77. package/dist/chunks/index.BrH1t1iu.js.map +1 -0
  78. package/dist/chunks/info-icon.CYOXx8CL.js +37 -0
  79. package/dist/chunks/info-icon.CYOXx8CL.js.map +1 -0
  80. package/dist/chunks/input-field-password.B8qWGzaB.js +252 -0
  81. package/dist/chunks/input-field-password.B8qWGzaB.js.map +1 -0
  82. package/dist/chunks/{input-field-phone-number.pnq9LO1V.js → input-field-phone-number.Bi4TJhbX.js} +3 -3
  83. package/dist/chunks/{input-field-phone-number.pnq9LO1V.js.map → input-field-phone-number.Bi4TJhbX.js.map} +1 -1
  84. package/dist/chunks/{input-field.CloLEXr_.js → input-field.L5bWjTpB.js} +3 -3
  85. package/dist/chunks/{input-field.CloLEXr_.js.map → input-field.L5bWjTpB.js.map} +1 -1
  86. package/dist/chunks/{pagination.1XBgTs6T.js → pagination.CW_1yX5C.js} +115 -115
  87. package/dist/chunks/pagination.CW_1yX5C.js.map +1 -0
  88. package/dist/chunks/{radio-group.CtPG_iiI.js → radio-group.4_KKjvAm.js} +3 -3
  89. package/dist/chunks/{radio-group.CtPG_iiI.js.map → radio-group.4_KKjvAm.js.map} +1 -1
  90. package/dist/chunks/{rich-text-editor.CLxVaskq.js → rich-text-editor.BpaFd2-y.js} +3 -3
  91. package/dist/chunks/{rich-text-editor.CLxVaskq.js.map → rich-text-editor.BpaFd2-y.js.map} +1 -1
  92. package/dist/chunks/{search-bar.BIVcXNZZ.js → search-bar.5JHI6li0.js} +3 -3
  93. package/dist/chunks/{search-bar.BIVcXNZZ.js.map → search-bar.5JHI6li0.js.map} +1 -1
  94. package/dist/chunks/{secondary-nav.CR5uIx-H.js → secondary-nav.D4hrWvf7.js} +2 -2
  95. package/dist/chunks/{secondary-nav.CR5uIx-H.js.map → secondary-nav.D4hrWvf7.js.map} +1 -1
  96. package/dist/chunks/{selection-card-group.CoqBRUT8.js → selection-card-group.0o5T4tab.js} +3 -3
  97. package/dist/chunks/{selection-card-group.CoqBRUT8.js.map → selection-card-group.0o5T4tab.js.map} +1 -1
  98. package/dist/chunks/step.DMMofD4B.js +217 -0
  99. package/dist/chunks/step.DMMofD4B.js.map +1 -0
  100. package/dist/chunks/{structured-list-item.tox2Kcb6.js → structured-list-item.Bnn6-Z3q.js} +3 -3
  101. package/dist/chunks/{structured-list-item.tox2Kcb6.js.map → structured-list-item.Bnn6-Z3q.js.map} +1 -1
  102. package/dist/chunks/summary-grid.types.Cwri2Y3T.js +337 -0
  103. package/dist/chunks/summary-grid.types.Cwri2Y3T.js.map +1 -0
  104. package/dist/chunks/tab.BhWPBxcB.js +192 -0
  105. package/dist/chunks/tab.BhWPBxcB.js.map +1 -0
  106. package/dist/chunks/{tabs.keys.Bc2pSKRw.js → tabs.keys.Cb4Vw5Jh.js} +3 -3
  107. package/dist/chunks/{tabs.keys.Bc2pSKRw.js.map → tabs.keys.Cb4Vw5Jh.js.map} +1 -1
  108. package/dist/chunks/{textarea.BPeDUAPL.js → textarea.RAU710Uw.js} +83 -80
  109. package/dist/chunks/textarea.RAU710Uw.js.map +1 -0
  110. package/dist/chunks/{timeline-item.CS9ZDOsm.js → timeline-item.DK2d00rt.js} +10 -11
  111. package/dist/chunks/timeline-item.DK2d00rt.js.map +1 -0
  112. package/dist/chunks/use-cached-selected-values.CusB5KBl.js +1320 -0
  113. package/dist/chunks/use-cached-selected-values.CusB5KBl.js.map +1 -0
  114. package/dist/code-snippet.js +1 -1
  115. package/dist/dashboard-template.js +1 -1
  116. package/dist/data-grid-template.js +1 -1
  117. package/dist/data-grid.js +1 -1
  118. package/dist/date-picker.js +2 -2
  119. package/dist/date-range-picker.js +2 -2
  120. package/dist/date.js +1 -1
  121. package/dist/dropdown.js +3 -3
  122. package/dist/file-uploader.js +1 -1
  123. package/dist/filter-bar.js +1 -1
  124. package/dist/header-with-views.js +1 -1
  125. package/dist/header.js +1 -1
  126. package/dist/index.js +34 -34
  127. package/dist/info-icon.js +1 -1
  128. package/dist/input-field-password.js +1 -1
  129. package/dist/input-field-phone-number.js +1 -1
  130. package/dist/input-field.js +1 -1
  131. package/dist/internal.js +6 -6
  132. package/dist/pagination.js +1 -1
  133. package/dist/radio-group.js +1 -1
  134. package/dist/rich-text-editor.js +1 -1
  135. package/dist/search-bar.js +2 -2
  136. package/dist/secondary-nav.js +1 -1
  137. package/dist/selection-card.js +1 -1
  138. package/dist/stepper.js +1 -1
  139. package/dist/structured-list.js +1 -1
  140. package/dist/styles/bento-dark.css +1 -0
  141. package/dist/styles/bento-light.css +1 -0
  142. package/dist/styles/bento.css +1 -0
  143. package/dist/styles/legacy.css +1 -0
  144. package/dist/styles/styleguide.css +1 -0
  145. package/dist/summary-grid.js +1 -1
  146. package/dist/tabs.js +1 -1
  147. package/dist/textarea.js +1 -1
  148. package/dist/timeline.js +1 -1
  149. package/dist/web-types.json +197 -79
  150. package/package.json +7 -6
  151. package/dist/assets/tabs.css +0 -1
  152. package/dist/chunks/action-bar.DHdrZtmW.js.map +0 -1
  153. package/dist/chunks/button-actions-with-menu.CYkEoiee.js +0 -166
  154. package/dist/chunks/button-actions-with-menu.CYkEoiee.js.map +0 -1
  155. package/dist/chunks/calendar.DbTC35rM.js +0 -1167
  156. package/dist/chunks/calendar.DbTC35rM.js.map +0 -1
  157. package/dist/chunks/copy.CXeLbvUP.js +0 -129
  158. package/dist/chunks/copy.CXeLbvUP.js.map +0 -1
  159. package/dist/chunks/data-grid-template.DtFRjaR8.js.map +0 -1
  160. package/dist/chunks/date.dYFFEunA.js +0 -987
  161. package/dist/chunks/date.dYFFEunA.js.map +0 -1
  162. package/dist/chunks/dropdown.9xELPCKZ.js.map +0 -1
  163. package/dist/chunks/file-uploader.DyjdNLOa.js.map +0 -1
  164. package/dist/chunks/get-date-locale.BN8xEjY0.js.map +0 -1
  165. package/dist/chunks/index.BDuTpjD8.js +0 -40
  166. package/dist/chunks/index.BDuTpjD8.js.map +0 -1
  167. package/dist/chunks/index.DD7TppDb.js +0 -10
  168. package/dist/chunks/index.DD7TppDb.js.map +0 -1
  169. package/dist/chunks/info-icon.B9aTl1nU.js +0 -41
  170. package/dist/chunks/info-icon.B9aTl1nU.js.map +0 -1
  171. package/dist/chunks/input-field-password.CH6pc2CI.js +0 -252
  172. package/dist/chunks/input-field-password.CH6pc2CI.js.map +0 -1
  173. package/dist/chunks/pagination.1XBgTs6T.js.map +0 -1
  174. package/dist/chunks/step.dNTg2rtW.js +0 -217
  175. package/dist/chunks/step.dNTg2rtW.js.map +0 -1
  176. package/dist/chunks/summary-grid.types.CkUIw703.js +0 -301
  177. package/dist/chunks/summary-grid.types.CkUIw703.js.map +0 -1
  178. package/dist/chunks/tabs.Dx6teJGW.js +0 -205
  179. package/dist/chunks/tabs.Dx6teJGW.js.map +0 -1
  180. package/dist/chunks/textarea.BPeDUAPL.js.map +0 -1
  181. package/dist/chunks/timeline-item.CS9ZDOsm.js.map +0 -1
  182. package/dist/chunks/use-cached-selected-values.C1CeSurp.js +0 -1271
  183. package/dist/chunks/use-cached-selected-values.C1CeSurp.js.map +0 -1
@@ -0,0 +1,1320 @@
1
+ import { computed as i, ref as E, onMounted as Ne, onUnmounted as $e, watch as q, defineComponent as w, nextTick as me, toRef as j, useSlots as Me, useAttrs as we } from "vue";
2
+ import { B as W } from "./typography.J1v_SPG3.js";
3
+ import { B as Ge } from "./loading-indicator.z8COalOc.js";
4
+ import { B as Pe } from "./empty-state.mtXfb1BB.js";
5
+ import { u as se } from "./i18n.BQkEbtPM.js";
6
+ import { d as Fe } from "./debounce.DUTu11PS.js";
7
+ import "./index.Cl4_42j5.js";
8
+ import { B as Ye } from "./chip.OV0EWIP3.js";
9
+ import { C as J, N as Ue } from "./minus-small.DJacLGTw.js";
10
+ import { C as ze } from "./checkmark-small.DVDtD4HQ.js";
11
+ import { n as $ } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
12
+ import { C as Ve } from "./chevron-down.eYtgv5ly.js";
13
+ import { C as We } from "./chevron-up.d8cwIlA_.js";
14
+ import { B as N, a as le } from "./keyboard-navigation.pB8weElW.js";
15
+ import { d as Ke, e as be } from "./button-actions._OIvTdKt.js";
16
+ /* empty css */
17
+ import { o as je } from "./resize.Bqks3WUm.js";
18
+ import "../assets/use-cached-selected-values.css";
19
+ const _e = (s, e, l, t) => {
20
+ const n = i(
21
+ () => {
22
+ var f, I;
23
+ return !!((f = s.value) != null && f.length) && ((I = s.value) == null ? void 0 : I.length) === e.value.length;
24
+ }
25
+ ), o = i(() => {
26
+ var f;
27
+ return s.value == null || s.value.length === 0 ? !1 : ((f = s.value) == null ? void 0 : f.length) !== e.value.length;
28
+ });
29
+ return {
30
+ isAllSelected: n,
31
+ isIndeterminate: o,
32
+ toggleSelectAll: (f) => {
33
+ f ? l() : t();
34
+ }
35
+ };
36
+ };
37
+ function qe(s, { disabled: e, itemHeight: l, overscan: t = 5, prefixHeight: n }) {
38
+ const o = E(null), r = E([]), f = E(0), I = E(0), d = E(0);
39
+ let b;
40
+ const O = i(() => {
41
+ const T = typeof l == "number" ? s.value.length * l : s.value.reduce((S, m, y) => S + l(y), 0), A = typeof l == "number" ? f.value * l : s.value.slice(0, f.value).reduce((S, m, y) => S + l(y), 0);
42
+ return {
43
+ style: {
44
+ marginTop: `${A}px`,
45
+ height: `${T - A}px`
46
+ }
47
+ };
48
+ }), p = () => {
49
+ const T = (n == null ? void 0 : n.value) ?? 0, A = Math.max(o.value.scrollTop - T, 0);
50
+ if (typeof l == "number")
51
+ return Math.floor(A / l);
52
+ let S = 0, m = 0;
53
+ for (let y = 0; y < s.value.length; y += 1) {
54
+ const h = l(y);
55
+ if (S += h, S >= A) {
56
+ m = y;
57
+ break;
58
+ }
59
+ }
60
+ return m;
61
+ }, g = () => {
62
+ if (d.value = o.value.clientHeight, typeof l == "number")
63
+ return Math.ceil(d.value / l);
64
+ const T = f.value ?? 0;
65
+ let A = 0, S = 0;
66
+ for (let m = T; m < s.value.length; m += 1) {
67
+ const y = l(m);
68
+ if (A += y, S = m, A > d.value)
69
+ break;
70
+ }
71
+ return S - T;
72
+ }, C = () => {
73
+ if (o.value) {
74
+ const T = g();
75
+ f.value = p(), I.value = Math.min(f.value + T + t, s.value.length), r.value = s.value.slice(f.value, I.value);
76
+ }
77
+ }, D = () => {
78
+ C();
79
+ };
80
+ e || (Ne(() => {
81
+ o.value && (d.value = o.value.clientHeight, b = je(o.value, ({ clientHeight: T }) => {
82
+ d.value = T, C();
83
+ }), C());
84
+ }), $e(() => {
85
+ b == null || b.disconnect();
86
+ }), q(
87
+ () => s.value,
88
+ () => {
89
+ C();
90
+ }
91
+ ));
92
+ const L = {
93
+ ref: o,
94
+ style: { overflowY: "auto" }
95
+ };
96
+ return e ? {
97
+ containerRef: o,
98
+ containerProps: L,
99
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
100
+ onScroll: () => {
101
+ },
102
+ list: s
103
+ } : {
104
+ containerRef: o,
105
+ containerProps: L,
106
+ onScroll: D,
107
+ list: r,
108
+ wrapperProps: O
109
+ };
110
+ }
111
+ var c = /* @__PURE__ */ ((s) => (s.SELECT = "select", s.SHOW_MORE = "show-more", s.ESCAPE = "escape-pressed", s.CLICK = "click", s.ENTER = "enter-pressed", s.SPACE = "space-pressed", s.TAB = "tab-pressed", s.CLOSE_DROPDOWN = "close-dropdown", s))(c || {}), V = /* @__PURE__ */ ((s) => (s.AUTOMATIC = "automatic", s.BUTTON = "button", s.NONE = "none", s))(V || {});
112
+ const He = w({
113
+ name: "bento-listbox-static-category",
114
+ components: {
115
+ BentoTypography: W
116
+ },
117
+ props: {
118
+ /**
119
+ * Category label text
120
+ */
121
+ categoryLabel: {
122
+ type: String,
123
+ required: !0
124
+ }
125
+ }
126
+ });
127
+ var Xe = function() {
128
+ var e = this, l = e._self._c;
129
+ return e._self._setupProxy, l("div", { staticClass: "b-listbox-single-select-category" }, [l("bento-typography", { staticClass: "b-listbox-single-select-category__label-text", attrs: { variant: "caption", el: "span" } }, [e._v(" " + e._s(e.categoryLabel) + " ")]), l("div", [e._t("default")], 2)], 1);
130
+ }, Je = [], Ze = /* @__PURE__ */ $(
131
+ He,
132
+ Xe,
133
+ Je,
134
+ !1,
135
+ null,
136
+ "4aa8cc6e"
137
+ );
138
+ const Qe = Ze.exports, et = w({
139
+ name: "bento-listbox-option",
140
+ props: {
141
+ /**
142
+ * Setting this property to true will disable the option.
143
+ */
144
+ disabled: { type: Boolean, default: !1 },
145
+ /**
146
+ * Indicates if the value is selected. Only one element can be selected at a time.
147
+ */
148
+ selected: { type: Boolean, default: !1 }
149
+ },
150
+ emits: [c.CLICK, c.ENTER, c.SPACE, c.TAB],
151
+ setup(s, { emit: e }) {
152
+ const l = i(() => ({
153
+ "b-listbox-option--disabled": s.disabled,
154
+ "b-listbox-option--selected": s.selected
155
+ }));
156
+ return {
157
+ // Enums
158
+ BentoKeyboardNavigationKeyDownEvent: N,
159
+ BentoListboxEvent: c,
160
+ // Values
161
+ conditionalClasses: l,
162
+ // Events
163
+ onClick: (o) => {
164
+ e(c.CLICK, o);
165
+ },
166
+ onOptionSelected: (o, r) => {
167
+ e(o, r);
168
+ }
169
+ };
170
+ }
171
+ });
172
+ var tt = function() {
173
+ var e = this, l = e._self._c;
174
+ return e._self._setupProxy, l("div", e._b({ staticClass: "b-listbox-option", class: e.conditionalClasses, attrs: { role: "option" }, on: { click: e.onClick, keydown: [function(t) {
175
+ return !t.type.indexOf("key") && e._k(t.keyCode, "enter", 13, t.key, "Enter") ? null : e.onOptionSelected(e.BentoListboxEvent.ENTER, t);
176
+ }, function(t) {
177
+ return !t.type.indexOf("key") && e._k(t.keyCode, "space", 32, t.key, [" ", "Spacebar"]) ? null : e.onOptionSelected(e.BentoListboxEvent.SPACE, t);
178
+ }, function(t) {
179
+ return !t.type.indexOf("key") && e._k(t.keyCode, "tab", 9, t.key, "Tab") ? null : e.onOptionSelected(e.BentoListboxEvent.TAB, t);
180
+ }] } }, "div", e.$attrs, !1), [e._t("default")], 2);
181
+ }, st = [], lt = /* @__PURE__ */ $(
182
+ et,
183
+ tt,
184
+ st,
185
+ !1,
186
+ null,
187
+ "a1e9ebff"
188
+ );
189
+ const Z = lt.exports;
190
+ let fe = 0;
191
+ const nt = {
192
+ beforeCreate() {
193
+ this.uuid = fe.toString(), fe += 1;
194
+ }
195
+ };
196
+ var ot = function() {
197
+ var e = this, l = e._self._c;
198
+ return l("svg", e._b({ staticClass: "ui-assets-icons-16", attrs: { role: "img", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none" } }, "svg", e.$attrs, !1), [e.$attrs["svg-title"] ? l("title", [e._v(e._s(e.$attrs["svg-title"]))]) : e._e(), l("path", { attrs: { fill: "#001222", d: "M15.0608 4.00011L14.0001 2.93945L6.00011 10.9395L2.00011 6.93945L0.939453 8.00011L6.00011 13.0608L15.0608 4.00011Z" } })]);
199
+ }, it = [], at = /* @__PURE__ */ $(
200
+ nt,
201
+ ot,
202
+ it,
203
+ !1,
204
+ null,
205
+ null
206
+ );
207
+ const ct = at.exports, rt = w({
208
+ name: "bento-listbox-single-select-option",
209
+ components: {
210
+ BentoListboxOption: Z,
211
+ BentoTypography: W,
212
+ CheckmarkIcon: ct
213
+ },
214
+ props: {
215
+ /**
216
+ * Setting this property to true will disable the option.
217
+ */
218
+ disabled: { type: Boolean, default: !1 },
219
+ /**
220
+ * The option item that contains all the option item's data.
221
+ * @type {BentoListboxOptionItem}
222
+ */
223
+ option: {
224
+ type: Object,
225
+ required: !0
226
+ },
227
+ /**
228
+ * Indicates if the value is selected. Only one element can be selected at a time.
229
+ */
230
+ selected: { type: Boolean, default: !1 }
231
+ },
232
+ emits: [c.ENTER, c.SELECT, c.SPACE, c.TAB],
233
+ setup(s, { emit: e }) {
234
+ const l = (r) => {
235
+ s.disabled || e(r, s.option);
236
+ }, t = i(() => s.disabled ? !0 : null), n = i(() => s.selected ? !0 : null), o = i(() => s.disabled ? -1 : 0);
237
+ return {
238
+ // Values
239
+ ariaDisabled: t,
240
+ ariaSelected: n,
241
+ tabIndex: o,
242
+ // Enums
243
+ BentoListboxEvent: c,
244
+ // Events
245
+ onOptionSelected: l
246
+ };
247
+ }
248
+ });
249
+ var ut = function() {
250
+ var e = this, l = e._self._c;
251
+ return e._self._setupProxy, l("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: { click: function(t) {
252
+ return e.onOptionSelected(e.BentoListboxEvent.SELECT);
253
+ }, "enter-pressed": function(t) {
254
+ return e.onOptionSelected(e.BentoListboxEvent.ENTER);
255
+ }, "space-pressed": function(t) {
256
+ return t.preventDefault(), e.onOptionSelected(e.BentoListboxEvent.SPACE);
257
+ }, "tab-pressed": function(t) {
258
+ return e.onOptionSelected(e.BentoListboxEvent.TAB);
259
+ } } }, [e._t("default", function() {
260
+ return [l("span", { staticClass: "b-listbox-single-select-option__text" }, [l("bento-typography", { attrs: { el: "span" } }, [e._v(e._s(e.option.label))]), e.option.description ? l("bento-typography", { staticClass: "b-listbox-single-select-option__description", attrs: { el: "span" } }, [e._v(" " + e._s(e.option.description) + " ")]) : e._e()], 1)];
261
+ }, null, e.option), l("span", { staticClass: "b-listbox-single-select-option__check-icon" }, [l("checkmark-icon", { directives: [{ name: "show", rawName: "v-show", value: e.selected, expression: "selected" }], attrs: { "svg-title": "selected" } })], 1)], 2);
262
+ }, dt = [], bt = /* @__PURE__ */ $(
263
+ rt,
264
+ ut,
265
+ dt,
266
+ !1,
267
+ null,
268
+ "5a5ff36a"
269
+ );
270
+ const ft = bt.exports, pe = ({ items: s }, e) => {
271
+ const l = i(() => s.value.length - 1), t = E(0), n = (p) => {
272
+ switch (p) {
273
+ case "increase":
274
+ t.value += 1;
275
+ break;
276
+ case "decrease":
277
+ t.value -= 1;
278
+ break;
279
+ }
280
+ }, o = ({ edgeCaseItem: p }, g) => {
281
+ t.value !== p && (n(g), e(t.value));
282
+ }, r = (p) => {
283
+ O(p), o(
284
+ {
285
+ edgeCaseItem: l.value
286
+ },
287
+ "increase"
288
+ /* INCREASE */
289
+ );
290
+ }, f = (p) => {
291
+ O(p), o(
292
+ {
293
+ edgeCaseItem: 0
294
+ },
295
+ "decrease"
296
+ /* DECREASE */
297
+ );
298
+ }, I = () => {
299
+ t.value = 0, e(t.value);
300
+ }, d = () => {
301
+ t.value = l.value, e(t.value);
302
+ }, b = (p) => {
303
+ t.value = p;
304
+ }, O = (p) => {
305
+ var g;
306
+ (g = p == null ? void 0 : p.detail) == null || g.preventDefault();
307
+ };
308
+ return {
309
+ moveToFirstElement: I,
310
+ moveToLastElement: d,
311
+ moveToNextElement: r,
312
+ moveToPreviousElement: f,
313
+ setListboxFocusedIndex: b,
314
+ preventDefault: O,
315
+ focusedIndex: t
316
+ };
317
+ }, ge = (s, e, l = E("option"), t = !0) => {
318
+ const n = E([]), o = async () => {
319
+ if (!s.value || s.value.nodeType === Node.COMMENT_NODE)
320
+ return;
321
+ const r = Array.from(s.value.querySelectorAll(`[role="${l.value}"]`));
322
+ n.value = t ? r.filter((f) => f.checkVisibility()) : r;
323
+ };
324
+ return q(
325
+ e,
326
+ () => {
327
+ me(() => {
328
+ o();
329
+ });
330
+ },
331
+ { immediate: !0 }
332
+ ), {
333
+ visibleDomOptions: n,
334
+ updateVisibleDomOptions: o
335
+ };
336
+ }, vt = w({
337
+ name: "bento-listbox-single-select",
338
+ components: {
339
+ BentoListboxSingleSelectCategory: Qe,
340
+ BentoListboxSingleSelectOption: ft
341
+ },
342
+ directives: { BentoKeyboardNavigationDirective: le },
343
+ inheritAttrs: !1,
344
+ props: {
345
+ /**
346
+ * Function that allows the options to be disabled
347
+ *
348
+ * @type {BentoListboxIsOptionDisabled}
349
+ * @param {BentoListboxOptionItem} option - listbox option object
350
+ * @param {string} option.label - Option's label text
351
+ * @param {string|number} option.value - Option's value
352
+ * @param {unknown} option.data - Option's extra data to be passed to the default slot
353
+ */
354
+ isOptionDisabled: {
355
+ type: Function,
356
+ default: () => !1
357
+ },
358
+ /**
359
+ * The option elements to populate the listbox with.
360
+ * It must be an array of {@see BentoListboxOptionItem }.
361
+ *
362
+ * @property {string} value.label - Text to be displayed in the option
363
+ * @property {string,number} value.value - Value of the option
364
+ */
365
+ items: {
366
+ type: Array,
367
+ required: !0
368
+ },
369
+ /**
370
+ * The `input` value.
371
+ * Providing an empty string will select no options.
372
+ * Set to an empty string `''` if you don't want any of the available options to be selected
373
+ */
374
+ selectedValue: {
375
+ type: Array,
376
+ default: void 0
377
+ },
378
+ /**
379
+ * If enabled, dropdown will display non-selectable, static categories
380
+ */
381
+ staticCategories: { type: Boolean, default: !1 }
382
+ },
383
+ emits: [c.SELECT, c.ENTER, c.SPACE, c.TAB],
384
+ setup(s, { emit: e, expose: l, slots: t, attrs: n }) {
385
+ const o = E(null), r = E([]), f = i(() => {
386
+ var m;
387
+ return !!((m = s.selectedValue) != null && m.length) && s.selectedValue.at(0);
388
+ }), I = i(
389
+ () => {
390
+ var m, y, h, k;
391
+ return {
392
+ "aria-label": (m = n["aria-label"]) == null ? void 0 : m.toString(),
393
+ "aria-busy": (y = n["aria-busy"]) == null ? void 0 : y.toString(),
394
+ "aria-atomic": (h = n["aria-atomic"]) == null ? void 0 : h.toString(),
395
+ "aria-live": (k = n["aria-live"]) == null ? void 0 : k.toString()
396
+ };
397
+ }
398
+ ), d = i(() => !!s.items.some(({ items: m }) => !!m)), b = (m) => (y) => {
399
+ e(m, [y]);
400
+ }, { visibleDomOptions: O } = ge(o, j(s, "items"), E("option"), !1), p = (m) => {
401
+ var y;
402
+ (y = O.value[m]) == null || y.focus();
403
+ }, {
404
+ moveToNextElement: g,
405
+ moveToPreviousElement: C,
406
+ moveToFirstElement: D,
407
+ moveToLastElement: L,
408
+ setListboxFocusedIndex: T
409
+ } = pe(
410
+ {
411
+ items: O
412
+ },
413
+ p
414
+ ), A = {
415
+ [N.ARROW_UP]: C,
416
+ [N.ARROW_DOWN]: g,
417
+ [N.HOME]: D,
418
+ [N.END]: L
419
+ }, S = {
420
+ [c.SELECT]: b(c.SELECT),
421
+ [c.SPACE]: b(c.SPACE),
422
+ [c.TAB]: b(c.TAB),
423
+ [c.ENTER]: b(c.ENTER)
424
+ };
425
+ return l({
426
+ /**
427
+ * Reference for a single listbox item.
428
+ * Required for keyboard navigation in dropdown as $children is removed in vue@3
429
+ */
430
+ listboxItemRef: r,
431
+ /**
432
+ * Method to set the index of the item to be focused on
433
+ * Used for focus management to be kept in-sync with parent e.g. dropdowns
434
+ */
435
+ setListboxFocusedIndex: T
436
+ }), {
437
+ // Enums
438
+ BentoListboxEvent: c,
439
+ // Values
440
+ listboxRef: o,
441
+ listboxItemRef: r,
442
+ selectedItem: f,
443
+ slots: t,
444
+ ariaAttributes: I,
445
+ // Computed
446
+ hasCategories: d,
447
+ // Methods
448
+ onOptionSelected: b,
449
+ // Keyboard navigation
450
+ listboxListeners: A,
451
+ listboxOptionListeners: S
452
+ };
453
+ }
454
+ });
455
+ var mt = function() {
456
+ var e = this, l = e._self._c;
457
+ return e._self._setupProxy, l("div", e._g(e._b({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], ref: "listboxRef", attrs: { role: "listbox" } }, "div", e.ariaAttributes, !1), e.listboxListeners), [e.hasCategories && e.staticCategories ? e._l(e.items, function(t) {
458
+ return l("bento-listbox-single-select-category", { key: t.value, attrs: { "category-label": t.label, role: "group" } }, e._l(t.items, function(n) {
459
+ return l("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, r) {
460
+ return { key: r, fn: function(f) {
461
+ return [e._t(r, null, null, f)];
462
+ } };
463
+ })], null, !0) }, e.listboxOptionListeners));
464
+ }), 1);
465
+ }) : e._l(e.items, function(t) {
466
+ return l("bento-listbox-single-select-option", e._g({ key: t.value, ref: "listboxItemRef", refInFor: !0, attrs: { role: "option", option: t, disabled: e.isOptionDisabled ? e.isOptionDisabled(t) : null, selected: t.value === e.selectedItem.value }, scopedSlots: e._u([e._l(e.slots, function(n, o) {
467
+ return { key: o, fn: function(r) {
468
+ return [e._t(o, null, null, r)];
469
+ } };
470
+ })], null, !0) }, e.listboxOptionListeners));
471
+ })], 2);
472
+ }, _t = [], pt = /* @__PURE__ */ $(
473
+ vt,
474
+ mt,
475
+ _t,
476
+ !1,
477
+ null,
478
+ null
479
+ );
480
+ const gt = pt.exports, yt = {}, xt = /* @__PURE__ */ w({
481
+ ...yt,
482
+ __name: "listbox-decorative-checkbox",
483
+ props: {
484
+ disabled: { type: Boolean, default: !1 },
485
+ indeterminate: { type: Boolean, default: !1 },
486
+ checked: { type: Boolean, default: !1 }
487
+ },
488
+ setup(s) {
489
+ const e = s, l = i(() => ({
490
+ [`b-checkbox-input--${J.DISABLED}`]: e.disabled
491
+ })), t = i(() => ({
492
+ [`b-checkbox-input__outline--${J.UNCHECKED}`]: !e.checked && !e.indeterminate,
493
+ [`b-checkbox-input__outline--${J.CHECKED}`]: e.checked && !e.indeterminate,
494
+ [`b-checkbox-input__outline--${J.INDETERMINATE}`]: e.indeterminate
495
+ }));
496
+ return { __sfc: !0, props: e, conditionalClasses: l, outlineConditionalClasses: t, CheckmarkSmallIcon: ze, MinusSmallIcon: Ue };
497
+ }
498
+ });
499
+ var ht = function() {
500
+ var e = this, l = e._self._c, t = e._self._setupProxy;
501
+ return l("div", { staticClass: "b-checkbox-input", class: t.conditionalClasses, attrs: { role: "presentation" } }, [e.indeterminate ? l(t.MinusSmallIcon, { staticClass: "b-checkbox-input__icon", attrs: { "svg-title": "", "aria-hidden": "true" } }) : e.checked ? l(t.CheckmarkSmallIcon, { staticClass: "b-checkbox-input__icon", attrs: { "svg-title": "", "aria-hidden": "true" } }) : e._e(), l("div", { staticClass: "b-checkbox-input__outline", class: t.outlineConditionalClasses })], 1);
502
+ }, Ct = [], St = /* @__PURE__ */ $(
503
+ xt,
504
+ ht,
505
+ Ct,
506
+ !1,
507
+ null,
508
+ "5dc60f05"
509
+ );
510
+ const ne = St.exports;
511
+ var ye = /* @__PURE__ */ ((s) => (s.DISABLED = "disabled", s.STATIC_CATEGORY = "static-category", s))(ye || {}), Y = /* @__PURE__ */ ((s) => (s.SELECT_CATEGORY = "select-category", s.UNSELECT_CATEGORY = "unselect-category", s.TOGGLE_CATEGORY_VISIBILITY = "toggle-category-visibility", s))(Y || {});
512
+ const Et = {
513
+ "en-US": {
514
+ categoryClosed: "{category} closed",
515
+ categoryOpened: "{category} opened"
516
+ }
517
+ }, Ot = w({
518
+ i18n: { messages: Et },
519
+ name: "bento-listbox-multi-select-category",
520
+ components: {
521
+ BentoTypography: W,
522
+ BentoListboxOption: Z,
523
+ ChevronDownIcon: Ve,
524
+ ChevronUpIcon: We,
525
+ ListboxDecorativeCheckbox: ne
526
+ },
527
+ props: {
528
+ /**
529
+ * The option elements to populate the listbox with.
530
+ * It must be an array of {@see BentoListboxOptionItem }.
531
+ *
532
+ * @property {string} value.label - Text to be displayed in the option
533
+ * @property {string,number} value.value - Value of the option
534
+ * @property {BentoListboxOptionItem} value.items - Category items list
535
+ */
536
+ category: {
537
+ type: Object,
538
+ required: !0
539
+ },
540
+ /**
541
+ * Function that allows the options to be disabled
542
+ *
543
+ * @type {BentoListboxIsOptionDisabled}
544
+ * @param {BentoListboxOptionItem} option - listbox option object
545
+ * @param {string} option.label - Option's label text
546
+ * @param {string|number} option.value - Option's value
547
+ * @param {unknown} option.data - Option's extra data to be passed to the default slot
548
+ */
549
+ isOptionDisabled: {
550
+ type: [Function],
551
+ default: () => !1
552
+ },
553
+ /**
554
+ * The `input` value.
555
+ * Providing an empty array will select no options.
556
+ */
557
+ selectedItemsList: {
558
+ type: Array,
559
+ default: () => []
560
+ },
561
+ /**
562
+ * If enabled, dropdown will display non-selectable, static categories
563
+ */
564
+ staticCategories: { type: Boolean, default: !1 },
565
+ /**
566
+ * Category's tabindex
567
+ */
568
+ tabindex: { type: Number, default: -1 }
569
+ },
570
+ emits: [
571
+ Y.SELECT_CATEGORY,
572
+ Y.UNSELECT_CATEGORY,
573
+ Y.TOGGLE_CATEGORY_VISIBILITY
574
+ ],
575
+ setup(s, { emit: e }) {
576
+ const l = E(!1), { t } = se(), n = (h) => s.isOptionDisabled ? s.isOptionDisabled(h) : !1, o = i(
577
+ () => s.category.items.every((h) => n(h))
578
+ ), r = j(s, "staticCategories"), f = i(() => l.value || s.staticCategories), I = i(() => ({
579
+ [`b-listbox-multi-select-category--${ye.DISABLED}`]: o.value
580
+ })), d = (h, k) => {
581
+ h.preventDefault(), l.value = k !== void 0 ? k : !l.value, e(Y.TOGGLE_CATEGORY_VISIBILITY, s.category.value);
582
+ }, b = (h) => {
583
+ var G;
584
+ const k = n(h), B = ((G = s.selectedItemsList) == null ? void 0 : G.includes(h.value)) || !1;
585
+ return { isDisabled: k, isPreSelected: B };
586
+ }, O = i(
587
+ () => s.category.items.filter((h) => {
588
+ const { isDisabled: k, isPreSelected: B } = b(h);
589
+ return k && B || !k;
590
+ })
591
+ ), p = i(
592
+ () => {
593
+ var h;
594
+ return (h = O.value) == null ? void 0 : h.filter(
595
+ ({ value: k }) => {
596
+ var B;
597
+ return (B = s.selectedItemsList) == null ? void 0 : B.includes(k);
598
+ }
599
+ );
600
+ }
601
+ ), g = i(() => {
602
+ const h = l.value ? "categoryOpened" : "categoryClosed";
603
+ return t(h, { category: s.category.label });
604
+ }), C = () => {
605
+ e(Y.SELECT_CATEGORY);
606
+ }, D = () => {
607
+ e(Y.UNSELECT_CATEGORY);
608
+ }, { isAllSelected: L, isIndeterminate: T, toggleSelectAll: A } = _e(
609
+ p,
610
+ O,
611
+ C,
612
+ D
613
+ ), S = i(() => T.value ? "mixed" : `${L.value}`), m = E(L.value), y = () => {
614
+ m.value = !m.value, A(m.value);
615
+ };
616
+ return q(L, () => {
617
+ m.value = L.value;
618
+ }), {
619
+ // Values
620
+ chevronTitle: g,
621
+ conditionalClass: I,
622
+ hasAllPropsDisabled: o,
623
+ isOpen: l,
624
+ isAllSelected: L,
625
+ isIndeterminate: T,
626
+ isStaticCategory: r,
627
+ // Computed
628
+ showItemChildren: f,
629
+ ariaCheckedComputed: S,
630
+ // Methods
631
+ handleSelectAll: y,
632
+ toggleOpen: d,
633
+ toggleSelectAll: A
634
+ };
635
+ }
636
+ });
637
+ var Tt = function() {
638
+ var e = this, l = e._self._c;
639
+ return e._self._setupProxy, l("div", [e.isStaticCategory ? l("div", { staticClass: "b-listbox-multi-select-category b-listbox-multi-select-category--static-category" }, [l("span", { staticClass: "b-listbox-multi-select-category__label" }, [l("bento-typography", { staticClass: "b-listbox-multi-select-category__label-text", attrs: { el: "span", variant: "caption" } }, [e._v(" " + e._s(e.category.label) + " ")])], 1)]) : l("bento-listbox-option", { staticClass: "b-listbox-multi-select-category__option", class: e.conditionalClass, attrs: { tabindex: e.tabindex, "aria-checked": e.ariaCheckedComputed, "aria-disabled": e.hasAllPropsDisabled, "aria-expanded": e.isOpen, role: "treeitem" }, on: { click: e.handleSelectAll, "enter-pressed": e.handleSelectAll, "space-pressed": function(t) {
640
+ return t.preventDefault(), e.handleSelectAll.apply(null, arguments);
641
+ } }, nativeOn: { keydown: [function(t) {
642
+ return !t.type.indexOf("key") && e._k(t.keyCode, "arrow-left", void 0, t.key, void 0) ? null : e.toggleOpen(t, !1);
643
+ }, function(t) {
644
+ return !t.type.indexOf("key") && e._k(t.keyCode, "arrow-right", void 0, t.key, void 0) ? null : e.toggleOpen(t, !0);
645
+ }] } }, [l("listbox-decorative-checkbox", { attrs: { indeterminate: e.isIndeterminate, disabled: e.hasAllPropsDisabled, checked: e.isAllSelected } }), l("span", { staticClass: "b-listbox-multi-select-category__label" }, [l("bento-typography", { staticClass: "b-listbox-multi-select-category__label-text", attrs: { el: "span" } }, [e._v(" " + e._s(e.category.label) + " ")]), l("div", { staticClass: "b-listbox-multi-select-category__label-chevron", attrs: { "data-testid": "toggle-listbox" }, on: { "!click": function(t) {
646
+ return t.stopPropagation(), e.toggleOpen.apply(null, arguments);
647
+ } } }, [e.isOpen ? l("chevron-up-icon", { attrs: { "svg-title": e.chevronTitle } }) : l("chevron-down-icon", { attrs: { "svg-title": e.chevronTitle } })], 1)], 1)], 1), l("div", { directives: [{ name: "show", rawName: "v-show", value: e.showItemChildren, expression: "showItemChildren" }] }, [e._t("default")], 2)], 1);
648
+ }, It = [], At = /* @__PURE__ */ $(
649
+ Ot,
650
+ Tt,
651
+ It,
652
+ !1,
653
+ null,
654
+ "e1e7494c"
655
+ );
656
+ const Lt = At.exports;
657
+ var M = /* @__PURE__ */ ((s) => (s.SELECT_CATEGORY = "select-category", s.TOGGLE_CHECKBOX_SELECTION = "toggle-checkbox-selection", s.UNSELECT_CATEGORY = "unselect-category", s.TOGGLE_CATEGORY_VISIBILITY = "toggle-category-visibility", s))(M || {});
658
+ const kt = w({
659
+ name: "listbox-multi-select-options",
660
+ components: {
661
+ BentoListboxOption: Z,
662
+ BentoTypography: W,
663
+ ListboxMultiSelectCategory: Lt,
664
+ ListboxDecorativeCheckbox: ne
665
+ },
666
+ inheritAttrs: !1,
667
+ props: {
668
+ /**
669
+ * Indicates if the items listed are inside a category
670
+ * so they can be padded to right by one level in recursion.
671
+ * Items of categories are automatically defined as "categoryItems"
672
+ */
673
+ categoryItems: { type: Boolean, default: !1 },
674
+ /**
675
+ * Current focused option index
676
+ */
677
+ focusedIndex: { type: Number, default: 0 },
678
+ /**
679
+ * Function that allows the options to be disabled
680
+ *
681
+ * @type {BentoListboxIsOptionDisabled}
682
+ * @param {BentoListboxOptionItem} option - listbox option object
683
+ * @param {string} option.label - Option's label text
684
+ * @param {string|number} option.value - Option's value
685
+ * @param {unknown} option.data - Option's extra data to be passed to the default slot
686
+ */
687
+ isOptionDisabled: {
688
+ type: Function,
689
+ default: () => !1
690
+ },
691
+ /**
692
+ * The option elements to populate the listbox with.
693
+ * It must be an array of {@see BentoListboxOptionItem }.
694
+ *
695
+ * @property {string} value.label - Text to be displayed in the option
696
+ * @property {string,number} value.value - Value of the option
697
+ */
698
+ items: {
699
+ type: Array,
700
+ required: !0
701
+ },
702
+ /**
703
+ * Indicates if the elements options are inside a multi-level category
704
+ */
705
+ isMultiLevel: { type: Boolean, default: !1 },
706
+ /**
707
+ * Flag that indicates that an external search it's being made
708
+ * to filter out the items inside the the multi-select listbox
709
+ *
710
+ * If enabled, hides the "Select all" checkbox in "multiple" mode.
711
+ */
712
+ searching: { type: Boolean, default: !1 },
713
+ /**
714
+ * List of selected items.
715
+ * Providing an empty array will select no options.
716
+ */
717
+ selectedItemsList: {
718
+ type: Array,
719
+ default: () => []
720
+ },
721
+ /**
722
+ * If enabled, dropdown will display non-selectable, static categories
723
+ */
724
+ staticCategories: { type: Boolean, default: !1 },
725
+ /**
726
+ * Object with the index of each item.
727
+ */
728
+ itemsIndex: {
729
+ type: Object,
730
+ default: () => ({})
731
+ }
732
+ },
733
+ emits: [
734
+ M.TOGGLE_CHECKBOX_SELECTION,
735
+ M.SELECT_CATEGORY,
736
+ M.UNSELECT_CATEGORY,
737
+ M.TOGGLE_CATEGORY_VISIBILITY
738
+ ],
739
+ setup(s, { emit: e }) {
740
+ const l = (d) => {
741
+ s.isOptionDisabled(d) || e(M.TOGGLE_CHECKBOX_SELECTION, d);
742
+ }, t = (d) => !!d.items, n = (d) => {
743
+ const b = s.isMultiLevel && s.searching;
744
+ return d.description && (!s.isMultiLevel || b);
745
+ }, o = (d) => d.items ? !!d.items.find((b) => s.selectedItemsList.includes(b.value)) : s.selectedItemsList.includes(d.value), r = (d) => {
746
+ if (t(d)) {
747
+ const b = o(d) ? M.UNSELECT_CATEGORY : M.SELECT_CATEGORY;
748
+ e(b, d);
749
+ } else
750
+ l(d);
751
+ };
752
+ return {
753
+ // Values
754
+ conditionalClasses: i(() => ({
755
+ "b-listbox-multi-select-options__static-category-option": s.staticCategories,
756
+ "b-listbox-multi-select-options__category-option": s.categoryItems
757
+ })),
758
+ // Methods
759
+ isOptionSelected: o,
760
+ shouldShowDescription: n,
761
+ toggleCheckboxSelection: l,
762
+ toggleSearchOption: r,
763
+ computedTabindex: (d) => s.itemsIndex[d] === s.focusedIndex ? 0 : -1,
764
+ // Enums
765
+ BentoListboxEvent: c,
766
+ ListboxMultiSelectOptionsEvent: M
767
+ };
768
+ }
769
+ });
770
+ var Rt = function() {
771
+ var e = this, l = e._self._c;
772
+ return e._self._setupProxy, l("div", e._l(e.items, function(t) {
773
+ return l("div", { key: `selected-${t.value}` }, [e.searching && e.isMultiLevel ? [l("bento-listbox-option", { staticClass: "b-listbox-multi-select-options", class: e.conditionalClasses, attrs: { disabled: e.isOptionDisabled ? e.isOptionDisabled(t) : null, tabindex: e.computedTabindex(t.value), "aria-checked": `${e.isOptionSelected(t)}`, "aria-disabled": e.isOptionDisabled ? e.isOptionDisabled(t) : null, role: e.$attrs.role }, on: { click: function(n) {
774
+ return e.toggleSearchOption(t);
775
+ }, "enter-pressed": function(n) {
776
+ return e.toggleSearchOption(t);
777
+ }, "space-pressed": function(n) {
778
+ return n.preventDefault(), e.toggleSearchOption(t);
779
+ } } }, [l("listbox-decorative-checkbox", { attrs: { disabled: e.isOptionDisabled ? e.isOptionDisabled(t) : null, checked: e.isOptionSelected(t) } }), e._t("default", function() {
780
+ return [l("span", { staticClass: "b-listbox-multi-select__option-text" }, [l("bento-typography", { attrs: { el: "span" } }, [e._v(e._s(t.label))]), e.shouldShowDescription(t) ? l("bento-typography", { staticClass: "b-listbox-multi-select__option-description", attrs: { el: "span" } }, [e._v(" " + e._s(t.description) + " ")]) : e._e()], 1)];
781
+ }, null, t)], 2)] : [t.items ? [l("listbox-multi-select-category", { attrs: { category: t, "static-categories": e.staticCategories, "is-option-disabled": e.isOptionDisabled, "selected-items-list": e.selectedItemsList, tabindex: e.computedTabindex(t.value) }, on: { "select-category": function(n) {
782
+ return e.$emit(e.ListboxMultiSelectOptionsEvent.SELECT_CATEGORY, t);
783
+ }, "unselect-category": function(n) {
784
+ return e.$emit(e.ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY, t);
785
+ }, "toggle-category-visibility": function(n) {
786
+ return e.$emit(e.ListboxMultiSelectOptionsEvent.TOGGLE_CATEGORY_VISIBILITY, n);
787
+ } } }, [l("listbox-multi-select-options", { attrs: { "category-items": "", items: t.items, "is-option-disabled": e.isOptionDisabled, "items-index": e.itemsIndex, "focused-index": e.focusedIndex, "is-multi-level": e.isMultiLevel, "static-categories": e.staticCategories, "selected-items-list": e.selectedItemsList, searching: e.searching, role: e.$attrs.role }, on: { "toggle-checkbox-selection": (n) => e.toggleCheckboxSelection(n) } })], 1)] : l("bento-listbox-option", { staticClass: "b-listbox-multi-select-options", class: e.conditionalClasses, attrs: { disabled: e.isOptionDisabled ? e.isOptionDisabled(t) : null, tabindex: e.computedTabindex(t.value), "aria-checked": `${e.isOptionSelected(t)}`, "aria-disabled": e.isOptionDisabled ? e.isOptionDisabled(t) : null, role: e.$attrs.role }, on: { click: function(n) {
788
+ return e.toggleCheckboxSelection(t);
789
+ }, "enter-pressed": function(n) {
790
+ return e.toggleCheckboxSelection(t);
791
+ }, "space-pressed": function(n) {
792
+ return n.preventDefault(), e.toggleCheckboxSelection(t);
793
+ } } }, [l("listbox-decorative-checkbox", { attrs: { disabled: e.isOptionDisabled ? e.isOptionDisabled(t) : null, checked: e.isOptionSelected(t) } }), e._t("default", function() {
794
+ return [l("span", { staticClass: "b-listbox-multi-select__option-text" }, [l("bento-typography", { attrs: { el: "span" } }, [e._v(e._s(t.label))]), e.shouldShowDescription(t) ? l("bento-typography", { staticClass: "b-listbox-multi-select__option-description", attrs: { el: "span" } }, [e._v(" " + e._s(t.description) + " ")]) : e._e()], 1)];
795
+ }, null, t)], 2)]], 2);
796
+ }), 0);
797
+ }, Dt = [], Bt = /* @__PURE__ */ $(
798
+ kt,
799
+ Rt,
800
+ Dt,
801
+ !1,
802
+ null,
803
+ "4c869a48"
804
+ );
805
+ const Nt = Bt.exports, $t = (s) => {
806
+ const e = i(() => {
807
+ var t;
808
+ return !!((t = s.value) != null && t.find(({ items: n }) => !!n));
809
+ }), l = i(() => {
810
+ var t;
811
+ return e.value ? (t = s.value) == null ? void 0 : t.reduce((n, o) => (o.items ? n.push(...o.items.flat()) : n.push(o), n), []) : s.value;
812
+ });
813
+ return {
814
+ isMultiLevelSelect: e,
815
+ flattenedItemsList: l
816
+ };
817
+ }, Mt = {
818
+ "en-US": {
819
+ allSelected: "All selected ({total})",
820
+ numberOfTotalSelected: "{number} of {total} selected",
821
+ numbersSelected: "{number} selected",
822
+ selectAll: "Select all ({total})"
823
+ },
824
+ "ja-JP": {
825
+ allSelected: "すべて選択済み ({total})",
826
+ numberOfTotalSelected: "{total}件中{number}件を選択済み",
827
+ numbersSelected: "{number}件を選択済み",
828
+ selectAll: "すべて選択 ({total})"
829
+ },
830
+ "pt-BR": {
831
+ allSelected: "Todos selecionados ({total})",
832
+ numberOfTotalSelected: "{number} de {total} selecionados",
833
+ numbersSelected: "{number} selecionados",
834
+ selectAll: "Selecionar todos ({total})"
835
+ }
836
+ }, wt = { i18n: { messages: Mt } }, Gt = /* @__PURE__ */ w({
837
+ ...wt,
838
+ __name: "listbox-multi-select",
839
+ props: {
840
+ hasMoreItems: { type: Boolean, default: !1 },
841
+ isOptionDisabled: { default: () => () => !1 },
842
+ items: null,
843
+ lazyLoadType: { default: "none" },
844
+ searching: { type: Boolean, default: !1 },
845
+ selectedValues: null,
846
+ staticCategories: { type: Boolean, default: !1 }
847
+ },
848
+ emits: ["select"],
849
+ setup(s, { expose: e, emit: l }) {
850
+ const t = s, { t: n, n: o } = se(), r = Me(), f = we(), I = i(
851
+ () => {
852
+ var a, u, v, x;
853
+ return {
854
+ "aria-label": (a = f["aria-label"]) == null ? void 0 : a.toString(),
855
+ "aria-busy": (u = f["aria-busy"]) == null ? void 0 : u.toString(),
856
+ "aria-atomic": (v = f["aria-atomic"]) == null ? void 0 : v.toString(),
857
+ "aria-live": (x = f["aria-live"]) == null ? void 0 : x.toString(),
858
+ "aria-multiselectable": !0
859
+ };
860
+ }
861
+ ), d = E(null), b = E(null), O = E(null), p = E(null), g = i(() => t.selectedValues.map(({ value: a }) => a)), { isMultiLevelSelect: C, flattenedItemsList: D } = $t(j(t, "items")), L = i(() => C.value && !t.staticCategories), T = i(() => L.value ? "tree" : "listbox"), A = i(() => L.value ? "treeitem" : "option"), S = (a) => {
862
+ var x;
863
+ const u = t.isOptionDisabled(a), v = ((x = g.value) == null ? void 0 : x.includes(a.value)) || !1;
864
+ return { isDisabled: u, isPreSelected: v };
865
+ }, m = i(() => {
866
+ if (t.searching && C)
867
+ return t.items;
868
+ const a = D.value.filter((u) => {
869
+ const { isDisabled: v, isPreSelected: x } = S(u);
870
+ return v && x || !v;
871
+ });
872
+ return t.selectedValues.forEach((u) => {
873
+ a.find((v) => v.value === u.value) || a.push(u);
874
+ }), a;
875
+ }), y = i(
876
+ () => {
877
+ var a;
878
+ return (a = m.value) == null ? void 0 : a.filter((u) => {
879
+ var v;
880
+ return u.items && C.value && t.searching ? u.items.filter(
881
+ (_) => (t.selectedValues ?? []).includes(_.value)
882
+ ).length === u.items.length : (v = g.value) == null ? void 0 : v.includes(u.value);
883
+ });
884
+ }
885
+ ), h = () => C.value && !t.searching ? D.value.length : t.items.length, k = i(() => {
886
+ var x;
887
+ const a = m.value.length, u = h(), v = ((x = y.value) == null ? void 0 : x.length) || 0;
888
+ return v === 0 ? n("selectAll", { total: o(a) }) : v === u ? n("allSelected", { total: o(u) }) : v <= u ? n("numberOfTotalSelected", { number: o(v), total: o(u) }) : n("numbersSelected", { number: o(v) });
889
+ }), B = (a) => {
890
+ const u = (x) => {
891
+ const { isDisabled: _, isPreSelected: P } = S(x);
892
+ return _ && P || !_;
893
+ }, v = a.filter(u).filter((x) => !g.value.includes(x.value));
894
+ l("select", [...t.selectedValues, ...v]);
895
+ }, G = (a) => {
896
+ const u = (_) => {
897
+ const { isDisabled: P, isPreSelected: Be } = S(_);
898
+ return !(P && Be);
899
+ }, v = a.filter(u).map(({ value: _ }) => _), x = t.selectedValues.filter((_) => !(v != null && v.includes(_.value)));
900
+ l("select", x);
901
+ }, H = () => {
902
+ B(D.value);
903
+ }, X = () => {
904
+ G(D.value);
905
+ }, { isAllSelected: F, isIndeterminate: R, toggleSelectAll: U } = _e(
906
+ y,
907
+ m,
908
+ H,
909
+ X
910
+ ), xe = i(() => R.value ? "mixed" : `${F.value}`), K = E(F.value), he = () => {
911
+ K.value = !K.value, U(K.value);
912
+ };
913
+ q(F, () => {
914
+ K.value = F.value;
915
+ });
916
+ const Ce = (a) => {
917
+ B(a.items);
918
+ }, Se = (a) => {
919
+ G(a.items);
920
+ }, Ee = (a, u) => {
921
+ let v = !1;
922
+ const x = t.selectedValues.filter(({ value: _ }) => u.value === _ ? (v = !0, !1) : !0);
923
+ v || x.push(u), l(a, x);
924
+ }, Oe = i(() => {
925
+ if (!C.value)
926
+ return t.selectedValues;
927
+ const a = (_) => g.value.includes(_.value), u = (_) => !t.staticCategories && _.every((P) => a(P));
928
+ return t.items.flatMap(
929
+ (_) => _.items && !u(_.items) ? _.items : _
930
+ ).filter((_) => _.items ? !0 : a(_));
931
+ }), Te = i(() => {
932
+ var v, x, _, P;
933
+ const a = ["automatic", "button"].includes(t.lazyLoadType), u = ((v = t.selectedValues) == null ? void 0 : v.length) > 0 && ((x = y.value) == null ? void 0 : x.length) !== ((_ = D.value) == null ? void 0 : _.length);
934
+ return a && t.hasMoreItems ? !!((P = t.selectedValues) != null && P.length) : u;
935
+ }), Ie = i(() => ["automatic", "button"].includes(t.lazyLoadType) ? !t.hasMoreItems : !0), z = E([]), { visibleDomOptions: Q, updateVisibleDomOptions: oe } = ge(
936
+ d,
937
+ j(t, "items"),
938
+ A
939
+ ), Ae = (a) => {
940
+ z.value.includes(a) ? z.value = z.value.filter((u) => u !== a) : z.value.push(a), me(() => {
941
+ oe();
942
+ });
943
+ }, ie = (a) => {
944
+ var u;
945
+ (u = Q.value[a]) == null || u.focus();
946
+ }, {
947
+ moveToNextElement: ae,
948
+ moveToPreviousElement: ce,
949
+ moveToFirstElement: re,
950
+ moveToLastElement: ue,
951
+ preventDefault: ee,
952
+ focusedIndex: Le,
953
+ setListboxFocusedIndex: de
954
+ } = pe(
955
+ {
956
+ items: Q
957
+ },
958
+ ie
959
+ ), ke = {
960
+ [N.ARROW_UP]: (a) => ce(a),
961
+ [N.ARROW_DOWN]: (a) => ae(a),
962
+ [N.HOME]: re,
963
+ [N.END]: ue
964
+ };
965
+ e({
966
+ /**
967
+ * Method to set the index of the item to be focused on
968
+ * Used for focus management to be kept in-sync with parent e.g. dropdowns
969
+ */
970
+ setListboxFocusedIndex: de
971
+ });
972
+ const Re = {
973
+ [N.ARROW_UP]: ee,
974
+ [N.ARROW_DOWN]: ee
975
+ }, De = i(() => {
976
+ let a = 1;
977
+ const u = {};
978
+ return t.items.forEach((v) => {
979
+ let x = z.value.includes(v.value);
980
+ v.items ? (t.staticCategories ? x = !0 : u[v.value] = a++, x && v.items.forEach((_) => u[_.value] = a++)) : u[v.value] = a++;
981
+ }), u;
982
+ });
983
+ return { __sfc: !0, props: t, emit: l, t: n, n: o, slots: r, attrs: f, ariaAttributes: I, listboxRef: d, selectAllListboxItemsRef: b, selectedListboxItemsRef: O, listboxItemsRef: p, selectedItemsList: g, isMultiLevelSelect: C, flattenedItemsList: D, isTreePattern: L, computedRole: T, computedOptionRole: A, optionStates: S, enabledItems: m, visibleSelectedList: y, calculateTotalItems: h, selectAllCheckboxText: k, selectAll: B, unselectAll: G, selectAllItems: H, unselectAllItems: X, isAllSelected: F, isIndeterminate: R, toggleSelectAll: U, ariaCheckedComputed: xe, isSelectAllOn: K, handleSelectAll: he, selectAllCategory: Ce, unselectAllCategory: Se, toggleCheckboxSelection: Ee, selectedOptions: Oe, showSelectedItems: Te, showSelectAllCheckbox: Ie, expandedCategories: z, visibleDomOptions: Q, updateVisibleDomOptions: oe, toggleCategoryVisibility: Ae, focusItem: ie, moveToNextElement: ae, moveToPreviousElement: ce, moveToFirstElement: re, moveToLastElement: ue, preventDefault: ee, focusedIndex: Le, setListboxFocusedIndex: de, listboxListeners: ke, chipsSectionListeners: Re, computedItemsIndex: De, ListboxDecorativeCheckbox: ne, BentoTypography: W, BentoChip: Ye, BentoListboxOption: Z, ListboxMultiSelectOptions: Nt, vBentoKeyboardNavigationDirective: le, BentoListboxEvent: c };
984
+ }
985
+ });
986
+ var Pt = function() {
987
+ var e = this, l = e._self._c, t = e._self._setupProxy;
988
+ return l("div", { ref: "listboxRef", staticClass: "b-listbox-multi-select" }, [t.showSelectedItems ? l("div", [l("ul", e._g({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], staticClass: "b-listbox-multi-select__chips" }, t.chipsSectionListeners), e._l(t.selectedOptions, function(n) {
989
+ return l("li", { key: n.value }, [l(t.BentoChip, { ref: "selectedListboxItemsRef", refInFor: !0, attrs: { disabled: e.isOptionDisabled(n), label: n.label, condensed: "" }, on: { click: function(o) {
990
+ n.items ? t.unselectAllCategory(n) : t.toggleCheckboxSelection("select", n);
991
+ } } })], 1);
992
+ }), 0), l("hr", { staticClass: "b-listbox-multi-select__divider", attrs: { "aria-hidden": "true" } })]) : e._e(), l("div", e._g(e._b({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], attrs: { role: t.computedRole } }, "div", t.ariaAttributes, !1), t.listboxListeners), [t.showSelectAllCheckbox ? l(t.BentoListboxOption, { ref: "selectAllListboxItemsRef", staticClass: "b-listbox-multi-select__option", attrs: { tabindex: t.focusedIndex === 0 ? 0 : -1, "aria-checked": t.ariaCheckedComputed, role: t.computedOptionRole }, on: { click: t.handleSelectAll, "enter-pressed": t.handleSelectAll, "space-pressed": function(n) {
993
+ return n.preventDefault(), t.handleSelectAll.apply(null, arguments);
994
+ } } }, [l(t.ListboxDecorativeCheckbox, { attrs: { checked: t.isAllSelected, indeterminate: t.isIndeterminate } }), l(t.BentoTypography, { attrs: { el: "span" } }, [e._v(" " + e._s(t.selectAllCheckboxText) + " ")])], 1) : e._e(), t.showSelectAllCheckbox ? l("hr", { staticClass: "b-listbox-multi-select__divider", attrs: { "aria-hidden": "true" } }) : e._e(), l(t.ListboxMultiSelectOptions, { ref: "listboxItemsRef", attrs: { items: e.items, "is-option-disabled": e.isOptionDisabled, "is-multi-level": t.isMultiLevelSelect, "static-categories": e.staticCategories, searching: e.searching, "selected-items-list": t.selectedItemsList, "focused-index": t.focusedIndex, "items-index": t.computedItemsIndex, role: t.computedOptionRole }, on: { "toggle-checkbox-selection": function(n) {
995
+ return t.toggleCheckboxSelection("select", n);
996
+ }, "select-category": t.selectAllCategory, "unselect-category": t.unselectAllCategory, "toggle-category-visibility": t.toggleCategoryVisibility, "space-pressed": function(n) {
997
+ return t.toggleCheckboxSelection(t.BentoListboxEvent.SPACE, n);
998
+ }, "tab-pressed": function(n) {
999
+ return t.toggleCheckboxSelection(t.BentoListboxEvent.TAB, n);
1000
+ }, "enter-pressed": function(n) {
1001
+ return t.toggleCheckboxSelection(t.BentoListboxEvent.ENTER, n);
1002
+ } }, scopedSlots: e._u([e._l(t.slots, function(n, o) {
1003
+ return { key: o, fn: function(r) {
1004
+ return [e._t(o, null, null, r)];
1005
+ } };
1006
+ })], null, !0) })], 1)]);
1007
+ }, Ft = [], Yt = /* @__PURE__ */ $(
1008
+ Gt,
1009
+ Pt,
1010
+ Ft,
1011
+ !1,
1012
+ null,
1013
+ "904fc859"
1014
+ );
1015
+ const ve = Yt.exports, Ut = {
1016
+ "en-US": {
1017
+ loading: "Loading",
1018
+ showMore: "Show more"
1019
+ },
1020
+ "ja-JP": {
1021
+ loading: "読み込み中",
1022
+ showMore: "表示内容を増やす"
1023
+ },
1024
+ "pt-BR": {
1025
+ loading: "Carregando",
1026
+ showMore: "Mostrar mais"
1027
+ }
1028
+ }, zt = 36, Vt = w({
1029
+ name: "bento-listbox",
1030
+ components: {
1031
+ BentoEmptyState: Pe,
1032
+ BentoListboxSingleSelect: gt,
1033
+ BentoListboxMultiSelect: ve,
1034
+ BentoTypography: W,
1035
+ BentoLoadingIndicator: Ge,
1036
+ BentoLoadingButton: Ke
1037
+ },
1038
+ directives: { BentoKeyboardNavigationDirective: le },
1039
+ i18n: { messages: Ut },
1040
+ props: {
1041
+ /**
1042
+ * Defines a string value that labels an interactive element.
1043
+ */
1044
+ ariaLabel: { type: String, default: null },
1045
+ /**
1046
+ * Empty state props that will be used with the inner empty state component to be displayed when no search results are found.
1047
+ */
1048
+ emptyState: {
1049
+ type: Object,
1050
+ default: void 0
1051
+ },
1052
+ /**
1053
+ * Indicates whether there are more items to load
1054
+ */
1055
+ hasMoreItems: { type: Boolean, default: !1 },
1056
+ /**
1057
+ * Identifies the listbox whose contents are controlled by the the combobox on which the aria-controls attribute is set.
1058
+ */
1059
+ id: { type: String, required: !0 },
1060
+ /**
1061
+ * Function that allows the options to be disabled
1062
+ *
1063
+ * @type {BentoListboxIsOptionDisabled}
1064
+ * @param {BentoListboxOptionItem} option - Listbox option object
1065
+ * @param {string} option.label - Option's label text
1066
+ * @param {string|number} option.value - Option's value
1067
+ * @param {unknown} option.data - Option's extra data to be passed to the default slot
1068
+ */
1069
+ isOptionDisabled: {
1070
+ type: Function,
1071
+ default: () => {
1072
+ }
1073
+ },
1074
+ /**
1075
+ * The option elements to populate the listbox with.
1076
+ * It must be an array of {@see BentoListboxOptionItem }
1077
+ * * @property {string} value.label - Text to be displayed in the option
1078
+ * * @property {string,number} value.value - Value of the option
1079
+ */
1080
+ items: {
1081
+ type: Array,
1082
+ required: !0
1083
+ },
1084
+ /**
1085
+ * Indicates if new options are lazy loading.
1086
+ */
1087
+ loading: { type: Boolean, default: !1 },
1088
+ /**
1089
+ * The type of `Lazy Load`.
1090
+ * Type "automatic" will enable infinite scrolling
1091
+ * Type "button" will enable lazy loading with "Show more" button
1092
+ */
1093
+ lazyLoadType: {
1094
+ type: String,
1095
+ default: V.NONE,
1096
+ validator: (s) => Object.values(V).includes(s)
1097
+ },
1098
+ /**
1099
+ * Indicates the listbox is loading filtered items.
1100
+ */
1101
+ componentLoading: { type: Boolean, default: !1 },
1102
+ /**
1103
+ * If enabled, the user will be able to select multiple items.
1104
+ */
1105
+ multiple: { type: Boolean, default: !1 },
1106
+ /**
1107
+ * If enabled, dropdown will display non-selectable, static categories
1108
+ */
1109
+ staticCategories: { type: Boolean, default: !1 },
1110
+ /**
1111
+ * Messaged displayed when no items are listed in the listbox
1112
+ */
1113
+ noResultsMessage: { type: String, required: !0 },
1114
+ /**
1115
+ * Flag that indicates that an external search it's being made
1116
+ * to filter out the items inside the the multi-select listbox
1117
+ *
1118
+ * If enabled, hides the "Select all" checkbox in "multiple" mode.
1119
+ */
1120
+ searching: ve.props.searching,
1121
+ /**
1122
+ * The `input` value.
1123
+ * Providing an empty string or empty array will select no options.
1124
+ * Set to an empty string `''` if you don't want any of the available options to be selected for single select
1125
+ */
1126
+ selectedValue: {
1127
+ type: Array,
1128
+ default: () => []
1129
+ },
1130
+ /**
1131
+ * Enables virtual scrolling if set to true or by providing an object with itemHeight function.
1132
+ * The itemHeight function is used to calculate the height of rendered item given it's index.
1133
+ */
1134
+ virtualScroll: {
1135
+ type: [Boolean, Object],
1136
+ default: !1
1137
+ }
1138
+ },
1139
+ emits: [
1140
+ c.SELECT,
1141
+ c.SPACE,
1142
+ c.SHOW_MORE,
1143
+ c.ENTER,
1144
+ c.ESCAPE,
1145
+ c.TAB
1146
+ ],
1147
+ setup(s, { emit: e, slots: l }) {
1148
+ const t = E([]), n = j(s, "items"), { t: o } = se(), r = i(() => s.lazyLoadType !== V.AUTOMATIC), f = i(() => s.lazyLoadType === V.AUTOMATIC), I = () => {
1149
+ var R;
1150
+ return typeof (s == null ? void 0 : s.virtualScroll) == "object" && ((R = s == null ? void 0 : s.virtualScroll) != null && R.itemHeight) ? s.virtualScroll.itemHeight : zt;
1151
+ }, {
1152
+ containerRef: d,
1153
+ containerProps: b,
1154
+ onScroll: O,
1155
+ list: p,
1156
+ wrapperProps: g
1157
+ } = qe(n, {
1158
+ itemHeight: I(),
1159
+ // Disable virtual scrolling if not enabled or if lazy loading is enabled or if multi-select
1160
+ disabled: (s == null ? void 0 : s.multiple) || (s == null ? void 0 : s.virtualScroll) === !1 || (s == null ? void 0 : s.lazyLoadType) !== "none"
1161
+ }), C = i(
1162
+ () => s.componentLoading !== void 0 || r.value ? "true" : void 0
1163
+ ), D = i(
1164
+ () => r.value && s.loading || s.componentLoading ? "true" : "false"
1165
+ ), L = i(
1166
+ () => r.value || s.componentLoading !== void 0 ? "polite" : void 0
1167
+ ), T = i(
1168
+ () => ({
1169
+ "aria-label": s.ariaLabel,
1170
+ "aria-busy": D.value,
1171
+ "aria-atomic": C.value,
1172
+ "aria-live": L.value
1173
+ })
1174
+ ), A = i(
1175
+ () => s.componentLoading ? {
1176
+ ...T.value,
1177
+ role: "alert"
1178
+ } : {}
1179
+ ), S = (R) => (U) => {
1180
+ e(R, U);
1181
+ }, m = () => {
1182
+ e(c.SHOW_MORE);
1183
+ }, y = Fe(() => {
1184
+ const R = d.value;
1185
+ if (!R)
1186
+ return;
1187
+ const U = Math.round(R.scrollTop) + R.clientHeight >= R.scrollHeight;
1188
+ s.hasMoreItems && U && !s.loading && m();
1189
+ }), h = () => {
1190
+ f.value ? y() : O();
1191
+ }, k = i(() => {
1192
+ var R;
1193
+ return ((R = s.items) == null ? void 0 : R.length) === 0;
1194
+ }), B = i(
1195
+ () => s.lazyLoadType === V.BUTTON && s.hasMoreItems
1196
+ ), G = i(
1197
+ () => s.loading ? be.LOADING : be.START
1198
+ ), H = i(() => s.loading ? o("loading") : o("showMore")), X = i(() => ({
1199
+ ...s.emptyState,
1200
+ variant: "condensed"
1201
+ })), F = {
1202
+ [c.SELECT]: S(c.SELECT),
1203
+ [c.SPACE]: S(c.SPACE),
1204
+ [c.TAB]: S(c.TAB),
1205
+ [c.ENTER]: S(c.ENTER)
1206
+ };
1207
+ return {
1208
+ // Refs
1209
+ listboxRef: d,
1210
+ listboxItemRef: t,
1211
+ // a11y
1212
+ ariaAttributes: T,
1213
+ listboxContainerAttributes: A,
1214
+ // Values
1215
+ containerProps: b,
1216
+ isSearchResultEmpty: k,
1217
+ limitedEmptyStateProps: X,
1218
+ loadingButtonState: G,
1219
+ slots: l,
1220
+ shouldDisplayShowMoreButton: B,
1221
+ showMoreButtonText: H,
1222
+ virtualisedItems: p,
1223
+ wrapperProps: g,
1224
+ // Enums
1225
+ BentoKeyboardNavigationKeyDownEvent: N,
1226
+ BentoListboxEvent: c,
1227
+ // Methods
1228
+ onListboxContainerScroll: h,
1229
+ onOptionSelected: S,
1230
+ emitShowMore: m,
1231
+ listboxListeners: F
1232
+ };
1233
+ }
1234
+ });
1235
+ var Wt = function() {
1236
+ var t;
1237
+ var e = this, l = e._self._c;
1238
+ return e._self._setupProxy, l("div", e._b({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], ref: "listboxRef", staticClass: "b-listbox", style: (t = e.containerProps) == null ? void 0 : t.style, attrs: { id: e.id, tabindex: "-1", "data-testid": "listbox-container" }, on: { scroll: e.onListboxContainerScroll } }, "div", e.listboxContainerAttributes, !1), [l("div", e._b({}, "div", e.wrapperProps, !1), [e.componentLoading ? l("div", { staticClass: "b-listbox__loading-filtered-items" }, [l("bento-loading-indicator")], 1) : e.isSearchResultEmpty ? l("div", { staticClass: "b-listbox__empty-search-message" }, [e.emptyState ? l("bento-empty-state", e._b({}, "bento-empty-state", e.limitedEmptyStateProps, !1)) : l("bento-typography", { attrs: { el: "span" } }, [e._v(e._s(e.noResultsMessage))])], 1) : [e.multiple ? [l("bento-listbox-multi-select", e._g(e._b({ 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(n, o) {
1239
+ return { key: o, fn: function(r) {
1240
+ return [e._t(o, null, null, r)];
1241
+ } };
1242
+ })], null, !0) }, "bento-listbox-multi-select", e.ariaAttributes, !1), e.listboxListeners))] : [l("bento-listbox-single-select", e._g(e._b({ ref: "listboxItemRef", attrs: { items: e.virtualisedItems, "selected-value": e.selectedValue, "static-categories": e.staticCategories, "is-option-disabled": e.isOptionDisabled }, scopedSlots: e._u([e._l(e.slots, function(n, o) {
1243
+ return { key: o, fn: function(r) {
1244
+ return [e._t(o, null, null, r)];
1245
+ } };
1246
+ })], null, !0) }, "bento-listbox-single-select", e.ariaAttributes, !1), e.listboxListeners))], e.shouldDisplayShowMoreButton ? l("div", { staticClass: "b-listbox__lazy-load" }, [l("bento-loading-button", { attrs: { state: e.loadingButtonState, variant: "secondary" }, on: { "!click": function(n) {
1247
+ return e.emitShowMore.apply(null, arguments);
1248
+ } } }, [e._v(" " + e._s(e.showMoreButtonText) + " ")])], 1) : e.loading ? l("div", { staticClass: "b-listbox__lazy-load" }, [l("bento-loading-indicator")], 1) : e._e()]], 2)]);
1249
+ }, Kt = [], jt = /* @__PURE__ */ $(
1250
+ Vt,
1251
+ Wt,
1252
+ Kt,
1253
+ !1,
1254
+ null,
1255
+ "46b000a2"
1256
+ );
1257
+ const bs = jt.exports, te = (s, e) => {
1258
+ for (const l of s) {
1259
+ if (l.value === e)
1260
+ return l;
1261
+ if (l.items) {
1262
+ const t = te(l.items, e);
1263
+ if (t)
1264
+ return t;
1265
+ }
1266
+ }
1267
+ return null;
1268
+ }, qt = (s) => typeof s == "object" && s !== null && "value" in s && "label" in s, fs = (s, e, l, t) => {
1269
+ const n = E([]), o = E(), r = (b) => {
1270
+ l.value ? o.value = b.map(({ value: O }) => O) : o.value = b.length > 0 ? b[0].value : null;
1271
+ }, f = (b) => {
1272
+ l.value ? o.value = b.map(({ value: O, label: p }) => ({ value: O, label: p })) : o.value = b.length > 0 ? { value: b[0].value, label: b[0].label } : null;
1273
+ }, I = (b) => {
1274
+ n.value = b, t != null && t.value ? f(b) : r(b);
1275
+ }, d = () => {
1276
+ n.value = [], o.value = null;
1277
+ };
1278
+ return q(
1279
+ () => e.value,
1280
+ () => {
1281
+ if (!e.value && e.value !== 0) {
1282
+ d();
1283
+ return;
1284
+ }
1285
+ const b = !Array.isArray(e.value), O = [...n.value];
1286
+ d();
1287
+ const p = (g) => {
1288
+ if (qt(g))
1289
+ n.value.push(g);
1290
+ else {
1291
+ let C = te(s.value, g);
1292
+ C || (C = te(O, g)), C || (C = { value: g, label: g.toString() }), n.value.push(C);
1293
+ }
1294
+ };
1295
+ if (b) {
1296
+ const g = e.value;
1297
+ p(g), t != null && t.value ? f(n.value) : r(n.value);
1298
+ return;
1299
+ }
1300
+ e.value.forEach(p), t != null && t.value ? f(n.value) : r(n.value);
1301
+ },
1302
+ { immediate: !0 }
1303
+ ), {
1304
+ // Values
1305
+ cachedSelectedListboxOptions: n,
1306
+ cachedListboxSelectedValues: o,
1307
+ // Methods
1308
+ resetCache: d,
1309
+ setCachedValues: I
1310
+ };
1311
+ };
1312
+ export {
1313
+ V as B,
1314
+ c as a,
1315
+ bs as b,
1316
+ fs as c,
1317
+ ge as d,
1318
+ $t as u
1319
+ };
1320
+ //# sourceMappingURL=use-cached-selected-values.CusB5KBl.js.map