@adyen/bento-vue3 1.98.0 → 1.99.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/button-actions.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/data-grid.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/filter-bar.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/navigation-menu-group.css +1 -1
- package/dist/assets/secondary-nav.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/summary-grid.css +1 -1
- package/dist/chunks/{calendar.D0RdoofE.js → calendar.B0XfOj2I.js} +2 -2
- package/dist/chunks/{calendar.D0RdoofE.js.map → calendar.B0XfOj2I.js.map} +1 -1
- package/dist/chunks/{code-snippet.CEsdQBL7.js → code-snippet.DiBQjBoy.js} +2 -2
- package/dist/chunks/{code-snippet.CEsdQBL7.js.map → code-snippet.DiBQjBoy.js.map} +1 -1
- package/dist/chunks/{data-grid.DXF4Cg7m.js → data-grid.BNFwP2g7.js} +6 -6
- package/dist/chunks/{data-grid.DXF4Cg7m.js.map → data-grid.BNFwP2g7.js.map} +1 -1
- package/dist/chunks/{date-picker.DhtLcpyr.js → date-picker.ClFHuglH.js} +8 -8
- package/dist/chunks/{date-picker.DhtLcpyr.js.map → date-picker.ClFHuglH.js.map} +1 -1
- package/dist/chunks/{date-range-picker.CChROXhw.js → date-range-picker.D3iAZN20.js} +35 -35
- package/dist/chunks/{date-range-picker.CChROXhw.js.map → date-range-picker.D3iAZN20.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.DCwovT-N.js → dropdown-tag.KO0gs2Lb.js} +2 -2
- package/dist/chunks/{dropdown-tag.DCwovT-N.js.map → dropdown-tag.KO0gs2Lb.js.map} +1 -1
- package/dist/chunks/{dropdown.CGUBk0iO.js → dropdown.DpqCHfi-.js} +751 -745
- package/dist/chunks/dropdown.DpqCHfi-.js.map +1 -0
- package/dist/chunks/{filter-bar.DjUo6CwN.js → filter-bar.D3Lf7VJF.js} +623 -616
- package/dist/chunks/filter-bar.D3Lf7VJF.js.map +1 -0
- package/dist/chunks/{header-with-views.-QuYbGZW.js → header-with-views.B-5VCTDp.js} +3 -3
- package/dist/chunks/{header-with-views.-QuYbGZW.js.map → header-with-views.B-5VCTDp.js.map} +1 -1
- package/dist/chunks/{input-field-password.wB3hoH6J.js → input-field-password.BCme16nn.js} +2 -2
- package/dist/chunks/{input-field-password.wB3hoH6J.js.map → input-field-password.BCme16nn.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.BmVS8zco.js → input-field-phone-number.BwVbTNcu.js} +2 -2
- package/dist/chunks/{input-field-phone-number.BmVS8zco.js.map → input-field-phone-number.BwVbTNcu.js.map} +1 -1
- package/dist/chunks/{input-field.lSSH5S7P.js → input-field.Cox9LW4Z.js} +2 -2
- package/dist/chunks/{input-field.lSSH5S7P.js.map → input-field.Cox9LW4Z.js.map} +1 -1
- package/dist/chunks/{input-time.nwnBuzgX.js → input-time.bHFZRv6T.js} +3 -3
- package/dist/chunks/{input-time.nwnBuzgX.js.map → input-time.bHFZRv6T.js.map} +1 -1
- package/dist/chunks/{list-item.DqZuLQXc.js → list-item.CqUFIXPC.js} +77 -68
- package/dist/chunks/{list-item.DqZuLQXc.js.map → list-item.CqUFIXPC.js.map} +1 -1
- package/dist/chunks/{pagination.DX2mxVYn.js → pagination.CMt-m_-T.js} +2 -2
- package/dist/chunks/{pagination.DX2mxVYn.js.map → pagination.CMt-m_-T.js.map} +1 -1
- package/dist/chunks/{search-bar.f03s-Ljw.js → search-bar.DSi5ti-s.js} +3 -3
- package/dist/chunks/{search-bar.f03s-Ljw.js.map → search-bar.DSi5ti-s.js.map} +1 -1
- package/dist/chunks/{secondary-nav.BQOLLVwy.js → secondary-nav.D5w22NJe.js} +2 -2
- package/dist/chunks/{secondary-nav.BQOLLVwy.js.map → secondary-nav.D5w22NJe.js.map} +1 -1
- package/dist/chunks/{use-date-input-formatter.S-t29v8i.js → use-date-input-formatter.ovThcj9h.js} +2 -2
- package/dist/chunks/{use-date-input-formatter.S-t29v8i.js.map → use-date-input-formatter.ovThcj9h.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/date-range-picker.js +2 -2
- package/dist/date-time-picker.js +75 -75
- package/dist/dropdown.js +2 -2
- package/dist/filter-bar.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/index.js +17 -17
- 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/input-time.js +1 -1
- package/dist/internal.js +2 -2
- package/dist/list.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 +2 -2
- package/dist/chunks/dropdown.CGUBk0iO.js.map +0 -1
- package/dist/chunks/filter-bar.DjUo6CwN.js.map +0 -1
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { computed as d, ref as
|
|
2
|
-
import { B as
|
|
3
|
-
import { g as
|
|
4
|
-
import { u as
|
|
5
|
-
import {
|
|
6
|
-
import { u as Kt } from "./form-field.D_2g7vaP.js";
|
|
7
|
-
import { u as Ut } from "./use-form-layout-loading.CWbjZiwP.js";
|
|
1
|
+
import { computed as d, ref as k, onMounted as Vt, onUnmounted as zt, watch as Oe, defineComponent as Z, resolveComponent as K, openBlock as p, createElementBlock as E, createVNode as V, withCtx as _, createTextVNode as le, toDisplayString as Y, createElementVNode as W, renderSlot as j, mergeProps as M, withKeys as me, createCommentVNode as J, createBlock as N, withModifiers as Ee, normalizeProps as ce, guardReactiveProps as Ce, withDirectives as ue, vShow as Ne, nextTick as se, toRef as oe, resolveDirective as Ot, toHandlers as ie, Fragment as pe, renderList as te, createSlots as ve, normalizeClass as fe, unref as f, useSlots as Ge, useAttrs as dt, toRefs as Lt, resolveDynamicComponent as It, inject as ct } from "vue";
|
|
2
|
+
import { B as Te, d as nt } from "./typography.B3J6_tYk.js";
|
|
3
|
+
import { g as Ie } from "./generate-uid.DBWe4g6T.js";
|
|
4
|
+
import { u as De } from "./index.B875RXHM.js";
|
|
5
|
+
import { s as _e } from "./events.BQOQSSb7.js";
|
|
8
6
|
import { u as Tt } from "./use-has-slot.CyMiImRQ.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { B as Wt } from "./empty-state.DT4sFyjB.js";
|
|
13
|
-
import { o as jt } from "./resize.Bqks3WUm.js";
|
|
14
|
-
import { C as We, N as Ht } from "./minus-small.CnYLTuSv.js";
|
|
15
|
-
import { C as Jt } from "./checkmark-small.CRuZauJc.js";
|
|
16
|
-
/* empty css */
|
|
17
|
-
import { _ as ee } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
18
|
-
import { B as Xt } from "./chip.DFldnqfz.js";
|
|
7
|
+
import { C as Gt } from "./cross-circle-fill.BWCKKn0E.js";
|
|
8
|
+
import { C as Kt } from "./cross-circle-fill-small.H1wH-vcZ.js";
|
|
9
|
+
import { _ as Q } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
19
10
|
import { C as At } from "./chevron-down.XeE-LBV_.js";
|
|
20
11
|
import { C as $t } from "./chevron-up.Cmgl2a3x.js";
|
|
21
|
-
|
|
22
|
-
import {
|
|
12
|
+
/* empty css */
|
|
13
|
+
import { u as Ut } from "./aria-label.CaUURpnB.js";
|
|
14
|
+
import { u as qt } from "./form-field.D_2g7vaP.js";
|
|
15
|
+
import { u as Yt } from "./use-form-layout-loading.CWbjZiwP.js";
|
|
16
|
+
import { B as Wt } from "./directive.D1-d-C2K.js";
|
|
17
|
+
import { B as H, a as ze } from "./keyboard-navigation.DWmhelVv.js";
|
|
18
|
+
import { B as jt } from "./loading-indicator.BPol9I84.js";
|
|
19
|
+
import { B as Ht } from "./empty-state.DT4sFyjB.js";
|
|
20
|
+
import { o as Jt } from "./resize.Bqks3WUm.js";
|
|
21
|
+
import { C as We, N as Xt } from "./minus-small.CnYLTuSv.js";
|
|
22
|
+
import { C as Zt } from "./checkmark-small.CRuZauJc.js";
|
|
23
|
+
import { B as Qt } from "./chip.DFldnqfz.js";
|
|
24
|
+
import { a as el, b as ft, h as tl, e as ll } from "./button-actions.CgZbPzhi.js";
|
|
25
|
+
import { F as ol } from "./field-label.yQ_2Qg88.js";
|
|
23
26
|
import { P as mt } from "./popper-container.DRt5hgY8.js";
|
|
24
|
-
import { E as
|
|
25
|
-
import { C as ol } from "./cross-circle-fill.BWCKKn0E.js";
|
|
26
|
-
import { C as al } from "./cross-circle-fill-small.H1wH-vcZ.js";
|
|
27
|
-
import { s as Re } from "./events.BQOQSSb7.js";
|
|
27
|
+
import { E as al } from "./error-message.Dyvrw6ZB.js";
|
|
28
28
|
import "../assets/dropdown.css";
|
|
29
29
|
const wt = (e, l, n, o) => {
|
|
30
30
|
const a = d(
|
|
@@ -39,68 +39,68 @@ const wt = (e, l, n, o) => {
|
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
function sl(e, { disabled: l, itemHeight: n, overscan: o = 5, prefixHeight: a }) {
|
|
42
|
-
const s =
|
|
42
|
+
const s = k(null), t = k([]), i = k(0), h = k(0), c = k(0);
|
|
43
43
|
let u;
|
|
44
44
|
const r = d(() => {
|
|
45
|
-
const C = typeof n == "number" ? e.value.length * n : e.value.reduce((
|
|
45
|
+
const C = typeof n == "number" ? e.value.length * n : e.value.reduce((R, x, $) => R + n($), 0), O = typeof n == "number" ? i.value * n : e.value.slice(0, i.value).reduce((R, x, $) => R + n($), 0);
|
|
46
46
|
return {
|
|
47
47
|
style: {
|
|
48
|
-
marginTop: `${
|
|
49
|
-
height: `${C -
|
|
48
|
+
marginTop: `${O}px`,
|
|
49
|
+
height: `${C - O}px`
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
}),
|
|
53
|
-
const C = a?.value ?? 0,
|
|
52
|
+
}), m = () => {
|
|
53
|
+
const C = a?.value ?? 0, O = Math.max(s.value.scrollTop - C, 0);
|
|
54
54
|
if (typeof n == "number")
|
|
55
|
-
return Math.floor(
|
|
56
|
-
let
|
|
57
|
-
for (let
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
60
|
-
|
|
55
|
+
return Math.floor(O / n);
|
|
56
|
+
let R = 0, x = 0;
|
|
57
|
+
for (let $ = 0; $ < e.value.length; $ += 1) {
|
|
58
|
+
const F = n($);
|
|
59
|
+
if (R += F, R >= O) {
|
|
60
|
+
x = $;
|
|
61
61
|
break;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
return
|
|
65
|
-
},
|
|
64
|
+
return x;
|
|
65
|
+
}, b = () => {
|
|
66
66
|
if (c.value = s.value.clientHeight, typeof n == "number")
|
|
67
67
|
return Math.ceil(c.value / n);
|
|
68
68
|
const C = i.value ?? 0;
|
|
69
|
-
let
|
|
70
|
-
for (let
|
|
71
|
-
const
|
|
72
|
-
if (
|
|
69
|
+
let O = 0, R = 0;
|
|
70
|
+
for (let x = C; x < e.value.length; x += 1) {
|
|
71
|
+
const $ = n(x);
|
|
72
|
+
if (O += $, R = x, O > c.value)
|
|
73
73
|
break;
|
|
74
74
|
}
|
|
75
|
-
return
|
|
76
|
-
},
|
|
75
|
+
return R - C;
|
|
76
|
+
}, T = () => {
|
|
77
77
|
if (s.value) {
|
|
78
|
-
const C =
|
|
79
|
-
i.value =
|
|
78
|
+
const C = b();
|
|
79
|
+
i.value = m(), h.value = Math.min(i.value + C + o, e.value.length), t.value = e.value.slice(i.value, h.value);
|
|
80
80
|
}
|
|
81
|
-
},
|
|
82
|
-
|
|
81
|
+
}, D = () => {
|
|
82
|
+
T();
|
|
83
83
|
};
|
|
84
84
|
l || (Vt(() => {
|
|
85
|
-
s.value && (c.value = s.value.clientHeight, u =
|
|
86
|
-
c.value = C,
|
|
87
|
-
}),
|
|
85
|
+
s.value && (c.value = s.value.clientHeight, u = Jt(s.value, ({ clientHeight: C }) => {
|
|
86
|
+
c.value = C, T();
|
|
87
|
+
}), T());
|
|
88
88
|
}), zt(() => {
|
|
89
89
|
u?.disconnect();
|
|
90
|
-
}),
|
|
90
|
+
}), Oe(
|
|
91
91
|
() => e.value,
|
|
92
92
|
() => {
|
|
93
|
-
|
|
93
|
+
T();
|
|
94
94
|
}
|
|
95
95
|
));
|
|
96
96
|
const g = {
|
|
97
97
|
ref: s,
|
|
98
98
|
style: { overflowY: "auto" }
|
|
99
|
-
},
|
|
99
|
+
}, z = (C) => {
|
|
100
100
|
if (!s.value)
|
|
101
101
|
return;
|
|
102
|
-
const
|
|
103
|
-
|
|
102
|
+
const O = typeof n == "number" ? C * n : e.value.slice(0, C).reduce((w, G, P) => w + n(P), 0), R = typeof n == "number" ? n : n(C), x = O + R, { scrollTop: $, clientHeight: F } = s.value, B = $ + F;
|
|
103
|
+
x > B ? s.value.scrollTop = F > 0 ? x - F : O : O < $ && (s.value.scrollTop = O), T();
|
|
104
104
|
};
|
|
105
105
|
return l ? {
|
|
106
106
|
containerRef: s,
|
|
@@ -112,22 +112,22 @@ function sl(e, { disabled: l, itemHeight: n, overscan: o = 5, prefixHeight: a })
|
|
|
112
112
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
113
113
|
scrollToIndex: () => {
|
|
114
114
|
},
|
|
115
|
-
startIndex:
|
|
115
|
+
startIndex: k(0)
|
|
116
116
|
} : {
|
|
117
117
|
containerRef: s,
|
|
118
118
|
containerProps: g,
|
|
119
|
-
onScroll:
|
|
119
|
+
onScroll: D,
|
|
120
120
|
list: t,
|
|
121
121
|
wrapperProps: r,
|
|
122
|
-
scrollToIndex:
|
|
122
|
+
scrollToIndex: z,
|
|
123
123
|
startIndex: i
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
-
var y = /* @__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))(y || {}),
|
|
126
|
+
var y = /* @__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))(y || {}), Le = /* @__PURE__ */ ((e) => (e.AUTOMATIC = "automatic", e.BUTTON = "button", e.NONE = "none", e))(Le || {});
|
|
127
127
|
const nl = Z({
|
|
128
128
|
name: "bento-listbox-static-category",
|
|
129
129
|
components: {
|
|
130
|
-
BentoTypography:
|
|
130
|
+
BentoTypography: Te
|
|
131
131
|
},
|
|
132
132
|
props: {
|
|
133
133
|
/**
|
|
@@ -146,14 +146,14 @@ function rl(e, l, n, o, a, s) {
|
|
|
146
146
|
role: "group",
|
|
147
147
|
"aria-label": e.categoryLabel
|
|
148
148
|
}, [
|
|
149
|
-
|
|
149
|
+
V(t, {
|
|
150
150
|
variant: "caption",
|
|
151
151
|
el: "span",
|
|
152
152
|
class: "b-listbox-single-select-category__label-text",
|
|
153
153
|
"aria-hidden": "true"
|
|
154
154
|
}, {
|
|
155
|
-
default:
|
|
156
|
-
|
|
155
|
+
default: _(() => [
|
|
156
|
+
le(Y(e.categoryLabel), 1)
|
|
157
157
|
]),
|
|
158
158
|
_: 1
|
|
159
159
|
}),
|
|
@@ -162,7 +162,7 @@ function rl(e, l, n, o, a, s) {
|
|
|
162
162
|
])
|
|
163
163
|
], 8, il);
|
|
164
164
|
}
|
|
165
|
-
const dl = /* @__PURE__ */
|
|
165
|
+
const dl = /* @__PURE__ */ Q(nl, [["render", rl], ["__scopeId", "data-v-27c4e09a"]]), cl = Z({
|
|
166
166
|
name: "bento-listbox-option",
|
|
167
167
|
props: {
|
|
168
168
|
/**
|
|
@@ -211,7 +211,7 @@ function ul(e, l, n, o, a, s) {
|
|
|
211
211
|
j(e.$slots, "default", {}, void 0, !0)
|
|
212
212
|
], 16);
|
|
213
213
|
}
|
|
214
|
-
const je = /* @__PURE__ */
|
|
214
|
+
const je = /* @__PURE__ */ Q(cl, [["render", ul], ["__scopeId", "data-v-1495b1db"]]);
|
|
215
215
|
let vt = 0;
|
|
216
216
|
const pl = {
|
|
217
217
|
beforeCreate() {
|
|
@@ -233,11 +233,11 @@ function fl(e, l, n, o, a, s) {
|
|
|
233
233
|
}, null, -1))
|
|
234
234
|
], 16);
|
|
235
235
|
}
|
|
236
|
-
const ml = /* @__PURE__ */
|
|
236
|
+
const ml = /* @__PURE__ */ Q(pl, [["render", fl]]), vl = Z({
|
|
237
237
|
name: "bento-listbox-single-select-option",
|
|
238
238
|
components: {
|
|
239
239
|
BentoListboxOption: je,
|
|
240
|
-
BentoTypography:
|
|
240
|
+
BentoTypography: Te,
|
|
241
241
|
CheckmarkIcon: ml
|
|
242
242
|
},
|
|
243
243
|
props: {
|
|
@@ -286,15 +286,15 @@ function hl(e, l, n, o, a, s) {
|
|
|
286
286
|
tabindex: e.tabIndex,
|
|
287
287
|
onClick: l[0] || (l[0] = (c) => e.onOptionSelected(e.BentoListboxEvent.SELECT)),
|
|
288
288
|
onEnterPressed: l[1] || (l[1] = (c) => e.onOptionSelected(e.BentoListboxEvent.ENTER)),
|
|
289
|
-
onSpacePressed: l[2] || (l[2] =
|
|
289
|
+
onSpacePressed: l[2] || (l[2] = Ee((c) => e.onOptionSelected(e.BentoListboxEvent.SPACE), ["prevent"])),
|
|
290
290
|
onTabPressed: l[3] || (l[3] = (c) => e.onOptionSelected(e.BentoListboxEvent.TAB))
|
|
291
291
|
}, {
|
|
292
|
-
default:
|
|
293
|
-
j(e.$slots, "default", ce(
|
|
292
|
+
default: _(() => [
|
|
293
|
+
j(e.$slots, "default", ce(Ce(e.option)), () => [
|
|
294
294
|
W("span", yl, [
|
|
295
|
-
|
|
296
|
-
default:
|
|
297
|
-
|
|
295
|
+
V(t, { el: "span" }, {
|
|
296
|
+
default: _(() => [
|
|
297
|
+
le(Y(e.option.label), 1)
|
|
298
298
|
]),
|
|
299
299
|
_: 1
|
|
300
300
|
}),
|
|
@@ -303,15 +303,15 @@ function hl(e, l, n, o, a, s) {
|
|
|
303
303
|
class: "b-listbox-single-select-option__description",
|
|
304
304
|
el: "span"
|
|
305
305
|
}, {
|
|
306
|
-
default:
|
|
307
|
-
|
|
306
|
+
default: _(() => [
|
|
307
|
+
le(Y(e.option.description), 1)
|
|
308
308
|
]),
|
|
309
309
|
_: 1
|
|
310
310
|
})) : J("", !0)
|
|
311
311
|
])
|
|
312
312
|
], !0),
|
|
313
313
|
W("span", gl, [
|
|
314
|
-
ue(
|
|
314
|
+
ue(V(i, { "svg-title": "selected" }, null, 512), [
|
|
315
315
|
[Ne, e.selected]
|
|
316
316
|
])
|
|
317
317
|
])
|
|
@@ -319,9 +319,9 @@ function hl(e, l, n, o, a, s) {
|
|
|
319
319
|
_: 3
|
|
320
320
|
}, 8, ["disabled", "selected", "aria-selected", "aria-disabled", "tabindex"]);
|
|
321
321
|
}
|
|
322
|
-
const Sl = /* @__PURE__ */
|
|
323
|
-
const o = d(() => l?.value ? l.value - 1 : e.value.length - 1), a =
|
|
324
|
-
switch (
|
|
322
|
+
const Sl = /* @__PURE__ */ Q(vl, [["render", hl], ["__scopeId", "data-v-4f41af07"]]), kt = ({ items: e, totalItemCount: l }, n) => {
|
|
323
|
+
const o = d(() => l?.value ? l.value - 1 : e.value.length - 1), a = k(0), s = (b) => {
|
|
324
|
+
switch (b) {
|
|
325
325
|
case "increase":
|
|
326
326
|
a.value += 1;
|
|
327
327
|
break;
|
|
@@ -329,32 +329,32 @@ const Sl = /* @__PURE__ */ ee(vl, [["render", hl], ["__scopeId", "data-v-4f41af0
|
|
|
329
329
|
a.value -= 1;
|
|
330
330
|
break;
|
|
331
331
|
}
|
|
332
|
-
}, t = ({ edgeCaseItem:
|
|
333
|
-
a.value !==
|
|
334
|
-
}, i = (
|
|
335
|
-
|
|
332
|
+
}, t = ({ edgeCaseItem: b }, T) => {
|
|
333
|
+
a.value !== b && (s(T), n(a.value));
|
|
334
|
+
}, i = (b) => {
|
|
335
|
+
m(b), t(
|
|
336
336
|
{
|
|
337
337
|
edgeCaseItem: o.value
|
|
338
338
|
},
|
|
339
339
|
"increase"
|
|
340
340
|
/* INCREASE */
|
|
341
341
|
);
|
|
342
|
-
}, h = (
|
|
343
|
-
|
|
342
|
+
}, h = (b) => {
|
|
343
|
+
m(b), t(
|
|
344
344
|
{
|
|
345
345
|
edgeCaseItem: 0
|
|
346
346
|
},
|
|
347
347
|
"decrease"
|
|
348
348
|
/* DECREASE */
|
|
349
349
|
);
|
|
350
|
-
}, c = () => {
|
|
351
|
-
a.value = 0, n(a.value);
|
|
352
|
-
}, u = () => {
|
|
353
|
-
a.value = o.value, n(a.value);
|
|
354
|
-
}, r = (
|
|
355
|
-
a.value =
|
|
356
|
-
},
|
|
357
|
-
|
|
350
|
+
}, c = (b) => {
|
|
351
|
+
m(b), a.value = 0, n(a.value);
|
|
352
|
+
}, u = (b) => {
|
|
353
|
+
m(b), a.value = o.value, n(a.value);
|
|
354
|
+
}, r = (b) => {
|
|
355
|
+
a.value = b;
|
|
356
|
+
}, m = (b) => {
|
|
357
|
+
b?.detail?.preventDefault(), b?.detail?.stopPropagation();
|
|
358
358
|
};
|
|
359
359
|
return {
|
|
360
360
|
moveToFirstElement: c,
|
|
@@ -362,20 +362,20 @@ const Sl = /* @__PURE__ */ ee(vl, [["render", hl], ["__scopeId", "data-v-4f41af0
|
|
|
362
362
|
moveToNextElement: i,
|
|
363
363
|
moveToPreviousElement: h,
|
|
364
364
|
setListboxFocusedIndex: r,
|
|
365
|
-
preventDefault:
|
|
365
|
+
preventDefault: m,
|
|
366
366
|
focusedIndex: a
|
|
367
367
|
};
|
|
368
|
-
}, ut = (e, l, n =
|
|
369
|
-
const a =
|
|
368
|
+
}, ut = (e, l, n = k("option"), o = !0) => {
|
|
369
|
+
const a = k([]), s = async () => {
|
|
370
370
|
if (!e.value || e.value.nodeType === Node.COMMENT_NODE)
|
|
371
371
|
return;
|
|
372
372
|
const t = Array.from(e.value.querySelectorAll(`[role="${n.value}"]`));
|
|
373
373
|
a.value = o ? t.filter((i) => i.checkVisibility()) : t;
|
|
374
374
|
};
|
|
375
|
-
return
|
|
375
|
+
return Oe(
|
|
376
376
|
l,
|
|
377
377
|
() => {
|
|
378
|
-
|
|
378
|
+
se(() => {
|
|
379
379
|
s();
|
|
380
380
|
});
|
|
381
381
|
},
|
|
@@ -446,60 +446,60 @@ const Sl = /* @__PURE__ */ ee(vl, [["render", hl], ["__scopeId", "data-v-4f41af0
|
|
|
446
446
|
},
|
|
447
447
|
emits: [y.SELECT, y.ENTER, y.SPACE, y.TAB],
|
|
448
448
|
setup(e, { emit: l, expose: n, slots: o, attrs: a }) {
|
|
449
|
-
const s =
|
|
449
|
+
const s = k(null), t = k([]), i = d(() => !!e.selectedValue?.length && e.selectedValue.at(0)), h = d(
|
|
450
450
|
() => ({
|
|
451
451
|
"aria-label": a["aria-label"]?.toString(),
|
|
452
452
|
"aria-busy": a["aria-busy"]?.toString(),
|
|
453
453
|
"aria-atomic": a["aria-atomic"]?.toString(),
|
|
454
454
|
"aria-live": a["aria-live"]?.toString()
|
|
455
455
|
})
|
|
456
|
-
), c = d(() => !!e.items.some(({ items:
|
|
457
|
-
l(
|
|
458
|
-
}, { visibleDomOptions: r, updateVisibleDomOptions:
|
|
456
|
+
), c = d(() => !!e.items.some(({ items: w }) => !!w)), u = (w) => (G) => {
|
|
457
|
+
l(w, [G]);
|
|
458
|
+
}, { visibleDomOptions: r, updateVisibleDomOptions: m } = ut(
|
|
459
459
|
s,
|
|
460
|
-
|
|
461
|
-
|
|
460
|
+
oe(e, "items"),
|
|
461
|
+
k("option"),
|
|
462
462
|
!1
|
|
463
|
-
),
|
|
464
|
-
if (!
|
|
463
|
+
), b = d(() => e.totalItemCount > 0), T = (w) => {
|
|
464
|
+
if (!b.value)
|
|
465
465
|
return;
|
|
466
|
-
const
|
|
467
|
-
if (
|
|
466
|
+
const G = w.target;
|
|
467
|
+
if (G === s.value || G?.getAttribute("role") !== "option")
|
|
468
468
|
return;
|
|
469
|
-
const
|
|
470
|
-
if (
|
|
471
|
-
const
|
|
472
|
-
|
|
469
|
+
const P = r.value.indexOf(G);
|
|
470
|
+
if (P !== -1) {
|
|
471
|
+
const ne = P + e.virtualScrollStartIndex;
|
|
472
|
+
$(ne);
|
|
473
473
|
}
|
|
474
|
-
},
|
|
475
|
-
if (
|
|
476
|
-
e.scrollToIndex(
|
|
477
|
-
const
|
|
478
|
-
r.value[
|
|
474
|
+
}, D = async (w) => {
|
|
475
|
+
if (b.value && e.scrollToIndex) {
|
|
476
|
+
e.scrollToIndex(w), await se(), await m();
|
|
477
|
+
const G = w - e.virtualScrollStartIndex;
|
|
478
|
+
r.value[G]?.focus();
|
|
479
479
|
} else
|
|
480
|
-
r.value[
|
|
481
|
-
}, g = async (
|
|
482
|
-
|
|
483
|
-
},
|
|
484
|
-
await
|
|
480
|
+
r.value[w]?.focus();
|
|
481
|
+
}, g = async (w) => {
|
|
482
|
+
$(w), await D(w);
|
|
483
|
+
}, z = async (w) => {
|
|
484
|
+
await m(), b.value && e.scrollToIndex ? e.scrollToIndex(w) : r.value[w]?.scrollIntoView?.({ block: "nearest" });
|
|
485
485
|
}, {
|
|
486
486
|
moveToNextElement: C,
|
|
487
|
-
moveToPreviousElement:
|
|
488
|
-
moveToFirstElement:
|
|
489
|
-
moveToLastElement:
|
|
490
|
-
setListboxFocusedIndex:
|
|
487
|
+
moveToPreviousElement: O,
|
|
488
|
+
moveToFirstElement: R,
|
|
489
|
+
moveToLastElement: x,
|
|
490
|
+
setListboxFocusedIndex: $
|
|
491
491
|
} = kt(
|
|
492
492
|
{
|
|
493
493
|
items: r,
|
|
494
|
-
totalItemCount:
|
|
494
|
+
totalItemCount: oe(e, "totalItemCount")
|
|
495
495
|
},
|
|
496
|
-
|
|
497
|
-
),
|
|
498
|
-
[H.ARROW_UP]:
|
|
496
|
+
D
|
|
497
|
+
), F = {
|
|
498
|
+
[H.ARROW_UP]: O,
|
|
499
499
|
[H.ARROW_DOWN]: C,
|
|
500
|
-
[H.HOME]:
|
|
501
|
-
[H.END]:
|
|
502
|
-
},
|
|
500
|
+
[H.HOME]: R,
|
|
501
|
+
[H.END]: x
|
|
502
|
+
}, B = {
|
|
503
503
|
[y.SELECT]: u(y.SELECT),
|
|
504
504
|
[y.SPACE]: u(y.SPACE),
|
|
505
505
|
[y.TAB]: u(y.TAB),
|
|
@@ -515,7 +515,7 @@ const Sl = /* @__PURE__ */ ee(vl, [["render", hl], ["__scopeId", "data-v-4f41af0
|
|
|
515
515
|
* Method to set the index of the item to be focused on
|
|
516
516
|
* Used for focus management to be kept in-sync with parent e.g. dropdowns
|
|
517
517
|
*/
|
|
518
|
-
setListboxFocusedIndex:
|
|
518
|
+
setListboxFocusedIndex: $,
|
|
519
519
|
/**
|
|
520
520
|
* Navigates to an item by global index, handling virtual scroll if enabled.
|
|
521
521
|
* Scrolls the virtual list and focuses the item.
|
|
@@ -525,7 +525,7 @@ const Sl = /* @__PURE__ */ ee(vl, [["render", hl], ["__scopeId", "data-v-4f41af0
|
|
|
525
525
|
* Scrolls to an item by global index without changing focus.
|
|
526
526
|
* Used when the dropdown opens via click to bring the selected option into view.
|
|
527
527
|
*/
|
|
528
|
-
scrollToItem:
|
|
528
|
+
scrollToItem: z
|
|
529
529
|
}), {
|
|
530
530
|
// Enums
|
|
531
531
|
BentoListboxEvent: y,
|
|
@@ -540,10 +540,10 @@ const Sl = /* @__PURE__ */ ee(vl, [["render", hl], ["__scopeId", "data-v-4f41af0
|
|
|
540
540
|
// Methods
|
|
541
541
|
onOptionSelected: u,
|
|
542
542
|
// Keyboard navigation
|
|
543
|
-
listboxListeners:
|
|
544
|
-
listboxOptionListeners:
|
|
543
|
+
listboxListeners: F,
|
|
544
|
+
listboxOptionListeners: B,
|
|
545
545
|
// Virtual scroll focus management
|
|
546
|
-
handleVirtualScrollingFocus:
|
|
546
|
+
handleVirtualScrollingFocus: T
|
|
547
547
|
};
|
|
548
548
|
}
|
|
549
549
|
});
|
|
@@ -552,13 +552,13 @@ function El(e, l, n, o, a, s) {
|
|
|
552
552
|
return ue((p(), E("div", M({ ref: "listboxRef" }, e.ariaAttributes, { role: "listbox" }, ie(e.listboxListeners, !0), {
|
|
553
553
|
onFocusin: l[0] || (l[0] = (...c) => e.handleVirtualScrollingFocus && e.handleVirtualScrollingFocus(...c))
|
|
554
554
|
}), [
|
|
555
|
-
e.hasCategories && e.staticCategories ? (p(!0), E(pe, { key: 0 },
|
|
555
|
+
e.hasCategories && e.staticCategories ? (p(!0), E(pe, { key: 0 }, te(e.items, (c) => (p(), E(pe, null, [
|
|
556
556
|
c.items && c.items.length > 0 ? (p(), N(i, {
|
|
557
557
|
key: `category-${c.value}`,
|
|
558
558
|
"category-label": c.label
|
|
559
559
|
}, {
|
|
560
|
-
default:
|
|
561
|
-
(p(!0), E(pe, null,
|
|
560
|
+
default: _(() => [
|
|
561
|
+
(p(!0), E(pe, null, te(c.items, (u) => (p(), N(t, M({
|
|
562
562
|
key: u.value,
|
|
563
563
|
ref_for: !0,
|
|
564
564
|
ref: "listboxItemRef",
|
|
@@ -567,10 +567,10 @@ function El(e, l, n, o, a, s) {
|
|
|
567
567
|
disabled: e.isOptionDisabled ? e.isOptionDisabled(u) : null,
|
|
568
568
|
selected: u.value === e.selectedItem.value
|
|
569
569
|
}, ie(e.listboxOptionListeners)), ve({ _: 2 }, [
|
|
570
|
-
|
|
571
|
-
name:
|
|
572
|
-
fn:
|
|
573
|
-
j(e.$slots,
|
|
570
|
+
te(e.slots, (r, m) => ({
|
|
571
|
+
name: m,
|
|
572
|
+
fn: _((b) => [
|
|
573
|
+
j(e.$slots, m, M({ ref_for: !0 }, b))
|
|
574
574
|
])
|
|
575
575
|
}))
|
|
576
576
|
]), 1040, ["option", "disabled", "selected"]))), 128))
|
|
@@ -585,14 +585,14 @@ function El(e, l, n, o, a, s) {
|
|
|
585
585
|
disabled: e.isOptionDisabled ? e.isOptionDisabled(c) : null,
|
|
586
586
|
selected: c.value === e.selectedItem.value
|
|
587
587
|
}, ie(e.listboxOptionListeners)), ve({ _: 2 }, [
|
|
588
|
-
|
|
588
|
+
te(e.slots, (u, r) => ({
|
|
589
589
|
name: r,
|
|
590
|
-
fn:
|
|
591
|
-
j(e.$slots, r, M({ ref_for: !0 },
|
|
590
|
+
fn: _((m) => [
|
|
591
|
+
j(e.$slots, r, M({ ref_for: !0 }, m))
|
|
592
592
|
])
|
|
593
593
|
}))
|
|
594
594
|
]), 1040, ["option", "disabled", "selected"]))
|
|
595
|
-
], 64))), 256)) : (p(!0), E(pe, { key: 1 },
|
|
595
|
+
], 64))), 256)) : (p(!0), E(pe, { key: 1 }, te(e.items, (c) => (p(), N(t, M({
|
|
596
596
|
key: c.value,
|
|
597
597
|
ref_for: !0,
|
|
598
598
|
ref: "listboxItemRef",
|
|
@@ -601,10 +601,10 @@ function El(e, l, n, o, a, s) {
|
|
|
601
601
|
disabled: e.isOptionDisabled ? e.isOptionDisabled(c) : null,
|
|
602
602
|
selected: c.value === e.selectedItem.value
|
|
603
603
|
}, ie(e.listboxOptionListeners)), ve({ _: 2 }, [
|
|
604
|
-
|
|
604
|
+
te(e.slots, (u, r) => ({
|
|
605
605
|
name: r,
|
|
606
|
-
fn:
|
|
607
|
-
j(e.$slots, r, M({ ref_for: !0 },
|
|
606
|
+
fn: _((m) => [
|
|
607
|
+
j(e.$slots, r, M({ ref_for: !0 }, m))
|
|
608
608
|
])
|
|
609
609
|
}))
|
|
610
610
|
]), 1040, ["option", "disabled", "selected"]))), 128))
|
|
@@ -612,7 +612,7 @@ function El(e, l, n, o, a, s) {
|
|
|
612
612
|
[h]
|
|
613
613
|
]);
|
|
614
614
|
}
|
|
615
|
-
const Ol = /* @__PURE__ */
|
|
615
|
+
const Ol = /* @__PURE__ */ Q(Cl, [["render", El]]);
|
|
616
616
|
let yt = 0;
|
|
617
617
|
const Ll = {
|
|
618
618
|
beforeCreate() {
|
|
@@ -638,7 +638,7 @@ function Tl(e, l, n, o, a, s) {
|
|
|
638
638
|
}, null, -1))
|
|
639
639
|
], 16);
|
|
640
640
|
}
|
|
641
|
-
const Al = /* @__PURE__ */
|
|
641
|
+
const Al = /* @__PURE__ */ Q(Ll, [["render", Tl]]), $l = {}, wl = /* @__PURE__ */ Z({
|
|
642
642
|
...$l,
|
|
643
643
|
__name: "decorative-checkbox",
|
|
644
644
|
props: {
|
|
@@ -659,18 +659,18 @@ const Al = /* @__PURE__ */ ee(Ll, [["render", Tl]]), $l = {}, wl = /* @__PURE__
|
|
|
659
659
|
class: fe(["b-checkbox-input", n.value]),
|
|
660
660
|
role: "presentation"
|
|
661
661
|
}, [
|
|
662
|
-
a.indeterminate ? (p(), N(
|
|
662
|
+
a.indeterminate ? (p(), N(f(Xt), {
|
|
663
663
|
key: 0,
|
|
664
664
|
class: "b-checkbox-input__icon",
|
|
665
665
|
"svg-title": "",
|
|
666
666
|
"aria-hidden": "true"
|
|
667
|
-
})) : a.allSelected ? (p(), N(
|
|
667
|
+
})) : a.allSelected ? (p(), N(f(Al), {
|
|
668
668
|
key: 1,
|
|
669
669
|
class: "b-checkbox-input__icon",
|
|
670
670
|
"svg-title": "",
|
|
671
671
|
"aria-hidden": "true",
|
|
672
672
|
"data-testid": "decorative-checkbox-double-checkmark-icon"
|
|
673
|
-
})) : a.checked ? (p(), N(
|
|
673
|
+
})) : a.checked ? (p(), N(f(Zt), {
|
|
674
674
|
key: 2,
|
|
675
675
|
class: "b-checkbox-input__icon",
|
|
676
676
|
"svg-title": "",
|
|
@@ -681,8 +681,8 @@ const Al = /* @__PURE__ */ ee(Ll, [["render", Tl]]), $l = {}, wl = /* @__PURE__
|
|
|
681
681
|
}, null, 2)
|
|
682
682
|
], 2));
|
|
683
683
|
}
|
|
684
|
-
}), pt = /* @__PURE__ */
|
|
685
|
-
var _t = /* @__PURE__ */ ((e) => (e.DISABLED = "disabled", e.STATIC_CATEGORY = "static-category", e))(_t || {}),
|
|
684
|
+
}), pt = /* @__PURE__ */ Q(wl, [["__scopeId", "data-v-08d3142e"]]);
|
|
685
|
+
var _t = /* @__PURE__ */ ((e) => (e.DISABLED = "disabled", e.STATIC_CATEGORY = "static-category", e))(_t || {}), ke = /* @__PURE__ */ ((e) => (e.SELECT_CATEGORY = "select-category", e.UNSELECT_CATEGORY = "unselect-category", e.TOGGLE_CATEGORY_VISIBILITY = "toggle-category-visibility", e))(ke || {});
|
|
686
686
|
const gt = {
|
|
687
687
|
"de-DE": { categoryClosed: "{category} geschlossen", categoryOpened: "{category} geöffnet" },
|
|
688
688
|
"en-GB": { categoryClosed: "{category} closed", categoryOpened: "{category} opened" },
|
|
@@ -698,7 +698,7 @@ const gt = {
|
|
|
698
698
|
i18n: { messages: gt },
|
|
699
699
|
name: "bento-listbox-multi-select-category",
|
|
700
700
|
components: {
|
|
701
|
-
BentoTypography:
|
|
701
|
+
BentoTypography: Te,
|
|
702
702
|
BentoListboxOption: je,
|
|
703
703
|
ChevronDownIcon: At,
|
|
704
704
|
ChevronUpIcon: $t,
|
|
@@ -748,64 +748,64 @@ const gt = {
|
|
|
748
748
|
tabindex: { type: Number, default: -1 }
|
|
749
749
|
},
|
|
750
750
|
emits: [
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
751
|
+
ke.SELECT_CATEGORY,
|
|
752
|
+
ke.UNSELECT_CATEGORY,
|
|
753
|
+
ke.TOGGLE_CATEGORY_VISIBILITY
|
|
754
754
|
],
|
|
755
755
|
setup(e, { emit: l }) {
|
|
756
|
-
const n =
|
|
757
|
-
() => e.category.items.every((
|
|
758
|
-
), h =
|
|
756
|
+
const n = k(!1), { t: o } = De({ messages: gt }), a = Ie("category-group"), s = Ie("category-name"), t = (B) => e.isOptionDisabled ? e.isOptionDisabled(B) : !1, i = d(
|
|
757
|
+
() => e.category.items.every((B) => t(B))
|
|
758
|
+
), h = oe(e, "staticCategories"), c = d(() => n.value || e.staticCategories), u = d(() => ({
|
|
759
759
|
[`b-listbox-multi-select-category--${_t.DISABLED}`]: i.value
|
|
760
|
-
})), r = (
|
|
761
|
-
|
|
762
|
-
},
|
|
763
|
-
const
|
|
764
|
-
return { isDisabled:
|
|
765
|
-
},
|
|
766
|
-
() => e.category.items.filter((
|
|
767
|
-
const { isDisabled:
|
|
768
|
-
return
|
|
760
|
+
})), r = (B, w) => {
|
|
761
|
+
B.preventDefault(), n.value = w !== void 0 ? w : !n.value, l(ke.TOGGLE_CATEGORY_VISIBILITY, e.category.value);
|
|
762
|
+
}, m = (B) => {
|
|
763
|
+
const w = t(B), G = e.selectedItemsList?.includes(B.value) || !1;
|
|
764
|
+
return { isDisabled: w, isPreSelected: G };
|
|
765
|
+
}, b = d(
|
|
766
|
+
() => e.category.items.filter((B) => {
|
|
767
|
+
const { isDisabled: w, isPreSelected: G } = m(B);
|
|
768
|
+
return w && G || !w;
|
|
769
769
|
})
|
|
770
|
-
),
|
|
771
|
-
() =>
|
|
772
|
-
({ value:
|
|
770
|
+
), T = d(
|
|
771
|
+
() => b.value?.filter(
|
|
772
|
+
({ value: B }) => e.selectedItemsList?.includes(B)
|
|
773
773
|
)
|
|
774
|
-
),
|
|
775
|
-
const
|
|
776
|
-
return o(
|
|
774
|
+
), D = d(() => {
|
|
775
|
+
const B = n.value ? "categoryOpened" : "categoryClosed";
|
|
776
|
+
return o(B, { category: e.category.label });
|
|
777
777
|
}), g = () => {
|
|
778
|
-
l(
|
|
779
|
-
},
|
|
780
|
-
l(
|
|
781
|
-
}, { isAllSelected: C, isIndeterminate:
|
|
782
|
-
|
|
783
|
-
|
|
778
|
+
l(ke.SELECT_CATEGORY);
|
|
779
|
+
}, z = () => {
|
|
780
|
+
l(ke.UNSELECT_CATEGORY);
|
|
781
|
+
}, { isAllSelected: C, isIndeterminate: O, toggleSelectAll: R } = wt(
|
|
782
|
+
T,
|
|
783
|
+
b,
|
|
784
784
|
g,
|
|
785
|
-
|
|
786
|
-
),
|
|
787
|
-
|
|
785
|
+
z
|
|
786
|
+
), x = d(() => O.value ? "mixed" : `${C.value}`), $ = k(C.value), F = () => {
|
|
787
|
+
$.value = !$.value, R($.value);
|
|
788
788
|
};
|
|
789
|
-
return
|
|
790
|
-
|
|
789
|
+
return Oe(C, () => {
|
|
790
|
+
$.value = C.value;
|
|
791
791
|
}), {
|
|
792
792
|
// Values
|
|
793
|
-
chevronTitle:
|
|
793
|
+
chevronTitle: D,
|
|
794
794
|
conditionalClass: u,
|
|
795
795
|
hasAllPropsDisabled: i,
|
|
796
796
|
isOpen: n,
|
|
797
797
|
isAllSelected: C,
|
|
798
|
-
isIndeterminate:
|
|
798
|
+
isIndeterminate: O,
|
|
799
799
|
isStaticCategory: h,
|
|
800
800
|
categoryGroupId: a,
|
|
801
801
|
categoryNameId: s,
|
|
802
802
|
// Computed
|
|
803
803
|
showItemChildren: c,
|
|
804
|
-
ariaCheckedComputed:
|
|
804
|
+
ariaCheckedComputed: x,
|
|
805
805
|
// Methods
|
|
806
|
-
handleSelectAll:
|
|
806
|
+
handleSelectAll: F,
|
|
807
807
|
toggleOpen: r,
|
|
808
|
-
toggleSelectAll:
|
|
808
|
+
toggleSelectAll: R
|
|
809
809
|
};
|
|
810
810
|
}
|
|
811
811
|
}), _l = { class: "b-listbox-multi-select-category__label" }, Dl = {
|
|
@@ -818,13 +818,13 @@ function Rl(e, l, n, o, a, s) {
|
|
|
818
818
|
return p(), E("div", null, [
|
|
819
819
|
e.isStaticCategory ? (p(), E("div", Dl, [
|
|
820
820
|
W("span", xl, [
|
|
821
|
-
|
|
821
|
+
V(i, {
|
|
822
822
|
el: "span",
|
|
823
823
|
variant: "caption",
|
|
824
824
|
class: "b-listbox-multi-select-category__label-text"
|
|
825
825
|
}, {
|
|
826
|
-
default:
|
|
827
|
-
|
|
826
|
+
default: _(() => [
|
|
827
|
+
le(Y(e.category.label), 1)
|
|
828
828
|
]),
|
|
829
829
|
_: 1
|
|
830
830
|
})
|
|
@@ -842,26 +842,26 @@ function Rl(e, l, n, o, a, s) {
|
|
|
842
842
|
"aria-labelledby": e.categoryNameId,
|
|
843
843
|
onClick: e.handleSelectAll,
|
|
844
844
|
onEnterPressed: e.handleSelectAll,
|
|
845
|
-
onSpacePressed:
|
|
845
|
+
onSpacePressed: Ee(e.handleSelectAll, ["prevent"]),
|
|
846
846
|
onKeydown: [
|
|
847
847
|
l[1] || (l[1] = me((r) => e.toggleOpen(r, !1), ["arrow-left", "native"])),
|
|
848
848
|
l[2] || (l[2] = me((r) => e.toggleOpen(r, !0), ["arrow-right", "native"]))
|
|
849
849
|
]
|
|
850
850
|
}, {
|
|
851
|
-
default:
|
|
852
|
-
|
|
851
|
+
default: _(() => [
|
|
852
|
+
V(t, {
|
|
853
853
|
indeterminate: e.isIndeterminate,
|
|
854
854
|
disabled: e.hasAllPropsDisabled,
|
|
855
855
|
checked: e.isAllSelected
|
|
856
856
|
}, null, 8, ["indeterminate", "disabled", "checked"]),
|
|
857
857
|
W("span", _l, [
|
|
858
|
-
|
|
858
|
+
V(i, {
|
|
859
859
|
id: e.categoryNameId,
|
|
860
860
|
el: "span",
|
|
861
861
|
class: "b-listbox-multi-select-category__label-text"
|
|
862
862
|
}, {
|
|
863
|
-
default:
|
|
864
|
-
|
|
863
|
+
default: _(() => [
|
|
864
|
+
le(Y(e.category.label), 1)
|
|
865
865
|
]),
|
|
866
866
|
_: 1
|
|
867
867
|
}, 8, ["id"]),
|
|
@@ -869,7 +869,7 @@ function Rl(e, l, n, o, a, s) {
|
|
|
869
869
|
"aria-hidden": "true",
|
|
870
870
|
class: "b-listbox-multi-select-category__label-chevron",
|
|
871
871
|
"data-testid": "toggle-listbox",
|
|
872
|
-
onClickCapture: l[0] || (l[0] =
|
|
872
|
+
onClickCapture: l[0] || (l[0] = Ee((...r) => e.toggleOpen && e.toggleOpen(...r), ["stop"]))
|
|
873
873
|
}, [
|
|
874
874
|
e.isOpen ? (p(), N(h, {
|
|
875
875
|
key: 0,
|
|
@@ -894,13 +894,13 @@ function Rl(e, l, n, o, a, s) {
|
|
|
894
894
|
])
|
|
895
895
|
]);
|
|
896
896
|
}
|
|
897
|
-
const Ml = /* @__PURE__ */
|
|
898
|
-
var
|
|
897
|
+
const Ml = /* @__PURE__ */ Q(kl, [["render", Rl], ["__scopeId", "data-v-60c04867"]]);
|
|
898
|
+
var Se = /* @__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))(Se || {});
|
|
899
899
|
const Nl = Z({
|
|
900
900
|
name: "listbox-multi-select-options",
|
|
901
901
|
components: {
|
|
902
902
|
BentoListboxOption: je,
|
|
903
|
-
BentoTypography:
|
|
903
|
+
BentoTypography: Te,
|
|
904
904
|
ListboxMultiSelectCategory: Ml,
|
|
905
905
|
DecorativeCheckbox: pt
|
|
906
906
|
},
|
|
@@ -972,20 +972,20 @@ const Nl = Z({
|
|
|
972
972
|
}
|
|
973
973
|
},
|
|
974
974
|
emits: [
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
975
|
+
Se.TOGGLE_CHECKBOX_SELECTION,
|
|
976
|
+
Se.SELECT_CATEGORY,
|
|
977
|
+
Se.UNSELECT_CATEGORY,
|
|
978
|
+
Se.TOGGLE_CATEGORY_VISIBILITY
|
|
979
979
|
],
|
|
980
980
|
setup(e, { emit: l }) {
|
|
981
981
|
const n = (c) => {
|
|
982
|
-
e.isOptionDisabled(c) || l(
|
|
982
|
+
e.isOptionDisabled(c) || l(Se.TOGGLE_CHECKBOX_SELECTION, c);
|
|
983
983
|
}, o = (c) => !!c.items, a = (c) => {
|
|
984
984
|
const u = e.isMultiLevel && e.searching;
|
|
985
985
|
return c.description && (!e.isMultiLevel || u);
|
|
986
986
|
}, s = (c) => c.items ? !!c.items.find((u) => e.selectedItemsList.includes(u.value)) : e.selectedItemsList.includes(c.value), t = (c) => {
|
|
987
987
|
if (o(c)) {
|
|
988
|
-
const u = s(c) ?
|
|
988
|
+
const u = s(c) ? Se.UNSELECT_CATEGORY : Se.SELECT_CATEGORY;
|
|
989
989
|
l(u, c);
|
|
990
990
|
} else
|
|
991
991
|
n(c);
|
|
@@ -1004,14 +1004,14 @@ const Nl = Z({
|
|
|
1004
1004
|
computedTabindex: (c) => e.itemsIndex[c] === e.focusedIndex ? 0 : -1,
|
|
1005
1005
|
// Enums
|
|
1006
1006
|
BentoListboxEvent: y,
|
|
1007
|
-
ListboxMultiSelectOptionsEvent:
|
|
1007
|
+
ListboxMultiSelectOptionsEvent: Se
|
|
1008
1008
|
};
|
|
1009
1009
|
}
|
|
1010
1010
|
}), Pl = { class: "b-listbox-multi-select__option-text" }, Fl = { class: "b-listbox-multi-select__option-text" };
|
|
1011
1011
|
function Vl(e, l, n, o, a, s) {
|
|
1012
1012
|
const t = K("decorative-checkbox"), i = K("bento-typography"), h = K("bento-listbox-option"), c = K("listbox-multi-select-options", !0), u = K("listbox-multi-select-category");
|
|
1013
1013
|
return p(), E("div", null, [
|
|
1014
|
-
(p(!0), E(pe, null,
|
|
1014
|
+
(p(!0), E(pe, null, te(e.items, (r) => (p(), E("div", {
|
|
1015
1015
|
key: `selected-${r.value}`
|
|
1016
1016
|
}, [
|
|
1017
1017
|
e.searching && e.isMultiLevel ? (p(), N(h, {
|
|
@@ -1023,20 +1023,20 @@ function Vl(e, l, n, o, a, s) {
|
|
|
1023
1023
|
"aria-checked": `${e.isOptionSelected(r)}`,
|
|
1024
1024
|
"aria-disabled": e.isOptionDisabled ? e.isOptionDisabled(r) : null,
|
|
1025
1025
|
role: e.$attrs.role || "option",
|
|
1026
|
-
onClick: (
|
|
1027
|
-
onEnterPressed: (
|
|
1028
|
-
onSpacePressed:
|
|
1026
|
+
onClick: (m) => e.toggleSearchOption(r),
|
|
1027
|
+
onEnterPressed: (m) => e.toggleSearchOption(r),
|
|
1028
|
+
onSpacePressed: Ee((m) => e.toggleSearchOption(r), ["prevent"])
|
|
1029
1029
|
}, {
|
|
1030
|
-
default:
|
|
1031
|
-
|
|
1030
|
+
default: _(() => [
|
|
1031
|
+
V(t, {
|
|
1032
1032
|
disabled: e.isOptionDisabled ? e.isOptionDisabled(r) : null,
|
|
1033
1033
|
checked: e.isOptionSelected(r)
|
|
1034
1034
|
}, null, 8, ["disabled", "checked"]),
|
|
1035
1035
|
j(e.$slots, "default", M({ ref_for: !0 }, r), () => [
|
|
1036
1036
|
W("span", Pl, [
|
|
1037
|
-
|
|
1038
|
-
default:
|
|
1039
|
-
|
|
1037
|
+
V(i, { el: "span" }, {
|
|
1038
|
+
default: _(() => [
|
|
1039
|
+
le(Y(r.label), 1)
|
|
1040
1040
|
]),
|
|
1041
1041
|
_: 2
|
|
1042
1042
|
}, 1024),
|
|
@@ -1045,8 +1045,8 @@ function Vl(e, l, n, o, a, s) {
|
|
|
1045
1045
|
class: "b-listbox-multi-select__option-description",
|
|
1046
1046
|
el: "span"
|
|
1047
1047
|
}, {
|
|
1048
|
-
default:
|
|
1049
|
-
|
|
1048
|
+
default: _(() => [
|
|
1049
|
+
le(Y(r.description), 1)
|
|
1050
1050
|
]),
|
|
1051
1051
|
_: 2
|
|
1052
1052
|
}, 1024)) : J("", !0)
|
|
@@ -1062,12 +1062,12 @@ function Vl(e, l, n, o, a, s) {
|
|
|
1062
1062
|
"is-option-disabled": e.isOptionDisabled,
|
|
1063
1063
|
"selected-items-list": e.selectedItemsList,
|
|
1064
1064
|
tabindex: e.computedTabindex(r.value),
|
|
1065
|
-
onSelectCategory: (
|
|
1066
|
-
onUnselectCategory: (
|
|
1067
|
-
onToggleCategoryVisibility: l[1] || (l[1] = (
|
|
1065
|
+
onSelectCategory: (m) => e.$emit(e.ListboxMultiSelectOptionsEvent.SELECT_CATEGORY, r),
|
|
1066
|
+
onUnselectCategory: (m) => e.$emit(e.ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY, r),
|
|
1067
|
+
onToggleCategoryVisibility: l[1] || (l[1] = (m) => e.$emit(e.ListboxMultiSelectOptionsEvent.TOGGLE_CATEGORY_VISIBILITY, m))
|
|
1068
1068
|
}, {
|
|
1069
|
-
default:
|
|
1070
|
-
|
|
1069
|
+
default: _(() => [
|
|
1070
|
+
V(c, {
|
|
1071
1071
|
"category-items": "",
|
|
1072
1072
|
items: r.items,
|
|
1073
1073
|
"is-option-disabled": e.isOptionDisabled,
|
|
@@ -1078,7 +1078,7 @@ function Vl(e, l, n, o, a, s) {
|
|
|
1078
1078
|
"selected-items-list": e.selectedItemsList,
|
|
1079
1079
|
searching: e.searching,
|
|
1080
1080
|
role: e.$attrs.role || "option",
|
|
1081
|
-
onToggleCheckboxSelection: l[0] || (l[0] = (
|
|
1081
|
+
onToggleCheckboxSelection: l[0] || (l[0] = (m) => e.toggleCheckboxSelection(m))
|
|
1082
1082
|
}, null, 8, ["items", "is-option-disabled", "items-index", "focused-index", "is-multi-level", "static-categories", "selected-items-list", "searching", "role"])
|
|
1083
1083
|
]),
|
|
1084
1084
|
_: 2
|
|
@@ -1091,20 +1091,20 @@ function Vl(e, l, n, o, a, s) {
|
|
|
1091
1091
|
"aria-checked": `${e.isOptionSelected(r)}`,
|
|
1092
1092
|
"aria-disabled": e.isOptionDisabled ? e.isOptionDisabled(r) : null,
|
|
1093
1093
|
role: e.$attrs.role || "option",
|
|
1094
|
-
onClick: (
|
|
1095
|
-
onEnterPressed: (
|
|
1096
|
-
onSpacePressed:
|
|
1094
|
+
onClick: (m) => e.toggleCheckboxSelection(r),
|
|
1095
|
+
onEnterPressed: (m) => e.toggleCheckboxSelection(r),
|
|
1096
|
+
onSpacePressed: Ee((m) => e.toggleCheckboxSelection(r), ["prevent"])
|
|
1097
1097
|
}, {
|
|
1098
|
-
default:
|
|
1099
|
-
|
|
1098
|
+
default: _(() => [
|
|
1099
|
+
V(t, {
|
|
1100
1100
|
disabled: e.isOptionDisabled ? e.isOptionDisabled(r) : null,
|
|
1101
1101
|
checked: e.isOptionSelected(r)
|
|
1102
1102
|
}, null, 8, ["disabled", "checked"]),
|
|
1103
1103
|
j(e.$slots, "default", M({ ref_for: !0 }, r), () => [
|
|
1104
1104
|
W("span", Fl, [
|
|
1105
|
-
|
|
1106
|
-
default:
|
|
1107
|
-
|
|
1105
|
+
V(i, { el: "span" }, {
|
|
1106
|
+
default: _(() => [
|
|
1107
|
+
le(Y(r.label), 1)
|
|
1108
1108
|
]),
|
|
1109
1109
|
_: 2
|
|
1110
1110
|
}, 1024),
|
|
@@ -1113,8 +1113,8 @@ function Vl(e, l, n, o, a, s) {
|
|
|
1113
1113
|
class: "b-listbox-multi-select__option-description",
|
|
1114
1114
|
el: "span"
|
|
1115
1115
|
}, {
|
|
1116
|
-
default:
|
|
1117
|
-
|
|
1116
|
+
default: _(() => [
|
|
1117
|
+
le(Y(r.description), 1)
|
|
1118
1118
|
]),
|
|
1119
1119
|
_: 2
|
|
1120
1120
|
}, 1024)) : J("", !0)
|
|
@@ -1127,7 +1127,7 @@ function Vl(e, l, n, o, a, s) {
|
|
|
1127
1127
|
]))), 128))
|
|
1128
1128
|
]);
|
|
1129
1129
|
}
|
|
1130
|
-
const zl = /* @__PURE__ */
|
|
1130
|
+
const zl = /* @__PURE__ */ Q(Nl, [["render", Vl], ["__scopeId", "data-v-237dfc58"]]), Dt = (e) => {
|
|
1131
1131
|
const l = d(() => !!e.value?.find(({ items: o }) => !!o)), n = d(() => l.value ? e.value?.reduce((o, a) => (a.items ? o.push(...a.items.flat()) : o.push(a), o), []) : e.value);
|
|
1132
1132
|
return {
|
|
1133
1133
|
isMultiLevelSelect: l,
|
|
@@ -1162,7 +1162,7 @@ const zl = /* @__PURE__ */ ee(Nl, [["render", Vl], ["__scopeId", "data-v-237dfc5
|
|
|
1162
1162
|
},
|
|
1163
1163
|
emits: ["select"],
|
|
1164
1164
|
setup(e, { expose: l, emit: n }) {
|
|
1165
|
-
const o = e, a = n, { t: s, n: t } =
|
|
1165
|
+
const o = e, a = n, { t: s, n: t } = De({ messages: xt }), i = Ge(), h = dt(), c = d(
|
|
1166
1166
|
() => ({
|
|
1167
1167
|
"aria-label": h["aria-label"]?.toString(),
|
|
1168
1168
|
"aria-busy": h["aria-busy"]?.toString(),
|
|
@@ -1170,81 +1170,81 @@ const zl = /* @__PURE__ */ ee(Nl, [["render", Vl], ["__scopeId", "data-v-237dfc5
|
|
|
1170
1170
|
"aria-live": h["aria-live"]?.toString(),
|
|
1171
1171
|
"aria-multiselectable": !0
|
|
1172
1172
|
})
|
|
1173
|
-
), u =
|
|
1174
|
-
const
|
|
1175
|
-
return { isDisabled:
|
|
1176
|
-
},
|
|
1177
|
-
if (o.searching &&
|
|
1173
|
+
), u = k(null), r = k(null), m = k(null), b = k(null), T = d(() => o.selectedValues.map(({ value: S }) => S)), { isMultiLevelSelect: D, flattenedItemsList: g } = Dt(oe(o, "items")), z = d(() => D.value && !o.staticCategories), C = d(() => z.value ? "tree" : "listbox"), O = d(() => z.value ? "treeitem" : "option"), R = (S) => {
|
|
1174
|
+
const A = o.isOptionDisabled(S), L = T.value?.includes(S.value) || !1;
|
|
1175
|
+
return { isDisabled: A, isPreSelected: L };
|
|
1176
|
+
}, x = d(() => {
|
|
1177
|
+
if (o.searching && D)
|
|
1178
1178
|
return o.items;
|
|
1179
|
-
const S = g.value.filter((
|
|
1180
|
-
const { isDisabled:
|
|
1181
|
-
return
|
|
1179
|
+
const S = g.value.filter((A) => {
|
|
1180
|
+
const { isDisabled: L, isPreSelected: U } = R(A);
|
|
1181
|
+
return L && U || !L;
|
|
1182
1182
|
});
|
|
1183
|
-
return o.selectedValues.forEach((
|
|
1184
|
-
S.find((
|
|
1183
|
+
return o.selectedValues.forEach((A) => {
|
|
1184
|
+
S.find((L) => L.value === A.value) || S.push(A);
|
|
1185
1185
|
}), S;
|
|
1186
|
-
}),
|
|
1187
|
-
() =>
|
|
1188
|
-
(
|
|
1189
|
-
).length === S.items.length :
|
|
1190
|
-
),
|
|
1191
|
-
const S =
|
|
1192
|
-
return
|
|
1193
|
-
}),
|
|
1194
|
-
const
|
|
1195
|
-
const { isDisabled: q, isPreSelected:
|
|
1196
|
-
return q &&
|
|
1197
|
-
},
|
|
1198
|
-
a("select", [...o.selectedValues, ...
|
|
1199
|
-
},
|
|
1200
|
-
const
|
|
1201
|
-
const { isDisabled:
|
|
1202
|
-
return !(
|
|
1203
|
-
},
|
|
1186
|
+
}), $ = d(
|
|
1187
|
+
() => x.value?.filter((S) => S.items && D.value && o.searching ? S.items.filter(
|
|
1188
|
+
(L) => (o.selectedValues ?? []).includes(L.value)
|
|
1189
|
+
).length === S.items.length : T.value?.includes(S.value))
|
|
1190
|
+
), F = () => D.value && !o.searching ? g.value.length : o.items.length, B = d(() => {
|
|
1191
|
+
const S = x.value.length, A = F(), L = $.value?.length || 0;
|
|
1192
|
+
return L === 0 ? s("selectAll", { total: t(S) }) : L === A ? s("allSelected", { total: t(A) }) : L <= A ? s("numberOfTotalSelected", { number: t(L), total: t(A) }) : s("numbersSelected", { number: t(L) });
|
|
1193
|
+
}), w = (S) => {
|
|
1194
|
+
const A = (U) => {
|
|
1195
|
+
const { isDisabled: q, isPreSelected: $e } = R(U);
|
|
1196
|
+
return q && $e || !q;
|
|
1197
|
+
}, L = S.filter(A).filter((U) => !T.value.includes(U.value));
|
|
1198
|
+
a("select", [...o.selectedValues, ...L]);
|
|
1199
|
+
}, G = (S) => {
|
|
1200
|
+
const A = (q) => {
|
|
1201
|
+
const { isDisabled: $e, isPreSelected: v } = R(q);
|
|
1202
|
+
return !($e && v);
|
|
1203
|
+
}, L = S.filter(A).map(({ value: q }) => q), U = o.selectedValues.filter((q) => !L?.includes(q.value));
|
|
1204
1204
|
a("select", U);
|
|
1205
|
-
},
|
|
1206
|
-
|
|
1207
|
-
},
|
|
1208
|
-
|
|
1209
|
-
}, { isAllSelected:
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
),
|
|
1205
|
+
}, P = () => {
|
|
1206
|
+
w(g.value);
|
|
1207
|
+
}, ne = () => {
|
|
1208
|
+
G(g.value);
|
|
1209
|
+
}, { isAllSelected: I, isIndeterminate: ye, toggleSelectAll: Pe } = wt(
|
|
1210
|
+
$,
|
|
1211
|
+
x,
|
|
1212
|
+
P,
|
|
1213
|
+
ne
|
|
1214
|
+
), xe = d(() => ye.value ? "mixed" : `${I.value}`), X = k(I.value), re = () => {
|
|
1215
1215
|
X.value = !X.value, Pe(X.value);
|
|
1216
1216
|
};
|
|
1217
|
-
|
|
1218
|
-
X.value =
|
|
1217
|
+
Oe(I, () => {
|
|
1218
|
+
X.value = I.value;
|
|
1219
1219
|
});
|
|
1220
1220
|
const Ke = (S) => {
|
|
1221
|
-
|
|
1222
|
-
},
|
|
1223
|
-
|
|
1224
|
-
},
|
|
1225
|
-
let
|
|
1226
|
-
const U = o.selectedValues.filter(({ value: q }) =>
|
|
1227
|
-
|
|
1221
|
+
w(S.items);
|
|
1222
|
+
}, Ae = (S) => {
|
|
1223
|
+
G(S.items);
|
|
1224
|
+
}, ge = (S, A) => {
|
|
1225
|
+
let L = !1;
|
|
1226
|
+
const U = o.selectedValues.filter(({ value: q }) => A.value === q ? (L = !0, !1) : !0);
|
|
1227
|
+
L || U.push(A), a(S, U);
|
|
1228
1228
|
}, He = d(() => {
|
|
1229
|
-
if (!
|
|
1229
|
+
if (!D.value)
|
|
1230
1230
|
return o.selectedValues;
|
|
1231
|
-
const S = (
|
|
1232
|
-
(
|
|
1233
|
-
), U =
|
|
1234
|
-
|
|
1235
|
-
q.add(
|
|
1231
|
+
const S = (v) => T.value.includes(v.value), A = (v) => !o.staticCategories && v.every((ae) => S(ae)), L = o.items.flatMap(
|
|
1232
|
+
(v) => v.items && !A(v.items) ? v.items : v
|
|
1233
|
+
), U = L.filter((v) => v.items ? !0 : S(v)), q = /* @__PURE__ */ new Set();
|
|
1234
|
+
L.forEach((v) => {
|
|
1235
|
+
q.add(v.value), v.items?.forEach((ae) => q.add(ae.value));
|
|
1236
1236
|
});
|
|
1237
|
-
const
|
|
1238
|
-
return [...U,
|
|
1237
|
+
const $e = o.selectedValues.filter((v) => !q.has(v.value));
|
|
1238
|
+
return [...U, ...$e];
|
|
1239
1239
|
}), Je = d(() => {
|
|
1240
|
-
const S = ["automatic", "button"].includes(o.lazyLoadType),
|
|
1241
|
-
return S && o.hasMoreItems ? !!o.selectedValues?.length :
|
|
1242
|
-
}),
|
|
1240
|
+
const S = ["automatic", "button"].includes(o.lazyLoadType), A = o.selectedValues?.length > 0 && $.value?.length !== g.value?.length;
|
|
1241
|
+
return S && o.hasMoreItems ? !!o.selectedValues?.length : A;
|
|
1242
|
+
}), Be = d(() => ["automatic", "button"].includes(o.lazyLoadType) ? !o.hasMoreItems : !0), he = k([]), { visibleDomOptions: Fe, updateVisibleDomOptions: Xe } = ut(
|
|
1243
1243
|
u,
|
|
1244
|
-
|
|
1245
|
-
|
|
1244
|
+
oe(o, "items"),
|
|
1245
|
+
O
|
|
1246
1246
|
), Ze = (S) => {
|
|
1247
|
-
|
|
1247
|
+
he.value.includes(S) ? he.value = he.value.filter((A) => A !== S) : he.value.push(S), se(() => {
|
|
1248
1248
|
Xe();
|
|
1249
1249
|
});
|
|
1250
1250
|
}, Qe = (S) => {
|
|
@@ -1255,7 +1255,7 @@ const zl = /* @__PURE__ */ ee(Nl, [["render", Vl], ["__scopeId", "data-v-237dfc5
|
|
|
1255
1255
|
moveToFirstElement: tt,
|
|
1256
1256
|
moveToLastElement: qe,
|
|
1257
1257
|
preventDefault: Ye,
|
|
1258
|
-
focusedIndex:
|
|
1258
|
+
focusedIndex: Re,
|
|
1259
1259
|
setListboxFocusedIndex: Ve
|
|
1260
1260
|
} = kt(
|
|
1261
1261
|
{
|
|
@@ -1279,103 +1279,103 @@ const zl = /* @__PURE__ */ ee(Nl, [["render", Vl], ["__scopeId", "data-v-237dfc5
|
|
|
1279
1279
|
[H.ARROW_UP]: Ye,
|
|
1280
1280
|
[H.ARROW_DOWN]: Ye
|
|
1281
1281
|
}, at = d(() => {
|
|
1282
|
-
let S =
|
|
1283
|
-
const
|
|
1284
|
-
return o.items.forEach((
|
|
1285
|
-
let U =
|
|
1286
|
-
|
|
1287
|
-
}),
|
|
1282
|
+
let S = Be.value ? 1 : 0;
|
|
1283
|
+
const A = {};
|
|
1284
|
+
return o.items.forEach((L) => {
|
|
1285
|
+
let U = he.value.includes(L.value);
|
|
1286
|
+
L.items ? (o.staticCategories ? U = !0 : A[L.value] = S++, U && L.items.forEach((q) => A[q.value] = S++)) : A[L.value] = S++;
|
|
1287
|
+
}), A;
|
|
1288
1288
|
});
|
|
1289
|
-
return (S,
|
|
1289
|
+
return (S, A) => (p(), E("div", {
|
|
1290
1290
|
ref_key: "listboxRef",
|
|
1291
1291
|
ref: u,
|
|
1292
1292
|
class: "b-listbox-multi-select"
|
|
1293
1293
|
}, [
|
|
1294
1294
|
Je.value ? (p(), E("div", Gl, [
|
|
1295
1295
|
ue((p(), E("ul", M({ class: "b-listbox-multi-select__chips" }, ie(ot, !0)), [
|
|
1296
|
-
(p(!0), E(pe, null,
|
|
1297
|
-
key:
|
|
1296
|
+
(p(!0), E(pe, null, te(He.value, (L) => (p(), E("li", {
|
|
1297
|
+
key: L.value
|
|
1298
1298
|
}, [
|
|
1299
|
-
|
|
1299
|
+
V(f(Qt), {
|
|
1300
1300
|
ref_for: !0,
|
|
1301
1301
|
ref_key: "selectedListboxItemsRef",
|
|
1302
|
-
ref:
|
|
1303
|
-
disabled: S.isOptionDisabled(
|
|
1304
|
-
label:
|
|
1302
|
+
ref: m,
|
|
1303
|
+
disabled: S.isOptionDisabled(L),
|
|
1304
|
+
label: L.label,
|
|
1305
1305
|
condensed: "",
|
|
1306
|
-
onClick: (U) =>
|
|
1306
|
+
onClick: (U) => L.items ? Ae(L) : ge("select", L)
|
|
1307
1307
|
}, null, 8, ["disabled", "label", "onClick"])
|
|
1308
1308
|
]))), 128))
|
|
1309
1309
|
], 16)), [
|
|
1310
|
-
[
|
|
1310
|
+
[f(ze)]
|
|
1311
1311
|
]),
|
|
1312
|
-
|
|
1312
|
+
A[4] || (A[4] = W("hr", {
|
|
1313
1313
|
class: "b-listbox-multi-select__divider",
|
|
1314
1314
|
"aria-hidden": "true"
|
|
1315
1315
|
}, null, -1))
|
|
1316
1316
|
])) : J("", !0),
|
|
1317
1317
|
ue((p(), E("div", M(c.value, { role: C.value }, ie(lt, !0)), [
|
|
1318
|
-
|
|
1318
|
+
Be.value ? (p(), N(f(je), {
|
|
1319
1319
|
key: 0,
|
|
1320
1320
|
ref_key: "selectAllListboxItemsRef",
|
|
1321
1321
|
ref: r,
|
|
1322
1322
|
class: "b-listbox-multi-select__option",
|
|
1323
|
-
tabindex:
|
|
1324
|
-
"aria-selected":
|
|
1325
|
-
"aria-checked":
|
|
1326
|
-
role:
|
|
1323
|
+
tabindex: f(Re) === 0 ? 0 : -1,
|
|
1324
|
+
"aria-selected": xe.value !== "false",
|
|
1325
|
+
"aria-checked": xe.value,
|
|
1326
|
+
role: O.value,
|
|
1327
1327
|
onClick: re,
|
|
1328
1328
|
onEnterPressed: re,
|
|
1329
|
-
onSpacePressed:
|
|
1329
|
+
onSpacePressed: Ee(re, ["prevent"])
|
|
1330
1330
|
}, {
|
|
1331
|
-
default:
|
|
1332
|
-
|
|
1333
|
-
checked:
|
|
1334
|
-
indeterminate:
|
|
1331
|
+
default: _(() => [
|
|
1332
|
+
V(f(pt), {
|
|
1333
|
+
checked: f(I),
|
|
1334
|
+
indeterminate: f(ye)
|
|
1335
1335
|
}, null, 8, ["checked", "indeterminate"]),
|
|
1336
|
-
|
|
1337
|
-
default:
|
|
1338
|
-
|
|
1336
|
+
V(f(Te), { el: "span" }, {
|
|
1337
|
+
default: _(() => [
|
|
1338
|
+
le(Y(B.value), 1)
|
|
1339
1339
|
]),
|
|
1340
1340
|
_: 1
|
|
1341
1341
|
})
|
|
1342
1342
|
]),
|
|
1343
1343
|
_: 1
|
|
1344
1344
|
}, 8, ["tabindex", "aria-selected", "aria-checked", "role"])) : J("", !0),
|
|
1345
|
-
|
|
1346
|
-
|
|
1345
|
+
Be.value ? (p(), E("hr", Ul)) : J("", !0),
|
|
1346
|
+
V(f(zl), {
|
|
1347
1347
|
ref_key: "listboxItemsRef",
|
|
1348
|
-
ref:
|
|
1348
|
+
ref: b,
|
|
1349
1349
|
items: S.items,
|
|
1350
1350
|
"is-option-disabled": S.isOptionDisabled,
|
|
1351
|
-
"is-multi-level":
|
|
1351
|
+
"is-multi-level": f(D),
|
|
1352
1352
|
"static-categories": S.staticCategories,
|
|
1353
1353
|
searching: S.searching,
|
|
1354
|
-
"selected-items-list":
|
|
1355
|
-
"focused-index":
|
|
1354
|
+
"selected-items-list": T.value,
|
|
1355
|
+
"focused-index": f(Re),
|
|
1356
1356
|
"items-index": at.value,
|
|
1357
|
-
role:
|
|
1358
|
-
onToggleCheckboxSelection:
|
|
1357
|
+
role: O.value,
|
|
1358
|
+
onToggleCheckboxSelection: A[0] || (A[0] = (L) => ge("select", L)),
|
|
1359
1359
|
onSelectCategory: Ke,
|
|
1360
|
-
onUnselectCategory:
|
|
1360
|
+
onUnselectCategory: Ae,
|
|
1361
1361
|
onToggleCategoryVisibility: Ze,
|
|
1362
|
-
onSpacePressed:
|
|
1363
|
-
onTabPressed:
|
|
1364
|
-
onEnterPressed:
|
|
1362
|
+
onSpacePressed: A[1] || (A[1] = (L) => ge(f(y).SPACE, L)),
|
|
1363
|
+
onTabPressed: A[2] || (A[2] = (L) => ge(f(y).TAB, L)),
|
|
1364
|
+
onEnterPressed: A[3] || (A[3] = (L) => ge(f(y).ENTER, L))
|
|
1365
1365
|
}, ve({ _: 2 }, [
|
|
1366
|
-
|
|
1366
|
+
te(f(i), (L, U) => ({
|
|
1367
1367
|
name: U,
|
|
1368
|
-
fn:
|
|
1369
|
-
j(S.$slots, U, ce(
|
|
1368
|
+
fn: _((q) => [
|
|
1369
|
+
j(S.$slots, U, ce(Ce(q)), void 0, !0)
|
|
1370
1370
|
])
|
|
1371
1371
|
}))
|
|
1372
1372
|
]), 1032, ["items", "is-option-disabled", "is-multi-level", "static-categories", "searching", "selected-items-list", "focused-index", "items-index", "role"])
|
|
1373
1373
|
], 16, Kl)), [
|
|
1374
|
-
[
|
|
1374
|
+
[f(ze)]
|
|
1375
1375
|
])
|
|
1376
1376
|
], 512));
|
|
1377
1377
|
}
|
|
1378
|
-
}), ht = /* @__PURE__ */
|
|
1378
|
+
}), ht = /* @__PURE__ */ Q(Yl, [["__scopeId", "data-v-dc9c0984"]]), Bt = (e, l = 300) => {
|
|
1379
1379
|
let n;
|
|
1380
1380
|
return (...a) => {
|
|
1381
1381
|
n && clearTimeout(n), n = setTimeout(() => e(...a), l);
|
|
@@ -1394,12 +1394,12 @@ const zl = /* @__PURE__ */ ee(Nl, [["render", Vl], ["__scopeId", "data-v-237dfc5
|
|
|
1394
1394
|
}, Wl = 36, jl = Z({
|
|
1395
1395
|
name: "bento-listbox",
|
|
1396
1396
|
components: {
|
|
1397
|
-
BentoEmptyState:
|
|
1397
|
+
BentoEmptyState: Ht,
|
|
1398
1398
|
BentoListboxSingleSelect: Ol,
|
|
1399
1399
|
BentoListboxMultiSelect: ht,
|
|
1400
|
-
BentoTypography:
|
|
1401
|
-
BentoLoadingIndicator:
|
|
1402
|
-
BentoLoadingButton:
|
|
1400
|
+
BentoTypography: Te,
|
|
1401
|
+
BentoLoadingIndicator: jt,
|
|
1402
|
+
BentoLoadingButton: el
|
|
1403
1403
|
},
|
|
1404
1404
|
directives: { BentoKeyboardNavigationDirective: ze },
|
|
1405
1405
|
i18n: { messages: St },
|
|
@@ -1458,8 +1458,8 @@ const zl = /* @__PURE__ */ ee(Nl, [["render", Vl], ["__scopeId", "data-v-237dfc5
|
|
|
1458
1458
|
*/
|
|
1459
1459
|
lazyLoadType: {
|
|
1460
1460
|
type: String,
|
|
1461
|
-
default:
|
|
1462
|
-
validator: (e) => Object.values(
|
|
1461
|
+
default: Le.NONE,
|
|
1462
|
+
validator: (e) => Object.values(Le).includes(e)
|
|
1463
1463
|
},
|
|
1464
1464
|
/**
|
|
1465
1465
|
* Indicates the listbox is loading filtered items.
|
|
@@ -1511,90 +1511,90 @@ const zl = /* @__PURE__ */ ee(Nl, [["render", Vl], ["__scopeId", "data-v-237dfc5
|
|
|
1511
1511
|
y.TAB
|
|
1512
1512
|
],
|
|
1513
1513
|
setup(e, { emit: l, slots: n }) {
|
|
1514
|
-
const o =
|
|
1514
|
+
const o = k([]), a = oe(e, "items"), { t: s } = De({ messages: St }), t = d(() => e.lazyLoadType !== Le.AUTOMATIC), i = d(() => e.lazyLoadType === Le.AUTOMATIC), h = () => typeof e?.virtualScroll == "object" && e?.virtualScroll?.itemHeight ? e.virtualScroll.itemHeight : Wl, c = !e?.multiple && e?.virtualScroll !== !1 && e?.lazyLoadType === "none", {
|
|
1515
1515
|
containerRef: u,
|
|
1516
1516
|
containerProps: r,
|
|
1517
|
-
onScroll:
|
|
1518
|
-
list:
|
|
1519
|
-
wrapperProps:
|
|
1520
|
-
scrollToIndex:
|
|
1517
|
+
onScroll: m,
|
|
1518
|
+
list: b,
|
|
1519
|
+
wrapperProps: T,
|
|
1520
|
+
scrollToIndex: D,
|
|
1521
1521
|
startIndex: g
|
|
1522
1522
|
} = sl(a, {
|
|
1523
1523
|
itemHeight: h(),
|
|
1524
1524
|
// Disable virtual scrolling if not enabled or if lazy loading is enabled or if multi-select
|
|
1525
1525
|
disabled: !c
|
|
1526
|
-
}),
|
|
1526
|
+
}), z = d(() => c ? a.value.length : 0), C = d(
|
|
1527
1527
|
() => e.componentLoading !== void 0 || t.value ? "true" : void 0
|
|
1528
|
-
),
|
|
1528
|
+
), O = d(
|
|
1529
1529
|
() => t.value && e.loading || e.componentLoading ? "true" : "false"
|
|
1530
|
-
),
|
|
1530
|
+
), R = d(
|
|
1531
1531
|
() => t.value || e.componentLoading !== void 0 ? "polite" : void 0
|
|
1532
|
-
),
|
|
1532
|
+
), x = d(
|
|
1533
1533
|
() => ({
|
|
1534
1534
|
"aria-label": e.ariaLabel,
|
|
1535
|
-
"aria-busy":
|
|
1535
|
+
"aria-busy": O.value,
|
|
1536
1536
|
"aria-atomic": C.value,
|
|
1537
|
-
"aria-live":
|
|
1537
|
+
"aria-live": R.value
|
|
1538
1538
|
})
|
|
1539
|
-
),
|
|
1539
|
+
), $ = d(
|
|
1540
1540
|
() => e.componentLoading ? {
|
|
1541
|
-
...
|
|
1541
|
+
...x.value,
|
|
1542
1542
|
role: "alert"
|
|
1543
1543
|
} : {}
|
|
1544
|
-
),
|
|
1544
|
+
), F = (X) => (re) => {
|
|
1545
1545
|
l(X, re);
|
|
1546
|
-
},
|
|
1546
|
+
}, B = () => {
|
|
1547
1547
|
l(y.SHOW_MORE);
|
|
1548
|
-
},
|
|
1548
|
+
}, w = Bt(() => {
|
|
1549
1549
|
const X = u.value;
|
|
1550
1550
|
if (!X)
|
|
1551
1551
|
return;
|
|
1552
1552
|
const re = Math.round(X.scrollTop) + X.clientHeight >= X.scrollHeight;
|
|
1553
|
-
e.hasMoreItems && re && !e.loading &&
|
|
1554
|
-
}),
|
|
1555
|
-
i.value ?
|
|
1556
|
-
},
|
|
1557
|
-
() => e.lazyLoadType ===
|
|
1558
|
-
),
|
|
1553
|
+
e.hasMoreItems && re && !e.loading && B();
|
|
1554
|
+
}), G = () => {
|
|
1555
|
+
i.value ? w() : m();
|
|
1556
|
+
}, P = d(() => e.items?.length === 0), ne = d(
|
|
1557
|
+
() => e.lazyLoadType === Le.BUTTON && e.hasMoreItems
|
|
1558
|
+
), I = d(
|
|
1559
1559
|
() => e.loading ? ft.LOADING : ft.START
|
|
1560
|
-
),
|
|
1560
|
+
), ye = d(() => e.loading ? s("loading") : s("showMore")), Pe = d(() => ({
|
|
1561
1561
|
...e.emptyState,
|
|
1562
1562
|
variant: "condensed"
|
|
1563
|
-
})),
|
|
1564
|
-
[y.SELECT]:
|
|
1565
|
-
[y.SPACE]:
|
|
1566
|
-
[y.TAB]:
|
|
1567
|
-
[y.ENTER]:
|
|
1563
|
+
})), xe = {
|
|
1564
|
+
[y.SELECT]: F(y.SELECT),
|
|
1565
|
+
[y.SPACE]: F(y.SPACE),
|
|
1566
|
+
[y.TAB]: F(y.TAB),
|
|
1567
|
+
[y.ENTER]: F(y.ENTER)
|
|
1568
1568
|
};
|
|
1569
1569
|
return {
|
|
1570
1570
|
// Refs
|
|
1571
1571
|
listboxRef: u,
|
|
1572
1572
|
listboxItemRef: o,
|
|
1573
1573
|
// a11y
|
|
1574
|
-
ariaAttributes:
|
|
1575
|
-
listboxContainerAttributes:
|
|
1574
|
+
ariaAttributes: x,
|
|
1575
|
+
listboxContainerAttributes: $,
|
|
1576
1576
|
// Values
|
|
1577
1577
|
containerProps: r,
|
|
1578
|
-
isSearchResultEmpty:
|
|
1578
|
+
isSearchResultEmpty: P,
|
|
1579
1579
|
limitedEmptyStateProps: Pe,
|
|
1580
|
-
loadingButtonState:
|
|
1580
|
+
loadingButtonState: I,
|
|
1581
1581
|
slots: n,
|
|
1582
|
-
shouldDisplayShowMoreButton:
|
|
1583
|
-
showMoreButtonText:
|
|
1584
|
-
virtualisedItems:
|
|
1585
|
-
wrapperProps:
|
|
1582
|
+
shouldDisplayShowMoreButton: ne,
|
|
1583
|
+
showMoreButtonText: ye,
|
|
1584
|
+
virtualisedItems: b,
|
|
1585
|
+
wrapperProps: T,
|
|
1586
1586
|
// Virtual scroll
|
|
1587
|
-
totalItemCount:
|
|
1588
|
-
scrollToIndex:
|
|
1587
|
+
totalItemCount: z,
|
|
1588
|
+
scrollToIndex: D,
|
|
1589
1589
|
virtualScrollStartIndex: g,
|
|
1590
1590
|
// Enums
|
|
1591
1591
|
BentoKeyboardNavigationKeyDownEvent: H,
|
|
1592
1592
|
BentoListboxEvent: y,
|
|
1593
1593
|
// Methods
|
|
1594
|
-
onListboxContainerScroll:
|
|
1595
|
-
onOptionSelected:
|
|
1596
|
-
emitShowMore:
|
|
1597
|
-
listboxListeners:
|
|
1594
|
+
onListboxContainerScroll: G,
|
|
1595
|
+
onOptionSelected: F,
|
|
1596
|
+
emitShowMore: B,
|
|
1597
|
+
listboxListeners: xe
|
|
1598
1598
|
};
|
|
1599
1599
|
}
|
|
1600
1600
|
}), Hl = ["id"], Jl = {
|
|
@@ -1611,7 +1611,7 @@ const zl = /* @__PURE__ */ ee(Nl, [["render", Vl], ["__scopeId", "data-v-237dfc5
|
|
|
1611
1611
|
class: "b-listbox__lazy-load"
|
|
1612
1612
|
};
|
|
1613
1613
|
function eo(e, l, n, o, a, s) {
|
|
1614
|
-
const t = K("bento-loading-indicator"), i = K("bento-empty-state"), h = K("bento-typography"), c = K("bento-listbox-multi-select"), u = K("bento-listbox-single-select"), r = K("bento-loading-button"),
|
|
1614
|
+
const t = K("bento-loading-indicator"), i = K("bento-empty-state"), h = K("bento-typography"), c = K("bento-listbox-multi-select"), u = K("bento-listbox-single-select"), r = K("bento-loading-button"), m = Ot("bento-keyboard-navigation-directive");
|
|
1615
1615
|
return ue((p(), E("div", M({
|
|
1616
1616
|
id: e.id,
|
|
1617
1617
|
ref: "listboxRef",
|
|
@@ -1620,18 +1620,18 @@ function eo(e, l, n, o, a, s) {
|
|
|
1620
1620
|
}, e.listboxContainerAttributes, {
|
|
1621
1621
|
style: e.containerProps?.style,
|
|
1622
1622
|
"data-testid": "listbox-container",
|
|
1623
|
-
onScroll: l[0] || (l[0] = (...
|
|
1623
|
+
onScroll: l[0] || (l[0] = (...b) => e.onListboxContainerScroll && e.onListboxContainerScroll(...b))
|
|
1624
1624
|
}), [
|
|
1625
|
-
W("div", ce(
|
|
1625
|
+
W("div", ce(Ce(e.wrapperProps)), [
|
|
1626
1626
|
e.componentLoading ? (p(), E("div", Jl, [
|
|
1627
|
-
|
|
1627
|
+
V(t)
|
|
1628
1628
|
])) : e.isSearchResultEmpty ? (p(), E("div", Xl, [
|
|
1629
1629
|
e.emptyState ? (p(), N(i, ce(M({ key: 0 }, e.limitedEmptyStateProps)), null, 16)) : (p(), N(h, {
|
|
1630
1630
|
key: 1,
|
|
1631
1631
|
el: "span"
|
|
1632
1632
|
}, {
|
|
1633
|
-
default:
|
|
1634
|
-
|
|
1633
|
+
default: _(() => [
|
|
1634
|
+
le(Y(e.noResultsMessage), 1)
|
|
1635
1635
|
]),
|
|
1636
1636
|
_: 1
|
|
1637
1637
|
}))
|
|
@@ -1648,10 +1648,10 @@ function eo(e, l, n, o, a, s) {
|
|
|
1648
1648
|
searching: e.searching,
|
|
1649
1649
|
"is-option-disabled": e.isOptionDisabled
|
|
1650
1650
|
}, ie(e.listboxListeners)), ve({ _: 2 }, [
|
|
1651
|
-
|
|
1652
|
-
name:
|
|
1653
|
-
fn:
|
|
1654
|
-
j(e.$slots,
|
|
1651
|
+
te(e.slots, (b, T) => ({
|
|
1652
|
+
name: T,
|
|
1653
|
+
fn: _((D) => [
|
|
1654
|
+
j(e.$slots, T, ce(Ce(D)), void 0, !0)
|
|
1655
1655
|
])
|
|
1656
1656
|
}))
|
|
1657
1657
|
]), 1040, ["has-more-items", "items", "lazy-load-type", "static-categories", "selected-values", "searching", "is-option-disabled"])) : (p(), N(u, M({
|
|
@@ -1666,34 +1666,34 @@ function eo(e, l, n, o, a, s) {
|
|
|
1666
1666
|
"static-categories": e.staticCategories,
|
|
1667
1667
|
"is-option-disabled": e.isOptionDisabled
|
|
1668
1668
|
}, ie(e.listboxListeners)), ve({ _: 2 }, [
|
|
1669
|
-
|
|
1670
|
-
name:
|
|
1671
|
-
fn:
|
|
1672
|
-
j(e.$slots,
|
|
1669
|
+
te(e.slots, (b, T) => ({
|
|
1670
|
+
name: T,
|
|
1671
|
+
fn: _((D) => [
|
|
1672
|
+
j(e.$slots, T, ce(Ce(D)), void 0, !0)
|
|
1673
1673
|
])
|
|
1674
1674
|
}))
|
|
1675
1675
|
]), 1040, ["items", "total-item-count", "scroll-to-index", "virtual-scroll-start-index", "selected-value", "static-categories", "is-option-disabled"])),
|
|
1676
1676
|
e.shouldDisplayShowMoreButton ? (p(), E("div", Zl, [
|
|
1677
|
-
|
|
1677
|
+
V(r, {
|
|
1678
1678
|
state: e.loadingButtonState,
|
|
1679
1679
|
variant: "secondary",
|
|
1680
1680
|
onClickCapture: e.emitShowMore
|
|
1681
1681
|
}, {
|
|
1682
|
-
default:
|
|
1683
|
-
|
|
1682
|
+
default: _(() => [
|
|
1683
|
+
le(Y(e.showMoreButtonText), 1)
|
|
1684
1684
|
]),
|
|
1685
1685
|
_: 1
|
|
1686
1686
|
}, 8, ["state", "onClickCapture"])
|
|
1687
1687
|
])) : e.loading ? (p(), E("div", Ql, [
|
|
1688
|
-
|
|
1688
|
+
V(t)
|
|
1689
1689
|
])) : J("", !0)
|
|
1690
1690
|
], 64))
|
|
1691
1691
|
], 16)
|
|
1692
1692
|
], 16, Hl)), [
|
|
1693
|
-
[
|
|
1693
|
+
[m]
|
|
1694
1694
|
]);
|
|
1695
1695
|
}
|
|
1696
|
-
const it = /* @__PURE__ */
|
|
1696
|
+
const it = /* @__PURE__ */ Q(jl, [["render", eo], ["__scopeId", "data-v-7026ea79"]]), rt = (e, l) => {
|
|
1697
1697
|
for (const n of e) {
|
|
1698
1698
|
if (n.value === l)
|
|
1699
1699
|
return n;
|
|
@@ -1705,16 +1705,16 @@ const it = /* @__PURE__ */ ee(jl, [["render", eo], ["__scopeId", "data-v-7026ea7
|
|
|
1705
1705
|
}
|
|
1706
1706
|
return null;
|
|
1707
1707
|
}, to = (e) => typeof e == "object" && e !== null && "value" in e && "label" in e, lo = (e, l, n, o) => {
|
|
1708
|
-
const a =
|
|
1708
|
+
const a = k([]), s = k(), t = (u) => {
|
|
1709
1709
|
n.value ? s.value = u.map(({ value: r }) => r) : s.value = u.length > 0 ? u[0].value : null;
|
|
1710
1710
|
}, i = (u) => {
|
|
1711
|
-
n.value ? s.value = u.map(({ value: r, label:
|
|
1711
|
+
n.value ? s.value = u.map(({ value: r, label: m }) => ({ value: r, label: m })) : s.value = u.length > 0 ? { value: u[0].value, label: u[0].label } : null;
|
|
1712
1712
|
}, h = (u) => {
|
|
1713
1713
|
a.value = u, o?.value ? i(u) : t(u);
|
|
1714
1714
|
}, c = () => {
|
|
1715
1715
|
a.value = [], s.value = null;
|
|
1716
1716
|
};
|
|
1717
|
-
return
|
|
1717
|
+
return Oe(
|
|
1718
1718
|
() => l.value,
|
|
1719
1719
|
() => {
|
|
1720
1720
|
if (!l.value && l.value !== 0) {
|
|
@@ -1723,20 +1723,20 @@ const it = /* @__PURE__ */ ee(jl, [["render", eo], ["__scopeId", "data-v-7026ea7
|
|
|
1723
1723
|
}
|
|
1724
1724
|
const u = !Array.isArray(l.value), r = [...a.value];
|
|
1725
1725
|
c();
|
|
1726
|
-
const
|
|
1727
|
-
if (to(
|
|
1728
|
-
a.value.push(
|
|
1726
|
+
const m = (b) => {
|
|
1727
|
+
if (to(b))
|
|
1728
|
+
a.value.push(b);
|
|
1729
1729
|
else {
|
|
1730
|
-
let
|
|
1731
|
-
|
|
1730
|
+
let T = rt(e.value, b);
|
|
1731
|
+
T || (T = rt(r, b)), T || (T = { value: b, label: b.toString() }), a.value.push(T);
|
|
1732
1732
|
}
|
|
1733
1733
|
};
|
|
1734
1734
|
if (u) {
|
|
1735
|
-
const
|
|
1736
|
-
|
|
1735
|
+
const b = l.value;
|
|
1736
|
+
m(b), o?.value ? i(a.value) : t(a.value);
|
|
1737
1737
|
return;
|
|
1738
1738
|
}
|
|
1739
|
-
l.value.forEach(
|
|
1739
|
+
l.value.forEach(m), o?.value ? i(a.value) : t(a.value);
|
|
1740
1740
|
},
|
|
1741
1741
|
{ immediate: !0 }
|
|
1742
1742
|
), {
|
|
@@ -1761,8 +1761,8 @@ const bt = {
|
|
|
1761
1761
|
"pt-BR": { apply: "Aplicar", cancel: "Cancelar", noOptionsMatchThisSearch: "Nenhuma opção corresponde a esta busca" },
|
|
1762
1762
|
"zh-CN": { apply: "应用", cancel: "取消", noOptionsMatchThisSearch: "没有符合此搜索条件的选项" }
|
|
1763
1763
|
}, oo = (e, l, n, o) => {
|
|
1764
|
-
const a =
|
|
1765
|
-
|
|
1764
|
+
const a = k(e.value), { t: s } = De({ messages: bt });
|
|
1765
|
+
Oe(e, () => {
|
|
1766
1766
|
a.value = e.value;
|
|
1767
1767
|
});
|
|
1768
1768
|
const t = d(
|
|
@@ -1785,30 +1785,30 @@ const bt = {
|
|
|
1785
1785
|
}
|
|
1786
1786
|
]), r = (C) => {
|
|
1787
1787
|
a.value = C, l.value || o(y.SELECT, C);
|
|
1788
|
-
},
|
|
1788
|
+
}, m = (C) => {
|
|
1789
1789
|
r(C), o(y.TAB);
|
|
1790
|
-
},
|
|
1790
|
+
}, b = (C) => {
|
|
1791
1791
|
r(C), o(y.ENTER);
|
|
1792
|
-
},
|
|
1792
|
+
}, T = (C) => {
|
|
1793
1793
|
r(C), o(y.SPACE);
|
|
1794
|
-
},
|
|
1794
|
+
}, D = () => {
|
|
1795
1795
|
h(), o(y.ESCAPE);
|
|
1796
1796
|
}, g = () => {
|
|
1797
1797
|
o(y.SHOW_MORE);
|
|
1798
|
-
},
|
|
1798
|
+
}, z = {
|
|
1799
1799
|
[y.SELECT]: r,
|
|
1800
1800
|
[y.SHOW_MORE]: g,
|
|
1801
|
-
[y.TAB]:
|
|
1802
|
-
[y.SPACE]:
|
|
1803
|
-
[y.ENTER]:
|
|
1801
|
+
[y.TAB]: m,
|
|
1802
|
+
[y.SPACE]: T,
|
|
1803
|
+
[y.ENTER]: b
|
|
1804
1804
|
};
|
|
1805
1805
|
return {
|
|
1806
1806
|
// Values
|
|
1807
1807
|
actions: u,
|
|
1808
1808
|
internalSelectedValue: a,
|
|
1809
1809
|
// Methods
|
|
1810
|
-
listeners:
|
|
1811
|
-
onEscapeKey:
|
|
1810
|
+
listeners: z,
|
|
1811
|
+
onEscapeKey: D,
|
|
1812
1812
|
onOutsideDropdownClick: c
|
|
1813
1813
|
};
|
|
1814
1814
|
}, ao = Z({
|
|
@@ -1874,8 +1874,8 @@ const bt = {
|
|
|
1874
1874
|
*/
|
|
1875
1875
|
lazyLoadType: {
|
|
1876
1876
|
type: String,
|
|
1877
|
-
default:
|
|
1878
|
-
validator: (e) => Object.values(
|
|
1877
|
+
default: Le.AUTOMATIC,
|
|
1878
|
+
validator: (e) => Object.values(Le).includes(e)
|
|
1879
1879
|
},
|
|
1880
1880
|
/**
|
|
1881
1881
|
* Indicates if new options are lazy loading.
|
|
@@ -1925,27 +1925,27 @@ const bt = {
|
|
|
1925
1925
|
}
|
|
1926
1926
|
},
|
|
1927
1927
|
setup(e, { expose: l, emit: n }) {
|
|
1928
|
-
const o = Ge(), a = n, s = e, { selectedValue: t, multiple: i } = Lt(s), h =
|
|
1928
|
+
const o = Ge(), a = n, s = e, { selectedValue: t, multiple: i } = Lt(s), h = k(null), { t: c } = De({ messages: bt }), u = d(() => s.open && !s.disabled), r = d(() => c("noOptionsMatchThisSearch")), m = d(() => ({
|
|
1929
1929
|
"b-dropdown-options-container--single": !s?.multiple
|
|
1930
|
-
})),
|
|
1930
|
+
})), b = d(() => ({
|
|
1931
1931
|
"b-dropdown-options-container__listbox--single": !s?.multiple
|
|
1932
|
-
})), { actions:
|
|
1933
|
-
const
|
|
1932
|
+
})), { actions: T, internalSelectedValue: D, listeners: g, onEscapeKey: z, onOutsideDropdownClick: C } = oo(t, i, u, a), O = d(() => s?.multiple ? tl : mt), R = d(() => {
|
|
1933
|
+
const x = {
|
|
1934
1934
|
"min-width": `${s?.targetElement?.clientWidth}px`,
|
|
1935
1935
|
"max-width": "min(500px, 95%)"
|
|
1936
1936
|
};
|
|
1937
1937
|
return s?.multiple ? {
|
|
1938
1938
|
actionsLayout: "space-between",
|
|
1939
1939
|
ariaLabel: s.ariaLabel,
|
|
1940
|
-
actions:
|
|
1940
|
+
actions: T.value,
|
|
1941
1941
|
divider: !0,
|
|
1942
1942
|
fallbackPosition: ["top-start"],
|
|
1943
|
-
id:
|
|
1943
|
+
id: Ie(`dropdown-options-${s.id}`),
|
|
1944
1944
|
open: s.open,
|
|
1945
1945
|
position: "bottom-start",
|
|
1946
1946
|
style: {
|
|
1947
1947
|
width: "auto",
|
|
1948
|
-
...
|
|
1948
|
+
...x
|
|
1949
1949
|
},
|
|
1950
1950
|
targetElement: s.targetElement
|
|
1951
1951
|
} : {
|
|
@@ -1954,37 +1954,41 @@ const bt = {
|
|
|
1954
1954
|
position: "bottom-start",
|
|
1955
1955
|
style: {
|
|
1956
1956
|
display: u.value ? "block" : "none",
|
|
1957
|
-
...
|
|
1957
|
+
...x
|
|
1958
1958
|
},
|
|
1959
1959
|
targetElement: s.targetElement
|
|
1960
1960
|
};
|
|
1961
1961
|
});
|
|
1962
1962
|
return l({
|
|
1963
1963
|
onOutsideDropdownClick: C
|
|
1964
|
-
}), (
|
|
1964
|
+
}), (x, $) => u.value ? (p(), N(It(O.value), M({
|
|
1965
1965
|
key: 0,
|
|
1966
|
-
class: ["b-dropdown-options-container",
|
|
1967
|
-
},
|
|
1968
|
-
default:
|
|
1966
|
+
class: ["b-dropdown-options-container", m.value]
|
|
1967
|
+
}, R.value), {
|
|
1968
|
+
default: _(() => [
|
|
1969
1969
|
W("div", {
|
|
1970
|
-
onKeydown:
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
[
|
|
1974
|
-
|
|
1970
|
+
onKeydown: [
|
|
1971
|
+
$[0] || ($[0] = Ee(() => {
|
|
1972
|
+
}, ["stop"])),
|
|
1973
|
+
$[1] || ($[1] = me(
|
|
1974
|
+
//@ts-ignore
|
|
1975
|
+
(...F) => f(z) && f(z)(...F),
|
|
1976
|
+
["esc"]
|
|
1977
|
+
))
|
|
1978
|
+
]
|
|
1975
1979
|
}, [
|
|
1976
|
-
|
|
1980
|
+
V(f(it), M({
|
|
1977
1981
|
id: e.id,
|
|
1978
1982
|
ref_key: "dropdownOptionsListboxRef",
|
|
1979
1983
|
ref: h,
|
|
1980
1984
|
"aria-label": e.ariaLabel,
|
|
1981
|
-
class: ["b-dropdown-options-container__listbox",
|
|
1985
|
+
class: ["b-dropdown-options-container__listbox", b.value],
|
|
1982
1986
|
"component-loading": e.componentLoading,
|
|
1983
1987
|
"empty-state": e.emptyState,
|
|
1984
1988
|
"is-option-disabled": e.isOptionDisabled,
|
|
1985
1989
|
items: e.items,
|
|
1986
|
-
"selected-value":
|
|
1987
|
-
multiple:
|
|
1990
|
+
"selected-value": f(D),
|
|
1991
|
+
multiple: f(i),
|
|
1988
1992
|
"static-categories": e.staticCategories,
|
|
1989
1993
|
"no-results-message": r.value,
|
|
1990
1994
|
searching: e.searching,
|
|
@@ -1992,11 +1996,11 @@ const bt = {
|
|
|
1992
1996
|
"lazy-load-type": e.lazyLoadType,
|
|
1993
1997
|
"has-more-items": e.hasMoreItems,
|
|
1994
1998
|
"virtual-scroll": e.virtualScroll
|
|
1995
|
-
}, ie(
|
|
1996
|
-
|
|
1997
|
-
name:
|
|
1998
|
-
fn:
|
|
1999
|
-
j(
|
|
1999
|
+
}, ie(f(g))), ve({ _: 2 }, [
|
|
2000
|
+
te(f(o), (F, B) => ({
|
|
2001
|
+
name: B,
|
|
2002
|
+
fn: _((w) => [
|
|
2003
|
+
j(x.$slots, B, ce(Ce(w)), void 0, !0)
|
|
2000
2004
|
])
|
|
2001
2005
|
}))
|
|
2002
2006
|
]), 1040, ["id", "aria-label", "class", "component-loading", "empty-state", "is-option-disabled", "items", "selected-value", "multiple", "static-categories", "no-results-message", "searching", "loading", "lazy-load-type", "has-more-items", "virtual-scroll"])
|
|
@@ -2005,8 +2009,8 @@ const bt = {
|
|
|
2005
2009
|
_: 3
|
|
2006
2010
|
}, 16, ["class"])) : J("", !0);
|
|
2007
2011
|
}
|
|
2008
|
-
}), no = /* @__PURE__ */
|
|
2009
|
-
var be = /* @__PURE__ */ ((e) => (e.DISABLED = "disabled", e.READONLY = "readonly", e.HAS_ITEMS = "has-items", e.OPENED = "opened", e.ERROR = "error", e))(be || {}),
|
|
2012
|
+
}), no = /* @__PURE__ */ Q(so, [["__scopeId", "data-v-1768de6e"]]);
|
|
2013
|
+
var be = /* @__PURE__ */ ((e) => (e.DISABLED = "disabled", e.READONLY = "readonly", e.HAS_ITEMS = "has-items", e.OPENED = "opened", e.ERROR = "error", e))(be || {}), ee = /* @__PURE__ */ ((e) => (e.OPEN = "dropdown-base-open", e.KEYDOWN = "dropdown-base-keydown", e.CLOSE = "dropdown-base-close", e.INPUT = "dropdown-base-input", e.CLEAR = "dropdown-base-clear", e))(ee || {});
|
|
2010
2014
|
const io = /* @__PURE__ */ Symbol("dropdown small size injection key"), Rt = /* @__PURE__ */ Symbol("dropdown underline style injection key"), Mt = {
|
|
2011
2015
|
"de-DE": { clearSearch: "Suche löschen" },
|
|
2012
2016
|
"en-GB": { clearSearch: "Clear search" },
|
|
@@ -2118,16 +2122,16 @@ const io = /* @__PURE__ */ Symbol("dropdown small size injection key"), Rt = /*
|
|
|
2118
2122
|
}
|
|
2119
2123
|
},
|
|
2120
2124
|
setup(e, { expose: l, emit: n }) {
|
|
2121
|
-
const { t: o } =
|
|
2125
|
+
const { t: o } = De({ messages: Mt }), a = dt(), s = Ge(), t = Tt(s), i = e, h = n, c = k(null), u = Ie("textbox"), r = ct(Rt, !1), m = d(() => ({
|
|
2122
2126
|
[`b-dropdown-base-textbox--${be.DISABLED}`]: i.disabled,
|
|
2123
2127
|
[`b-dropdown-base-textbox--${be.READONLY}`]: i.readonly,
|
|
2124
2128
|
[`b-dropdown-base-textbox--${be.HAS_ITEMS}`]: !!i.additionalItemsSelected,
|
|
2125
2129
|
"b-dropdown-base-textbox--underline": r
|
|
2126
|
-
})),
|
|
2130
|
+
})), b = d(
|
|
2127
2131
|
() => C.value && a["aria-required"] ? "true" : null
|
|
2128
|
-
),
|
|
2132
|
+
), T = d(() => ({
|
|
2129
2133
|
"b-dropdown-base-textbox__input--dynamic-filtering": i.dynamicFiltering
|
|
2130
|
-
})),
|
|
2134
|
+
})), D = d(() => i.dynamicFiltering && !!i.value && i.open), g = d(
|
|
2131
2135
|
() => ({
|
|
2132
2136
|
"aria-haspopup": "listbox",
|
|
2133
2137
|
"aria-controls": i.ariaControls,
|
|
@@ -2139,47 +2143,47 @@ const io = /* @__PURE__ */ Symbol("dropdown small size injection key"), Rt = /*
|
|
|
2139
2143
|
"aria-disabled": i.disabled ? !0 : null,
|
|
2140
2144
|
"aria-required": a["aria-required"]
|
|
2141
2145
|
})
|
|
2142
|
-
),
|
|
2146
|
+
), z = d(
|
|
2143
2147
|
() => i.multiple ? i.selectedValueItem : []
|
|
2144
|
-
), C = d(() => i.dynamicFiltering && (i.open || i.alwaysComboboxIsInput)),
|
|
2145
|
-
() => i.multiple && i.selectedValueItem &&
|
|
2148
|
+
), C = d(() => i.dynamicFiltering && (i.open || i.alwaysComboboxIsInput)), O = d(() => i.selectedValueItem && !i.multiple), R = d(
|
|
2149
|
+
() => i.multiple && i.selectedValueItem && z.value.length > 0 && i.showSlotContentInMultiple
|
|
2146
2150
|
);
|
|
2147
|
-
|
|
2151
|
+
Oe(
|
|
2148
2152
|
() => C.value,
|
|
2149
2153
|
() => {
|
|
2150
|
-
C.value && !i.alwaysComboboxIsInput &&
|
|
2154
|
+
C.value && !i.alwaysComboboxIsInput && se(() => {
|
|
2151
2155
|
c.value.focus();
|
|
2152
2156
|
});
|
|
2153
2157
|
}
|
|
2154
2158
|
);
|
|
2155
|
-
const
|
|
2156
|
-
!i.disabled && !i.readonly && (h(
|
|
2157
|
-
},
|
|
2158
|
-
i.open && (c.value.focus(), h(
|
|
2159
|
-
},
|
|
2160
|
-
h(
|
|
2161
|
-
},
|
|
2162
|
-
!i.readonly && !i.disabled ? h(
|
|
2159
|
+
const x = async () => {
|
|
2160
|
+
!i.disabled && !i.readonly && (h(ee.OPEN), await se(), c.value.focus());
|
|
2161
|
+
}, $ = (P) => {
|
|
2162
|
+
i.open && (P && _e(P), c.value.focus(), h(ee.CLOSE));
|
|
2163
|
+
}, F = (P) => i.open && P.target.tagName === "INPUT" ? null : i.open ? $() : x(), B = () => {
|
|
2164
|
+
h(ee.CLEAR), h(ee.INPUT, ""), c.value.focus();
|
|
2165
|
+
}, w = (P) => {
|
|
2166
|
+
!i.readonly && !i.disabled ? h(ee.INPUT, P.target.value) : (P.preventDefault(), P.stopPropagation());
|
|
2163
2167
|
};
|
|
2164
2168
|
return l({
|
|
2165
2169
|
focus: () => {
|
|
2166
2170
|
c.value.focus();
|
|
2167
2171
|
}
|
|
2168
|
-
}), (
|
|
2169
|
-
class: fe(
|
|
2172
|
+
}), (P, ne) => (p(), E("div", {
|
|
2173
|
+
class: fe(P.$attrs.class),
|
|
2170
2174
|
"data-testid": "textbox-wrapper",
|
|
2171
|
-
onClick:
|
|
2172
|
-
onKeydown: me(
|
|
2175
|
+
onClick: F,
|
|
2176
|
+
onKeydown: me($, ["escape"])
|
|
2173
2177
|
}, [
|
|
2174
|
-
|
|
2175
|
-
class: fe(["b-dropdown-base-textbox",
|
|
2176
|
-
variant:
|
|
2178
|
+
V(f(Te), {
|
|
2179
|
+
class: fe(["b-dropdown-base-textbox", m.value]),
|
|
2180
|
+
variant: f(r) ? "title" : "body",
|
|
2177
2181
|
el: "div",
|
|
2178
2182
|
"data-testid": "base-textbox"
|
|
2179
2183
|
}, {
|
|
2180
|
-
default:
|
|
2184
|
+
default: _(() => [
|
|
2181
2185
|
C.value ? (p(), E("input", M({ key: 0 }, g.value, {
|
|
2182
|
-
id:
|
|
2186
|
+
id: f(u),
|
|
2183
2187
|
ref_key: "textbox",
|
|
2184
2188
|
ref: c,
|
|
2185
2189
|
class: "b-dropdown-base-textbox__input",
|
|
@@ -2190,60 +2194,60 @@ const io = /* @__PURE__ */ Symbol("dropdown small size injection key"), Rt = /*
|
|
|
2190
2194
|
value: e.open ? e.value : e.displayValue,
|
|
2191
2195
|
disabled: e.disabled ? !0 : null,
|
|
2192
2196
|
readonly: e.readonly,
|
|
2193
|
-
required:
|
|
2197
|
+
required: b.value,
|
|
2194
2198
|
onKeydown: [
|
|
2195
|
-
|
|
2196
|
-
me(
|
|
2199
|
+
ne[0] || (ne[0] = (I) => P.$emit(f(ee).KEYDOWN, I)),
|
|
2200
|
+
me(F, ["enter"])
|
|
2197
2201
|
],
|
|
2198
|
-
onInput:
|
|
2202
|
+
onInput: w
|
|
2199
2203
|
}), null, 16, ro)) : (p(), E("div", M({
|
|
2200
2204
|
key: 1,
|
|
2201
|
-
id:
|
|
2205
|
+
id: f(u)
|
|
2202
2206
|
}, g.value, {
|
|
2203
2207
|
ref_key: "textbox",
|
|
2204
2208
|
ref: c,
|
|
2205
|
-
class: ["b-dropdown-base-textbox__input",
|
|
2209
|
+
class: ["b-dropdown-base-textbox__input", T.value],
|
|
2206
2210
|
"aria-readonly": e.readonly ? "true" : null,
|
|
2207
2211
|
role: "combobox",
|
|
2208
2212
|
tabindex: e.disabled ? -1 : 0
|
|
2209
2213
|
}), [
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2214
|
+
O.value ? (p(), E(pe, { key: 0 }, [
|
|
2215
|
+
f(t)("display-value") ? j(P.$slots, "display-value", ce(M({ key: 0 }, e.selectedValueItem)), void 0, !0) : j(P.$slots, "default", ce(M({ key: 1 }, e.selectedValueItem)), () => [
|
|
2216
|
+
le(Y(e.displayValue), 1)
|
|
2213
2217
|
], !0)
|
|
2214
|
-
], 64)) :
|
|
2215
|
-
(p(!0), E(pe, null,
|
|
2216
|
-
key:
|
|
2218
|
+
], 64)) : R.value ? (p(), E("div", uo, [
|
|
2219
|
+
(p(!0), E(pe, null, te(z.value, (I) => (p(), E("div", {
|
|
2220
|
+
key: I.value
|
|
2217
2221
|
}, [
|
|
2218
2222
|
W("div", po, [
|
|
2219
|
-
j(
|
|
2220
|
-
|
|
2223
|
+
j(P.$slots, "default", M({ ref_for: !0 }, I), () => [
|
|
2224
|
+
le(Y(e.displayValue), 1)
|
|
2221
2225
|
], !0)
|
|
2222
2226
|
])
|
|
2223
2227
|
]))), 128))
|
|
2224
2228
|
])) : (p(), E(pe, { key: 2 }, [
|
|
2225
|
-
|
|
2229
|
+
le(Y(e.displayValue), 1)
|
|
2226
2230
|
], 64))
|
|
2227
2231
|
], 16, co)),
|
|
2228
2232
|
e.additionalItemsSelected ? (p(), E("span", bo, Y(e.additionalItemsSelected), 1)) : J("", !0),
|
|
2229
|
-
|
|
2230
|
-
j(
|
|
2233
|
+
f(t)("icon") && !D.value ? (p(), E("span", fo, [
|
|
2234
|
+
j(P.$slots, "icon", {}, void 0, !0)
|
|
2231
2235
|
])) : J("", !0),
|
|
2232
|
-
|
|
2236
|
+
D.value ? (p(), E("span", {
|
|
2233
2237
|
key: 4,
|
|
2234
2238
|
class: "b-dropdown-base-textbox__clear-search",
|
|
2235
2239
|
tabindex: e.disabled ? -1 : 0,
|
|
2236
2240
|
"data-testid": "clear-search-button",
|
|
2237
|
-
onClick:
|
|
2238
|
-
onKeydown: me(
|
|
2239
|
-
onKeyup: me(
|
|
2241
|
+
onClick: Ee(B, ["stop"]),
|
|
2242
|
+
onKeydown: me(Ee(B, ["stop"]), ["enter"]),
|
|
2243
|
+
onKeyup: me(B, ["space"])
|
|
2240
2244
|
}, [
|
|
2241
|
-
e.size ===
|
|
2245
|
+
e.size === f(Me).SMALL ? (p(), N(f(Kt), {
|
|
2242
2246
|
key: 0,
|
|
2243
|
-
"svg-title":
|
|
2244
|
-
}, null, 8, ["svg-title"])) : (p(), N(
|
|
2247
|
+
"svg-title": f(o)("clearSearch")
|
|
2248
|
+
}, null, 8, ["svg-title"])) : (p(), N(f(Gt), {
|
|
2245
2249
|
key: 1,
|
|
2246
|
-
"svg-title":
|
|
2250
|
+
"svg-title": f(o)("clearSearch")
|
|
2247
2251
|
}, null, 8, ["svg-title"]))
|
|
2248
2252
|
], 40, mo)) : J("", !0)
|
|
2249
2253
|
]),
|
|
@@ -2251,7 +2255,7 @@ const io = /* @__PURE__ */ Symbol("dropdown small size injection key"), Rt = /*
|
|
|
2251
2255
|
}, 8, ["class", "variant"])
|
|
2252
2256
|
], 34));
|
|
2253
2257
|
}
|
|
2254
|
-
}), Nt = /* @__PURE__ */
|
|
2258
|
+
}), Nt = /* @__PURE__ */ Q(yo, [["__scopeId", "data-v-648ab3b5"]]), go = { class: "b-dropdown-default-textbox__chevron" }, ho = Z({
|
|
2255
2259
|
name: "dropdown-default-textbox",
|
|
2256
2260
|
inheritAttrs: !1
|
|
2257
2261
|
}), So = /* @__PURE__ */ Z({
|
|
@@ -2343,7 +2347,7 @@ const io = /* @__PURE__ */ Symbol("dropdown small size injection key"), Rt = /*
|
|
|
2343
2347
|
},
|
|
2344
2348
|
emits: ["clear", "close", "input", "keydown", "open"],
|
|
2345
2349
|
setup(e, { expose: l, emit: n }) {
|
|
2346
|
-
const o = n, a = Ge(), s = e, t =
|
|
2350
|
+
const o = n, a = Ge(), s = e, t = k(null), i = d(() => ({
|
|
2347
2351
|
[`b-dropdown-default-textbox--${be.ERROR}`]: !s.disabled && !s.readonly && s.isInvalid,
|
|
2348
2352
|
[`b-dropdown-default-textbox--${be.DISABLED}`]: s.disabled,
|
|
2349
2353
|
[`b-dropdown-default-textbox--${be.READONLY}`]: s.readonly,
|
|
@@ -2354,55 +2358,55 @@ const io = /* @__PURE__ */ Symbol("dropdown small size injection key"), Rt = /*
|
|
|
2354
2358
|
}, u = (g) => {
|
|
2355
2359
|
o("keydown", g);
|
|
2356
2360
|
}, r = (g) => {
|
|
2357
|
-
|
|
2358
|
-
},
|
|
2359
|
-
|
|
2360
|
-
},
|
|
2361
|
-
|
|
2362
|
-
},
|
|
2363
|
-
[
|
|
2364
|
-
[
|
|
2365
|
-
[
|
|
2366
|
-
[
|
|
2367
|
-
[
|
|
2361
|
+
_e(g), o("open");
|
|
2362
|
+
}, m = (g) => {
|
|
2363
|
+
_e(g), o("close");
|
|
2364
|
+
}, b = (g) => {
|
|
2365
|
+
_e(g), o("clear");
|
|
2366
|
+
}, T = {
|
|
2367
|
+
[ee.INPUT]: c,
|
|
2368
|
+
[ee.OPEN]: r,
|
|
2369
|
+
[ee.CLOSE]: m,
|
|
2370
|
+
[ee.CLEAR]: b,
|
|
2371
|
+
[ee.KEYDOWN]: u
|
|
2368
2372
|
};
|
|
2369
2373
|
return l({
|
|
2370
2374
|
focus: () => {
|
|
2371
2375
|
t.value.focus();
|
|
2372
2376
|
}
|
|
2373
|
-
}), (g,
|
|
2377
|
+
}), (g, z) => (p(), E("div", {
|
|
2374
2378
|
class: fe(["b-dropdown-default-textbox", i.value]),
|
|
2375
2379
|
"data-testid": "default-textbox"
|
|
2376
2380
|
}, [
|
|
2377
|
-
|
|
2381
|
+
V(Nt, M({
|
|
2378
2382
|
ref_key: "baseTextbox",
|
|
2379
2383
|
ref: t
|
|
2380
2384
|
}, { ...g.$attrs, ...g.$props }, {
|
|
2381
2385
|
class: "b-dropdown-default-textbox__textbox",
|
|
2382
2386
|
value: e.value
|
|
2383
|
-
}, ie(
|
|
2384
|
-
icon:
|
|
2387
|
+
}, ie(T)), ve({
|
|
2388
|
+
icon: _(() => [
|
|
2385
2389
|
W("div", go, [
|
|
2386
|
-
ue(
|
|
2390
|
+
ue(V(f($t), { "svg-title": "opened" }, null, 512), [
|
|
2387
2391
|
[Ne, h.value]
|
|
2388
2392
|
]),
|
|
2389
|
-
ue(
|
|
2393
|
+
ue(V(f(At), { "svg-title": "closed" }, null, 512), [
|
|
2390
2394
|
[Ne, !h.value]
|
|
2391
2395
|
])
|
|
2392
2396
|
])
|
|
2393
2397
|
]),
|
|
2394
2398
|
_: 2
|
|
2395
2399
|
}, [
|
|
2396
|
-
|
|
2397
|
-
name:
|
|
2398
|
-
fn:
|
|
2399
|
-
j(g.$slots,
|
|
2400
|
+
te(f(a), (C, O) => ({
|
|
2401
|
+
name: O,
|
|
2402
|
+
fn: _((R) => [
|
|
2403
|
+
j(g.$slots, O, ce(Ce(R ?? {})), void 0, !0)
|
|
2400
2404
|
])
|
|
2401
2405
|
}))
|
|
2402
2406
|
]), 1040, ["value"])
|
|
2403
2407
|
], 2));
|
|
2404
2408
|
}
|
|
2405
|
-
}), Co = /* @__PURE__ */
|
|
2409
|
+
}), Co = /* @__PURE__ */ Q(So, [["__scopeId", "data-v-c3e3ce21"]]);
|
|
2406
2410
|
let Ct = 0;
|
|
2407
2411
|
const Eo = {
|
|
2408
2412
|
beforeCreate() {
|
|
@@ -2424,7 +2428,7 @@ function Lo(e, l, n, o, a, s) {
|
|
|
2424
2428
|
}, null, -1))
|
|
2425
2429
|
], 16);
|
|
2426
2430
|
}
|
|
2427
|
-
const Io = /* @__PURE__ */
|
|
2431
|
+
const Io = /* @__PURE__ */ Q(Eo, [["render", Lo]]);
|
|
2428
2432
|
let Et = 0;
|
|
2429
2433
|
const To = {
|
|
2430
2434
|
beforeCreate() {
|
|
@@ -2446,7 +2450,7 @@ function $o(e, l, n, o, a, s) {
|
|
|
2446
2450
|
}, null, -1))
|
|
2447
2451
|
], 16);
|
|
2448
2452
|
}
|
|
2449
|
-
const wo = /* @__PURE__ */
|
|
2453
|
+
const wo = /* @__PURE__ */ Q(To, [["render", $o]]), ko = { class: "b-dropdown-small-textbox__chevron" }, _o = Z({
|
|
2450
2454
|
name: "dropdown-small-textbox",
|
|
2451
2455
|
inheritAttrs: !1
|
|
2452
2456
|
}), Do = /* @__PURE__ */ Z({
|
|
@@ -2507,7 +2511,7 @@ const wo = /* @__PURE__ */ ee(To, [["render", $o]]), ko = { class: "b-dropdown-s
|
|
|
2507
2511
|
},
|
|
2508
2512
|
emits: ["clear", "close", "input", "keydown", "open"],
|
|
2509
2513
|
setup(e, { expose: l, emit: n }) {
|
|
2510
|
-
const o = n, a = e, s =
|
|
2514
|
+
const o = n, a = e, s = k(null), t = ct(Rt, !1), i = d(() => ({
|
|
2511
2515
|
[`b-dropdown-small-textbox--${be.DISABLED}`]: a.disabled,
|
|
2512
2516
|
[`b-dropdown-small-textbox--${be.READONLY}`]: a.readonly,
|
|
2513
2517
|
[`b-dropdown-small-textbox--${be.OPENED}`]: a.open,
|
|
@@ -2517,38 +2521,38 @@ const wo = /* @__PURE__ */ ee(To, [["render", $o]]), ko = { class: "b-dropdown-s
|
|
|
2517
2521
|
}, u = (g) => {
|
|
2518
2522
|
o("keydown", g);
|
|
2519
2523
|
}, r = (g) => {
|
|
2520
|
-
|
|
2521
|
-
},
|
|
2522
|
-
|
|
2523
|
-
},
|
|
2524
|
-
|
|
2525
|
-
},
|
|
2526
|
-
[
|
|
2527
|
-
[
|
|
2528
|
-
[
|
|
2529
|
-
[
|
|
2530
|
-
[
|
|
2524
|
+
_e(g), o("open");
|
|
2525
|
+
}, m = (g) => {
|
|
2526
|
+
_e(g), o("close");
|
|
2527
|
+
}, b = (g) => {
|
|
2528
|
+
_e(g), o("clear");
|
|
2529
|
+
}, T = {
|
|
2530
|
+
[ee.INPUT]: c,
|
|
2531
|
+
[ee.OPEN]: r,
|
|
2532
|
+
[ee.CLOSE]: m,
|
|
2533
|
+
[ee.CLEAR]: b,
|
|
2534
|
+
[ee.KEYDOWN]: u
|
|
2531
2535
|
};
|
|
2532
2536
|
return l({
|
|
2533
2537
|
focus: () => {
|
|
2534
2538
|
s.value.focus();
|
|
2535
2539
|
}
|
|
2536
|
-
}), (g,
|
|
2540
|
+
}), (g, z) => (p(), E("div", {
|
|
2537
2541
|
class: fe(["b-dropdown-small-textbox", i.value])
|
|
2538
2542
|
}, [
|
|
2539
|
-
|
|
2543
|
+
V(Nt, M({
|
|
2540
2544
|
ref_key: "baseTextbox",
|
|
2541
2545
|
ref: s
|
|
2542
2546
|
}, { ...g.$attrs, ...g.$props }, {
|
|
2543
2547
|
class: "b-dropdown-small-textbox__textbox",
|
|
2544
|
-
size:
|
|
2545
|
-
}, ie(
|
|
2546
|
-
icon:
|
|
2548
|
+
size: f(Me).SMALL
|
|
2549
|
+
}, ie(T)), {
|
|
2550
|
+
icon: _(() => [
|
|
2547
2551
|
W("div", ko, [
|
|
2548
|
-
ue(
|
|
2552
|
+
ue(V(f(wo), { "svg-title": "opened" }, null, 512), [
|
|
2549
2553
|
[Ne, h.value]
|
|
2550
2554
|
]),
|
|
2551
|
-
ue(
|
|
2555
|
+
ue(V(f(Io), { "svg-title": "closed" }, null, 512), [
|
|
2552
2556
|
[Ne, !h.value]
|
|
2553
2557
|
])
|
|
2554
2558
|
])
|
|
@@ -2557,7 +2561,7 @@ const wo = /* @__PURE__ */ ee(To, [["render", $o]]), ko = { class: "b-dropdown-s
|
|
|
2557
2561
|
}, 16, ["size"])
|
|
2558
2562
|
], 2));
|
|
2559
2563
|
}
|
|
2560
|
-
}), xo = /* @__PURE__ */
|
|
2564
|
+
}), xo = /* @__PURE__ */ Q(Do, [["__scopeId", "data-v-5fe55c74"]]), Bo = (e, l) => l.value.reduce((n, o) => {
|
|
2561
2565
|
if (o.items) {
|
|
2562
2566
|
const a = o.items.filter(
|
|
2563
2567
|
(t) => e.value.find((i) => i.value === t.value)
|
|
@@ -2583,58 +2587,60 @@ const wo = /* @__PURE__ */ ee(To, [["render", $o]]), ko = { class: "b-dropdown-s
|
|
|
2583
2587
|
totalItemCount: i,
|
|
2584
2588
|
isVirtualScroll: h
|
|
2585
2589
|
}, c, u, r) => {
|
|
2586
|
-
const
|
|
2587
|
-
a.value && await
|
|
2588
|
-
},
|
|
2589
|
-
a.value && await
|
|
2590
|
-
const
|
|
2590
|
+
const m = async (I) => {
|
|
2591
|
+
a.value && await se(), s.value[I]?.focus();
|
|
2592
|
+
}, b = async (I) => {
|
|
2593
|
+
a.value && await se();
|
|
2594
|
+
const ye = l.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef?.$el.querySelectorAll(
|
|
2591
2595
|
"button"
|
|
2592
2596
|
);
|
|
2593
|
-
|
|
2594
|
-
},
|
|
2595
|
-
|
|
2596
|
-
),
|
|
2597
|
-
await l.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef?.navigateToItem(
|
|
2598
|
-
}, g = (
|
|
2599
|
-
|
|
2600
|
-
h ?
|
|
2597
|
+
ye?.length ? ye[I]?.focus() : m(I);
|
|
2598
|
+
}, T = (I) => l.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef?.setListboxFocusedIndex(
|
|
2599
|
+
I
|
|
2600
|
+
), D = async (I) => {
|
|
2601
|
+
await l.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef?.navigateToItem(I);
|
|
2602
|
+
}, g = (I) => {
|
|
2603
|
+
se(() => {
|
|
2604
|
+
h ? D(I) : (T(I), m(I));
|
|
2601
2605
|
});
|
|
2602
|
-
},
|
|
2606
|
+
}, z = () => {
|
|
2603
2607
|
o.value || u(), g(0);
|
|
2604
2608
|
}, C = () => {
|
|
2605
|
-
o.value || u(),
|
|
2609
|
+
o.value || u(), se(() => {
|
|
2606
2610
|
g(h ? i.value - 1 : s.value.length - 1);
|
|
2607
2611
|
});
|
|
2608
|
-
},
|
|
2609
|
-
|
|
2610
|
-
},
|
|
2611
|
-
|
|
2612
|
-
},
|
|
2613
|
-
|
|
2614
|
-
},
|
|
2615
|
-
|
|
2616
|
-
},
|
|
2617
|
-
|
|
2618
|
-
},
|
|
2619
|
-
|
|
2620
|
-
},
|
|
2621
|
-
o.value &&
|
|
2622
|
-
},
|
|
2623
|
-
o.value &&
|
|
2612
|
+
}, O = (I) => {
|
|
2613
|
+
I.preventDefault(), I.stopPropagation();
|
|
2614
|
+
}, R = ({ detail: I }) => {
|
|
2615
|
+
O(I), z();
|
|
2616
|
+
}, x = ({ detail: I }) => {
|
|
2617
|
+
O(I), C();
|
|
2618
|
+
}, $ = ({ detail: I }) => {
|
|
2619
|
+
O(I), z();
|
|
2620
|
+
}, F = ({ detail: I }) => {
|
|
2621
|
+
O(I), C();
|
|
2622
|
+
}, B = ({ detail: I }) => {
|
|
2623
|
+
O(I), c(), o.value && (t ? b(0) : g(n.value));
|
|
2624
|
+
}, w = ({ detail: I }) => {
|
|
2625
|
+
O(I), c(), o.value && (t ? b(0) : g(n.value));
|
|
2626
|
+
}, G = ({ detail: I }) => {
|
|
2627
|
+
I.stopPropagation(), o.value && r();
|
|
2628
|
+
}, P = ({ detail: I }) => {
|
|
2629
|
+
I.stopPropagation(), o.value && (r(), Pt(e));
|
|
2624
2630
|
};
|
|
2625
2631
|
return d(() => ({
|
|
2626
|
-
[H.ARROW_DOWN]:
|
|
2627
|
-
[H.ARROW_UP]:
|
|
2628
|
-
[H.HOME]:
|
|
2629
|
-
[H.END]:
|
|
2630
|
-
...a.value ? {} : { [H.SPACE]:
|
|
2631
|
-
[H.ENTER]:
|
|
2632
|
-
...a.value ? {} : { [H.TAB]:
|
|
2633
|
-
[H.ESCAPE]:
|
|
2632
|
+
[H.ARROW_DOWN]: R,
|
|
2633
|
+
[H.ARROW_UP]: x,
|
|
2634
|
+
[H.HOME]: $,
|
|
2635
|
+
[H.END]: F,
|
|
2636
|
+
...a.value ? {} : { [H.SPACE]: B },
|
|
2637
|
+
[H.ENTER]: w,
|
|
2638
|
+
...a.value ? {} : { [H.TAB]: G },
|
|
2639
|
+
[H.ESCAPE]: P
|
|
2634
2640
|
}));
|
|
2635
2641
|
}, No = ({ inputContainerRef: e, isDropdownOpen: l }, n) => {
|
|
2636
2642
|
const o = () => {
|
|
2637
|
-
l.value && n(),
|
|
2643
|
+
l.value && n(), se(() => {
|
|
2638
2644
|
Pt(e);
|
|
2639
2645
|
});
|
|
2640
2646
|
};
|
|
@@ -2646,8 +2652,8 @@ const wo = /* @__PURE__ */ ee(To, [["render", $o]]), ko = { class: "b-dropdown-s
|
|
|
2646
2652
|
};
|
|
2647
2653
|
};
|
|
2648
2654
|
function Po(e, l, n, o, a) {
|
|
2649
|
-
const s =
|
|
2650
|
-
return
|
|
2655
|
+
const s = k(e), t = k(l), i = (u, r = []) => r.flatMap((m) => m.label.toLocaleLowerCase().includes(u) ? o?.value && m.items ? [...i(u, m.items)] : [m, ...i(u, m.items)] : m.items ? [...i(u, m.items)] : []), h = n !== void 0 ? Bt(() => n(s.value), a ?? 300) : void 0;
|
|
2656
|
+
return Oe(s, () => {
|
|
2651
2657
|
h !== void 0 && h();
|
|
2652
2658
|
}), d(() => {
|
|
2653
2659
|
if (!s.value || n !== void 0)
|
|
@@ -2711,109 +2717,109 @@ const Ft = {
|
|
|
2711
2717
|
},
|
|
2712
2718
|
emits: ["input", "update:model-value", "show-more", "open"],
|
|
2713
2719
|
setup(e, { expose: l, emit: n }) {
|
|
2714
|
-
const o = dt(), a = Ge(), s = Tt(a), t = e, i = n, { t: h } =
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
),
|
|
2720
|
+
const o = dt(), a = Ge(), s = Tt(a), t = e, i = n, { t: h } = De({ messages: Ft }), { emitValue: c } = qt(i), u = k(null), r = k(null), m = k(null), b = k(!1), T = Ie("bento-dropdown-options-container"), D = Ie("dropdown-label"), g = Ie("dropdown-description"), z = Ie("dropdown-error"), { isReadOnly: C } = Yt(oe(t, "readonly")), O = d(() => t.modelValue ?? t.value), { cachedSelectedListboxOptions: R, cachedListboxSelectedValues: x, setCachedValues: $ } = lo(
|
|
2721
|
+
oe(t, "items"),
|
|
2722
|
+
O,
|
|
2723
|
+
oe(t, "multiple"),
|
|
2724
|
+
oe(t, "enableValueLabelPair")
|
|
2725
|
+
), F = k(o["aria-label"]), B = k(o["aria-describedby"]), { ariaLabel: w, label: G } = Lt(t), P = d(() => h("ariaLabelFallback")), ne = Ut({
|
|
2720
2726
|
// TODO: take ariaLabel ref away when aria-label prop is removed
|
|
2721
|
-
ariaLabel:
|
|
2722
|
-
label:
|
|
2723
|
-
defaultFallback:
|
|
2724
|
-
}),
|
|
2727
|
+
ariaLabel: w.value || F,
|
|
2728
|
+
label: G,
|
|
2729
|
+
defaultFallback: P
|
|
2730
|
+
}), I = t.size === Me.SMALL || ct(io, !1), ye = d(() => I ? Me.SMALL : Me.DEFAULT), Pe = d(() => ({
|
|
2725
2731
|
"b-dropdown--condensed": t.condensed
|
|
2726
|
-
})),
|
|
2732
|
+
})), xe = d(() => ({
|
|
2727
2733
|
"b-dropdown__description--error": !!t.errorMessage
|
|
2728
|
-
})), X =
|
|
2734
|
+
})), X = k(""), re = oe(t, "items"), Ke = oe(t, "staticCategories"), Ae = Po(
|
|
2729
2735
|
X,
|
|
2730
2736
|
re,
|
|
2731
2737
|
t?.search?.searchEvent,
|
|
2732
2738
|
Ke,
|
|
2733
2739
|
t?.search?.debounceTime
|
|
2734
|
-
),
|
|
2740
|
+
), ge = d(() => t.dynamicFiltering && !!X.value), He = Ro({
|
|
2735
2741
|
items: re,
|
|
2736
|
-
placeholder:
|
|
2737
|
-
isMultiSelect:
|
|
2738
|
-
selectedValues:
|
|
2742
|
+
placeholder: oe(t, "placeholder"),
|
|
2743
|
+
isMultiSelect: oe(t, "multiple"),
|
|
2744
|
+
selectedValues: R
|
|
2739
2745
|
}), Je = d(() => {
|
|
2740
|
-
if (t?.multiple && Array.isArray(
|
|
2746
|
+
if (t?.multiple && Array.isArray(O.value))
|
|
2741
2747
|
return t.items.filter(
|
|
2742
|
-
({ value:
|
|
2748
|
+
({ value: v }) => t?.value && (t?.value).includes(v)
|
|
2743
2749
|
);
|
|
2744
2750
|
if (!t.multiple && t.staticCategories) {
|
|
2745
|
-
const
|
|
2746
|
-
(de) => de.items?.some((
|
|
2751
|
+
const v = t.items.find(
|
|
2752
|
+
(de) => de.items?.some((we) => we.value === O.value)
|
|
2747
2753
|
);
|
|
2748
|
-
return (
|
|
2754
|
+
return (v ? v.items.find((de) => de.value === O.value) : t.items.find(({ value: de }) => de === O.value)) ?? null;
|
|
2749
2755
|
}
|
|
2750
|
-
return t.items.find(({ value:
|
|
2751
|
-
}),
|
|
2752
|
-
const
|
|
2753
|
-
return
|
|
2754
|
-
}), { isMultiLevelSelect:
|
|
2756
|
+
return t.items.find(({ value: v }) => v === O.value);
|
|
2757
|
+
}), Be = d(() => {
|
|
2758
|
+
const ae = (he.value ? Fe.value : Ae.value).findIndex(({ value: de }) => t.enableValueLabelPair ? O.value?.value === de : O.value === de);
|
|
2759
|
+
return ae > -1 ? ae : 0;
|
|
2760
|
+
}), { isMultiLevelSelect: he, flattenedItemsList: Fe } = Dt(re), Xe = d(() => he.value && !t.staticCategories), Ze = d(() => Xe.value ? "treeitem" : "option"), Qe = d(() => {
|
|
2755
2761
|
if (t.multiple) {
|
|
2756
|
-
const
|
|
2757
|
-
return
|
|
2762
|
+
const v = Array.isArray(O.value) ? O.value.length : 0, ae = he.value ? Fe.value.length : re.value.length;
|
|
2763
|
+
return v === 0 ? null : !t.hasMoreItems && ae > 0 && ae === v ? h("all") : v;
|
|
2758
2764
|
}
|
|
2759
2765
|
return null;
|
|
2760
2766
|
}), et = d(
|
|
2761
2767
|
() => [
|
|
2762
2768
|
t.description ? g : null,
|
|
2763
|
-
|
|
2764
|
-
t.errorMessage ?
|
|
2769
|
+
B.value,
|
|
2770
|
+
t.errorMessage ? z : null
|
|
2765
2771
|
].filter(Boolean).join(" ") || null
|
|
2766
|
-
), Ue = d(() =>
|
|
2772
|
+
), Ue = d(() => m.value?.$el), { visibleDomOptions: tt, updateVisibleDomOptions: qe } = ut(
|
|
2767
2773
|
Ue,
|
|
2768
|
-
|
|
2774
|
+
Ae,
|
|
2769
2775
|
Ze
|
|
2770
2776
|
), Ye = () => {
|
|
2771
|
-
C.value || (
|
|
2777
|
+
C.value || (b.value = !0, se(() => {
|
|
2772
2778
|
qe();
|
|
2773
2779
|
}));
|
|
2774
|
-
},
|
|
2775
|
-
|
|
2780
|
+
}, Re = () => {
|
|
2781
|
+
b.value = !1;
|
|
2776
2782
|
}, Ve = () => {
|
|
2777
|
-
C.value || (
|
|
2783
|
+
C.value || (b.value = !b.value, se(() => {
|
|
2778
2784
|
qe();
|
|
2779
|
-
}),
|
|
2785
|
+
}), ge.value && (X.value = ""));
|
|
2780
2786
|
}, lt = () => {
|
|
2781
|
-
|
|
2787
|
+
ge.value && (X.value = ""), b.value && (b.value = !1, m.value.onOutsideDropdownClick());
|
|
2782
2788
|
}, ot = d(() => [
|
|
2783
2789
|
lt,
|
|
2784
2790
|
{
|
|
2785
2791
|
ignore: [Ue]
|
|
2786
2792
|
}
|
|
2787
|
-
]), at = async (
|
|
2788
|
-
t.multiple || (X.value = "",
|
|
2793
|
+
]), at = async (v) => {
|
|
2794
|
+
t.multiple || (X.value = "", b.value = !1), $(v), c(x.value), t.multiple || (await se(), q());
|
|
2789
2795
|
}, S = () => {
|
|
2790
2796
|
i(y.SHOW_MORE);
|
|
2791
|
-
},
|
|
2797
|
+
}, A = Mo(
|
|
2792
2798
|
{
|
|
2793
2799
|
inputContainerRef: u,
|
|
2794
|
-
optionsContainerRef:
|
|
2795
|
-
selectedValueIndex:
|
|
2796
|
-
isDropdownOpen:
|
|
2797
|
-
isDynamicFltering:
|
|
2800
|
+
optionsContainerRef: m,
|
|
2801
|
+
selectedValueIndex: Be,
|
|
2802
|
+
isDropdownOpen: b,
|
|
2803
|
+
isDynamicFltering: oe(t, "dynamicFiltering"),
|
|
2798
2804
|
items: tt,
|
|
2799
2805
|
isMultiple: t.multiple,
|
|
2800
|
-
totalItemCount: d(() =>
|
|
2806
|
+
totalItemCount: d(() => Ae.value.length),
|
|
2801
2807
|
isVirtualScroll: !t?.multiple && t?.virtualScroll !== !1 && t?.lazyLoadType === "none"
|
|
2802
2808
|
},
|
|
2803
2809
|
Ve,
|
|
2804
2810
|
Ye,
|
|
2805
|
-
|
|
2806
|
-
),
|
|
2811
|
+
Re
|
|
2812
|
+
), L = No(
|
|
2807
2813
|
{
|
|
2808
2814
|
inputContainerRef: u,
|
|
2809
|
-
isDropdownOpen:
|
|
2815
|
+
isDropdownOpen: b
|
|
2810
2816
|
},
|
|
2811
|
-
|
|
2817
|
+
Re
|
|
2812
2818
|
), U = {
|
|
2813
|
-
[y.CLOSE_DROPDOWN]:
|
|
2819
|
+
[y.CLOSE_DROPDOWN]: Re,
|
|
2814
2820
|
[y.SELECT]: at,
|
|
2815
2821
|
[y.SHOW_MORE]: S,
|
|
2816
|
-
...
|
|
2822
|
+
...L
|
|
2817
2823
|
};
|
|
2818
2824
|
t.error && nt(
|
|
2819
2825
|
'BentoDropdown "error" property',
|
|
@@ -2829,140 +2835,140 @@ const Ft = {
|
|
|
2829
2835
|
);
|
|
2830
2836
|
const q = () => {
|
|
2831
2837
|
u.value.focus();
|
|
2832
|
-
},
|
|
2833
|
-
if (await
|
|
2838
|
+
}, $e = async () => {
|
|
2839
|
+
if (await se(), !b.value || t.multiple || !m.value)
|
|
2834
2840
|
return;
|
|
2835
|
-
const
|
|
2836
|
-
if (
|
|
2841
|
+
const v = Be.value;
|
|
2842
|
+
if (v <= 0)
|
|
2837
2843
|
return;
|
|
2838
|
-
|
|
2844
|
+
m.value?.$refs?.dropdownOptionsListboxRef?.$refs?.listboxItemRef?.scrollToItem?.(v);
|
|
2839
2845
|
};
|
|
2840
|
-
return
|
|
2841
|
-
() =>
|
|
2842
|
-
(
|
|
2843
|
-
|
|
2846
|
+
return Oe(
|
|
2847
|
+
() => b.value,
|
|
2848
|
+
(v) => {
|
|
2849
|
+
v && (i("open"), $e());
|
|
2844
2850
|
}
|
|
2845
2851
|
), l({
|
|
2846
2852
|
focus: q
|
|
2847
|
-
}), (
|
|
2853
|
+
}), (v, ae) => ue((p(), E("div", {
|
|
2848
2854
|
class: fe(["b-dropdown", Pe.value])
|
|
2849
2855
|
}, [
|
|
2850
|
-
|
|
2856
|
+
f(G) ? (p(), N(f(ol), {
|
|
2851
2857
|
key: 0,
|
|
2852
|
-
id:
|
|
2853
|
-
condensed:
|
|
2854
|
-
label:
|
|
2855
|
-
"tooltip-text":
|
|
2856
|
-
optional:
|
|
2857
|
-
required:
|
|
2858
|
+
id: f(D),
|
|
2859
|
+
condensed: v.condensed,
|
|
2860
|
+
label: f(G),
|
|
2861
|
+
"tooltip-text": v.tooltipText,
|
|
2862
|
+
optional: v.optional,
|
|
2863
|
+
required: v.required
|
|
2858
2864
|
}, null, 8, ["id", "condensed", "label", "tooltip-text", "optional", "required"])) : J("", !0),
|
|
2859
2865
|
ue((p(), E("div", M({
|
|
2860
2866
|
ref_key: "inputContainerRefWrapper",
|
|
2861
2867
|
ref: r
|
|
2862
|
-
}, ie(
|
|
2863
|
-
(p(), N(It(
|
|
2868
|
+
}, ie(f(A), !0)), [
|
|
2869
|
+
(p(), N(It(ye.value), {
|
|
2864
2870
|
ref_key: "inputContainerRef",
|
|
2865
2871
|
ref: u,
|
|
2866
|
-
condensed:
|
|
2872
|
+
condensed: v.condensed,
|
|
2867
2873
|
value: X.value,
|
|
2868
2874
|
"additional-items-selected": Qe.value,
|
|
2869
|
-
"aria-controls":
|
|
2870
|
-
ariaExpanded:
|
|
2871
|
-
"aria-labelledby":
|
|
2875
|
+
"aria-controls": f(T),
|
|
2876
|
+
ariaExpanded: b.value,
|
|
2877
|
+
"aria-labelledby": f(G) ? f(D) : null,
|
|
2872
2878
|
"aria-describedby": et.value,
|
|
2873
|
-
"aria-label":
|
|
2874
|
-
"aria-readonly":
|
|
2875
|
-
"aria-required":
|
|
2876
|
-
readonly:
|
|
2877
|
-
disabled:
|
|
2878
|
-
"display-value":
|
|
2879
|
-
"dynamic-filtering":
|
|
2880
|
-
"is-invalid": !!
|
|
2881
|
-
multiple:
|
|
2882
|
-
open:
|
|
2883
|
-
"selected-value-item":
|
|
2884
|
-
"show-slot-content-in-multiple":
|
|
2885
|
-
onInput:
|
|
2879
|
+
"aria-label": f(ne),
|
|
2880
|
+
"aria-readonly": f(C),
|
|
2881
|
+
"aria-required": v.required,
|
|
2882
|
+
readonly: f(C),
|
|
2883
|
+
disabled: v.disabled,
|
|
2884
|
+
"display-value": f(He),
|
|
2885
|
+
"dynamic-filtering": v.dynamicFiltering,
|
|
2886
|
+
"is-invalid": !!v.errorMessage || v.error,
|
|
2887
|
+
multiple: v.multiple,
|
|
2888
|
+
open: b.value,
|
|
2889
|
+
"selected-value-item": f(I) ? void 0 : Je.value,
|
|
2890
|
+
"show-slot-content-in-multiple": v.showSlotContentInMultiple,
|
|
2891
|
+
onInput: ae[0] || (ae[0] = (de) => X.value = de),
|
|
2886
2892
|
onOpen: Ve,
|
|
2887
2893
|
onClose: Ve
|
|
2888
2894
|
}, ve({ _: 2 }, [
|
|
2889
|
-
|
|
2890
|
-
name:
|
|
2891
|
-
fn:
|
|
2892
|
-
j(
|
|
2895
|
+
te(f(a), (de, we) => ({
|
|
2896
|
+
name: we,
|
|
2897
|
+
fn: _((st) => [
|
|
2898
|
+
j(v.$slots, we, ce(Ce(st)), void 0, !0)
|
|
2893
2899
|
])
|
|
2894
2900
|
}))
|
|
2895
2901
|
]), 1064, ["condensed", "value", "additional-items-selected", "aria-controls", "ariaExpanded", "aria-labelledby", "aria-describedby", "aria-label", "aria-readonly", "aria-required", "readonly", "disabled", "display-value", "dynamic-filtering", "is-invalid", "multiple", "open", "selected-value-item", "show-slot-content-in-multiple"]))
|
|
2896
2902
|
], 16)), [
|
|
2897
|
-
[
|
|
2903
|
+
[f(ze)]
|
|
2898
2904
|
]),
|
|
2899
|
-
u.value ? (p(), N(
|
|
2905
|
+
u.value ? (p(), N(f(ll), {
|
|
2900
2906
|
key: 1,
|
|
2901
|
-
disabled:
|
|
2902
|
-
to:
|
|
2907
|
+
disabled: v.teleport?.disabled,
|
|
2908
|
+
to: v.teleport?.to
|
|
2903
2909
|
}, {
|
|
2904
|
-
default:
|
|
2905
|
-
|
|
2906
|
-
id:
|
|
2910
|
+
default: _(() => [
|
|
2911
|
+
V(f(no), M({
|
|
2912
|
+
id: f(T),
|
|
2907
2913
|
ref_key: "optionsContainerRef",
|
|
2908
|
-
ref:
|
|
2909
|
-
"aria-label":
|
|
2910
|
-
"component-loading":
|
|
2911
|
-
"empty-state":
|
|
2912
|
-
disabled:
|
|
2913
|
-
"is-option-disabled":
|
|
2914
|
-
items:
|
|
2915
|
-
multiple:
|
|
2914
|
+
ref: m,
|
|
2915
|
+
"aria-label": f(ne),
|
|
2916
|
+
"component-loading": v.componentLoading,
|
|
2917
|
+
"empty-state": v.emptyState,
|
|
2918
|
+
disabled: v.disabled,
|
|
2919
|
+
"is-option-disabled": v.isOptionDisabled,
|
|
2920
|
+
items: f(Ae),
|
|
2921
|
+
multiple: v.multiple,
|
|
2916
2922
|
"static-categories": Ke.value,
|
|
2917
|
-
open:
|
|
2918
|
-
"selected-value":
|
|
2919
|
-
searching:
|
|
2923
|
+
open: b.value,
|
|
2924
|
+
"selected-value": f(R),
|
|
2925
|
+
searching: ge.value,
|
|
2920
2926
|
"target-element": r.value,
|
|
2921
|
-
loading:
|
|
2922
|
-
"has-more-items":
|
|
2923
|
-
"lazy-load-type":
|
|
2924
|
-
"virtual-scroll":
|
|
2927
|
+
loading: v.loading,
|
|
2928
|
+
"has-more-items": v.hasMoreItems,
|
|
2929
|
+
"lazy-load-type": v.lazyLoadType,
|
|
2930
|
+
"virtual-scroll": v.virtualScroll
|
|
2925
2931
|
}, ie(U)), ve({ _: 2 }, [
|
|
2926
|
-
|
|
2927
|
-
name:
|
|
2928
|
-
fn:
|
|
2929
|
-
j(
|
|
2932
|
+
te(f(a), (de, we) => ({
|
|
2933
|
+
name: we,
|
|
2934
|
+
fn: _((st) => [
|
|
2935
|
+
j(v.$slots, we, ce(Ce(st)), void 0, !0)
|
|
2930
2936
|
])
|
|
2931
2937
|
}))
|
|
2932
2938
|
]), 1040, ["id", "aria-label", "component-loading", "empty-state", "disabled", "is-option-disabled", "items", "multiple", "static-categories", "open", "selected-value", "searching", "target-element", "loading", "has-more-items", "lazy-load-type", "virtual-scroll"])
|
|
2933
2939
|
]),
|
|
2934
2940
|
_: 3
|
|
2935
2941
|
}, 8, ["disabled", "to"])) : J("", !0),
|
|
2936
|
-
|
|
2942
|
+
v.errorMessage ? (p(), N(f(al), {
|
|
2937
2943
|
key: 2,
|
|
2938
|
-
id:
|
|
2939
|
-
"error-message":
|
|
2944
|
+
id: f(z),
|
|
2945
|
+
"error-message": v.errorMessage,
|
|
2940
2946
|
class: "b-dropdown__error-message"
|
|
2941
2947
|
}, null, 8, ["id", "error-message"])) : J("", !0),
|
|
2942
|
-
|
|
2948
|
+
v.description || f(s)("description") ? (p(), N(f(Te), {
|
|
2943
2949
|
key: 3,
|
|
2944
|
-
id:
|
|
2945
|
-
class: fe(["b-dropdown__description",
|
|
2950
|
+
id: f(g),
|
|
2951
|
+
class: fe(["b-dropdown__description", xe.value]),
|
|
2946
2952
|
el: "span"
|
|
2947
2953
|
}, {
|
|
2948
|
-
default:
|
|
2949
|
-
j(
|
|
2950
|
-
|
|
2954
|
+
default: _(() => [
|
|
2955
|
+
j(v.$slots, "description", {}, () => [
|
|
2956
|
+
le(Y(v.description), 1)
|
|
2951
2957
|
], !0)
|
|
2952
2958
|
]),
|
|
2953
2959
|
_: 3
|
|
2954
2960
|
}, 8, ["id", "class"])) : J("", !0)
|
|
2955
2961
|
], 2)), [
|
|
2956
|
-
[
|
|
2962
|
+
[f(Wt), ot.value]
|
|
2957
2963
|
]);
|
|
2958
2964
|
}
|
|
2959
|
-
}), fa = /* @__PURE__ */
|
|
2965
|
+
}), fa = /* @__PURE__ */ Q(Vo, [["__scopeId", "data-v-66790b9d"]]);
|
|
2960
2966
|
export {
|
|
2961
2967
|
fa as B,
|
|
2962
2968
|
ml as C,
|
|
2963
2969
|
Co as D,
|
|
2964
2970
|
y as a,
|
|
2965
|
-
|
|
2971
|
+
Le as b,
|
|
2966
2972
|
Me as c,
|
|
2967
2973
|
it as d,
|
|
2968
2974
|
Dt as e,
|
|
@@ -2973,4 +2979,4 @@ export {
|
|
|
2973
2979
|
pt as j,
|
|
2974
2980
|
lo as u
|
|
2975
2981
|
};
|
|
2976
|
-
//# sourceMappingURL=dropdown.
|
|
2982
|
+
//# sourceMappingURL=dropdown.DpqCHfi-.js.map
|