@adyen/bento-vue2 1.11.0 → 1.12.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/packages/vue2/src/components/code-snippet/code-snippet.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns.vue.d.ts +11 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-scroller/use-scroller.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/date/date.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue.d.ts +38 -29
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +43 -1306
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-small-textbox/dropdown-small-textbox.vue.d.ts +5 -11
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-avatar/dropdown-avatar.vue.d.ts +43 -48
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-avatar/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/dropdown-country.vue.d.ts +43 -44
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-currency/dropdown-currency.vue.d.ts +43 -43
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-currency/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-payment-method/dropdown-payment-method.vue.d.ts +43 -43
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-payment-method/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-tag/dropdown-tag.vue.d.ts +43 -48
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-tag/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/dropdown/composables/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/dropdown/composables/use-display-value.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/dropdown/composables/use-display-value.types.d.ts +28 -0
- package/dist/@types/packages/vue2/src/components/dropdown/composables/{useKeyboardNavigation.d.ts → use-keyboard-navigation.d.ts} +3 -13
- package/dist/@types/packages/vue2/src/components/dropdown/composables/use-keyboard-navigation.types.d.ts +15 -0
- package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +48 -1674
- package/dist/@types/packages/vue2/src/components/dropdown/index.d.ts +6 -5
- package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +12 -12
- package/dist/@types/packages/vue2/src/components/input-field/input-field.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/internal/listbox/listbox.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/link/link.vue.d.ts +17 -11
- package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.vue.d.ts +16 -60
- package/dist/@types/packages/vue2/src/components/modal/components/modal-default/modal-default.vue.d.ts +59 -49
- package/dist/@types/packages/vue2/src/components/modal/components/modal-dialog/modal-dialog.vue.d.ts +39 -291
- package/dist/@types/packages/vue2/src/components/modal/modal.vue.d.ts +76 -83
- package/dist/@types/packages/vue2/src/components/pagination/pagination.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/popper-container/popper-container.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/search-bar/search-bar.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item/summary-grid-item.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/textarea/textarea.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/tooltip/tooltip.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/templates/data-grid-template/data-grid-template.types.d.ts +6 -0
- package/dist/@types/packages/vue2/src/templates/data-grid-template/data-grid-template.vue.d.ts +10 -0
- package/dist/@types/packages/vue2/src/templates/data-grid-template/index.d.ts +1 -0
- package/dist/accordion.js +2 -2
- package/dist/action-bar.js +5 -5
- package/dist/alert.js +3 -3
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button.css +1 -1
- package/dist/assets/dropdown-default-textbox.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/index10.css +1 -1
- package/dist/assets/index11.css +1 -1
- package/dist/assets/index12.css +1 -1
- package/dist/assets/index13.css +1 -1
- package/dist/assets/index14.css +1 -1
- package/dist/assets/index15.css +1 -1
- package/dist/assets/index16.css +1 -1
- package/dist/assets/index17.css +1 -1
- package/dist/assets/index18.css +1 -1
- package/dist/assets/index19.css +1 -1
- package/dist/assets/index2.css +1 -1
- package/dist/assets/index20.css +1 -1
- package/dist/assets/index21.css +1 -1
- package/dist/assets/index22.css +1 -1
- package/dist/assets/index23.css +1 -1
- package/dist/assets/index24.css +1 -1
- package/dist/assets/index25.css +1 -1
- package/dist/assets/index26.css +1 -1
- package/dist/assets/index27.css +1 -1
- package/dist/assets/index28.css +1 -1
- package/dist/assets/index29.css +1 -1
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index30.css +1 -1
- package/dist/assets/index31.css +1 -1
- package/dist/assets/index32.css +1 -1
- package/dist/assets/index33.css +1 -1
- package/dist/assets/index34.css +1 -1
- package/dist/assets/index35.css +1 -1
- package/dist/assets/index36.css +1 -1
- package/dist/assets/index37.css +1 -1
- package/dist/assets/index38.css +1 -1
- package/dist/assets/index39.css +1 -1
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index40.css +1 -1
- package/dist/assets/index41.css +1 -1
- package/dist/assets/index42.css +1 -1
- package/dist/assets/index43.css +1 -1
- package/dist/assets/index44.css +1 -1
- package/dist/assets/index45.css +1 -1
- package/dist/assets/index46.css +1 -1
- package/dist/assets/index5.css +1 -1
- package/dist/assets/index6.css +1 -1
- package/dist/assets/index7.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/avatar-image.js +1 -1
- package/dist/button.js +5 -5
- package/dist/card.js +15 -15
- package/dist/card.js.map +1 -1
- package/dist/checkbox.js +6 -6
- package/dist/chunks/{base-button.bd61ab14.js → base-button.1f07b7c1.js} +2 -2
- package/dist/chunks/{base-button.bd61ab14.js.map → base-button.1f07b7c1.js.map} +1 -1
- package/dist/chunks/base-modal.9d63bdaf.js +200 -0
- package/dist/chunks/base-modal.9d63bdaf.js.map +1 -0
- package/dist/chunks/{button-actions-with-menu.767344df.js → button-actions-with-menu.4c5091f4.js} +3 -3
- package/dist/chunks/{button-actions-with-menu.767344df.js.map → button-actions-with-menu.4c5091f4.js.map} +1 -1
- package/dist/chunks/{button.bb5b4909.js → button.133f145e.js} +2 -2
- package/dist/chunks/{button.bb5b4909.js.map → button.133f145e.js.map} +1 -1
- package/dist/chunks/{calendar.4ab3c2dc.js → calendar.9a8605d1.js} +8 -7
- package/dist/chunks/{calendar.4ab3c2dc.js.map → calendar.9a8605d1.js.map} +1 -1
- package/dist/chunks/{checkbox.c684c20a.js → checkbox.d8b810c7.js} +3 -3
- package/dist/chunks/{checkbox.c684c20a.js.map → checkbox.d8b810c7.js.map} +1 -1
- package/dist/chunks/{controls-group.d25f5044.js → controls-group.bf152dea.js} +3 -3
- package/dist/chunks/{controls-group.d25f5044.js.map → controls-group.bf152dea.js.map} +1 -1
- package/dist/chunks/{copy.36c058e9.js → copy.68a7d416.js} +4 -4
- package/dist/chunks/{copy.36c058e9.js.map → copy.68a7d416.js.map} +1 -1
- package/dist/chunks/{dropdown-default-textbox.1cba89ea.js → dropdown-default-textbox.c595fd31.js} +129 -148
- package/dist/chunks/dropdown-default-textbox.c595fd31.js.map +1 -0
- package/dist/chunks/dropdown.eaee22a3.js +797 -0
- package/dist/chunks/dropdown.eaee22a3.js.map +1 -0
- package/dist/chunks/{field-label.a0c54b7d.js → field-label.66f52c8f.js} +2 -2
- package/dist/chunks/{field-label.a0c54b7d.js.map → field-label.66f52c8f.js.map} +1 -1
- package/dist/chunks/{fixed-scroller.5c90f692.js → fixed-scroller.01fc96f7.js} +2 -2
- package/dist/chunks/{fixed-scroller.5c90f692.js.map → fixed-scroller.01fc96f7.js.map} +1 -1
- package/dist/chunks/{footer-actions.b14cfca8.js → footer-actions.38e99891.js} +3 -3
- package/dist/chunks/{footer-actions.b14cfca8.js.map → footer-actions.38e99891.js.map} +1 -1
- package/dist/chunks/{index.aaedd8f9.js → index.14758ff7.js} +3 -3
- package/dist/chunks/{index.aaedd8f9.js.map → index.14758ff7.js.map} +1 -1
- package/dist/chunks/index.18773b0b.js +637 -0
- package/dist/chunks/index.18773b0b.js.map +1 -0
- package/dist/chunks/{index.7d2ea1de.js → index.2cfe4a09.js} +2 -2
- package/dist/chunks/{index.7d2ea1de.js.map → index.2cfe4a09.js.map} +1 -1
- package/dist/chunks/{index.1e8c900a.js → index.3b7d40b7.js} +2 -2
- package/dist/chunks/{index.1e8c900a.js.map → index.3b7d40b7.js.map} +1 -1
- package/dist/chunks/{index.f18f79eb.js → index.45aa17fc.js} +5 -5
- package/dist/chunks/{index.f18f79eb.js.map → index.45aa17fc.js.map} +1 -1
- package/dist/chunks/{index.b0a89960.js → index.99a2184a.js} +2 -2
- package/dist/chunks/{index.b0a89960.js.map → index.99a2184a.js.map} +1 -1
- package/dist/chunks/{index.f2223abb.js → index.9b669c12.js} +6 -6
- package/dist/chunks/{index.f2223abb.js.map → index.9b669c12.js.map} +1 -1
- package/dist/chunks/{index.720f0cbf.js → index.b38a191d.js} +13 -12
- package/dist/chunks/{index.720f0cbf.js.map → index.b38a191d.js.map} +1 -1
- package/dist/chunks/{index.58282364.js → index.d90c5838.js} +3 -3
- package/dist/chunks/{index.58282364.js.map → index.d90c5838.js.map} +1 -1
- package/dist/chunks/{index.75f0e99f.js → index.eb527b75.js} +6 -6
- package/dist/chunks/{index.75f0e99f.js.map → index.eb527b75.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.9103c011.js → listbox-option-tag.168c794c.js} +3 -3
- package/dist/chunks/{listbox-option-tag.9103c011.js.map → listbox-option-tag.168c794c.js.map} +1 -1
- package/dist/chunks/{listbox.7cf6d6b4.js → listbox.23c6b393.js} +6 -6
- package/dist/chunks/{listbox.7cf6d6b4.js.map → listbox.23c6b393.js.map} +1 -1
- package/dist/chunks/{loading-button.fb025a2e.js → loading-button.44d698b9.js} +2 -2
- package/dist/chunks/{loading-button.fb025a2e.js.map → loading-button.44d698b9.js.map} +1 -1
- package/dist/chunks/{tooltip.f48beb54.js → tooltip.f91b2040.js} +3 -3
- package/dist/chunks/{tooltip.f48beb54.js.map → tooltip.f91b2040.js.map} +1 -1
- package/dist/chunks/{useCountryItems.6b7985bf.js → use-country-items.6b7985bf.js} +1 -1
- package/dist/chunks/use-country-items.6b7985bf.js.map +1 -0
- package/dist/code-snippet.js +7 -7
- package/dist/code-snippet.js.map +1 -1
- package/dist/country.js +2 -2
- package/dist/currency.js +1 -1
- package/dist/data-grid.js +460 -451
- package/dist/data-grid.js.map +1 -1
- package/dist/date-picker.js +38 -38
- package/dist/date-picker.js.map +1 -1
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/divider.js +1 -1
- package/dist/dropdown.js +102 -132
- package/dist/dropdown.js.map +1 -1
- package/dist/empty-state.js +3 -3
- package/dist/filter-bar.js +54 -53
- package/dist/filter-bar.js.map +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +2 -2
- package/dist/header.js +3 -3
- package/dist/index.js +218 -215
- package/dist/info-icon.js +3 -3
- package/dist/input-field.js +4 -4
- package/dist/internal.js +7 -7
- package/dist/link.js +38 -28
- package/dist/link.js.map +1 -1
- package/dist/loading-indicator.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal.js +209 -302
- package/dist/modal.js.map +1 -1
- package/dist/pagination.js +88 -88
- package/dist/pagination.js.map +1 -1
- package/dist/payment-method.js +2 -2
- package/dist/popover.js +1 -1
- package/dist/popper-container.js +1 -1
- package/dist/radio-group.js +4 -4
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +2 -2
- package/dist/segmented-control.js +3 -3
- package/dist/sidepanel.js +5 -5
- package/dist/status.js +2 -2
- package/dist/stepper.js +3 -3
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +3 -3
- package/dist/tabs.js +4 -4
- package/dist/tabs.js.map +1 -1
- package/dist/tag.js +3 -3
- package/dist/textarea.js +4 -4
- package/dist/timeline.js +5 -5
- package/dist/toast.js +3 -3
- package/dist/toggle.js +2 -2
- package/dist/tutorial.js +5 -5
- package/dist/typography.js +1 -1
- package/dist/web-types.json +3739 -3589
- package/package.json +2 -2
- package/dist/@types/packages/vue2/src/components/dropdown/composables/useDisplayValue.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/dropdown/composables/useDisplayValue.types.d.ts +0 -12
- package/dist/@types/packages/vue2/src/components/dropdown/composables/useDropdownSearchFilter.d.ts +0 -3
- package/dist/chunks/base-modal.5640a66a.js +0 -222
- package/dist/chunks/base-modal.5640a66a.js.map +0 -1
- package/dist/chunks/dropdown-default-textbox.1cba89ea.js.map +0 -1
- package/dist/chunks/dropdown.4152cc00.js +0 -887
- package/dist/chunks/dropdown.4152cc00.js.map +0 -1
- package/dist/chunks/index.179d485c.js +0 -635
- package/dist/chunks/index.179d485c.js.map +0 -1
- package/dist/chunks/useCountryItems.6b7985bf.js.map +0 -1
- /package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/composables/{useDropdownOptionsListbox.d.ts → use-dropdown-options-listbox.d.ts} +0 -0
- /package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/composables/{useCountryItems.d.ts → use-country-items.d.ts} +0 -0
|
@@ -0,0 +1,797 @@
|
|
|
1
|
+
import { ref as y, watch as te, computed as c, defineComponent as B, useSlots as oe, toRefs as ne, nextTick as E, useAttrs as me, toRef as O } from "vue";
|
|
2
|
+
import { d as be, B as _e } from "./index.99a2184a.js";
|
|
3
|
+
import { g as T } from "./unique-id.a2a2b458.js";
|
|
4
|
+
import { u as ye } from "./aria-label.ac9651a5.js";
|
|
5
|
+
import { u as W } from "./i18n.eb5b985b.js";
|
|
6
|
+
import { u as ge } from "./use-form-layout-loading.d03e5d48.js";
|
|
7
|
+
import { u as xe } from "./use-has-slot.fbeb19ec.js";
|
|
8
|
+
import { D as P, a as k, b as we, c as he } from "./dropdown-default-textbox.c595fd31.js";
|
|
9
|
+
import { n as A } from "./_plugin-vue2_normalizer.71e2aa87.js";
|
|
10
|
+
import { b as u, a as K, B as z, u as Se } from "./listbox.23c6b393.js";
|
|
11
|
+
import { B as $, a as Le } from "./keyboard-navigation.ca47dfa8.js";
|
|
12
|
+
import { a as X } from "./index.d90c5838.js";
|
|
13
|
+
import { a as Ce } from "./index.45aa17fc.js";
|
|
14
|
+
import { E as Oe, F as $e } from "./field-label.66f52c8f.js";
|
|
15
|
+
import { B as Ee } from "./directive.0408e565.js";
|
|
16
|
+
import "../assets/dropdown.css";
|
|
17
|
+
var D = /* @__PURE__ */ ((n) => (n.DEFAULT = "DropdownInputDefault", n.SMALL = "DropdownInputSmall", n))(D || {});
|
|
18
|
+
const De = {
|
|
19
|
+
"en-US": {
|
|
20
|
+
apply: "Apply",
|
|
21
|
+
cancel: "Cancel",
|
|
22
|
+
noOptionsMatchThisSearch: "No options match this search"
|
|
23
|
+
}
|
|
24
|
+
}, Be = (n, e, o, t) => {
|
|
25
|
+
const l = y(n.value), { t: s } = W();
|
|
26
|
+
te(n, () => {
|
|
27
|
+
l.value = n.value;
|
|
28
|
+
});
|
|
29
|
+
const a = c(
|
|
30
|
+
() => JSON.stringify(l.value) === JSON.stringify(n.value)
|
|
31
|
+
), r = () => {
|
|
32
|
+
t(u.SELECT, l.value), t(u.CLOSE_DROPDOWN);
|
|
33
|
+
}, d = () => {
|
|
34
|
+
l.value = n.value, t(u.CLOSE_DROPDOWN);
|
|
35
|
+
}, f = () => {
|
|
36
|
+
o.value && e.value && (l.value = n.value);
|
|
37
|
+
}, v = c(() => [
|
|
38
|
+
{
|
|
39
|
+
title: s("apply"),
|
|
40
|
+
event: r,
|
|
41
|
+
disabled: a.value
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
title: s("cancel"),
|
|
45
|
+
event: d
|
|
46
|
+
}
|
|
47
|
+
]), _ = (i) => {
|
|
48
|
+
l.value = i, e.value || t(u.SELECT, i);
|
|
49
|
+
}, C = (i) => {
|
|
50
|
+
_(i), t(u.TAB);
|
|
51
|
+
}, g = (i) => {
|
|
52
|
+
_(i), t(u.ENTER);
|
|
53
|
+
}, h = (i) => {
|
|
54
|
+
_(i), t(u.SPACE);
|
|
55
|
+
}, x = () => {
|
|
56
|
+
d(), t(u.ESCAPE);
|
|
57
|
+
}, S = () => {
|
|
58
|
+
t(u.SHOW_MORE);
|
|
59
|
+
}, L = {
|
|
60
|
+
[u.SELECT]: _,
|
|
61
|
+
[u.SHOW_MORE]: S,
|
|
62
|
+
[u.TAB]: C,
|
|
63
|
+
[u.SPACE]: h,
|
|
64
|
+
[u.ENTER]: g
|
|
65
|
+
};
|
|
66
|
+
return {
|
|
67
|
+
// Values
|
|
68
|
+
actions: v,
|
|
69
|
+
internalSelectedValue: l,
|
|
70
|
+
// Methods
|
|
71
|
+
listeners: L,
|
|
72
|
+
onEscapeKey: x,
|
|
73
|
+
onOutsideDropdownClick: f
|
|
74
|
+
};
|
|
75
|
+
}, Ie = B({
|
|
76
|
+
i18n: { messages: De },
|
|
77
|
+
name: "bento-dropdown-options-container"
|
|
78
|
+
}), Re = /* @__PURE__ */ B({
|
|
79
|
+
...Ie,
|
|
80
|
+
props: {
|
|
81
|
+
/**
|
|
82
|
+
* Defines a string value that labels an interactive element.
|
|
83
|
+
*/
|
|
84
|
+
ariaLabel: { type: String, default: null },
|
|
85
|
+
/**
|
|
86
|
+
* Empty state props used with the inner empty state component which is displayed when no search results are found.
|
|
87
|
+
*/
|
|
88
|
+
emptyState: {
|
|
89
|
+
type: Object,
|
|
90
|
+
default: void 0
|
|
91
|
+
},
|
|
92
|
+
/**
|
|
93
|
+
* Disables dropdown functionality
|
|
94
|
+
*/
|
|
95
|
+
disabled: { type: Boolean, default: !1 },
|
|
96
|
+
/**
|
|
97
|
+
* Indicates whether there are more items to load
|
|
98
|
+
*/
|
|
99
|
+
hasMoreItems: { type: Boolean, default: !1 },
|
|
100
|
+
/**
|
|
101
|
+
* Identifies the listbox whose contents are controlled by the the combobox on which the aria-controls attribute is set.
|
|
102
|
+
*/
|
|
103
|
+
id: { type: String, required: !0 },
|
|
104
|
+
/**
|
|
105
|
+
* Dropdown input size
|
|
106
|
+
*/
|
|
107
|
+
inputSize: {
|
|
108
|
+
type: String,
|
|
109
|
+
default: D.DEFAULT,
|
|
110
|
+
validator: (n) => Object.values(D).includes(n)
|
|
111
|
+
},
|
|
112
|
+
/**
|
|
113
|
+
* Function that allows the options to be disabled
|
|
114
|
+
*
|
|
115
|
+
* @type {BentoDropdownIsOptionDisabled}
|
|
116
|
+
* @param {BentoDropdownOptionItem} option - Dropdown option object
|
|
117
|
+
* @param {string} option.label - Option's label text
|
|
118
|
+
* @param {string|number} option.value - Option's value
|
|
119
|
+
* @param {unknown} option.data - Option's extra data to be passed to the default slot
|
|
120
|
+
*/
|
|
121
|
+
isOptionDisabled: {
|
|
122
|
+
type: Function,
|
|
123
|
+
default: void 0
|
|
124
|
+
},
|
|
125
|
+
/**
|
|
126
|
+
* The option elements to populate the dropdown with.
|
|
127
|
+
* It must be an array of {@see BentoDropdownOptionItem }
|
|
128
|
+
* * @property {string} value.label - Text to be displayed in the option
|
|
129
|
+
* * @property {string,number} value.value - Value of the option
|
|
130
|
+
*/
|
|
131
|
+
items: {
|
|
132
|
+
type: Array,
|
|
133
|
+
required: !0
|
|
134
|
+
},
|
|
135
|
+
/**
|
|
136
|
+
* The type of `Lazy Load`.
|
|
137
|
+
* Type "automatic" will enable infinite scrolling
|
|
138
|
+
* Type "button" will enable lazy loading with "Show more" button
|
|
139
|
+
*/
|
|
140
|
+
lazyLoadType: {
|
|
141
|
+
type: String,
|
|
142
|
+
default: K.AUTOMATIC,
|
|
143
|
+
validator: (n) => Object.values(K).includes(n)
|
|
144
|
+
},
|
|
145
|
+
/**
|
|
146
|
+
* Indicates if new options are loading.
|
|
147
|
+
*/
|
|
148
|
+
loading: { type: Boolean, default: !1 },
|
|
149
|
+
/**
|
|
150
|
+
* If enabled, the user will be able to select multiple items.
|
|
151
|
+
*/
|
|
152
|
+
multiple: { type: Boolean, default: !1 },
|
|
153
|
+
/**
|
|
154
|
+
* Indicates if the dropdown is open so that
|
|
155
|
+
* the container can be displayed.
|
|
156
|
+
*/
|
|
157
|
+
open: { type: Boolean, required: !0 },
|
|
158
|
+
/**
|
|
159
|
+
* The `input` value.
|
|
160
|
+
* Providing an empty string or empty array will select no options.
|
|
161
|
+
* Set to an empty string `''` if you don't want any of the available options to be selected for single select
|
|
162
|
+
*/
|
|
163
|
+
selectedValue: {
|
|
164
|
+
type: [String, Number, Array],
|
|
165
|
+
default: null
|
|
166
|
+
},
|
|
167
|
+
/**
|
|
168
|
+
* Flag that indicates that an external search it's being made
|
|
169
|
+
* to filter out the items inside the the multi-select listbox
|
|
170
|
+
*
|
|
171
|
+
* If enabled, hides the "Select all" checkbox in "multiple" mode.
|
|
172
|
+
*/
|
|
173
|
+
searching: z.props.searching,
|
|
174
|
+
/**
|
|
175
|
+
* If enabled, dropdown will display non-selectable, static categories
|
|
176
|
+
*/
|
|
177
|
+
staticCategories: { type: Boolean, default: !1 },
|
|
178
|
+
/**
|
|
179
|
+
* Reference to the DOM element or Vue component for positioning
|
|
180
|
+
* the Dropdown container.
|
|
181
|
+
*/
|
|
182
|
+
targetElement: { type: X.props.targetElement.type, required: !0 },
|
|
183
|
+
/**
|
|
184
|
+
* Enables virtual scrolling if set to true or by providing an object with itemHeight function.
|
|
185
|
+
* The itemHeight function is used to calculate the height of rendered item given it's index.
|
|
186
|
+
*/
|
|
187
|
+
virtualScroll: {
|
|
188
|
+
type: [Boolean, Object],
|
|
189
|
+
default: !1
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
setup(n, { expose: e, emit: o }) {
|
|
193
|
+
const t = n, l = oe(), { selectedValue: s, multiple: a } = ne(t), r = y(null), { t: d } = W(), f = c(() => t.open && !t.disabled), v = c(() => d("noOptionsMatchThisSearch")), _ = c(() => ({
|
|
194
|
+
"b-dropdown-options-container--single": !(t != null && t.multiple)
|
|
195
|
+
})), C = c(() => ({
|
|
196
|
+
"b-dropdown-options-container__listbox--small": t.inputSize === D.SMALL,
|
|
197
|
+
"b-dropdown-options-container__listbox--single": !(t != null && t.multiple)
|
|
198
|
+
})), { actions: g, internalSelectedValue: h, listeners: x, onEscapeKey: S, onOutsideDropdownClick: L } = Be(s, a, f, o), i = c(() => t != null && t.multiple ? Ce : X), p = c(() => {
|
|
199
|
+
var w;
|
|
200
|
+
const b = {
|
|
201
|
+
"min-width": `${(w = t == null ? void 0 : t.targetElement) == null ? void 0 : w.clientWidth}px`,
|
|
202
|
+
"max-width": "min(500px, 95%)"
|
|
203
|
+
};
|
|
204
|
+
return t != null && t.multiple ? {
|
|
205
|
+
actionsLayout: "space-between",
|
|
206
|
+
actions: g.value,
|
|
207
|
+
divider: !0,
|
|
208
|
+
fallbackPosition: ["top-start"],
|
|
209
|
+
id: T(`dropdown-options-${t.id}`),
|
|
210
|
+
open: t.open,
|
|
211
|
+
position: "bottom-start",
|
|
212
|
+
style: {
|
|
213
|
+
width: "auto",
|
|
214
|
+
...b
|
|
215
|
+
},
|
|
216
|
+
targetElement: t.targetElement
|
|
217
|
+
} : {
|
|
218
|
+
fallbackPosition: ["top-start"],
|
|
219
|
+
offset: [0, 8],
|
|
220
|
+
position: "bottom-start",
|
|
221
|
+
style: {
|
|
222
|
+
display: f.value ? "block" : "none",
|
|
223
|
+
...b
|
|
224
|
+
},
|
|
225
|
+
targetElement: t.targetElement
|
|
226
|
+
};
|
|
227
|
+
});
|
|
228
|
+
return e({
|
|
229
|
+
onOutsideDropdownClick: L
|
|
230
|
+
}), { __sfc: !0, slots: l, emit: o, props: t, selectedValue: s, multiple: a, dropdownOptionsListboxRef: r, t: d, isDropdownOpen: f, noResultsMessage: v, conditionalClasses: _, conditionalListboxClasses: C, actions: g, internalSelectedValue: h, listeners: x, onEscapeKey: S, onOutsideDropdownClick: L, popperContainerOrPopoverComponent: i, popperContainerOrPopoverProps: p, BentoListbox: z };
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
var Te = function() {
|
|
234
|
+
var e = this, o = e._self._c, t = e._self._setupProxy;
|
|
235
|
+
return o(t.popperContainerOrPopoverComponent, e._b({ tag: "component", staticClass: "b-dropdown-options-container", class: t.conditionalClasses }, "component", t.popperContainerOrPopoverProps, !1), [o("div", { on: { keydown: function(l) {
|
|
236
|
+
return !l.type.indexOf("key") && e._k(l.keyCode, "esc", 27, l.key, ["Esc", "Escape"]) ? null : t.onEscapeKey.apply(null, arguments);
|
|
237
|
+
} } }, [o(t.BentoListbox, e._g({ ref: "dropdownOptionsListboxRef", staticClass: "b-dropdown-options-container__listbox", class: t.conditionalListboxClasses, attrs: { id: e.id, "aria-label": e.ariaLabel, "empty-state": e.emptyState, "is-option-disabled": e.isOptionDisabled, items: e.items, "selected-value": t.internalSelectedValue, multiple: t.multiple, "static-categories": e.staticCategories, "no-results-message": t.noResultsMessage, searching: e.searching, loading: e.loading, "lazy-load-type": e.lazyLoadType, "has-more-items": e.hasMoreItems, "virtual-scroll": e.virtualScroll }, scopedSlots: e._u([e._l(t.slots, function(l, s) {
|
|
238
|
+
return { key: s, fn: function(a) {
|
|
239
|
+
return [e._t(s, null, null, a)];
|
|
240
|
+
} };
|
|
241
|
+
})], null, !0) }, t.listeners))], 1)]);
|
|
242
|
+
}, Ae = [], Me = /* @__PURE__ */ A(
|
|
243
|
+
Re,
|
|
244
|
+
Te,
|
|
245
|
+
Ae,
|
|
246
|
+
!1,
|
|
247
|
+
null,
|
|
248
|
+
"1ccfc490",
|
|
249
|
+
null,
|
|
250
|
+
null
|
|
251
|
+
);
|
|
252
|
+
const Ne = Me.exports;
|
|
253
|
+
let V = 0;
|
|
254
|
+
const ke = {
|
|
255
|
+
beforeCreate() {
|
|
256
|
+
this.uuid = V.toString(), V += 1;
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
var Fe = function() {
|
|
260
|
+
var e = this, o = e._self._c;
|
|
261
|
+
return o("svg", e._b({ staticClass: "ui-assets-icons-16", attrs: { role: "img", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none" } }, "svg", e.$attrs, !1), [e.$attrs["svg-title"] ? o("title", [e._v(e._s(e.$attrs["svg-title"]))]) : e._e(), o("path", { attrs: { fill: "#00112C", d: "M5.00011 5.43922L8.00011 8.43922L11.0001 5.43922L12.0608 6.49988L8.00011 10.5605L3.93945 6.49988L5.00011 5.43922Z" } })]);
|
|
262
|
+
}, Pe = [], Ke = /* @__PURE__ */ A(
|
|
263
|
+
ke,
|
|
264
|
+
Fe,
|
|
265
|
+
Pe,
|
|
266
|
+
!1,
|
|
267
|
+
null,
|
|
268
|
+
null,
|
|
269
|
+
null,
|
|
270
|
+
null
|
|
271
|
+
);
|
|
272
|
+
const ze = Ke.exports;
|
|
273
|
+
let ee = 0;
|
|
274
|
+
const We = {
|
|
275
|
+
beforeCreate() {
|
|
276
|
+
this.uuid = ee.toString(), ee += 1;
|
|
277
|
+
}
|
|
278
|
+
};
|
|
279
|
+
var Ue = function() {
|
|
280
|
+
var e = this, o = e._self._c;
|
|
281
|
+
return o("svg", e._b({ staticClass: "ui-assets-icons-16", attrs: { role: "img", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none" } }, "svg", e.$attrs, !1), [e.$attrs["svg-title"] ? o("title", [e._v(e._s(e.$attrs["svg-title"]))]) : e._e(), o("path", { attrs: { fill: "#00112C", d: "M10.9999 10.5608L7.9999 7.56077L4.9999 10.5608L3.93924 9.50011L7.9999 5.43945L12.0606 9.50011L10.9999 10.5608Z" } })]);
|
|
282
|
+
}, je = [], qe = /* @__PURE__ */ A(
|
|
283
|
+
We,
|
|
284
|
+
Ue,
|
|
285
|
+
je,
|
|
286
|
+
!1,
|
|
287
|
+
null,
|
|
288
|
+
null,
|
|
289
|
+
null,
|
|
290
|
+
null
|
|
291
|
+
);
|
|
292
|
+
const He = qe.exports, Je = B({
|
|
293
|
+
name: "dropdown-small-textbox",
|
|
294
|
+
inheritAttrs: !1
|
|
295
|
+
}), Ze = /* @__PURE__ */ B({
|
|
296
|
+
...Je,
|
|
297
|
+
props: {
|
|
298
|
+
/**
|
|
299
|
+
* The number of additional items that have been selected in the dropdown.
|
|
300
|
+
*/
|
|
301
|
+
additionalItemsSelected: { type: [Number, String], default: 0 },
|
|
302
|
+
/**
|
|
303
|
+
* Sets the aria-controls attribute on the textbox. This should correspond to the popover's id that the textbox triggers.
|
|
304
|
+
*/
|
|
305
|
+
ariaControls: { type: String, required: !0 },
|
|
306
|
+
/**
|
|
307
|
+
* 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.
|
|
308
|
+
*/
|
|
309
|
+
ariaExpanded: {
|
|
310
|
+
type: [String, Boolean],
|
|
311
|
+
required: !0
|
|
312
|
+
},
|
|
313
|
+
/**
|
|
314
|
+
* If no label element is used then the aria-label is be set should be set.
|
|
315
|
+
*/
|
|
316
|
+
ariaLabel: { type: String, default: null },
|
|
317
|
+
/**
|
|
318
|
+
* Corresponds to the label's id that labels the textbox element.
|
|
319
|
+
*/
|
|
320
|
+
ariaLabelledby: { type: String, default: null },
|
|
321
|
+
/**
|
|
322
|
+
* Custom debounce time. Default: 300
|
|
323
|
+
*/
|
|
324
|
+
debounceTime: { type: Number, default: 300 },
|
|
325
|
+
/**
|
|
326
|
+
* Disables any textbox functionality
|
|
327
|
+
*/
|
|
328
|
+
disabled: { type: Boolean, default: !1 },
|
|
329
|
+
/**
|
|
330
|
+
* Selected option's label
|
|
331
|
+
*/
|
|
332
|
+
displayValue: { type: String, default: null },
|
|
333
|
+
/**
|
|
334
|
+
* Sets the possibility to type into the textbox
|
|
335
|
+
*/
|
|
336
|
+
dynamicFiltering: { type: Boolean, default: !1 },
|
|
337
|
+
/**
|
|
338
|
+
* Marks the textbox as invalid, rendering an error state
|
|
339
|
+
*/
|
|
340
|
+
isInvalid: { type: Boolean, default: !1 },
|
|
341
|
+
/**
|
|
342
|
+
* Indicates if the dropdown is open so that
|
|
343
|
+
* the respective event can be emitted
|
|
344
|
+
*/
|
|
345
|
+
open: { type: Boolean, default: !1 },
|
|
346
|
+
/**
|
|
347
|
+
* Sets the dropdown to readonly state
|
|
348
|
+
*/
|
|
349
|
+
readonly: { type: Boolean, default: !1 },
|
|
350
|
+
/**
|
|
351
|
+
* The input value
|
|
352
|
+
*/
|
|
353
|
+
value: { type: String, default: "" }
|
|
354
|
+
},
|
|
355
|
+
setup(n, { emit: e }) {
|
|
356
|
+
const o = n, t = c(() => ({
|
|
357
|
+
[`b-dropdown-small-textbox--${P.DISABLED}`]: o.disabled,
|
|
358
|
+
[`b-dropdown-small-textbox--${P.READONLY}`]: o.readonly,
|
|
359
|
+
[`b-dropdown-small-textbox--${P.OPENED}`]: o.open
|
|
360
|
+
})), l = c(() => o.open && !o.disabled && !o.readonly), s = () => {
|
|
361
|
+
e(k.OPEN);
|
|
362
|
+
}, a = () => {
|
|
363
|
+
e(k.CLOSE);
|
|
364
|
+
}, r = {
|
|
365
|
+
[k.OPEN]: s,
|
|
366
|
+
[k.CLOSE]: a
|
|
367
|
+
};
|
|
368
|
+
return { __sfc: !0, emit: e, props: o, conditionalClasses: t, isDropdownOpen: l, openDropdown: s, closeDropdown: a, listeners: r, DropdownBaseTextbox: we, ChevronDownSmallIcon: ze, ChevronUpSmallIcon: He };
|
|
369
|
+
}
|
|
370
|
+
});
|
|
371
|
+
var Ye = function() {
|
|
372
|
+
var e = this, o = e._self._c, t = e._self._setupProxy;
|
|
373
|
+
return o("div", { staticClass: "b-dropdown-small-textbox", class: t.conditionalClasses }, [o(t.DropdownBaseTextbox, e._g(e._b({ staticClass: "b-dropdown-small-textbox__textbox", scopedSlots: e._u([{ key: "icon", fn: function() {
|
|
374
|
+
return [o("div", { staticClass: "b-dropdown-small-textbox__chevron" }, [o(t.ChevronUpSmallIcon, { directives: [{ name: "show", rawName: "v-show", value: t.isDropdownOpen, expression: "isDropdownOpen" }], attrs: { "svg-title": "opened" } }), o(t.ChevronDownSmallIcon, { directives: [{ name: "show", rawName: "v-show", value: !t.isDropdownOpen, expression: "!isDropdownOpen" }], attrs: { "svg-title": "closed" } })], 1)];
|
|
375
|
+
}, proxy: !0 }]) }, "dropdown-base-textbox", { ...e.$attrs, ...e.$props }, !1), t.listeners))], 1);
|
|
376
|
+
}, Ge = [], Qe = /* @__PURE__ */ A(
|
|
377
|
+
Ze,
|
|
378
|
+
Ye,
|
|
379
|
+
Ge,
|
|
380
|
+
!1,
|
|
381
|
+
null,
|
|
382
|
+
"1bc3a61b",
|
|
383
|
+
null,
|
|
384
|
+
null
|
|
385
|
+
);
|
|
386
|
+
const Xe = Qe.exports, Ve = ({ items: n, placeholder: e, selectedValue: o, staticCategories: t }) => {
|
|
387
|
+
if (!o.value)
|
|
388
|
+
return e.value || null;
|
|
389
|
+
let l;
|
|
390
|
+
if (t) {
|
|
391
|
+
const s = n.value.find((a) => a.items.some((r) => r.value === o.value));
|
|
392
|
+
l = s == null ? void 0 : s.items.find((a) => a.value === o.value);
|
|
393
|
+
} else
|
|
394
|
+
l = n.value.find(({ value: s }) => s === o.value);
|
|
395
|
+
return l ? l.label : o.value.toString();
|
|
396
|
+
}, et = ({ selectedValues: n, items: e, placeholder: o }) => {
|
|
397
|
+
var t;
|
|
398
|
+
return !n.value || ((t = n.value) == null ? void 0 : t.length) === 0 ? o.value || null : n.value.map((l) => {
|
|
399
|
+
const s = e.value.find(({ value: a }) => a === l);
|
|
400
|
+
return s ? s.label : l;
|
|
401
|
+
}).join(", ");
|
|
402
|
+
}, tt = ({ selectedValues: n, items: e, placeholder: o }) => {
|
|
403
|
+
var t;
|
|
404
|
+
return !n.value || !((t = n.value) != null && t.length) ? o.value || null : e.value.reduce((l, s) => {
|
|
405
|
+
if (s.items) {
|
|
406
|
+
const a = s.items.filter(
|
|
407
|
+
(d) => n.value.includes(d.value)
|
|
408
|
+
);
|
|
409
|
+
a.length === s.items.length ? l.push(s.label) : a.forEach(({ label: d }) => l.push(d));
|
|
410
|
+
}
|
|
411
|
+
return n.value.includes(s.value) && l.push(s.label), l;
|
|
412
|
+
}, []).join(", ");
|
|
413
|
+
}, ot = ({ items: n, placeholder: e, value: o, multiple: t, staticCategories: l }) => {
|
|
414
|
+
const s = c(() => n.value.find((r) => {
|
|
415
|
+
var d;
|
|
416
|
+
return (d = r.items) == null ? void 0 : d.length;
|
|
417
|
+
}));
|
|
418
|
+
return c(() => t.value ? s.value ? tt({ selectedValues: o, placeholder: e, items: n }) : et({ selectedValues: o, items: n, placeholder: e }) : Ve({
|
|
419
|
+
items: n,
|
|
420
|
+
placeholder: e,
|
|
421
|
+
selectedValue: o,
|
|
422
|
+
staticCategories: l.value
|
|
423
|
+
}));
|
|
424
|
+
}, le = (n) => {
|
|
425
|
+
var e;
|
|
426
|
+
(e = n.value.$children) == null || e[0].$refs.textbox.focus();
|
|
427
|
+
}, nt = ({
|
|
428
|
+
inputContainerRef: n,
|
|
429
|
+
optionsContainerRef: e,
|
|
430
|
+
selectedValueIndex: o,
|
|
431
|
+
isDropdownOpen: t,
|
|
432
|
+
isDynamicFltering: l,
|
|
433
|
+
items: s,
|
|
434
|
+
isMultiple: a
|
|
435
|
+
}, r, d, f) => {
|
|
436
|
+
const v = ({ detail: i }) => {
|
|
437
|
+
i.preventDefault(), t.value || (d(), E(() => {
|
|
438
|
+
var p, b;
|
|
439
|
+
a ? (p = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || p[0].$el.focus() : (b = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || b[o.value].$el.focus();
|
|
440
|
+
}));
|
|
441
|
+
}, _ = ({ detail: i }) => {
|
|
442
|
+
i.preventDefault(), t.value || (d(), E(() => {
|
|
443
|
+
var p;
|
|
444
|
+
(p = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || p[0].$el.focus();
|
|
445
|
+
}));
|
|
446
|
+
}, C = () => {
|
|
447
|
+
t.value || (d(), E(() => {
|
|
448
|
+
var i, p;
|
|
449
|
+
if (a) {
|
|
450
|
+
const b = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children;
|
|
451
|
+
(i = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || i[b.length - 1].$children[s.length - 1].$el.focus();
|
|
452
|
+
} else
|
|
453
|
+
(p = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || p[s.length - 1].$el.focus();
|
|
454
|
+
}));
|
|
455
|
+
}, g = () => {
|
|
456
|
+
t.value && (f(), le(n));
|
|
457
|
+
}, h = () => {
|
|
458
|
+
t.value || d(), E(() => {
|
|
459
|
+
var i;
|
|
460
|
+
(i = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || i[0].$el.focus();
|
|
461
|
+
});
|
|
462
|
+
}, x = ({ detail: i }) => {
|
|
463
|
+
i.preventDefault(), r(), t.value && E(() => {
|
|
464
|
+
var p, b;
|
|
465
|
+
a ? (p = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || p[0].$el.focus() : (b = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || b[o.value].$el.focus();
|
|
466
|
+
});
|
|
467
|
+
}, S = () => {
|
|
468
|
+
r(), t.value && E(() => {
|
|
469
|
+
var i, p;
|
|
470
|
+
a ? (i = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || i[0].$el.focus() : (p = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || p[o.value].$el.focus();
|
|
471
|
+
});
|
|
472
|
+
};
|
|
473
|
+
return c(() => ({
|
|
474
|
+
...l.value ? {} : { [$.SPACE]: x },
|
|
475
|
+
[$.ENTER]: S,
|
|
476
|
+
[$.ARROW_DOWN]: v,
|
|
477
|
+
[$.ARROW_UP]: _,
|
|
478
|
+
[$.END]: C,
|
|
479
|
+
[$.ESCAPE]: g,
|
|
480
|
+
[$.HOME]: h
|
|
481
|
+
}));
|
|
482
|
+
}, lt = ({ inputContainerRef: n, isDropdownOpen: e }, o) => {
|
|
483
|
+
const t = () => {
|
|
484
|
+
e.value && o(), E(() => {
|
|
485
|
+
le(n);
|
|
486
|
+
});
|
|
487
|
+
};
|
|
488
|
+
return {
|
|
489
|
+
[u.ENTER]: t,
|
|
490
|
+
[u.ESCAPE]: t,
|
|
491
|
+
[u.TAB]: t,
|
|
492
|
+
[u.SPACE]: t
|
|
493
|
+
};
|
|
494
|
+
};
|
|
495
|
+
function st(n, e, o) {
|
|
496
|
+
const t = y(n), l = y(e), s = (r, d = []) => d.flatMap((f) => f.label.toLocaleLowerCase().includes(r) ? [f, ...s(r, f.items)] : f.items ? [...s(r, f.items)] : []);
|
|
497
|
+
return te(t, () => {
|
|
498
|
+
o !== void 0 && o(t.value);
|
|
499
|
+
}), c(() => {
|
|
500
|
+
if (!t.value || o !== void 0)
|
|
501
|
+
return l.value;
|
|
502
|
+
const r = t.value.toLocaleLowerCase();
|
|
503
|
+
return s(r, l.value);
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
const at = {
|
|
507
|
+
"en-US": {
|
|
508
|
+
all: "All",
|
|
509
|
+
clearSearch: "Clear filter",
|
|
510
|
+
ariaLabelFallback: "Dropdown"
|
|
511
|
+
}
|
|
512
|
+
}, rt = B({
|
|
513
|
+
i18n: { messages: at },
|
|
514
|
+
name: "b-dropdown",
|
|
515
|
+
components: {
|
|
516
|
+
DropdownInputDefault: he,
|
|
517
|
+
DropdownInputSmall: Xe
|
|
518
|
+
}
|
|
519
|
+
}), it = /* @__PURE__ */ B({
|
|
520
|
+
...rt,
|
|
521
|
+
props: {
|
|
522
|
+
/**
|
|
523
|
+
* @deprecated from version 2.0.0. Use the aria-label attribute instead.
|
|
524
|
+
*/
|
|
525
|
+
/**
|
|
526
|
+
* Defines a string value that labels an interactive element.
|
|
527
|
+
*/
|
|
528
|
+
ariaLabel: { type: String, default: null },
|
|
529
|
+
/**
|
|
530
|
+
* Renders the dropdown with a condensed style.
|
|
531
|
+
*/
|
|
532
|
+
condensed: { type: Boolean, default: !1 },
|
|
533
|
+
/**
|
|
534
|
+
* Empty state props used with the inner empty state component which is displayed when no search results are found.
|
|
535
|
+
*/
|
|
536
|
+
emptyState: {
|
|
537
|
+
type: Object,
|
|
538
|
+
default: void 0
|
|
539
|
+
},
|
|
540
|
+
/**
|
|
541
|
+
* Disables dropdown functionality.
|
|
542
|
+
*/
|
|
543
|
+
disabled: { type: Boolean, default: !1 },
|
|
544
|
+
/**
|
|
545
|
+
* Sets the possibility to type into the textbox.
|
|
546
|
+
*/
|
|
547
|
+
dynamicFiltering: {
|
|
548
|
+
type: Boolean,
|
|
549
|
+
default: !1
|
|
550
|
+
},
|
|
551
|
+
/**
|
|
552
|
+
* Highlights the dropdown in an erroneous state.
|
|
553
|
+
*
|
|
554
|
+
* @deprecated Use "errorMessage" prop instead
|
|
555
|
+
*/
|
|
556
|
+
error: { type: Boolean, default: !1 },
|
|
557
|
+
/**
|
|
558
|
+
* Highlights the dropdown in an erroneous state with an error message.
|
|
559
|
+
*/
|
|
560
|
+
errorMessage: { type: String, default: null },
|
|
561
|
+
/**
|
|
562
|
+
* Descriptive supporting text visbile underneath the dropdown.
|
|
563
|
+
*/
|
|
564
|
+
description: { type: String, default: null },
|
|
565
|
+
/**
|
|
566
|
+
* Indicates whether there are more items to load
|
|
567
|
+
*/
|
|
568
|
+
hasMoreItems: { type: Boolean, default: !1 },
|
|
569
|
+
/**
|
|
570
|
+
* Function that dertermines which options are disabled from interaction.
|
|
571
|
+
*
|
|
572
|
+
* @type {BentoListboxIsOptionDisabled}
|
|
573
|
+
* @param {BentoListboxOptionItem} option - Dropdown option object
|
|
574
|
+
* @param {string} option.label - Option's label text
|
|
575
|
+
* @param {string|number} option.value - Option's value
|
|
576
|
+
* @param {unknown} option.data - Option's extra data to be passed to the default slot
|
|
577
|
+
*/
|
|
578
|
+
isOptionDisabled: {
|
|
579
|
+
type: Function,
|
|
580
|
+
default: void 0
|
|
581
|
+
},
|
|
582
|
+
/**
|
|
583
|
+
* The option elements to populate the dropdown with.
|
|
584
|
+
* It must be an array of {@see BentoListboxOptionItem }
|
|
585
|
+
* * @property {string} value.label - Text to be displayed in the option
|
|
586
|
+
* * @property {string,number} value.value - Value of the option
|
|
587
|
+
*/
|
|
588
|
+
items: {
|
|
589
|
+
type: Array,
|
|
590
|
+
default: () => []
|
|
591
|
+
},
|
|
592
|
+
/**
|
|
593
|
+
* Text that is displayed as a label above the element.
|
|
594
|
+
*/
|
|
595
|
+
label: { type: String, default: null },
|
|
596
|
+
/**
|
|
597
|
+
* Indicates if new options are loading.
|
|
598
|
+
*/
|
|
599
|
+
loading: { type: Boolean, default: !1 },
|
|
600
|
+
/**
|
|
601
|
+
* The type of `Lazy Load`.
|
|
602
|
+
* Type "automatic" will enable infinite scrolling
|
|
603
|
+
* Type "button" will enable lazy loading with "Show more" button
|
|
604
|
+
*/
|
|
605
|
+
lazyLoadType: {
|
|
606
|
+
type: String,
|
|
607
|
+
default: z.props.lazyLoadType.default,
|
|
608
|
+
validator: (n) => Object.values(K).includes(n)
|
|
609
|
+
},
|
|
610
|
+
/*
|
|
611
|
+
* If enabled, the user will be able to select multiple items.
|
|
612
|
+
*/
|
|
613
|
+
multiple: { type: Boolean, default: !1 },
|
|
614
|
+
/**
|
|
615
|
+
* Highlights the dropdown is optional.
|
|
616
|
+
*/
|
|
617
|
+
optional: { type: Boolean, default: !1 },
|
|
618
|
+
/**
|
|
619
|
+
* Text that appears in the form control when it has no value set
|
|
620
|
+
*/
|
|
621
|
+
placeholder: { type: String, default: null },
|
|
622
|
+
/**
|
|
623
|
+
* Sets the dropdown to readonly state
|
|
624
|
+
*/
|
|
625
|
+
readonly: { type: Boolean, default: !1 },
|
|
626
|
+
/**
|
|
627
|
+
* Highlights the dropdown is required.
|
|
628
|
+
*/
|
|
629
|
+
required: { type: Boolean, default: !1 },
|
|
630
|
+
/**
|
|
631
|
+
* Dropdown search options and events.
|
|
632
|
+
* @see BentoDropdownSearchOptions
|
|
633
|
+
*/
|
|
634
|
+
search: {
|
|
635
|
+
type: Object,
|
|
636
|
+
default: void 0
|
|
637
|
+
},
|
|
638
|
+
/**
|
|
639
|
+
* Toggles whether to use the slot content select items shown in the textbox in multiple mode.
|
|
640
|
+
*/
|
|
641
|
+
showSlotContentInMultiple: { type: Boolean, default: !1 },
|
|
642
|
+
/**
|
|
643
|
+
* Dropdown input size
|
|
644
|
+
* * @see BentoDropdownSize
|
|
645
|
+
*/
|
|
646
|
+
size: {
|
|
647
|
+
type: String,
|
|
648
|
+
default: D.DEFAULT,
|
|
649
|
+
validator: (n) => Object.values(D).includes(n)
|
|
650
|
+
},
|
|
651
|
+
/**
|
|
652
|
+
* If enabled, dropdown will display non-selectable, static categories
|
|
653
|
+
*/
|
|
654
|
+
staticCategories: { type: Boolean, default: !1 },
|
|
655
|
+
/**
|
|
656
|
+
* Adds a info icon next to the label to display the passed tooltip message.
|
|
657
|
+
*/
|
|
658
|
+
tooltipText: { type: String, default: null },
|
|
659
|
+
/**
|
|
660
|
+
* The `input` value.
|
|
661
|
+
* Providing an empty string will select no options.
|
|
662
|
+
* Set to an empty string `''` if you don't want any of the available options to be selected.
|
|
663
|
+
*/
|
|
664
|
+
value: {
|
|
665
|
+
type: [String, Number, Array],
|
|
666
|
+
default: null
|
|
667
|
+
},
|
|
668
|
+
/**
|
|
669
|
+
* Enables virtual scrolling if set to true or by providing an object with itemHeight function.
|
|
670
|
+
* The itemHeight function is used to calculate the height of rendered item given it's index.
|
|
671
|
+
*/
|
|
672
|
+
virtualScroll: {
|
|
673
|
+
type: [Boolean, Object],
|
|
674
|
+
default: !1
|
|
675
|
+
}
|
|
676
|
+
},
|
|
677
|
+
emits: ["input", "show-more"],
|
|
678
|
+
setup(n, { emit: e }) {
|
|
679
|
+
var Q;
|
|
680
|
+
const o = n, t = me(), l = oe(), s = xe(l), { t: a } = W(), r = y(null), d = y(null), f = y(null), v = y(!1), _ = T("bento-dropdown-options-container"), C = T("dropdown-label"), g = T("dropdown-description"), h = T("dropdown-error"), { isReadOnly: x } = ge(O(o, "readonly")), S = y(t["aria-label"]), { ariaLabel: L } = ne(o), i = ye({
|
|
681
|
+
ariaLabel: S.value,
|
|
682
|
+
// TODO: take this line away when the aria-label props is removed
|
|
683
|
+
label: L,
|
|
684
|
+
defaultFallback: a("ariaLabelFallback")
|
|
685
|
+
}), p = c(() => ({
|
|
686
|
+
"b-dropdown--condensed": o.condensed
|
|
687
|
+
})), b = c(() => ({
|
|
688
|
+
"b-dropdown__description--error": !!o.errorMessage
|
|
689
|
+
})), w = y(""), I = O(o, "items"), se = st(w, I, (Q = o == null ? void 0 : o.search) == null ? void 0 : Q.searchEvent), F = c(() => o.dynamicFiltering && !!w.value), ae = ot({
|
|
690
|
+
items: I,
|
|
691
|
+
staticCategories: O(o, "staticCategories"),
|
|
692
|
+
multiple: O(o, "multiple"),
|
|
693
|
+
placeholder: O(o, "placeholder"),
|
|
694
|
+
value: O(o, "value")
|
|
695
|
+
}), re = c(() => o.size === D.DEFAULT), ie = c(() => {
|
|
696
|
+
if (o != null && o.multiple)
|
|
697
|
+
return o.items.filter(
|
|
698
|
+
({ value: m }) => (o == null ? void 0 : o.value) && (o == null ? void 0 : o.value).includes(m)
|
|
699
|
+
);
|
|
700
|
+
if (!o.multiple && o.staticCategories) {
|
|
701
|
+
const m = o.items.find(
|
|
702
|
+
(N) => N.items.some((ve) => ve.value === o.value)
|
|
703
|
+
);
|
|
704
|
+
return m ? m.items.find((N) => N.value === o.value) : null;
|
|
705
|
+
}
|
|
706
|
+
return o.items.find(({ value: m }) => m === (o == null ? void 0 : o.value));
|
|
707
|
+
}), U = c(() => {
|
|
708
|
+
const m = o.items.findIndex(({ value: R }) => o.value === R);
|
|
709
|
+
return m > 0 ? m : 0;
|
|
710
|
+
}), { isMultiLevelSelect: j, flattenedItemsList: q } = Se(I), de = c(() => {
|
|
711
|
+
var m;
|
|
712
|
+
if (o.multiple) {
|
|
713
|
+
const R = (m = o == null ? void 0 : o.value) == null ? void 0 : m.length;
|
|
714
|
+
return (j.value ? q.value.length : I.value.length) === R ? a("all") : R;
|
|
715
|
+
}
|
|
716
|
+
return null;
|
|
717
|
+
}), ue = c(
|
|
718
|
+
() => `${o.description ? g : ""} ${o.errorMessage ? h : ""}`.trim() || null
|
|
719
|
+
), H = () => {
|
|
720
|
+
x.value || (v.value = !0);
|
|
721
|
+
}, M = () => {
|
|
722
|
+
v.value = !1;
|
|
723
|
+
}, J = () => {
|
|
724
|
+
x.value || (v.value = !v.value, F.value && (w.value = ""));
|
|
725
|
+
}, ce = () => {
|
|
726
|
+
F.value && (w.value = ""), v.value && (v.value = !1, f.value.onOutsideDropdownClick());
|
|
727
|
+
}, Z = (m) => {
|
|
728
|
+
o.multiple || (w.value = "", v.value = !1), e("input", m);
|
|
729
|
+
}, Y = () => {
|
|
730
|
+
e(u.SHOW_MORE);
|
|
731
|
+
}, pe = nt(
|
|
732
|
+
{
|
|
733
|
+
inputContainerRef: r,
|
|
734
|
+
optionsContainerRef: f,
|
|
735
|
+
selectedValueIndex: U,
|
|
736
|
+
isDropdownOpen: v,
|
|
737
|
+
isDynamicFltering: O(o, "dynamicFiltering"),
|
|
738
|
+
items: o.items,
|
|
739
|
+
isMultiple: o.multiple
|
|
740
|
+
},
|
|
741
|
+
J,
|
|
742
|
+
H,
|
|
743
|
+
M
|
|
744
|
+
), G = lt(
|
|
745
|
+
{
|
|
746
|
+
inputContainerRef: r,
|
|
747
|
+
isDropdownOpen: v
|
|
748
|
+
},
|
|
749
|
+
M
|
|
750
|
+
), fe = {
|
|
751
|
+
[u.CLOSE_DROPDOWN]: M,
|
|
752
|
+
[u.SELECT]: Z,
|
|
753
|
+
[u.SHOW_MORE]: Y,
|
|
754
|
+
...G
|
|
755
|
+
};
|
|
756
|
+
return o.error && be(
|
|
757
|
+
'BentoDropdown "error" property',
|
|
758
|
+
`Use the BentoDropdown "errorMessage" property instead to indicate that there is a modifier error.
|
|
759
|
+
Having the field as "undefined" will hide/remove the error.
|
|
760
|
+
<bento-dropdown errorMessage="Error message text" />`,
|
|
761
|
+
"2.0.0"
|
|
762
|
+
), { __sfc: !0, attrs: t, slots: l, hasSlot: s, props: o, emit: e, t: a, inputContainerRef: r, inputContainerRefWrapper: d, optionsContainerRef: f, isDropdownOpen: v, dropdownOptionsContainerId: _, labelId: C, descriptionId: g, errorId: h, isReadOnly: x, ariaLabelAttribute: S, ariaLabel: L, computedAriaLabel: i, conditionalClasses: p, descriptionConditionalClasses: b, searchTerm: w, items: I, filteredItems: se, isSearching: F, displayValue: ae, idDefaultSize: re, selectedValueItem: ie, selectedValueIndex: U, isMultiLevelSelect: j, flattenedItemsList: q, additionalItemsSelected: de, ariaDescribedBy: ue, openDropdown: H, closeDropdown: M, toggleDropdown: J, clickOutsideDropdown: ce, onOptionSelected: Z, emitShowMoreEvent: Y, textboxKeyboardNavigationListeners: pe, listboxKeyboardNavigationListeners: G, listboxListeners: fe, BentoDropdownOptionsContainer: Ne, BentoTypography: _e, ErrorMessage: Oe, FieldLabel: $e, vBentoClickOutsideDirective: Ee, vBentoKeyboardNavigationDirective: Le };
|
|
763
|
+
}
|
|
764
|
+
});
|
|
765
|
+
var dt = function() {
|
|
766
|
+
var l;
|
|
767
|
+
var e = this, o = e._self._c, t = e._self._setupProxy;
|
|
768
|
+
return o("div", { directives: [{ name: "bento-click-outside-directive", rawName: "v-bento-click-outside-directive", value: t.clickOutsideDropdown, expression: "clickOutsideDropdown" }], staticClass: "b-dropdown", class: t.conditionalClasses }, [e.label ? o(t.FieldLabel, { attrs: { id: t.labelId, condensed: e.condensed, label: e.label, "tooltip-text": e.tooltipText, optional: e.optional, required: e.required } }) : e._e(), o("div", e._g({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], ref: "inputContainerRefWrapper" }, t.textboxKeyboardNavigationListeners), [o(e.size, { ref: "inputContainerRef", tag: "component", attrs: { condensed: e.condensed, value: t.searchTerm, "additional-items-selected": t.additionalItemsSelected, ariaControls: t.dropdownOptionsContainerId, ariaExpanded: t.isDropdownOpen, "aria-labelledby": e.label ? t.labelId : null, "aria-describedby": t.ariaDescribedBy, "aria-label": t.computedAriaLabel, "aria-readonly": t.isReadOnly, readonly: t.isReadOnly, disabled: e.disabled, "display-value": t.displayValue, "dynamic-filtering": e.dynamicFiltering, "is-invalid": !!e.errorMessage || e.error, multiple: e.multiple, open: t.isDropdownOpen, "selected-value-item": t.idDefaultSize ? t.selectedValueItem : void 0, "show-slot-content-in-multiple": e.showSlotContentInMultiple }, on: { input: function(s) {
|
|
769
|
+
t.searchTerm = s;
|
|
770
|
+
}, open: t.toggleDropdown, close: t.toggleDropdown }, scopedSlots: e._u([e._l(t.slots, function(s, a) {
|
|
771
|
+
return { key: a, fn: function(r) {
|
|
772
|
+
return [e._t(a, null, null, r)];
|
|
773
|
+
} };
|
|
774
|
+
})], null, !0) })], 1), t.inputContainerRef ? o(t.BentoDropdownOptionsContainer, e._g({ ref: "optionsContainerRef", attrs: { id: t.dropdownOptionsContainerId, "aria-label": t.computedAriaLabel, "empty-state": e.emptyState, "debounce-time": (l = e.search) == null ? void 0 : l.debounceTime, disabled: e.disabled, "input-size": e.size, "is-option-disabled": e.isOptionDisabled, items: t.filteredItems, multiple: e.multiple, "static-categories": e.staticCategories, open: t.isDropdownOpen, "selected-value": e.value, searching: t.isSearching, "target-element": t.inputContainerRefWrapper, loading: e.loading, "has-more-items": e.hasMoreItems, "lazy-load-type": e.lazyLoadType, "virtual-scroll": e.virtualScroll }, scopedSlots: e._u([e._l(t.slots, function(s, a) {
|
|
775
|
+
return { key: a, fn: function(r) {
|
|
776
|
+
return [e._t(a, null, null, r)];
|
|
777
|
+
} };
|
|
778
|
+
})], null, !0) }, t.listboxListeners)) : e._e(), e.errorMessage ? o(t.ErrorMessage, { staticClass: "b-dropdown__error-message", attrs: { id: t.errorId, "error-message": e.errorMessage } }) : e._e(), e.description || t.hasSlot("description") ? o(t.BentoTypography, { staticClass: "b-dropdown__description", class: t.descriptionConditionalClasses, attrs: { id: t.descriptionId, el: "span" } }, [e._t("description", function() {
|
|
779
|
+
return [e._v(" " + e._s(e.description) + " ")];
|
|
780
|
+
})], 2) : e._e()], 1);
|
|
781
|
+
}, ut = [], ct = /* @__PURE__ */ A(
|
|
782
|
+
it,
|
|
783
|
+
dt,
|
|
784
|
+
ut,
|
|
785
|
+
!1,
|
|
786
|
+
null,
|
|
787
|
+
"bdb41062",
|
|
788
|
+
null,
|
|
789
|
+
null
|
|
790
|
+
);
|
|
791
|
+
const $t = ct.exports;
|
|
792
|
+
export {
|
|
793
|
+
$t as B,
|
|
794
|
+
D as a,
|
|
795
|
+
st as u
|
|
796
|
+
};
|
|
797
|
+
//# sourceMappingURL=dropdown.eaee22a3.js.map
|