@adyen/bento-vue3 1.63.2 → 1.64.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 (123) hide show
  1. package/dist/@types/index.d.ts +4 -0
  2. package/dist/assets/accordion-item.css +1 -1
  3. package/dist/assets/action-bar.css +1 -1
  4. package/dist/assets/base-modal.css +1 -1
  5. package/dist/assets/card.css +1 -1
  6. package/dist/assets/data-grid.css +1 -1
  7. package/dist/assets/date-picker.css +1 -1
  8. package/dist/assets/dialog-page.css +1 -1
  9. package/dist/assets/dropdown.css +1 -1
  10. package/dist/assets/file-uploader.css +1 -1
  11. package/dist/assets/input-field-password.css +1 -1
  12. package/dist/assets/inspector.css +1 -1
  13. package/dist/assets/menu.css +1 -1
  14. package/dist/assets/modal-fullscreen.css +1 -1
  15. package/dist/assets/popover.css +1 -1
  16. package/dist/assets/sidepanel.css +1 -1
  17. package/dist/assets/use-cached-selected-values.css +1 -1
  18. package/dist/checkbox.js +2 -2
  19. package/dist/chunks/{checkbox-group.Aqtco8Q5.js → checkbox-group.BKsddn67.js} +4 -4
  20. package/dist/chunks/{checkbox-group.Aqtco8Q5.js.map → checkbox-group.BKsddn67.js.map} +1 -1
  21. package/dist/chunks/{checkbox.Hl6-8Sai.js → checkbox.C1y3Ad4Z.js} +3 -3
  22. package/dist/chunks/{checkbox.Hl6-8Sai.js.map → checkbox.C1y3Ad4Z.js.map} +1 -1
  23. package/dist/chunks/{code-snippet.DyAfzpUj.js → code-snippet.CcWkFdEq.js} +3 -3
  24. package/dist/chunks/{code-snippet.DyAfzpUj.js.map → code-snippet.CcWkFdEq.js.map} +1 -1
  25. package/dist/chunks/{controls-group.D32ggMrj.js → controls-group.DD1m4EKn.js} +2 -2
  26. package/dist/chunks/{controls-group.D32ggMrj.js.map → controls-group.DD1m4EKn.js.map} +1 -1
  27. package/dist/chunks/{copy.BFMgEWBq.js → copy.DqckFHHS.js} +2 -2
  28. package/dist/chunks/{copy.BFMgEWBq.js.map → copy.DqckFHHS.js.map} +1 -1
  29. package/dist/chunks/{dashed-underline.DPWO9ADi.js → dashed-underline.ywc0ydgS.js} +2 -2
  30. package/dist/chunks/{dashed-underline.DPWO9ADi.js.map → dashed-underline.ywc0ydgS.js.map} +1 -1
  31. package/dist/chunks/data-grid.D0De1biC.js +3773 -0
  32. package/dist/chunks/data-grid.D0De1biC.js.map +1 -0
  33. package/dist/chunks/{date-picker.DGj3tbf8.js → date-picker.BLYOus7e.js} +20 -20
  34. package/dist/chunks/date-picker.BLYOus7e.js.map +1 -0
  35. package/dist/chunks/{date-range-picker.BJm2xOoG.js → date-range-picker._0XU4TRk.js} +5 -5
  36. package/dist/chunks/{date-range-picker.BJm2xOoG.js.map → date-range-picker._0XU4TRk.js.map} +1 -1
  37. package/dist/chunks/{dropdown-tag.CQMkfl3K.js → dropdown-tag.JTxCvtZL.js} +3 -3
  38. package/dist/chunks/{dropdown-tag.CQMkfl3K.js.map → dropdown-tag.JTxCvtZL.js.map} +1 -1
  39. package/dist/chunks/{dropdown.BPQS22Kl.js → dropdown.Bz5hTRFH.js} +159 -159
  40. package/dist/chunks/dropdown.Bz5hTRFH.js.map +1 -0
  41. package/dist/chunks/{error-message.C9YtK-P0.js → error-message.DZWphzoT.js} +2 -2
  42. package/dist/chunks/{error-message.C9YtK-P0.js.map → error-message.DZWphzoT.js.map} +1 -1
  43. package/dist/chunks/{file-uploader.CXi2dHhF.js → file-uploader.C8DwUCMp.js} +3 -3
  44. package/dist/chunks/{file-uploader.CXi2dHhF.js.map → file-uploader.C8DwUCMp.js.map} +1 -1
  45. package/dist/chunks/{filter-bar.BFnsLrta.js → filter-bar.ChPG7oJN.js} +10 -10
  46. package/dist/chunks/{filter-bar.BFnsLrta.js.map → filter-bar.ChPG7oJN.js.map} +1 -1
  47. package/dist/chunks/{header-with-views.CCSJ1mUs.js → header-with-views.DkoDjkyK.js} +4 -4
  48. package/dist/chunks/{header-with-views.CCSJ1mUs.js.map → header-with-views.DkoDjkyK.js.map} +1 -1
  49. package/dist/chunks/{info-icon.BOxWZsrW.js → info-icon.CpGwbhZQ.js} +2 -2
  50. package/dist/chunks/{info-icon.BOxWZsrW.js.map → info-icon.CpGwbhZQ.js.map} +1 -1
  51. package/dist/chunks/{input-field-password.B5zx9e4K.js → input-field-password.nYZBZ1bM.js} +137 -134
  52. package/dist/chunks/input-field-password.nYZBZ1bM.js.map +1 -0
  53. package/dist/chunks/{input-field-phone-number.DqfmWaJ2.js → input-field-phone-number.Ck_1WdgH.js} +3 -3
  54. package/dist/chunks/{input-field-phone-number.DqfmWaJ2.js.map → input-field-phone-number.Ck_1WdgH.js.map} +1 -1
  55. package/dist/chunks/{input-field.CfsdWr4t.js → input-field.BdDrm776.js} +3 -3
  56. package/dist/chunks/{input-field.CfsdWr4t.js.map → input-field.BdDrm776.js.map} +1 -1
  57. package/dist/chunks/{listbox-option-tag.0fIXV0Bs.js → listbox-option-tag.0BK6jWO9.js} +2 -2
  58. package/dist/chunks/{listbox-option-tag.0fIXV0Bs.js.map → listbox-option-tag.0BK6jWO9.js.map} +1 -1
  59. package/dist/chunks/{pagination.BKyr5hq_.js → pagination.DbuaT-4D.js} +2 -2
  60. package/dist/chunks/{pagination.BKyr5hq_.js.map → pagination.DbuaT-4D.js.map} +1 -1
  61. package/dist/chunks/{radio-group.B7-_Wh8z.js → radio-group.435rdgzm.js} +4 -4
  62. package/dist/chunks/{radio-group.B7-_Wh8z.js.map → radio-group.435rdgzm.js.map} +1 -1
  63. package/dist/chunks/{rich-text-editor.BK2zdyOm.js → rich-text-editor.BDLncrV5.js} +4 -4
  64. package/dist/chunks/{rich-text-editor.BK2zdyOm.js.map → rich-text-editor.BDLncrV5.js.map} +1 -1
  65. package/dist/chunks/{search-bar.DgOHq0ns.js → search-bar.DzVNjmpW.js} +3 -3
  66. package/dist/chunks/{search-bar.DgOHq0ns.js.map → search-bar.DzVNjmpW.js.map} +1 -1
  67. package/dist/chunks/{secondary-nav.BHpoi5U4.js → secondary-nav.tId-4Wy2.js} +2 -2
  68. package/dist/chunks/{secondary-nav.BHpoi5U4.js.map → secondary-nav.tId-4Wy2.js.map} +1 -1
  69. package/dist/chunks/{segmented-control.CZpx9H-d.js → segmented-control.5-vlm8Gt.js} +2 -2
  70. package/dist/chunks/{segmented-control.CZpx9H-d.js.map → segmented-control.5-vlm8Gt.js.map} +1 -1
  71. package/dist/chunks/{selection-card-group.-8bXRhOW.js → selection-card-group.9wJy7FC2.js} +3 -3
  72. package/dist/chunks/{selection-card-group.-8bXRhOW.js.map → selection-card-group.9wJy7FC2.js.map} +1 -1
  73. package/dist/chunks/{structured-list-item.Ca1EGpL7.js → structured-list-item.DQzxNb_M.js} +4 -4
  74. package/dist/chunks/{structured-list-item.Ca1EGpL7.js.map → structured-list-item.DQzxNb_M.js.map} +1 -1
  75. package/dist/chunks/{summary-grid.types.CGJ5YLMz.js → summary-grid.types.BpS1z1-W.js} +5 -5
  76. package/dist/chunks/{summary-grid.types.CGJ5YLMz.js.map → summary-grid.types.BpS1z1-W.js.map} +1 -1
  77. package/dist/chunks/{tag.B1G_vwKM.js → tag.D3in0-Bp.js} +2 -2
  78. package/dist/chunks/{tag.B1G_vwKM.js.map → tag.D3in0-Bp.js.map} +1 -1
  79. package/dist/chunks/{textarea.CuTrFVEa.js → textarea.CV1HjB0x.js} +2 -2
  80. package/dist/chunks/{textarea.CuTrFVEa.js.map → textarea.CV1HjB0x.js.map} +1 -1
  81. package/dist/chunks/{timeline-item.Oovatubh.js → timeline-item.DUp8MmgZ.js} +4 -4
  82. package/dist/chunks/{timeline-item.Oovatubh.js.map → timeline-item.DUp8MmgZ.js.map} +1 -1
  83. package/dist/chunks/{tooltip.D2o0d8Xf.js → tooltip.VYPUHERk.js} +13 -13
  84. package/dist/chunks/tooltip.VYPUHERk.js.map +1 -0
  85. package/dist/chunks/use-cached-selected-values.CatIU1_1.js +1591 -0
  86. package/dist/chunks/use-cached-selected-values.CatIU1_1.js.map +1 -0
  87. package/dist/code-snippet.js +1 -1
  88. package/dist/dashed-underline.js +1 -1
  89. package/dist/data-grid.js +1 -1
  90. package/dist/date-picker.js +1 -1
  91. package/dist/date-range-picker.js +1 -1
  92. package/dist/dropdown.js +3 -3
  93. package/dist/file-uploader.js +1 -1
  94. package/dist/filter-bar.js +1 -1
  95. package/dist/header-with-views.js +1 -1
  96. package/dist/index.js +30 -30
  97. package/dist/info-icon.js +1 -1
  98. package/dist/input-field-password.js +1 -1
  99. package/dist/input-field-phone-number.js +1 -1
  100. package/dist/input-field.js +1 -1
  101. package/dist/internal.js +6 -6
  102. package/dist/pagination.js +1 -1
  103. package/dist/radio-group.js +1 -1
  104. package/dist/rich-text-editor.js +1 -1
  105. package/dist/search-bar.js +2 -2
  106. package/dist/secondary-nav.js +1 -1
  107. package/dist/segmented-control.js +1 -1
  108. package/dist/selection-card.js +1 -1
  109. package/dist/structured-list.js +1 -1
  110. package/dist/summary-grid.js +1 -1
  111. package/dist/tag.js +1 -1
  112. package/dist/textarea.js +1 -1
  113. package/dist/timeline.js +1 -1
  114. package/dist/web-types.json +1 -1
  115. package/package.json +5 -5
  116. package/dist/chunks/data-grid.BD6IwwRl.js +0 -3741
  117. package/dist/chunks/data-grid.BD6IwwRl.js.map +0 -1
  118. package/dist/chunks/date-picker.DGj3tbf8.js.map +0 -1
  119. package/dist/chunks/dropdown.BPQS22Kl.js.map +0 -1
  120. package/dist/chunks/input-field-password.B5zx9e4K.js.map +0 -1
  121. package/dist/chunks/tooltip.D2o0d8Xf.js.map +0 -1
  122. package/dist/chunks/use-cached-selected-values.swt0cdsA.js +0 -1524
  123. package/dist/chunks/use-cached-selected-values.swt0cdsA.js.map +0 -1
