@adyen/bento-vue3 1.91.0 → 1.92.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 +128 -137
- package/dist/action-bar.js +1 -1
- package/dist/ai-tag.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/checkbox-group.css +1 -1
- package/dist/assets/checkbox.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown-tag.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/input-field-password.css +1 -1
- package/dist/assets/input-field-phone-number.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/secondary-nav.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/textarea.css +1 -1
- package/dist/assets/toggle.css +1 -1
- package/dist/assets/use-cached-selected-values.css +1 -1
- package/dist/button.js +1 -1
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{action-bar.BPS3wPde.js → action-bar.BxyRAZn1.js} +3 -3
- package/dist/chunks/{action-bar.BPS3wPde.js.map → action-bar.BxyRAZn1.js.map} +1 -1
- package/dist/chunks/{ai-tag.D7shWB_x.js → ai-tag.CpeZm2Yf.js} +2 -2
- package/dist/chunks/{ai-tag.D7shWB_x.js.map → ai-tag.CpeZm2Yf.js.map} +1 -1
- package/dist/chunks/{alert.CFWN2E0b.js → alert.RD0qOLhx.js} +91 -69
- package/dist/chunks/alert.RD0qOLhx.js.map +1 -0
- package/dist/chunks/{base-modal.BxcS7Pao.js → base-modal.C8Rsc2oO.js} +3 -3
- package/dist/chunks/base-modal.C8Rsc2oO.js.map +1 -0
- package/dist/chunks/{button-actions-with-menu.BKdNXYgU.js → button-actions-with-menu.KaWdHibo.js} +2 -2
- package/dist/chunks/{button-actions-with-menu.BKdNXYgU.js.map → button-actions-with-menu.KaWdHibo.js.map} +1 -1
- package/dist/chunks/{button-actions.DLiM8KZL.js → button-actions.7Oi2Ra4p.js} +87 -93
- package/dist/chunks/button-actions.7Oi2Ra4p.js.map +1 -0
- package/dist/chunks/button-actions.types.BptAXjD8.js.map +1 -1
- package/dist/chunks/button.DWF7FSIw.js.map +1 -1
- package/dist/chunks/{calendar.qm-kFNQv.js → calendar.DfMwuOIR.js} +516 -456
- package/dist/chunks/calendar.DfMwuOIR.js.map +1 -0
- package/dist/chunks/{card.BEChcEqg.js → card.7q8tTfjG.js} +2 -2
- package/dist/chunks/card.7q8tTfjG.js.map +1 -0
- package/dist/chunks/{checkbox-group.i3W8WO-7.js → checkbox-group.DawPC5Go.js} +4 -4
- package/dist/chunks/checkbox-group.DawPC5Go.js.map +1 -0
- package/dist/chunks/{checkbox.BPrymcRl.js → checkbox.CDjMTuJk.js} +20 -22
- package/dist/chunks/checkbox.CDjMTuJk.js.map +1 -0
- package/dist/chunks/{code-snippet.BG5ZmCrb.js → code-snippet.Dtb7CDv9.js} +3 -3
- package/dist/chunks/code-snippet.Dtb7CDv9.js.map +1 -0
- package/dist/chunks/constructNow.DyOJDyZZ.js +8 -0
- package/dist/chunks/{constructNow.D9uRk678.js.map → constructNow.DyOJDyZZ.js.map} +1 -1
- package/dist/chunks/country.types.6a7xxZIR.js.map +1 -1
- package/dist/chunks/{dashboard-section.C7mfUXOl.js → dashboard-section.kwKlujP-.js} +2 -2
- package/dist/chunks/{dashboard-section.C7mfUXOl.js.map → dashboard-section.kwKlujP-.js.map} +1 -1
- package/dist/chunks/{dashed-underline.B50DIXjK.js → dashed-underline.ADDEdamG.js} +2 -2
- package/dist/chunks/{dashed-underline.B50DIXjK.js.map → dashed-underline.ADDEdamG.js.map} +1 -1
- package/dist/chunks/{data-grid-template.CKdZb6EN.js → data-grid-template.C69yN3ZR.js} +2 -2
- package/dist/chunks/{data-grid-template.CKdZb6EN.js.map → data-grid-template.C69yN3ZR.js.map} +1 -1
- package/dist/chunks/{data-grid.DvMe72LK.js → data-grid._kCZlpR4.js} +464 -465
- package/dist/chunks/data-grid._kCZlpR4.js.map +1 -0
- package/dist/chunks/{date-picker.CidHad1p.js → date-picker.D08qIp2A.js} +7 -7
- package/dist/chunks/{date-picker.CidHad1p.js.map → date-picker.D08qIp2A.js.map} +1 -1
- package/dist/chunks/date-picker.types.Ckt7zxGy.js.map +1 -1
- package/dist/chunks/date-range-picker.BXzTT4AF.js +1038 -0
- package/dist/chunks/date-range-picker.BXzTT4AF.js.map +1 -0
- package/dist/chunks/date-range-picker.types.Ckt7zxGy.js.map +1 -1
- package/dist/chunks/{de.DXrHnkLX.js → de.ctR_lBqr.js} +2 -2
- package/dist/chunks/{de.DXrHnkLX.js.map → de.ctR_lBqr.js.map} +1 -1
- package/dist/chunks/{differenceInMonths.s_znQQpw.js → differenceInMonths.yz4Dfe-b.js} +13 -12
- package/dist/chunks/{differenceInMonths.s_znQQpw.js.map → differenceInMonths.yz4Dfe-b.js.map} +1 -1
- package/dist/chunks/{draggable-handle.CySRx1tb.js → draggable-handle.BWHOlabB.js} +2 -2
- package/dist/chunks/{draggable-handle.CySRx1tb.js.map → draggable-handle.BWHOlabB.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.wcJ6Mgqe.js → dropdown-tag.Sk2n9gbl.js} +6 -6
- package/dist/chunks/dropdown-tag.Sk2n9gbl.js.map +1 -0
- package/dist/chunks/{dropdown.DHoL50gV.js → dropdown.CuIBYLdy.js} +400 -396
- package/dist/chunks/dropdown.CuIBYLdy.js.map +1 -0
- package/dist/chunks/{en-GB.CBpvhDYV.js → en-GB.BsQNm5GT.js} +2 -2
- package/dist/chunks/{en-GB.CBpvhDYV.js.map → en-GB.BsQNm5GT.js.map} +1 -1
- package/dist/chunks/{en-US.CCazFVNP.js → en-US.BR6y7foR.js} +5 -5
- package/dist/chunks/{en-US.CCazFVNP.js.map → en-US.BR6y7foR.js.map} +1 -1
- package/dist/chunks/{es.CoF2PB8b.js → es.DxqH-QhP.js} +2 -2
- package/dist/chunks/{es.CoF2PB8b.js.map → es.DxqH-QhP.js.map} +1 -1
- package/dist/chunks/{file-uploader.Dbg3vfZ_.js → file-uploader.B5_l2uQO.js} +4 -5
- package/dist/chunks/{file-uploader.Dbg3vfZ_.js.map → file-uploader.B5_l2uQO.js.map} +1 -1
- package/dist/chunks/{filter-bar.Dt-cU3zy.js → filter-bar.gwDFNkp5.js} +22 -22
- package/dist/chunks/filter-bar.gwDFNkp5.js.map +1 -0
- package/dist/chunks/{footer-actions.CYBdKDPo.js → footer-actions.4Qj_I3cd.js} +2 -2
- package/dist/chunks/{footer-actions.CYBdKDPo.js.map → footer-actions.4Qj_I3cd.js.map} +1 -1
- package/dist/chunks/{form-layout-title.B3ePK3yi.js → form-layout-title.B712PesH.js} +2 -2
- package/dist/chunks/{form-layout-title.B3ePK3yi.js.map → form-layout-title.B712PesH.js.map} +1 -1
- package/dist/chunks/{fr.CJXL-Ief.js → fr.DJtn8ron.js} +2 -2
- package/dist/chunks/{fr.CJXL-Ief.js.map → fr.DJtn8ron.js.map} +1 -1
- package/dist/chunks/{header-meta.COak4D8-.js → header-meta.BJjFOcxY.js} +14 -14
- package/dist/chunks/{header-meta.COak4D8-.js.map → header-meta.BJjFOcxY.js.map} +1 -1
- package/dist/chunks/{header-with-views.DqioajcO.js → header-with-views.CMO5q6g5.js} +8 -8
- package/dist/chunks/{header-with-views.DqioajcO.js.map → header-with-views.CMO5q6g5.js.map} +1 -1
- package/dist/chunks/{header.C21yzWrk.js → header.5RQulwlL.js} +3 -3
- package/dist/chunks/header.5RQulwlL.js.map +1 -0
- package/dist/chunks/{input-field-password.DyUphhxB.js → input-field-password.DWR0liBW.js} +5 -5
- package/dist/chunks/input-field-password.DWR0liBW.js.map +1 -0
- package/dist/chunks/{input-field-phone-number.BXVaC5ra.js → input-field-phone-number.ByjukCrO.js} +4 -4
- package/dist/chunks/{input-field-phone-number.BXVaC5ra.js.map → input-field-phone-number.ByjukCrO.js.map} +1 -1
- package/dist/chunks/{input-field.DkUFvIWt.js → input-field.FkzBZDWS.js} +141 -130
- package/dist/chunks/input-field.FkzBZDWS.js.map +1 -0
- package/dist/chunks/{input-time.WI_qdwJc.js → input-time.DlvANG4O.js} +4 -4
- package/dist/chunks/{input-time.WI_qdwJc.js.map → input-time.DlvANG4O.js.map} +1 -1
- package/dist/chunks/isSameWeek.CieN9XgL.js +14 -0
- package/dist/chunks/{isSameWeek.Dj6luS8h.js.map → isSameWeek.CieN9XgL.js.map} +1 -1
- package/dist/chunks/{it.20Y7h-bF.js → it.keS7oN5l.js} +3 -3
- package/dist/chunks/{it.20Y7h-bF.js.map → it.keS7oN5l.js.map} +1 -1
- package/dist/chunks/{ja.DXlq0H98.js → ja.cLwacUE6.js} +2 -2
- package/dist/chunks/{ja.DXlq0H98.js.map → ja.cLwacUE6.js.map} +1 -1
- package/dist/chunks/link.D6D6YGsN.js.map +1 -1
- package/dist/chunks/{modal-fullscreen.c6QphYQo.js → modal-fullscreen.CepaWyoi.js} +2 -2
- package/dist/chunks/{modal-fullscreen.c6QphYQo.js.map → modal-fullscreen.CepaWyoi.js.map} +1 -1
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.ImqHKH-g.js → modal.vue_vue_type_script_setup_true_lang.BW9Ff59H.js} +49 -47
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.ImqHKH-g.js.map → modal.vue_vue_type_script_setup_true_lang.BW9Ff59H.js.map} +1 -1
- package/dist/chunks/{pagination.Cu85Lqms.js → pagination.Ch_Occwt.js} +2 -2
- package/dist/chunks/{pagination.Cu85Lqms.js.map → pagination.Ch_Occwt.js.map} +1 -1
- package/dist/chunks/payment-method.types.BqtH7RM2.js.map +1 -1
- package/dist/chunks/popover.types.D8tHtFl3.js.map +1 -1
- package/dist/chunks/popper-container.DMN8n5iC.js.map +1 -1
- package/dist/chunks/promo-banner.-H4r_cwj.js.map +1 -1
- package/dist/chunks/{pt-BR.DmhmCzxE.js → pt-BR.ChPOra5s.js} +2 -2
- package/dist/chunks/{pt-BR.DmhmCzxE.js.map → pt-BR.ChPOra5s.js.map} +1 -1
- package/dist/chunks/radio-group.CfMr1fmW.js.map +1 -1
- package/dist/chunks/{rich-text-editor.Bf9EWzNk.js → rich-text-editor.mxbLaG6q.js} +3 -3
- package/dist/chunks/{rich-text-editor.Bf9EWzNk.js.map → rich-text-editor.mxbLaG6q.js.map} +1 -1
- package/dist/chunks/{search-bar.p6kHCCvT.js → search-bar.JDkxJGjF.js} +4 -4
- package/dist/chunks/{search-bar.p6kHCCvT.js.map → search-bar.JDkxJGjF.js.map} +1 -1
- package/dist/chunks/{secondary-nav.CaxiyVaO.js → secondary-nav.CROQNbYk.js} +2 -2
- package/dist/chunks/{secondary-nav.CaxiyVaO.js.map → secondary-nav.CROQNbYk.js.map} +1 -1
- package/dist/chunks/segmented-control.types.BHRLV8KU.js.map +1 -1
- package/dist/chunks/{selection-card-group.58XZj_SJ.js → selection-card-group.DJ6FFvsA.js} +9 -9
- package/dist/chunks/{selection-card-group.58XZj_SJ.js.map → selection-card-group.DJ6FFvsA.js.map} +1 -1
- package/dist/chunks/{sidepanel.CAVhSs-O.js → sidepanel.S037xghX.js} +3 -3
- package/dist/chunks/{sidepanel.CAVhSs-O.js.map → sidepanel.S037xghX.js.map} +1 -1
- package/dist/chunks/{startOfWeek.Cvmo-f5J.js → startOfWeek.muMEhS7U.js} +2 -2
- package/dist/chunks/{startOfWeek.Cvmo-f5J.js.map → startOfWeek.muMEhS7U.js.map} +1 -1
- package/dist/chunks/status.types.Dx8MDhEH.js.map +1 -1
- package/dist/chunks/{summary-grid.types.CDithi8M.js → summary-grid.types.D1JQ_jtv.js} +2 -2
- package/dist/chunks/{summary-grid.types.CDithi8M.js.map → summary-grid.types.D1JQ_jtv.js.map} +1 -1
- package/dist/chunks/tag.YN2r-Pp3.js.map +1 -1
- package/dist/chunks/{textarea.JGXAlpx9.js → textarea.-6FHesSp.js} +2 -2
- package/dist/chunks/textarea.-6FHesSp.js.map +1 -0
- package/dist/chunks/{timeline-item.BNFPpQz1.js → timeline-item.BJaFr2_Y.js} +5 -5
- package/dist/chunks/timeline-item.BJaFr2_Y.js.map +1 -0
- package/dist/chunks/{toggle.BQoprdX-.js → toggle.BdcgY15I.js} +3 -5
- package/dist/chunks/toggle.BdcgY15I.js.map +1 -0
- package/dist/chunks/tooltip.DHfG2aRt.js.map +1 -1
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.C1cF-adv.js → tutorial.vue_vue_type_script_setup_true_lang.D_Z1zKam.js} +2 -2
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.C1cF-adv.js.map → tutorial.vue_vue_type_script_setup_true_lang.D_Z1zKam.js.map} +1 -1
- package/dist/chunks/typography.B3J6_tYk.js.map +1 -1
- package/dist/chunks/use-cached-selected-values.DUWGSMvO.js +1740 -0
- package/dist/chunks/use-cached-selected-values.DUWGSMvO.js.map +1 -0
- package/dist/chunks/{use-date-input-formatter.BOuXpRb-.js → use-date-input-formatter.BH4hdEJW.js} +4 -4
- package/dist/chunks/{use-date-input-formatter.BOuXpRb-.js.map → use-date-input-formatter.BH4hdEJW.js.map} +1 -1
- package/dist/chunks/{zh-CN.Ce34mXsX.js → zh-CN.ZG6obniO.js} +3 -3
- package/dist/chunks/{zh-CN.Ce34mXsX.js.map → zh-CN.ZG6obniO.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/dashboard-template.js +1 -1
- package/dist/dashed-underline.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/draggable.js +1 -1
- package/dist/dropdown.js +3 -3
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/form-layout.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +42 -42
- package/dist/index.js.map +1 -1
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/input-time.js +1 -1
- package/dist/internal.js +5 -5
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/pagination.js +1 -1
- package/dist/popover.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/sidepanel.js +1 -1
- package/dist/summary-grid.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/toggle.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +5 -5
- package/dist/chunks/alert.CFWN2E0b.js.map +0 -1
- package/dist/chunks/base-modal.BxcS7Pao.js.map +0 -1
- package/dist/chunks/button-actions.DLiM8KZL.js.map +0 -1
- package/dist/chunks/calendar.qm-kFNQv.js.map +0 -1
- package/dist/chunks/card.BEChcEqg.js.map +0 -1
- package/dist/chunks/checkbox-group.i3W8WO-7.js.map +0 -1
- package/dist/chunks/checkbox.BPrymcRl.js.map +0 -1
- package/dist/chunks/code-snippet.BG5ZmCrb.js.map +0 -1
- package/dist/chunks/constructNow.D9uRk678.js +0 -8
- package/dist/chunks/data-grid.DvMe72LK.js.map +0 -1
- package/dist/chunks/date-range-picker.c5OwESTS.js +0 -1027
- package/dist/chunks/date-range-picker.c5OwESTS.js.map +0 -1
- package/dist/chunks/dropdown-tag.wcJ6Mgqe.js.map +0 -1
- package/dist/chunks/dropdown.DHoL50gV.js.map +0 -1
- package/dist/chunks/filter-bar.Dt-cU3zy.js.map +0 -1
- package/dist/chunks/header.C21yzWrk.js.map +0 -1
- package/dist/chunks/input-field-password.DyUphhxB.js.map +0 -1
- package/dist/chunks/input-field.DkUFvIWt.js.map +0 -1
- package/dist/chunks/isSameWeek.Dj6luS8h.js +0 -14
- package/dist/chunks/textarea.JGXAlpx9.js.map +0 -1
- package/dist/chunks/timeline-item.BNFPpQz1.js.map +0 -1
- package/dist/chunks/toggle.BQoprdX-.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.Bx8uuky9.js +0 -1657
- package/dist/chunks/use-cached-selected-values.Bx8uuky9.js.map +0 -1
- package/dist/chunks/warning-filled.BzyK_mMj.js +0 -29
- package/dist/chunks/warning-filled.BzyK_mMj.js.map +0 -1
|
@@ -1,1657 +0,0 @@
|
|
|
1
|
-
import { computed as b, ref as I, onMounted as ut, onUnmounted as bt, watch as fe, defineComponent as J, resolveComponent as _, openBlock as d, createElementBlock as y, createVNode as N, withCtx as L, createTextVNode as K, toDisplayString as V, createElementVNode as G, renderSlot as W, mergeProps as w, withKeys as be, createCommentVNode as q, createBlock as A, withModifiers as ae, normalizeProps as oe, guardReactiveProps as me, withDirectives as ne, vShow as ze, nextTick as Ye, toRef as pe, resolveDirective as Ue, toHandlers as ee, Fragment as te, renderList as j, createSlots as ge, normalizeClass as ve, unref as B, useSlots as mt, useAttrs as pt } from "vue";
|
|
2
|
-
import { B as F, a as he } from "./keyboard-navigation.DWmhelVv.js";
|
|
3
|
-
import { B as ie } from "./typography.B3J6_tYk.js";
|
|
4
|
-
import { B as gt } from "./loading-indicator.BPol9I84.js";
|
|
5
|
-
import { B as vt } from "./empty-state.DT4sFyjB.js";
|
|
6
|
-
import { u as _e } from "./index.B875RXHM.js";
|
|
7
|
-
import { C as Se, N as ft } from "./minus-small.CnYLTuSv.js";
|
|
8
|
-
import { C as yt } from "./checkmark-small.CRuZauJc.js";
|
|
9
|
-
/* empty css */
|
|
10
|
-
import { _ as H } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
11
|
-
import { B as St } from "./chip.DFldnqfz.js";
|
|
12
|
-
import { C as ht } from "./chevron-down.XeE-LBV_.js";
|
|
13
|
-
import { C as Ct } from "./chevron-up.Cmgl2a3x.js";
|
|
14
|
-
import { g as Me } from "./generate-uid.DBWe4g6T.js";
|
|
15
|
-
import { a as Et, b as Pe } from "./button-actions.DLiM8KZL.js";
|
|
16
|
-
import { o as Ot } from "./resize.Bqks3WUm.js";
|
|
17
|
-
import "../assets/use-cached-selected-values.css";
|
|
18
|
-
const Fe = (e, t, o, s) => {
|
|
19
|
-
const i = b(
|
|
20
|
-
() => !!e.value?.length && e.value?.length === t.value.length
|
|
21
|
-
), r = b(() => e.value == null || e.value.length === 0 ? !1 : e.value?.length !== t.value.length);
|
|
22
|
-
return {
|
|
23
|
-
isAllSelected: i,
|
|
24
|
-
isIndeterminate: r,
|
|
25
|
-
toggleSelectAll: (f) => {
|
|
26
|
-
f ? o() : s();
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
function Tt(e, { disabled: t, itemHeight: o, overscan: s = 5, prefixHeight: i }) {
|
|
31
|
-
const r = I(null), a = I([]), f = I(0), S = I(0), n = I(0);
|
|
32
|
-
let u;
|
|
33
|
-
const l = b(() => {
|
|
34
|
-
const k = typeof o == "number" ? e.value.length * o : e.value.reduce((T, O, D) => T + o(D), 0), $ = typeof o == "number" ? f.value * o : e.value.slice(0, f.value).reduce((T, O, D) => T + o(D), 0);
|
|
35
|
-
return {
|
|
36
|
-
style: {
|
|
37
|
-
marginTop: `${$}px`,
|
|
38
|
-
height: `${k - $}px`
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
}), m = () => {
|
|
42
|
-
const k = i?.value ?? 0, $ = Math.max(r.value.scrollTop - k, 0);
|
|
43
|
-
if (typeof o == "number")
|
|
44
|
-
return Math.floor($ / o);
|
|
45
|
-
let T = 0, O = 0;
|
|
46
|
-
for (let D = 0; D < e.value.length; D += 1) {
|
|
47
|
-
const z = o(D);
|
|
48
|
-
if (T += z, T >= $) {
|
|
49
|
-
O = D;
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return O;
|
|
54
|
-
}, C = () => {
|
|
55
|
-
if (n.value = r.value.clientHeight, typeof o == "number")
|
|
56
|
-
return Math.ceil(n.value / o);
|
|
57
|
-
const k = f.value ?? 0;
|
|
58
|
-
let $ = 0, T = 0;
|
|
59
|
-
for (let O = k; O < e.value.length; O += 1) {
|
|
60
|
-
const D = o(O);
|
|
61
|
-
if ($ += D, T = O, $ > n.value)
|
|
62
|
-
break;
|
|
63
|
-
}
|
|
64
|
-
return T - k;
|
|
65
|
-
}, h = () => {
|
|
66
|
-
if (r.value) {
|
|
67
|
-
const k = C();
|
|
68
|
-
f.value = m(), S.value = Math.min(f.value + k + s, e.value.length), a.value = e.value.slice(f.value, S.value);
|
|
69
|
-
}
|
|
70
|
-
}, R = () => {
|
|
71
|
-
h();
|
|
72
|
-
};
|
|
73
|
-
t || (ut(() => {
|
|
74
|
-
r.value && (n.value = r.value.clientHeight, u = Ot(r.value, ({ clientHeight: k }) => {
|
|
75
|
-
n.value = k, h();
|
|
76
|
-
}), h());
|
|
77
|
-
}), bt(() => {
|
|
78
|
-
u?.disconnect();
|
|
79
|
-
}), fe(
|
|
80
|
-
() => e.value,
|
|
81
|
-
() => {
|
|
82
|
-
h();
|
|
83
|
-
}
|
|
84
|
-
));
|
|
85
|
-
const x = {
|
|
86
|
-
ref: r,
|
|
87
|
-
style: { overflowY: "auto" }
|
|
88
|
-
};
|
|
89
|
-
return t ? {
|
|
90
|
-
containerRef: r,
|
|
91
|
-
containerProps: x,
|
|
92
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
93
|
-
onScroll: () => {
|
|
94
|
-
},
|
|
95
|
-
list: e
|
|
96
|
-
} : {
|
|
97
|
-
containerRef: r,
|
|
98
|
-
containerProps: x,
|
|
99
|
-
onScroll: R,
|
|
100
|
-
list: a,
|
|
101
|
-
wrapperProps: l
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
var p = /* @__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))(p || {}), le = /* @__PURE__ */ ((e) => (e.AUTOMATIC = "automatic", e.BUTTON = "button", e.NONE = "none", e))(le || {});
|
|
105
|
-
const Lt = J({
|
|
106
|
-
name: "bento-listbox-static-category",
|
|
107
|
-
components: {
|
|
108
|
-
BentoTypography: ie
|
|
109
|
-
},
|
|
110
|
-
props: {
|
|
111
|
-
/**
|
|
112
|
-
* Category label text
|
|
113
|
-
*/
|
|
114
|
-
categoryLabel: {
|
|
115
|
-
type: String,
|
|
116
|
-
required: !0
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}), It = ["aria-label"];
|
|
120
|
-
function _t(e, t, o, s, i, r) {
|
|
121
|
-
const a = _("bento-typography");
|
|
122
|
-
return d(), y("div", {
|
|
123
|
-
class: "b-listbox-single-select-category",
|
|
124
|
-
role: "group",
|
|
125
|
-
"aria-label": e.categoryLabel
|
|
126
|
-
}, [
|
|
127
|
-
N(a, {
|
|
128
|
-
variant: "caption",
|
|
129
|
-
el: "span",
|
|
130
|
-
class: "b-listbox-single-select-category__label-text",
|
|
131
|
-
"aria-hidden": "true"
|
|
132
|
-
}, {
|
|
133
|
-
default: L(() => [
|
|
134
|
-
K(V(e.categoryLabel), 1)
|
|
135
|
-
]),
|
|
136
|
-
_: 1
|
|
137
|
-
}),
|
|
138
|
-
G("div", null, [
|
|
139
|
-
W(e.$slots, "default", {}, void 0, !0)
|
|
140
|
-
])
|
|
141
|
-
], 8, It);
|
|
142
|
-
}
|
|
143
|
-
const At = /* @__PURE__ */ H(Lt, [["render", _t], ["__scopeId", "data-v-27c4e09a"]]), kt = J({
|
|
144
|
-
name: "bento-listbox-option",
|
|
145
|
-
props: {
|
|
146
|
-
/**
|
|
147
|
-
* Setting this property to true will disable the option.
|
|
148
|
-
*/
|
|
149
|
-
disabled: { type: Boolean, default: !1 },
|
|
150
|
-
/**
|
|
151
|
-
* Indicates if the value is selected. Only one element can be selected at a time.
|
|
152
|
-
*/
|
|
153
|
-
selected: { type: Boolean, default: !1 }
|
|
154
|
-
},
|
|
155
|
-
emits: [p.CLICK, p.ENTER, p.SPACE, p.TAB],
|
|
156
|
-
setup(e, { emit: t }) {
|
|
157
|
-
const o = b(() => ({
|
|
158
|
-
"b-listbox-option--disabled": e.disabled,
|
|
159
|
-
"b-listbox-option--selected": e.selected
|
|
160
|
-
}));
|
|
161
|
-
return {
|
|
162
|
-
// Enums
|
|
163
|
-
BentoKeyboardNavigationKeyDownEvent: F,
|
|
164
|
-
BentoListboxEvent: p,
|
|
165
|
-
// Values
|
|
166
|
-
conditionalClasses: o,
|
|
167
|
-
// Events
|
|
168
|
-
onClick: (r) => {
|
|
169
|
-
t(p.CLICK, r);
|
|
170
|
-
},
|
|
171
|
-
onOptionSelected: (r, a) => {
|
|
172
|
-
t(r, a);
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
function $t(e, t, o, s, i, r) {
|
|
178
|
-
return d(), y("div", w({
|
|
179
|
-
class: ["b-listbox-option", e.conditionalClasses],
|
|
180
|
-
role: "option"
|
|
181
|
-
}, e.$attrs, {
|
|
182
|
-
onClick: t[0] || (t[0] = (...a) => e.onClick && e.onClick(...a)),
|
|
183
|
-
onKeydown: [
|
|
184
|
-
t[1] || (t[1] = be((a) => e.onOptionSelected(e.BentoListboxEvent.ENTER, a), ["enter"])),
|
|
185
|
-
t[2] || (t[2] = be((a) => e.onOptionSelected(e.BentoListboxEvent.SPACE, a), ["space"])),
|
|
186
|
-
t[3] || (t[3] = be((a) => e.onOptionSelected(e.BentoListboxEvent.TAB, a), ["tab"]))
|
|
187
|
-
]
|
|
188
|
-
}), [
|
|
189
|
-
W(e.$slots, "default", {}, void 0, !0)
|
|
190
|
-
], 16);
|
|
191
|
-
}
|
|
192
|
-
const Ce = /* @__PURE__ */ H(kt, [["render", $t], ["__scopeId", "data-v-1495b1db"]]);
|
|
193
|
-
let Ne = 0;
|
|
194
|
-
const Dt = {
|
|
195
|
-
beforeCreate() {
|
|
196
|
-
this.uuid = Ne.toString(), Ne += 1;
|
|
197
|
-
}
|
|
198
|
-
}, Bt = { key: 0 };
|
|
199
|
-
function Rt(e, t, o, s, i, r) {
|
|
200
|
-
return d(), y("svg", w({ role: "img" }, e.$attrs, {
|
|
201
|
-
class: "ui-assets-icons-16",
|
|
202
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
203
|
-
width: "16",
|
|
204
|
-
height: "16",
|
|
205
|
-
fill: "none"
|
|
206
|
-
}), [
|
|
207
|
-
e.$attrs["svg-title"] ? (d(), y("title", Bt, V(e.$attrs["svg-title"]), 1)) : q("", !0),
|
|
208
|
-
t[0] || (t[0] = G("path", {
|
|
209
|
-
fill: "#001222",
|
|
210
|
-
d: "M15.0608 4.00011L14.0001 2.93945L6.00011 10.9395L2.00011 6.93945L0.939453 8.00011L6.00011 13.0608L15.0608 4.00011Z"
|
|
211
|
-
}, null, -1))
|
|
212
|
-
], 16);
|
|
213
|
-
}
|
|
214
|
-
const Mt = /* @__PURE__ */ H(Dt, [["render", Rt]]), Pt = J({
|
|
215
|
-
name: "bento-listbox-single-select-option",
|
|
216
|
-
components: {
|
|
217
|
-
BentoListboxOption: Ce,
|
|
218
|
-
BentoTypography: ie,
|
|
219
|
-
CheckmarkIcon: Mt
|
|
220
|
-
},
|
|
221
|
-
props: {
|
|
222
|
-
/**
|
|
223
|
-
* Setting this property to true will disable the option.
|
|
224
|
-
*/
|
|
225
|
-
disabled: { type: Boolean, default: !1 },
|
|
226
|
-
/**
|
|
227
|
-
* The option item that contains all the option item's data.
|
|
228
|
-
* @type {BentoListboxOptionItem}
|
|
229
|
-
*/
|
|
230
|
-
option: {
|
|
231
|
-
type: Object,
|
|
232
|
-
required: !0
|
|
233
|
-
},
|
|
234
|
-
/**
|
|
235
|
-
* Indicates if the value is selected. Only one element can be selected at a time.
|
|
236
|
-
*/
|
|
237
|
-
selected: { type: Boolean, default: !1 }
|
|
238
|
-
},
|
|
239
|
-
emits: [p.ENTER, p.SELECT, p.SPACE, p.TAB],
|
|
240
|
-
setup(e, { emit: t }) {
|
|
241
|
-
const o = (a) => {
|
|
242
|
-
e.disabled || t(a, e.option);
|
|
243
|
-
}, s = b(() => e.disabled ? !0 : null), i = b(() => e.selected ? !0 : null), r = b(() => e.disabled ? -1 : 0);
|
|
244
|
-
return {
|
|
245
|
-
// Values
|
|
246
|
-
ariaDisabled: s,
|
|
247
|
-
ariaSelected: i,
|
|
248
|
-
tabIndex: r,
|
|
249
|
-
// Enums
|
|
250
|
-
BentoListboxEvent: p,
|
|
251
|
-
// Events
|
|
252
|
-
onOptionSelected: o
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
}), Nt = { class: "b-listbox-single-select-option__text" }, wt = { class: "b-listbox-single-select-option__check-icon" };
|
|
256
|
-
function Gt(e, t, o, s, i, r) {
|
|
257
|
-
const a = _("bento-typography"), f = _("checkmark-icon"), S = _("bento-listbox-option");
|
|
258
|
-
return d(), A(S, {
|
|
259
|
-
class: "b-listbox-single-select-option",
|
|
260
|
-
disabled: e.disabled,
|
|
261
|
-
selected: e.selected,
|
|
262
|
-
"aria-selected": e.ariaSelected,
|
|
263
|
-
"aria-disabled": e.ariaDisabled,
|
|
264
|
-
tabindex: e.tabIndex,
|
|
265
|
-
onClick: t[0] || (t[0] = (n) => e.onOptionSelected(e.BentoListboxEvent.SELECT)),
|
|
266
|
-
onEnterPressed: t[1] || (t[1] = (n) => e.onOptionSelected(e.BentoListboxEvent.ENTER)),
|
|
267
|
-
onSpacePressed: t[2] || (t[2] = ae((n) => e.onOptionSelected(e.BentoListboxEvent.SPACE), ["prevent"])),
|
|
268
|
-
onTabPressed: t[3] || (t[3] = (n) => e.onOptionSelected(e.BentoListboxEvent.TAB))
|
|
269
|
-
}, {
|
|
270
|
-
default: L(() => [
|
|
271
|
-
W(e.$slots, "default", oe(me(e.option)), () => [
|
|
272
|
-
G("span", Nt, [
|
|
273
|
-
N(a, { el: "span" }, {
|
|
274
|
-
default: L(() => [
|
|
275
|
-
K(V(e.option.label), 1)
|
|
276
|
-
]),
|
|
277
|
-
_: 1
|
|
278
|
-
}),
|
|
279
|
-
e.option.description ? (d(), A(a, {
|
|
280
|
-
key: 0,
|
|
281
|
-
class: "b-listbox-single-select-option__description",
|
|
282
|
-
el: "span"
|
|
283
|
-
}, {
|
|
284
|
-
default: L(() => [
|
|
285
|
-
K(V(e.option.description), 1)
|
|
286
|
-
]),
|
|
287
|
-
_: 1
|
|
288
|
-
})) : q("", !0)
|
|
289
|
-
])
|
|
290
|
-
], !0),
|
|
291
|
-
G("span", wt, [
|
|
292
|
-
ne(N(f, { "svg-title": "selected" }, null, 512), [
|
|
293
|
-
[ze, e.selected]
|
|
294
|
-
])
|
|
295
|
-
])
|
|
296
|
-
]),
|
|
297
|
-
_: 3
|
|
298
|
-
}, 8, ["disabled", "selected", "aria-selected", "aria-disabled", "tabindex"]);
|
|
299
|
-
}
|
|
300
|
-
const xt = /* @__PURE__ */ H(Pt, [["render", Gt], ["__scopeId", "data-v-4f41af07"]]), Ke = ({ items: e }, t) => {
|
|
301
|
-
const o = b(() => e.value.length - 1), s = I(0), i = (m) => {
|
|
302
|
-
switch (m) {
|
|
303
|
-
case "increase":
|
|
304
|
-
s.value += 1;
|
|
305
|
-
break;
|
|
306
|
-
case "decrease":
|
|
307
|
-
s.value -= 1;
|
|
308
|
-
break;
|
|
309
|
-
}
|
|
310
|
-
}, r = ({ edgeCaseItem: m }, C) => {
|
|
311
|
-
s.value !== m && (i(C), t(s.value));
|
|
312
|
-
}, a = (m) => {
|
|
313
|
-
l(m), r(
|
|
314
|
-
{
|
|
315
|
-
edgeCaseItem: o.value
|
|
316
|
-
},
|
|
317
|
-
"increase"
|
|
318
|
-
/* INCREASE */
|
|
319
|
-
);
|
|
320
|
-
}, f = (m) => {
|
|
321
|
-
l(m), r(
|
|
322
|
-
{
|
|
323
|
-
edgeCaseItem: 0
|
|
324
|
-
},
|
|
325
|
-
"decrease"
|
|
326
|
-
/* DECREASE */
|
|
327
|
-
);
|
|
328
|
-
}, S = () => {
|
|
329
|
-
s.value = 0, t(s.value);
|
|
330
|
-
}, n = () => {
|
|
331
|
-
s.value = o.value, t(s.value);
|
|
332
|
-
}, u = (m) => {
|
|
333
|
-
s.value = m;
|
|
334
|
-
}, l = (m) => {
|
|
335
|
-
m?.detail?.preventDefault();
|
|
336
|
-
};
|
|
337
|
-
return {
|
|
338
|
-
moveToFirstElement: S,
|
|
339
|
-
moveToLastElement: n,
|
|
340
|
-
moveToNextElement: a,
|
|
341
|
-
moveToPreviousElement: f,
|
|
342
|
-
setListboxFocusedIndex: u,
|
|
343
|
-
preventDefault: l,
|
|
344
|
-
focusedIndex: s
|
|
345
|
-
};
|
|
346
|
-
}, We = (e, t, o = I("option"), s = !0) => {
|
|
347
|
-
const i = I([]), r = async () => {
|
|
348
|
-
if (!e.value || e.value.nodeType === Node.COMMENT_NODE)
|
|
349
|
-
return;
|
|
350
|
-
const a = Array.from(e.value.querySelectorAll(`[role="${o.value}"]`));
|
|
351
|
-
i.value = s ? a.filter((f) => f.checkVisibility()) : a;
|
|
352
|
-
};
|
|
353
|
-
return fe(
|
|
354
|
-
t,
|
|
355
|
-
() => {
|
|
356
|
-
Ye(() => {
|
|
357
|
-
r();
|
|
358
|
-
});
|
|
359
|
-
},
|
|
360
|
-
{ immediate: !0 }
|
|
361
|
-
), {
|
|
362
|
-
visibleDomOptions: i,
|
|
363
|
-
updateVisibleDomOptions: r
|
|
364
|
-
};
|
|
365
|
-
}, Vt = J({
|
|
366
|
-
name: "bento-listbox-single-select",
|
|
367
|
-
components: {
|
|
368
|
-
BentoListboxSingleSelectCategory: At,
|
|
369
|
-
BentoListboxSingleSelectOption: xt
|
|
370
|
-
},
|
|
371
|
-
directives: { BentoKeyboardNavigationDirective: he },
|
|
372
|
-
inheritAttrs: !1,
|
|
373
|
-
props: {
|
|
374
|
-
/**
|
|
375
|
-
* Function that allows the options to be disabled
|
|
376
|
-
*
|
|
377
|
-
* @type {BentoListboxIsOptionDisabled}
|
|
378
|
-
* @param {BentoListboxOptionItem} option - listbox option object
|
|
379
|
-
* @param {string} option.label - Option's label text
|
|
380
|
-
* @param {string|number} option.value - Option's value
|
|
381
|
-
* @param {unknown} option.data - Option's extra data to be passed to the default slot
|
|
382
|
-
*/
|
|
383
|
-
isOptionDisabled: {
|
|
384
|
-
type: Function,
|
|
385
|
-
default: () => !1
|
|
386
|
-
},
|
|
387
|
-
/**
|
|
388
|
-
* The option elements to populate the listbox with.
|
|
389
|
-
* It must be an array of {@see BentoListboxOptionItem }.
|
|
390
|
-
*
|
|
391
|
-
* @property {string} value.label - Text to be displayed in the option
|
|
392
|
-
* @property {string,number} value.value - Value of the option
|
|
393
|
-
*/
|
|
394
|
-
items: {
|
|
395
|
-
type: Array,
|
|
396
|
-
required: !0
|
|
397
|
-
},
|
|
398
|
-
/**
|
|
399
|
-
* The `input` value.
|
|
400
|
-
* Providing an empty string will select no options.
|
|
401
|
-
* Set to an empty string `''` if you don't want any of the available options to be selected
|
|
402
|
-
*/
|
|
403
|
-
selectedValue: {
|
|
404
|
-
type: Array,
|
|
405
|
-
default: void 0
|
|
406
|
-
},
|
|
407
|
-
/**
|
|
408
|
-
* If enabled, dropdown will display non-selectable, static categories
|
|
409
|
-
*/
|
|
410
|
-
staticCategories: { type: Boolean, default: !1 }
|
|
411
|
-
},
|
|
412
|
-
emits: [p.SELECT, p.ENTER, p.SPACE, p.TAB],
|
|
413
|
-
setup(e, { emit: t, expose: o, slots: s, attrs: i }) {
|
|
414
|
-
const r = I(null), a = I([]), f = b(() => !!e.selectedValue?.length && e.selectedValue.at(0)), S = b(
|
|
415
|
-
() => ({
|
|
416
|
-
"aria-label": i["aria-label"]?.toString(),
|
|
417
|
-
"aria-busy": i["aria-busy"]?.toString(),
|
|
418
|
-
"aria-atomic": i["aria-atomic"]?.toString(),
|
|
419
|
-
"aria-live": i["aria-live"]?.toString()
|
|
420
|
-
})
|
|
421
|
-
), n = b(() => !!e.items.some(({ items: O }) => !!O)), u = (O) => (D) => {
|
|
422
|
-
t(O, [D]);
|
|
423
|
-
}, { visibleDomOptions: l } = We(r, pe(e, "items"), I("option"), !1), m = (O) => {
|
|
424
|
-
l.value[O]?.focus();
|
|
425
|
-
}, {
|
|
426
|
-
moveToNextElement: C,
|
|
427
|
-
moveToPreviousElement: h,
|
|
428
|
-
moveToFirstElement: R,
|
|
429
|
-
moveToLastElement: x,
|
|
430
|
-
setListboxFocusedIndex: k
|
|
431
|
-
} = Ke(
|
|
432
|
-
{
|
|
433
|
-
items: l
|
|
434
|
-
},
|
|
435
|
-
m
|
|
436
|
-
), $ = {
|
|
437
|
-
[F.ARROW_UP]: h,
|
|
438
|
-
[F.ARROW_DOWN]: C,
|
|
439
|
-
[F.HOME]: R,
|
|
440
|
-
[F.END]: x
|
|
441
|
-
}, T = {
|
|
442
|
-
[p.SELECT]: u(p.SELECT),
|
|
443
|
-
[p.SPACE]: u(p.SPACE),
|
|
444
|
-
[p.TAB]: u(p.TAB),
|
|
445
|
-
[p.ENTER]: u(p.ENTER)
|
|
446
|
-
};
|
|
447
|
-
return o({
|
|
448
|
-
/**
|
|
449
|
-
* Reference for a single listbox item.
|
|
450
|
-
* Required for keyboard navigation in dropdown as $children is removed in vue@3
|
|
451
|
-
*/
|
|
452
|
-
listboxItemRef: a,
|
|
453
|
-
/**
|
|
454
|
-
* Method to set the index of the item to be focused on
|
|
455
|
-
* Used for focus management to be kept in-sync with parent e.g. dropdowns
|
|
456
|
-
*/
|
|
457
|
-
setListboxFocusedIndex: k
|
|
458
|
-
}), {
|
|
459
|
-
// Enums
|
|
460
|
-
BentoListboxEvent: p,
|
|
461
|
-
// Values
|
|
462
|
-
listboxRef: r,
|
|
463
|
-
listboxItemRef: a,
|
|
464
|
-
selectedItem: f,
|
|
465
|
-
slots: s,
|
|
466
|
-
ariaAttributes: S,
|
|
467
|
-
// Computed
|
|
468
|
-
hasCategories: n,
|
|
469
|
-
// Methods
|
|
470
|
-
onOptionSelected: u,
|
|
471
|
-
// Keyboard navigation
|
|
472
|
-
listboxListeners: $,
|
|
473
|
-
listboxOptionListeners: T
|
|
474
|
-
};
|
|
475
|
-
}
|
|
476
|
-
});
|
|
477
|
-
function zt(e, t, o, s, i, r) {
|
|
478
|
-
const a = _("bento-listbox-single-select-option"), f = _("bento-listbox-single-select-category"), S = Ue("bento-keyboard-navigation-directive");
|
|
479
|
-
return ne((d(), y("div", w({ ref: "listboxRef" }, e.ariaAttributes, { role: "listbox" }, ee(e.listboxListeners, !0)), [
|
|
480
|
-
e.hasCategories && e.staticCategories ? (d(!0), y(te, { key: 0 }, j(e.items, (n) => (d(), A(f, {
|
|
481
|
-
key: n.value,
|
|
482
|
-
"category-label": n.label
|
|
483
|
-
}, {
|
|
484
|
-
default: L(() => [
|
|
485
|
-
(d(!0), y(te, null, j(n.items, (u) => (d(), A(a, w({
|
|
486
|
-
key: u.value,
|
|
487
|
-
ref_for: !0,
|
|
488
|
-
ref: "listboxItemRef",
|
|
489
|
-
role: "option",
|
|
490
|
-
option: u,
|
|
491
|
-
disabled: e.isOptionDisabled ? e.isOptionDisabled(u) : null,
|
|
492
|
-
selected: u.value === e.selectedItem.value
|
|
493
|
-
}, ee(e.listboxOptionListeners)), ge({ _: 2 }, [
|
|
494
|
-
j(e.slots, (l, m) => ({
|
|
495
|
-
name: m,
|
|
496
|
-
fn: L((C) => [
|
|
497
|
-
W(e.$slots, m, w({ ref_for: !0 }, C))
|
|
498
|
-
])
|
|
499
|
-
}))
|
|
500
|
-
]), 1040, ["option", "disabled", "selected"]))), 128))
|
|
501
|
-
]),
|
|
502
|
-
_: 2
|
|
503
|
-
}, 1032, ["category-label"]))), 128)) : (d(!0), y(te, { key: 1 }, j(e.items, (n) => (d(), A(a, w({
|
|
504
|
-
key: n.value,
|
|
505
|
-
ref_for: !0,
|
|
506
|
-
ref: "listboxItemRef",
|
|
507
|
-
role: "option",
|
|
508
|
-
option: n,
|
|
509
|
-
disabled: e.isOptionDisabled ? e.isOptionDisabled(n) : null,
|
|
510
|
-
selected: n.value === e.selectedItem.value
|
|
511
|
-
}, ee(e.listboxOptionListeners)), ge({ _: 2 }, [
|
|
512
|
-
j(e.slots, (u, l) => ({
|
|
513
|
-
name: l,
|
|
514
|
-
fn: L((m) => [
|
|
515
|
-
W(e.$slots, l, w({ ref_for: !0 }, m))
|
|
516
|
-
])
|
|
517
|
-
}))
|
|
518
|
-
]), 1040, ["option", "disabled", "selected"]))), 128))
|
|
519
|
-
], 16)), [
|
|
520
|
-
[S]
|
|
521
|
-
]);
|
|
522
|
-
}
|
|
523
|
-
const Yt = /* @__PURE__ */ H(Vt, [["render", zt]]);
|
|
524
|
-
let we = 0;
|
|
525
|
-
const Ut = {
|
|
526
|
-
beforeCreate() {
|
|
527
|
-
this.uuid = we.toString(), we += 1;
|
|
528
|
-
}
|
|
529
|
-
}, Ft = { key: 0 };
|
|
530
|
-
function Kt(e, t, o, s, i, r) {
|
|
531
|
-
return d(), y("svg", w({ role: "img" }, e.$attrs, {
|
|
532
|
-
class: "ui-assets-icons-16",
|
|
533
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
534
|
-
width: "16",
|
|
535
|
-
height: "16",
|
|
536
|
-
fill: "none"
|
|
537
|
-
}), [
|
|
538
|
-
e.$attrs["svg-title"] ? (d(), y("title", Ft, V(e.$attrs["svg-title"]), 1)) : q("", !0),
|
|
539
|
-
t[0] || (t[0] = G("path", {
|
|
540
|
-
fill: "#001222",
|
|
541
|
-
d: "M9.69043 5.75L4.62988 10.8105L1.56934 7.75L2.62988 6.68945L4.62988 8.68945L8.62988 4.68945L9.69043 5.75Z"
|
|
542
|
-
}, null, -1)),
|
|
543
|
-
t[1] || (t[1] = G("path", {
|
|
544
|
-
fill: "#001222",
|
|
545
|
-
d: "M13.9307 5.75L8.87012 10.8105L7.80957 9.75L12.8701 4.68945L13.9307 5.75Z"
|
|
546
|
-
}, null, -1))
|
|
547
|
-
], 16);
|
|
548
|
-
}
|
|
549
|
-
const Wt = /* @__PURE__ */ H(Ut, [["render", Kt]]), Ht = {}, jt = /* @__PURE__ */ J({
|
|
550
|
-
...Ht,
|
|
551
|
-
__name: "decorative-checkbox",
|
|
552
|
-
props: {
|
|
553
|
-
disabled: { type: Boolean, default: !1 },
|
|
554
|
-
indeterminate: { type: Boolean, default: !1 },
|
|
555
|
-
checked: { type: Boolean, default: !1 },
|
|
556
|
-
allSelected: { type: Boolean, default: !1 }
|
|
557
|
-
},
|
|
558
|
-
setup(e) {
|
|
559
|
-
const t = e, o = b(() => ({
|
|
560
|
-
[`b-checkbox-input--${Se.DISABLED}`]: t.disabled
|
|
561
|
-
})), s = b(() => ({
|
|
562
|
-
[`b-checkbox-input__outline--${Se.UNCHECKED}`]: !t.checked && !t.indeterminate && !t.allSelected,
|
|
563
|
-
[`b-checkbox-input__outline--${Se.CHECKED}`]: (t.checked || t.allSelected) && !t.indeterminate,
|
|
564
|
-
[`b-checkbox-input__outline--${Se.INDETERMINATE}`]: t.indeterminate
|
|
565
|
-
}));
|
|
566
|
-
return (i, r) => (d(), y("div", {
|
|
567
|
-
class: ve(["b-checkbox-input", o.value]),
|
|
568
|
-
role: "presentation"
|
|
569
|
-
}, [
|
|
570
|
-
i.indeterminate ? (d(), A(B(ft), {
|
|
571
|
-
key: 0,
|
|
572
|
-
class: "b-checkbox-input__icon",
|
|
573
|
-
"svg-title": "",
|
|
574
|
-
"aria-hidden": "true"
|
|
575
|
-
})) : i.allSelected ? (d(), A(B(Wt), {
|
|
576
|
-
key: 1,
|
|
577
|
-
class: "b-checkbox-input__icon",
|
|
578
|
-
"svg-title": "",
|
|
579
|
-
"aria-hidden": "true",
|
|
580
|
-
"data-testid": "decorative-checkbox-double-checkmark-icon"
|
|
581
|
-
})) : i.checked ? (d(), A(B(yt), {
|
|
582
|
-
key: 2,
|
|
583
|
-
class: "b-checkbox-input__icon",
|
|
584
|
-
"svg-title": "",
|
|
585
|
-
"aria-hidden": "true"
|
|
586
|
-
})) : q("", !0),
|
|
587
|
-
G("div", {
|
|
588
|
-
class: ve(["b-checkbox-input__outline", s.value])
|
|
589
|
-
}, null, 2)
|
|
590
|
-
], 2));
|
|
591
|
-
}
|
|
592
|
-
}), Ae = /* @__PURE__ */ H(jt, [["__scopeId", "data-v-08d3142e"]]);
|
|
593
|
-
var He = /* @__PURE__ */ ((e) => (e.DISABLED = "disabled", e.STATIC_CATEGORY = "static-category", e))(He || {}), Q = /* @__PURE__ */ ((e) => (e.SELECT_CATEGORY = "select-category", e.UNSELECT_CATEGORY = "unselect-category", e.TOGGLE_CATEGORY_VISIBILITY = "toggle-category-visibility", e))(Q || {});
|
|
594
|
-
const Ge = {
|
|
595
|
-
"de-DE": { categoryClosed: "{category} geschlossen", categoryOpened: "{category} geöffnet" },
|
|
596
|
-
"en-GB": { categoryClosed: "{category} closed", categoryOpened: "{category} opened" },
|
|
597
|
-
"en-US": { categoryClosed: "{category} closed", categoryOpened: "{category} opened" },
|
|
598
|
-
"es-ES": { categoryClosed: "{category} cerrado", categoryOpened: "{category} abierto" },
|
|
599
|
-
"es-MX": { categoryClosed: "{category} cerrado", categoryOpened: "{category} abierto" },
|
|
600
|
-
"fr-FR": { categoryClosed: "{category} fermée", categoryOpened: "{category} ouverte" },
|
|
601
|
-
"it-IT": { categoryClosed: "{category} chiuso", categoryOpened: "{category} aperto" },
|
|
602
|
-
"ja-JP": { categoryClosed: "{category}を閉じました", categoryOpened: "{category}を開きました" },
|
|
603
|
-
"pt-BR": { categoryClosed: "{category} fechada", categoryOpened: "{categoria} aberta" },
|
|
604
|
-
"zh-CN": { categoryClosed: "{category} 已关闭", categoryOpened: "{category} 已打开" }
|
|
605
|
-
}, qt = J({
|
|
606
|
-
i18n: { messages: Ge },
|
|
607
|
-
name: "bento-listbox-multi-select-category",
|
|
608
|
-
components: {
|
|
609
|
-
BentoTypography: ie,
|
|
610
|
-
BentoListboxOption: Ce,
|
|
611
|
-
ChevronDownIcon: ht,
|
|
612
|
-
ChevronUpIcon: Ct,
|
|
613
|
-
DecorativeCheckbox: Ae
|
|
614
|
-
},
|
|
615
|
-
props: {
|
|
616
|
-
/**
|
|
617
|
-
* The option elements to populate the listbox with.
|
|
618
|
-
* It must be an array of {@see BentoListboxOptionItem }.
|
|
619
|
-
*
|
|
620
|
-
* @property {string} value.label - Text to be displayed in the option
|
|
621
|
-
* @property {string,number} value.value - Value of the option
|
|
622
|
-
* @property {BentoListboxOptionItem} value.items - Category items list
|
|
623
|
-
*/
|
|
624
|
-
category: {
|
|
625
|
-
type: Object,
|
|
626
|
-
required: !0
|
|
627
|
-
},
|
|
628
|
-
/**
|
|
629
|
-
* Function that allows the options to be disabled
|
|
630
|
-
*
|
|
631
|
-
* @type {BentoListboxIsOptionDisabled}
|
|
632
|
-
* @param {BentoListboxOptionItem} option - listbox option object
|
|
633
|
-
* @param {string} option.label - Option's label text
|
|
634
|
-
* @param {string|number} option.value - Option's value
|
|
635
|
-
* @param {unknown} option.data - Option's extra data to be passed to the default slot
|
|
636
|
-
*/
|
|
637
|
-
isOptionDisabled: {
|
|
638
|
-
type: [Function],
|
|
639
|
-
default: () => !1
|
|
640
|
-
},
|
|
641
|
-
/**
|
|
642
|
-
* The `input` value.
|
|
643
|
-
* Providing an empty array will select no options.
|
|
644
|
-
*/
|
|
645
|
-
selectedItemsList: {
|
|
646
|
-
type: Array,
|
|
647
|
-
default: () => []
|
|
648
|
-
},
|
|
649
|
-
/**
|
|
650
|
-
* If enabled, dropdown will display non-selectable, static categories
|
|
651
|
-
*/
|
|
652
|
-
staticCategories: { type: Boolean, default: !1 },
|
|
653
|
-
/**
|
|
654
|
-
* Category's tabindex
|
|
655
|
-
*/
|
|
656
|
-
tabindex: { type: Number, default: -1 }
|
|
657
|
-
},
|
|
658
|
-
emits: [
|
|
659
|
-
Q.SELECT_CATEGORY,
|
|
660
|
-
Q.UNSELECT_CATEGORY,
|
|
661
|
-
Q.TOGGLE_CATEGORY_VISIBILITY
|
|
662
|
-
],
|
|
663
|
-
setup(e, { emit: t }) {
|
|
664
|
-
const o = I(!1), { t: s } = _e({ messages: Ge }), i = Me("category-group"), r = Me("category-name"), a = (M) => e.isOptionDisabled ? e.isOptionDisabled(M) : !1, f = b(
|
|
665
|
-
() => e.category.items.every((M) => a(M))
|
|
666
|
-
), S = pe(e, "staticCategories"), n = b(() => o.value || e.staticCategories), u = b(() => ({
|
|
667
|
-
[`b-listbox-multi-select-category--${He.DISABLED}`]: f.value
|
|
668
|
-
})), l = (M, Y) => {
|
|
669
|
-
M.preventDefault(), o.value = Y !== void 0 ? Y : !o.value, t(Q.TOGGLE_CATEGORY_VISIBILITY, e.category.value);
|
|
670
|
-
}, m = (M) => {
|
|
671
|
-
const Y = a(M), Z = e.selectedItemsList?.includes(M.value) || !1;
|
|
672
|
-
return { isDisabled: Y, isPreSelected: Z };
|
|
673
|
-
}, C = b(
|
|
674
|
-
() => e.category.items.filter((M) => {
|
|
675
|
-
const { isDisabled: Y, isPreSelected: Z } = m(M);
|
|
676
|
-
return Y && Z || !Y;
|
|
677
|
-
})
|
|
678
|
-
), h = b(
|
|
679
|
-
() => C.value?.filter(
|
|
680
|
-
({ value: M }) => e.selectedItemsList?.includes(M)
|
|
681
|
-
)
|
|
682
|
-
), R = b(() => {
|
|
683
|
-
const M = o.value ? "categoryOpened" : "categoryClosed";
|
|
684
|
-
return s(M, { category: e.category.label });
|
|
685
|
-
}), x = () => {
|
|
686
|
-
t(Q.SELECT_CATEGORY);
|
|
687
|
-
}, k = () => {
|
|
688
|
-
t(Q.UNSELECT_CATEGORY);
|
|
689
|
-
}, { isAllSelected: $, isIndeterminate: T, toggleSelectAll: O } = Fe(
|
|
690
|
-
h,
|
|
691
|
-
C,
|
|
692
|
-
x,
|
|
693
|
-
k
|
|
694
|
-
), D = b(() => T.value ? "mixed" : `${$.value}`), z = I($.value), re = () => {
|
|
695
|
-
z.value = !z.value, O(z.value);
|
|
696
|
-
};
|
|
697
|
-
return fe($, () => {
|
|
698
|
-
z.value = $.value;
|
|
699
|
-
}), {
|
|
700
|
-
// Values
|
|
701
|
-
chevronTitle: R,
|
|
702
|
-
conditionalClass: u,
|
|
703
|
-
hasAllPropsDisabled: f,
|
|
704
|
-
isOpen: o,
|
|
705
|
-
isAllSelected: $,
|
|
706
|
-
isIndeterminate: T,
|
|
707
|
-
isStaticCategory: S,
|
|
708
|
-
categoryGroupId: i,
|
|
709
|
-
categoryNameId: r,
|
|
710
|
-
// Computed
|
|
711
|
-
showItemChildren: n,
|
|
712
|
-
ariaCheckedComputed: D,
|
|
713
|
-
// Methods
|
|
714
|
-
handleSelectAll: re,
|
|
715
|
-
toggleOpen: l,
|
|
716
|
-
toggleSelectAll: O
|
|
717
|
-
};
|
|
718
|
-
}
|
|
719
|
-
}), Xt = { class: "b-listbox-multi-select-category__label" }, Jt = {
|
|
720
|
-
key: 1,
|
|
721
|
-
class: "b-listbox-multi-select-category b-listbox-multi-select-category--static-category",
|
|
722
|
-
"aria-hidden": "true"
|
|
723
|
-
}, Zt = { class: "b-listbox-multi-select-category__label" }, Qt = ["id", "aria-label"];
|
|
724
|
-
function es(e, t, o, s, i, r) {
|
|
725
|
-
const a = _("decorative-checkbox"), f = _("bento-typography"), S = _("chevron-up-icon"), n = _("chevron-down-icon"), u = _("bento-listbox-option");
|
|
726
|
-
return d(), y("div", null, [
|
|
727
|
-
e.isStaticCategory ? (d(), y("div", Jt, [
|
|
728
|
-
G("span", Zt, [
|
|
729
|
-
N(f, {
|
|
730
|
-
el: "span",
|
|
731
|
-
variant: "caption",
|
|
732
|
-
class: "b-listbox-multi-select-category__label-text"
|
|
733
|
-
}, {
|
|
734
|
-
default: L(() => [
|
|
735
|
-
K(V(e.category.label), 1)
|
|
736
|
-
]),
|
|
737
|
-
_: 1
|
|
738
|
-
})
|
|
739
|
-
])
|
|
740
|
-
])) : (d(), A(u, {
|
|
741
|
-
key: 0,
|
|
742
|
-
class: ve(["b-listbox-multi-select-category__option", e.conditionalClass]),
|
|
743
|
-
tabindex: e.tabindex,
|
|
744
|
-
"aria-selected": e.ariaCheckedComputed !== "false",
|
|
745
|
-
"aria-checked": e.ariaCheckedComputed,
|
|
746
|
-
"aria-disabled": e.hasAllPropsDisabled,
|
|
747
|
-
"aria-expanded": `${e.isOpen}`,
|
|
748
|
-
role: "treeitem",
|
|
749
|
-
"aria-owns": e.categoryGroupId,
|
|
750
|
-
"aria-labelledby": e.categoryNameId,
|
|
751
|
-
onClick: e.handleSelectAll,
|
|
752
|
-
onEnterPressed: e.handleSelectAll,
|
|
753
|
-
onSpacePressed: ae(e.handleSelectAll, ["prevent"]),
|
|
754
|
-
onKeydown: [
|
|
755
|
-
t[1] || (t[1] = be((l) => e.toggleOpen(l, !1), ["arrow-left", "native"])),
|
|
756
|
-
t[2] || (t[2] = be((l) => e.toggleOpen(l, !0), ["arrow-right", "native"]))
|
|
757
|
-
]
|
|
758
|
-
}, {
|
|
759
|
-
default: L(() => [
|
|
760
|
-
N(a, {
|
|
761
|
-
indeterminate: e.isIndeterminate,
|
|
762
|
-
disabled: e.hasAllPropsDisabled,
|
|
763
|
-
checked: e.isAllSelected
|
|
764
|
-
}, null, 8, ["indeterminate", "disabled", "checked"]),
|
|
765
|
-
G("span", Xt, [
|
|
766
|
-
N(f, {
|
|
767
|
-
id: e.categoryNameId,
|
|
768
|
-
el: "span",
|
|
769
|
-
class: "b-listbox-multi-select-category__label-text"
|
|
770
|
-
}, {
|
|
771
|
-
default: L(() => [
|
|
772
|
-
K(V(e.category.label), 1)
|
|
773
|
-
]),
|
|
774
|
-
_: 1
|
|
775
|
-
}, 8, ["id"]),
|
|
776
|
-
G("div", {
|
|
777
|
-
"aria-hidden": "true",
|
|
778
|
-
class: "b-listbox-multi-select-category__label-chevron",
|
|
779
|
-
"data-testid": "toggle-listbox",
|
|
780
|
-
onClickCapture: t[0] || (t[0] = ae((...l) => e.toggleOpen && e.toggleOpen(...l), ["stop"]))
|
|
781
|
-
}, [
|
|
782
|
-
e.isOpen ? (d(), A(S, {
|
|
783
|
-
key: 0,
|
|
784
|
-
"svg-title": e.chevronTitle
|
|
785
|
-
}, null, 8, ["svg-title"])) : (d(), A(n, {
|
|
786
|
-
key: 1,
|
|
787
|
-
"svg-title": e.chevronTitle
|
|
788
|
-
}, null, 8, ["svg-title"]))
|
|
789
|
-
], 32)
|
|
790
|
-
])
|
|
791
|
-
]),
|
|
792
|
-
_: 1
|
|
793
|
-
}, 8, ["class", "tabindex", "aria-selected", "aria-checked", "aria-disabled", "aria-expanded", "aria-owns", "aria-labelledby", "onClick", "onEnterPressed", "onSpacePressed"])),
|
|
794
|
-
ne(G("div", {
|
|
795
|
-
id: e.categoryGroupId,
|
|
796
|
-
role: "group",
|
|
797
|
-
"aria-label": e.category.label
|
|
798
|
-
}, [
|
|
799
|
-
W(e.$slots, "default", {}, void 0, !0)
|
|
800
|
-
], 8, Qt), [
|
|
801
|
-
[ze, e.showItemChildren]
|
|
802
|
-
])
|
|
803
|
-
]);
|
|
804
|
-
}
|
|
805
|
-
const ts = /* @__PURE__ */ H(qt, [["render", es], ["__scopeId", "data-v-60c04867"]]);
|
|
806
|
-
var X = /* @__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))(X || {});
|
|
807
|
-
const ss = J({
|
|
808
|
-
name: "listbox-multi-select-options",
|
|
809
|
-
components: {
|
|
810
|
-
BentoListboxOption: Ce,
|
|
811
|
-
BentoTypography: ie,
|
|
812
|
-
ListboxMultiSelectCategory: ts,
|
|
813
|
-
DecorativeCheckbox: Ae
|
|
814
|
-
},
|
|
815
|
-
inheritAttrs: !1,
|
|
816
|
-
props: {
|
|
817
|
-
/**
|
|
818
|
-
* Indicates if the items listed are inside a category
|
|
819
|
-
* so they can be padded to right by one level in recursion.
|
|
820
|
-
* Items of categories are automatically defined as "categoryItems"
|
|
821
|
-
*/
|
|
822
|
-
categoryItems: { type: Boolean, default: !1 },
|
|
823
|
-
/**
|
|
824
|
-
* Current focused option index
|
|
825
|
-
*/
|
|
826
|
-
focusedIndex: { type: Number, default: 0 },
|
|
827
|
-
/**
|
|
828
|
-
* Function that allows the options to be disabled
|
|
829
|
-
*
|
|
830
|
-
* @type {BentoListboxIsOptionDisabled}
|
|
831
|
-
* @param {BentoListboxOptionItem} option - listbox option object
|
|
832
|
-
* @param {string} option.label - Option's label text
|
|
833
|
-
* @param {string|number} option.value - Option's value
|
|
834
|
-
* @param {unknown} option.data - Option's extra data to be passed to the default slot
|
|
835
|
-
*/
|
|
836
|
-
isOptionDisabled: {
|
|
837
|
-
type: Function,
|
|
838
|
-
default: () => !1
|
|
839
|
-
},
|
|
840
|
-
/**
|
|
841
|
-
* The option elements to populate the listbox with.
|
|
842
|
-
* It must be an array of {@see BentoListboxOptionItem }.
|
|
843
|
-
*
|
|
844
|
-
* @property {string} value.label - Text to be displayed in the option
|
|
845
|
-
* @property {string,number} value.value - Value of the option
|
|
846
|
-
*/
|
|
847
|
-
items: {
|
|
848
|
-
type: Array,
|
|
849
|
-
required: !0
|
|
850
|
-
},
|
|
851
|
-
/**
|
|
852
|
-
* Indicates if the elements options are inside a multi-level category
|
|
853
|
-
*/
|
|
854
|
-
isMultiLevel: { type: Boolean, default: !1 },
|
|
855
|
-
/**
|
|
856
|
-
* Flag that indicates that an external search it's being made
|
|
857
|
-
* to filter out the items inside the the multi-select listbox
|
|
858
|
-
*
|
|
859
|
-
* If enabled, hides the "Select all" checkbox in "multiple" mode.
|
|
860
|
-
*/
|
|
861
|
-
searching: { type: Boolean, default: !1 },
|
|
862
|
-
/**
|
|
863
|
-
* List of selected items.
|
|
864
|
-
* Providing an empty array will select no options.
|
|
865
|
-
*/
|
|
866
|
-
selectedItemsList: {
|
|
867
|
-
type: Array,
|
|
868
|
-
default: () => []
|
|
869
|
-
},
|
|
870
|
-
/**
|
|
871
|
-
* If enabled, dropdown will display non-selectable, static categories
|
|
872
|
-
*/
|
|
873
|
-
staticCategories: { type: Boolean, default: !1 },
|
|
874
|
-
/**
|
|
875
|
-
* Object with the index of each item.
|
|
876
|
-
*/
|
|
877
|
-
itemsIndex: {
|
|
878
|
-
type: Object,
|
|
879
|
-
default: () => ({})
|
|
880
|
-
}
|
|
881
|
-
},
|
|
882
|
-
emits: [
|
|
883
|
-
X.TOGGLE_CHECKBOX_SELECTION,
|
|
884
|
-
X.SELECT_CATEGORY,
|
|
885
|
-
X.UNSELECT_CATEGORY,
|
|
886
|
-
X.TOGGLE_CATEGORY_VISIBILITY
|
|
887
|
-
],
|
|
888
|
-
setup(e, { emit: t }) {
|
|
889
|
-
const o = (n) => {
|
|
890
|
-
e.isOptionDisabled(n) || t(X.TOGGLE_CHECKBOX_SELECTION, n);
|
|
891
|
-
}, s = (n) => !!n.items, i = (n) => {
|
|
892
|
-
const u = e.isMultiLevel && e.searching;
|
|
893
|
-
return n.description && (!e.isMultiLevel || u);
|
|
894
|
-
}, r = (n) => n.items ? !!n.items.find((u) => e.selectedItemsList.includes(u.value)) : e.selectedItemsList.includes(n.value), a = (n) => {
|
|
895
|
-
if (s(n)) {
|
|
896
|
-
const u = r(n) ? X.UNSELECT_CATEGORY : X.SELECT_CATEGORY;
|
|
897
|
-
t(u, n);
|
|
898
|
-
} else
|
|
899
|
-
o(n);
|
|
900
|
-
};
|
|
901
|
-
return {
|
|
902
|
-
// Values
|
|
903
|
-
conditionalClasses: b(() => ({
|
|
904
|
-
"b-listbox-multi-select-options__static-category-option": e.staticCategories,
|
|
905
|
-
"b-listbox-multi-select-options__category-option": e.categoryItems
|
|
906
|
-
})),
|
|
907
|
-
// Methods
|
|
908
|
-
isOptionSelected: r,
|
|
909
|
-
shouldShowDescription: i,
|
|
910
|
-
toggleCheckboxSelection: o,
|
|
911
|
-
toggleSearchOption: a,
|
|
912
|
-
computedTabindex: (n) => e.itemsIndex[n] === e.focusedIndex ? 0 : -1,
|
|
913
|
-
// Enums
|
|
914
|
-
BentoListboxEvent: p,
|
|
915
|
-
ListboxMultiSelectOptionsEvent: X
|
|
916
|
-
};
|
|
917
|
-
}
|
|
918
|
-
}), ls = { class: "b-listbox-multi-select__option-text" }, os = { class: "b-listbox-multi-select__option-text" };
|
|
919
|
-
function as(e, t, o, s, i, r) {
|
|
920
|
-
const a = _("decorative-checkbox"), f = _("bento-typography"), S = _("bento-listbox-option"), n = _("listbox-multi-select-options", !0), u = _("listbox-multi-select-category");
|
|
921
|
-
return d(), y("div", null, [
|
|
922
|
-
(d(!0), y(te, null, j(e.items, (l) => (d(), y("div", {
|
|
923
|
-
key: `selected-${l.value}`
|
|
924
|
-
}, [
|
|
925
|
-
e.searching && e.isMultiLevel ? (d(), A(S, {
|
|
926
|
-
key: 0,
|
|
927
|
-
class: ve(["b-listbox-multi-select-options", e.conditionalClasses]),
|
|
928
|
-
disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null,
|
|
929
|
-
tabindex: e.computedTabindex(l.value),
|
|
930
|
-
"aria-selected": `${e.isOptionSelected(l)}`,
|
|
931
|
-
"aria-checked": `${e.isOptionSelected(l)}`,
|
|
932
|
-
"aria-disabled": e.isOptionDisabled ? e.isOptionDisabled(l) : null,
|
|
933
|
-
role: e.$attrs.role || "option",
|
|
934
|
-
onClick: (m) => e.toggleSearchOption(l),
|
|
935
|
-
onEnterPressed: (m) => e.toggleSearchOption(l),
|
|
936
|
-
onSpacePressed: ae((m) => e.toggleSearchOption(l), ["prevent"])
|
|
937
|
-
}, {
|
|
938
|
-
default: L(() => [
|
|
939
|
-
N(a, {
|
|
940
|
-
disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null,
|
|
941
|
-
checked: e.isOptionSelected(l)
|
|
942
|
-
}, null, 8, ["disabled", "checked"]),
|
|
943
|
-
W(e.$slots, "default", w({ ref_for: !0 }, l), () => [
|
|
944
|
-
G("span", ls, [
|
|
945
|
-
N(f, { el: "span" }, {
|
|
946
|
-
default: L(() => [
|
|
947
|
-
K(V(l.label), 1)
|
|
948
|
-
]),
|
|
949
|
-
_: 2
|
|
950
|
-
}, 1024),
|
|
951
|
-
e.shouldShowDescription(l) ? (d(), A(f, {
|
|
952
|
-
key: 0,
|
|
953
|
-
class: "b-listbox-multi-select__option-description",
|
|
954
|
-
el: "span"
|
|
955
|
-
}, {
|
|
956
|
-
default: L(() => [
|
|
957
|
-
K(V(l.description), 1)
|
|
958
|
-
]),
|
|
959
|
-
_: 2
|
|
960
|
-
}, 1024)) : q("", !0)
|
|
961
|
-
])
|
|
962
|
-
], !0)
|
|
963
|
-
]),
|
|
964
|
-
_: 2
|
|
965
|
-
}, 1032, ["class", "disabled", "tabindex", "aria-selected", "aria-checked", "aria-disabled", "role", "onClick", "onEnterPressed", "onSpacePressed"])) : (d(), y(te, { key: 1 }, [
|
|
966
|
-
l.items ? (d(), A(u, {
|
|
967
|
-
key: 0,
|
|
968
|
-
category: l,
|
|
969
|
-
"static-categories": e.staticCategories,
|
|
970
|
-
"is-option-disabled": e.isOptionDisabled,
|
|
971
|
-
"selected-items-list": e.selectedItemsList,
|
|
972
|
-
tabindex: e.computedTabindex(l.value),
|
|
973
|
-
onSelectCategory: (m) => e.$emit(e.ListboxMultiSelectOptionsEvent.SELECT_CATEGORY, l),
|
|
974
|
-
onUnselectCategory: (m) => e.$emit(e.ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY, l),
|
|
975
|
-
onToggleCategoryVisibility: t[1] || (t[1] = (m) => e.$emit(e.ListboxMultiSelectOptionsEvent.TOGGLE_CATEGORY_VISIBILITY, m))
|
|
976
|
-
}, {
|
|
977
|
-
default: L(() => [
|
|
978
|
-
N(n, {
|
|
979
|
-
"category-items": "",
|
|
980
|
-
items: l.items,
|
|
981
|
-
"is-option-disabled": e.isOptionDisabled,
|
|
982
|
-
"items-index": e.itemsIndex,
|
|
983
|
-
"focused-index": e.focusedIndex,
|
|
984
|
-
"is-multi-level": e.isMultiLevel,
|
|
985
|
-
"static-categories": e.staticCategories,
|
|
986
|
-
"selected-items-list": e.selectedItemsList,
|
|
987
|
-
searching: e.searching,
|
|
988
|
-
role: e.$attrs.role || "option",
|
|
989
|
-
onToggleCheckboxSelection: t[0] || (t[0] = (m) => e.toggleCheckboxSelection(m))
|
|
990
|
-
}, null, 8, ["items", "is-option-disabled", "items-index", "focused-index", "is-multi-level", "static-categories", "selected-items-list", "searching", "role"])
|
|
991
|
-
]),
|
|
992
|
-
_: 2
|
|
993
|
-
}, 1032, ["category", "static-categories", "is-option-disabled", "selected-items-list", "tabindex", "onSelectCategory", "onUnselectCategory"])) : (d(), A(S, {
|
|
994
|
-
key: 1,
|
|
995
|
-
class: ve(["b-listbox-multi-select-options", e.conditionalClasses]),
|
|
996
|
-
disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null,
|
|
997
|
-
tabindex: e.computedTabindex(l.value),
|
|
998
|
-
"aria-selected": `${e.isOptionSelected(l)}`,
|
|
999
|
-
"aria-checked": `${e.isOptionSelected(l)}`,
|
|
1000
|
-
"aria-disabled": e.isOptionDisabled ? e.isOptionDisabled(l) : null,
|
|
1001
|
-
role: e.$attrs.role || "option",
|
|
1002
|
-
onClick: (m) => e.toggleCheckboxSelection(l),
|
|
1003
|
-
onEnterPressed: (m) => e.toggleCheckboxSelection(l),
|
|
1004
|
-
onSpacePressed: ae((m) => e.toggleCheckboxSelection(l), ["prevent"])
|
|
1005
|
-
}, {
|
|
1006
|
-
default: L(() => [
|
|
1007
|
-
N(a, {
|
|
1008
|
-
disabled: e.isOptionDisabled ? e.isOptionDisabled(l) : null,
|
|
1009
|
-
checked: e.isOptionSelected(l)
|
|
1010
|
-
}, null, 8, ["disabled", "checked"]),
|
|
1011
|
-
W(e.$slots, "default", w({ ref_for: !0 }, l), () => [
|
|
1012
|
-
G("span", os, [
|
|
1013
|
-
N(f, { el: "span" }, {
|
|
1014
|
-
default: L(() => [
|
|
1015
|
-
K(V(l.label), 1)
|
|
1016
|
-
]),
|
|
1017
|
-
_: 2
|
|
1018
|
-
}, 1024),
|
|
1019
|
-
e.shouldShowDescription(l) ? (d(), A(f, {
|
|
1020
|
-
key: 0,
|
|
1021
|
-
class: "b-listbox-multi-select__option-description",
|
|
1022
|
-
el: "span"
|
|
1023
|
-
}, {
|
|
1024
|
-
default: L(() => [
|
|
1025
|
-
K(V(l.description), 1)
|
|
1026
|
-
]),
|
|
1027
|
-
_: 2
|
|
1028
|
-
}, 1024)) : q("", !0)
|
|
1029
|
-
])
|
|
1030
|
-
], !0)
|
|
1031
|
-
]),
|
|
1032
|
-
_: 2
|
|
1033
|
-
}, 1032, ["class", "disabled", "tabindex", "aria-selected", "aria-checked", "aria-disabled", "role", "onClick", "onEnterPressed", "onSpacePressed"]))
|
|
1034
|
-
], 64))
|
|
1035
|
-
]))), 128))
|
|
1036
|
-
]);
|
|
1037
|
-
}
|
|
1038
|
-
const ns = /* @__PURE__ */ H(ss, [["render", as], ["__scopeId", "data-v-237dfc58"]]), is = (e) => {
|
|
1039
|
-
const t = b(() => !!e.value?.find(({ items: s }) => !!s)), o = b(() => t.value ? e.value?.reduce((s, i) => (i.items ? s.push(...i.items.flat()) : s.push(i), s), []) : e.value);
|
|
1040
|
-
return {
|
|
1041
|
-
isMultiLevelSelect: t,
|
|
1042
|
-
flattenedItemsList: o
|
|
1043
|
-
};
|
|
1044
|
-
}, je = {
|
|
1045
|
-
"de-DE": { allSelected: "Alle ausgewählt ({total})", numberOfTotalSelected: "{number} von {total} ausgewählt", numbersSelected: "{number} ausgewählt", selectAll: "Alle auswählen ({total})" },
|
|
1046
|
-
"en-GB": { allSelected: "All selected ({total})", numberOfTotalSelected: "{number} of {total} selected", numbersSelected: "{number} selected", selectAll: "Select all ({total})" },
|
|
1047
|
-
"en-US": { allSelected: "All selected ({total})", numberOfTotalSelected: "{number} of {total} selected", numbersSelected: "{number} selected", selectAll: "Select all ({total})" },
|
|
1048
|
-
"es-ES": { allSelected: "Todos seleccionados ({total})", numberOfTotalSelected: "{number} de {total} seleccionados", numbersSelected: "{number} seleccionado", selectAll: "Seleccionar todo ({total})" },
|
|
1049
|
-
"es-MX": { allSelected: "Todos seleccionados ({total})", numberOfTotalSelected: "{number} de {total} seleccionados", numbersSelected: "{número} seleccionado", selectAll: "Seleccionar todo ({total})" },
|
|
1050
|
-
"fr-FR": { allSelected: "Tous sélectionnés ({total})", numberOfTotalSelected: "{number} sélectionné(s) sur {total}", numbersSelected: "{number} sélectionné(s)", selectAll: "Tout sélectionner ({total})" },
|
|
1051
|
-
"it-IT": { allSelected: "Tutti i selezionati ({total})", numberOfTotalSelected: "{numero} su {totale} selezionati", numbersSelected: "{numero} selezionati", selectAll: "Seleziona tutto ({total})" },
|
|
1052
|
-
"ja-JP": { allSelected: "すべて選択 ({total})", numberOfTotalSelected: "{number}/{total}件が選択されました", numbersSelected: "{number}件選択済み", selectAll: "すべて選択 ({total})" },
|
|
1053
|
-
"pt-BR": { allSelected: "Todos os selecionados ({total})", numberOfTotalSelected: "{number} de {total} selecionados", numbersSelected: "{number} selecionados", selectAll: "Selecionar tudo ({total})" },
|
|
1054
|
-
"zh-CN": { allSelected: "全部已选 ({total})", numberOfTotalSelected: "已选择 {number} 个,共 {total} 个", numbersSelected: "已选择 {number} 个", selectAll: "选择全部({total})个" }
|
|
1055
|
-
}, rs = { key: 0 }, cs = ["role"], ds = {
|
|
1056
|
-
key: 1,
|
|
1057
|
-
class: "b-listbox-multi-select__divider",
|
|
1058
|
-
"aria-hidden": "true"
|
|
1059
|
-
}, us = { i18n: { messages: je } }, bs = /* @__PURE__ */ J({
|
|
1060
|
-
...us,
|
|
1061
|
-
__name: "listbox-multi-select",
|
|
1062
|
-
props: {
|
|
1063
|
-
hasMoreItems: { type: Boolean, default: !1 },
|
|
1064
|
-
isOptionDisabled: { type: Function, default: () => !1 },
|
|
1065
|
-
items: {},
|
|
1066
|
-
lazyLoadType: { default: "none" },
|
|
1067
|
-
searching: { type: Boolean, default: !1 },
|
|
1068
|
-
selectedValues: {},
|
|
1069
|
-
staticCategories: { type: Boolean, default: !1 }
|
|
1070
|
-
},
|
|
1071
|
-
emits: ["select"],
|
|
1072
|
-
setup(e, { expose: t, emit: o }) {
|
|
1073
|
-
const s = e, i = o, { t: r, n: a } = _e({ messages: je }), f = mt(), S = pt(), n = b(
|
|
1074
|
-
() => ({
|
|
1075
|
-
"aria-label": S["aria-label"]?.toString(),
|
|
1076
|
-
"aria-busy": S["aria-busy"]?.toString(),
|
|
1077
|
-
"aria-atomic": S["aria-atomic"]?.toString(),
|
|
1078
|
-
"aria-live": S["aria-live"]?.toString(),
|
|
1079
|
-
"aria-multiselectable": !0
|
|
1080
|
-
})
|
|
1081
|
-
), u = I(null), l = I(null), m = I(null), C = I(null), h = b(() => s.selectedValues.map(({ value: c }) => c)), { isMultiLevelSelect: R, flattenedItemsList: x } = is(pe(s, "items")), k = b(() => R.value && !s.staticCategories), $ = b(() => k.value ? "tree" : "listbox"), T = b(() => k.value ? "treeitem" : "option"), O = (c) => {
|
|
1082
|
-
const v = s.isOptionDisabled(c), g = h.value?.includes(c.value) || !1;
|
|
1083
|
-
return { isDisabled: v, isPreSelected: g };
|
|
1084
|
-
}, D = b(() => {
|
|
1085
|
-
if (s.searching && R)
|
|
1086
|
-
return s.items;
|
|
1087
|
-
const c = x.value.filter((v) => {
|
|
1088
|
-
const { isDisabled: g, isPreSelected: P } = O(v);
|
|
1089
|
-
return g && P || !g;
|
|
1090
|
-
});
|
|
1091
|
-
return s.selectedValues.forEach((v) => {
|
|
1092
|
-
c.find((g) => g.value === v.value) || c.push(v);
|
|
1093
|
-
}), c;
|
|
1094
|
-
}), z = b(
|
|
1095
|
-
() => D.value?.filter((c) => c.items && R.value && s.searching ? c.items.filter(
|
|
1096
|
-
(g) => (s.selectedValues ?? []).includes(g.value)
|
|
1097
|
-
).length === c.items.length : h.value?.includes(c.value))
|
|
1098
|
-
), re = () => R.value && !s.searching ? x.value.length : s.items.length, M = b(() => {
|
|
1099
|
-
const c = D.value.length, v = re(), g = z.value?.length || 0;
|
|
1100
|
-
return g === 0 ? r("selectAll", { total: a(c) }) : g === v ? r("allSelected", { total: a(v) }) : g <= v ? r("numberOfTotalSelected", { number: a(g), total: a(v) }) : r("numbersSelected", { number: a(g) });
|
|
1101
|
-
}), Y = (c) => {
|
|
1102
|
-
const v = (P) => {
|
|
1103
|
-
const { isDisabled: E, isPreSelected: ue } = O(P);
|
|
1104
|
-
return E && ue || !E;
|
|
1105
|
-
}, g = c.filter(v).filter((P) => !h.value.includes(P.value));
|
|
1106
|
-
i("select", [...s.selectedValues, ...g]);
|
|
1107
|
-
}, Z = (c) => {
|
|
1108
|
-
const v = (E) => {
|
|
1109
|
-
const { isDisabled: ue, isPreSelected: dt } = O(E);
|
|
1110
|
-
return !(ue && dt);
|
|
1111
|
-
}, g = c.filter(v).map(({ value: E }) => E), P = s.selectedValues.filter((E) => !g?.includes(E.value));
|
|
1112
|
-
i("select", P);
|
|
1113
|
-
}, Ee = () => {
|
|
1114
|
-
Y(x.value);
|
|
1115
|
-
}, Oe = () => {
|
|
1116
|
-
Z(x.value);
|
|
1117
|
-
}, { isAllSelected: U, isIndeterminate: se, toggleSelectAll: qe } = Fe(
|
|
1118
|
-
z,
|
|
1119
|
-
D,
|
|
1120
|
-
Ee,
|
|
1121
|
-
Oe
|
|
1122
|
-
), ke = b(() => se.value ? "mixed" : `${U.value}`), ye = I(U.value), Te = () => {
|
|
1123
|
-
ye.value = !ye.value, qe(ye.value);
|
|
1124
|
-
};
|
|
1125
|
-
fe(U, () => {
|
|
1126
|
-
ye.value = U.value;
|
|
1127
|
-
});
|
|
1128
|
-
const Xe = (c) => {
|
|
1129
|
-
Y(c.items);
|
|
1130
|
-
}, $e = (c) => {
|
|
1131
|
-
Z(c.items);
|
|
1132
|
-
}, ce = (c, v) => {
|
|
1133
|
-
let g = !1;
|
|
1134
|
-
const P = s.selectedValues.filter(({ value: E }) => v.value === E ? (g = !0, !1) : !0);
|
|
1135
|
-
g || P.push(v), i(c, P);
|
|
1136
|
-
}, Je = b(() => {
|
|
1137
|
-
if (!R.value)
|
|
1138
|
-
return s.selectedValues;
|
|
1139
|
-
const c = (E) => h.value.includes(E.value), v = (E) => !s.staticCategories && E.every((ue) => c(ue));
|
|
1140
|
-
return s.items.flatMap(
|
|
1141
|
-
(E) => E.items && !v(E.items) ? E.items : E
|
|
1142
|
-
).filter((E) => E.items ? !0 : c(E));
|
|
1143
|
-
}), Ze = b(() => {
|
|
1144
|
-
const c = ["automatic", "button"].includes(s.lazyLoadType), v = s.selectedValues?.length > 0 && z.value?.length !== x.value?.length;
|
|
1145
|
-
return c && s.hasMoreItems ? !!s.selectedValues?.length : v;
|
|
1146
|
-
}), Le = b(() => ["automatic", "button"].includes(s.lazyLoadType) ? !s.hasMoreItems : !0), de = I([]), { visibleDomOptions: De, updateVisibleDomOptions: Qe } = We(
|
|
1147
|
-
u,
|
|
1148
|
-
pe(s, "items"),
|
|
1149
|
-
T
|
|
1150
|
-
), et = (c) => {
|
|
1151
|
-
de.value.includes(c) ? de.value = de.value.filter((v) => v !== c) : de.value.push(c), Ye(() => {
|
|
1152
|
-
Qe();
|
|
1153
|
-
});
|
|
1154
|
-
}, tt = (c) => {
|
|
1155
|
-
De.value[c]?.focus();
|
|
1156
|
-
}, {
|
|
1157
|
-
moveToNextElement: st,
|
|
1158
|
-
moveToPreviousElement: lt,
|
|
1159
|
-
moveToFirstElement: ot,
|
|
1160
|
-
moveToLastElement: at,
|
|
1161
|
-
preventDefault: Be,
|
|
1162
|
-
focusedIndex: Re,
|
|
1163
|
-
setListboxFocusedIndex: nt
|
|
1164
|
-
} = Ke(
|
|
1165
|
-
{
|
|
1166
|
-
items: De
|
|
1167
|
-
},
|
|
1168
|
-
tt
|
|
1169
|
-
), it = {
|
|
1170
|
-
[F.ARROW_UP]: (c) => lt(c),
|
|
1171
|
-
[F.ARROW_DOWN]: (c) => st(c),
|
|
1172
|
-
[F.HOME]: ot,
|
|
1173
|
-
[F.END]: at
|
|
1174
|
-
};
|
|
1175
|
-
t({
|
|
1176
|
-
/**
|
|
1177
|
-
* Method to set the index of the item to be focused on
|
|
1178
|
-
* Used for focus management to be kept in-sync with parent e.g. dropdowns
|
|
1179
|
-
*/
|
|
1180
|
-
setListboxFocusedIndex: nt
|
|
1181
|
-
});
|
|
1182
|
-
const rt = {
|
|
1183
|
-
[F.ARROW_UP]: Be,
|
|
1184
|
-
[F.ARROW_DOWN]: Be
|
|
1185
|
-
}, ct = b(() => {
|
|
1186
|
-
let c = Le.value ? 1 : 0;
|
|
1187
|
-
const v = {};
|
|
1188
|
-
return s.items.forEach((g) => {
|
|
1189
|
-
let P = de.value.includes(g.value);
|
|
1190
|
-
g.items ? (s.staticCategories ? P = !0 : v[g.value] = c++, P && g.items.forEach((E) => v[E.value] = c++)) : v[g.value] = c++;
|
|
1191
|
-
}), v;
|
|
1192
|
-
});
|
|
1193
|
-
return (c, v) => (d(), y("div", {
|
|
1194
|
-
ref_key: "listboxRef",
|
|
1195
|
-
ref: u,
|
|
1196
|
-
class: "b-listbox-multi-select"
|
|
1197
|
-
}, [
|
|
1198
|
-
Ze.value ? (d(), y("div", rs, [
|
|
1199
|
-
ne((d(), y("ul", w({ class: "b-listbox-multi-select__chips" }, ee(rt, !0)), [
|
|
1200
|
-
(d(!0), y(te, null, j(Je.value, (g) => (d(), y("li", {
|
|
1201
|
-
key: g.value
|
|
1202
|
-
}, [
|
|
1203
|
-
N(B(St), {
|
|
1204
|
-
ref_for: !0,
|
|
1205
|
-
ref_key: "selectedListboxItemsRef",
|
|
1206
|
-
ref: m,
|
|
1207
|
-
disabled: c.isOptionDisabled(g),
|
|
1208
|
-
label: g.label,
|
|
1209
|
-
condensed: "",
|
|
1210
|
-
onClick: (P) => g.items ? $e(g) : ce("select", g)
|
|
1211
|
-
}, null, 8, ["disabled", "label", "onClick"])
|
|
1212
|
-
]))), 128))
|
|
1213
|
-
], 16)), [
|
|
1214
|
-
[B(he)]
|
|
1215
|
-
]),
|
|
1216
|
-
v[4] || (v[4] = G("hr", {
|
|
1217
|
-
class: "b-listbox-multi-select__divider",
|
|
1218
|
-
"aria-hidden": "true"
|
|
1219
|
-
}, null, -1))
|
|
1220
|
-
])) : q("", !0),
|
|
1221
|
-
ne((d(), y("div", w(n.value, { role: $.value }, ee(it, !0)), [
|
|
1222
|
-
Le.value ? (d(), A(B(Ce), {
|
|
1223
|
-
key: 0,
|
|
1224
|
-
ref_key: "selectAllListboxItemsRef",
|
|
1225
|
-
ref: l,
|
|
1226
|
-
class: "b-listbox-multi-select__option",
|
|
1227
|
-
tabindex: B(Re) === 0 ? 0 : -1,
|
|
1228
|
-
"aria-selected": ke.value !== "false",
|
|
1229
|
-
"aria-checked": ke.value,
|
|
1230
|
-
role: T.value,
|
|
1231
|
-
onClick: Te,
|
|
1232
|
-
onEnterPressed: Te,
|
|
1233
|
-
onSpacePressed: ae(Te, ["prevent"])
|
|
1234
|
-
}, {
|
|
1235
|
-
default: L(() => [
|
|
1236
|
-
N(B(Ae), {
|
|
1237
|
-
checked: B(U),
|
|
1238
|
-
indeterminate: B(se)
|
|
1239
|
-
}, null, 8, ["checked", "indeterminate"]),
|
|
1240
|
-
N(B(ie), { el: "span" }, {
|
|
1241
|
-
default: L(() => [
|
|
1242
|
-
K(V(M.value), 1)
|
|
1243
|
-
]),
|
|
1244
|
-
_: 1
|
|
1245
|
-
})
|
|
1246
|
-
]),
|
|
1247
|
-
_: 1
|
|
1248
|
-
}, 8, ["tabindex", "aria-selected", "aria-checked", "role"])) : q("", !0),
|
|
1249
|
-
Le.value ? (d(), y("hr", ds)) : q("", !0),
|
|
1250
|
-
N(B(ns), {
|
|
1251
|
-
ref_key: "listboxItemsRef",
|
|
1252
|
-
ref: C,
|
|
1253
|
-
items: c.items,
|
|
1254
|
-
"is-option-disabled": c.isOptionDisabled,
|
|
1255
|
-
"is-multi-level": B(R),
|
|
1256
|
-
"static-categories": c.staticCategories,
|
|
1257
|
-
searching: c.searching,
|
|
1258
|
-
"selected-items-list": h.value,
|
|
1259
|
-
"focused-index": B(Re),
|
|
1260
|
-
"items-index": ct.value,
|
|
1261
|
-
role: T.value,
|
|
1262
|
-
onToggleCheckboxSelection: v[0] || (v[0] = (g) => ce("select", g)),
|
|
1263
|
-
onSelectCategory: Xe,
|
|
1264
|
-
onUnselectCategory: $e,
|
|
1265
|
-
onToggleCategoryVisibility: et,
|
|
1266
|
-
onSpacePressed: v[1] || (v[1] = (g) => ce(B(p).SPACE, g)),
|
|
1267
|
-
onTabPressed: v[2] || (v[2] = (g) => ce(B(p).TAB, g)),
|
|
1268
|
-
onEnterPressed: v[3] || (v[3] = (g) => ce(B(p).ENTER, g))
|
|
1269
|
-
}, ge({ _: 2 }, [
|
|
1270
|
-
j(B(f), (g, P) => ({
|
|
1271
|
-
name: P,
|
|
1272
|
-
fn: L((E) => [
|
|
1273
|
-
W(c.$slots, P, oe(me(E)), void 0, !0)
|
|
1274
|
-
])
|
|
1275
|
-
}))
|
|
1276
|
-
]), 1032, ["items", "is-option-disabled", "is-multi-level", "static-categories", "searching", "selected-items-list", "focused-index", "items-index", "role"])
|
|
1277
|
-
], 16, cs)), [
|
|
1278
|
-
[B(he)]
|
|
1279
|
-
])
|
|
1280
|
-
], 512));
|
|
1281
|
-
}
|
|
1282
|
-
}), xe = /* @__PURE__ */ H(bs, [["__scopeId", "data-v-4abd31b6"]]), ms = (e, t = 300) => {
|
|
1283
|
-
let o;
|
|
1284
|
-
return (...i) => {
|
|
1285
|
-
o && clearTimeout(o), o = setTimeout(() => e(...i), t);
|
|
1286
|
-
};
|
|
1287
|
-
}, Ve = {
|
|
1288
|
-
"de-DE": { loading: "Laden", showMore: "Mehr anzeigen" },
|
|
1289
|
-
"en-GB": { loading: "Loading", showMore: "Show more" },
|
|
1290
|
-
"en-US": { loading: "Loading", showMore: "Show more" },
|
|
1291
|
-
"es-ES": { loading: "Cargando", showMore: "Mostrar más" },
|
|
1292
|
-
"es-MX": { loading: "Cargando", showMore: "Mostrar más" },
|
|
1293
|
-
"fr-FR": { loading: "Chargement", showMore: "Afficher plus" },
|
|
1294
|
-
"it-IT": { loading: "Caricamento", showMore: "Mostra di più" },
|
|
1295
|
-
"ja-JP": { loading: "読み込み中", showMore: "さらに表示" },
|
|
1296
|
-
"pt-BR": { loading: "Carregando", showMore: "Mostrar mais" },
|
|
1297
|
-
"zh-CN": { loading: "正在加载", showMore: "显示更多" }
|
|
1298
|
-
}, ps = 36, gs = J({
|
|
1299
|
-
name: "bento-listbox",
|
|
1300
|
-
components: {
|
|
1301
|
-
BentoEmptyState: vt,
|
|
1302
|
-
BentoListboxSingleSelect: Yt,
|
|
1303
|
-
BentoListboxMultiSelect: xe,
|
|
1304
|
-
BentoTypography: ie,
|
|
1305
|
-
BentoLoadingIndicator: gt,
|
|
1306
|
-
BentoLoadingButton: Et
|
|
1307
|
-
},
|
|
1308
|
-
directives: { BentoKeyboardNavigationDirective: he },
|
|
1309
|
-
i18n: { messages: Ve },
|
|
1310
|
-
props: {
|
|
1311
|
-
/**
|
|
1312
|
-
* Defines a string value that labels an interactive element.
|
|
1313
|
-
*/
|
|
1314
|
-
ariaLabel: { type: String, default: null },
|
|
1315
|
-
/**
|
|
1316
|
-
* Empty state props that will be used with the inner empty state component to be displayed when no search results are found.
|
|
1317
|
-
*/
|
|
1318
|
-
emptyState: {
|
|
1319
|
-
type: Object,
|
|
1320
|
-
default: void 0
|
|
1321
|
-
},
|
|
1322
|
-
/**
|
|
1323
|
-
* Indicates whether there are more items to load
|
|
1324
|
-
*/
|
|
1325
|
-
hasMoreItems: { type: Boolean, default: !1 },
|
|
1326
|
-
/**
|
|
1327
|
-
* Identifies the listbox whose contents are controlled by the the combobox on which the aria-controls attribute is set.
|
|
1328
|
-
*/
|
|
1329
|
-
id: { type: String, required: !0 },
|
|
1330
|
-
/**
|
|
1331
|
-
* Function that allows the options to be disabled
|
|
1332
|
-
*
|
|
1333
|
-
* @type {BentoListboxIsOptionDisabled}
|
|
1334
|
-
* @param {BentoListboxOptionItem} option - Listbox option object
|
|
1335
|
-
* @param {string} option.label - Option's label text
|
|
1336
|
-
* @param {string|number} option.value - Option's value
|
|
1337
|
-
* @param {unknown} option.data - Option's extra data to be passed to the default slot
|
|
1338
|
-
*/
|
|
1339
|
-
isOptionDisabled: {
|
|
1340
|
-
type: Function,
|
|
1341
|
-
default: () => {
|
|
1342
|
-
}
|
|
1343
|
-
},
|
|
1344
|
-
/**
|
|
1345
|
-
* The option elements to populate the listbox with.
|
|
1346
|
-
* It must be an array of {@see BentoListboxOptionItem }
|
|
1347
|
-
* * @property {string} value.label - Text to be displayed in the option
|
|
1348
|
-
* * @property {string,number} value.value - Value of the option
|
|
1349
|
-
*/
|
|
1350
|
-
items: {
|
|
1351
|
-
type: Array,
|
|
1352
|
-
required: !0
|
|
1353
|
-
},
|
|
1354
|
-
/**
|
|
1355
|
-
* Indicates if new options are lazy loading.
|
|
1356
|
-
*/
|
|
1357
|
-
loading: { type: Boolean, default: !1 },
|
|
1358
|
-
/**
|
|
1359
|
-
* The type of `Lazy Load`.
|
|
1360
|
-
* Type "automatic" will enable infinite scrolling
|
|
1361
|
-
* Type "button" will enable lazy loading with "Show more" button
|
|
1362
|
-
*/
|
|
1363
|
-
lazyLoadType: {
|
|
1364
|
-
type: String,
|
|
1365
|
-
default: le.NONE,
|
|
1366
|
-
validator: (e) => Object.values(le).includes(e)
|
|
1367
|
-
},
|
|
1368
|
-
/**
|
|
1369
|
-
* Indicates the listbox is loading filtered items.
|
|
1370
|
-
*/
|
|
1371
|
-
componentLoading: { type: Boolean, default: !1 },
|
|
1372
|
-
/**
|
|
1373
|
-
* If enabled, the user will be able to select multiple items.
|
|
1374
|
-
*/
|
|
1375
|
-
multiple: { type: Boolean, default: !1 },
|
|
1376
|
-
/**
|
|
1377
|
-
* If enabled, dropdown will display non-selectable, static categories
|
|
1378
|
-
*/
|
|
1379
|
-
staticCategories: { type: Boolean, default: !1 },
|
|
1380
|
-
/**
|
|
1381
|
-
* Messaged displayed when no items are listed in the listbox
|
|
1382
|
-
*/
|
|
1383
|
-
noResultsMessage: { type: String, required: !0 },
|
|
1384
|
-
/**
|
|
1385
|
-
* Flag that indicates that an external search it's being made
|
|
1386
|
-
* to filter out the items inside the the multi-select listbox
|
|
1387
|
-
*
|
|
1388
|
-
* If enabled, hides the "Select all" checkbox in "multiple" mode.
|
|
1389
|
-
*/
|
|
1390
|
-
searching: xe.props.searching,
|
|
1391
|
-
/**
|
|
1392
|
-
* The `input` value.
|
|
1393
|
-
* Providing an empty string or empty array will select no options.
|
|
1394
|
-
* Set to an empty string `''` if you don't want any of the available options to be selected for single select
|
|
1395
|
-
*/
|
|
1396
|
-
selectedValue: {
|
|
1397
|
-
type: Array,
|
|
1398
|
-
default: () => []
|
|
1399
|
-
},
|
|
1400
|
-
/**
|
|
1401
|
-
* Enables virtual scrolling if set to true or by providing an object with itemHeight function.
|
|
1402
|
-
* The itemHeight function is used to calculate the height of rendered item given it's index.
|
|
1403
|
-
*/
|
|
1404
|
-
virtualScroll: {
|
|
1405
|
-
type: [Boolean, Object],
|
|
1406
|
-
default: !1
|
|
1407
|
-
}
|
|
1408
|
-
},
|
|
1409
|
-
emits: [
|
|
1410
|
-
p.SELECT,
|
|
1411
|
-
p.SPACE,
|
|
1412
|
-
p.SHOW_MORE,
|
|
1413
|
-
p.ENTER,
|
|
1414
|
-
p.ESCAPE,
|
|
1415
|
-
p.TAB
|
|
1416
|
-
],
|
|
1417
|
-
setup(e, { emit: t, slots: o }) {
|
|
1418
|
-
const s = I([]), i = pe(e, "items"), { t: r } = _e({ messages: Ve }), a = b(() => e.lazyLoadType !== le.AUTOMATIC), f = b(() => e.lazyLoadType === le.AUTOMATIC), S = () => typeof e?.virtualScroll == "object" && e?.virtualScroll?.itemHeight ? e.virtualScroll.itemHeight : ps, {
|
|
1419
|
-
containerRef: n,
|
|
1420
|
-
containerProps: u,
|
|
1421
|
-
onScroll: l,
|
|
1422
|
-
list: m,
|
|
1423
|
-
wrapperProps: C
|
|
1424
|
-
} = Tt(i, {
|
|
1425
|
-
itemHeight: S(),
|
|
1426
|
-
// Disable virtual scrolling if not enabled or if lazy loading is enabled or if multi-select
|
|
1427
|
-
disabled: e?.multiple || e?.virtualScroll === !1 || e?.lazyLoadType !== "none"
|
|
1428
|
-
}), h = b(
|
|
1429
|
-
() => e.componentLoading !== void 0 || a.value ? "true" : void 0
|
|
1430
|
-
), R = b(
|
|
1431
|
-
() => a.value && e.loading || e.componentLoading ? "true" : "false"
|
|
1432
|
-
), x = b(
|
|
1433
|
-
() => a.value || e.componentLoading !== void 0 ? "polite" : void 0
|
|
1434
|
-
), k = b(
|
|
1435
|
-
() => ({
|
|
1436
|
-
"aria-label": e.ariaLabel,
|
|
1437
|
-
"aria-busy": R.value,
|
|
1438
|
-
"aria-atomic": h.value,
|
|
1439
|
-
"aria-live": x.value
|
|
1440
|
-
})
|
|
1441
|
-
), $ = b(
|
|
1442
|
-
() => e.componentLoading ? {
|
|
1443
|
-
...k.value,
|
|
1444
|
-
role: "alert"
|
|
1445
|
-
} : {}
|
|
1446
|
-
), T = (U) => (se) => {
|
|
1447
|
-
t(U, se);
|
|
1448
|
-
}, O = () => {
|
|
1449
|
-
t(p.SHOW_MORE);
|
|
1450
|
-
}, D = ms(() => {
|
|
1451
|
-
const U = n.value;
|
|
1452
|
-
if (!U)
|
|
1453
|
-
return;
|
|
1454
|
-
const se = Math.round(U.scrollTop) + U.clientHeight >= U.scrollHeight;
|
|
1455
|
-
e.hasMoreItems && se && !e.loading && O();
|
|
1456
|
-
}), z = () => {
|
|
1457
|
-
f.value ? D() : l();
|
|
1458
|
-
}, re = b(() => e.items?.length === 0), M = b(
|
|
1459
|
-
() => e.lazyLoadType === le.BUTTON && e.hasMoreItems
|
|
1460
|
-
), Y = b(
|
|
1461
|
-
() => e.loading ? Pe.LOADING : Pe.START
|
|
1462
|
-
), Z = b(() => e.loading ? r("loading") : r("showMore")), Ee = b(() => ({
|
|
1463
|
-
...e.emptyState,
|
|
1464
|
-
variant: "condensed"
|
|
1465
|
-
})), Oe = {
|
|
1466
|
-
[p.SELECT]: T(p.SELECT),
|
|
1467
|
-
[p.SPACE]: T(p.SPACE),
|
|
1468
|
-
[p.TAB]: T(p.TAB),
|
|
1469
|
-
[p.ENTER]: T(p.ENTER)
|
|
1470
|
-
};
|
|
1471
|
-
return {
|
|
1472
|
-
// Refs
|
|
1473
|
-
listboxRef: n,
|
|
1474
|
-
listboxItemRef: s,
|
|
1475
|
-
// a11y
|
|
1476
|
-
ariaAttributes: k,
|
|
1477
|
-
listboxContainerAttributes: $,
|
|
1478
|
-
// Values
|
|
1479
|
-
containerProps: u,
|
|
1480
|
-
isSearchResultEmpty: re,
|
|
1481
|
-
limitedEmptyStateProps: Ee,
|
|
1482
|
-
loadingButtonState: Y,
|
|
1483
|
-
slots: o,
|
|
1484
|
-
shouldDisplayShowMoreButton: M,
|
|
1485
|
-
showMoreButtonText: Z,
|
|
1486
|
-
virtualisedItems: m,
|
|
1487
|
-
wrapperProps: C,
|
|
1488
|
-
// Enums
|
|
1489
|
-
BentoKeyboardNavigationKeyDownEvent: F,
|
|
1490
|
-
BentoListboxEvent: p,
|
|
1491
|
-
// Methods
|
|
1492
|
-
onListboxContainerScroll: z,
|
|
1493
|
-
onOptionSelected: T,
|
|
1494
|
-
emitShowMore: O,
|
|
1495
|
-
listboxListeners: Oe
|
|
1496
|
-
};
|
|
1497
|
-
}
|
|
1498
|
-
}), vs = ["id"], fs = {
|
|
1499
|
-
key: 0,
|
|
1500
|
-
class: "b-listbox__loading-filtered-items"
|
|
1501
|
-
}, ys = {
|
|
1502
|
-
key: 1,
|
|
1503
|
-
class: "b-listbox__empty-search-message"
|
|
1504
|
-
}, Ss = {
|
|
1505
|
-
key: 2,
|
|
1506
|
-
class: "b-listbox__lazy-load"
|
|
1507
|
-
}, hs = {
|
|
1508
|
-
key: 3,
|
|
1509
|
-
class: "b-listbox__lazy-load"
|
|
1510
|
-
};
|
|
1511
|
-
function Cs(e, t, o, s, i, r) {
|
|
1512
|
-
const a = _("bento-loading-indicator"), f = _("bento-empty-state"), S = _("bento-typography"), n = _("bento-listbox-multi-select"), u = _("bento-listbox-single-select"), l = _("bento-loading-button"), m = Ue("bento-keyboard-navigation-directive");
|
|
1513
|
-
return ne((d(), y("div", w({
|
|
1514
|
-
id: e.id,
|
|
1515
|
-
ref: "listboxRef",
|
|
1516
|
-
class: "b-listbox",
|
|
1517
|
-
tabindex: "-1"
|
|
1518
|
-
}, e.listboxContainerAttributes, {
|
|
1519
|
-
style: e.containerProps?.style,
|
|
1520
|
-
"data-testid": "listbox-container",
|
|
1521
|
-
onScroll: t[0] || (t[0] = (...C) => e.onListboxContainerScroll && e.onListboxContainerScroll(...C))
|
|
1522
|
-
}), [
|
|
1523
|
-
G("div", oe(me(e.wrapperProps)), [
|
|
1524
|
-
e.componentLoading ? (d(), y("div", fs, [
|
|
1525
|
-
N(a)
|
|
1526
|
-
])) : e.isSearchResultEmpty ? (d(), y("div", ys, [
|
|
1527
|
-
e.emptyState ? (d(), A(f, oe(w({ key: 0 }, e.limitedEmptyStateProps)), null, 16)) : (d(), A(S, {
|
|
1528
|
-
key: 1,
|
|
1529
|
-
el: "span"
|
|
1530
|
-
}, {
|
|
1531
|
-
default: L(() => [
|
|
1532
|
-
K(V(e.noResultsMessage), 1)
|
|
1533
|
-
]),
|
|
1534
|
-
_: 1
|
|
1535
|
-
}))
|
|
1536
|
-
])) : (d(), y(te, { key: 2 }, [
|
|
1537
|
-
e.multiple ? (d(), A(n, w({
|
|
1538
|
-
key: 0,
|
|
1539
|
-
ref: "listboxItemRef",
|
|
1540
|
-
"has-more-items": e.hasMoreItems
|
|
1541
|
-
}, e.ariaAttributes, {
|
|
1542
|
-
items: e.items,
|
|
1543
|
-
"lazy-load-type": e.lazyLoadType,
|
|
1544
|
-
"static-categories": e.staticCategories,
|
|
1545
|
-
"selected-values": e.selectedValue,
|
|
1546
|
-
searching: e.searching,
|
|
1547
|
-
"is-option-disabled": e.isOptionDisabled
|
|
1548
|
-
}, ee(e.listboxListeners)), ge({ _: 2 }, [
|
|
1549
|
-
j(e.slots, (C, h) => ({
|
|
1550
|
-
name: h,
|
|
1551
|
-
fn: L((R) => [
|
|
1552
|
-
W(e.$slots, h, oe(me(R)), void 0, !0)
|
|
1553
|
-
])
|
|
1554
|
-
}))
|
|
1555
|
-
]), 1040, ["has-more-items", "items", "lazy-load-type", "static-categories", "selected-values", "searching", "is-option-disabled"])) : (d(), A(u, w({
|
|
1556
|
-
key: 1,
|
|
1557
|
-
ref: "listboxItemRef",
|
|
1558
|
-
items: e.virtualisedItems
|
|
1559
|
-
}, e.ariaAttributes, {
|
|
1560
|
-
"selected-value": e.selectedValue,
|
|
1561
|
-
"static-categories": e.staticCategories,
|
|
1562
|
-
"is-option-disabled": e.isOptionDisabled
|
|
1563
|
-
}, ee(e.listboxListeners)), ge({ _: 2 }, [
|
|
1564
|
-
j(e.slots, (C, h) => ({
|
|
1565
|
-
name: h,
|
|
1566
|
-
fn: L((R) => [
|
|
1567
|
-
W(e.$slots, h, oe(me(R)), void 0, !0)
|
|
1568
|
-
])
|
|
1569
|
-
}))
|
|
1570
|
-
]), 1040, ["items", "selected-value", "static-categories", "is-option-disabled"])),
|
|
1571
|
-
e.shouldDisplayShowMoreButton ? (d(), y("div", Ss, [
|
|
1572
|
-
N(l, {
|
|
1573
|
-
state: e.loadingButtonState,
|
|
1574
|
-
variant: "secondary",
|
|
1575
|
-
onClickCapture: e.emitShowMore
|
|
1576
|
-
}, {
|
|
1577
|
-
default: L(() => [
|
|
1578
|
-
K(V(e.showMoreButtonText), 1)
|
|
1579
|
-
]),
|
|
1580
|
-
_: 1
|
|
1581
|
-
}, 8, ["state", "onClickCapture"])
|
|
1582
|
-
])) : e.loading ? (d(), y("div", hs, [
|
|
1583
|
-
N(a)
|
|
1584
|
-
])) : q("", !0)
|
|
1585
|
-
], 64))
|
|
1586
|
-
], 16)
|
|
1587
|
-
], 16, vs)), [
|
|
1588
|
-
[m]
|
|
1589
|
-
]);
|
|
1590
|
-
}
|
|
1591
|
-
const xs = /* @__PURE__ */ H(gs, [["render", Cs], ["__scopeId", "data-v-ef1c27fa"]]), Ie = (e, t) => {
|
|
1592
|
-
for (const o of e) {
|
|
1593
|
-
if (o.value === t)
|
|
1594
|
-
return o;
|
|
1595
|
-
if (o.items) {
|
|
1596
|
-
const s = Ie(o.items, t);
|
|
1597
|
-
if (s)
|
|
1598
|
-
return s;
|
|
1599
|
-
}
|
|
1600
|
-
}
|
|
1601
|
-
return null;
|
|
1602
|
-
}, Es = (e) => typeof e == "object" && e !== null && "value" in e && "label" in e, Vs = (e, t, o, s) => {
|
|
1603
|
-
const i = I([]), r = I(), a = (u) => {
|
|
1604
|
-
o.value ? r.value = u.map(({ value: l }) => l) : r.value = u.length > 0 ? u[0].value : null;
|
|
1605
|
-
}, f = (u) => {
|
|
1606
|
-
o.value ? r.value = u.map(({ value: l, label: m }) => ({ value: l, label: m })) : r.value = u.length > 0 ? { value: u[0].value, label: u[0].label } : null;
|
|
1607
|
-
}, S = (u) => {
|
|
1608
|
-
i.value = u, s?.value ? f(u) : a(u);
|
|
1609
|
-
}, n = () => {
|
|
1610
|
-
i.value = [], r.value = null;
|
|
1611
|
-
};
|
|
1612
|
-
return fe(
|
|
1613
|
-
() => t.value,
|
|
1614
|
-
() => {
|
|
1615
|
-
if (!t.value && t.value !== 0) {
|
|
1616
|
-
n();
|
|
1617
|
-
return;
|
|
1618
|
-
}
|
|
1619
|
-
const u = !Array.isArray(t.value), l = [...i.value];
|
|
1620
|
-
n();
|
|
1621
|
-
const m = (C) => {
|
|
1622
|
-
if (Es(C))
|
|
1623
|
-
i.value.push(C);
|
|
1624
|
-
else {
|
|
1625
|
-
let h = Ie(e.value, C);
|
|
1626
|
-
h || (h = Ie(l, C)), h || (h = { value: C, label: C.toString() }), i.value.push(h);
|
|
1627
|
-
}
|
|
1628
|
-
};
|
|
1629
|
-
if (u) {
|
|
1630
|
-
const C = t.value;
|
|
1631
|
-
m(C), s?.value ? f(i.value) : a(i.value);
|
|
1632
|
-
return;
|
|
1633
|
-
}
|
|
1634
|
-
t.value.forEach(m), s?.value ? f(i.value) : a(i.value);
|
|
1635
|
-
},
|
|
1636
|
-
{ immediate: !0 }
|
|
1637
|
-
), {
|
|
1638
|
-
// Values
|
|
1639
|
-
cachedSelectedListboxOptions: i,
|
|
1640
|
-
cachedListboxSelectedValues: r,
|
|
1641
|
-
// Methods
|
|
1642
|
-
resetCache: n,
|
|
1643
|
-
setCachedValues: S
|
|
1644
|
-
};
|
|
1645
|
-
};
|
|
1646
|
-
export {
|
|
1647
|
-
p as B,
|
|
1648
|
-
Mt as C,
|
|
1649
|
-
Ae as D,
|
|
1650
|
-
le as a,
|
|
1651
|
-
xs as b,
|
|
1652
|
-
is as c,
|
|
1653
|
-
ms as d,
|
|
1654
|
-
We as e,
|
|
1655
|
-
Vs as u
|
|
1656
|
-
};
|
|
1657
|
-
//# sourceMappingURL=use-cached-selected-values.Bx8uuky9.js.map
|