@adyen/bento-vue3 1.76.2 → 1.77.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/index.d.ts +216 -33
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-picker.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown-default-textbox.css +1 -1
- package/dist/assets/dropdown-tag.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/input-field-phone-number.css +1 -1
- package/dist/assets/input-field.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/pagination.css +1 -1
- package/dist/assets/payment-method.css +1 -1
- package/dist/assets/secondary-nav.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/tag.css +1 -1
- package/dist/assets/textarea.css +1 -1
- package/dist/assets/timeline-item.css +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{checkbox-group.8ebmaHsA.js → checkbox-group.COUx8Ne8.js} +2 -2
- package/dist/chunks/{checkbox-group.8ebmaHsA.js.map → checkbox-group.COUx8Ne8.js.map} +1 -1
- package/dist/chunks/{checkbox.BI0dqARY.js → checkbox.SffuKyNj.js} +3 -3
- package/dist/chunks/{checkbox.BI0dqARY.js.map → checkbox.SffuKyNj.js.map} +1 -1
- package/dist/chunks/{code-snippet.Bjf1ma1L.js → code-snippet.ByoBEM00.js} +2 -2
- package/dist/chunks/{code-snippet.Bjf1ma1L.js.map → code-snippet.ByoBEM00.js.map} +1 -1
- package/dist/chunks/{currency.CBZMwm21.js → currency.WmvQjX7l.js} +2 -2
- package/dist/chunks/{currency.CBZMwm21.js.map → currency.WmvQjX7l.js.map} +1 -1
- package/dist/chunks/{data-grid.VBEJO94f.js → data-grid.CMIG82Xt.js} +7 -7
- package/dist/chunks/{data-grid.VBEJO94f.js.map → data-grid.CMIG82Xt.js.map} +1 -1
- package/dist/chunks/date-picker.CsGq3iSK.js +244 -0
- package/dist/chunks/date-picker.CsGq3iSK.js.map +1 -0
- package/dist/chunks/date-picker.types.Ckt7zxGy.js +5 -0
- package/dist/chunks/date-picker.types.Ckt7zxGy.js.map +1 -0
- package/dist/chunks/date-range-picker.C19CWG27.js +1149 -0
- package/dist/chunks/date-range-picker.C19CWG27.js.map +1 -0
- package/dist/chunks/{dropdown-default-textbox.MkU0tMf1.js → dropdown-default-textbox._KEBXjKT.js} +88 -86
- package/dist/chunks/dropdown-default-textbox._KEBXjKT.js.map +1 -0
- package/dist/chunks/dropdown-tag.B90dpg8J.js +301 -0
- package/dist/chunks/dropdown-tag.B90dpg8J.js.map +1 -0
- package/dist/chunks/dropdown.DYDHM__3.js +833 -0
- package/dist/chunks/{dropdown.KStrJVoP.js.map → dropdown.DYDHM__3.js.map} +1 -1
- package/dist/chunks/es6.MoTTyETW.js.map +1 -1
- package/dist/chunks/{file-uploader.By0MTfKk.js → file-uploader.BDXQ7Ccv.js} +416 -415
- package/dist/chunks/{file-uploader.By0MTfKk.js.map → file-uploader.BDXQ7Ccv.js.map} +1 -1
- package/dist/chunks/{filter-bar.JXmlFnHV.js → filter-bar.CmF92iAr.js} +303 -303
- package/dist/chunks/filter-bar.CmF92iAr.js.map +1 -0
- package/dist/chunks/form-field.BBqLu-vs.js +10 -0
- package/dist/chunks/form-field.BBqLu-vs.js.map +1 -0
- package/dist/chunks/get-slot-text.CQRAP2_q.js +12 -0
- package/dist/chunks/get-slot-text.CQRAP2_q.js.map +1 -0
- package/dist/chunks/{header-with-views.Dg2usaMY.js → header-with-views.xPfeOz0Y.js} +3 -3
- package/dist/chunks/{header-with-views.Dg2usaMY.js.map → header-with-views.xPfeOz0Y.js.map} +1 -1
- package/dist/chunks/{input-field-password.B6nJ7ygZ.js → input-field-password.BZBYVyAb.js} +3 -3
- package/dist/chunks/{input-field-password.B6nJ7ygZ.js.map → input-field-password.BZBYVyAb.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.D_UBAN2s.js → input-field-phone-number.a8Mw5PAW.js} +5 -5
- package/dist/chunks/{input-field-phone-number.D_UBAN2s.js.map → input-field-phone-number.a8Mw5PAW.js.map} +1 -1
- package/dist/chunks/{input-field.C29FCI4j.js → input-field.CYGGIK48.js} +48 -48
- package/dist/chunks/input-field.CYGGIK48.js.map +1 -0
- package/dist/chunks/{listbox-option-tag.uHSB7MO6.js → listbox-option-tag.Cwe9Bn-R.js} +2 -2
- package/dist/chunks/{listbox-option-tag.uHSB7MO6.js.map → listbox-option-tag.Cwe9Bn-R.js.map} +1 -1
- package/dist/chunks/{pagination.BaBWNlIF.js → pagination.CYdGcyMA.js} +49 -49
- package/dist/chunks/pagination.CYdGcyMA.js.map +1 -0
- package/dist/chunks/{payment-method.CDnn1bjo.js → payment-method.D6PeTYWq.js} +45 -42
- package/dist/chunks/payment-method.D6PeTYWq.js.map +1 -0
- package/dist/chunks/payment-method.types.BqtH7RM2.js.map +1 -1
- package/dist/chunks/{radio-group.DWNqrkZ3.js → radio-group.B_8R6vGx.js} +3 -3
- package/dist/chunks/{radio-group.DWNqrkZ3.js.map → radio-group.B_8R6vGx.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.Bh7KS617.js → rich-text-editor.B6Ftqv55.js} +2 -2
- package/dist/chunks/{rich-text-editor.Bh7KS617.js.map → rich-text-editor.B6Ftqv55.js.map} +1 -1
- package/dist/chunks/{search-bar.RS02IcLc.js → search-bar.D3Ri_RUK.js} +3 -3
- package/dist/chunks/{search-bar.RS02IcLc.js.map → search-bar.D3Ri_RUK.js.map} +1 -1
- package/dist/chunks/{secondary-nav.DXsgUTqk.js → secondary-nav.CAb20jWW.js} +24 -24
- package/dist/chunks/secondary-nav.CAb20jWW.js.map +1 -0
- package/dist/chunks/{summary-grid.types.ByQ4u19J.js → summary-grid.types.cE1fyLvC.js} +2 -2
- package/dist/chunks/{summary-grid.types.ByQ4u19J.js.map → summary-grid.types.cE1fyLvC.js.map} +1 -1
- package/dist/chunks/tag.CjaB9DxL.js +57 -0
- package/dist/chunks/tag.CjaB9DxL.js.map +1 -0
- package/dist/chunks/textarea.C_gnXj6b.js +254 -0
- package/dist/chunks/textarea.C_gnXj6b.js.map +1 -0
- package/dist/chunks/{timeline-item.DNjubXL2.js → timeline-item.rSY0Xce3.js} +48 -48
- package/dist/chunks/timeline-item.rSY0Xce3.js.map +1 -0
- package/dist/chunks/{toggle.Dd_NA8eH.js → toggle.BHCUjMpp.js} +2 -2
- package/dist/chunks/{toggle.Dd_NA8eH.js.map → toggle.BHCUjMpp.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/currency.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +7 -6
- package/dist/date-picker.js.map +1 -1
- package/dist/date-range-picker.js +1 -1
- package/dist/dropdown.js +3 -3
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/index.js +246 -245
- package/dist/index.js.map +1 -1
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/internal.js +1 -1
- package/dist/pagination.js +1 -1
- package/dist/payment-method.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/styles/bento-dark.css +4 -0
- package/dist/styles/bento-light.css +4 -0
- package/dist/styles/bento.css +4 -0
- package/dist/styles/legacy.css +4 -0
- package/dist/styles/styleguide.css +4 -0
- package/dist/summary-grid.js +1 -1
- package/dist/tag.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/toggle.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +5 -5
- package/dist/chunks/date-picker.OI-sQ232.js +0 -234
- package/dist/chunks/date-picker.OI-sQ232.js.map +0 -1
- package/dist/chunks/date-range-picker.D7IwIR5V.js +0 -1114
- package/dist/chunks/date-range-picker.D7IwIR5V.js.map +0 -1
- package/dist/chunks/dropdown-default-textbox.MkU0tMf1.js.map +0 -1
- package/dist/chunks/dropdown-tag.DFeoXIgH.js +0 -242
- package/dist/chunks/dropdown-tag.DFeoXIgH.js.map +0 -1
- package/dist/chunks/dropdown.KStrJVoP.js +0 -825
- package/dist/chunks/filter-bar.JXmlFnHV.js.map +0 -1
- package/dist/chunks/get-slot-text.DQlZEsId.js +0 -12
- package/dist/chunks/get-slot-text.DQlZEsId.js.map +0 -1
- package/dist/chunks/input-field.C29FCI4j.js.map +0 -1
- package/dist/chunks/pagination.BaBWNlIF.js.map +0 -1
- package/dist/chunks/payment-method.CDnn1bjo.js.map +0 -1
- package/dist/chunks/secondary-nav.DXsgUTqk.js.map +0 -1
- package/dist/chunks/tag.CEmpyuYX.js +0 -50
- package/dist/chunks/tag.CEmpyuYX.js.map +0 -1
- package/dist/chunks/textarea.C1jkfowf.js +0 -246
- package/dist/chunks/textarea.C1jkfowf.js.map +0 -1
- package/dist/chunks/timeline-item.DNjubXL2.js.map +0 -1
|
@@ -0,0 +1,833 @@
|
|
|
1
|
+
import { ref as C, watch as ge, computed as d, defineComponent as W, useSlots as $e, toRefs as Me, createBlock as K, openBlock as S, resolveDynamicComponent as Re, mergeProps as P, withCtx as V, createElementVNode as ae, withKeys as nt, unref as s, createVNode as X, toHandlers as te, createSlots as pe, renderList as fe, renderSlot as G, normalizeProps as me, guardReactiveProps as ve, createElementBlock as k, createCommentVNode as z, toDisplayString as he, normalizeClass as ye, withDirectives as oe, vShow as Te, nextTick as N, useAttrs as st, toRef as x, inject as it, createTextVNode as rt } from "vue";
|
|
2
|
+
import { d as de, B as dt } from "./typography.yBEME_Gu.js";
|
|
3
|
+
import { a as ue, b as H, c as ut, B as ee, D as ct } from "./dropdown-default-textbox._KEBXjKT.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { _ as Y } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
6
|
+
import { s as ce } from "./events.CMzGybJJ.js";
|
|
7
|
+
import { g as J } from "./generate-uid.NJ8tVoha.js";
|
|
8
|
+
import { u as pt } from "./aria-label.CaUURpnB.js";
|
|
9
|
+
import { u as Le } from "./index.pdBj0KQU.js";
|
|
10
|
+
import { u as ft } from "./form-field.BBqLu-vs.js";
|
|
11
|
+
import { a as f, b as be, B as Ie, c as mt, u as vt, d as yt } from "./use-cached-selected-values.8MdrR9wt.js";
|
|
12
|
+
import { u as bt } from "./use-form-layout-loading.D3lALhtC.js";
|
|
13
|
+
import { B as gt } from "./directive.Cbdox5VL.js";
|
|
14
|
+
import { B as $, a as ht } from "./keyboard-navigation.pB8weElW.js";
|
|
15
|
+
import { u as Lt } from "./use-has-slot.B7eQSabc.js";
|
|
16
|
+
import { F as wt, E as St } from "./field-label.C97CrBI_.js";
|
|
17
|
+
import { P as xe } from "./popper-container.Uod3yjsR.js";
|
|
18
|
+
import { h as Et } from "./button-actions.BQ3AFQqt.js";
|
|
19
|
+
import "../assets/dropdown.css";
|
|
20
|
+
const we = {
|
|
21
|
+
"en-US": {
|
|
22
|
+
apply: "Apply",
|
|
23
|
+
cancel: "Cancel",
|
|
24
|
+
noOptionsMatchThisSearch: "No options match this search"
|
|
25
|
+
},
|
|
26
|
+
"ja-JP": {
|
|
27
|
+
apply: "適用",
|
|
28
|
+
cancel: "キャンセル"
|
|
29
|
+
},
|
|
30
|
+
"pt-BR": {
|
|
31
|
+
apply: "Aplicar",
|
|
32
|
+
cancel: "Cancelar"
|
|
33
|
+
}
|
|
34
|
+
}, Ct = (a, r, i, o) => {
|
|
35
|
+
const n = C(a.value), { t: l } = Le({ messages: we });
|
|
36
|
+
ge(a, () => {
|
|
37
|
+
n.value = a.value;
|
|
38
|
+
});
|
|
39
|
+
const e = d(
|
|
40
|
+
() => JSON.stringify(n.value) === JSON.stringify(a.value)
|
|
41
|
+
), c = () => {
|
|
42
|
+
o(f.SELECT, n.value), o(f.CLOSE_DROPDOWN);
|
|
43
|
+
}, v = () => {
|
|
44
|
+
n.value = a.value, o(f.CLOSE_DROPDOWN);
|
|
45
|
+
}, L = () => {
|
|
46
|
+
i.value && r.value && (n.value = a.value);
|
|
47
|
+
}, u = d(() => [
|
|
48
|
+
{
|
|
49
|
+
title: l("apply"),
|
|
50
|
+
event: c,
|
|
51
|
+
disabled: e.value
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
title: l("cancel"),
|
|
55
|
+
event: v
|
|
56
|
+
}
|
|
57
|
+
]), h = (b) => {
|
|
58
|
+
n.value = b, r.value || o(f.SELECT, b);
|
|
59
|
+
}, g = (b) => {
|
|
60
|
+
h(b), o(f.TAB);
|
|
61
|
+
}, p = (b) => {
|
|
62
|
+
h(b), o(f.ENTER);
|
|
63
|
+
}, O = (b) => {
|
|
64
|
+
h(b), o(f.SPACE);
|
|
65
|
+
}, m = () => {
|
|
66
|
+
v(), o(f.ESCAPE);
|
|
67
|
+
}, B = () => {
|
|
68
|
+
o(f.SHOW_MORE);
|
|
69
|
+
}, D = {
|
|
70
|
+
[f.SELECT]: h,
|
|
71
|
+
[f.SHOW_MORE]: B,
|
|
72
|
+
[f.TAB]: g,
|
|
73
|
+
[f.SPACE]: O,
|
|
74
|
+
[f.ENTER]: p
|
|
75
|
+
};
|
|
76
|
+
return {
|
|
77
|
+
// Values
|
|
78
|
+
actions: u,
|
|
79
|
+
internalSelectedValue: n,
|
|
80
|
+
// Methods
|
|
81
|
+
listeners: D,
|
|
82
|
+
onEscapeKey: m,
|
|
83
|
+
onOutsideDropdownClick: L
|
|
84
|
+
};
|
|
85
|
+
}, Ot = W({
|
|
86
|
+
i18n: { messages: we },
|
|
87
|
+
name: "bento-dropdown-options-container"
|
|
88
|
+
}), Bt = /* @__PURE__ */ W({
|
|
89
|
+
...Ot,
|
|
90
|
+
props: {
|
|
91
|
+
/**
|
|
92
|
+
* Defines a string value that labels an interactive element.
|
|
93
|
+
*/
|
|
94
|
+
ariaLabel: { type: String, default: null },
|
|
95
|
+
/**
|
|
96
|
+
* Indicates that dropdown items are loading
|
|
97
|
+
*/
|
|
98
|
+
componentLoading: { type: Boolean, default: !1 },
|
|
99
|
+
/**
|
|
100
|
+
* Empty state props used with the inner empty state component which is displayed when no search results are found.
|
|
101
|
+
*/
|
|
102
|
+
emptyState: {
|
|
103
|
+
type: Object,
|
|
104
|
+
default: void 0
|
|
105
|
+
},
|
|
106
|
+
/**
|
|
107
|
+
* Disables dropdown functionality
|
|
108
|
+
*/
|
|
109
|
+
disabled: { type: Boolean, default: !1 },
|
|
110
|
+
/**
|
|
111
|
+
* Indicates whether there are more items to load
|
|
112
|
+
*/
|
|
113
|
+
hasMoreItems: { type: Boolean, default: !1 },
|
|
114
|
+
/**
|
|
115
|
+
* Identifies the listbox whose contents are controlled by the the combobox on which the aria-controls attribute is set.
|
|
116
|
+
*/
|
|
117
|
+
id: { type: String, required: !0 },
|
|
118
|
+
/**
|
|
119
|
+
* Function that allows the options to be disabled
|
|
120
|
+
*
|
|
121
|
+
* @type {BentoDropdownIsOptionDisabled}
|
|
122
|
+
* @param {BentoDropdownOptionItem} option - Dropdown option object
|
|
123
|
+
* @param {string} option.label - Option's label text
|
|
124
|
+
* @param {string|number} option.value - Option's value
|
|
125
|
+
* @param {unknown} option.data - Option's extra data to be passed to the default slot
|
|
126
|
+
*/
|
|
127
|
+
isOptionDisabled: {
|
|
128
|
+
type: Function,
|
|
129
|
+
default: void 0
|
|
130
|
+
},
|
|
131
|
+
/**
|
|
132
|
+
* The option elements to populate the dropdown with.
|
|
133
|
+
* It must be an array of {@see BentoDropdownOptionItem }
|
|
134
|
+
* * @property {string} value.label - Text to be displayed in the option
|
|
135
|
+
* * @property {string,number} value.value - Value of the option
|
|
136
|
+
*/
|
|
137
|
+
items: {
|
|
138
|
+
type: Array,
|
|
139
|
+
required: !0
|
|
140
|
+
},
|
|
141
|
+
/**
|
|
142
|
+
* The type of `Lazy Load`.
|
|
143
|
+
* Type "automatic" will enable infinite scrolling
|
|
144
|
+
* Type "button" will enable lazy loading with "Show more" button
|
|
145
|
+
*/
|
|
146
|
+
lazyLoadType: {
|
|
147
|
+
type: String,
|
|
148
|
+
default: Ie.AUTOMATIC,
|
|
149
|
+
validator: (a) => Object.values(Ie).includes(a)
|
|
150
|
+
},
|
|
151
|
+
/**
|
|
152
|
+
* Indicates if new options are lazy loading.
|
|
153
|
+
*/
|
|
154
|
+
loading: { type: Boolean, default: !1 },
|
|
155
|
+
/**
|
|
156
|
+
* If enabled, the user will be able to select multiple items.
|
|
157
|
+
*/
|
|
158
|
+
multiple: { type: Boolean, default: !1 },
|
|
159
|
+
/**
|
|
160
|
+
* Indicates if the dropdown is open so that
|
|
161
|
+
* the container can be displayed.
|
|
162
|
+
*/
|
|
163
|
+
open: { type: Boolean, required: !0 },
|
|
164
|
+
/**
|
|
165
|
+
* The `input` value.
|
|
166
|
+
* Providing an empty string or empty array will select no options.
|
|
167
|
+
* Set to an empty string `''` if you don't want any of the available options to be selected for single select
|
|
168
|
+
*/
|
|
169
|
+
selectedValue: {
|
|
170
|
+
type: Array,
|
|
171
|
+
default: null
|
|
172
|
+
},
|
|
173
|
+
/**
|
|
174
|
+
* Flag that indicates that an external search it's being made
|
|
175
|
+
* to filter out the items inside the the multi-select listbox
|
|
176
|
+
*
|
|
177
|
+
* If enabled, hides the "Select all" checkbox in "multiple" mode.
|
|
178
|
+
*/
|
|
179
|
+
searching: be.props.searching,
|
|
180
|
+
/**
|
|
181
|
+
* If enabled, dropdown will display non-selectable, static categories
|
|
182
|
+
*/
|
|
183
|
+
staticCategories: { type: Boolean, default: !1 },
|
|
184
|
+
/**
|
|
185
|
+
* Reference to the DOM element or Vue component for positioning
|
|
186
|
+
* the Dropdown container.
|
|
187
|
+
*/
|
|
188
|
+
targetElement: { type: xe.props.targetElement.type, required: !0 },
|
|
189
|
+
/**
|
|
190
|
+
* Enables virtual scrolling if set to true or by providing an object with itemHeight function.
|
|
191
|
+
* The itemHeight function is used to calculate the height of rendered item given it's index.
|
|
192
|
+
*/
|
|
193
|
+
virtualScroll: {
|
|
194
|
+
type: [Boolean, Object],
|
|
195
|
+
default: !1
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
setup(a, { expose: r, emit: i }) {
|
|
199
|
+
const o = $e(), n = i, l = a, { selectedValue: e, multiple: c } = Me(l), v = C(null), { t: L } = Le({ messages: we }), u = d(() => l.open && !l.disabled), h = d(() => L("noOptionsMatchThisSearch")), g = d(() => ({
|
|
200
|
+
"b-dropdown-options-container--single": !(l != null && l.multiple)
|
|
201
|
+
})), p = d(() => ({
|
|
202
|
+
"b-dropdown-options-container__listbox--single": !(l != null && l.multiple)
|
|
203
|
+
})), { actions: O, internalSelectedValue: m, listeners: B, onEscapeKey: D, onOutsideDropdownClick: b } = Ct(e, c, u, n), w = d(() => l != null && l.multiple ? Et : xe), _ = d(() => {
|
|
204
|
+
var T;
|
|
205
|
+
const A = {
|
|
206
|
+
"min-width": `${(T = l == null ? void 0 : l.targetElement) == null ? void 0 : T.clientWidth}px`,
|
|
207
|
+
"max-width": "min(500px, 95%)"
|
|
208
|
+
};
|
|
209
|
+
return l != null && l.multiple ? {
|
|
210
|
+
actionsLayout: "space-between",
|
|
211
|
+
ariaLabel: l.ariaLabel,
|
|
212
|
+
actions: O.value,
|
|
213
|
+
divider: !0,
|
|
214
|
+
fallbackPosition: ["top-start"],
|
|
215
|
+
id: J(`dropdown-options-${l.id}`),
|
|
216
|
+
open: l.open,
|
|
217
|
+
position: "bottom-start",
|
|
218
|
+
style: {
|
|
219
|
+
width: "auto",
|
|
220
|
+
...A
|
|
221
|
+
},
|
|
222
|
+
targetElement: l.targetElement
|
|
223
|
+
} : {
|
|
224
|
+
fallbackPosition: ["top-start"],
|
|
225
|
+
offset: [0, 8],
|
|
226
|
+
position: "bottom-start",
|
|
227
|
+
style: {
|
|
228
|
+
display: u.value ? "block" : "none",
|
|
229
|
+
...A
|
|
230
|
+
},
|
|
231
|
+
targetElement: l.targetElement
|
|
232
|
+
};
|
|
233
|
+
});
|
|
234
|
+
return r({
|
|
235
|
+
onOutsideDropdownClick: b
|
|
236
|
+
}), (A, T) => (S(), K(Re(w.value), P({
|
|
237
|
+
class: ["b-dropdown-options-container", g.value]
|
|
238
|
+
}, _.value), {
|
|
239
|
+
default: V(() => [
|
|
240
|
+
ae("div", {
|
|
241
|
+
onKeydown: T[0] || (T[0] = nt(
|
|
242
|
+
//@ts-ignore
|
|
243
|
+
(...q) => s(D) && s(D)(...q),
|
|
244
|
+
["esc"]
|
|
245
|
+
))
|
|
246
|
+
}, [
|
|
247
|
+
X(s(be), P({
|
|
248
|
+
id: a.id,
|
|
249
|
+
ref_key: "dropdownOptionsListboxRef",
|
|
250
|
+
ref: v,
|
|
251
|
+
"aria-label": a.ariaLabel,
|
|
252
|
+
class: ["b-dropdown-options-container__listbox", p.value],
|
|
253
|
+
"component-loading": a.componentLoading,
|
|
254
|
+
"empty-state": a.emptyState,
|
|
255
|
+
"is-option-disabled": a.isOptionDisabled,
|
|
256
|
+
items: a.items,
|
|
257
|
+
"selected-value": s(m),
|
|
258
|
+
multiple: s(c),
|
|
259
|
+
"static-categories": a.staticCategories,
|
|
260
|
+
"no-results-message": h.value,
|
|
261
|
+
searching: a.searching,
|
|
262
|
+
loading: a.loading,
|
|
263
|
+
"lazy-load-type": a.lazyLoadType,
|
|
264
|
+
"has-more-items": a.hasMoreItems,
|
|
265
|
+
"virtual-scroll": a.virtualScroll
|
|
266
|
+
}, te(s(B))), pe({ _: 2 }, [
|
|
267
|
+
fe(s(o), (q, y) => ({
|
|
268
|
+
name: y,
|
|
269
|
+
fn: V((E) => [
|
|
270
|
+
G(A.$slots, y, me(ve(E)), void 0, !0)
|
|
271
|
+
])
|
|
272
|
+
}))
|
|
273
|
+
]), 1040, ["id", "aria-label", "class", "component-loading", "empty-state", "is-option-disabled", "items", "selected-value", "multiple", "static-categories", "no-results-message", "searching", "loading", "lazy-load-type", "has-more-items", "virtual-scroll"])
|
|
274
|
+
], 32)
|
|
275
|
+
]),
|
|
276
|
+
_: 3
|
|
277
|
+
}, 16, ["class"]));
|
|
278
|
+
}
|
|
279
|
+
}), Dt = /* @__PURE__ */ Y(Bt, [["__scopeId", "data-v-d87d28cd"]]);
|
|
280
|
+
let Ne = 0;
|
|
281
|
+
const Tt = {
|
|
282
|
+
beforeCreate() {
|
|
283
|
+
this.uuid = Ne.toString(), Ne += 1;
|
|
284
|
+
}
|
|
285
|
+
}, It = { key: 0 };
|
|
286
|
+
function xt(a, r, i, o, n, l) {
|
|
287
|
+
return S(), k("svg", P({ role: "img" }, a.$attrs, {
|
|
288
|
+
class: "ui-assets-icons-16",
|
|
289
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
290
|
+
width: "16",
|
|
291
|
+
height: "16",
|
|
292
|
+
fill: "none"
|
|
293
|
+
}), [
|
|
294
|
+
a.$attrs["svg-title"] ? (S(), k("title", It, he(a.$attrs["svg-title"]), 1)) : z("", !0),
|
|
295
|
+
r[0] || (r[0] = ae("path", {
|
|
296
|
+
fill: "#001222",
|
|
297
|
+
d: "M5.00011 5.43922L8.00011 8.43922L11.0001 5.43922L12.0608 6.49988L8.00011 10.5605L3.93945 6.49988L5.00011 5.43922Z"
|
|
298
|
+
}, null, -1))
|
|
299
|
+
], 16);
|
|
300
|
+
}
|
|
301
|
+
const Nt = /* @__PURE__ */ Y(Tt, [["render", xt]]);
|
|
302
|
+
let Ae = 0;
|
|
303
|
+
const At = {
|
|
304
|
+
beforeCreate() {
|
|
305
|
+
this.uuid = Ae.toString(), Ae += 1;
|
|
306
|
+
}
|
|
307
|
+
}, $t = { key: 0 };
|
|
308
|
+
function Mt(a, r, i, o, n, l) {
|
|
309
|
+
return S(), k("svg", P({ role: "img" }, a.$attrs, {
|
|
310
|
+
class: "ui-assets-icons-16",
|
|
311
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
312
|
+
width: "16",
|
|
313
|
+
height: "16",
|
|
314
|
+
fill: "none"
|
|
315
|
+
}), [
|
|
316
|
+
a.$attrs["svg-title"] ? (S(), k("title", $t, he(a.$attrs["svg-title"]), 1)) : z("", !0),
|
|
317
|
+
r[0] || (r[0] = ae("path", {
|
|
318
|
+
fill: "#001222",
|
|
319
|
+
d: "M10.9999 10.5608L7.9999 7.56077L4.9999 10.5608L3.93924 9.50011L7.9999 5.43945L12.0606 9.50011L10.9999 10.5608Z"
|
|
320
|
+
}, null, -1))
|
|
321
|
+
], 16);
|
|
322
|
+
}
|
|
323
|
+
const Rt = /* @__PURE__ */ Y(At, [["render", Mt]]), Pt = { class: "b-dropdown-small-textbox__chevron" }, kt = W({
|
|
324
|
+
name: "dropdown-small-textbox",
|
|
325
|
+
inheritAttrs: !1
|
|
326
|
+
}), _t = /* @__PURE__ */ W({
|
|
327
|
+
...kt,
|
|
328
|
+
props: {
|
|
329
|
+
/**
|
|
330
|
+
* The number of additional items that have been selected in the dropdown.
|
|
331
|
+
*/
|
|
332
|
+
additionalItemsSelected: { type: [Number, String], default: 0 },
|
|
333
|
+
/**
|
|
334
|
+
* Sets the aria-controls attribute on the textbox. This should correspond to the popover's id that the textbox triggers.
|
|
335
|
+
*/
|
|
336
|
+
ariaControls: { type: String, required: !0 },
|
|
337
|
+
/**
|
|
338
|
+
* 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.
|
|
339
|
+
*/
|
|
340
|
+
ariaExpanded: {
|
|
341
|
+
type: [String, Boolean],
|
|
342
|
+
required: !0
|
|
343
|
+
},
|
|
344
|
+
/**
|
|
345
|
+
* If no label element is used then the aria-label is be set should be set.
|
|
346
|
+
*/
|
|
347
|
+
ariaLabel: { type: String, default: null },
|
|
348
|
+
/**
|
|
349
|
+
* Corresponds to the label's id that labels the textbox element.
|
|
350
|
+
*/
|
|
351
|
+
ariaLabelledby: { type: String, default: null },
|
|
352
|
+
/**
|
|
353
|
+
* Custom debounce time. Default: 300
|
|
354
|
+
*/
|
|
355
|
+
debounceTime: { type: Number, default: 300 },
|
|
356
|
+
/**
|
|
357
|
+
* Disables any textbox functionality
|
|
358
|
+
*/
|
|
359
|
+
disabled: { type: Boolean, default: !1 },
|
|
360
|
+
/**
|
|
361
|
+
* Selected option's label
|
|
362
|
+
*/
|
|
363
|
+
displayValue: { type: String, default: null },
|
|
364
|
+
/**
|
|
365
|
+
* Sets the possibility to type into the textbox
|
|
366
|
+
*/
|
|
367
|
+
dynamicFiltering: { type: Boolean, default: !1 },
|
|
368
|
+
/**
|
|
369
|
+
* Marks the textbox as invalid, rendering an error state
|
|
370
|
+
*/
|
|
371
|
+
isInvalid: { type: Boolean, default: !1 },
|
|
372
|
+
/**
|
|
373
|
+
* Indicates if the dropdown is open so that
|
|
374
|
+
* the respective event can be emitted
|
|
375
|
+
*/
|
|
376
|
+
open: { type: Boolean, default: !1 },
|
|
377
|
+
/**
|
|
378
|
+
* Sets the dropdown to readonly state
|
|
379
|
+
*/
|
|
380
|
+
readonly: { type: Boolean, default: !1 },
|
|
381
|
+
/**
|
|
382
|
+
* The input value
|
|
383
|
+
*/
|
|
384
|
+
value: { type: String, default: "" }
|
|
385
|
+
},
|
|
386
|
+
emits: ["clear", "close", "input", "keydown", "open"],
|
|
387
|
+
setup(a, { expose: r, emit: i }) {
|
|
388
|
+
const o = i, n = a, l = C(null), e = d(() => ({
|
|
389
|
+
[`b-dropdown-small-textbox--${ue.DISABLED}`]: n.disabled,
|
|
390
|
+
[`b-dropdown-small-textbox--${ue.READONLY}`]: n.readonly,
|
|
391
|
+
[`b-dropdown-small-textbox--${ue.OPENED}`]: n.open
|
|
392
|
+
})), c = d(() => n.open && !n.disabled && !n.readonly), v = (m) => {
|
|
393
|
+
o("input", m);
|
|
394
|
+
}, L = (m) => {
|
|
395
|
+
o("keydown", m);
|
|
396
|
+
}, u = (m) => {
|
|
397
|
+
ce(m), o("open");
|
|
398
|
+
}, h = (m) => {
|
|
399
|
+
ce(m), o("close");
|
|
400
|
+
}, g = (m) => {
|
|
401
|
+
ce(m), o("clear");
|
|
402
|
+
}, p = {
|
|
403
|
+
[H.INPUT]: v,
|
|
404
|
+
[H.OPEN]: u,
|
|
405
|
+
[H.CLOSE]: h,
|
|
406
|
+
[H.CLEAR]: g,
|
|
407
|
+
[H.KEYDOWN]: L
|
|
408
|
+
};
|
|
409
|
+
return r({
|
|
410
|
+
focus: () => {
|
|
411
|
+
l.value.focus();
|
|
412
|
+
}
|
|
413
|
+
}), (m, B) => (S(), k("div", {
|
|
414
|
+
class: ye(["b-dropdown-small-textbox", e.value])
|
|
415
|
+
}, [
|
|
416
|
+
X(ut, P({
|
|
417
|
+
ref_key: "baseTextbox",
|
|
418
|
+
ref: l
|
|
419
|
+
}, { ...m.$attrs, ...m.$props }, {
|
|
420
|
+
class: "b-dropdown-small-textbox__textbox",
|
|
421
|
+
size: s(ee).SMALL
|
|
422
|
+
}, te(p)), {
|
|
423
|
+
icon: V(() => [
|
|
424
|
+
ae("div", Pt, [
|
|
425
|
+
oe(X(s(Rt), { "svg-title": "opened" }, null, 512), [
|
|
426
|
+
[Te, c.value]
|
|
427
|
+
]),
|
|
428
|
+
oe(X(s(Nt), { "svg-title": "closed" }, null, 512), [
|
|
429
|
+
[Te, !c.value]
|
|
430
|
+
])
|
|
431
|
+
])
|
|
432
|
+
]),
|
|
433
|
+
_: 1
|
|
434
|
+
}, 16, ["size"])
|
|
435
|
+
], 2));
|
|
436
|
+
}
|
|
437
|
+
}), Ft = /* @__PURE__ */ Y(_t, [["__scopeId", "data-v-890ca00e"]]), Kt = (a, r) => r.value.reduce((i, o) => {
|
|
438
|
+
if (o.items) {
|
|
439
|
+
const n = o.items.filter(
|
|
440
|
+
(e) => a.value.find((c) => c.value === e.value)
|
|
441
|
+
);
|
|
442
|
+
n.length === o.items.length ? i.push(o.displayValue ?? o.label) : n.forEach(({ label: e, displayValue: c }) => i.push(c ?? e));
|
|
443
|
+
}
|
|
444
|
+
return a.value.find((n) => n.value === o.value) && i.push(o.displayValue ?? o.label), i;
|
|
445
|
+
}, []).join(", "), zt = ({ items: a, placeholder: r, selectedValues: i, isMultiSelect: o }) => {
|
|
446
|
+
const n = d(
|
|
447
|
+
() => o.value && a.value.find((e) => {
|
|
448
|
+
var c;
|
|
449
|
+
return (c = e.items) == null ? void 0 : c.length;
|
|
450
|
+
})
|
|
451
|
+
);
|
|
452
|
+
return d(() => i.value.length ? n.value ? Kt(i, a) : i.value.map(({ label: e, displayValue: c }) => c ?? e).join(", ") : r.value || null);
|
|
453
|
+
}, Pe = (a) => {
|
|
454
|
+
var r;
|
|
455
|
+
(r = a.value.$children) == null || r[0].$refs.textbox.focus();
|
|
456
|
+
}, Vt = ({
|
|
457
|
+
inputContainerRef: a,
|
|
458
|
+
optionsContainerRef: r,
|
|
459
|
+
selectedValueIndex: i,
|
|
460
|
+
isDropdownOpen: o,
|
|
461
|
+
isDynamicFltering: n,
|
|
462
|
+
items: l,
|
|
463
|
+
isMultiple: e
|
|
464
|
+
}, c, v, L) => {
|
|
465
|
+
const u = async (y) => {
|
|
466
|
+
var E;
|
|
467
|
+
n.value && await N(), (E = l.value[y]) == null || E.focus();
|
|
468
|
+
}, h = async (y) => {
|
|
469
|
+
var M, Z;
|
|
470
|
+
n.value && await N();
|
|
471
|
+
const E = (M = r.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef) == null ? void 0 : M.$el.querySelectorAll(
|
|
472
|
+
"button"
|
|
473
|
+
);
|
|
474
|
+
E.length ? (Z = E[y]) == null || Z.focus() : u(y);
|
|
475
|
+
}, g = (y) => {
|
|
476
|
+
var E;
|
|
477
|
+
return (E = r.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef) == null ? void 0 : E.setListboxFocusedIndex(
|
|
478
|
+
y
|
|
479
|
+
);
|
|
480
|
+
}, p = () => {
|
|
481
|
+
o.value || v(), N(() => {
|
|
482
|
+
g(0), u(0);
|
|
483
|
+
});
|
|
484
|
+
}, O = () => {
|
|
485
|
+
o.value || v(), N(() => {
|
|
486
|
+
g(l.value.length - 1), u(l.value.length - 1);
|
|
487
|
+
});
|
|
488
|
+
}, m = ({ detail: y }) => {
|
|
489
|
+
y.preventDefault(), p();
|
|
490
|
+
}, B = ({ detail: y }) => {
|
|
491
|
+
y.preventDefault(), O();
|
|
492
|
+
}, D = () => {
|
|
493
|
+
p();
|
|
494
|
+
}, b = () => {
|
|
495
|
+
O();
|
|
496
|
+
}, w = ({ detail: y }) => {
|
|
497
|
+
y.preventDefault(), c(), o.value && N(() => {
|
|
498
|
+
e ? h(0) : (g(i.value), u(i.value));
|
|
499
|
+
});
|
|
500
|
+
}, _ = ({ detail: y }) => {
|
|
501
|
+
y.preventDefault(), c(), o.value && N(() => {
|
|
502
|
+
e ? h(0) : (g(i.value), u(i.value));
|
|
503
|
+
});
|
|
504
|
+
}, A = () => {
|
|
505
|
+
o.value && L();
|
|
506
|
+
}, T = () => {
|
|
507
|
+
o.value && (L(), Pe(a));
|
|
508
|
+
};
|
|
509
|
+
return d(() => ({
|
|
510
|
+
[$.ARROW_DOWN]: m,
|
|
511
|
+
[$.ARROW_UP]: B,
|
|
512
|
+
[$.HOME]: D,
|
|
513
|
+
[$.END]: b,
|
|
514
|
+
...n.value ? {} : { [$.SPACE]: w },
|
|
515
|
+
[$.ENTER]: _,
|
|
516
|
+
[$.TAB]: A,
|
|
517
|
+
[$.ESCAPE]: T
|
|
518
|
+
}));
|
|
519
|
+
}, Wt = ({ inputContainerRef: a, isDropdownOpen: r }, i) => {
|
|
520
|
+
const o = () => {
|
|
521
|
+
r.value && i(), N(() => {
|
|
522
|
+
Pe(a);
|
|
523
|
+
});
|
|
524
|
+
};
|
|
525
|
+
return {
|
|
526
|
+
[f.ENTER]: o,
|
|
527
|
+
[f.ESCAPE]: o,
|
|
528
|
+
[f.TAB]: o,
|
|
529
|
+
[f.SPACE]: o
|
|
530
|
+
};
|
|
531
|
+
};
|
|
532
|
+
function qt(a, r, i, o) {
|
|
533
|
+
const n = C(a), l = C(r), e = (v, L = []) => L.flatMap((u) => u.label.toLocaleLowerCase().includes(v) ? o != null && o.value && u.items ? [...e(v, u.items)] : [u, ...e(v, u.items)] : u.items ? [...e(v, u.items)] : []);
|
|
534
|
+
return ge(n, () => {
|
|
535
|
+
i !== void 0 && i(n.value);
|
|
536
|
+
}), d(() => {
|
|
537
|
+
if (!n.value || i !== void 0)
|
|
538
|
+
return l.value;
|
|
539
|
+
const v = n.value.toLocaleLowerCase();
|
|
540
|
+
return e(v, l.value);
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
const ke = {
|
|
544
|
+
"en-US": {
|
|
545
|
+
all: "All",
|
|
546
|
+
ariaLabelFallback: "Dropdown",
|
|
547
|
+
clearSearch: "Clear filter"
|
|
548
|
+
},
|
|
549
|
+
"ja-JP": {
|
|
550
|
+
all: "すべて",
|
|
551
|
+
clearFilter: "フィルターをクリア"
|
|
552
|
+
},
|
|
553
|
+
"pt-BR": {
|
|
554
|
+
all: "Todos",
|
|
555
|
+
clearFilter: "Limpar filtro"
|
|
556
|
+
}
|
|
557
|
+
}, Ut = Symbol("input field component injection key"), fo = Symbol("input field hint injection key"), mo = Symbol("input field parent component injection key"), jt = W({
|
|
558
|
+
i18n: { messages: ke },
|
|
559
|
+
name: "b-dropdown",
|
|
560
|
+
components: {
|
|
561
|
+
DropdownInputDefault: ct,
|
|
562
|
+
DropdownInputSmall: Ft
|
|
563
|
+
},
|
|
564
|
+
model: { prop: "modelValue" }
|
|
565
|
+
}), Ht = /* @__PURE__ */ W({
|
|
566
|
+
...jt,
|
|
567
|
+
props: {
|
|
568
|
+
ariaLabel: { default: null },
|
|
569
|
+
condensed: { type: Boolean, default: !1 },
|
|
570
|
+
emptyState: { default: void 0 },
|
|
571
|
+
dynamicFiltering: { type: Boolean, default: !1 },
|
|
572
|
+
error: { type: Boolean, default: !1 },
|
|
573
|
+
hasMoreItems: { type: Boolean, default: !1 },
|
|
574
|
+
isOptionDisabled: { type: Function, default: void 0 },
|
|
575
|
+
items: { default: () => [] },
|
|
576
|
+
loading: { type: Boolean, default: !1 },
|
|
577
|
+
componentLoading: { type: Boolean, default: !1 },
|
|
578
|
+
lazyLoadType: { default: be.props.lazyLoadType.default },
|
|
579
|
+
multiple: { type: Boolean, default: !1 },
|
|
580
|
+
search: { default: void 0 },
|
|
581
|
+
showSlotContentInMultiple: { type: Boolean, default: !1 },
|
|
582
|
+
size: { default: null },
|
|
583
|
+
staticCategories: { type: Boolean, default: !1 },
|
|
584
|
+
value: { default: null },
|
|
585
|
+
modelValue: { default: null },
|
|
586
|
+
virtualScroll: { type: [Boolean, Object], default: !1 },
|
|
587
|
+
enableValueLabelPair: { type: Boolean, default: !1 },
|
|
588
|
+
description: { default: null },
|
|
589
|
+
disabled: { type: Boolean, default: !1 },
|
|
590
|
+
errorMessage: { default: null },
|
|
591
|
+
label: { default: null },
|
|
592
|
+
optional: { type: Boolean, default: !1 },
|
|
593
|
+
placeholder: { default: null },
|
|
594
|
+
readonly: { type: Boolean, default: !1 },
|
|
595
|
+
required: { type: Boolean, default: !1 },
|
|
596
|
+
tooltipText: { default: null }
|
|
597
|
+
},
|
|
598
|
+
emits: ["input", "update:model-value", "show-more", "open"],
|
|
599
|
+
setup(a, { expose: r, emit: i }) {
|
|
600
|
+
var De;
|
|
601
|
+
const o = st(), n = $e(), l = Lt(n), e = a, c = i, { t: v } = Le({ messages: ke }), { emitValue: L } = ft(c), u = C(null), h = C(null), g = C(null), p = C(!1), O = J("bento-dropdown-options-container"), m = J("dropdown-label"), B = J("dropdown-description"), D = J("dropdown-error"), { isReadOnly: b } = bt(x(e, "readonly")), w = d(() => e.modelValue ?? e.value), { cachedSelectedListboxOptions: _, cachedListboxSelectedValues: A, setCachedValues: T } = mt(
|
|
602
|
+
x(e, "items"),
|
|
603
|
+
w,
|
|
604
|
+
x(e, "multiple"),
|
|
605
|
+
x(e, "enableValueLabelPair")
|
|
606
|
+
), q = C(o["aria-label"]), y = C(o["aria-describedby"]), { ariaLabel: E, label: M } = Me(e), Z = d(() => v("ariaLabelFallback")), Se = pt({
|
|
607
|
+
// TODO: take ariaLabel ref away when aria-label prop is removed
|
|
608
|
+
ariaLabel: E.value || q,
|
|
609
|
+
label: M,
|
|
610
|
+
defaultFallback: Z
|
|
611
|
+
}), Ee = e.size === ee.SMALL || it(Ut, !1), _e = d(() => Ee ? ee.SMALL : ee.DEFAULT), Fe = d(() => ({
|
|
612
|
+
"b-dropdown--condensed": e.condensed
|
|
613
|
+
})), Ke = d(() => ({
|
|
614
|
+
"b-dropdown__description--error": !!e.errorMessage
|
|
615
|
+
})), R = C(""), Q = x(e, "items"), Ce = x(e, "staticCategories"), le = qt(R, Q, (De = e == null ? void 0 : e.search) == null ? void 0 : De.searchEvent, Ce), ne = d(() => e.dynamicFiltering && !!R.value), ze = zt({
|
|
616
|
+
items: Q,
|
|
617
|
+
placeholder: x(e, "placeholder"),
|
|
618
|
+
isMultiSelect: x(e, "multiple"),
|
|
619
|
+
selectedValues: _
|
|
620
|
+
}), Ve = d(() => {
|
|
621
|
+
if (e != null && e.multiple && Array.isArray(w.value))
|
|
622
|
+
return e.items.filter(
|
|
623
|
+
({ value: t }) => (e == null ? void 0 : e.value) && (e == null ? void 0 : e.value).includes(t)
|
|
624
|
+
);
|
|
625
|
+
if (!e.multiple && e.staticCategories) {
|
|
626
|
+
const t = e.items.find(
|
|
627
|
+
(F) => F.items.some((U) => U.value === w.value)
|
|
628
|
+
);
|
|
629
|
+
return t ? t.items.find((F) => F.value === w.value) : null;
|
|
630
|
+
}
|
|
631
|
+
return e.items.find(({ value: t }) => t === w.value);
|
|
632
|
+
}), We = d(() => {
|
|
633
|
+
const t = le.value.findIndex(({ value: I }) => e.enableValueLabelPair ? w.value.value === I : w.value === I);
|
|
634
|
+
return t > -1 ? t : 0;
|
|
635
|
+
}), { isMultiLevelSelect: Oe, flattenedItemsList: qe } = vt(Q), Ue = d(() => Oe.value && !e.staticCategories), je = d(() => Ue.value ? "treeitem" : "option"), He = d(() => {
|
|
636
|
+
if (e.multiple) {
|
|
637
|
+
const t = Array.isArray(w.value) ? w.value.length : 0, I = Oe.value ? qe.value.length : Q.value.length;
|
|
638
|
+
return t === 0 ? null : !e.hasMoreItems && I > 0 && I === t ? v("all") : t;
|
|
639
|
+
}
|
|
640
|
+
return null;
|
|
641
|
+
}), Je = d(
|
|
642
|
+
() => [
|
|
643
|
+
e.description ? B : null,
|
|
644
|
+
y.value,
|
|
645
|
+
e.errorMessage ? D : null
|
|
646
|
+
].filter(Boolean).join(" ") || null
|
|
647
|
+
), Ye = d(() => {
|
|
648
|
+
var t;
|
|
649
|
+
return (t = g.value) == null ? void 0 : t.$el;
|
|
650
|
+
}), { visibleDomOptions: Ze, updateVisibleDomOptions: Be } = yt(
|
|
651
|
+
Ye,
|
|
652
|
+
le,
|
|
653
|
+
je
|
|
654
|
+
), Qe = () => {
|
|
655
|
+
b.value || (p.value = !0, N(() => {
|
|
656
|
+
Be();
|
|
657
|
+
}));
|
|
658
|
+
}, se = () => {
|
|
659
|
+
p.value = !1;
|
|
660
|
+
}, ie = () => {
|
|
661
|
+
b.value || (p.value = !p.value, N(() => {
|
|
662
|
+
Be();
|
|
663
|
+
}), ne.value && (R.value = ""));
|
|
664
|
+
}, Xe = () => {
|
|
665
|
+
ne.value && (R.value = ""), p.value && (p.value = !1, g.value.onOutsideDropdownClick());
|
|
666
|
+
}, Ge = (t) => {
|
|
667
|
+
e.multiple || (R.value = "", p.value = !1), T(t), L(A.value);
|
|
668
|
+
}, et = () => {
|
|
669
|
+
c(f.SHOW_MORE);
|
|
670
|
+
}, tt = Vt(
|
|
671
|
+
{
|
|
672
|
+
inputContainerRef: u,
|
|
673
|
+
optionsContainerRef: g,
|
|
674
|
+
selectedValueIndex: We,
|
|
675
|
+
isDropdownOpen: p,
|
|
676
|
+
isDynamicFltering: x(e, "dynamicFiltering"),
|
|
677
|
+
items: Ze,
|
|
678
|
+
isMultiple: e.multiple
|
|
679
|
+
},
|
|
680
|
+
ie,
|
|
681
|
+
Qe,
|
|
682
|
+
se
|
|
683
|
+
), ot = Wt(
|
|
684
|
+
{
|
|
685
|
+
inputContainerRef: u,
|
|
686
|
+
isDropdownOpen: p
|
|
687
|
+
},
|
|
688
|
+
se
|
|
689
|
+
), at = {
|
|
690
|
+
[f.CLOSE_DROPDOWN]: se,
|
|
691
|
+
[f.SELECT]: Ge,
|
|
692
|
+
[f.SHOW_MORE]: et,
|
|
693
|
+
...ot
|
|
694
|
+
};
|
|
695
|
+
e.error && de(
|
|
696
|
+
'BentoDropdown "error" property',
|
|
697
|
+
`Use the BentoDropdown "errorMessage" property instead to indicate that there is a modifier error.
|
|
698
|
+
Having the field as "undefined" will hide/remove the error.
|
|
699
|
+
<bento-dropdown errorMessage="Error message text" />`,
|
|
700
|
+
"2.0.0"
|
|
701
|
+
), e.size && de('BentoDropdown "size" property', "Do not use. Only 'default' size should be used.", "2.0.0"), e.value && de(
|
|
702
|
+
'BentoDropdown "value" property',
|
|
703
|
+
`The use of "value" prop in "BentoDropdown" is no longer supported.
|
|
704
|
+
Use the "v-model" or "model-value" property instead.`,
|
|
705
|
+
"2.0.0"
|
|
706
|
+
);
|
|
707
|
+
const lt = () => {
|
|
708
|
+
u.value.focus();
|
|
709
|
+
};
|
|
710
|
+
return ge(
|
|
711
|
+
() => p.value,
|
|
712
|
+
(t) => {
|
|
713
|
+
t && c("open");
|
|
714
|
+
}
|
|
715
|
+
), r({
|
|
716
|
+
focus: lt
|
|
717
|
+
}), (t, I) => {
|
|
718
|
+
var F;
|
|
719
|
+
return oe((S(), k("div", {
|
|
720
|
+
class: ye(["b-dropdown", Fe.value])
|
|
721
|
+
}, [
|
|
722
|
+
s(M) ? (S(), K(s(wt), {
|
|
723
|
+
key: 0,
|
|
724
|
+
id: s(m),
|
|
725
|
+
condensed: t.condensed,
|
|
726
|
+
label: s(M),
|
|
727
|
+
"tooltip-text": t.tooltipText,
|
|
728
|
+
optional: t.optional,
|
|
729
|
+
required: t.required
|
|
730
|
+
}, null, 8, ["id", "condensed", "label", "tooltip-text", "optional", "required"])) : z("", !0),
|
|
731
|
+
oe((S(), k("div", P({
|
|
732
|
+
ref_key: "inputContainerRefWrapper",
|
|
733
|
+
ref: h
|
|
734
|
+
}, te(s(tt), !0)), [
|
|
735
|
+
(S(), K(Re(_e.value), {
|
|
736
|
+
ref_key: "inputContainerRef",
|
|
737
|
+
ref: u,
|
|
738
|
+
condensed: t.condensed,
|
|
739
|
+
value: R.value,
|
|
740
|
+
"additional-items-selected": He.value,
|
|
741
|
+
"aria-controls": s(O),
|
|
742
|
+
ariaExpanded: p.value,
|
|
743
|
+
"aria-labelledby": s(M) ? s(m) : null,
|
|
744
|
+
"aria-describedby": Je.value,
|
|
745
|
+
"aria-label": s(Se),
|
|
746
|
+
"aria-readonly": s(b),
|
|
747
|
+
readonly: s(b),
|
|
748
|
+
required: t.required,
|
|
749
|
+
disabled: t.disabled,
|
|
750
|
+
"display-value": s(ze),
|
|
751
|
+
"dynamic-filtering": t.dynamicFiltering,
|
|
752
|
+
"is-invalid": !!t.errorMessage || t.error,
|
|
753
|
+
multiple: t.multiple,
|
|
754
|
+
open: p.value,
|
|
755
|
+
"selected-value-item": s(Ee) ? void 0 : Ve.value,
|
|
756
|
+
"show-slot-content-in-multiple": t.showSlotContentInMultiple,
|
|
757
|
+
onInput: I[0] || (I[0] = (U) => R.value = U),
|
|
758
|
+
onOpen: ie,
|
|
759
|
+
onClose: ie
|
|
760
|
+
}, pe({ _: 2 }, [
|
|
761
|
+
fe(s(n), (U, j) => ({
|
|
762
|
+
name: j,
|
|
763
|
+
fn: V((re) => [
|
|
764
|
+
G(t.$slots, j, me(ve(re)), void 0, !0)
|
|
765
|
+
])
|
|
766
|
+
}))
|
|
767
|
+
]), 1064, ["condensed", "value", "additional-items-selected", "aria-controls", "ariaExpanded", "aria-labelledby", "aria-describedby", "aria-label", "aria-readonly", "readonly", "required", "disabled", "display-value", "dynamic-filtering", "is-invalid", "multiple", "open", "selected-value-item", "show-slot-content-in-multiple"]))
|
|
768
|
+
], 16)), [
|
|
769
|
+
[s(ht)]
|
|
770
|
+
]),
|
|
771
|
+
u.value ? (S(), K(s(Dt), P({
|
|
772
|
+
key: 1,
|
|
773
|
+
id: s(O),
|
|
774
|
+
ref_key: "optionsContainerRef",
|
|
775
|
+
ref: g,
|
|
776
|
+
"aria-label": s(Se),
|
|
777
|
+
"component-loading": t.componentLoading,
|
|
778
|
+
"empty-state": t.emptyState,
|
|
779
|
+
"debounce-time": (F = t.search) == null ? void 0 : F.debounceTime,
|
|
780
|
+
disabled: t.disabled,
|
|
781
|
+
"is-option-disabled": t.isOptionDisabled,
|
|
782
|
+
items: s(le),
|
|
783
|
+
multiple: t.multiple,
|
|
784
|
+
"static-categories": Ce.value,
|
|
785
|
+
open: p.value,
|
|
786
|
+
"selected-value": s(_),
|
|
787
|
+
searching: ne.value,
|
|
788
|
+
"target-element": h.value,
|
|
789
|
+
loading: t.loading,
|
|
790
|
+
"has-more-items": t.hasMoreItems,
|
|
791
|
+
"lazy-load-type": t.lazyLoadType,
|
|
792
|
+
"virtual-scroll": t.virtualScroll
|
|
793
|
+
}, te(at)), pe({ _: 2 }, [
|
|
794
|
+
fe(s(n), (U, j) => ({
|
|
795
|
+
name: j,
|
|
796
|
+
fn: V((re) => [
|
|
797
|
+
G(t.$slots, j, me(ve(re)), void 0, !0)
|
|
798
|
+
])
|
|
799
|
+
}))
|
|
800
|
+
]), 1040, ["id", "aria-label", "component-loading", "empty-state", "debounce-time", "disabled", "is-option-disabled", "items", "multiple", "static-categories", "open", "selected-value", "searching", "target-element", "loading", "has-more-items", "lazy-load-type", "virtual-scroll"])) : z("", !0),
|
|
801
|
+
t.errorMessage ? (S(), K(s(St), {
|
|
802
|
+
key: 2,
|
|
803
|
+
id: s(D),
|
|
804
|
+
"error-message": t.errorMessage,
|
|
805
|
+
class: "b-dropdown__error-message"
|
|
806
|
+
}, null, 8, ["id", "error-message"])) : z("", !0),
|
|
807
|
+
t.description || s(l)("description") ? (S(), K(s(dt), {
|
|
808
|
+
key: 3,
|
|
809
|
+
id: s(B),
|
|
810
|
+
class: ye(["b-dropdown__description", Ke.value]),
|
|
811
|
+
el: "span"
|
|
812
|
+
}, {
|
|
813
|
+
default: V(() => [
|
|
814
|
+
G(t.$slots, "description", {}, () => [
|
|
815
|
+
rt(he(t.description), 1)
|
|
816
|
+
], !0)
|
|
817
|
+
]),
|
|
818
|
+
_: 3
|
|
819
|
+
}, 8, ["id", "class"])) : z("", !0)
|
|
820
|
+
], 2)), [
|
|
821
|
+
[s(gt), Xe]
|
|
822
|
+
]);
|
|
823
|
+
};
|
|
824
|
+
}
|
|
825
|
+
}), vo = /* @__PURE__ */ Y(Ht, [["__scopeId", "data-v-019c4bce"]]);
|
|
826
|
+
export {
|
|
827
|
+
vo as B,
|
|
828
|
+
fo as I,
|
|
829
|
+
Ut as a,
|
|
830
|
+
mo as b,
|
|
831
|
+
qt as u
|
|
832
|
+
};
|
|
833
|
+
//# sourceMappingURL=dropdown.DYDHM__3.js.map
|