@@ -1,1524 +0,0 @@
1
- import { computed as m, ref as B, onMounted as Ve, onUnmounted as Xe, watch as ge, defineComponent as Z, resolveComponent as L, createElementBlock as _, openBlock as d, createVNode as P, createElementVNode as W, withCtx as T, createTextVNode as Y, toDisplayString as F, renderSlot as q, mergeProps as U, withKeys as Se, createCommentVNode as K, createBlock as $, withModifiers as ie, normalizeProps as ne, guardReactiveProps as be, withDirectives as ae, vShow as Be, toRef as te, resolveDirective as Re, toHandlers as se, Fragment as le, renderList as V, createSlots as me, normalizeClass as ve, unref as R, useSlots as Je, normalizeStyle as Ze } from "vue";
2
- import { B as z, a as pe } from "./keyboard-navigation.CqgGzfZQ.js";
3
- import "./events.FNmSWp_P.js";
4
- import { B as re } from "./typography.DN5eC5ch.js";
5
- import { B as Qe } from "./loading-indicator.DEepb9Wl.js";
6
- import { B as et } from "./empty-state.D7llINgF.js";
7
- import { u as Ee } from "./i18n.B6g5VX0q.js";
8
- import { d as tt } from "./debounce.DUTu11PS.js";
9
- import { B as st } from "./chip.CneNX2_j.js";
10
- import { _ as X } from "./_plugin-vue_export-helper.CHgC5LLL.js";
11
- import { C as fe, N as lt } from "./minus-small.DYIyF5XW.js";
12
- import { C as ot } from "./checkmark-small.x-gmK2Dt.js";
13
- import { C as nt } from "./chevron-down.DCQ6ZLaq.js";
14
- import { C as it } from "./chevron-up.kfuLRpZb.js";
15
- import { d as at, e as Le } from "./button-actions.D1pXI1AJ.js";
16
- /* empty css */
17
- import { o as rt } from "./resize.Bqks3WUm.js";
18
- import "../assets/use-cached-selected-values.css";
19
- const Ne = (e, s, t, c) => {
20
- const i = m(
21
- () => {
22
- var v, h;
23
- return !!((v = e.value) != null && v.length) && ((h = e.value) == null ? void 0 : h.length) === s.value.length;
24
- }
25
- ), l = m(() => {
26
- var v;
27
- return e.value == null || e.value.length === 0 ? !1 : ((v = e.value) == null ? void 0 : v.length) !== s.value.length;
28
- });
29
- return {
30
- isAllSelected: i,
31
- isIndeterminate: l,
32
- toggleSelectAll: (v) => {
33
- v ? t() : c();
34
- }
35
- };
36
- };
37
- function ct(e, { disabled: s, itemHeight: t, overscan: c = 5, prefixHeight: i }) {
38
- const l = B(null), r = B([]), v = B(0), h = B(0), n = B(0);
39
- let a;
40
- const o = m(() => {
41
- const S = typeof t == "number" ? e.value.length * t : e.value.reduce((N, x, D) => N + t(D), 0), A = typeof t == "number" ? v.value * t : e.value.slice(0, v.value).reduce((N, x, D) => N + t(D), 0);
42
- return {
43
- style: {
44
- marginTop: `${A}px`,
45
- height: `${S - A}px`
46
- }
47
- };
48
- }), C = () => {
49
- const S = (i == null ? void 0 : i.value) ?? 0, A = Math.max(l.value.scrollTop - S, 0);
50
- if (typeof t == "number")
51
- return Math.floor(A / t);
52
- let N = 0, x = 0;
53
- for (let D = 0; D < e.value.length; D += 1) {
54
- const G = t(D);
55
- if (N += G, N >= A) {
56
- x = D;
57
- break;
58
- }
59
- }
60
- return x;
61
- }, g = () => {
62
- if (n.value = l.value.clientHeight, typeof t == "number")
63
- return Math.ceil(n.value / t);
64
- const S = v.value ?? 0;
65
- let A = 0, N = 0;
66
- for (let x = S; x < e.value.length; x += 1) {
67
- const D = t(x);
68
- if (A += D, N = x, A > n.value)
69
- break;
70
- }
71
- return N - S;
72
- }, p = () => {
73
- if (l.value) {
74
- const S = g();
75
- v.value = C(), h.value = Math.min(v.value + S + c, e.value.length), r.value = e.value.slice(v.value, h.value);
76
- }
77
- }, k = () => {
78
- p();
79
- };
80
- s || (Ve(() => {
81
- l.value && (n.value = l.value.clientHeight, a = rt(l.value, ({ clientHeight: S }) => {
82
- n.value = S, p();
83
- }), p());
84
- }), Xe(() => {
85
- a == null || a.disconnect();
86
- }), ge(
87
- () => e.value,
88
- () => {
89
- p();
90
- }
91
- ));
92
- const w = {
93
- ref: l,
94
- style: { overflowY: "auto" }
95
- };
96
- return s ? {
97
- containerRef: l,
98
- containerProps: w,
99
- // eslint-disable-next-line @typescript-eslint/no-empty-function
100
- onScroll: () => {
101
- },
102
- list: e
103
- } : {
104
- containerRef: l,
105
- containerProps: w,
106
- onScroll: k,
107
- list: r,
108
- wrapperProps: o
109
- };
110
- }
111
- var b = /* @__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))(b || {}), oe = /* @__PURE__ */ ((e) => (e.AUTOMATIC = "automatic", e.BUTTON = "button", e.NONE = "none", e))(oe || {});
112
- const dt = Z({
113
- name: "bento-listbox-static-category",
114
- components: {
115
- BentoTypography: re
116
- },
117
- props: {
118
- /**
119
- * Category label text
120
- */
121
- categoryLabel: {
122
- type: String,
123
- required: !0
124
- }
125
- }
126
- }), ut = { class: "b-listbox-single-select-category" };
127
- function bt(e, s, t, c, i, l) {
128
- const r = L("bento-typography");
129
- return d(), _("div", ut, [
130
- P(r, {
131
- variant: "caption",
132
- el: "span",
133
- class: "b-listbox-single-select-category__label-text"
134
- }, {
135
- default: T(() => [
136
- Y(F(e.categoryLabel), 1)
137
- ]),
138
- _: 1
139
- }),
140
- W("div", null, [
141
- q(e.$slots, "default", {}, void 0, !0)
142
- ])
143
- ]);
144
- }
145
- const mt = /* @__PURE__ */ X(dt, [["render", bt], ["__scopeId", "data-v-a90eff17"]]), vt = Z({
146
- name: "bento-listbox-option",
147
- props: {
148
- /**
149
- * Setting this property to true will disable the option.
150
- */
151
- disabled: { type: Boolean, default: !1 },
152
- /**
153
- * Indicates if the value is selected. Only one element can be selected at a time.
154
- */
155
- selected: { type: Boolean, default: !1 }
156
- },
157
- emits: [b.CLICK, b.ENTER, b.SPACE, b.TAB],
158
- setup(e, { emit: s }) {
159
- const t = m(() => ({
160
- "b-listbox-option--disabled": e.disabled,
161
- "b-listbox-option--selected": e.selected
162
- }));
163
- return {
164
- // Enums
165
- BentoKeyboardNavigationKeyDownEvent: z,
166
- BentoListboxEvent: b,
167
- // Values
168
- conditionalClasses: t,
169
- // Events
170
- onClick: (l) => {
171
- s(b.CLICK, l);
172
- },
173
- onOptionSelected: (l, r) => {
174
- s(l, r);
175
- }
176
- };
177
- }
178
- });
179
- function ft(e, s, t, c, i, l) {
180
- return d(), _("div", U({
181
- class: ["b-listbox-option", e.conditionalClasses],
182
- role: "option"
183
- }, e.$attrs, {
184
- onClick: s[0] || (s[0] = (...r) => e.onClick && e.onClick(...r)),
185
- onKeydown: [
186
- s[1] || (s[1] = Se((r) => e.onOptionSelected(e.BentoListboxEvent.ENTER, r), ["enter"])),
187
- s[2] || (s[2] = Se((r) => e.onOptionSelected(e.BentoListboxEvent.SPACE, r), ["space"])),
188
- s[3] || (s[3] = Se((r) => e.onOptionSelected(e.BentoListboxEvent.TAB, r), ["tab"]))
189
- ]
190
- }), [
191
- q(e.$slots, "default", {}, void 0, !0)
192
- ], 16);
193
- }
194
- const ye = /* @__PURE__ */ X(vt, [["render", ft], ["__scopeId", "data-v-b7af43a6"]]);
195
- let Ie = 0;
196
- const pt = {
197
- beforeCreate() {
198
- this.uuid = Ie.toString(), Ie += 1;
199
- }
200
- }, gt = { key: 0 };
201
- function yt(e, s, t, c, i, l) {
202
- return d(), _("svg", U({ role: "img" }, e.$attrs, {
203
- class: "ui-assets-icons-16",
204
- xmlns: "http://www.w3.org/2000/svg",
205
- width: "16",
206
- height: "16",
207
- fill: "none"
208
- }), [
209
- e.$attrs["svg-title"] ? (d(), _("title", gt, F(e.$attrs["svg-title"]), 1)) : K("", !0),
210
- s[0] || (s[0] = W("path", {
211
- fill: "#001222",
212
- d: "M15.0608 4.00011L14.0001 2.93945L6.00011 10.9395L2.00011 6.93945L0.939453 8.00011L6.00011 13.0608L15.0608 4.00011Z"
213
- }, null, -1))
214
- ], 16);
215
- }
216
- const St = /* @__PURE__ */ X(pt, [["render", yt]]), ht = Z({
217
- name: "bento-listbox-single-select-option",
218
- components: {
219
- BentoListboxOption: ye,
220
- BentoTypography: re,
221
- CheckmarkIcon: St
222
- },
223
- props: {
224
- /**
225
- * Setting this property to true will disable the option.
226
- */
227
- disabled: { type: Boolean, default: !1 },
228
- /**
229
- * The option item that contains all the option item's data.
230
- * @type {BentoListboxOptionItem}
231
- */
232
- option: {
233
- type: Object,
234
- required: !0
235
- },
236
- /**
237
- * Indicates if the value is selected. Only one element can be selected at a time.
238
- */
239
- selected: { type: Boolean, default: !1 }
240
- },
241
- emits: [b.ENTER, b.SELECT, b.SPACE, b.TAB],
242
- setup(e, { emit: s }) {
243
- const t = (r) => {
244
- e.disabled || s(r, e.option);
245
- }, c = m(() => e.disabled ? !0 : null), i = m(() => e.selected ? !0 : null), l = m(() => e.disabled ? -1 : 0);
246
- return {
247
- // Values
248
- ariaDisabled: c,
249
- ariaSelected: i,
250
- tabIndex: l,
251
- // Enums
252
- BentoListboxEvent: b,
253
- // Events
254
- onOptionSelected: t
255
- };
256
- }
257
- }), Ct = { class: "b-listbox-single-select-option__text" }, Et = { class: "b-listbox-single-select-option__check-icon" };
258
- function _t(e, s, t, c, i, l) {
259
- const r = L("bento-typography"), v = L("checkmark-icon"), h = L("bento-listbox-option");
260
- return d(), $(h, {
261
- class: "b-listbox-single-select-option",
262
- disabled: e.disabled,
263
- selected: e.selected,
264
- "aria-selected": e.ariaSelected,
265
- "aria-disabled": e.ariaDisabled,
266
- tabindex: e.tabIndex,
267
- onClick: s[0] || (s[0] = (n) => e.onOptionSelected(e.BentoListboxEvent.SELECT)),
268
- onEnterPressed: s[1] || (s[1] = (n) => e.onOptionSelected(e.BentoListboxEvent.ENTER)),
269
- onSpacePressed: s[2] || (s[2] = ie((n) => e.onOptionSelected(e.BentoListboxEvent.SPACE), ["prevent"])),
270
- onTabPressed: s[3] || (s[3] = (n) => e.onOptionSelected(e.BentoListboxEvent.TAB))
271
- }, {
272
- default: T(() => [
273
- q(e.$slots, "default", ne(be(e.option)), () => [
274
- W("span", Ct, [
275
- P(r, { el: "span" }, {
276
- default: T(() => [
277
- Y(F(e.option.label), 1)
278
- ]),
279
- _: 1
280
- }),
281
- e.option.description ? (d(), $(r, {
282
- key: 0,
283
- class: "b-listbox-single-select-option__description",
284
- el: "span"
285
- }, {
286
- default: T(() => [
287
- Y(F(e.option.description), 1)
288
- ]),
289
- _: 1
290
- })) : K("", !0)
291
- ])
292
- ], !0),
293
- W("span", Et, [
294
- ae(P(v, { "svg-title": "selected" }, null, 512), [
295
- [Be, e.selected]
296
- ])
297
- ])
298
- ]),
299
- _: 3
300
- }, 8, ["disabled", "selected", "aria-selected", "aria-disabled", "tabindex"]);
301
- }
302
- const Ot = /* @__PURE__ */ X(ht, [["render", _t], ["__scopeId", "data-v-226f4c84"]]), Pe = ({ items: e, hasStaticCategories: s }, t) => {
303
- const c = m(
304
- () => s.value ? e.value.flatMap((p) => p.items) : e.value
305
- ), i = m(() => c.value.length - 1), l = B(0), r = (p) => {
306
- switch (p) {
307
- case "increase":
308
- l.value += 1;
309
- break;
310
- case "decrease":
311
- l.value -= 1;
312
- break;
313
- }
314
- }, v = ({ edgeCaseItem: p }, k) => {
315
- l.value !== p && (r(k), t(l.value));
316
- }, h = (p) => {
317
- g(p), v(
318
- {
319
- edgeCaseItem: i.value
320
- },
321
- "increase"
322
- /* INCREASE */
323
- );
324
- }, n = (p) => {
325
- g(p), v(
326
- {
327
- edgeCaseItem: 0
328
- },
329
- "decrease"
330
- /* DECREASE */
331
- );
332
- }, a = () => {
333
- l.value = 0, t(l.value);
334
- }, o = () => {
335
- l.value = i.value, t(l.value);
336
- }, C = (p) => {
337
- l.value = p;
338
- }, g = (p) => {
339
- var k;
340
- (k = p == null ? void 0 : p.detail) == null || k.preventDefault();
341
- };
342
- return {
343
- moveToFirstElement: a,
344
- moveToLastElement: o,
345
- moveToNextElement: h,
346
- moveToPreviousElement: n,
347
- setListboxFocusedIndex: C,
348
- preventDefault: g,
349
- focusedIndex: l
350
- };
351
- }, Tt = Z({
352
- name: "bento-listbox-single-select",
353
- components: {
354
- BentoListboxSingleSelectCategory: mt,
355
- BentoListboxSingleSelectOption: Ot
356
- },
357
- directives: { BentoKeyboardNavigationDirective: pe },
358
- inheritAttrs: !1,
359
- props: {
360
- /**
361
- * Function that allows the options to be disabled
362
- *
363
- * @type {BentoListboxIsOptionDisabled}
364
- * @param {BentoListboxOptionItem} option - listbox option object
365
- * @param {string} option.label - Option's label text
366
- * @param {string|number} option.value - Option's value
367
- * @param {unknown} option.data - Option's extra data to be passed to the default slot
368
- */
369
- isOptionDisabled: {
370
- type: Function,
371
- default: () => !1
372
- },
373
- /**
374
- * The option elements to populate the listbox with.
375
- * It must be an array of {@see BentoListboxOptionItem }.
376
- *
377
- * @property {string} value.label - Text to be displayed in the option
378
- * @property {string,number} value.value - Value of the option
379
- */
380
- items: {
381
- type: Array,
382
- required: !0
383
- },
384
- /**
385
- * The `input` value.
386
- * Providing an empty string will select no options.
387
- * Set to an empty string `''` if you don't want any of the available options to be selected
388
- */
389
- selectedValue: {
390
- type: Array,
391
- default: void 0
392
- },
393
- /**
394
- * If enabled, dropdown will display non-selectable, static categories
395
- */
396
- staticCategories: { type: Boolean, default: !1 }
397
- },
398
- emits: [b.SELECT, b.ENTER, b.SPACE, b.TAB],
399
- setup(e, { emit: s, expose: t, slots: c }) {
400
- const i = B(null), l = B([]), r = m(() => {
401
- var S;
402
- return !!((S = e.selectedValue) != null && S.length) && e.selectedValue.at(0);
403
- }), v = m(() => !!e.items.some(({ items: S }) => !!S)), h = (S) => (A) => {
404
- s(S, [A]);
405
- }, n = (S) => {
406
- var A;
407
- (A = i.value.querySelectorAll('[role="option"]')[S]) == null || A.focus();
408
- }, {
409
- moveToNextElement: a,
410
- moveToPreviousElement: o,
411
- moveToFirstElement: C,
412
- moveToLastElement: g,
413
- setListboxFocusedIndex: p
414
- } = Pe(
415
- {
416
- items: te(e, "items"),
417
- hasStaticCategories: te(e, "staticCategories")
418
- },
419
- n
420
- ), k = {
421
- [z.ARROW_UP]: o,
422
- [z.ARROW_DOWN]: a,
423
- [z.HOME]: C,
424
- [z.END]: g
425
- }, w = {
426
- [b.SELECT]: h(b.SELECT),
427
- [b.SPACE]: h(b.SPACE),
428
- [b.TAB]: h(b.TAB),
429
- [b.ENTER]: h(b.ENTER)
430
- };
431
- return t({
432
- /**
433
- * Reference for a single listbox item.
434
- * Required for keyboard navigation in dropdown as $children is removed in vue@3
435
- */
436
- listboxItemRef: l,
437
- /**
438
- * Method to set the index of the item to be focused on
439
- * Used for focus management to be kept in-sync with parent e.g. dropdowns
440
- */
441
- setListboxFocusedIndex: p
442
- }), {
443
- // Enums
444
- BentoListboxEvent: b,
445
- // Values
446
- listboxRef: i,
447
- listboxItemRef: l,
448
- selectedItem: r,
449
- slots: c,
450
- // Computed
451
- hasCategories: v,
452
- // Methods
453
- onOptionSelected: h,
454
- // Keyboard navigation
455
- listboxListeners: k,
456
- listboxOptionListeners: w
457
- };
458
- }
459
- });
460
- function kt(e, s, t, c, i, l) {
461
- const r = L("bento-listbox-single-select-option"), v = L("bento-listbox-single-select-category"), h = Re("bento-keyboard-navigation-directive");
462
- return ae((d(), _("div", U({ ref: "listboxRef" }, se(e.listboxListeners, !0)), [
463
- e.hasCategories && e.staticCategories ? (d(!0), _(le, { key: 0 }, V(e.items, (n) => (d(), $(v, {
464
- key: n.value,
465
- "category-label": n.label,
466
- role: "group"
467
- }, {
468
- default: T(() => [
469
- (d(!0), _(le, null, V(n.items, (a) => (d(), $(r, U({
470
- key: a.value,
471
- ref_for: !0,
472
- ref: "listboxItemRef",
473
- role: "option",
474
- option: a,
475
- disabled: e.isOptionDisabled ? e.isOptionDisabled(a) : null,
476
- selected: a.value === e.selectedItem.value
477
- }, se(e.listboxOptionListeners)), me({ _: 2 }, [
478
- V(e.slots, (o, C) => ({
479
- name: C,
480
- fn: T((g) => [
481
- q(e.$slots, C, U({ ref_for: !0 }, g))
482
- ])
483
- }))
484
- ]), 1040, ["option", "disabled", "selected"]))), 128))
485
- ]),
486
- _: 2
487
- }, 1032, ["category-label"]))), 128)) : (d(!0), _(le, { key: 1 }, V(e.items, (n) => (d(), $(r, U({
488
- key: n.value,
489
- ref_for: !0,
490
- ref: "listboxItemRef",
491
- role: "option",
492
- option: n,
493
- disabled: e.isOptionDisabled ? e.isOptionDisabled(n) : null,
494
- selected: n.value === e.selectedItem.value
495
- }, se(e.listboxOptionListeners)), me({ _: 2 }, [
496
- V(e.slots, (a, o) => ({
497
- name: o,
498
- fn: T((C) => [
499
- q(e.$slots, o, U({ ref_for: !0 }, C))
500
- ])
501
- }))
502
- ]), 1040, ["option", "disabled", "selected"]))), 128))
503
- ], 16)), [
504
- [h]
505
- ]);
506
- }
507
- const At = /* @__PURE__ */ X(Tt, [["render", kt]]), Lt = {}, It = /* @__PURE__ */ Z({
508
- ...Lt,
509
- __name: "listbox-decorative-checkbox",
510
- props: {
511
- disabled: { type: Boolean, default: !1 },
512
- indeterminate: { type: Boolean, default: !1 },
513
- checked: { type: Boolean, default: !1 }
514
- },
515
- setup(e) {
516
- const s = e, t = m(() => ({
517
- [`b-checkbox-input--${fe.DISABLED}`]: s.disabled
518
- })), c = m(() => ({
519
- [`b-checkbox-input__outline--${fe.UNCHECKED}`]: !s.checked && !s.indeterminate,
520
- [`b-checkbox-input__outline--${fe.CHECKED}`]: s.checked && !s.indeterminate,
521
- [`b-checkbox-input__outline--${fe.INDETERMINATE}`]: s.indeterminate
522
- }));
523
- return (i, l) => (d(), _("div", {
524
- class: ve(["b-checkbox-input", t.value]),
525
- role: "presentation"
526
- }, [
527
- i.indeterminate ? (d(), $(R(lt), {
528
- key: 0,
529
- class: "b-checkbox-input__icon",
530
- "svg-title": "",
531
- "aria-hidden": "true"
532
- })) : i.checked ? (d(), $(R(ot), {
533
- key: 1,
534
- class: "b-checkbox-input__icon",
535
- "svg-title": "",
536
- "aria-hidden": "true"
537
- })) : K("", !0),
538
- W("div", {
539
- class: ve(["b-checkbox-input__outline", c.value])
540
- }, null, 2)
541
- ], 2));
542
- }
543
- }), _e = /* @__PURE__ */ X(It, [["__scopeId", "data-v-c604b68a"]]);
544
- var he = /* @__PURE__ */ ((e) => (e.DISABLED = "disabled", e.STATIC_CATEGORY = "static-category", e))(he || {}), ue = /* @__PURE__ */ ((e) => (e.SELECT_CATEGORY = "select-category", e.UNSELECT_CATEGORY = "unselect-category", e))(ue || {});
545
- const $t = {
546
- "en-US": {
547
- categoryClosed: "{category} closed",
548
- categoryOpened: "{category} opened"
549
- }
550
- }, Dt = Z({
551
- i18n: { messages: $t },
552
- name: "bento-listbox-multi-select-category",
553
- components: {
554
- BentoTypography: re,
555
- BentoListboxOption: ye,
556
- ChevronDownIcon: nt,
557
- ChevronUpIcon: it,
558
- ListboxDecorativeCheckbox: _e
559
- },
560
- props: {
561
- /**
562
- * The option elements to populate the listbox with.
563
- * It must be an array of {@see BentoListboxOptionItem }.
564
- *
565
- * @property {string} value.label - Text to be displayed in the option
566
- * @property {string,number} value.value - Value of the option
567
- * @property {BentoListboxOptionItem} value.items - Category items list
568
- */
569
- category: {
570
- type: Object,
571
- required: !0
572
- },
573
- /**
574
- * Function that allows the options to be disabled
575
- *
576
- * @type {BentoListboxIsOptionDisabled}
577
- * @param {BentoListboxOptionItem} option - listbox option object
578
- * @param {string} option.label - Option's label text
579
- * @param {string|number} option.value - Option's value
580
- * @param {unknown} option.data - Option's extra data to be passed to the default slot
581
- */
582
- isOptionDisabled: {
583
- type: [Function],
584
- default: () => !1
585
- },
586
- /**
587
- * The `input` value.
588
- * Providing an empty array will select no options.
589
- */
590
- selectedItemsList: {
591
- type: Array,
592
- default: () => []
593
- },
594
- /**
595
- * If enabled, dropdown will display non-selectable, static categories
596
- */
597
- staticCategories: { type: Boolean, default: !1 },
598
- /**
599
- * Category's tabindex
600
- */
601
- tabindex: { type: Number, default: -1 }
602
- },
603
- emits: [ue.SELECT_CATEGORY, ue.UNSELECT_CATEGORY],
604
- setup(e, { emit: s }) {
605
- const t = B(!1), { t: c } = Ee(), i = (I) => e.isOptionDisabled ? e.isOptionDisabled(I) : !1, l = m(
606
- () => e.category.items.every((I) => i(I))
607
- ), r = te(e, "staticCategories"), v = m(() => t.value || e.staticCategories), h = m(() => ({
608
- [`b-listbox-multi-select-category--${he.DISABLED}`]: l.value,
609
- [`b-listbox-multi-select-category--${he.STATIC_CATEGORY}`]: e.staticCategories
610
- })), n = (I) => {
611
- I.preventDefault(), t.value = !t.value;
612
- }, a = (I) => {
613
- var J;
614
- const H = i(I), j = ((J = e.selectedItemsList) == null ? void 0 : J.includes(I.value)) || !1;
615
- return { isDisabled: H, isPreSelected: j };
616
- }, o = m(
617
- () => e.category.items.filter((I) => {
618
- const { isDisabled: H, isPreSelected: j } = a(I);
619
- return H && j || !H;
620
- })
621
- ), C = m(
622
- () => {
623
- var I;
624
- return (I = o.value) == null ? void 0 : I.filter(
625
- ({ value: H }) => {
626
- var j;
627
- return (j = e.selectedItemsList) == null ? void 0 : j.includes(H);
628
- }
629
- );
630
- }
631
- ), g = m(() => {
632
- const I = t.value ? "categoryOpened" : "categoryClosed";
633
- return c(I, { category: e.category.label });
634
- }), p = m(
635
- () => ({
636
- el: "span",
637
- variant: e.staticCategories ? "caption" : "body"
638
- })
639
- ), k = () => {
640
- s(ue.SELECT_CATEGORY);
641
- }, w = () => {
642
- s(ue.UNSELECT_CATEGORY);
643
- }, { isAllSelected: S, isIndeterminate: A, toggleSelectAll: N } = Ne(
644
- C,
645
- o,
646
- k,
647
- w
648
- ), x = m(() => A.value ? "mixed" : `${S.value}`), D = B(S.value), G = () => {
649
- D.value = !D.value, N(D.value);
650
- };
651
- return ge(S, () => {
652
- D.value = S.value;
653
- }), {
654
- // Values
655
- chevronTitle: g,
656
- conditionalClass: h,
657
- hasAllPropsDisabled: l,
658
- isOpen: t,
659
- isAllSelected: S,
660
- isIndeterminate: A,
661
- isStaticCategory: r,
662
- // Computed
663
- showItemChildren: v,
664
- categoryLabelProps: p,
665
- ariaCheckedComputed: x,
666
- // Methods
667
- handleSelectAll: G,
668
- toggleOpen: n,
669
- toggleSelectAll: N
670
- };
671
- }
672
- }), Bt = { class: "b-listbox-multi-select-category__label" };
673
- function Rt(e, s, t, c, i, l) {
674
- const r = L("listbox-decorative-checkbox"), v = L("bento-typography"), h = L("chevron-up-icon"), n = L("chevron-down-icon"), a = L("bento-listbox-option");
675
- return d(), _("div", null, [
676
- P(a, {
677
- class: ve(["b-listbox-multi-select-category__option", e.conditionalClass]),
678
- tabindex: e.tabindex,
679
- "aria-checked": e.ariaCheckedComputed,
680
- "aria-disabled": e.hasAllPropsDisabled,
681
- onClick: e.handleSelectAll,
682
- onEnterPressed: e.handleSelectAll,
683
- onSpacePressed: ie(e.handleSelectAll, ["prevent"])
684
- }, {
685
- default: T(() => [
686
- e.isStaticCategory ? K("", !0) : (d(), $(r, {
687
- key: 0,
688
- indeterminate: e.isIndeterminate,
689
- disabled: e.hasAllPropsDisabled,
690
- checked: e.isAllSelected
691
- }, null, 8, ["indeterminate", "disabled", "checked"])),
692
- W("span", Bt, [
693
- P(v, U(e.categoryLabelProps, { class: "b-listbox-multi-select-category__label-text" }), {
694
- default: T(() => [
695
- Y(F(e.category.label), 1)
696
- ]),
697
- _: 1
698
- }, 16),
699
- e.isStaticCategory ? K("", !0) : (d(), _("div", {
700
- key: 0,
701
- class: "b-listbox-multi-select-category__label-chevron",
702
- "data-testid": "toggle-listbox",
703
- onClickCapture: s[0] || (s[0] = ie((...o) => e.toggleOpen && e.toggleOpen(...o), ["stop"]))
704
- }, [
705
- e.isOpen ? (d(), $(h, {
706
- key: 0,
707
- "svg-title": e.chevronTitle
708
- }, null, 8, ["svg-title"])) : (d(), $(n, {
709
- key: 1,
710
- "svg-title": e.chevronTitle
711
- }, null, 8, ["svg-title"]))
712
- ], 32))
713
- ])
714
- ]),
715
- _: 1
716
- }, 8, ["class", "tabindex", "aria-checked", "aria-disabled", "onClick", "onEnterPressed", "onSpacePressed"]),
717
- ae(W("div", null, [
718
- q(e.$slots, "default", {}, void 0, !0)
719
- ], 512), [
720
- [Be, e.showItemChildren]
721
- ])
722
- ]);
723
- }
724
- const Nt = /* @__PURE__ */ X(Dt, [["render", Rt], ["__scopeId", "data-v-c59132dd"]]);
725
- var ee = /* @__PURE__ */ ((e) => (e.SELECT_CATEGORY = "select-category", e.TOGGLE_CHECKBOX_SELECTION = "toggle-checkbox-selection", e.UNSELECT_CATEGORY = "unselect-category", e))(ee || {});
726
- const Pt = Z({
727
- name: "listbox-multi-select-options",
728
- components: {
729
- BentoListboxOption: ye,
730
- BentoTypography: re,
731
- ListboxMultiSelectCategory: Nt,
732
- ListboxDecorativeCheckbox: _e
733
- },
734
- props: {
735
- /**
736
- * Indicates if the items listed are inside a category
737
- * so they can be padded to right by one level in recursion.
738
- * Items of categories are automatically defined as "categoryItems"
739
- */
740
- categoryItems: { type: Boolean, default: !1 },
741
- /**
742
- * Current focused option index
743
- */
744
- focusedIndex: { type: Number, default: 0 },
745
- /**
746
- * Function that allows the options to be disabled
747
- *
748
- * @type {BentoListboxIsOptionDisabled}
749
- * @param {BentoListboxOptionItem} option - listbox option object
750
- * @param {string} option.label - Option's label text
751
- * @param {string|number} option.value - Option's value
752
- * @param {unknown} option.data - Option's extra data to be passed to the default slot
753
- */
754
- isOptionDisabled: {
755
- type: Function,
756
- default: () => !1
757
- },
758
- /**
759
- * The option elements to populate the listbox with.
760
- * It must be an array of {@see BentoListboxOptionItem }.
761
- *
762
- * @property {string} value.label - Text to be displayed in the option
763
- * @property {string,number} value.value - Value of the option
764
- */
765
- items: {
766
- type: Array,
767
- required: !0
768
- },
769
- /**
770
- * Indicates if the elements options are inside a multi-level category
771
- */
772
- isMultiLevel: { type: Boolean, default: !1 },
773
- /**
774
- * Flag that indicates that an external search it's being made
775
- * to filter out the items inside the the multi-select listbox
776
- *
777
- * If enabled, hides the "Select all" checkbox in "multiple" mode.
778
- */
779
- searching: { type: Boolean, default: !1 },
780
- /**
781
- * List of selected items.
782
- * Providing an empty array will select no options.
783
- */
784
- selectedItemsList: {
785
- type: Array,
786
- default: () => []
787
- },
788
- /**
789
- * If enabled, dropdown will display non-selectable, static categories
790
- */
791
- staticCategories: { type: Boolean, default: !1 }
792
- },
793
- emits: [
794
- ee.TOGGLE_CHECKBOX_SELECTION,
795
- ee.SELECT_CATEGORY,
796
- ee.UNSELECT_CATEGORY
797
- ],
798
- setup(e, { emit: s }) {
799
- const t = (n) => {
800
- e.isOptionDisabled(n) || s(ee.TOGGLE_CHECKBOX_SELECTION, n);
801
- }, c = (n) => !!n.items, i = (n) => {
802
- const a = e.isMultiLevel && e.searching;
803
- return n.description && (!e.isMultiLevel || a);
804
- }, l = (n) => n.items ? !!n.items.find((a) => e.selectedItemsList.includes(a.value)) : e.selectedItemsList.includes(n.value), r = (n) => {
805
- if (c(n)) {
806
- const a = l(n) ? ee.UNSELECT_CATEGORY : ee.SELECT_CATEGORY;
807
- s(a, n);
808
- } else
809
- t(n);
810
- };
811
- return {
812
- // Values
813
- conditionalClasses: m(() => ({
814
- "b-listbox-multi-select-options__static-category-option": e.staticCategories,
815
- "b-listbox-multi-select-options__category-option": e.categoryItems
816
- })),
817
- // Methods
818
- isOptionSelected: l,
819
- shouldShowDescription: i,
820
- toggleCheckboxSelection: t,
821
- toggleSearchOption: r,
822
- computedTabindex: (n) => n + 1 === e.focusedIndex ? 0 : -1,
823
- // Enums
824
- BentoListboxEvent: b,
825
- ListboxMultiSelectOptionsEvent: ee
826
- };
827
- }
828
- }), Mt = { class: "b-listbox-multi-select__option-text" }, wt = { class: "b-listbox-multi-select__option-text" };
829
- function xt(e, s, t, c, i, l) {
830
- const r = L("listbox-decorative-checkbox"), v = L("bento-typography"), h = L("bento-listbox-option"), n = L("listbox-multi-select-options", !0), a = L("listbox-multi-select-category");
831
- return d(), _("div", null, [
832
- (d(!0), _(le, null, V(e.items, (o, C) => (d(), _("div", {
833
- key: `selected-${o.value}`
834
- }, [
835
- e.searching && e.isMultiLevel ? (d(), $(h, {
836
- key: 0,
837
- class: ve(["b-listbox-multi-select-options", e.conditionalClasses]),
838
- disabled: e.isOptionDisabled ? e.isOptionDisabled(o) : null,
839
- tabindex: e.computedTabindex(C),
840
- "aria-checked": `${e.isOptionSelected(o)}`,
841
- "aria-disabled": e.isOptionDisabled ? e.isOptionDisabled(o) : null,
842
- onClick: (g) => e.toggleSearchOption(o),
843
- onEnterPressed: (g) => e.toggleSearchOption(o),
844
- onSpacePressed: ie((g) => e.toggleSearchOption(o), ["prevent"])
845
- }, {
846
- default: T(() => [
847
- P(r, {
848
- disabled: e.isOptionDisabled ? e.isOptionDisabled(o) : null,
849
- checked: e.isOptionSelected(o)
850
- }, null, 8, ["disabled", "checked"]),
851
- q(e.$slots, "default", U({ ref_for: !0 }, o), () => [
852
- W("span", Mt, [
853
- P(v, { el: "span" }, {
854
- default: T(() => [
855
- Y(F(o.label), 1)
856
- ]),
857
- _: 2
858
- }, 1024),
859
- e.shouldShowDescription(o) ? (d(), $(v, {
860
- key: 0,
861
- class: "b-listbox-multi-select__option-description",
862
- el: "span"
863
- }, {
864
- default: T(() => [
865
- Y(F(o.description), 1)
866
- ]),
867
- _: 2
868
- }, 1024)) : K("", !0)
869
- ])
870
- ], !0)
871
- ]),
872
- _: 2
873
- }, 1032, ["class", "disabled", "tabindex", "aria-checked", "aria-disabled", "onClick", "onEnterPressed", "onSpacePressed"])) : (d(), _(le, { key: 1 }, [
874
- o.items ? (d(), $(a, {
875
- key: 0,
876
- category: o,
877
- "static-categories": e.staticCategories,
878
- "is-option-disabled": e.isOptionDisabled,
879
- "selected-items-list": e.selectedItemsList,
880
- tabindex: e.computedTabindex(C),
881
- onSelectCategory: (g) => e.$emit(e.ListboxMultiSelectOptionsEvent.SELECT_CATEGORY, o),
882
- onUnselectCategory: (g) => e.$emit(e.ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY, o)
883
- }, {
884
- default: T(() => [
885
- P(n, {
886
- "category-items": "",
887
- items: o.items,
888
- "is-option-disabled": e.isOptionDisabled,
889
- "focused-index": e.focusedIndex,
890
- "is-multi-level": e.isMultiLevel,
891
- "static-categories": e.staticCategories,
892
- "selected-items-list": e.selectedItemsList,
893
- searching: e.searching,
894
- onToggleCheckboxSelection: s[0] || (s[0] = (g) => e.toggleCheckboxSelection(g))
895
- }, null, 8, ["items", "is-option-disabled", "focused-index", "is-multi-level", "static-categories", "selected-items-list", "searching"])
896
- ]),
897
- _: 2
898
- }, 1032, ["category", "static-categories", "is-option-disabled", "selected-items-list", "tabindex", "onSelectCategory", "onUnselectCategory"])) : (d(), $(h, {
899
- key: 1,
900
- class: ve(["b-listbox-multi-select-options", e.conditionalClasses]),
901
- disabled: e.isOptionDisabled ? e.isOptionDisabled(o) : null,
902
- tabindex: e.computedTabindex(C),
903
- "aria-checked": `${e.isOptionSelected(o)}`,
904
- "aria-disabled": e.isOptionDisabled ? e.isOptionDisabled(o) : null,
905
- onClick: (g) => e.toggleCheckboxSelection(o),
906
- onEnterPressed: (g) => e.toggleCheckboxSelection(o),
907
- onSpacePressed: ie((g) => e.toggleCheckboxSelection(o), ["prevent"])
908
- }, {
909
- default: T(() => [
910
- P(r, {
911
- disabled: e.isOptionDisabled ? e.isOptionDisabled(o) : null,
912
- checked: e.isOptionSelected(o)
913
- }, null, 8, ["disabled", "checked"]),
914
- q(e.$slots, "default", U({ ref_for: !0 }, o), () => [
915
- W("span", wt, [
916
- P(v, { el: "span" }, {
917
- default: T(() => [
918
- Y(F(o.label), 1)
919
- ]),
920
- _: 2
921
- }, 1024),
922
- e.shouldShowDescription(o) ? (d(), $(v, {
923
- key: 0,
924
- class: "b-listbox-multi-select__option-description",
925
- el: "span"
926
- }, {
927
- default: T(() => [
928
- Y(F(o.description), 1)
929
- ]),
930
- _: 2
931
- }, 1024)) : K("", !0)
932
- ])
933
- ], !0)
934
- ]),
935
- _: 2
936
- }, 1032, ["class", "disabled", "tabindex", "aria-checked", "aria-disabled", "onClick", "onEnterPressed", "onSpacePressed"]))
937
- ], 64))
938
- ]))), 128))
939
- ]);
940
- }
941
- const Ut = /* @__PURE__ */ X(Pt, [["render", xt], ["__scopeId", "data-v-5778456e"]]), Gt = (e) => {
942
- const s = m(() => {
943
- var c;
944
- return !!((c = e.value) != null && c.find(({ items: i }) => !!i));
945
- }), t = m(() => {
946
- var c;
947
- return s.value ? (c = e.value) == null ? void 0 : c.reduce((i, l) => (l.items ? i.push(...l.items.flat()) : i.push(l), i), []) : e.value;
948
- });
949
- return {
950
- isMultiLevelSelect: s,
951
- flattenedItemsList: t
952
- };
953
- }, Me = {
954
- "en-US": {
955
- allSelected: "All selected ({total})",
956
- numberOfTotalSelected: "{number} of {total} selected",
957
- numbersSelected: "{number} selected",
958
- selectAll: "Select all ({total})"
959
- }
960
- }, zt = { key: 0 }, Ft = {
961
- key: 1,
962
- class: "b-listbox-multi-select__divider"
963
- }, Yt = { i18n: { messages: Me } }, Kt = /* @__PURE__ */ Z({
964
- ...Yt,
965
- __name: "listbox-multi-select",
966
- props: {
967
- hasMoreItems: { type: Boolean, default: !1 },
968
- isOptionDisabled: { type: Function, default: () => !1 },
969
- items: {},
970
- lazyLoadType: { default: "none" },
971
- searching: { type: Boolean, default: !1 },
972
- selectedValues: {},
973
- staticCategories: { type: Boolean, default: !1 }
974
- },
975
- emits: ["select"],
976
- setup(e, { emit: s }) {
977
- const t = e, c = s, { t: i } = Ee({ messages: Me }), l = Je(), r = B(null), v = B(null), h = B(null), n = B(null), a = m(() => t.selectedValues.map(({ value: f }) => f)), { isMultiLevelSelect: o, flattenedItemsList: C } = Gt(te(t, "items")), g = (f) => {
978
- var O;
979
- const y = t.isOptionDisabled(f), u = ((O = a.value) == null ? void 0 : O.includes(f.value)) || !1;
980
- return { isDisabled: y, isPreSelected: u };
981
- }, p = m(() => {
982
- if (t.searching && o)
983
- return t.items;
984
- const f = C.value.filter((y) => {
985
- const { isDisabled: u, isPreSelected: O } = g(y);
986
- return u && O || !u;
987
- });
988
- return t.selectedValues.forEach((y) => {
989
- f.find((u) => u.value === y.value) || f.push(y);
990
- }), f;
991
- }), k = m(
992
- () => {
993
- var f;
994
- return (f = p.value) == null ? void 0 : f.filter((y) => {
995
- var u;
996
- return y.items && o.value && t.searching ? y.items.filter(
997
- (E) => (t.selectedValues ?? []).includes(E.value)
998
- ).length === y.items.length : (u = a.value) == null ? void 0 : u.includes(y.value);
999
- });
1000
- }
1001
- ), w = () => o.value && !t.searching ? C.value.length : t.items.length, S = m(() => {
1002
- var O;
1003
- const f = p.value.length, y = w(), u = ((O = k.value) == null ? void 0 : O.length) || 0;
1004
- return u === 0 ? i("selectAll", { total: f }) : u === y ? i("allSelected", { total: y }) : u <= y ? i("numberOfTotalSelected", { number: u, total: y }) : i("numbersSelected", { number: u });
1005
- }), A = (f) => {
1006
- const y = (O) => {
1007
- const { isDisabled: E, isPreSelected: Q } = g(O);
1008
- return E && Q || !E;
1009
- }, u = f.filter(y).filter((O) => !a.value.includes(O.value));
1010
- c("select", [...t.selectedValues, ...u]);
1011
- }, N = (f) => {
1012
- const y = (E) => {
1013
- const { isDisabled: Q, isPreSelected: je } = g(E);
1014
- return !(Q && je);
1015
- }, u = f.filter(y).map(({ value: E }) => E), O = t.selectedValues.filter((E) => !(u != null && u.includes(E.value)));
1016
- c("select", O);
1017
- }, x = () => {
1018
- A(C.value);
1019
- }, D = () => {
1020
- N(C.value);
1021
- }, { isAllSelected: G, isIndeterminate: I, toggleSelectAll: H } = Ne(
1022
- k,
1023
- p,
1024
- x,
1025
- D
1026
- ), j = m(() => I.value ? "mixed" : `${G.value}`), J = B(G.value), M = () => {
1027
- J.value = !J.value, H(J.value);
1028
- };
1029
- ge(G, () => {
1030
- J.value = G.value;
1031
- });
1032
- const ce = (f) => {
1033
- A(f.items);
1034
- }, Oe = (f) => {
1035
- N(f.items);
1036
- }, de = (f, y) => {
1037
- let u = !1;
1038
- const O = t.selectedValues.filter(({ value: E }) => y.value === E ? (u = !0, !1) : !0);
1039
- u || O.push(y), c(f, O);
1040
- }, we = m(() => {
1041
- if (!o.value)
1042
- return t.selectedValues;
1043
- const f = (E) => a.value.includes(E.value), y = (E) => !t.staticCategories && E.every((Q) => f(Q));
1044
- return t.items.flatMap(
1045
- (E) => E.items && !y(E.items) ? E.items : E
1046
- ).filter((E) => E.items ? !0 : f(E));
1047
- }), xe = m(() => {
1048
- var u, O, E, Q;
1049
- const f = ["automatic", "button"].includes(t.lazyLoadType), y = ((u = t.selectedValues) == null ? void 0 : u.length) > 0 && ((O = k.value) == null ? void 0 : O.length) !== ((E = C.value) == null ? void 0 : E.length);
1050
- return f && t.hasMoreItems ? !!((Q = t.selectedValues) != null && Q.length) : y;
1051
- }), Te = m(() => ["automatic", "button"].includes(t.lazyLoadType) ? !t.hasMoreItems : !0), Ue = m(() => ({ label: S, value: G })), Ge = m(() => [Ue, ...te(t, "items").value]), ze = (f) => {
1052
- var u;
1053
- (u = Array.from(
1054
- r.value.querySelectorAll('[role="option"]')
1055
- ).filter((O) => O.checkVisibility())[f]) == null || u.focus();
1056
- }, {
1057
- moveToNextElement: Fe,
1058
- moveToPreviousElement: Ye,
1059
- moveToFirstElement: Ke,
1060
- moveToLastElement: We,
1061
- preventDefault: ke,
1062
- focusedIndex: Ae
1063
- } = Pe(
1064
- {
1065
- items: B(Ge),
1066
- hasStaticCategories: te(t, "staticCategories")
1067
- },
1068
- ze
1069
- ), qe = {
1070
- [z.ARROW_UP]: (f) => Ye(f),
1071
- [z.ARROW_DOWN]: (f) => Fe(f),
1072
- [z.HOME]: Ke,
1073
- [z.END]: We
1074
- }, He = {
1075
- [z.ARROW_UP]: ke,
1076
- [z.ARROW_DOWN]: ke
1077
- };
1078
- return (f, y) => (d(), _("div", {
1079
- ref_key: "listboxRef",
1080
- ref: r,
1081
- class: "b-listbox-multi-select"
1082
- }, [
1083
- xe.value ? (d(), _("div", zt, [
1084
- ae((d(), _("ul", U({ class: "b-listbox-multi-select__chips" }, se(He, !0)), [
1085
- (d(!0), _(le, null, V(we.value, (u) => (d(), _("li", {
1086
- key: u.value
1087
- }, [
1088
- P(R(st), {
1089
- ref_for: !0,
1090
- ref_key: "selectedListboxItemsRef",
1091
- ref: h,
1092
- disabled: f.isOptionDisabled(u),
1093
- label: u.label,
1094
- condensed: "",
1095
- onClick: (O) => u.items ? Oe(u) : de("select", u)
1096
- }, null, 8, ["disabled", "label", "onClick"])
1097
- ]))), 128))
1098
- ], 16)), [
1099
- [R(pe)]
1100
- ]),
1101
- y[4] || (y[4] = W("hr", { class: "b-listbox-multi-select__divider" }, null, -1))
1102
- ])) : K("", !0),
1103
- ae((d(), _("div", se(qe, !0), [
1104
- Te.value ? (d(), $(R(ye), {
1105
- key: 0,
1106
- ref_key: "selectAllListboxItemsRef",
1107
- ref: v,
1108
- class: "b-listbox-multi-select__option",
1109
- tabindex: R(Ae) === 0 ? 0 : -1,
1110
- "aria-checked": j.value,
1111
- onClick: M,
1112
- onEnterPressed: M,
1113
- onSpacePressed: ie(M, ["prevent"])
1114
- }, {
1115
- default: T(() => [
1116
- P(R(_e), {
1117
- checked: R(G),
1118
- indeterminate: R(I)
1119
- }, null, 8, ["checked", "indeterminate"]),
1120
- P(R(re), { el: "span" }, {
1121
- default: T(() => [
1122
- Y(F(S.value), 1)
1123
- ]),
1124
- _: 1
1125
- })
1126
- ]),
1127
- _: 1
1128
- }, 8, ["tabindex", "aria-checked"])) : K("", !0),
1129
- Te.value ? (d(), _("hr", Ft)) : K("", !0),
1130
- P(R(Ut), {
1131
- ref_key: "listboxItemsRef",
1132
- ref: n,
1133
- items: f.items,
1134
- "is-option-disabled": f.isOptionDisabled,
1135
- "is-multi-level": R(o),
1136
- "static-categories": f.staticCategories,
1137
- searching: f.searching,
1138
- "selected-items-list": a.value,
1139
- "focused-index": R(Ae),
1140
- onToggleCheckboxSelection: y[0] || (y[0] = (u) => de("select", u)),
1141
- onSelectCategory: ce,
1142
- onUnselectCategory: Oe,
1143
- onSpacePressed: y[1] || (y[1] = (u) => de(R(b).SPACE, u)),
1144
- onTabPressed: y[2] || (y[2] = (u) => de(R(b).TAB, u)),
1145
- onEnterPressed: y[3] || (y[3] = (u) => de(R(b).ENTER, u))
1146
- }, me({ _: 2 }, [
1147
- V(R(l), (u, O) => ({
1148
- name: O,
1149
- fn: T((E) => [
1150
- q(f.$slots, O, ne(be(E)), void 0, !0)
1151
- ])
1152
- }))
1153
- ]), 1032, ["items", "is-option-disabled", "is-multi-level", "static-categories", "searching", "selected-items-list", "focused-index"])
1154
- ], 16)), [
1155
- [R(pe)]
1156
- ])
1157
- ], 512));
1158
- }
1159
- }), $e = /* @__PURE__ */ X(Kt, [["__scopeId", "data-v-1997b63d"]]), De = {
1160
- "en-US": {
1161
- loading: "Loading",
1162
- showMore: "Show more"
1163
- },
1164
- "ja-JP": {
1165
- loading: "読み込み中",
1166
- showMore: "表示内容を増やす"
1167
- },
1168
- "pt-BR": {
1169
- loading: "Carregando",
1170
- showMore: "Mostrar mais"
1171
- }
1172
- }, Wt = 36, qt = Z({
1173
- name: "bento-listbox",
1174
- components: {
1175
- BentoEmptyState: et,
1176
- BentoListboxSingleSelect: At,
1177
- BentoListboxMultiSelect: $e,
1178
- BentoTypography: re,
1179
- BentoLoadingIndicator: Qe,
1180
- BentoLoadingButton: at
1181
- },
1182
- directives: { BentoKeyboardNavigationDirective: pe },
1183
- i18n: { messages: De },
1184
- props: {
1185
- /**
1186
- * Defines a string value that labels an interactive element.
1187
- */
1188
- ariaLabel: { type: String, default: null },
1189
- /**
1190
- * Empty state props that will be used with the inner empty state component to be displayed when no search results are found.
1191
- */
1192
- emptyState: {
1193
- type: Object,
1194
- default: void 0
1195
- },
1196
- /**
1197
- * Indicates whether there are more items to load
1198
- */
1199
- hasMoreItems: { type: Boolean, default: !1 },
1200
- /**
1201
- * Identifies the listbox whose contents are controlled by the the combobox on which the aria-controls attribute is set.
1202
- */
1203
- id: { type: String, required: !0 },
1204
- /**
1205
- * Function that allows the options to be disabled
1206
- *
1207
- * @type {BentoListboxIsOptionDisabled}
1208
- * @param {BentoListboxOptionItem} option - Listbox option object
1209
- * @param {string} option.label - Option's label text
1210
- * @param {string|number} option.value - Option's value
1211
- * @param {unknown} option.data - Option's extra data to be passed to the default slot
1212
- */
1213
- isOptionDisabled: {
1214
- type: Function,
1215
- default: () => {
1216
- }
1217
- },
1218
- /**
1219
- * The option elements to populate the listbox with.
1220
- * It must be an array of {@see BentoListboxOptionItem }
1221
- * * @property {string} value.label - Text to be displayed in the option
1222
- * * @property {string,number} value.value - Value of the option
1223
- */
1224
- items: {
1225
- type: Array,
1226
- required: !0
1227
- },
1228
- /**
1229
- * Indicates if new options are lazy loading.
1230
- */
1231
- loading: { type: Boolean, default: !1 },
1232
- /**
1233
- * The type of `Lazy Load`.
1234
- * Type "automatic" will enable infinite scrolling
1235
- * Type "button" will enable lazy loading with "Show more" button
1236
- */
1237
- lazyLoadType: {
1238
- type: String,
1239
- default: oe.NONE,
1240
- validator: (e) => Object.values(oe).includes(e)
1241
- },
1242
- /**
1243
- * Indicates the listbox is loading filtered items.
1244
- */
1245
- componentLoading: { type: Boolean, default: !1 },
1246
- /**
1247
- * If enabled, the user will be able to select multiple items.
1248
- */
1249
- multiple: { type: Boolean, default: !1 },
1250
- /**
1251
- * If enabled, dropdown will display non-selectable, static categories
1252
- */
1253
- staticCategories: { type: Boolean, default: !1 },
1254
- /**
1255
- * Messaged displayed when no items are listed in the listbox
1256
- */
1257
- noResultsMessage: { type: String, required: !0 },
1258
- /**
1259
- * Flag that indicates that an external search it's being made
1260
- * to filter out the items inside the the multi-select listbox
1261
- *
1262
- * If enabled, hides the "Select all" checkbox in "multiple" mode.
1263
- */
1264
- searching: $e.props.searching,
1265
- /**
1266
- * The `input` value.
1267
- * Providing an empty string or empty array will select no options.
1268
- * Set to an empty string `''` if you don't want any of the available options to be selected for single select
1269
- */
1270
- selectedValue: {
1271
- type: Array,
1272
- default: () => []
1273
- },
1274
- /**
1275
- * Enables virtual scrolling if set to true or by providing an object with itemHeight function.
1276
- * The itemHeight function is used to calculate the height of rendered item given it's index.
1277
- */
1278
- virtualScroll: {
1279
- type: [Boolean, Object],
1280
- default: !1
1281
- }
1282
- },
1283
- emits: [
1284
- b.SELECT,
1285
- b.SPACE,
1286
- b.SHOW_MORE,
1287
- b.ENTER,
1288
- b.ESCAPE,
1289
- b.TAB
1290
- ],
1291
- setup(e, { emit: s, slots: t }) {
1292
- const c = B([]), i = te(e, "items"), { t: l } = Ee({ messages: De }), r = m(() => e.lazyLoadType !== oe.AUTOMATIC), v = m(() => e.lazyLoadType === oe.AUTOMATIC), h = () => {
1293
- var M;
1294
- return typeof (e == null ? void 0 : e.virtualScroll) == "object" && ((M = e == null ? void 0 : e.virtualScroll) != null && M.itemHeight) ? e.virtualScroll.itemHeight : Wt;
1295
- }, {
1296
- containerRef: n,
1297
- containerProps: a,
1298
- onScroll: o,
1299
- list: C,
1300
- wrapperProps: g
1301
- } = ct(i, {
1302
- itemHeight: h(),
1303
- // Disable virtual scrolling if not enabled or if lazy loading is enabled or if multi-select
1304
- disabled: (e == null ? void 0 : e.multiple) || (e == null ? void 0 : e.virtualScroll) === !1 || (e == null ? void 0 : e.lazyLoadType) !== "none"
1305
- }), p = m(
1306
- () => e.componentLoading !== void 0 || r.value ? "true" : void 0
1307
- ), k = m(
1308
- () => r.value && e.loading || e.componentLoading ? "true" : "false"
1309
- ), w = m(
1310
- () => r.value || e.componentLoading !== void 0 ? "polite" : void 0
1311
- ), S = (M) => (ce) => {
1312
- s(M, ce);
1313
- }, A = () => {
1314
- s(b.SHOW_MORE);
1315
- }, N = tt(() => {
1316
- const M = n.value;
1317
- if (!M)
1318
- return;
1319
- const ce = Math.round(M.scrollTop) + M.clientHeight >= M.scrollHeight;
1320
- e.hasMoreItems && ce && !e.loading && A();
1321
- }), x = () => {
1322
- v.value ? N() : o();
1323
- }, D = m(() => {
1324
- var M;
1325
- return ((M = e.items) == null ? void 0 : M.length) === 0;
1326
- }), G = m(
1327
- () => e.lazyLoadType === oe.BUTTON && e.hasMoreItems
1328
- ), I = m(
1329
- () => e.loading ? Le.LOADING : Le.START
1330
- ), H = m(() => e.loading ? l("loading") : l("showMore")), j = m(() => ({
1331
- ...e.emptyState,
1332
- variant: "condensed"
1333
- })), J = {
1334
- [b.SELECT]: S(b.SELECT),
1335
- [b.SPACE]: S(b.SPACE),
1336
- [b.TAB]: S(b.TAB),
1337
- [b.ENTER]: S(b.ENTER)
1338
- };
1339
- return {
1340
- // Refs
1341
- listboxRef: n,
1342
- listboxItemRef: c,
1343
- // a11y
1344
- ariaAtomic: p,
1345
- ariaBusy: k,
1346
- ariaLive: w,
1347
- // Values
1348
- containerProps: a,
1349
- isSearchResultEmpty: D,
1350
- limitedEmptyStateProps: j,
1351
- loadingButtonState: I,
1352
- slots: t,
1353
- shouldDisplayShowMoreButton: G,
1354
- showMoreButtonText: H,
1355
- virtualisedItems: C,
1356
- wrapperProps: g,
1357
- // Enums
1358
- BentoKeyboardNavigationKeyDownEvent: z,
1359
- BentoListboxEvent: b,
1360
- // Methods
1361
- onListboxContainerScroll: x,
1362
- onOptionSelected: S,
1363
- emitShowMore: A,
1364
- listboxListeners: J
1365
- };
1366
- }
1367
- }), Ht = ["id", "aria-busy", "aria-atomic", "aria-label", "aria-live"], jt = {
1368
- key: 0,
1369
- class: "b-listbox__loading-filtered-items"
1370
- }, Vt = {
1371
- key: 1,
1372
- class: "b-listbox__empty-search-message"
1373
- }, Xt = {
1374
- key: 2,
1375
- class: "b-listbox__lazy-load"
1376
- }, Jt = {
1377
- key: 3,
1378
- class: "b-listbox__lazy-load"
1379
- };
1380
- function Zt(e, s, t, c, i, l) {
1381
- var g;
1382
- const r = L("bento-loading-indicator"), v = L("bento-empty-state"), h = L("bento-typography"), n = L("bento-listbox-multi-select"), a = L("bento-listbox-single-select"), o = L("bento-loading-button"), C = Re("bento-keyboard-navigation-directive");
1383
- return ae((d(), _("div", {
1384
- id: e.id,
1385
- ref: "listboxRef",
1386
- class: "b-listbox",
1387
- role: "listbox",
1388
- tabindex: "-1",
1389
- "aria-busy": e.ariaBusy,
1390
- "aria-atomic": e.ariaAtomic,
1391
- "aria-label": e.ariaLabel,
1392
- "aria-live": e.ariaLive,
1393
- style: Ze((g = e.containerProps) == null ? void 0 : g.style),
1394
- onScroll: s[0] || (s[0] = (...p) => e.onListboxContainerScroll && e.onListboxContainerScroll(...p))
1395
- }, [
1396
- W("div", ne(be(e.wrapperProps)), [
1397
- e.componentLoading ? (d(), _("div", jt, [
1398
- P(r)
1399
- ])) : e.isSearchResultEmpty ? (d(), _("div", Vt, [
1400
- e.emptyState ? (d(), $(v, ne(U({ key: 0 }, e.limitedEmptyStateProps)), null, 16)) : (d(), $(h, {
1401
- key: 1,
1402
- el: "span"
1403
- }, {
1404
- default: T(() => [
1405
- Y(F(e.noResultsMessage), 1)
1406
- ]),
1407
- _: 1
1408
- }))
1409
- ])) : (d(), _(le, { key: 2 }, [
1410
- e.multiple ? (d(), $(n, U({
1411
- key: 0,
1412
- ref: "listboxItemRef",
1413
- "has-more-items": e.hasMoreItems,
1414
- items: e.items,
1415
- "lazy-load-type": e.lazyLoadType,
1416
- "static-categories": e.staticCategories,
1417
- "selected-values": e.selectedValue,
1418
- searching: e.searching,
1419
- "is-option-disabled": e.isOptionDisabled
1420
- }, se(e.listboxListeners)), me({ _: 2 }, [
1421
- V(e.slots, (p, k) => ({
1422
- name: k,
1423
- fn: T((w) => [
1424
- q(e.$slots, k, ne(be(w)), void 0, !0)
1425
- ])
1426
- }))
1427
- ]), 1040, ["has-more-items", "items", "lazy-load-type", "static-categories", "selected-values", "searching", "is-option-disabled"])) : (d(), $(a, U({
1428
- key: 1,
1429
- ref: "listboxItemRef",
1430
- items: e.virtualisedItems,
1431
- "selected-value": e.selectedValue,
1432
- "static-categories": e.staticCategories,
1433
- "is-option-disabled": e.isOptionDisabled
1434
- }, se(e.listboxListeners)), me({ _: 2 }, [
1435
- V(e.slots, (p, k) => ({
1436
- name: k,
1437
- fn: T((w) => [
1438
- q(e.$slots, k, ne(be(w)), void 0, !0)
1439
- ])
1440
- }))
1441
- ]), 1040, ["items", "selected-value", "static-categories", "is-option-disabled"])),
1442
- e.shouldDisplayShowMoreButton ? (d(), _("div", Xt, [
1443
- P(o, {
1444
- state: e.loadingButtonState,
1445
- variant: "secondary",
1446
- onClickCapture: e.emitShowMore
1447
- }, {
1448
- default: T(() => [
1449
- Y(F(e.showMoreButtonText), 1)
1450
- ]),
1451
- _: 1
1452
- }, 8, ["state", "onClickCapture"])
1453
- ])) : e.loading ? (d(), _("div", Jt, [
1454
- P(r)
1455
- ])) : K("", !0)
1456
- ], 64))
1457
- ], 16)
1458
- ], 44, Ht)), [
1459
- [C]
1460
- ]);
1461
- }
1462
- const gs = /* @__PURE__ */ X(qt, [["render", Zt], ["__scopeId", "data-v-7b74fe4e"]]), Ce = (e, s) => {
1463
- for (const t of e) {
1464
- if (t.value === s)
1465
- return t;
1466
- if (t.items) {
1467
- const c = Ce(t.items, s);
1468
- if (c)
1469
- return c;
1470
- }
1471
- }
1472
- return null;
1473
- }, Qt = (e) => typeof e == "object" && e !== null && "value" in e && "label" in e, ys = (e, s, t, c) => {
1474
- const i = B([]), l = B(), r = (a) => {
1475
- t.value ? l.value = a.map(({ value: o }) => o) : l.value = a.length > 0 ? a[0].value : null;
1476
- }, v = (a) => {
1477
- t.value ? l.value = a.map(({ value: o, label: C }) => ({ value: o, label: C })) : l.value = a.length > 0 ? { value: a[0].value, label: a[0].label } : null;
1478
- }, h = (a) => {
1479
- i.value = a, c != null && c.value ? v(a) : r(a);
1480
- }, n = () => {
1481
- i.value = [], l.value = null;
1482
- };
1483
- return ge(
1484
- () => s.value,
1485
- () => {
1486
- if (!s.value && s.value !== 0) {
1487
- n();
1488
- return;
1489
- }
1490
- const a = !Array.isArray(s.value), o = [...i.value];
1491
- n();
1492
- const C = (g) => {
1493
- if (Qt(g))
1494
- i.value.push(g);
1495
- else {
1496
- let p = Ce(e.value, g);
1497
- p || (p = Ce(o, g)), p || (p = { value: g, label: g.toString() }), i.value.push(p);
1498
- }
1499
- };
1500
- if (a) {
1501
- const g = s.value;
1502
- C(g), c != null && c.value ? v(i.value) : r(i.value);
1503
- return;
1504
- }
1505
- s.value.forEach(C), c != null && c.value ? v(i.value) : r(i.value);
1506
- },
1507
- { immediate: !0 }
1508
- ), {
1509
- // Values
1510
- cachedSelectedListboxOptions: i,
1511
- cachedListboxSelectedValues: l,
1512
- // Methods
1513
- resetCache: n,
1514
- setCachedValues: h
1515
- };
1516
- };
1517
- export {
1518
- oe as B,
1519
- b as a,
1520
- gs as b,
1521
- ys as c,
1522
- Gt as u
1523
- };
1524
- //# sourceMappingURL=use-cached-selected-values.swt0cdsA.js.map