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