@adyen/bento-vue3 1.64.0 → 1.65.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.
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/menu.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/popover.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/use-cached-selected-values.css +1 -1
- package/dist/chunks/{code-snippet.CcWkFdEq.js → code-snippet.Bj5SAyT-.js} +2 -2
- package/dist/chunks/{code-snippet.CcWkFdEq.js.map → code-snippet.Bj5SAyT-.js.map} +1 -1
- package/dist/chunks/{data-grid.D0De1biC.js → data-grid.DroQMKSc.js} +660 -654
- package/dist/chunks/{data-grid.D0De1biC.js.map → data-grid.DroQMKSc.js.map} +1 -1
- package/dist/chunks/{date-picker.BLYOus7e.js → date-picker.BuX2J2OW.js} +19 -19
- package/dist/chunks/date-picker.BuX2J2OW.js.map +1 -0
- package/dist/chunks/{date-range-picker._0XU4TRk.js → date-range-picker.C2x1_xoz.js} +3 -3
- package/dist/chunks/{date-range-picker._0XU4TRk.js.map → date-range-picker.C2x1_xoz.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.JTxCvtZL.js → dropdown-tag.Dm-1VD3B.js} +2 -2
- package/dist/chunks/{dropdown-tag.JTxCvtZL.js.map → dropdown-tag.Dm-1VD3B.js.map} +1 -1
- package/dist/chunks/{dropdown.Bz5hTRFH.js → dropdown.Bj6DK-2v.js} +323 -312
- package/dist/chunks/dropdown.Bj6DK-2v.js.map +1 -0
- package/dist/chunks/{filter-bar.ChPG7oJN.js → filter-bar.BvInaVGL.js} +7 -7
- package/dist/chunks/{filter-bar.ChPG7oJN.js.map → filter-bar.BvInaVGL.js.map} +1 -1
- package/dist/chunks/{header-with-views.DkoDjkyK.js → header-with-views.De0oVJXS.js} +2 -2
- package/dist/chunks/{header-with-views.DkoDjkyK.js.map → header-with-views.De0oVJXS.js.map} +1 -1
- package/dist/chunks/{input-field-password.nYZBZ1bM.js → input-field-password.CJOf1GlS.js} +3 -3
- package/dist/chunks/{input-field-password.nYZBZ1bM.js.map → input-field-password.CJOf1GlS.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.Ck_1WdgH.js → input-field-phone-number.DVliTkE3.js} +3 -3
- package/dist/chunks/{input-field-phone-number.Ck_1WdgH.js.map → input-field-phone-number.DVliTkE3.js.map} +1 -1
- package/dist/chunks/{input-field.BdDrm776.js → input-field.xUQT0LXI.js} +2 -2
- package/dist/chunks/{input-field.BdDrm776.js.map → input-field.xUQT0LXI.js.map} +1 -1
- package/dist/chunks/{pagination.DbuaT-4D.js → pagination.D6A7TX6J.js} +2 -2
- package/dist/chunks/{pagination.DbuaT-4D.js.map → pagination.D6A7TX6J.js.map} +1 -1
- package/dist/chunks/{search-bar.DzVNjmpW.js → search-bar.Cngs3uYZ.js} +3 -3
- package/dist/chunks/{search-bar.DzVNjmpW.js.map → search-bar.Cngs3uYZ.js.map} +1 -1
- package/dist/chunks/{secondary-nav.tId-4Wy2.js → secondary-nav.ByCa4wiA.js} +2 -2
- package/dist/chunks/{secondary-nav.tId-4Wy2.js.map → secondary-nav.ByCa4wiA.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.CatIU1_1.js → use-cached-selected-values.CEwKqYIe.js} +616 -607
- package/dist/chunks/{use-cached-selected-values.CatIU1_1.js.map → use-cached-selected-values.CEwKqYIe.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker.js +1 -1
- package/dist/dropdown.js +3 -3
- package/dist/filter-bar.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/index.js +15 -15
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/internal.js +1 -1
- package/dist/pagination.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +5 -5
- package/dist/chunks/date-picker.BLYOus7e.js.map +0 -1
- package/dist/chunks/dropdown.Bz5hTRFH.js.map +0 -1
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
import { computed as p, ref as B, onMounted as
|
|
1
|
+
import { computed as p, ref as B, onMounted as et, onUnmounted as tt, watch as ne, defineComponent as Z, resolveComponent as k, createElementBlock as O, openBlock as d, createVNode as x, createElementVNode as z, withCtx as I, createTextVNode as K, toDisplayString as F, renderSlot as W, mergeProps as w, withKeys as Ce, createCommentVNode as J, createBlock as R, withModifiers as ae, normalizeProps as ie, guardReactiveProps as ue, withDirectives as re, vShow as Pe, nextTick as Me, resolveDirective as xe, toHandlers as se, Fragment as le, renderList as H, createSlots as be, normalizeClass as me, unref as M, toRef as _e, useSlots as st, useAttrs as lt } from "vue";
|
|
2
2
|
import { B as V, a as pe } from "./keyboard-navigation.CqgGzfZQ.js";
|
|
3
3
|
import "./events.FNmSWp_P.js";
|
|
4
4
|
import { B as ce } from "./typography.DN5eC5ch.js";
|
|
5
|
-
import { B as
|
|
6
|
-
import { B as
|
|
5
|
+
import { B as ot } from "./loading-indicator.DEepb9Wl.js";
|
|
6
|
+
import { B as it } from "./empty-state.D7llINgF.js";
|
|
7
7
|
import { u as Oe } from "./i18n.B6g5VX0q.js";
|
|
8
|
-
import { d as
|
|
9
|
-
import { B as
|
|
10
|
-
import { _ as
|
|
11
|
-
import { C as fe, N as
|
|
12
|
-
import { C as
|
|
13
|
-
import { C as
|
|
14
|
-
import { C as
|
|
15
|
-
import { d as
|
|
8
|
+
import { d as nt } from "./debounce.DUTu11PS.js";
|
|
9
|
+
import { B as at } from "./chip.CneNX2_j.js";
|
|
10
|
+
import { _ as j } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
11
|
+
import { C as fe, N as rt } from "./minus-small.DYIyF5XW.js";
|
|
12
|
+
import { C as ct } from "./checkmark-small.x-gmK2Dt.js";
|
|
13
|
+
import { C as dt } from "./chevron-down.DCQ6ZLaq.js";
|
|
14
|
+
import { C as ut } from "./chevron-up.kfuLRpZb.js";
|
|
15
|
+
import { d as bt, e as De } from "./button-actions.D1pXI1AJ.js";
|
|
16
16
|
/* empty css */
|
|
17
|
-
import { o as
|
|
17
|
+
import { o as mt } from "./resize.Bqks3WUm.js";
|
|
18
18
|
import "../assets/use-cached-selected-values.css";
|
|
19
|
-
const Ge = (e, t,
|
|
20
|
-
const
|
|
19
|
+
const Ge = (e, t, n, s) => {
|
|
20
|
+
const a = p(
|
|
21
21
|
() => {
|
|
22
|
-
var
|
|
23
|
-
return !!((
|
|
22
|
+
var m, h;
|
|
23
|
+
return !!((m = e.value) != null && m.length) && ((h = e.value) == null ? void 0 : h.length) === t.value.length;
|
|
24
24
|
}
|
|
25
|
-
),
|
|
26
|
-
var
|
|
27
|
-
return e.value == null || e.value.length === 0 ? !1 : ((
|
|
25
|
+
), i = p(() => {
|
|
26
|
+
var m;
|
|
27
|
+
return e.value == null || e.value.length === 0 ? !1 : ((m = e.value) == null ? void 0 : m.length) !== t.value.length;
|
|
28
28
|
});
|
|
29
29
|
return {
|
|
30
|
-
isAllSelected:
|
|
31
|
-
isIndeterminate:
|
|
32
|
-
toggleSelectAll: (
|
|
33
|
-
|
|
30
|
+
isAllSelected: a,
|
|
31
|
+
isIndeterminate: i,
|
|
32
|
+
toggleSelectAll: (m) => {
|
|
33
|
+
m ? n() : s();
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
|
-
function
|
|
38
|
-
const
|
|
39
|
-
let
|
|
40
|
-
const
|
|
41
|
-
const A = typeof
|
|
37
|
+
function vt(e, { disabled: t, itemHeight: n, overscan: s = 5, prefixHeight: a }) {
|
|
38
|
+
const i = B(null), c = B([]), m = B(0), h = B(0), l = B(0);
|
|
39
|
+
let r;
|
|
40
|
+
const o = p(() => {
|
|
41
|
+
const A = typeof n == "number" ? e.value.length * n : e.value.reduce((L, $, C) => L + n(C), 0), P = typeof n == "number" ? m.value * n : e.value.slice(0, m.value).reduce((L, $, C) => L + n(C), 0);
|
|
42
42
|
return {
|
|
43
43
|
style: {
|
|
44
|
-
marginTop: `${
|
|
45
|
-
height: `${A -
|
|
44
|
+
marginTop: `${P}px`,
|
|
45
|
+
height: `${A - P}px`
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
}),
|
|
49
|
-
const A = (
|
|
50
|
-
if (typeof
|
|
51
|
-
return Math.floor(
|
|
52
|
-
let
|
|
53
|
-
for (let
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
|
|
48
|
+
}), y = () => {
|
|
49
|
+
const A = (a == null ? void 0 : a.value) ?? 0, P = Math.max(i.value.scrollTop - A, 0);
|
|
50
|
+
if (typeof n == "number")
|
|
51
|
+
return Math.floor(P / n);
|
|
52
|
+
let L = 0, $ = 0;
|
|
53
|
+
for (let C = 0; C < e.value.length; C += 1) {
|
|
54
|
+
const S = n(C);
|
|
55
|
+
if (L += S, L >= P) {
|
|
56
|
+
$ = C;
|
|
57
57
|
break;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
return
|
|
61
|
-
},
|
|
62
|
-
if (
|
|
63
|
-
return Math.ceil(
|
|
64
|
-
const A =
|
|
65
|
-
let
|
|
66
|
-
for (let
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
60
|
+
return $;
|
|
61
|
+
}, g = () => {
|
|
62
|
+
if (l.value = i.value.clientHeight, typeof n == "number")
|
|
63
|
+
return Math.ceil(l.value / n);
|
|
64
|
+
const A = m.value ?? 0;
|
|
65
|
+
let P = 0, L = 0;
|
|
66
|
+
for (let $ = A; $ < e.value.length; $ += 1) {
|
|
67
|
+
const C = n($);
|
|
68
|
+
if (P += C, L = $, P > l.value)
|
|
69
69
|
break;
|
|
70
70
|
}
|
|
71
|
-
return
|
|
71
|
+
return L - A;
|
|
72
72
|
}, T = () => {
|
|
73
|
-
if (
|
|
74
|
-
const A =
|
|
75
|
-
|
|
73
|
+
if (i.value) {
|
|
74
|
+
const A = g();
|
|
75
|
+
m.value = y(), h.value = Math.min(m.value + A + s, e.value.length), c.value = e.value.slice(m.value, h.value);
|
|
76
76
|
}
|
|
77
|
-
},
|
|
77
|
+
}, N = () => {
|
|
78
78
|
T();
|
|
79
79
|
};
|
|
80
|
-
t || (
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
t || (et(() => {
|
|
81
|
+
i.value && (l.value = i.value.clientHeight, r = mt(i.value, ({ clientHeight: A }) => {
|
|
82
|
+
l.value = A, T();
|
|
83
83
|
}), T());
|
|
84
|
-
}),
|
|
85
|
-
|
|
84
|
+
}), tt(() => {
|
|
85
|
+
r == null || r.disconnect();
|
|
86
86
|
}), ne(
|
|
87
87
|
() => e.value,
|
|
88
88
|
() => {
|
|
@@ -90,26 +90,26 @@ function bt(e, { disabled: t, itemHeight: s, overscan: o = 5, prefixHeight: n })
|
|
|
90
90
|
}
|
|
91
91
|
));
|
|
92
92
|
const D = {
|
|
93
|
-
ref:
|
|
93
|
+
ref: i,
|
|
94
94
|
style: { overflowY: "auto" }
|
|
95
95
|
};
|
|
96
96
|
return t ? {
|
|
97
|
-
containerRef:
|
|
97
|
+
containerRef: i,
|
|
98
98
|
containerProps: D,
|
|
99
99
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
100
100
|
onScroll: () => {
|
|
101
101
|
},
|
|
102
102
|
list: e
|
|
103
103
|
} : {
|
|
104
|
-
containerRef:
|
|
104
|
+
containerRef: i,
|
|
105
105
|
containerProps: D,
|
|
106
|
-
onScroll:
|
|
107
|
-
list:
|
|
108
|
-
wrapperProps:
|
|
106
|
+
onScroll: N,
|
|
107
|
+
list: c,
|
|
108
|
+
wrapperProps: o
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
var v = /* @__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))(v || {}), oe = /* @__PURE__ */ ((e) => (e.AUTOMATIC = "automatic", e.BUTTON = "button", e.NONE = "none", e))(oe || {});
|
|
112
|
-
const
|
|
112
|
+
const ft = Z({
|
|
113
113
|
name: "bento-listbox-static-category",
|
|
114
114
|
components: {
|
|
115
115
|
BentoTypography: ce
|
|
@@ -123,11 +123,11 @@ const mt = J({
|
|
|
123
123
|
required: !0
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
}),
|
|
127
|
-
function
|
|
128
|
-
const
|
|
129
|
-
return d(), O("div",
|
|
130
|
-
|
|
126
|
+
}), pt = { class: "b-listbox-single-select-category" };
|
|
127
|
+
function gt(e, t, n, s, a, i) {
|
|
128
|
+
const c = k("bento-typography");
|
|
129
|
+
return d(), O("div", pt, [
|
|
130
|
+
x(c, {
|
|
131
131
|
variant: "caption",
|
|
132
132
|
el: "span",
|
|
133
133
|
class: "b-listbox-single-select-category__label-text"
|
|
@@ -142,7 +142,7 @@ function ft(e, t, s, o, n, a) {
|
|
|
142
142
|
])
|
|
143
143
|
]);
|
|
144
144
|
}
|
|
145
|
-
const
|
|
145
|
+
const yt = /* @__PURE__ */ j(ft, [["render", gt], ["__scopeId", "data-v-a90eff17"]]), St = Z({
|
|
146
146
|
name: "bento-listbox-option",
|
|
147
147
|
props: {
|
|
148
148
|
/**
|
|
@@ -156,7 +156,7 @@ const pt = /* @__PURE__ */ H(mt, [["render", ft], ["__scopeId", "data-v-a90eff17
|
|
|
156
156
|
},
|
|
157
157
|
emits: [v.CLICK, v.ENTER, v.SPACE, v.TAB],
|
|
158
158
|
setup(e, { emit: t }) {
|
|
159
|
-
const
|
|
159
|
+
const n = p(() => ({
|
|
160
160
|
"b-listbox-option--disabled": e.disabled,
|
|
161
161
|
"b-listbox-option--selected": e.selected
|
|
162
162
|
}));
|
|
@@ -165,60 +165,60 @@ const pt = /* @__PURE__ */ H(mt, [["render", ft], ["__scopeId", "data-v-a90eff17
|
|
|
165
165
|
BentoKeyboardNavigationKeyDownEvent: V,
|
|
166
166
|
BentoListboxEvent: v,
|
|
167
167
|
// Values
|
|
168
|
-
conditionalClasses:
|
|
168
|
+
conditionalClasses: n,
|
|
169
169
|
// Events
|
|
170
|
-
onClick: (
|
|
171
|
-
t(v.CLICK,
|
|
170
|
+
onClick: (i) => {
|
|
171
|
+
t(v.CLICK, i);
|
|
172
172
|
},
|
|
173
|
-
onOptionSelected: (
|
|
174
|
-
t(
|
|
173
|
+
onOptionSelected: (i, c) => {
|
|
174
|
+
t(i, c);
|
|
175
175
|
}
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
178
|
});
|
|
179
|
-
function
|
|
180
|
-
return d(), O("div",
|
|
179
|
+
function ht(e, t, n, s, a, i) {
|
|
180
|
+
return d(), O("div", w({
|
|
181
181
|
class: ["b-listbox-option", e.conditionalClasses],
|
|
182
182
|
role: "option"
|
|
183
183
|
}, e.$attrs, {
|
|
184
|
-
onClick: t[0] || (t[0] = (...
|
|
184
|
+
onClick: t[0] || (t[0] = (...c) => e.onClick && e.onClick(...c)),
|
|
185
185
|
onKeydown: [
|
|
186
|
-
t[1] || (t[1] = Ce((
|
|
187
|
-
t[2] || (t[2] = Ce((
|
|
188
|
-
t[3] || (t[3] = Ce((
|
|
186
|
+
t[1] || (t[1] = Ce((c) => e.onOptionSelected(e.BentoListboxEvent.ENTER, c), ["enter"])),
|
|
187
|
+
t[2] || (t[2] = Ce((c) => e.onOptionSelected(e.BentoListboxEvent.SPACE, c), ["space"])),
|
|
188
|
+
t[3] || (t[3] = Ce((c) => e.onOptionSelected(e.BentoListboxEvent.TAB, c), ["tab"]))
|
|
189
189
|
]
|
|
190
190
|
}), [
|
|
191
191
|
W(e.$slots, "default", {}, void 0, !0)
|
|
192
192
|
], 16);
|
|
193
193
|
}
|
|
194
|
-
const ge = /* @__PURE__ */
|
|
194
|
+
const ge = /* @__PURE__ */ j(St, [["render", ht], ["__scopeId", "data-v-b7af43a6"]]);
|
|
195
195
|
let Be = 0;
|
|
196
|
-
const
|
|
196
|
+
const Ct = {
|
|
197
197
|
beforeCreate() {
|
|
198
198
|
this.uuid = Be.toString(), Be += 1;
|
|
199
199
|
}
|
|
200
|
-
},
|
|
201
|
-
function
|
|
202
|
-
return d(), O("svg",
|
|
200
|
+
}, Et = { key: 0 };
|
|
201
|
+
function _t(e, t, n, s, a, i) {
|
|
202
|
+
return d(), O("svg", w({ role: "img" }, e.$attrs, {
|
|
203
203
|
class: "ui-assets-icons-16",
|
|
204
204
|
xmlns: "http://www.w3.org/2000/svg",
|
|
205
205
|
width: "16",
|
|
206
206
|
height: "16",
|
|
207
207
|
fill: "none"
|
|
208
208
|
}), [
|
|
209
|
-
e.$attrs["svg-title"] ? (d(), O("title",
|
|
209
|
+
e.$attrs["svg-title"] ? (d(), O("title", Et, F(e.$attrs["svg-title"]), 1)) : J("", !0),
|
|
210
210
|
t[0] || (t[0] = z("path", {
|
|
211
211
|
fill: "#001222",
|
|
212
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
213
|
}, null, -1))
|
|
214
214
|
], 16);
|
|
215
215
|
}
|
|
216
|
-
const
|
|
216
|
+
const Ot = /* @__PURE__ */ j(Ct, [["render", _t]]), Tt = Z({
|
|
217
217
|
name: "bento-listbox-single-select-option",
|
|
218
218
|
components: {
|
|
219
219
|
BentoListboxOption: ge,
|
|
220
220
|
BentoTypography: ce,
|
|
221
|
-
CheckmarkIcon:
|
|
221
|
+
CheckmarkIcon: Ot
|
|
222
222
|
},
|
|
223
223
|
props: {
|
|
224
224
|
/**
|
|
@@ -240,45 +240,45 @@ const Et = /* @__PURE__ */ H(St, [["render", Ct]]), _t = J({
|
|
|
240
240
|
},
|
|
241
241
|
emits: [v.ENTER, v.SELECT, v.SPACE, v.TAB],
|
|
242
242
|
setup(e, { emit: t }) {
|
|
243
|
-
const
|
|
244
|
-
e.disabled || t(
|
|
245
|
-
},
|
|
243
|
+
const n = (c) => {
|
|
244
|
+
e.disabled || t(c, e.option);
|
|
245
|
+
}, s = p(() => e.disabled ? !0 : null), a = p(() => e.selected ? !0 : null), i = p(() => e.disabled ? -1 : 0);
|
|
246
246
|
return {
|
|
247
247
|
// Values
|
|
248
|
-
ariaDisabled:
|
|
249
|
-
ariaSelected:
|
|
250
|
-
tabIndex:
|
|
248
|
+
ariaDisabled: s,
|
|
249
|
+
ariaSelected: a,
|
|
250
|
+
tabIndex: i,
|
|
251
251
|
// Enums
|
|
252
252
|
BentoListboxEvent: v,
|
|
253
253
|
// Events
|
|
254
|
-
onOptionSelected:
|
|
254
|
+
onOptionSelected: n
|
|
255
255
|
};
|
|
256
256
|
}
|
|
257
|
-
}),
|
|
258
|
-
function
|
|
259
|
-
const
|
|
260
|
-
return d(), R(
|
|
257
|
+
}), It = { class: "b-listbox-single-select-option__text" }, At = { class: "b-listbox-single-select-option__check-icon" };
|
|
258
|
+
function kt(e, t, n, s, a, i) {
|
|
259
|
+
const c = k("bento-typography"), m = k("checkmark-icon"), h = k("bento-listbox-option");
|
|
260
|
+
return d(), R(h, {
|
|
261
261
|
class: "b-listbox-single-select-option",
|
|
262
262
|
disabled: e.disabled,
|
|
263
263
|
selected: e.selected,
|
|
264
264
|
"aria-selected": e.ariaSelected,
|
|
265
265
|
"aria-disabled": e.ariaDisabled,
|
|
266
266
|
tabindex: e.tabIndex,
|
|
267
|
-
onClick: t[0] || (t[0] = (
|
|
268
|
-
onEnterPressed: t[1] || (t[1] = (
|
|
269
|
-
onSpacePressed: t[2] || (t[2] = ae((
|
|
270
|
-
onTabPressed: t[3] || (t[3] = (
|
|
267
|
+
onClick: t[0] || (t[0] = (l) => e.onOptionSelected(e.BentoListboxEvent.SELECT)),
|
|
268
|
+
onEnterPressed: t[1] || (t[1] = (l) => e.onOptionSelected(e.BentoListboxEvent.ENTER)),
|
|
269
|
+
onSpacePressed: t[2] || (t[2] = ae((l) => e.onOptionSelected(e.BentoListboxEvent.SPACE), ["prevent"])),
|
|
270
|
+
onTabPressed: t[3] || (t[3] = (l) => e.onOptionSelected(e.BentoListboxEvent.TAB))
|
|
271
271
|
}, {
|
|
272
272
|
default: I(() => [
|
|
273
|
-
W(e.$slots, "default", ie(
|
|
274
|
-
z("span",
|
|
275
|
-
|
|
273
|
+
W(e.$slots, "default", ie(ue(e.option)), () => [
|
|
274
|
+
z("span", It, [
|
|
275
|
+
x(c, { el: "span" }, {
|
|
276
276
|
default: I(() => [
|
|
277
277
|
K(F(e.option.label), 1)
|
|
278
278
|
]),
|
|
279
279
|
_: 1
|
|
280
280
|
}),
|
|
281
|
-
e.option.description ? (d(), R(
|
|
281
|
+
e.option.description ? (d(), R(c, {
|
|
282
282
|
key: 0,
|
|
283
283
|
class: "b-listbox-single-select-option__description",
|
|
284
284
|
el: "span"
|
|
@@ -287,11 +287,11 @@ function It(e, t, s, o, n, a) {
|
|
|
287
287
|
K(F(e.option.description), 1)
|
|
288
288
|
]),
|
|
289
289
|
_: 1
|
|
290
|
-
})) :
|
|
290
|
+
})) : J("", !0)
|
|
291
291
|
])
|
|
292
292
|
], !0),
|
|
293
|
-
z("span",
|
|
294
|
-
re(
|
|
293
|
+
z("span", At, [
|
|
294
|
+
re(x(m, { "svg-title": "selected" }, null, 512), [
|
|
295
295
|
[Pe, e.selected]
|
|
296
296
|
])
|
|
297
297
|
])
|
|
@@ -299,58 +299,58 @@ function It(e, t, s, o, n, a) {
|
|
|
299
299
|
_: 3
|
|
300
300
|
}, 8, ["disabled", "selected", "aria-selected", "aria-disabled", "tabindex"]);
|
|
301
301
|
}
|
|
302
|
-
const
|
|
303
|
-
const
|
|
304
|
-
switch (
|
|
302
|
+
const Lt = /* @__PURE__ */ j(Tt, [["render", kt], ["__scopeId", "data-v-226f4c84"]]), we = ({ items: e }, t) => {
|
|
303
|
+
const n = p(() => e.value.length - 1), s = B(0), a = (y) => {
|
|
304
|
+
switch (y) {
|
|
305
305
|
case "increase":
|
|
306
|
-
|
|
306
|
+
s.value += 1;
|
|
307
307
|
break;
|
|
308
308
|
case "decrease":
|
|
309
|
-
|
|
309
|
+
s.value -= 1;
|
|
310
310
|
break;
|
|
311
311
|
}
|
|
312
|
-
},
|
|
313
|
-
|
|
314
|
-
},
|
|
315
|
-
|
|
312
|
+
}, i = ({ edgeCaseItem: y }, g) => {
|
|
313
|
+
s.value !== y && (a(g), t(s.value));
|
|
314
|
+
}, c = (y) => {
|
|
315
|
+
o(y), i(
|
|
316
316
|
{
|
|
317
|
-
edgeCaseItem:
|
|
317
|
+
edgeCaseItem: n.value
|
|
318
318
|
},
|
|
319
319
|
"increase"
|
|
320
320
|
/* INCREASE */
|
|
321
321
|
);
|
|
322
|
-
},
|
|
323
|
-
|
|
322
|
+
}, m = (y) => {
|
|
323
|
+
o(y), i(
|
|
324
324
|
{
|
|
325
325
|
edgeCaseItem: 0
|
|
326
326
|
},
|
|
327
327
|
"decrease"
|
|
328
328
|
/* DECREASE */
|
|
329
329
|
);
|
|
330
|
-
},
|
|
331
|
-
|
|
332
|
-
},
|
|
333
|
-
|
|
334
|
-
},
|
|
335
|
-
|
|
336
|
-
},
|
|
337
|
-
var
|
|
338
|
-
(
|
|
330
|
+
}, h = () => {
|
|
331
|
+
s.value = 0, t(s.value);
|
|
332
|
+
}, l = () => {
|
|
333
|
+
s.value = n.value, t(s.value);
|
|
334
|
+
}, r = (y) => {
|
|
335
|
+
s.value = y;
|
|
336
|
+
}, o = (y) => {
|
|
337
|
+
var g;
|
|
338
|
+
(g = y == null ? void 0 : y.detail) == null || g.preventDefault();
|
|
339
339
|
};
|
|
340
340
|
return {
|
|
341
|
-
moveToFirstElement:
|
|
342
|
-
moveToLastElement:
|
|
343
|
-
moveToNextElement:
|
|
344
|
-
moveToPreviousElement:
|
|
345
|
-
setListboxFocusedIndex:
|
|
346
|
-
preventDefault:
|
|
347
|
-
focusedIndex:
|
|
341
|
+
moveToFirstElement: h,
|
|
342
|
+
moveToLastElement: l,
|
|
343
|
+
moveToNextElement: c,
|
|
344
|
+
moveToPreviousElement: m,
|
|
345
|
+
setListboxFocusedIndex: r,
|
|
346
|
+
preventDefault: o,
|
|
347
|
+
focusedIndex: s
|
|
348
348
|
};
|
|
349
|
-
},
|
|
349
|
+
}, $t = Z({
|
|
350
350
|
name: "bento-listbox-single-select",
|
|
351
351
|
components: {
|
|
352
|
-
BentoListboxSingleSelectCategory:
|
|
353
|
-
BentoListboxSingleSelectOption:
|
|
352
|
+
BentoListboxSingleSelectCategory: yt,
|
|
353
|
+
BentoListboxSingleSelectOption: Lt
|
|
354
354
|
},
|
|
355
355
|
directives: { BentoKeyboardNavigationDirective: pe },
|
|
356
356
|
inheritAttrs: !1,
|
|
@@ -394,136 +394,136 @@ const At = /* @__PURE__ */ H(_t, [["render", It], ["__scopeId", "data-v-226f4c84
|
|
|
394
394
|
staticCategories: { type: Boolean, default: !1 }
|
|
395
395
|
},
|
|
396
396
|
emits: [v.SELECT, v.ENTER, v.SPACE, v.TAB],
|
|
397
|
-
setup(e, { emit: t, expose:
|
|
398
|
-
const
|
|
399
|
-
var
|
|
400
|
-
return !!((
|
|
401
|
-
}),
|
|
397
|
+
setup(e, { emit: t, expose: n, slots: s, attrs: a }) {
|
|
398
|
+
const i = B(null), c = B([]), m = p(() => {
|
|
399
|
+
var C;
|
|
400
|
+
return !!((C = e.selectedValue) != null && C.length) && e.selectedValue.at(0);
|
|
401
|
+
}), h = p(
|
|
402
402
|
() => {
|
|
403
|
-
var
|
|
403
|
+
var C, S, Y, U;
|
|
404
404
|
return {
|
|
405
|
-
"aria-label": (
|
|
406
|
-
"aria-busy": (
|
|
407
|
-
"aria-atomic": (
|
|
408
|
-
"aria-live": (
|
|
405
|
+
"aria-label": (C = a["aria-label"]) == null ? void 0 : C.toString(),
|
|
406
|
+
"aria-busy": (S = a["aria-busy"]) == null ? void 0 : S.toString(),
|
|
407
|
+
"aria-atomic": (Y = a["aria-atomic"]) == null ? void 0 : Y.toString(),
|
|
408
|
+
"aria-live": (U = a["aria-live"]) == null ? void 0 : U.toString()
|
|
409
409
|
};
|
|
410
410
|
}
|
|
411
|
-
),
|
|
412
|
-
t(
|
|
413
|
-
},
|
|
414
|
-
await Me(),
|
|
415
|
-
},
|
|
416
|
-
var
|
|
417
|
-
(
|
|
411
|
+
), l = p(() => !!e.items.some(({ items: C }) => !!C)), r = (C) => (S) => {
|
|
412
|
+
t(C, [S]);
|
|
413
|
+
}, o = async () => {
|
|
414
|
+
await Me(), i.value && (y.value = Array.from(i.value.querySelectorAll('[role="option"]')));
|
|
415
|
+
}, y = B([]), g = (C) => {
|
|
416
|
+
var S;
|
|
417
|
+
(S = y.value[C]) == null || S.focus();
|
|
418
418
|
}, {
|
|
419
419
|
moveToNextElement: T,
|
|
420
|
-
moveToPreviousElement:
|
|
420
|
+
moveToPreviousElement: N,
|
|
421
421
|
moveToFirstElement: D,
|
|
422
422
|
moveToLastElement: A,
|
|
423
|
-
setListboxFocusedIndex:
|
|
423
|
+
setListboxFocusedIndex: P
|
|
424
424
|
} = we(
|
|
425
425
|
{
|
|
426
|
-
items:
|
|
426
|
+
items: y
|
|
427
427
|
},
|
|
428
|
-
|
|
428
|
+
g
|
|
429
429
|
);
|
|
430
430
|
ne(
|
|
431
431
|
() => e.items,
|
|
432
432
|
() => {
|
|
433
|
-
|
|
433
|
+
o();
|
|
434
434
|
},
|
|
435
435
|
{ immediate: !0 }
|
|
436
436
|
);
|
|
437
|
-
const
|
|
438
|
-
[V.ARROW_UP]:
|
|
437
|
+
const L = {
|
|
438
|
+
[V.ARROW_UP]: N,
|
|
439
439
|
[V.ARROW_DOWN]: T,
|
|
440
440
|
[V.HOME]: D,
|
|
441
441
|
[V.END]: A
|
|
442
|
-
},
|
|
443
|
-
[v.SELECT]:
|
|
444
|
-
[v.SPACE]:
|
|
445
|
-
[v.TAB]:
|
|
446
|
-
[v.ENTER]:
|
|
442
|
+
}, $ = {
|
|
443
|
+
[v.SELECT]: r(v.SELECT),
|
|
444
|
+
[v.SPACE]: r(v.SPACE),
|
|
445
|
+
[v.TAB]: r(v.TAB),
|
|
446
|
+
[v.ENTER]: r(v.ENTER)
|
|
447
447
|
};
|
|
448
|
-
return
|
|
448
|
+
return n({
|
|
449
449
|
/**
|
|
450
450
|
* Reference for a single listbox item.
|
|
451
451
|
* Required for keyboard navigation in dropdown as $children is removed in vue@3
|
|
452
452
|
*/
|
|
453
|
-
listboxItemRef:
|
|
453
|
+
listboxItemRef: c,
|
|
454
454
|
/**
|
|
455
455
|
* Method to set the index of the item to be focused on
|
|
456
456
|
* Used for focus management to be kept in-sync with parent e.g. dropdowns
|
|
457
457
|
*/
|
|
458
|
-
setListboxFocusedIndex:
|
|
458
|
+
setListboxFocusedIndex: P
|
|
459
459
|
}), {
|
|
460
460
|
// Enums
|
|
461
461
|
BentoListboxEvent: v,
|
|
462
462
|
// Values
|
|
463
|
-
listboxRef:
|
|
464
|
-
listboxItemRef:
|
|
465
|
-
selectedItem:
|
|
466
|
-
slots:
|
|
467
|
-
ariaAttributes:
|
|
463
|
+
listboxRef: i,
|
|
464
|
+
listboxItemRef: c,
|
|
465
|
+
selectedItem: m,
|
|
466
|
+
slots: s,
|
|
467
|
+
ariaAttributes: h,
|
|
468
468
|
// Computed
|
|
469
|
-
hasCategories:
|
|
469
|
+
hasCategories: l,
|
|
470
470
|
// Methods
|
|
471
|
-
onOptionSelected:
|
|
471
|
+
onOptionSelected: r,
|
|
472
472
|
// Keyboard navigation
|
|
473
|
-
listboxListeners:
|
|
474
|
-
listboxOptionListeners:
|
|
473
|
+
listboxListeners: L,
|
|
474
|
+
listboxOptionListeners: $
|
|
475
475
|
};
|
|
476
476
|
}
|
|
477
477
|
});
|
|
478
|
-
function
|
|
479
|
-
const
|
|
480
|
-
return re((d(), O("div",
|
|
481
|
-
e.hasCategories && e.staticCategories ? (d(!0), O(
|
|
482
|
-
key:
|
|
483
|
-
"category-label":
|
|
478
|
+
function Dt(e, t, n, s, a, i) {
|
|
479
|
+
const c = k("bento-listbox-single-select-option"), m = k("bento-listbox-single-select-category"), h = xe("bento-keyboard-navigation-directive");
|
|
480
|
+
return re((d(), O("div", w({ ref: "listboxRef" }, e.ariaAttributes, { role: "listbox" }, se(e.listboxListeners, !0)), [
|
|
481
|
+
e.hasCategories && e.staticCategories ? (d(!0), O(le, { key: 0 }, H(e.items, (l) => (d(), R(m, {
|
|
482
|
+
key: l.value,
|
|
483
|
+
"category-label": l.label,
|
|
484
484
|
role: "group"
|
|
485
485
|
}, {
|
|
486
486
|
default: I(() => [
|
|
487
|
-
(d(!0), O(
|
|
488
|
-
key:
|
|
487
|
+
(d(!0), O(le, null, H(l.items, (r) => (d(), R(c, w({
|
|
488
|
+
key: r.value,
|
|
489
489
|
ref_for: !0,
|
|
490
490
|
ref: "listboxItemRef",
|
|
491
491
|
role: "option",
|
|
492
|
-
option:
|
|
493
|
-
disabled: e.isOptionDisabled ? e.isOptionDisabled(
|
|
494
|
-
selected:
|
|
495
|
-
},
|
|
496
|
-
|
|
497
|
-
name:
|
|
498
|
-
fn: I((
|
|
499
|
-
W(e.$slots,
|
|
492
|
+
option: r,
|
|
493
|
+
disabled: e.isOptionDisabled ? e.isOptionDisabled(r) : null,
|
|
494
|
+
selected: r.value === e.selectedItem.value
|
|
495
|
+
}, se(e.listboxOptionListeners)), be({ _: 2 }, [
|
|
496
|
+
H(e.slots, (o, y) => ({
|
|
497
|
+
name: y,
|
|
498
|
+
fn: I((g) => [
|
|
499
|
+
W(e.$slots, y, w({ ref_for: !0 }, g))
|
|
500
500
|
])
|
|
501
501
|
}))
|
|
502
502
|
]), 1040, ["option", "disabled", "selected"]))), 128))
|
|
503
503
|
]),
|
|
504
504
|
_: 2
|
|
505
|
-
}, 1032, ["category-label"]))), 128)) : (d(!0), O(
|
|
506
|
-
key:
|
|
505
|
+
}, 1032, ["category-label"]))), 128)) : (d(!0), O(le, { key: 1 }, H(e.items, (l) => (d(), R(c, w({
|
|
506
|
+
key: l.value,
|
|
507
507
|
ref_for: !0,
|
|
508
508
|
ref: "listboxItemRef",
|
|
509
509
|
role: "option",
|
|
510
|
-
option:
|
|
511
|
-
disabled: e.isOptionDisabled ? e.isOptionDisabled(
|
|
512
|
-
selected:
|
|
513
|
-
},
|
|
514
|
-
|
|
515
|
-
name:
|
|
516
|
-
fn: I((
|
|
517
|
-
W(e.$slots,
|
|
510
|
+
option: l,
|
|
511
|
+
disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null,
|
|
512
|
+
selected: l.value === e.selectedItem.value
|
|
513
|
+
}, se(e.listboxOptionListeners)), be({ _: 2 }, [
|
|
514
|
+
H(e.slots, (r, o) => ({
|
|
515
|
+
name: o,
|
|
516
|
+
fn: I((y) => [
|
|
517
|
+
W(e.$slots, o, w({ ref_for: !0 }, y))
|
|
518
518
|
])
|
|
519
519
|
}))
|
|
520
520
|
]), 1040, ["option", "disabled", "selected"]))), 128))
|
|
521
521
|
], 16)), [
|
|
522
|
-
[
|
|
522
|
+
[h]
|
|
523
523
|
]);
|
|
524
524
|
}
|
|
525
|
-
const
|
|
526
|
-
...
|
|
525
|
+
const Bt = /* @__PURE__ */ j($t, [["render", Dt]]), Rt = {}, Nt = /* @__PURE__ */ Z({
|
|
526
|
+
...Rt,
|
|
527
527
|
__name: "listbox-decorative-checkbox",
|
|
528
528
|
props: {
|
|
529
529
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -531,48 +531,48 @@ const $t = /* @__PURE__ */ H(kt, [["render", Lt]]), Dt = {}, Bt = /* @__PURE__ *
|
|
|
531
531
|
checked: { type: Boolean, default: !1 }
|
|
532
532
|
},
|
|
533
533
|
setup(e) {
|
|
534
|
-
const t = e,
|
|
534
|
+
const t = e, n = p(() => ({
|
|
535
535
|
[`b-checkbox-input--${fe.DISABLED}`]: t.disabled
|
|
536
|
-
})),
|
|
536
|
+
})), s = p(() => ({
|
|
537
537
|
[`b-checkbox-input__outline--${fe.UNCHECKED}`]: !t.checked && !t.indeterminate,
|
|
538
538
|
[`b-checkbox-input__outline--${fe.CHECKED}`]: t.checked && !t.indeterminate,
|
|
539
539
|
[`b-checkbox-input__outline--${fe.INDETERMINATE}`]: t.indeterminate
|
|
540
540
|
}));
|
|
541
|
-
return (
|
|
542
|
-
class:
|
|
541
|
+
return (a, i) => (d(), O("div", {
|
|
542
|
+
class: me(["b-checkbox-input", n.value]),
|
|
543
543
|
role: "presentation"
|
|
544
544
|
}, [
|
|
545
|
-
|
|
545
|
+
a.indeterminate ? (d(), R(M(rt), {
|
|
546
546
|
key: 0,
|
|
547
547
|
class: "b-checkbox-input__icon",
|
|
548
548
|
"svg-title": "",
|
|
549
549
|
"aria-hidden": "true"
|
|
550
|
-
})) :
|
|
550
|
+
})) : a.checked ? (d(), R(M(ct), {
|
|
551
551
|
key: 1,
|
|
552
552
|
class: "b-checkbox-input__icon",
|
|
553
553
|
"svg-title": "",
|
|
554
554
|
"aria-hidden": "true"
|
|
555
|
-
})) :
|
|
555
|
+
})) : J("", !0),
|
|
556
556
|
z("div", {
|
|
557
|
-
class:
|
|
557
|
+
class: me(["b-checkbox-input__outline", s.value])
|
|
558
558
|
}, null, 2)
|
|
559
559
|
], 2));
|
|
560
560
|
}
|
|
561
|
-
}), Te = /* @__PURE__ */
|
|
562
|
-
var Ye = /* @__PURE__ */ ((e) => (e.DISABLED = "disabled", e.STATIC_CATEGORY = "static-category", e))(Ye || {}),
|
|
563
|
-
const
|
|
561
|
+
}), Te = /* @__PURE__ */ j(Nt, [["__scopeId", "data-v-c604b68a"]]);
|
|
562
|
+
var Ye = /* @__PURE__ */ ((e) => (e.DISABLED = "disabled", e.STATIC_CATEGORY = "static-category", e))(Ye || {}), te = /* @__PURE__ */ ((e) => (e.SELECT_CATEGORY = "select-category", e.UNSELECT_CATEGORY = "unselect-category", e.TOGGLE_CATEGORY_VISIBILITY = "toggle-category-visibility", e))(te || {});
|
|
563
|
+
const Pt = {
|
|
564
564
|
"en-US": {
|
|
565
565
|
categoryClosed: "{category} closed",
|
|
566
566
|
categoryOpened: "{category} opened"
|
|
567
567
|
}
|
|
568
|
-
},
|
|
569
|
-
i18n: { messages:
|
|
568
|
+
}, Mt = Z({
|
|
569
|
+
i18n: { messages: Pt },
|
|
570
570
|
name: "bento-listbox-multi-select-category",
|
|
571
571
|
components: {
|
|
572
572
|
BentoTypography: ce,
|
|
573
573
|
BentoListboxOption: ge,
|
|
574
|
-
ChevronDownIcon:
|
|
575
|
-
ChevronUpIcon:
|
|
574
|
+
ChevronDownIcon: dt,
|
|
575
|
+
ChevronUpIcon: ut,
|
|
576
576
|
ListboxDecorativeCheckbox: Te
|
|
577
577
|
},
|
|
578
578
|
props: {
|
|
@@ -619,81 +619,81 @@ const Rt = {
|
|
|
619
619
|
tabindex: { type: Number, default: -1 }
|
|
620
620
|
},
|
|
621
621
|
emits: [
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
622
|
+
te.SELECT_CATEGORY,
|
|
623
|
+
te.UNSELECT_CATEGORY,
|
|
624
|
+
te.TOGGLE_CATEGORY_VISIBILITY
|
|
625
625
|
],
|
|
626
626
|
setup(e, { emit: t }) {
|
|
627
|
-
const
|
|
628
|
-
() => e.category.items.every((
|
|
629
|
-
),
|
|
630
|
-
[`b-listbox-multi-select-category--${Ye.DISABLED}`]:
|
|
631
|
-
})),
|
|
632
|
-
|
|
633
|
-
},
|
|
634
|
-
var
|
|
635
|
-
const
|
|
636
|
-
return { isDisabled:
|
|
637
|
-
},
|
|
638
|
-
() => e.category.items.filter((
|
|
639
|
-
const { isDisabled:
|
|
640
|
-
return
|
|
627
|
+
const n = B(!1), { t: s } = Oe(), a = (S) => e.isOptionDisabled ? e.isOptionDisabled(S) : !1, i = p(
|
|
628
|
+
() => e.category.items.every((S) => a(S))
|
|
629
|
+
), c = _e(e, "staticCategories"), m = p(() => n.value || e.staticCategories), h = p(() => ({
|
|
630
|
+
[`b-listbox-multi-select-category--${Ye.DISABLED}`]: i.value
|
|
631
|
+
})), l = (S) => {
|
|
632
|
+
S.preventDefault(), n.value = !n.value, t(te.TOGGLE_CATEGORY_VISIBILITY);
|
|
633
|
+
}, r = (S) => {
|
|
634
|
+
var q;
|
|
635
|
+
const Y = a(S), U = ((q = e.selectedItemsList) == null ? void 0 : q.includes(S.value)) || !1;
|
|
636
|
+
return { isDisabled: Y, isPreSelected: U };
|
|
637
|
+
}, o = p(
|
|
638
|
+
() => e.category.items.filter((S) => {
|
|
639
|
+
const { isDisabled: Y, isPreSelected: U } = r(S);
|
|
640
|
+
return Y && U || !Y;
|
|
641
641
|
})
|
|
642
|
-
),
|
|
642
|
+
), y = p(
|
|
643
643
|
() => {
|
|
644
|
-
var
|
|
645
|
-
return (
|
|
646
|
-
({ value:
|
|
647
|
-
var
|
|
648
|
-
return (
|
|
644
|
+
var S;
|
|
645
|
+
return (S = o.value) == null ? void 0 : S.filter(
|
|
646
|
+
({ value: Y }) => {
|
|
647
|
+
var U;
|
|
648
|
+
return (U = e.selectedItemsList) == null ? void 0 : U.includes(Y);
|
|
649
649
|
}
|
|
650
650
|
);
|
|
651
651
|
}
|
|
652
|
-
),
|
|
653
|
-
const
|
|
654
|
-
return
|
|
652
|
+
), g = p(() => {
|
|
653
|
+
const S = n.value ? "categoryOpened" : "categoryClosed";
|
|
654
|
+
return s(S, { category: e.category.label });
|
|
655
655
|
}), T = () => {
|
|
656
|
-
t(
|
|
657
|
-
},
|
|
658
|
-
t(
|
|
659
|
-
}, { isAllSelected: D, isIndeterminate: A, toggleSelectAll:
|
|
660
|
-
|
|
661
|
-
|
|
656
|
+
t(te.SELECT_CATEGORY);
|
|
657
|
+
}, N = () => {
|
|
658
|
+
t(te.UNSELECT_CATEGORY);
|
|
659
|
+
}, { isAllSelected: D, isIndeterminate: A, toggleSelectAll: P } = Ge(
|
|
660
|
+
y,
|
|
661
|
+
o,
|
|
662
662
|
T,
|
|
663
|
-
|
|
664
|
-
),
|
|
665
|
-
|
|
663
|
+
N
|
|
664
|
+
), L = p(() => A.value ? "mixed" : `${D.value}`), $ = B(D.value), C = () => {
|
|
665
|
+
$.value = !$.value, P($.value);
|
|
666
666
|
};
|
|
667
667
|
return ne(D, () => {
|
|
668
|
-
|
|
668
|
+
$.value = D.value;
|
|
669
669
|
}), {
|
|
670
670
|
// Values
|
|
671
|
-
chevronTitle:
|
|
672
|
-
conditionalClass:
|
|
673
|
-
hasAllPropsDisabled:
|
|
674
|
-
isOpen:
|
|
671
|
+
chevronTitle: g,
|
|
672
|
+
conditionalClass: h,
|
|
673
|
+
hasAllPropsDisabled: i,
|
|
674
|
+
isOpen: n,
|
|
675
675
|
isAllSelected: D,
|
|
676
676
|
isIndeterminate: A,
|
|
677
|
-
isStaticCategory:
|
|
677
|
+
isStaticCategory: c,
|
|
678
678
|
// Computed
|
|
679
|
-
showItemChildren:
|
|
680
|
-
ariaCheckedComputed:
|
|
679
|
+
showItemChildren: m,
|
|
680
|
+
ariaCheckedComputed: L,
|
|
681
681
|
// Methods
|
|
682
|
-
handleSelectAll:
|
|
683
|
-
toggleOpen:
|
|
684
|
-
toggleSelectAll:
|
|
682
|
+
handleSelectAll: C,
|
|
683
|
+
toggleOpen: l,
|
|
684
|
+
toggleSelectAll: P
|
|
685
685
|
};
|
|
686
686
|
}
|
|
687
|
-
}),
|
|
687
|
+
}), xt = { class: "b-listbox-multi-select-category__label" }, Gt = {
|
|
688
688
|
key: 1,
|
|
689
689
|
class: "b-listbox-multi-select-category b-listbox-multi-select-category--static-category"
|
|
690
|
-
},
|
|
691
|
-
function
|
|
692
|
-
const
|
|
690
|
+
}, wt = { class: "b-listbox-multi-select-category__label" };
|
|
691
|
+
function Yt(e, t, n, s, a, i) {
|
|
692
|
+
const c = k("listbox-decorative-checkbox"), m = k("bento-typography"), h = k("chevron-up-icon"), l = k("chevron-down-icon"), r = k("bento-listbox-option");
|
|
693
693
|
return d(), O("div", null, [
|
|
694
|
-
e.isStaticCategory ? (d(), O("div",
|
|
695
|
-
z("span",
|
|
696
|
-
|
|
694
|
+
e.isStaticCategory ? (d(), O("div", Gt, [
|
|
695
|
+
z("span", wt, [
|
|
696
|
+
x(m, {
|
|
697
697
|
el: "span",
|
|
698
698
|
variant: "caption",
|
|
699
699
|
class: "b-listbox-multi-select-category__label-text"
|
|
@@ -704,9 +704,9 @@ function Gt(e, t, s, o, n, a) {
|
|
|
704
704
|
_: 1
|
|
705
705
|
})
|
|
706
706
|
])
|
|
707
|
-
])) : (d(), R(
|
|
707
|
+
])) : (d(), R(r, {
|
|
708
708
|
key: 0,
|
|
709
|
-
class:
|
|
709
|
+
class: me(["b-listbox-multi-select-category__option", e.conditionalClass]),
|
|
710
710
|
tabindex: e.tabindex,
|
|
711
711
|
"aria-checked": e.ariaCheckedComputed,
|
|
712
712
|
"aria-disabled": e.hasAllPropsDisabled,
|
|
@@ -715,13 +715,13 @@ function Gt(e, t, s, o, n, a) {
|
|
|
715
715
|
onSpacePressed: ae(e.handleSelectAll, ["prevent"])
|
|
716
716
|
}, {
|
|
717
717
|
default: I(() => [
|
|
718
|
-
|
|
718
|
+
x(c, {
|
|
719
719
|
indeterminate: e.isIndeterminate,
|
|
720
720
|
disabled: e.hasAllPropsDisabled,
|
|
721
721
|
checked: e.isAllSelected
|
|
722
722
|
}, null, 8, ["indeterminate", "disabled", "checked"]),
|
|
723
|
-
z("span",
|
|
724
|
-
|
|
723
|
+
z("span", xt, [
|
|
724
|
+
x(m, {
|
|
725
725
|
el: "span",
|
|
726
726
|
class: "b-listbox-multi-select-category__label-text"
|
|
727
727
|
}, {
|
|
@@ -733,12 +733,12 @@ function Gt(e, t, s, o, n, a) {
|
|
|
733
733
|
z("div", {
|
|
734
734
|
class: "b-listbox-multi-select-category__label-chevron",
|
|
735
735
|
"data-testid": "toggle-listbox",
|
|
736
|
-
onClickCapture: t[0] || (t[0] = ae((...
|
|
736
|
+
onClickCapture: t[0] || (t[0] = ae((...o) => e.toggleOpen && e.toggleOpen(...o), ["stop"]))
|
|
737
737
|
}, [
|
|
738
|
-
e.isOpen ? (d(), R(
|
|
738
|
+
e.isOpen ? (d(), R(h, {
|
|
739
739
|
key: 0,
|
|
740
740
|
"svg-title": e.chevronTitle
|
|
741
|
-
}, null, 8, ["svg-title"])) : (d(), R(
|
|
741
|
+
}, null, 8, ["svg-title"])) : (d(), R(l, {
|
|
742
742
|
key: 1,
|
|
743
743
|
"svg-title": e.chevronTitle
|
|
744
744
|
}, null, 8, ["svg-title"]))
|
|
@@ -754,14 +754,14 @@ function Gt(e, t, s, o, n, a) {
|
|
|
754
754
|
])
|
|
755
755
|
]);
|
|
756
756
|
}
|
|
757
|
-
const
|
|
758
|
-
var
|
|
759
|
-
const
|
|
757
|
+
const Ut = /* @__PURE__ */ j(Mt, [["render", Yt], ["__scopeId", "data-v-40db801f"]]);
|
|
758
|
+
var X = /* @__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))(X || {});
|
|
759
|
+
const zt = Z({
|
|
760
760
|
name: "listbox-multi-select-options",
|
|
761
761
|
components: {
|
|
762
762
|
BentoListboxOption: ge,
|
|
763
763
|
BentoTypography: ce,
|
|
764
|
-
ListboxMultiSelectCategory:
|
|
764
|
+
ListboxMultiSelectCategory: Ut,
|
|
765
765
|
ListboxDecorativeCheckbox: Te
|
|
766
766
|
},
|
|
767
767
|
props: {
|
|
@@ -824,23 +824,23 @@ const Yt = J({
|
|
|
824
824
|
staticCategories: { type: Boolean, default: !1 }
|
|
825
825
|
},
|
|
826
826
|
emits: [
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
827
|
+
X.TOGGLE_CHECKBOX_SELECTION,
|
|
828
|
+
X.SELECT_CATEGORY,
|
|
829
|
+
X.UNSELECT_CATEGORY,
|
|
830
|
+
X.TOGGLE_CATEGORY_VISIBILITY
|
|
831
831
|
],
|
|
832
832
|
setup(e, { emit: t }) {
|
|
833
|
-
const
|
|
834
|
-
e.isOptionDisabled(
|
|
835
|
-
},
|
|
836
|
-
const
|
|
837
|
-
return
|
|
838
|
-
},
|
|
839
|
-
if (
|
|
840
|
-
const
|
|
841
|
-
t(
|
|
833
|
+
const n = (l) => {
|
|
834
|
+
e.isOptionDisabled(l) || t(X.TOGGLE_CHECKBOX_SELECTION, l);
|
|
835
|
+
}, s = (l) => !!l.items, a = (l) => {
|
|
836
|
+
const r = e.isMultiLevel && e.searching;
|
|
837
|
+
return l.description && (!e.isMultiLevel || r);
|
|
838
|
+
}, i = (l) => l.items ? !!l.items.find((r) => e.selectedItemsList.includes(r.value)) : e.selectedItemsList.includes(l.value), c = (l) => {
|
|
839
|
+
if (s(l)) {
|
|
840
|
+
const r = i(l) ? X.UNSELECT_CATEGORY : X.SELECT_CATEGORY;
|
|
841
|
+
t(r, l);
|
|
842
842
|
} else
|
|
843
|
-
|
|
843
|
+
n(l);
|
|
844
844
|
};
|
|
845
845
|
return {
|
|
846
846
|
// Values
|
|
@@ -849,121 +849,121 @@ const Yt = J({
|
|
|
849
849
|
"b-listbox-multi-select-options__category-option": e.categoryItems
|
|
850
850
|
})),
|
|
851
851
|
// Methods
|
|
852
|
-
isOptionSelected:
|
|
853
|
-
shouldShowDescription:
|
|
854
|
-
toggleCheckboxSelection:
|
|
855
|
-
toggleSearchOption:
|
|
856
|
-
computedTabindex: (
|
|
852
|
+
isOptionSelected: i,
|
|
853
|
+
shouldShowDescription: a,
|
|
854
|
+
toggleCheckboxSelection: n,
|
|
855
|
+
toggleSearchOption: c,
|
|
856
|
+
computedTabindex: (l) => l + 1 === e.focusedIndex ? 0 : -1,
|
|
857
857
|
// Enums
|
|
858
858
|
BentoListboxEvent: v,
|
|
859
|
-
ListboxMultiSelectOptionsEvent:
|
|
859
|
+
ListboxMultiSelectOptionsEvent: X
|
|
860
860
|
};
|
|
861
861
|
}
|
|
862
|
-
}),
|
|
863
|
-
function
|
|
864
|
-
const
|
|
862
|
+
}), Ft = { class: "b-listbox-multi-select__option-text" }, Vt = { class: "b-listbox-multi-select__option-text" };
|
|
863
|
+
function Kt(e, t, n, s, a, i) {
|
|
864
|
+
const c = k("listbox-decorative-checkbox"), m = k("bento-typography"), h = k("bento-listbox-option"), l = k("listbox-multi-select-options", !0), r = k("listbox-multi-select-category");
|
|
865
865
|
return d(), O("div", null, [
|
|
866
|
-
(d(!0), O(
|
|
867
|
-
key: `selected-${
|
|
866
|
+
(d(!0), O(le, null, H(e.items, (o, y) => (d(), O("div", {
|
|
867
|
+
key: `selected-${o.value}`
|
|
868
868
|
}, [
|
|
869
|
-
e.searching && e.isMultiLevel ? (d(), R(
|
|
869
|
+
e.searching && e.isMultiLevel ? (d(), R(h, {
|
|
870
870
|
key: 0,
|
|
871
|
-
class:
|
|
872
|
-
disabled: e.isOptionDisabled ? e.isOptionDisabled(
|
|
873
|
-
tabindex: e.computedTabindex(
|
|
874
|
-
"aria-checked": `${e.isOptionSelected(
|
|
875
|
-
"aria-disabled": e.isOptionDisabled ? e.isOptionDisabled(
|
|
876
|
-
onClick: (
|
|
877
|
-
onEnterPressed: (
|
|
878
|
-
onSpacePressed: ae((
|
|
871
|
+
class: me(["b-listbox-multi-select-options", e.conditionalClasses]),
|
|
872
|
+
disabled: e.isOptionDisabled ? e.isOptionDisabled(o) : null,
|
|
873
|
+
tabindex: e.computedTabindex(y),
|
|
874
|
+
"aria-checked": `${e.isOptionSelected(o)}`,
|
|
875
|
+
"aria-disabled": e.isOptionDisabled ? e.isOptionDisabled(o) : null,
|
|
876
|
+
onClick: (g) => e.toggleSearchOption(o),
|
|
877
|
+
onEnterPressed: (g) => e.toggleSearchOption(o),
|
|
878
|
+
onSpacePressed: ae((g) => e.toggleSearchOption(o), ["prevent"])
|
|
879
879
|
}, {
|
|
880
880
|
default: I(() => [
|
|
881
|
-
|
|
882
|
-
disabled: e.isOptionDisabled ? e.isOptionDisabled(
|
|
883
|
-
checked: e.isOptionSelected(
|
|
881
|
+
x(c, {
|
|
882
|
+
disabled: e.isOptionDisabled ? e.isOptionDisabled(o) : null,
|
|
883
|
+
checked: e.isOptionSelected(o)
|
|
884
884
|
}, null, 8, ["disabled", "checked"]),
|
|
885
|
-
W(e.$slots, "default",
|
|
886
|
-
z("span",
|
|
887
|
-
|
|
885
|
+
W(e.$slots, "default", w({ ref_for: !0 }, o), () => [
|
|
886
|
+
z("span", Ft, [
|
|
887
|
+
x(m, { el: "span" }, {
|
|
888
888
|
default: I(() => [
|
|
889
|
-
K(F(
|
|
889
|
+
K(F(o.label), 1)
|
|
890
890
|
]),
|
|
891
891
|
_: 2
|
|
892
892
|
}, 1024),
|
|
893
|
-
e.shouldShowDescription(
|
|
893
|
+
e.shouldShowDescription(o) ? (d(), R(m, {
|
|
894
894
|
key: 0,
|
|
895
895
|
class: "b-listbox-multi-select__option-description",
|
|
896
896
|
el: "span"
|
|
897
897
|
}, {
|
|
898
898
|
default: I(() => [
|
|
899
|
-
K(F(
|
|
899
|
+
K(F(o.description), 1)
|
|
900
900
|
]),
|
|
901
901
|
_: 2
|
|
902
|
-
}, 1024)) :
|
|
902
|
+
}, 1024)) : J("", !0)
|
|
903
903
|
])
|
|
904
904
|
], !0)
|
|
905
905
|
]),
|
|
906
906
|
_: 2
|
|
907
|
-
}, 1032, ["class", "disabled", "tabindex", "aria-checked", "aria-disabled", "onClick", "onEnterPressed", "onSpacePressed"])) : (d(), O(
|
|
908
|
-
|
|
907
|
+
}, 1032, ["class", "disabled", "tabindex", "aria-checked", "aria-disabled", "onClick", "onEnterPressed", "onSpacePressed"])) : (d(), O(le, { key: 1 }, [
|
|
908
|
+
o.items ? (d(), R(r, {
|
|
909
909
|
key: 0,
|
|
910
|
-
category:
|
|
910
|
+
category: o,
|
|
911
911
|
"static-categories": e.staticCategories,
|
|
912
912
|
"is-option-disabled": e.isOptionDisabled,
|
|
913
913
|
"selected-items-list": e.selectedItemsList,
|
|
914
|
-
tabindex: e.computedTabindex(
|
|
915
|
-
onSelectCategory: (
|
|
916
|
-
onUnselectCategory: (
|
|
917
|
-
onToggleCategoryVisibility: t[1] || (t[1] = (
|
|
914
|
+
tabindex: e.computedTabindex(y),
|
|
915
|
+
onSelectCategory: (g) => e.$emit(e.ListboxMultiSelectOptionsEvent.SELECT_CATEGORY, o),
|
|
916
|
+
onUnselectCategory: (g) => e.$emit(e.ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY, o),
|
|
917
|
+
onToggleCategoryVisibility: t[1] || (t[1] = (g) => e.$emit(e.ListboxMultiSelectOptionsEvent.TOGGLE_CATEGORY_VISIBILITY))
|
|
918
918
|
}, {
|
|
919
919
|
default: I(() => [
|
|
920
|
-
|
|
920
|
+
x(l, {
|
|
921
921
|
"category-items": "",
|
|
922
|
-
items:
|
|
922
|
+
items: o.items,
|
|
923
923
|
"is-option-disabled": e.isOptionDisabled,
|
|
924
924
|
"focused-index": e.focusedIndex,
|
|
925
925
|
"is-multi-level": e.isMultiLevel,
|
|
926
926
|
"static-categories": e.staticCategories,
|
|
927
927
|
"selected-items-list": e.selectedItemsList,
|
|
928
928
|
searching: e.searching,
|
|
929
|
-
onToggleCheckboxSelection: t[0] || (t[0] = (
|
|
929
|
+
onToggleCheckboxSelection: t[0] || (t[0] = (g) => e.toggleCheckboxSelection(g))
|
|
930
930
|
}, null, 8, ["items", "is-option-disabled", "focused-index", "is-multi-level", "static-categories", "selected-items-list", "searching"])
|
|
931
931
|
]),
|
|
932
932
|
_: 2
|
|
933
|
-
}, 1032, ["category", "static-categories", "is-option-disabled", "selected-items-list", "tabindex", "onSelectCategory", "onUnselectCategory"])) : (d(), R(
|
|
933
|
+
}, 1032, ["category", "static-categories", "is-option-disabled", "selected-items-list", "tabindex", "onSelectCategory", "onUnselectCategory"])) : (d(), R(h, {
|
|
934
934
|
key: 1,
|
|
935
|
-
class:
|
|
936
|
-
disabled: e.isOptionDisabled ? e.isOptionDisabled(
|
|
937
|
-
tabindex: e.computedTabindex(
|
|
938
|
-
"aria-checked": `${e.isOptionSelected(
|
|
939
|
-
"aria-disabled": e.isOptionDisabled ? e.isOptionDisabled(
|
|
940
|
-
onClick: (
|
|
941
|
-
onEnterPressed: (
|
|
942
|
-
onSpacePressed: ae((
|
|
935
|
+
class: me(["b-listbox-multi-select-options", e.conditionalClasses]),
|
|
936
|
+
disabled: e.isOptionDisabled ? e.isOptionDisabled(o) : null,
|
|
937
|
+
tabindex: e.computedTabindex(y),
|
|
938
|
+
"aria-checked": `${e.isOptionSelected(o)}`,
|
|
939
|
+
"aria-disabled": e.isOptionDisabled ? e.isOptionDisabled(o) : null,
|
|
940
|
+
onClick: (g) => e.toggleCheckboxSelection(o),
|
|
941
|
+
onEnterPressed: (g) => e.toggleCheckboxSelection(o),
|
|
942
|
+
onSpacePressed: ae((g) => e.toggleCheckboxSelection(o), ["prevent"])
|
|
943
943
|
}, {
|
|
944
944
|
default: I(() => [
|
|
945
|
-
|
|
946
|
-
disabled: e.isOptionDisabled ? e.isOptionDisabled(
|
|
947
|
-
checked: e.isOptionSelected(
|
|
945
|
+
x(c, {
|
|
946
|
+
disabled: e.isOptionDisabled ? e.isOptionDisabled(o) : null,
|
|
947
|
+
checked: e.isOptionSelected(o)
|
|
948
948
|
}, null, 8, ["disabled", "checked"]),
|
|
949
|
-
W(e.$slots, "default",
|
|
950
|
-
z("span",
|
|
951
|
-
|
|
949
|
+
W(e.$slots, "default", w({ ref_for: !0 }, o), () => [
|
|
950
|
+
z("span", Vt, [
|
|
951
|
+
x(m, { el: "span" }, {
|
|
952
952
|
default: I(() => [
|
|
953
|
-
K(F(
|
|
953
|
+
K(F(o.label), 1)
|
|
954
954
|
]),
|
|
955
955
|
_: 2
|
|
956
956
|
}, 1024),
|
|
957
|
-
e.shouldShowDescription(
|
|
957
|
+
e.shouldShowDescription(o) ? (d(), R(m, {
|
|
958
958
|
key: 0,
|
|
959
959
|
class: "b-listbox-multi-select__option-description",
|
|
960
960
|
el: "span"
|
|
961
961
|
}, {
|
|
962
962
|
default: I(() => [
|
|
963
|
-
K(F(
|
|
963
|
+
K(F(o.description), 1)
|
|
964
964
|
]),
|
|
965
965
|
_: 2
|
|
966
|
-
}, 1024)) :
|
|
966
|
+
}, 1024)) : J("", !0)
|
|
967
967
|
])
|
|
968
968
|
], !0)
|
|
969
969
|
]),
|
|
@@ -973,17 +973,17 @@ function Ft(e, t, s, o, n, a) {
|
|
|
973
973
|
]))), 128))
|
|
974
974
|
]);
|
|
975
975
|
}
|
|
976
|
-
const
|
|
976
|
+
const Wt = /* @__PURE__ */ j(zt, [["render", Kt], ["__scopeId", "data-v-e26ceb2d"]]), qt = (e) => {
|
|
977
977
|
const t = p(() => {
|
|
978
|
-
var
|
|
979
|
-
return !!((
|
|
980
|
-
}),
|
|
981
|
-
var
|
|
982
|
-
return t.value ? (
|
|
978
|
+
var s;
|
|
979
|
+
return !!((s = e.value) != null && s.find(({ items: a }) => !!a));
|
|
980
|
+
}), n = p(() => {
|
|
981
|
+
var s;
|
|
982
|
+
return t.value ? (s = e.value) == null ? void 0 : s.reduce((a, i) => (i.items ? a.push(...i.items.flat()) : a.push(i), a), []) : e.value;
|
|
983
983
|
});
|
|
984
984
|
return {
|
|
985
985
|
isMultiLevelSelect: t,
|
|
986
|
-
flattenedItemsList:
|
|
986
|
+
flattenedItemsList: n
|
|
987
987
|
};
|
|
988
988
|
}, Ue = {
|
|
989
989
|
"en-US": {
|
|
@@ -992,12 +992,12 @@ const Vt = /* @__PURE__ */ H(Yt, [["render", Ft], ["__scopeId", "data-v-e26ceb2d
|
|
|
992
992
|
numbersSelected: "{number} selected",
|
|
993
993
|
selectAll: "Select all ({total})"
|
|
994
994
|
}
|
|
995
|
-
},
|
|
995
|
+
}, Ht = { key: 0 }, jt = {
|
|
996
996
|
key: 1,
|
|
997
997
|
class: "b-listbox-multi-select__divider",
|
|
998
998
|
"aria-hidden": "true"
|
|
999
|
-
},
|
|
1000
|
-
...
|
|
999
|
+
}, Xt = { i18n: { messages: Ue } }, Jt = /* @__PURE__ */ Z({
|
|
1000
|
+
...Xt,
|
|
1001
1001
|
__name: "listbox-multi-select",
|
|
1002
1002
|
props: {
|
|
1003
1003
|
hasMoreItems: { type: Boolean, default: !1 },
|
|
@@ -1009,116 +1009,125 @@ const Vt = /* @__PURE__ */ H(Yt, [["render", Ft], ["__scopeId", "data-v-e26ceb2d
|
|
|
1009
1009
|
staticCategories: { type: Boolean, default: !1 }
|
|
1010
1010
|
},
|
|
1011
1011
|
emits: ["select"],
|
|
1012
|
-
setup(e, {
|
|
1013
|
-
const s = e,
|
|
1012
|
+
setup(e, { expose: t, emit: n }) {
|
|
1013
|
+
const s = e, a = n, { t: i } = Oe({ messages: Ue }), c = st(), m = lt(), h = p(
|
|
1014
1014
|
() => {
|
|
1015
1015
|
var u, f, b, _;
|
|
1016
1016
|
return {
|
|
1017
|
-
"aria-label": (u =
|
|
1018
|
-
"aria-busy": (f =
|
|
1019
|
-
"aria-atomic": (b =
|
|
1020
|
-
"aria-live": (_ =
|
|
1017
|
+
"aria-label": (u = m["aria-label"]) == null ? void 0 : u.toString(),
|
|
1018
|
+
"aria-busy": (f = m["aria-busy"]) == null ? void 0 : f.toString(),
|
|
1019
|
+
"aria-atomic": (b = m["aria-atomic"]) == null ? void 0 : b.toString(),
|
|
1020
|
+
"aria-live": (_ = m["aria-live"]) == null ? void 0 : _.toString()
|
|
1021
1021
|
};
|
|
1022
1022
|
}
|
|
1023
|
-
),
|
|
1023
|
+
), l = B(null), r = B(null), o = B(null), y = B(null), g = p(() => s.selectedValues.map(({ value: u }) => u)), { isMultiLevelSelect: T, flattenedItemsList: N } = qt(_e(s, "items")), D = (u) => {
|
|
1024
1024
|
var _;
|
|
1025
|
-
const f = s.isOptionDisabled(u), b = ((_ =
|
|
1025
|
+
const f = s.isOptionDisabled(u), b = ((_ = g.value) == null ? void 0 : _.includes(u.value)) || !1;
|
|
1026
1026
|
return { isDisabled: f, isPreSelected: b };
|
|
1027
|
-
},
|
|
1028
|
-
if (s.searching &&
|
|
1027
|
+
}, A = p(() => {
|
|
1028
|
+
if (s.searching && T)
|
|
1029
1029
|
return s.items;
|
|
1030
|
-
const u =
|
|
1031
|
-
const { isDisabled: b, isPreSelected: _ } =
|
|
1030
|
+
const u = N.value.filter((f) => {
|
|
1031
|
+
const { isDisabled: b, isPreSelected: _ } = D(f);
|
|
1032
1032
|
return b && _ || !b;
|
|
1033
1033
|
});
|
|
1034
1034
|
return s.selectedValues.forEach((f) => {
|
|
1035
1035
|
u.find((b) => b.value === f.value) || u.push(f);
|
|
1036
1036
|
}), u;
|
|
1037
|
-
}),
|
|
1037
|
+
}), P = p(
|
|
1038
1038
|
() => {
|
|
1039
1039
|
var u;
|
|
1040
|
-
return (u =
|
|
1040
|
+
return (u = A.value) == null ? void 0 : u.filter((f) => {
|
|
1041
1041
|
var b;
|
|
1042
|
-
return f.items &&
|
|
1042
|
+
return f.items && T.value && s.searching ? f.items.filter(
|
|
1043
1043
|
(E) => (s.selectedValues ?? []).includes(E.value)
|
|
1044
|
-
).length === f.items.length : (b =
|
|
1044
|
+
).length === f.items.length : (b = g.value) == null ? void 0 : b.includes(f.value);
|
|
1045
1045
|
});
|
|
1046
1046
|
}
|
|
1047
|
-
),
|
|
1047
|
+
), L = () => T.value && !s.searching ? N.value.length : s.items.length, $ = p(() => {
|
|
1048
1048
|
var _;
|
|
1049
|
-
const u =
|
|
1050
|
-
return b === 0 ?
|
|
1051
|
-
}),
|
|
1049
|
+
const u = A.value.length, f = L(), b = ((_ = P.value) == null ? void 0 : _.length) || 0;
|
|
1050
|
+
return b === 0 ? i("selectAll", { total: u }) : b === f ? i("allSelected", { total: f }) : b <= f ? i("numberOfTotalSelected", { number: b, total: f }) : i("numbersSelected", { number: b });
|
|
1051
|
+
}), C = (u) => {
|
|
1052
1052
|
const f = (_) => {
|
|
1053
|
-
const { isDisabled: E, isPreSelected:
|
|
1054
|
-
return E &&
|
|
1055
|
-
}, b = u.filter(f).filter((_) => !
|
|
1056
|
-
|
|
1057
|
-
},
|
|
1053
|
+
const { isDisabled: E, isPreSelected: Q } = D(_);
|
|
1054
|
+
return E && Q || !E;
|
|
1055
|
+
}, b = u.filter(f).filter((_) => !g.value.includes(_.value));
|
|
1056
|
+
a("select", [...s.selectedValues, ...b]);
|
|
1057
|
+
}, S = (u) => {
|
|
1058
1058
|
const f = (E) => {
|
|
1059
|
-
const { isDisabled:
|
|
1060
|
-
return !(
|
|
1059
|
+
const { isDisabled: Q, isPreSelected: Qe } = D(E);
|
|
1060
|
+
return !(Q && Qe);
|
|
1061
1061
|
}, b = u.filter(f).map(({ value: E }) => E), _ = s.selectedValues.filter((E) => !(b != null && b.includes(E.value)));
|
|
1062
|
-
|
|
1063
|
-
},
|
|
1064
|
-
|
|
1062
|
+
a("select", _);
|
|
1063
|
+
}, Y = () => {
|
|
1064
|
+
C(N.value);
|
|
1065
1065
|
}, U = () => {
|
|
1066
|
-
|
|
1067
|
-
}, { isAllSelected:
|
|
1066
|
+
S(N.value);
|
|
1067
|
+
}, { isAllSelected: q, isIndeterminate: ve, toggleSelectAll: ye } = Ge(
|
|
1068
|
+
P,
|
|
1068
1069
|
A,
|
|
1069
|
-
|
|
1070
|
-
C,
|
|
1070
|
+
Y,
|
|
1071
1071
|
U
|
|
1072
|
-
), Se = p(() =>
|
|
1073
|
-
|
|
1072
|
+
), Se = p(() => ve.value ? "mixed" : `${q.value}`), G = B(q.value), ee = () => {
|
|
1073
|
+
G.value = !G.value, ye(G.value);
|
|
1074
1074
|
};
|
|
1075
|
-
ne(
|
|
1076
|
-
|
|
1075
|
+
ne(q, () => {
|
|
1076
|
+
G.value = q.value;
|
|
1077
1077
|
});
|
|
1078
|
-
const
|
|
1079
|
-
|
|
1078
|
+
const ze = (u) => {
|
|
1079
|
+
C(u.items);
|
|
1080
1080
|
}, Ie = (u) => {
|
|
1081
|
-
|
|
1082
|
-
},
|
|
1081
|
+
S(u.items);
|
|
1082
|
+
}, de = (u, f) => {
|
|
1083
1083
|
let b = !1;
|
|
1084
1084
|
const _ = s.selectedValues.filter(({ value: E }) => f.value === E ? (b = !0, !1) : !0);
|
|
1085
|
-
b || _.push(f),
|
|
1086
|
-
},
|
|
1087
|
-
if (!
|
|
1085
|
+
b || _.push(f), a(u, _);
|
|
1086
|
+
}, Fe = p(() => {
|
|
1087
|
+
if (!T.value)
|
|
1088
1088
|
return s.selectedValues;
|
|
1089
|
-
const u = (E) =>
|
|
1089
|
+
const u = (E) => g.value.includes(E.value), f = (E) => !s.staticCategories && E.every((Q) => u(Q));
|
|
1090
1090
|
return s.items.flatMap(
|
|
1091
1091
|
(E) => E.items && !f(E.items) ? E.items : E
|
|
1092
1092
|
).filter((E) => E.items ? !0 : u(E));
|
|
1093
|
-
}),
|
|
1094
|
-
var b, _, E,
|
|
1095
|
-
const u = ["automatic", "button"].includes(s.lazyLoadType), f = ((b = s.selectedValues) == null ? void 0 : b.length) > 0 && ((_ =
|
|
1096
|
-
return u && s.hasMoreItems ? !!((
|
|
1093
|
+
}), Ve = p(() => {
|
|
1094
|
+
var b, _, E, Q;
|
|
1095
|
+
const u = ["automatic", "button"].includes(s.lazyLoadType), f = ((b = s.selectedValues) == null ? void 0 : b.length) > 0 && ((_ = P.value) == null ? void 0 : _.length) !== ((E = N.value) == null ? void 0 : E.length);
|
|
1096
|
+
return u && s.hasMoreItems ? !!((Q = s.selectedValues) != null && Q.length) : f;
|
|
1097
1097
|
}), Ae = p(() => ["automatic", "button"].includes(s.lazyLoadType) ? !s.hasMoreItems : !0), he = B([]), ke = async () => {
|
|
1098
|
-
await Me(),
|
|
1099
|
-
|
|
1098
|
+
await Me(), l.value && (he.value = Array.from(
|
|
1099
|
+
l.value.querySelectorAll('[role="option"]')
|
|
1100
1100
|
).filter((u) => u.checkVisibility()));
|
|
1101
|
-
},
|
|
1101
|
+
}, Ke = (u) => {
|
|
1102
1102
|
var f;
|
|
1103
1103
|
(f = he.value[u]) == null || f.focus();
|
|
1104
1104
|
}, {
|
|
1105
|
-
moveToNextElement:
|
|
1106
|
-
moveToPreviousElement:
|
|
1107
|
-
moveToFirstElement:
|
|
1108
|
-
moveToLastElement:
|
|
1105
|
+
moveToNextElement: We,
|
|
1106
|
+
moveToPreviousElement: qe,
|
|
1107
|
+
moveToFirstElement: He,
|
|
1108
|
+
moveToLastElement: je,
|
|
1109
1109
|
preventDefault: Le,
|
|
1110
|
-
focusedIndex: $e
|
|
1110
|
+
focusedIndex: $e,
|
|
1111
|
+
setListboxFocusedIndex: Xe
|
|
1111
1112
|
} = we(
|
|
1112
1113
|
{
|
|
1113
1114
|
items: he
|
|
1114
1115
|
},
|
|
1115
|
-
|
|
1116
|
-
),
|
|
1117
|
-
[V.ARROW_UP]: (u) =>
|
|
1118
|
-
[V.ARROW_DOWN]: (u) =>
|
|
1119
|
-
[V.HOME]:
|
|
1120
|
-
[V.END]:
|
|
1121
|
-
}
|
|
1116
|
+
Ke
|
|
1117
|
+
), Je = {
|
|
1118
|
+
[V.ARROW_UP]: (u) => qe(u),
|
|
1119
|
+
[V.ARROW_DOWN]: (u) => We(u),
|
|
1120
|
+
[V.HOME]: He,
|
|
1121
|
+
[V.END]: je
|
|
1122
|
+
};
|
|
1123
|
+
t({
|
|
1124
|
+
/**
|
|
1125
|
+
* Method to set the index of the item to be focused on
|
|
1126
|
+
* Used for focus management to be kept in-sync with parent e.g. dropdowns
|
|
1127
|
+
*/
|
|
1128
|
+
setListboxFocusedIndex: Xe
|
|
1129
|
+
});
|
|
1130
|
+
const Ze = {
|
|
1122
1131
|
[V.ARROW_UP]: Le,
|
|
1123
1132
|
[V.ARROW_DOWN]: Le
|
|
1124
1133
|
};
|
|
@@ -1130,50 +1139,50 @@ const Vt = /* @__PURE__ */ H(Yt, [["render", Ft], ["__scopeId", "data-v-e26ceb2d
|
|
|
1130
1139
|
{ immediate: !0 }
|
|
1131
1140
|
), (u, f) => (d(), O("div", {
|
|
1132
1141
|
ref_key: "listboxRef",
|
|
1133
|
-
ref:
|
|
1142
|
+
ref: l,
|
|
1134
1143
|
class: "b-listbox-multi-select"
|
|
1135
1144
|
}, [
|
|
1136
|
-
|
|
1137
|
-
re((d(), O("ul",
|
|
1138
|
-
(d(!0), O(
|
|
1145
|
+
Ve.value ? (d(), O("div", Ht, [
|
|
1146
|
+
re((d(), O("ul", w({ class: "b-listbox-multi-select__chips" }, se(Ze, !0)), [
|
|
1147
|
+
(d(!0), O(le, null, H(Fe.value, (b) => (d(), O("li", {
|
|
1139
1148
|
key: b.value
|
|
1140
1149
|
}, [
|
|
1141
|
-
|
|
1150
|
+
x(M(at), {
|
|
1142
1151
|
ref_for: !0,
|
|
1143
1152
|
ref_key: "selectedListboxItemsRef",
|
|
1144
|
-
ref:
|
|
1153
|
+
ref: o,
|
|
1145
1154
|
disabled: u.isOptionDisabled(b),
|
|
1146
1155
|
label: b.label,
|
|
1147
1156
|
condensed: "",
|
|
1148
|
-
onClick: (_) => b.items ? Ie(b) :
|
|
1157
|
+
onClick: (_) => b.items ? Ie(b) : de("select", b)
|
|
1149
1158
|
}, null, 8, ["disabled", "label", "onClick"])
|
|
1150
1159
|
]))), 128))
|
|
1151
1160
|
], 16)), [
|
|
1152
|
-
[
|
|
1161
|
+
[M(pe)]
|
|
1153
1162
|
]),
|
|
1154
1163
|
f[4] || (f[4] = z("hr", {
|
|
1155
1164
|
class: "b-listbox-multi-select__divider",
|
|
1156
1165
|
"aria-hidden": "true"
|
|
1157
1166
|
}, null, -1))
|
|
1158
|
-
])) :
|
|
1159
|
-
re((d(), O("div",
|
|
1160
|
-
Ae.value ? (d(), R(
|
|
1167
|
+
])) : J("", !0),
|
|
1168
|
+
re((d(), O("div", w(h.value, { role: "listbox" }, se(Je, !0)), [
|
|
1169
|
+
Ae.value ? (d(), R(M(ge), {
|
|
1161
1170
|
key: 0,
|
|
1162
1171
|
ref_key: "selectAllListboxItemsRef",
|
|
1163
|
-
ref:
|
|
1172
|
+
ref: r,
|
|
1164
1173
|
class: "b-listbox-multi-select__option",
|
|
1165
|
-
tabindex:
|
|
1174
|
+
tabindex: M($e) === 0 ? 0 : -1,
|
|
1166
1175
|
"aria-checked": Se.value,
|
|
1167
|
-
onClick:
|
|
1168
|
-
onEnterPressed:
|
|
1169
|
-
onSpacePressed: ae(
|
|
1176
|
+
onClick: ee,
|
|
1177
|
+
onEnterPressed: ee,
|
|
1178
|
+
onSpacePressed: ae(ee, ["prevent"])
|
|
1170
1179
|
}, {
|
|
1171
1180
|
default: I(() => [
|
|
1172
|
-
|
|
1173
|
-
checked:
|
|
1174
|
-
indeterminate:
|
|
1181
|
+
x(M(Te), {
|
|
1182
|
+
checked: M(q),
|
|
1183
|
+
indeterminate: M(ve)
|
|
1175
1184
|
}, null, 8, ["checked", "indeterminate"]),
|
|
1176
|
-
|
|
1185
|
+
x(M(ce), { el: "span" }, {
|
|
1177
1186
|
default: I(() => [
|
|
1178
1187
|
K(F($.value), 1)
|
|
1179
1188
|
]),
|
|
@@ -1181,39 +1190,39 @@ const Vt = /* @__PURE__ */ H(Yt, [["render", Ft], ["__scopeId", "data-v-e26ceb2d
|
|
|
1181
1190
|
})
|
|
1182
1191
|
]),
|
|
1183
1192
|
_: 1
|
|
1184
|
-
}, 8, ["tabindex", "aria-checked"])) :
|
|
1185
|
-
Ae.value ? (d(), O("hr",
|
|
1186
|
-
|
|
1193
|
+
}, 8, ["tabindex", "aria-checked"])) : J("", !0),
|
|
1194
|
+
Ae.value ? (d(), O("hr", jt)) : J("", !0),
|
|
1195
|
+
x(M(Wt), {
|
|
1187
1196
|
ref_key: "listboxItemsRef",
|
|
1188
|
-
ref:
|
|
1197
|
+
ref: y,
|
|
1189
1198
|
items: u.items,
|
|
1190
1199
|
"is-option-disabled": u.isOptionDisabled,
|
|
1191
|
-
"is-multi-level":
|
|
1200
|
+
"is-multi-level": M(T),
|
|
1192
1201
|
"static-categories": u.staticCategories,
|
|
1193
1202
|
searching: u.searching,
|
|
1194
|
-
"selected-items-list":
|
|
1195
|
-
"focused-index":
|
|
1196
|
-
onToggleCheckboxSelection: f[0] || (f[0] = (b) =>
|
|
1197
|
-
onSelectCategory:
|
|
1203
|
+
"selected-items-list": g.value,
|
|
1204
|
+
"focused-index": M($e),
|
|
1205
|
+
onToggleCheckboxSelection: f[0] || (f[0] = (b) => de("select", b)),
|
|
1206
|
+
onSelectCategory: ze,
|
|
1198
1207
|
onUnselectCategory: Ie,
|
|
1199
1208
|
onToggleCategoryVisibility: ke,
|
|
1200
|
-
onSpacePressed: f[1] || (f[1] = (b) =>
|
|
1201
|
-
onTabPressed: f[2] || (f[2] = (b) =>
|
|
1202
|
-
onEnterPressed: f[3] || (f[3] = (b) =>
|
|
1203
|
-
},
|
|
1204
|
-
|
|
1209
|
+
onSpacePressed: f[1] || (f[1] = (b) => de(M(v).SPACE, b)),
|
|
1210
|
+
onTabPressed: f[2] || (f[2] = (b) => de(M(v).TAB, b)),
|
|
1211
|
+
onEnterPressed: f[3] || (f[3] = (b) => de(M(v).ENTER, b))
|
|
1212
|
+
}, be({ _: 2 }, [
|
|
1213
|
+
H(M(c), (b, _) => ({
|
|
1205
1214
|
name: _,
|
|
1206
1215
|
fn: I((E) => [
|
|
1207
|
-
W(u.$slots, _, ie(
|
|
1216
|
+
W(u.$slots, _, ie(ue(E)), void 0, !0)
|
|
1208
1217
|
])
|
|
1209
1218
|
}))
|
|
1210
1219
|
]), 1032, ["items", "is-option-disabled", "is-multi-level", "static-categories", "searching", "selected-items-list", "focused-index"])
|
|
1211
1220
|
], 16)), [
|
|
1212
|
-
[
|
|
1221
|
+
[M(pe)]
|
|
1213
1222
|
])
|
|
1214
1223
|
], 512));
|
|
1215
1224
|
}
|
|
1216
|
-
}), Re = /* @__PURE__ */
|
|
1225
|
+
}), Re = /* @__PURE__ */ j(Jt, [["__scopeId", "data-v-2a854443"]]), Ne = {
|
|
1217
1226
|
"en-US": {
|
|
1218
1227
|
loading: "Loading",
|
|
1219
1228
|
showMore: "Show more"
|
|
@@ -1226,15 +1235,15 @@ const Vt = /* @__PURE__ */ H(Yt, [["render", Ft], ["__scopeId", "data-v-e26ceb2d
|
|
|
1226
1235
|
loading: "Carregando",
|
|
1227
1236
|
showMore: "Mostrar mais"
|
|
1228
1237
|
}
|
|
1229
|
-
},
|
|
1238
|
+
}, Zt = 36, Qt = Z({
|
|
1230
1239
|
name: "bento-listbox",
|
|
1231
1240
|
components: {
|
|
1232
|
-
BentoEmptyState:
|
|
1233
|
-
BentoListboxSingleSelect:
|
|
1241
|
+
BentoEmptyState: it,
|
|
1242
|
+
BentoListboxSingleSelect: Bt,
|
|
1234
1243
|
BentoListboxMultiSelect: Re,
|
|
1235
1244
|
BentoTypography: ce,
|
|
1236
|
-
BentoLoadingIndicator:
|
|
1237
|
-
BentoLoadingButton:
|
|
1245
|
+
BentoLoadingIndicator: ot,
|
|
1246
|
+
BentoLoadingButton: bt
|
|
1238
1247
|
},
|
|
1239
1248
|
directives: { BentoKeyboardNavigationDirective: pe },
|
|
1240
1249
|
i18n: { messages: Ne },
|
|
@@ -1345,124 +1354,124 @@ const Vt = /* @__PURE__ */ H(Yt, [["render", Ft], ["__scopeId", "data-v-e26ceb2d
|
|
|
1345
1354
|
v.ESCAPE,
|
|
1346
1355
|
v.TAB
|
|
1347
1356
|
],
|
|
1348
|
-
setup(e, { emit: t, slots:
|
|
1349
|
-
const
|
|
1350
|
-
var
|
|
1351
|
-
return typeof (e == null ? void 0 : e.virtualScroll) == "object" && ((
|
|
1357
|
+
setup(e, { emit: t, slots: n }) {
|
|
1358
|
+
const s = B([]), a = _e(e, "items"), { t: i } = Oe({ messages: Ne }), c = p(() => e.lazyLoadType !== oe.AUTOMATIC), m = p(() => e.lazyLoadType === oe.AUTOMATIC), h = () => {
|
|
1359
|
+
var G;
|
|
1360
|
+
return typeof (e == null ? void 0 : e.virtualScroll) == "object" && ((G = e == null ? void 0 : e.virtualScroll) != null && G.itemHeight) ? e.virtualScroll.itemHeight : Zt;
|
|
1352
1361
|
}, {
|
|
1353
|
-
containerRef:
|
|
1354
|
-
containerProps:
|
|
1355
|
-
onScroll:
|
|
1356
|
-
list:
|
|
1357
|
-
wrapperProps:
|
|
1358
|
-
} =
|
|
1359
|
-
itemHeight:
|
|
1362
|
+
containerRef: l,
|
|
1363
|
+
containerProps: r,
|
|
1364
|
+
onScroll: o,
|
|
1365
|
+
list: y,
|
|
1366
|
+
wrapperProps: g
|
|
1367
|
+
} = vt(a, {
|
|
1368
|
+
itemHeight: h(),
|
|
1360
1369
|
// Disable virtual scrolling if not enabled or if lazy loading is enabled or if multi-select
|
|
1361
1370
|
disabled: (e == null ? void 0 : e.multiple) || (e == null ? void 0 : e.virtualScroll) === !1 || (e == null ? void 0 : e.lazyLoadType) !== "none"
|
|
1362
1371
|
}), T = p(
|
|
1363
|
-
() => e.componentLoading !== void 0 ||
|
|
1364
|
-
),
|
|
1365
|
-
() =>
|
|
1372
|
+
() => e.componentLoading !== void 0 || c.value ? "true" : void 0
|
|
1373
|
+
), N = p(
|
|
1374
|
+
() => c.value && e.loading || e.componentLoading ? "true" : "false"
|
|
1366
1375
|
), D = p(
|
|
1367
|
-
() =>
|
|
1376
|
+
() => c.value || e.componentLoading !== void 0 ? "polite" : void 0
|
|
1368
1377
|
), A = p(
|
|
1369
1378
|
() => ({
|
|
1370
1379
|
"aria-label": e.ariaLabel,
|
|
1371
|
-
"aria-busy":
|
|
1380
|
+
"aria-busy": N.value,
|
|
1372
1381
|
"aria-atomic": T.value,
|
|
1373
1382
|
"aria-live": D.value
|
|
1374
1383
|
})
|
|
1375
|
-
),
|
|
1384
|
+
), P = p(
|
|
1376
1385
|
() => e.componentLoading ? {
|
|
1377
1386
|
...A.value,
|
|
1378
1387
|
role: "alert"
|
|
1379
1388
|
} : {}
|
|
1380
|
-
),
|
|
1381
|
-
t(
|
|
1382
|
-
},
|
|
1389
|
+
), L = (G) => (ee) => {
|
|
1390
|
+
t(G, ee);
|
|
1391
|
+
}, $ = () => {
|
|
1383
1392
|
t(v.SHOW_MORE);
|
|
1384
|
-
},
|
|
1385
|
-
const
|
|
1386
|
-
if (!
|
|
1393
|
+
}, C = nt(() => {
|
|
1394
|
+
const G = l.value;
|
|
1395
|
+
if (!G)
|
|
1387
1396
|
return;
|
|
1388
|
-
const
|
|
1389
|
-
e.hasMoreItems &&
|
|
1390
|
-
}),
|
|
1391
|
-
|
|
1392
|
-
},
|
|
1393
|
-
var
|
|
1394
|
-
return ((
|
|
1395
|
-
}),
|
|
1397
|
+
const ee = Math.round(G.scrollTop) + G.clientHeight >= G.scrollHeight;
|
|
1398
|
+
e.hasMoreItems && ee && !e.loading && $();
|
|
1399
|
+
}), S = () => {
|
|
1400
|
+
m.value ? C() : o();
|
|
1401
|
+
}, Y = p(() => {
|
|
1402
|
+
var G;
|
|
1403
|
+
return ((G = e.items) == null ? void 0 : G.length) === 0;
|
|
1404
|
+
}), U = p(
|
|
1396
1405
|
() => e.lazyLoadType === oe.BUTTON && e.hasMoreItems
|
|
1397
|
-
),
|
|
1406
|
+
), q = p(
|
|
1398
1407
|
() => e.loading ? De.LOADING : De.START
|
|
1399
|
-
),
|
|
1408
|
+
), ve = p(() => e.loading ? i("loading") : i("showMore")), ye = p(() => ({
|
|
1400
1409
|
...e.emptyState,
|
|
1401
1410
|
variant: "condensed"
|
|
1402
|
-
})),
|
|
1403
|
-
[v.SELECT]:
|
|
1404
|
-
[v.SPACE]:
|
|
1405
|
-
[v.TAB]:
|
|
1406
|
-
[v.ENTER]:
|
|
1411
|
+
})), Se = {
|
|
1412
|
+
[v.SELECT]: L(v.SELECT),
|
|
1413
|
+
[v.SPACE]: L(v.SPACE),
|
|
1414
|
+
[v.TAB]: L(v.TAB),
|
|
1415
|
+
[v.ENTER]: L(v.ENTER)
|
|
1407
1416
|
};
|
|
1408
1417
|
return {
|
|
1409
1418
|
// Refs
|
|
1410
|
-
listboxRef:
|
|
1411
|
-
listboxItemRef:
|
|
1419
|
+
listboxRef: l,
|
|
1420
|
+
listboxItemRef: s,
|
|
1412
1421
|
// a11y
|
|
1413
1422
|
ariaAttributes: A,
|
|
1414
|
-
listboxContainerAttributes:
|
|
1423
|
+
listboxContainerAttributes: P,
|
|
1415
1424
|
// Values
|
|
1416
|
-
containerProps:
|
|
1417
|
-
isSearchResultEmpty:
|
|
1418
|
-
limitedEmptyStateProps:
|
|
1419
|
-
loadingButtonState:
|
|
1420
|
-
slots:
|
|
1421
|
-
shouldDisplayShowMoreButton:
|
|
1422
|
-
showMoreButtonText:
|
|
1423
|
-
virtualisedItems:
|
|
1424
|
-
wrapperProps:
|
|
1425
|
+
containerProps: r,
|
|
1426
|
+
isSearchResultEmpty: Y,
|
|
1427
|
+
limitedEmptyStateProps: ye,
|
|
1428
|
+
loadingButtonState: q,
|
|
1429
|
+
slots: n,
|
|
1430
|
+
shouldDisplayShowMoreButton: U,
|
|
1431
|
+
showMoreButtonText: ve,
|
|
1432
|
+
virtualisedItems: y,
|
|
1433
|
+
wrapperProps: g,
|
|
1425
1434
|
// Enums
|
|
1426
1435
|
BentoKeyboardNavigationKeyDownEvent: V,
|
|
1427
1436
|
BentoListboxEvent: v,
|
|
1428
1437
|
// Methods
|
|
1429
|
-
onListboxContainerScroll:
|
|
1430
|
-
onOptionSelected:
|
|
1431
|
-
emitShowMore:
|
|
1432
|
-
listboxListeners:
|
|
1438
|
+
onListboxContainerScroll: S,
|
|
1439
|
+
onOptionSelected: L,
|
|
1440
|
+
emitShowMore: $,
|
|
1441
|
+
listboxListeners: Se
|
|
1433
1442
|
};
|
|
1434
1443
|
}
|
|
1435
|
-
}),
|
|
1444
|
+
}), es = ["id"], ts = {
|
|
1436
1445
|
key: 0,
|
|
1437
1446
|
class: "b-listbox__loading-filtered-items"
|
|
1438
|
-
},
|
|
1447
|
+
}, ss = {
|
|
1439
1448
|
key: 1,
|
|
1440
1449
|
class: "b-listbox__empty-search-message"
|
|
1441
|
-
},
|
|
1450
|
+
}, ls = {
|
|
1442
1451
|
key: 2,
|
|
1443
1452
|
class: "b-listbox__lazy-load"
|
|
1444
|
-
},
|
|
1453
|
+
}, os = {
|
|
1445
1454
|
key: 3,
|
|
1446
1455
|
class: "b-listbox__lazy-load"
|
|
1447
1456
|
};
|
|
1448
|
-
function
|
|
1449
|
-
var
|
|
1450
|
-
const
|
|
1451
|
-
return re((d(), O("div",
|
|
1457
|
+
function is(e, t, n, s, a, i) {
|
|
1458
|
+
var g;
|
|
1459
|
+
const c = k("bento-loading-indicator"), m = k("bento-empty-state"), h = k("bento-typography"), l = k("bento-listbox-multi-select"), r = k("bento-listbox-single-select"), o = k("bento-loading-button"), y = xe("bento-keyboard-navigation-directive");
|
|
1460
|
+
return re((d(), O("div", w({
|
|
1452
1461
|
id: e.id,
|
|
1453
1462
|
ref: "listboxRef",
|
|
1454
1463
|
class: "b-listbox",
|
|
1455
1464
|
tabindex: "-1"
|
|
1456
1465
|
}, e.listboxContainerAttributes, {
|
|
1457
|
-
style: (
|
|
1466
|
+
style: (g = e.containerProps) == null ? void 0 : g.style,
|
|
1458
1467
|
"data-testid": "listbox-container",
|
|
1459
1468
|
onScroll: t[0] || (t[0] = (...T) => e.onListboxContainerScroll && e.onListboxContainerScroll(...T))
|
|
1460
1469
|
}), [
|
|
1461
|
-
z("div", ie(
|
|
1462
|
-
e.componentLoading ? (d(), O("div",
|
|
1463
|
-
|
|
1464
|
-
])) : e.isSearchResultEmpty ? (d(), O("div",
|
|
1465
|
-
e.emptyState ? (d(), R(
|
|
1470
|
+
z("div", ie(ue(e.wrapperProps)), [
|
|
1471
|
+
e.componentLoading ? (d(), O("div", ts, [
|
|
1472
|
+
x(c)
|
|
1473
|
+
])) : e.isSearchResultEmpty ? (d(), O("div", ss, [
|
|
1474
|
+
e.emptyState ? (d(), R(m, ie(w({ key: 0 }, e.limitedEmptyStateProps)), null, 16)) : (d(), R(h, {
|
|
1466
1475
|
key: 1,
|
|
1467
1476
|
el: "span"
|
|
1468
1477
|
}, {
|
|
@@ -1471,8 +1480,8 @@ function ls(e, t, s, o, n, a) {
|
|
|
1471
1480
|
]),
|
|
1472
1481
|
_: 1
|
|
1473
1482
|
}))
|
|
1474
|
-
])) : (d(), O(
|
|
1475
|
-
e.multiple ? (d(), R(
|
|
1483
|
+
])) : (d(), O(le, { key: 2 }, [
|
|
1484
|
+
e.multiple ? (d(), R(l, w({
|
|
1476
1485
|
key: 0,
|
|
1477
1486
|
ref: "listboxItemRef",
|
|
1478
1487
|
"has-more-items": e.hasMoreItems
|
|
@@ -1483,14 +1492,14 @@ function ls(e, t, s, o, n, a) {
|
|
|
1483
1492
|
"selected-values": e.selectedValue,
|
|
1484
1493
|
searching: e.searching,
|
|
1485
1494
|
"is-option-disabled": e.isOptionDisabled
|
|
1486
|
-
},
|
|
1487
|
-
|
|
1488
|
-
name:
|
|
1495
|
+
}, se(e.listboxListeners)), be({ _: 2 }, [
|
|
1496
|
+
H(e.slots, (T, N) => ({
|
|
1497
|
+
name: N,
|
|
1489
1498
|
fn: I((D) => [
|
|
1490
|
-
W(e.$slots,
|
|
1499
|
+
W(e.$slots, N, ie(ue(D)), void 0, !0)
|
|
1491
1500
|
])
|
|
1492
1501
|
}))
|
|
1493
|
-
]), 1040, ["has-more-items", "items", "lazy-load-type", "static-categories", "selected-values", "searching", "is-option-disabled"])) : (d(), R(
|
|
1502
|
+
]), 1040, ["has-more-items", "items", "lazy-load-type", "static-categories", "selected-values", "searching", "is-option-disabled"])) : (d(), R(r, w({
|
|
1494
1503
|
key: 1,
|
|
1495
1504
|
ref: "listboxItemRef",
|
|
1496
1505
|
items: e.virtualisedItems
|
|
@@ -1498,16 +1507,16 @@ function ls(e, t, s, o, n, a) {
|
|
|
1498
1507
|
"selected-value": e.selectedValue,
|
|
1499
1508
|
"static-categories": e.staticCategories,
|
|
1500
1509
|
"is-option-disabled": e.isOptionDisabled
|
|
1501
|
-
},
|
|
1502
|
-
|
|
1503
|
-
name:
|
|
1510
|
+
}, se(e.listboxListeners)), be({ _: 2 }, [
|
|
1511
|
+
H(e.slots, (T, N) => ({
|
|
1512
|
+
name: N,
|
|
1504
1513
|
fn: I((D) => [
|
|
1505
|
-
W(e.$slots,
|
|
1514
|
+
W(e.$slots, N, ie(ue(D)), void 0, !0)
|
|
1506
1515
|
])
|
|
1507
1516
|
}))
|
|
1508
1517
|
]), 1040, ["items", "selected-value", "static-categories", "is-option-disabled"])),
|
|
1509
|
-
e.shouldDisplayShowMoreButton ? (d(), O("div",
|
|
1510
|
-
|
|
1518
|
+
e.shouldDisplayShowMoreButton ? (d(), O("div", ls, [
|
|
1519
|
+
x(o, {
|
|
1511
1520
|
state: e.loadingButtonState,
|
|
1512
1521
|
variant: "secondary",
|
|
1513
1522
|
onClickCapture: e.emitShowMore
|
|
@@ -1517,75 +1526,75 @@ function ls(e, t, s, o, n, a) {
|
|
|
1517
1526
|
]),
|
|
1518
1527
|
_: 1
|
|
1519
1528
|
}, 8, ["state", "onClickCapture"])
|
|
1520
|
-
])) : e.loading ? (d(), O("div",
|
|
1521
|
-
|
|
1522
|
-
])) :
|
|
1529
|
+
])) : e.loading ? (d(), O("div", os, [
|
|
1530
|
+
x(c)
|
|
1531
|
+
])) : J("", !0)
|
|
1523
1532
|
], 64))
|
|
1524
1533
|
], 16)
|
|
1525
|
-
], 16,
|
|
1526
|
-
[
|
|
1534
|
+
], 16, es)), [
|
|
1535
|
+
[y]
|
|
1527
1536
|
]);
|
|
1528
1537
|
}
|
|
1529
|
-
const
|
|
1530
|
-
for (const
|
|
1531
|
-
if (
|
|
1532
|
-
return
|
|
1533
|
-
if (
|
|
1534
|
-
const
|
|
1535
|
-
if (
|
|
1536
|
-
return
|
|
1538
|
+
const Os = /* @__PURE__ */ j(Qt, [["render", is], ["__scopeId", "data-v-c9aaa0e3"]]), Ee = (e, t) => {
|
|
1539
|
+
for (const n of e) {
|
|
1540
|
+
if (n.value === t)
|
|
1541
|
+
return n;
|
|
1542
|
+
if (n.items) {
|
|
1543
|
+
const s = Ee(n.items, t);
|
|
1544
|
+
if (s)
|
|
1545
|
+
return s;
|
|
1537
1546
|
}
|
|
1538
1547
|
}
|
|
1539
1548
|
return null;
|
|
1540
|
-
},
|
|
1541
|
-
const
|
|
1542
|
-
|
|
1543
|
-
},
|
|
1544
|
-
|
|
1545
|
-
},
|
|
1546
|
-
|
|
1547
|
-
},
|
|
1548
|
-
|
|
1549
|
+
}, ns = (e) => typeof e == "object" && e !== null && "value" in e && "label" in e, Ts = (e, t, n, s) => {
|
|
1550
|
+
const a = B([]), i = B(), c = (r) => {
|
|
1551
|
+
n.value ? i.value = r.map(({ value: o }) => o) : i.value = r.length > 0 ? r[0].value : null;
|
|
1552
|
+
}, m = (r) => {
|
|
1553
|
+
n.value ? i.value = r.map(({ value: o, label: y }) => ({ value: o, label: y })) : i.value = r.length > 0 ? { value: r[0].value, label: r[0].label } : null;
|
|
1554
|
+
}, h = (r) => {
|
|
1555
|
+
a.value = r, s != null && s.value ? m(r) : c(r);
|
|
1556
|
+
}, l = () => {
|
|
1557
|
+
a.value = [], i.value = null;
|
|
1549
1558
|
};
|
|
1550
1559
|
return ne(
|
|
1551
1560
|
() => t.value,
|
|
1552
1561
|
() => {
|
|
1553
1562
|
if (!t.value && t.value !== 0) {
|
|
1554
|
-
|
|
1563
|
+
l();
|
|
1555
1564
|
return;
|
|
1556
1565
|
}
|
|
1557
|
-
const
|
|
1558
|
-
|
|
1559
|
-
const
|
|
1560
|
-
if (
|
|
1561
|
-
|
|
1566
|
+
const r = !Array.isArray(t.value), o = [...a.value];
|
|
1567
|
+
l();
|
|
1568
|
+
const y = (g) => {
|
|
1569
|
+
if (ns(g))
|
|
1570
|
+
a.value.push(g);
|
|
1562
1571
|
else {
|
|
1563
|
-
let T = Ee(e.value,
|
|
1564
|
-
T || (T = Ee(
|
|
1572
|
+
let T = Ee(e.value, g);
|
|
1573
|
+
T || (T = Ee(o, g)), T || (T = { value: g, label: g.toString() }), a.value.push(T);
|
|
1565
1574
|
}
|
|
1566
1575
|
};
|
|
1567
|
-
if (
|
|
1568
|
-
const
|
|
1569
|
-
|
|
1576
|
+
if (r) {
|
|
1577
|
+
const g = t.value;
|
|
1578
|
+
y(g), s != null && s.value ? m(a.value) : c(a.value);
|
|
1570
1579
|
return;
|
|
1571
1580
|
}
|
|
1572
|
-
t.value.forEach(
|
|
1581
|
+
t.value.forEach(y), s != null && s.value ? m(a.value) : c(a.value);
|
|
1573
1582
|
},
|
|
1574
1583
|
{ immediate: !0 }
|
|
1575
1584
|
), {
|
|
1576
1585
|
// Values
|
|
1577
|
-
cachedSelectedListboxOptions:
|
|
1578
|
-
cachedListboxSelectedValues:
|
|
1586
|
+
cachedSelectedListboxOptions: a,
|
|
1587
|
+
cachedListboxSelectedValues: i,
|
|
1579
1588
|
// Methods
|
|
1580
|
-
resetCache:
|
|
1581
|
-
setCachedValues:
|
|
1589
|
+
resetCache: l,
|
|
1590
|
+
setCachedValues: h
|
|
1582
1591
|
};
|
|
1583
1592
|
};
|
|
1584
1593
|
export {
|
|
1585
1594
|
oe as B,
|
|
1586
1595
|
v as a,
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1596
|
+
Os as b,
|
|
1597
|
+
Ts as c,
|
|
1598
|
+
qt as u
|
|
1590
1599
|
};
|
|
1591
|
-
//# sourceMappingURL=use-cached-selected-values.
|
|
1600
|
+
//# sourceMappingURL=use-cached-selected-values.CEwKqYIe.js.map
|