@adyen/bento-vue2 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 +300 -35
- 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.CtNVRcmP.js → checkbox-group.C3RH5Gcg.js} +2 -2
- package/dist/chunks/{checkbox-group.CtNVRcmP.js.map → checkbox-group.C3RH5Gcg.js.map} +1 -1
- package/dist/chunks/{checkbox.nyUc0gLb.js → checkbox.itbBlXev.js} +3 -3
- package/dist/chunks/{checkbox.nyUc0gLb.js.map → checkbox.itbBlXev.js.map} +1 -1
- package/dist/chunks/{code-snippet.DFf3KMSi.js → code-snippet.BEbA1bIn.js} +2 -2
- package/dist/chunks/{code-snippet.DFf3KMSi.js.map → code-snippet.BEbA1bIn.js.map} +1 -1
- package/dist/chunks/{currency.AvvbekWO.js → currency.Cwhzzxw2.js} +2 -2
- package/dist/chunks/{currency.AvvbekWO.js.map → currency.Cwhzzxw2.js.map} +1 -1
- package/dist/chunks/{data-grid.C07AmPwV.js → data-grid.B-kBw540.js} +7 -7
- package/dist/chunks/{data-grid.C07AmPwV.js.map → data-grid.B-kBw540.js.map} +1 -1
- package/dist/chunks/date-picker.CKaQJcPa.js +168 -0
- package/dist/chunks/date-picker.CKaQJcPa.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.BtPxkPN0.js +942 -0
- package/dist/chunks/date-range-picker.BtPxkPN0.js.map +1 -0
- package/dist/chunks/{dropdown-default-textbox.yLeN0E2z.js → dropdown-default-textbox.BCOVaw-a.js} +10 -10
- package/dist/chunks/dropdown-default-textbox.BCOVaw-a.js.map +1 -0
- package/dist/chunks/dropdown-tag.BXMgDH3v.js +294 -0
- package/dist/chunks/dropdown-tag.BXMgDH3v.js.map +1 -0
- package/dist/chunks/{dropdown.RxD2TqnP.js → dropdown.-3x2IBDg.js} +305 -297
- package/dist/chunks/{dropdown.RxD2TqnP.js.map → dropdown.-3x2IBDg.js.map} +1 -1
- package/dist/chunks/es6.MoTTyETW.js.map +1 -1
- package/dist/chunks/{file-uploader.BGoCYrnw.js → file-uploader.BkTtqgvQ.js} +296 -295
- package/dist/chunks/{file-uploader.BGoCYrnw.js.map → file-uploader.BkTtqgvQ.js.map} +1 -1
- package/dist/chunks/{filter-bar.DVqgwt2p.js → filter-bar.BLnSnOlj.js} +201 -201
- package/dist/chunks/filter-bar.BLnSnOlj.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.Bjb9dTSV.js +12 -0
- package/dist/chunks/get-slot-text.Bjb9dTSV.js.map +1 -0
- package/dist/chunks/{header-with-views.jnhILkoQ.js → header-with-views.C6Y7mAkq.js} +3 -3
- package/dist/chunks/{header-with-views.jnhILkoQ.js.map → header-with-views.C6Y7mAkq.js.map} +1 -1
- package/dist/chunks/{input-field-password.CHn2GUcL.js → input-field-password.sthICA2L.js} +3 -3
- package/dist/chunks/{input-field-password.CHn2GUcL.js.map → input-field-password.sthICA2L.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.CpnfVw6w.js → input-field-phone-number.BjinuvOl.js} +5 -5
- package/dist/chunks/{input-field-phone-number.CpnfVw6w.js.map → input-field-phone-number.BjinuvOl.js.map} +1 -1
- package/dist/chunks/{input-field.sGmuIXiw.js → input-field.CwKD3p3q.js} +34 -34
- package/dist/chunks/input-field.CwKD3p3q.js.map +1 -0
- package/dist/chunks/link.D8qpqg3W.js.map +1 -1
- package/dist/chunks/{listbox-option-tag.Dl8GwHLT.js → listbox-option-tag.DkPz3wPc.js} +2 -2
- package/dist/chunks/{listbox-option-tag.Dl8GwHLT.js.map → listbox-option-tag.DkPz3wPc.js.map} +1 -1
- package/dist/chunks/{pagination.C0YW_A_o.js → pagination.BzyyZJy6.js} +7 -7
- package/dist/chunks/pagination.BzyyZJy6.js.map +1 -0
- package/dist/chunks/{payment-method.DtvfUnit.js → payment-method.CcASYR3B.js} +12 -12
- package/dist/chunks/payment-method.CcASYR3B.js.map +1 -0
- package/dist/chunks/payment-method.types.BqtH7RM2.js.map +1 -1
- package/dist/chunks/{radio-group.AcYMFudv.js → radio-group.B8ukv-pw.js} +3 -3
- package/dist/chunks/{radio-group.AcYMFudv.js.map → radio-group.B8ukv-pw.js.map} +1 -1
- package/dist/chunks/{rich-text-editor.eYW8X_YP.js → rich-text-editor.DzH-Z5oi.js} +2 -2
- package/dist/chunks/{rich-text-editor.eYW8X_YP.js.map → rich-text-editor.DzH-Z5oi.js.map} +1 -1
- package/dist/chunks/{search-bar.D8SJsbze.js → search-bar.CgzPXP8r.js} +3 -3
- package/dist/chunks/{search-bar.D8SJsbze.js.map → search-bar.CgzPXP8r.js.map} +1 -1
- package/dist/chunks/{secondary-nav.BFiTQaag.js → secondary-nav.3eZKyb8K.js} +4 -4
- package/dist/chunks/secondary-nav.3eZKyb8K.js.map +1 -0
- package/dist/chunks/{summary-grid.types.B80533d1.js → summary-grid.types.CaYrtyVO.js} +2 -2
- package/dist/chunks/{summary-grid.types.B80533d1.js.map → summary-grid.types.CaYrtyVO.js.map} +1 -1
- package/dist/chunks/tag.BltIbSh3.js +44 -0
- package/dist/chunks/tag.BltIbSh3.js.map +1 -0
- package/dist/chunks/textarea.h-WF62HP.js +173 -0
- package/dist/chunks/textarea.h-WF62HP.js.map +1 -0
- package/dist/chunks/{timeline-item.CZBuknZ_.js → timeline-item.BLhS7uNF.js} +5 -5
- package/dist/chunks/timeline-item.BLhS7uNF.js.map +1 -0
- package/dist/chunks/{toggle.BJMXpHRu.js → toggle.D2wmNu7m.js} +2 -2
- package/dist/chunks/{toggle.BJMXpHRu.js.map → toggle.D2wmNu7m.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 +247 -246
- 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 +144 -6
- package/package.json +6 -6
- package/dist/chunks/date-picker.DImAYvoM.js +0 -158
- package/dist/chunks/date-picker.DImAYvoM.js.map +0 -1
- package/dist/chunks/date-range-picker.NAG_5i8I.js +0 -914
- package/dist/chunks/date-range-picker.NAG_5i8I.js.map +0 -1
- package/dist/chunks/dropdown-default-textbox.yLeN0E2z.js.map +0 -1
- package/dist/chunks/dropdown-tag.CpvU8eSZ.js +0 -260
- package/dist/chunks/dropdown-tag.CpvU8eSZ.js.map +0 -1
- package/dist/chunks/filter-bar.DVqgwt2p.js.map +0 -1
- package/dist/chunks/get-slot-text.BQS5Olxm.js +0 -12
- package/dist/chunks/get-slot-text.BQS5Olxm.js.map +0 -1
- package/dist/chunks/input-field.sGmuIXiw.js.map +0 -1
- package/dist/chunks/pagination.C0YW_A_o.js.map +0 -1
- package/dist/chunks/payment-method.DtvfUnit.js.map +0 -1
- package/dist/chunks/secondary-nav.BFiTQaag.js.map +0 -1
- package/dist/chunks/tag.BwKc2d2E.js +0 -44
- package/dist/chunks/tag.BwKc2d2E.js.map +0 -1
- package/dist/chunks/textarea.CIQuLWQ8.js +0 -165
- package/dist/chunks/textarea.CIQuLWQ8.js.map +0 -1
- package/dist/chunks/timeline-item.CZBuknZ_.js.map +0 -1
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
import { defineComponent as p, computed as v, toRefs as h, ref as d, watch as $ } from "vue";
|
|
2
|
-
import { B as b } from "./avatar.CeDqq2Z-.js";
|
|
3
|
-
import { B as a, u as B } from "./dropdown.RxD2TqnP.js";
|
|
4
|
-
import { n as m } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
5
|
-
import { d as I, B as x } from "./typography.hlOAxsEn.js";
|
|
6
|
-
import { u as g } from "./use-country-items.B3Cd3Tdo.js";
|
|
7
|
-
import { B as l } from "./country.types.C0Q_hhgJ.js";
|
|
8
|
-
import { L as w } from "./listbox-option-tag.Dl8GwHLT.js";
|
|
9
|
-
import { B as C } from "./payment-method.DtvfUnit.js";
|
|
10
|
-
import "../assets/dropdown-tag.css";
|
|
11
|
-
const D = p({
|
|
12
|
-
name: "bento-dropdown-avatar"
|
|
13
|
-
}), A = /* @__PURE__ */ p({
|
|
14
|
-
...D,
|
|
15
|
-
props: {
|
|
16
|
-
...a.props,
|
|
17
|
-
/**
|
|
18
|
-
* The option elements to populate the avatar dropdown with.
|
|
19
|
-
* It must be an array of {@see BentoAvatarListboxOptions }
|
|
20
|
-
* @property {string} value.label - Text to be displayed in the option.
|
|
21
|
-
* @property {string | number} value.value - Value of the option.
|
|
22
|
-
* @property {string} value.src - Image source of the avatar image.
|
|
23
|
-
*/
|
|
24
|
-
items: {
|
|
25
|
-
type: Array,
|
|
26
|
-
default: () => []
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
emits: ["input", "show-more", "open"],
|
|
30
|
-
setup(s, { emit: t }) {
|
|
31
|
-
const n = s, e = (r) => t("input", r), o = v(() => n.items.map(({ value: r, label: u, src: _ }) => ({ value: r, label: u, data: _ })));
|
|
32
|
-
return { __sfc: !0, props: n, emit: t, onInput: e, dropdownItems: o, BentoAvatar: b, BentoDropdown: a };
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
var P = function() {
|
|
36
|
-
var t = this, n = t._self._c, e = t._self._setupProxy;
|
|
37
|
-
return n("div", [n(e.BentoDropdown, t._b({ attrs: { items: e.dropdownItems }, on: { input: e.onInput, "show-more": function(o) {
|
|
38
|
-
return e.emit("show-more");
|
|
39
|
-
}, open: function(o) {
|
|
40
|
-
return e.emit("open");
|
|
41
|
-
} }, scopedSlots: t._u([{ key: "default", fn: function({ label: o, data: r }) {
|
|
42
|
-
return [n(e.BentoAvatar, { attrs: { username: o, src: r } })];
|
|
43
|
-
} }]) }, "bento-dropdown", t.$props, !1))], 1);
|
|
44
|
-
}, S = [], T = /* @__PURE__ */ m(
|
|
45
|
-
A,
|
|
46
|
-
P,
|
|
47
|
-
S,
|
|
48
|
-
!1,
|
|
49
|
-
null,
|
|
50
|
-
null
|
|
51
|
-
);
|
|
52
|
-
const pt = T.exports, R = p({
|
|
53
|
-
name: "b-dropdown-country"
|
|
54
|
-
}), k = /* @__PURE__ */ p({
|
|
55
|
-
...R,
|
|
56
|
-
props: {
|
|
57
|
-
...a.props,
|
|
58
|
-
/**
|
|
59
|
-
* The option elements to populate the country dropdown with.
|
|
60
|
-
* It must be an array of {@see BentoCountryListboxOptions }
|
|
61
|
-
* * @deprecated {string} value.label - Use BentoDropdown instead of custom labels
|
|
62
|
-
* * @property {BentoCountryCode | string} value.value - Country code of the option
|
|
63
|
-
*/
|
|
64
|
-
items: {
|
|
65
|
-
type: Array,
|
|
66
|
-
default: () => []
|
|
67
|
-
},
|
|
68
|
-
/**
|
|
69
|
-
* Which label variant to display.
|
|
70
|
-
* @values iso, name, phone_code, capital
|
|
71
|
-
*/
|
|
72
|
-
variant: {
|
|
73
|
-
type: String,
|
|
74
|
-
default: l.CUSTOM,
|
|
75
|
-
validator: (s) => Object.values(l).includes(s)
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
emits: ["input", "show-more", "open"],
|
|
79
|
-
setup(s, { emit: t }) {
|
|
80
|
-
const n = s, e = (_) => t("input", _), { variant: o, items: r } = h(n), u = g(o, r);
|
|
81
|
-
return (o.value === "custom" || r.value.some((_) => _.label)) && I(
|
|
82
|
-
'BentoDropdownCountry "custom" variant and "items" prop "label" key',
|
|
83
|
-
"Use any of the other BentoDropdownCountry variants instead OR use BentoDropdown component for custom labels",
|
|
84
|
-
"2.0.0"
|
|
85
|
-
), { __sfc: !0, props: n, emit: t, onInput: e, variant: o, items: r, countryItems: u, BentoTypography: x, BentoDropdown: a };
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
var F = function() {
|
|
89
|
-
var t = this, n = t._self._c, e = t._self._setupProxy;
|
|
90
|
-
return n("div", [n(e.BentoDropdown, t._b({ attrs: { items: e.countryItems }, on: { input: e.onInput, "show-more": function(o) {
|
|
91
|
-
return e.emit("show-more");
|
|
92
|
-
}, open: function(o) {
|
|
93
|
-
return e.emit("open");
|
|
94
|
-
} }, scopedSlots: t._u([{ key: "default", fn: function({ label: o }) {
|
|
95
|
-
return [n(e.BentoTypography, { attrs: { el: "span" } }, [t._v(t._s(o))])];
|
|
96
|
-
} }]) }, "bento-dropdown", t.$props, !1))], 1);
|
|
97
|
-
}, O = [], L = /* @__PURE__ */ m(
|
|
98
|
-
k,
|
|
99
|
-
F,
|
|
100
|
-
O,
|
|
101
|
-
!1,
|
|
102
|
-
null,
|
|
103
|
-
null
|
|
104
|
-
);
|
|
105
|
-
const ut = L.exports, M = p({
|
|
106
|
-
name: "b-dropdown-currency"
|
|
107
|
-
}), z = /* @__PURE__ */ p({
|
|
108
|
-
...M,
|
|
109
|
-
props: {
|
|
110
|
-
...a.props,
|
|
111
|
-
/**
|
|
112
|
-
* The option elements to populate the currency dropdown with.
|
|
113
|
-
* It must be an array of {@see BentoCurrencyListboxOptions }
|
|
114
|
-
* @property {string} value.label - Text to be displayed in the option
|
|
115
|
-
* @property {BentoCurrencyISOCode} value.code - Currency ISO code of the option
|
|
116
|
-
*/
|
|
117
|
-
items: {
|
|
118
|
-
type: Array,
|
|
119
|
-
default: () => []
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
emits: ["input", "show-more", "open"],
|
|
123
|
-
setup(s, { emit: t }) {
|
|
124
|
-
const n = s, e = (u) => t("input", u), o = d([]);
|
|
125
|
-
$(
|
|
126
|
-
() => n.items,
|
|
127
|
-
() => o.value = n.items,
|
|
128
|
-
{ immediate: !0 }
|
|
129
|
-
);
|
|
130
|
-
const r = n.search ? n.search : {
|
|
131
|
-
debounceTime: 500,
|
|
132
|
-
searchEvent: async (u) => {
|
|
133
|
-
var f;
|
|
134
|
-
const _ = n.items.map((c) => ({
|
|
135
|
-
...c,
|
|
136
|
-
label: `${c.value} ${c.label}`
|
|
137
|
-
})), i = B(
|
|
138
|
-
d(u),
|
|
139
|
-
d(_),
|
|
140
|
-
(f = n == null ? void 0 : n.search) == null ? void 0 : f.searchEvent,
|
|
141
|
-
d(!1)
|
|
142
|
-
).value, y = i == null ? void 0 : i.map((c) => ({
|
|
143
|
-
...c,
|
|
144
|
-
label: c.label.substring(c.value.length + 1)
|
|
145
|
-
}));
|
|
146
|
-
o.value = y;
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
return { __sfc: !0, props: n, emit: t, onInput: e, filteredItems: o, search: r, ListboxOptionTag: w, BentoDropdown: a };
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
var E = function() {
|
|
153
|
-
var t = this, n = t._self._c, e = t._self._setupProxy;
|
|
154
|
-
return n(e.BentoDropdown, t._b({ attrs: { search: e.search, items: e.filteredItems }, on: { input: e.onInput, "show-more": function(o) {
|
|
155
|
-
return e.emit("show-more");
|
|
156
|
-
}, open: function(o) {
|
|
157
|
-
return e.emit("open");
|
|
158
|
-
} }, scopedSlots: t._u([{ key: "default", fn: function(o) {
|
|
159
|
-
return [n(e.ListboxOptionTag, { attrs: { option: o } })];
|
|
160
|
-
} }]) }, "bento-dropdown", t.$props, !1));
|
|
161
|
-
}, U = [], j = /* @__PURE__ */ m(
|
|
162
|
-
z,
|
|
163
|
-
E,
|
|
164
|
-
U,
|
|
165
|
-
!1,
|
|
166
|
-
null,
|
|
167
|
-
null
|
|
168
|
-
);
|
|
169
|
-
const _t = j.exports, V = p({
|
|
170
|
-
name: "bento-dropdown-payment-method"
|
|
171
|
-
}), q = /* @__PURE__ */ p({
|
|
172
|
-
...V,
|
|
173
|
-
props: {
|
|
174
|
-
...a.props,
|
|
175
|
-
/**
|
|
176
|
-
* The option elements to populate the payment method dropdown with.
|
|
177
|
-
* It must be an array of {@see BentoPaymentMethodListboxOptions }
|
|
178
|
-
* @property {string} value.label - Text to be displayed in the option
|
|
179
|
-
* @property {string} value.value - Payment type code that translates to a payment icon name {@see https://adyen-ui-assets.netlify.app/?path=/story/packages-ui-assets-payment-method-icons--icons}
|
|
180
|
-
*/
|
|
181
|
-
items: {
|
|
182
|
-
type: Array,
|
|
183
|
-
default: () => []
|
|
184
|
-
}
|
|
185
|
-
},
|
|
186
|
-
emits: ["input", "show-more", "open"],
|
|
187
|
-
setup(s, { emit: t }) {
|
|
188
|
-
return { __sfc: !0, emit: t, onInput: (e) => t("input", e), BentoPaymentMethod: C, BentoDropdown: a };
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
var G = function() {
|
|
192
|
-
var t = this, n = t._self._c, e = t._self._setupProxy;
|
|
193
|
-
return n("div", [n(e.BentoDropdown, t._b({ on: { input: e.onInput, "show-more": function(o) {
|
|
194
|
-
return e.emit("show-more");
|
|
195
|
-
}, open: function(o) {
|
|
196
|
-
return e.emit("open");
|
|
197
|
-
} }, scopedSlots: t._u([{ key: "default", fn: function({ value: o, label: r }) {
|
|
198
|
-
return [n(e.BentoPaymentMethod, { attrs: { type: o, label: r } })];
|
|
199
|
-
} }]) }, "bento-dropdown", t.$props, !1))], 1);
|
|
200
|
-
}, H = [], J = /* @__PURE__ */ m(
|
|
201
|
-
q,
|
|
202
|
-
G,
|
|
203
|
-
H,
|
|
204
|
-
!1,
|
|
205
|
-
null,
|
|
206
|
-
null
|
|
207
|
-
);
|
|
208
|
-
const ct = J.exports, K = p({
|
|
209
|
-
name: "bento-dropdown-tag"
|
|
210
|
-
}), N = /* @__PURE__ */ p({
|
|
211
|
-
...K,
|
|
212
|
-
props: {
|
|
213
|
-
...a.props,
|
|
214
|
-
/**
|
|
215
|
-
* The option elements to populate the tag dropdown with.
|
|
216
|
-
* It must be an array of {@see BentoTagListboxOptions }
|
|
217
|
-
* @property {string} value.label - Text to be displayed in the option
|
|
218
|
-
* @property {string | number} value.value - Value of the option
|
|
219
|
-
* @property {string} value.variant - The BentTag variant shown for the option.
|
|
220
|
-
*/
|
|
221
|
-
items: {
|
|
222
|
-
type: Array,
|
|
223
|
-
default: () => []
|
|
224
|
-
}
|
|
225
|
-
},
|
|
226
|
-
emits: ["input", "show-more", "open"],
|
|
227
|
-
setup(s, { emit: t }) {
|
|
228
|
-
const n = s, e = (r) => t("input", r), o = v(() => {
|
|
229
|
-
var r;
|
|
230
|
-
return (r = n.items) == null ? void 0 : r.map(({ label: u, value: _, variant: i }) => ({ label: u, value: _, data: i }));
|
|
231
|
-
});
|
|
232
|
-
return { __sfc: !0, props: n, emit: t, onInput: e, tagItems: o, ListboxOptionTag: w, BentoDropdown: a };
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
var Q = function() {
|
|
236
|
-
var t = this, n = t._self._c, e = t._self._setupProxy;
|
|
237
|
-
return n(e.BentoDropdown, t._b({ staticClass: "b-dropdown-tag", attrs: { items: e.tagItems, "show-slot-content-in-multiple": "" }, on: { input: e.onInput, "show-more": function(o) {
|
|
238
|
-
return e.emit("show-more");
|
|
239
|
-
}, open: function(o) {
|
|
240
|
-
return e.emit("open");
|
|
241
|
-
} }, scopedSlots: t._u([{ key: "default", fn: function({ label: o, data: r }) {
|
|
242
|
-
return [n(e.ListboxOptionTag, { attrs: { option: { value: o, data: r, label: "" } } })];
|
|
243
|
-
} }]) }, "bento-dropdown", t.$props, !1));
|
|
244
|
-
}, W = [], X = /* @__PURE__ */ m(
|
|
245
|
-
N,
|
|
246
|
-
Q,
|
|
247
|
-
W,
|
|
248
|
-
!1,
|
|
249
|
-
null,
|
|
250
|
-
"be985824"
|
|
251
|
-
);
|
|
252
|
-
const it = X.exports;
|
|
253
|
-
export {
|
|
254
|
-
ut as a,
|
|
255
|
-
_t as b,
|
|
256
|
-
ct as c,
|
|
257
|
-
pt as d,
|
|
258
|
-
it as e
|
|
259
|
-
};
|
|
260
|
-
//# sourceMappingURL=dropdown-tag.CpvU8eSZ.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-tag.CpvU8eSZ.js","sources":["../../src/components/dropdown/components/variants/dropdown-avatar/dropdown-avatar.vue","../../src/components/dropdown/components/variants/dropdown-country/dropdown-country.vue","../../src/components/dropdown/components/variants/dropdown-currency/dropdown-currency.vue","../../src/components/dropdown/components/variants/dropdown-payment-method/dropdown-payment-method.vue","../../src/components/dropdown/components/variants/dropdown-tag/dropdown-tag.vue"],"sourcesContent":["<template>\n <div>\n <bento-dropdown\n v-slot=\"{ label, data }\"\n v-bind=\"$props\"\n :items=\"dropdownItems\"\n @input=\"onInput\"\n @show-more=\"emit('show-more')\"\n @open=\"emit('open')\"\n >\n <bento-avatar :username=\"label\" :src=\"data\" />\n </bento-dropdown>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, type PropType } from 'vue';\n import { type BentoListboxSelectedValue } from '@/types/listbox';\n import { type BentoAvatarListboxOptions } from './dropdown-avatar.types';\n import { BentoAvatar } from '@/components/avatar';\n import BentoDropdown from '@/components/dropdown/dropdown.vue';\n\n const props = defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the avatar dropdown with.\n * It must be an array of {@see BentoAvatarListboxOptions }\n * @property {string} value.label - Text to be displayed in the option.\n * @property {string | number} value.value - Value of the option.\n * @property {string} value.src - Image source of the avatar image.\n */\n items: {\n type: Array as PropType<BentoAvatarListboxOptions>,\n default: () => [],\n },\n });\n\n const emit = defineEmits([\"input\", \"show-more\", \"open\"]);\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n\n const dropdownItems = computed(() => props.items.map(({ value, label, src }) => ({ value, label, data: src })));\n</script>\n\n<script lang=\"ts\">\n /**\n * A Avatar Dropdown showing a selectable list of countries.\n *\n * @example\n * import { BentoDropdownAvatar } from '@adyen/bento-vue2';\n * import type { BentoAvatarListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdownAvatar },\n * template: `\n * <bento-dropdown-avatar\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :multiple=\"true\"\n * :isOptionsDisabled=\"option => option.value === 2\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref('user-id-1') // Default value\n * const options: BentoAvatarListboxOptions = [\n * { label: 'User 1', value: 'user-id-1' },\n * { label: 'User 2', value: 'user-id-2', src: 'image-source.jpeg' },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'bento-dropdown-avatar',\n });\n</script>\n","<template>\n <div>\n <bento-dropdown\n v-slot=\"{ label }\"\n v-bind=\"$props\"\n :items=\"countryItems\"\n @input=\"onInput\"\n @show-more=\"emit('show-more')\"\n @open=\"emit('open')\"\n >\n <bento-typography el=\"span\">{{ label }}</bento-typography>\n </bento-dropdown>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { defineComponent, type PropType, toRefs } from 'vue';\n import { type BentoCountryListboxOptions } from './dropdown-country.types';\n import { type BentoListboxSelectedValue } from '@/types/listbox';\n import { BentoTypography } from '@/components/typography';\n import { useCountryItems } from './composables/use-country-items';\n import { deprecate } from '@/utils/ts/deprecate';\n import { BentoCountryVariant } from '@/components/country';\n import BentoDropdown from '@/components/dropdown/dropdown.vue';\n\n const props = defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the country dropdown with.\n * It must be an array of {@see BentoCountryListboxOptions }\n * * @deprecated {string} value.label - Use BentoDropdown instead of custom labels\n * * @property {BentoCountryCode | string} value.value - Country code of the option\n */\n items: {\n type: Array as PropType<BentoCountryListboxOptions>,\n default: () => [],\n },\n\n /**\n * Which label variant to display.\n * @values iso, name, phone_code, capital\n */\n variant: {\n type: String as PropType<BentoCountryVariant | `${BentoCountryVariant}`>,\n default: BentoCountryVariant.CUSTOM,\n validator: (value: BentoCountryVariant) => Object.values(BentoCountryVariant).includes(value),\n },\n });\n\n const emit = defineEmits([\"input\", \"show-more\", \"open\"]);\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n\n const { variant, items } = toRefs(props);\n const countryItems = useCountryItems(variant, items);\n\n if (variant.value === 'custom' || items.value.some(item => item.label)) {\n deprecate(\n 'BentoDropdownCountry \"custom\" variant and \"items\" prop \"label\" key',\n 'Use any of the other BentoDropdownCountry variants instead OR use BentoDropdown component for custom labels',\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * A Country Dropdown showing a selectable list of countries.\n *\n * @example\n * import { BentoDropdownCountry, BentoCountryCode } from '@adyen/bento-vue2';\n * import type { BentoCountryListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdown },\n * template: `\n * <bento-dropdown-country\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :multiple=\"true\"\n * :isOptionsDisabled=\"option => option.value === 2\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref(BentoCountryCode.NL) // Default value\n * const options: BentoCountryListboxOptions = [\n * { label: 'Option 1', value: BentoCountryCode.NL },\n * { label: 'Option 2', value: BentoCountryCode.BE },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'b-dropdown-country',\n });\n</script>\n","<template>\n <bento-dropdown\n v-slot=\"slotProps\"\n v-bind=\"$props\"\n :search=\"search\"\n :items=\"filteredItems\"\n @input=\"onInput\"\n @show-more=\"emit('show-more')\"\n @open=\"emit('open')\"\n >\n <listbox-option-tag :option=\"slotProps\" />\n </bento-dropdown>\n</template>\n\n<script setup lang=\"ts\">\n import { defineComponent, type PropType, ref, watch } from 'vue';\n import type { BentoCurrencyListboxOptions } from './dropdown-currency.types';\n import type { BentoListboxSelectedValue } from '@/types/listbox';\n import { ListboxOptionTag } from '@/internal/listbox/';\n import BentoDropdown from '@/components/dropdown/dropdown.vue';\n import { useSearchBarFilter } from '@/components/search-bar/useSearchBarDataFilter';\n\n const props = defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the currency dropdown with.\n * It must be an array of {@see BentoCurrencyListboxOptions }\n * @property {string} value.label - Text to be displayed in the option\n * @property {BentoCurrencyISOCode} value.code - Currency ISO code of the option\n */\n items: {\n type: Array as PropType<BentoCurrencyListboxOptions>,\n default: () => [],\n },\n });\n\n const emit = defineEmits([\"input\", \"show-more\", \"open\"]);\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n const filteredItems = ref<BentoCurrencyListboxOptions>([]);\n\n watch(\n () => props.items,\n () => (filteredItems.value = props.items),\n { immediate: true }\n );\n\n const search = props.search\n ? props.search\n : {\n debounceTime: 500,\n searchEvent: async (searchTerm: string) => {\n // Combine value and label to be able to search by the currency code\n const searchableItems = props.items.map(item => ({\n ...item,\n label: `${item.value} ${item.label}`,\n }));\n\n const searchResults = useSearchBarFilter(\n ref(searchTerm),\n ref<BentoCurrencyListboxOptions>(searchableItems),\n props?.search?.searchEvent,\n ref(false)\n ).value;\n\n // Restore original labels by removing the prepended value\n const normalizedResults = searchResults?.map(result => ({\n ...result,\n label: result.label.substring(result.value.length + 1),\n }));\n\n filteredItems.value = normalizedResults;\n },\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * A Currency Dropdown showing a selectable list of currencies.\n *\n * @example\n * import { BentoDropdownCountry, BentoCountryCode } from '@adyen/bento-vue2';\n * import type { BentoCountryListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdown },\n * template: `\n * <bento-dropdown-currency\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :multiple=\"true\"\n * :isOptionsDisabled=\"option => option.value === 2\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref(BentoCountryCode.NL) // Default value\n * const options: BentoCountryListboxOptions = [\n * { label: 'Option 1', value: BentoCountryCode.NL },\n * { label: 'Option 2', value: BentoCountryCode.BE },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'b-dropdown-currency',\n });\n</script>\n","<template>\n <div>\n <bento-dropdown\n v-slot=\"{ value, label }\"\n v-bind=\"$props\"\n @input=\"onInput\"\n @show-more=\"emit('show-more')\"\n @open=\"emit('open')\"\n >\n <bento-payment-method :type=\"value\" :label=\"label\" />\n </bento-dropdown>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { defineComponent, type PropType } from 'vue';\n import { type BentoPaymentMethodListboxOptions } from './dropdown-payment-method.types';\n import { type BentoListboxSelectedValue } from '@/types/listbox';\n import { BentoPaymentMethod } from '@/components/payment-method';\n import BentoDropdown from '@/components/dropdown/dropdown.vue';\n\n defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the payment method dropdown with.\n * It must be an array of {@see BentoPaymentMethodListboxOptions }\n * @property {string} value.label - Text to be displayed in the option\n * @property {string} value.value - Payment type code that translates to a payment icon name {@see https://adyen-ui-assets.netlify.app/?path=/story/packages-ui-assets-payment-method-icons--icons}\n */\n items: {\n type: Array as PropType<BentoPaymentMethodListboxOptions>,\n default: () => [],\n },\n });\n\n const emit = defineEmits([\"input\", \"show-more\", \"open\"]);\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n</script>\n\n<script lang=\"ts\">\n /**\n * A Payment method Dropdown showing a selectable list of countries.\n *\n * @example\n * import { BentoDropdownPaymentMethod } from '@adyen/bento-vue2';\n * import type { BentoPaymentMethodListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdownPaymentMethod },\n * template: `\n * <bento-dropdown-payment-method\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :multiple=\"true\"\n * :isOptionsDisabled=\"option => option.value === 'Visa'\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref('ideal') // Default value\n * const options: BentoPaymentMethodListboxOptions = [\n * { label: 'Option 1', value: 'ideal' },\n * { label: 'Option 2', value: 'visa' },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'bento-dropdown-payment-method',\n });\n</script>\n","<template>\n <bento-dropdown\n v-slot=\"{ label, data }\"\n v-bind=\"$props\"\n class=\"b-dropdown-tag\"\n :items=\"tagItems\"\n show-slot-content-in-multiple\n @input=\"onInput\"\n @show-more=\"emit('show-more')\"\n @open=\"emit('open')\"\n >\n <listbox-option-tag :option=\"{ value: label, data, label: '' }\" />\n </bento-dropdown>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, type PropType } from 'vue';\n import type { BentoTagListboxOptions } from './dropdown-tag.types';\n import type { BentoListboxSelectedValue } from '@/types/listbox';\n import { ListboxOptionTag } from '../../../../internal';\n import BentoDropdown from '../../../dropdown.vue';\n\n const props = defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the tag dropdown with.\n * It must be an array of {@see BentoTagListboxOptions }\n * @property {string} value.label - Text to be displayed in the option\n * @property {string | number} value.value - Value of the option\n * @property {string} value.variant - The BentTag variant shown for the option.\n */\n items: {\n type: Array as PropType<BentoTagListboxOptions>,\n default: () => [],\n },\n });\n\n const emit = defineEmits([\"input\", \"show-more\", \"open\"]);\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n\n const tagItems = computed(() => props.items?.map(({ label, value, variant }) => ({ label, value, data: variant })));\n</script>\n\n<script lang=\"ts\">\n /**\n * A Tag Dropdown showing a selectable list of tags.\n *\n * @example\n * import { BentoDropdownTag } from '@adyen/bento-vue2';\n * import type { BentoTagListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdownTag },\n * template: `\n * <bento-dropdown-tag\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref('unique-id-1') // Default value\n * const options: BentoTagListboxOptions = [\n * { label: 'Offline', value: 'unique-id-1', variant: 'red' },\n * { label: 'Online', value: 'unique-id-2', variant: 'green' },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'bento-dropdown-tag',\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./dropdown-tag.scss\" />\n"],"names":["__default__$4","defineComponent","onInput","selectedValue","emit","dropdownItems","computed","props","value","label","src","__default__$3","variant","items","toRefs","countryItems","useCountryItems","item","deprecate","__default__$2","filteredItems","ref","watch","search","searchTerm","searchableItems","searchResults","useSearchBarFilter","_a","normalizedResults","result","__default__$1","__default__","tagItems"],"mappings":";;;;;;;;;;AAyEI,MAAAA,IAAAC,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;;iBApCAC,IAAA,CAAAC,MAAAC,EAAA,SAAAD,CAAA,GAEAE,IAAAC,EAAA,MAAAC,EAAA,MAAA,IAAA,CAAA,EAAA,OAAAC,GAAA,OAAAC,GAAA,KAAAC,EAAA,OAAA,EAAA,OAAAF,GAAA,OAAAC,GAAA,MAAAC,EAAA,EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;sBCqDAC,IAAAV,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;iBA7CAC,IAAA,CAAAC,MAAAC,EAAA,SAAAD,CAAA,GAEA,EAAA,SAAAS,GAAA,OAAAC,EAAA,IAAAC,EAAAP,CAAA,GACAQ,IAAAC,EAAAJ,GAAAC,CAAA;AAEA,YAAAD,EAAA,UAAA,YAAAC,EAAA,MAAA,KAAA,CAAAI,MAAAA,EAAA,KAAA,MACIC;AAAA,MAAA;AAAA,MACI;AAAA,MACA;AAAA,IACA;;;;;;;;;;;;;;;;;;;;sBC6CRC,IAAAlB,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;iBArEAC,IAAA,CAAAC,MAAAC,EAAA,SAAAD,CAAA,GACAiB,IAAAC,EAAA,CAAA,CAAA;AAEA,IAAAC;AAAA,MAAA,MAAAf,EAAA;AAAA,MACgB,MAAAa,EAAA,QAAAb,EAAA;AAAA,MACuB,EAAA,WAAA,GAAA;AAAA,IACjB;AAGtB,UAAAgB,IAAAhB,EAAA,SAAAA,EAAA,SAAA;AAAA,MAEM,cAAA;AAAA,MACkB,aAAA,OAAAiB,MAAA;;AAGV,cAAAC,IAAAlB,EAAA,MAAA,IAAA,CAAAU,OAAA;AAAA,UAAiD,GAAAA;AAAA,UAC1C,OAAA,GAAAA,EAAA,KAAA,IAAAA,EAAA,KAAA;AAAA,QAC+B,EAAA,GAGtCS,IAAAC;AAAA,UAAsBN,EAAAG,CAAA;AAAA,UACJH,EAAAI,CAAA;AAAA,WACkCG,IAAArB,KAAA,gBAAAA,EAAA,WAAA,gBAAAqB,EAAA;AAAA,UACjCP,EAAA,EAAA;AAAA,QACN,EAAA,OAIbQ,IAAAH,KAAA,gBAAAA,EAAA,IAAA,CAAAI,OAAA;AAAA,UAAwD,GAAAA;AAAA,UACjD,OAAAA,EAAA,MAAA,UAAAA,EAAA,MAAA,SAAA,CAAA;AAAA,QACkD;AAGzD,QAAAV,EAAA,QAAAS;AAAA,MAAsB;AAAA,IAC1B;;;;;;;;;;;;;;;;;;;;;sBCHVE,IAAA9B,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;0CAlCA,CAAAE,MAAAC,EAAA,SAAAD,CAAA;;;;;;;;;;;;;;;;;;;;sBCkCA6B,IAAA/B,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;;iBAlCAC,IAAA,CAAAC,MAAAC,EAAA,SAAAD,CAAA,GAEA8B,IAAA3B,EAAA,MAAA;;AAAA,cAAAsB,IAAArB,EAAA,UAAA,gBAAAqB,EAAA,IAAA,CAAA,EAAA,OAAAnB,GAAA,OAAAD,GAAA,SAAAI,EAAA,OAAA,EAAA,OAAAH,GAAA,OAAAD,GAAA,MAAAI,EAAA;AAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;"}
|