@adyen/bento-vue3 1.96.1 → 1.97.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 (176) hide show
  1. package/dist/@types/index.d.ts +159 -125
  2. package/dist/action-bar.js +1 -1
  3. package/dist/ai-tag.js +1 -1
  4. package/dist/alert.js +1 -1
  5. package/dist/assets/accordion-item.css +1 -1
  6. package/dist/assets/action-bar.css +1 -1
  7. package/dist/assets/alert.css +1 -1
  8. package/dist/assets/base-modal.css +1 -1
  9. package/dist/assets/button-actions.css +1 -1
  10. package/dist/assets/calendar.css +1 -1
  11. package/dist/assets/card.css +1 -1
  12. package/dist/assets/country.css +1 -1
  13. package/dist/assets/data-grid.css +1 -1
  14. package/dist/assets/date-picker.css +1 -1
  15. package/dist/assets/date-range-picker.css +1 -1
  16. package/dist/assets/date-time-picker.css +1 -1
  17. package/dist/assets/dialog-page.css +1 -1
  18. package/dist/assets/dropdown.css +1 -1
  19. package/dist/assets/file-uploader.css +1 -1
  20. package/dist/assets/filter-bar.css +1 -1
  21. package/dist/assets/inspector.css +1 -1
  22. package/dist/assets/modal-fullscreen.css +1 -1
  23. package/dist/assets/navigation-menu-group.css +1 -1
  24. package/dist/assets/secondary-nav.css +1 -1
  25. package/dist/assets/sidepanel.css +1 -1
  26. package/dist/assets/summary-grid.css +1 -1
  27. package/dist/assets/textarea.css +1 -1
  28. package/dist/button.js +1 -1
  29. package/dist/card.js +1 -1
  30. package/dist/checkbox.js +2 -2
  31. package/dist/chunks/{action-bar.CIVprT2U.js → action-bar.BEV9uXHS.js} +3 -3
  32. package/dist/chunks/{action-bar.CIVprT2U.js.map → action-bar.BEV9uXHS.js.map} +1 -1
  33. package/dist/chunks/{ai-tag.DkTlRY__.js → ai-tag.BSzY3-0w.js} +2 -2
  34. package/dist/chunks/{ai-tag.DkTlRY__.js.map → ai-tag.BSzY3-0w.js.map} +1 -1
  35. package/dist/chunks/{alert.RD0qOLhx.js → alert.V1imvtyI.js} +3 -3
  36. package/dist/chunks/alert.V1imvtyI.js.map +1 -0
  37. package/dist/chunks/{base-modal.BKtpH-qh.js → base-modal.B7SiRo7c.js} +3 -3
  38. package/dist/chunks/{base-modal.BKtpH-qh.js.map → base-modal.B7SiRo7c.js.map} +1 -1
  39. package/dist/chunks/{button-actions-with-menu.cMAAF47d.js → button-actions-with-menu.DoUcLg-M.js} +2 -2
  40. package/dist/chunks/{button-actions-with-menu.cMAAF47d.js.map → button-actions-with-menu.DoUcLg-M.js.map} +1 -1
  41. package/dist/chunks/{button-actions.CxTxPprd.js → button-actions.CWmTl4cF.js} +170 -161
  42. package/dist/chunks/{button-actions.CxTxPprd.js.map → button-actions.CWmTl4cF.js.map} +1 -1
  43. package/dist/chunks/calendar.6NKd6IMo.js +1272 -0
  44. package/dist/chunks/calendar.6NKd6IMo.js.map +1 -0
  45. package/dist/chunks/{card.CQlyqa5-.js → card.Ca7FkYxy.js} +2 -2
  46. package/dist/chunks/{card.CQlyqa5-.js.map → card.Ca7FkYxy.js.map} +1 -1
  47. package/dist/chunks/{checkbox-group.BcDIXL27.js → checkbox-group.BWx4wn0F.js} +2 -2
  48. package/dist/chunks/{checkbox-group.BcDIXL27.js.map → checkbox-group.BWx4wn0F.js.map} +1 -1
  49. package/dist/chunks/{checkbox.LTRqb-pE.js → checkbox.DwfrmbwI.js} +18 -18
  50. package/dist/chunks/{checkbox.LTRqb-pE.js.map → checkbox.DwfrmbwI.js.map} +1 -1
  51. package/dist/chunks/{code-snippet.DHzB-8JJ.js → code-snippet.Cp61a0Ud.js} +3 -3
  52. package/dist/chunks/{code-snippet.DHzB-8JJ.js.map → code-snippet.Cp61a0Ud.js.map} +1 -1
  53. package/dist/chunks/{country.15m_ATbO.js → country.a-fpQGLP.js} +2 -2
  54. package/dist/chunks/country.a-fpQGLP.js.map +1 -0
  55. package/dist/chunks/{dashboard-section.Da6ZFGtm.js → dashboard-section.BR0xU-b-.js} +2 -2
  56. package/dist/chunks/{dashboard-section.Da6ZFGtm.js.map → dashboard-section.BR0xU-b-.js.map} +1 -1
  57. package/dist/chunks/{dashed-underline.DJmMXcdt.js → dashed-underline.CxpIRlCx.js} +2 -2
  58. package/dist/chunks/{dashed-underline.DJmMXcdt.js.map → dashed-underline.CxpIRlCx.js.map} +1 -1
  59. package/dist/chunks/{data-grid-template.-MuGcJp1.js → data-grid-template.LTILymaF.js} +2 -2
  60. package/dist/chunks/{data-grid-template.-MuGcJp1.js.map → data-grid-template.LTILymaF.js.map} +1 -1
  61. package/dist/chunks/{data-grid.kZgqWqQx.js → data-grid.xcmkjuyg.js} +26 -27
  62. package/dist/chunks/{data-grid.kZgqWqQx.js.map → data-grid.xcmkjuyg.js.map} +1 -1
  63. package/dist/chunks/date-picker.CCETX031.js +279 -0
  64. package/dist/chunks/date-picker.CCETX031.js.map +1 -0
  65. package/dist/chunks/date-picker.types.Ckt7zxGy.js.map +1 -1
  66. package/dist/chunks/date-range-picker.CtGaxtYh.js +1095 -0
  67. package/dist/chunks/date-range-picker.CtGaxtYh.js.map +1 -0
  68. package/dist/chunks/date-range-picker.types.Ckt7zxGy.js.map +1 -1
  69. package/dist/chunks/{draggable-handle.C1dudqKz.js → draggable-handle.CUecl-HB.js} +2 -2
  70. package/dist/chunks/{draggable-handle.C1dudqKz.js.map → draggable-handle.CUecl-HB.js.map} +1 -1
  71. package/dist/chunks/{dropdown-tag.C1ei1SyR.js → dropdown-tag.BgZYYc_D.js} +2 -2
  72. package/dist/chunks/{dropdown-tag.C1ei1SyR.js.map → dropdown-tag.BgZYYc_D.js.map} +1 -1
  73. package/dist/chunks/dropdown.C97ShfXZ.js +2958 -0
  74. package/dist/chunks/dropdown.C97ShfXZ.js.map +1 -0
  75. package/dist/chunks/{file-uploader.C9YOBRQg.js → file-uploader.CXgAfp0m.js} +2 -2
  76. package/dist/chunks/{file-uploader.C9YOBRQg.js.map → file-uploader.CXgAfp0m.js.map} +1 -1
  77. package/dist/chunks/{filter-bar.CzFtzztU.js → filter-bar.D8BVPHLT.js} +44 -41
  78. package/dist/chunks/filter-bar.D8BVPHLT.js.map +1 -0
  79. package/dist/chunks/{footer-actions.zlKq74F1.js → footer-actions.C_HlJeXP.js} +2 -2
  80. package/dist/chunks/{footer-actions.zlKq74F1.js.map → footer-actions.C_HlJeXP.js.map} +1 -1
  81. package/dist/chunks/{form-layout-title.Kwve4xv2.js → form-layout-title.CWw0poO8.js} +2 -2
  82. package/dist/chunks/{form-layout-title.Kwve4xv2.js.map → form-layout-title.CWw0poO8.js.map} +1 -1
  83. package/dist/chunks/{header-meta.NFZo1ACP.js → header-meta.yBxBW12f.js} +2 -2
  84. package/dist/chunks/{header-meta.NFZo1ACP.js.map → header-meta.yBxBW12f.js.map} +1 -1
  85. package/dist/chunks/{header-with-views.ubPTyW9A.js → header-with-views.qCyKEZW1.js} +8 -8
  86. package/dist/chunks/{header-with-views.ubPTyW9A.js.map → header-with-views.qCyKEZW1.js.map} +1 -1
  87. package/dist/chunks/{header.Ds0sFKBB.js → header.aJLkRe1D.js} +3 -3
  88. package/dist/chunks/{header.Ds0sFKBB.js.map → header.aJLkRe1D.js.map} +1 -1
  89. package/dist/chunks/{input-field-password.CZ-NTpZF.js → input-field-password.DUSoJYKT.js} +3 -3
  90. package/dist/chunks/{input-field-password.CZ-NTpZF.js.map → input-field-password.DUSoJYKT.js.map} +1 -1
  91. package/dist/chunks/{input-field-phone-number.DOHk6gSp.js → input-field-phone-number.Q-bQJL4g.js} +2 -2
  92. package/dist/chunks/{input-field-phone-number.DOHk6gSp.js.map → input-field-phone-number.Q-bQJL4g.js.map} +1 -1
  93. package/dist/chunks/{input-field.DBlTGgAD.js → input-field.CvnmfrzQ.js} +2 -2
  94. package/dist/chunks/{input-field.DBlTGgAD.js.map → input-field.CvnmfrzQ.js.map} +1 -1
  95. package/dist/chunks/{input-time.CHIjCO74.js → input-time.CGPUOOQ9.js} +45 -45
  96. package/dist/chunks/{input-time.CHIjCO74.js.map → input-time.CGPUOOQ9.js.map} +1 -1
  97. package/dist/chunks/{modal-fullscreen.DmruiE3n.js → modal-fullscreen.CBxh_3gU.js} +2 -2
  98. package/dist/chunks/{modal-fullscreen.DmruiE3n.js.map → modal-fullscreen.CBxh_3gU.js.map} +1 -1
  99. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.CrJQWuzb.js → modal.vue_vue_type_script_setup_true_lang.C3xuswtY.js} +4 -4
  100. package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.CrJQWuzb.js.map → modal.vue_vue_type_script_setup_true_lang.C3xuswtY.js.map} +1 -1
  101. package/dist/chunks/{pagination.DbpHH_53.js → pagination.cNByWBP1.js} +2 -2
  102. package/dist/chunks/{pagination.DbpHH_53.js.map → pagination.cNByWBP1.js.map} +1 -1
  103. package/dist/chunks/{rich-text-editor.u-V4fNWK.js → rich-text-editor.CJA_d518.js} +3 -3
  104. package/dist/chunks/{rich-text-editor.u-V4fNWK.js.map → rich-text-editor.CJA_d518.js.map} +1 -1
  105. package/dist/chunks/{search-bar.TKgi1KLs.js → search-bar.CLjqWNaI.js} +6 -6
  106. package/dist/chunks/{search-bar.TKgi1KLs.js.map → search-bar.CLjqWNaI.js.map} +1 -1
  107. package/dist/chunks/{secondary-nav.0OsJiAWI.js → secondary-nav.BU47gyEO.js} +2 -2
  108. package/dist/chunks/{secondary-nav.0OsJiAWI.js.map → secondary-nav.BU47gyEO.js.map} +1 -1
  109. package/dist/chunks/{selection-card-group.C59ZIrVm.js → selection-card-group.C2Av3uyz.js} +9 -9
  110. package/dist/chunks/{selection-card-group.C59ZIrVm.js.map → selection-card-group.C2Av3uyz.js.map} +1 -1
  111. package/dist/chunks/{sidepanel.BVQt6Tac.js → sidepanel.Dw2If3qM.js} +3 -3
  112. package/dist/chunks/{sidepanel.BVQt6Tac.js.map → sidepanel.Dw2If3qM.js.map} +1 -1
  113. package/dist/chunks/{summary-grid.types.9sUs0LS0.js → summary-grid.types.Cnrc4ThJ.js} +3 -3
  114. package/dist/chunks/summary-grid.types.Cnrc4ThJ.js.map +1 -0
  115. package/dist/chunks/{timeline-item.DfwOm5do.js → timeline-item.BWhCoOf1.js} +3 -3
  116. package/dist/chunks/{timeline-item.DfwOm5do.js.map → timeline-item.BWhCoOf1.js.map} +1 -1
  117. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.B5-sWGlz.js → tutorial.vue_vue_type_script_setup_true_lang.QWcInKo7.js} +2 -2
  118. package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.B5-sWGlz.js.map → tutorial.vue_vue_type_script_setup_true_lang.QWcInKo7.js.map} +1 -1
  119. package/dist/chunks/use-bento-delayed-hover.Csc3nIWt.js.map +1 -1
  120. package/dist/chunks/{use-date-input-formatter.x285YiSd.js → use-date-input-formatter.QXaVIBS0.js} +2 -2
  121. package/dist/chunks/{use-date-input-formatter.x285YiSd.js.map → use-date-input-formatter.QXaVIBS0.js.map} +1 -1
  122. package/dist/code-snippet.js +1 -1
  123. package/dist/country.js +1 -1
  124. package/dist/dashboard-template.js +1 -1
  125. package/dist/dashed-underline.js +1 -1
  126. package/dist/data-grid-template.js +1 -1
  127. package/dist/data-grid.js +1 -1
  128. package/dist/date-picker.js +2 -2
  129. package/dist/date-range-picker.js +2 -2
  130. package/dist/date-time-picker.js +87 -79
  131. package/dist/date-time-picker.js.map +1 -1
  132. package/dist/draggable.js +1 -1
  133. package/dist/dropdown.js +11 -12
  134. package/dist/dropdown.js.map +1 -1
  135. package/dist/file-uploader.js +1 -1
  136. package/dist/filter-bar.js +1 -1
  137. package/dist/form-layout.js +1 -1
  138. package/dist/header-with-views.js +1 -1
  139. package/dist/header.js +1 -1
  140. package/dist/index.js +255 -256
  141. package/dist/index.js.map +1 -1
  142. package/dist/input-field-password.js +1 -1
  143. package/dist/input-field-phone-number.js +1 -1
  144. package/dist/input-field.js +1 -1
  145. package/dist/input-time.js +1 -1
  146. package/dist/internal.js +13 -13
  147. package/dist/menu.js +1 -1
  148. package/dist/modal-fullscreen.js +1 -1
  149. package/dist/modal.js +2 -2
  150. package/dist/pagination.js +1 -1
  151. package/dist/popover.js +1 -1
  152. package/dist/rich-text-editor.js +1 -1
  153. package/dist/search-bar.js +2 -2
  154. package/dist/secondary-nav.js +1 -1
  155. package/dist/selection-card.js +1 -1
  156. package/dist/sidepanel.js +1 -1
  157. package/dist/summary-grid.js +1 -1
  158. package/dist/timeline.js +1 -1
  159. package/dist/tutorial.js +1 -1
  160. package/dist/web-types.json +1 -1
  161. package/package.json +4 -4
  162. package/dist/assets/use-cached-selected-values.css +0 -1
  163. package/dist/chunks/alert.RD0qOLhx.js.map +0 -1
  164. package/dist/chunks/calendar.iQyNwQBL.js +0 -1207
  165. package/dist/chunks/calendar.iQyNwQBL.js.map +0 -1
  166. package/dist/chunks/country.15m_ATbO.js.map +0 -1
  167. package/dist/chunks/date-picker.DyImOUH4.js +0 -277
  168. package/dist/chunks/date-picker.DyImOUH4.js.map +0 -1
  169. package/dist/chunks/date-range-picker.BigC6wm2.js +0 -1019
  170. package/dist/chunks/date-range-picker.BigC6wm2.js.map +0 -1
  171. package/dist/chunks/dropdown.C5um1anU.js +0 -1233
  172. package/dist/chunks/dropdown.C5um1anU.js.map +0 -1
  173. package/dist/chunks/filter-bar.CzFtzztU.js.map +0 -1
  174. package/dist/chunks/summary-grid.types.9sUs0LS0.js.map +0 -1
  175. package/dist/chunks/use-cached-selected-values.DOw5IKdU.js +0 -1740
  176. package/dist/chunks/use-cached-selected-values.DOw5IKdU.js.map +0 -1
