@adyen/bento-vue2 1.24.0 → 1.26.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 +484 -629
- package/dist/accordion.js +2 -2
- package/dist/action-bar.js +6 -6
- package/dist/alert.js +69 -104
- package/dist/alert.js.map +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/index10.css +1 -1
- package/dist/assets/index11.css +1 -1
- package/dist/assets/index12.css +1 -1
- package/dist/assets/index13.css +1 -1
- package/dist/assets/index14.css +1 -1
- package/dist/assets/index15.css +1 -1
- package/dist/assets/index16.css +1 -1
- package/dist/assets/index17.css +1 -1
- package/dist/assets/index18.css +1 -1
- package/dist/assets/index19.css +1 -1
- package/dist/assets/index2.css +1 -1
- package/dist/assets/index20.css +1 -1
- package/dist/assets/index21.css +1 -1
- package/dist/assets/index22.css +1 -1
- package/dist/assets/index23.css +1 -1
- package/dist/assets/index24.css +1 -1
- package/dist/assets/index25.css +1 -1
- package/dist/assets/index26.css +1 -1
- package/dist/assets/index27.css +1 -1
- package/dist/assets/index28.css +1 -1
- package/dist/assets/index29.css +1 -1
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index30.css +1 -1
- package/dist/assets/index31.css +1 -1
- package/dist/assets/index32.css +1 -1
- package/dist/assets/index33.css +1 -1
- package/dist/assets/index34.css +1 -1
- package/dist/assets/index35.css +1 -1
- package/dist/assets/index36.css +1 -1
- package/dist/assets/index37.css +1 -1
- package/dist/assets/index38.css +1 -1
- package/dist/assets/index39.css +1 -1
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index40.css +1 -1
- package/dist/assets/index41.css +1 -1
- package/dist/assets/index42.css +1 -1
- package/dist/assets/index43.css +1 -1
- package/dist/assets/index44.css +1 -1
- package/dist/assets/index45.css +1 -1
- package/dist/assets/index47.css +1 -1
- package/dist/assets/index48.css +1 -1
- package/dist/assets/index5.css +1 -1
- package/dist/assets/index6.css +1 -1
- package/dist/assets/index7.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/assets/{listbox.css → use-cached-selected-values.css} +1 -1
- package/dist/avatar-image.js +1 -1
- package/dist/button.js +5 -5
- package/dist/card.js +83 -180
- package/dist/card.js.map +1 -1
- package/dist/checkbox.js +5 -5
- package/dist/chunks/{base-button.090f511d.js → base-button.ad74b6f8.js} +2 -2
- package/dist/chunks/{base-button.090f511d.js.map → base-button.ad74b6f8.js.map} +1 -1
- package/dist/chunks/{base-modal.aa09a60c.js → base-modal.1fff7abe.js} +6 -6
- package/dist/chunks/{base-modal.aa09a60c.js.map → base-modal.1fff7abe.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.879c4573.js → button-actions-with-menu.e845d77a.js} +4 -4
- package/dist/chunks/{button-actions-with-menu.879c4573.js.map → button-actions-with-menu.e845d77a.js.map} +1 -1
- package/dist/chunks/{button-actions.239456cb.js → button-actions.81db18e8.js} +3 -3
- package/dist/chunks/{button-actions.239456cb.js.map → button-actions.81db18e8.js.map} +1 -1
- package/dist/chunks/{button.6e6324f0.js → button.9d6435ae.js} +3 -3
- package/dist/chunks/{button.6e6324f0.js.map → button.9d6435ae.js.map} +1 -1
- package/dist/chunks/{calendar.1e416969.js → calendar.640b8d25.js} +4 -4
- package/dist/chunks/{calendar.1e416969.js.map → calendar.640b8d25.js.map} +1 -1
- package/dist/chunks/{checkbox.f38276e6.js → checkbox.bfed007c.js} +3 -3
- package/dist/chunks/{checkbox.f38276e6.js.map → checkbox.bfed007c.js.map} +1 -1
- package/dist/chunks/{controls-group.f1dfa419.js → controls-group.4fb50009.js} +3 -3
- package/dist/chunks/{controls-group.f1dfa419.js.map → controls-group.4fb50009.js.map} +1 -1
- package/dist/chunks/{copy.acc9f1b0.js → copy.f85700c6.js} +4 -4
- package/dist/chunks/{copy.acc9f1b0.js.map → copy.f85700c6.js.map} +1 -1
- package/dist/chunks/dialog-page.73da22cf.js +133 -0
- package/dist/chunks/dialog-page.73da22cf.js.map +1 -0
- package/dist/chunks/{dropdown-default-textbox.c1f8fe5f.js → dropdown-default-textbox.54ca1b18.js} +2 -2
- package/dist/chunks/{dropdown-default-textbox.c1f8fe5f.js.map → dropdown-default-textbox.54ca1b18.js.map} +1 -1
- package/dist/chunks/dropdown.10c034aa.js +775 -0
- package/dist/chunks/dropdown.10c034aa.js.map +1 -0
- package/dist/chunks/{error-message.8734e591.js → error-message.31ec12b7.js} +2 -2
- package/dist/chunks/{error-message.8734e591.js.map → error-message.31ec12b7.js.map} +1 -1
- package/dist/chunks/{fixed-scroller.772ad033.js → fixed-scroller.4eb9a9ac.js} +2 -2
- package/dist/chunks/{fixed-scroller.772ad033.js.map → fixed-scroller.4eb9a9ac.js.map} +1 -1
- package/dist/chunks/{footer-actions.11071f12.js → footer-actions.a1e09b4f.js} +4 -4
- package/dist/chunks/{footer-actions.11071f12.js.map → footer-actions.a1e09b4f.js.map} +1 -1
- package/dist/chunks/{index.5d5f2200.js → index.15b088b9.js} +6 -6
- package/dist/chunks/{index.5d5f2200.js.map → index.15b088b9.js.map} +1 -1
- package/dist/chunks/{index.87180cdd.js → index.1ea85d4a.js} +138 -119
- package/dist/chunks/index.1ea85d4a.js.map +1 -0
- package/dist/chunks/{index.8e6bc325.js → index.317fca12.js} +3 -3
- package/dist/chunks/{index.8e6bc325.js.map → index.317fca12.js.map} +1 -1
- package/dist/chunks/{index.51308a21.js → index.671768a1.js} +3 -3
- package/dist/chunks/{index.51308a21.js.map → index.671768a1.js.map} +1 -1
- package/dist/chunks/{index.49ce3f6a.js → index.7eefc59c.js} +3 -3
- package/dist/chunks/{index.49ce3f6a.js.map → index.7eefc59c.js.map} +1 -1
- package/dist/chunks/{index.f19887a1.js → index.885d05a9.js} +2 -2
- package/dist/chunks/{index.f19887a1.js.map → index.885d05a9.js.map} +1 -1
- package/dist/chunks/{index.73abb1a9.js → index.8b8c3b16.js} +9 -9
- package/dist/chunks/{index.73abb1a9.js.map → index.8b8c3b16.js.map} +1 -1
- package/dist/chunks/{index.ff09389c.js → index.aaf965f8.js} +6 -6
- package/dist/chunks/{index.ff09389c.js.map → index.aaf965f8.js.map} +1 -1
- package/dist/chunks/{index.03ae22b4.js → index.b21197ca.js} +2 -2
- package/dist/chunks/{index.03ae22b4.js.map → index.b21197ca.js.map} +1 -1
- package/dist/chunks/{index.94980f50.js → index.d553d3d1.js} +2 -2
- package/dist/chunks/{index.94980f50.js.map → index.d553d3d1.js.map} +1 -1
- package/dist/chunks/{index.ba6c1040.js → index.dd30e538.js} +3 -3
- package/dist/chunks/index.dd30e538.js.map +1 -0
- package/dist/chunks/{listbox-option-tag.c0a56a95.js → listbox-option-tag.6bbb6bbe.js} +3 -3
- package/dist/chunks/{listbox-option-tag.c0a56a95.js.map → listbox-option-tag.6bbb6bbe.js.map} +1 -1
- package/dist/chunks/{loading-button.84a5529d.js → loading-button.eafc9e1b.js} +2 -2
- package/dist/chunks/{loading-button.84a5529d.js.map → loading-button.eafc9e1b.js.map} +1 -1
- package/dist/chunks/{payment-method.faa302de.js → payment-method.6c1ce07c.js} +2 -2
- package/dist/chunks/{payment-method.faa302de.js.map → payment-method.6c1ce07c.js.map} +1 -1
- package/dist/chunks/{tooltip.8e9d733c.js → tooltip.58ef3f4a.js} +3 -3
- package/dist/chunks/{tooltip.8e9d733c.js.map → tooltip.58ef3f4a.js.map} +1 -1
- package/dist/chunks/{use-bento-toast-controller.7d4436ad.js → use-bento-toast-controller.c3277f73.js} +2 -2
- package/dist/chunks/{use-bento-toast-controller.7d4436ad.js.map → use-bento-toast-controller.c3277f73.js.map} +1 -1
- package/dist/chunks/{listbox.e6e1bc90.js → use-cached-selected-values.69297473.js} +510 -448
- package/dist/chunks/use-cached-selected-values.69297473.js.map +1 -0
- package/dist/code-snippet.js +7 -7
- package/dist/code-snippet.js.map +1 -1
- package/dist/country.js +2 -2
- package/dist/currency.js +1 -1
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +947 -885
- package/dist/data-grid.js.map +1 -1
- package/dist/date-picker.js +8 -8
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/divider.js +1 -1
- package/dist/dropdown.js +7 -7
- package/dist/empty-state.js +3 -3
- package/dist/filter-bar.js +1115 -955
- package/dist/filter-bar.js.map +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +15 -14
- package/dist/form-layout.js.map +1 -1
- package/dist/header.js +4 -4
- package/dist/index.js +177 -169
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +3 -3
- package/dist/input-field.js +31 -29
- package/dist/input-field.js.map +1 -1
- package/dist/internal.js +31 -78
- package/dist/internal.js.map +1 -1
- package/dist/link.js +1 -1
- package/dist/loading-indicator.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +6 -6
- package/dist/modal.js +6 -6
- package/dist/pagination.js +4 -4
- package/dist/payment-method.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/popper-container.js +1 -1
- package/dist/radio-group.js +62 -62
- package/dist/radio-group.js.map +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +2 -2
- package/dist/segmented-control.js +2 -2
- package/dist/selection-card.js +4 -4
- package/dist/sidepanel.js +52 -50
- package/dist/sidepanel.js.map +1 -1
- package/dist/status.js +2 -2
- package/dist/stepper.js +3 -3
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +3 -3
- package/dist/tabs.js +52 -52
- package/dist/tabs.js.map +1 -1
- package/dist/tag.js +3 -3
- package/dist/textarea.js +4 -4
- package/dist/timeline.js +7 -7
- package/dist/toast.js +4 -4
- package/dist/toggle.js +2 -2
- package/dist/tutorial.js +88 -67
- package/dist/tutorial.js.map +1 -1
- package/dist/typography.js +1 -1
- package/dist/web-types.json +550 -266
- package/package.json +3 -2
- package/dist/chunks/dialog-page.75b295b7.js +0 -133
- package/dist/chunks/dialog-page.75b295b7.js.map +0 -1
- package/dist/chunks/dropdown.669b858b.js +0 -797
- package/dist/chunks/dropdown.669b858b.js.map +0 -1
- package/dist/chunks/index.87180cdd.js.map +0 -1
- package/dist/chunks/index.ba6c1040.js.map +0 -1
- package/dist/chunks/listbox.e6e1bc90.js.map +0 -1
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { B as
|
|
3
|
-
import { BentoLoadingIndicator as
|
|
4
|
-
import { BentoEmptyState as
|
|
5
|
-
import { u as
|
|
6
|
-
import { d as
|
|
1
|
+
import { computed as i, ref as A, onMounted as ee, onUnmounted as ve, watch as te, defineComponent as D, toRef as V } from "vue";
|
|
2
|
+
import { B as w } from "./index.dd30e538.js";
|
|
3
|
+
import { BentoLoadingIndicator as fe } from "../loading-indicator.js";
|
|
4
|
+
import { BentoEmptyState as ge } from "../empty-state.js";
|
|
5
|
+
import { u as Y } from "./i18n.eb5b985b.js";
|
|
6
|
+
import { d as ye } from "./debounce.b5ef6acf.js";
|
|
7
7
|
import { n as N } from "./_plugin-vue2_normalizer.71e2aa87.js";
|
|
8
|
-
import { C as
|
|
9
|
-
import { B as k, a as
|
|
10
|
-
import { B as
|
|
8
|
+
import { C as pe } from "./checkmark.a6ed8f47.js";
|
|
9
|
+
import { B as k, a as X } from "./keyboard-navigation.ca47dfa8.js";
|
|
10
|
+
import { B as J } from "./checkbox.bfed007c.js";
|
|
11
11
|
import "./index.4c062058.js";
|
|
12
|
-
import { C as
|
|
13
|
-
import { B as
|
|
14
|
-
import { C as
|
|
15
|
-
import { B as
|
|
16
|
-
import { o as
|
|
17
|
-
import "../assets/
|
|
18
|
-
const
|
|
19
|
-
const n =
|
|
12
|
+
import { C as Se, a as xe } from "./chevron-up.81185563.js";
|
|
13
|
+
import { B as Ce } from "./base-button.ad74b6f8.js";
|
|
14
|
+
import { C as he } from "./cross-small.e851e0de.js";
|
|
15
|
+
import { B as Ee, a as Q } from "./loading-button.eafc9e1b.js";
|
|
16
|
+
import { o as Te } from "./resize.a041304d.js";
|
|
17
|
+
import "../assets/use-cached-selected-values.css";
|
|
18
|
+
const se = (t, e, s, l) => {
|
|
19
|
+
const n = i(
|
|
20
20
|
() => {
|
|
21
|
-
var
|
|
22
|
-
return !!((
|
|
21
|
+
var d, r;
|
|
22
|
+
return !!((d = t.value) != null && d.length) && ((r = t.value) == null ? void 0 : r.length) === e.value.length;
|
|
23
23
|
}
|
|
24
|
-
), o =
|
|
25
|
-
var
|
|
26
|
-
return t.value == null || t.value.length === 0 ? !1 : ((
|
|
24
|
+
), o = i(() => {
|
|
25
|
+
var d;
|
|
26
|
+
return t.value == null || t.value.length === 0 ? !1 : ((d = t.value) == null ? void 0 : d.length) !== e.value.length;
|
|
27
27
|
});
|
|
28
28
|
return {
|
|
29
29
|
isAllSelected: n,
|
|
30
30
|
isIndeterminate: o,
|
|
31
|
-
toggleSelectAll: (
|
|
32
|
-
|
|
31
|
+
toggleSelectAll: (d) => {
|
|
32
|
+
d ? s() : l();
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
|
-
function
|
|
37
|
-
const o =
|
|
38
|
-
let
|
|
39
|
-
const
|
|
40
|
-
const
|
|
36
|
+
function Le(t, { disabled: e, itemHeight: s, overscan: l = 5, prefixHeight: n }) {
|
|
37
|
+
const o = A(null), _ = A([]), d = A(0), r = A(0), u = A(0);
|
|
38
|
+
let p;
|
|
39
|
+
const h = i(() => {
|
|
40
|
+
const S = typeof s == "number" ? t.value.length * s : t.value.reduce((L, m, x) => L + s(x), 0), O = typeof s == "number" ? d.value * s : t.value.slice(0, d.value).reduce((L, m, x) => L + s(x), 0);
|
|
41
41
|
return {
|
|
42
42
|
style: {
|
|
43
43
|
marginTop: `${O}px`,
|
|
44
|
-
height: `${
|
|
44
|
+
height: `${S - O}px`
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
-
}),
|
|
48
|
-
const
|
|
47
|
+
}), E = () => {
|
|
48
|
+
const S = (n == null ? void 0 : n.value) ?? 0, O = Math.max(o.value.scrollTop - S, 0);
|
|
49
49
|
if (typeof s == "number")
|
|
50
50
|
return Math.floor(O / s);
|
|
51
|
-
let
|
|
52
|
-
for (let
|
|
53
|
-
const R = s(
|
|
54
|
-
if (
|
|
55
|
-
|
|
51
|
+
let L = 0, m = 0;
|
|
52
|
+
for (let x = 0; x < t.value.length; x += 1) {
|
|
53
|
+
const R = s(x);
|
|
54
|
+
if (L += R, L >= O) {
|
|
55
|
+
m = x;
|
|
56
56
|
break;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
return
|
|
60
|
-
},
|
|
59
|
+
return m;
|
|
60
|
+
}, v = () => {
|
|
61
61
|
if (u.value = o.value.clientHeight, typeof s == "number")
|
|
62
62
|
return Math.ceil(u.value / s);
|
|
63
|
-
const
|
|
64
|
-
let O = 0,
|
|
65
|
-
for (let
|
|
66
|
-
const
|
|
67
|
-
if (O +=
|
|
63
|
+
const S = d.value ?? 0;
|
|
64
|
+
let O = 0, L = 0;
|
|
65
|
+
for (let m = S; m < t.value.length; m += 1) {
|
|
66
|
+
const x = s(m);
|
|
67
|
+
if (O += x, L = m, O > u.value)
|
|
68
68
|
break;
|
|
69
69
|
}
|
|
70
|
-
return
|
|
71
|
-
},
|
|
70
|
+
return L - S;
|
|
71
|
+
}, y = () => {
|
|
72
72
|
if (o.value) {
|
|
73
|
-
const
|
|
74
|
-
|
|
73
|
+
const S = v();
|
|
74
|
+
d.value = E(), r.value = Math.min(d.value + S + l, t.value.length), _.value = t.value.slice(d.value, r.value);
|
|
75
75
|
}
|
|
76
|
-
},
|
|
77
|
-
|
|
76
|
+
}, T = () => {
|
|
77
|
+
y();
|
|
78
78
|
};
|
|
79
|
-
e || (
|
|
80
|
-
o.value && (u.value = o.value.clientHeight,
|
|
81
|
-
u.value =
|
|
82
|
-
}),
|
|
83
|
-
}),
|
|
84
|
-
|
|
85
|
-
}),
|
|
79
|
+
e || (ee(() => {
|
|
80
|
+
o.value && (u.value = o.value.clientHeight, p = Te(o.value, ({ clientHeight: S }) => {
|
|
81
|
+
u.value = S, y();
|
|
82
|
+
}), y());
|
|
83
|
+
}), ve(() => {
|
|
84
|
+
p == null || p.disconnect();
|
|
85
|
+
}), te(
|
|
86
86
|
() => t.value,
|
|
87
87
|
() => {
|
|
88
|
-
|
|
88
|
+
y();
|
|
89
89
|
}
|
|
90
90
|
));
|
|
91
91
|
const B = {
|
|
@@ -102,16 +102,16 @@ function Ee(t, { disabled: e, itemHeight: s, overscan: l = 5, prefixHeight: n })
|
|
|
102
102
|
} : {
|
|
103
103
|
containerRef: o,
|
|
104
104
|
containerProps: B,
|
|
105
|
-
onScroll:
|
|
106
|
-
list:
|
|
107
|
-
wrapperProps:
|
|
105
|
+
onScroll: T,
|
|
106
|
+
list: _,
|
|
107
|
+
wrapperProps: h
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
|
-
var
|
|
111
|
-
const
|
|
110
|
+
var a = /* @__PURE__ */ ((t) => (t.SELECT = "select", t.SHOW_MORE = "show-more", t.ESCAPE = "escape-pressed", t.CLICK = "click", t.ENTER = "enter-pressed", t.SPACE = "space-pressed", t.TAB = "tab-pressed", t.CLOSE_DROPDOWN = "close-dropdown", t))(a || {}), M = /* @__PURE__ */ ((t) => (t.AUTOMATIC = "automatic", t.BUTTON = "button", t.NONE = "none", t))(M || {});
|
|
111
|
+
const Oe = D({
|
|
112
112
|
name: "bento-listbox-static-category",
|
|
113
113
|
components: {
|
|
114
|
-
BentoTypography:
|
|
114
|
+
BentoTypography: w
|
|
115
115
|
},
|
|
116
116
|
props: {
|
|
117
117
|
/**
|
|
@@ -123,20 +123,20 @@ const he = D({
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
});
|
|
126
|
-
var
|
|
126
|
+
var Ae = function() {
|
|
127
127
|
var e = this, s = e._self._c;
|
|
128
128
|
return e._self._setupProxy, s("div", { staticClass: "b-listbox-single-select-category" }, [s("bento-typography", { staticClass: "b-listbox-single-select-category__label-text", attrs: { variant: "caption", el: "span" } }, [e._v(" " + e._s(e.categoryLabel) + " ")]), s("div", [e._t("default")], 2)], 1);
|
|
129
|
-
},
|
|
130
|
-
he,
|
|
129
|
+
}, Ie = [], Be = /* @__PURE__ */ N(
|
|
131
130
|
Oe,
|
|
132
|
-
|
|
131
|
+
Ae,
|
|
132
|
+
Ie,
|
|
133
133
|
!1,
|
|
134
134
|
null,
|
|
135
135
|
"4aa8cc6e",
|
|
136
136
|
null,
|
|
137
137
|
null
|
|
138
138
|
);
|
|
139
|
-
const
|
|
139
|
+
const Re = Be.exports, ke = D({
|
|
140
140
|
name: "bento-listbox-option",
|
|
141
141
|
props: {
|
|
142
142
|
/**
|
|
@@ -148,29 +148,29 @@ const Ae = Le.exports, Ie = D({
|
|
|
148
148
|
*/
|
|
149
149
|
selected: { type: Boolean, default: !1 }
|
|
150
150
|
},
|
|
151
|
-
emits: [
|
|
151
|
+
emits: [a.CLICK, a.ENTER, a.SPACE, a.TAB],
|
|
152
152
|
setup(t, { emit: e }) {
|
|
153
|
-
const s =
|
|
153
|
+
const s = i(() => ({
|
|
154
154
|
"b-listbox-option--disabled": t.disabled,
|
|
155
155
|
"b-listbox-option--selected": t.selected
|
|
156
156
|
}));
|
|
157
157
|
return {
|
|
158
158
|
// Enums
|
|
159
159
|
BentoKeyboardNavigationKeyDownEvent: k,
|
|
160
|
-
BentoListboxEvent:
|
|
160
|
+
BentoListboxEvent: a,
|
|
161
161
|
// Values
|
|
162
162
|
conditionalClasses: s,
|
|
163
163
|
// Events
|
|
164
164
|
onClick: (o) => {
|
|
165
|
-
e(
|
|
165
|
+
e(a.CLICK, o);
|
|
166
166
|
},
|
|
167
|
-
onOptionSelected: (o,
|
|
168
|
-
e(o,
|
|
167
|
+
onOptionSelected: (o, _) => {
|
|
168
|
+
e(o, _);
|
|
169
169
|
}
|
|
170
170
|
};
|
|
171
171
|
}
|
|
172
172
|
});
|
|
173
|
-
var
|
|
173
|
+
var De = function() {
|
|
174
174
|
var e = this, s = e._self._c;
|
|
175
175
|
return e._self._setupProxy, s("label", e._b({ staticClass: "b-listbox-option", class: e.conditionalClasses, attrs: { role: "option" }, on: { click: e.onClick, keydown: [function(l) {
|
|
176
176
|
return !l.type.indexOf("key") && e._k(l.keyCode, "enter", 13, l.key, "Enter") ? null : e.onOptionSelected(e.BentoListboxEvent.ENTER, l);
|
|
@@ -179,22 +179,22 @@ var Be = function() {
|
|
|
179
179
|
}, function(l) {
|
|
180
180
|
return !l.type.indexOf("key") && e._k(l.keyCode, "tab", 9, l.key, "Tab") ? null : e.onOptionSelected(e.BentoListboxEvent.TAB, l);
|
|
181
181
|
}] } }, "label", e.$attrs, !1), [e._t("default")], 2);
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
182
|
+
}, Ne = [], Pe = /* @__PURE__ */ N(
|
|
183
|
+
ke,
|
|
184
|
+
De,
|
|
185
|
+
Ne,
|
|
186
186
|
!1,
|
|
187
187
|
null,
|
|
188
188
|
"d7fb415c",
|
|
189
189
|
null,
|
|
190
190
|
null
|
|
191
191
|
);
|
|
192
|
-
const
|
|
192
|
+
const q = Pe.exports, $e = D({
|
|
193
193
|
name: "bento-listbox-single-select-option",
|
|
194
194
|
components: {
|
|
195
|
-
BentoListboxOption:
|
|
196
|
-
BentoTypography:
|
|
197
|
-
CheckmarkIcon:
|
|
195
|
+
BentoListboxOption: q,
|
|
196
|
+
BentoTypography: w,
|
|
197
|
+
CheckmarkIcon: pe
|
|
198
198
|
},
|
|
199
199
|
props: {
|
|
200
200
|
/**
|
|
@@ -214,24 +214,24 @@ const W = ke.exports, De = D({
|
|
|
214
214
|
*/
|
|
215
215
|
selected: { type: Boolean, default: !1 }
|
|
216
216
|
},
|
|
217
|
-
emits: [
|
|
217
|
+
emits: [a.ENTER, a.SELECT, a.SPACE, a.TAB],
|
|
218
218
|
setup(t, { emit: e }) {
|
|
219
|
-
const s = (
|
|
220
|
-
t.disabled || e(
|
|
221
|
-
}, l =
|
|
219
|
+
const s = (_) => {
|
|
220
|
+
t.disabled || e(_, t.option);
|
|
221
|
+
}, l = i(() => t.disabled ? !0 : null), n = i(() => t.selected ? !0 : null), o = i(() => t.disabled ? -1 : 0);
|
|
222
222
|
return {
|
|
223
223
|
// Values
|
|
224
224
|
ariaDisabled: l,
|
|
225
225
|
ariaSelected: n,
|
|
226
226
|
tabIndex: o,
|
|
227
227
|
// Enums
|
|
228
|
-
BentoListboxEvent:
|
|
228
|
+
BentoListboxEvent: a,
|
|
229
229
|
// Events
|
|
230
230
|
onOptionSelected: s
|
|
231
231
|
};
|
|
232
232
|
}
|
|
233
233
|
});
|
|
234
|
-
var
|
|
234
|
+
var Me = function() {
|
|
235
235
|
var e = this, s = e._self._c;
|
|
236
236
|
return e._self._setupProxy, s("bento-listbox-option", { staticClass: "b-listbox-single-select-option", attrs: { disabled: e.disabled, selected: e.selected, "aria-selected": e.ariaSelected, "aria-disabled": e.ariaDisabled, tabindex: e.tabIndex }, on: e._d({ click: function(l) {
|
|
237
237
|
return e.onOptionSelected(e.BentoListboxEvent.SELECT);
|
|
@@ -244,23 +244,23 @@ var Ne = function() {
|
|
|
244
244
|
}]) }, [e._t("default", function() {
|
|
245
245
|
return [s("span", { staticClass: "b-listbox-single-select-option__text" }, [s("bento-typography", { attrs: { el: "span" } }, [e._v(e._s(e.option.label))]), e.option.description ? s("bento-typography", { staticClass: "b-listbox-single-select-option__description", attrs: { el: "span" } }, [e._v(" " + e._s(e.option.description) + " ")]) : e._e()], 1)];
|
|
246
246
|
}, null, e.option), s("span", { staticClass: "b-listbox-single-select-option__check-icon" }, [s("checkmark-icon", { directives: [{ name: "show", rawName: "v-show", value: e.selected, expression: "selected" }], attrs: { "svg-title": "selected" } })], 1)], 2);
|
|
247
|
-
},
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
247
|
+
}, we = [], Fe = /* @__PURE__ */ N(
|
|
248
|
+
$e,
|
|
249
|
+
Me,
|
|
250
|
+
we,
|
|
251
251
|
!1,
|
|
252
252
|
null,
|
|
253
|
-
"
|
|
253
|
+
"3ba7da5b",
|
|
254
254
|
null,
|
|
255
255
|
null
|
|
256
256
|
);
|
|
257
|
-
const
|
|
258
|
-
const l =
|
|
259
|
-
|
|
260
|
-
e && (n.value = t.value.findIndex((
|
|
257
|
+
const Ge = Fe.exports, le = ({ items: t, isOptionDisabled: e }, s) => {
|
|
258
|
+
const l = i(() => t.value.length - 1), n = A(0);
|
|
259
|
+
ee(() => {
|
|
260
|
+
e && (n.value = t.value.findIndex((v) => !e(v)));
|
|
261
261
|
});
|
|
262
|
-
const o = (
|
|
263
|
-
switch (
|
|
262
|
+
const o = (v) => !e || !!e && e(t.value[v]), _ = (v) => !e || !!e && !e(t.value[v]), d = (v) => {
|
|
263
|
+
switch (v) {
|
|
264
264
|
case "increase":
|
|
265
265
|
n.value += 1;
|
|
266
266
|
break;
|
|
@@ -268,31 +268,31 @@ const Me = $e.exports, se = ({ items: t, isOptionDisabled: e }, s) => {
|
|
|
268
268
|
n.value -= 1;
|
|
269
269
|
break;
|
|
270
270
|
}
|
|
271
|
-
},
|
|
272
|
-
n.value !==
|
|
273
|
-
}, u = (
|
|
274
|
-
var
|
|
275
|
-
(
|
|
276
|
-
const
|
|
277
|
-
|
|
271
|
+
}, r = ({ edgeCaseItem: v, isItemBeforeEdgeCaseItem: y }, T, B) => {
|
|
272
|
+
n.value !== v && (y ? _(v) && d(B) : (d(B), o(n.value) && T()), s(n.value));
|
|
273
|
+
}, u = (v) => {
|
|
274
|
+
var T;
|
|
275
|
+
(T = v == null ? void 0 : v.detail) == null || T.preventDefault();
|
|
276
|
+
const y = n.value === l.value - 2;
|
|
277
|
+
r(
|
|
278
278
|
{
|
|
279
|
-
isItemBeforeEdgeCaseItem:
|
|
279
|
+
isItemBeforeEdgeCaseItem: y,
|
|
280
280
|
edgeCaseItem: l.value
|
|
281
281
|
},
|
|
282
282
|
u,
|
|
283
283
|
"increase"
|
|
284
284
|
/* INCREASE */
|
|
285
285
|
);
|
|
286
|
-
},
|
|
287
|
-
var
|
|
288
|
-
(
|
|
289
|
-
const
|
|
290
|
-
|
|
286
|
+
}, p = (v) => {
|
|
287
|
+
var T;
|
|
288
|
+
(T = v == null ? void 0 : v.detail) == null || T.preventDefault();
|
|
289
|
+
const y = n.value === 1;
|
|
290
|
+
r(
|
|
291
291
|
{
|
|
292
292
|
edgeCaseItem: 0,
|
|
293
|
-
isItemBeforeEdgeCaseItem:
|
|
293
|
+
isItemBeforeEdgeCaseItem: y
|
|
294
294
|
},
|
|
295
|
-
|
|
295
|
+
p,
|
|
296
296
|
"decrease"
|
|
297
297
|
/* DECREASE */
|
|
298
298
|
);
|
|
@@ -302,18 +302,18 @@ const Me = $e.exports, se = ({ items: t, isOptionDisabled: e }, s) => {
|
|
|
302
302
|
n.value = 0, o(n.value) ? u() : s(n.value);
|
|
303
303
|
},
|
|
304
304
|
moveToLastElement: () => {
|
|
305
|
-
n.value = l.value, o(n.value) ?
|
|
305
|
+
n.value = l.value, o(n.value) ? p() : s(n.value);
|
|
306
306
|
},
|
|
307
307
|
moveToNextElement: u,
|
|
308
|
-
moveToPreviousElement:
|
|
308
|
+
moveToPreviousElement: p
|
|
309
309
|
};
|
|
310
|
-
},
|
|
310
|
+
}, Ue = D({
|
|
311
311
|
name: "bento-listbox-single-select",
|
|
312
312
|
components: {
|
|
313
|
-
BentoListboxSingleSelectCategory:
|
|
314
|
-
BentoListboxSingleSelectOption:
|
|
313
|
+
BentoListboxSingleSelectCategory: Re,
|
|
314
|
+
BentoListboxSingleSelectOption: Ge
|
|
315
315
|
},
|
|
316
|
-
directives: { BentoKeyboardNavigationDirective:
|
|
316
|
+
directives: { BentoKeyboardNavigationDirective: X },
|
|
317
317
|
inheritAttrs: !1,
|
|
318
318
|
props: {
|
|
319
319
|
/**
|
|
@@ -346,7 +346,7 @@ const Me = $e.exports, se = ({ items: t, isOptionDisabled: e }, s) => {
|
|
|
346
346
|
* Set to an empty string `''` if you don't want any of the available options to be selected
|
|
347
347
|
*/
|
|
348
348
|
selectedValue: {
|
|
349
|
-
type:
|
|
349
|
+
type: Array,
|
|
350
350
|
default: void 0
|
|
351
351
|
},
|
|
352
352
|
/**
|
|
@@ -354,86 +354,90 @@ const Me = $e.exports, se = ({ items: t, isOptionDisabled: e }, s) => {
|
|
|
354
354
|
*/
|
|
355
355
|
staticCategories: { type: Boolean, default: !1 }
|
|
356
356
|
},
|
|
357
|
-
emits: [
|
|
357
|
+
emits: [a.SELECT, a.ENTER, a.SPACE, a.TAB],
|
|
358
358
|
setup(t, { emit: e, slots: s }) {
|
|
359
|
-
const l =
|
|
360
|
-
|
|
361
|
-
|
|
359
|
+
const l = A([]), n = i(() => {
|
|
360
|
+
var y;
|
|
361
|
+
return !!((y = t.selectedValue) != null && y.length) && t.selectedValue.at(0);
|
|
362
|
+
}), o = i(() => !!t.items.some(({ items: y }) => !!y)), _ = (y) => (T) => {
|
|
363
|
+
e(y, [T]);
|
|
364
|
+
}, d = (y) => l.value[y].$el.focus(), { moveToNextElement: r, moveToPreviousElement: u, moveToFirstElement: p, moveToLastElement: h } = le(
|
|
362
365
|
{
|
|
363
366
|
items: V(t, "items"),
|
|
364
367
|
isOptionDisabled: t.isOptionDisabled
|
|
365
368
|
},
|
|
366
|
-
|
|
367
|
-
),
|
|
368
|
-
[k.ARROW_UP]:
|
|
369
|
-
[k.ARROW_DOWN]:
|
|
370
|
-
[k.HOME]:
|
|
371
|
-
[k.END]:
|
|
372
|
-
},
|
|
373
|
-
[
|
|
374
|
-
[
|
|
375
|
-
[
|
|
376
|
-
[
|
|
369
|
+
d
|
|
370
|
+
), E = {
|
|
371
|
+
[k.ARROW_UP]: u,
|
|
372
|
+
[k.ARROW_DOWN]: r,
|
|
373
|
+
[k.HOME]: p,
|
|
374
|
+
[k.END]: h
|
|
375
|
+
}, v = {
|
|
376
|
+
[a.SELECT]: _(a.SELECT),
|
|
377
|
+
[a.SPACE]: _(a.SPACE),
|
|
378
|
+
[a.TAB]: _(a.TAB),
|
|
379
|
+
[a.ENTER]: _(a.ENTER)
|
|
377
380
|
};
|
|
378
381
|
return {
|
|
379
382
|
// Enums
|
|
380
|
-
BentoListboxEvent:
|
|
383
|
+
BentoListboxEvent: a,
|
|
381
384
|
// Values
|
|
382
385
|
listboxItemRef: l,
|
|
386
|
+
selectedItem: n,
|
|
383
387
|
slots: s,
|
|
384
388
|
// Computed
|
|
385
|
-
hasCategories:
|
|
389
|
+
hasCategories: o,
|
|
386
390
|
// Methods
|
|
387
|
-
onOptionSelected:
|
|
391
|
+
onOptionSelected: _,
|
|
388
392
|
// Keyboard navigation
|
|
389
|
-
listboxListeners:
|
|
390
|
-
listboxOptionListeners:
|
|
393
|
+
listboxListeners: E,
|
|
394
|
+
listboxOptionListeners: v
|
|
391
395
|
};
|
|
392
396
|
}
|
|
393
397
|
});
|
|
394
|
-
var
|
|
398
|
+
var ze = function() {
|
|
395
399
|
var e = this, s = e._self._c;
|
|
396
400
|
return e._self._setupProxy, s("div", e._g({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }] }, e.listboxListeners), [e.hasCategories && e.staticCategories ? e._l(e.items, function(l) {
|
|
397
401
|
return s("bento-listbox-single-select-category", { key: l.value, attrs: { "category-label": l.label, role: "group" } }, e._l(l.items, function(n) {
|
|
398
|
-
return s("bento-listbox-single-select-option", e._g({ key: n.value, ref: "listboxItemRef", refInFor: !0, attrs: { role: "option", option: n, disabled: e.isOptionDisabled ? e.isOptionDisabled(n) : null, selected: n.value === e.
|
|
399
|
-
return { key:
|
|
400
|
-
return [e._t(
|
|
402
|
+
return s("bento-listbox-single-select-option", e._g({ key: n.value, ref: "listboxItemRef", refInFor: !0, attrs: { role: "option", option: n, disabled: e.isOptionDisabled ? e.isOptionDisabled(n) : null, selected: n.value === e.selectedItem.value }, scopedSlots: e._u([e._l(e.slots, function(o, _) {
|
|
403
|
+
return { key: _, fn: function(d) {
|
|
404
|
+
return [e._t(_, null, null, d)];
|
|
401
405
|
} };
|
|
402
406
|
})], null, !0) }, e.listboxOptionListeners));
|
|
403
407
|
}), 1);
|
|
404
408
|
}) : e._l(e.items, function(l) {
|
|
405
|
-
return s("bento-listbox-single-select-option", e._g({ key: l.value, ref: "listboxItemRef", refInFor: !0, attrs: { role: "option", option: l, disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null, selected: l.value === e.
|
|
406
|
-
return { key: o, fn: function(
|
|
407
|
-
return [e._t(o, null, null,
|
|
409
|
+
return s("bento-listbox-single-select-option", e._g({ key: l.value, ref: "listboxItemRef", refInFor: !0, attrs: { role: "option", option: l, disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null, selected: l.value === e.selectedItem.value }, scopedSlots: e._u([e._l(e.slots, function(n, o) {
|
|
410
|
+
return { key: o, fn: function(_) {
|
|
411
|
+
return [e._t(o, null, null, _)];
|
|
408
412
|
} };
|
|
409
413
|
})], null, !0) }, e.listboxOptionListeners));
|
|
410
414
|
})], 2);
|
|
411
|
-
},
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
+
}, Ve = [], Ye = /* @__PURE__ */ N(
|
|
416
|
+
Ue,
|
|
417
|
+
ze,
|
|
418
|
+
Ve,
|
|
415
419
|
!1,
|
|
416
420
|
null,
|
|
417
421
|
null,
|
|
418
422
|
null,
|
|
419
423
|
null
|
|
420
424
|
);
|
|
421
|
-
const
|
|
422
|
-
var j = /* @__PURE__ */ ((t) => (t.DISABLED = "disabled", t.STATIC_CATEGORY = "static-category", t))(j || {}),
|
|
423
|
-
const
|
|
425
|
+
const qe = Ye.exports;
|
|
426
|
+
var j = /* @__PURE__ */ ((t) => (t.DISABLED = "disabled", t.STATIC_CATEGORY = "static-category", t))(j || {}), U = /* @__PURE__ */ ((t) => (t.SELECT_CATEGORY = "select-category", t.UNSELECT_CATEGORY = "unselect-category", t))(U || {});
|
|
427
|
+
const We = {
|
|
424
428
|
"en-US": {
|
|
425
429
|
categoryClosed: "{category} closed",
|
|
426
430
|
categoryOpened: "{category} opened"
|
|
427
431
|
}
|
|
428
|
-
},
|
|
429
|
-
i18n: { messages:
|
|
432
|
+
}, Ke = D({
|
|
433
|
+
i18n: { messages: We },
|
|
430
434
|
name: "bento-listbox-multi-select-category",
|
|
431
435
|
components: {
|
|
432
|
-
BentoCheckbox:
|
|
433
|
-
BentoTypography:
|
|
434
|
-
BentoListboxOption:
|
|
435
|
-
ChevronDownIcon:
|
|
436
|
-
ChevronUpIcon:
|
|
436
|
+
BentoCheckbox: J,
|
|
437
|
+
BentoTypography: w,
|
|
438
|
+
BentoListboxOption: q,
|
|
439
|
+
ChevronDownIcon: Se,
|
|
440
|
+
ChevronUpIcon: xe
|
|
437
441
|
},
|
|
438
442
|
props: {
|
|
439
443
|
/**
|
|
@@ -474,94 +478,94 @@ const Ve = {
|
|
|
474
478
|
*/
|
|
475
479
|
staticCategories: { type: Boolean, default: !1 }
|
|
476
480
|
},
|
|
477
|
-
emits: [
|
|
481
|
+
emits: [U.SELECT_CATEGORY, U.UNSELECT_CATEGORY],
|
|
478
482
|
setup(t, { emit: e }) {
|
|
479
|
-
const s =
|
|
480
|
-
() => t.category.items.every((
|
|
481
|
-
),
|
|
483
|
+
const s = A(!1), { t: l } = Y(), n = (m) => t.isOptionDisabled ? t.isOptionDisabled(m) : !1, o = i(
|
|
484
|
+
() => t.category.items.every((m) => n(m))
|
|
485
|
+
), _ = V(t, "staticCategories"), d = i(() => s.value || t.staticCategories), r = i(() => ({
|
|
482
486
|
[`b-listbox-multi-select-category--${j.DISABLED}`]: o.value,
|
|
483
487
|
[`b-listbox-multi-select-category--${j.STATIC_CATEGORY}`]: t.staticCategories
|
|
484
|
-
})), u = (
|
|
485
|
-
|
|
486
|
-
},
|
|
487
|
-
var
|
|
488
|
-
const
|
|
489
|
-
return { isDisabled:
|
|
490
|
-
},
|
|
491
|
-
() => t.category.items.filter((
|
|
492
|
-
const { isDisabled:
|
|
493
|
-
return
|
|
488
|
+
})), u = (m) => {
|
|
489
|
+
m.preventDefault(), s.value = !s.value;
|
|
490
|
+
}, p = (m) => {
|
|
491
|
+
var F;
|
|
492
|
+
const x = n(m), R = ((F = t.selectedItemsList) == null ? void 0 : F.includes(m.value)) || !1;
|
|
493
|
+
return { isDisabled: x, isPreSelected: R };
|
|
494
|
+
}, h = i(
|
|
495
|
+
() => t.category.items.filter((m) => {
|
|
496
|
+
const { isDisabled: x, isPreSelected: R } = p(m);
|
|
497
|
+
return x && R || !x;
|
|
494
498
|
})
|
|
495
|
-
),
|
|
499
|
+
), E = i(
|
|
496
500
|
() => {
|
|
497
|
-
var
|
|
498
|
-
return (
|
|
499
|
-
({ value:
|
|
501
|
+
var m;
|
|
502
|
+
return (m = h.value) == null ? void 0 : m.filter(
|
|
503
|
+
({ value: x }) => {
|
|
500
504
|
var R;
|
|
501
|
-
return (R = t.selectedItemsList) == null ? void 0 : R.includes(
|
|
505
|
+
return (R = t.selectedItemsList) == null ? void 0 : R.includes(x);
|
|
502
506
|
}
|
|
503
507
|
);
|
|
504
508
|
}
|
|
505
|
-
),
|
|
506
|
-
const
|
|
507
|
-
return l(
|
|
508
|
-
}),
|
|
509
|
+
), v = i(() => {
|
|
510
|
+
const m = s.value ? "categoryOpened" : "categoryClosed";
|
|
511
|
+
return l(m, { category: t.category.label });
|
|
512
|
+
}), y = i(
|
|
509
513
|
() => ({
|
|
510
514
|
el: "span",
|
|
511
515
|
variant: t.staticCategories ? "caption" : "body"
|
|
512
516
|
})
|
|
513
|
-
),
|
|
514
|
-
e(
|
|
517
|
+
), T = () => {
|
|
518
|
+
e(U.SELECT_CATEGORY);
|
|
515
519
|
}, B = () => {
|
|
516
|
-
e(
|
|
517
|
-
}, { isAllSelected:
|
|
518
|
-
I,
|
|
519
|
-
A,
|
|
520
|
+
e(U.UNSELECT_CATEGORY);
|
|
521
|
+
}, { isAllSelected: S, isIndeterminate: O, toggleSelectAll: L } = se(
|
|
520
522
|
E,
|
|
523
|
+
h,
|
|
524
|
+
T,
|
|
521
525
|
B
|
|
522
526
|
);
|
|
523
527
|
return {
|
|
524
528
|
// Values
|
|
525
|
-
chevronTitle:
|
|
526
|
-
conditionalClass:
|
|
529
|
+
chevronTitle: v,
|
|
530
|
+
conditionalClass: r,
|
|
527
531
|
hasAllPropsDisabled: o,
|
|
528
532
|
isOpen: s,
|
|
529
|
-
isAllSelected:
|
|
533
|
+
isAllSelected: S,
|
|
530
534
|
isIndeterminate: O,
|
|
531
|
-
isStaticCategory:
|
|
535
|
+
isStaticCategory: _,
|
|
532
536
|
// Computed
|
|
533
|
-
showItemChildren:
|
|
534
|
-
categoryLabelProps:
|
|
537
|
+
showItemChildren: d,
|
|
538
|
+
categoryLabelProps: y,
|
|
535
539
|
// Methods
|
|
536
540
|
toggleOpen: u,
|
|
537
|
-
toggleSelectAll:
|
|
541
|
+
toggleSelectAll: L
|
|
538
542
|
};
|
|
539
543
|
}
|
|
540
544
|
});
|
|
541
|
-
var
|
|
545
|
+
var je = function() {
|
|
542
546
|
var e = this, s = e._self._c;
|
|
543
547
|
return e._self._setupProxy, s("div", [s("bento-listbox-option", { staticClass: "b-listbox-multi-select-category__option", class: e.conditionalClass }, [e.isStaticCategory ? e._e() : s("bento-checkbox", { attrs: { "model-value": e.isAllSelected, indeterminate: e.isIndeterminate, disabled: e.hasAllPropsDisabled, "aria-label": e.category.label, value: e.category.value }, on: { "update:model-value": e.toggleSelectAll } }), s("span", { staticClass: "b-listbox-multi-select-category__label" }, [s("bento-typography", e._b({ staticClass: "b-listbox-multi-select-category__label-text" }, "bento-typography", e.categoryLabelProps, !1), [e._v(" " + e._s(e.category.label) + " ")]), e.isStaticCategory ? e._e() : s("div", { staticClass: "b-listbox-multi-select-category__label-chevron", attrs: { "data-testid": "toggle-listbox" }, on: { "!click": function(l) {
|
|
544
548
|
return e.toggleOpen.apply(null, arguments);
|
|
545
549
|
} } }, [e.isOpen ? s("chevron-up-icon", { attrs: { "svg-title": e.chevronTitle } }) : s("chevron-down-icon", { attrs: { "svg-title": e.chevronTitle } })], 1)], 1)], 1), s("div", { directives: [{ name: "show", rawName: "v-show", value: e.showItemChildren, expression: "showItemChildren" }] }, [e._t("default")], 2)], 1);
|
|
546
|
-
},
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
+
}, He = [], Xe = /* @__PURE__ */ N(
|
|
551
|
+
Ke,
|
|
552
|
+
je,
|
|
553
|
+
He,
|
|
550
554
|
!1,
|
|
551
555
|
null,
|
|
552
556
|
"f360ac3d",
|
|
553
557
|
null,
|
|
554
558
|
null
|
|
555
559
|
);
|
|
556
|
-
const
|
|
557
|
-
var
|
|
558
|
-
const
|
|
560
|
+
const Je = Xe.exports;
|
|
561
|
+
var $ = /* @__PURE__ */ ((t) => (t.SELECT_CATEGORY = "select-category", t.TOGGLE_CHECKBOX_SELECTION = "toggle-checkbox-selection", t.UNSELECT_CATEGORY = "unselect-category", t))($ || {});
|
|
562
|
+
const Qe = D({
|
|
559
563
|
name: "listbox-multi-select-options",
|
|
560
564
|
components: {
|
|
561
|
-
BentoCheckbox:
|
|
562
|
-
BentoListboxOption:
|
|
563
|
-
BentoTypography:
|
|
564
|
-
ListboxMultiSelectCategory:
|
|
565
|
+
BentoCheckbox: J,
|
|
566
|
+
BentoListboxOption: q,
|
|
567
|
+
BentoTypography: w,
|
|
568
|
+
ListboxMultiSelectCategory: Je
|
|
565
569
|
},
|
|
566
570
|
props: {
|
|
567
571
|
/**
|
|
@@ -619,40 +623,39 @@ const He = D({
|
|
|
619
623
|
staticCategories: { type: Boolean, default: !1 }
|
|
620
624
|
},
|
|
621
625
|
emits: [
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
626
|
+
$.TOGGLE_CHECKBOX_SELECTION,
|
|
627
|
+
$.SELECT_CATEGORY,
|
|
628
|
+
$.UNSELECT_CATEGORY
|
|
625
629
|
],
|
|
626
630
|
setup(t, { emit: e }) {
|
|
627
|
-
const s = (
|
|
628
|
-
e(
|
|
629
|
-
}, l = (
|
|
631
|
+
const s = (r) => {
|
|
632
|
+
e($.TOGGLE_CHECKBOX_SELECTION, r);
|
|
633
|
+
}, l = (r) => !!r.items, n = (r) => {
|
|
630
634
|
const u = t.isMultiLevel && t.searching;
|
|
631
|
-
return
|
|
632
|
-
}, o = (
|
|
635
|
+
return r.description && (!t.isMultiLevel || u);
|
|
636
|
+
}, o = (r) => r.items ? !!r.items.find((u) => t.selectedItemsList.includes(u.value)) : t.selectedItemsList.includes(r.value), _ = (r, u) => {
|
|
633
637
|
if (l(u))
|
|
634
|
-
return e(
|
|
638
|
+
return e(r ? $.SELECT_CATEGORY : $.UNSELECT_CATEGORY, u);
|
|
635
639
|
s(u.value);
|
|
636
640
|
};
|
|
637
641
|
return {
|
|
638
642
|
// Values
|
|
639
|
-
conditionalClasses:
|
|
643
|
+
conditionalClasses: i(() => ({
|
|
640
644
|
"b-listbox-multi-select-options__static-category-option": t.staticCategories,
|
|
641
645
|
"b-listbox-multi-select-options__category-option": t.categoryItems
|
|
642
646
|
})),
|
|
643
647
|
// Methods
|
|
644
|
-
isCategory: l,
|
|
645
648
|
isOptionSelected: o,
|
|
646
649
|
shouldShowDescription: n,
|
|
647
650
|
toggleCheckboxSelection: s,
|
|
648
|
-
selectSearch:
|
|
651
|
+
selectSearch: _,
|
|
649
652
|
// Enums
|
|
650
|
-
BentoListboxEvent:
|
|
651
|
-
ListboxMultiSelectOptionsEvent:
|
|
653
|
+
BentoListboxEvent: a,
|
|
654
|
+
ListboxMultiSelectOptionsEvent: $
|
|
652
655
|
};
|
|
653
656
|
}
|
|
654
657
|
});
|
|
655
|
-
var
|
|
658
|
+
var Ze = function() {
|
|
656
659
|
var e = this, s = e._self._c;
|
|
657
660
|
return e._self._setupProxy, s("div", e._l(e.items, function(l) {
|
|
658
661
|
return s("div", { key: `selected-${l.value}` }, [e.searching && e.isMultiLevel ? [s("bento-listbox-option", { staticClass: "b-listbox-multi-select-options", class: e.conditionalClasses, attrs: { disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null } }, [s("bento-checkbox", { attrs: { "model-value": e.isOptionSelected(l), "aria-label": l.label, disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null, value: l.value }, on: { "update:model-value": (n) => e.selectSearch(n, l) } }), e._t("default", function() {
|
|
@@ -662,29 +665,29 @@ var Xe = function() {
|
|
|
662
665
|
}, "unselect-category": function(n) {
|
|
663
666
|
return e.$emit(e.ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY, l);
|
|
664
667
|
} } }, [s("listbox-multi-select-options", { attrs: { "category-items": "", items: l.items, "is-option-disabled": e.isOptionDisabled, "is-multi-level": e.isMultiLevel, "static-categories": e.staticCategories, "selected-items-list": e.selectedItemsList, searching: e.searching }, on: { "toggle-checkbox-selection": (n) => e.toggleCheckboxSelection(n) } })], 1)] : s("bento-listbox-option", { staticClass: "b-listbox-multi-select-options", class: e.conditionalClasses, attrs: { disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null } }, [s("bento-checkbox", { attrs: { "model-value": e.selectedItemsList, "aria-label": l.label, disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null, value: l.value }, on: { "update:model-value": function(n) {
|
|
665
|
-
return e.toggleCheckboxSelection(l
|
|
668
|
+
return e.toggleCheckboxSelection(l);
|
|
666
669
|
} } }), e._t("default", function() {
|
|
667
670
|
return [s("span", { staticClass: "b-listbox-multi-select__option-text" }, [s("bento-typography", { attrs: { el: "span" } }, [e._v(e._s(l.label))]), e.shouldShowDescription(l) ? s("bento-typography", { staticClass: "b-listbox-multi-select__option-description", attrs: { el: "span" } }, [e._v(" " + e._s(l.description) + " ")]) : e._e()], 1)];
|
|
668
671
|
}, null, l)], 2)]], 2);
|
|
669
672
|
}), 0);
|
|
670
|
-
},
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
673
|
+
}, et = [], tt = /* @__PURE__ */ N(
|
|
674
|
+
Qe,
|
|
675
|
+
Ze,
|
|
676
|
+
et,
|
|
674
677
|
!1,
|
|
675
678
|
null,
|
|
676
|
-
"
|
|
679
|
+
"b2db9f50",
|
|
677
680
|
null,
|
|
678
681
|
null
|
|
679
682
|
);
|
|
680
|
-
const
|
|
683
|
+
const st = tt.exports, lt = {
|
|
681
684
|
"en-US": {
|
|
682
685
|
remove: "Remove"
|
|
683
686
|
}
|
|
684
|
-
},
|
|
685
|
-
i18n: { messages:
|
|
686
|
-
},
|
|
687
|
-
...
|
|
687
|
+
}, nt = {
|
|
688
|
+
i18n: { messages: lt }
|
|
689
|
+
}, ot = /* @__PURE__ */ D({
|
|
690
|
+
...nt,
|
|
688
691
|
__name: "listbox-multi-select-chips",
|
|
689
692
|
props: {
|
|
690
693
|
/**
|
|
@@ -708,11 +711,11 @@ const Ze = Qe.exports, et = {
|
|
|
708
711
|
},
|
|
709
712
|
emits: ["unselect-item", "unselect-category"],
|
|
710
713
|
setup(t, { emit: e }) {
|
|
711
|
-
const { t: s } =
|
|
712
|
-
return { __sfc: !0, emit: e, t: s, unselectOption: (n) => n.items ? e("unselect-category", n) : e("unselect-item", n
|
|
714
|
+
const { t: s } = Y();
|
|
715
|
+
return { __sfc: !0, emit: e, t: s, unselectOption: (n) => n.items ? e("unselect-category", n) : e("unselect-item", n), BentoTypography: w, BaseButton: Ce, CrossSmallIcon: he };
|
|
713
716
|
}
|
|
714
717
|
});
|
|
715
|
-
var
|
|
718
|
+
var at = function() {
|
|
716
719
|
var e = this, s = e._self._c, l = e._self._setupProxy;
|
|
717
720
|
return s("div", { staticClass: "b-listbox-multi-select-chips" }, e._l(e.items, function(n) {
|
|
718
721
|
return s("div", { key: `selected-${n.value}` }, [s(l.BaseButton, { staticClass: "b-listbox-multi-select-chips__chip", attrs: { disabled: e.isOptionDisabled ? e.isOptionDisabled(n) : null }, on: { click: function(o) {
|
|
@@ -721,27 +724,28 @@ var lt = function() {
|
|
|
721
724
|
return [s(l.CrossSmallIcon, { attrs: { "svg-title": l.t("remove") } })];
|
|
722
725
|
}, proxy: !0 }], null, !0) }, [s(l.BentoTypography, { staticClass: "b-listbox-multi-select-chips__option-text", attrs: { el: "span", variant: "caption" } }, [e._v(e._s(n.label))])], 1)], 1);
|
|
723
726
|
}), 0);
|
|
724
|
-
},
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
727
|
+
}, it = [], ct = /* @__PURE__ */ N(
|
|
728
|
+
ot,
|
|
729
|
+
at,
|
|
730
|
+
it,
|
|
728
731
|
!1,
|
|
729
732
|
null,
|
|
730
|
-
"
|
|
733
|
+
"931e5246",
|
|
731
734
|
null,
|
|
732
735
|
null
|
|
733
736
|
);
|
|
734
|
-
const
|
|
737
|
+
const rt = ct.exports, ut = {
|
|
735
738
|
"en-US": {
|
|
736
739
|
allSelected: "All selected ({total})",
|
|
737
740
|
numberOfTotalSelected: "{number} of {total} selected",
|
|
741
|
+
numbersSelected: "{number} selected",
|
|
738
742
|
selectAll: "Select all ({total})"
|
|
739
743
|
}
|
|
740
|
-
},
|
|
741
|
-
const e =
|
|
744
|
+
}, dt = (t) => {
|
|
745
|
+
const e = i(() => {
|
|
742
746
|
var l;
|
|
743
747
|
return !!((l = t.value) != null && l.find(({ items: n }) => !!n));
|
|
744
|
-
}), s =
|
|
748
|
+
}), s = i(() => {
|
|
745
749
|
var l;
|
|
746
750
|
return e.value ? (l = t.value) == null ? void 0 : l.reduce((n, o) => (o.items ? n.push(...o.items.flat()) : n.push(o), n), []) : t.value;
|
|
747
751
|
});
|
|
@@ -749,18 +753,22 @@ const it = ot.exports, at = {
|
|
|
749
753
|
isMultiLevelSelect: e,
|
|
750
754
|
flattenedItemsList: s
|
|
751
755
|
};
|
|
752
|
-
},
|
|
753
|
-
i18n: { messages:
|
|
756
|
+
}, _t = D({
|
|
757
|
+
i18n: { messages: ut },
|
|
754
758
|
name: "bento-listbox-multi-select",
|
|
755
759
|
components: {
|
|
756
|
-
BentoCheckbox:
|
|
757
|
-
BentoListboxOption:
|
|
758
|
-
BentoTypography:
|
|
759
|
-
ListboxMultiSelectOptions:
|
|
760
|
-
ListboxMultiSelectChips:
|
|
760
|
+
BentoCheckbox: J,
|
|
761
|
+
BentoListboxOption: q,
|
|
762
|
+
BentoTypography: w,
|
|
763
|
+
ListboxMultiSelectOptions: st,
|
|
764
|
+
ListboxMultiSelectChips: rt
|
|
761
765
|
},
|
|
762
|
-
directives: { BentoKeyboardNavigationDirective:
|
|
766
|
+
directives: { BentoKeyboardNavigationDirective: X },
|
|
763
767
|
props: {
|
|
768
|
+
/**
|
|
769
|
+
* Indicates whether there are more items to load
|
|
770
|
+
*/
|
|
771
|
+
hasMoreItems: { type: Boolean, default: !1 },
|
|
764
772
|
/**
|
|
765
773
|
* Function that allows the options to be disabled
|
|
766
774
|
*
|
|
@@ -785,6 +793,16 @@ const it = ot.exports, at = {
|
|
|
785
793
|
type: Array,
|
|
786
794
|
required: !0
|
|
787
795
|
},
|
|
796
|
+
/**
|
|
797
|
+
* The type of `Lazy Load`.
|
|
798
|
+
* Type "automatic" will enable infinite scrolling
|
|
799
|
+
* Type "button" will enable lazy loading with "Show more" button
|
|
800
|
+
*/
|
|
801
|
+
lazyLoadType: {
|
|
802
|
+
type: String,
|
|
803
|
+
default: M.NONE,
|
|
804
|
+
validator: (t) => Object.values(M).includes(t)
|
|
805
|
+
},
|
|
788
806
|
/**
|
|
789
807
|
* Flag that indicates that an external search it's being made
|
|
790
808
|
* to filter out the items inside the the multi-select listbox
|
|
@@ -798,154 +816,152 @@ const it = ot.exports, at = {
|
|
|
798
816
|
*/
|
|
799
817
|
selectedValues: {
|
|
800
818
|
type: Array,
|
|
801
|
-
|
|
819
|
+
required: !0
|
|
802
820
|
},
|
|
803
821
|
/**
|
|
804
822
|
* If enabled, dropdown will display non-selectable, static categories
|
|
805
823
|
*/
|
|
806
824
|
staticCategories: { type: Boolean, default: !1 }
|
|
807
825
|
},
|
|
808
|
-
emits: [
|
|
826
|
+
emits: [a.SELECT],
|
|
809
827
|
setup(t, { emit: e, slots: s }) {
|
|
810
|
-
const { t: l } =
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
return
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
return _ && f || !_;
|
|
828
|
-
})
|
|
829
|
-
), I = c(
|
|
828
|
+
const { t: l } = Y(), n = A(null), o = A(null), _ = A(null), d = i(
|
|
829
|
+
() => t.selectedValues.map(({ value: c }) => c)
|
|
830
|
+
), { isMultiLevelSelect: r, flattenedItemsList: u } = dt(V(t, "items")), p = (c) => {
|
|
831
|
+
var C;
|
|
832
|
+
const b = t.isOptionDisabled(c), f = ((C = d.value) == null ? void 0 : C.includes(c.value)) || !1;
|
|
833
|
+
return { isDisabled: b, isPreSelected: f };
|
|
834
|
+
}, h = i(() => {
|
|
835
|
+
if (t.searching && r)
|
|
836
|
+
return t.items;
|
|
837
|
+
const c = u.value.filter((b) => {
|
|
838
|
+
const { isDisabled: f, isPreSelected: C } = p(b);
|
|
839
|
+
return f && C || !f;
|
|
840
|
+
});
|
|
841
|
+
return t.selectedValues.forEach((b) => {
|
|
842
|
+
c.find((f) => f.value === b.value) || c.push(b);
|
|
843
|
+
}), c;
|
|
844
|
+
}), E = i(
|
|
830
845
|
() => {
|
|
831
|
-
var
|
|
832
|
-
return (
|
|
846
|
+
var c;
|
|
847
|
+
return (c = h.value) == null ? void 0 : c.filter((b) => {
|
|
833
848
|
var f;
|
|
834
|
-
return
|
|
835
|
-
(
|
|
836
|
-
|
|
837
|
-
)
|
|
838
|
-
).length === _.items.length : (f = a.value) == null ? void 0 : f.includes(_.value);
|
|
849
|
+
return b.items && r.value && t.searching ? b.items.filter(
|
|
850
|
+
(g) => (t.selectedValues ?? []).includes(g.value)
|
|
851
|
+
).length === b.items.length : (f = d.value) == null ? void 0 : f.includes(b.value);
|
|
839
852
|
});
|
|
840
853
|
}
|
|
841
|
-
),
|
|
842
|
-
var
|
|
843
|
-
const
|
|
844
|
-
return f === 0 ? l("selectAll", { total:
|
|
845
|
-
}),
|
|
846
|
-
const
|
|
847
|
-
const { isDisabled:
|
|
848
|
-
return
|
|
849
|
-
}, f =
|
|
850
|
-
a.
|
|
851
|
-
}, B = (
|
|
852
|
-
const
|
|
853
|
-
const { isDisabled:
|
|
854
|
-
return !(
|
|
855
|
-
}, f =
|
|
856
|
-
|
|
857
|
-
},
|
|
858
|
-
|
|
854
|
+
), v = () => r.value && !t.searching ? u.value.length : t.items.length, y = i(() => {
|
|
855
|
+
var C;
|
|
856
|
+
const c = h.value.length, b = v(), f = ((C = E.value) == null ? void 0 : C.length) || 0;
|
|
857
|
+
return f === 0 ? l("selectAll", { total: c }) : f === b ? l("allSelected", { total: b }) : f <= b ? l("numberOfTotalSelected", { number: f, total: b }) : l("numbersSelected", { number: f });
|
|
858
|
+
}), T = (c) => {
|
|
859
|
+
const b = (C) => {
|
|
860
|
+
const { isDisabled: g, isPreSelected: P } = p(C);
|
|
861
|
+
return g && P || !g;
|
|
862
|
+
}, f = c.filter(b).filter((C) => !d.value.includes(C.value));
|
|
863
|
+
e(a.SELECT, [...t.selectedValues, ...f]);
|
|
864
|
+
}, B = (c) => {
|
|
865
|
+
const b = (g) => {
|
|
866
|
+
const { isDisabled: P, isPreSelected: me } = p(g);
|
|
867
|
+
return !(P && me);
|
|
868
|
+
}, f = c.filter(b).map(({ value: g }) => g), C = t.selectedValues.filter((g) => !(f != null && f.includes(g.value)));
|
|
869
|
+
e(a.SELECT, C);
|
|
870
|
+
}, S = () => {
|
|
871
|
+
T(u.value);
|
|
859
872
|
}, O = () => {
|
|
860
873
|
B(u.value);
|
|
861
|
-
}, { isAllSelected:
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
874
|
+
}, { isAllSelected: L, isIndeterminate: m, toggleSelectAll: x } = se(
|
|
875
|
+
E,
|
|
876
|
+
h,
|
|
877
|
+
S,
|
|
865
878
|
O
|
|
866
|
-
), R = (
|
|
867
|
-
|
|
868
|
-
},
|
|
869
|
-
B(
|
|
870
|
-
},
|
|
879
|
+
), R = (c) => {
|
|
880
|
+
T(c.items);
|
|
881
|
+
}, F = (c) => {
|
|
882
|
+
B(c.items);
|
|
883
|
+
}, W = (c, b) => {
|
|
871
884
|
let f = !1;
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
885
|
+
const C = t.selectedValues.filter(({ value: g }) => b.value === g ? (f = !0, !1) : !0);
|
|
886
|
+
f || C.push(b), e(c, C);
|
|
887
|
+
}, z = i(() => {
|
|
888
|
+
if (!r.value)
|
|
889
|
+
return t.selectedValues;
|
|
890
|
+
const c = (g) => d.value.includes(g.value), b = (g) => !t.staticCategories && g.every((P) => c(P));
|
|
875
891
|
return t.items.flatMap(
|
|
876
|
-
(
|
|
877
|
-
).filter((
|
|
878
|
-
}), K =
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
), T = c(
|
|
892
|
+
(g) => g.items && !b(g.items) ? g.items : g
|
|
893
|
+
).filter((g) => g.items ? !0 : c(g));
|
|
894
|
+
}), K = i(() => {
|
|
895
|
+
var f, C, g, P;
|
|
896
|
+
const c = ["automatic", "button"].includes(t.lazyLoadType), b = ((f = t.selectedValues) == null ? void 0 : f.length) > 0 && ((C = E.value) == null ? void 0 : C.length) !== ((g = u.value) == null ? void 0 : g.length);
|
|
897
|
+
return c && t.hasMoreItems ? !!((P = t.selectedValues) != null && P.length) : b;
|
|
898
|
+
}), I = i(() => ["automatic", "button"].includes(t.lazyLoadType) ? !t.hasMoreItems : !0), G = i(
|
|
884
899
|
() => n.value ? [n.value] : []
|
|
885
|
-
),
|
|
900
|
+
), ne = i(
|
|
886
901
|
() => {
|
|
887
|
-
var
|
|
888
|
-
return (
|
|
902
|
+
var c, b;
|
|
903
|
+
return (b = (c = o.value) == null ? void 0 : c.$children) != null && b.length ? o.value.$children : [];
|
|
889
904
|
}
|
|
890
|
-
),
|
|
905
|
+
), oe = i(
|
|
891
906
|
() => {
|
|
892
|
-
var
|
|
893
|
-
return (
|
|
907
|
+
var c, b;
|
|
908
|
+
return (b = (c = _.value) == null ? void 0 : c.$children) != null && b.length ? _.value.$children : [];
|
|
894
909
|
}
|
|
895
|
-
),
|
|
896
|
-
|
|
897
|
-
...
|
|
910
|
+
), ae = i(() => ({ label: y, value: L })), ie = i(() => [
|
|
911
|
+
ae,
|
|
912
|
+
...z.value,
|
|
898
913
|
...u.value
|
|
899
|
-
]),
|
|
914
|
+
]), ce = (c) => {
|
|
900
915
|
[
|
|
901
|
-
...T.value,
|
|
902
916
|
...G.value,
|
|
903
|
-
...
|
|
904
|
-
|
|
905
|
-
|
|
917
|
+
...ne.value,
|
|
918
|
+
...oe.value
|
|
919
|
+
][c].$el.focus();
|
|
920
|
+
}, { moveToNextElement: re, moveToPreviousElement: ue, moveToFirstElement: de, moveToLastElement: _e } = le(
|
|
906
921
|
{
|
|
907
|
-
items:
|
|
922
|
+
items: A(ie),
|
|
908
923
|
isOptionDisabled: t.isOptionDisabled
|
|
909
924
|
},
|
|
910
|
-
|
|
911
|
-
),
|
|
912
|
-
[k.ARROW_UP]: (
|
|
913
|
-
[k.ARROW_DOWN]: (
|
|
914
|
-
[k.HOME]:
|
|
915
|
-
[k.END]:
|
|
925
|
+
ce
|
|
926
|
+
), be = {
|
|
927
|
+
[k.ARROW_UP]: (c) => ue(c),
|
|
928
|
+
[k.ARROW_DOWN]: (c) => re(c),
|
|
929
|
+
[k.HOME]: de,
|
|
930
|
+
[k.END]: _e
|
|
916
931
|
};
|
|
917
932
|
return {
|
|
918
933
|
// Refs
|
|
919
934
|
selectAllListboxItemsRef: n,
|
|
920
935
|
selectedListboxItemsRef: o,
|
|
921
|
-
listboxItemsRef:
|
|
936
|
+
listboxItemsRef: _,
|
|
922
937
|
// Values
|
|
923
|
-
isAllSelected:
|
|
938
|
+
isAllSelected: L,
|
|
924
939
|
showSelectedItems: K,
|
|
925
|
-
isIndeterminate:
|
|
926
|
-
isMultiLevelSelect:
|
|
940
|
+
isIndeterminate: m,
|
|
941
|
+
isMultiLevelSelect: r,
|
|
927
942
|
flattenedItemsList: u,
|
|
928
|
-
selectedItemsList:
|
|
929
|
-
selectAllCheckboxText:
|
|
930
|
-
selectedOptions:
|
|
943
|
+
selectedItemsList: d,
|
|
944
|
+
selectAllCheckboxText: y,
|
|
945
|
+
selectedOptions: z,
|
|
946
|
+
showSelectAllCheckbox: I,
|
|
931
947
|
slots: s,
|
|
932
948
|
// Enums
|
|
933
|
-
BentoListboxEvent:
|
|
949
|
+
BentoListboxEvent: a,
|
|
934
950
|
// Methods
|
|
935
951
|
selectAllCategory: R,
|
|
936
|
-
toggleCheckboxSelection:
|
|
937
|
-
toggleSelectAll:
|
|
938
|
-
unselectAllCategory:
|
|
952
|
+
toggleCheckboxSelection: W,
|
|
953
|
+
toggleSelectAll: x,
|
|
954
|
+
unselectAllCategory: F,
|
|
939
955
|
// Events
|
|
940
|
-
listboxListeners:
|
|
956
|
+
listboxListeners: be
|
|
941
957
|
};
|
|
942
958
|
}
|
|
943
959
|
});
|
|
944
|
-
var
|
|
960
|
+
var bt = function() {
|
|
945
961
|
var e = this, s = e._self._c;
|
|
946
|
-
return e._self._setupProxy, s("div", e._g({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], staticClass: "b-listbox-multi-select" }, e.listboxListeners), [s("bento-listbox-option", { ref: "selectAllListboxItemsRef", staticClass: "b-listbox-multi-select__option" }, [s("bento-checkbox", { attrs: { "aria-label": e.selectAllCheckboxText, "model-value": e.isAllSelected, indeterminate: e.isIndeterminate }, on: { "update:model-value": e.toggleSelectAll } }), s("bento-typography", { attrs: { el: "span" } }, [e._v(" " + e._s(e.selectAllCheckboxText) + " ")])], 1), e.
|
|
962
|
+
return e._self._setupProxy, s("div", e._g({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], staticClass: "b-listbox-multi-select" }, e.listboxListeners), [e.showSelectAllCheckbox ? s("bento-listbox-option", { ref: "selectAllListboxItemsRef", staticClass: "b-listbox-multi-select__option" }, [s("bento-checkbox", { attrs: { "aria-label": e.selectAllCheckboxText, "model-value": e.isAllSelected, indeterminate: e.isIndeterminate }, on: { "update:model-value": e.toggleSelectAll } }), s("bento-typography", { attrs: { el: "span", "aria-hidden": "true" } }, [e._v(" " + e._s(e.selectAllCheckboxText) + " ")])], 1) : e._e(), e.showSelectAllCheckbox ? s("hr", { staticClass: "b-listbox-multi-select__divider" }) : e._e(), e.showSelectedItems ? s("div", [s("listbox-multi-select-chips", { ref: "selectedListboxItemsRef", attrs: { items: e.selectedOptions, "is-option-disabled": e.isOptionDisabled }, on: { "unselect-category": e.unselectAllCategory, "unselect-item": function(l) {
|
|
947
963
|
return e.toggleCheckboxSelection(e.BentoListboxEvent.SELECT, l);
|
|
948
|
-
} } })
|
|
964
|
+
} } }), s("hr", { staticClass: "b-listbox-multi-select__divider" })], 1) : e._e(), s("listbox-multi-select-options", { ref: "listboxItemsRef", attrs: { items: e.items, "is-option-disabled": e.isOptionDisabled, "is-multi-level": e.isMultiLevelSelect, "static-categories": e.staticCategories, searching: e.searching, "selected-items-list": e.selectedItemsList }, on: e._d({ "toggle-checkbox-selection": function(l) {
|
|
949
965
|
return e.toggleCheckboxSelection(e.BentoListboxEvent.SELECT, l);
|
|
950
966
|
}, "select-category": e.selectAllCategory, "unselect-category": e.unselectAllCategory }, [e.BentoListboxEvent.SPACE, function(l) {
|
|
951
967
|
return e.toggleCheckboxSelection(e.BentoListboxEvent.SPACE, l);
|
|
@@ -958,33 +974,33 @@ var ut = function() {
|
|
|
958
974
|
return [e._t(n, null, null, o)];
|
|
959
975
|
} };
|
|
960
976
|
})], null, !0) })], 1);
|
|
961
|
-
},
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
977
|
+
}, mt = [], vt = /* @__PURE__ */ N(
|
|
978
|
+
_t,
|
|
979
|
+
bt,
|
|
980
|
+
mt,
|
|
965
981
|
!1,
|
|
966
982
|
null,
|
|
967
|
-
"
|
|
983
|
+
"8e21add2",
|
|
968
984
|
null,
|
|
969
985
|
null
|
|
970
986
|
);
|
|
971
|
-
const
|
|
987
|
+
const Z = vt.exports, ft = {
|
|
972
988
|
"en-US": {
|
|
973
989
|
showMore: "Show more",
|
|
974
990
|
loading: "Loading"
|
|
975
991
|
}
|
|
976
|
-
},
|
|
992
|
+
}, gt = 36, yt = D({
|
|
977
993
|
name: "bento-listbox",
|
|
978
994
|
components: {
|
|
979
|
-
BentoEmptyState:
|
|
980
|
-
BentoListboxSingleSelect:
|
|
981
|
-
BentoListboxMultiSelect:
|
|
982
|
-
BentoTypography:
|
|
983
|
-
BentoLoadingIndicator:
|
|
984
|
-
BentoLoadingButton:
|
|
995
|
+
BentoEmptyState: ge,
|
|
996
|
+
BentoListboxSingleSelect: qe,
|
|
997
|
+
BentoListboxMultiSelect: Z,
|
|
998
|
+
BentoTypography: w,
|
|
999
|
+
BentoLoadingIndicator: fe,
|
|
1000
|
+
BentoLoadingButton: Ee
|
|
985
1001
|
},
|
|
986
|
-
directives: { BentoKeyboardNavigationDirective:
|
|
987
|
-
i18n: { messages:
|
|
1002
|
+
directives: { BentoKeyboardNavigationDirective: X },
|
|
1003
|
+
i18n: { messages: ft },
|
|
988
1004
|
props: {
|
|
989
1005
|
/**
|
|
990
1006
|
* Defines a string value that labels an interactive element.
|
|
@@ -1040,8 +1056,8 @@ const Q = _t.exports, bt = {
|
|
|
1040
1056
|
*/
|
|
1041
1057
|
lazyLoadType: {
|
|
1042
1058
|
type: String,
|
|
1043
|
-
default:
|
|
1044
|
-
validator: (t) => Object.values(
|
|
1059
|
+
default: M.NONE,
|
|
1060
|
+
validator: (t) => Object.values(M).includes(t)
|
|
1045
1061
|
},
|
|
1046
1062
|
/**
|
|
1047
1063
|
* If enabled, the user will be able to select multiple items.
|
|
@@ -1061,15 +1077,15 @@ const Q = _t.exports, bt = {
|
|
|
1061
1077
|
*
|
|
1062
1078
|
* If enabled, hides the "Select all" checkbox in "multiple" mode.
|
|
1063
1079
|
*/
|
|
1064
|
-
searching:
|
|
1080
|
+
searching: Z.props.searching,
|
|
1065
1081
|
/**
|
|
1066
1082
|
* The `input` value.
|
|
1067
1083
|
* Providing an empty string or empty array will select no options.
|
|
1068
1084
|
* Set to an empty string `''` if you don't want any of the available options to be selected for single select
|
|
1069
1085
|
*/
|
|
1070
1086
|
selectedValue: {
|
|
1071
|
-
type:
|
|
1072
|
-
default:
|
|
1087
|
+
type: Array,
|
|
1088
|
+
default: () => []
|
|
1073
1089
|
},
|
|
1074
1090
|
/**
|
|
1075
1091
|
* Enables virtual scrolling if set to true or by providing an object with itemHeight function.
|
|
@@ -1081,93 +1097,93 @@ const Q = _t.exports, bt = {
|
|
|
1081
1097
|
}
|
|
1082
1098
|
},
|
|
1083
1099
|
emits: [
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1100
|
+
a.SELECT,
|
|
1101
|
+
a.SPACE,
|
|
1102
|
+
a.SHOW_MORE,
|
|
1103
|
+
a.ENTER,
|
|
1104
|
+
a.ESCAPE,
|
|
1105
|
+
a.TAB
|
|
1090
1106
|
],
|
|
1091
1107
|
setup(t, { emit: e, slots: s }) {
|
|
1092
|
-
const l =
|
|
1093
|
-
var
|
|
1094
|
-
return typeof (t == null ? void 0 : t.virtualScroll) == "object" && ((
|
|
1108
|
+
const l = A([]), n = V(t, "items"), { t: o } = Y(), _ = i(() => t.lazyLoadType !== M.AUTOMATIC), d = i(() => t.lazyLoadType === M.AUTOMATIC), r = () => {
|
|
1109
|
+
var I;
|
|
1110
|
+
return typeof (t == null ? void 0 : t.virtualScroll) == "object" && ((I = t == null ? void 0 : t.virtualScroll) != null && I.itemHeight) ? t.virtualScroll.itemHeight : gt;
|
|
1095
1111
|
}, {
|
|
1096
1112
|
containerRef: u,
|
|
1097
|
-
containerProps:
|
|
1098
|
-
onScroll:
|
|
1099
|
-
list:
|
|
1100
|
-
wrapperProps:
|
|
1101
|
-
} =
|
|
1102
|
-
itemHeight:
|
|
1113
|
+
containerProps: p,
|
|
1114
|
+
onScroll: h,
|
|
1115
|
+
list: E,
|
|
1116
|
+
wrapperProps: v
|
|
1117
|
+
} = Le(n, {
|
|
1118
|
+
itemHeight: r(),
|
|
1103
1119
|
// Disable virtual scrolling if not enabled or if lazy loading is enabled or if multi-select
|
|
1104
1120
|
disabled: (t == null ? void 0 : t.multiple) || (t == null ? void 0 : t.virtualScroll) === !1 || (t == null ? void 0 : t.lazyLoadType) !== "none"
|
|
1105
|
-
}),
|
|
1106
|
-
() =>
|
|
1107
|
-
),
|
|
1108
|
-
() =>
|
|
1109
|
-
), B =
|
|
1110
|
-
() =>
|
|
1111
|
-
),
|
|
1112
|
-
e(
|
|
1121
|
+
}), y = i(
|
|
1122
|
+
() => _.value ? "true" : void 0
|
|
1123
|
+
), T = i(
|
|
1124
|
+
() => _.value && t.loading ? "true" : "false"
|
|
1125
|
+
), B = i(
|
|
1126
|
+
() => _.value ? "polite" : void 0
|
|
1127
|
+
), S = (I) => (G) => {
|
|
1128
|
+
e(I, G);
|
|
1113
1129
|
}, O = () => {
|
|
1114
|
-
e(
|
|
1115
|
-
},
|
|
1116
|
-
const
|
|
1117
|
-
if (!
|
|
1130
|
+
e(a.SHOW_MORE);
|
|
1131
|
+
}, L = ye(() => {
|
|
1132
|
+
const I = u.value;
|
|
1133
|
+
if (!I)
|
|
1118
1134
|
return;
|
|
1119
|
-
const G = Math.round(
|
|
1135
|
+
const G = Math.round(I.scrollTop) + I.clientHeight >= I.scrollHeight;
|
|
1120
1136
|
t.hasMoreItems && G && !t.loading && O();
|
|
1121
|
-
}),
|
|
1122
|
-
|
|
1123
|
-
},
|
|
1124
|
-
var
|
|
1125
|
-
return t.searching && ((
|
|
1126
|
-
}), R =
|
|
1127
|
-
() => t.lazyLoadType ===
|
|
1128
|
-
),
|
|
1129
|
-
() => t.loading ?
|
|
1130
|
-
),
|
|
1137
|
+
}), m = () => {
|
|
1138
|
+
d.value ? L() : h();
|
|
1139
|
+
}, x = i(() => {
|
|
1140
|
+
var I;
|
|
1141
|
+
return t.searching && ((I = t.items) == null ? void 0 : I.length) === 0;
|
|
1142
|
+
}), R = i(
|
|
1143
|
+
() => t.lazyLoadType === M.BUTTON && t.hasMoreItems
|
|
1144
|
+
), F = i(
|
|
1145
|
+
() => t.loading ? Q.LOADING : Q.START
|
|
1146
|
+
), W = i(() => t.loading ? o("loading") : o("showMore")), z = i(() => ({
|
|
1131
1147
|
...t.emptyState,
|
|
1132
1148
|
variant: "condensed"
|
|
1133
1149
|
})), K = {
|
|
1134
|
-
[
|
|
1135
|
-
[
|
|
1136
|
-
[
|
|
1137
|
-
[
|
|
1150
|
+
[a.SELECT]: S(a.SELECT),
|
|
1151
|
+
[a.SPACE]: S(a.SPACE),
|
|
1152
|
+
[a.TAB]: S(a.TAB),
|
|
1153
|
+
[a.ENTER]: S(a.ENTER)
|
|
1138
1154
|
};
|
|
1139
1155
|
return {
|
|
1140
1156
|
// Refs
|
|
1141
1157
|
listboxRef: u,
|
|
1142
1158
|
listboxItemRef: l,
|
|
1143
1159
|
// a11y
|
|
1144
|
-
ariaAtomic:
|
|
1145
|
-
ariaBusy:
|
|
1160
|
+
ariaAtomic: y,
|
|
1161
|
+
ariaBusy: T,
|
|
1146
1162
|
ariaLive: B,
|
|
1147
1163
|
// Values
|
|
1148
|
-
containerProps:
|
|
1149
|
-
isSearchResultEmpty:
|
|
1150
|
-
limitedEmptyStateProps:
|
|
1151
|
-
loadingButtonState:
|
|
1164
|
+
containerProps: p,
|
|
1165
|
+
isSearchResultEmpty: x,
|
|
1166
|
+
limitedEmptyStateProps: z,
|
|
1167
|
+
loadingButtonState: F,
|
|
1152
1168
|
slots: s,
|
|
1153
1169
|
shouldDisplayShowMoreButton: R,
|
|
1154
|
-
showMoreButtonText:
|
|
1155
|
-
virtualisedItems:
|
|
1156
|
-
wrapperProps:
|
|
1170
|
+
showMoreButtonText: W,
|
|
1171
|
+
virtualisedItems: E,
|
|
1172
|
+
wrapperProps: v,
|
|
1157
1173
|
// Enums
|
|
1158
1174
|
BentoKeyboardNavigationKeyDownEvent: k,
|
|
1159
|
-
BentoListboxEvent:
|
|
1175
|
+
BentoListboxEvent: a,
|
|
1160
1176
|
// Methods
|
|
1161
|
-
onListboxContainerScroll:
|
|
1162
|
-
onOptionSelected:
|
|
1177
|
+
onListboxContainerScroll: m,
|
|
1178
|
+
onOptionSelected: S,
|
|
1163
1179
|
emitShowMore: O,
|
|
1164
1180
|
listboxListeners: K
|
|
1165
1181
|
};
|
|
1166
1182
|
}
|
|
1167
1183
|
});
|
|
1168
|
-
var
|
|
1184
|
+
var pt = function() {
|
|
1169
1185
|
var e = this, s = e._self._c;
|
|
1170
|
-
return e._self._setupProxy, s("div", e._b({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], staticClass: "b-listbox", attrs: { id: e.id, role: "listbox", tabindex: "-1", "aria-busy": e.ariaBusy, "aria-atomic": e.ariaAtomic, "aria-label": e.ariaLabel, "aria-live": e.ariaLive }, on: { scroll: e.onListboxContainerScroll } }, "div", e.containerProps, !1), [s("div", e._b({}, "div", e.wrapperProps, !1), [e.isSearchResultEmpty ? s("div", { staticClass: "b-listbox__empty-search-message" }, [e.emptyState ? s("bento-empty-state", e._b({}, "bento-empty-state", e.limitedEmptyStateProps, !1)) : s("bento-typography", { attrs: { el: "span" } }, [e._v(e._s(e.noResultsMessage))])], 1) : [e.multiple ? [s("bento-listbox-multi-select", e._g({ ref: "listboxItemRef", attrs: { items: e.items, "static-categories": e.staticCategories, "selected-values": e.selectedValue, searching: e.searching, "is-option-disabled": e.isOptionDisabled }, scopedSlots: e._u([e._l(e.slots, function(l, n) {
|
|
1186
|
+
return e._self._setupProxy, s("div", e._b({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], staticClass: "b-listbox", attrs: { id: e.id, role: "listbox", tabindex: "-1", "aria-busy": e.ariaBusy, "aria-atomic": e.ariaAtomic, "aria-label": e.ariaLabel, "aria-live": e.ariaLive }, on: { scroll: e.onListboxContainerScroll } }, "div", e.containerProps, !1), [s("div", e._b({}, "div", e.wrapperProps, !1), [e.isSearchResultEmpty ? s("div", { staticClass: "b-listbox__empty-search-message" }, [e.emptyState ? s("bento-empty-state", e._b({}, "bento-empty-state", e.limitedEmptyStateProps, !1)) : s("bento-typography", { attrs: { el: "span" } }, [e._v(e._s(e.noResultsMessage))])], 1) : [e.multiple ? [s("bento-listbox-multi-select", e._g({ ref: "listboxItemRef", attrs: { "has-more-items": e.hasMoreItems, items: e.items, "lazy-load-type": e.lazyLoadType, "static-categories": e.staticCategories, "selected-values": e.selectedValue, searching: e.searching, "is-option-disabled": e.isOptionDisabled }, scopedSlots: e._u([e._l(e.slots, function(l, n) {
|
|
1171
1187
|
return { key: n, fn: function(o) {
|
|
1172
1188
|
return [e._t(n, null, null, o)];
|
|
1173
1189
|
} };
|
|
@@ -1178,21 +1194,67 @@ var ft = function() {
|
|
|
1178
1194
|
})], null, !0) }, e.listboxListeners))], e.shouldDisplayShowMoreButton ? s("div", { staticClass: "b-listbox__lazy-load" }, [s("bento-loading-button", { attrs: { state: e.loadingButtonState, variant: "secondary" }, on: { "!click": function(l) {
|
|
1179
1195
|
return e.emitShowMore.apply(null, arguments);
|
|
1180
1196
|
} } }, [e._v(" " + e._s(e.showMoreButtonText) + " ")])], 1) : e.loading ? s("div", { staticClass: "b-listbox__lazy-load" }, [s("bento-loading-indicator")], 1) : e._e()]], 2)]);
|
|
1181
|
-
},
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1197
|
+
}, St = [], xt = /* @__PURE__ */ N(
|
|
1198
|
+
yt,
|
|
1199
|
+
pt,
|
|
1200
|
+
St,
|
|
1185
1201
|
!1,
|
|
1186
1202
|
null,
|
|
1187
|
-
"
|
|
1203
|
+
"28929030",
|
|
1188
1204
|
null,
|
|
1189
1205
|
null
|
|
1190
1206
|
);
|
|
1191
|
-
const
|
|
1207
|
+
const wt = xt.exports, H = (t, e) => {
|
|
1208
|
+
for (const s of t) {
|
|
1209
|
+
if (s.value === e)
|
|
1210
|
+
return s.label;
|
|
1211
|
+
if (s.items)
|
|
1212
|
+
return H(s.items, e);
|
|
1213
|
+
}
|
|
1214
|
+
return null;
|
|
1215
|
+
}, Ft = (t, e, s) => {
|
|
1216
|
+
const l = A([]), n = A(), o = (r) => {
|
|
1217
|
+
n.value = s.value ? r.map(({ value: u }) => u) : r[0].value;
|
|
1218
|
+
}, _ = (r) => {
|
|
1219
|
+
l.value = r, o(r);
|
|
1220
|
+
}, d = () => {
|
|
1221
|
+
l.value = [], n.value = null;
|
|
1222
|
+
};
|
|
1223
|
+
return te(
|
|
1224
|
+
() => e.value,
|
|
1225
|
+
() => {
|
|
1226
|
+
if (!e.value) {
|
|
1227
|
+
d();
|
|
1228
|
+
return;
|
|
1229
|
+
}
|
|
1230
|
+
const r = !Array.isArray(e.value), u = [...l.value];
|
|
1231
|
+
d();
|
|
1232
|
+
const p = (h) => {
|
|
1233
|
+
let E = H(t.value, h);
|
|
1234
|
+
E || (E = H(u, h)), E || (E = h.toString()), l.value.push({ value: h, label: E });
|
|
1235
|
+
};
|
|
1236
|
+
if (r) {
|
|
1237
|
+
const h = e.value;
|
|
1238
|
+
p(h), o(l.value);
|
|
1239
|
+
return;
|
|
1240
|
+
}
|
|
1241
|
+
e.value.forEach(p), o(l.value);
|
|
1242
|
+
},
|
|
1243
|
+
{ immediate: !0 }
|
|
1244
|
+
), {
|
|
1245
|
+
// Values
|
|
1246
|
+
cachedSelectedListboxOptions: l,
|
|
1247
|
+
cachedListboxSelectedValues: n,
|
|
1248
|
+
// Methods
|
|
1249
|
+
resetCache: d,
|
|
1250
|
+
setCachedValues: _
|
|
1251
|
+
};
|
|
1252
|
+
};
|
|
1192
1253
|
export {
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1254
|
+
wt as B,
|
|
1255
|
+
Ft as a,
|
|
1256
|
+
M as b,
|
|
1257
|
+
a as c,
|
|
1258
|
+
dt as u
|
|
1197
1259
|
};
|
|
1198
|
-
//# sourceMappingURL=
|
|
1260
|
+
//# sourceMappingURL=use-cached-selected-values.69297473.js.map
|