@adyen/bento-vue3 1.26.0 → 1.27.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/components.d.ts +4 -0
- package/dist/@types/packages/core/src/utils/ts/storybook.d.ts +12 -0
- package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.types.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/code-snippet/code-snippet.types.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/code-snippet/code-snippet.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/code-snippet/utils/get-lang-loader.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-calculate-column-width/use-calculate-column-width.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-column-hovering/use-column-hovering.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-column-reorderer/use-column-reorderer.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-config-settings/use-config-settings.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-resizer.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.types.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +15 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +1 -18
- package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +12 -0
- package/dist/@types/packages/vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue.d.ts +36 -54
- package/dist/@types/packages/vue2/src/components/structured-list/structured-list.vue.d.ts +27 -22
- package/dist/@types/packages/vue2/src/components/tabs/tabs.vue.d.ts +76 -1
- package/dist/@types/packages/vue2/src/components/tutorial/tutorial.vue.d.ts +21 -2
- package/dist/@types/packages/vue2/src/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/templates/dashboard-template/components/dashboard-section/dashboard-section.vue.d.ts +78 -0
- package/dist/@types/packages/vue2/src/templates/dashboard-template/dashboard-template.types.d.ts +8 -0
- package/dist/@types/packages/vue2/src/templates/dashboard-template/dashboard-template.vue.d.ts +103 -0
- package/dist/@types/packages/vue2/src/templates/dashboard-template/index.d.ts +3 -0
- package/dist/@types/packages/vue2/src/utils/ts/storybook.d.ts +1 -12
- package/dist/accordion.js +3 -3
- package/dist/action-bar.js +71 -155
- package/dist/action-bar.js.map +1 -1
- package/dist/alert.js +6 -6
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/button.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/assets/index10.css +1 -1
- package/dist/assets/index11.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/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/index46.css +1 -1
- package/dist/assets/index47.css +1 -1
- package/dist/assets/index48.css +1 -1
- package/dist/assets/index49.css +1 -0
- 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/use-cached-selected-values.css +1 -1
- package/dist/avatar-image.js +1 -1
- package/dist/badge.js +1 -1
- package/dist/button.js +4 -4
- package/dist/card.js +4 -4
- package/dist/checkbox.js +6 -6
- package/dist/chunks/{base-button.e84acf30.js → base-button.a0140a4c.js} +2 -2
- package/dist/chunks/{base-button.e84acf30.js.map → base-button.a0140a4c.js.map} +1 -1
- package/dist/chunks/{base-modal.29e062d0.js → base-modal.4102f69d.js} +7 -7
- package/dist/chunks/{base-modal.29e062d0.js.map → base-modal.4102f69d.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.7fce47a2.js → button-actions-with-menu.4f311411.js} +4 -4
- package/dist/chunks/{button-actions-with-menu.7fce47a2.js.map → button-actions-with-menu.4f311411.js.map} +1 -1
- package/dist/chunks/{button-actions.642b37de.js → button-actions.82163994.js} +42 -40
- package/dist/chunks/button-actions.82163994.js.map +1 -0
- package/dist/chunks/{button.60dad578.js → button.ae4760cd.js} +27 -26
- package/dist/chunks/button.ae4760cd.js.map +1 -0
- package/dist/chunks/{calendar.f38cdab9.js → calendar.a9c5a68c.js} +6 -6
- package/dist/chunks/{calendar.f38cdab9.js.map → calendar.a9c5a68c.js.map} +1 -1
- package/dist/chunks/{checkbox-input.ab758a81.js → checkbox-input.99336948.js} +2 -2
- package/dist/chunks/{checkbox-input.ab758a81.js.map → checkbox-input.99336948.js.map} +1 -1
- package/dist/chunks/{checkbox.f55ee3a5.js → checkbox.9c30c07b.js} +4 -4
- package/dist/chunks/{checkbox.f55ee3a5.js.map → checkbox.9c30c07b.js.map} +1 -1
- package/dist/chunks/{checkmark-circle-fill.f3a69c6a.js → checkmark-circle-fill.c45a999d.js} +2 -2
- package/dist/chunks/{checkmark-circle-fill.f3a69c6a.js.map → checkmark-circle-fill.c45a999d.js.map} +1 -1
- package/dist/chunks/{checkmark-small.d7e31e5e.js → checkmark-small.c79220d9.js} +2 -2
- package/dist/chunks/{checkmark-small.d7e31e5e.js.map → checkmark-small.c79220d9.js.map} +1 -1
- package/dist/chunks/{chevron-left.963d35e9.js → chevron-left.4ee92950.js} +2 -2
- package/dist/chunks/{chevron-left.963d35e9.js.map → chevron-left.4ee92950.js.map} +1 -1
- package/dist/chunks/{chevron-up.05ca20db.js → chevron-up.638a9f34.js} +2 -2
- package/dist/chunks/{chevron-up.05ca20db.js.map → chevron-up.638a9f34.js.map} +1 -1
- package/dist/chunks/{controls-group.9e0f17b2.js → controls-group.8357e3fd.js} +3 -3
- package/dist/chunks/{controls-group.9e0f17b2.js.map → controls-group.8357e3fd.js.map} +1 -1
- package/dist/chunks/{copy.852d4cb8.js → copy.60ee6ac3.js} +4 -4
- package/dist/chunks/{copy.852d4cb8.js.map → copy.60ee6ac3.js.map} +1 -1
- package/dist/chunks/{cross-circle-fill.81925c7f.js → cross-circle-fill.1abec1a2.js} +2 -2
- package/dist/chunks/{cross-circle-fill.81925c7f.js.map → cross-circle-fill.1abec1a2.js.map} +1 -1
- package/dist/chunks/{cross-small.9bc6a02f.js → cross-small.b85406fe.js} +2 -2
- package/dist/chunks/{cross-small.9bc6a02f.js.map → cross-small.b85406fe.js.map} +1 -1
- package/dist/chunks/{cross.a60533f6.js → cross.26509efc.js} +2 -2
- package/dist/chunks/{cross.a60533f6.js.map → cross.26509efc.js.map} +1 -1
- package/dist/chunks/{dialog-page.ea67bb14.js → dialog-page.cb6ce9b6.js} +3 -3
- package/dist/chunks/{dialog-page.ea67bb14.js.map → dialog-page.cb6ce9b6.js.map} +1 -1
- package/dist/chunks/{dropdown-default-textbox.ad5063c2.js → dropdown-default-textbox.cda0798f.js} +5 -5
- package/dist/chunks/{dropdown-default-textbox.ad5063c2.js.map → dropdown-default-textbox.cda0798f.js.map} +1 -1
- package/dist/chunks/{dropdown.d8587f36.js → dropdown.0ae3b842.js} +122 -132
- package/dist/chunks/dropdown.0ae3b842.js.map +1 -0
- package/dist/chunks/{error-message.3fb5573a.js → error-message.d2bdeb80.js} +3 -3
- package/dist/chunks/{error-message.3fb5573a.js.map → error-message.d2bdeb80.js.map} +1 -1
- package/dist/chunks/{events.58c00e6d.js → events.f14a214b.js} +5 -5
- package/dist/chunks/events.f14a214b.js.map +1 -0
- package/dist/chunks/{fixed-scroller.59aefd1b.js → fixed-scroller.7b42cb1e.js} +3 -3
- package/dist/chunks/{fixed-scroller.59aefd1b.js.map → fixed-scroller.7b42cb1e.js.map} +1 -1
- package/dist/chunks/{footer-actions.89e68269.js → footer-actions.64f6f5d8.js} +4 -4
- package/dist/chunks/{footer-actions.89e68269.js.map → footer-actions.64f6f5d8.js.map} +1 -1
- package/dist/chunks/{index.96cd0d4c.js → index.2d7b4511.js} +15 -15
- package/dist/chunks/{index.96cd0d4c.js.map → index.2d7b4511.js.map} +1 -1
- package/dist/chunks/index.2fcd1233.js +103 -0
- package/dist/chunks/index.2fcd1233.js.map +1 -0
- package/dist/chunks/{index.9bf04b01.js → index.6295e754.js} +3 -3
- package/dist/chunks/{index.9bf04b01.js.map → index.6295e754.js.map} +1 -1
- package/dist/chunks/{index.030c1dd7.js → index.6bb6f38c.js} +7 -7
- package/dist/chunks/{index.030c1dd7.js.map → index.6bb6f38c.js.map} +1 -1
- package/dist/chunks/{index.ba3396d3.js → index.8aa536a8.js} +3 -3
- package/dist/chunks/{index.ba3396d3.js.map → index.8aa536a8.js.map} +1 -1
- package/dist/chunks/{index.8be283d5.js → index.9d7fb316.js} +2 -2
- package/dist/chunks/{index.8be283d5.js.map → index.9d7fb316.js.map} +1 -1
- package/dist/chunks/{index.5bdebf9d.js → index.a001a0a8.js} +7 -7
- package/dist/chunks/{index.5bdebf9d.js.map → index.a001a0a8.js.map} +1 -1
- package/dist/chunks/{index.07122048.js → index.b18c78d6.js} +2 -2
- package/dist/chunks/{index.07122048.js.map → index.b18c78d6.js.map} +1 -1
- package/dist/chunks/{index.6e0e9d21.js → index.eb38a6c4.js} +3 -3
- package/dist/chunks/{index.6e0e9d21.js.map → index.eb38a6c4.js.map} +1 -1
- package/dist/chunks/{index.a3d60e4f.js → index.ee15db35.js} +2 -2
- package/dist/chunks/{index.a3d60e4f.js.map → index.ee15db35.js.map} +1 -1
- package/dist/chunks/{index.146f967e.js → index.f9d081d2.js} +2 -2
- package/dist/chunks/{index.146f967e.js.map → index.f9d081d2.js.map} +1 -1
- package/dist/chunks/index.fedbb4c2.js +125 -0
- package/dist/chunks/index.fedbb4c2.js.map +1 -0
- package/dist/chunks/{info.205b4496.js → info.550f9511.js} +2 -2
- package/dist/chunks/{info.205b4496.js.map → info.550f9511.js.map} +1 -1
- package/dist/chunks/{keyboard-navigation.ca47dfa8.js → keyboard-navigation.bbc3d15c.js} +2 -2
- package/dist/chunks/{keyboard-navigation.ca47dfa8.js.map → keyboard-navigation.bbc3d15c.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.b6182b2e.js → listbox-option-tag.2aea037c.js} +3 -3
- package/dist/chunks/{listbox-option-tag.b6182b2e.js.map → listbox-option-tag.2aea037c.js.map} +1 -1
- package/dist/chunks/{loading-button.0391ad8b.js → loading-button.6b81b546.js} +4 -4
- package/dist/chunks/{loading-button.0391ad8b.js.map → loading-button.6b81b546.js.map} +1 -1
- package/dist/chunks/{payment-method.31a68b9b.js → payment-method.d5595a7c.js} +2 -2
- package/dist/chunks/{payment-method.31a68b9b.js.map → payment-method.d5595a7c.js.map} +1 -1
- package/dist/chunks/{refresh.53691839.js → refresh.bd60f6a8.js} +2 -2
- package/dist/chunks/{refresh.53691839.js.map → refresh.bd60f6a8.js.map} +1 -1
- package/dist/chunks/{search.4e4ee4dd.js → search.ade93bda.js} +2 -2
- package/dist/chunks/{search.4e4ee4dd.js.map → search.ade93bda.js.map} +1 -1
- package/dist/chunks/{tooltip.1084d92b.js → tooltip.36172265.js} +4 -4
- package/dist/chunks/{tooltip.1084d92b.js.map → tooltip.36172265.js.map} +1 -1
- package/dist/chunks/{use-bento-toast-controller.98d8613c.js → use-bento-toast-controller.3dc4e113.js} +2 -2
- package/dist/chunks/{use-bento-toast-controller.98d8613c.js.map → use-bento-toast-controller.3dc4e113.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.852aeafe.js → use-cached-selected-values.3c312296.js} +396 -375
- package/dist/chunks/use-cached-selected-values.3c312296.js.map +1 -0
- package/dist/code-snippet.js +137 -135
- package/dist/code-snippet.js.map +1 -1
- package/dist/country.js +2 -2
- package/dist/currency.js +1 -1
- package/dist/dashboard-template.js +169 -0
- package/dist/dashboard-template.js.map +1 -0
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +52 -44
- package/dist/data-grid.js.map +1 -1
- package/dist/date-picker.js +19 -19
- package/dist/date-picker.js.map +1 -1
- 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 +85 -83
- package/dist/filter-bar.js.map +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +2 -2
- package/dist/header.js +5 -5
- package/dist/index.js +66 -63
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +4 -4
- package/dist/input-field.js +4 -4
- package/dist/internal.js +8 -8
- package/dist/link.js +1 -1
- package/dist/loading-indicator.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +7 -7
- 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 +4 -4
- package/dist/search-bar.js +4 -4
- package/dist/secondary-nav.js +2 -2
- package/dist/segmented-control.js +66 -72
- package/dist/segmented-control.js.map +1 -1
- package/dist/selection-card.js +5 -5
- package/dist/sidepanel.js +7 -7
- package/dist/status.js +2 -2
- package/dist/stepper.js +5 -5
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +3 -3
- package/dist/tabs.js +80 -78
- 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 +3 -3
- package/dist/tutorial.js +125 -110
- package/dist/tutorial.js.map +1 -1
- package/dist/typography.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +8 -6
- package/dist/chunks/button-actions.642b37de.js.map +0 -1
- package/dist/chunks/button.60dad578.js.map +0 -1
- package/dist/chunks/checkmark.87919b24.js +0 -29
- package/dist/chunks/checkmark.87919b24.js.map +0 -1
- package/dist/chunks/dropdown.d8587f36.js.map +0 -1
- package/dist/chunks/events.58c00e6d.js.map +0 -1
- package/dist/chunks/index.c8ffede1.js +0 -168
- package/dist/chunks/index.c8ffede1.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.852aeafe.js.map +0 -1
- /package/dist/assets/{checkmark-circle-fill.css → cross.css} +0 -0
|
@@ -1,41 +1,40 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { B as Y, a as Se } from "./keyboard-navigation.
|
|
3
|
-
import { B as ee } from "./index.
|
|
4
|
-
import { BentoLoadingIndicator as
|
|
5
|
-
import { BentoEmptyState as
|
|
1
|
+
import { computed as v, ref as N, onMounted as Ie, onUnmounted as Ye, watch as Ae, defineComponent as j, resolveComponent as E, openBlock as m, createElementBlock as T, createVNode as k, withCtx as L, createTextVNode as V, toDisplayString as P, createElementVNode as q, renderSlot as G, mergeProps as x, withKeys as ge, createCommentVNode as K, createBlock as B, toHandlerKey as se, normalizeProps as F, guardReactiveProps as H, withDirectives as ae, vShow as $e, toRef as ue, resolveDirective as _e, toHandlers as le, Fragment as Q, renderList as z, createSlots as ie, normalizeClass as fe, unref as re, pushScopeId as Ke, popScopeId as qe } from "vue";
|
|
2
|
+
import { B as Y, a as Se } from "./keyboard-navigation.bbc3d15c.js";
|
|
3
|
+
import { B as ee } from "./index.ee15db35.js";
|
|
4
|
+
import { BentoLoadingIndicator as We } from "../loading-indicator.js";
|
|
5
|
+
import { BentoEmptyState as He } from "../empty-state.js";
|
|
6
6
|
import { u as de } from "./i18n.f7e6533e.js";
|
|
7
|
-
import { d as
|
|
8
|
-
import { _ as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { B as et, a as Ee } from "./loading-button.0391ad8b.js";
|
|
7
|
+
import { d as je } from "./debounce.b5ef6acf.js";
|
|
8
|
+
import { _ as W } from "./_plugin-vue_export-helper.dad06003.js";
|
|
9
|
+
import { B as Ce } from "./checkbox.9c30c07b.js";
|
|
10
|
+
import { a as Xe, C as Ze } from "./chevron-up.638a9f34.js";
|
|
11
|
+
import { B as Je } from "./base-button.a0140a4c.js";
|
|
12
|
+
import { C as Qe } from "./cross-small.b85406fe.js";
|
|
13
|
+
import { B as et, a as he } from "./loading-button.6b81b546.js";
|
|
15
14
|
import { o as tt } from "./resize.a041304d.js";
|
|
16
15
|
import "../assets/use-cached-selected-values.css";
|
|
17
|
-
const
|
|
18
|
-
const s =
|
|
16
|
+
const ke = (e, t, n, u) => {
|
|
17
|
+
const s = v(
|
|
19
18
|
() => {
|
|
20
|
-
var r,
|
|
21
|
-
return !!((r = e.value) != null && r.length) && ((
|
|
19
|
+
var r, c;
|
|
20
|
+
return !!((r = e.value) != null && r.length) && ((c = e.value) == null ? void 0 : c.length) === t.value.length;
|
|
22
21
|
}
|
|
23
|
-
),
|
|
22
|
+
), a = v(() => {
|
|
24
23
|
var r;
|
|
25
24
|
return e.value == null || e.value.length === 0 ? !1 : ((r = e.value) == null ? void 0 : r.length) !== t.value.length;
|
|
26
25
|
});
|
|
27
26
|
return {
|
|
28
27
|
isAllSelected: s,
|
|
29
|
-
isIndeterminate:
|
|
28
|
+
isIndeterminate: a,
|
|
30
29
|
toggleSelectAll: (r) => {
|
|
31
30
|
r ? n() : u();
|
|
32
31
|
}
|
|
33
32
|
};
|
|
34
33
|
};
|
|
35
34
|
function st(e, { disabled: t, itemHeight: n, overscan: u = 5, prefixHeight: s }) {
|
|
36
|
-
const
|
|
37
|
-
let
|
|
38
|
-
const i =
|
|
35
|
+
const a = N(null), l = N([]), r = N(0), c = N(0), o = N(0);
|
|
36
|
+
let p;
|
|
37
|
+
const i = v(() => {
|
|
39
38
|
const I = typeof n == "number" ? e.value.length * n : e.value.reduce((R, S, A) => R + n(A), 0), D = typeof n == "number" ? r.value * n : e.value.slice(0, r.value).reduce((R, S, A) => R + n(A), 0);
|
|
40
39
|
return {
|
|
41
40
|
style: {
|
|
@@ -44,20 +43,20 @@ function st(e, { disabled: t, itemHeight: n, overscan: u = 5, prefixHeight: s })
|
|
|
44
43
|
}
|
|
45
44
|
};
|
|
46
45
|
}), b = () => {
|
|
47
|
-
const I = (s == null ? void 0 : s.value) ?? 0, D = Math.max(
|
|
46
|
+
const I = (s == null ? void 0 : s.value) ?? 0, D = Math.max(a.value.scrollTop - I, 0);
|
|
48
47
|
if (typeof n == "number")
|
|
49
48
|
return Math.floor(D / n);
|
|
50
49
|
let R = 0, S = 0;
|
|
51
50
|
for (let A = 0; A < e.value.length; A += 1) {
|
|
52
|
-
const
|
|
53
|
-
if (R +=
|
|
51
|
+
const U = n(A);
|
|
52
|
+
if (R += U, R >= D) {
|
|
54
53
|
S = A;
|
|
55
54
|
break;
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
57
|
return S;
|
|
59
58
|
}, f = () => {
|
|
60
|
-
if (o.value =
|
|
59
|
+
if (o.value = a.value.clientHeight, typeof n == "number")
|
|
61
60
|
return Math.ceil(o.value / n);
|
|
62
61
|
const I = r.value ?? 0;
|
|
63
62
|
let D = 0, R = 0;
|
|
@@ -67,47 +66,47 @@ function st(e, { disabled: t, itemHeight: n, overscan: u = 5, prefixHeight: s })
|
|
|
67
66
|
break;
|
|
68
67
|
}
|
|
69
68
|
return R - I;
|
|
70
|
-
},
|
|
71
|
-
if (
|
|
69
|
+
}, y = () => {
|
|
70
|
+
if (a.value) {
|
|
72
71
|
const I = f();
|
|
73
|
-
r.value = b(),
|
|
72
|
+
r.value = b(), c.value = Math.min(r.value + I + u, e.value.length), l.value = e.value.slice(r.value, c.value);
|
|
74
73
|
}
|
|
75
74
|
}, O = () => {
|
|
76
|
-
|
|
75
|
+
y();
|
|
77
76
|
};
|
|
78
|
-
t || (
|
|
79
|
-
|
|
80
|
-
o.value = I,
|
|
81
|
-
}),
|
|
82
|
-
}),
|
|
83
|
-
|
|
84
|
-
}),
|
|
77
|
+
t || (Ie(() => {
|
|
78
|
+
a.value && (o.value = a.value.clientHeight, p = tt(a.value, ({ clientHeight: I }) => {
|
|
79
|
+
o.value = I, y();
|
|
80
|
+
}), y());
|
|
81
|
+
}), Ye(() => {
|
|
82
|
+
p == null || p.disconnect();
|
|
83
|
+
}), Ae(
|
|
85
84
|
() => e.value,
|
|
86
85
|
() => {
|
|
87
|
-
|
|
86
|
+
y();
|
|
88
87
|
}
|
|
89
88
|
));
|
|
90
|
-
const
|
|
91
|
-
ref:
|
|
89
|
+
const w = {
|
|
90
|
+
ref: a,
|
|
92
91
|
style: { overflowY: "auto" }
|
|
93
92
|
};
|
|
94
93
|
return t ? {
|
|
95
|
-
containerRef:
|
|
96
|
-
containerProps:
|
|
94
|
+
containerRef: a,
|
|
95
|
+
containerProps: w,
|
|
97
96
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
98
97
|
onScroll: () => {
|
|
99
98
|
},
|
|
100
99
|
list: e
|
|
101
100
|
} : {
|
|
102
|
-
containerRef:
|
|
103
|
-
containerProps:
|
|
101
|
+
containerRef: a,
|
|
102
|
+
containerProps: w,
|
|
104
103
|
onScroll: O,
|
|
105
104
|
list: l,
|
|
106
105
|
wrapperProps: i
|
|
107
106
|
};
|
|
108
107
|
}
|
|
109
|
-
var d = /* @__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))(d || {}),
|
|
110
|
-
const lt =
|
|
108
|
+
var d = /* @__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))(d || {}), J = /* @__PURE__ */ ((e) => (e.AUTOMATIC = "automatic", e.BUTTON = "button", e.NONE = "none", e))(J || {});
|
|
109
|
+
const lt = j({
|
|
111
110
|
name: "bento-listbox-static-category",
|
|
112
111
|
components: {
|
|
113
112
|
BentoTypography: ee
|
|
@@ -123,25 +122,25 @@ const lt = H({
|
|
|
123
122
|
}
|
|
124
123
|
});
|
|
125
124
|
const ot = { class: "b-listbox-single-select-category" };
|
|
126
|
-
function nt(e, t, n, u, s,
|
|
127
|
-
const l =
|
|
128
|
-
return
|
|
125
|
+
function nt(e, t, n, u, s, a) {
|
|
126
|
+
const l = E("bento-typography");
|
|
127
|
+
return m(), T("div", ot, [
|
|
129
128
|
k(l, {
|
|
130
129
|
variant: "caption",
|
|
131
130
|
el: "span",
|
|
132
131
|
class: "b-listbox-single-select-category__label-text"
|
|
133
132
|
}, {
|
|
134
133
|
default: L(() => [
|
|
135
|
-
|
|
134
|
+
V(P(e.categoryLabel), 1)
|
|
136
135
|
]),
|
|
137
136
|
_: 1
|
|
138
137
|
}),
|
|
139
|
-
|
|
138
|
+
q("div", null, [
|
|
140
139
|
G(e.$slots, "default", {}, void 0, !0)
|
|
141
140
|
])
|
|
142
141
|
]);
|
|
143
142
|
}
|
|
144
|
-
const it = /* @__PURE__ */
|
|
143
|
+
const it = /* @__PURE__ */ W(lt, [["render", nt], ["__scopeId", "data-v-a90eff17"]]), at = j({
|
|
145
144
|
name: "bento-listbox-option",
|
|
146
145
|
props: {
|
|
147
146
|
/**
|
|
@@ -155,7 +154,7 @@ const it = /* @__PURE__ */ j(lt, [["render", nt], ["__scopeId", "data-v-a90eff17
|
|
|
155
154
|
},
|
|
156
155
|
emits: [d.CLICK, d.ENTER, d.SPACE, d.TAB],
|
|
157
156
|
setup(e, { emit: t }) {
|
|
158
|
-
const n =
|
|
157
|
+
const n = v(() => ({
|
|
159
158
|
"b-listbox-option--disabled": e.disabled,
|
|
160
159
|
"b-listbox-option--selected": e.selected
|
|
161
160
|
}));
|
|
@@ -166,17 +165,17 @@ const it = /* @__PURE__ */ j(lt, [["render", nt], ["__scopeId", "data-v-a90eff17
|
|
|
166
165
|
// Values
|
|
167
166
|
conditionalClasses: n,
|
|
168
167
|
// Events
|
|
169
|
-
onClick: (
|
|
170
|
-
t(d.CLICK,
|
|
168
|
+
onClick: (a) => {
|
|
169
|
+
t(d.CLICK, a);
|
|
171
170
|
},
|
|
172
|
-
onOptionSelected: (
|
|
173
|
-
t(
|
|
171
|
+
onOptionSelected: (a, l) => {
|
|
172
|
+
t(a, l);
|
|
174
173
|
}
|
|
175
174
|
};
|
|
176
175
|
}
|
|
177
176
|
});
|
|
178
|
-
function ct(e, t, n, u, s,
|
|
179
|
-
return
|
|
177
|
+
function ct(e, t, n, u, s, a) {
|
|
178
|
+
return m(), T("label", x({
|
|
180
179
|
class: ["b-listbox-option", e.conditionalClasses],
|
|
181
180
|
role: "option"
|
|
182
181
|
}, e.$attrs, {
|
|
@@ -190,12 +189,34 @@ function ct(e, t, n, u, s, c) {
|
|
|
190
189
|
G(e.$slots, "default", {}, void 0, !0)
|
|
191
190
|
], 16);
|
|
192
191
|
}
|
|
193
|
-
const be = /* @__PURE__ */
|
|
192
|
+
const be = /* @__PURE__ */ W(at, [["render", ct], ["__scopeId", "data-v-18a61f5d"]]);
|
|
193
|
+
let Ee = 0;
|
|
194
|
+
const rt = {
|
|
195
|
+
beforeCreate() {
|
|
196
|
+
this.uuid = Ee.toString(), Ee += 1;
|
|
197
|
+
}
|
|
198
|
+
}, ut = { key: 0 }, dt = /* @__PURE__ */ q("path", {
|
|
199
|
+
fill: "#00112C",
|
|
200
|
+
d: "M15.0608 4.00011L14.0001 2.93945L6.00011 10.9395L2.00011 6.93945L0.939453 8.00011L6.00011 13.0608L15.0608 4.00011Z"
|
|
201
|
+
}, null, -1);
|
|
202
|
+
function bt(e, t, n, u, s, a) {
|
|
203
|
+
return m(), T("svg", x({ role: "img" }, e.$attrs, {
|
|
204
|
+
class: "ui-assets-icons-16",
|
|
205
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
206
|
+
width: "16",
|
|
207
|
+
height: "16",
|
|
208
|
+
fill: "none"
|
|
209
|
+
}), [
|
|
210
|
+
e.$attrs["svg-title"] ? (m(), T("title", ut, P(e.$attrs["svg-title"]), 1)) : K("", !0),
|
|
211
|
+
dt
|
|
212
|
+
], 16);
|
|
213
|
+
}
|
|
214
|
+
const mt = /* @__PURE__ */ W(rt, [["render", bt]]), vt = j({
|
|
194
215
|
name: "bento-listbox-single-select-option",
|
|
195
216
|
components: {
|
|
196
217
|
BentoListboxOption: be,
|
|
197
218
|
BentoTypography: ee,
|
|
198
|
-
CheckmarkIcon:
|
|
219
|
+
CheckmarkIcon: mt
|
|
199
220
|
},
|
|
200
221
|
props: {
|
|
201
222
|
/**
|
|
@@ -219,12 +240,12 @@ const be = /* @__PURE__ */ j(at, [["render", ct], ["__scopeId", "data-v-18a61f5d
|
|
|
219
240
|
setup(e, { emit: t }) {
|
|
220
241
|
const n = (l) => {
|
|
221
242
|
e.disabled || t(l, e.option);
|
|
222
|
-
}, u =
|
|
243
|
+
}, u = v(() => e.disabled ? !0 : null), s = v(() => e.selected ? !0 : null), a = v(() => e.disabled ? -1 : 0);
|
|
223
244
|
return {
|
|
224
245
|
// Values
|
|
225
246
|
ariaDisabled: u,
|
|
226
247
|
ariaSelected: s,
|
|
227
|
-
tabIndex:
|
|
248
|
+
tabIndex: a,
|
|
228
249
|
// Enums
|
|
229
250
|
BentoListboxEvent: d,
|
|
230
251
|
// Events
|
|
@@ -232,10 +253,10 @@ const be = /* @__PURE__ */ j(at, [["render", ct], ["__scopeId", "data-v-18a61f5d
|
|
|
232
253
|
};
|
|
233
254
|
}
|
|
234
255
|
});
|
|
235
|
-
const
|
|
236
|
-
function
|
|
237
|
-
const l =
|
|
238
|
-
return
|
|
256
|
+
const gt = { class: "b-listbox-single-select-option__text" }, ft = { class: "b-listbox-single-select-option__check-icon" };
|
|
257
|
+
function pt(e, t, n, u, s, a) {
|
|
258
|
+
const l = E("bento-typography"), r = E("checkmark-icon"), c = E("bento-listbox-option");
|
|
259
|
+
return m(), B(c, x({
|
|
239
260
|
class: "b-listbox-single-select-option",
|
|
240
261
|
disabled: e.disabled,
|
|
241
262
|
selected: e.selected,
|
|
@@ -251,41 +272,41 @@ function bt(e, t, n, u, s, c) {
|
|
|
251
272
|
[se(e.BentoListboxEvent.TAB)]: t[3] || (t[3] = (o) => e.onOptionSelected(e.BentoListboxEvent.TAB))
|
|
252
273
|
}), {
|
|
253
274
|
default: L(() => [
|
|
254
|
-
G(e.$slots, "default", F(
|
|
255
|
-
|
|
275
|
+
G(e.$slots, "default", F(H(e.option)), () => [
|
|
276
|
+
q("span", gt, [
|
|
256
277
|
k(l, { el: "span" }, {
|
|
257
278
|
default: L(() => [
|
|
258
|
-
|
|
279
|
+
V(P(e.option.label), 1)
|
|
259
280
|
]),
|
|
260
281
|
_: 1
|
|
261
282
|
}),
|
|
262
|
-
e.option.description ? (
|
|
283
|
+
e.option.description ? (m(), B(l, {
|
|
263
284
|
key: 0,
|
|
264
285
|
class: "b-listbox-single-select-option__description",
|
|
265
286
|
el: "span"
|
|
266
287
|
}, {
|
|
267
288
|
default: L(() => [
|
|
268
|
-
|
|
289
|
+
V(P(e.option.description), 1)
|
|
269
290
|
]),
|
|
270
291
|
_: 1
|
|
271
|
-
})) :
|
|
292
|
+
})) : K("", !0)
|
|
272
293
|
])
|
|
273
294
|
], !0),
|
|
274
|
-
|
|
295
|
+
q("span", ft, [
|
|
275
296
|
ae(k(r, { "svg-title": "selected" }, null, 512), [
|
|
276
|
-
[
|
|
297
|
+
[$e, e.selected]
|
|
277
298
|
])
|
|
278
299
|
])
|
|
279
300
|
]),
|
|
280
301
|
_: 3
|
|
281
302
|
}, 16, ["disabled", "selected", "aria-selected", "aria-disabled", "tabindex"]);
|
|
282
303
|
}
|
|
283
|
-
const
|
|
284
|
-
const u =
|
|
285
|
-
|
|
304
|
+
const yt = /* @__PURE__ */ W(vt, [["render", pt], ["__scopeId", "data-v-e8cc847b"]]), Be = ({ items: e, isOptionDisabled: t }, n) => {
|
|
305
|
+
const u = v(() => e.value.length - 1), s = N(0);
|
|
306
|
+
Ie(() => {
|
|
286
307
|
t && (s.value = e.value.findIndex((f) => !t(f)));
|
|
287
308
|
});
|
|
288
|
-
const
|
|
309
|
+
const a = (f) => !t || !!t && t(e.value[f]), l = (f) => !t || !!t && !t(e.value[f]), r = (f) => {
|
|
289
310
|
switch (f) {
|
|
290
311
|
case "increase":
|
|
291
312
|
s.value += 1;
|
|
@@ -294,50 +315,50 @@ const mt = /* @__PURE__ */ j(rt, [["render", bt], ["__scopeId", "data-v-e8cc847b
|
|
|
294
315
|
s.value -= 1;
|
|
295
316
|
break;
|
|
296
317
|
}
|
|
297
|
-
},
|
|
298
|
-
s.value !== f && (
|
|
318
|
+
}, c = ({ edgeCaseItem: f, isItemBeforeEdgeCaseItem: y }, O, w) => {
|
|
319
|
+
s.value !== f && (y ? l(f) && r(w) : (r(w), a(s.value) && O()), n(s.value));
|
|
299
320
|
}, o = (f) => {
|
|
300
321
|
var O;
|
|
301
322
|
(O = f == null ? void 0 : f.detail) == null || O.preventDefault();
|
|
302
|
-
const
|
|
303
|
-
|
|
323
|
+
const y = s.value === u.value - 2;
|
|
324
|
+
c(
|
|
304
325
|
{
|
|
305
|
-
isItemBeforeEdgeCaseItem:
|
|
326
|
+
isItemBeforeEdgeCaseItem: y,
|
|
306
327
|
edgeCaseItem: u.value
|
|
307
328
|
},
|
|
308
329
|
o,
|
|
309
330
|
"increase"
|
|
310
331
|
/* INCREASE */
|
|
311
332
|
);
|
|
312
|
-
},
|
|
333
|
+
}, p = (f) => {
|
|
313
334
|
var O;
|
|
314
335
|
(O = f == null ? void 0 : f.detail) == null || O.preventDefault();
|
|
315
|
-
const
|
|
316
|
-
|
|
336
|
+
const y = s.value === 1;
|
|
337
|
+
c(
|
|
317
338
|
{
|
|
318
339
|
edgeCaseItem: 0,
|
|
319
|
-
isItemBeforeEdgeCaseItem:
|
|
340
|
+
isItemBeforeEdgeCaseItem: y
|
|
320
341
|
},
|
|
321
|
-
|
|
342
|
+
p,
|
|
322
343
|
"decrease"
|
|
323
344
|
/* DECREASE */
|
|
324
345
|
);
|
|
325
346
|
};
|
|
326
347
|
return {
|
|
327
348
|
moveToFirstElement: () => {
|
|
328
|
-
s.value = 0,
|
|
349
|
+
s.value = 0, a(s.value) ? o() : n(s.value);
|
|
329
350
|
},
|
|
330
351
|
moveToLastElement: () => {
|
|
331
|
-
s.value = u.value,
|
|
352
|
+
s.value = u.value, a(s.value) ? p() : n(s.value);
|
|
332
353
|
},
|
|
333
354
|
moveToNextElement: o,
|
|
334
|
-
moveToPreviousElement:
|
|
355
|
+
moveToPreviousElement: p
|
|
335
356
|
};
|
|
336
|
-
},
|
|
357
|
+
}, _t = j({
|
|
337
358
|
name: "bento-listbox-single-select",
|
|
338
359
|
components: {
|
|
339
360
|
BentoListboxSingleSelectCategory: it,
|
|
340
|
-
BentoListboxSingleSelectOption:
|
|
361
|
+
BentoListboxSingleSelectOption: yt
|
|
341
362
|
},
|
|
342
363
|
directives: { BentoKeyboardNavigationDirective: Se },
|
|
343
364
|
inheritAttrs: !1,
|
|
@@ -382,12 +403,12 @@ const mt = /* @__PURE__ */ j(rt, [["render", bt], ["__scopeId", "data-v-e8cc847b
|
|
|
382
403
|
},
|
|
383
404
|
emits: [d.SELECT, d.ENTER, d.SPACE, d.TAB],
|
|
384
405
|
setup(e, { emit: t, slots: n }) {
|
|
385
|
-
const u = N([]), s =
|
|
386
|
-
var
|
|
387
|
-
return !!((
|
|
388
|
-
}),
|
|
389
|
-
t(
|
|
390
|
-
}, r = (
|
|
406
|
+
const u = N([]), s = v(() => {
|
|
407
|
+
var y;
|
|
408
|
+
return !!((y = e.selectedValue) != null && y.length) && e.selectedValue.at(0);
|
|
409
|
+
}), a = v(() => !!e.items.some(({ items: y }) => !!y)), l = (y) => (O) => {
|
|
410
|
+
t(y, [O]);
|
|
411
|
+
}, r = (y) => u.value[y].$el.focus(), { moveToNextElement: c, moveToPreviousElement: o, moveToFirstElement: p, moveToLastElement: i } = Be(
|
|
391
412
|
{
|
|
392
413
|
items: ue(e, "items"),
|
|
393
414
|
isOptionDisabled: e.isOptionDisabled
|
|
@@ -395,8 +416,8 @@ const mt = /* @__PURE__ */ j(rt, [["render", bt], ["__scopeId", "data-v-e8cc847b
|
|
|
395
416
|
r
|
|
396
417
|
), b = {
|
|
397
418
|
[Y.ARROW_UP]: o,
|
|
398
|
-
[Y.ARROW_DOWN]:
|
|
399
|
-
[Y.HOME]:
|
|
419
|
+
[Y.ARROW_DOWN]: c,
|
|
420
|
+
[Y.HOME]: p,
|
|
400
421
|
[Y.END]: i
|
|
401
422
|
}, f = {
|
|
402
423
|
[d.SELECT]: l(d.SELECT),
|
|
@@ -412,7 +433,7 @@ const mt = /* @__PURE__ */ j(rt, [["render", bt], ["__scopeId", "data-v-e8cc847b
|
|
|
412
433
|
selectedItem: s,
|
|
413
434
|
slots: n,
|
|
414
435
|
// Computed
|
|
415
|
-
hasCategories:
|
|
436
|
+
hasCategories: a,
|
|
416
437
|
// Methods
|
|
417
438
|
onOptionSelected: l,
|
|
418
439
|
// Keyboard navigation
|
|
@@ -421,34 +442,34 @@ const mt = /* @__PURE__ */ j(rt, [["render", bt], ["__scopeId", "data-v-e8cc847b
|
|
|
421
442
|
};
|
|
422
443
|
}
|
|
423
444
|
});
|
|
424
|
-
function
|
|
425
|
-
const l =
|
|
426
|
-
return ae((
|
|
427
|
-
e.hasCategories && e.staticCategories ? (
|
|
445
|
+
function St(e, t, n, u, s, a) {
|
|
446
|
+
const l = E("bento-listbox-single-select-option"), r = E("bento-listbox-single-select-category"), c = _e("bento-keyboard-navigation-directive");
|
|
447
|
+
return ae((m(), T("div", le(e.listboxListeners, !0), [
|
|
448
|
+
e.hasCategories && e.staticCategories ? (m(!0), T(Q, { key: 0 }, z(e.items, (o) => (m(), B(r, {
|
|
428
449
|
key: o.value,
|
|
429
450
|
"category-label": o.label,
|
|
430
451
|
role: "group"
|
|
431
452
|
}, {
|
|
432
453
|
default: L(() => [
|
|
433
|
-
(
|
|
434
|
-
key:
|
|
454
|
+
(m(!0), T(Q, null, z(o.items, (p) => (m(), B(l, x({
|
|
455
|
+
key: p.value,
|
|
435
456
|
ref_for: !0,
|
|
436
457
|
ref: "listboxItemRef",
|
|
437
458
|
role: "option",
|
|
438
|
-
option:
|
|
439
|
-
disabled: e.isOptionDisabled ? e.isOptionDisabled(
|
|
440
|
-
selected:
|
|
459
|
+
option: p,
|
|
460
|
+
disabled: e.isOptionDisabled ? e.isOptionDisabled(p) : null,
|
|
461
|
+
selected: p.value === e.selectedItem.value
|
|
441
462
|
}, le(e.listboxOptionListeners)), ie({ _: 2 }, [
|
|
442
463
|
z(e.slots, (i, b) => ({
|
|
443
464
|
name: b,
|
|
444
465
|
fn: L((f) => [
|
|
445
|
-
G(e.$slots, b, F(
|
|
466
|
+
G(e.$slots, b, F(H(f)))
|
|
446
467
|
])
|
|
447
468
|
}))
|
|
448
469
|
]), 1040, ["option", "disabled", "selected"]))), 128))
|
|
449
470
|
]),
|
|
450
471
|
_: 2
|
|
451
|
-
}, 1032, ["category-label"]))), 128)) : (
|
|
472
|
+
}, 1032, ["category-label"]))), 128)) : (m(!0), T(Q, { key: 1 }, z(e.items, (o) => (m(), B(l, x({
|
|
452
473
|
key: o.value,
|
|
453
474
|
ref_for: !0,
|
|
454
475
|
ref: "listboxItemRef",
|
|
@@ -457,33 +478,33 @@ function gt(e, t, n, u, s, c) {
|
|
|
457
478
|
disabled: e.isOptionDisabled ? e.isOptionDisabled(o) : null,
|
|
458
479
|
selected: o.value === e.selectedItem.value
|
|
459
480
|
}, le(e.listboxOptionListeners)), ie({ _: 2 }, [
|
|
460
|
-
z(e.slots, (
|
|
481
|
+
z(e.slots, (p, i) => ({
|
|
461
482
|
name: i,
|
|
462
483
|
fn: L((b) => [
|
|
463
|
-
G(e.$slots, i, F(
|
|
484
|
+
G(e.$slots, i, F(H(b)))
|
|
464
485
|
])
|
|
465
486
|
}))
|
|
466
487
|
]), 1040, ["option", "disabled", "selected"]))), 128))
|
|
467
488
|
], 16)), [
|
|
468
|
-
[
|
|
489
|
+
[c]
|
|
469
490
|
]);
|
|
470
491
|
}
|
|
471
|
-
const
|
|
472
|
-
var
|
|
473
|
-
const
|
|
492
|
+
const Ct = /* @__PURE__ */ W(_t, [["render", St]]);
|
|
493
|
+
var pe = /* @__PURE__ */ ((e) => (e.DISABLED = "disabled", e.STATIC_CATEGORY = "static-category", e))(pe || {}), ne = /* @__PURE__ */ ((e) => (e.SELECT_CATEGORY = "select-category", e.UNSELECT_CATEGORY = "unselect-category", e))(ne || {});
|
|
494
|
+
const ht = {
|
|
474
495
|
"en-US": {
|
|
475
496
|
categoryClosed: "{category} closed",
|
|
476
497
|
categoryOpened: "{category} opened"
|
|
477
498
|
}
|
|
478
|
-
},
|
|
479
|
-
i18n: { messages:
|
|
499
|
+
}, Et = j({
|
|
500
|
+
i18n: { messages: ht },
|
|
480
501
|
name: "bento-listbox-multi-select-category",
|
|
481
502
|
components: {
|
|
482
503
|
BentoCheckbox: Ce,
|
|
483
504
|
BentoTypography: ee,
|
|
484
505
|
BentoListboxOption: be,
|
|
485
506
|
ChevronDownIcon: Xe,
|
|
486
|
-
ChevronUpIcon:
|
|
507
|
+
ChevronUpIcon: Ze
|
|
487
508
|
},
|
|
488
509
|
props: {
|
|
489
510
|
/**
|
|
@@ -526,77 +547,77 @@ const yt = {
|
|
|
526
547
|
},
|
|
527
548
|
emits: [ne.SELECT_CATEGORY, ne.UNSELECT_CATEGORY],
|
|
528
549
|
setup(e, { emit: t }) {
|
|
529
|
-
const n = N(!1), { t: u } = de(), s = (S) => e.isOptionDisabled ? e.isOptionDisabled(S) : !1,
|
|
550
|
+
const n = N(!1), { t: u } = de(), s = (S) => e.isOptionDisabled ? e.isOptionDisabled(S) : !1, a = v(
|
|
530
551
|
() => e.category.items.every((S) => s(S))
|
|
531
|
-
), l = ue(e, "staticCategories"), r =
|
|
532
|
-
[`b-listbox-multi-select-category--${
|
|
533
|
-
[`b-listbox-multi-select-category--${
|
|
552
|
+
), l = ue(e, "staticCategories"), r = v(() => n.value || e.staticCategories), c = v(() => ({
|
|
553
|
+
[`b-listbox-multi-select-category--${pe.DISABLED}`]: a.value,
|
|
554
|
+
[`b-listbox-multi-select-category--${pe.STATIC_CATEGORY}`]: e.staticCategories
|
|
534
555
|
})), o = (S) => {
|
|
535
556
|
S.preventDefault(), n.value = !n.value;
|
|
536
|
-
},
|
|
557
|
+
}, p = (S) => {
|
|
537
558
|
var te;
|
|
538
|
-
const A = s(S),
|
|
539
|
-
return { isDisabled: A, isPreSelected:
|
|
540
|
-
}, i =
|
|
559
|
+
const A = s(S), U = ((te = e.selectedItemsList) == null ? void 0 : te.includes(S.value)) || !1;
|
|
560
|
+
return { isDisabled: A, isPreSelected: U };
|
|
561
|
+
}, i = v(
|
|
541
562
|
() => e.category.items.filter((S) => {
|
|
542
|
-
const { isDisabled: A, isPreSelected:
|
|
543
|
-
return A &&
|
|
563
|
+
const { isDisabled: A, isPreSelected: U } = p(S);
|
|
564
|
+
return A && U || !A;
|
|
544
565
|
})
|
|
545
|
-
), b =
|
|
566
|
+
), b = v(
|
|
546
567
|
() => {
|
|
547
568
|
var S;
|
|
548
569
|
return (S = i.value) == null ? void 0 : S.filter(
|
|
549
570
|
({ value: A }) => {
|
|
550
|
-
var
|
|
551
|
-
return (
|
|
571
|
+
var U;
|
|
572
|
+
return (U = e.selectedItemsList) == null ? void 0 : U.includes(A);
|
|
552
573
|
}
|
|
553
574
|
);
|
|
554
575
|
}
|
|
555
|
-
), f =
|
|
576
|
+
), f = v(() => {
|
|
556
577
|
const S = n.value ? "categoryOpened" : "categoryClosed";
|
|
557
578
|
return u(S, { category: e.category.label });
|
|
558
|
-
}),
|
|
579
|
+
}), y = v(
|
|
559
580
|
() => ({
|
|
560
581
|
el: "span",
|
|
561
582
|
variant: e.staticCategories ? "caption" : "body"
|
|
562
583
|
})
|
|
563
584
|
), O = () => {
|
|
564
585
|
t(ne.SELECT_CATEGORY);
|
|
565
|
-
},
|
|
586
|
+
}, w = () => {
|
|
566
587
|
t(ne.UNSELECT_CATEGORY);
|
|
567
|
-
}, { isAllSelected: I, isIndeterminate: D, toggleSelectAll: R } =
|
|
588
|
+
}, { isAllSelected: I, isIndeterminate: D, toggleSelectAll: R } = ke(
|
|
568
589
|
b,
|
|
569
590
|
i,
|
|
570
591
|
O,
|
|
571
|
-
|
|
592
|
+
w
|
|
572
593
|
);
|
|
573
594
|
return {
|
|
574
595
|
// Values
|
|
575
596
|
chevronTitle: f,
|
|
576
|
-
conditionalClass:
|
|
577
|
-
hasAllPropsDisabled:
|
|
597
|
+
conditionalClass: c,
|
|
598
|
+
hasAllPropsDisabled: a,
|
|
578
599
|
isOpen: n,
|
|
579
600
|
isAllSelected: I,
|
|
580
601
|
isIndeterminate: D,
|
|
581
602
|
isStaticCategory: l,
|
|
582
603
|
// Computed
|
|
583
604
|
showItemChildren: r,
|
|
584
|
-
categoryLabelProps:
|
|
605
|
+
categoryLabelProps: y,
|
|
585
606
|
// Methods
|
|
586
607
|
toggleOpen: o,
|
|
587
608
|
toggleSelectAll: R
|
|
588
609
|
};
|
|
589
610
|
}
|
|
590
611
|
});
|
|
591
|
-
const
|
|
592
|
-
function
|
|
593
|
-
const l =
|
|
594
|
-
return
|
|
595
|
-
k(
|
|
612
|
+
const Lt = { class: "b-listbox-multi-select-category__label" };
|
|
613
|
+
function Tt(e, t, n, u, s, a) {
|
|
614
|
+
const l = E("bento-checkbox"), r = E("bento-typography"), c = E("chevron-up-icon"), o = E("chevron-down-icon"), p = E("bento-listbox-option");
|
|
615
|
+
return m(), T("div", null, [
|
|
616
|
+
k(p, {
|
|
596
617
|
class: fe(["b-listbox-multi-select-category__option", e.conditionalClass])
|
|
597
618
|
}, {
|
|
598
619
|
default: L(() => [
|
|
599
|
-
e.isStaticCategory ?
|
|
620
|
+
e.isStaticCategory ? K("", !0) : (m(), B(l, {
|
|
600
621
|
key: 0,
|
|
601
622
|
"model-value": e.isAllSelected,
|
|
602
623
|
indeterminate: e.isIndeterminate,
|
|
@@ -605,23 +626,23 @@ function St(e, t, n, u, s, c) {
|
|
|
605
626
|
value: e.category.value,
|
|
606
627
|
"onUpdate:modelValue": e.toggleSelectAll
|
|
607
628
|
}, null, 8, ["model-value", "indeterminate", "disabled", "aria-label", "value", "onUpdate:modelValue"])),
|
|
608
|
-
|
|
629
|
+
q("span", Lt, [
|
|
609
630
|
k(r, x(e.categoryLabelProps, { class: "b-listbox-multi-select-category__label-text" }), {
|
|
610
631
|
default: L(() => [
|
|
611
|
-
|
|
632
|
+
V(P(e.category.label), 1)
|
|
612
633
|
]),
|
|
613
634
|
_: 1
|
|
614
635
|
}, 16),
|
|
615
|
-
e.isStaticCategory ?
|
|
636
|
+
e.isStaticCategory ? K("", !0) : (m(), T("div", {
|
|
616
637
|
key: 0,
|
|
617
638
|
class: "b-listbox-multi-select-category__label-chevron",
|
|
618
639
|
"data-testid": "toggle-listbox",
|
|
619
640
|
onClickCapture: t[0] || (t[0] = (...i) => e.toggleOpen && e.toggleOpen(...i))
|
|
620
641
|
}, [
|
|
621
|
-
e.isOpen ? (
|
|
642
|
+
e.isOpen ? (m(), B(c, {
|
|
622
643
|
key: 0,
|
|
623
644
|
"svg-title": e.chevronTitle
|
|
624
|
-
}, null, 8, ["svg-title"])) : (
|
|
645
|
+
}, null, 8, ["svg-title"])) : (m(), B(o, {
|
|
625
646
|
key: 1,
|
|
626
647
|
"svg-title": e.chevronTitle
|
|
627
648
|
}, null, 8, ["svg-title"]))
|
|
@@ -630,22 +651,22 @@ function St(e, t, n, u, s, c) {
|
|
|
630
651
|
]),
|
|
631
652
|
_: 1
|
|
632
653
|
}, 8, ["class"]),
|
|
633
|
-
ae(
|
|
654
|
+
ae(q("div", null, [
|
|
634
655
|
G(e.$slots, "default", {}, void 0, !0)
|
|
635
656
|
], 512), [
|
|
636
|
-
[
|
|
657
|
+
[$e, e.showItemChildren]
|
|
637
658
|
])
|
|
638
659
|
]);
|
|
639
660
|
}
|
|
640
|
-
const
|
|
641
|
-
var
|
|
642
|
-
const
|
|
661
|
+
const Ot = /* @__PURE__ */ W(Et, [["render", Tt], ["__scopeId", "data-v-9a00de22"]]);
|
|
662
|
+
var Z = /* @__PURE__ */ ((e) => (e.SELECT_CATEGORY = "select-category", e.TOGGLE_CHECKBOX_SELECTION = "toggle-checkbox-selection", e.UNSELECT_CATEGORY = "unselect-category", e))(Z || {});
|
|
663
|
+
const It = j({
|
|
643
664
|
name: "listbox-multi-select-options",
|
|
644
665
|
components: {
|
|
645
666
|
BentoCheckbox: Ce,
|
|
646
667
|
BentoListboxOption: be,
|
|
647
668
|
BentoTypography: ee,
|
|
648
|
-
ListboxMultiSelectCategory:
|
|
669
|
+
ListboxMultiSelectCategory: Ot
|
|
649
670
|
},
|
|
650
671
|
props: {
|
|
651
672
|
/**
|
|
@@ -703,46 +724,46 @@ const Et = H({
|
|
|
703
724
|
staticCategories: { type: Boolean, default: !1 }
|
|
704
725
|
},
|
|
705
726
|
emits: [
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
727
|
+
Z.TOGGLE_CHECKBOX_SELECTION,
|
|
728
|
+
Z.SELECT_CATEGORY,
|
|
729
|
+
Z.UNSELECT_CATEGORY
|
|
709
730
|
],
|
|
710
731
|
setup(e, { emit: t }) {
|
|
711
|
-
const n = (
|
|
712
|
-
t(
|
|
713
|
-
}, u = (
|
|
732
|
+
const n = (c) => {
|
|
733
|
+
t(Z.TOGGLE_CHECKBOX_SELECTION, c);
|
|
734
|
+
}, u = (c) => !!c.items, s = (c) => {
|
|
714
735
|
const o = e.isMultiLevel && e.searching;
|
|
715
|
-
return
|
|
716
|
-
},
|
|
736
|
+
return c.description && (!e.isMultiLevel || o);
|
|
737
|
+
}, a = (c) => c.items ? !!c.items.find((o) => e.selectedItemsList.includes(o.value)) : e.selectedItemsList.includes(c.value), l = (c, o) => {
|
|
717
738
|
if (u(o))
|
|
718
|
-
return t(
|
|
739
|
+
return t(c ? Z.SELECT_CATEGORY : Z.UNSELECT_CATEGORY, o);
|
|
719
740
|
n(o.value);
|
|
720
741
|
};
|
|
721
742
|
return {
|
|
722
743
|
// Values
|
|
723
|
-
conditionalClasses:
|
|
744
|
+
conditionalClasses: v(() => ({
|
|
724
745
|
"b-listbox-multi-select-options__static-category-option": e.staticCategories,
|
|
725
746
|
"b-listbox-multi-select-options__category-option": e.categoryItems
|
|
726
747
|
})),
|
|
727
748
|
// Methods
|
|
728
|
-
isOptionSelected:
|
|
749
|
+
isOptionSelected: a,
|
|
729
750
|
shouldShowDescription: s,
|
|
730
751
|
toggleCheckboxSelection: n,
|
|
731
752
|
selectSearch: l,
|
|
732
753
|
// Enums
|
|
733
754
|
BentoListboxEvent: d,
|
|
734
|
-
ListboxMultiSelectOptionsEvent:
|
|
755
|
+
ListboxMultiSelectOptionsEvent: Z
|
|
735
756
|
};
|
|
736
757
|
}
|
|
737
758
|
});
|
|
738
|
-
const
|
|
739
|
-
function
|
|
740
|
-
const l =
|
|
741
|
-
return
|
|
742
|
-
(
|
|
759
|
+
const At = { class: "b-listbox-multi-select__option-text" }, $t = { class: "b-listbox-multi-select__option-text" };
|
|
760
|
+
function kt(e, t, n, u, s, a) {
|
|
761
|
+
const l = E("bento-checkbox"), r = E("bento-typography"), c = E("bento-listbox-option"), o = E("listbox-multi-select-options", !0), p = E("listbox-multi-select-category");
|
|
762
|
+
return m(), T("div", null, [
|
|
763
|
+
(m(!0), T(Q, null, z(e.items, (i) => (m(), T("div", {
|
|
743
764
|
key: `selected-${i.value}`
|
|
744
765
|
}, [
|
|
745
|
-
e.searching && e.isMultiLevel ? (
|
|
766
|
+
e.searching && e.isMultiLevel ? (m(), B(c, {
|
|
746
767
|
key: 0,
|
|
747
768
|
class: fe(["b-listbox-multi-select-options", e.conditionalClasses]),
|
|
748
769
|
disabled: e.isOptionDisabled ? e.isOptionDisabled(i) : null
|
|
@@ -755,30 +776,30 @@ function Tt(e, t, n, u, s, c) {
|
|
|
755
776
|
value: i.value,
|
|
756
777
|
"onUpdate:modelValue": (b) => e.selectSearch(b, i)
|
|
757
778
|
}, null, 8, ["model-value", "aria-label", "disabled", "value", "onUpdate:modelValue"]),
|
|
758
|
-
G(e.$slots, "default", F(
|
|
759
|
-
|
|
779
|
+
G(e.$slots, "default", F(H(i)), () => [
|
|
780
|
+
q("span", At, [
|
|
760
781
|
k(r, { el: "span" }, {
|
|
761
782
|
default: L(() => [
|
|
762
|
-
|
|
783
|
+
V(P(i.label), 1)
|
|
763
784
|
]),
|
|
764
785
|
_: 2
|
|
765
786
|
}, 1024),
|
|
766
|
-
e.shouldShowDescription(i) ? (
|
|
787
|
+
e.shouldShowDescription(i) ? (m(), B(r, {
|
|
767
788
|
key: 0,
|
|
768
789
|
class: "b-listbox-multi-select__option-description",
|
|
769
790
|
el: "span"
|
|
770
791
|
}, {
|
|
771
792
|
default: L(() => [
|
|
772
|
-
|
|
793
|
+
V(P(i.description), 1)
|
|
773
794
|
]),
|
|
774
795
|
_: 2
|
|
775
|
-
}, 1024)) :
|
|
796
|
+
}, 1024)) : K("", !0)
|
|
776
797
|
])
|
|
777
798
|
], !0)
|
|
778
799
|
]),
|
|
779
800
|
_: 2
|
|
780
|
-
}, 1032, ["class", "disabled"])) : (
|
|
781
|
-
i.items ? (
|
|
801
|
+
}, 1032, ["class", "disabled"])) : (m(), T(Q, { key: 1 }, [
|
|
802
|
+
i.items ? (m(), B(p, {
|
|
782
803
|
key: 0,
|
|
783
804
|
category: i,
|
|
784
805
|
"static-categories": e.staticCategories,
|
|
@@ -800,7 +821,7 @@ function Tt(e, t, n, u, s, c) {
|
|
|
800
821
|
}, null, 8, ["items", "is-option-disabled", "is-multi-level", "static-categories", "selected-items-list", "searching"])
|
|
801
822
|
]),
|
|
802
823
|
_: 2
|
|
803
|
-
}, 1032, ["category", "static-categories", "is-option-disabled", "selected-items-list", "onSelectCategory", "onUnselectCategory"])) : (
|
|
824
|
+
}, 1032, ["category", "static-categories", "is-option-disabled", "selected-items-list", "onSelectCategory", "onUnselectCategory"])) : (m(), B(c, {
|
|
804
825
|
key: 1,
|
|
805
826
|
class: fe(["b-listbox-multi-select-options", e.conditionalClasses]),
|
|
806
827
|
disabled: e.isOptionDisabled ? e.isOptionDisabled(i) : null
|
|
@@ -813,24 +834,24 @@ function Tt(e, t, n, u, s, c) {
|
|
|
813
834
|
value: i.value,
|
|
814
835
|
"onUpdate:modelValue": (b) => e.toggleCheckboxSelection(i)
|
|
815
836
|
}, null, 8, ["model-value", "aria-label", "disabled", "value", "onUpdate:modelValue"]),
|
|
816
|
-
G(e.$slots, "default", F(
|
|
817
|
-
|
|
837
|
+
G(e.$slots, "default", F(H(i)), () => [
|
|
838
|
+
q("span", $t, [
|
|
818
839
|
k(r, { el: "span" }, {
|
|
819
840
|
default: L(() => [
|
|
820
|
-
|
|
841
|
+
V(P(i.label), 1)
|
|
821
842
|
]),
|
|
822
843
|
_: 2
|
|
823
844
|
}, 1024),
|
|
824
|
-
e.shouldShowDescription(i) ? (
|
|
845
|
+
e.shouldShowDescription(i) ? (m(), B(r, {
|
|
825
846
|
key: 0,
|
|
826
847
|
class: "b-listbox-multi-select__option-description",
|
|
827
848
|
el: "span"
|
|
828
849
|
}, {
|
|
829
850
|
default: L(() => [
|
|
830
|
-
|
|
851
|
+
V(P(i.description), 1)
|
|
831
852
|
]),
|
|
832
853
|
_: 2
|
|
833
|
-
}, 1024)) :
|
|
854
|
+
}, 1024)) : K("", !0)
|
|
834
855
|
])
|
|
835
856
|
], !0)
|
|
836
857
|
]),
|
|
@@ -840,14 +861,14 @@ function Tt(e, t, n, u, s, c) {
|
|
|
840
861
|
]))), 128))
|
|
841
862
|
]);
|
|
842
863
|
}
|
|
843
|
-
const
|
|
864
|
+
const Bt = /* @__PURE__ */ W(It, [["render", kt], ["__scopeId", "data-v-25938a72"]]), Re = {
|
|
844
865
|
"en-US": {
|
|
845
866
|
remove: "Remove"
|
|
846
867
|
}
|
|
847
|
-
},
|
|
848
|
-
i18n: { messages:
|
|
849
|
-
},
|
|
850
|
-
...
|
|
868
|
+
}, Rt = { class: "b-listbox-multi-select-chips" }, Dt = {
|
|
869
|
+
i18n: { messages: Re }
|
|
870
|
+
}, Nt = /* @__PURE__ */ j({
|
|
871
|
+
...Dt,
|
|
851
872
|
__name: "listbox-multi-select-chips",
|
|
852
873
|
props: {
|
|
853
874
|
/**
|
|
@@ -871,18 +892,18 @@ const Ot = /* @__PURE__ */ j(Et, [["render", Tt], ["__scopeId", "data-v-25938a72
|
|
|
871
892
|
},
|
|
872
893
|
emits: ["unselect-item", "unselect-category"],
|
|
873
894
|
setup(e, { emit: t }) {
|
|
874
|
-
const { t: n } = de({ messages:
|
|
875
|
-
return (s,
|
|
876
|
-
(
|
|
895
|
+
const { t: n } = de({ messages: Re }), u = (s) => s.items ? t("unselect-category", s) : t("unselect-item", s);
|
|
896
|
+
return (s, a) => (m(), T("div", Rt, [
|
|
897
|
+
(m(!0), T(Q, null, z(e.items, (l) => (m(), T("div", {
|
|
877
898
|
key: `selected-${l.value}`
|
|
878
899
|
}, [
|
|
879
|
-
k(re(
|
|
900
|
+
k(re(Je), {
|
|
880
901
|
class: "b-listbox-multi-select-chips__chip",
|
|
881
902
|
disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null,
|
|
882
903
|
onClick: (r) => u(l)
|
|
883
904
|
}, {
|
|
884
905
|
iconRight: L(() => [
|
|
885
|
-
k(re(
|
|
906
|
+
k(re(Qe), {
|
|
886
907
|
"svg-title": re(n)("remove")
|
|
887
908
|
}, null, 8, ["svg-title"])
|
|
888
909
|
]),
|
|
@@ -893,7 +914,7 @@ const Ot = /* @__PURE__ */ j(Et, [["render", Tt], ["__scopeId", "data-v-25938a72
|
|
|
893
914
|
class: "b-listbox-multi-select-chips__option-text"
|
|
894
915
|
}, {
|
|
895
916
|
default: L(() => [
|
|
896
|
-
|
|
917
|
+
V(P(l.label), 1)
|
|
897
918
|
]),
|
|
898
919
|
_: 2
|
|
899
920
|
}, 1024)
|
|
@@ -904,34 +925,34 @@ const Ot = /* @__PURE__ */ j(Et, [["render", Tt], ["__scopeId", "data-v-25938a72
|
|
|
904
925
|
]));
|
|
905
926
|
}
|
|
906
927
|
});
|
|
907
|
-
const
|
|
928
|
+
const Mt = /* @__PURE__ */ W(Nt, [["__scopeId", "data-v-7c5f8bdb"]]), Le = {
|
|
908
929
|
"en-US": {
|
|
909
930
|
allSelected: "All selected ({total})",
|
|
910
931
|
numberOfTotalSelected: "{number} of {total} selected",
|
|
911
932
|
numbersSelected: "{number} selected",
|
|
912
933
|
selectAll: "Select all ({total})"
|
|
913
934
|
}
|
|
914
|
-
},
|
|
915
|
-
const t =
|
|
935
|
+
}, Pt = (e) => {
|
|
936
|
+
const t = v(() => {
|
|
916
937
|
var u;
|
|
917
938
|
return !!((u = e.value) != null && u.find(({ items: s }) => !!s));
|
|
918
|
-
}), n =
|
|
939
|
+
}), n = v(() => {
|
|
919
940
|
var u;
|
|
920
|
-
return t.value ? (u = e.value) == null ? void 0 : u.reduce((s,
|
|
941
|
+
return t.value ? (u = e.value) == null ? void 0 : u.reduce((s, a) => (a.items ? s.push(...a.items.flat()) : s.push(a), s), []) : e.value;
|
|
921
942
|
});
|
|
922
943
|
return {
|
|
923
944
|
isMultiLevelSelect: t,
|
|
924
945
|
flattenedItemsList: n
|
|
925
946
|
};
|
|
926
|
-
},
|
|
927
|
-
i18n: { messages:
|
|
947
|
+
}, wt = j({
|
|
948
|
+
i18n: { messages: Le },
|
|
928
949
|
name: "bento-listbox-multi-select",
|
|
929
950
|
components: {
|
|
930
951
|
BentoCheckbox: Ce,
|
|
931
952
|
BentoListboxOption: be,
|
|
932
953
|
BentoTypography: ee,
|
|
933
|
-
ListboxMultiSelectOptions:
|
|
934
|
-
ListboxMultiSelectChips:
|
|
954
|
+
ListboxMultiSelectOptions: Bt,
|
|
955
|
+
ListboxMultiSelectChips: Mt
|
|
935
956
|
},
|
|
936
957
|
directives: { BentoKeyboardNavigationDirective: Se },
|
|
937
958
|
props: {
|
|
@@ -970,8 +991,8 @@ const kt = /* @__PURE__ */ j($t, [["__scopeId", "data-v-7c5f8bdb"]]), he = {
|
|
|
970
991
|
*/
|
|
971
992
|
lazyLoadType: {
|
|
972
993
|
type: String,
|
|
973
|
-
default:
|
|
974
|
-
validator: (e) => Object.values(
|
|
994
|
+
default: J.NONE,
|
|
995
|
+
validator: (e) => Object.values(J).includes(e)
|
|
975
996
|
},
|
|
976
997
|
/**
|
|
977
998
|
* Flag that indicates that an external search it's being made
|
|
@@ -995,146 +1016,146 @@ const kt = /* @__PURE__ */ j($t, [["__scopeId", "data-v-7c5f8bdb"]]), he = {
|
|
|
995
1016
|
},
|
|
996
1017
|
emits: [d.SELECT],
|
|
997
1018
|
setup(e, { emit: t, slots: n }) {
|
|
998
|
-
const { t: u } = de({ messages:
|
|
999
|
-
() => e.selectedValues.map(({ value:
|
|
1000
|
-
), { isMultiLevelSelect:
|
|
1019
|
+
const { t: u } = de({ messages: Le }), s = N(null), a = N(null), l = N(null), r = v(
|
|
1020
|
+
() => e.selectedValues.map(({ value: g }) => g)
|
|
1021
|
+
), { isMultiLevelSelect: c, flattenedItemsList: o } = Pt(ue(e, "items")), p = (g) => {
|
|
1001
1022
|
var $;
|
|
1002
|
-
const _ = e.isOptionDisabled(
|
|
1023
|
+
const _ = e.isOptionDisabled(g), C = (($ = r.value) == null ? void 0 : $.includes(g.value)) || !1;
|
|
1003
1024
|
return { isDisabled: _, isPreSelected: C };
|
|
1004
|
-
}, i =
|
|
1005
|
-
if (e.searching &&
|
|
1025
|
+
}, i = v(() => {
|
|
1026
|
+
if (e.searching && c)
|
|
1006
1027
|
return e.items;
|
|
1007
|
-
const
|
|
1008
|
-
const { isDisabled: C, isPreSelected: $ } =
|
|
1028
|
+
const g = o.value.filter((_) => {
|
|
1029
|
+
const { isDisabled: C, isPreSelected: $ } = p(_);
|
|
1009
1030
|
return C && $ || !C;
|
|
1010
1031
|
});
|
|
1011
1032
|
return e.selectedValues.forEach((_) => {
|
|
1012
|
-
|
|
1013
|
-
}),
|
|
1014
|
-
}), b =
|
|
1033
|
+
g.find((C) => C.value === _.value) || g.push(_);
|
|
1034
|
+
}), g;
|
|
1035
|
+
}), b = v(
|
|
1015
1036
|
() => {
|
|
1016
|
-
var
|
|
1017
|
-
return (
|
|
1037
|
+
var g;
|
|
1038
|
+
return (g = i.value) == null ? void 0 : g.filter((_) => {
|
|
1018
1039
|
var C;
|
|
1019
|
-
return _.items &&
|
|
1020
|
-
(
|
|
1040
|
+
return _.items && c.value && e.searching ? _.items.filter(
|
|
1041
|
+
(h) => (e.selectedValues ?? []).includes(h.value)
|
|
1021
1042
|
).length === _.items.length : (C = r.value) == null ? void 0 : C.includes(_.value);
|
|
1022
1043
|
});
|
|
1023
1044
|
}
|
|
1024
|
-
), f = () =>
|
|
1045
|
+
), f = () => c.value && !e.searching ? o.value.length : e.items.length, y = v(() => {
|
|
1025
1046
|
var $;
|
|
1026
|
-
const
|
|
1027
|
-
return C === 0 ? u("selectAll", { total:
|
|
1028
|
-
}), O = (
|
|
1047
|
+
const g = i.value.length, _ = f(), C = (($ = b.value) == null ? void 0 : $.length) || 0;
|
|
1048
|
+
return C === 0 ? u("selectAll", { total: g }) : C === _ ? u("allSelected", { total: _ }) : C <= _ ? u("numberOfTotalSelected", { number: C, total: _ }) : u("numbersSelected", { number: C });
|
|
1049
|
+
}), O = (g) => {
|
|
1029
1050
|
const _ = ($) => {
|
|
1030
|
-
const { isDisabled:
|
|
1031
|
-
return
|
|
1032
|
-
}, C =
|
|
1051
|
+
const { isDisabled: h, isPreSelected: X } = p($);
|
|
1052
|
+
return h && X || !h;
|
|
1053
|
+
}, C = g.filter(_).filter(($) => !r.value.includes($.value));
|
|
1033
1054
|
t(d.SELECT, [...e.selectedValues, ...C]);
|
|
1034
|
-
},
|
|
1035
|
-
const _ = (
|
|
1036
|
-
const { isDisabled: X, isPreSelected:
|
|
1037
|
-
return !(X &&
|
|
1038
|
-
}, C =
|
|
1055
|
+
}, w = (g) => {
|
|
1056
|
+
const _ = (h) => {
|
|
1057
|
+
const { isDisabled: X, isPreSelected: Fe } = p(h);
|
|
1058
|
+
return !(X && Fe);
|
|
1059
|
+
}, C = g.filter(_).map(({ value: h }) => h), $ = e.selectedValues.filter((h) => !(C != null && C.includes(h.value)));
|
|
1039
1060
|
t(d.SELECT, $);
|
|
1040
1061
|
}, I = () => {
|
|
1041
1062
|
O(o.value);
|
|
1042
1063
|
}, D = () => {
|
|
1043
|
-
|
|
1044
|
-
}, { isAllSelected: R, isIndeterminate: S, toggleSelectAll: A } =
|
|
1064
|
+
w(o.value);
|
|
1065
|
+
}, { isAllSelected: R, isIndeterminate: S, toggleSelectAll: A } = ke(
|
|
1045
1066
|
b,
|
|
1046
1067
|
i,
|
|
1047
1068
|
I,
|
|
1048
1069
|
D
|
|
1049
|
-
),
|
|
1050
|
-
O(
|
|
1051
|
-
}, te = (
|
|
1052
|
-
|
|
1053
|
-
}, me = (
|
|
1070
|
+
), U = (g) => {
|
|
1071
|
+
O(g.items);
|
|
1072
|
+
}, te = (g) => {
|
|
1073
|
+
w(g.items);
|
|
1074
|
+
}, me = (g, _) => {
|
|
1054
1075
|
let C = !1;
|
|
1055
|
-
const $ = e.selectedValues.filter(({ value:
|
|
1056
|
-
C || $.push(_), t(
|
|
1057
|
-
}, ce =
|
|
1058
|
-
if (!
|
|
1076
|
+
const $ = e.selectedValues.filter(({ value: h }) => _.value === h ? (C = !0, !1) : !0);
|
|
1077
|
+
C || $.push(_), t(g, $);
|
|
1078
|
+
}, ce = v(() => {
|
|
1079
|
+
if (!c.value)
|
|
1059
1080
|
return e.selectedValues;
|
|
1060
|
-
const
|
|
1081
|
+
const g = (h) => r.value.includes(h.value), _ = (h) => !e.staticCategories && h.every((X) => g(X));
|
|
1061
1082
|
return e.items.flatMap(
|
|
1062
|
-
(
|
|
1063
|
-
).filter((
|
|
1064
|
-
}), ve =
|
|
1065
|
-
var C, $,
|
|
1066
|
-
const
|
|
1067
|
-
return
|
|
1068
|
-
}), M =
|
|
1083
|
+
(h) => h.items && !_(h.items) ? h.items : h
|
|
1084
|
+
).filter((h) => h.items ? !0 : g(h));
|
|
1085
|
+
}), ve = v(() => {
|
|
1086
|
+
var C, $, h, X;
|
|
1087
|
+
const g = ["automatic", "button"].includes(e.lazyLoadType), _ = ((C = e.selectedValues) == null ? void 0 : C.length) > 0 && (($ = b.value) == null ? void 0 : $.length) !== ((h = o.value) == null ? void 0 : h.length);
|
|
1088
|
+
return g && e.hasMoreItems ? !!((X = e.selectedValues) != null && X.length) : _;
|
|
1089
|
+
}), M = v(() => ["automatic", "button"].includes(e.lazyLoadType) ? !e.hasMoreItems : !0), oe = v(
|
|
1069
1090
|
() => s.value ? [s.value] : []
|
|
1070
|
-
),
|
|
1091
|
+
), De = v(
|
|
1071
1092
|
() => {
|
|
1072
|
-
var
|
|
1073
|
-
return (_ = (
|
|
1093
|
+
var g, _;
|
|
1094
|
+
return (_ = (g = a.value) == null ? void 0 : g.$children) != null && _.length ? a.value.$children : [];
|
|
1074
1095
|
}
|
|
1075
|
-
),
|
|
1096
|
+
), Ne = v(
|
|
1076
1097
|
() => {
|
|
1077
|
-
var
|
|
1078
|
-
return (_ = (
|
|
1098
|
+
var g, _;
|
|
1099
|
+
return (_ = (g = l.value) == null ? void 0 : g.$children) != null && _.length ? l.value.$children : [];
|
|
1079
1100
|
}
|
|
1080
|
-
),
|
|
1081
|
-
|
|
1101
|
+
), Me = v(() => ({ label: y, value: R })), Pe = v(() => [
|
|
1102
|
+
Me,
|
|
1082
1103
|
...ce.value,
|
|
1083
1104
|
...o.value
|
|
1084
|
-
]),
|
|
1105
|
+
]), we = (g) => {
|
|
1085
1106
|
[
|
|
1086
1107
|
...oe.value,
|
|
1087
|
-
...
|
|
1088
|
-
...
|
|
1089
|
-
][
|
|
1090
|
-
}, { moveToNextElement:
|
|
1108
|
+
...De.value,
|
|
1109
|
+
...Ne.value
|
|
1110
|
+
][g].$el.focus();
|
|
1111
|
+
}, { moveToNextElement: Ue, moveToPreviousElement: Ve, moveToFirstElement: xe, moveToLastElement: Ge } = Be(
|
|
1091
1112
|
{
|
|
1092
|
-
items: N(
|
|
1113
|
+
items: N(Pe),
|
|
1093
1114
|
isOptionDisabled: e.isOptionDisabled
|
|
1094
1115
|
},
|
|
1095
|
-
|
|
1096
|
-
),
|
|
1097
|
-
[Y.ARROW_UP]: (
|
|
1098
|
-
[Y.ARROW_DOWN]: (
|
|
1099
|
-
[Y.HOME]:
|
|
1100
|
-
[Y.END]:
|
|
1116
|
+
we
|
|
1117
|
+
), ze = {
|
|
1118
|
+
[Y.ARROW_UP]: (g) => Ve(g),
|
|
1119
|
+
[Y.ARROW_DOWN]: (g) => Ue(g),
|
|
1120
|
+
[Y.HOME]: xe,
|
|
1121
|
+
[Y.END]: Ge
|
|
1101
1122
|
};
|
|
1102
1123
|
return {
|
|
1103
1124
|
// Refs
|
|
1104
1125
|
selectAllListboxItemsRef: s,
|
|
1105
|
-
selectedListboxItemsRef:
|
|
1126
|
+
selectedListboxItemsRef: a,
|
|
1106
1127
|
listboxItemsRef: l,
|
|
1107
1128
|
// Values
|
|
1108
1129
|
isAllSelected: R,
|
|
1109
1130
|
showSelectedItems: ve,
|
|
1110
1131
|
isIndeterminate: S,
|
|
1111
|
-
isMultiLevelSelect:
|
|
1132
|
+
isMultiLevelSelect: c,
|
|
1112
1133
|
flattenedItemsList: o,
|
|
1113
1134
|
selectedItemsList: r,
|
|
1114
|
-
selectAllCheckboxText:
|
|
1135
|
+
selectAllCheckboxText: y,
|
|
1115
1136
|
selectedOptions: ce,
|
|
1116
1137
|
showSelectAllCheckbox: M,
|
|
1117
1138
|
slots: n,
|
|
1118
1139
|
// Enums
|
|
1119
1140
|
BentoListboxEvent: d,
|
|
1120
1141
|
// Methods
|
|
1121
|
-
selectAllCategory:
|
|
1142
|
+
selectAllCategory: U,
|
|
1122
1143
|
toggleCheckboxSelection: me,
|
|
1123
1144
|
toggleSelectAll: A,
|
|
1124
1145
|
unselectAllCategory: te,
|
|
1125
1146
|
// Events
|
|
1126
|
-
listboxListeners:
|
|
1147
|
+
listboxListeners: ze
|
|
1127
1148
|
};
|
|
1128
1149
|
}
|
|
1129
1150
|
});
|
|
1130
|
-
const
|
|
1151
|
+
const Ut = (e) => (Ke("data-v-0ca61721"), e = e(), qe(), e), Vt = {
|
|
1131
1152
|
key: 1,
|
|
1132
1153
|
class: "b-listbox-multi-select__divider"
|
|
1133
|
-
},
|
|
1134
|
-
function
|
|
1135
|
-
const l =
|
|
1136
|
-
return ae((
|
|
1137
|
-
e.showSelectAllCheckbox ? (
|
|
1154
|
+
}, xt = { key: 2 }, Gt = /* @__PURE__ */ Ut(() => /* @__PURE__ */ q("hr", { class: "b-listbox-multi-select__divider" }, null, -1));
|
|
1155
|
+
function zt(e, t, n, u, s, a) {
|
|
1156
|
+
const l = E("bento-checkbox"), r = E("bento-typography"), c = E("bento-listbox-option"), o = E("listbox-multi-select-chips"), p = E("listbox-multi-select-options"), i = _e("bento-keyboard-navigation-directive");
|
|
1157
|
+
return ae((m(), T("div", x({ class: "b-listbox-multi-select" }, le(e.listboxListeners, !0)), [
|
|
1158
|
+
e.showSelectAllCheckbox ? (m(), B(c, {
|
|
1138
1159
|
key: 0,
|
|
1139
1160
|
ref: "selectAllListboxItemsRef",
|
|
1140
1161
|
class: "b-listbox-multi-select__option"
|
|
@@ -1151,15 +1172,15 @@ function wt(e, t, n, u, s, c) {
|
|
|
1151
1172
|
"aria-hidden": "true"
|
|
1152
1173
|
}, {
|
|
1153
1174
|
default: L(() => [
|
|
1154
|
-
|
|
1175
|
+
V(P(e.selectAllCheckboxText), 1)
|
|
1155
1176
|
]),
|
|
1156
1177
|
_: 1
|
|
1157
1178
|
})
|
|
1158
1179
|
]),
|
|
1159
1180
|
_: 1
|
|
1160
|
-
}, 512)) :
|
|
1161
|
-
e.showSelectAllCheckbox ? (
|
|
1162
|
-
e.showSelectedItems ? (
|
|
1181
|
+
}, 512)) : K("", !0),
|
|
1182
|
+
e.showSelectAllCheckbox ? (m(), T("hr", Vt)) : K("", !0),
|
|
1183
|
+
e.showSelectedItems ? (m(), T("div", xt, [
|
|
1163
1184
|
k(o, {
|
|
1164
1185
|
ref: "selectedListboxItemsRef",
|
|
1165
1186
|
items: e.selectedOptions,
|
|
@@ -1167,9 +1188,9 @@ function wt(e, t, n, u, s, c) {
|
|
|
1167
1188
|
onUnselectCategory: e.unselectAllCategory,
|
|
1168
1189
|
onUnselectItem: t[0] || (t[0] = (b) => e.toggleCheckboxSelection(e.BentoListboxEvent.SELECT, b))
|
|
1169
1190
|
}, null, 8, ["items", "is-option-disabled", "onUnselectCategory"]),
|
|
1170
|
-
|
|
1171
|
-
])) :
|
|
1172
|
-
k(
|
|
1191
|
+
Gt
|
|
1192
|
+
])) : K("", !0),
|
|
1193
|
+
k(p, x({
|
|
1173
1194
|
ref: "listboxItemsRef",
|
|
1174
1195
|
items: e.items,
|
|
1175
1196
|
"is-option-disabled": e.isOptionDisabled,
|
|
@@ -1189,8 +1210,8 @@ function wt(e, t, n, u, s, c) {
|
|
|
1189
1210
|
}), ie({ _: 2 }, [
|
|
1190
1211
|
z(e.slots, (b, f) => ({
|
|
1191
1212
|
name: f,
|
|
1192
|
-
fn: L((
|
|
1193
|
-
G(e.$slots, f, F(
|
|
1213
|
+
fn: L((y) => [
|
|
1214
|
+
G(e.$slots, f, F(H(y)), void 0, !0)
|
|
1194
1215
|
])
|
|
1195
1216
|
}))
|
|
1196
1217
|
]), 1040, ["items", "is-option-disabled", "is-multi-level", "static-categories", "searching", "selected-items-list", "onSelectCategory", "onUnselectCategory"])
|
|
@@ -1198,23 +1219,23 @@ function wt(e, t, n, u, s, c) {
|
|
|
1198
1219
|
[i]
|
|
1199
1220
|
]);
|
|
1200
1221
|
}
|
|
1201
|
-
const
|
|
1222
|
+
const Te = /* @__PURE__ */ W(wt, [["render", zt], ["__scopeId", "data-v-0ca61721"]]), Oe = {
|
|
1202
1223
|
"en-US": {
|
|
1203
1224
|
showMore: "Show more",
|
|
1204
1225
|
loading: "Loading"
|
|
1205
1226
|
}
|
|
1206
|
-
},
|
|
1227
|
+
}, Ft = 36, Yt = j({
|
|
1207
1228
|
name: "bento-listbox",
|
|
1208
1229
|
components: {
|
|
1209
|
-
BentoEmptyState:
|
|
1210
|
-
BentoListboxSingleSelect:
|
|
1211
|
-
BentoListboxMultiSelect:
|
|
1230
|
+
BentoEmptyState: He,
|
|
1231
|
+
BentoListboxSingleSelect: Ct,
|
|
1232
|
+
BentoListboxMultiSelect: Te,
|
|
1212
1233
|
BentoTypography: ee,
|
|
1213
|
-
BentoLoadingIndicator:
|
|
1234
|
+
BentoLoadingIndicator: We,
|
|
1214
1235
|
BentoLoadingButton: et
|
|
1215
1236
|
},
|
|
1216
1237
|
directives: { BentoKeyboardNavigationDirective: Se },
|
|
1217
|
-
i18n: { messages:
|
|
1238
|
+
i18n: { messages: Oe },
|
|
1218
1239
|
props: {
|
|
1219
1240
|
/**
|
|
1220
1241
|
* Defines a string value that labels an interactive element.
|
|
@@ -1270,8 +1291,8 @@ const Le = /* @__PURE__ */ j(Rt, [["render", wt], ["__scopeId", "data-v-0ca61721
|
|
|
1270
1291
|
*/
|
|
1271
1292
|
lazyLoadType: {
|
|
1272
1293
|
type: String,
|
|
1273
|
-
default:
|
|
1274
|
-
validator: (e) => Object.values(
|
|
1294
|
+
default: J.NONE,
|
|
1295
|
+
validator: (e) => Object.values(J).includes(e)
|
|
1275
1296
|
},
|
|
1276
1297
|
/**
|
|
1277
1298
|
* If enabled, the user will be able to select multiple items.
|
|
@@ -1291,7 +1312,7 @@ const Le = /* @__PURE__ */ j(Rt, [["render", wt], ["__scopeId", "data-v-0ca61721
|
|
|
1291
1312
|
*
|
|
1292
1313
|
* If enabled, hides the "Select all" checkbox in "multiple" mode.
|
|
1293
1314
|
*/
|
|
1294
|
-
searching:
|
|
1315
|
+
searching: Te.props.searching,
|
|
1295
1316
|
/**
|
|
1296
1317
|
* The `input` value.
|
|
1297
1318
|
* Providing an empty string or empty array will select no options.
|
|
@@ -1319,30 +1340,30 @@ const Le = /* @__PURE__ */ j(Rt, [["render", wt], ["__scopeId", "data-v-0ca61721
|
|
|
1319
1340
|
d.TAB
|
|
1320
1341
|
],
|
|
1321
1342
|
setup(e, { emit: t, slots: n }) {
|
|
1322
|
-
const u = N([]), s = ue(e, "items"), { t:
|
|
1343
|
+
const u = N([]), s = ue(e, "items"), { t: a } = de({ messages: Oe }), l = v(() => e.lazyLoadType !== J.AUTOMATIC), r = v(() => e.lazyLoadType === J.AUTOMATIC), c = () => {
|
|
1323
1344
|
var M;
|
|
1324
|
-
return typeof (e == null ? void 0 : e.virtualScroll) == "object" && ((M = e == null ? void 0 : e.virtualScroll) != null && M.itemHeight) ? e.virtualScroll.itemHeight :
|
|
1345
|
+
return typeof (e == null ? void 0 : e.virtualScroll) == "object" && ((M = e == null ? void 0 : e.virtualScroll) != null && M.itemHeight) ? e.virtualScroll.itemHeight : Ft;
|
|
1325
1346
|
}, {
|
|
1326
1347
|
containerRef: o,
|
|
1327
|
-
containerProps:
|
|
1348
|
+
containerProps: p,
|
|
1328
1349
|
onScroll: i,
|
|
1329
1350
|
list: b,
|
|
1330
1351
|
wrapperProps: f
|
|
1331
1352
|
} = st(s, {
|
|
1332
|
-
itemHeight:
|
|
1353
|
+
itemHeight: c(),
|
|
1333
1354
|
// Disable virtual scrolling if not enabled or if lazy loading is enabled or if multi-select
|
|
1334
1355
|
disabled: (e == null ? void 0 : e.multiple) || (e == null ? void 0 : e.virtualScroll) === !1 || (e == null ? void 0 : e.lazyLoadType) !== "none"
|
|
1335
|
-
}),
|
|
1356
|
+
}), y = v(
|
|
1336
1357
|
() => l.value ? "true" : void 0
|
|
1337
|
-
), O =
|
|
1358
|
+
), O = v(
|
|
1338
1359
|
() => l.value && e.loading ? "true" : "false"
|
|
1339
|
-
),
|
|
1360
|
+
), w = v(
|
|
1340
1361
|
() => l.value ? "polite" : void 0
|
|
1341
1362
|
), I = (M) => (oe) => {
|
|
1342
1363
|
t(M, oe);
|
|
1343
1364
|
}, D = () => {
|
|
1344
1365
|
t(d.SHOW_MORE);
|
|
1345
|
-
}, R =
|
|
1366
|
+
}, R = je(() => {
|
|
1346
1367
|
const M = o.value;
|
|
1347
1368
|
if (!M)
|
|
1348
1369
|
return;
|
|
@@ -1350,14 +1371,14 @@ const Le = /* @__PURE__ */ j(Rt, [["render", wt], ["__scopeId", "data-v-0ca61721
|
|
|
1350
1371
|
e.hasMoreItems && oe && !e.loading && D();
|
|
1351
1372
|
}), S = () => {
|
|
1352
1373
|
r.value ? R() : i();
|
|
1353
|
-
}, A =
|
|
1374
|
+
}, A = v(() => {
|
|
1354
1375
|
var M;
|
|
1355
1376
|
return e.searching && ((M = e.items) == null ? void 0 : M.length) === 0;
|
|
1356
|
-
}),
|
|
1357
|
-
() => e.lazyLoadType ===
|
|
1358
|
-
), te =
|
|
1359
|
-
() => e.loading ?
|
|
1360
|
-
), me =
|
|
1377
|
+
}), U = v(
|
|
1378
|
+
() => e.lazyLoadType === J.BUTTON && e.hasMoreItems
|
|
1379
|
+
), te = v(
|
|
1380
|
+
() => e.loading ? he.LOADING : he.START
|
|
1381
|
+
), me = v(() => e.loading ? a("loading") : a("showMore")), ce = v(() => ({
|
|
1361
1382
|
...e.emptyState,
|
|
1362
1383
|
variant: "condensed"
|
|
1363
1384
|
})), ve = {
|
|
@@ -1371,16 +1392,16 @@ const Le = /* @__PURE__ */ j(Rt, [["render", wt], ["__scopeId", "data-v-0ca61721
|
|
|
1371
1392
|
listboxRef: o,
|
|
1372
1393
|
listboxItemRef: u,
|
|
1373
1394
|
// a11y
|
|
1374
|
-
ariaAtomic:
|
|
1395
|
+
ariaAtomic: y,
|
|
1375
1396
|
ariaBusy: O,
|
|
1376
|
-
ariaLive:
|
|
1397
|
+
ariaLive: w,
|
|
1377
1398
|
// Values
|
|
1378
|
-
containerProps:
|
|
1399
|
+
containerProps: p,
|
|
1379
1400
|
isSearchResultEmpty: A,
|
|
1380
1401
|
limitedEmptyStateProps: ce,
|
|
1381
1402
|
loadingButtonState: te,
|
|
1382
1403
|
slots: n,
|
|
1383
|
-
shouldDisplayShowMoreButton:
|
|
1404
|
+
shouldDisplayShowMoreButton: U,
|
|
1384
1405
|
showMoreButtonText: me,
|
|
1385
1406
|
virtualisedItems: b,
|
|
1386
1407
|
wrapperProps: f,
|
|
@@ -1395,19 +1416,19 @@ const Le = /* @__PURE__ */ j(Rt, [["render", wt], ["__scopeId", "data-v-0ca61721
|
|
|
1395
1416
|
};
|
|
1396
1417
|
}
|
|
1397
1418
|
});
|
|
1398
|
-
const
|
|
1419
|
+
const Kt = ["id", "aria-busy", "aria-atomic", "aria-label", "aria-live"], qt = {
|
|
1399
1420
|
key: 0,
|
|
1400
1421
|
class: "b-listbox__empty-search-message"
|
|
1401
|
-
},
|
|
1422
|
+
}, Wt = {
|
|
1402
1423
|
key: 2,
|
|
1403
1424
|
class: "b-listbox__lazy-load"
|
|
1404
|
-
},
|
|
1425
|
+
}, Ht = {
|
|
1405
1426
|
key: 3,
|
|
1406
1427
|
class: "b-listbox__lazy-load"
|
|
1407
1428
|
};
|
|
1408
|
-
function
|
|
1409
|
-
const l =
|
|
1410
|
-
return ae((
|
|
1429
|
+
function jt(e, t, n, u, s, a) {
|
|
1430
|
+
const l = E("bento-empty-state"), r = E("bento-typography"), c = E("bento-listbox-multi-select"), o = E("bento-listbox-single-select"), p = E("bento-loading-button"), i = E("bento-loading-indicator"), b = _e("bento-keyboard-navigation-directive");
|
|
1431
|
+
return ae((m(), T("div", x({ id: e.id }, e.containerProps, {
|
|
1411
1432
|
class: "b-listbox",
|
|
1412
1433
|
role: "listbox",
|
|
1413
1434
|
tabindex: "-1",
|
|
@@ -1417,19 +1438,19 @@ function Yt(e, t, n, u, s, c) {
|
|
|
1417
1438
|
"aria-live": e.ariaLive,
|
|
1418
1439
|
onScroll: t[0] || (t[0] = (...f) => e.onListboxContainerScroll && e.onListboxContainerScroll(...f))
|
|
1419
1440
|
}), [
|
|
1420
|
-
|
|
1421
|
-
e.isSearchResultEmpty ? (
|
|
1422
|
-
e.emptyState ? (
|
|
1441
|
+
q("div", F(H(e.wrapperProps)), [
|
|
1442
|
+
e.isSearchResultEmpty ? (m(), T("div", qt, [
|
|
1443
|
+
e.emptyState ? (m(), B(l, F(x({ key: 0 }, e.limitedEmptyStateProps)), null, 16)) : (m(), B(r, {
|
|
1423
1444
|
key: 1,
|
|
1424
1445
|
el: "span"
|
|
1425
1446
|
}, {
|
|
1426
1447
|
default: L(() => [
|
|
1427
|
-
|
|
1448
|
+
V(P(e.noResultsMessage), 1)
|
|
1428
1449
|
]),
|
|
1429
1450
|
_: 1
|
|
1430
1451
|
}))
|
|
1431
|
-
])) : (
|
|
1432
|
-
e.multiple ? (
|
|
1452
|
+
])) : (m(), T(Q, { key: 1 }, [
|
|
1453
|
+
e.multiple ? (m(), B(c, x({
|
|
1433
1454
|
key: 0,
|
|
1434
1455
|
ref: "listboxItemRef",
|
|
1435
1456
|
"has-more-items": e.hasMoreItems,
|
|
@@ -1440,13 +1461,13 @@ function Yt(e, t, n, u, s, c) {
|
|
|
1440
1461
|
searching: e.searching,
|
|
1441
1462
|
"is-option-disabled": e.isOptionDisabled
|
|
1442
1463
|
}, le(e.listboxListeners)), ie({ _: 2 }, [
|
|
1443
|
-
z(e.slots, (f,
|
|
1444
|
-
name:
|
|
1464
|
+
z(e.slots, (f, y) => ({
|
|
1465
|
+
name: y,
|
|
1445
1466
|
fn: L((O) => [
|
|
1446
|
-
G(e.$slots,
|
|
1467
|
+
G(e.$slots, y, F(H(O)), void 0, !0)
|
|
1447
1468
|
])
|
|
1448
1469
|
}))
|
|
1449
|
-
]), 1040, ["has-more-items", "items", "lazy-load-type", "static-categories", "selected-values", "searching", "is-option-disabled"])) : (
|
|
1470
|
+
]), 1040, ["has-more-items", "items", "lazy-load-type", "static-categories", "selected-values", "searching", "is-option-disabled"])) : (m(), B(o, x({
|
|
1450
1471
|
key: 1,
|
|
1451
1472
|
ref: "listboxItemRef",
|
|
1452
1473
|
items: e.virtualisedItems,
|
|
@@ -1454,68 +1475,68 @@ function Yt(e, t, n, u, s, c) {
|
|
|
1454
1475
|
"static-categories": e.staticCategories,
|
|
1455
1476
|
"is-option-disabled": e.isOptionDisabled
|
|
1456
1477
|
}, le(e.listboxListeners)), ie({ _: 2 }, [
|
|
1457
|
-
z(e.slots, (f,
|
|
1458
|
-
name:
|
|
1478
|
+
z(e.slots, (f, y) => ({
|
|
1479
|
+
name: y,
|
|
1459
1480
|
fn: L((O) => [
|
|
1460
|
-
G(e.$slots,
|
|
1481
|
+
G(e.$slots, y, F(H(O)), void 0, !0)
|
|
1461
1482
|
])
|
|
1462
1483
|
}))
|
|
1463
1484
|
]), 1040, ["items", "selected-value", "static-categories", "is-option-disabled"])),
|
|
1464
|
-
e.shouldDisplayShowMoreButton ? (
|
|
1465
|
-
k(
|
|
1485
|
+
e.shouldDisplayShowMoreButton ? (m(), T("div", Wt, [
|
|
1486
|
+
k(p, {
|
|
1466
1487
|
state: e.loadingButtonState,
|
|
1467
1488
|
variant: "secondary",
|
|
1468
1489
|
onClickCapture: e.emitShowMore
|
|
1469
1490
|
}, {
|
|
1470
1491
|
default: L(() => [
|
|
1471
|
-
|
|
1492
|
+
V(P(e.showMoreButtonText), 1)
|
|
1472
1493
|
]),
|
|
1473
1494
|
_: 1
|
|
1474
1495
|
}, 8, ["state", "onClickCapture"])
|
|
1475
|
-
])) : e.loading ? (
|
|
1496
|
+
])) : e.loading ? (m(), T("div", Ht, [
|
|
1476
1497
|
k(i)
|
|
1477
|
-
])) :
|
|
1498
|
+
])) : K("", !0)
|
|
1478
1499
|
], 64))
|
|
1479
1500
|
], 16)
|
|
1480
|
-
], 16,
|
|
1501
|
+
], 16, Kt)), [
|
|
1481
1502
|
[b]
|
|
1482
1503
|
]);
|
|
1483
1504
|
}
|
|
1484
|
-
const
|
|
1505
|
+
const us = /* @__PURE__ */ W(Yt, [["render", jt], ["__scopeId", "data-v-f5e00d2e"]]), ye = (e, t) => {
|
|
1485
1506
|
for (const n of e) {
|
|
1486
1507
|
if (n.value === t)
|
|
1487
1508
|
return n.label;
|
|
1488
1509
|
if (n.items)
|
|
1489
|
-
return
|
|
1510
|
+
return ye(n.items, t);
|
|
1490
1511
|
}
|
|
1491
1512
|
return null;
|
|
1492
|
-
},
|
|
1493
|
-
const u = N([]), s = N(),
|
|
1494
|
-
s.value = n.value ?
|
|
1495
|
-
}, l = (
|
|
1496
|
-
u.value =
|
|
1513
|
+
}, ds = (e, t, n) => {
|
|
1514
|
+
const u = N([]), s = N(), a = (c) => {
|
|
1515
|
+
s.value = n.value ? c.map(({ value: o }) => o) : c[0].value;
|
|
1516
|
+
}, l = (c) => {
|
|
1517
|
+
u.value = c, a(c);
|
|
1497
1518
|
}, r = () => {
|
|
1498
1519
|
u.value = [], s.value = null;
|
|
1499
1520
|
};
|
|
1500
|
-
return
|
|
1521
|
+
return Ae(
|
|
1501
1522
|
() => t.value,
|
|
1502
1523
|
() => {
|
|
1503
1524
|
if (!t.value) {
|
|
1504
1525
|
r();
|
|
1505
1526
|
return;
|
|
1506
1527
|
}
|
|
1507
|
-
const
|
|
1528
|
+
const c = !Array.isArray(t.value), o = [...u.value];
|
|
1508
1529
|
r();
|
|
1509
|
-
const
|
|
1510
|
-
let b =
|
|
1511
|
-
b || (b =
|
|
1530
|
+
const p = (i) => {
|
|
1531
|
+
let b = ye(e.value, i);
|
|
1532
|
+
b || (b = ye(o, i)), b || (b = i.toString()), u.value.push({ value: i, label: b });
|
|
1512
1533
|
};
|
|
1513
|
-
if (
|
|
1534
|
+
if (c) {
|
|
1514
1535
|
const i = t.value;
|
|
1515
|
-
|
|
1536
|
+
p(i), a(u.value);
|
|
1516
1537
|
return;
|
|
1517
1538
|
}
|
|
1518
|
-
t.value.forEach(
|
|
1539
|
+
t.value.forEach(p), a(u.value);
|
|
1519
1540
|
},
|
|
1520
1541
|
{ immediate: !0 }
|
|
1521
1542
|
), {
|
|
@@ -1528,10 +1549,10 @@ const is = /* @__PURE__ */ j(Vt, [["render", Yt], ["__scopeId", "data-v-f5e00d2e
|
|
|
1528
1549
|
};
|
|
1529
1550
|
};
|
|
1530
1551
|
export {
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1552
|
+
us as B,
|
|
1553
|
+
ds as a,
|
|
1554
|
+
J as b,
|
|
1534
1555
|
d as c,
|
|
1535
|
-
|
|
1556
|
+
Pt as u
|
|
1536
1557
|
};
|
|
1537
|
-
//# sourceMappingURL=use-cached-selected-values.
|
|
1558
|
+
//# sourceMappingURL=use-cached-selected-values.3c312296.js.map
|