@adyen/bento-vue3 1.74.0 → 1.76.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 +1660 -614
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/calendar.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/data-grid-template.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-picker.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown-tag.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/header-meta.css +1 -1
- package/dist/assets/input-field-password.css +1 -1
- package/dist/assets/input-field.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/selection-card-group.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/timeline-item.css +1 -1
- package/dist/assets/use-cached-selected-values.css +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/calendar.Tm7Cvpwu.js +2001 -0
- package/dist/chunks/calendar.Tm7Cvpwu.js.map +1 -0
- package/dist/chunks/{checkbox-group.8ebmaHsA.js → checkbox-group.8J29fVna.js} +2 -2
- package/dist/chunks/{checkbox-group.8ebmaHsA.js.map → checkbox-group.8J29fVna.js.map} +1 -1
- package/dist/chunks/{checkbox.BI0dqARY.js → checkbox.CfNYUty6.js} +18 -18
- package/dist/chunks/{checkbox.BI0dqARY.js.map → checkbox.CfNYUty6.js.map} +1 -1
- package/dist/chunks/{code-snippet.CO78Nfj0.js → code-snippet.EeIcRV20.js} +2 -2
- package/dist/chunks/{code-snippet.CO78Nfj0.js.map → code-snippet.EeIcRV20.js.map} +1 -1
- package/dist/chunks/constructNow.CHWWeLPc.js +8 -0
- package/dist/chunks/constructNow.CHWWeLPc.js.map +1 -0
- package/dist/chunks/{dashboard-section.CVttsom5.js → dashboard-section.Cqi0PWeJ.js} +2 -2
- package/dist/chunks/{dashboard-section.CVttsom5.js.map → dashboard-section.Cqi0PWeJ.js.map} +1 -1
- package/dist/chunks/{data-grid-template.CFt1NV_4.js → data-grid-template.D7kB3S1u.js} +2 -2
- package/dist/chunks/{data-grid-template.CFt1NV_4.js.map → data-grid-template.D7kB3S1u.js.map} +1 -1
- package/dist/chunks/data-grid.DJIxBwCa.js +4143 -0
- package/dist/chunks/data-grid.DJIxBwCa.js.map +1 -0
- package/dist/chunks/{date-picker.DSkvT_CA.js → date-picker.CobmiKaJ.js} +16 -16
- package/dist/chunks/date-picker.CobmiKaJ.js.map +1 -0
- package/dist/chunks/date-range-picker.B6UKl1_N.js +1114 -0
- package/dist/chunks/date-range-picker.B6UKl1_N.js.map +1 -0
- package/dist/chunks/{get-date-locale.CAyOIbcp.js → differenceInMonths.C8FyCrav.js} +580 -364
- package/dist/chunks/differenceInMonths.C8FyCrav.js.map +1 -0
- package/dist/chunks/dropdown-tag.CMjilUQb.js +242 -0
- package/dist/chunks/dropdown-tag.CMjilUQb.js.map +1 -0
- package/dist/chunks/{dropdown.bLsoTZbw.js → dropdown.DG_EnV8g.js} +18 -18
- package/dist/chunks/{dropdown.bLsoTZbw.js.map → dropdown.DG_EnV8g.js.map} +1 -1
- package/dist/chunks/es6.MoTTyETW.js.map +1 -1
- package/dist/chunks/{filter-bar.nX73NKNC.js → filter-bar.dmC284Po.js} +737 -710
- package/dist/chunks/filter-bar.dmC284Po.js.map +1 -0
- package/dist/chunks/getRoundingMethod.C3eaeGLR.js +10 -0
- package/dist/chunks/getRoundingMethod.C3eaeGLR.js.map +1 -0
- package/dist/chunks/{index.BrH1t1iu.js → getTimezoneOffsetInMilliseconds.BW7U6PxE.js} +254 -177
- package/dist/chunks/getTimezoneOffsetInMilliseconds.BW7U6PxE.js.map +1 -0
- package/dist/chunks/header-meta.BE6QfUNi.js +221 -0
- package/dist/chunks/header-meta.BE6QfUNi.js.map +1 -0
- package/dist/chunks/{header-with-views.BLW817ZC.js → header-with-views.BZ16v5-m.js} +4 -4
- package/dist/chunks/{header-with-views.BLW817ZC.js.map → header-with-views.BZ16v5-m.js.map} +1 -1
- package/dist/chunks/{header.DARVAeE9.js → header.3It50Clh.js} +2 -2
- package/dist/chunks/{header.DARVAeE9.js.map → header.3It50Clh.js.map} +1 -1
- package/dist/chunks/{input-field-password.BtM3-txc.js → input-field-password.BVnZWBAV.js} +185 -167
- package/dist/chunks/input-field-password.BVnZWBAV.js.map +1 -0
- package/dist/chunks/{input-field-phone-number.oaNB69nM.js → input-field-phone-number.CWhPGQ1U.js} +3 -3
- package/dist/chunks/{input-field-phone-number.oaNB69nM.js.map → input-field-phone-number.CWhPGQ1U.js.map} +1 -1
- package/dist/chunks/{input-field.D_tADgPG.js → input-field.A-dEZZfC.js} +124 -119
- package/dist/chunks/input-field.A-dEZZfC.js.map +1 -0
- package/dist/chunks/{pagination.D1Gdo5to.js → pagination.B4qBK4pM.js} +2 -2
- package/dist/chunks/{pagination.D1Gdo5to.js.map → pagination.B4qBK4pM.js.map} +1 -1
- package/dist/chunks/radio-group.DWNqrkZ3.js.map +1 -1
- package/dist/chunks/{rich-text-editor.BK9AivIm.js → rich-text-editor.BA6_k4Vv.js} +354 -352
- package/dist/chunks/{rich-text-editor.BK9AivIm.js.map → rich-text-editor.BA6_k4Vv.js.map} +1 -1
- package/dist/chunks/{search-bar.BD_R-vgA.js → search-bar.dZ7UCMxb.js} +3 -3
- package/dist/chunks/{search-bar.BD_R-vgA.js.map → search-bar.dZ7UCMxb.js.map} +1 -1
- package/dist/chunks/{secondary-nav.Du2PL7Ok.js → secondary-nav.CE082cQ_.js} +2 -2
- package/dist/chunks/{secondary-nav.Du2PL7Ok.js.map → secondary-nav.CE082cQ_.js.map} +1 -1
- package/dist/chunks/selection-card-group.NnTbPQjj.js +412 -0
- package/dist/chunks/{selection-card-group._RgLiMyQ.js.map → selection-card-group.NnTbPQjj.js.map} +1 -1
- package/dist/chunks/textarea.C1jkfowf.js.map +1 -1
- package/dist/chunks/timeline-item.DNjubXL2.js +556 -0
- package/dist/chunks/timeline-item.DNjubXL2.js.map +1 -0
- package/dist/chunks/{use-cached-selected-values.C32tjNKy.js → use-cached-selected-values.8MdrR9wt.js} +501 -467
- package/dist/chunks/use-cached-selected-values.8MdrR9wt.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 +3 -3
- 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 +24 -24
- 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 +3 -3
- 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 +7 -5
- package/dist/styles/bento-light.css +7 -5
- package/dist/styles/bento.css +7 -5
- package/dist/styles/legacy.css +7 -5
- package/dist/styles/styleguide.css +7 -5
- package/dist/timeline.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +8 -23
- package/dist/chunks/_commonjsHelpers.C6fGbg64.js +0 -7
- package/dist/chunks/_commonjsHelpers.C6fGbg64.js.map +0 -1
- package/dist/chunks/calendar.Cqjyxc69.js +0 -2223
- package/dist/chunks/calendar.Cqjyxc69.js.map +0 -1
- package/dist/chunks/data-grid.BjPdbx50.js +0 -4071
- package/dist/chunks/data-grid.BjPdbx50.js.map +0 -1
- package/dist/chunks/date-picker.DSkvT_CA.js.map +0 -1
- package/dist/chunks/date-range-picker.cmg75lC-.js +0 -1117
- package/dist/chunks/date-range-picker.cmg75lC-.js.map +0 -1
- package/dist/chunks/dropdown-tag.DvQQIJsw.js +0 -308
- package/dist/chunks/dropdown-tag.DvQQIJsw.js.map +0 -1
- package/dist/chunks/filter-bar.nX73NKNC.js.map +0 -1
- package/dist/chunks/get-date-locale.CAyOIbcp.js.map +0 -1
- package/dist/chunks/header-meta.C4iaUsfq.js +0 -236
- package/dist/chunks/header-meta.C4iaUsfq.js.map +0 -1
- package/dist/chunks/index.BrH1t1iu.js.map +0 -1
- package/dist/chunks/index.BxBB1rsx.js +0 -15
- package/dist/chunks/index.BxBB1rsx.js.map +0 -1
- package/dist/chunks/input-field-password.BtM3-txc.js.map +0 -1
- package/dist/chunks/input-field.D_tADgPG.js.map +0 -1
- package/dist/chunks/selection-card-group._RgLiMyQ.js +0 -474
- package/dist/chunks/timeline-item.C8PA_w7m.js +0 -568
- package/dist/chunks/timeline-item.C8PA_w7m.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.C32tjNKy.js.map +0 -1
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
import { computed as
|
|
1
|
+
import { computed as v, ref as L, onMounted as ut, onUnmounted as bt, watch as ye, defineComponent as J, resolveComponent as A, createElementBlock as E, openBlock as m, createVNode as G, createElementVNode as U, withCtx as k, createTextVNode as K, toDisplayString as V, renderSlot as j, mergeProps as x, withKeys as me, createCommentVNode as X, createBlock as $, withModifiers as re, normalizeProps as ae, guardReactiveProps as ve, withDirectives as ce, vShow as Ue, nextTick as ze, toRef as fe, resolveDirective as Ve, toHandlers as se, Fragment as le, renderList as H, createSlots as pe, normalizeClass as ge, unref as M, useSlots as mt, useAttrs as vt } from "vue";
|
|
2
2
|
import { B as F, a as Ce } from "./keyboard-navigation.pB8weElW.js";
|
|
3
3
|
import { B as de } from "./typography.yBEME_Gu.js";
|
|
4
|
-
import { B as
|
|
5
|
-
import { B as
|
|
4
|
+
import { B as ft } from "./loading-indicator.Db794TT5.js";
|
|
5
|
+
import { B as pt } from "./empty-state.Be6M8ivH.js";
|
|
6
6
|
import { u as Ie } from "./index.pdBj0KQU.js";
|
|
7
|
-
import { d as
|
|
8
|
-
import { B as gt } from "./chip.DuLyhNCy.js";
|
|
9
|
-
import { _ as H } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
7
|
+
import { d as gt } from "./debounce.DUTu11PS.js";
|
|
10
8
|
import { C as he, N as yt } from "./minus-small.DYIyF5XW.js";
|
|
11
9
|
import { C as St } from "./checkmark-small.x-gmK2Dt.js";
|
|
12
|
-
import { C as ht } from "./chevron-down.DCQ6ZLaq.js";
|
|
13
|
-
import { C as Ct } from "./chevron-up.kfuLRpZb.js";
|
|
14
|
-
import { g as Ne } from "./generate-uid.NJ8tVoha.js";
|
|
15
|
-
import { a as Et, b as Pe } from "./button-actions.BQ3AFQqt.js";
|
|
16
10
|
/* empty css */
|
|
17
|
-
import {
|
|
11
|
+
import { _ as q } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
12
|
+
import { B as ht } from "./chip.DuLyhNCy.js";
|
|
13
|
+
import { C as Ct } from "./chevron-down.DCQ6ZLaq.js";
|
|
14
|
+
import { C as Et } from "./chevron-up.kfuLRpZb.js";
|
|
15
|
+
import { g as Ne } from "./generate-uid.NJ8tVoha.js";
|
|
16
|
+
import { a as Ot, b as Me } from "./button-actions.BQ3AFQqt.js";
|
|
17
|
+
import { o as Tt } from "./resize.Bqks3WUm.js";
|
|
18
18
|
import "../assets/use-cached-selected-values.css";
|
|
19
|
-
const
|
|
20
|
-
const
|
|
19
|
+
const Fe = (e, t, i, s) => {
|
|
20
|
+
const n = v(
|
|
21
21
|
() => {
|
|
22
22
|
var p, y;
|
|
23
23
|
return !!((p = e.value) != null && p.length) && ((y = e.value) == null ? void 0 : y.length) === t.value.length;
|
|
24
24
|
}
|
|
25
|
-
), o =
|
|
25
|
+
), o = v(() => {
|
|
26
26
|
var p;
|
|
27
27
|
return e.value == null || e.value.length === 0 ? !1 : ((p = e.value) == null ? void 0 : p.length) !== t.value.length;
|
|
28
28
|
});
|
|
29
29
|
return {
|
|
30
|
-
isAllSelected:
|
|
30
|
+
isAllSelected: n,
|
|
31
31
|
isIndeterminate: o,
|
|
32
32
|
toggleSelectAll: (p) => {
|
|
33
33
|
p ? i() : s();
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
|
-
function
|
|
38
|
-
const o =
|
|
37
|
+
function _t(e, { disabled: t, itemHeight: i, overscan: s = 5, prefixHeight: n }) {
|
|
38
|
+
const o = L(null), a = L([]), p = L(0), y = L(0), r = L(0);
|
|
39
39
|
let u;
|
|
40
|
-
const l =
|
|
41
|
-
const
|
|
40
|
+
const l = v(() => {
|
|
41
|
+
const B = typeof i == "number" ? e.value.length * i : e.value.reduce((I, S, _) => I + i(_), 0), R = typeof i == "number" ? p.value * i : e.value.slice(0, p.value).reduce((I, S, _) => I + i(_), 0);
|
|
42
42
|
return {
|
|
43
43
|
style: {
|
|
44
|
-
marginTop: `${
|
|
45
|
-
height: `${
|
|
44
|
+
marginTop: `${R}px`,
|
|
45
|
+
height: `${B - R}px`
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
}), f = () => {
|
|
49
|
-
const
|
|
49
|
+
const B = (n == null ? void 0 : n.value) ?? 0, R = Math.max(o.value.scrollTop - B, 0);
|
|
50
50
|
if (typeof i == "number")
|
|
51
|
-
return Math.floor(
|
|
51
|
+
return Math.floor(R / i);
|
|
52
52
|
let I = 0, S = 0;
|
|
53
53
|
for (let _ = 0; _ < e.value.length; _ += 1) {
|
|
54
|
-
const
|
|
55
|
-
if (I +=
|
|
54
|
+
const Y = i(_);
|
|
55
|
+
if (I += Y, I >= R) {
|
|
56
56
|
S = _;
|
|
57
57
|
break;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
return S;
|
|
61
|
-
},
|
|
62
|
-
if (
|
|
63
|
-
return Math.ceil(
|
|
64
|
-
const
|
|
65
|
-
let
|
|
66
|
-
for (let S =
|
|
61
|
+
}, O = () => {
|
|
62
|
+
if (r.value = o.value.clientHeight, typeof i == "number")
|
|
63
|
+
return Math.ceil(r.value / i);
|
|
64
|
+
const B = p.value ?? 0;
|
|
65
|
+
let R = 0, I = 0;
|
|
66
|
+
for (let S = B; S < e.value.length; S += 1) {
|
|
67
67
|
const _ = i(S);
|
|
68
|
-
if (
|
|
68
|
+
if (R += _, I = S, R > r.value)
|
|
69
69
|
break;
|
|
70
70
|
}
|
|
71
|
-
return I -
|
|
71
|
+
return I - B;
|
|
72
72
|
}, T = () => {
|
|
73
73
|
if (o.value) {
|
|
74
|
-
const
|
|
75
|
-
p.value = f(), y.value = Math.min(p.value +
|
|
74
|
+
const B = O();
|
|
75
|
+
p.value = f(), y.value = Math.min(p.value + B + s, e.value.length), a.value = e.value.slice(p.value, y.value);
|
|
76
76
|
}
|
|
77
|
-
},
|
|
77
|
+
}, D = () => {
|
|
78
78
|
T();
|
|
79
79
|
};
|
|
80
|
-
t || (
|
|
81
|
-
o.value && (
|
|
82
|
-
|
|
80
|
+
t || (ut(() => {
|
|
81
|
+
o.value && (r.value = o.value.clientHeight, u = Tt(o.value, ({ clientHeight: B }) => {
|
|
82
|
+
r.value = B, T();
|
|
83
83
|
}), T());
|
|
84
|
-
}),
|
|
84
|
+
}), bt(() => {
|
|
85
85
|
u == null || u.disconnect();
|
|
86
86
|
}), ye(
|
|
87
87
|
() => e.value,
|
|
@@ -103,13 +103,13 @@ function Tt(e, { disabled: t, itemHeight: i, overscan: s = 5, prefixHeight: r })
|
|
|
103
103
|
} : {
|
|
104
104
|
containerRef: o,
|
|
105
105
|
containerProps: P,
|
|
106
|
-
onScroll:
|
|
107
|
-
list:
|
|
106
|
+
onScroll: D,
|
|
107
|
+
list: a,
|
|
108
108
|
wrapperProps: l
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
var g = /* @__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))(g || {}), ne = /* @__PURE__ */ ((e) => (e.AUTOMATIC = "automatic", e.BUTTON = "button", e.NONE = "none", e))(ne || {});
|
|
112
|
-
const
|
|
112
|
+
const It = J({
|
|
113
113
|
name: "bento-listbox-static-category",
|
|
114
114
|
components: {
|
|
115
115
|
BentoTypography: de
|
|
@@ -123,31 +123,31 @@ const _t = Z({
|
|
|
123
123
|
required: !0
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
}),
|
|
127
|
-
function
|
|
128
|
-
const
|
|
129
|
-
return
|
|
126
|
+
}), kt = ["aria-label"];
|
|
127
|
+
function Lt(e, t, i, s, n, o) {
|
|
128
|
+
const a = A("bento-typography");
|
|
129
|
+
return m(), E("div", {
|
|
130
130
|
class: "b-listbox-single-select-category",
|
|
131
131
|
role: "group",
|
|
132
132
|
"aria-label": e.categoryLabel
|
|
133
133
|
}, [
|
|
134
|
-
G(
|
|
134
|
+
G(a, {
|
|
135
135
|
variant: "caption",
|
|
136
136
|
el: "span",
|
|
137
137
|
class: "b-listbox-single-select-category__label-text",
|
|
138
138
|
"aria-hidden": "true"
|
|
139
139
|
}, {
|
|
140
|
-
default:
|
|
140
|
+
default: k(() => [
|
|
141
141
|
K(V(e.categoryLabel), 1)
|
|
142
142
|
]),
|
|
143
143
|
_: 1
|
|
144
144
|
}),
|
|
145
|
-
|
|
145
|
+
U("div", null, [
|
|
146
146
|
j(e.$slots, "default", {}, void 0, !0)
|
|
147
147
|
])
|
|
148
|
-
], 8,
|
|
148
|
+
], 8, kt);
|
|
149
149
|
}
|
|
150
|
-
const
|
|
150
|
+
const At = /* @__PURE__ */ q(It, [["render", Lt], ["__scopeId", "data-v-27c4e09a"]]), $t = J({
|
|
151
151
|
name: "bento-listbox-option",
|
|
152
152
|
props: {
|
|
153
153
|
/**
|
|
@@ -161,7 +161,7 @@ const kt = /* @__PURE__ */ H(_t, [["render", At], ["__scopeId", "data-v-27c4e09a
|
|
|
161
161
|
},
|
|
162
162
|
emits: [g.CLICK, g.ENTER, g.SPACE, g.TAB],
|
|
163
163
|
setup(e, { emit: t }) {
|
|
164
|
-
const i =
|
|
164
|
+
const i = v(() => ({
|
|
165
165
|
"b-listbox-option--disabled": e.disabled,
|
|
166
166
|
"b-listbox-option--selected": e.selected
|
|
167
167
|
}));
|
|
@@ -175,55 +175,55 @@ const kt = /* @__PURE__ */ H(_t, [["render", At], ["__scopeId", "data-v-27c4e09a
|
|
|
175
175
|
onClick: (o) => {
|
|
176
176
|
t(g.CLICK, o);
|
|
177
177
|
},
|
|
178
|
-
onOptionSelected: (o,
|
|
179
|
-
t(o,
|
|
178
|
+
onOptionSelected: (o, a) => {
|
|
179
|
+
t(o, a);
|
|
180
180
|
}
|
|
181
181
|
};
|
|
182
182
|
}
|
|
183
183
|
});
|
|
184
|
-
function
|
|
185
|
-
return
|
|
184
|
+
function Dt(e, t, i, s, n, o) {
|
|
185
|
+
return m(), E("div", x({
|
|
186
186
|
class: ["b-listbox-option", e.conditionalClasses],
|
|
187
187
|
role: "option"
|
|
188
188
|
}, e.$attrs, {
|
|
189
|
-
onClick: t[0] || (t[0] = (...
|
|
189
|
+
onClick: t[0] || (t[0] = (...a) => e.onClick && e.onClick(...a)),
|
|
190
190
|
onKeydown: [
|
|
191
|
-
t[1] || (t[1] = me((
|
|
192
|
-
t[2] || (t[2] = me((
|
|
193
|
-
t[3] || (t[3] = me((
|
|
191
|
+
t[1] || (t[1] = me((a) => e.onOptionSelected(e.BentoListboxEvent.ENTER, a), ["enter"])),
|
|
192
|
+
t[2] || (t[2] = me((a) => e.onOptionSelected(e.BentoListboxEvent.SPACE, a), ["space"])),
|
|
193
|
+
t[3] || (t[3] = me((a) => e.onOptionSelected(e.BentoListboxEvent.TAB, a), ["tab"]))
|
|
194
194
|
]
|
|
195
195
|
}), [
|
|
196
196
|
j(e.$slots, "default", {}, void 0, !0)
|
|
197
197
|
], 16);
|
|
198
198
|
}
|
|
199
|
-
const Ee = /* @__PURE__ */
|
|
200
|
-
let
|
|
201
|
-
const
|
|
199
|
+
const Ee = /* @__PURE__ */ q($t, [["render", Dt], ["__scopeId", "data-v-1495b1db"]]);
|
|
200
|
+
let Pe = 0;
|
|
201
|
+
const Bt = {
|
|
202
202
|
beforeCreate() {
|
|
203
|
-
this.uuid =
|
|
203
|
+
this.uuid = Pe.toString(), Pe += 1;
|
|
204
204
|
}
|
|
205
|
-
},
|
|
206
|
-
function
|
|
207
|
-
return
|
|
205
|
+
}, Rt = { key: 0 };
|
|
206
|
+
function Nt(e, t, i, s, n, o) {
|
|
207
|
+
return m(), E("svg", x({ role: "img" }, e.$attrs, {
|
|
208
208
|
class: "ui-assets-icons-16",
|
|
209
209
|
xmlns: "http://www.w3.org/2000/svg",
|
|
210
210
|
width: "16",
|
|
211
211
|
height: "16",
|
|
212
212
|
fill: "none"
|
|
213
213
|
}), [
|
|
214
|
-
e.$attrs["svg-title"] ? (
|
|
215
|
-
t[0] || (t[0] =
|
|
214
|
+
e.$attrs["svg-title"] ? (m(), E("title", Rt, V(e.$attrs["svg-title"]), 1)) : X("", !0),
|
|
215
|
+
t[0] || (t[0] = U("path", {
|
|
216
216
|
fill: "#001222",
|
|
217
217
|
d: "M15.0608 4.00011L14.0001 2.93945L6.00011 10.9395L2.00011 6.93945L0.939453 8.00011L6.00011 13.0608L15.0608 4.00011Z"
|
|
218
218
|
}, null, -1))
|
|
219
219
|
], 16);
|
|
220
220
|
}
|
|
221
|
-
const
|
|
221
|
+
const Mt = /* @__PURE__ */ q(Bt, [["render", Nt]]), Pt = J({
|
|
222
222
|
name: "bento-listbox-single-select-option",
|
|
223
223
|
components: {
|
|
224
224
|
BentoListboxOption: Ee,
|
|
225
225
|
BentoTypography: de,
|
|
226
|
-
CheckmarkIcon:
|
|
226
|
+
CheckmarkIcon: Mt
|
|
227
227
|
},
|
|
228
228
|
props: {
|
|
229
229
|
/**
|
|
@@ -245,13 +245,13 @@ const Nt = /* @__PURE__ */ H(Dt, [["render", Rt]]), Pt = Z({
|
|
|
245
245
|
},
|
|
246
246
|
emits: [g.ENTER, g.SELECT, g.SPACE, g.TAB],
|
|
247
247
|
setup(e, { emit: t }) {
|
|
248
|
-
const i = (
|
|
249
|
-
e.disabled || t(
|
|
250
|
-
}, s =
|
|
248
|
+
const i = (a) => {
|
|
249
|
+
e.disabled || t(a, e.option);
|
|
250
|
+
}, s = v(() => e.disabled ? !0 : null), n = v(() => e.selected ? !0 : null), o = v(() => e.disabled ? -1 : 0);
|
|
251
251
|
return {
|
|
252
252
|
// Values
|
|
253
253
|
ariaDisabled: s,
|
|
254
|
-
ariaSelected:
|
|
254
|
+
ariaSelected: n,
|
|
255
255
|
tabIndex: o,
|
|
256
256
|
// Enums
|
|
257
257
|
BentoListboxEvent: g,
|
|
@@ -259,53 +259,53 @@ const Nt = /* @__PURE__ */ H(Dt, [["render", Rt]]), Pt = Z({
|
|
|
259
259
|
onOptionSelected: i
|
|
260
260
|
};
|
|
261
261
|
}
|
|
262
|
-
}),
|
|
263
|
-
function
|
|
264
|
-
const
|
|
265
|
-
return
|
|
262
|
+
}), wt = { class: "b-listbox-single-select-option__text" }, Gt = { class: "b-listbox-single-select-option__check-icon" };
|
|
263
|
+
function xt(e, t, i, s, n, o) {
|
|
264
|
+
const a = A("bento-typography"), p = A("checkmark-icon"), y = A("bento-listbox-option");
|
|
265
|
+
return m(), $(y, {
|
|
266
266
|
class: "b-listbox-single-select-option",
|
|
267
267
|
disabled: e.disabled,
|
|
268
268
|
selected: e.selected,
|
|
269
269
|
"aria-selected": e.ariaSelected,
|
|
270
270
|
"aria-disabled": e.ariaDisabled,
|
|
271
271
|
tabindex: e.tabIndex,
|
|
272
|
-
onClick: t[0] || (t[0] = (
|
|
273
|
-
onEnterPressed: t[1] || (t[1] = (
|
|
274
|
-
onSpacePressed: t[2] || (t[2] = re((
|
|
275
|
-
onTabPressed: t[3] || (t[3] = (
|
|
272
|
+
onClick: t[0] || (t[0] = (r) => e.onOptionSelected(e.BentoListboxEvent.SELECT)),
|
|
273
|
+
onEnterPressed: t[1] || (t[1] = (r) => e.onOptionSelected(e.BentoListboxEvent.ENTER)),
|
|
274
|
+
onSpacePressed: t[2] || (t[2] = re((r) => e.onOptionSelected(e.BentoListboxEvent.SPACE), ["prevent"])),
|
|
275
|
+
onTabPressed: t[3] || (t[3] = (r) => e.onOptionSelected(e.BentoListboxEvent.TAB))
|
|
276
276
|
}, {
|
|
277
|
-
default:
|
|
277
|
+
default: k(() => [
|
|
278
278
|
j(e.$slots, "default", ae(ve(e.option)), () => [
|
|
279
|
-
|
|
280
|
-
G(
|
|
281
|
-
default:
|
|
279
|
+
U("span", wt, [
|
|
280
|
+
G(a, { el: "span" }, {
|
|
281
|
+
default: k(() => [
|
|
282
282
|
K(V(e.option.label), 1)
|
|
283
283
|
]),
|
|
284
284
|
_: 1
|
|
285
285
|
}),
|
|
286
|
-
e.option.description ? (
|
|
286
|
+
e.option.description ? (m(), $(a, {
|
|
287
287
|
key: 0,
|
|
288
288
|
class: "b-listbox-single-select-option__description",
|
|
289
289
|
el: "span"
|
|
290
290
|
}, {
|
|
291
|
-
default:
|
|
291
|
+
default: k(() => [
|
|
292
292
|
K(V(e.option.description), 1)
|
|
293
293
|
]),
|
|
294
294
|
_: 1
|
|
295
|
-
})) :
|
|
295
|
+
})) : X("", !0)
|
|
296
296
|
])
|
|
297
297
|
], !0),
|
|
298
|
-
|
|
298
|
+
U("span", Gt, [
|
|
299
299
|
ce(G(p, { "svg-title": "selected" }, null, 512), [
|
|
300
|
-
[
|
|
300
|
+
[Ue, e.selected]
|
|
301
301
|
])
|
|
302
302
|
])
|
|
303
303
|
]),
|
|
304
304
|
_: 3
|
|
305
305
|
}, 8, ["disabled", "selected", "aria-selected", "aria-disabled", "tabindex"]);
|
|
306
306
|
}
|
|
307
|
-
const
|
|
308
|
-
const i =
|
|
307
|
+
const Yt = /* @__PURE__ */ q(Pt, [["render", xt], ["__scopeId", "data-v-4f41af07"]]), Ke = ({ items: e }, t) => {
|
|
308
|
+
const i = v(() => e.value.length - 1), s = L(0), n = (f) => {
|
|
309
309
|
switch (f) {
|
|
310
310
|
case "increase":
|
|
311
311
|
s.value += 1;
|
|
@@ -314,9 +314,9 @@ const wt = /* @__PURE__ */ H(Pt, [["render", Gt], ["__scopeId", "data-v-4f41af07
|
|
|
314
314
|
s.value -= 1;
|
|
315
315
|
break;
|
|
316
316
|
}
|
|
317
|
-
}, o = ({ edgeCaseItem: f },
|
|
318
|
-
s.value !== f && (
|
|
319
|
-
},
|
|
317
|
+
}, o = ({ edgeCaseItem: f }, O) => {
|
|
318
|
+
s.value !== f && (n(O), t(s.value));
|
|
319
|
+
}, a = (f) => {
|
|
320
320
|
l(f), o(
|
|
321
321
|
{
|
|
322
322
|
edgeCaseItem: i.value
|
|
@@ -334,47 +334,47 @@ const wt = /* @__PURE__ */ H(Pt, [["render", Gt], ["__scopeId", "data-v-4f41af07
|
|
|
334
334
|
);
|
|
335
335
|
}, y = () => {
|
|
336
336
|
s.value = 0, t(s.value);
|
|
337
|
-
},
|
|
337
|
+
}, r = () => {
|
|
338
338
|
s.value = i.value, t(s.value);
|
|
339
339
|
}, u = (f) => {
|
|
340
340
|
s.value = f;
|
|
341
341
|
}, l = (f) => {
|
|
342
|
-
var
|
|
343
|
-
(
|
|
342
|
+
var O;
|
|
343
|
+
(O = f == null ? void 0 : f.detail) == null || O.preventDefault();
|
|
344
344
|
};
|
|
345
345
|
return {
|
|
346
346
|
moveToFirstElement: y,
|
|
347
|
-
moveToLastElement:
|
|
348
|
-
moveToNextElement:
|
|
347
|
+
moveToLastElement: r,
|
|
348
|
+
moveToNextElement: a,
|
|
349
349
|
moveToPreviousElement: p,
|
|
350
350
|
setListboxFocusedIndex: u,
|
|
351
351
|
preventDefault: l,
|
|
352
352
|
focusedIndex: s
|
|
353
353
|
};
|
|
354
|
-
},
|
|
355
|
-
const
|
|
354
|
+
}, We = (e, t, i = L("option"), s = !0) => {
|
|
355
|
+
const n = L([]), o = async () => {
|
|
356
356
|
if (!e.value || e.value.nodeType === Node.COMMENT_NODE)
|
|
357
357
|
return;
|
|
358
|
-
const
|
|
359
|
-
|
|
358
|
+
const a = Array.from(e.value.querySelectorAll(`[role="${i.value}"]`));
|
|
359
|
+
n.value = s ? a.filter((p) => p.checkVisibility()) : a;
|
|
360
360
|
};
|
|
361
361
|
return ye(
|
|
362
362
|
t,
|
|
363
363
|
() => {
|
|
364
|
-
|
|
364
|
+
ze(() => {
|
|
365
365
|
o();
|
|
366
366
|
});
|
|
367
367
|
},
|
|
368
368
|
{ immediate: !0 }
|
|
369
369
|
), {
|
|
370
|
-
visibleDomOptions:
|
|
370
|
+
visibleDomOptions: n,
|
|
371
371
|
updateVisibleDomOptions: o
|
|
372
372
|
};
|
|
373
|
-
},
|
|
373
|
+
}, Ut = J({
|
|
374
374
|
name: "bento-listbox-single-select",
|
|
375
375
|
components: {
|
|
376
|
-
BentoListboxSingleSelectCategory:
|
|
377
|
-
BentoListboxSingleSelectOption:
|
|
376
|
+
BentoListboxSingleSelectCategory: At,
|
|
377
|
+
BentoListboxSingleSelectOption: Yt
|
|
378
378
|
},
|
|
379
379
|
directives: { BentoKeyboardNavigationDirective: Ce },
|
|
380
380
|
inheritAttrs: !1,
|
|
@@ -418,40 +418,40 @@ const wt = /* @__PURE__ */ H(Pt, [["render", Gt], ["__scopeId", "data-v-4f41af07
|
|
|
418
418
|
staticCategories: { type: Boolean, default: !1 }
|
|
419
419
|
},
|
|
420
420
|
emits: [g.SELECT, g.ENTER, g.SPACE, g.TAB],
|
|
421
|
-
setup(e, { emit: t, expose: i, slots: s, attrs:
|
|
422
|
-
const o =
|
|
421
|
+
setup(e, { emit: t, expose: i, slots: s, attrs: n }) {
|
|
422
|
+
const o = L(null), a = L([]), p = v(() => {
|
|
423
423
|
var S;
|
|
424
424
|
return !!((S = e.selectedValue) != null && S.length) && e.selectedValue.at(0);
|
|
425
|
-
}), y =
|
|
425
|
+
}), y = v(
|
|
426
426
|
() => {
|
|
427
|
-
var S, _,
|
|
427
|
+
var S, _, Y, Q;
|
|
428
428
|
return {
|
|
429
|
-
"aria-label": (S =
|
|
430
|
-
"aria-busy": (_ =
|
|
431
|
-
"aria-atomic": (
|
|
432
|
-
"aria-live": (Q =
|
|
429
|
+
"aria-label": (S = n["aria-label"]) == null ? void 0 : S.toString(),
|
|
430
|
+
"aria-busy": (_ = n["aria-busy"]) == null ? void 0 : _.toString(),
|
|
431
|
+
"aria-atomic": (Y = n["aria-atomic"]) == null ? void 0 : Y.toString(),
|
|
432
|
+
"aria-live": (Q = n["aria-live"]) == null ? void 0 : Q.toString()
|
|
433
433
|
};
|
|
434
434
|
}
|
|
435
|
-
),
|
|
435
|
+
), r = v(() => !!e.items.some(({ items: S }) => !!S)), u = (S) => (_) => {
|
|
436
436
|
t(S, [_]);
|
|
437
|
-
}, { visibleDomOptions: l } =
|
|
437
|
+
}, { visibleDomOptions: l } = We(o, fe(e, "items"), L("option"), !1), f = (S) => {
|
|
438
438
|
var _;
|
|
439
439
|
(_ = l.value[S]) == null || _.focus();
|
|
440
440
|
}, {
|
|
441
|
-
moveToNextElement:
|
|
441
|
+
moveToNextElement: O,
|
|
442
442
|
moveToPreviousElement: T,
|
|
443
|
-
moveToFirstElement:
|
|
443
|
+
moveToFirstElement: D,
|
|
444
444
|
moveToLastElement: P,
|
|
445
|
-
setListboxFocusedIndex:
|
|
446
|
-
} =
|
|
445
|
+
setListboxFocusedIndex: B
|
|
446
|
+
} = Ke(
|
|
447
447
|
{
|
|
448
448
|
items: l
|
|
449
449
|
},
|
|
450
450
|
f
|
|
451
|
-
),
|
|
451
|
+
), R = {
|
|
452
452
|
[F.ARROW_UP]: T,
|
|
453
|
-
[F.ARROW_DOWN]:
|
|
454
|
-
[F.HOME]:
|
|
453
|
+
[F.ARROW_DOWN]: O,
|
|
454
|
+
[F.HOME]: D,
|
|
455
455
|
[F.END]: P
|
|
456
456
|
}, I = {
|
|
457
457
|
[g.SELECT]: u(g.SELECT),
|
|
@@ -464,40 +464,40 @@ const wt = /* @__PURE__ */ H(Pt, [["render", Gt], ["__scopeId", "data-v-4f41af07
|
|
|
464
464
|
* Reference for a single listbox item.
|
|
465
465
|
* Required for keyboard navigation in dropdown as $children is removed in vue@3
|
|
466
466
|
*/
|
|
467
|
-
listboxItemRef:
|
|
467
|
+
listboxItemRef: a,
|
|
468
468
|
/**
|
|
469
469
|
* Method to set the index of the item to be focused on
|
|
470
470
|
* Used for focus management to be kept in-sync with parent e.g. dropdowns
|
|
471
471
|
*/
|
|
472
|
-
setListboxFocusedIndex:
|
|
472
|
+
setListboxFocusedIndex: B
|
|
473
473
|
}), {
|
|
474
474
|
// Enums
|
|
475
475
|
BentoListboxEvent: g,
|
|
476
476
|
// Values
|
|
477
477
|
listboxRef: o,
|
|
478
|
-
listboxItemRef:
|
|
478
|
+
listboxItemRef: a,
|
|
479
479
|
selectedItem: p,
|
|
480
480
|
slots: s,
|
|
481
481
|
ariaAttributes: y,
|
|
482
482
|
// Computed
|
|
483
|
-
hasCategories:
|
|
483
|
+
hasCategories: r,
|
|
484
484
|
// Methods
|
|
485
485
|
onOptionSelected: u,
|
|
486
486
|
// Keyboard navigation
|
|
487
|
-
listboxListeners:
|
|
487
|
+
listboxListeners: R,
|
|
488
488
|
listboxOptionListeners: I
|
|
489
489
|
};
|
|
490
490
|
}
|
|
491
491
|
});
|
|
492
|
-
function
|
|
493
|
-
const
|
|
494
|
-
return ce((
|
|
495
|
-
e.hasCategories && e.staticCategories ? (
|
|
496
|
-
key:
|
|
497
|
-
"category-label":
|
|
492
|
+
function zt(e, t, i, s, n, o) {
|
|
493
|
+
const a = A("bento-listbox-single-select-option"), p = A("bento-listbox-single-select-category"), y = Ve("bento-keyboard-navigation-directive");
|
|
494
|
+
return ce((m(), E("div", x({ ref: "listboxRef" }, e.ariaAttributes, { role: "listbox" }, se(e.listboxListeners, !0)), [
|
|
495
|
+
e.hasCategories && e.staticCategories ? (m(!0), E(le, { key: 0 }, H(e.items, (r) => (m(), $(p, {
|
|
496
|
+
key: r.value,
|
|
497
|
+
"category-label": r.label
|
|
498
498
|
}, {
|
|
499
|
-
default:
|
|
500
|
-
(
|
|
499
|
+
default: k(() => [
|
|
500
|
+
(m(!0), E(le, null, H(r.items, (u) => (m(), $(a, x({
|
|
501
501
|
key: u.value,
|
|
502
502
|
ref_for: !0,
|
|
503
503
|
ref: "listboxItemRef",
|
|
@@ -506,28 +506,28 @@ function Ut(e, t, i, s, r, o) {
|
|
|
506
506
|
disabled: e.isOptionDisabled ? e.isOptionDisabled(u) : null,
|
|
507
507
|
selected: u.value === e.selectedItem.value
|
|
508
508
|
}, se(e.listboxOptionListeners)), pe({ _: 2 }, [
|
|
509
|
-
|
|
509
|
+
H(e.slots, (l, f) => ({
|
|
510
510
|
name: f,
|
|
511
|
-
fn:
|
|
512
|
-
j(e.$slots, f,
|
|
511
|
+
fn: k((O) => [
|
|
512
|
+
j(e.$slots, f, x({ ref_for: !0 }, O))
|
|
513
513
|
])
|
|
514
514
|
}))
|
|
515
515
|
]), 1040, ["option", "disabled", "selected"]))), 128))
|
|
516
516
|
]),
|
|
517
517
|
_: 2
|
|
518
|
-
}, 1032, ["category-label"]))), 128)) : (
|
|
519
|
-
key:
|
|
518
|
+
}, 1032, ["category-label"]))), 128)) : (m(!0), E(le, { key: 1 }, H(e.items, (r) => (m(), $(a, x({
|
|
519
|
+
key: r.value,
|
|
520
520
|
ref_for: !0,
|
|
521
521
|
ref: "listboxItemRef",
|
|
522
522
|
role: "option",
|
|
523
|
-
option:
|
|
524
|
-
disabled: e.isOptionDisabled ? e.isOptionDisabled(
|
|
525
|
-
selected:
|
|
523
|
+
option: r,
|
|
524
|
+
disabled: e.isOptionDisabled ? e.isOptionDisabled(r) : null,
|
|
525
|
+
selected: r.value === e.selectedItem.value
|
|
526
526
|
}, se(e.listboxOptionListeners)), pe({ _: 2 }, [
|
|
527
|
-
|
|
527
|
+
H(e.slots, (u, l) => ({
|
|
528
528
|
name: l,
|
|
529
|
-
fn:
|
|
530
|
-
j(e.$slots, l,
|
|
529
|
+
fn: k((f) => [
|
|
530
|
+
j(e.$slots, l, x({ ref_for: !0 }, f))
|
|
531
531
|
])
|
|
532
532
|
}))
|
|
533
533
|
]), 1040, ["option", "disabled", "selected"]))), 128))
|
|
@@ -535,58 +535,91 @@ function Ut(e, t, i, s, r, o) {
|
|
|
535
535
|
[y]
|
|
536
536
|
]);
|
|
537
537
|
}
|
|
538
|
-
const
|
|
539
|
-
|
|
540
|
-
|
|
538
|
+
const Vt = /* @__PURE__ */ q(Ut, [["render", zt]]);
|
|
539
|
+
let we = 0;
|
|
540
|
+
const Ft = {
|
|
541
|
+
beforeCreate() {
|
|
542
|
+
this.uuid = we.toString(), we += 1;
|
|
543
|
+
}
|
|
544
|
+
}, Kt = { key: 0 };
|
|
545
|
+
function Wt(e, t, i, s, n, o) {
|
|
546
|
+
return m(), E("svg", x({ role: "img" }, e.$attrs, {
|
|
547
|
+
class: "ui-assets-icons-16",
|
|
548
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
549
|
+
width: "16",
|
|
550
|
+
height: "16",
|
|
551
|
+
fill: "none"
|
|
552
|
+
}), [
|
|
553
|
+
e.$attrs["svg-title"] ? (m(), E("title", Kt, V(e.$attrs["svg-title"]), 1)) : X("", !0),
|
|
554
|
+
t[0] || (t[0] = U("path", {
|
|
555
|
+
fill: "#001222",
|
|
556
|
+
d: "M9.69043 5.75L4.62988 10.8105L1.56934 7.75L2.62988 6.68945L4.62988 8.68945L8.62988 4.68945L9.69043 5.75Z"
|
|
557
|
+
}, null, -1)),
|
|
558
|
+
t[1] || (t[1] = U("path", {
|
|
559
|
+
fill: "#001222",
|
|
560
|
+
d: "M13.9307 5.75L8.87012 10.8105L7.80957 9.75L12.8701 4.68945L13.9307 5.75Z"
|
|
561
|
+
}, null, -1))
|
|
562
|
+
], 16);
|
|
563
|
+
}
|
|
564
|
+
const jt = /* @__PURE__ */ q(Ft, [["render", Wt]]), qt = {}, Ht = /* @__PURE__ */ J({
|
|
565
|
+
...qt,
|
|
566
|
+
__name: "decorative-checkbox",
|
|
541
567
|
props: {
|
|
542
568
|
disabled: { type: Boolean, default: !1 },
|
|
543
569
|
indeterminate: { type: Boolean, default: !1 },
|
|
544
|
-
checked: { type: Boolean, default: !1 }
|
|
570
|
+
checked: { type: Boolean, default: !1 },
|
|
571
|
+
allSelected: { type: Boolean, default: !1 }
|
|
545
572
|
},
|
|
546
573
|
setup(e) {
|
|
547
|
-
const t = e, i =
|
|
574
|
+
const t = e, i = v(() => ({
|
|
548
575
|
[`b-checkbox-input--${he.DISABLED}`]: t.disabled
|
|
549
|
-
})), s =
|
|
550
|
-
[`b-checkbox-input__outline--${he.UNCHECKED}`]: !t.checked && !t.indeterminate,
|
|
551
|
-
[`b-checkbox-input__outline--${he.CHECKED}`]: t.checked && !t.indeterminate,
|
|
576
|
+
})), s = v(() => ({
|
|
577
|
+
[`b-checkbox-input__outline--${he.UNCHECKED}`]: !t.checked && !t.indeterminate && !t.allSelected,
|
|
578
|
+
[`b-checkbox-input__outline--${he.CHECKED}`]: (t.checked || t.allSelected) && !t.indeterminate,
|
|
552
579
|
[`b-checkbox-input__outline--${he.INDETERMINATE}`]: t.indeterminate
|
|
553
580
|
}));
|
|
554
|
-
return (
|
|
581
|
+
return (n, o) => (m(), E("div", {
|
|
555
582
|
class: ge(["b-checkbox-input", i.value]),
|
|
556
583
|
role: "presentation"
|
|
557
584
|
}, [
|
|
558
|
-
|
|
585
|
+
n.indeterminate ? (m(), $(M(yt), {
|
|
559
586
|
key: 0,
|
|
560
587
|
class: "b-checkbox-input__icon",
|
|
561
588
|
"svg-title": "",
|
|
562
589
|
"aria-hidden": "true"
|
|
563
|
-
})) :
|
|
590
|
+
})) : n.allSelected ? (m(), $(M(jt), {
|
|
564
591
|
key: 1,
|
|
565
592
|
class: "b-checkbox-input__icon",
|
|
566
593
|
"svg-title": "",
|
|
594
|
+
"aria-hidden": "true",
|
|
595
|
+
"data-testid": "decorative-checkbox-double-checkmark-icon"
|
|
596
|
+
})) : n.checked ? (m(), $(M(St), {
|
|
597
|
+
key: 2,
|
|
598
|
+
class: "b-checkbox-input__icon",
|
|
599
|
+
"svg-title": "",
|
|
567
600
|
"aria-hidden": "true"
|
|
568
|
-
})) :
|
|
569
|
-
|
|
601
|
+
})) : X("", !0),
|
|
602
|
+
U("div", {
|
|
570
603
|
class: ge(["b-checkbox-input__outline", s.value])
|
|
571
604
|
}, null, 2)
|
|
572
605
|
], 2));
|
|
573
606
|
}
|
|
574
|
-
}),
|
|
575
|
-
var
|
|
576
|
-
const
|
|
607
|
+
}), ke = /* @__PURE__ */ q(Ht, [["__scopeId", "data-v-08d3142e"]]);
|
|
608
|
+
var je = /* @__PURE__ */ ((e) => (e.DISABLED = "disabled", e.STATIC_CATEGORY = "static-category", e))(je || {}), te = /* @__PURE__ */ ((e) => (e.SELECT_CATEGORY = "select-category", e.UNSELECT_CATEGORY = "unselect-category", e.TOGGLE_CATEGORY_VISIBILITY = "toggle-category-visibility", e))(te || {});
|
|
609
|
+
const Ge = {
|
|
577
610
|
"en-US": {
|
|
578
611
|
categoryClosed: "{category} closed",
|
|
579
612
|
categoryOpened: "{category} opened"
|
|
580
613
|
}
|
|
581
|
-
},
|
|
582
|
-
i18n: { messages:
|
|
614
|
+
}, Xt = J({
|
|
615
|
+
i18n: { messages: Ge },
|
|
583
616
|
name: "bento-listbox-multi-select-category",
|
|
584
617
|
components: {
|
|
585
618
|
BentoTypography: de,
|
|
586
619
|
BentoListboxOption: Ee,
|
|
587
|
-
ChevronDownIcon:
|
|
588
|
-
ChevronUpIcon:
|
|
589
|
-
|
|
620
|
+
ChevronDownIcon: Ct,
|
|
621
|
+
ChevronUpIcon: Et,
|
|
622
|
+
DecorativeCheckbox: ke
|
|
590
623
|
},
|
|
591
624
|
props: {
|
|
592
625
|
/**
|
|
@@ -637,61 +670,61 @@ const xe = {
|
|
|
637
670
|
te.TOGGLE_CATEGORY_VISIBILITY
|
|
638
671
|
],
|
|
639
672
|
setup(e, { emit: t }) {
|
|
640
|
-
const i =
|
|
641
|
-
() => e.category.items.every((N) =>
|
|
642
|
-
), y = fe(e, "staticCategories"),
|
|
643
|
-
[`b-listbox-multi-select-category--${
|
|
644
|
-
})), l = (N,
|
|
645
|
-
N.preventDefault(), i.value =
|
|
673
|
+
const i = L(!1), { t: s } = Ie({ messages: Ge }), n = Ne("category-group"), o = Ne("category-name"), a = (N) => e.isOptionDisabled ? e.isOptionDisabled(N) : !1, p = v(
|
|
674
|
+
() => e.category.items.every((N) => a(N))
|
|
675
|
+
), y = fe(e, "staticCategories"), r = v(() => i.value || e.staticCategories), u = v(() => ({
|
|
676
|
+
[`b-listbox-multi-select-category--${je.DISABLED}`]: p.value
|
|
677
|
+
})), l = (N, z) => {
|
|
678
|
+
N.preventDefault(), i.value = z !== void 0 ? z : !i.value, t(te.TOGGLE_CATEGORY_VISIBILITY, e.category.value);
|
|
646
679
|
}, f = (N) => {
|
|
647
680
|
var oe;
|
|
648
|
-
const
|
|
649
|
-
return { isDisabled:
|
|
650
|
-
},
|
|
681
|
+
const z = a(N), W = ((oe = e.selectedItemsList) == null ? void 0 : oe.includes(N.value)) || !1;
|
|
682
|
+
return { isDisabled: z, isPreSelected: W };
|
|
683
|
+
}, O = v(
|
|
651
684
|
() => e.category.items.filter((N) => {
|
|
652
|
-
const { isDisabled:
|
|
653
|
-
return
|
|
685
|
+
const { isDisabled: z, isPreSelected: W } = f(N);
|
|
686
|
+
return z && W || !z;
|
|
654
687
|
})
|
|
655
|
-
), T =
|
|
688
|
+
), T = v(
|
|
656
689
|
() => {
|
|
657
690
|
var N;
|
|
658
|
-
return (N =
|
|
659
|
-
({ value:
|
|
691
|
+
return (N = O.value) == null ? void 0 : N.filter(
|
|
692
|
+
({ value: z }) => {
|
|
660
693
|
var W;
|
|
661
|
-
return (W = e.selectedItemsList) == null ? void 0 : W.includes(
|
|
694
|
+
return (W = e.selectedItemsList) == null ? void 0 : W.includes(z);
|
|
662
695
|
}
|
|
663
696
|
);
|
|
664
697
|
}
|
|
665
|
-
),
|
|
698
|
+
), D = v(() => {
|
|
666
699
|
const N = i.value ? "categoryOpened" : "categoryClosed";
|
|
667
700
|
return s(N, { category: e.category.label });
|
|
668
701
|
}), P = () => {
|
|
669
702
|
t(te.SELECT_CATEGORY);
|
|
670
|
-
},
|
|
703
|
+
}, B = () => {
|
|
671
704
|
t(te.UNSELECT_CATEGORY);
|
|
672
|
-
}, { isAllSelected:
|
|
705
|
+
}, { isAllSelected: R, isIndeterminate: I, toggleSelectAll: S } = Fe(
|
|
673
706
|
T,
|
|
674
|
-
|
|
707
|
+
O,
|
|
675
708
|
P,
|
|
676
|
-
|
|
677
|
-
), _ =
|
|
678
|
-
|
|
709
|
+
B
|
|
710
|
+
), _ = v(() => I.value ? "mixed" : `${R.value}`), Y = L(R.value), Q = () => {
|
|
711
|
+
Y.value = !Y.value, S(Y.value);
|
|
679
712
|
};
|
|
680
|
-
return ye(
|
|
681
|
-
|
|
713
|
+
return ye(R, () => {
|
|
714
|
+
Y.value = R.value;
|
|
682
715
|
}), {
|
|
683
716
|
// Values
|
|
684
|
-
chevronTitle:
|
|
717
|
+
chevronTitle: D,
|
|
685
718
|
conditionalClass: u,
|
|
686
719
|
hasAllPropsDisabled: p,
|
|
687
720
|
isOpen: i,
|
|
688
|
-
isAllSelected:
|
|
721
|
+
isAllSelected: R,
|
|
689
722
|
isIndeterminate: I,
|
|
690
723
|
isStaticCategory: y,
|
|
691
|
-
categoryGroupId:
|
|
724
|
+
categoryGroupId: n,
|
|
692
725
|
categoryNameId: o,
|
|
693
726
|
// Computed
|
|
694
|
-
showItemChildren:
|
|
727
|
+
showItemChildren: r,
|
|
695
728
|
ariaCheckedComputed: _,
|
|
696
729
|
// Methods
|
|
697
730
|
handleSelectAll: Q,
|
|
@@ -699,28 +732,28 @@ const xe = {
|
|
|
699
732
|
toggleSelectAll: S
|
|
700
733
|
};
|
|
701
734
|
}
|
|
702
|
-
}),
|
|
735
|
+
}), Zt = { class: "b-listbox-multi-select-category__label" }, Jt = {
|
|
703
736
|
key: 1,
|
|
704
737
|
class: "b-listbox-multi-select-category b-listbox-multi-select-category--static-category",
|
|
705
738
|
"aria-hidden": "true"
|
|
706
|
-
},
|
|
707
|
-
function
|
|
708
|
-
const
|
|
709
|
-
return
|
|
710
|
-
e.isStaticCategory ? (
|
|
711
|
-
|
|
739
|
+
}, Qt = { class: "b-listbox-multi-select-category__label" }, es = ["id", "aria-label"];
|
|
740
|
+
function ts(e, t, i, s, n, o) {
|
|
741
|
+
const a = A("decorative-checkbox"), p = A("bento-typography"), y = A("chevron-up-icon"), r = A("chevron-down-icon"), u = A("bento-listbox-option");
|
|
742
|
+
return m(), E("div", null, [
|
|
743
|
+
e.isStaticCategory ? (m(), E("div", Jt, [
|
|
744
|
+
U("span", Qt, [
|
|
712
745
|
G(p, {
|
|
713
746
|
el: "span",
|
|
714
747
|
variant: "caption",
|
|
715
748
|
class: "b-listbox-multi-select-category__label-text"
|
|
716
749
|
}, {
|
|
717
|
-
default:
|
|
750
|
+
default: k(() => [
|
|
718
751
|
K(V(e.category.label), 1)
|
|
719
752
|
]),
|
|
720
753
|
_: 1
|
|
721
754
|
})
|
|
722
755
|
])
|
|
723
|
-
])) : (
|
|
756
|
+
])) : (m(), $(u, {
|
|
724
757
|
key: 0,
|
|
725
758
|
class: ge(["b-listbox-multi-select-category__option", e.conditionalClass]),
|
|
726
759
|
tabindex: e.tabindex,
|
|
@@ -739,33 +772,33 @@ function Xt(e, t, i, s, r, o) {
|
|
|
739
772
|
t[2] || (t[2] = me((l) => e.toggleOpen(l, !0), ["arrow-right", "native"]))
|
|
740
773
|
]
|
|
741
774
|
}, {
|
|
742
|
-
default:
|
|
743
|
-
G(
|
|
775
|
+
default: k(() => [
|
|
776
|
+
G(a, {
|
|
744
777
|
indeterminate: e.isIndeterminate,
|
|
745
778
|
disabled: e.hasAllPropsDisabled,
|
|
746
779
|
checked: e.isAllSelected
|
|
747
780
|
}, null, 8, ["indeterminate", "disabled", "checked"]),
|
|
748
|
-
|
|
781
|
+
U("span", Zt, [
|
|
749
782
|
G(p, {
|
|
750
783
|
id: e.categoryNameId,
|
|
751
784
|
el: "span",
|
|
752
785
|
class: "b-listbox-multi-select-category__label-text"
|
|
753
786
|
}, {
|
|
754
|
-
default:
|
|
787
|
+
default: k(() => [
|
|
755
788
|
K(V(e.category.label), 1)
|
|
756
789
|
]),
|
|
757
790
|
_: 1
|
|
758
791
|
}, 8, ["id"]),
|
|
759
|
-
|
|
792
|
+
U("div", {
|
|
760
793
|
"aria-hidden": "true",
|
|
761
794
|
class: "b-listbox-multi-select-category__label-chevron",
|
|
762
795
|
"data-testid": "toggle-listbox",
|
|
763
796
|
onClickCapture: t[0] || (t[0] = re((...l) => e.toggleOpen && e.toggleOpen(...l), ["stop"]))
|
|
764
797
|
}, [
|
|
765
|
-
e.isOpen ? (
|
|
798
|
+
e.isOpen ? (m(), $(y, {
|
|
766
799
|
key: 0,
|
|
767
800
|
"svg-title": e.chevronTitle
|
|
768
|
-
}, null, 8, ["svg-title"])) : (
|
|
801
|
+
}, null, 8, ["svg-title"])) : (m(), $(r, {
|
|
769
802
|
key: 1,
|
|
770
803
|
"svg-title": e.chevronTitle
|
|
771
804
|
}, null, 8, ["svg-title"]))
|
|
@@ -774,26 +807,26 @@ function Xt(e, t, i, s, r, o) {
|
|
|
774
807
|
]),
|
|
775
808
|
_: 1
|
|
776
809
|
}, 8, ["class", "tabindex", "aria-selected", "aria-checked", "aria-disabled", "aria-expanded", "aria-owns", "aria-labelledby", "onClick", "onEnterPressed", "onSpacePressed"])),
|
|
777
|
-
ce(
|
|
810
|
+
ce(U("div", {
|
|
778
811
|
id: e.categoryGroupId,
|
|
779
812
|
role: "group",
|
|
780
813
|
"aria-label": e.category.label
|
|
781
814
|
}, [
|
|
782
815
|
j(e.$slots, "default", {}, void 0, !0)
|
|
783
|
-
], 8,
|
|
784
|
-
[
|
|
816
|
+
], 8, es), [
|
|
817
|
+
[Ue, e.showItemChildren]
|
|
785
818
|
])
|
|
786
819
|
]);
|
|
787
820
|
}
|
|
788
|
-
const
|
|
789
|
-
var
|
|
790
|
-
const
|
|
821
|
+
const ss = /* @__PURE__ */ q(Xt, [["render", ts], ["__scopeId", "data-v-60c04867"]]);
|
|
822
|
+
var Z = /* @__PURE__ */ ((e) => (e.SELECT_CATEGORY = "select-category", e.TOGGLE_CHECKBOX_SELECTION = "toggle-checkbox-selection", e.UNSELECT_CATEGORY = "unselect-category", e.TOGGLE_CATEGORY_VISIBILITY = "toggle-category-visibility", e))(Z || {});
|
|
823
|
+
const ls = J({
|
|
791
824
|
name: "listbox-multi-select-options",
|
|
792
825
|
components: {
|
|
793
826
|
BentoListboxOption: Ee,
|
|
794
827
|
BentoTypography: de,
|
|
795
|
-
ListboxMultiSelectCategory:
|
|
796
|
-
|
|
828
|
+
ListboxMultiSelectCategory: ss,
|
|
829
|
+
DecorativeCheckbox: ke
|
|
797
830
|
},
|
|
798
831
|
inheritAttrs: !1,
|
|
799
832
|
props: {
|
|
@@ -863,49 +896,49 @@ const Zt = Z({
|
|
|
863
896
|
}
|
|
864
897
|
},
|
|
865
898
|
emits: [
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
899
|
+
Z.TOGGLE_CHECKBOX_SELECTION,
|
|
900
|
+
Z.SELECT_CATEGORY,
|
|
901
|
+
Z.UNSELECT_CATEGORY,
|
|
902
|
+
Z.TOGGLE_CATEGORY_VISIBILITY
|
|
870
903
|
],
|
|
871
904
|
setup(e, { emit: t }) {
|
|
872
|
-
const i = (
|
|
873
|
-
e.isOptionDisabled(
|
|
874
|
-
}, s = (
|
|
905
|
+
const i = (r) => {
|
|
906
|
+
e.isOptionDisabled(r) || t(Z.TOGGLE_CHECKBOX_SELECTION, r);
|
|
907
|
+
}, s = (r) => !!r.items, n = (r) => {
|
|
875
908
|
const u = e.isMultiLevel && e.searching;
|
|
876
|
-
return
|
|
877
|
-
}, o = (
|
|
878
|
-
if (s(
|
|
879
|
-
const u = o(
|
|
880
|
-
t(u,
|
|
909
|
+
return r.description && (!e.isMultiLevel || u);
|
|
910
|
+
}, o = (r) => r.items ? !!r.items.find((u) => e.selectedItemsList.includes(u.value)) : e.selectedItemsList.includes(r.value), a = (r) => {
|
|
911
|
+
if (s(r)) {
|
|
912
|
+
const u = o(r) ? Z.UNSELECT_CATEGORY : Z.SELECT_CATEGORY;
|
|
913
|
+
t(u, r);
|
|
881
914
|
} else
|
|
882
|
-
i(
|
|
915
|
+
i(r);
|
|
883
916
|
};
|
|
884
917
|
return {
|
|
885
918
|
// Values
|
|
886
|
-
conditionalClasses:
|
|
919
|
+
conditionalClasses: v(() => ({
|
|
887
920
|
"b-listbox-multi-select-options__static-category-option": e.staticCategories,
|
|
888
921
|
"b-listbox-multi-select-options__category-option": e.categoryItems
|
|
889
922
|
})),
|
|
890
923
|
// Methods
|
|
891
924
|
isOptionSelected: o,
|
|
892
|
-
shouldShowDescription:
|
|
925
|
+
shouldShowDescription: n,
|
|
893
926
|
toggleCheckboxSelection: i,
|
|
894
|
-
toggleSearchOption:
|
|
895
|
-
computedTabindex: (
|
|
927
|
+
toggleSearchOption: a,
|
|
928
|
+
computedTabindex: (r) => e.itemsIndex[r] === e.focusedIndex ? 0 : -1,
|
|
896
929
|
// Enums
|
|
897
930
|
BentoListboxEvent: g,
|
|
898
|
-
ListboxMultiSelectOptionsEvent:
|
|
931
|
+
ListboxMultiSelectOptionsEvent: Z
|
|
899
932
|
};
|
|
900
933
|
}
|
|
901
|
-
}),
|
|
902
|
-
function
|
|
903
|
-
const
|
|
904
|
-
return
|
|
905
|
-
(
|
|
934
|
+
}), os = { class: "b-listbox-multi-select__option-text" }, is = { class: "b-listbox-multi-select__option-text" };
|
|
935
|
+
function ns(e, t, i, s, n, o) {
|
|
936
|
+
const a = A("decorative-checkbox"), p = A("bento-typography"), y = A("bento-listbox-option"), r = A("listbox-multi-select-options", !0), u = A("listbox-multi-select-category");
|
|
937
|
+
return m(), E("div", null, [
|
|
938
|
+
(m(!0), E(le, null, H(e.items, (l) => (m(), E("div", {
|
|
906
939
|
key: `selected-${l.value}`
|
|
907
940
|
}, [
|
|
908
|
-
e.searching && e.isMultiLevel ? (
|
|
941
|
+
e.searching && e.isMultiLevel ? (m(), $(y, {
|
|
909
942
|
key: 0,
|
|
910
943
|
class: ge(["b-listbox-multi-select-options", e.conditionalClasses]),
|
|
911
944
|
disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null,
|
|
@@ -918,35 +951,35 @@ function ts(e, t, i, s, r, o) {
|
|
|
918
951
|
onEnterPressed: (f) => e.toggleSearchOption(l),
|
|
919
952
|
onSpacePressed: re((f) => e.toggleSearchOption(l), ["prevent"])
|
|
920
953
|
}, {
|
|
921
|
-
default:
|
|
922
|
-
G(
|
|
954
|
+
default: k(() => [
|
|
955
|
+
G(a, {
|
|
923
956
|
disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null,
|
|
924
957
|
checked: e.isOptionSelected(l)
|
|
925
958
|
}, null, 8, ["disabled", "checked"]),
|
|
926
|
-
j(e.$slots, "default",
|
|
927
|
-
|
|
959
|
+
j(e.$slots, "default", x({ ref_for: !0 }, l), () => [
|
|
960
|
+
U("span", os, [
|
|
928
961
|
G(p, { el: "span" }, {
|
|
929
|
-
default:
|
|
962
|
+
default: k(() => [
|
|
930
963
|
K(V(l.label), 1)
|
|
931
964
|
]),
|
|
932
965
|
_: 2
|
|
933
966
|
}, 1024),
|
|
934
|
-
e.shouldShowDescription(l) ? (
|
|
967
|
+
e.shouldShowDescription(l) ? (m(), $(p, {
|
|
935
968
|
key: 0,
|
|
936
969
|
class: "b-listbox-multi-select__option-description",
|
|
937
970
|
el: "span"
|
|
938
971
|
}, {
|
|
939
|
-
default:
|
|
972
|
+
default: k(() => [
|
|
940
973
|
K(V(l.description), 1)
|
|
941
974
|
]),
|
|
942
975
|
_: 2
|
|
943
|
-
}, 1024)) :
|
|
976
|
+
}, 1024)) : X("", !0)
|
|
944
977
|
])
|
|
945
978
|
], !0)
|
|
946
979
|
]),
|
|
947
980
|
_: 2
|
|
948
|
-
}, 1032, ["class", "disabled", "tabindex", "aria-selected", "aria-checked", "aria-disabled", "role", "onClick", "onEnterPressed", "onSpacePressed"])) : (
|
|
949
|
-
l.items ? (
|
|
981
|
+
}, 1032, ["class", "disabled", "tabindex", "aria-selected", "aria-checked", "aria-disabled", "role", "onClick", "onEnterPressed", "onSpacePressed"])) : (m(), E(le, { key: 1 }, [
|
|
982
|
+
l.items ? (m(), $(u, {
|
|
950
983
|
key: 0,
|
|
951
984
|
category: l,
|
|
952
985
|
"static-categories": e.staticCategories,
|
|
@@ -957,8 +990,8 @@ function ts(e, t, i, s, r, o) {
|
|
|
957
990
|
onUnselectCategory: (f) => e.$emit(e.ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY, l),
|
|
958
991
|
onToggleCategoryVisibility: t[1] || (t[1] = (f) => e.$emit(e.ListboxMultiSelectOptionsEvent.TOGGLE_CATEGORY_VISIBILITY, f))
|
|
959
992
|
}, {
|
|
960
|
-
default:
|
|
961
|
-
G(
|
|
993
|
+
default: k(() => [
|
|
994
|
+
G(r, {
|
|
962
995
|
"category-items": "",
|
|
963
996
|
items: l.items,
|
|
964
997
|
"is-option-disabled": e.isOptionDisabled,
|
|
@@ -973,7 +1006,7 @@ function ts(e, t, i, s, r, o) {
|
|
|
973
1006
|
}, null, 8, ["items", "is-option-disabled", "items-index", "focused-index", "is-multi-level", "static-categories", "selected-items-list", "searching", "role"])
|
|
974
1007
|
]),
|
|
975
1008
|
_: 2
|
|
976
|
-
}, 1032, ["category", "static-categories", "is-option-disabled", "selected-items-list", "tabindex", "onSelectCategory", "onUnselectCategory"])) : (
|
|
1009
|
+
}, 1032, ["category", "static-categories", "is-option-disabled", "selected-items-list", "tabindex", "onSelectCategory", "onUnselectCategory"])) : (m(), $(y, {
|
|
977
1010
|
key: 1,
|
|
978
1011
|
class: ge(["b-listbox-multi-select-options", e.conditionalClasses]),
|
|
979
1012
|
disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null,
|
|
@@ -986,29 +1019,29 @@ function ts(e, t, i, s, r, o) {
|
|
|
986
1019
|
onEnterPressed: (f) => e.toggleCheckboxSelection(l),
|
|
987
1020
|
onSpacePressed: re((f) => e.toggleCheckboxSelection(l), ["prevent"])
|
|
988
1021
|
}, {
|
|
989
|
-
default:
|
|
990
|
-
G(
|
|
1022
|
+
default: k(() => [
|
|
1023
|
+
G(a, {
|
|
991
1024
|
disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null,
|
|
992
1025
|
checked: e.isOptionSelected(l)
|
|
993
1026
|
}, null, 8, ["disabled", "checked"]),
|
|
994
|
-
j(e.$slots, "default",
|
|
995
|
-
|
|
1027
|
+
j(e.$slots, "default", x({ ref_for: !0 }, l), () => [
|
|
1028
|
+
U("span", is, [
|
|
996
1029
|
G(p, { el: "span" }, {
|
|
997
|
-
default:
|
|
1030
|
+
default: k(() => [
|
|
998
1031
|
K(V(l.label), 1)
|
|
999
1032
|
]),
|
|
1000
1033
|
_: 2
|
|
1001
1034
|
}, 1024),
|
|
1002
|
-
e.shouldShowDescription(l) ? (
|
|
1035
|
+
e.shouldShowDescription(l) ? (m(), $(p, {
|
|
1003
1036
|
key: 0,
|
|
1004
1037
|
class: "b-listbox-multi-select__option-description",
|
|
1005
1038
|
el: "span"
|
|
1006
1039
|
}, {
|
|
1007
|
-
default:
|
|
1040
|
+
default: k(() => [
|
|
1008
1041
|
K(V(l.description), 1)
|
|
1009
1042
|
]),
|
|
1010
1043
|
_: 2
|
|
1011
|
-
}, 1024)) :
|
|
1044
|
+
}, 1024)) : X("", !0)
|
|
1012
1045
|
])
|
|
1013
1046
|
], !0)
|
|
1014
1047
|
]),
|
|
@@ -1018,19 +1051,19 @@ function ts(e, t, i, s, r, o) {
|
|
|
1018
1051
|
]))), 128))
|
|
1019
1052
|
]);
|
|
1020
1053
|
}
|
|
1021
|
-
const
|
|
1022
|
-
const t =
|
|
1054
|
+
const as = /* @__PURE__ */ q(ls, [["render", ns], ["__scopeId", "data-v-0c9e6af6"]]), rs = (e) => {
|
|
1055
|
+
const t = v(() => {
|
|
1023
1056
|
var s;
|
|
1024
|
-
return !!((s = e.value) != null && s.find(({ items:
|
|
1025
|
-
}), i =
|
|
1057
|
+
return !!((s = e.value) != null && s.find(({ items: n }) => !!n));
|
|
1058
|
+
}), i = v(() => {
|
|
1026
1059
|
var s;
|
|
1027
|
-
return t.value ? (s = e.value) == null ? void 0 : s.reduce((
|
|
1060
|
+
return t.value ? (s = e.value) == null ? void 0 : s.reduce((n, o) => (o.items ? n.push(...o.items.flat()) : n.push(o), n), []) : e.value;
|
|
1028
1061
|
});
|
|
1029
1062
|
return {
|
|
1030
1063
|
isMultiLevelSelect: t,
|
|
1031
1064
|
flattenedItemsList: i
|
|
1032
1065
|
};
|
|
1033
|
-
},
|
|
1066
|
+
}, qe = {
|
|
1034
1067
|
"en-US": {
|
|
1035
1068
|
allSelected: "All selected ({total})",
|
|
1036
1069
|
numberOfTotalSelected: "{number} of {total} selected",
|
|
@@ -1049,12 +1082,12 @@ const ss = /* @__PURE__ */ H(Zt, [["render", ts], ["__scopeId", "data-v-74d7ed4a
|
|
|
1049
1082
|
numbersSelected: "{number} selecionados",
|
|
1050
1083
|
selectAll: "Selecionar todos ({total})"
|
|
1051
1084
|
}
|
|
1052
|
-
},
|
|
1085
|
+
}, cs = { key: 0 }, ds = ["role"], us = {
|
|
1053
1086
|
key: 1,
|
|
1054
1087
|
class: "b-listbox-multi-select__divider",
|
|
1055
1088
|
"aria-hidden": "true"
|
|
1056
|
-
},
|
|
1057
|
-
...
|
|
1089
|
+
}, bs = { i18n: { messages: qe } }, ms = /* @__PURE__ */ J({
|
|
1090
|
+
...bs,
|
|
1058
1091
|
__name: "listbox-multi-select",
|
|
1059
1092
|
props: {
|
|
1060
1093
|
hasMoreItems: { type: Boolean, default: !1 },
|
|
@@ -1067,7 +1100,7 @@ const ss = /* @__PURE__ */ H(Zt, [["render", ts], ["__scopeId", "data-v-74d7ed4a
|
|
|
1067
1100
|
},
|
|
1068
1101
|
emits: ["select"],
|
|
1069
1102
|
setup(e, { expose: t, emit: i }) {
|
|
1070
|
-
const s = e,
|
|
1103
|
+
const s = e, n = i, { t: o, n: a } = Ie({ messages: qe }), p = mt(), y = vt(), r = v(
|
|
1071
1104
|
() => {
|
|
1072
1105
|
var c, b, d, h;
|
|
1073
1106
|
return {
|
|
@@ -1078,12 +1111,12 @@ const ss = /* @__PURE__ */ H(Zt, [["render", ts], ["__scopeId", "data-v-74d7ed4a
|
|
|
1078
1111
|
"aria-multiselectable": !0
|
|
1079
1112
|
};
|
|
1080
1113
|
}
|
|
1081
|
-
), u =
|
|
1114
|
+
), u = L(null), l = L(null), f = L(null), O = L(null), T = v(() => s.selectedValues.map(({ value: c }) => c)), { isMultiLevelSelect: D, flattenedItemsList: P } = rs(fe(s, "items")), B = v(() => D.value && !s.staticCategories), R = v(() => B.value ? "tree" : "listbox"), I = v(() => B.value ? "treeitem" : "option"), S = (c) => {
|
|
1082
1115
|
var h;
|
|
1083
1116
|
const b = s.isOptionDisabled(c), d = ((h = T.value) == null ? void 0 : h.includes(c.value)) || !1;
|
|
1084
1117
|
return { isDisabled: b, isPreSelected: d };
|
|
1085
|
-
}, _ =
|
|
1086
|
-
if (s.searching &&
|
|
1118
|
+
}, _ = v(() => {
|
|
1119
|
+
if (s.searching && D)
|
|
1087
1120
|
return s.items;
|
|
1088
1121
|
const c = P.value.filter((b) => {
|
|
1089
1122
|
const { isDisabled: d, isPreSelected: h } = S(b);
|
|
@@ -1092,107 +1125,107 @@ const ss = /* @__PURE__ */ H(Zt, [["render", ts], ["__scopeId", "data-v-74d7ed4a
|
|
|
1092
1125
|
return s.selectedValues.forEach((b) => {
|
|
1093
1126
|
c.find((d) => d.value === b.value) || c.push(b);
|
|
1094
1127
|
}), c;
|
|
1095
|
-
}),
|
|
1128
|
+
}), Y = v(
|
|
1096
1129
|
() => {
|
|
1097
1130
|
var c;
|
|
1098
1131
|
return (c = _.value) == null ? void 0 : c.filter((b) => {
|
|
1099
1132
|
var d;
|
|
1100
|
-
return b.items &&
|
|
1133
|
+
return b.items && D.value && s.searching ? b.items.filter(
|
|
1101
1134
|
(C) => (s.selectedValues ?? []).includes(C.value)
|
|
1102
1135
|
).length === b.items.length : (d = T.value) == null ? void 0 : d.includes(b.value);
|
|
1103
1136
|
});
|
|
1104
1137
|
}
|
|
1105
|
-
), Q = () =>
|
|
1138
|
+
), Q = () => D.value && !s.searching ? P.value.length : s.items.length, N = v(() => {
|
|
1106
1139
|
var h;
|
|
1107
|
-
const c = _.value.length, b = Q(), d = ((h =
|
|
1108
|
-
return d === 0 ? o("selectAll", { total:
|
|
1109
|
-
}),
|
|
1140
|
+
const c = _.value.length, b = Q(), d = ((h = Y.value) == null ? void 0 : h.length) || 0;
|
|
1141
|
+
return d === 0 ? o("selectAll", { total: a(c) }) : d === b ? o("allSelected", { total: a(b) }) : d <= b ? o("numberOfTotalSelected", { number: a(d), total: a(b) }) : o("numbersSelected", { number: a(d) });
|
|
1142
|
+
}), z = (c) => {
|
|
1110
1143
|
const b = (h) => {
|
|
1111
1144
|
const { isDisabled: C, isPreSelected: ee } = S(h);
|
|
1112
1145
|
return C && ee || !C;
|
|
1113
1146
|
}, d = c.filter(b).filter((h) => !T.value.includes(h.value));
|
|
1114
|
-
|
|
1147
|
+
n("select", [...s.selectedValues, ...d]);
|
|
1115
1148
|
}, W = (c) => {
|
|
1116
1149
|
const b = (C) => {
|
|
1117
|
-
const { isDisabled: ee, isPreSelected:
|
|
1118
|
-
return !(ee &&
|
|
1150
|
+
const { isDisabled: ee, isPreSelected: dt } = S(C);
|
|
1151
|
+
return !(ee && dt);
|
|
1119
1152
|
}, d = c.filter(b).map(({ value: C }) => C), h = s.selectedValues.filter((C) => !(d != null && d.includes(C.value)));
|
|
1120
|
-
|
|
1153
|
+
n("select", h);
|
|
1121
1154
|
}, oe = () => {
|
|
1122
|
-
|
|
1155
|
+
z(P.value);
|
|
1123
1156
|
}, Oe = () => {
|
|
1124
1157
|
W(P.value);
|
|
1125
|
-
}, { isAllSelected:
|
|
1126
|
-
|
|
1158
|
+
}, { isAllSelected: w, isIndeterminate: ie, toggleSelectAll: He } = Fe(
|
|
1159
|
+
Y,
|
|
1127
1160
|
_,
|
|
1128
1161
|
oe,
|
|
1129
1162
|
Oe
|
|
1130
|
-
),
|
|
1131
|
-
Se.value = !Se.value,
|
|
1163
|
+
), Le = v(() => ie.value ? "mixed" : `${w.value}`), Se = L(w.value), Te = () => {
|
|
1164
|
+
Se.value = !Se.value, He(Se.value);
|
|
1132
1165
|
};
|
|
1133
|
-
ye(
|
|
1134
|
-
Se.value =
|
|
1166
|
+
ye(w, () => {
|
|
1167
|
+
Se.value = w.value;
|
|
1135
1168
|
});
|
|
1136
|
-
const
|
|
1137
|
-
|
|
1138
|
-
},
|
|
1169
|
+
const Xe = (c) => {
|
|
1170
|
+
z(c.items);
|
|
1171
|
+
}, Ae = (c) => {
|
|
1139
1172
|
W(c.items);
|
|
1140
1173
|
}, ue = (c, b) => {
|
|
1141
1174
|
let d = !1;
|
|
1142
1175
|
const h = s.selectedValues.filter(({ value: C }) => b.value === C ? (d = !0, !1) : !0);
|
|
1143
|
-
d || h.push(b),
|
|
1144
|
-
},
|
|
1145
|
-
if (
|
|
1176
|
+
d || h.push(b), n(c, h);
|
|
1177
|
+
}, Ze = v(() => {
|
|
1178
|
+
if (!D.value)
|
|
1146
1179
|
return s.selectedValues;
|
|
1147
1180
|
const c = (C) => T.value.includes(C.value), b = (C) => !s.staticCategories && C.every((ee) => c(ee));
|
|
1148
1181
|
return s.items.flatMap(
|
|
1149
1182
|
(C) => C.items && !b(C.items) ? C.items : C
|
|
1150
1183
|
).filter((C) => C.items ? !0 : c(C));
|
|
1151
|
-
}), Je =
|
|
1184
|
+
}), Je = v(() => {
|
|
1152
1185
|
var d, h, C, ee;
|
|
1153
|
-
const c = ["automatic", "button"].includes(s.lazyLoadType), b = ((d = s.selectedValues) == null ? void 0 : d.length) > 0 && ((h =
|
|
1186
|
+
const c = ["automatic", "button"].includes(s.lazyLoadType), b = ((d = s.selectedValues) == null ? void 0 : d.length) > 0 && ((h = Y.value) == null ? void 0 : h.length) !== ((C = P.value) == null ? void 0 : C.length);
|
|
1154
1187
|
return c && s.hasMoreItems ? !!((ee = s.selectedValues) != null && ee.length) : b;
|
|
1155
|
-
}), $e =
|
|
1188
|
+
}), $e = v(() => ["automatic", "button"].includes(s.lazyLoadType) ? !s.hasMoreItems : !0), be = L([]), { visibleDomOptions: De, updateVisibleDomOptions: Qe } = We(
|
|
1156
1189
|
u,
|
|
1157
1190
|
fe(s, "items"),
|
|
1158
1191
|
I
|
|
1159
|
-
),
|
|
1160
|
-
be.value.includes(c) ? be.value = be.value.filter((b) => b !== c) : be.value.push(c),
|
|
1161
|
-
|
|
1192
|
+
), et = (c) => {
|
|
1193
|
+
be.value.includes(c) ? be.value = be.value.filter((b) => b !== c) : be.value.push(c), ze(() => {
|
|
1194
|
+
Qe();
|
|
1162
1195
|
});
|
|
1163
|
-
},
|
|
1196
|
+
}, tt = (c) => {
|
|
1164
1197
|
var b;
|
|
1165
1198
|
(b = De.value[c]) == null || b.focus();
|
|
1166
1199
|
}, {
|
|
1167
|
-
moveToNextElement:
|
|
1168
|
-
moveToPreviousElement:
|
|
1169
|
-
moveToFirstElement:
|
|
1170
|
-
moveToLastElement:
|
|
1200
|
+
moveToNextElement: st,
|
|
1201
|
+
moveToPreviousElement: lt,
|
|
1202
|
+
moveToFirstElement: ot,
|
|
1203
|
+
moveToLastElement: it,
|
|
1171
1204
|
preventDefault: Be,
|
|
1172
1205
|
focusedIndex: Re,
|
|
1173
|
-
setListboxFocusedIndex:
|
|
1174
|
-
} =
|
|
1206
|
+
setListboxFocusedIndex: nt
|
|
1207
|
+
} = Ke(
|
|
1175
1208
|
{
|
|
1176
1209
|
items: De
|
|
1177
1210
|
},
|
|
1178
|
-
|
|
1179
|
-
),
|
|
1180
|
-
[F.ARROW_UP]: (c) =>
|
|
1181
|
-
[F.ARROW_DOWN]: (c) =>
|
|
1182
|
-
[F.HOME]:
|
|
1183
|
-
[F.END]:
|
|
1211
|
+
tt
|
|
1212
|
+
), at = {
|
|
1213
|
+
[F.ARROW_UP]: (c) => lt(c),
|
|
1214
|
+
[F.ARROW_DOWN]: (c) => st(c),
|
|
1215
|
+
[F.HOME]: ot,
|
|
1216
|
+
[F.END]: it
|
|
1184
1217
|
};
|
|
1185
1218
|
t({
|
|
1186
1219
|
/**
|
|
1187
1220
|
* Method to set the index of the item to be focused on
|
|
1188
1221
|
* Used for focus management to be kept in-sync with parent e.g. dropdowns
|
|
1189
1222
|
*/
|
|
1190
|
-
setListboxFocusedIndex:
|
|
1223
|
+
setListboxFocusedIndex: nt
|
|
1191
1224
|
});
|
|
1192
|
-
const
|
|
1225
|
+
const rt = {
|
|
1193
1226
|
[F.ARROW_UP]: Be,
|
|
1194
1227
|
[F.ARROW_DOWN]: Be
|
|
1195
|
-
},
|
|
1228
|
+
}, ct = v(() => {
|
|
1196
1229
|
let c = 1;
|
|
1197
1230
|
const b = {};
|
|
1198
1231
|
return s.items.forEach((d) => {
|
|
@@ -1200,96 +1233,96 @@ const ss = /* @__PURE__ */ H(Zt, [["render", ts], ["__scopeId", "data-v-74d7ed4a
|
|
|
1200
1233
|
d.items ? (s.staticCategories ? h = !0 : b[d.value] = c++, h && d.items.forEach((C) => b[C.value] = c++)) : b[d.value] = c++;
|
|
1201
1234
|
}), b;
|
|
1202
1235
|
});
|
|
1203
|
-
return (c, b) => (
|
|
1236
|
+
return (c, b) => (m(), E("div", {
|
|
1204
1237
|
ref_key: "listboxRef",
|
|
1205
1238
|
ref: u,
|
|
1206
1239
|
class: "b-listbox-multi-select"
|
|
1207
1240
|
}, [
|
|
1208
|
-
Je.value ? (
|
|
1209
|
-
ce((
|
|
1210
|
-
(
|
|
1241
|
+
Je.value ? (m(), E("div", cs, [
|
|
1242
|
+
ce((m(), E("ul", x({ class: "b-listbox-multi-select__chips" }, se(rt, !0)), [
|
|
1243
|
+
(m(!0), E(le, null, H(Ze.value, (d) => (m(), E("li", {
|
|
1211
1244
|
key: d.value
|
|
1212
1245
|
}, [
|
|
1213
|
-
G(
|
|
1246
|
+
G(M(ht), {
|
|
1214
1247
|
ref_for: !0,
|
|
1215
1248
|
ref_key: "selectedListboxItemsRef",
|
|
1216
1249
|
ref: f,
|
|
1217
1250
|
disabled: c.isOptionDisabled(d),
|
|
1218
1251
|
label: d.label,
|
|
1219
1252
|
condensed: "",
|
|
1220
|
-
onClick: (h) => d.items ?
|
|
1253
|
+
onClick: (h) => d.items ? Ae(d) : ue("select", d)
|
|
1221
1254
|
}, null, 8, ["disabled", "label", "onClick"])
|
|
1222
1255
|
]))), 128))
|
|
1223
1256
|
], 16)), [
|
|
1224
|
-
[
|
|
1257
|
+
[M(Ce)]
|
|
1225
1258
|
]),
|
|
1226
|
-
b[4] || (b[4] =
|
|
1259
|
+
b[4] || (b[4] = U("hr", {
|
|
1227
1260
|
class: "b-listbox-multi-select__divider",
|
|
1228
1261
|
"aria-hidden": "true"
|
|
1229
1262
|
}, null, -1))
|
|
1230
|
-
])) :
|
|
1231
|
-
ce((
|
|
1232
|
-
$e.value ? (
|
|
1263
|
+
])) : X("", !0),
|
|
1264
|
+
ce((m(), E("div", x(r.value, { role: R.value }, se(at, !0)), [
|
|
1265
|
+
$e.value ? (m(), $(M(Ee), {
|
|
1233
1266
|
key: 0,
|
|
1234
1267
|
ref_key: "selectAllListboxItemsRef",
|
|
1235
1268
|
ref: l,
|
|
1236
1269
|
class: "b-listbox-multi-select__option",
|
|
1237
|
-
tabindex:
|
|
1238
|
-
"aria-selected":
|
|
1239
|
-
"aria-checked":
|
|
1270
|
+
tabindex: M(Re) === 0 ? 0 : -1,
|
|
1271
|
+
"aria-selected": Le.value !== "false",
|
|
1272
|
+
"aria-checked": Le.value,
|
|
1240
1273
|
role: I.value,
|
|
1241
1274
|
onClick: Te,
|
|
1242
1275
|
onEnterPressed: Te,
|
|
1243
1276
|
onSpacePressed: re(Te, ["prevent"])
|
|
1244
1277
|
}, {
|
|
1245
|
-
default:
|
|
1246
|
-
G(
|
|
1247
|
-
checked:
|
|
1248
|
-
indeterminate:
|
|
1278
|
+
default: k(() => [
|
|
1279
|
+
G(M(ke), {
|
|
1280
|
+
checked: M(w),
|
|
1281
|
+
indeterminate: M(ie)
|
|
1249
1282
|
}, null, 8, ["checked", "indeterminate"]),
|
|
1250
|
-
G(
|
|
1251
|
-
default:
|
|
1283
|
+
G(M(de), { el: "span" }, {
|
|
1284
|
+
default: k(() => [
|
|
1252
1285
|
K(V(N.value), 1)
|
|
1253
1286
|
]),
|
|
1254
1287
|
_: 1
|
|
1255
1288
|
})
|
|
1256
1289
|
]),
|
|
1257
1290
|
_: 1
|
|
1258
|
-
}, 8, ["tabindex", "aria-selected", "aria-checked", "role"])) :
|
|
1259
|
-
$e.value ? (
|
|
1260
|
-
G(
|
|
1291
|
+
}, 8, ["tabindex", "aria-selected", "aria-checked", "role"])) : X("", !0),
|
|
1292
|
+
$e.value ? (m(), E("hr", us)) : X("", !0),
|
|
1293
|
+
G(M(as), {
|
|
1261
1294
|
ref_key: "listboxItemsRef",
|
|
1262
|
-
ref:
|
|
1295
|
+
ref: O,
|
|
1263
1296
|
items: c.items,
|
|
1264
1297
|
"is-option-disabled": c.isOptionDisabled,
|
|
1265
|
-
"is-multi-level":
|
|
1298
|
+
"is-multi-level": M(D),
|
|
1266
1299
|
"static-categories": c.staticCategories,
|
|
1267
1300
|
searching: c.searching,
|
|
1268
1301
|
"selected-items-list": T.value,
|
|
1269
|
-
"focused-index":
|
|
1270
|
-
"items-index":
|
|
1302
|
+
"focused-index": M(Re),
|
|
1303
|
+
"items-index": ct.value,
|
|
1271
1304
|
role: I.value,
|
|
1272
1305
|
onToggleCheckboxSelection: b[0] || (b[0] = (d) => ue("select", d)),
|
|
1273
|
-
onSelectCategory:
|
|
1274
|
-
onUnselectCategory:
|
|
1275
|
-
onToggleCategoryVisibility:
|
|
1276
|
-
onSpacePressed: b[1] || (b[1] = (d) => ue(
|
|
1277
|
-
onTabPressed: b[2] || (b[2] = (d) => ue(
|
|
1278
|
-
onEnterPressed: b[3] || (b[3] = (d) => ue(
|
|
1306
|
+
onSelectCategory: Xe,
|
|
1307
|
+
onUnselectCategory: Ae,
|
|
1308
|
+
onToggleCategoryVisibility: et,
|
|
1309
|
+
onSpacePressed: b[1] || (b[1] = (d) => ue(M(g).SPACE, d)),
|
|
1310
|
+
onTabPressed: b[2] || (b[2] = (d) => ue(M(g).TAB, d)),
|
|
1311
|
+
onEnterPressed: b[3] || (b[3] = (d) => ue(M(g).ENTER, d))
|
|
1279
1312
|
}, pe({ _: 2 }, [
|
|
1280
|
-
|
|
1313
|
+
H(M(p), (d, h) => ({
|
|
1281
1314
|
name: h,
|
|
1282
|
-
fn:
|
|
1315
|
+
fn: k((C) => [
|
|
1283
1316
|
j(c.$slots, h, ae(ve(C)), void 0, !0)
|
|
1284
1317
|
])
|
|
1285
1318
|
}))
|
|
1286
1319
|
]), 1032, ["items", "is-option-disabled", "is-multi-level", "static-categories", "searching", "selected-items-list", "focused-index", "items-index", "role"])
|
|
1287
|
-
], 16,
|
|
1288
|
-
[
|
|
1320
|
+
], 16, ds)), [
|
|
1321
|
+
[M(Ce)]
|
|
1289
1322
|
])
|
|
1290
1323
|
], 512));
|
|
1291
1324
|
}
|
|
1292
|
-
}),
|
|
1325
|
+
}), xe = /* @__PURE__ */ q(ms, [["__scopeId", "data-v-d170602c"]]), Ye = {
|
|
1293
1326
|
"en-US": {
|
|
1294
1327
|
loading: "Loading",
|
|
1295
1328
|
showMore: "Show more"
|
|
@@ -1302,18 +1335,18 @@ const ss = /* @__PURE__ */ H(Zt, [["render", ts], ["__scopeId", "data-v-74d7ed4a
|
|
|
1302
1335
|
loading: "Carregando",
|
|
1303
1336
|
showMore: "Mostrar mais"
|
|
1304
1337
|
}
|
|
1305
|
-
},
|
|
1338
|
+
}, vs = 36, fs = J({
|
|
1306
1339
|
name: "bento-listbox",
|
|
1307
1340
|
components: {
|
|
1308
|
-
BentoEmptyState:
|
|
1309
|
-
BentoListboxSingleSelect:
|
|
1310
|
-
BentoListboxMultiSelect:
|
|
1341
|
+
BentoEmptyState: pt,
|
|
1342
|
+
BentoListboxSingleSelect: Vt,
|
|
1343
|
+
BentoListboxMultiSelect: xe,
|
|
1311
1344
|
BentoTypography: de,
|
|
1312
|
-
BentoLoadingIndicator:
|
|
1313
|
-
BentoLoadingButton:
|
|
1345
|
+
BentoLoadingIndicator: ft,
|
|
1346
|
+
BentoLoadingButton: Ot
|
|
1314
1347
|
},
|
|
1315
1348
|
directives: { BentoKeyboardNavigationDirective: Ce },
|
|
1316
|
-
i18n: { messages:
|
|
1349
|
+
i18n: { messages: Ye },
|
|
1317
1350
|
props: {
|
|
1318
1351
|
/**
|
|
1319
1352
|
* Defines a string value that labels an interactive element.
|
|
@@ -1394,7 +1427,7 @@ const ss = /* @__PURE__ */ H(Zt, [["render", ts], ["__scopeId", "data-v-74d7ed4a
|
|
|
1394
1427
|
*
|
|
1395
1428
|
* If enabled, hides the "Select all" checkbox in "multiple" mode.
|
|
1396
1429
|
*/
|
|
1397
|
-
searching:
|
|
1430
|
+
searching: xe.props.searching,
|
|
1398
1431
|
/**
|
|
1399
1432
|
* The `input` value.
|
|
1400
1433
|
* Providing an empty string or empty array will select no options.
|
|
@@ -1422,57 +1455,57 @@ const ss = /* @__PURE__ */ H(Zt, [["render", ts], ["__scopeId", "data-v-74d7ed4a
|
|
|
1422
1455
|
g.TAB
|
|
1423
1456
|
],
|
|
1424
1457
|
setup(e, { emit: t, slots: i }) {
|
|
1425
|
-
const s =
|
|
1426
|
-
var
|
|
1427
|
-
return typeof (e == null ? void 0 : e.virtualScroll) == "object" && ((
|
|
1458
|
+
const s = L([]), n = fe(e, "items"), { t: o } = Ie({ messages: Ye }), a = v(() => e.lazyLoadType !== ne.AUTOMATIC), p = v(() => e.lazyLoadType === ne.AUTOMATIC), y = () => {
|
|
1459
|
+
var w;
|
|
1460
|
+
return typeof (e == null ? void 0 : e.virtualScroll) == "object" && ((w = e == null ? void 0 : e.virtualScroll) != null && w.itemHeight) ? e.virtualScroll.itemHeight : vs;
|
|
1428
1461
|
}, {
|
|
1429
|
-
containerRef:
|
|
1462
|
+
containerRef: r,
|
|
1430
1463
|
containerProps: u,
|
|
1431
1464
|
onScroll: l,
|
|
1432
1465
|
list: f,
|
|
1433
|
-
wrapperProps:
|
|
1434
|
-
} =
|
|
1466
|
+
wrapperProps: O
|
|
1467
|
+
} = _t(n, {
|
|
1435
1468
|
itemHeight: y(),
|
|
1436
1469
|
// Disable virtual scrolling if not enabled or if lazy loading is enabled or if multi-select
|
|
1437
1470
|
disabled: (e == null ? void 0 : e.multiple) || (e == null ? void 0 : e.virtualScroll) === !1 || (e == null ? void 0 : e.lazyLoadType) !== "none"
|
|
1438
|
-
}), T =
|
|
1439
|
-
() => e.componentLoading !== void 0 ||
|
|
1440
|
-
),
|
|
1441
|
-
() =>
|
|
1442
|
-
), P =
|
|
1443
|
-
() =>
|
|
1444
|
-
),
|
|
1471
|
+
}), T = v(
|
|
1472
|
+
() => e.componentLoading !== void 0 || a.value ? "true" : void 0
|
|
1473
|
+
), D = v(
|
|
1474
|
+
() => a.value && e.loading || e.componentLoading ? "true" : "false"
|
|
1475
|
+
), P = v(
|
|
1476
|
+
() => a.value || e.componentLoading !== void 0 ? "polite" : void 0
|
|
1477
|
+
), B = v(
|
|
1445
1478
|
() => ({
|
|
1446
1479
|
"aria-label": e.ariaLabel,
|
|
1447
|
-
"aria-busy":
|
|
1480
|
+
"aria-busy": D.value,
|
|
1448
1481
|
"aria-atomic": T.value,
|
|
1449
1482
|
"aria-live": P.value
|
|
1450
1483
|
})
|
|
1451
|
-
),
|
|
1484
|
+
), R = v(
|
|
1452
1485
|
() => e.componentLoading ? {
|
|
1453
|
-
...
|
|
1486
|
+
...B.value,
|
|
1454
1487
|
role: "alert"
|
|
1455
1488
|
} : {}
|
|
1456
|
-
), I = (
|
|
1457
|
-
t(
|
|
1489
|
+
), I = (w) => (ie) => {
|
|
1490
|
+
t(w, ie);
|
|
1458
1491
|
}, S = () => {
|
|
1459
1492
|
t(g.SHOW_MORE);
|
|
1460
|
-
}, _ =
|
|
1461
|
-
const
|
|
1462
|
-
if (!
|
|
1493
|
+
}, _ = gt(() => {
|
|
1494
|
+
const w = r.value;
|
|
1495
|
+
if (!w)
|
|
1463
1496
|
return;
|
|
1464
|
-
const ie = Math.round(
|
|
1497
|
+
const ie = Math.round(w.scrollTop) + w.clientHeight >= w.scrollHeight;
|
|
1465
1498
|
e.hasMoreItems && ie && !e.loading && S();
|
|
1466
|
-
}),
|
|
1499
|
+
}), Y = () => {
|
|
1467
1500
|
p.value ? _() : l();
|
|
1468
|
-
}, Q =
|
|
1469
|
-
var
|
|
1470
|
-
return ((
|
|
1471
|
-
}), N =
|
|
1501
|
+
}, Q = v(() => {
|
|
1502
|
+
var w;
|
|
1503
|
+
return ((w = e.items) == null ? void 0 : w.length) === 0;
|
|
1504
|
+
}), N = v(
|
|
1472
1505
|
() => e.lazyLoadType === ne.BUTTON && e.hasMoreItems
|
|
1473
|
-
),
|
|
1474
|
-
() => e.loading ?
|
|
1475
|
-
), W =
|
|
1506
|
+
), z = v(
|
|
1507
|
+
() => e.loading ? Me.LOADING : Me.START
|
|
1508
|
+
), W = v(() => e.loading ? o("loading") : o("showMore")), oe = v(() => ({
|
|
1476
1509
|
...e.emptyState,
|
|
1477
1510
|
variant: "condensed"
|
|
1478
1511
|
})), Oe = {
|
|
@@ -1483,72 +1516,72 @@ const ss = /* @__PURE__ */ H(Zt, [["render", ts], ["__scopeId", "data-v-74d7ed4a
|
|
|
1483
1516
|
};
|
|
1484
1517
|
return {
|
|
1485
1518
|
// Refs
|
|
1486
|
-
listboxRef:
|
|
1519
|
+
listboxRef: r,
|
|
1487
1520
|
listboxItemRef: s,
|
|
1488
1521
|
// a11y
|
|
1489
|
-
ariaAttributes:
|
|
1490
|
-
listboxContainerAttributes:
|
|
1522
|
+
ariaAttributes: B,
|
|
1523
|
+
listboxContainerAttributes: R,
|
|
1491
1524
|
// Values
|
|
1492
1525
|
containerProps: u,
|
|
1493
1526
|
isSearchResultEmpty: Q,
|
|
1494
1527
|
limitedEmptyStateProps: oe,
|
|
1495
|
-
loadingButtonState:
|
|
1528
|
+
loadingButtonState: z,
|
|
1496
1529
|
slots: i,
|
|
1497
1530
|
shouldDisplayShowMoreButton: N,
|
|
1498
1531
|
showMoreButtonText: W,
|
|
1499
1532
|
virtualisedItems: f,
|
|
1500
|
-
wrapperProps:
|
|
1533
|
+
wrapperProps: O,
|
|
1501
1534
|
// Enums
|
|
1502
1535
|
BentoKeyboardNavigationKeyDownEvent: F,
|
|
1503
1536
|
BentoListboxEvent: g,
|
|
1504
1537
|
// Methods
|
|
1505
|
-
onListboxContainerScroll:
|
|
1538
|
+
onListboxContainerScroll: Y,
|
|
1506
1539
|
onOptionSelected: I,
|
|
1507
1540
|
emitShowMore: S,
|
|
1508
1541
|
listboxListeners: Oe
|
|
1509
1542
|
};
|
|
1510
1543
|
}
|
|
1511
|
-
}),
|
|
1544
|
+
}), ps = ["id"], gs = {
|
|
1512
1545
|
key: 0,
|
|
1513
1546
|
class: "b-listbox__loading-filtered-items"
|
|
1514
|
-
},
|
|
1547
|
+
}, ys = {
|
|
1515
1548
|
key: 1,
|
|
1516
1549
|
class: "b-listbox__empty-search-message"
|
|
1517
|
-
},
|
|
1550
|
+
}, Ss = {
|
|
1518
1551
|
key: 2,
|
|
1519
1552
|
class: "b-listbox__lazy-load"
|
|
1520
|
-
},
|
|
1553
|
+
}, hs = {
|
|
1521
1554
|
key: 3,
|
|
1522
1555
|
class: "b-listbox__lazy-load"
|
|
1523
1556
|
};
|
|
1524
|
-
function
|
|
1525
|
-
var
|
|
1526
|
-
const
|
|
1527
|
-
return ce((
|
|
1557
|
+
function Cs(e, t, i, s, n, o) {
|
|
1558
|
+
var O;
|
|
1559
|
+
const a = A("bento-loading-indicator"), p = A("bento-empty-state"), y = A("bento-typography"), r = A("bento-listbox-multi-select"), u = A("bento-listbox-single-select"), l = A("bento-loading-button"), f = Ve("bento-keyboard-navigation-directive");
|
|
1560
|
+
return ce((m(), E("div", x({
|
|
1528
1561
|
id: e.id,
|
|
1529
1562
|
ref: "listboxRef",
|
|
1530
1563
|
class: "b-listbox",
|
|
1531
1564
|
tabindex: "-1"
|
|
1532
1565
|
}, e.listboxContainerAttributes, {
|
|
1533
|
-
style: (
|
|
1566
|
+
style: (O = e.containerProps) == null ? void 0 : O.style,
|
|
1534
1567
|
"data-testid": "listbox-container",
|
|
1535
1568
|
onScroll: t[0] || (t[0] = (...T) => e.onListboxContainerScroll && e.onListboxContainerScroll(...T))
|
|
1536
1569
|
}), [
|
|
1537
|
-
|
|
1538
|
-
e.componentLoading ? (
|
|
1539
|
-
G(
|
|
1540
|
-
])) : e.isSearchResultEmpty ? (
|
|
1541
|
-
e.emptyState ? (
|
|
1570
|
+
U("div", ae(ve(e.wrapperProps)), [
|
|
1571
|
+
e.componentLoading ? (m(), E("div", gs, [
|
|
1572
|
+
G(a)
|
|
1573
|
+
])) : e.isSearchResultEmpty ? (m(), E("div", ys, [
|
|
1574
|
+
e.emptyState ? (m(), $(p, ae(x({ key: 0 }, e.limitedEmptyStateProps)), null, 16)) : (m(), $(y, {
|
|
1542
1575
|
key: 1,
|
|
1543
1576
|
el: "span"
|
|
1544
1577
|
}, {
|
|
1545
|
-
default:
|
|
1578
|
+
default: k(() => [
|
|
1546
1579
|
K(V(e.noResultsMessage), 1)
|
|
1547
1580
|
]),
|
|
1548
1581
|
_: 1
|
|
1549
1582
|
}))
|
|
1550
|
-
])) : (
|
|
1551
|
-
e.multiple ? (
|
|
1583
|
+
])) : (m(), E(le, { key: 2 }, [
|
|
1584
|
+
e.multiple ? (m(), $(r, x({
|
|
1552
1585
|
key: 0,
|
|
1553
1586
|
ref: "listboxItemRef",
|
|
1554
1587
|
"has-more-items": e.hasMoreItems
|
|
@@ -1560,13 +1593,13 @@ function ps(e, t, i, s, r, o) {
|
|
|
1560
1593
|
searching: e.searching,
|
|
1561
1594
|
"is-option-disabled": e.isOptionDisabled
|
|
1562
1595
|
}, se(e.listboxListeners)), pe({ _: 2 }, [
|
|
1563
|
-
|
|
1564
|
-
name:
|
|
1565
|
-
fn:
|
|
1566
|
-
j(e.$slots,
|
|
1596
|
+
H(e.slots, (T, D) => ({
|
|
1597
|
+
name: D,
|
|
1598
|
+
fn: k((P) => [
|
|
1599
|
+
j(e.$slots, D, ae(ve(P)), void 0, !0)
|
|
1567
1600
|
])
|
|
1568
1601
|
}))
|
|
1569
|
-
]), 1040, ["has-more-items", "items", "lazy-load-type", "static-categories", "selected-values", "searching", "is-option-disabled"])) : (
|
|
1602
|
+
]), 1040, ["has-more-items", "items", "lazy-load-type", "static-categories", "selected-values", "searching", "is-option-disabled"])) : (m(), $(u, x({
|
|
1570
1603
|
key: 1,
|
|
1571
1604
|
ref: "listboxItemRef",
|
|
1572
1605
|
items: e.virtualisedItems
|
|
@@ -1575,34 +1608,34 @@ function ps(e, t, i, s, r, o) {
|
|
|
1575
1608
|
"static-categories": e.staticCategories,
|
|
1576
1609
|
"is-option-disabled": e.isOptionDisabled
|
|
1577
1610
|
}, se(e.listboxListeners)), pe({ _: 2 }, [
|
|
1578
|
-
|
|
1579
|
-
name:
|
|
1580
|
-
fn:
|
|
1581
|
-
j(e.$slots,
|
|
1611
|
+
H(e.slots, (T, D) => ({
|
|
1612
|
+
name: D,
|
|
1613
|
+
fn: k((P) => [
|
|
1614
|
+
j(e.$slots, D, ae(ve(P)), void 0, !0)
|
|
1582
1615
|
])
|
|
1583
1616
|
}))
|
|
1584
1617
|
]), 1040, ["items", "selected-value", "static-categories", "is-option-disabled"])),
|
|
1585
|
-
e.shouldDisplayShowMoreButton ? (
|
|
1618
|
+
e.shouldDisplayShowMoreButton ? (m(), E("div", Ss, [
|
|
1586
1619
|
G(l, {
|
|
1587
1620
|
state: e.loadingButtonState,
|
|
1588
1621
|
variant: "secondary",
|
|
1589
1622
|
onClickCapture: e.emitShowMore
|
|
1590
1623
|
}, {
|
|
1591
|
-
default:
|
|
1624
|
+
default: k(() => [
|
|
1592
1625
|
K(V(e.showMoreButtonText), 1)
|
|
1593
1626
|
]),
|
|
1594
1627
|
_: 1
|
|
1595
1628
|
}, 8, ["state", "onClickCapture"])
|
|
1596
|
-
])) : e.loading ? (
|
|
1597
|
-
G(
|
|
1598
|
-
])) :
|
|
1629
|
+
])) : e.loading ? (m(), E("div", hs, [
|
|
1630
|
+
G(a)
|
|
1631
|
+
])) : X("", !0)
|
|
1599
1632
|
], 64))
|
|
1600
1633
|
], 16)
|
|
1601
|
-
], 16,
|
|
1634
|
+
], 16, ps)), [
|
|
1602
1635
|
[f]
|
|
1603
1636
|
]);
|
|
1604
1637
|
}
|
|
1605
|
-
const
|
|
1638
|
+
const Ys = /* @__PURE__ */ q(fs, [["render", Cs], ["__scopeId", "data-v-ef1c27fa"]]), _e = (e, t) => {
|
|
1606
1639
|
for (const i of e) {
|
|
1607
1640
|
if (i.value === t)
|
|
1608
1641
|
return i;
|
|
@@ -1613,56 +1646,57 @@ const Ps = /* @__PURE__ */ H(ds, [["render", ps], ["__scopeId", "data-v-ef1c27fa
|
|
|
1613
1646
|
}
|
|
1614
1647
|
}
|
|
1615
1648
|
return null;
|
|
1616
|
-
},
|
|
1617
|
-
const
|
|
1649
|
+
}, Es = (e) => typeof e == "object" && e !== null && "value" in e && "label" in e, Us = (e, t, i, s) => {
|
|
1650
|
+
const n = L([]), o = L(), a = (u) => {
|
|
1618
1651
|
i.value ? o.value = u.map(({ value: l }) => l) : o.value = u.length > 0 ? u[0].value : null;
|
|
1619
1652
|
}, p = (u) => {
|
|
1620
1653
|
i.value ? o.value = u.map(({ value: l, label: f }) => ({ value: l, label: f })) : o.value = u.length > 0 ? { value: u[0].value, label: u[0].label } : null;
|
|
1621
1654
|
}, y = (u) => {
|
|
1622
|
-
|
|
1623
|
-
},
|
|
1624
|
-
|
|
1655
|
+
n.value = u, s != null && s.value ? p(u) : a(u);
|
|
1656
|
+
}, r = () => {
|
|
1657
|
+
n.value = [], o.value = null;
|
|
1625
1658
|
};
|
|
1626
1659
|
return ye(
|
|
1627
1660
|
() => t.value,
|
|
1628
1661
|
() => {
|
|
1629
1662
|
if (!t.value && t.value !== 0) {
|
|
1630
|
-
|
|
1663
|
+
r();
|
|
1631
1664
|
return;
|
|
1632
1665
|
}
|
|
1633
|
-
const u = !Array.isArray(t.value), l = [...
|
|
1634
|
-
|
|
1635
|
-
const f = (
|
|
1636
|
-
if (
|
|
1637
|
-
|
|
1666
|
+
const u = !Array.isArray(t.value), l = [...n.value];
|
|
1667
|
+
r();
|
|
1668
|
+
const f = (O) => {
|
|
1669
|
+
if (Es(O))
|
|
1670
|
+
n.value.push(O);
|
|
1638
1671
|
else {
|
|
1639
|
-
let T = _e(e.value,
|
|
1640
|
-
T || (T = _e(l,
|
|
1672
|
+
let T = _e(e.value, O);
|
|
1673
|
+
T || (T = _e(l, O)), T || (T = { value: O, label: O.toString() }), n.value.push(T);
|
|
1641
1674
|
}
|
|
1642
1675
|
};
|
|
1643
1676
|
if (u) {
|
|
1644
|
-
const
|
|
1645
|
-
f(
|
|
1677
|
+
const O = t.value;
|
|
1678
|
+
f(O), s != null && s.value ? p(n.value) : a(n.value);
|
|
1646
1679
|
return;
|
|
1647
1680
|
}
|
|
1648
|
-
t.value.forEach(f), s != null && s.value ? p(
|
|
1681
|
+
t.value.forEach(f), s != null && s.value ? p(n.value) : a(n.value);
|
|
1649
1682
|
},
|
|
1650
1683
|
{ immediate: !0 }
|
|
1651
1684
|
), {
|
|
1652
1685
|
// Values
|
|
1653
|
-
cachedSelectedListboxOptions:
|
|
1686
|
+
cachedSelectedListboxOptions: n,
|
|
1654
1687
|
cachedListboxSelectedValues: o,
|
|
1655
1688
|
// Methods
|
|
1656
|
-
resetCache:
|
|
1689
|
+
resetCache: r,
|
|
1657
1690
|
setCachedValues: y
|
|
1658
1691
|
};
|
|
1659
1692
|
};
|
|
1660
1693
|
export {
|
|
1661
1694
|
ne as B,
|
|
1695
|
+
ke as D,
|
|
1662
1696
|
g as a,
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1697
|
+
Ys as b,
|
|
1698
|
+
Us as c,
|
|
1699
|
+
We as d,
|
|
1700
|
+
rs as u
|
|
1667
1701
|
};
|
|
1668
|
-
//# sourceMappingURL=use-cached-selected-values.
|
|
1702
|
+
//# sourceMappingURL=use-cached-selected-values.8MdrR9wt.js.map
|