@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
|
@@ -1,887 +0,0 @@
|
|
|
1
|
-
import { ref as y, watch as Z, computed as f, defineComponent as K, toRefs as Y, nextTick as C, toRef as O } from "vue";
|
|
2
|
-
import { B as pe, d as me } from "./index.b0a89960.js";
|
|
3
|
-
import { D as be, a as D, b as N, c as ye } from "./dropdown-default-textbox.1cba89ea.js";
|
|
4
|
-
import { n as I } from "./_plugin-vue2_normalizer.71e2aa87.js";
|
|
5
|
-
import { g as B } from "./unique-id.a2a2b458.js";
|
|
6
|
-
import { u as _e } from "./aria-label.ac9651a5.js";
|
|
7
|
-
import { u as W } from "./i18n.eb5b985b.js";
|
|
8
|
-
import { u as ge } from "./use-form-layout-loading.d03e5d48.js";
|
|
9
|
-
import { a as i, B as k, b as F, u as xe } from "./listbox.7cf6d6b4.js";
|
|
10
|
-
import { B as L, a as we } from "./keyboard-navigation.ca47dfa8.js";
|
|
11
|
-
import { u as he } from "./use-has-slot.fbeb19ec.js";
|
|
12
|
-
import { a as P } from "./index.58282364.js";
|
|
13
|
-
import { a as q } from "./index.f18f79eb.js";
|
|
14
|
-
import { B as G } from "./directive.0408e565.js";
|
|
15
|
-
import { E as Se, F as Oe } from "./field-label.a0c54b7d.js";
|
|
16
|
-
import "../assets/dropdown.css";
|
|
17
|
-
var E = /* @__PURE__ */ ((t) => (t.DEFAULT = "DropdownInputDefault", t.SMALL = "DropdownInputSmall", t))(E || {});
|
|
18
|
-
const Le = {
|
|
19
|
-
"en-US": {
|
|
20
|
-
apply: "Apply",
|
|
21
|
-
cancel: "Cancel",
|
|
22
|
-
noOptionsMatchThisSearch: "No options match this search"
|
|
23
|
-
}
|
|
24
|
-
}, Ce = (t, e, n, l) => {
|
|
25
|
-
const a = y(t.value), { t: o } = W();
|
|
26
|
-
Z(t, () => {
|
|
27
|
-
a.value = t.value;
|
|
28
|
-
});
|
|
29
|
-
const d = f(
|
|
30
|
-
() => JSON.stringify(a.value) === JSON.stringify(t.value)
|
|
31
|
-
), u = () => {
|
|
32
|
-
l(i.SELECT, a.value), l(i.CLOSE_DROPDOWN);
|
|
33
|
-
}, s = () => {
|
|
34
|
-
a.value = t.value, l(i.CLOSE_DROPDOWN);
|
|
35
|
-
}, p = () => {
|
|
36
|
-
n.value && e.value && (a.value = t.value);
|
|
37
|
-
}, x = f(() => [
|
|
38
|
-
{
|
|
39
|
-
title: o("apply"),
|
|
40
|
-
event: u,
|
|
41
|
-
disabled: d.value
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
title: o("cancel"),
|
|
45
|
-
event: s
|
|
46
|
-
}
|
|
47
|
-
]), m = (r) => {
|
|
48
|
-
a.value = r, e.value || l(i.SELECT, r);
|
|
49
|
-
}, g = (r) => {
|
|
50
|
-
m(r), l(i.TAB);
|
|
51
|
-
}, _ = (r) => {
|
|
52
|
-
m(r), l(i.ENTER);
|
|
53
|
-
}, w = (r) => {
|
|
54
|
-
m(r), l(i.SPACE);
|
|
55
|
-
}, h = () => {
|
|
56
|
-
s(), l(i.ESCAPE);
|
|
57
|
-
}, S = () => {
|
|
58
|
-
l(i.SHOW_MORE);
|
|
59
|
-
}, $ = {
|
|
60
|
-
[i.SELECT]: m,
|
|
61
|
-
[i.SHOW_MORE]: S,
|
|
62
|
-
[i.TAB]: g,
|
|
63
|
-
[i.SPACE]: w,
|
|
64
|
-
[i.ENTER]: _
|
|
65
|
-
};
|
|
66
|
-
return {
|
|
67
|
-
// Values
|
|
68
|
-
actions: x,
|
|
69
|
-
internalSelectedValue: a,
|
|
70
|
-
// Methods
|
|
71
|
-
listeners: $,
|
|
72
|
-
onEscapeKey: h,
|
|
73
|
-
onOutsideDropdownClick: p
|
|
74
|
-
};
|
|
75
|
-
}, Ee = K({
|
|
76
|
-
i18n: { messages: Le },
|
|
77
|
-
name: "bento-dropdown-options-container",
|
|
78
|
-
components: {
|
|
79
|
-
BentoListbox: k,
|
|
80
|
-
PopperContainer: P,
|
|
81
|
-
BentoPopover: q
|
|
82
|
-
},
|
|
83
|
-
directives: { BentoClickOutsideDirective: G },
|
|
84
|
-
props: {
|
|
85
|
-
/**
|
|
86
|
-
* Defines a string value that labels an interactive element.
|
|
87
|
-
*/
|
|
88
|
-
ariaLabel: { type: String, default: null },
|
|
89
|
-
/**
|
|
90
|
-
* Empty state props used with the inner empty state component which is displayed when no search results are found.
|
|
91
|
-
*/
|
|
92
|
-
emptyState: {
|
|
93
|
-
type: Object,
|
|
94
|
-
default: void 0
|
|
95
|
-
},
|
|
96
|
-
/**
|
|
97
|
-
* Disables dropdown functionality
|
|
98
|
-
*/
|
|
99
|
-
disabled: { type: Boolean, default: !1 },
|
|
100
|
-
/**
|
|
101
|
-
* Indicates whether there are more items to load
|
|
102
|
-
*/
|
|
103
|
-
hasMoreItems: { type: Boolean, default: !1 },
|
|
104
|
-
/**
|
|
105
|
-
* Identifies the listbox whose contents are controlled by the the combobox on which the aria-controls attribute is set.
|
|
106
|
-
*/
|
|
107
|
-
id: { type: String, required: !0 },
|
|
108
|
-
/**
|
|
109
|
-
* Function that allows the options to be disabled
|
|
110
|
-
*
|
|
111
|
-
* @type {BentoDropdownIsOptionDisabled}
|
|
112
|
-
* @param {BentoDropdownOptionItem} option - Dropdown option object
|
|
113
|
-
* @param {string} option.label - Option's label text
|
|
114
|
-
* @param {string|number} option.value - Option's value
|
|
115
|
-
* @param {unknown} option.data - Option's extra data to be passed to the default slot
|
|
116
|
-
*/
|
|
117
|
-
isOptionDisabled: {
|
|
118
|
-
type: Function,
|
|
119
|
-
default: void 0
|
|
120
|
-
},
|
|
121
|
-
/**
|
|
122
|
-
* Dropdown input size
|
|
123
|
-
*/
|
|
124
|
-
inputSize: {
|
|
125
|
-
type: String,
|
|
126
|
-
default: E.DEFAULT,
|
|
127
|
-
validator: (t) => Object.values(E).includes(t)
|
|
128
|
-
},
|
|
129
|
-
/**
|
|
130
|
-
* The option elements to populate the dropdown with.
|
|
131
|
-
* It must be an array of {@see BentoDropdownOptionItem }
|
|
132
|
-
* * @property {string} value.label - Text to be displayed in the option
|
|
133
|
-
* * @property {string,number} value.value - Value of the option
|
|
134
|
-
*/
|
|
135
|
-
items: {
|
|
136
|
-
type: Array,
|
|
137
|
-
required: !0
|
|
138
|
-
},
|
|
139
|
-
/**
|
|
140
|
-
* Indicates if new options are loading.
|
|
141
|
-
*/
|
|
142
|
-
loading: { type: Boolean, default: !1 },
|
|
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: F.AUTOMATIC,
|
|
151
|
-
validator: (t) => Object.values(F).includes(t)
|
|
152
|
-
},
|
|
153
|
-
/**
|
|
154
|
-
* If enabled, the user will be able to select multiple items.
|
|
155
|
-
*/
|
|
156
|
-
multiple: { type: Boolean, default: !1 },
|
|
157
|
-
/**
|
|
158
|
-
* If enabled, dropdown will display non-selectable, static categories
|
|
159
|
-
*/
|
|
160
|
-
staticCategories: { 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: [String, Number, 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: k.props.searching,
|
|
182
|
-
/**
|
|
183
|
-
* Reference to the DOM element or Vue component for positioning
|
|
184
|
-
* the Dropdown container.
|
|
185
|
-
*/
|
|
186
|
-
targetElement: { type: P.props.targetElement.type, required: !0 },
|
|
187
|
-
/**
|
|
188
|
-
* Enables virtual scrolling if set to true or by providing an object with itemHeight function.
|
|
189
|
-
* The itemHeight function is used to calculate the height of rendered item given it's index.
|
|
190
|
-
*/
|
|
191
|
-
virtualScroll: {
|
|
192
|
-
type: [Boolean, Object],
|
|
193
|
-
default: !1
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
emits: [
|
|
197
|
-
i.CLOSE_DROPDOWN,
|
|
198
|
-
i.SHOW_MORE,
|
|
199
|
-
i.SELECT,
|
|
200
|
-
i.ENTER,
|
|
201
|
-
i.ESCAPE,
|
|
202
|
-
i.SPACE,
|
|
203
|
-
i.TAB
|
|
204
|
-
],
|
|
205
|
-
setup(t, { emit: e, slots: n }) {
|
|
206
|
-
const { selectedValue: l, multiple: a } = Y(t), o = y(null), { t: d } = W(), u = f(() => t.open && !t.disabled), s = f(() => d("noOptionsMatchThisSearch")), p = f(() => ({
|
|
207
|
-
"b-dropdown-options-container--single": !(t != null && t.multiple)
|
|
208
|
-
})), x = f(() => ({
|
|
209
|
-
"b-dropdown-options-container__listbox--small": t.inputSize === E.SMALL,
|
|
210
|
-
"b-dropdown-options-container__listbox--single": !(t != null && t.multiple)
|
|
211
|
-
})), { actions: m, internalSelectedValue: g, listeners: _, onEscapeKey: w, onOutsideDropdownClick: h } = Ce(l, a, u, e), S = f(
|
|
212
|
-
() => t != null && t.multiple ? q : P
|
|
213
|
-
), $ = f(() => {
|
|
214
|
-
var c;
|
|
215
|
-
const r = {
|
|
216
|
-
"min-width": `${(c = t == null ? void 0 : t.targetElement) == null ? void 0 : c.clientWidth}px`,
|
|
217
|
-
"max-width": "min(500px, 95%)"
|
|
218
|
-
};
|
|
219
|
-
return t != null && t.multiple ? {
|
|
220
|
-
actionsLayout: "space-between",
|
|
221
|
-
actions: m.value,
|
|
222
|
-
divider: !0,
|
|
223
|
-
fallbackPosition: ["top-start"],
|
|
224
|
-
id: B(`dropdown-options-${t.id}`),
|
|
225
|
-
open: t.open,
|
|
226
|
-
position: "bottom-start",
|
|
227
|
-
style: {
|
|
228
|
-
width: "auto",
|
|
229
|
-
...r
|
|
230
|
-
},
|
|
231
|
-
targetElement: t.targetElement
|
|
232
|
-
} : {
|
|
233
|
-
fallbackPosition: ["top-start"],
|
|
234
|
-
offset: [0, 8],
|
|
235
|
-
position: "bottom-start",
|
|
236
|
-
style: {
|
|
237
|
-
display: u.value ? "block" : "none",
|
|
238
|
-
...r
|
|
239
|
-
},
|
|
240
|
-
targetElement: t.targetElement
|
|
241
|
-
};
|
|
242
|
-
});
|
|
243
|
-
return {
|
|
244
|
-
// Values
|
|
245
|
-
isDropdownOpen: u,
|
|
246
|
-
conditionalClasses: p,
|
|
247
|
-
conditionalListboxClasses: x,
|
|
248
|
-
noResultsMessage: s,
|
|
249
|
-
slots: n,
|
|
250
|
-
actions: m,
|
|
251
|
-
internalSelectedValue: g,
|
|
252
|
-
// Component wrapper
|
|
253
|
-
popperContainerOrPopoverComponent: S,
|
|
254
|
-
popperContainerOrPopoverProps: $,
|
|
255
|
-
// Refs
|
|
256
|
-
dropdownOptionsListboxRef: o,
|
|
257
|
-
// Events
|
|
258
|
-
onEscapeKey: w,
|
|
259
|
-
onOutsideDropdownClick: h,
|
|
260
|
-
listeners: _
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
var $e = function() {
|
|
265
|
-
var e = this, n = e._self._c;
|
|
266
|
-
return e._self._setupProxy, n(e.popperContainerOrPopoverComponent, e._b({ tag: "component", staticClass: "b-dropdown-options-container", class: e.conditionalClasses }, "component", e.popperContainerOrPopoverProps, !1), [n("div", { on: { keydown: function(l) {
|
|
267
|
-
return !l.type.indexOf("key") && e._k(l.keyCode, "esc", 27, l.key, ["Esc", "Escape"]) ? null : e.onEscapeKey.apply(null, arguments);
|
|
268
|
-
} } }, [n("bento-listbox", e._g({ ref: "dropdownOptionsListboxRef", staticClass: "b-dropdown-options-container__listbox", class: e.conditionalListboxClasses, attrs: { id: e.id, "aria-label": e.ariaLabel, "empty-state": e.emptyState, "is-option-disabled": e.isOptionDisabled, items: e.items, "selected-value": e.internalSelectedValue, multiple: e.multiple, "static-categories": e.staticCategories, "no-results-message": e.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(e.slots, function(l, a) {
|
|
269
|
-
return { key: a, fn: function(o) {
|
|
270
|
-
return [e._t(a, null, null, o)];
|
|
271
|
-
} };
|
|
272
|
-
})], null, !0) }, e.listeners))], 1)]);
|
|
273
|
-
}, De = [], Re = /* @__PURE__ */ I(
|
|
274
|
-
Ee,
|
|
275
|
-
$e,
|
|
276
|
-
De,
|
|
277
|
-
!1,
|
|
278
|
-
null,
|
|
279
|
-
"9f64e5d1",
|
|
280
|
-
null,
|
|
281
|
-
null
|
|
282
|
-
);
|
|
283
|
-
const Be = Re.exports;
|
|
284
|
-
let J = 0;
|
|
285
|
-
const Ie = {
|
|
286
|
-
beforeCreate() {
|
|
287
|
-
this.uuid = J.toString(), J += 1;
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
var Te = function() {
|
|
291
|
-
var e = this, n = e._self._c;
|
|
292
|
-
return n("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"] ? n("title", [e._v(e._s(e.$attrs["svg-title"]))]) : e._e(), n("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" } })]);
|
|
293
|
-
}, Ae = [], Me = /* @__PURE__ */ I(
|
|
294
|
-
Ie,
|
|
295
|
-
Te,
|
|
296
|
-
Ae,
|
|
297
|
-
!1,
|
|
298
|
-
null,
|
|
299
|
-
null,
|
|
300
|
-
null,
|
|
301
|
-
null
|
|
302
|
-
);
|
|
303
|
-
const Ne = Me.exports;
|
|
304
|
-
let V = 0;
|
|
305
|
-
const Pe = {
|
|
306
|
-
beforeCreate() {
|
|
307
|
-
this.uuid = V.toString(), V += 1;
|
|
308
|
-
}
|
|
309
|
-
};
|
|
310
|
-
var ke = function() {
|
|
311
|
-
var e = this, n = e._self._c;
|
|
312
|
-
return n("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"] ? n("title", [e._v(e._s(e.$attrs["svg-title"]))]) : e._e(), n("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" } })]);
|
|
313
|
-
}, Fe = [], Ke = /* @__PURE__ */ I(
|
|
314
|
-
Pe,
|
|
315
|
-
ke,
|
|
316
|
-
Fe,
|
|
317
|
-
!1,
|
|
318
|
-
null,
|
|
319
|
-
null,
|
|
320
|
-
null,
|
|
321
|
-
null
|
|
322
|
-
);
|
|
323
|
-
const We = Ke.exports, ze = K({
|
|
324
|
-
name: "dropdown-small-textbox",
|
|
325
|
-
components: { ChevronDownSmallIcon: Ne, ChevronUpSmallIcon: We, DropdownBaseTextbox: be },
|
|
326
|
-
inheritAttrs: !1,
|
|
327
|
-
props: {
|
|
328
|
-
/**
|
|
329
|
-
* The number of additional items that have been selected in the dropdown.
|
|
330
|
-
*/
|
|
331
|
-
additionalItemsSelected: { type: [Number, String], default: 0 },
|
|
332
|
-
/**
|
|
333
|
-
* Sets the aria-controls attribute on the textbox. This should correspond to the popover's id that the textbox triggers.
|
|
334
|
-
*/
|
|
335
|
-
ariaControls: {
|
|
336
|
-
type: String,
|
|
337
|
-
required: !0
|
|
338
|
-
},
|
|
339
|
-
/**
|
|
340
|
-
* 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.
|
|
341
|
-
*/
|
|
342
|
-
ariaExpanded: {
|
|
343
|
-
type: [String, Boolean],
|
|
344
|
-
required: !0
|
|
345
|
-
},
|
|
346
|
-
/**
|
|
347
|
-
* If no label element is used then the aria-label is be set should be set.
|
|
348
|
-
*/
|
|
349
|
-
ariaLabel: {
|
|
350
|
-
type: String,
|
|
351
|
-
default: null
|
|
352
|
-
},
|
|
353
|
-
/**
|
|
354
|
-
* Corresponds to the label's id that labels the textbox element.
|
|
355
|
-
*/
|
|
356
|
-
ariaLabelledby: {
|
|
357
|
-
type: String,
|
|
358
|
-
default: null
|
|
359
|
-
},
|
|
360
|
-
/**
|
|
361
|
-
* Custom debounce time. Default: 300
|
|
362
|
-
*/
|
|
363
|
-
debounceTime: { type: Number, default: 300 },
|
|
364
|
-
/**
|
|
365
|
-
* Disables any textbox functionality
|
|
366
|
-
*/
|
|
367
|
-
disabled: { type: Boolean, default: !1 },
|
|
368
|
-
/**
|
|
369
|
-
* Selected option's label
|
|
370
|
-
*/
|
|
371
|
-
displayValue: { type: String, default: null },
|
|
372
|
-
/**
|
|
373
|
-
* Sets the possibility to type into the textbox
|
|
374
|
-
*/
|
|
375
|
-
dynamicFiltering: {
|
|
376
|
-
type: Boolean,
|
|
377
|
-
default: !1
|
|
378
|
-
},
|
|
379
|
-
/**
|
|
380
|
-
* Marks the textbox as invalid, rendering an error state
|
|
381
|
-
*/
|
|
382
|
-
isInvalid: { type: Boolean, default: !1 },
|
|
383
|
-
/**
|
|
384
|
-
* Indicates if the dropdown is open so that
|
|
385
|
-
* the respective event can be emitted
|
|
386
|
-
*/
|
|
387
|
-
open: { type: Boolean, default: !1 },
|
|
388
|
-
/**
|
|
389
|
-
* Sets the dropdown to readonly state
|
|
390
|
-
*/
|
|
391
|
-
readonly: { type: Boolean, default: !1 },
|
|
392
|
-
/**
|
|
393
|
-
* The input value
|
|
394
|
-
*/
|
|
395
|
-
value: { type: String, default: "" }
|
|
396
|
-
},
|
|
397
|
-
emits: [D.OPEN, D.CLOSE],
|
|
398
|
-
setup(t, { emit: e }) {
|
|
399
|
-
const n = f(() => ({
|
|
400
|
-
[`b-dropdown-small-textbox--${N.DISABLED}`]: t.disabled,
|
|
401
|
-
[`b-dropdown-small-textbox--${N.READONLY}`]: t.readonly,
|
|
402
|
-
[`b-dropdown-small-textbox--${N.OPENED}`]: t.open
|
|
403
|
-
})), l = f(() => t.open && !t.disabled && !t.readonly), a = () => {
|
|
404
|
-
e(D.OPEN);
|
|
405
|
-
}, o = () => {
|
|
406
|
-
e(D.CLOSE);
|
|
407
|
-
}, d = {
|
|
408
|
-
[D.OPEN]: a,
|
|
409
|
-
[D.CLOSE]: o
|
|
410
|
-
};
|
|
411
|
-
return {
|
|
412
|
-
// Values
|
|
413
|
-
conditionalClasses: n,
|
|
414
|
-
isDropdownOpen: l,
|
|
415
|
-
// Events
|
|
416
|
-
listeners: d
|
|
417
|
-
};
|
|
418
|
-
}
|
|
419
|
-
});
|
|
420
|
-
var Ue = function() {
|
|
421
|
-
var e = this, n = e._self._c;
|
|
422
|
-
return e._self._setupProxy, n("div", { staticClass: "b-dropdown-small-textbox", class: e.conditionalClasses }, [n("dropdown-base-textbox", e._g(e._b({ staticClass: "b-dropdown-small-textbox__textbox", scopedSlots: e._u([{ key: "icon", fn: function() {
|
|
423
|
-
return [n("div", { staticClass: "b-dropdown-small-textbox__chevron" }, [n("chevron-up-small-icon", { directives: [{ name: "show", rawName: "v-show", value: e.isDropdownOpen, expression: "isDropdownOpen" }], attrs: { "svg-title": "opened" } }), n("chevron-down-small-icon", { directives: [{ name: "show", rawName: "v-show", value: !e.isDropdownOpen, expression: "!isDropdownOpen" }], attrs: { "svg-title": "closed" } })], 1)];
|
|
424
|
-
}, proxy: !0 }]) }, "dropdown-base-textbox", { ...e.$attrs, ...e.$props }, !1), e.listeners))], 1);
|
|
425
|
-
}, je = [], He = /* @__PURE__ */ I(
|
|
426
|
-
ze,
|
|
427
|
-
Ue,
|
|
428
|
-
je,
|
|
429
|
-
!1,
|
|
430
|
-
null,
|
|
431
|
-
"bc324b09",
|
|
432
|
-
null,
|
|
433
|
-
null
|
|
434
|
-
);
|
|
435
|
-
const qe = He.exports, Je = ({ items: t, placeholder: e, selectedValue: n, staticCategories: l }) => {
|
|
436
|
-
let a;
|
|
437
|
-
if (l) {
|
|
438
|
-
const o = t.value.find((d) => d.items.some((u) => u.value === n.value));
|
|
439
|
-
a = o == null ? void 0 : o.items.find((d) => d.value === n.value);
|
|
440
|
-
} else
|
|
441
|
-
a = t.value.find(({ value: o }) => o === n.value);
|
|
442
|
-
return (a == null ? void 0 : a.label) || e.value || null;
|
|
443
|
-
}, Ve = ({ selectedValues: t, items: e, placeholder: n }) => {
|
|
444
|
-
var l;
|
|
445
|
-
return !t.value || ((l = t.value) == null ? void 0 : l.length) === 0 ? n.value || null : t.value.map((a) => {
|
|
446
|
-
const { label: o } = e.value.find(({ value: d }) => d === a);
|
|
447
|
-
return o;
|
|
448
|
-
}).join(", ");
|
|
449
|
-
}, Ze = ({ selectedValues: t, items: e, placeholder: n }) => {
|
|
450
|
-
var l;
|
|
451
|
-
return !t.value || !((l = t.value) != null && l.length) ? n.value || null : e.value.reduce((a, o) => {
|
|
452
|
-
if (o.items) {
|
|
453
|
-
const d = o.items.filter(
|
|
454
|
-
(s) => t.value.includes(s.value)
|
|
455
|
-
);
|
|
456
|
-
d.length === o.items.length ? a.push(o.label) : d.forEach(({ label: s }) => a.push(s));
|
|
457
|
-
}
|
|
458
|
-
return t.value.includes(o.value) && a.push(o.label), a;
|
|
459
|
-
}, []).join(", ");
|
|
460
|
-
}, Ye = ({ items: t, placeholder: e, value: n, multiple: l, staticCategories: a }) => {
|
|
461
|
-
const o = f(() => t.value.find((u) => {
|
|
462
|
-
var s;
|
|
463
|
-
return (s = u.items) == null ? void 0 : s.length;
|
|
464
|
-
}));
|
|
465
|
-
return f(() => l.value ? o.value ? Ze({ selectedValues: n, placeholder: e, items: t }) : Ve({ selectedValues: n, items: t, placeholder: e }) : Je({
|
|
466
|
-
items: t,
|
|
467
|
-
placeholder: e,
|
|
468
|
-
selectedValue: n,
|
|
469
|
-
staticCategories: a.value
|
|
470
|
-
}));
|
|
471
|
-
}, Q = (t) => {
|
|
472
|
-
var e;
|
|
473
|
-
(e = t.value.$children) == null || e[0].$refs.textbox.focus();
|
|
474
|
-
}, Ge = ({
|
|
475
|
-
inputContainerRef: t,
|
|
476
|
-
optionsContainerRef: e,
|
|
477
|
-
selectedValueIndex: n,
|
|
478
|
-
isDropdownOpen: l,
|
|
479
|
-
isDynamicFltering: a,
|
|
480
|
-
items: o,
|
|
481
|
-
isMultiple: d
|
|
482
|
-
}, u, s, p) => {
|
|
483
|
-
const x = ({ detail: r }) => {
|
|
484
|
-
r.preventDefault(), l.value || (s(), C(() => {
|
|
485
|
-
var c, b;
|
|
486
|
-
d ? (c = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || c[0].$el.focus() : (b = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || b[n.value].$el.focus();
|
|
487
|
-
}));
|
|
488
|
-
}, m = ({ detail: r }) => {
|
|
489
|
-
r.preventDefault(), l.value || (s(), C(() => {
|
|
490
|
-
var c;
|
|
491
|
-
(c = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || c[0].$el.focus();
|
|
492
|
-
}));
|
|
493
|
-
}, g = () => {
|
|
494
|
-
l.value || (s(), C(() => {
|
|
495
|
-
var r, c;
|
|
496
|
-
if (d) {
|
|
497
|
-
const b = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children;
|
|
498
|
-
(r = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || r[b.length - 1].$children[o.length - 1].$el.focus();
|
|
499
|
-
} else
|
|
500
|
-
(c = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || c[o.length - 1].$el.focus();
|
|
501
|
-
}));
|
|
502
|
-
}, _ = () => {
|
|
503
|
-
l.value && (p(), Q(t));
|
|
504
|
-
}, w = () => {
|
|
505
|
-
l.value || s(), C(() => {
|
|
506
|
-
var r;
|
|
507
|
-
(r = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || r[0].$el.focus();
|
|
508
|
-
});
|
|
509
|
-
}, h = ({ detail: r }) => {
|
|
510
|
-
r.preventDefault(), u(), l.value && C(() => {
|
|
511
|
-
var c, b;
|
|
512
|
-
d ? (c = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || c[0].$el.focus() : (b = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || b[n.value].$el.focus();
|
|
513
|
-
});
|
|
514
|
-
}, S = () => {
|
|
515
|
-
u(), l.value && C(() => {
|
|
516
|
-
var r, c;
|
|
517
|
-
d ? (r = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || r[0].$el.focus() : (c = e.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || c[n.value].$el.focus();
|
|
518
|
-
});
|
|
519
|
-
};
|
|
520
|
-
return f(() => ({
|
|
521
|
-
...a.value ? {} : { [L.SPACE]: h },
|
|
522
|
-
[L.ENTER]: S,
|
|
523
|
-
[L.ARROW_DOWN]: x,
|
|
524
|
-
[L.ARROW_UP]: m,
|
|
525
|
-
[L.END]: g,
|
|
526
|
-
[L.ESCAPE]: _,
|
|
527
|
-
[L.HOME]: w
|
|
528
|
-
}));
|
|
529
|
-
}, Qe = ({ inputContainerRef: t, isDropdownOpen: e }, n) => {
|
|
530
|
-
const l = () => {
|
|
531
|
-
e.value && n(), C(() => {
|
|
532
|
-
Q(t);
|
|
533
|
-
});
|
|
534
|
-
};
|
|
535
|
-
return {
|
|
536
|
-
[i.ENTER]: l,
|
|
537
|
-
[i.ESCAPE]: l,
|
|
538
|
-
[i.TAB]: l,
|
|
539
|
-
[i.SPACE]: l
|
|
540
|
-
};
|
|
541
|
-
};
|
|
542
|
-
function Xe(t, e, n) {
|
|
543
|
-
const l = y(t), a = y(e), o = (u, s = []) => s.flatMap((p) => p.label.toLocaleLowerCase().includes(u) ? [p, ...o(u, p.items)] : p.items ? [...o(u, p.items)] : []);
|
|
544
|
-
return Z(l, () => {
|
|
545
|
-
n !== void 0 && n(l.value);
|
|
546
|
-
}), f(() => {
|
|
547
|
-
if (!l.value || n !== void 0)
|
|
548
|
-
return a.value;
|
|
549
|
-
const u = l.value.toLocaleLowerCase();
|
|
550
|
-
return o(u, a.value);
|
|
551
|
-
});
|
|
552
|
-
}
|
|
553
|
-
const et = {
|
|
554
|
-
"en-US": {
|
|
555
|
-
all: "All",
|
|
556
|
-
clearSearch: "Clear filter",
|
|
557
|
-
ariaLabelFallback: "Dropdown"
|
|
558
|
-
}
|
|
559
|
-
}, tt = K({
|
|
560
|
-
i18n: { messages: et },
|
|
561
|
-
name: "b-dropdown",
|
|
562
|
-
components: {
|
|
563
|
-
BentoDropdownOptionsContainer: Be,
|
|
564
|
-
BentoTypography: pe,
|
|
565
|
-
DropdownInputDefault: ye,
|
|
566
|
-
DropdownInputSmall: qe,
|
|
567
|
-
ErrorMessage: Se,
|
|
568
|
-
FieldLabel: Oe
|
|
569
|
-
},
|
|
570
|
-
directives: { BentoClickOutsideDirective: G, BentoKeyboardNavigationDirective: we },
|
|
571
|
-
props: {
|
|
572
|
-
/**
|
|
573
|
-
* @deprecated from version 2.0.0. Use the aria-label attribute instead.
|
|
574
|
-
*/
|
|
575
|
-
/**
|
|
576
|
-
* Defines a string value that labels an interactive element.
|
|
577
|
-
*/
|
|
578
|
-
ariaLabel: { type: String, default: null },
|
|
579
|
-
/**
|
|
580
|
-
* Renders the dropdown with a condensed style.
|
|
581
|
-
*/
|
|
582
|
-
condensed: { type: Boolean, default: !1 },
|
|
583
|
-
/**
|
|
584
|
-
* Empty state props used with the inner empty state component which is displayed when no search results are found.
|
|
585
|
-
*/
|
|
586
|
-
emptyState: {
|
|
587
|
-
type: Object,
|
|
588
|
-
default: void 0
|
|
589
|
-
},
|
|
590
|
-
/**
|
|
591
|
-
* Disables dropdown functionality.
|
|
592
|
-
*/
|
|
593
|
-
disabled: { type: Boolean, default: !1 },
|
|
594
|
-
/**
|
|
595
|
-
* Text that appears in the form control when it has no value set
|
|
596
|
-
*/
|
|
597
|
-
placeholder: {
|
|
598
|
-
type: String,
|
|
599
|
-
default: null
|
|
600
|
-
},
|
|
601
|
-
/**
|
|
602
|
-
* Sets the possibility to type into the textbox.
|
|
603
|
-
*/
|
|
604
|
-
dynamicFiltering: {
|
|
605
|
-
type: Boolean,
|
|
606
|
-
default: !1
|
|
607
|
-
},
|
|
608
|
-
/**
|
|
609
|
-
* Highlights the dropdown in an erroneous state.
|
|
610
|
-
*
|
|
611
|
-
* @deprecated Use "errorMessage" prop instead
|
|
612
|
-
*/
|
|
613
|
-
error: { type: Boolean, default: !1 },
|
|
614
|
-
/**
|
|
615
|
-
* Highlights the dropdown in an erroneous state with an error message.
|
|
616
|
-
*/
|
|
617
|
-
errorMessage: { type: String, default: null },
|
|
618
|
-
/**
|
|
619
|
-
* Text that is displayed as a label above the element.
|
|
620
|
-
*/
|
|
621
|
-
label: { type: String, default: null },
|
|
622
|
-
/**
|
|
623
|
-
* Descriptive supporting text visbile underneath the dropdown.
|
|
624
|
-
*/
|
|
625
|
-
description: { type: String, default: null },
|
|
626
|
-
/**
|
|
627
|
-
* Indicates whether there are more items to load
|
|
628
|
-
*/
|
|
629
|
-
hasMoreItems: { type: Boolean, default: !1 },
|
|
630
|
-
/**
|
|
631
|
-
* Function that dertermines which options are disabled from interaction.
|
|
632
|
-
*
|
|
633
|
-
* @type {BentoListboxIsOptionDisabled}
|
|
634
|
-
* @param {BentoListboxOptionItem} option - Dropdown option object
|
|
635
|
-
* @param {string} option.label - Option's label text
|
|
636
|
-
* @param {string|number} option.value - Option's value
|
|
637
|
-
* @param {unknown} option.data - Option's extra data to be passed to the default slot
|
|
638
|
-
*/
|
|
639
|
-
isOptionDisabled: {
|
|
640
|
-
type: Function,
|
|
641
|
-
default: void 0
|
|
642
|
-
},
|
|
643
|
-
/**
|
|
644
|
-
* The option elements to populate the dropdown with.
|
|
645
|
-
* It must be an array of {@see BentoListboxOptionItem }
|
|
646
|
-
* * @property {string} value.label - Text to be displayed in the option
|
|
647
|
-
* * @property {string,number} value.value - Value of the option
|
|
648
|
-
*/
|
|
649
|
-
items: {
|
|
650
|
-
type: Array,
|
|
651
|
-
default: () => []
|
|
652
|
-
},
|
|
653
|
-
/**
|
|
654
|
-
* Indicates if new options are loading.
|
|
655
|
-
*/
|
|
656
|
-
loading: { type: Boolean, default: !1 },
|
|
657
|
-
/**
|
|
658
|
-
* The type of `Lazy Load`.
|
|
659
|
-
* Type "automatic" will enable infinite scrolling
|
|
660
|
-
* Type "button" will enable lazy loading with "Show more" button
|
|
661
|
-
*/
|
|
662
|
-
lazyLoadType: {
|
|
663
|
-
type: String,
|
|
664
|
-
default: k.props.lazyLoadType.default,
|
|
665
|
-
validator: (t) => Object.values(F).includes(t)
|
|
666
|
-
},
|
|
667
|
-
/*
|
|
668
|
-
* If enabled, the user will be able to select multiple items.
|
|
669
|
-
*/
|
|
670
|
-
multiple: { type: Boolean, default: !1 },
|
|
671
|
-
/**
|
|
672
|
-
* Highlights the dropdown is optional.
|
|
673
|
-
*/
|
|
674
|
-
optional: { type: Boolean, default: !1 },
|
|
675
|
-
/**
|
|
676
|
-
* Sets the dropdown to readonly state
|
|
677
|
-
*/
|
|
678
|
-
readonly: { type: Boolean, default: !1 },
|
|
679
|
-
/**
|
|
680
|
-
* Highlights the dropdown is required.
|
|
681
|
-
*/
|
|
682
|
-
required: { type: Boolean, default: !1 },
|
|
683
|
-
/**
|
|
684
|
-
* Toggles whether to use the slot content select items shown in the textbox in multiple mode.
|
|
685
|
-
*/
|
|
686
|
-
showSlotContentInMultiple: { type: Boolean, default: !1 },
|
|
687
|
-
/**
|
|
688
|
-
* Dropdown input size
|
|
689
|
-
* * @see BentoDropdownSize
|
|
690
|
-
*/
|
|
691
|
-
size: {
|
|
692
|
-
type: String,
|
|
693
|
-
default: E.DEFAULT,
|
|
694
|
-
validator: (t) => Object.values(E).includes(t)
|
|
695
|
-
},
|
|
696
|
-
/**
|
|
697
|
-
* Adds a info icon next to the label to display the passed tooltip message.
|
|
698
|
-
*/
|
|
699
|
-
tooltipText: { type: String, default: null },
|
|
700
|
-
/**
|
|
701
|
-
* If enabled, dropdown will display non-selectable, static categories
|
|
702
|
-
*/
|
|
703
|
-
staticCategories: { type: Boolean, default: !1 },
|
|
704
|
-
/**
|
|
705
|
-
* The `input` value.
|
|
706
|
-
* Providing an empty string will select no options.
|
|
707
|
-
* Set to an empty string `''` if you don't want any of the available options to be selected.
|
|
708
|
-
*/
|
|
709
|
-
value: {
|
|
710
|
-
type: [String, Number, Array],
|
|
711
|
-
default: null
|
|
712
|
-
},
|
|
713
|
-
/**
|
|
714
|
-
* Enables virtual scrolling if set to true or by providing an object with itemHeight function.
|
|
715
|
-
* The itemHeight function is used to calculate the height of rendered item given it's index.
|
|
716
|
-
*/
|
|
717
|
-
virtualScroll: {
|
|
718
|
-
type: [Boolean, Object],
|
|
719
|
-
default: !1
|
|
720
|
-
},
|
|
721
|
-
/**
|
|
722
|
-
* Dropdown search options and events.
|
|
723
|
-
* @see BentoDropdownSearchOptions
|
|
724
|
-
*/
|
|
725
|
-
search: {
|
|
726
|
-
type: Object,
|
|
727
|
-
default: void 0
|
|
728
|
-
}
|
|
729
|
-
},
|
|
730
|
-
emits: ["input", i.SHOW_MORE],
|
|
731
|
-
setup(t, { attrs: e, emit: n, slots: l }) {
|
|
732
|
-
var H;
|
|
733
|
-
const { t: a } = W(), o = y(null), d = y(null), u = y(null), s = y(!1), p = B("bento-dropdown-options-container"), x = B("dropdown-label"), m = B("dropdown-description"), g = B("dropdown-error"), { isReadOnly: _ } = ge(O(t, "readonly")), w = y(e["aria-label"]), { ariaLabel: h } = Y(t), S = _e({
|
|
734
|
-
ariaLabel: w.value,
|
|
735
|
-
// TODO: take this line away when the aria-label props is removed
|
|
736
|
-
label: h,
|
|
737
|
-
defaultFallback: a("ariaLabelFallback")
|
|
738
|
-
}), $ = f(() => ({
|
|
739
|
-
"b-dropdown--condensed": t.condensed
|
|
740
|
-
})), r = f(() => ({
|
|
741
|
-
"b-dropdown__description--error": !!t.errorMessage
|
|
742
|
-
})), c = y(""), b = O(t, "items"), X = Xe(c, b, (H = t == null ? void 0 : t.search) == null ? void 0 : H.searchEvent), A = f(() => t.dynamicFiltering && !!c.value), ee = Ye({
|
|
743
|
-
items: b,
|
|
744
|
-
staticCategories: O(t, "staticCategories"),
|
|
745
|
-
multiple: O(t, "multiple"),
|
|
746
|
-
placeholder: O(t, "placeholder"),
|
|
747
|
-
value: O(t, "value")
|
|
748
|
-
}), te = f(() => t.size === E.DEFAULT), ne = f(() => {
|
|
749
|
-
if (t != null && t.multiple)
|
|
750
|
-
return t.items.filter(
|
|
751
|
-
({ value: v }) => (t == null ? void 0 : t.value) && (t == null ? void 0 : t.value).includes(v)
|
|
752
|
-
);
|
|
753
|
-
if (!t.multiple && t.staticCategories) {
|
|
754
|
-
const v = t.items.find(
|
|
755
|
-
(T) => T.items.some((ve) => ve.value === t.value)
|
|
756
|
-
);
|
|
757
|
-
return v ? v.items.find((T) => T.value === t.value) : null;
|
|
758
|
-
}
|
|
759
|
-
return t.items.find(({ value: v }) => v === (t == null ? void 0 : t.value));
|
|
760
|
-
}), le = f(() => {
|
|
761
|
-
const v = t.items.findIndex(({ value: R }) => t.value === R);
|
|
762
|
-
return v > 0 ? v : 0;
|
|
763
|
-
}), { isMultiLevelSelect: ae, flattenedItemsList: oe } = xe(b), se = f(() => {
|
|
764
|
-
var v;
|
|
765
|
-
if (t.multiple) {
|
|
766
|
-
const R = (v = t == null ? void 0 : t.value) == null ? void 0 : v.length;
|
|
767
|
-
return (ae.value ? oe.value.length : b.value.length) === R ? a("all") : R;
|
|
768
|
-
}
|
|
769
|
-
return null;
|
|
770
|
-
}), ie = f(
|
|
771
|
-
() => `${t.description ? m : ""} ${t.errorMessage ? g : ""}`.trim() || null
|
|
772
|
-
), re = () => {
|
|
773
|
-
_.value || (s.value = !0);
|
|
774
|
-
}, M = () => {
|
|
775
|
-
s.value = !1;
|
|
776
|
-
}, z = () => {
|
|
777
|
-
_.value || (s.value = !s.value, A.value && (c.value = ""));
|
|
778
|
-
}, de = () => {
|
|
779
|
-
A.value && (c.value = ""), s.value && (s.value = !1, u.value.onOutsideDropdownClick());
|
|
780
|
-
}, U = (v) => {
|
|
781
|
-
t.multiple || (c.value = "", s.value = !1), n("input", v);
|
|
782
|
-
}, j = () => {
|
|
783
|
-
n(i.SHOW_MORE);
|
|
784
|
-
}, ue = Ge(
|
|
785
|
-
{
|
|
786
|
-
inputContainerRef: o,
|
|
787
|
-
optionsContainerRef: u,
|
|
788
|
-
selectedValueIndex: le,
|
|
789
|
-
isDropdownOpen: s,
|
|
790
|
-
isDynamicFltering: O(t, "dynamicFiltering"),
|
|
791
|
-
items: t.items,
|
|
792
|
-
isMultiple: t.multiple
|
|
793
|
-
},
|
|
794
|
-
z,
|
|
795
|
-
re,
|
|
796
|
-
M
|
|
797
|
-
), ce = Qe(
|
|
798
|
-
{
|
|
799
|
-
inputContainerRef: o,
|
|
800
|
-
isDropdownOpen: s
|
|
801
|
-
},
|
|
802
|
-
M
|
|
803
|
-
), fe = {
|
|
804
|
-
[i.CLOSE_DROPDOWN]: M,
|
|
805
|
-
[i.SELECT]: U,
|
|
806
|
-
[i.SHOW_MORE]: j,
|
|
807
|
-
...ce
|
|
808
|
-
};
|
|
809
|
-
return t.error && me(
|
|
810
|
-
'BentoDropdown "error" property',
|
|
811
|
-
`Use the BentoDropdown "errorMessage" property instead to indicate that there is a modifier error.
|
|
812
|
-
Having the field as "undefined" will hide/remove the error.
|
|
813
|
-
<bento-dropdown errorMessage="Error message text" />`,
|
|
814
|
-
"2.0.0"
|
|
815
|
-
), {
|
|
816
|
-
// Values
|
|
817
|
-
conditionalClasses: $,
|
|
818
|
-
computedAriaLabel: S,
|
|
819
|
-
additionalItemsSelected: se,
|
|
820
|
-
idDefaultSize: te,
|
|
821
|
-
isDropdownOpen: s,
|
|
822
|
-
displayValue: ee,
|
|
823
|
-
dropdownOptionsContainerId: p,
|
|
824
|
-
filteredItems: X,
|
|
825
|
-
isSearching: A,
|
|
826
|
-
isReadOnly: _,
|
|
827
|
-
searchTerm: c,
|
|
828
|
-
labelId: x,
|
|
829
|
-
descriptionId: m,
|
|
830
|
-
errorId: g,
|
|
831
|
-
ariaDescribedBy: ie,
|
|
832
|
-
selectedValueItem: ne,
|
|
833
|
-
// Conciliation of Vue2 $scopedSlots and Vue3 $scopes.
|
|
834
|
-
// The setup method and the "useSlots" composible define
|
|
835
|
-
// { slots } as a proxy of $scopedSlots and $scopes in their
|
|
836
|
-
// respective Vue version. Source: https://github.com/vuejs/composition-api/issues/84#issuecomment-524885445
|
|
837
|
-
slots: l,
|
|
838
|
-
descriptionConditionalClasses: r,
|
|
839
|
-
// Methods
|
|
840
|
-
hasSlot: he(l),
|
|
841
|
-
// Refs
|
|
842
|
-
inputContainerRef: o,
|
|
843
|
-
inputContainerRefWrapper: d,
|
|
844
|
-
optionsContainerRef: u,
|
|
845
|
-
// Events
|
|
846
|
-
clickOutsideDropdown: de,
|
|
847
|
-
toggleDropdown: z,
|
|
848
|
-
onOptionSelected: U,
|
|
849
|
-
emitShowMoreEvent: j,
|
|
850
|
-
textboxKeyboardNavigationListeners: ue,
|
|
851
|
-
listboxListeners: fe
|
|
852
|
-
};
|
|
853
|
-
}
|
|
854
|
-
});
|
|
855
|
-
var nt = function() {
|
|
856
|
-
var l;
|
|
857
|
-
var e = this, n = e._self._c;
|
|
858
|
-
return e._self._setupProxy, n("div", { directives: [{ name: "bento-click-outside-directive", rawName: "v-bento-click-outside-directive", value: e.clickOutsideDropdown, expression: "clickOutsideDropdown" }], staticClass: "b-dropdown", class: e.conditionalClasses }, [e.label ? n("field-label", { attrs: { id: e.labelId, condensed: e.condensed, label: e.label, "tooltip-text": e.tooltipText, optional: e.optional, required: e.required } }) : e._e(), n("div", e._g({ directives: [{ name: "bento-keyboard-navigation-directive", rawName: "v-bento-keyboard-navigation-directive" }], ref: "inputContainerRefWrapper" }, e.textboxKeyboardNavigationListeners), [n(e.size, { ref: "inputContainerRef", tag: "component", attrs: { condensed: e.condensed, value: e.searchTerm, "additional-items-selected": e.additionalItemsSelected, ariaControls: e.dropdownOptionsContainerId, ariaExpanded: e.isDropdownOpen, "aria-labelledby": e.label ? e.labelId : null, "aria-describedby": e.ariaDescribedBy, "aria-label": e.computedAriaLabel, "aria-readonly": e.isReadOnly, readonly: e.isReadOnly, disabled: e.disabled, "display-value": e.displayValue, "dynamic-filtering": e.dynamicFiltering, "is-invalid": !!e.errorMessage || e.error, multiple: e.multiple, open: e.isDropdownOpen, "selected-value-item": e.idDefaultSize ? e.selectedValueItem : void 0, "show-slot-content-in-multiple": e.showSlotContentInMultiple }, on: { input: function(a) {
|
|
859
|
-
e.searchTerm = a;
|
|
860
|
-
}, open: e.toggleDropdown, close: e.toggleDropdown }, scopedSlots: e._u([e._l(e.slots, function(a, o) {
|
|
861
|
-
return { key: o, fn: function(d) {
|
|
862
|
-
return [e._t(o, null, null, d)];
|
|
863
|
-
} };
|
|
864
|
-
})], null, !0) })], 1), e.inputContainerRef ? n("bento-dropdown-options-container", e._g({ ref: "optionsContainerRef", attrs: { id: e.dropdownOptionsContainerId, "aria-label": e.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: e.filteredItems, multiple: e.multiple, "static-categories": e.staticCategories, open: e.isDropdownOpen, "selected-value": e.value, searching: e.isSearching, "target-element": e.inputContainerRefWrapper, loading: e.loading, "has-more-items": e.hasMoreItems, "lazy-load-type": e.lazyLoadType, "virtual-scroll": e.virtualScroll }, scopedSlots: e._u([e._l(e.slots, function(a, o) {
|
|
865
|
-
return { key: o, fn: function(d) {
|
|
866
|
-
return [e._t(o, null, null, d)];
|
|
867
|
-
} };
|
|
868
|
-
})], null, !0) }, e.listboxListeners)) : e._e(), e.errorMessage ? n("error-message", { staticClass: "b-dropdown__error-message", attrs: { id: e.errorId, "error-message": e.errorMessage } }) : e._e(), e.description || e.hasSlot("description") ? n("bento-typography", { staticClass: "b-dropdown__description", class: e.descriptionConditionalClasses, attrs: { id: e.descriptionId, el: "span" } }, [e._t("description", function() {
|
|
869
|
-
return [e._v(" " + e._s(e.description) + " ")];
|
|
870
|
-
})], 2) : e._e()], 1);
|
|
871
|
-
}, lt = [], at = /* @__PURE__ */ I(
|
|
872
|
-
tt,
|
|
873
|
-
nt,
|
|
874
|
-
lt,
|
|
875
|
-
!1,
|
|
876
|
-
null,
|
|
877
|
-
"df383e41",
|
|
878
|
-
null,
|
|
879
|
-
null
|
|
880
|
-
);
|
|
881
|
-
const xt = at.exports;
|
|
882
|
-
export {
|
|
883
|
-
xt as B,
|
|
884
|
-
E as a,
|
|
885
|
-
Xe as u
|
|
886
|
-
};
|
|
887
|
-
//# sourceMappingURL=dropdown.4152cc00.js.map
|