@@ -0,0 +1,2958 @@
1
+ import { computed as d, ref as $, onMounted as Ft, onUnmounted as Vt, watch as Se, defineComponent as Z, resolveComponent as K, openBlock as p, createElementBlock as E, createVNode as V, withCtx as _, createTextVNode as oe, toDisplayString as U, createElementVNode as q, renderSlot as Y, mergeProps as R, withKeys as fe, createCommentVNode as J, createBlock as N, withModifiers as Le, normalizeProps as re, guardReactiveProps as he, withDirectives as de, vShow as Re, nextTick as se, toRef as ae, resolveDirective as Et, toHandlers as ne, Fragment as ue, renderList as le, createSlots as me, normalizeClass as be, unref as b, useSlots as Ve, useAttrs as rt, toRefs as Ot, resolveDynamicComponent as Lt, inject as dt } from "vue";
2
+ import { B as Ie, d as st } from "./typography.B3J6_tYk.js";
3
+ import { g as Oe } from "./generate-uid.DBWe4g6T.js";
4
+ import { u as zt } from "./aria-label.CaUURpnB.js";
5
+ import { u as ke } from "./index.B875RXHM.js";
6
+ import { u as Gt } from "./form-field.D_2g7vaP.js";
7
+ import { u as Kt } from "./use-form-layout-loading.CWbjZiwP.js";
8
+ import { u as It } from "./use-has-slot.CyMiImRQ.js";
9
+ import { B as Ut } from "./directive.D1-d-C2K.js";
10
+ import { B as H, a as Fe } from "./keyboard-navigation.DWmhelVv.js";
11
+ import { B as qt } from "./loading-indicator.BPol9I84.js";
12
+ import { B as Yt } from "./empty-state.DT4sFyjB.js";
13
+ import { o as Wt } from "./resize.Bqks3WUm.js";
14
+ import { C as Ye, N as jt } from "./minus-small.CnYLTuSv.js";
15
+ import { C as Ht } from "./checkmark-small.CRuZauJc.js";
16
+ /* empty css */
17
+ import { _ as ee } from "./_plugin-vue_export-helper.CHgC5LLL.js";
18
+ import { B as Jt } from "./chip.DFldnqfz.js";
19
+ import { C as Tt } from "./chevron-down.XeE-LBV_.js";
20
+ import { C as At } from "./chevron-up.Cmgl2a3x.js";
21
+ import { a as Xt, b as bt, h as Zt, e as Qt } from "./button-actions.CWmTl4cF.js";
22
+ import { F as el } from "./field-label.CLV3nSzz.js";
23
+ import { P as ft } from "./popper-container.BH4WxeUj.js";
24
+ import { E as tl } from "./error-message.Dyvrw6ZB.js";
25
+ import { C as ll } from "./cross-circle-fill.BWCKKn0E.js";
26
+ import { C as ol } from "./cross-circle-fill-small.H1wH-vcZ.js";
27
+ import { s as Be } from "./events.BQOQSSb7.js";
28
+ import "../assets/dropdown.css";
29
+ const $t = (e, l, n, o) => {
30
+ const a = d(
31
+ () => !!e.value?.length && e.value?.length === l.value.length
32
+ ), s = d(() => e.value == null || e.value.length === 0 ? !1 : e.value?.length !== l.value.length);
33
+ return {
34
+ isAllSelected: a,
35
+ isIndeterminate: s,
36
+ toggleSelectAll: (i) => {
37
+ i ? n() : o();
38
+ }
39
+ };
40
+ };
41
+ function al(e, { disabled: l, itemHeight: n, overscan: o = 5, prefixHeight: a }) {
42
+ const s = $(null), t = $([]), i = $(0), g = $(0), c = $(0);
43
+ let u;
44
+ const r = d(() => {
45
+ const C = typeof n == "number" ? e.value.length * n : e.value.reduce((B, k, w) => B + n(w), 0), T = typeof n == "number" ? i.value * n : e.value.slice(0, i.value).reduce((B, k, w) => B + n(w), 0);
46
+ return {
47
+ style: {
48
+ marginTop: `${T}px`,
49
+ height: `${C - T}px`
50
+ }
51
+ };
52
+ }), m = () => {
53
+ const C = a?.value ?? 0, T = Math.max(s.value.scrollTop - C, 0);
54
+ if (typeof n == "number")
55
+ return Math.floor(T / n);
56
+ let B = 0, k = 0;
57
+ for (let w = 0; w < e.value.length; w += 1) {
58
+ const F = n(w);
59
+ if (B += F, B >= T) {
60
+ k = w;
61
+ break;
62
+ }
63
+ }
64
+ return k;
65
+ }, v = () => {
66
+ if (c.value = s.value.clientHeight, typeof n == "number")
67
+ return Math.ceil(c.value / n);
68
+ const C = i.value ?? 0;
69
+ let T = 0, B = 0;
70
+ for (let k = C; k < e.value.length; k += 1) {
71
+ const w = n(k);
72
+ if (T += w, B = k, T > c.value)
73
+ break;
74
+ }
75
+ return B - C;
76
+ }, O = () => {
77
+ if (s.value) {
78
+ const C = v();
79
+ i.value = m(), g.value = Math.min(i.value + C + o, e.value.length), t.value = e.value.slice(i.value, g.value);
80
+ }
81
+ }, D = () => {
82
+ O();
83
+ };
84
+ l || (Ft(() => {
85
+ s.value && (c.value = s.value.clientHeight, u = Wt(s.value, ({ clientHeight: C }) => {
86
+ c.value = C, O();
87
+ }), O());
88
+ }), Vt(() => {
89
+ u?.disconnect();
90
+ }), Se(
91
+ () => e.value,
92
+ () => {
93
+ O();
94
+ }
95
+ ));
96
+ const y = {
97
+ ref: s,
98
+ style: { overflowY: "auto" }
99
+ }, z = (C) => {
100
+ if (!s.value)
101
+ return;
102
+ const T = typeof n == "number" ? C * n : e.value.slice(0, C).reduce((M, W, G) => M + n(G), 0), B = typeof n == "number" ? n : n(C), k = T + B, { scrollTop: w, clientHeight: F } = s.value, I = w + F;
103
+ k > I ? s.value.scrollTop = F > 0 ? k - F : T : T < w && (s.value.scrollTop = T), O();
104
+ };
105
+ return l ? {
106
+ containerRef: s,
107
+ containerProps: y,
108
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
109
+ onScroll: () => {
110
+ },
111
+ list: e,
112
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
113
+ scrollToIndex: () => {
114
+ },
115
+ startIndex: $(0)
116
+ } : {
117
+ containerRef: s,
118
+ containerProps: y,
119
+ onScroll: D,
120
+ list: t,
121
+ wrapperProps: r,
122
+ scrollToIndex: z,
123
+ startIndex: i
124
+ };
125
+ }
126
+ var f = /* @__PURE__ */ ((e) => (e.SELECT = "select", e.SHOW_MORE = "show-more", e.ESCAPE = "escape-pressed", e.CLICK = "click", e.ENTER = "enter-pressed", e.SPACE = "space-pressed", e.TAB = "tab-pressed", e.CLOSE_DROPDOWN = "close-dropdown", e))(f || {}), Ee = /* @__PURE__ */ ((e) => (e.AUTOMATIC = "automatic", e.BUTTON = "button", e.NONE = "none", e))(Ee || {});
127
+ const sl = Z({
128
+ name: "bento-listbox-static-category",
129
+ components: {
130
+ BentoTypography: Ie
131
+ },
132
+ props: {
133
+ /**
134
+ * Category label text
135
+ */
136
+ categoryLabel: {
137
+ type: String,
138
+ required: !0
139
+ }
140
+ }
141
+ }), nl = ["aria-label"];
142
+ function il(e, l, n, o, a, s) {
143
+ const t = K("bento-typography");
144
+ return p(), E("div", {
145
+ class: "b-listbox-single-select-category",
146
+ role: "group",
147
+ "aria-label": e.categoryLabel
148
+ }, [
149
+ V(t, {
150
+ variant: "caption",
151
+ el: "span",
152
+ class: "b-listbox-single-select-category__label-text",
153
+ "aria-hidden": "true"
154
+ }, {
155
+ default: _(() => [
156
+ oe(U(e.categoryLabel), 1)
157
+ ]),
158
+ _: 1
159
+ }),
160
+ q("div", null, [
161
+ Y(e.$slots, "default", {}, void 0, !0)
162
+ ])
163
+ ], 8, nl);
164
+ }
165
+ const rl = /* @__PURE__ */ ee(sl, [["render", il], ["__scopeId", "data-v-27c4e09a"]]), dl = Z({
166
+ name: "bento-listbox-option",
167
+ props: {
168
+ /**
169
+ * Setting this property to true will disable the option.
170
+ */
171
+ disabled: { type: Boolean, default: !1 },
172
+ /**
173
+ * Indicates if the value is selected. Only one element can be selected at a time.
174
+ */
175
+ selected: { type: Boolean, default: !1 }
176
+ },
177
+ emits: [f.CLICK, f.ENTER, f.SPACE, f.TAB],
178
+ setup(e, { emit: l }) {
179
+ const n = d(() => ({
180
+ "b-listbox-option--disabled": e.disabled,
181
+ "b-listbox-option--selected": e.selected
182
+ }));
183
+ return {
184
+ // Enums
185
+ BentoKeyboardNavigationKeyDownEvent: H,
186
+ BentoListboxEvent: f,
187
+ // Values
188
+ conditionalClasses: n,
189
+ // Events
190
+ onClick: (s) => {
191
+ l(f.CLICK, s);
192
+ },
193
+ onOptionSelected: (s, t) => {
194
+ l(s, t);
195
+ }
196
+ };
197
+ }
198
+ });
199
+ function cl(e, l, n, o, a, s) {
200
+ return p(), E("div", R({
201
+ class: ["b-listbox-option", e.conditionalClasses],
202
+ role: "option"
203
+ }, e.$attrs, {
204
+ onClick: l[0] || (l[0] = (...t) => e.onClick && e.onClick(...t)),
205
+ onKeydown: [
206
+ l[1] || (l[1] = fe((t) => e.onOptionSelected(e.BentoListboxEvent.ENTER, t), ["enter"])),
207
+ l[2] || (l[2] = fe((t) => e.onOptionSelected(e.BentoListboxEvent.SPACE, t), ["space"])),
208
+ l[3] || (l[3] = fe((t) => e.onOptionSelected(e.BentoListboxEvent.TAB, t), ["tab"]))
209
+ ]
210
+ }), [
211
+ Y(e.$slots, "default", {}, void 0, !0)
212
+ ], 16);
213
+ }
214
+ const We = /* @__PURE__ */ ee(dl, [["render", cl], ["__scopeId", "data-v-1495b1db"]]);
215
+ let mt = 0;
216
+ const ul = {
217
+ beforeCreate() {
218
+ this.uuid = mt.toString(), mt += 1;
219
+ }
220
+ }, pl = { key: 0 };
221
+ function bl(e, l, n, o, a, s) {
222
+ return p(), E("svg", R({ role: "img" }, e.$attrs, {
223
+ class: "ui-assets-icons-16",
224
+ xmlns: "http://www.w3.org/2000/svg",
225
+ width: "16",
226
+ height: "16",
227
+ fill: "none"
228
+ }), [
229
+ e.$attrs["svg-title"] ? (p(), E("title", pl, U(e.$attrs["svg-title"]), 1)) : J("", !0),
230
+ l[0] || (l[0] = q("path", {
231
+ fill: "#001222",
232
+ d: "M15.0608 4.00011L14.0001 2.93945L6.00011 10.9395L2.00011 6.93945L0.939453 8.00011L6.00011 13.0608L15.0608 4.00011Z"
233
+ }, null, -1))
234
+ ], 16);
235
+ }
236
+ const fl = /* @__PURE__ */ ee(ul, [["render", bl]]), ml = Z({
237
+ name: "bento-listbox-single-select-option",
238
+ components: {
239
+ BentoListboxOption: We,
240
+ BentoTypography: Ie,
241
+ CheckmarkIcon: fl
242
+ },
243
+ props: {
244
+ /**
245
+ * Setting this property to true will disable the option.
246
+ */
247
+ disabled: { type: Boolean, default: !1 },
248
+ /**
249
+ * The option item that contains all the option item's data.
250
+ * @type {BentoListboxOptionItem}
251
+ */
252
+ option: {
253
+ type: Object,
254
+ required: !0
255
+ },
256
+ /**
257
+ * Indicates if the value is selected. Only one element can be selected at a time.
258
+ */
259
+ selected: { type: Boolean, default: !1 }
260
+ },
261
+ emits: [f.ENTER, f.SELECT, f.SPACE, f.TAB],
262
+ setup(e, { emit: l }) {
263
+ const n = (t) => {
264
+ e.disabled || l(t, e.option);
265
+ }, o = d(() => e.disabled ? !0 : null), a = d(() => e.selected ? !0 : null), s = d(() => e.disabled ? -1 : 0);
266
+ return {
267
+ // Values
268
+ ariaDisabled: o,
269
+ ariaSelected: a,
270
+ tabIndex: s,
271
+ // Enums
272
+ BentoListboxEvent: f,
273
+ // Events
274
+ onOptionSelected: n
275
+ };
276
+ }
277
+ }), vl = { class: "b-listbox-single-select-option__text" }, yl = { class: "b-listbox-single-select-option__check-icon" };
278
+ function gl(e, l, n, o, a, s) {
279
+ const t = K("bento-typography"), i = K("checkmark-icon"), g = K("bento-listbox-option");
280
+ return p(), N(g, {
281
+ class: "b-listbox-single-select-option",
282
+ disabled: e.disabled,
283
+ selected: e.selected,
284
+ "aria-selected": e.ariaSelected,
285
+ "aria-disabled": e.ariaDisabled,
286
+ tabindex: e.tabIndex,
287
+ onClick: l[0] || (l[0] = (c) => e.onOptionSelected(e.BentoListboxEvent.SELECT)),
288
+ onEnterPressed: l[1] || (l[1] = (c) => e.onOptionSelected(e.BentoListboxEvent.ENTER)),
289
+ onSpacePressed: l[2] || (l[2] = Le((c) => e.onOptionSelected(e.BentoListboxEvent.SPACE), ["prevent"])),
290
+ onTabPressed: l[3] || (l[3] = (c) => e.onOptionSelected(e.BentoListboxEvent.TAB))
291
+ }, {
292
+ default: _(() => [
293
+ Y(e.$slots, "default", re(he(e.option)), () => [
294
+ q("span", vl, [
295
+ V(t, { el: "span" }, {
296
+ default: _(() => [
297
+ oe(U(e.option.label), 1)
298
+ ]),
299
+ _: 1
300
+ }),
301
+ e.option.description ? (p(), N(t, {
302
+ key: 0,
303
+ class: "b-listbox-single-select-option__description",
304
+ el: "span"
305
+ }, {
306
+ default: _(() => [
307
+ oe(U(e.option.description), 1)
308
+ ]),
309
+ _: 1
310
+ })) : J("", !0)
311
+ ])
312
+ ], !0),
313
+ q("span", yl, [
314
+ de(V(i, { "svg-title": "selected" }, null, 512), [
315
+ [Re, e.selected]
316
+ ])
317
+ ])
318
+ ]),
319
+ _: 3
320
+ }, 8, ["disabled", "selected", "aria-selected", "aria-disabled", "tabindex"]);
321
+ }
322
+ const hl = /* @__PURE__ */ ee(ml, [["render", gl], ["__scopeId", "data-v-4f41af07"]]), kt = ({ items: e, totalItemCount: l }, n) => {
323
+ const o = d(() => l?.value ? l.value - 1 : e.value.length - 1), a = $(0), s = (v) => {
324
+ switch (v) {
325
+ case "increase":
326
+ a.value += 1;
327
+ break;
328
+ case "decrease":
329
+ a.value -= 1;
330
+ break;
331
+ }
332
+ }, t = ({ edgeCaseItem: v }, O) => {
333
+ a.value !== v && (s(O), n(a.value));
334
+ }, i = (v) => {
335
+ m(v), t(
336
+ {
337
+ edgeCaseItem: o.value
338
+ },
339
+ "increase"
340
+ /* INCREASE */
341
+ );
342
+ }, g = (v) => {
343
+ m(v), t(
344
+ {
345
+ edgeCaseItem: 0
346
+ },
347
+ "decrease"
348
+ /* DECREASE */
349
+ );
350
+ }, c = () => {
351
+ a.value = 0, n(a.value);
352
+ }, u = () => {
353
+ a.value = o.value, n(a.value);
354
+ }, r = (v) => {
355
+ a.value = v;
356
+ }, m = (v) => {
357
+ v?.detail?.preventDefault();
358
+ };
359
+ return {
360
+ moveToFirstElement: c,
361
+ moveToLastElement: u,
362
+ moveToNextElement: i,
363
+ moveToPreviousElement: g,
364
+ setListboxFocusedIndex: r,
365
+ preventDefault: m,
366
+ focusedIndex: a
367
+ };
368
+ }, ct = (e, l, n = $("option"), o = !0) => {
369
+ const a = $([]), s = async () => {
370
+ if (!e.value || e.value.nodeType === Node.COMMENT_NODE)
371
+ return;
372
+ const t = Array.from(e.value.querySelectorAll(`[role="${n.value}"]`));
373
+ a.value = o ? t.filter((i) => i.checkVisibility()) : t;
374
+ };
375
+ return Se(
376
+ l,
377
+ () => {
378
+ se(() => {
379
+ s();
380
+ });
381
+ },
382
+ { immediate: !0 }
383
+ ), {
384
+ visibleDomOptions: a,
385
+ updateVisibleDomOptions: s
386
+ };
387
+ }, Sl = Z({
388
+ name: "bento-listbox-single-select",
389
+ components: {
390
+ BentoListboxSingleSelectCategory: rl,
391
+ BentoListboxSingleSelectOption: hl
392
+ },
393
+ directives: { BentoKeyboardNavigationDirective: Fe },
394
+ inheritAttrs: !1,
395
+ props: {
396
+ /**
397
+ * Function that allows the options to be disabled
398
+ *
399
+ * @type {BentoListboxIsOptionDisabled}
400
+ * @param {BentoListboxOptionItem} option - listbox option object
401
+ * @param {string} option.label - Option's label text
402
+ * @param {string|number} option.value - Option's value
403
+ * @param {unknown} option.data - Option's extra data to be passed to the default slot
404
+ */
405
+ isOptionDisabled: {
406
+ type: Function,
407
+ default: () => !1
408
+ },
409
+ /**
410
+ * The option elements to populate the listbox with.
411
+ * It must be an array of {@see BentoListboxOptionItem }.
412
+ *
413
+ * @property {string} value.label - Text to be displayed in the option
414
+ * @property {string,number} value.value - Value of the option
415
+ */
416
+ items: {
417
+ type: Array,
418
+ required: !0
419
+ },
420
+ /**
421
+ * The `input` value.
422
+ * Providing an empty string will select no options.
423
+ * Set to an empty string `''` if you don't want any of the available options to be selected
424
+ */
425
+ selectedValue: {
426
+ type: Array,
427
+ default: void 0
428
+ },
429
+ /**
430
+ * If enabled, dropdown will display non-selectable, static categories
431
+ */
432
+ staticCategories: { type: Boolean, default: !1 },
433
+ /**
434
+ * Total number of items in the full list (used for virtual scroll keyboard navigation).
435
+ * When greater than 0, virtual scroll keyboard navigation is enabled.
436
+ */
437
+ totalItemCount: { type: Number, default: 0 },
438
+ /**
439
+ * Function to scroll the virtual list container to a given item index.
440
+ */
441
+ scrollToIndex: { type: Function, default: void 0 },
442
+ /**
443
+ * The start index of the currently rendered virtual scroll slice.
444
+ */
445
+ virtualScrollStartIndex: { type: Number, default: 0 }
446
+ },
447
+ emits: [f.SELECT, f.ENTER, f.SPACE, f.TAB],
448
+ setup(e, { emit: l, expose: n, slots: o, attrs: a }) {
449
+ const s = $(null), t = $([]), i = d(() => !!e.selectedValue?.length && e.selectedValue.at(0)), g = d(
450
+ () => ({
451
+ "aria-label": a["aria-label"]?.toString(),
452
+ "aria-busy": a["aria-busy"]?.toString(),
453
+ "aria-atomic": a["aria-atomic"]?.toString(),
454
+ "aria-live": a["aria-live"]?.toString()
455
+ })
456
+ ), c = d(() => !!e.items.some(({ items: I }) => !!I)), u = (I) => (M) => {
457
+ l(I, [M]);
458
+ }, { visibleDomOptions: r, updateVisibleDomOptions: m } = ct(
459
+ s,
460
+ ae(e, "items"),
461
+ $("option"),
462
+ !1
463
+ ), v = d(() => e.totalItemCount > 0), O = (I) => {
464
+ if (!v.value)
465
+ return;
466
+ const M = I.target;
467
+ if (M === s.value || M?.getAttribute("role") !== "option")
468
+ return;
469
+ const W = r.value.indexOf(M);
470
+ if (W !== -1) {
471
+ const G = W + e.virtualScrollStartIndex;
472
+ k(G);
473
+ }
474
+ }, D = async (I) => {
475
+ if (v.value && e.scrollToIndex) {
476
+ e.scrollToIndex(I), await se(), await m();
477
+ const M = I - e.virtualScrollStartIndex;
478
+ r.value[M]?.focus();
479
+ } else
480
+ r.value[I]?.focus();
481
+ }, y = async (I) => {
482
+ k(I), await D(I);
483
+ }, {
484
+ moveToNextElement: z,
485
+ moveToPreviousElement: C,
486
+ moveToFirstElement: T,
487
+ moveToLastElement: B,
488
+ setListboxFocusedIndex: k
489
+ } = kt(
490
+ {
491
+ items: r,
492
+ totalItemCount: ae(e, "totalItemCount")
493
+ },
494
+ D
495
+ ), w = {
496
+ [H.ARROW_UP]: C,
497
+ [H.ARROW_DOWN]: z,
498
+ [H.HOME]: T,
499
+ [H.END]: B
500
+ }, F = {
501
+ [f.SELECT]: u(f.SELECT),
502
+ [f.SPACE]: u(f.SPACE),
503
+ [f.TAB]: u(f.TAB),
504
+ [f.ENTER]: u(f.ENTER)
505
+ };
506
+ return n({
507
+ /**
508
+ * Reference for a single listbox item.
509
+ * Required for keyboard navigation in dropdown as $children is removed in vue@3
510
+ */
511
+ listboxItemRef: t,
512
+ /**
513
+ * Method to set the index of the item to be focused on
514
+ * Used for focus management to be kept in-sync with parent e.g. dropdowns
515
+ */
516
+ setListboxFocusedIndex: k,
517
+ /**
518
+ * Navigates to an item by global index, handling virtual scroll if enabled.
519
+ * Scrolls the virtual list and focuses the item.
520
+ */
521
+ navigateToItem: y
522
+ }), {
523
+ // Enums
524
+ BentoListboxEvent: f,
525
+ // Values
526
+ listboxRef: s,
527
+ listboxItemRef: t,
528
+ selectedItem: i,
529
+ slots: o,
530
+ ariaAttributes: g,
531
+ // Computed
532
+ hasCategories: c,
533
+ // Methods
534
+ onOptionSelected: u,
535
+ // Keyboard navigation
536
+ listboxListeners: w,
537
+ listboxOptionListeners: F,
538
+ // Virtual scroll focus management
539
+ handleVirtualScrollingFocus: O
540
+ };
541
+ }
542
+ });
543
+ function Cl(e, l, n, o, a, s) {
544
+ const t = K("bento-listbox-single-select-option"), i = K("bento-listbox-single-select-category"), g = Et("bento-keyboard-navigation-directive");
545
+ return de((p(), E("div", R({ ref: "listboxRef" }, e.ariaAttributes, { role: "listbox" }, ne(e.listboxListeners, !0), {
546
+ onFocusin: l[0] || (l[0] = (...c) => e.handleVirtualScrollingFocus && e.handleVirtualScrollingFocus(...c))
547
+ }), [
548
+ e.hasCategories && e.staticCategories ? (p(!0), E(ue, { key: 0 }, le(e.items, (c) => (p(), E(ue, null, [
549
+ c.items && c.items.length > 0 ? (p(), N(i, {
550
+ key: `category-${c.value}`,
551
+ "category-label": c.label
552
+ }, {
553
+ default: _(() => [
554
+ (p(!0), E(ue, null, le(c.items, (u) => (p(), N(t, R({
555
+ key: u.value,
556
+ ref_for: !0,
557
+ ref: "listboxItemRef",
558
+ role: "option",
559
+ option: u,
560
+ disabled: e.isOptionDisabled ? e.isOptionDisabled(u) : null,
561
+ selected: u.value === e.selectedItem.value
562
+ }, ne(e.listboxOptionListeners)), me({ _: 2 }, [
563
+ le(e.slots, (r, m) => ({
564
+ name: m,
565
+ fn: _((v) => [
566
+ Y(e.$slots, m, R({ ref_for: !0 }, v))
567
+ ])
568
+ }))
569
+ ]), 1040, ["option", "disabled", "selected"]))), 128))
570
+ ]),
571
+ _: 2
572
+ }, 1032, ["category-label"])) : (p(), N(t, R({
573
+ key: `option-${c.value}`,
574
+ ref_for: !0,
575
+ ref: "listboxItemRef",
576
+ role: "option",
577
+ option: c,
578
+ disabled: e.isOptionDisabled ? e.isOptionDisabled(c) : null,
579
+ selected: c.value === e.selectedItem.value
580
+ }, ne(e.listboxOptionListeners)), me({ _: 2 }, [
581
+ le(e.slots, (u, r) => ({
582
+ name: r,
583
+ fn: _((m) => [
584
+ Y(e.$slots, r, R({ ref_for: !0 }, m))
585
+ ])
586
+ }))
587
+ ]), 1040, ["option", "disabled", "selected"]))
588
+ ], 64))), 256)) : (p(!0), E(ue, { key: 1 }, le(e.items, (c) => (p(), N(t, R({
589
+ key: c.value,
590
+ ref_for: !0,
591
+ ref: "listboxItemRef",
592
+ role: "option",
593
+ option: c,
594
+ disabled: e.isOptionDisabled ? e.isOptionDisabled(c) : null,
595
+ selected: c.value === e.selectedItem.value
596
+ }, ne(e.listboxOptionListeners)), me({ _: 2 }, [
597
+ le(e.slots, (u, r) => ({
598
+ name: r,
599
+ fn: _((m) => [
600
+ Y(e.$slots, r, R({ ref_for: !0 }, m))
601
+ ])
602
+ }))
603
+ ]), 1040, ["option", "disabled", "selected"]))), 128))
604
+ ], 16)), [
605
+ [g]
606
+ ]);
607
+ }
608
+ const El = /* @__PURE__ */ ee(Sl, [["render", Cl]]);
609
+ let vt = 0;
610
+ const Ol = {
611
+ beforeCreate() {
612
+ this.uuid = vt.toString(), vt += 1;
613
+ }
614
+ }, Ll = { key: 0 };
615
+ function Il(e, l, n, o, a, s) {
616
+ return p(), E("svg", R({ role: "img" }, e.$attrs, {
617
+ class: "ui-assets-icons-16",
618
+ xmlns: "http://www.w3.org/2000/svg",
619
+ width: "16",
620
+ height: "16",
621
+ fill: "none"
622
+ }), [
623
+ e.$attrs["svg-title"] ? (p(), E("title", Ll, U(e.$attrs["svg-title"]), 1)) : J("", !0),
624
+ l[0] || (l[0] = q("path", {
625
+ fill: "#001222",
626
+ d: "M9.69043 5.75L4.62988 10.8105L1.56934 7.75L2.62988 6.68945L4.62988 8.68945L8.62988 4.68945L9.69043 5.75Z"
627
+ }, null, -1)),
628
+ l[1] || (l[1] = q("path", {
629
+ fill: "#001222",
630
+ d: "M13.9307 5.75L8.87012 10.8105L7.80957 9.75L12.8701 4.68945L13.9307 5.75Z"
631
+ }, null, -1))
632
+ ], 16);
633
+ }
634
+ const Tl = /* @__PURE__ */ ee(Ol, [["render", Il]]), Al = {}, $l = /* @__PURE__ */ Z({
635
+ ...Al,
636
+ __name: "decorative-checkbox",
637
+ props: {
638
+ disabled: { type: Boolean, default: !1 },
639
+ indeterminate: { type: Boolean, default: !1 },
640
+ checked: { type: Boolean, default: !1 },
641
+ allSelected: { type: Boolean, default: !1 }
642
+ },
643
+ setup(e) {
644
+ const l = e, n = d(() => ({
645
+ [`b-checkbox-input--${Ye.DISABLED}`]: l.disabled
646
+ })), o = d(() => ({
647
+ [`b-checkbox-input__outline--${Ye.UNCHECKED}`]: !l.checked && !l.indeterminate && !l.allSelected,
648
+ [`b-checkbox-input__outline--${Ye.CHECKED}`]: (l.checked || l.allSelected) && !l.indeterminate,
649
+ [`b-checkbox-input__outline--${Ye.INDETERMINATE}`]: l.indeterminate
650
+ }));
651
+ return (a, s) => (p(), E("div", {
652
+ class: be(["b-checkbox-input", n.value]),
653
+ role: "presentation"
654
+ }, [
655
+ a.indeterminate ? (p(), N(b(jt), {
656
+ key: 0,
657
+ class: "b-checkbox-input__icon",
658
+ "svg-title": "",
659
+ "aria-hidden": "true"
660
+ })) : a.allSelected ? (p(), N(b(Tl), {
661
+ key: 1,
662
+ class: "b-checkbox-input__icon",
663
+ "svg-title": "",
664
+ "aria-hidden": "true",
665
+ "data-testid": "decorative-checkbox-double-checkmark-icon"
666
+ })) : a.checked ? (p(), N(b(Ht), {
667
+ key: 2,
668
+ class: "b-checkbox-input__icon",
669
+ "svg-title": "",
670
+ "aria-hidden": "true"
671
+ })) : J("", !0),
672
+ q("div", {
673
+ class: be(["b-checkbox-input__outline", o.value])
674
+ }, null, 2)
675
+ ], 2));
676
+ }
677
+ }), ut = /* @__PURE__ */ ee($l, [["__scopeId", "data-v-08d3142e"]]);
678
+ var wt = /* @__PURE__ */ ((e) => (e.DISABLED = "disabled", e.STATIC_CATEGORY = "static-category", e))(wt || {}), $e = /* @__PURE__ */ ((e) => (e.SELECT_CATEGORY = "select-category", e.UNSELECT_CATEGORY = "unselect-category", e.TOGGLE_CATEGORY_VISIBILITY = "toggle-category-visibility", e))($e || {});
679
+ const yt = {
680
+ "de-DE": { categoryClosed: "{category} geschlossen", categoryOpened: "{category} geöffnet" },
681
+ "en-GB": { categoryClosed: "{category} closed", categoryOpened: "{category} opened" },
682
+ "en-US": { categoryClosed: "{category} closed", categoryOpened: "{category} opened" },
683
+ "es-ES": { categoryClosed: "{category} cerrado", categoryOpened: "{category} abierto" },
684
+ "es-MX": { categoryClosed: "{category} cerrado", categoryOpened: "{category} abierto" },
685
+ "fr-FR": { categoryClosed: "{category} fermée", categoryOpened: "{category} ouverte" },
686
+ "it-IT": { categoryClosed: "{category} chiuso", categoryOpened: "{category} aperto" },
687
+ "ja-JP": { categoryClosed: "{category}を閉じました", categoryOpened: "{category}を開きました" },
688
+ "pt-BR": { categoryClosed: "{category} fechada", categoryOpened: "{categoria} aberta" },
689
+ "zh-CN": { categoryClosed: "{category} 已关闭", categoryOpened: "{category} 已打开" }
690
+ }, kl = Z({
691
+ i18n: { messages: yt },
692
+ name: "bento-listbox-multi-select-category",
693
+ components: {
694
+ BentoTypography: Ie,
695
+ BentoListboxOption: We,
696
+ ChevronDownIcon: Tt,
697
+ ChevronUpIcon: At,
698
+ DecorativeCheckbox: ut
699
+ },
700
+ props: {
701
+ /**
702
+ * The option elements to populate the listbox with.
703
+ * It must be an array of {@see BentoListboxOptionItem }.
704
+ *
705
+ * @property {string} value.label - Text to be displayed in the option
706
+ * @property {string,number} value.value - Value of the option
707
+ * @property {BentoListboxOptionItem} value.items - Category items list
708
+ */
709
+ category: {
710
+ type: Object,
711
+ required: !0
712
+ },
713
+ /**
714
+ * Function that allows the options to be disabled
715
+ *
716
+ * @type {BentoListboxIsOptionDisabled}
717
+ * @param {BentoListboxOptionItem} option - listbox option object
718
+ * @param {string} option.label - Option's label text
719
+ * @param {string|number} option.value - Option's value
720
+ * @param {unknown} option.data - Option's extra data to be passed to the default slot
721
+ */
722
+ isOptionDisabled: {
723
+ type: [Function],
724
+ default: () => !1
725
+ },
726
+ /**
727
+ * The `input` value.
728
+ * Providing an empty array will select no options.
729
+ */
730
+ selectedItemsList: {
731
+ type: Array,
732
+ default: () => []
733
+ },
734
+ /**
735
+ * If enabled, dropdown will display non-selectable, static categories
736
+ */
737
+ staticCategories: { type: Boolean, default: !1 },
738
+ /**
739
+ * Category's tabindex
740
+ */
741
+ tabindex: { type: Number, default: -1 }
742
+ },
743
+ emits: [
744
+ $e.SELECT_CATEGORY,
745
+ $e.UNSELECT_CATEGORY,
746
+ $e.TOGGLE_CATEGORY_VISIBILITY
747
+ ],
748
+ setup(e, { emit: l }) {
749
+ const n = $(!1), { t: o } = ke({ messages: yt }), a = Oe("category-group"), s = Oe("category-name"), t = (I) => e.isOptionDisabled ? e.isOptionDisabled(I) : !1, i = d(
750
+ () => e.category.items.every((I) => t(I))
751
+ ), g = ae(e, "staticCategories"), c = d(() => n.value || e.staticCategories), u = d(() => ({
752
+ [`b-listbox-multi-select-category--${wt.DISABLED}`]: i.value
753
+ })), r = (I, M) => {
754
+ I.preventDefault(), n.value = M !== void 0 ? M : !n.value, l($e.TOGGLE_CATEGORY_VISIBILITY, e.category.value);
755
+ }, m = (I) => {
756
+ const M = t(I), W = e.selectedItemsList?.includes(I.value) || !1;
757
+ return { isDisabled: M, isPreSelected: W };
758
+ }, v = d(
759
+ () => e.category.items.filter((I) => {
760
+ const { isDisabled: M, isPreSelected: W } = m(I);
761
+ return M && W || !M;
762
+ })
763
+ ), O = d(
764
+ () => v.value?.filter(
765
+ ({ value: I }) => e.selectedItemsList?.includes(I)
766
+ )
767
+ ), D = d(() => {
768
+ const I = n.value ? "categoryOpened" : "categoryClosed";
769
+ return o(I, { category: e.category.label });
770
+ }), y = () => {
771
+ l($e.SELECT_CATEGORY);
772
+ }, z = () => {
773
+ l($e.UNSELECT_CATEGORY);
774
+ }, { isAllSelected: C, isIndeterminate: T, toggleSelectAll: B } = $t(
775
+ O,
776
+ v,
777
+ y,
778
+ z
779
+ ), k = d(() => T.value ? "mixed" : `${C.value}`), w = $(C.value), F = () => {
780
+ w.value = !w.value, B(w.value);
781
+ };
782
+ return Se(C, () => {
783
+ w.value = C.value;
784
+ }), {
785
+ // Values
786
+ chevronTitle: D,
787
+ conditionalClass: u,
788
+ hasAllPropsDisabled: i,
789
+ isOpen: n,
790
+ isAllSelected: C,
791
+ isIndeterminate: T,
792
+ isStaticCategory: g,
793
+ categoryGroupId: a,
794
+ categoryNameId: s,
795
+ // Computed
796
+ showItemChildren: c,
797
+ ariaCheckedComputed: k,
798
+ // Methods
799
+ handleSelectAll: F,
800
+ toggleOpen: r,
801
+ toggleSelectAll: B
802
+ };
803
+ }
804
+ }), wl = { class: "b-listbox-multi-select-category__label" }, _l = {
805
+ key: 1,
806
+ class: "b-listbox-multi-select-category b-listbox-multi-select-category--static-category",
807
+ "aria-hidden": "true"
808
+ }, Dl = { class: "b-listbox-multi-select-category__label" }, Bl = ["id", "aria-label"];
809
+ function xl(e, l, n, o, a, s) {
810
+ const t = K("decorative-checkbox"), i = K("bento-typography"), g = K("chevron-up-icon"), c = K("chevron-down-icon"), u = K("bento-listbox-option");
811
+ return p(), E("div", null, [
812
+ e.isStaticCategory ? (p(), E("div", _l, [
813
+ q("span", Dl, [
814
+ V(i, {
815
+ el: "span",
816
+ variant: "caption",
817
+ class: "b-listbox-multi-select-category__label-text"
818
+ }, {
819
+ default: _(() => [
820
+ oe(U(e.category.label), 1)
821
+ ]),
822
+ _: 1
823
+ })
824
+ ])
825
+ ])) : (p(), N(u, {
826
+ key: 0,
827
+ class: be(["b-listbox-multi-select-category__option", e.conditionalClass]),
828
+ tabindex: e.tabindex,
829
+ "aria-selected": e.ariaCheckedComputed !== "false",
830
+ "aria-checked": e.ariaCheckedComputed,
831
+ "aria-disabled": e.hasAllPropsDisabled,
832
+ "aria-expanded": `${e.isOpen}`,
833
+ role: "treeitem",
834
+ "aria-owns": e.categoryGroupId,
835
+ "aria-labelledby": e.categoryNameId,
836
+ onClick: e.handleSelectAll,
837
+ onEnterPressed: e.handleSelectAll,
838
+ onSpacePressed: Le(e.handleSelectAll, ["prevent"]),
839
+ onKeydown: [
840
+ l[1] || (l[1] = fe((r) => e.toggleOpen(r, !1), ["arrow-left", "native"])),
841
+ l[2] || (l[2] = fe((r) => e.toggleOpen(r, !0), ["arrow-right", "native"]))
842
+ ]
843
+ }, {
844
+ default: _(() => [
845
+ V(t, {
846
+ indeterminate: e.isIndeterminate,
847
+ disabled: e.hasAllPropsDisabled,
848
+ checked: e.isAllSelected
849
+ }, null, 8, ["indeterminate", "disabled", "checked"]),
850
+ q("span", wl, [
851
+ V(i, {
852
+ id: e.categoryNameId,
853
+ el: "span",
854
+ class: "b-listbox-multi-select-category__label-text"
855
+ }, {
856
+ default: _(() => [
857
+ oe(U(e.category.label), 1)
858
+ ]),
859
+ _: 1
860
+ }, 8, ["id"]),
861
+ q("div", {
862
+ "aria-hidden": "true",
863
+ class: "b-listbox-multi-select-category__label-chevron",
864
+ "data-testid": "toggle-listbox",
865
+ onClickCapture: l[0] || (l[0] = Le((...r) => e.toggleOpen && e.toggleOpen(...r), ["stop"]))
866
+ }, [
867
+ e.isOpen ? (p(), N(g, {
868
+ key: 0,
869
+ "svg-title": e.chevronTitle
870
+ }, null, 8, ["svg-title"])) : (p(), N(c, {
871
+ key: 1,
872
+ "svg-title": e.chevronTitle
873
+ }, null, 8, ["svg-title"]))
874
+ ], 32)
875
+ ])
876
+ ]),
877
+ _: 1
878
+ }, 8, ["class", "tabindex", "aria-selected", "aria-checked", "aria-disabled", "aria-expanded", "aria-owns", "aria-labelledby", "onClick", "onEnterPressed", "onSpacePressed"])),
879
+ de(q("div", {
880
+ id: e.categoryGroupId,
881
+ role: "group",
882
+ "aria-label": e.category.label
883
+ }, [
884
+ Y(e.$slots, "default", {}, void 0, !0)
885
+ ], 8, Bl), [
886
+ [Re, e.showItemChildren]
887
+ ])
888
+ ]);
889
+ }
890
+ const Rl = /* @__PURE__ */ ee(kl, [["render", xl], ["__scopeId", "data-v-60c04867"]]);
891
+ var ge = /* @__PURE__ */ ((e) => (e.SELECT_CATEGORY = "select-category", e.TOGGLE_CHECKBOX_SELECTION = "toggle-checkbox-selection", e.UNSELECT_CATEGORY = "unselect-category", e.TOGGLE_CATEGORY_VISIBILITY = "toggle-category-visibility", e))(ge || {});
892
+ const Ml = Z({
893
+ name: "listbox-multi-select-options",
894
+ components: {
895
+ BentoListboxOption: We,
896
+ BentoTypography: Ie,
897
+ ListboxMultiSelectCategory: Rl,
898
+ DecorativeCheckbox: ut
899
+ },
900
+ inheritAttrs: !1,
901
+ props: {
902
+ /**
903
+ * Indicates if the items listed are inside a category
904
+ * so they can be padded to right by one level in recursion.
905
+ * Items of categories are automatically defined as "categoryItems"
906
+ */
907
+ categoryItems: { type: Boolean, default: !1 },
908
+ /**
909
+ * Current focused option index
910
+ */
911
+ focusedIndex: { type: Number, default: 0 },
912
+ /**
913
+ * Function that allows the options to be disabled
914
+ *
915
+ * @type {BentoListboxIsOptionDisabled}
916
+ * @param {BentoListboxOptionItem} option - listbox option object
917
+ * @param {string} option.label - Option's label text
918
+ * @param {string|number} option.value - Option's value
919
+ * @param {unknown} option.data - Option's extra data to be passed to the default slot
920
+ */
921
+ isOptionDisabled: {
922
+ type: Function,
923
+ default: () => !1
924
+ },
925
+ /**
926
+ * The option elements to populate the listbox with.
927
+ * It must be an array of {@see BentoListboxOptionItem }.
928
+ *
929
+ * @property {string} value.label - Text to be displayed in the option
930
+ * @property {string,number} value.value - Value of the option
931
+ */
932
+ items: {
933
+ type: Array,
934
+ required: !0
935
+ },
936
+ /**
937
+ * Indicates if the elements options are inside a multi-level category
938
+ */
939
+ isMultiLevel: { type: Boolean, default: !1 },
940
+ /**
941
+ * Flag that indicates that an external search it's being made
942
+ * to filter out the items inside the the multi-select listbox
943
+ *
944
+ * If enabled, hides the "Select all" checkbox in "multiple" mode.
945
+ */
946
+ searching: { type: Boolean, default: !1 },
947
+ /**
948
+ * List of selected items.
949
+ * Providing an empty array will select no options.
950
+ */
951
+ selectedItemsList: {
952
+ type: Array,
953
+ default: () => []
954
+ },
955
+ /**
956
+ * If enabled, dropdown will display non-selectable, static categories
957
+ */
958
+ staticCategories: { type: Boolean, default: !1 },
959
+ /**
960
+ * Object with the index of each item.
961
+ */
962
+ itemsIndex: {
963
+ type: Object,
964
+ default: () => ({})
965
+ }
966
+ },
967
+ emits: [
968
+ ge.TOGGLE_CHECKBOX_SELECTION,
969
+ ge.SELECT_CATEGORY,
970
+ ge.UNSELECT_CATEGORY,
971
+ ge.TOGGLE_CATEGORY_VISIBILITY
972
+ ],
973
+ setup(e, { emit: l }) {
974
+ const n = (c) => {
975
+ e.isOptionDisabled(c) || l(ge.TOGGLE_CHECKBOX_SELECTION, c);
976
+ }, o = (c) => !!c.items, a = (c) => {
977
+ const u = e.isMultiLevel && e.searching;
978
+ return c.description && (!e.isMultiLevel || u);
979
+ }, s = (c) => c.items ? !!c.items.find((u) => e.selectedItemsList.includes(u.value)) : e.selectedItemsList.includes(c.value), t = (c) => {
980
+ if (o(c)) {
981
+ const u = s(c) ? ge.UNSELECT_CATEGORY : ge.SELECT_CATEGORY;
982
+ l(u, c);
983
+ } else
984
+ n(c);
985
+ };
986
+ return {
987
+ // Values
988
+ conditionalClasses: d(() => ({
989
+ "b-listbox-multi-select-options__static-category-option": e.staticCategories,
990
+ "b-listbox-multi-select-options__category-option": e.categoryItems
991
+ })),
992
+ // Methods
993
+ isOptionSelected: s,
994
+ shouldShowDescription: a,
995
+ toggleCheckboxSelection: n,
996
+ toggleSearchOption: t,
997
+ computedTabindex: (c) => e.itemsIndex[c] === e.focusedIndex ? 0 : -1,
998
+ // Enums
999
+ BentoListboxEvent: f,
1000
+ ListboxMultiSelectOptionsEvent: ge
1001
+ };
1002
+ }
1003
+ }), Nl = { class: "b-listbox-multi-select__option-text" }, Pl = { class: "b-listbox-multi-select__option-text" };
1004
+ function Fl(e, l, n, o, a, s) {
1005
+ const t = K("decorative-checkbox"), i = K("bento-typography"), g = K("bento-listbox-option"), c = K("listbox-multi-select-options", !0), u = K("listbox-multi-select-category");
1006
+ return p(), E("div", null, [
1007
+ (p(!0), E(ue, null, le(e.items, (r) => (p(), E("div", {
1008
+ key: `selected-${r.value}`
1009
+ }, [
1010
+ e.searching && e.isMultiLevel ? (p(), N(g, {
1011
+ key: 0,
1012
+ class: be(["b-listbox-multi-select-options", e.conditionalClasses]),
1013
+ disabled: e.isOptionDisabled ? e.isOptionDisabled(r) : null,
1014
+ tabindex: e.computedTabindex(r.value),
1015
+ "aria-selected": `${e.isOptionSelected(r)}`,
1016
+ "aria-checked": `${e.isOptionSelected(r)}`,
1017
+ "aria-disabled": e.isOptionDisabled ? e.isOptionDisabled(r) : null,
1018
+ role: e.$attrs.role || "option",
1019
+ onClick: (m) => e.toggleSearchOption(r),
1020
+ onEnterPressed: (m) => e.toggleSearchOption(r),
1021
+ onSpacePressed: Le((m) => e.toggleSearchOption(r), ["prevent"])
1022
+ }, {
1023
+ default: _(() => [
1024
+ V(t, {
1025
+ disabled: e.isOptionDisabled ? e.isOptionDisabled(r) : null,
1026
+ checked: e.isOptionSelected(r)
1027
+ }, null, 8, ["disabled", "checked"]),
1028
+ Y(e.$slots, "default", R({ ref_for: !0 }, r), () => [
1029
+ q("span", Nl, [
1030
+ V(i, { el: "span" }, {
1031
+ default: _(() => [
1032
+ oe(U(r.label), 1)
1033
+ ]),
1034
+ _: 2
1035
+ }, 1024),
1036
+ e.shouldShowDescription(r) ? (p(), N(i, {
1037
+ key: 0,
1038
+ class: "b-listbox-multi-select__option-description",
1039
+ el: "span"
1040
+ }, {
1041
+ default: _(() => [
1042
+ oe(U(r.description), 1)
1043
+ ]),
1044
+ _: 2
1045
+ }, 1024)) : J("", !0)
1046
+ ])
1047
+ ], !0)
1048
+ ]),
1049
+ _: 2
1050
+ }, 1032, ["class", "disabled", "tabindex", "aria-selected", "aria-checked", "aria-disabled", "role", "onClick", "onEnterPressed", "onSpacePressed"])) : (p(), E(ue, { key: 1 }, [
1051
+ r.items ? (p(), N(u, {
1052
+ key: 0,
1053
+ category: r,
1054
+ "static-categories": e.staticCategories,
1055
+ "is-option-disabled": e.isOptionDisabled,
1056
+ "selected-items-list": e.selectedItemsList,
1057
+ tabindex: e.computedTabindex(r.value),
1058
+ onSelectCategory: (m) => e.$emit(e.ListboxMultiSelectOptionsEvent.SELECT_CATEGORY, r),
1059
+ onUnselectCategory: (m) => e.$emit(e.ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY, r),
1060
+ onToggleCategoryVisibility: l[1] || (l[1] = (m) => e.$emit(e.ListboxMultiSelectOptionsEvent.TOGGLE_CATEGORY_VISIBILITY, m))
1061
+ }, {
1062
+ default: _(() => [
1063
+ V(c, {
1064
+ "category-items": "",
1065
+ items: r.items,
1066
+ "is-option-disabled": e.isOptionDisabled,
1067
+ "items-index": e.itemsIndex,
1068
+ "focused-index": e.focusedIndex,
1069
+ "is-multi-level": e.isMultiLevel,
1070
+ "static-categories": e.staticCategories,
1071
+ "selected-items-list": e.selectedItemsList,
1072
+ searching: e.searching,
1073
+ role: e.$attrs.role || "option",
1074
+ onToggleCheckboxSelection: l[0] || (l[0] = (m) => e.toggleCheckboxSelection(m))
1075
+ }, null, 8, ["items", "is-option-disabled", "items-index", "focused-index", "is-multi-level", "static-categories", "selected-items-list", "searching", "role"])
1076
+ ]),
1077
+ _: 2
1078
+ }, 1032, ["category", "static-categories", "is-option-disabled", "selected-items-list", "tabindex", "onSelectCategory", "onUnselectCategory"])) : (p(), N(g, {
1079
+ key: 1,
1080
+ class: be(["b-listbox-multi-select-options", e.conditionalClasses]),
1081
+ disabled: e.isOptionDisabled ? e.isOptionDisabled(r) : null,
1082
+ tabindex: e.computedTabindex(r.value),
1083
+ "aria-selected": `${e.isOptionSelected(r)}`,
1084
+ "aria-checked": `${e.isOptionSelected(r)}`,
1085
+ "aria-disabled": e.isOptionDisabled ? e.isOptionDisabled(r) : null,
1086
+ role: e.$attrs.role || "option",
1087
+ onClick: (m) => e.toggleCheckboxSelection(r),
1088
+ onEnterPressed: (m) => e.toggleCheckboxSelection(r),
1089
+ onSpacePressed: Le((m) => e.toggleCheckboxSelection(r), ["prevent"])
1090
+ }, {
1091
+ default: _(() => [
1092
+ V(t, {
1093
+ disabled: e.isOptionDisabled ? e.isOptionDisabled(r) : null,
1094
+ checked: e.isOptionSelected(r)
1095
+ }, null, 8, ["disabled", "checked"]),
1096
+ Y(e.$slots, "default", R({ ref_for: !0 }, r), () => [
1097
+ q("span", Pl, [
1098
+ V(i, { el: "span" }, {
1099
+ default: _(() => [
1100
+ oe(U(r.label), 1)
1101
+ ]),
1102
+ _: 2
1103
+ }, 1024),
1104
+ e.shouldShowDescription(r) ? (p(), N(i, {
1105
+ key: 0,
1106
+ class: "b-listbox-multi-select__option-description",
1107
+ el: "span"
1108
+ }, {
1109
+ default: _(() => [
1110
+ oe(U(r.description), 1)
1111
+ ]),
1112
+ _: 2
1113
+ }, 1024)) : J("", !0)
1114
+ ])
1115
+ ], !0)
1116
+ ]),
1117
+ _: 2
1118
+ }, 1032, ["class", "disabled", "tabindex", "aria-selected", "aria-checked", "aria-disabled", "role", "onClick", "onEnterPressed", "onSpacePressed"]))
1119
+ ], 64))
1120
+ ]))), 128))
1121
+ ]);
1122
+ }
1123
+ const Vl = /* @__PURE__ */ ee(Ml, [["render", Fl], ["__scopeId", "data-v-237dfc58"]]), _t = (e) => {
1124
+ const l = d(() => !!e.value?.find(({ items: o }) => !!o)), n = d(() => l.value ? e.value?.reduce((o, a) => (a.items ? o.push(...a.items.flat()) : o.push(a), o), []) : e.value);
1125
+ return {
1126
+ isMultiLevelSelect: l,
1127
+ flattenedItemsList: n
1128
+ };
1129
+ }, Dt = {
1130
+ "de-DE": { allSelected: "Alle ausgewählt ({total})", numberOfTotalSelected: "{number} von {total} ausgewählt", numbersSelected: "{number} ausgewählt", selectAll: "Alle auswählen ({total})" },
1131
+ "en-GB": { allSelected: "All selected ({total})", numberOfTotalSelected: "{number} of {total} selected", numbersSelected: "{number} selected", selectAll: "Select all ({total})" },
1132
+ "en-US": { allSelected: "All selected ({total})", numberOfTotalSelected: "{number} of {total} selected", numbersSelected: "{number} selected", selectAll: "Select all ({total})" },
1133
+ "es-ES": { allSelected: "Todos seleccionados ({total})", numberOfTotalSelected: "{number} de {total} seleccionados", numbersSelected: "{number} seleccionado", selectAll: "Seleccionar todo ({total})" },
1134
+ "es-MX": { allSelected: "Todos seleccionados ({total})", numberOfTotalSelected: "{number} de {total} seleccionados", numbersSelected: "{número} seleccionado", selectAll: "Seleccionar todo ({total})" },
1135
+ "fr-FR": { allSelected: "Tous sélectionnés ({total})", numberOfTotalSelected: "{number} sélectionné(s) sur {total}", numbersSelected: "{number} sélectionné(s)", selectAll: "Tout sélectionner ({total})" },
1136
+ "it-IT": { allSelected: "Tutti i selezionati ({total})", numberOfTotalSelected: "{numero} su {totale} selezionati", numbersSelected: "{numero} selezionati", selectAll: "Seleziona tutto ({total})" },
1137
+ "ja-JP": { allSelected: "すべて選択 ({total})", numberOfTotalSelected: "{total}件中{number}件を選択済み", numbersSelected: "{number}件選択済み", selectAll: "すべて選択 ({total})" },
1138
+ "pt-BR": { allSelected: "Todos os selecionados ({total})", numberOfTotalSelected: "{number} de {total} selecionados", numbersSelected: "{number} selecionados", selectAll: "Selecionar tudo ({total})" },
1139
+ "zh-CN": { allSelected: "全部已选 ({total})", numberOfTotalSelected: "已选择 {number} 个,共 {total} 个", numbersSelected: "已选择 {number} 个", selectAll: "选择全部({total})个" }
1140
+ }, zl = { key: 0 }, Gl = ["role"], Kl = {
1141
+ key: 1,
1142
+ class: "b-listbox-multi-select__divider",
1143
+ "aria-hidden": "true"
1144
+ }, Ul = { i18n: { messages: Dt } }, ql = /* @__PURE__ */ Z({
1145
+ ...Ul,
1146
+ __name: "listbox-multi-select",
1147
+ props: {
1148
+ hasMoreItems: { type: Boolean, default: !1 },
1149
+ isOptionDisabled: { type: Function, default: () => !1 },
1150
+ items: {},
1151
+ lazyLoadType: { default: "none" },
1152
+ searching: { type: Boolean, default: !1 },
1153
+ selectedValues: {},
1154
+ staticCategories: { type: Boolean, default: !1 }
1155
+ },
1156
+ emits: ["select"],
1157
+ setup(e, { expose: l, emit: n }) {
1158
+ const o = e, a = n, { t: s, n: t } = ke({ messages: Dt }), i = Ve(), g = rt(), c = d(
1159
+ () => ({
1160
+ "aria-label": g["aria-label"]?.toString(),
1161
+ "aria-busy": g["aria-busy"]?.toString(),
1162
+ "aria-atomic": g["aria-atomic"]?.toString(),
1163
+ "aria-live": g["aria-live"]?.toString(),
1164
+ "aria-multiselectable": !0
1165
+ })
1166
+ ), u = $(null), r = $(null), m = $(null), v = $(null), O = d(() => o.selectedValues.map(({ value: h }) => h)), { isMultiLevelSelect: D, flattenedItemsList: y } = _t(ae(o, "items")), z = d(() => D.value && !o.staticCategories), C = d(() => z.value ? "tree" : "listbox"), T = d(() => z.value ? "treeitem" : "option"), B = (h) => {
1167
+ const A = o.isOptionDisabled(h), L = O.value?.includes(h.value) || !1;
1168
+ return { isDisabled: A, isPreSelected: L };
1169
+ }, k = d(() => {
1170
+ if (o.searching && D)
1171
+ return o.items;
1172
+ const h = y.value.filter((A) => {
1173
+ const { isDisabled: L, isPreSelected: j } = B(A);
1174
+ return L && j || !L;
1175
+ });
1176
+ return o.selectedValues.forEach((A) => {
1177
+ h.find((L) => L.value === A.value) || h.push(A);
1178
+ }), h;
1179
+ }), w = d(
1180
+ () => k.value?.filter((h) => h.items && D.value && o.searching ? h.items.filter(
1181
+ (L) => (o.selectedValues ?? []).includes(L.value)
1182
+ ).length === h.items.length : O.value?.includes(h.value))
1183
+ ), F = () => D.value && !o.searching ? y.value.length : o.items.length, I = d(() => {
1184
+ const h = k.value.length, A = F(), L = w.value?.length || 0;
1185
+ return L === 0 ? s("selectAll", { total: t(h) }) : L === A ? s("allSelected", { total: t(A) }) : L <= A ? s("numberOfTotalSelected", { number: t(L), total: t(A) }) : s("numbersSelected", { number: t(L) });
1186
+ }), M = (h) => {
1187
+ const A = (j) => {
1188
+ const { isDisabled: P, isPreSelected: S } = B(j);
1189
+ return P && S || !P;
1190
+ }, L = h.filter(A).filter((j) => !O.value.includes(j.value));
1191
+ a("select", [...o.selectedValues, ...L]);
1192
+ }, W = (h) => {
1193
+ const A = (P) => {
1194
+ const { isDisabled: S, isPreSelected: ce } = B(P);
1195
+ return !(S && ce);
1196
+ }, L = h.filter(A).map(({ value: P }) => P), j = o.selectedValues.filter((P) => !L?.includes(P.value));
1197
+ a("select", j);
1198
+ }, G = () => {
1199
+ M(y.value);
1200
+ }, x = () => {
1201
+ W(y.value);
1202
+ }, { isAllSelected: Q, isIndeterminate: we, toggleSelectAll: Me } = $t(
1203
+ w,
1204
+ k,
1205
+ G,
1206
+ x
1207
+ ), _e = d(() => we.value ? "mixed" : `${Q.value}`), X = $(Q.value), ie = () => {
1208
+ X.value = !X.value, Me(X.value);
1209
+ };
1210
+ Se(Q, () => {
1211
+ X.value = Q.value;
1212
+ });
1213
+ const ze = (h) => {
1214
+ M(h.items);
1215
+ }, Te = (h) => {
1216
+ W(h.items);
1217
+ }, ve = (h, A) => {
1218
+ let L = !1;
1219
+ const j = o.selectedValues.filter(({ value: P }) => A.value === P ? (L = !0, !1) : !0);
1220
+ L || j.push(A), a(h, j);
1221
+ }, je = d(() => {
1222
+ if (!D.value)
1223
+ return o.selectedValues;
1224
+ const h = (P) => O.value.includes(P.value), A = (P) => !o.staticCategories && P.every((S) => h(S));
1225
+ return o.items.flatMap(
1226
+ (P) => P.items && !A(P.items) ? P.items : P
1227
+ ).filter((P) => P.items ? !0 : h(P));
1228
+ }), He = d(() => {
1229
+ const h = ["automatic", "button"].includes(o.lazyLoadType), A = o.selectedValues?.length > 0 && w.value?.length !== y.value?.length;
1230
+ return h && o.hasMoreItems ? !!o.selectedValues?.length : A;
1231
+ }), Ne = d(() => ["automatic", "button"].includes(o.lazyLoadType) ? !o.hasMoreItems : !0), Ce = $([]), { visibleDomOptions: Ge, updateVisibleDomOptions: Je } = ct(
1232
+ u,
1233
+ ae(o, "items"),
1234
+ T
1235
+ ), Xe = (h) => {
1236
+ Ce.value.includes(h) ? Ce.value = Ce.value.filter((A) => A !== h) : Ce.value.push(h), se(() => {
1237
+ Je();
1238
+ });
1239
+ }, Ze = (h) => {
1240
+ Ge.value[h]?.focus();
1241
+ }, {
1242
+ moveToNextElement: Qe,
1243
+ moveToPreviousElement: Ke,
1244
+ moveToFirstElement: et,
1245
+ moveToLastElement: Ue,
1246
+ preventDefault: qe,
1247
+ focusedIndex: De,
1248
+ setListboxFocusedIndex: Pe
1249
+ } = kt(
1250
+ {
1251
+ items: Ge
1252
+ },
1253
+ Ze
1254
+ ), tt = {
1255
+ [H.ARROW_UP]: (h) => Ke(h),
1256
+ [H.ARROW_DOWN]: (h) => Qe(h),
1257
+ [H.HOME]: et,
1258
+ [H.END]: Ue
1259
+ };
1260
+ l({
1261
+ /**
1262
+ * Method to set the index of the item to be focused on
1263
+ * Used for focus management to be kept in-sync with parent e.g. dropdowns
1264
+ */
1265
+ setListboxFocusedIndex: Pe
1266
+ });
1267
+ const lt = {
1268
+ [H.ARROW_UP]: qe,
1269
+ [H.ARROW_DOWN]: qe
1270
+ }, ot = d(() => {
1271
+ let h = Ne.value ? 1 : 0;
1272
+ const A = {};
1273
+ return o.items.forEach((L) => {
1274
+ let j = Ce.value.includes(L.value);
1275
+ L.items ? (o.staticCategories ? j = !0 : A[L.value] = h++, j && L.items.forEach((P) => A[P.value] = h++)) : A[L.value] = h++;
1276
+ }), A;
1277
+ });
1278
+ return (h, A) => (p(), E("div", {
1279
+ ref_key: "listboxRef",
1280
+ ref: u,
1281
+ class: "b-listbox-multi-select"
1282
+ }, [
1283
+ He.value ? (p(), E("div", zl, [
1284
+ de((p(), E("ul", R({ class: "b-listbox-multi-select__chips" }, ne(lt, !0)), [
1285
+ (p(!0), E(ue, null, le(je.value, (L) => (p(), E("li", {
1286
+ key: L.value
1287
+ }, [
1288
+ V(b(Jt), {
1289
+ ref_for: !0,
1290
+ ref_key: "selectedListboxItemsRef",
1291
+ ref: m,
1292
+ disabled: h.isOptionDisabled(L),
1293
+ label: L.label,
1294
+ condensed: "",
1295
+ onClick: (j) => L.items ? Te(L) : ve("select", L)
1296
+ }, null, 8, ["disabled", "label", "onClick"])
1297
+ ]))), 128))
1298
+ ], 16)), [
1299
+ [b(Fe)]
1300
+ ]),
1301
+ A[4] || (A[4] = q("hr", {
1302
+ class: "b-listbox-multi-select__divider",
1303
+ "aria-hidden": "true"
1304
+ }, null, -1))
1305
+ ])) : J("", !0),
1306
+ de((p(), E("div", R(c.value, { role: C.value }, ne(tt, !0)), [
1307
+ Ne.value ? (p(), N(b(We), {
1308
+ key: 0,
1309
+ ref_key: "selectAllListboxItemsRef",
1310
+ ref: r,
1311
+ class: "b-listbox-multi-select__option",
1312
+ tabindex: b(De) === 0 ? 0 : -1,
1313
+ "aria-selected": _e.value !== "false",
1314
+ "aria-checked": _e.value,
1315
+ role: T.value,
1316
+ onClick: ie,
1317
+ onEnterPressed: ie,
1318
+ onSpacePressed: Le(ie, ["prevent"])
1319
+ }, {
1320
+ default: _(() => [
1321
+ V(b(ut), {
1322
+ checked: b(Q),
1323
+ indeterminate: b(we)
1324
+ }, null, 8, ["checked", "indeterminate"]),
1325
+ V(b(Ie), { el: "span" }, {
1326
+ default: _(() => [
1327
+ oe(U(I.value), 1)
1328
+ ]),
1329
+ _: 1
1330
+ })
1331
+ ]),
1332
+ _: 1
1333
+ }, 8, ["tabindex", "aria-selected", "aria-checked", "role"])) : J("", !0),
1334
+ Ne.value ? (p(), E("hr", Kl)) : J("", !0),
1335
+ V(b(Vl), {
1336
+ ref_key: "listboxItemsRef",
1337
+ ref: v,
1338
+ items: h.items,
1339
+ "is-option-disabled": h.isOptionDisabled,
1340
+ "is-multi-level": b(D),
1341
+ "static-categories": h.staticCategories,
1342
+ searching: h.searching,
1343
+ "selected-items-list": O.value,
1344
+ "focused-index": b(De),
1345
+ "items-index": ot.value,
1346
+ role: T.value,
1347
+ onToggleCheckboxSelection: A[0] || (A[0] = (L) => ve("select", L)),
1348
+ onSelectCategory: ze,
1349
+ onUnselectCategory: Te,
1350
+ onToggleCategoryVisibility: Xe,
1351
+ onSpacePressed: A[1] || (A[1] = (L) => ve(b(f).SPACE, L)),
1352
+ onTabPressed: A[2] || (A[2] = (L) => ve(b(f).TAB, L)),
1353
+ onEnterPressed: A[3] || (A[3] = (L) => ve(b(f).ENTER, L))
1354
+ }, me({ _: 2 }, [
1355
+ le(b(i), (L, j) => ({
1356
+ name: j,
1357
+ fn: _((P) => [
1358
+ Y(h.$slots, j, re(he(P)), void 0, !0)
1359
+ ])
1360
+ }))
1361
+ ]), 1032, ["items", "is-option-disabled", "is-multi-level", "static-categories", "searching", "selected-items-list", "focused-index", "items-index", "role"])
1362
+ ], 16, Gl)), [
1363
+ [b(Fe)]
1364
+ ])
1365
+ ], 512));
1366
+ }
1367
+ }), gt = /* @__PURE__ */ ee(ql, [["__scopeId", "data-v-4abd31b6"]]), Bt = (e, l = 300) => {
1368
+ let n;
1369
+ return (...a) => {
1370
+ n && clearTimeout(n), n = setTimeout(() => e(...a), l);
1371
+ };
1372
+ }, ht = {
1373
+ "de-DE": { loading: "Laden", showMore: "Mehr anzeigen" },
1374
+ "en-GB": { loading: "Loading", showMore: "Show more" },
1375
+ "en-US": { loading: "Loading", showMore: "Show more" },
1376
+ "es-ES": { loading: "Cargando", showMore: "Mostrar más" },
1377
+ "es-MX": { loading: "Cargando", showMore: "Mostrar más" },
1378
+ "fr-FR": { loading: "Chargement", showMore: "Afficher plus" },
1379
+ "it-IT": { loading: "Caricamento", showMore: "Mostra di più" },
1380
+ "ja-JP": { loading: "読み込み中", showMore: "さらに表示" },
1381
+ "pt-BR": { loading: "Carregando", showMore: "Mostrar mais" },
1382
+ "zh-CN": { loading: "正在加载", showMore: "显示更多" }
1383
+ }, Yl = 36, Wl = Z({
1384
+ name: "bento-listbox",
1385
+ components: {
1386
+ BentoEmptyState: Yt,
1387
+ BentoListboxSingleSelect: El,
1388
+ BentoListboxMultiSelect: gt,
1389
+ BentoTypography: Ie,
1390
+ BentoLoadingIndicator: qt,
1391
+ BentoLoadingButton: Xt
1392
+ },
1393
+ directives: { BentoKeyboardNavigationDirective: Fe },
1394
+ i18n: { messages: ht },
1395
+ props: {
1396
+ /**
1397
+ * Defines a string value that labels an interactive element.
1398
+ */
1399
+ ariaLabel: { type: String, default: null },
1400
+ /**
1401
+ * Empty state props that will be used with the inner empty state component to be displayed when no search results are found.
1402
+ */
1403
+ emptyState: {
1404
+ type: Object,
1405
+ default: void 0
1406
+ },
1407
+ /**
1408
+ * Indicates whether there are more items to load
1409
+ */
1410
+ hasMoreItems: { type: Boolean, default: !1 },
1411
+ /**
1412
+ * Identifies the listbox whose contents are controlled by the the combobox on which the aria-controls attribute is set.
1413
+ */
1414
+ id: { type: String, required: !0 },
1415
+ /**
1416
+ * Function that allows the options to be disabled
1417
+ *
1418
+ * @type {BentoListboxIsOptionDisabled}
1419
+ * @param {BentoListboxOptionItem} option - Listbox option object
1420
+ * @param {string} option.label - Option's label text
1421
+ * @param {string|number} option.value - Option's value
1422
+ * @param {unknown} option.data - Option's extra data to be passed to the default slot
1423
+ */
1424
+ isOptionDisabled: {
1425
+ type: Function,
1426
+ default: () => {
1427
+ }
1428
+ },
1429
+ /**
1430
+ * The option elements to populate the listbox with.
1431
+ * It must be an array of {@see BentoListboxOptionItem }
1432
+ * * @property {string} value.label - Text to be displayed in the option
1433
+ * * @property {string,number} value.value - Value of the option
1434
+ */
1435
+ items: {
1436
+ type: Array,
1437
+ required: !0
1438
+ },
1439
+ /**
1440
+ * Indicates if new options are lazy loading.
1441
+ */
1442
+ loading: { type: Boolean, default: !1 },
1443
+ /**
1444
+ * The type of `Lazy Load`.
1445
+ * Type "automatic" will enable infinite scrolling
1446
+ * Type "button" will enable lazy loading with "Show more" button
1447
+ */
1448
+ lazyLoadType: {
1449
+ type: String,
1450
+ default: Ee.NONE,
1451
+ validator: (e) => Object.values(Ee).includes(e)
1452
+ },
1453
+ /**
1454
+ * Indicates the listbox is loading filtered items.
1455
+ */
1456
+ componentLoading: { type: Boolean, default: !1 },
1457
+ /**
1458
+ * If enabled, the user will be able to select multiple items.
1459
+ */
1460
+ multiple: { type: Boolean, default: !1 },
1461
+ /**
1462
+ * If enabled, dropdown will display non-selectable, static categories
1463
+ */
1464
+ staticCategories: { type: Boolean, default: !1 },
1465
+ /**
1466
+ * Messaged displayed when no items are listed in the listbox
1467
+ */
1468
+ noResultsMessage: { type: String, required: !0 },
1469
+ /**
1470
+ * Flag that indicates that an external search it's being made
1471
+ * to filter out the items inside the the multi-select listbox
1472
+ *
1473
+ * If enabled, hides the "Select all" checkbox in "multiple" mode.
1474
+ */
1475
+ searching: gt.props.searching,
1476
+ /**
1477
+ * The `input` value.
1478
+ * Providing an empty string or empty array will select no options.
1479
+ * Set to an empty string `''` if you don't want any of the available options to be selected for single select
1480
+ */
1481
+ selectedValue: {
1482
+ type: Array,
1483
+ default: () => []
1484
+ },
1485
+ /**
1486
+ * Enables virtual scrolling if set to true or by providing an object with itemHeight function.
1487
+ * The itemHeight function is used to calculate the height of rendered item given it's index.
1488
+ */
1489
+ virtualScroll: {
1490
+ type: [Boolean, Object],
1491
+ default: !1
1492
+ }
1493
+ },
1494
+ emits: [
1495
+ f.SELECT,
1496
+ f.SPACE,
1497
+ f.SHOW_MORE,
1498
+ f.ENTER,
1499
+ f.ESCAPE,
1500
+ f.TAB
1501
+ ],
1502
+ setup(e, { emit: l, slots: n }) {
1503
+ const o = $([]), a = ae(e, "items"), { t: s } = ke({ messages: ht }), t = d(() => e.lazyLoadType !== Ee.AUTOMATIC), i = d(() => e.lazyLoadType === Ee.AUTOMATIC), g = () => typeof e?.virtualScroll == "object" && e?.virtualScroll?.itemHeight ? e.virtualScroll.itemHeight : Yl, c = !e?.multiple && e?.virtualScroll !== !1 && e?.lazyLoadType === "none", {
1504
+ containerRef: u,
1505
+ containerProps: r,
1506
+ onScroll: m,
1507
+ list: v,
1508
+ wrapperProps: O,
1509
+ scrollToIndex: D,
1510
+ startIndex: y
1511
+ } = al(a, {
1512
+ itemHeight: g(),
1513
+ // Disable virtual scrolling if not enabled or if lazy loading is enabled or if multi-select
1514
+ disabled: !c
1515
+ }), z = d(() => c ? a.value.length : 0), C = d(
1516
+ () => e.componentLoading !== void 0 || t.value ? "true" : void 0
1517
+ ), T = d(
1518
+ () => t.value && e.loading || e.componentLoading ? "true" : "false"
1519
+ ), B = d(
1520
+ () => t.value || e.componentLoading !== void 0 ? "polite" : void 0
1521
+ ), k = d(
1522
+ () => ({
1523
+ "aria-label": e.ariaLabel,
1524
+ "aria-busy": T.value,
1525
+ "aria-atomic": C.value,
1526
+ "aria-live": B.value
1527
+ })
1528
+ ), w = d(
1529
+ () => e.componentLoading ? {
1530
+ ...k.value,
1531
+ role: "alert"
1532
+ } : {}
1533
+ ), F = (X) => (ie) => {
1534
+ l(X, ie);
1535
+ }, I = () => {
1536
+ l(f.SHOW_MORE);
1537
+ }, M = Bt(() => {
1538
+ const X = u.value;
1539
+ if (!X)
1540
+ return;
1541
+ const ie = Math.round(X.scrollTop) + X.clientHeight >= X.scrollHeight;
1542
+ e.hasMoreItems && ie && !e.loading && I();
1543
+ }), W = () => {
1544
+ i.value ? M() : m();
1545
+ }, G = d(() => e.items?.length === 0), x = d(
1546
+ () => e.lazyLoadType === Ee.BUTTON && e.hasMoreItems
1547
+ ), Q = d(
1548
+ () => e.loading ? bt.LOADING : bt.START
1549
+ ), we = d(() => e.loading ? s("loading") : s("showMore")), Me = d(() => ({
1550
+ ...e.emptyState,
1551
+ variant: "condensed"
1552
+ })), _e = {
1553
+ [f.SELECT]: F(f.SELECT),
1554
+ [f.SPACE]: F(f.SPACE),
1555
+ [f.TAB]: F(f.TAB),
1556
+ [f.ENTER]: F(f.ENTER)
1557
+ };
1558
+ return {
1559
+ // Refs
1560
+ listboxRef: u,
1561
+ listboxItemRef: o,
1562
+ // a11y
1563
+ ariaAttributes: k,
1564
+ listboxContainerAttributes: w,
1565
+ // Values
1566
+ containerProps: r,
1567
+ isSearchResultEmpty: G,
1568
+ limitedEmptyStateProps: Me,
1569
+ loadingButtonState: Q,
1570
+ slots: n,
1571
+ shouldDisplayShowMoreButton: x,
1572
+ showMoreButtonText: we,
1573
+ virtualisedItems: v,
1574
+ wrapperProps: O,
1575
+ // Virtual scroll
1576
+ totalItemCount: z,
1577
+ scrollToIndex: D,
1578
+ virtualScrollStartIndex: y,
1579
+ // Enums
1580
+ BentoKeyboardNavigationKeyDownEvent: H,
1581
+ BentoListboxEvent: f,
1582
+ // Methods
1583
+ onListboxContainerScroll: W,
1584
+ onOptionSelected: F,
1585
+ emitShowMore: I,
1586
+ listboxListeners: _e
1587
+ };
1588
+ }
1589
+ }), jl = ["id"], Hl = {
1590
+ key: 0,
1591
+ class: "b-listbox__loading-filtered-items"
1592
+ }, Jl = {
1593
+ key: 1,
1594
+ class: "b-listbox__empty-search-message"
1595
+ }, Xl = {
1596
+ key: 2,
1597
+ class: "b-listbox__lazy-load"
1598
+ }, Zl = {
1599
+ key: 3,
1600
+ class: "b-listbox__lazy-load"
1601
+ };
1602
+ function Ql(e, l, n, o, a, s) {
1603
+ const t = K("bento-loading-indicator"), i = K("bento-empty-state"), g = K("bento-typography"), c = K("bento-listbox-multi-select"), u = K("bento-listbox-single-select"), r = K("bento-loading-button"), m = Et("bento-keyboard-navigation-directive");
1604
+ return de((p(), E("div", R({
1605
+ id: e.id,
1606
+ ref: "listboxRef",
1607
+ class: "b-listbox",
1608
+ tabindex: "-1"
1609
+ }, e.listboxContainerAttributes, {
1610
+ style: e.containerProps?.style,
1611
+ "data-testid": "listbox-container",
1612
+ onScroll: l[0] || (l[0] = (...v) => e.onListboxContainerScroll && e.onListboxContainerScroll(...v))
1613
+ }), [
1614
+ q("div", re(he(e.wrapperProps)), [
1615
+ e.componentLoading ? (p(), E("div", Hl, [
1616
+ V(t)
1617
+ ])) : e.isSearchResultEmpty ? (p(), E("div", Jl, [
1618
+ e.emptyState ? (p(), N(i, re(R({ key: 0 }, e.limitedEmptyStateProps)), null, 16)) : (p(), N(g, {
1619
+ key: 1,
1620
+ el: "span"
1621
+ }, {
1622
+ default: _(() => [
1623
+ oe(U(e.noResultsMessage), 1)
1624
+ ]),
1625
+ _: 1
1626
+ }))
1627
+ ])) : (p(), E(ue, { key: 2 }, [
1628
+ e.multiple ? (p(), N(c, R({
1629
+ key: 0,
1630
+ ref: "listboxItemRef",
1631
+ "has-more-items": e.hasMoreItems
1632
+ }, e.ariaAttributes, {
1633
+ items: e.items,
1634
+ "lazy-load-type": e.lazyLoadType,
1635
+ "static-categories": e.staticCategories,
1636
+ "selected-values": e.selectedValue,
1637
+ searching: e.searching,
1638
+ "is-option-disabled": e.isOptionDisabled
1639
+ }, ne(e.listboxListeners)), me({ _: 2 }, [
1640
+ le(e.slots, (v, O) => ({
1641
+ name: O,
1642
+ fn: _((D) => [
1643
+ Y(e.$slots, O, re(he(D)), void 0, !0)
1644
+ ])
1645
+ }))
1646
+ ]), 1040, ["has-more-items", "items", "lazy-load-type", "static-categories", "selected-values", "searching", "is-option-disabled"])) : (p(), N(u, R({
1647
+ key: 1,
1648
+ ref: "listboxItemRef",
1649
+ items: e.virtualisedItems,
1650
+ "total-item-count": e.totalItemCount,
1651
+ "scroll-to-index": e.scrollToIndex,
1652
+ "virtual-scroll-start-index": e.virtualScrollStartIndex
1653
+ }, e.ariaAttributes, {
1654
+ "selected-value": e.selectedValue,
1655
+ "static-categories": e.staticCategories,
1656
+ "is-option-disabled": e.isOptionDisabled
1657
+ }, ne(e.listboxListeners)), me({ _: 2 }, [
1658
+ le(e.slots, (v, O) => ({
1659
+ name: O,
1660
+ fn: _((D) => [
1661
+ Y(e.$slots, O, re(he(D)), void 0, !0)
1662
+ ])
1663
+ }))
1664
+ ]), 1040, ["items", "total-item-count", "scroll-to-index", "virtual-scroll-start-index", "selected-value", "static-categories", "is-option-disabled"])),
1665
+ e.shouldDisplayShowMoreButton ? (p(), E("div", Xl, [
1666
+ V(r, {
1667
+ state: e.loadingButtonState,
1668
+ variant: "secondary",
1669
+ onClickCapture: e.emitShowMore
1670
+ }, {
1671
+ default: _(() => [
1672
+ oe(U(e.showMoreButtonText), 1)
1673
+ ]),
1674
+ _: 1
1675
+ }, 8, ["state", "onClickCapture"])
1676
+ ])) : e.loading ? (p(), E("div", Zl, [
1677
+ V(t)
1678
+ ])) : J("", !0)
1679
+ ], 64))
1680
+ ], 16)
1681
+ ], 16, jl)), [
1682
+ [m]
1683
+ ]);
1684
+ }
1685
+ const nt = /* @__PURE__ */ ee(Wl, [["render", Ql], ["__scopeId", "data-v-7026ea79"]]), it = (e, l) => {
1686
+ for (const n of e) {
1687
+ if (n.value === l)
1688
+ return n;
1689
+ if (n.items) {
1690
+ const o = it(n.items, l);
1691
+ if (o)
1692
+ return o;
1693
+ }
1694
+ }
1695
+ return null;
1696
+ }, eo = (e) => typeof e == "object" && e !== null && "value" in e && "label" in e, to = (e, l, n, o) => {
1697
+ const a = $([]), s = $(), t = (u) => {
1698
+ n.value ? s.value = u.map(({ value: r }) => r) : s.value = u.length > 0 ? u[0].value : null;
1699
+ }, i = (u) => {
1700
+ n.value ? s.value = u.map(({ value: r, label: m }) => ({ value: r, label: m })) : s.value = u.length > 0 ? { value: u[0].value, label: u[0].label } : null;
1701
+ }, g = (u) => {
1702
+ a.value = u, o?.value ? i(u) : t(u);
1703
+ }, c = () => {
1704
+ a.value = [], s.value = null;
1705
+ };
1706
+ return Se(
1707
+ () => l.value,
1708
+ () => {
1709
+ if (!l.value && l.value !== 0) {
1710
+ c();
1711
+ return;
1712
+ }
1713
+ const u = !Array.isArray(l.value), r = [...a.value];
1714
+ c();
1715
+ const m = (v) => {
1716
+ if (eo(v))
1717
+ a.value.push(v);
1718
+ else {
1719
+ let O = it(e.value, v);
1720
+ O || (O = it(r, v)), O || (O = { value: v, label: v.toString() }), a.value.push(O);
1721
+ }
1722
+ };
1723
+ if (u) {
1724
+ const v = l.value;
1725
+ m(v), o?.value ? i(a.value) : t(a.value);
1726
+ return;
1727
+ }
1728
+ l.value.forEach(m), o?.value ? i(a.value) : t(a.value);
1729
+ },
1730
+ { immediate: !0 }
1731
+ ), {
1732
+ // Values
1733
+ cachedSelectedListboxOptions: a,
1734
+ cachedListboxSelectedValues: s,
1735
+ // Methods
1736
+ resetCache: c,
1737
+ setCachedValues: g
1738
+ };
1739
+ };
1740
+ var xe = /* @__PURE__ */ ((e) => (e.DEFAULT = "DropdownInputDefault", e.SMALL = "DropdownInputSmall", e))(xe || {});
1741
+ const pt = {
1742
+ "de-DE": { apply: "Anwenden", cancel: "Abbrechen", noOptionsMatchThisSearch: "Für diese Suche wurden keine Ergebnisse gefunden." },
1743
+ "en-GB": { apply: "Apply", cancel: "Cancel", noOptionsMatchThisSearch: "No options match this search" },
1744
+ "en-US": { apply: "Apply", cancel: "Cancel", noOptionsMatchThisSearch: "No options match this search" },
1745
+ "es-ES": { apply: "Aplicar", cancel: "Cancelar", noOptionsMatchThisSearch: "No hay opciones que coincidan con esta búsqueda" },
1746
+ "es-MX": { apply: "Aplicar", cancel: "Cancelar", noOptionsMatchThisSearch: "No hay opciones que coincidan con esta búsqueda" },
1747
+ "fr-FR": { apply: "Appliquer", cancel: "Annuler", noOptionsMatchThisSearch: "Aucune option ne correspond à cette recherche" },
1748
+ "it-IT": { apply: "Applica", cancel: "Annulla", noOptionsMatchThisSearch: "Nessun risultato corrispondente a questa ricerca" },
1749
+ "ja-JP": { apply: "適用", cancel: "キャンセル", noOptionsMatchThisSearch: "この検索に一致するオプションはありません" },
1750
+ "pt-BR": { apply: "Aplicar", cancel: "Cancelar", noOptionsMatchThisSearch: "Nenhuma opção corresponde a esta busca" },
1751
+ "zh-CN": { apply: "应用", cancel: "取消", noOptionsMatchThisSearch: "没有符合此搜索条件的选项" }
1752
+ }, lo = (e, l, n, o) => {
1753
+ const a = $(e.value), { t: s } = ke({ messages: pt });
1754
+ Se(e, () => {
1755
+ a.value = e.value;
1756
+ });
1757
+ const t = d(
1758
+ () => JSON.stringify(a.value) === JSON.stringify(e.value)
1759
+ ), i = () => {
1760
+ o(f.SELECT, a.value), o(f.CLOSE_DROPDOWN);
1761
+ }, g = () => {
1762
+ a.value = e.value, o(f.CLOSE_DROPDOWN);
1763
+ }, c = () => {
1764
+ n.value && l.value && (a.value = e.value);
1765
+ }, u = d(() => [
1766
+ {
1767
+ title: s("apply"),
1768
+ event: i,
1769
+ disabled: t.value
1770
+ },
1771
+ {
1772
+ title: s("cancel"),
1773
+ event: g
1774
+ }
1775
+ ]), r = (C) => {
1776
+ a.value = C, l.value || o(f.SELECT, C);
1777
+ }, m = (C) => {
1778
+ r(C), o(f.TAB);
1779
+ }, v = (C) => {
1780
+ r(C), o(f.ENTER);
1781
+ }, O = (C) => {
1782
+ r(C), o(f.SPACE);
1783
+ }, D = () => {
1784
+ g(), o(f.ESCAPE);
1785
+ }, y = () => {
1786
+ o(f.SHOW_MORE);
1787
+ }, z = {
1788
+ [f.SELECT]: r,
1789
+ [f.SHOW_MORE]: y,
1790
+ [f.TAB]: m,
1791
+ [f.SPACE]: O,
1792
+ [f.ENTER]: v
1793
+ };
1794
+ return {
1795
+ // Values
1796
+ actions: u,
1797
+ internalSelectedValue: a,
1798
+ // Methods
1799
+ listeners: z,
1800
+ onEscapeKey: D,
1801
+ onOutsideDropdownClick: c
1802
+ };
1803
+ }, oo = Z({
1804
+ i18n: { messages: pt },
1805
+ name: "bento-dropdown-options-container"
1806
+ }), ao = /* @__PURE__ */ Z({
1807
+ ...oo,
1808
+ props: {
1809
+ /**
1810
+ * Defines a string value that labels an interactive element.
1811
+ */
1812
+ ariaLabel: { type: String, default: null },
1813
+ /**
1814
+ * Indicates that dropdown items are loading
1815
+ */
1816
+ componentLoading: { type: Boolean, default: !1 },
1817
+ /**
1818
+ * Empty state props used with the inner empty state component which is displayed when no search results are found.
1819
+ */
1820
+ emptyState: {
1821
+ type: Object,
1822
+ default: void 0
1823
+ },
1824
+ /**
1825
+ * Disables dropdown functionality
1826
+ */
1827
+ disabled: { type: Boolean, default: !1 },
1828
+ /**
1829
+ * Indicates whether there are more items to load
1830
+ */
1831
+ hasMoreItems: { type: Boolean, default: !1 },
1832
+ /**
1833
+ * Identifies the listbox whose contents are controlled by the the combobox on which the aria-controls attribute is set.
1834
+ */
1835
+ id: { type: String, required: !0 },
1836
+ /**
1837
+ * Function that allows the options to be disabled
1838
+ *
1839
+ * @type {BentoDropdownIsOptionDisabled}
1840
+ * @param {BentoDropdownOptionItem} option - Dropdown option object
1841
+ * @param {string} option.label - Option's label text
1842
+ * @param {string|number} option.value - Option's value
1843
+ * @param {unknown} option.data - Option's extra data to be passed to the default slot
1844
+ */
1845
+ isOptionDisabled: {
1846
+ type: Function,
1847
+ default: void 0
1848
+ },
1849
+ /**
1850
+ * The option elements to populate the dropdown with.
1851
+ * It must be an array of {@see BentoDropdownOptionItem }
1852
+ * * @property {string} value.label - Text to be displayed in the option
1853
+ * * @property {string,number} value.value - Value of the option
1854
+ */
1855
+ items: {
1856
+ type: Array,
1857
+ required: !0
1858
+ },
1859
+ /**
1860
+ * The type of `Lazy Load`.
1861
+ * Type "automatic" will enable infinite scrolling
1862
+ * Type "button" will enable lazy loading with "Show more" button
1863
+ */
1864
+ lazyLoadType: {
1865
+ type: String,
1866
+ default: Ee.AUTOMATIC,
1867
+ validator: (e) => Object.values(Ee).includes(e)
1868
+ },
1869
+ /**
1870
+ * Indicates if new options are lazy loading.
1871
+ */
1872
+ loading: { type: Boolean, default: !1 },
1873
+ /**
1874
+ * If enabled, the user will be able to select multiple items.
1875
+ */
1876
+ multiple: { type: Boolean, default: !1 },
1877
+ /**
1878
+ * Indicates if the dropdown is open so that
1879
+ * the container can be displayed.
1880
+ */
1881
+ open: { type: Boolean, required: !0 },
1882
+ /**
1883
+ * The `input` value.
1884
+ * Providing an empty string or empty array will select no options.
1885
+ * Set to an empty string `''` if you don't want any of the available options to be selected for single select
1886
+ */
1887
+ selectedValue: {
1888
+ type: Array,
1889
+ default: null
1890
+ },
1891
+ /**
1892
+ * Flag that indicates that an external search it's being made
1893
+ * to filter out the items inside the the multi-select listbox
1894
+ *
1895
+ * If enabled, hides the "Select all" checkbox in "multiple" mode.
1896
+ */
1897
+ searching: nt.props.searching,
1898
+ /**
1899
+ * If enabled, dropdown will display non-selectable, static categories
1900
+ */
1901
+ staticCategories: { type: Boolean, default: !1 },
1902
+ /**
1903
+ * Reference to the DOM element or Vue component for positioning
1904
+ * the Dropdown container.
1905
+ */
1906
+ targetElement: { type: ft.props.targetElement.type, required: !0 },
1907
+ /**
1908
+ * Enables virtual scrolling if set to true or by providing an object with itemHeight function.
1909
+ * The itemHeight function is used to calculate the height of rendered item given it's index.
1910
+ */
1911
+ virtualScroll: {
1912
+ type: [Boolean, Object],
1913
+ default: !1
1914
+ }
1915
+ },
1916
+ setup(e, { expose: l, emit: n }) {
1917
+ const o = Ve(), a = n, s = e, { selectedValue: t, multiple: i } = Ot(s), g = $(null), { t: c } = ke({ messages: pt }), u = d(() => s.open && !s.disabled), r = d(() => c("noOptionsMatchThisSearch")), m = d(() => ({
1918
+ "b-dropdown-options-container--single": !s?.multiple
1919
+ })), v = d(() => ({
1920
+ "b-dropdown-options-container__listbox--single": !s?.multiple
1921
+ })), { actions: O, internalSelectedValue: D, listeners: y, onEscapeKey: z, onOutsideDropdownClick: C } = lo(t, i, u, a), T = d(() => s?.multiple ? Zt : ft), B = d(() => {
1922
+ const k = {
1923
+ "min-width": `${s?.targetElement?.clientWidth}px`,
1924
+ "max-width": "min(500px, 95%)"
1925
+ };
1926
+ return s?.multiple ? {
1927
+ actionsLayout: "space-between",
1928
+ ariaLabel: s.ariaLabel,
1929
+ actions: O.value,
1930
+ divider: !0,
1931
+ fallbackPosition: ["top-start"],
1932
+ id: Oe(`dropdown-options-${s.id}`),
1933
+ open: s.open,
1934
+ position: "bottom-start",
1935
+ style: {
1936
+ width: "auto",
1937
+ ...k
1938
+ },
1939
+ targetElement: s.targetElement
1940
+ } : {
1941
+ fallbackPosition: ["top-start"],
1942
+ offset: [0, 8],
1943
+ position: "bottom-start",
1944
+ style: {
1945
+ display: u.value ? "block" : "none",
1946
+ ...k
1947
+ },
1948
+ targetElement: s.targetElement
1949
+ };
1950
+ });
1951
+ return l({
1952
+ onOutsideDropdownClick: C
1953
+ }), (k, w) => u.value ? (p(), N(Lt(T.value), R({
1954
+ key: 0,
1955
+ class: ["b-dropdown-options-container", m.value]
1956
+ }, B.value), {
1957
+ default: _(() => [
1958
+ q("div", {
1959
+ onKeydown: w[0] || (w[0] = fe(
1960
+ //@ts-ignore
1961
+ (...F) => b(z) && b(z)(...F),
1962
+ ["esc"]
1963
+ ))
1964
+ }, [
1965
+ V(b(nt), R({
1966
+ id: e.id,
1967
+ ref_key: "dropdownOptionsListboxRef",
1968
+ ref: g,
1969
+ "aria-label": e.ariaLabel,
1970
+ class: ["b-dropdown-options-container__listbox", v.value],
1971
+ "component-loading": e.componentLoading,
1972
+ "empty-state": e.emptyState,
1973
+ "is-option-disabled": e.isOptionDisabled,
1974
+ items: e.items,
1975
+ "selected-value": b(D),
1976
+ multiple: b(i),
1977
+ "static-categories": e.staticCategories,
1978
+ "no-results-message": r.value,
1979
+ searching: e.searching,
1980
+ loading: e.loading,
1981
+ "lazy-load-type": e.lazyLoadType,
1982
+ "has-more-items": e.hasMoreItems,
1983
+ "virtual-scroll": e.virtualScroll
1984
+ }, ne(b(y))), me({ _: 2 }, [
1985
+ le(b(o), (F, I) => ({
1986
+ name: I,
1987
+ fn: _((M) => [
1988
+ Y(k.$slots, I, re(he(M)), void 0, !0)
1989
+ ])
1990
+ }))
1991
+ ]), 1040, ["id", "aria-label", "class", "component-loading", "empty-state", "is-option-disabled", "items", "selected-value", "multiple", "static-categories", "no-results-message", "searching", "loading", "lazy-load-type", "has-more-items", "virtual-scroll"])
1992
+ ], 32)
1993
+ ]),
1994
+ _: 3
1995
+ }, 16, ["class"])) : J("", !0);
1996
+ }
1997
+ }), so = /* @__PURE__ */ ee(ao, [["__scopeId", "data-v-f5790908"]]);
1998
+ var pe = /* @__PURE__ */ ((e) => (e.DISABLED = "disabled", e.READONLY = "readonly", e.HAS_ITEMS = "has-items", e.OPENED = "opened", e.ERROR = "error", e))(pe || {}), te = /* @__PURE__ */ ((e) => (e.OPEN = "dropdown-base-open", e.KEYDOWN = "dropdown-base-keydown", e.CLOSE = "dropdown-base-close", e.INPUT = "dropdown-base-input", e.CLEAR = "dropdown-base-clear", e))(te || {});
1999
+ const no = /* @__PURE__ */ Symbol("dropdown small size injection key"), xt = /* @__PURE__ */ Symbol("dropdown underline style injection key"), Rt = {
2000
+ "de-DE": { clearSearch: "Suche löschen" },
2001
+ "en-GB": { clearSearch: "Clear search" },
2002
+ "en-US": { clearSearch: "Clear search" },
2003
+ "es-ES": { clearSearch: "Borrar búsqueda" },
2004
+ "es-MX": { clearSearch: "Borrar búsqueda" },
2005
+ "fr-FR": { clearSearch: "Effacer la recherche" },
2006
+ "it-IT": { clearSearch: "Cancella ricerca" },
2007
+ "ja-JP": { clearSearch: "検索をクリア" },
2008
+ "pt-BR": { clearSearch: "Limpar busca" },
2009
+ "zh-CN": { clearSearch: "清除搜索" }
2010
+ }, io = ["id", "value", "disabled", "readonly", "required"], ro = ["id", "aria-readonly", "tabindex"], co = {
2011
+ key: 1,
2012
+ class: "b-dropdown-base-textbox__input-multiple-selected"
2013
+ }, uo = { class: "b-dropdown-base-textbox__input-selected-element" }, po = {
2014
+ key: 2,
2015
+ class: "b-dropdown-base-textbox__additional-items"
2016
+ }, bo = {
2017
+ key: 3,
2018
+ class: "b-dropdown-base-textbox__icon",
2019
+ "aria-hidden": "true"
2020
+ }, fo = ["tabindex", "onKeydown"], mo = Z({
2021
+ i18n: { messages: Rt },
2022
+ name: "dropdown-base-textbox",
2023
+ inheritAttrs: !1
2024
+ }), vo = /* @__PURE__ */ Z({
2025
+ ...mo,
2026
+ props: {
2027
+ /**
2028
+ * The number of additional items that have been selected in the dropdown.
2029
+ */
2030
+ additionalItemsSelected: { type: [Number, String], default: 0 },
2031
+ /**
2032
+ * If the combobox DOM element should be an `input` element.
2033
+ */
2034
+ alwaysComboboxIsInput: {
2035
+ type: Boolean,
2036
+ default: !1
2037
+ },
2038
+ /**
2039
+ * Sets the aria-controls attribute on the textbox. This should correspond to the popover's id that the textbox triggers.
2040
+ */
2041
+ ariaControls: { type: String, required: !0 },
2042
+ /**
2043
+ * Indicates whether the content the textbox triggers is visible or not. Needs to be set accordingly when the textbox is used and changed every time the popover is shown/hidden.
2044
+ */
2045
+ ariaExpanded: {
2046
+ type: [String, Boolean],
2047
+ required: !0
2048
+ },
2049
+ /**
2050
+ * If no label element is used then the aria-label is be set should be set.
2051
+ */
2052
+ ariaLabel: { type: String, default: null },
2053
+ /**
2054
+ * Corresponds to the label's id that labels the textbox element.
2055
+ */
2056
+ ariaLabelledby: { type: String, default: null },
2057
+ /**
2058
+ * Disables any textbox functionality
2059
+ */
2060
+ disabled: { type: Boolean, default: !1 },
2061
+ /**
2062
+ * Selected option's label
2063
+ */
2064
+ displayValue: { type: String, default: null },
2065
+ /**
2066
+ * Sets the possibility to type into the textbox.
2067
+ */
2068
+ dynamicFiltering: { type: Boolean, default: !1 },
2069
+ /**
2070
+ * Marks the textbox as invalid, rendering an error state
2071
+ */
2072
+ isInvalid: { type: Boolean, default: !1 },
2073
+ /*
2074
+ * If enabled, the user will be able to select multiple items.
2075
+ */
2076
+ multiple: { type: Boolean, default: !1 },
2077
+ /**
2078
+ * Indicates if the dropdown is open so that
2079
+ * the respective event can be emitted
2080
+ */
2081
+ open: { type: Boolean, default: !1 },
2082
+ /**
2083
+ * Sets the dropdown to readonly state
2084
+ */
2085
+ readonly: { type: Boolean, default: !1 },
2086
+ /**
2087
+ * The input value
2088
+ */
2089
+ value: { type: String, default: "" },
2090
+ /**
2091
+ * The selected value's list box item.
2092
+ */
2093
+ selectedValueItem: {
2094
+ type: [Object, Array],
2095
+ default: void 0
2096
+ },
2097
+ /**
2098
+ * Toggles whether to use the slot content select items shown in the textbox in multiple mode.
2099
+ */
2100
+ showSlotContentInMultiple: { type: Boolean, default: !1 },
2101
+ /**
2102
+ * Dropdown size
2103
+ */
2104
+ size: {
2105
+ type: String,
2106
+ default: null
2107
+ }
2108
+ },
2109
+ setup(e, { expose: l, emit: n }) {
2110
+ const { t: o } = ke({ messages: Rt }), a = rt(), s = Ve(), t = It(s), i = e, g = n, c = $(null), u = Oe("textbox"), r = dt(xt, !1), m = d(() => ({
2111
+ [`b-dropdown-base-textbox--${pe.DISABLED}`]: i.disabled,
2112
+ [`b-dropdown-base-textbox--${pe.READONLY}`]: i.readonly,
2113
+ [`b-dropdown-base-textbox--${pe.HAS_ITEMS}`]: !!i.additionalItemsSelected,
2114
+ "b-dropdown-base-textbox--underline": r
2115
+ })), v = d(
2116
+ () => C.value && a["aria-required"] ? "true" : null
2117
+ ), O = d(() => ({
2118
+ "b-dropdown-base-textbox__input--dynamic-filtering": i.dynamicFiltering
2119
+ })), D = d(() => i.dynamicFiltering && !!i.value && i.open), y = d(
2120
+ () => ({
2121
+ "aria-haspopup": "listbox",
2122
+ "aria-controls": i.ariaControls,
2123
+ "aria-describedby": a["aria-describedby"]?.toString(),
2124
+ "aria-expanded": i.ariaExpanded ? "true" : "false",
2125
+ "aria-labelledby": i.ariaLabelledby,
2126
+ "aria-label": i.ariaLabelledby ? null : i.ariaLabel,
2127
+ "aria-invalid": i.isInvalid,
2128
+ "aria-disabled": i.disabled ? !0 : null,
2129
+ "aria-required": a["aria-required"]
2130
+ })
2131
+ ), z = d(
2132
+ () => i.multiple ? i.selectedValueItem : []
2133
+ ), C = d(() => i.dynamicFiltering && (i.open || i.alwaysComboboxIsInput)), T = d(() => i.selectedValueItem && !i.multiple), B = d(
2134
+ () => i.multiple && i.selectedValueItem && z.value.length > 0 && i.showSlotContentInMultiple
2135
+ );
2136
+ Se(
2137
+ () => C.value,
2138
+ () => {
2139
+ C.value && !i.alwaysComboboxIsInput && se(() => {
2140
+ c.value.focus();
2141
+ });
2142
+ }
2143
+ );
2144
+ const k = async () => {
2145
+ !i.disabled && !i.readonly && (g(te.OPEN), await se(), c.value.focus());
2146
+ }, w = () => {
2147
+ i.open && (c.value.focus(), g(te.CLOSE));
2148
+ }, F = (G) => i.open && G.target.tagName === "INPUT" ? null : i.open ? w() : k(), I = () => {
2149
+ g(te.CLEAR), g(te.INPUT, ""), c.value.focus();
2150
+ }, M = (G) => {
2151
+ !i.readonly && !i.disabled ? g(te.INPUT, G.target.value) : (G.preventDefault(), G.stopPropagation());
2152
+ };
2153
+ return l({
2154
+ focus: () => {
2155
+ c.value.focus();
2156
+ }
2157
+ }), (G, x) => (p(), E("div", {
2158
+ class: be(G.$attrs.class),
2159
+ "data-testid": "textbox-wrapper",
2160
+ onClick: F,
2161
+ onKeydown: fe(w, ["escape"])
2162
+ }, [
2163
+ V(b(Ie), {
2164
+ class: be(["b-dropdown-base-textbox", m.value]),
2165
+ variant: b(r) ? "title" : "body",
2166
+ el: "div",
2167
+ "data-testid": "base-textbox"
2168
+ }, {
2169
+ default: _(() => [
2170
+ C.value ? (p(), E("input", R({ key: 0 }, y.value, {
2171
+ id: b(u),
2172
+ ref_key: "textbox",
2173
+ ref: c,
2174
+ class: "b-dropdown-base-textbox__input",
2175
+ role: "combobox",
2176
+ type: "text",
2177
+ "aria-autocomplete": "list",
2178
+ size: "1",
2179
+ value: e.open ? e.value : e.displayValue,
2180
+ disabled: e.disabled ? !0 : null,
2181
+ readonly: e.readonly,
2182
+ required: v.value,
2183
+ onKeydown: [
2184
+ x[0] || (x[0] = (Q) => G.$emit(b(te).KEYDOWN, Q)),
2185
+ fe(F, ["enter"])
2186
+ ],
2187
+ onInput: M
2188
+ }), null, 16, io)) : (p(), E("div", R({
2189
+ key: 1,
2190
+ id: b(u)
2191
+ }, y.value, {
2192
+ ref_key: "textbox",
2193
+ ref: c,
2194
+ class: ["b-dropdown-base-textbox__input", O.value],
2195
+ "aria-readonly": e.readonly ? "true" : null,
2196
+ role: "combobox",
2197
+ tabindex: e.disabled ? -1 : 0
2198
+ }), [
2199
+ T.value ? (p(), E(ue, { key: 0 }, [
2200
+ b(t)("display-value") ? Y(G.$slots, "display-value", re(R({ key: 0 }, e.selectedValueItem)), void 0, !0) : Y(G.$slots, "default", re(R({ key: 1 }, e.selectedValueItem)), () => [
2201
+ oe(U(e.displayValue), 1)
2202
+ ], !0)
2203
+ ], 64)) : B.value ? (p(), E("div", co, [
2204
+ (p(!0), E(ue, null, le(z.value, (Q) => (p(), E("div", {
2205
+ key: Q.value
2206
+ }, [
2207
+ q("div", uo, [
2208
+ Y(G.$slots, "default", R({ ref_for: !0 }, Q), () => [
2209
+ oe(U(e.displayValue), 1)
2210
+ ], !0)
2211
+ ])
2212
+ ]))), 128))
2213
+ ])) : (p(), E(ue, { key: 2 }, [
2214
+ oe(U(e.displayValue), 1)
2215
+ ], 64))
2216
+ ], 16, ro)),
2217
+ e.additionalItemsSelected ? (p(), E("span", po, U(e.additionalItemsSelected), 1)) : J("", !0),
2218
+ b(t)("icon") && !D.value ? (p(), E("span", bo, [
2219
+ Y(G.$slots, "icon", {}, void 0, !0)
2220
+ ])) : J("", !0),
2221
+ D.value ? (p(), E("span", {
2222
+ key: 4,
2223
+ class: "b-dropdown-base-textbox__clear-search",
2224
+ tabindex: e.disabled ? -1 : 0,
2225
+ "data-testid": "clear-search-button",
2226
+ onClick: Le(I, ["stop"]),
2227
+ onKeydown: fe(Le(I, ["stop"]), ["enter"]),
2228
+ onKeyup: fe(I, ["space"])
2229
+ }, [
2230
+ e.size === b(xe).SMALL ? (p(), N(b(ol), {
2231
+ key: 0,
2232
+ "svg-title": b(o)("clearSearch")
2233
+ }, null, 8, ["svg-title"])) : (p(), N(b(ll), {
2234
+ key: 1,
2235
+ "svg-title": b(o)("clearSearch")
2236
+ }, null, 8, ["svg-title"]))
2237
+ ], 40, fo)) : J("", !0)
2238
+ ]),
2239
+ _: 3
2240
+ }, 8, ["class", "variant"])
2241
+ ], 34));
2242
+ }
2243
+ }), Mt = /* @__PURE__ */ ee(vo, [["__scopeId", "data-v-d9e852a4"]]), yo = { class: "b-dropdown-default-textbox__chevron" }, go = Z({
2244
+ name: "dropdown-default-textbox",
2245
+ inheritAttrs: !1
2246
+ }), ho = /* @__PURE__ */ Z({
2247
+ ...go,
2248
+ props: {
2249
+ /**
2250
+ * The number of additional items that have been selected in the dropdown.
2251
+ */
2252
+ additionalItemsSelected: { type: [Number, String], default: 0 },
2253
+ /**
2254
+ * Sets the aria-controls attribute on the textbox. This should correspond to the popover's id that the textbox triggers.
2255
+ */
2256
+ ariaControls: {
2257
+ type: String,
2258
+ required: !0
2259
+ },
2260
+ /**
2261
+ * Indicates whether the content the textbox triggers is visible or not. Needs to be set accordingly when the textbox is used and changed every time the popover is shown/hidden.
2262
+ */
2263
+ ariaExpanded: {
2264
+ type: [String, Boolean],
2265
+ required: !0
2266
+ },
2267
+ /**
2268
+ * If no label element is used then the aria-label is be set should be set.
2269
+ */
2270
+ ariaLabel: {
2271
+ type: String,
2272
+ default: null
2273
+ },
2274
+ /**
2275
+ * Corresponds to the label's id that labels the textbox element.
2276
+ */
2277
+ ariaLabelledby: {
2278
+ type: String,
2279
+ default: null
2280
+ },
2281
+ /**
2282
+ * Renders the dropdown with a condensed style.
2283
+ */
2284
+ condensed: { type: Boolean, default: !1 },
2285
+ /**
2286
+ * Disables any textbox functionality
2287
+ */
2288
+ disabled: { type: Boolean, default: !1 },
2289
+ /**
2290
+ * Selected option's label
2291
+ */
2292
+ displayValue: { type: String, default: null },
2293
+ /**
2294
+ * Sets the possibility to type into the textbox
2295
+ */
2296
+ dynamicFiltering: {
2297
+ type: Boolean,
2298
+ default: !1
2299
+ },
2300
+ /**
2301
+ * Marks the textbox as invalid, rendering an error state
2302
+ */
2303
+ isInvalid: { type: Boolean, default: !1 },
2304
+ /**
2305
+ * Indicates if the dropdown is open so that
2306
+ * the respective event can be emitted
2307
+ */
2308
+ open: { type: Boolean, default: !1 },
2309
+ /**
2310
+ * Sets the dropdown to readonly state
2311
+ */
2312
+ readonly: { type: Boolean, default: !1 },
2313
+ /**
2314
+ * The selected value's list box item.
2315
+ */
2316
+ selectedValueItem: {
2317
+ type: [Object, Array],
2318
+ default: void 0
2319
+ },
2320
+ /**
2321
+ * Toggles whether to use the slot content select items shown in the textbox in multiple mode.
2322
+ */
2323
+ showSlotContentInMultiple: { type: Boolean, default: !1 },
2324
+ /**
2325
+ * The input value
2326
+ */
2327
+ value: { type: String, default: "" },
2328
+ /*
2329
+ * If enabled, the user will be able to select multiple items.
2330
+ */
2331
+ multiple: { type: Boolean, default: !1 }
2332
+ },
2333
+ emits: ["clear", "close", "input", "keydown", "open"],
2334
+ setup(e, { expose: l, emit: n }) {
2335
+ const o = n, a = Ve(), s = e, t = $(null), i = d(() => ({
2336
+ [`b-dropdown-default-textbox--${pe.ERROR}`]: !s.disabled && !s.readonly && s.isInvalid,
2337
+ [`b-dropdown-default-textbox--${pe.DISABLED}`]: s.disabled,
2338
+ [`b-dropdown-default-textbox--${pe.READONLY}`]: s.readonly,
2339
+ [`b-dropdown-default-textbox--${pe.OPENED}`]: s.open,
2340
+ "b-dropdown-default-textbox--condensed": s.condensed
2341
+ })), g = d(() => s.open && !s.disabled && !s.readonly), c = (y) => {
2342
+ o("input", y);
2343
+ }, u = (y) => {
2344
+ o("keydown", y);
2345
+ }, r = (y) => {
2346
+ Be(y), o("open");
2347
+ }, m = (y) => {
2348
+ Be(y), o("close");
2349
+ }, v = (y) => {
2350
+ Be(y), o("clear");
2351
+ }, O = {
2352
+ [te.INPUT]: c,
2353
+ [te.OPEN]: r,
2354
+ [te.CLOSE]: m,
2355
+ [te.CLEAR]: v,
2356
+ [te.KEYDOWN]: u
2357
+ };
2358
+ return l({
2359
+ focus: () => {
2360
+ t.value.focus();
2361
+ }
2362
+ }), (y, z) => (p(), E("div", {
2363
+ class: be(["b-dropdown-default-textbox", i.value]),
2364
+ "data-testid": "default-textbox"
2365
+ }, [
2366
+ V(Mt, R({
2367
+ ref_key: "baseTextbox",
2368
+ ref: t
2369
+ }, { ...y.$attrs, ...y.$props }, {
2370
+ class: "b-dropdown-default-textbox__textbox",
2371
+ value: e.value
2372
+ }, ne(O)), me({
2373
+ icon: _(() => [
2374
+ q("div", yo, [
2375
+ de(V(b(At), { "svg-title": "opened" }, null, 512), [
2376
+ [Re, g.value]
2377
+ ]),
2378
+ de(V(b(Tt), { "svg-title": "closed" }, null, 512), [
2379
+ [Re, !g.value]
2380
+ ])
2381
+ ])
2382
+ ]),
2383
+ _: 2
2384
+ }, [
2385
+ le(b(a), (C, T) => ({
2386
+ name: T,
2387
+ fn: _((B) => [
2388
+ Y(y.$slots, T, re(he(B ?? {})), void 0, !0)
2389
+ ])
2390
+ }))
2391
+ ]), 1040, ["value"])
2392
+ ], 2));
2393
+ }
2394
+ }), So = /* @__PURE__ */ ee(ho, [["__scopeId", "data-v-c3e3ce21"]]);
2395
+ let St = 0;
2396
+ const Co = {
2397
+ beforeCreate() {
2398
+ this.uuid = St.toString(), St += 1;
2399
+ }
2400
+ }, Eo = { key: 0 };
2401
+ function Oo(e, l, n, o, a, s) {
2402
+ return p(), E("svg", R({ role: "img" }, e.$attrs, {
2403
+ class: "ui-assets-icons-16",
2404
+ xmlns: "http://www.w3.org/2000/svg",
2405
+ width: "16",
2406
+ height: "16",
2407
+ fill: "none"
2408
+ }), [
2409
+ e.$attrs["svg-title"] ? (p(), E("title", Eo, U(e.$attrs["svg-title"]), 1)) : J("", !0),
2410
+ l[0] || (l[0] = q("path", {
2411
+ fill: "#001222",
2412
+ d: "M5.00011 5.43922L8.00011 8.43922L11.0001 5.43922L12.0608 6.49988L8.00011 10.5605L3.93945 6.49988L5.00011 5.43922Z"
2413
+ }, null, -1))
2414
+ ], 16);
2415
+ }
2416
+ const Lo = /* @__PURE__ */ ee(Co, [["render", Oo]]);
2417
+ let Ct = 0;
2418
+ const Io = {
2419
+ beforeCreate() {
2420
+ this.uuid = Ct.toString(), Ct += 1;
2421
+ }
2422
+ }, To = { key: 0 };
2423
+ function Ao(e, l, n, o, a, s) {
2424
+ return p(), E("svg", R({ role: "img" }, e.$attrs, {
2425
+ class: "ui-assets-icons-16",
2426
+ xmlns: "http://www.w3.org/2000/svg",
2427
+ width: "16",
2428
+ height: "16",
2429
+ fill: "none"
2430
+ }), [
2431
+ e.$attrs["svg-title"] ? (p(), E("title", To, U(e.$attrs["svg-title"]), 1)) : J("", !0),
2432
+ l[0] || (l[0] = q("path", {
2433
+ fill: "#001222",
2434
+ d: "M10.9999 10.5608L7.9999 7.56077L4.9999 10.5608L3.93924 9.50011L7.9999 5.43945L12.0606 9.50011L10.9999 10.5608Z"
2435
+ }, null, -1))
2436
+ ], 16);
2437
+ }
2438
+ const $o = /* @__PURE__ */ ee(Io, [["render", Ao]]), ko = { class: "b-dropdown-small-textbox__chevron" }, wo = Z({
2439
+ name: "dropdown-small-textbox",
2440
+ inheritAttrs: !1
2441
+ }), _o = /* @__PURE__ */ Z({
2442
+ ...wo,
2443
+ props: {
2444
+ /**
2445
+ * The number of additional items that have been selected in the dropdown.
2446
+ */
2447
+ additionalItemsSelected: { type: [Number, String], default: 0 },
2448
+ /**
2449
+ * Sets the aria-controls attribute on the textbox. This should correspond to the popover's id that the textbox triggers.
2450
+ */
2451
+ ariaControls: { type: String, required: !0 },
2452
+ /**
2453
+ * Indicates whether the content the textbox triggers is visible or not. Needs to be set accordingly when the textbox is used and changed every time the popover is shown/hidden.
2454
+ */
2455
+ ariaExpanded: {
2456
+ type: [String, Boolean],
2457
+ required: !0
2458
+ },
2459
+ /**
2460
+ * If no label element is used then the aria-label is be set should be set.
2461
+ */
2462
+ ariaLabel: { type: String, default: null },
2463
+ /**
2464
+ * Corresponds to the label's id that labels the textbox element.
2465
+ */
2466
+ ariaLabelledby: { type: String, default: null },
2467
+ /**
2468
+ * Disables any textbox functionality
2469
+ */
2470
+ disabled: { type: Boolean, default: !1 },
2471
+ /**
2472
+ * Selected option's label
2473
+ */
2474
+ displayValue: { type: String, default: null },
2475
+ /**
2476
+ * Sets the possibility to type into the textbox
2477
+ */
2478
+ dynamicFiltering: { type: Boolean, default: !1 },
2479
+ /**
2480
+ * Marks the textbox as invalid, rendering an error state
2481
+ */
2482
+ isInvalid: { type: Boolean, default: !1 },
2483
+ /**
2484
+ * Indicates if the dropdown is open so that
2485
+ * the respective event can be emitted
2486
+ */
2487
+ open: { type: Boolean, default: !1 },
2488
+ /**
2489
+ * Sets the dropdown to readonly state
2490
+ */
2491
+ readonly: { type: Boolean, default: !1 },
2492
+ /**
2493
+ * The input value
2494
+ */
2495
+ value: { type: String, default: "" }
2496
+ },
2497
+ emits: ["clear", "close", "input", "keydown", "open"],
2498
+ setup(e, { expose: l, emit: n }) {
2499
+ const o = n, a = e, s = $(null), t = dt(xt, !1), i = d(() => ({
2500
+ [`b-dropdown-small-textbox--${pe.DISABLED}`]: a.disabled,
2501
+ [`b-dropdown-small-textbox--${pe.READONLY}`]: a.readonly,
2502
+ [`b-dropdown-small-textbox--${pe.OPENED}`]: a.open,
2503
+ "b-dropdown-small-textbox--underline": t
2504
+ })), g = d(() => a.open && !a.disabled && !a.readonly), c = (y) => {
2505
+ o("input", y);
2506
+ }, u = (y) => {
2507
+ o("keydown", y);
2508
+ }, r = (y) => {
2509
+ Be(y), o("open");
2510
+ }, m = (y) => {
2511
+ Be(y), o("close");
2512
+ }, v = (y) => {
2513
+ Be(y), o("clear");
2514
+ }, O = {
2515
+ [te.INPUT]: c,
2516
+ [te.OPEN]: r,
2517
+ [te.CLOSE]: m,
2518
+ [te.CLEAR]: v,
2519
+ [te.KEYDOWN]: u
2520
+ };
2521
+ return l({
2522
+ focus: () => {
2523
+ s.value.focus();
2524
+ }
2525
+ }), (y, z) => (p(), E("div", {
2526
+ class: be(["b-dropdown-small-textbox", i.value])
2527
+ }, [
2528
+ V(Mt, R({
2529
+ ref_key: "baseTextbox",
2530
+ ref: s
2531
+ }, { ...y.$attrs, ...y.$props }, {
2532
+ class: "b-dropdown-small-textbox__textbox",
2533
+ size: b(xe).SMALL
2534
+ }, ne(O)), {
2535
+ icon: _(() => [
2536
+ q("div", ko, [
2537
+ de(V(b($o), { "svg-title": "opened" }, null, 512), [
2538
+ [Re, g.value]
2539
+ ]),
2540
+ de(V(b(Lo), { "svg-title": "closed" }, null, 512), [
2541
+ [Re, !g.value]
2542
+ ])
2543
+ ])
2544
+ ]),
2545
+ _: 1
2546
+ }, 16, ["size"])
2547
+ ], 2));
2548
+ }
2549
+ }), Do = /* @__PURE__ */ ee(_o, [["__scopeId", "data-v-5fe55c74"]]), Bo = (e, l) => l.value.reduce((n, o) => {
2550
+ if (o.items) {
2551
+ const a = o.items.filter(
2552
+ (t) => e.value.find((i) => i.value === t.value)
2553
+ );
2554
+ a.length === o.items.length ? n.push(o.displayValue ?? o.label) : a.forEach(({ label: t, displayValue: i }) => n.push(i ?? t));
2555
+ }
2556
+ return e.value.find((a) => a.value === o.value) && n.push(o.displayValue ?? o.label), n;
2557
+ }, []).join(", "), xo = ({ items: e, placeholder: l, selectedValues: n, isMultiSelect: o }) => {
2558
+ const a = d(
2559
+ () => o.value && e.value.find((t) => t.items?.length)
2560
+ );
2561
+ return d(() => n.value.length ? a.value ? Bo(n, e) : n.value.map(({ label: t, displayValue: i }) => i ?? t).join(", ") : l.value || null);
2562
+ }, Nt = (e) => {
2563
+ e.value.$children?.[0].$refs.textbox.focus();
2564
+ }, Ro = ({
2565
+ inputContainerRef: e,
2566
+ optionsContainerRef: l,
2567
+ selectedValueIndex: n,
2568
+ isDropdownOpen: o,
2569
+ isDynamicFltering: a,
2570
+ items: s,
2571
+ isMultiple: t,
2572
+ totalItemCount: i,
2573
+ isVirtualScroll: g
2574
+ }, c, u, r) => {
2575
+ const m = async (x) => {
2576
+ a.value && await se(), s.value[x]?.focus();
2577
+ }, v = async (x) => {
2578
+ a.value && await se();
2579
+ const Q = l.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef?.$el.querySelectorAll(
2580
+ "button"
2581
+ );
2582
+ Q?.length ? Q[x]?.focus() : m(x);
2583
+ }, O = (x) => l.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef?.setListboxFocusedIndex(
2584
+ x
2585
+ ), D = async (x) => {
2586
+ await l.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef?.navigateToItem(x);
2587
+ }, y = (x) => {
2588
+ se(() => {
2589
+ g ? D(x) : (O(x), m(x));
2590
+ });
2591
+ }, z = () => {
2592
+ o.value || u(), y(0);
2593
+ }, C = () => {
2594
+ o.value || u(), se(() => {
2595
+ y(g ? i.value - 1 : s.value.length - 1);
2596
+ });
2597
+ }, T = ({ detail: x }) => {
2598
+ x.preventDefault(), z();
2599
+ }, B = ({ detail: x }) => {
2600
+ x.preventDefault(), C();
2601
+ }, k = () => {
2602
+ z();
2603
+ }, w = () => {
2604
+ C();
2605
+ }, F = ({ detail: x }) => {
2606
+ x.preventDefault(), c(), o.value && (t ? v(0) : y(n.value));
2607
+ }, I = ({ detail: x }) => {
2608
+ x.preventDefault(), c(), o.value && (t ? v(0) : y(n.value));
2609
+ }, M = () => {
2610
+ o.value && r();
2611
+ }, W = () => {
2612
+ o.value && (r(), Nt(e));
2613
+ };
2614
+ return d(() => ({
2615
+ [H.ARROW_DOWN]: T,
2616
+ [H.ARROW_UP]: B,
2617
+ [H.HOME]: k,
2618
+ [H.END]: w,
2619
+ ...a.value ? {} : { [H.SPACE]: F },
2620
+ [H.ENTER]: I,
2621
+ ...a.value ? {} : { [H.TAB]: M },
2622
+ [H.ESCAPE]: W
2623
+ }));
2624
+ }, Mo = ({ inputContainerRef: e, isDropdownOpen: l }, n) => {
2625
+ const o = () => {
2626
+ l.value && n(), se(() => {
2627
+ Nt(e);
2628
+ });
2629
+ };
2630
+ return {
2631
+ [f.ENTER]: o,
2632
+ [f.ESCAPE]: o,
2633
+ [f.TAB]: o,
2634
+ [f.SPACE]: o
2635
+ };
2636
+ };
2637
+ function No(e, l, n, o, a) {
2638
+ const s = $(e), t = $(l), i = (u, r = []) => r.flatMap((m) => m.label.toLocaleLowerCase().includes(u) ? o?.value && m.items ? [...i(u, m.items)] : [m, ...i(u, m.items)] : m.items ? [...i(u, m.items)] : []), g = n !== void 0 ? Bt(() => n(s.value), a ?? 300) : void 0;
2639
+ return Se(s, () => {
2640
+ g !== void 0 && g();
2641
+ }), d(() => {
2642
+ if (!s.value || n !== void 0)
2643
+ return t.value;
2644
+ const u = s.value.toLocaleLowerCase();
2645
+ return i(u, t.value);
2646
+ });
2647
+ }
2648
+ const Pt = {
2649
+ "de-DE": { all: "Alle", ariaLabelFallback: "Dropdown", clearSearch: "Filter löschen" },
2650
+ "en-GB": { all: "All", ariaLabelFallback: "Dropdown", clearSearch: "Clear filter" },
2651
+ "en-US": { all: "All", ariaLabelFallback: "Dropdown", clearSearch: "Clear filter" },
2652
+ "es-ES": { all: "Todos", ariaLabelFallback: "Menú desplegable", clearSearch: "Limpiar filtro" },
2653
+ "es-MX": { all: "Todos", ariaLabelFallback: "Menú desplegable", clearSearch: "Limpiar filtro" },
2654
+ "fr-FR": { all: "Tous", ariaLabelFallback: "Menu déroulant", clearSearch: "Effacer le filtre" },
2655
+ "it-IT": { all: "Tutti", ariaLabelFallback: "Menu a discesa", clearSearch: "Cancella filtro" },
2656
+ "ja-JP": { all: "すべて", ariaLabelFallback: "ドロップダウン", clearSearch: "フィルターをクリア" },
2657
+ "pt-BR": { all: "Todos", ariaLabelFallback: "Menu suspenso", clearSearch: "Limpar filtro" },
2658
+ "zh-CN": { all: "全部", ariaLabelFallback: "下拉菜单", clearSearch: "清除筛选器" }
2659
+ }, Po = Z({
2660
+ i18n: { messages: Pt },
2661
+ name: "b-dropdown",
2662
+ components: {
2663
+ DropdownInputDefault: So,
2664
+ DropdownInputSmall: Do
2665
+ },
2666
+ model: { prop: "modelValue" }
2667
+ }), Fo = /* @__PURE__ */ Z({
2668
+ ...Po,
2669
+ props: {
2670
+ ariaLabel: { default: null },
2671
+ condensed: { type: Boolean, default: !1 },
2672
+ emptyState: { default: void 0 },
2673
+ dynamicFiltering: { type: Boolean, default: !1 },
2674
+ error: { type: Boolean, default: !1 },
2675
+ hasMoreItems: { type: Boolean, default: !1 },
2676
+ isOptionDisabled: { type: Function, default: void 0 },
2677
+ items: { default: () => [] },
2678
+ loading: { type: Boolean, default: !1 },
2679
+ componentLoading: { type: Boolean, default: !1 },
2680
+ lazyLoadType: { default: nt.props.lazyLoadType.default },
2681
+ multiple: { type: Boolean, default: !1 },
2682
+ search: { default: void 0 },
2683
+ showSlotContentInMultiple: { type: Boolean, default: !1 },
2684
+ size: { default: null },
2685
+ staticCategories: { type: Boolean, default: !1 },
2686
+ teleport: { default: () => ({ disabled: !0 }) },
2687
+ value: { default: null },
2688
+ modelValue: { default: null },
2689
+ virtualScroll: { type: [Boolean, Object], default: !1 },
2690
+ enableValueLabelPair: { type: Boolean, default: !1 },
2691
+ description: { default: null },
2692
+ disabled: { type: Boolean, default: !1 },
2693
+ errorMessage: { default: null },
2694
+ label: { default: null },
2695
+ optional: { type: Boolean, default: !1 },
2696
+ placeholder: { default: null },
2697
+ readonly: { type: Boolean, default: !1 },
2698
+ required: { type: Boolean, default: !1 },
2699
+ tooltipText: { default: null }
2700
+ },
2701
+ emits: ["input", "update:model-value", "show-more", "open"],
2702
+ setup(e, { expose: l, emit: n }) {
2703
+ const o = rt(), a = Ve(), s = It(a), t = e, i = n, { t: g } = ke({ messages: Pt }), { emitValue: c } = Gt(i), u = $(null), r = $(null), m = $(null), v = $(!1), O = Oe("bento-dropdown-options-container"), D = Oe("dropdown-label"), y = Oe("dropdown-description"), z = Oe("dropdown-error"), { isReadOnly: C } = Kt(ae(t, "readonly")), T = d(() => t.modelValue ?? t.value), { cachedSelectedListboxOptions: B, cachedListboxSelectedValues: k, setCachedValues: w } = to(
2704
+ ae(t, "items"),
2705
+ T,
2706
+ ae(t, "multiple"),
2707
+ ae(t, "enableValueLabelPair")
2708
+ ), F = $(o["aria-label"]), I = $(o["aria-describedby"]), { ariaLabel: M, label: W } = Ot(t), G = d(() => g("ariaLabelFallback")), x = zt({
2709
+ // TODO: take ariaLabel ref away when aria-label prop is removed
2710
+ ariaLabel: M.value || F,
2711
+ label: W,
2712
+ defaultFallback: G
2713
+ }), Q = t.size === xe.SMALL || dt(no, !1), we = d(() => Q ? xe.SMALL : xe.DEFAULT), Me = d(() => ({
2714
+ "b-dropdown--condensed": t.condensed
2715
+ })), _e = d(() => ({
2716
+ "b-dropdown__description--error": !!t.errorMessage
2717
+ })), X = $(""), ie = ae(t, "items"), ze = ae(t, "staticCategories"), Te = No(
2718
+ X,
2719
+ ie,
2720
+ t?.search?.searchEvent,
2721
+ ze,
2722
+ t?.search?.debounceTime
2723
+ ), ve = d(() => t.dynamicFiltering && !!X.value), je = xo({
2724
+ items: ie,
2725
+ placeholder: ae(t, "placeholder"),
2726
+ isMultiSelect: ae(t, "multiple"),
2727
+ selectedValues: B
2728
+ }), He = d(() => {
2729
+ if (t?.multiple && Array.isArray(T.value))
2730
+ return t.items.filter(
2731
+ ({ value: S }) => t?.value && (t?.value).includes(S)
2732
+ );
2733
+ if (!t.multiple && t.staticCategories) {
2734
+ const S = t.items.find(
2735
+ (ye) => ye.items?.some((Ae) => Ae.value === T.value)
2736
+ );
2737
+ return (S ? S.items.find((ye) => ye.value === T.value) : t.items.find(({ value: ye }) => ye === T.value)) ?? null;
2738
+ }
2739
+ return t.items.find(({ value: S }) => S === T.value);
2740
+ }), Ne = d(() => {
2741
+ const S = Te.value.findIndex(({ value: ce }) => t.enableValueLabelPair ? T.value.value === ce : T.value === ce);
2742
+ return S > -1 ? S : 0;
2743
+ }), { isMultiLevelSelect: Ce, flattenedItemsList: Ge } = _t(ie), Je = d(() => Ce.value && !t.staticCategories), Xe = d(() => Je.value ? "treeitem" : "option"), Ze = d(() => {
2744
+ if (t.multiple) {
2745
+ const S = Array.isArray(T.value) ? T.value.length : 0, ce = Ce.value ? Ge.value.length : ie.value.length;
2746
+ return S === 0 ? null : !t.hasMoreItems && ce > 0 && ce === S ? g("all") : S;
2747
+ }
2748
+ return null;
2749
+ }), Qe = d(
2750
+ () => [
2751
+ t.description ? y : null,
2752
+ I.value,
2753
+ t.errorMessage ? z : null
2754
+ ].filter(Boolean).join(" ") || null
2755
+ ), Ke = d(() => m.value?.$el), { visibleDomOptions: et, updateVisibleDomOptions: Ue } = ct(
2756
+ Ke,
2757
+ Te,
2758
+ Xe
2759
+ ), qe = () => {
2760
+ C.value || (v.value = !0, se(() => {
2761
+ Ue();
2762
+ }));
2763
+ }, De = () => {
2764
+ v.value = !1;
2765
+ }, Pe = () => {
2766
+ C.value || (v.value = !v.value, se(() => {
2767
+ Ue();
2768
+ }), ve.value && (X.value = ""));
2769
+ }, tt = () => {
2770
+ ve.value && (X.value = ""), v.value && (v.value = !1, m.value.onOutsideDropdownClick());
2771
+ }, lt = d(() => [
2772
+ tt,
2773
+ {
2774
+ ignore: [Ke]
2775
+ }
2776
+ ]), ot = async (S) => {
2777
+ t.multiple || (X.value = "", v.value = !1), w(S), c(k.value), t.multiple || (await se(), P());
2778
+ }, h = () => {
2779
+ i(f.SHOW_MORE);
2780
+ }, A = Ro(
2781
+ {
2782
+ inputContainerRef: u,
2783
+ optionsContainerRef: m,
2784
+ selectedValueIndex: Ne,
2785
+ isDropdownOpen: v,
2786
+ isDynamicFltering: ae(t, "dynamicFiltering"),
2787
+ items: et,
2788
+ isMultiple: t.multiple,
2789
+ totalItemCount: d(() => Te.value.length),
2790
+ isVirtualScroll: !t?.multiple && t?.virtualScroll !== !1 && t?.lazyLoadType === "none"
2791
+ },
2792
+ Pe,
2793
+ qe,
2794
+ De
2795
+ ), L = Mo(
2796
+ {
2797
+ inputContainerRef: u,
2798
+ isDropdownOpen: v
2799
+ },
2800
+ De
2801
+ ), j = {
2802
+ [f.CLOSE_DROPDOWN]: De,
2803
+ [f.SELECT]: ot,
2804
+ [f.SHOW_MORE]: h,
2805
+ ...L
2806
+ };
2807
+ t.error && st(
2808
+ 'BentoDropdown "error" property',
2809
+ `Use the BentoDropdown "errorMessage" property instead to indicate that there is a modifier error.
2810
+ Having the field as "undefined" will hide/remove the error.
2811
+ <bento-dropdown errorMessage="Error message text" />`,
2812
+ "2.0.0"
2813
+ ), t.size && st('BentoDropdown "size" property', "Do not use. Only 'default' size should be used.", "2.0.0"), t.value && st(
2814
+ 'BentoDropdown "value" property',
2815
+ `The use of "value" prop in "BentoDropdown" is no longer supported.
2816
+ Use the "v-model" or "model-value" property instead.`,
2817
+ "2.0.0"
2818
+ );
2819
+ const P = () => {
2820
+ u.value.focus();
2821
+ };
2822
+ return Se(
2823
+ () => v.value,
2824
+ (S) => {
2825
+ S && i("open");
2826
+ }
2827
+ ), l({
2828
+ focus: P
2829
+ }), (S, ce) => de((p(), E("div", {
2830
+ class: be(["b-dropdown", Me.value])
2831
+ }, [
2832
+ b(W) ? (p(), N(b(el), {
2833
+ key: 0,
2834
+ id: b(D),
2835
+ condensed: S.condensed,
2836
+ label: b(W),
2837
+ "tooltip-text": S.tooltipText,
2838
+ optional: S.optional,
2839
+ required: S.required
2840
+ }, null, 8, ["id", "condensed", "label", "tooltip-text", "optional", "required"])) : J("", !0),
2841
+ de((p(), E("div", R({
2842
+ ref_key: "inputContainerRefWrapper",
2843
+ ref: r
2844
+ }, ne(b(A), !0)), [
2845
+ (p(), N(Lt(we.value), {
2846
+ ref_key: "inputContainerRef",
2847
+ ref: u,
2848
+ condensed: S.condensed,
2849
+ value: X.value,
2850
+ "additional-items-selected": Ze.value,
2851
+ "aria-controls": b(O),
2852
+ ariaExpanded: v.value,
2853
+ "aria-labelledby": b(W) ? b(D) : null,
2854
+ "aria-describedby": Qe.value,
2855
+ "aria-label": b(x),
2856
+ "aria-readonly": b(C),
2857
+ "aria-required": S.required,
2858
+ readonly: b(C),
2859
+ disabled: S.disabled,
2860
+ "display-value": b(je),
2861
+ "dynamic-filtering": S.dynamicFiltering,
2862
+ "is-invalid": !!S.errorMessage || S.error,
2863
+ multiple: S.multiple,
2864
+ open: v.value,
2865
+ "selected-value-item": b(Q) ? void 0 : He.value,
2866
+ "show-slot-content-in-multiple": S.showSlotContentInMultiple,
2867
+ onInput: ce[0] || (ce[0] = (ye) => X.value = ye),
2868
+ onOpen: Pe,
2869
+ onClose: Pe
2870
+ }, me({ _: 2 }, [
2871
+ le(b(a), (ye, Ae) => ({
2872
+ name: Ae,
2873
+ fn: _((at) => [
2874
+ Y(S.$slots, Ae, re(he(at)), void 0, !0)
2875
+ ])
2876
+ }))
2877
+ ]), 1064, ["condensed", "value", "additional-items-selected", "aria-controls", "ariaExpanded", "aria-labelledby", "aria-describedby", "aria-label", "aria-readonly", "aria-required", "readonly", "disabled", "display-value", "dynamic-filtering", "is-invalid", "multiple", "open", "selected-value-item", "show-slot-content-in-multiple"]))
2878
+ ], 16)), [
2879
+ [b(Fe)]
2880
+ ]),
2881
+ u.value ? (p(), N(b(Qt), {
2882
+ key: 1,
2883
+ disabled: S.teleport?.disabled,
2884
+ to: S.teleport?.to
2885
+ }, {
2886
+ default: _(() => [
2887
+ V(b(so), R({
2888
+ id: b(O),
2889
+ ref_key: "optionsContainerRef",
2890
+ ref: m,
2891
+ "aria-label": b(x),
2892
+ "component-loading": S.componentLoading,
2893
+ "empty-state": S.emptyState,
2894
+ disabled: S.disabled,
2895
+ "is-option-disabled": S.isOptionDisabled,
2896
+ items: b(Te),
2897
+ multiple: S.multiple,
2898
+ "static-categories": ze.value,
2899
+ open: v.value,
2900
+ "selected-value": b(B),
2901
+ searching: ve.value,
2902
+ "target-element": r.value,
2903
+ loading: S.loading,
2904
+ "has-more-items": S.hasMoreItems,
2905
+ "lazy-load-type": S.lazyLoadType,
2906
+ "virtual-scroll": S.virtualScroll
2907
+ }, ne(j)), me({ _: 2 }, [
2908
+ le(b(a), (ye, Ae) => ({
2909
+ name: Ae,
2910
+ fn: _((at) => [
2911
+ Y(S.$slots, Ae, re(he(at)), void 0, !0)
2912
+ ])
2913
+ }))
2914
+ ]), 1040, ["id", "aria-label", "component-loading", "empty-state", "disabled", "is-option-disabled", "items", "multiple", "static-categories", "open", "selected-value", "searching", "target-element", "loading", "has-more-items", "lazy-load-type", "virtual-scroll"])
2915
+ ]),
2916
+ _: 3
2917
+ }, 8, ["disabled", "to"])) : J("", !0),
2918
+ S.errorMessage ? (p(), N(b(tl), {
2919
+ key: 2,
2920
+ id: b(z),
2921
+ "error-message": S.errorMessage,
2922
+ class: "b-dropdown__error-message"
2923
+ }, null, 8, ["id", "error-message"])) : J("", !0),
2924
+ S.description || b(s)("description") ? (p(), N(b(Ie), {
2925
+ key: 3,
2926
+ id: b(y),
2927
+ class: be(["b-dropdown__description", _e.value]),
2928
+ el: "span"
2929
+ }, {
2930
+ default: _(() => [
2931
+ Y(S.$slots, "description", {}, () => [
2932
+ oe(U(S.description), 1)
2933
+ ], !0)
2934
+ ]),
2935
+ _: 3
2936
+ }, 8, ["id", "class"])) : J("", !0)
2937
+ ], 2)), [
2938
+ [b(Ut), lt.value]
2939
+ ]);
2940
+ }
2941
+ }), ba = /* @__PURE__ */ ee(Fo, [["__scopeId", "data-v-57256e26"]]);
2942
+ export {
2943
+ ba as B,
2944
+ fl as C,
2945
+ So as D,
2946
+ f as a,
2947
+ Ee as b,
2948
+ xe as c,
2949
+ nt as d,
2950
+ _t as e,
2951
+ No as f,
2952
+ Bt as g,
2953
+ no as h,
2954
+ xt as i,
2955
+ ut as j,
2956
+ to as u
2957
+ };
2958
+ //# sourceMappingURL=dropdown.C97ShfXZ.js.map