@adyen/bento-vue2 0.10.0 → 0.10.1-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/components/currency/currency.vue.d.ts +9 -0
- package/dist/@types/components/data-grid/data-grid.vue.d.ts +3 -3
- package/dist/@types/components/date/date.vue.d.ts +9 -0
- package/dist/@types/components/modal/components/base-modal/base-modal.vue.d.ts +10 -0
- package/dist/@types/components/modal/components/modal-default/modal-default.vue.d.ts +9 -0
- package/dist/@types/components/modal/components/modal-dialog/modal-dialog.vue.d.ts +9 -0
- package/dist/@types/components/modal/modal.vue.d.ts +11 -0
- package/dist/@types/components/segmented-control/components/segmented-control-button/segmented-control-button.vue.d.ts +1 -1
- package/dist/@types/components/segmented-control/index.d.ts +2 -0
- package/dist/@types/components/segmented-control/segmented-control.types.d.ts +8 -0
- package/dist/@types/components/segmented-control/segmented-control.vue.d.ts +53 -0
- package/dist/@types/components.d.ts +2 -4
- package/dist/@types/index.d.ts +1 -0
- package/dist/accordion.js +206 -0
- package/dist/accordion.js.map +1 -0
- package/dist/alert.js +103 -0
- package/dist/alert.js.map +1 -0
- package/dist/assets/base-button.css +1 -0
- package/dist/assets/button-actions.css +1 -0
- package/dist/assets/button.css +1 -0
- package/dist/assets/checkbox.css +1 -0
- package/dist/assets/checkmark-circle-fill.css +1 -0
- package/dist/assets/checkmark-small.css +1 -0
- package/dist/assets/chevron-left.css +1 -0
- package/dist/assets/chevron-up.css +1 -0
- package/dist/assets/copy.css +1 -0
- package/dist/assets/cross-circle-fill.css +1 -0
- package/dist/assets/cross-small.css +1 -0
- package/dist/assets/cross.css +1 -0
- package/dist/assets/dropdown.css +1 -0
- package/dist/assets/grid-layout.css +1 -0
- package/dist/assets/index.css +1 -0
- package/dist/assets/index10.css +1 -0
- package/dist/assets/index11.css +1 -0
- package/dist/assets/index12.css +1 -0
- package/dist/assets/index13.css +1 -0
- package/dist/assets/index14.css +1 -0
- package/dist/assets/index15.css +1 -0
- package/dist/assets/index16.css +1 -0
- package/dist/assets/index17.css +1 -0
- package/dist/assets/index18.css +1 -0
- package/dist/assets/index19.css +1 -0
- package/dist/assets/index2.css +1 -0
- package/dist/assets/index20.css +1 -0
- package/dist/assets/index21.css +1 -0
- package/dist/assets/index22.css +1 -0
- package/dist/assets/index23.css +1 -0
- package/dist/assets/index24.css +1 -0
- package/dist/assets/index25.css +1 -0
- package/dist/assets/index26.css +1 -0
- package/dist/assets/index27.css +1 -0
- package/dist/assets/index28.css +1 -0
- package/dist/assets/index29.css +1 -0
- package/dist/assets/index3.css +1 -0
- package/dist/assets/index30.css +1 -0
- package/dist/assets/index31.css +1 -0
- package/dist/assets/index32.css +1 -0
- package/dist/assets/index33.css +1 -0
- package/dist/assets/index34.css +1 -0
- package/dist/assets/index35.css +1 -0
- package/dist/assets/index36.css +1 -0
- package/dist/assets/index37.css +1 -0
- package/dist/assets/index38.css +1 -0
- package/dist/assets/index4.css +1 -0
- package/dist/assets/index5.css +1 -0
- package/dist/assets/index6.css +1 -0
- package/dist/assets/index7.css +1 -0
- package/dist/assets/index8.css +1 -0
- package/dist/assets/index9.css +1 -0
- package/dist/assets/info-filled.css +1 -0
- package/dist/assets/listbox-option-tag.css +1 -0
- package/dist/assets/listbox.css +1 -0
- package/dist/assets/search.css +1 -0
- package/dist/assets/tooltip.css +1 -0
- package/dist/avatar-image.js +7 -0
- package/dist/avatar-image.js.map +1 -0
- package/dist/badge.js +57 -0
- package/dist/badge.js.map +1 -0
- package/dist/button.js +110 -0
- package/dist/button.js.map +1 -0
- package/dist/card.js +178 -0
- package/dist/card.js.map +1 -0
- package/dist/checkbox.js +94 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/chunks/_plugin-vue2_normalizer.71e2aa87.js +33 -0
- package/dist/chunks/_plugin-vue2_normalizer.71e2aa87.js.map +1 -0
- package/dist/chunks/aria-label.ac9651a5.js +13 -0
- package/dist/chunks/aria-label.ac9651a5.js.map +1 -0
- package/dist/chunks/base-button.38651156.js +83 -0
- package/dist/chunks/base-button.38651156.js.map +1 -0
- package/dist/chunks/button-actions.59406268.js +105 -0
- package/dist/chunks/button-actions.59406268.js.map +1 -0
- package/dist/chunks/button.31b757d1.js +102 -0
- package/dist/chunks/button.31b757d1.js.map +1 -0
- package/dist/chunks/checkbox.fab16cce.js +138 -0
- package/dist/chunks/checkbox.fab16cce.js.map +1 -0
- package/dist/chunks/checkmark-circle-fill.d1aa324d.js +26 -0
- package/dist/chunks/checkmark-circle-fill.d1aa324d.js.map +1 -0
- package/dist/chunks/checkmark-small.1371dd20.js +26 -0
- package/dist/chunks/checkmark-small.1371dd20.js.map +1 -0
- package/dist/chunks/chevron-left.e3a49e62.js +47 -0
- package/dist/chunks/chevron-left.e3a49e62.js.map +1 -0
- package/dist/chunks/chevron-up.416431cd.js +47 -0
- package/dist/chunks/chevron-up.416431cd.js.map +1 -0
- package/dist/chunks/copy.fa9aa27e.js +105 -0
- package/dist/chunks/copy.fa9aa27e.js.map +1 -0
- package/dist/chunks/cross-circle-fill.0a1d738c.js +26 -0
- package/dist/chunks/cross-circle-fill.0a1d738c.js.map +1 -0
- package/dist/chunks/cross-small.7ecb1b97.js +26 -0
- package/dist/chunks/cross-small.7ecb1b97.js.map +1 -0
- package/dist/chunks/cross.db1f9177.js +26 -0
- package/dist/chunks/cross.db1f9177.js.map +1 -0
- package/dist/chunks/directive.23e35ab0.js +21 -0
- package/dist/chunks/directive.23e35ab0.js.map +1 -0
- package/dist/chunks/dropdown.0d394d2f.js +771 -0
- package/dist/chunks/dropdown.0d394d2f.js.map +1 -0
- package/dist/chunks/grid-layout.14423a2e.js +69 -0
- package/dist/chunks/grid-layout.14423a2e.js.map +1 -0
- package/dist/chunks/hasSlot.dceac207.js +5 -0
- package/dist/chunks/hasSlot.dceac207.js.map +1 -0
- package/dist/chunks/i18n.8934ef6c.js +1695 -0
- package/dist/chunks/i18n.8934ef6c.js.map +1 -0
- package/dist/chunks/index.2e54c294.js +801 -0
- package/dist/chunks/index.2e54c294.js.map +1 -0
- package/dist/chunks/index.34eba2c4.js +107 -0
- package/dist/chunks/index.34eba2c4.js.map +1 -0
- package/dist/chunks/index.59dc2e3f.js +801 -0
- package/dist/chunks/index.59dc2e3f.js.map +1 -0
- package/dist/chunks/index.73d7902e.js +29 -0
- package/dist/chunks/index.73d7902e.js.map +1 -0
- package/dist/chunks/index.8c38e06b.js +441 -0
- package/dist/chunks/index.8c38e06b.js.map +1 -0
- package/dist/chunks/index.8e9cdc73.js +441 -0
- package/dist/chunks/index.8e9cdc73.js.map +1 -0
- package/dist/chunks/index.a7a22907.js +929 -0
- package/dist/chunks/index.a7a22907.js.map +1 -0
- package/dist/chunks/index.ad5e1dbd.js +107 -0
- package/dist/chunks/index.ad5e1dbd.js.map +1 -0
- package/dist/chunks/index.e2141d95.js +86 -0
- package/dist/chunks/index.e2141d95.js.map +1 -0
- package/dist/chunks/index.f4582460.js +86 -0
- package/dist/chunks/index.f4582460.js.map +1 -0
- package/dist/chunks/index.f55fdc32.js +1118 -0
- package/dist/chunks/index.f55fdc32.js.map +1 -0
- package/dist/chunks/info-filled.9748686e.js +26 -0
- package/dist/chunks/info-filled.9748686e.js.map +1 -0
- package/dist/chunks/listbox-option-tag.2e5c4012.js +111 -0
- package/dist/chunks/listbox-option-tag.2e5c4012.js.map +1 -0
- package/dist/chunks/listbox-option-tag.f44b4ee0.js +111 -0
- package/dist/chunks/listbox-option-tag.f44b4ee0.js.map +1 -0
- package/dist/chunks/listbox.152dab0a.js +485 -0
- package/dist/chunks/listbox.152dab0a.js.map +1 -0
- package/dist/chunks/on-click-outside.3e0c3e2a.js +91 -0
- package/dist/chunks/on-click-outside.3e0c3e2a.js.map +1 -0
- package/dist/chunks/search.6be3396b.js +26 -0
- package/dist/chunks/search.6be3396b.js.map +1 -0
- package/dist/chunks/toastController.b1b08299.js +15 -0
- package/dist/chunks/toastController.b1b08299.js.map +1 -0
- package/dist/chunks/tooltip.a4625a7b.js +220 -0
- package/dist/chunks/tooltip.a4625a7b.js.map +1 -0
- package/dist/chunks/unique-id.a2a2b458.js +34 -0
- package/dist/chunks/unique-id.a2a2b458.js.map +1 -0
- package/dist/chunks/use-default-slot-validator.83d977a1.js +11 -0
- package/dist/chunks/use-default-slot-validator.83d977a1.js.map +1 -0
- package/dist/chunks/useCountryItems.cbe60557.js +29 -0
- package/dist/chunks/useCountryItems.cbe60557.js.map +1 -0
- package/dist/click-outside.js +23 -0
- package/dist/click-outside.js.map +1 -0
- package/dist/controls-group.js +59 -0
- package/dist/controls-group.js.map +1 -0
- package/dist/country.js +5979 -0
- package/dist/country.js.map +1 -0
- package/dist/currency.js +119 -0
- package/dist/currency.js.map +1 -0
- package/dist/data-grid.js +1169 -0
- package/dist/data-grid.js.map +1 -0
- package/dist/date-picker.js +8 -0
- package/dist/date-picker.js.map +1 -0
- package/dist/date.js +6 -0
- package/dist/date.js.map +1 -0
- package/dist/divider.js +35 -0
- package/dist/divider.js.map +1 -0
- package/dist/dropdown.js +262 -0
- package/dist/dropdown.js.map +1 -0
- package/dist/filter-bar.js +1735 -0
- package/dist/filter-bar.js.map +1 -0
- package/dist/focus-trap.js +5 -0
- package/dist/focus-trap.js.map +1 -0
- package/dist/header.js +205 -0
- package/dist/header.js.map +1 -0
- package/dist/index.js +335 -21278
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +61 -0
- package/dist/info-icon.js.map +1 -0
- package/dist/input-field.js +168 -0
- package/dist/input-field.js.map +1 -0
- package/dist/internal.js +13 -0
- package/dist/internal.js.map +1 -0
- package/dist/link.js +46 -0
- package/dist/link.js.map +1 -0
- package/dist/loading-indicator.js +51 -0
- package/dist/loading-indicator.js.map +1 -0
- package/dist/menu.js +474 -0
- package/dist/menu.js.map +1 -0
- package/dist/modal.js +709 -0
- package/dist/modal.js.map +1 -0
- package/dist/pagination.js +487 -0
- package/dist/pagination.js.map +1 -0
- package/dist/payment-method.js +84 -0
- package/dist/payment-method.js.map +1 -0
- package/dist/popover.js +284 -0
- package/dist/popover.js.map +1 -0
- package/dist/popper-container.js +225 -0
- package/dist/popper-container.js.map +1 -0
- package/dist/radio-group.js +192 -0
- package/dist/radio-group.js.map +1 -0
- package/dist/search-bar.js +106 -0
- package/dist/search-bar.js.map +1 -0
- package/dist/status.js +47 -0
- package/dist/status.js.map +1 -0
- package/dist/structured-list.js +98 -0
- package/dist/structured-list.js.map +1 -0
- package/dist/summary-grid.js +526 -0
- package/dist/summary-grid.js.map +1 -0
- package/dist/tabs.js +106 -0
- package/dist/tabs.js.map +1 -0
- package/dist/tag.js +73 -0
- package/dist/tag.js.map +1 -0
- package/dist/textarea.js +64 -0
- package/dist/textarea.js.map +1 -0
- package/dist/toast.js +132 -0
- package/dist/toast.js.map +1 -0
- package/dist/toggle.js +6 -0
- package/dist/toggle.js.map +1 -0
- package/dist/typography.js +111 -0
- package/dist/typography.js.map +1 -0
- package/dist/web-types.json +130 -13
- package/package.json +6 -4
- package/dist/@types/utils/ts/inject-css.d.ts +0 -2
|
@@ -0,0 +1,771 @@
|
|
|
1
|
+
import "../assets/dropdown.css";
|
|
2
|
+
import { defineComponent as b, computed as o, ref as m, toRef as A } from "vue";
|
|
3
|
+
import { g as h } from "./unique-id.a2a2b458.js";
|
|
4
|
+
import { BentoTypography as L, BentoTypographyElement as E, BentoTypographyVariant as N } from "../typography.js";
|
|
5
|
+
import { PopperContainer as D, PopperContainerPosition as R } from "../popper-container.js";
|
|
6
|
+
import { u as V } from "./i18n.8934ef6c.js";
|
|
7
|
+
import { B as I } from "./listbox.152dab0a.js";
|
|
8
|
+
import { n as p } from "./_plugin-vue2_normalizer.71e2aa87.js";
|
|
9
|
+
import { h as P } from "./hasSlot.dceac207.js";
|
|
10
|
+
import { C as q } from "./cross-circle-fill.0a1d738c.js";
|
|
11
|
+
import { C as M, a as U } from "./chevron-up.416431cd.js";
|
|
12
|
+
import { B as z } from "./directive.23e35ab0.js";
|
|
13
|
+
var c = /* @__PURE__ */ ((t) => (t.DEFAULT = "DropdownInputDefault", t.SMALL = "DropdownInputSmall", t))(c || {});
|
|
14
|
+
const O = {
|
|
15
|
+
"en-US": {
|
|
16
|
+
noOptionsMatchThisSearch: "No options match this search"
|
|
17
|
+
}
|
|
18
|
+
}, j = b({
|
|
19
|
+
i18n: { messages: O },
|
|
20
|
+
name: "bento-dropdown-options-container",
|
|
21
|
+
components: {
|
|
22
|
+
BentoListbox: I,
|
|
23
|
+
PopperContainer: D
|
|
24
|
+
},
|
|
25
|
+
inheritAttrs: !1,
|
|
26
|
+
props: {
|
|
27
|
+
/**
|
|
28
|
+
* Defines a string value that labels an interactive element.
|
|
29
|
+
*/
|
|
30
|
+
ariaLabel: { type: String, default: null },
|
|
31
|
+
/**
|
|
32
|
+
* Disables dropdown functionality
|
|
33
|
+
*/
|
|
34
|
+
disabled: { type: Boolean, default: !1 },
|
|
35
|
+
/**
|
|
36
|
+
* Identifies the listbox whose contents are controlled by the the combobox on which the aria-controls attribute is set.
|
|
37
|
+
*/
|
|
38
|
+
id: { type: String, required: !0 },
|
|
39
|
+
/**
|
|
40
|
+
* Function that allows the options to be disabled
|
|
41
|
+
*
|
|
42
|
+
* @type {BentoDropdownIsOptionDisabled}
|
|
43
|
+
* @param {BentoDropdownOptionItem} option - Dropdown option object
|
|
44
|
+
* @param {string} option.label - Option's label text
|
|
45
|
+
* @param {string|number} option.value - Option's value
|
|
46
|
+
* @param {unknown} option.data - Option's extra data to be passed to the default slot
|
|
47
|
+
*/
|
|
48
|
+
isOptionDisabled: {
|
|
49
|
+
type: Function,
|
|
50
|
+
default: void 0
|
|
51
|
+
},
|
|
52
|
+
/**
|
|
53
|
+
* Dropdown input size
|
|
54
|
+
* @see BentoDropdownSize
|
|
55
|
+
*/
|
|
56
|
+
inputSize: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: c.DEFAULT,
|
|
59
|
+
validator: (t) => Object.values(c).includes(t)
|
|
60
|
+
},
|
|
61
|
+
/**
|
|
62
|
+
* The option elements to populate the dropdown with.
|
|
63
|
+
* It must be an array of {@see BentoDropdownOptionItem }
|
|
64
|
+
* * @property {string} value.label - Text to be displayed in the option
|
|
65
|
+
* * @property {string,number} value.value - Value of the option
|
|
66
|
+
*/
|
|
67
|
+
items: {
|
|
68
|
+
type: Array,
|
|
69
|
+
required: !0
|
|
70
|
+
},
|
|
71
|
+
/**
|
|
72
|
+
* If enabled, the user will be able to select multiple items.
|
|
73
|
+
*/
|
|
74
|
+
multiple: { type: Boolean, default: !1 },
|
|
75
|
+
/**
|
|
76
|
+
* Indicates if the dropdown is open so that
|
|
77
|
+
* the container can be displayed.
|
|
78
|
+
*/
|
|
79
|
+
open: { type: Boolean, required: !0 },
|
|
80
|
+
/**
|
|
81
|
+
* The `input` value.
|
|
82
|
+
* Providing an empty string or empty array will select no options.
|
|
83
|
+
* Set to an empty string `''` if you don't want any of the available options to be selected for single select
|
|
84
|
+
*/
|
|
85
|
+
selectedValue: {
|
|
86
|
+
type: [String, Number, Array],
|
|
87
|
+
default: null
|
|
88
|
+
},
|
|
89
|
+
/**
|
|
90
|
+
* Flag that indicates that an external search it's being made
|
|
91
|
+
* to filter out the items inside the the multi-select listbox
|
|
92
|
+
*
|
|
93
|
+
* If enabled, hides the "Select all" checkbox in "multiple" mode.
|
|
94
|
+
*/
|
|
95
|
+
searching: I.props.searching,
|
|
96
|
+
/**
|
|
97
|
+
* Reference to the DOM element or Vue component for positioning
|
|
98
|
+
* the Dropdown container.
|
|
99
|
+
*/
|
|
100
|
+
targetElement: { type: D.props.targetElement.type, required: !0 }
|
|
101
|
+
},
|
|
102
|
+
emits: ["select"],
|
|
103
|
+
setup(t, { emit: e }) {
|
|
104
|
+
const { t: n } = V({ messages: O }), l = o(() => t.open && !t.disabled), a = (r) => {
|
|
105
|
+
e("select", r);
|
|
106
|
+
}, s = o(() => n("noOptionsMatchThisSearch")), u = o(() => ({
|
|
107
|
+
"b-dropdown-options-container--small": t.inputSize === c.SMALL
|
|
108
|
+
}));
|
|
109
|
+
return {
|
|
110
|
+
// Values
|
|
111
|
+
isDropdownOpen: l,
|
|
112
|
+
conditionalListboxClasses: u,
|
|
113
|
+
noResultsMessage: s,
|
|
114
|
+
// Enums
|
|
115
|
+
PopperContainerPosition: R,
|
|
116
|
+
// Events
|
|
117
|
+
onOptionSelected: a
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
var H = function() {
|
|
122
|
+
var e = this, n = e._self._c;
|
|
123
|
+
return e._self._setupProxy, n("popper-container", { directives: [{ name: "show", rawName: "v-show", value: e.isDropdownOpen, expression: "isDropdownOpen" }], attrs: { "target-element": e.targetElement, position: e.PopperContainerPosition.BOTTOM_START, offset: [0, 8], "match-width": "" } }, [n("bento-listbox", { staticClass: "b-dropdown-options-container", class: e.conditionalListboxClasses, attrs: { id: e.id, "aria-label": e.ariaLabel, "is-option-disabled": e.isOptionDisabled, items: e.items, "selected-value": e.selectedValue, multiple: e.multiple, "no-results-message": e.noResultsMessage, searching: e.searching }, on: { select: e.onOptionSelected }, scopedSlots: e._u([e._l(e.$scopedSlots || e.$slots, function(l, a) {
|
|
124
|
+
return { key: a, fn: function(s) {
|
|
125
|
+
return [e._t(a, null, null, s)];
|
|
126
|
+
} };
|
|
127
|
+
})], null, !0) })], 1);
|
|
128
|
+
}, Z = [], G = /* @__PURE__ */ p(
|
|
129
|
+
j,
|
|
130
|
+
H,
|
|
131
|
+
Z,
|
|
132
|
+
!1,
|
|
133
|
+
null,
|
|
134
|
+
"2d7eaf26",
|
|
135
|
+
null,
|
|
136
|
+
null
|
|
137
|
+
);
|
|
138
|
+
const J = G.exports, K = (t, e = 300) => {
|
|
139
|
+
let n;
|
|
140
|
+
return (...a) => {
|
|
141
|
+
n && clearTimeout(n), n = setTimeout(() => t(...a), e);
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
var d = /* @__PURE__ */ ((t) => (t.DISABLED = "disabled", t.HAS_ITEMS = "has-items", t.OPENED = "opened", t.ERROR = "error", t))(d || {});
|
|
145
|
+
const Q = b({
|
|
146
|
+
name: "dropdown-base-textbox",
|
|
147
|
+
components: { BentoTypography: L, CrossCircleFillIcon: q },
|
|
148
|
+
props: {
|
|
149
|
+
/**
|
|
150
|
+
* The number of additional items that have been selected in the dropdown.
|
|
151
|
+
*/
|
|
152
|
+
additionalItemsSelected: { type: Number, default: 0 },
|
|
153
|
+
/**
|
|
154
|
+
* Sets the aria-controls attribute on the textbox. This should correspond to the popover's id that the textbox triggers.
|
|
155
|
+
*/
|
|
156
|
+
ariaControls: {
|
|
157
|
+
type: String,
|
|
158
|
+
required: !0
|
|
159
|
+
},
|
|
160
|
+
/**
|
|
161
|
+
* 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.
|
|
162
|
+
*/
|
|
163
|
+
ariaExpanded: {
|
|
164
|
+
type: [String, Boolean],
|
|
165
|
+
required: !0
|
|
166
|
+
},
|
|
167
|
+
/**
|
|
168
|
+
* If no label element is used then the aria-label is be set should be set.
|
|
169
|
+
*/
|
|
170
|
+
ariaLabel: {
|
|
171
|
+
type: String,
|
|
172
|
+
default: null
|
|
173
|
+
},
|
|
174
|
+
/**
|
|
175
|
+
* Corresponds to the label's id that labels the textbox element.
|
|
176
|
+
*/
|
|
177
|
+
ariaLabelledby: {
|
|
178
|
+
type: String,
|
|
179
|
+
default: null
|
|
180
|
+
},
|
|
181
|
+
/**
|
|
182
|
+
* Custom debounce time for the user type event.
|
|
183
|
+
*/
|
|
184
|
+
debounceTime: { type: Number, default: 300 },
|
|
185
|
+
/**
|
|
186
|
+
* Disables any textbox functionality
|
|
187
|
+
*/
|
|
188
|
+
disabled: { type: Boolean, default: !1 },
|
|
189
|
+
/**
|
|
190
|
+
* Selected option's label
|
|
191
|
+
*/
|
|
192
|
+
displayValue: { type: String, default: null },
|
|
193
|
+
/**
|
|
194
|
+
* Sets the possibility to type into the textbox.
|
|
195
|
+
*/
|
|
196
|
+
dynamicFiltering: {
|
|
197
|
+
type: Boolean,
|
|
198
|
+
default: !1
|
|
199
|
+
},
|
|
200
|
+
/**
|
|
201
|
+
* Marks the textbox as invalid, rendering an error state
|
|
202
|
+
*/
|
|
203
|
+
isInvalid: { type: Boolean, default: !1 },
|
|
204
|
+
/**
|
|
205
|
+
* Indicates if the dropdown is open so that
|
|
206
|
+
* the respective event can be emitted
|
|
207
|
+
*/
|
|
208
|
+
open: { type: Boolean, default: !1 },
|
|
209
|
+
/**
|
|
210
|
+
* The input value
|
|
211
|
+
*/
|
|
212
|
+
value: { type: String, default: "" },
|
|
213
|
+
/**
|
|
214
|
+
* The selected value's list box item.
|
|
215
|
+
*/
|
|
216
|
+
selectedValueItem: {
|
|
217
|
+
type: [Object, Array],
|
|
218
|
+
default: void 0
|
|
219
|
+
},
|
|
220
|
+
/**
|
|
221
|
+
* Toggles whether to use the slot content select items shown in the textbox in multiple mode.
|
|
222
|
+
*/
|
|
223
|
+
showSlotContentInMultiple: { type: Boolean, default: !1 },
|
|
224
|
+
/*
|
|
225
|
+
* If enabled, the user will be able to select multiple items.
|
|
226
|
+
*/
|
|
227
|
+
multiple: { type: Boolean, default: !1 }
|
|
228
|
+
},
|
|
229
|
+
emits: ["open", "close", "input", "clear"],
|
|
230
|
+
setup(t, { emit: e, slots: n }) {
|
|
231
|
+
const l = m(null), a = h("textbox"), s = o(() => ({
|
|
232
|
+
[`b-dropdown-base-textbox--${d.DISABLED}`]: t.disabled,
|
|
233
|
+
[`b-dropdown-base-textbox--${d.HAS_ITEMS}`]: !!t.additionalItemsSelected
|
|
234
|
+
})), u = o(() => t.dynamicFiltering && !!t.value), r = o(
|
|
235
|
+
() => ({
|
|
236
|
+
"aria-haspopup": "listbox",
|
|
237
|
+
"aria-controls": t.ariaControls,
|
|
238
|
+
"aria-expanded": t.ariaExpanded ? "true" : "false",
|
|
239
|
+
"aria-labelledby": t.ariaLabelledby,
|
|
240
|
+
"aria-label": t.ariaLabelledby ? null : t.ariaLabel,
|
|
241
|
+
"aria-invalid": t.isInvalid,
|
|
242
|
+
"aria-disabled": t.disabled ? !0 : null
|
|
243
|
+
})
|
|
244
|
+
), v = () => {
|
|
245
|
+
t.disabled || (l.value.focus(), e("open"));
|
|
246
|
+
}, y = () => {
|
|
247
|
+
t.open && (l.value.focus(), e("close"));
|
|
248
|
+
}, _ = (f) => t.open && f.target.tagName === "INPUT" ? null : t.open ? y() : v(), x = (f) => {
|
|
249
|
+
t.dynamicFiltering || _(f);
|
|
250
|
+
}, g = () => {
|
|
251
|
+
e("clear"), e("input", "");
|
|
252
|
+
}, C = K((f) => {
|
|
253
|
+
e("input", f.target.value);
|
|
254
|
+
}, t.debounceTime), S = o(
|
|
255
|
+
() => t.multiple ? t.selectedValueItem : []
|
|
256
|
+
);
|
|
257
|
+
return {
|
|
258
|
+
// Enums
|
|
259
|
+
BentoTypographyElement: E,
|
|
260
|
+
BentoTypographyVariant: N,
|
|
261
|
+
// Values
|
|
262
|
+
conditionalClasses: s,
|
|
263
|
+
textboxId: a,
|
|
264
|
+
textbox: l,
|
|
265
|
+
isFiltering: u,
|
|
266
|
+
ariaAttributes: r,
|
|
267
|
+
selectedValueItems: S,
|
|
268
|
+
// Events
|
|
269
|
+
onCloseDropdown: y,
|
|
270
|
+
onToggleDropdown: _,
|
|
271
|
+
onClearSearch: g,
|
|
272
|
+
onInputEvent: C,
|
|
273
|
+
onSpaceBar: x,
|
|
274
|
+
// Methods
|
|
275
|
+
hasSlot: P(n)
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
var W = function() {
|
|
280
|
+
var e = this, n = e._self._c;
|
|
281
|
+
return e._self._setupProxy, n("div", { attrs: { "data-testid": "textbox-wrapper" }, on: { click: e.onToggleDropdown, keydown: [function(l) {
|
|
282
|
+
return !l.type.indexOf("key") && e._k(l.keyCode, "space", 32, l.key, [" ", "Spacebar"]) ? null : e.onSpaceBar.apply(null, arguments);
|
|
283
|
+
}, function(l) {
|
|
284
|
+
return !l.type.indexOf("key") && e._k(l.keyCode, "esc", 27, l.key, ["Esc", "Escape"]) ? null : e.onCloseDropdown.apply(null, arguments);
|
|
285
|
+
}] } }, [n("bento-typography", { staticClass: "b-dropdown-base-textbox", class: e.conditionalClasses, attrs: { el: e.BentoTypographyElement.DIV, "data-testid": "base-textbox" } }, [e.dynamicFiltering ? n("input", e._b({ ref: "textbox", staticClass: "b-dropdown-base-textbox__input", attrs: { id: e.textboxId, role: "combobox", type: "text", "aria-autocomplete": "list", disabled: e.disabled ? !0 : null }, domProps: { value: e.open ? e.value : e.displayValue }, on: { keydown: function(l) {
|
|
286
|
+
return !l.type.indexOf("key") && e._k(l.keyCode, "enter", 13, l.key, "Enter") ? null : e.onToggleDropdown.apply(null, arguments);
|
|
287
|
+
}, input: e.onInputEvent } }, "input", e.ariaAttributes, !1)) : n("div", e._b({ ref: "textbox", staticClass: "b-dropdown-base-textbox__input", attrs: { id: e.textboxId, role: "combobox", tabindex: 0 } }, "div", e.ariaAttributes, !1), [e.selectedValueItem && !e.multiple ? e._t("default", function() {
|
|
288
|
+
return [e._v(" " + e._s(e.displayValue) + " ")];
|
|
289
|
+
}, null, e.selectedValueItem) : e.selectedValueItem && e.showSlotContentInMultiple ? [n("div", { staticClass: "b-dropdown-base-textbox__input-multiple-selected" }, e._l(e.selectedValueItems, function(l) {
|
|
290
|
+
return n("div", { key: l.value }, [n("div", { staticClass: "b-dropdown-base-textbox__input-selected-element" }, [e._t("default", function() {
|
|
291
|
+
return [e._v(" " + e._s(e.displayValue) + " ")];
|
|
292
|
+
}, null, l)], 2)]);
|
|
293
|
+
}), 0)] : [e._v(e._s(e.displayValue))]], 2), e.additionalItemsSelected ? n("span", { staticClass: "b-dropdown-base-textbox__additional-items" }, [e._v(" " + e._s(e.additionalItemsSelected) + " ")]) : e._e(), e.hasSlot("icon") && !e.isFiltering ? n("span", { staticClass: "b-dropdown-base-textbox__icon", attrs: { "aria-hidden": "true" } }, [e._t("icon")], 2) : e._e(), e.isFiltering ? n("span", { staticClass: "b-dropdown-base-textbox__clear-search", attrs: { tabindex: "0", "data-testid": "clear-search-button" }, on: { click: e.onClearSearch, keypress: function(l) {
|
|
294
|
+
return !l.type.indexOf("key") && e._k(l.keyCode, "enter", 13, l.key, "Enter") ? null : e.onClearSearch.apply(null, arguments);
|
|
295
|
+
}, keyup: function(l) {
|
|
296
|
+
return !l.type.indexOf("key") && e._k(l.keyCode, "space", 32, l.key, [" ", "Spacebar"]) ? null : e.onClearSearch.apply(null, arguments);
|
|
297
|
+
} } }, [n("cross-circle-fill-icon", { attrs: { "svg-title": "clearSearch" } })], 1) : e._e()])], 1);
|
|
298
|
+
}, X = [], Y = /* @__PURE__ */ p(
|
|
299
|
+
Q,
|
|
300
|
+
W,
|
|
301
|
+
X,
|
|
302
|
+
!1,
|
|
303
|
+
null,
|
|
304
|
+
"1061aefd",
|
|
305
|
+
null,
|
|
306
|
+
null
|
|
307
|
+
);
|
|
308
|
+
const k = Y.exports, ee = b({
|
|
309
|
+
name: "dropdown-default-textbox",
|
|
310
|
+
components: { ChevronDownIcon: M, ChevronUpIcon: U, DropdownBaseTextbox: k },
|
|
311
|
+
emits: ["open", "close", "input", "clear"],
|
|
312
|
+
props: {
|
|
313
|
+
/**
|
|
314
|
+
* The number of additional items that have been selected in the dropdown.
|
|
315
|
+
*/
|
|
316
|
+
additionalItemsSelected: { type: Number, default: 0 },
|
|
317
|
+
/**
|
|
318
|
+
* Sets the aria-controls attribute on the textbox. This should correspond to the popover's id that the textbox triggers.
|
|
319
|
+
*/
|
|
320
|
+
ariaControls: {
|
|
321
|
+
type: String,
|
|
322
|
+
required: !0
|
|
323
|
+
},
|
|
324
|
+
/**
|
|
325
|
+
* 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.
|
|
326
|
+
*/
|
|
327
|
+
ariaExpanded: {
|
|
328
|
+
type: [String, Boolean],
|
|
329
|
+
required: !0
|
|
330
|
+
},
|
|
331
|
+
/**
|
|
332
|
+
* If no label element is used then the aria-label is be set should be set.
|
|
333
|
+
*/
|
|
334
|
+
ariaLabel: {
|
|
335
|
+
type: String,
|
|
336
|
+
default: null
|
|
337
|
+
},
|
|
338
|
+
/**
|
|
339
|
+
* Corresponds to the label's id that labels the textbox element.
|
|
340
|
+
*/
|
|
341
|
+
ariaLabelledby: {
|
|
342
|
+
type: String,
|
|
343
|
+
default: null
|
|
344
|
+
},
|
|
345
|
+
/**
|
|
346
|
+
* Custom debounce time. Default: 300
|
|
347
|
+
*/
|
|
348
|
+
debounceTime: { type: Number, default: 300 },
|
|
349
|
+
/**
|
|
350
|
+
* Disables any textbox functionality
|
|
351
|
+
*/
|
|
352
|
+
disabled: { type: Boolean, default: !1 },
|
|
353
|
+
/**
|
|
354
|
+
* Selected option's label
|
|
355
|
+
*/
|
|
356
|
+
displayValue: { type: String, default: null },
|
|
357
|
+
/**
|
|
358
|
+
* Sets the possibility to type into the textbox
|
|
359
|
+
*/
|
|
360
|
+
dynamicFiltering: {
|
|
361
|
+
type: Boolean,
|
|
362
|
+
default: !1
|
|
363
|
+
},
|
|
364
|
+
/**
|
|
365
|
+
* Marks the textbox as invalid, rendering an error state
|
|
366
|
+
*/
|
|
367
|
+
isInvalid: { type: Boolean, default: !1 },
|
|
368
|
+
/**
|
|
369
|
+
* Indicates if the dropdown is open so that
|
|
370
|
+
* the respective event can be emitted
|
|
371
|
+
*/
|
|
372
|
+
open: { type: Boolean, default: !1 },
|
|
373
|
+
/**
|
|
374
|
+
* The selected value's list box item.
|
|
375
|
+
*/
|
|
376
|
+
selectedValueItem: {
|
|
377
|
+
type: [Object, Array],
|
|
378
|
+
default: void 0
|
|
379
|
+
},
|
|
380
|
+
/**
|
|
381
|
+
* Toggles whether to use the slot content select items shown in the textbox in multiple mode.
|
|
382
|
+
*/
|
|
383
|
+
showSlotContentInMultiple: { type: Boolean, default: !1 },
|
|
384
|
+
/**
|
|
385
|
+
* The input value
|
|
386
|
+
*/
|
|
387
|
+
value: { type: String, default: "" },
|
|
388
|
+
/*
|
|
389
|
+
* If enabled, the user will be able to select multiple items.
|
|
390
|
+
*/
|
|
391
|
+
multiple: { type: Boolean, default: !1 }
|
|
392
|
+
},
|
|
393
|
+
setup(t) {
|
|
394
|
+
const e = o(() => ({
|
|
395
|
+
[`b-dropdown-default-textbox--${d.ERROR}`]: t.isInvalid,
|
|
396
|
+
[`b-dropdown-default-textbox--${d.DISABLED}`]: t.disabled,
|
|
397
|
+
[`b-dropdown-default-textbox--${d.OPENED}`]: t.open
|
|
398
|
+
})), n = o(() => t.open && !t.disabled);
|
|
399
|
+
return {
|
|
400
|
+
// Values
|
|
401
|
+
conditionalClasses: e,
|
|
402
|
+
isDropdownOpen: n
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
var te = function() {
|
|
407
|
+
var e = this, n = e._self._c;
|
|
408
|
+
return e._self._setupProxy, n("div", { staticClass: "b-dropdown-default-textbox", class: e.conditionalClasses, attrs: { "data-testid": "default-textbox" } }, [n("dropdown-base-textbox", e._b({ staticClass: "b-dropdown-default-textbox__textbox", attrs: { value: e.value }, on: { input: (l) => e.$emit("input", l), open: function(l) {
|
|
409
|
+
return e.$emit("open");
|
|
410
|
+
}, close: function(l) {
|
|
411
|
+
return e.$emit("close");
|
|
412
|
+
}, clear: function(l) {
|
|
413
|
+
return e.$emit("clear");
|
|
414
|
+
} }, scopedSlots: e._u([e._l(e.$scopedSlots || e.$slots, function(l, a) {
|
|
415
|
+
return { key: a, fn: function(s) {
|
|
416
|
+
return [e._t(a, null, null, s)];
|
|
417
|
+
} };
|
|
418
|
+
}), { key: "icon", fn: function() {
|
|
419
|
+
return [n("div", { staticClass: "b-dropdown-default-textbox__chevron" }, [n("chevron-up-icon", { directives: [{ name: "show", rawName: "v-show", value: e.isDropdownOpen, expression: "isDropdownOpen" }], attrs: { "svg-title": "opened" } }), n("chevron-down-icon", { directives: [{ name: "show", rawName: "v-show", value: !e.isDropdownOpen, expression: "!isDropdownOpen" }], attrs: { "svg-title": "closed" } })], 1)];
|
|
420
|
+
}, proxy: !0 }], null, !0) }, "dropdown-base-textbox", { ...e.$attrs, ...e.$props }, !1))], 1);
|
|
421
|
+
}, ne = [], le = /* @__PURE__ */ p(
|
|
422
|
+
ee,
|
|
423
|
+
te,
|
|
424
|
+
ne,
|
|
425
|
+
!1,
|
|
426
|
+
null,
|
|
427
|
+
"65e4921d",
|
|
428
|
+
null,
|
|
429
|
+
null
|
|
430
|
+
);
|
|
431
|
+
const ae = le.exports;
|
|
432
|
+
let $ = 0;
|
|
433
|
+
const oe = {
|
|
434
|
+
beforeCreate() {
|
|
435
|
+
this.uuid = $.toString(), $ += 1;
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
var se = function() {
|
|
439
|
+
var e = this, n = e._self._c;
|
|
440
|
+
return n("svg", e._b({ 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", "fill-rule": "evenodd", d: "M4.4697 5.96967C4.76259 5.67678 5.23747 5.67678 5.53036 5.96967L8.00003 8.43934L10.4697 5.96967C10.7626 5.67678 11.2375 5.67678 11.5304 5.96967C11.8233 6.26256 11.8233 6.73744 11.5304 7.03033L8.53036 10.0303C8.23747 10.3232 7.76259 10.3232 7.4697 10.0303L4.4697 7.03033C4.17681 6.73744 4.17681 6.26256 4.4697 5.96967Z", "clip-rule": "evenodd" } })]);
|
|
441
|
+
}, ie = [], re = /* @__PURE__ */ p(
|
|
442
|
+
oe,
|
|
443
|
+
se,
|
|
444
|
+
ie,
|
|
445
|
+
!1,
|
|
446
|
+
null,
|
|
447
|
+
"18645fe6",
|
|
448
|
+
null,
|
|
449
|
+
null
|
|
450
|
+
);
|
|
451
|
+
const de = re.exports;
|
|
452
|
+
let B = 0;
|
|
453
|
+
const ue = {
|
|
454
|
+
beforeCreate() {
|
|
455
|
+
this.uuid = B.toString(), B += 1;
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
var ce = function() {
|
|
459
|
+
var e = this, n = e._self._c;
|
|
460
|
+
return n("svg", e._b({ 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", "fill-rule": "evenodd", d: "M11.5303 10.0303C11.2374 10.3232 10.7626 10.3232 10.4697 10.0303L8 7.56066L5.53033 10.0303C5.23744 10.3232 4.76256 10.3232 4.46967 10.0303C4.17678 9.73744 4.17678 9.26256 4.46967 8.96967L7.46967 5.96967C7.61032 5.82902 7.80109 5.75 8 5.75C8.19891 5.75 8.38968 5.82902 8.53033 5.96967L11.5303 8.96967C11.8232 9.26256 11.8232 9.73744 11.5303 10.0303Z", "clip-rule": "evenodd" } })]);
|
|
461
|
+
}, pe = [], _e = /* @__PURE__ */ p(
|
|
462
|
+
ue,
|
|
463
|
+
ce,
|
|
464
|
+
pe,
|
|
465
|
+
!1,
|
|
466
|
+
null,
|
|
467
|
+
"6f20d431",
|
|
468
|
+
null,
|
|
469
|
+
null
|
|
470
|
+
);
|
|
471
|
+
const fe = _e.exports, me = b({
|
|
472
|
+
name: "dropdown-small-textbox",
|
|
473
|
+
components: { ChevronDownSmallIcon: de, ChevronUpSmallIcon: fe, DropdownBaseTextbox: k },
|
|
474
|
+
props: {
|
|
475
|
+
/**
|
|
476
|
+
* The number of additional items that have been selected in the dropdown.
|
|
477
|
+
*/
|
|
478
|
+
additionalItemsSelected: { type: Number, default: 0 },
|
|
479
|
+
/**
|
|
480
|
+
* Sets the aria-controls attribute on the textbox. This should correspond to the popover's id that the textbox triggers.
|
|
481
|
+
*/
|
|
482
|
+
ariaControls: {
|
|
483
|
+
type: String,
|
|
484
|
+
required: !0
|
|
485
|
+
},
|
|
486
|
+
/**
|
|
487
|
+
* 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.
|
|
488
|
+
*/
|
|
489
|
+
ariaExpanded: {
|
|
490
|
+
type: [String, Boolean],
|
|
491
|
+
required: !0
|
|
492
|
+
},
|
|
493
|
+
/**
|
|
494
|
+
* If no label element is used then the aria-label is be set should be set.
|
|
495
|
+
*/
|
|
496
|
+
ariaLabel: {
|
|
497
|
+
type: String,
|
|
498
|
+
default: null
|
|
499
|
+
},
|
|
500
|
+
/**
|
|
501
|
+
* Corresponds to the label's id that labels the textbox element.
|
|
502
|
+
*/
|
|
503
|
+
ariaLabelledby: {
|
|
504
|
+
type: String,
|
|
505
|
+
default: null
|
|
506
|
+
},
|
|
507
|
+
/**
|
|
508
|
+
* Custom debounce time. Default: 300
|
|
509
|
+
*/
|
|
510
|
+
debounceTime: { type: Number, default: 300 },
|
|
511
|
+
/**
|
|
512
|
+
* Disables any textbox functionality
|
|
513
|
+
*/
|
|
514
|
+
disabled: { type: Boolean, default: !1 },
|
|
515
|
+
/**
|
|
516
|
+
* Selected option's label
|
|
517
|
+
*/
|
|
518
|
+
displayValue: { type: String, default: null },
|
|
519
|
+
/**
|
|
520
|
+
* Sets the possibility to type into the textbox
|
|
521
|
+
*/
|
|
522
|
+
dynamicFiltering: {
|
|
523
|
+
type: Boolean,
|
|
524
|
+
default: !1
|
|
525
|
+
},
|
|
526
|
+
/**
|
|
527
|
+
* Marks the textbox as invalid, rendering an error state
|
|
528
|
+
*/
|
|
529
|
+
isInvalid: { type: Boolean, default: !1 },
|
|
530
|
+
/**
|
|
531
|
+
* Indicates if the dropdown is open so that
|
|
532
|
+
* the respective event can be emitted
|
|
533
|
+
*/
|
|
534
|
+
open: { type: Boolean, default: !1 },
|
|
535
|
+
/**
|
|
536
|
+
* The input value
|
|
537
|
+
*/
|
|
538
|
+
value: { type: String, default: "" }
|
|
539
|
+
},
|
|
540
|
+
setup(t) {
|
|
541
|
+
const e = o(() => ({
|
|
542
|
+
[`b-dropdown-small-textbox--${d.DISABLED}`]: t.disabled,
|
|
543
|
+
[`b-dropdown-small-textbox--${d.OPENED}`]: t.open
|
|
544
|
+
})), n = o(() => t.open && !t.disabled);
|
|
545
|
+
return {
|
|
546
|
+
// Values
|
|
547
|
+
conditionalClasses: e,
|
|
548
|
+
isDropdownOpen: n
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
var be = function() {
|
|
553
|
+
var e = this, n = e._self._c;
|
|
554
|
+
return e._self._setupProxy, n("div", { staticClass: "b-dropdown-small-textbox", class: e.conditionalClasses }, [n("dropdown-base-textbox", e._b({ staticClass: "b-dropdown-small-textbox__textbox", on: { open: function(l) {
|
|
555
|
+
return e.$emit("open");
|
|
556
|
+
}, close: function(l) {
|
|
557
|
+
return e.$emit("close");
|
|
558
|
+
} }, scopedSlots: e._u([{ key: "icon", fn: function() {
|
|
559
|
+
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)];
|
|
560
|
+
}, proxy: !0 }]) }, "dropdown-base-textbox", { ...e.$attrs, ...e.$props }, !1))], 1);
|
|
561
|
+
}, ye = [], ve = /* @__PURE__ */ p(
|
|
562
|
+
me,
|
|
563
|
+
be,
|
|
564
|
+
ye,
|
|
565
|
+
!1,
|
|
566
|
+
null,
|
|
567
|
+
"83f4c245",
|
|
568
|
+
null,
|
|
569
|
+
null
|
|
570
|
+
);
|
|
571
|
+
const xe = ve.exports;
|
|
572
|
+
function ge(t, e) {
|
|
573
|
+
const n = m(t), l = m(e);
|
|
574
|
+
return o(() => {
|
|
575
|
+
const s = n.value.toLocaleLowerCase();
|
|
576
|
+
return l.value.filter(({ label: u }) => u.toLowerCase().includes(s));
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
const we = {
|
|
580
|
+
"en-US": {
|
|
581
|
+
optional: "optional",
|
|
582
|
+
required: "required",
|
|
583
|
+
clearSearch: "Clear filter"
|
|
584
|
+
}
|
|
585
|
+
}, he = b({
|
|
586
|
+
i18n: { messages: we },
|
|
587
|
+
name: "b-dropdown",
|
|
588
|
+
components: {
|
|
589
|
+
BentoDropdownOptionsContainer: J,
|
|
590
|
+
BentoTypography: L,
|
|
591
|
+
DropdownInputDefault: ae,
|
|
592
|
+
DropdownInputSmall: xe
|
|
593
|
+
},
|
|
594
|
+
directives: { BentoClickOutsideDirective: z },
|
|
595
|
+
inheritAttrs: !1,
|
|
596
|
+
props: {
|
|
597
|
+
/**
|
|
598
|
+
* Defines a string value that labels an interactive element.
|
|
599
|
+
*/
|
|
600
|
+
ariaLabel: { type: String, default: null },
|
|
601
|
+
/**
|
|
602
|
+
* Disables dropdown functionality.
|
|
603
|
+
*/
|
|
604
|
+
disabled: { type: Boolean, default: !1 },
|
|
605
|
+
/**
|
|
606
|
+
* Text that appears in the form control when it has no value set
|
|
607
|
+
*/
|
|
608
|
+
placeholder: {
|
|
609
|
+
type: String,
|
|
610
|
+
default: null
|
|
611
|
+
},
|
|
612
|
+
/**
|
|
613
|
+
* Sets the possibility to type into the textbox.
|
|
614
|
+
*/
|
|
615
|
+
dynamicFiltering: {
|
|
616
|
+
type: Boolean,
|
|
617
|
+
default: !1
|
|
618
|
+
},
|
|
619
|
+
/**
|
|
620
|
+
* Highlights the dropdown in an erroneous state.
|
|
621
|
+
*/
|
|
622
|
+
error: { type: Boolean, default: !1 },
|
|
623
|
+
/**
|
|
624
|
+
* Text that is displayed as a label above the element.
|
|
625
|
+
*/
|
|
626
|
+
label: { type: String, default: null },
|
|
627
|
+
/**
|
|
628
|
+
* Descriptive supporting text visbile underneath the dropdown.
|
|
629
|
+
*/
|
|
630
|
+
description: { type: String, default: null },
|
|
631
|
+
/**
|
|
632
|
+
* Function that dertermines which options are disabled from interaction.
|
|
633
|
+
*
|
|
634
|
+
* @type {BentoListboxIsOptionDisabled}
|
|
635
|
+
* @param {BentoListboxOptionItem} option - Dropdown option object
|
|
636
|
+
* @param {string} option.label - Option's label text
|
|
637
|
+
* @param {string|number} option.value - Option's value
|
|
638
|
+
* @param {unknown} option.data - Option's extra data to be passed to the default slot
|
|
639
|
+
*/
|
|
640
|
+
isOptionDisabled: {
|
|
641
|
+
type: Function,
|
|
642
|
+
default: void 0
|
|
643
|
+
},
|
|
644
|
+
/**
|
|
645
|
+
* The option elements to populate the dropdown with.
|
|
646
|
+
* It must be an array of {@see BentoListboxOptionItem }
|
|
647
|
+
* * @property {string} value.label - Text to be displayed in the option
|
|
648
|
+
* * @property {string,number} value.value - Value of the option
|
|
649
|
+
*/
|
|
650
|
+
items: {
|
|
651
|
+
type: Array,
|
|
652
|
+
default: () => []
|
|
653
|
+
},
|
|
654
|
+
/*
|
|
655
|
+
* If enabled, the user will be able to select multiple items.
|
|
656
|
+
*/
|
|
657
|
+
multiple: { type: Boolean, default: !1 },
|
|
658
|
+
/**
|
|
659
|
+
* Highlights the dropdown is optional.
|
|
660
|
+
*/
|
|
661
|
+
optional: { type: Boolean, default: !1 },
|
|
662
|
+
/**
|
|
663
|
+
* Highlights the dropdown is required.
|
|
664
|
+
*/
|
|
665
|
+
required: { type: Boolean, default: !1 },
|
|
666
|
+
/**
|
|
667
|
+
* Toggles whether to use the slot content select items shown in the textbox in multiple mode.
|
|
668
|
+
*/
|
|
669
|
+
showSlotContentInMultiple: { type: Boolean, default: !1 },
|
|
670
|
+
/**
|
|
671
|
+
* Dropdown input size
|
|
672
|
+
* @see BentoDropdownSize
|
|
673
|
+
*/
|
|
674
|
+
size: {
|
|
675
|
+
type: String,
|
|
676
|
+
default: c.DEFAULT,
|
|
677
|
+
validator: (t) => Object.values(c).includes(t)
|
|
678
|
+
},
|
|
679
|
+
/**
|
|
680
|
+
* The `input` value.
|
|
681
|
+
* Providing an empty string will select no options.
|
|
682
|
+
* Set to an empty string `''` if you don't want any of the available options to be selected.
|
|
683
|
+
*/
|
|
684
|
+
value: {
|
|
685
|
+
type: [String, Number, Array],
|
|
686
|
+
default: null
|
|
687
|
+
}
|
|
688
|
+
},
|
|
689
|
+
emits: ["input"],
|
|
690
|
+
setup(t, { emit: e }) {
|
|
691
|
+
const n = m(null), l = m(!1), a = h("bento-dropdown-options-container"), s = h("dropdown-label"), u = o(() => ({
|
|
692
|
+
"b-dropdown__description--error": t.error
|
|
693
|
+
})), r = m(""), v = A(t, "items"), y = ge(r, v), _ = o(() => t.dynamicFiltering && !!r.value), x = o(() => {
|
|
694
|
+
if (!t.multiple) {
|
|
695
|
+
const i = t.items.find(({ value: w }) => w === (t == null ? void 0 : t.value));
|
|
696
|
+
return (i == null ? void 0 : i.label) || t.placeholder || null;
|
|
697
|
+
}
|
|
698
|
+
return t != null && t.value ? t.value.map((i) => {
|
|
699
|
+
const { label: w } = t.items.find(({ value: F }) => F === i);
|
|
700
|
+
return w;
|
|
701
|
+
}).join(", ") : t.placeholder || null;
|
|
702
|
+
}), g = o(
|
|
703
|
+
() => t != null && t.multiple ? t.items.filter(
|
|
704
|
+
({ value: i }) => (t == null ? void 0 : t.value) && (t == null ? void 0 : t.value).includes(i)
|
|
705
|
+
) : t.items.find(({ value: i }) => i === (t == null ? void 0 : t.value))
|
|
706
|
+
);
|
|
707
|
+
return {
|
|
708
|
+
// Values
|
|
709
|
+
additionalItemsSelected: o(() => {
|
|
710
|
+
var i;
|
|
711
|
+
return t.multiple ? (i = t == null ? void 0 : t.value) == null ? void 0 : i.length : null;
|
|
712
|
+
}),
|
|
713
|
+
isDropdownOpen: l,
|
|
714
|
+
displayValue: x,
|
|
715
|
+
dropdownOptionsContainerId: a,
|
|
716
|
+
filteredItems: y,
|
|
717
|
+
isSearching: _,
|
|
718
|
+
searchTerm: r,
|
|
719
|
+
labelId: s,
|
|
720
|
+
selectedValueItem: g,
|
|
721
|
+
descriptionConditionalClasses: u,
|
|
722
|
+
// Refs
|
|
723
|
+
inputContainerRef: n,
|
|
724
|
+
// Events
|
|
725
|
+
closeOpenedDropdown: () => {
|
|
726
|
+
_.value && (r.value = ""), l.value && (l.value = !1);
|
|
727
|
+
},
|
|
728
|
+
toggleDropdown: () => {
|
|
729
|
+
l.value = !l.value, _.value && (r.value = "");
|
|
730
|
+
},
|
|
731
|
+
onOptionSelected: (i) => {
|
|
732
|
+
t.multiple || (r.value = "", l.value = !1), e("input", i);
|
|
733
|
+
},
|
|
734
|
+
// Enums
|
|
735
|
+
BentoTypographyElement: E,
|
|
736
|
+
BentoDropdownSize: c
|
|
737
|
+
};
|
|
738
|
+
}
|
|
739
|
+
});
|
|
740
|
+
var Ce = function() {
|
|
741
|
+
var e = this, n = e._self._c;
|
|
742
|
+
return e._self._setupProxy, n("div", { directives: [{ name: "bento-click-outside-directive", rawName: "v-bento-click-outside-directive", value: e.closeOpenedDropdown, expression: "closeOpenedDropdown" }], staticClass: "b-dropdown" }, [e.label ? n("div", { staticClass: "b-dropdown__label", attrs: { id: e.labelId } }, [n("bento-typography", { attrs: { el: e.BentoTypographyElement.SPAN, stronger: "" } }, [e._v(e._s(e.label))]), e.optional ? n("bento-typography", { staticClass: "b-dropdown__label-requirement", attrs: { el: e.BentoTypographyElement.SPAN } }, [e._v(" (" + e._s(e.$t("optional")) + ") ")]) : e._e(), e.required ? n("bento-typography", { staticClass: "b-dropdown__label-requirement", attrs: { el: e.BentoTypographyElement.SPAN } }, [e._v(" (" + e._s(e.$t("required")) + ") ")]) : e._e()], 1) : e._e(), n(e.size, { ref: "inputContainerRef", tag: "component", attrs: { "additional-items-selected": e.additionalItemsSelected, ariaControls: e.dropdownOptionsContainerId, ariaExpanded: e.isDropdownOpen, "aria-labelledby": e.label ? e.labelId : null, "aria-label": e.ariaLabel ? e.ariaLabel : null, disabled: e.disabled, "display-value": e.displayValue, "dynamic-filtering": e.dynamicFiltering, "is-invalid": e.error, multiple: e.multiple, open: e.isDropdownOpen, "selected-value-item": e.size === e.BentoDropdownSize.DEFAULT ? e.selectedValueItem : void 0, "show-slot-content-in-multiple": e.showSlotContentInMultiple }, on: { open: e.toggleDropdown, close: e.toggleDropdown }, scopedSlots: e._u([e._l(e.$scopedSlots || e.$slots, function(l, a) {
|
|
743
|
+
return { key: a, fn: function(s) {
|
|
744
|
+
return [e._t(a, null, null, s)];
|
|
745
|
+
} };
|
|
746
|
+
})], null, !0), model: { value: e.searchTerm, callback: function(l) {
|
|
747
|
+
e.searchTerm = l;
|
|
748
|
+
}, expression: "searchTerm" } }), e.inputContainerRef ? n("bento-dropdown-options-container", { attrs: { id: e.dropdownOptionsContainerId, "aria-label": e.ariaLabel, disabled: e.disabled, "input-size": e.size, "is-option-disabled": e.isOptionDisabled, items: e.filteredItems, multiple: e.multiple, open: e.isDropdownOpen, "selected-value": e.value, searching: e.isSearching, "target-element": e.inputContainerRef }, on: { select: e.onOptionSelected, close: e.toggleDropdown }, scopedSlots: e._u([e._l(e.$scopedSlots || e.$slots, function(l, a) {
|
|
749
|
+
return { key: a, fn: function(s) {
|
|
750
|
+
return [e._t(a, null, null, s)];
|
|
751
|
+
} };
|
|
752
|
+
})], null, !0) }) : e._e(), e.description ? n("bento-typography", { staticClass: "b-dropdown__description", class: e.descriptionConditionalClasses, attrs: { el: e.BentoTypographyElement.SPAN } }, [e._v(" " + e._s(e.description) + " ")]) : e._e()], 1);
|
|
753
|
+
}, Se = [], De = /* @__PURE__ */ p(
|
|
754
|
+
he,
|
|
755
|
+
Ce,
|
|
756
|
+
Se,
|
|
757
|
+
!1,
|
|
758
|
+
null,
|
|
759
|
+
"491f42a8",
|
|
760
|
+
null,
|
|
761
|
+
null
|
|
762
|
+
);
|
|
763
|
+
const Ve = De.exports;
|
|
764
|
+
export {
|
|
765
|
+
Ve as B,
|
|
766
|
+
ae as D,
|
|
767
|
+
c as a,
|
|
768
|
+
K as d,
|
|
769
|
+
ge as u
|
|
770
|
+
};
|
|
771
|
+
//# sourceMappingURL=dropdown.0d394d2f.js.map
|