@adyen/bento-vue3 1.96.1 → 1.97.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 +159 -125
- 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/alert.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/calendar.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/country.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-picker.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/date-time-picker.css +1 -1
- package/dist/assets/dialog-page.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/inspector.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/navigation-menu-group.css +1 -1
- package/dist/assets/secondary-nav.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/summary-grid.css +1 -1
- package/dist/assets/textarea.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.CIVprT2U.js → action-bar.BEV9uXHS.js} +3 -3
- package/dist/chunks/{action-bar.CIVprT2U.js.map → action-bar.BEV9uXHS.js.map} +1 -1
- package/dist/chunks/{ai-tag.DkTlRY__.js → ai-tag.BSzY3-0w.js} +2 -2
- package/dist/chunks/{ai-tag.DkTlRY__.js.map → ai-tag.BSzY3-0w.js.map} +1 -1
- package/dist/chunks/{alert.RD0qOLhx.js → alert.V1imvtyI.js} +3 -3
- package/dist/chunks/alert.V1imvtyI.js.map +1 -0
- package/dist/chunks/{base-modal.BKtpH-qh.js → base-modal.B7SiRo7c.js} +3 -3
- package/dist/chunks/{base-modal.BKtpH-qh.js.map → base-modal.B7SiRo7c.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.cMAAF47d.js → button-actions-with-menu.DoUcLg-M.js} +2 -2
- package/dist/chunks/{button-actions-with-menu.cMAAF47d.js.map → button-actions-with-menu.DoUcLg-M.js.map} +1 -1
- package/dist/chunks/{button-actions.CxTxPprd.js → button-actions.CWmTl4cF.js} +170 -161
- package/dist/chunks/{button-actions.CxTxPprd.js.map → button-actions.CWmTl4cF.js.map} +1 -1
- package/dist/chunks/calendar.6NKd6IMo.js +1272 -0
- package/dist/chunks/calendar.6NKd6IMo.js.map +1 -0
- package/dist/chunks/{card.CQlyqa5-.js → card.Ca7FkYxy.js} +2 -2
- package/dist/chunks/{card.CQlyqa5-.js.map → card.Ca7FkYxy.js.map} +1 -1
- package/dist/chunks/{checkbox-group.BcDIXL27.js → checkbox-group.BWx4wn0F.js} +2 -2
- package/dist/chunks/{checkbox-group.BcDIXL27.js.map → checkbox-group.BWx4wn0F.js.map} +1 -1
- package/dist/chunks/{checkbox.LTRqb-pE.js → checkbox.DwfrmbwI.js} +18 -18
- package/dist/chunks/{checkbox.LTRqb-pE.js.map → checkbox.DwfrmbwI.js.map} +1 -1
- package/dist/chunks/{code-snippet.DHzB-8JJ.js → code-snippet.Cp61a0Ud.js} +3 -3
- package/dist/chunks/{code-snippet.DHzB-8JJ.js.map → code-snippet.Cp61a0Ud.js.map} +1 -1
- package/dist/chunks/{country.15m_ATbO.js → country.a-fpQGLP.js} +2 -2
- package/dist/chunks/country.a-fpQGLP.js.map +1 -0
- package/dist/chunks/{dashboard-section.Da6ZFGtm.js → dashboard-section.BR0xU-b-.js} +2 -2
- package/dist/chunks/{dashboard-section.Da6ZFGtm.js.map → dashboard-section.BR0xU-b-.js.map} +1 -1
- package/dist/chunks/{dashed-underline.DJmMXcdt.js → dashed-underline.CxpIRlCx.js} +2 -2
- package/dist/chunks/{dashed-underline.DJmMXcdt.js.map → dashed-underline.CxpIRlCx.js.map} +1 -1
- package/dist/chunks/{data-grid-template.-MuGcJp1.js → data-grid-template.LTILymaF.js} +2 -2
- package/dist/chunks/{data-grid-template.-MuGcJp1.js.map → data-grid-template.LTILymaF.js.map} +1 -1
- package/dist/chunks/{data-grid.kZgqWqQx.js → data-grid.xcmkjuyg.js} +26 -27
- package/dist/chunks/{data-grid.kZgqWqQx.js.map → data-grid.xcmkjuyg.js.map} +1 -1
- package/dist/chunks/date-picker.CCETX031.js +279 -0
- package/dist/chunks/date-picker.CCETX031.js.map +1 -0
- package/dist/chunks/date-picker.types.Ckt7zxGy.js.map +1 -1
- package/dist/chunks/date-range-picker.CtGaxtYh.js +1095 -0
- package/dist/chunks/date-range-picker.CtGaxtYh.js.map +1 -0
- package/dist/chunks/date-range-picker.types.Ckt7zxGy.js.map +1 -1
- package/dist/chunks/{draggable-handle.C1dudqKz.js → draggable-handle.CUecl-HB.js} +2 -2
- package/dist/chunks/{draggable-handle.C1dudqKz.js.map → draggable-handle.CUecl-HB.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.C1ei1SyR.js → dropdown-tag.BgZYYc_D.js} +2 -2
- package/dist/chunks/{dropdown-tag.C1ei1SyR.js.map → dropdown-tag.BgZYYc_D.js.map} +1 -1
- package/dist/chunks/dropdown.C97ShfXZ.js +2958 -0
- package/dist/chunks/dropdown.C97ShfXZ.js.map +1 -0
- package/dist/chunks/{file-uploader.C9YOBRQg.js → file-uploader.CXgAfp0m.js} +2 -2
- package/dist/chunks/{file-uploader.C9YOBRQg.js.map → file-uploader.CXgAfp0m.js.map} +1 -1
- package/dist/chunks/{filter-bar.CzFtzztU.js → filter-bar.D8BVPHLT.js} +44 -41
- package/dist/chunks/filter-bar.D8BVPHLT.js.map +1 -0
- package/dist/chunks/{footer-actions.zlKq74F1.js → footer-actions.C_HlJeXP.js} +2 -2
- package/dist/chunks/{footer-actions.zlKq74F1.js.map → footer-actions.C_HlJeXP.js.map} +1 -1
- package/dist/chunks/{form-layout-title.Kwve4xv2.js → form-layout-title.CWw0poO8.js} +2 -2
- package/dist/chunks/{form-layout-title.Kwve4xv2.js.map → form-layout-title.CWw0poO8.js.map} +1 -1
- package/dist/chunks/{header-meta.NFZo1ACP.js → header-meta.yBxBW12f.js} +2 -2
- package/dist/chunks/{header-meta.NFZo1ACP.js.map → header-meta.yBxBW12f.js.map} +1 -1
- package/dist/chunks/{header-with-views.ubPTyW9A.js → header-with-views.qCyKEZW1.js} +8 -8
- package/dist/chunks/{header-with-views.ubPTyW9A.js.map → header-with-views.qCyKEZW1.js.map} +1 -1
- package/dist/chunks/{header.Ds0sFKBB.js → header.aJLkRe1D.js} +3 -3
- package/dist/chunks/{header.Ds0sFKBB.js.map → header.aJLkRe1D.js.map} +1 -1
- package/dist/chunks/{input-field-password.CZ-NTpZF.js → input-field-password.DUSoJYKT.js} +3 -3
- package/dist/chunks/{input-field-password.CZ-NTpZF.js.map → input-field-password.DUSoJYKT.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.DOHk6gSp.js → input-field-phone-number.Q-bQJL4g.js} +2 -2
- package/dist/chunks/{input-field-phone-number.DOHk6gSp.js.map → input-field-phone-number.Q-bQJL4g.js.map} +1 -1
- package/dist/chunks/{input-field.DBlTGgAD.js → input-field.CvnmfrzQ.js} +2 -2
- package/dist/chunks/{input-field.DBlTGgAD.js.map → input-field.CvnmfrzQ.js.map} +1 -1
- package/dist/chunks/{input-time.CHIjCO74.js → input-time.CGPUOOQ9.js} +45 -45
- package/dist/chunks/{input-time.CHIjCO74.js.map → input-time.CGPUOOQ9.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.DmruiE3n.js → modal-fullscreen.CBxh_3gU.js} +2 -2
- package/dist/chunks/{modal-fullscreen.DmruiE3n.js.map → modal-fullscreen.CBxh_3gU.js.map} +1 -1
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.CrJQWuzb.js → modal.vue_vue_type_script_setup_true_lang.C3xuswtY.js} +4 -4
- package/dist/chunks/{modal.vue_vue_type_script_setup_true_lang.CrJQWuzb.js.map → modal.vue_vue_type_script_setup_true_lang.C3xuswtY.js.map} +1 -1
- package/dist/chunks/{pagination.DbpHH_53.js → pagination.cNByWBP1.js} +2 -2
- package/dist/chunks/{pagination.DbpHH_53.js.map → pagination.cNByWBP1.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.u-V4fNWK.js → rich-text-editor.CJA_d518.js} +3 -3
- package/dist/chunks/{rich-text-editor.u-V4fNWK.js.map → rich-text-editor.CJA_d518.js.map} +1 -1
- package/dist/chunks/{search-bar.TKgi1KLs.js → search-bar.CLjqWNaI.js} +6 -6
- package/dist/chunks/{search-bar.TKgi1KLs.js.map → search-bar.CLjqWNaI.js.map} +1 -1
- package/dist/chunks/{secondary-nav.0OsJiAWI.js → secondary-nav.BU47gyEO.js} +2 -2
- package/dist/chunks/{secondary-nav.0OsJiAWI.js.map → secondary-nav.BU47gyEO.js.map} +1 -1
- package/dist/chunks/{selection-card-group.C59ZIrVm.js → selection-card-group.C2Av3uyz.js} +9 -9
- package/dist/chunks/{selection-card-group.C59ZIrVm.js.map → selection-card-group.C2Av3uyz.js.map} +1 -1
- package/dist/chunks/{sidepanel.BVQt6Tac.js → sidepanel.Dw2If3qM.js} +3 -3
- package/dist/chunks/{sidepanel.BVQt6Tac.js.map → sidepanel.Dw2If3qM.js.map} +1 -1
- package/dist/chunks/{summary-grid.types.9sUs0LS0.js → summary-grid.types.Cnrc4ThJ.js} +3 -3
- package/dist/chunks/summary-grid.types.Cnrc4ThJ.js.map +1 -0
- package/dist/chunks/{timeline-item.DfwOm5do.js → timeline-item.BWhCoOf1.js} +3 -3
- package/dist/chunks/{timeline-item.DfwOm5do.js.map → timeline-item.BWhCoOf1.js.map} +1 -1
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.B5-sWGlz.js → tutorial.vue_vue_type_script_setup_true_lang.QWcInKo7.js} +2 -2
- package/dist/chunks/{tutorial.vue_vue_type_script_setup_true_lang.B5-sWGlz.js.map → tutorial.vue_vue_type_script_setup_true_lang.QWcInKo7.js.map} +1 -1
- package/dist/chunks/use-bento-delayed-hover.Csc3nIWt.js.map +1 -1
- package/dist/chunks/{use-date-input-formatter.x285YiSd.js → use-date-input-formatter.QXaVIBS0.js} +2 -2
- package/dist/chunks/{use-date-input-formatter.x285YiSd.js.map → use-date-input-formatter.QXaVIBS0.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/country.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/date-time-picker.js +87 -79
- package/dist/date-time-picker.js.map +1 -1
- package/dist/draggable.js +1 -1
- package/dist/dropdown.js +11 -12
- package/dist/dropdown.js.map +1 -1
- 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 +255 -256
- 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 +13 -13
- 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/timeline.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +4 -4
- package/dist/assets/use-cached-selected-values.css +0 -1
- package/dist/chunks/alert.RD0qOLhx.js.map +0 -1
- package/dist/chunks/calendar.iQyNwQBL.js +0 -1207
- package/dist/chunks/calendar.iQyNwQBL.js.map +0 -1
- package/dist/chunks/country.15m_ATbO.js.map +0 -1
- package/dist/chunks/date-picker.DyImOUH4.js +0 -277
- package/dist/chunks/date-picker.DyImOUH4.js.map +0 -1
- package/dist/chunks/date-range-picker.BigC6wm2.js +0 -1019
- package/dist/chunks/date-range-picker.BigC6wm2.js.map +0 -1
- package/dist/chunks/dropdown.C5um1anU.js +0 -1233
- package/dist/chunks/dropdown.C5um1anU.js.map +0 -1
- package/dist/chunks/filter-bar.CzFtzztU.js.map +0 -1
- package/dist/chunks/summary-grid.types.9sUs0LS0.js.map +0 -1
- package/dist/chunks/use-cached-selected-values.DOw5IKdU.js +0 -1740
- package/dist/chunks/use-cached-selected-values.DOw5IKdU.js.map +0 -1
|
@@ -1,1233 +0,0 @@
|
|
|
1
|
-
import { ref as D, watch as ve, computed as d, defineComponent as _, useSlots as he, toRefs as _e, openBlock as b, createBlock as Y, resolveDynamicComponent as Ve, mergeProps as A, withCtx as R, createElementVNode as ie, withKeys as re, unref as o, createVNode as j, toHandlers as de, createSlots as be, renderList as ue, renderSlot as W, normalizeProps as oe, guardReactiveProps as ye, createCommentVNode as F, useAttrs as Ke, inject as Ie, nextTick as P, createElementBlock as C, normalizeClass as ne, Fragment as Ee, createTextVNode as fe, toDisplayString as Q, withModifiers as Me, withDirectives as se, vShow as me, toRef as U } from "vue";
|
|
2
|
-
import { B as qe, d as xe } from "./typography.B3J6_tYk.js";
|
|
3
|
-
import { g as te } from "./generate-uid.DBWe4g6T.js";
|
|
4
|
-
import { u as ge } from "./index.B875RXHM.js";
|
|
5
|
-
import { u as ze } from "./use-has-slot.CyMiImRQ.js";
|
|
6
|
-
import { C as yt } from "./cross-circle-fill.BWCKKn0E.js";
|
|
7
|
-
import { C as mt } from "./cross-circle-fill-small.H1wH-vcZ.js";
|
|
8
|
-
import { _ as ee } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
9
|
-
import { s as ae } from "./events.BQOQSSb7.js";
|
|
10
|
-
import { C as vt } from "./chevron-down.XeE-LBV_.js";
|
|
11
|
-
import { C as ht } from "./chevron-up.Cmgl2a3x.js";
|
|
12
|
-
/* empty css */
|
|
13
|
-
import { u as gt } from "./aria-label.CaUURpnB.js";
|
|
14
|
-
import { u as St } from "./form-field.D_2g7vaP.js";
|
|
15
|
-
import { B as S, b as Oe, a as Ne, d as wt, u as Lt, c as Ct, e as Et } from "./use-cached-selected-values.DOw5IKdU.js";
|
|
16
|
-
import { u as xt } from "./use-form-layout-loading.CWbjZiwP.js";
|
|
17
|
-
import { B as Ot } from "./directive.D1-d-C2K.js";
|
|
18
|
-
import { B as H, a as It } from "./keyboard-navigation.DWmhelVv.js";
|
|
19
|
-
import { F as Dt } from "./field-label.CLV3nSzz.js";
|
|
20
|
-
import { h as Bt, e as At } from "./button-actions.CxTxPprd.js";
|
|
21
|
-
import { P as Re } from "./popper-container.BH4WxeUj.js";
|
|
22
|
-
import { E as kt } from "./error-message.Dyvrw6ZB.js";
|
|
23
|
-
import "../assets/dropdown.css";
|
|
24
|
-
var le = /* @__PURE__ */ ((e) => (e.DEFAULT = "DropdownInputDefault", e.SMALL = "DropdownInputSmall", e))(le || {});
|
|
25
|
-
const De = {
|
|
26
|
-
"de-DE": { apply: "Anwenden", cancel: "Abbrechen", noOptionsMatchThisSearch: "Für diese Suche wurden keine Ergebnisse gefunden." },
|
|
27
|
-
"en-GB": { apply: "Apply", cancel: "Cancel", noOptionsMatchThisSearch: "No options match this search" },
|
|
28
|
-
"en-US": { apply: "Apply", cancel: "Cancel", noOptionsMatchThisSearch: "No options match this search" },
|
|
29
|
-
"es-ES": { apply: "Aplicar", cancel: "Cancelar", noOptionsMatchThisSearch: "No hay opciones que coincidan con esta búsqueda" },
|
|
30
|
-
"es-MX": { apply: "Aplicar", cancel: "Cancelar", noOptionsMatchThisSearch: "No hay opciones que coincidan con esta búsqueda" },
|
|
31
|
-
"fr-FR": { apply: "Appliquer", cancel: "Annuler", noOptionsMatchThisSearch: "Aucune option ne correspond à cette recherche" },
|
|
32
|
-
"it-IT": { apply: "Applica", cancel: "Annulla", noOptionsMatchThisSearch: "Nessun risultato corrispondente a questa ricerca" },
|
|
33
|
-
"ja-JP": { apply: "適用", cancel: "キャンセル", noOptionsMatchThisSearch: "この検索に一致するオプションはありません" },
|
|
34
|
-
"pt-BR": { apply: "Aplicar", cancel: "Cancelar", noOptionsMatchThisSearch: "Nenhuma opção corresponde a esta busca" },
|
|
35
|
-
"zh-CN": { apply: "应用", cancel: "取消", noOptionsMatchThisSearch: "没有符合此搜索条件的选项" }
|
|
36
|
-
}, Tt = (e, c, u, l) => {
|
|
37
|
-
const i = D(e.value), { t: s } = ge({ messages: De });
|
|
38
|
-
ve(e, () => {
|
|
39
|
-
i.value = e.value;
|
|
40
|
-
});
|
|
41
|
-
const t = d(
|
|
42
|
-
() => JSON.stringify(i.value) === JSON.stringify(e.value)
|
|
43
|
-
), a = () => {
|
|
44
|
-
l(S.SELECT, i.value), l(S.CLOSE_DROPDOWN);
|
|
45
|
-
}, m = () => {
|
|
46
|
-
i.value = e.value, l(S.CLOSE_DROPDOWN);
|
|
47
|
-
}, w = () => {
|
|
48
|
-
u.value && c.value && (i.value = e.value);
|
|
49
|
-
}, p = d(() => [
|
|
50
|
-
{
|
|
51
|
-
title: s("apply"),
|
|
52
|
-
event: a,
|
|
53
|
-
disabled: t.value
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
title: s("cancel"),
|
|
57
|
-
event: m
|
|
58
|
-
}
|
|
59
|
-
]), g = (h) => {
|
|
60
|
-
i.value = h, c.value || l(S.SELECT, h);
|
|
61
|
-
}, v = (h) => {
|
|
62
|
-
g(h), l(S.TAB);
|
|
63
|
-
}, y = (h) => {
|
|
64
|
-
g(h), l(S.ENTER);
|
|
65
|
-
}, I = (h) => {
|
|
66
|
-
g(h), l(S.SPACE);
|
|
67
|
-
}, B = () => {
|
|
68
|
-
m(), l(S.ESCAPE);
|
|
69
|
-
}, r = () => {
|
|
70
|
-
l(S.SHOW_MORE);
|
|
71
|
-
}, x = {
|
|
72
|
-
[S.SELECT]: g,
|
|
73
|
-
[S.SHOW_MORE]: r,
|
|
74
|
-
[S.TAB]: v,
|
|
75
|
-
[S.SPACE]: I,
|
|
76
|
-
[S.ENTER]: y
|
|
77
|
-
};
|
|
78
|
-
return {
|
|
79
|
-
// Values
|
|
80
|
-
actions: p,
|
|
81
|
-
internalSelectedValue: i,
|
|
82
|
-
// Methods
|
|
83
|
-
listeners: x,
|
|
84
|
-
onEscapeKey: B,
|
|
85
|
-
onOutsideDropdownClick: w
|
|
86
|
-
};
|
|
87
|
-
}, $t = _({
|
|
88
|
-
i18n: { messages: De },
|
|
89
|
-
name: "bento-dropdown-options-container"
|
|
90
|
-
}), Mt = /* @__PURE__ */ _({
|
|
91
|
-
...$t,
|
|
92
|
-
props: {
|
|
93
|
-
/**
|
|
94
|
-
* Defines a string value that labels an interactive element.
|
|
95
|
-
*/
|
|
96
|
-
ariaLabel: { type: String, default: null },
|
|
97
|
-
/**
|
|
98
|
-
* Indicates that dropdown items are loading
|
|
99
|
-
*/
|
|
100
|
-
componentLoading: { type: Boolean, default: !1 },
|
|
101
|
-
/**
|
|
102
|
-
* Empty state props used with the inner empty state component which is displayed when no search results are found.
|
|
103
|
-
*/
|
|
104
|
-
emptyState: {
|
|
105
|
-
type: Object,
|
|
106
|
-
default: void 0
|
|
107
|
-
},
|
|
108
|
-
/**
|
|
109
|
-
* Disables dropdown functionality
|
|
110
|
-
*/
|
|
111
|
-
disabled: { type: Boolean, default: !1 },
|
|
112
|
-
/**
|
|
113
|
-
* Indicates whether there are more items to load
|
|
114
|
-
*/
|
|
115
|
-
hasMoreItems: { type: Boolean, default: !1 },
|
|
116
|
-
/**
|
|
117
|
-
* Identifies the listbox whose contents are controlled by the the combobox on which the aria-controls attribute is set.
|
|
118
|
-
*/
|
|
119
|
-
id: { type: String, required: !0 },
|
|
120
|
-
/**
|
|
121
|
-
* Function that allows the options to be disabled
|
|
122
|
-
*
|
|
123
|
-
* @type {BentoDropdownIsOptionDisabled}
|
|
124
|
-
* @param {BentoDropdownOptionItem} option - Dropdown option object
|
|
125
|
-
* @param {string} option.label - Option's label text
|
|
126
|
-
* @param {string|number} option.value - Option's value
|
|
127
|
-
* @param {unknown} option.data - Option's extra data to be passed to the default slot
|
|
128
|
-
*/
|
|
129
|
-
isOptionDisabled: {
|
|
130
|
-
type: Function,
|
|
131
|
-
default: void 0
|
|
132
|
-
},
|
|
133
|
-
/**
|
|
134
|
-
* The option elements to populate the dropdown with.
|
|
135
|
-
* It must be an array of {@see BentoDropdownOptionItem }
|
|
136
|
-
* * @property {string} value.label - Text to be displayed in the option
|
|
137
|
-
* * @property {string,number} value.value - Value of the option
|
|
138
|
-
*/
|
|
139
|
-
items: {
|
|
140
|
-
type: Array,
|
|
141
|
-
required: !0
|
|
142
|
-
},
|
|
143
|
-
/**
|
|
144
|
-
* The type of `Lazy Load`.
|
|
145
|
-
* Type "automatic" will enable infinite scrolling
|
|
146
|
-
* Type "button" will enable lazy loading with "Show more" button
|
|
147
|
-
*/
|
|
148
|
-
lazyLoadType: {
|
|
149
|
-
type: String,
|
|
150
|
-
default: Ne.AUTOMATIC,
|
|
151
|
-
validator: (e) => Object.values(Ne).includes(e)
|
|
152
|
-
},
|
|
153
|
-
/**
|
|
154
|
-
* Indicates if new options are lazy loading.
|
|
155
|
-
*/
|
|
156
|
-
loading: { type: Boolean, default: !1 },
|
|
157
|
-
/**
|
|
158
|
-
* If enabled, the user will be able to select multiple items.
|
|
159
|
-
*/
|
|
160
|
-
multiple: { type: Boolean, default: !1 },
|
|
161
|
-
/**
|
|
162
|
-
* Indicates if the dropdown is open so that
|
|
163
|
-
* the container can be displayed.
|
|
164
|
-
*/
|
|
165
|
-
open: { type: Boolean, required: !0 },
|
|
166
|
-
/**
|
|
167
|
-
* The `input` value.
|
|
168
|
-
* Providing an empty string or empty array will select no options.
|
|
169
|
-
* Set to an empty string `''` if you don't want any of the available options to be selected for single select
|
|
170
|
-
*/
|
|
171
|
-
selectedValue: {
|
|
172
|
-
type: Array,
|
|
173
|
-
default: null
|
|
174
|
-
},
|
|
175
|
-
/**
|
|
176
|
-
* Flag that indicates that an external search it's being made
|
|
177
|
-
* to filter out the items inside the the multi-select listbox
|
|
178
|
-
*
|
|
179
|
-
* If enabled, hides the "Select all" checkbox in "multiple" mode.
|
|
180
|
-
*/
|
|
181
|
-
searching: Oe.props.searching,
|
|
182
|
-
/**
|
|
183
|
-
* If enabled, dropdown will display non-selectable, static categories
|
|
184
|
-
*/
|
|
185
|
-
staticCategories: { type: Boolean, default: !1 },
|
|
186
|
-
/**
|
|
187
|
-
* Reference to the DOM element or Vue component for positioning
|
|
188
|
-
* the Dropdown container.
|
|
189
|
-
*/
|
|
190
|
-
targetElement: { type: Re.props.targetElement.type, required: !0 },
|
|
191
|
-
/**
|
|
192
|
-
* Enables virtual scrolling if set to true or by providing an object with itemHeight function.
|
|
193
|
-
* The itemHeight function is used to calculate the height of rendered item given it's index.
|
|
194
|
-
*/
|
|
195
|
-
virtualScroll: {
|
|
196
|
-
type: [Boolean, Object],
|
|
197
|
-
default: !1
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
setup(e, { expose: c, emit: u }) {
|
|
201
|
-
const l = he(), i = u, s = e, { selectedValue: t, multiple: a } = _e(s), m = D(null), { t: w } = ge({ messages: De }), p = d(() => s.open && !s.disabled), g = d(() => w("noOptionsMatchThisSearch")), v = d(() => ({
|
|
202
|
-
"b-dropdown-options-container--single": !s?.multiple
|
|
203
|
-
})), y = d(() => ({
|
|
204
|
-
"b-dropdown-options-container__listbox--single": !s?.multiple
|
|
205
|
-
})), { actions: I, internalSelectedValue: B, listeners: r, onEscapeKey: x, onOutsideDropdownClick: h } = Tt(t, a, p, i), L = d(() => s?.multiple ? Bt : Re), T = d(() => {
|
|
206
|
-
const $ = {
|
|
207
|
-
"min-width": `${s?.targetElement?.clientWidth}px`,
|
|
208
|
-
"max-width": "min(500px, 95%)"
|
|
209
|
-
};
|
|
210
|
-
return s?.multiple ? {
|
|
211
|
-
actionsLayout: "space-between",
|
|
212
|
-
ariaLabel: s.ariaLabel,
|
|
213
|
-
actions: I.value,
|
|
214
|
-
divider: !0,
|
|
215
|
-
fallbackPosition: ["top-start"],
|
|
216
|
-
id: te(`dropdown-options-${s.id}`),
|
|
217
|
-
open: s.open,
|
|
218
|
-
position: "bottom-start",
|
|
219
|
-
style: {
|
|
220
|
-
width: "auto",
|
|
221
|
-
...$
|
|
222
|
-
},
|
|
223
|
-
targetElement: s.targetElement
|
|
224
|
-
} : {
|
|
225
|
-
fallbackPosition: ["top-start"],
|
|
226
|
-
offset: [0, 8],
|
|
227
|
-
position: "bottom-start",
|
|
228
|
-
style: {
|
|
229
|
-
display: p.value ? "block" : "none",
|
|
230
|
-
...$
|
|
231
|
-
},
|
|
232
|
-
targetElement: s.targetElement
|
|
233
|
-
};
|
|
234
|
-
});
|
|
235
|
-
return c({
|
|
236
|
-
onOutsideDropdownClick: h
|
|
237
|
-
}), ($, V) => p.value ? (b(), Y(Ve(L.value), A({
|
|
238
|
-
key: 0,
|
|
239
|
-
class: ["b-dropdown-options-container", v.value]
|
|
240
|
-
}, T.value), {
|
|
241
|
-
default: R(() => [
|
|
242
|
-
ie("div", {
|
|
243
|
-
onKeydown: V[0] || (V[0] = re(
|
|
244
|
-
//@ts-ignore
|
|
245
|
-
(...K) => o(x) && o(x)(...K),
|
|
246
|
-
["esc"]
|
|
247
|
-
))
|
|
248
|
-
}, [
|
|
249
|
-
j(o(Oe), A({
|
|
250
|
-
id: e.id,
|
|
251
|
-
ref_key: "dropdownOptionsListboxRef",
|
|
252
|
-
ref: m,
|
|
253
|
-
"aria-label": e.ariaLabel,
|
|
254
|
-
class: ["b-dropdown-options-container__listbox", y.value],
|
|
255
|
-
"component-loading": e.componentLoading,
|
|
256
|
-
"empty-state": e.emptyState,
|
|
257
|
-
"is-option-disabled": e.isOptionDisabled,
|
|
258
|
-
items: e.items,
|
|
259
|
-
"selected-value": o(B),
|
|
260
|
-
multiple: o(a),
|
|
261
|
-
"static-categories": e.staticCategories,
|
|
262
|
-
"no-results-message": g.value,
|
|
263
|
-
searching: e.searching,
|
|
264
|
-
loading: e.loading,
|
|
265
|
-
"lazy-load-type": e.lazyLoadType,
|
|
266
|
-
"has-more-items": e.hasMoreItems,
|
|
267
|
-
"virtual-scroll": e.virtualScroll
|
|
268
|
-
}, de(o(r))), be({ _: 2 }, [
|
|
269
|
-
ue(o(l), (K, M) => ({
|
|
270
|
-
name: M,
|
|
271
|
-
fn: R((J) => [
|
|
272
|
-
W($.$slots, M, oe(ye(J)), void 0, !0)
|
|
273
|
-
])
|
|
274
|
-
}))
|
|
275
|
-
]), 1040, ["id", "aria-label", "class", "component-loading", "empty-state", "is-option-disabled", "items", "selected-value", "multiple", "static-categories", "no-results-message", "searching", "loading", "lazy-load-type", "has-more-items", "virtual-scroll"])
|
|
276
|
-
], 32)
|
|
277
|
-
]),
|
|
278
|
-
_: 3
|
|
279
|
-
}, 16, ["class"])) : F("", !0);
|
|
280
|
-
}
|
|
281
|
-
}), Nt = /* @__PURE__ */ ee(Mt, [["__scopeId", "data-v-abf92e14"]]);
|
|
282
|
-
var k = /* @__PURE__ */ ((e) => (e.DISABLED = "disabled", e.READONLY = "readonly", e.HAS_ITEMS = "has-items", e.OPENED = "opened", e.ERROR = "error", e))(k || {}), E = /* @__PURE__ */ ((e) => (e.OPEN = "dropdown-base-open", e.KEYDOWN = "dropdown-base-keydown", e.CLOSE = "dropdown-base-close", e.INPUT = "dropdown-base-input", e.CLEAR = "dropdown-base-clear", e))(E || {});
|
|
283
|
-
const Rt = /* @__PURE__ */ Symbol("dropdown small size injection key"), Ue = /* @__PURE__ */ Symbol("dropdown underline style injection key"), We = {
|
|
284
|
-
"de-DE": { clearSearch: "Suche löschen" },
|
|
285
|
-
"en-GB": { clearSearch: "Clear search" },
|
|
286
|
-
"en-US": { clearSearch: "Clear search" },
|
|
287
|
-
"es-ES": { clearSearch: "Borrar búsqueda" },
|
|
288
|
-
"es-MX": { clearSearch: "Borrar búsqueda" },
|
|
289
|
-
"fr-FR": { clearSearch: "Effacer la recherche" },
|
|
290
|
-
"it-IT": { clearSearch: "Cancella ricerca" },
|
|
291
|
-
"ja-JP": { clearSearch: "検索をクリア" },
|
|
292
|
-
"pt-BR": { clearSearch: "Limpar busca" },
|
|
293
|
-
"zh-CN": { clearSearch: "清除搜索" }
|
|
294
|
-
}, Ft = ["id", "value", "disabled", "readonly", "required"], Pt = ["id", "aria-readonly", "tabindex"], _t = {
|
|
295
|
-
key: 1,
|
|
296
|
-
class: "b-dropdown-base-textbox__input-multiple-selected"
|
|
297
|
-
}, Vt = { class: "b-dropdown-base-textbox__input-selected-element" }, Kt = {
|
|
298
|
-
key: 2,
|
|
299
|
-
class: "b-dropdown-base-textbox__additional-items"
|
|
300
|
-
}, qt = {
|
|
301
|
-
key: 3,
|
|
302
|
-
class: "b-dropdown-base-textbox__icon",
|
|
303
|
-
"aria-hidden": "true"
|
|
304
|
-
}, zt = ["tabindex", "onKeydown"], Ut = _({
|
|
305
|
-
i18n: { messages: We },
|
|
306
|
-
name: "dropdown-base-textbox",
|
|
307
|
-
inheritAttrs: !1
|
|
308
|
-
}), Wt = /* @__PURE__ */ _({
|
|
309
|
-
...Ut,
|
|
310
|
-
props: {
|
|
311
|
-
/**
|
|
312
|
-
* The number of additional items that have been selected in the dropdown.
|
|
313
|
-
*/
|
|
314
|
-
additionalItemsSelected: { type: [Number, String], default: 0 },
|
|
315
|
-
/**
|
|
316
|
-
* If the combobox DOM element should be an `input` element.
|
|
317
|
-
*/
|
|
318
|
-
alwaysComboboxIsInput: {
|
|
319
|
-
type: Boolean,
|
|
320
|
-
default: !1
|
|
321
|
-
},
|
|
322
|
-
/**
|
|
323
|
-
* Sets the aria-controls attribute on the textbox. This should correspond to the popover's id that the textbox triggers.
|
|
324
|
-
*/
|
|
325
|
-
ariaControls: { type: String, required: !0 },
|
|
326
|
-
/**
|
|
327
|
-
* Indicates whether the content the textbox triggers is visible or not. Needs to be set accordingly when the textbox is used and changed every time the popover is shown/hidden.
|
|
328
|
-
*/
|
|
329
|
-
ariaExpanded: {
|
|
330
|
-
type: [String, Boolean],
|
|
331
|
-
required: !0
|
|
332
|
-
},
|
|
333
|
-
/**
|
|
334
|
-
* If no label element is used then the aria-label is be set should be set.
|
|
335
|
-
*/
|
|
336
|
-
ariaLabel: { type: String, default: null },
|
|
337
|
-
/**
|
|
338
|
-
* Corresponds to the label's id that labels the textbox element.
|
|
339
|
-
*/
|
|
340
|
-
ariaLabelledby: { type: String, default: null },
|
|
341
|
-
/**
|
|
342
|
-
* Disables any textbox functionality
|
|
343
|
-
*/
|
|
344
|
-
disabled: { type: Boolean, default: !1 },
|
|
345
|
-
/**
|
|
346
|
-
* Selected option's label
|
|
347
|
-
*/
|
|
348
|
-
displayValue: { type: String, default: null },
|
|
349
|
-
/**
|
|
350
|
-
* Sets the possibility to type into the textbox.
|
|
351
|
-
*/
|
|
352
|
-
dynamicFiltering: { type: Boolean, default: !1 },
|
|
353
|
-
/**
|
|
354
|
-
* Marks the textbox as invalid, rendering an error state
|
|
355
|
-
*/
|
|
356
|
-
isInvalid: { type: Boolean, default: !1 },
|
|
357
|
-
/*
|
|
358
|
-
* If enabled, the user will be able to select multiple items.
|
|
359
|
-
*/
|
|
360
|
-
multiple: { type: Boolean, default: !1 },
|
|
361
|
-
/**
|
|
362
|
-
* Indicates if the dropdown is open so that
|
|
363
|
-
* the respective event can be emitted
|
|
364
|
-
*/
|
|
365
|
-
open: { type: Boolean, default: !1 },
|
|
366
|
-
/**
|
|
367
|
-
* Sets the dropdown to readonly state
|
|
368
|
-
*/
|
|
369
|
-
readonly: { type: Boolean, default: !1 },
|
|
370
|
-
/**
|
|
371
|
-
* The input value
|
|
372
|
-
*/
|
|
373
|
-
value: { type: String, default: "" },
|
|
374
|
-
/**
|
|
375
|
-
* The selected value's list box item.
|
|
376
|
-
*/
|
|
377
|
-
selectedValueItem: {
|
|
378
|
-
type: [Object, Array],
|
|
379
|
-
default: void 0
|
|
380
|
-
},
|
|
381
|
-
/**
|
|
382
|
-
* Toggles whether to use the slot content select items shown in the textbox in multiple mode.
|
|
383
|
-
*/
|
|
384
|
-
showSlotContentInMultiple: { type: Boolean, default: !1 },
|
|
385
|
-
/**
|
|
386
|
-
* Dropdown size
|
|
387
|
-
*/
|
|
388
|
-
size: {
|
|
389
|
-
type: String,
|
|
390
|
-
default: null
|
|
391
|
-
}
|
|
392
|
-
},
|
|
393
|
-
setup(e, { expose: c, emit: u }) {
|
|
394
|
-
const { t: l } = ge({ messages: We }), i = Ke(), s = he(), t = ze(s), a = e, m = u, w = D(null), p = te("textbox"), g = Ie(Ue, !1), v = d(() => ({
|
|
395
|
-
[`b-dropdown-base-textbox--${k.DISABLED}`]: a.disabled,
|
|
396
|
-
[`b-dropdown-base-textbox--${k.READONLY}`]: a.readonly,
|
|
397
|
-
[`b-dropdown-base-textbox--${k.HAS_ITEMS}`]: !!a.additionalItemsSelected,
|
|
398
|
-
"b-dropdown-base-textbox--underline": g
|
|
399
|
-
})), y = d(
|
|
400
|
-
() => h.value && i["aria-required"] ? "true" : null
|
|
401
|
-
), I = d(() => ({
|
|
402
|
-
"b-dropdown-base-textbox__input--dynamic-filtering": a.dynamicFiltering
|
|
403
|
-
})), B = d(() => a.dynamicFiltering && !!a.value && a.open), r = d(
|
|
404
|
-
() => ({
|
|
405
|
-
"aria-haspopup": "listbox",
|
|
406
|
-
"aria-controls": a.ariaControls,
|
|
407
|
-
"aria-describedby": i["aria-describedby"]?.toString(),
|
|
408
|
-
"aria-expanded": a.ariaExpanded ? "true" : "false",
|
|
409
|
-
"aria-labelledby": a.ariaLabelledby,
|
|
410
|
-
"aria-label": a.ariaLabelledby ? null : a.ariaLabel,
|
|
411
|
-
"aria-invalid": a.isInvalid,
|
|
412
|
-
"aria-disabled": a.disabled ? !0 : null,
|
|
413
|
-
"aria-required": i["aria-required"]
|
|
414
|
-
})
|
|
415
|
-
), x = d(
|
|
416
|
-
() => a.multiple ? a.selectedValueItem : []
|
|
417
|
-
), h = d(() => a.dynamicFiltering && (a.open || a.alwaysComboboxIsInput)), L = d(() => a.selectedValueItem && !a.multiple), T = d(
|
|
418
|
-
() => a.multiple && a.selectedValueItem && x.value.length > 0 && a.showSlotContentInMultiple
|
|
419
|
-
);
|
|
420
|
-
ve(
|
|
421
|
-
() => h.value,
|
|
422
|
-
() => {
|
|
423
|
-
h.value && !a.alwaysComboboxIsInput && P(() => {
|
|
424
|
-
w.value.focus();
|
|
425
|
-
});
|
|
426
|
-
}
|
|
427
|
-
);
|
|
428
|
-
const $ = async () => {
|
|
429
|
-
!a.disabled && !a.readonly && (m(E.OPEN), await P(), w.value.focus());
|
|
430
|
-
}, V = () => {
|
|
431
|
-
a.open && (w.value.focus(), m(E.CLOSE));
|
|
432
|
-
}, K = (O) => a.open && O.target.tagName === "INPUT" ? null : a.open ? V() : $(), M = () => {
|
|
433
|
-
m(E.CLEAR), m(E.INPUT, ""), w.value.focus();
|
|
434
|
-
}, J = (O) => {
|
|
435
|
-
!a.readonly && !a.disabled ? m(E.INPUT, O.target.value) : (O.preventDefault(), O.stopPropagation());
|
|
436
|
-
};
|
|
437
|
-
return c({
|
|
438
|
-
focus: () => {
|
|
439
|
-
w.value.focus();
|
|
440
|
-
}
|
|
441
|
-
}), (O, f) => (b(), C("div", {
|
|
442
|
-
class: ne(O.$attrs.class),
|
|
443
|
-
"data-testid": "textbox-wrapper",
|
|
444
|
-
onClick: K,
|
|
445
|
-
onKeydown: re(V, ["escape"])
|
|
446
|
-
}, [
|
|
447
|
-
j(o(qe), {
|
|
448
|
-
class: ne(["b-dropdown-base-textbox", v.value]),
|
|
449
|
-
variant: o(g) ? "title" : "body",
|
|
450
|
-
el: "div",
|
|
451
|
-
"data-testid": "base-textbox"
|
|
452
|
-
}, {
|
|
453
|
-
default: R(() => [
|
|
454
|
-
h.value ? (b(), C("input", A({ key: 0 }, r.value, {
|
|
455
|
-
id: o(p),
|
|
456
|
-
ref_key: "textbox",
|
|
457
|
-
ref: w,
|
|
458
|
-
class: "b-dropdown-base-textbox__input",
|
|
459
|
-
role: "combobox",
|
|
460
|
-
type: "text",
|
|
461
|
-
"aria-autocomplete": "list",
|
|
462
|
-
size: "1",
|
|
463
|
-
value: e.open ? e.value : e.displayValue,
|
|
464
|
-
disabled: e.disabled ? !0 : null,
|
|
465
|
-
readonly: e.readonly,
|
|
466
|
-
required: y.value,
|
|
467
|
-
onKeydown: [
|
|
468
|
-
f[0] || (f[0] = (N) => O.$emit(o(E).KEYDOWN, N)),
|
|
469
|
-
re(K, ["enter"])
|
|
470
|
-
],
|
|
471
|
-
onInput: J
|
|
472
|
-
}), null, 16, Ft)) : (b(), C("div", A({
|
|
473
|
-
key: 1,
|
|
474
|
-
id: o(p)
|
|
475
|
-
}, r.value, {
|
|
476
|
-
ref_key: "textbox",
|
|
477
|
-
ref: w,
|
|
478
|
-
class: ["b-dropdown-base-textbox__input", I.value],
|
|
479
|
-
"aria-readonly": e.readonly ? "true" : null,
|
|
480
|
-
role: "combobox",
|
|
481
|
-
tabindex: e.disabled ? -1 : 0
|
|
482
|
-
}), [
|
|
483
|
-
L.value ? (b(), C(Ee, { key: 0 }, [
|
|
484
|
-
o(t)("display-value") ? W(O.$slots, "display-value", oe(A({ key: 0 }, e.selectedValueItem)), void 0, !0) : W(O.$slots, "default", oe(A({ key: 1 }, e.selectedValueItem)), () => [
|
|
485
|
-
fe(Q(e.displayValue), 1)
|
|
486
|
-
], !0)
|
|
487
|
-
], 64)) : T.value ? (b(), C("div", _t, [
|
|
488
|
-
(b(!0), C(Ee, null, ue(x.value, (N) => (b(), C("div", {
|
|
489
|
-
key: N.value
|
|
490
|
-
}, [
|
|
491
|
-
ie("div", Vt, [
|
|
492
|
-
W(O.$slots, "default", A({ ref_for: !0 }, N), () => [
|
|
493
|
-
fe(Q(e.displayValue), 1)
|
|
494
|
-
], !0)
|
|
495
|
-
])
|
|
496
|
-
]))), 128))
|
|
497
|
-
])) : (b(), C(Ee, { key: 2 }, [
|
|
498
|
-
fe(Q(e.displayValue), 1)
|
|
499
|
-
], 64))
|
|
500
|
-
], 16, Pt)),
|
|
501
|
-
e.additionalItemsSelected ? (b(), C("span", Kt, Q(e.additionalItemsSelected), 1)) : F("", !0),
|
|
502
|
-
o(t)("icon") && !B.value ? (b(), C("span", qt, [
|
|
503
|
-
W(O.$slots, "icon", {}, void 0, !0)
|
|
504
|
-
])) : F("", !0),
|
|
505
|
-
B.value ? (b(), C("span", {
|
|
506
|
-
key: 4,
|
|
507
|
-
class: "b-dropdown-base-textbox__clear-search",
|
|
508
|
-
tabindex: e.disabled ? -1 : 0,
|
|
509
|
-
"data-testid": "clear-search-button",
|
|
510
|
-
onClick: Me(M, ["stop"]),
|
|
511
|
-
onKeydown: re(Me(M, ["stop"]), ["enter"]),
|
|
512
|
-
onKeyup: re(M, ["space"])
|
|
513
|
-
}, [
|
|
514
|
-
e.size === o(le).SMALL ? (b(), Y(o(mt), {
|
|
515
|
-
key: 0,
|
|
516
|
-
"svg-title": o(l)("clearSearch")
|
|
517
|
-
}, null, 8, ["svg-title"])) : (b(), Y(o(yt), {
|
|
518
|
-
key: 1,
|
|
519
|
-
"svg-title": o(l)("clearSearch")
|
|
520
|
-
}, null, 8, ["svg-title"]))
|
|
521
|
-
], 40, zt)) : F("", !0)
|
|
522
|
-
]),
|
|
523
|
-
_: 3
|
|
524
|
-
}, 8, ["class", "variant"])
|
|
525
|
-
], 34));
|
|
526
|
-
}
|
|
527
|
-
}), je = /* @__PURE__ */ ee(Wt, [["__scopeId", "data-v-d9e852a4"]]), jt = { class: "b-dropdown-default-textbox__chevron" }, Ht = _({
|
|
528
|
-
name: "dropdown-default-textbox",
|
|
529
|
-
inheritAttrs: !1
|
|
530
|
-
}), Yt = /* @__PURE__ */ _({
|
|
531
|
-
...Ht,
|
|
532
|
-
props: {
|
|
533
|
-
/**
|
|
534
|
-
* The number of additional items that have been selected in the dropdown.
|
|
535
|
-
*/
|
|
536
|
-
additionalItemsSelected: { type: [Number, String], default: 0 },
|
|
537
|
-
/**
|
|
538
|
-
* Sets the aria-controls attribute on the textbox. This should correspond to the popover's id that the textbox triggers.
|
|
539
|
-
*/
|
|
540
|
-
ariaControls: {
|
|
541
|
-
type: String,
|
|
542
|
-
required: !0
|
|
543
|
-
},
|
|
544
|
-
/**
|
|
545
|
-
* Indicates whether the content the textbox triggers is visible or not. Needs to be set accordingly when the textbox is used and changed every time the popover is shown/hidden.
|
|
546
|
-
*/
|
|
547
|
-
ariaExpanded: {
|
|
548
|
-
type: [String, Boolean],
|
|
549
|
-
required: !0
|
|
550
|
-
},
|
|
551
|
-
/**
|
|
552
|
-
* If no label element is used then the aria-label is be set should be set.
|
|
553
|
-
*/
|
|
554
|
-
ariaLabel: {
|
|
555
|
-
type: String,
|
|
556
|
-
default: null
|
|
557
|
-
},
|
|
558
|
-
/**
|
|
559
|
-
* Corresponds to the label's id that labels the textbox element.
|
|
560
|
-
*/
|
|
561
|
-
ariaLabelledby: {
|
|
562
|
-
type: String,
|
|
563
|
-
default: null
|
|
564
|
-
},
|
|
565
|
-
/**
|
|
566
|
-
* Renders the dropdown with a condensed style.
|
|
567
|
-
*/
|
|
568
|
-
condensed: { type: Boolean, default: !1 },
|
|
569
|
-
/**
|
|
570
|
-
* Disables any textbox functionality
|
|
571
|
-
*/
|
|
572
|
-
disabled: { type: Boolean, default: !1 },
|
|
573
|
-
/**
|
|
574
|
-
* Selected option's label
|
|
575
|
-
*/
|
|
576
|
-
displayValue: { type: String, default: null },
|
|
577
|
-
/**
|
|
578
|
-
* Sets the possibility to type into the textbox
|
|
579
|
-
*/
|
|
580
|
-
dynamicFiltering: {
|
|
581
|
-
type: Boolean,
|
|
582
|
-
default: !1
|
|
583
|
-
},
|
|
584
|
-
/**
|
|
585
|
-
* Marks the textbox as invalid, rendering an error state
|
|
586
|
-
*/
|
|
587
|
-
isInvalid: { type: Boolean, default: !1 },
|
|
588
|
-
/**
|
|
589
|
-
* Indicates if the dropdown is open so that
|
|
590
|
-
* the respective event can be emitted
|
|
591
|
-
*/
|
|
592
|
-
open: { type: Boolean, default: !1 },
|
|
593
|
-
/**
|
|
594
|
-
* Sets the dropdown to readonly state
|
|
595
|
-
*/
|
|
596
|
-
readonly: { type: Boolean, default: !1 },
|
|
597
|
-
/**
|
|
598
|
-
* The selected value's list box item.
|
|
599
|
-
*/
|
|
600
|
-
selectedValueItem: {
|
|
601
|
-
type: [Object, Array],
|
|
602
|
-
default: void 0
|
|
603
|
-
},
|
|
604
|
-
/**
|
|
605
|
-
* Toggles whether to use the slot content select items shown in the textbox in multiple mode.
|
|
606
|
-
*/
|
|
607
|
-
showSlotContentInMultiple: { type: Boolean, default: !1 },
|
|
608
|
-
/**
|
|
609
|
-
* The input value
|
|
610
|
-
*/
|
|
611
|
-
value: { type: String, default: "" },
|
|
612
|
-
/*
|
|
613
|
-
* If enabled, the user will be able to select multiple items.
|
|
614
|
-
*/
|
|
615
|
-
multiple: { type: Boolean, default: !1 }
|
|
616
|
-
},
|
|
617
|
-
emits: ["clear", "close", "input", "keydown", "open"],
|
|
618
|
-
setup(e, { expose: c, emit: u }) {
|
|
619
|
-
const l = u, i = he(), s = e, t = D(null), a = d(() => ({
|
|
620
|
-
[`b-dropdown-default-textbox--${k.ERROR}`]: !s.disabled && !s.readonly && s.isInvalid,
|
|
621
|
-
[`b-dropdown-default-textbox--${k.DISABLED}`]: s.disabled,
|
|
622
|
-
[`b-dropdown-default-textbox--${k.READONLY}`]: s.readonly,
|
|
623
|
-
[`b-dropdown-default-textbox--${k.OPENED}`]: s.open,
|
|
624
|
-
"b-dropdown-default-textbox--condensed": s.condensed
|
|
625
|
-
})), m = d(() => s.open && !s.disabled && !s.readonly), w = (r) => {
|
|
626
|
-
l("input", r);
|
|
627
|
-
}, p = (r) => {
|
|
628
|
-
l("keydown", r);
|
|
629
|
-
}, g = (r) => {
|
|
630
|
-
ae(r), l("open");
|
|
631
|
-
}, v = (r) => {
|
|
632
|
-
ae(r), l("close");
|
|
633
|
-
}, y = (r) => {
|
|
634
|
-
ae(r), l("clear");
|
|
635
|
-
}, I = {
|
|
636
|
-
[E.INPUT]: w,
|
|
637
|
-
[E.OPEN]: g,
|
|
638
|
-
[E.CLOSE]: v,
|
|
639
|
-
[E.CLEAR]: y,
|
|
640
|
-
[E.KEYDOWN]: p
|
|
641
|
-
};
|
|
642
|
-
return c({
|
|
643
|
-
focus: () => {
|
|
644
|
-
t.value.focus();
|
|
645
|
-
}
|
|
646
|
-
}), (r, x) => (b(), C("div", {
|
|
647
|
-
class: ne(["b-dropdown-default-textbox", a.value]),
|
|
648
|
-
"data-testid": "default-textbox"
|
|
649
|
-
}, [
|
|
650
|
-
j(je, A({
|
|
651
|
-
ref_key: "baseTextbox",
|
|
652
|
-
ref: t
|
|
653
|
-
}, { ...r.$attrs, ...r.$props }, {
|
|
654
|
-
class: "b-dropdown-default-textbox__textbox",
|
|
655
|
-
value: e.value
|
|
656
|
-
}, de(I)), be({
|
|
657
|
-
icon: R(() => [
|
|
658
|
-
ie("div", jt, [
|
|
659
|
-
se(j(o(ht), { "svg-title": "opened" }, null, 512), [
|
|
660
|
-
[me, m.value]
|
|
661
|
-
]),
|
|
662
|
-
se(j(o(vt), { "svg-title": "closed" }, null, 512), [
|
|
663
|
-
[me, !m.value]
|
|
664
|
-
])
|
|
665
|
-
])
|
|
666
|
-
]),
|
|
667
|
-
_: 2
|
|
668
|
-
}, [
|
|
669
|
-
ue(o(i), (h, L) => ({
|
|
670
|
-
name: L,
|
|
671
|
-
fn: R((T) => [
|
|
672
|
-
W(r.$slots, L, oe(ye(T ?? {})), void 0, !0)
|
|
673
|
-
])
|
|
674
|
-
}))
|
|
675
|
-
]), 1040, ["value"])
|
|
676
|
-
], 2));
|
|
677
|
-
}
|
|
678
|
-
}), Jt = /* @__PURE__ */ ee(Yt, [["__scopeId", "data-v-c3e3ce21"]]);
|
|
679
|
-
let Fe = 0;
|
|
680
|
-
const Gt = {
|
|
681
|
-
beforeCreate() {
|
|
682
|
-
this.uuid = Fe.toString(), Fe += 1;
|
|
683
|
-
}
|
|
684
|
-
}, Xt = { key: 0 };
|
|
685
|
-
function Zt(e, c, u, l, i, s) {
|
|
686
|
-
return b(), C("svg", A({ role: "img" }, e.$attrs, {
|
|
687
|
-
class: "ui-assets-icons-16",
|
|
688
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
689
|
-
width: "16",
|
|
690
|
-
height: "16",
|
|
691
|
-
fill: "none"
|
|
692
|
-
}), [
|
|
693
|
-
e.$attrs["svg-title"] ? (b(), C("title", Xt, Q(e.$attrs["svg-title"]), 1)) : F("", !0),
|
|
694
|
-
c[0] || (c[0] = ie("path", {
|
|
695
|
-
fill: "#001222",
|
|
696
|
-
d: "M5.00011 5.43922L8.00011 8.43922L11.0001 5.43922L12.0608 6.49988L8.00011 10.5605L3.93945 6.49988L5.00011 5.43922Z"
|
|
697
|
-
}, null, -1))
|
|
698
|
-
], 16);
|
|
699
|
-
}
|
|
700
|
-
const Qt = /* @__PURE__ */ ee(Gt, [["render", Zt]]);
|
|
701
|
-
let Pe = 0;
|
|
702
|
-
const ea = {
|
|
703
|
-
beforeCreate() {
|
|
704
|
-
this.uuid = Pe.toString(), Pe += 1;
|
|
705
|
-
}
|
|
706
|
-
}, ta = { key: 0 };
|
|
707
|
-
function aa(e, c, u, l, i, s) {
|
|
708
|
-
return b(), C("svg", A({ role: "img" }, e.$attrs, {
|
|
709
|
-
class: "ui-assets-icons-16",
|
|
710
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
711
|
-
width: "16",
|
|
712
|
-
height: "16",
|
|
713
|
-
fill: "none"
|
|
714
|
-
}), [
|
|
715
|
-
e.$attrs["svg-title"] ? (b(), C("title", ta, Q(e.$attrs["svg-title"]), 1)) : F("", !0),
|
|
716
|
-
c[0] || (c[0] = ie("path", {
|
|
717
|
-
fill: "#001222",
|
|
718
|
-
d: "M10.9999 10.5608L7.9999 7.56077L4.9999 10.5608L3.93924 9.50011L7.9999 5.43945L12.0606 9.50011L10.9999 10.5608Z"
|
|
719
|
-
}, null, -1))
|
|
720
|
-
], 16);
|
|
721
|
-
}
|
|
722
|
-
const la = /* @__PURE__ */ ee(ea, [["render", aa]]), oa = { class: "b-dropdown-small-textbox__chevron" }, na = _({
|
|
723
|
-
name: "dropdown-small-textbox",
|
|
724
|
-
inheritAttrs: !1
|
|
725
|
-
}), sa = /* @__PURE__ */ _({
|
|
726
|
-
...na,
|
|
727
|
-
props: {
|
|
728
|
-
/**
|
|
729
|
-
* The number of additional items that have been selected in the dropdown.
|
|
730
|
-
*/
|
|
731
|
-
additionalItemsSelected: { type: [Number, String], default: 0 },
|
|
732
|
-
/**
|
|
733
|
-
* Sets the aria-controls attribute on the textbox. This should correspond to the popover's id that the textbox triggers.
|
|
734
|
-
*/
|
|
735
|
-
ariaControls: { type: String, required: !0 },
|
|
736
|
-
/**
|
|
737
|
-
* Indicates whether the content the textbox triggers is visible or not. Needs to be set accordingly when the textbox is used and changed every time the popover is shown/hidden.
|
|
738
|
-
*/
|
|
739
|
-
ariaExpanded: {
|
|
740
|
-
type: [String, Boolean],
|
|
741
|
-
required: !0
|
|
742
|
-
},
|
|
743
|
-
/**
|
|
744
|
-
* If no label element is used then the aria-label is be set should be set.
|
|
745
|
-
*/
|
|
746
|
-
ariaLabel: { type: String, default: null },
|
|
747
|
-
/**
|
|
748
|
-
* Corresponds to the label's id that labels the textbox element.
|
|
749
|
-
*/
|
|
750
|
-
ariaLabelledby: { type: String, default: null },
|
|
751
|
-
/**
|
|
752
|
-
* Disables any textbox functionality
|
|
753
|
-
*/
|
|
754
|
-
disabled: { type: Boolean, default: !1 },
|
|
755
|
-
/**
|
|
756
|
-
* Selected option's label
|
|
757
|
-
*/
|
|
758
|
-
displayValue: { type: String, default: null },
|
|
759
|
-
/**
|
|
760
|
-
* Sets the possibility to type into the textbox
|
|
761
|
-
*/
|
|
762
|
-
dynamicFiltering: { type: Boolean, default: !1 },
|
|
763
|
-
/**
|
|
764
|
-
* Marks the textbox as invalid, rendering an error state
|
|
765
|
-
*/
|
|
766
|
-
isInvalid: { type: Boolean, default: !1 },
|
|
767
|
-
/**
|
|
768
|
-
* Indicates if the dropdown is open so that
|
|
769
|
-
* the respective event can be emitted
|
|
770
|
-
*/
|
|
771
|
-
open: { type: Boolean, default: !1 },
|
|
772
|
-
/**
|
|
773
|
-
* Sets the dropdown to readonly state
|
|
774
|
-
*/
|
|
775
|
-
readonly: { type: Boolean, default: !1 },
|
|
776
|
-
/**
|
|
777
|
-
* The input value
|
|
778
|
-
*/
|
|
779
|
-
value: { type: String, default: "" }
|
|
780
|
-
},
|
|
781
|
-
emits: ["clear", "close", "input", "keydown", "open"],
|
|
782
|
-
setup(e, { expose: c, emit: u }) {
|
|
783
|
-
const l = u, i = e, s = D(null), t = Ie(Ue, !1), a = d(() => ({
|
|
784
|
-
[`b-dropdown-small-textbox--${k.DISABLED}`]: i.disabled,
|
|
785
|
-
[`b-dropdown-small-textbox--${k.READONLY}`]: i.readonly,
|
|
786
|
-
[`b-dropdown-small-textbox--${k.OPENED}`]: i.open,
|
|
787
|
-
"b-dropdown-small-textbox--underline": t
|
|
788
|
-
})), m = d(() => i.open && !i.disabled && !i.readonly), w = (r) => {
|
|
789
|
-
l("input", r);
|
|
790
|
-
}, p = (r) => {
|
|
791
|
-
l("keydown", r);
|
|
792
|
-
}, g = (r) => {
|
|
793
|
-
ae(r), l("open");
|
|
794
|
-
}, v = (r) => {
|
|
795
|
-
ae(r), l("close");
|
|
796
|
-
}, y = (r) => {
|
|
797
|
-
ae(r), l("clear");
|
|
798
|
-
}, I = {
|
|
799
|
-
[E.INPUT]: w,
|
|
800
|
-
[E.OPEN]: g,
|
|
801
|
-
[E.CLOSE]: v,
|
|
802
|
-
[E.CLEAR]: y,
|
|
803
|
-
[E.KEYDOWN]: p
|
|
804
|
-
};
|
|
805
|
-
return c({
|
|
806
|
-
focus: () => {
|
|
807
|
-
s.value.focus();
|
|
808
|
-
}
|
|
809
|
-
}), (r, x) => (b(), C("div", {
|
|
810
|
-
class: ne(["b-dropdown-small-textbox", a.value])
|
|
811
|
-
}, [
|
|
812
|
-
j(je, A({
|
|
813
|
-
ref_key: "baseTextbox",
|
|
814
|
-
ref: s
|
|
815
|
-
}, { ...r.$attrs, ...r.$props }, {
|
|
816
|
-
class: "b-dropdown-small-textbox__textbox",
|
|
817
|
-
size: o(le).SMALL
|
|
818
|
-
}, de(I)), {
|
|
819
|
-
icon: R(() => [
|
|
820
|
-
ie("div", oa, [
|
|
821
|
-
se(j(o(la), { "svg-title": "opened" }, null, 512), [
|
|
822
|
-
[me, m.value]
|
|
823
|
-
]),
|
|
824
|
-
se(j(o(Qt), { "svg-title": "closed" }, null, 512), [
|
|
825
|
-
[me, !m.value]
|
|
826
|
-
])
|
|
827
|
-
])
|
|
828
|
-
]),
|
|
829
|
-
_: 1
|
|
830
|
-
}, 16, ["size"])
|
|
831
|
-
], 2));
|
|
832
|
-
}
|
|
833
|
-
}), ia = /* @__PURE__ */ ee(sa, [["__scopeId", "data-v-5fe55c74"]]), ra = (e, c) => c.value.reduce((u, l) => {
|
|
834
|
-
if (l.items) {
|
|
835
|
-
const i = l.items.filter(
|
|
836
|
-
(t) => e.value.find((a) => a.value === t.value)
|
|
837
|
-
);
|
|
838
|
-
i.length === l.items.length ? u.push(l.displayValue ?? l.label) : i.forEach(({ label: t, displayValue: a }) => u.push(a ?? t));
|
|
839
|
-
}
|
|
840
|
-
return e.value.find((i) => i.value === l.value) && u.push(l.displayValue ?? l.label), u;
|
|
841
|
-
}, []).join(", "), da = ({ items: e, placeholder: c, selectedValues: u, isMultiSelect: l }) => {
|
|
842
|
-
const i = d(
|
|
843
|
-
() => l.value && e.value.find((t) => t.items?.length)
|
|
844
|
-
);
|
|
845
|
-
return d(() => u.value.length ? i.value ? ra(u, e) : u.value.map(({ label: t, displayValue: a }) => a ?? t).join(", ") : c.value || null);
|
|
846
|
-
}, He = (e) => {
|
|
847
|
-
e.value.$children?.[0].$refs.textbox.focus();
|
|
848
|
-
}, ua = ({
|
|
849
|
-
inputContainerRef: e,
|
|
850
|
-
optionsContainerRef: c,
|
|
851
|
-
selectedValueIndex: u,
|
|
852
|
-
isDropdownOpen: l,
|
|
853
|
-
isDynamicFltering: i,
|
|
854
|
-
items: s,
|
|
855
|
-
isMultiple: t,
|
|
856
|
-
totalItemCount: a,
|
|
857
|
-
isVirtualScroll: m
|
|
858
|
-
}, w, p, g) => {
|
|
859
|
-
const v = async (f) => {
|
|
860
|
-
i.value && await P(), s.value[f]?.focus();
|
|
861
|
-
}, y = async (f) => {
|
|
862
|
-
i.value && await P();
|
|
863
|
-
const N = c.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef?.$el.querySelectorAll(
|
|
864
|
-
"button"
|
|
865
|
-
);
|
|
866
|
-
N?.length ? N[f]?.focus() : v(f);
|
|
867
|
-
}, I = (f) => c.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef?.setListboxFocusedIndex(
|
|
868
|
-
f
|
|
869
|
-
), B = async (f) => {
|
|
870
|
-
await c.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef?.navigateToItem(f);
|
|
871
|
-
}, r = (f) => {
|
|
872
|
-
P(() => {
|
|
873
|
-
m ? B(f) : (I(f), v(f));
|
|
874
|
-
});
|
|
875
|
-
}, x = () => {
|
|
876
|
-
l.value || p(), r(0);
|
|
877
|
-
}, h = () => {
|
|
878
|
-
l.value || p(), P(() => {
|
|
879
|
-
r(m ? a.value - 1 : s.value.length - 1);
|
|
880
|
-
});
|
|
881
|
-
}, L = ({ detail: f }) => {
|
|
882
|
-
f.preventDefault(), x();
|
|
883
|
-
}, T = ({ detail: f }) => {
|
|
884
|
-
f.preventDefault(), h();
|
|
885
|
-
}, $ = () => {
|
|
886
|
-
x();
|
|
887
|
-
}, V = () => {
|
|
888
|
-
h();
|
|
889
|
-
}, K = ({ detail: f }) => {
|
|
890
|
-
f.preventDefault(), w(), l.value && (t ? y(0) : r(u.value));
|
|
891
|
-
}, M = ({ detail: f }) => {
|
|
892
|
-
f.preventDefault(), w(), l.value && (t ? y(0) : r(u.value));
|
|
893
|
-
}, J = () => {
|
|
894
|
-
l.value && g();
|
|
895
|
-
}, G = () => {
|
|
896
|
-
l.value && (g(), He(e));
|
|
897
|
-
};
|
|
898
|
-
return d(() => ({
|
|
899
|
-
[H.ARROW_DOWN]: L,
|
|
900
|
-
[H.ARROW_UP]: T,
|
|
901
|
-
[H.HOME]: $,
|
|
902
|
-
[H.END]: V,
|
|
903
|
-
...i.value ? {} : { [H.SPACE]: K },
|
|
904
|
-
[H.ENTER]: M,
|
|
905
|
-
...i.value ? {} : { [H.TAB]: J },
|
|
906
|
-
[H.ESCAPE]: G
|
|
907
|
-
}));
|
|
908
|
-
}, ca = ({ inputContainerRef: e, isDropdownOpen: c }, u) => {
|
|
909
|
-
const l = () => {
|
|
910
|
-
c.value && u(), P(() => {
|
|
911
|
-
He(e);
|
|
912
|
-
});
|
|
913
|
-
};
|
|
914
|
-
return {
|
|
915
|
-
[S.ENTER]: l,
|
|
916
|
-
[S.ESCAPE]: l,
|
|
917
|
-
[S.TAB]: l,
|
|
918
|
-
[S.SPACE]: l
|
|
919
|
-
};
|
|
920
|
-
};
|
|
921
|
-
function pa(e, c, u, l, i) {
|
|
922
|
-
const s = D(e), t = D(c), a = (p, g = []) => g.flatMap((v) => v.label.toLocaleLowerCase().includes(p) ? l?.value && v.items ? [...a(p, v.items)] : [v, ...a(p, v.items)] : v.items ? [...a(p, v.items)] : []), m = u !== void 0 ? wt(() => u(s.value), i ?? 300) : void 0;
|
|
923
|
-
return ve(s, () => {
|
|
924
|
-
m !== void 0 && m();
|
|
925
|
-
}), d(() => {
|
|
926
|
-
if (!s.value || u !== void 0)
|
|
927
|
-
return t.value;
|
|
928
|
-
const p = s.value.toLocaleLowerCase();
|
|
929
|
-
return a(p, t.value);
|
|
930
|
-
});
|
|
931
|
-
}
|
|
932
|
-
const Ye = {
|
|
933
|
-
"de-DE": { all: "Alle", ariaLabelFallback: "Dropdown", clearSearch: "Filter löschen" },
|
|
934
|
-
"en-GB": { all: "All", ariaLabelFallback: "Dropdown", clearSearch: "Clear filter" },
|
|
935
|
-
"en-US": { all: "All", ariaLabelFallback: "Dropdown", clearSearch: "Clear filter" },
|
|
936
|
-
"es-ES": { all: "Todos", ariaLabelFallback: "Menú desplegable", clearSearch: "Limpiar filtro" },
|
|
937
|
-
"es-MX": { all: "Todos", ariaLabelFallback: "Menú desplegable", clearSearch: "Limpiar filtro" },
|
|
938
|
-
"fr-FR": { all: "Tous", ariaLabelFallback: "Menu déroulant", clearSearch: "Effacer le filtre" },
|
|
939
|
-
"it-IT": { all: "Tutti", ariaLabelFallback: "Menu a discesa", clearSearch: "Cancella filtro" },
|
|
940
|
-
"ja-JP": { all: "すべて", ariaLabelFallback: "ドロップダウン", clearSearch: "フィルターをクリア" },
|
|
941
|
-
"pt-BR": { all: "Todos", ariaLabelFallback: "Menu suspenso", clearSearch: "Limpar filtro" },
|
|
942
|
-
"zh-CN": { all: "全部", ariaLabelFallback: "下拉菜单", clearSearch: "清除筛选器" }
|
|
943
|
-
}, fa = _({
|
|
944
|
-
i18n: { messages: Ye },
|
|
945
|
-
name: "b-dropdown",
|
|
946
|
-
components: {
|
|
947
|
-
DropdownInputDefault: Jt,
|
|
948
|
-
DropdownInputSmall: ia
|
|
949
|
-
},
|
|
950
|
-
model: { prop: "modelValue" }
|
|
951
|
-
}), ba = /* @__PURE__ */ _({
|
|
952
|
-
...fa,
|
|
953
|
-
props: {
|
|
954
|
-
ariaLabel: { default: null },
|
|
955
|
-
condensed: { type: Boolean, default: !1 },
|
|
956
|
-
emptyState: { default: void 0 },
|
|
957
|
-
dynamicFiltering: { type: Boolean, default: !1 },
|
|
958
|
-
error: { type: Boolean, default: !1 },
|
|
959
|
-
hasMoreItems: { type: Boolean, default: !1 },
|
|
960
|
-
isOptionDisabled: { type: Function, default: void 0 },
|
|
961
|
-
items: { default: () => [] },
|
|
962
|
-
loading: { type: Boolean, default: !1 },
|
|
963
|
-
componentLoading: { type: Boolean, default: !1 },
|
|
964
|
-
lazyLoadType: { default: Oe.props.lazyLoadType.default },
|
|
965
|
-
multiple: { type: Boolean, default: !1 },
|
|
966
|
-
search: { default: void 0 },
|
|
967
|
-
showSlotContentInMultiple: { type: Boolean, default: !1 },
|
|
968
|
-
size: { default: null },
|
|
969
|
-
staticCategories: { type: Boolean, default: !1 },
|
|
970
|
-
teleport: { default: () => ({ disabled: !0 }) },
|
|
971
|
-
value: { default: null },
|
|
972
|
-
modelValue: { default: null },
|
|
973
|
-
virtualScroll: { type: [Boolean, Object], default: !1 },
|
|
974
|
-
enableValueLabelPair: { type: Boolean, default: !1 },
|
|
975
|
-
description: { default: null },
|
|
976
|
-
disabled: { type: Boolean, default: !1 },
|
|
977
|
-
errorMessage: { default: null },
|
|
978
|
-
label: { default: null },
|
|
979
|
-
optional: { type: Boolean, default: !1 },
|
|
980
|
-
placeholder: { default: null },
|
|
981
|
-
readonly: { type: Boolean, default: !1 },
|
|
982
|
-
required: { type: Boolean, default: !1 },
|
|
983
|
-
tooltipText: { default: null }
|
|
984
|
-
},
|
|
985
|
-
emits: ["input", "update:model-value", "show-more", "open"],
|
|
986
|
-
setup(e, { expose: c, emit: u }) {
|
|
987
|
-
const l = Ke(), i = he(), s = ze(i), t = e, a = u, { t: m } = ge({ messages: Ye }), { emitValue: w } = St(a), p = D(null), g = D(null), v = D(null), y = D(!1), I = te("bento-dropdown-options-container"), B = te("dropdown-label"), r = te("dropdown-description"), x = te("dropdown-error"), { isReadOnly: h } = xt(U(t, "readonly")), L = d(() => t.modelValue ?? t.value), { cachedSelectedListboxOptions: T, cachedListboxSelectedValues: $, setCachedValues: V } = Lt(
|
|
988
|
-
U(t, "items"),
|
|
989
|
-
L,
|
|
990
|
-
U(t, "multiple"),
|
|
991
|
-
U(t, "enableValueLabelPair")
|
|
992
|
-
), K = D(l["aria-label"]), M = D(l["aria-describedby"]), { ariaLabel: J, label: G } = _e(t), O = d(() => m("ariaLabelFallback")), f = gt({
|
|
993
|
-
// TODO: take ariaLabel ref away when aria-label prop is removed
|
|
994
|
-
ariaLabel: J.value || K,
|
|
995
|
-
label: G,
|
|
996
|
-
defaultFallback: O
|
|
997
|
-
}), N = t.size === le.SMALL || Ie(Rt, !1), Je = d(() => N ? le.SMALL : le.DEFAULT), Ge = d(() => ({
|
|
998
|
-
"b-dropdown--condensed": t.condensed
|
|
999
|
-
})), Xe = d(() => ({
|
|
1000
|
-
"b-dropdown__description--error": !!t.errorMessage
|
|
1001
|
-
})), X = D(""), ce = U(t, "items"), Be = U(t, "staticCategories"), pe = pa(
|
|
1002
|
-
X,
|
|
1003
|
-
ce,
|
|
1004
|
-
t?.search?.searchEvent,
|
|
1005
|
-
Be,
|
|
1006
|
-
t?.search?.debounceTime
|
|
1007
|
-
), Se = d(() => t.dynamicFiltering && !!X.value), Ze = da({
|
|
1008
|
-
items: ce,
|
|
1009
|
-
placeholder: U(t, "placeholder"),
|
|
1010
|
-
isMultiSelect: U(t, "multiple"),
|
|
1011
|
-
selectedValues: T
|
|
1012
|
-
}), Qe = d(() => {
|
|
1013
|
-
if (t?.multiple && Array.isArray(L.value))
|
|
1014
|
-
return t.items.filter(
|
|
1015
|
-
({ value: n }) => t?.value && (t?.value).includes(n)
|
|
1016
|
-
);
|
|
1017
|
-
if (!t.multiple && t.staticCategories) {
|
|
1018
|
-
const n = t.items.find(
|
|
1019
|
-
(z) => z.items?.some((Z) => Z.value === L.value)
|
|
1020
|
-
);
|
|
1021
|
-
return (n ? n.items.find((z) => z.value === L.value) : t.items.find(({ value: z }) => z === L.value)) ?? null;
|
|
1022
|
-
}
|
|
1023
|
-
return t.items.find(({ value: n }) => n === L.value);
|
|
1024
|
-
}), et = d(() => {
|
|
1025
|
-
const n = pe.value.findIndex(({ value: q }) => t.enableValueLabelPair ? L.value.value === q : L.value === q);
|
|
1026
|
-
return n > -1 ? n : 0;
|
|
1027
|
-
}), { isMultiLevelSelect: Ae, flattenedItemsList: tt } = Ct(ce), at = d(() => Ae.value && !t.staticCategories), lt = d(() => at.value ? "treeitem" : "option"), ot = d(() => {
|
|
1028
|
-
if (t.multiple) {
|
|
1029
|
-
const n = Array.isArray(L.value) ? L.value.length : 0, q = Ae.value ? tt.value.length : ce.value.length;
|
|
1030
|
-
return n === 0 ? null : !t.hasMoreItems && q > 0 && q === n ? m("all") : n;
|
|
1031
|
-
}
|
|
1032
|
-
return null;
|
|
1033
|
-
}), nt = d(
|
|
1034
|
-
() => [
|
|
1035
|
-
t.description ? r : null,
|
|
1036
|
-
M.value,
|
|
1037
|
-
t.errorMessage ? x : null
|
|
1038
|
-
].filter(Boolean).join(" ") || null
|
|
1039
|
-
), ke = d(() => v.value?.$el), { visibleDomOptions: st, updateVisibleDomOptions: Te } = Et(
|
|
1040
|
-
ke,
|
|
1041
|
-
pe,
|
|
1042
|
-
lt
|
|
1043
|
-
), it = () => {
|
|
1044
|
-
h.value || (y.value = !0, P(() => {
|
|
1045
|
-
Te();
|
|
1046
|
-
}));
|
|
1047
|
-
}, we = () => {
|
|
1048
|
-
y.value = !1;
|
|
1049
|
-
}, Le = () => {
|
|
1050
|
-
h.value || (y.value = !y.value, P(() => {
|
|
1051
|
-
Te();
|
|
1052
|
-
}), Se.value && (X.value = ""));
|
|
1053
|
-
}, rt = () => {
|
|
1054
|
-
Se.value && (X.value = ""), y.value && (y.value = !1, v.value.onOutsideDropdownClick());
|
|
1055
|
-
}, dt = d(() => [
|
|
1056
|
-
rt,
|
|
1057
|
-
{
|
|
1058
|
-
ignore: [ke]
|
|
1059
|
-
}
|
|
1060
|
-
]), ut = async (n) => {
|
|
1061
|
-
t.multiple || (X.value = "", y.value = !1), V(n), w($.value), t.multiple || (await P(), $e());
|
|
1062
|
-
}, ct = () => {
|
|
1063
|
-
a(S.SHOW_MORE);
|
|
1064
|
-
}, pt = ua(
|
|
1065
|
-
{
|
|
1066
|
-
inputContainerRef: p,
|
|
1067
|
-
optionsContainerRef: v,
|
|
1068
|
-
selectedValueIndex: et,
|
|
1069
|
-
isDropdownOpen: y,
|
|
1070
|
-
isDynamicFltering: U(t, "dynamicFiltering"),
|
|
1071
|
-
items: st,
|
|
1072
|
-
isMultiple: t.multiple,
|
|
1073
|
-
totalItemCount: d(() => pe.value.length),
|
|
1074
|
-
isVirtualScroll: !t?.multiple && t?.virtualScroll !== !1 && t?.lazyLoadType === "none"
|
|
1075
|
-
},
|
|
1076
|
-
Le,
|
|
1077
|
-
it,
|
|
1078
|
-
we
|
|
1079
|
-
), ft = ca(
|
|
1080
|
-
{
|
|
1081
|
-
inputContainerRef: p,
|
|
1082
|
-
isDropdownOpen: y
|
|
1083
|
-
},
|
|
1084
|
-
we
|
|
1085
|
-
), bt = {
|
|
1086
|
-
[S.CLOSE_DROPDOWN]: we,
|
|
1087
|
-
[S.SELECT]: ut,
|
|
1088
|
-
[S.SHOW_MORE]: ct,
|
|
1089
|
-
...ft
|
|
1090
|
-
};
|
|
1091
|
-
t.error && xe(
|
|
1092
|
-
'BentoDropdown "error" property',
|
|
1093
|
-
`Use the BentoDropdown "errorMessage" property instead to indicate that there is a modifier error.
|
|
1094
|
-
Having the field as "undefined" will hide/remove the error.
|
|
1095
|
-
<bento-dropdown errorMessage="Error message text" />`,
|
|
1096
|
-
"2.0.0"
|
|
1097
|
-
), t.size && xe('BentoDropdown "size" property', "Do not use. Only 'default' size should be used.", "2.0.0"), t.value && xe(
|
|
1098
|
-
'BentoDropdown "value" property',
|
|
1099
|
-
`The use of "value" prop in "BentoDropdown" is no longer supported.
|
|
1100
|
-
Use the "v-model" or "model-value" property instead.`,
|
|
1101
|
-
"2.0.0"
|
|
1102
|
-
);
|
|
1103
|
-
const $e = () => {
|
|
1104
|
-
p.value.focus();
|
|
1105
|
-
};
|
|
1106
|
-
return ve(
|
|
1107
|
-
() => y.value,
|
|
1108
|
-
(n) => {
|
|
1109
|
-
n && a("open");
|
|
1110
|
-
}
|
|
1111
|
-
), c({
|
|
1112
|
-
focus: $e
|
|
1113
|
-
}), (n, q) => se((b(), C("div", {
|
|
1114
|
-
class: ne(["b-dropdown", Ge.value])
|
|
1115
|
-
}, [
|
|
1116
|
-
o(G) ? (b(), Y(o(Dt), {
|
|
1117
|
-
key: 0,
|
|
1118
|
-
id: o(B),
|
|
1119
|
-
condensed: n.condensed,
|
|
1120
|
-
label: o(G),
|
|
1121
|
-
"tooltip-text": n.tooltipText,
|
|
1122
|
-
optional: n.optional,
|
|
1123
|
-
required: n.required
|
|
1124
|
-
}, null, 8, ["id", "condensed", "label", "tooltip-text", "optional", "required"])) : F("", !0),
|
|
1125
|
-
se((b(), C("div", A({
|
|
1126
|
-
ref_key: "inputContainerRefWrapper",
|
|
1127
|
-
ref: g
|
|
1128
|
-
}, de(o(pt), !0)), [
|
|
1129
|
-
(b(), Y(Ve(Je.value), {
|
|
1130
|
-
ref_key: "inputContainerRef",
|
|
1131
|
-
ref: p,
|
|
1132
|
-
condensed: n.condensed,
|
|
1133
|
-
value: X.value,
|
|
1134
|
-
"additional-items-selected": ot.value,
|
|
1135
|
-
"aria-controls": o(I),
|
|
1136
|
-
ariaExpanded: y.value,
|
|
1137
|
-
"aria-labelledby": o(G) ? o(B) : null,
|
|
1138
|
-
"aria-describedby": nt.value,
|
|
1139
|
-
"aria-label": o(f),
|
|
1140
|
-
"aria-readonly": o(h),
|
|
1141
|
-
"aria-required": n.required,
|
|
1142
|
-
readonly: o(h),
|
|
1143
|
-
disabled: n.disabled,
|
|
1144
|
-
"display-value": o(Ze),
|
|
1145
|
-
"dynamic-filtering": n.dynamicFiltering,
|
|
1146
|
-
"is-invalid": !!n.errorMessage || n.error,
|
|
1147
|
-
multiple: n.multiple,
|
|
1148
|
-
open: y.value,
|
|
1149
|
-
"selected-value-item": o(N) ? void 0 : Qe.value,
|
|
1150
|
-
"show-slot-content-in-multiple": n.showSlotContentInMultiple,
|
|
1151
|
-
onInput: q[0] || (q[0] = (z) => X.value = z),
|
|
1152
|
-
onOpen: Le,
|
|
1153
|
-
onClose: Le
|
|
1154
|
-
}, be({ _: 2 }, [
|
|
1155
|
-
ue(o(i), (z, Z) => ({
|
|
1156
|
-
name: Z,
|
|
1157
|
-
fn: R((Ce) => [
|
|
1158
|
-
W(n.$slots, Z, oe(ye(Ce)), void 0, !0)
|
|
1159
|
-
])
|
|
1160
|
-
}))
|
|
1161
|
-
]), 1064, ["condensed", "value", "additional-items-selected", "aria-controls", "ariaExpanded", "aria-labelledby", "aria-describedby", "aria-label", "aria-readonly", "aria-required", "readonly", "disabled", "display-value", "dynamic-filtering", "is-invalid", "multiple", "open", "selected-value-item", "show-slot-content-in-multiple"]))
|
|
1162
|
-
], 16)), [
|
|
1163
|
-
[o(It)]
|
|
1164
|
-
]),
|
|
1165
|
-
p.value ? (b(), Y(o(At), {
|
|
1166
|
-
key: 1,
|
|
1167
|
-
disabled: n.teleport?.disabled,
|
|
1168
|
-
to: n.teleport?.to
|
|
1169
|
-
}, {
|
|
1170
|
-
default: R(() => [
|
|
1171
|
-
j(o(Nt), A({
|
|
1172
|
-
id: o(I),
|
|
1173
|
-
ref_key: "optionsContainerRef",
|
|
1174
|
-
ref: v,
|
|
1175
|
-
"aria-label": o(f),
|
|
1176
|
-
"component-loading": n.componentLoading,
|
|
1177
|
-
"empty-state": n.emptyState,
|
|
1178
|
-
disabled: n.disabled,
|
|
1179
|
-
"is-option-disabled": n.isOptionDisabled,
|
|
1180
|
-
items: o(pe),
|
|
1181
|
-
multiple: n.multiple,
|
|
1182
|
-
"static-categories": Be.value,
|
|
1183
|
-
open: y.value,
|
|
1184
|
-
"selected-value": o(T),
|
|
1185
|
-
searching: Se.value,
|
|
1186
|
-
"target-element": g.value,
|
|
1187
|
-
loading: n.loading,
|
|
1188
|
-
"has-more-items": n.hasMoreItems,
|
|
1189
|
-
"lazy-load-type": n.lazyLoadType,
|
|
1190
|
-
"virtual-scroll": n.virtualScroll
|
|
1191
|
-
}, de(bt)), be({ _: 2 }, [
|
|
1192
|
-
ue(o(i), (z, Z) => ({
|
|
1193
|
-
name: Z,
|
|
1194
|
-
fn: R((Ce) => [
|
|
1195
|
-
W(n.$slots, Z, oe(ye(Ce)), void 0, !0)
|
|
1196
|
-
])
|
|
1197
|
-
}))
|
|
1198
|
-
]), 1040, ["id", "aria-label", "component-loading", "empty-state", "disabled", "is-option-disabled", "items", "multiple", "static-categories", "open", "selected-value", "searching", "target-element", "loading", "has-more-items", "lazy-load-type", "virtual-scroll"])
|
|
1199
|
-
]),
|
|
1200
|
-
_: 3
|
|
1201
|
-
}, 8, ["disabled", "to"])) : F("", !0),
|
|
1202
|
-
n.errorMessage ? (b(), Y(o(kt), {
|
|
1203
|
-
key: 2,
|
|
1204
|
-
id: o(x),
|
|
1205
|
-
"error-message": n.errorMessage,
|
|
1206
|
-
class: "b-dropdown__error-message"
|
|
1207
|
-
}, null, 8, ["id", "error-message"])) : F("", !0),
|
|
1208
|
-
n.description || o(s)("description") ? (b(), Y(o(qe), {
|
|
1209
|
-
key: 3,
|
|
1210
|
-
id: o(r),
|
|
1211
|
-
class: ne(["b-dropdown__description", Xe.value]),
|
|
1212
|
-
el: "span"
|
|
1213
|
-
}, {
|
|
1214
|
-
default: R(() => [
|
|
1215
|
-
W(n.$slots, "description", {}, () => [
|
|
1216
|
-
fe(Q(n.description), 1)
|
|
1217
|
-
], !0)
|
|
1218
|
-
]),
|
|
1219
|
-
_: 3
|
|
1220
|
-
}, 8, ["id", "class"])) : F("", !0)
|
|
1221
|
-
], 2)), [
|
|
1222
|
-
[o(Ot), dt.value]
|
|
1223
|
-
]);
|
|
1224
|
-
}
|
|
1225
|
-
}), Fa = /* @__PURE__ */ ee(ba, [["__scopeId", "data-v-3dc67619"]]);
|
|
1226
|
-
export {
|
|
1227
|
-
Fa as B,
|
|
1228
|
-
Jt as D,
|
|
1229
|
-
le as a,
|
|
1230
|
-
Rt as b,
|
|
1231
|
-
pa as u
|
|
1232
|
-
};
|
|
1233
|
-
//# sourceMappingURL=dropdown.C5um1anU.js.map
|