@adyen/bento-vue3 1.77.0 → 1.78.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 +145 -99
- 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/checkbox-group.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/date-range-picker.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/index.css +1 -0
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/radio-group.css +1 -1
- package/dist/assets/selection-card-group.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/chunks/checkbox-group.D56nUmre.js +176 -0
- package/dist/chunks/checkbox-group.D56nUmre.js.map +1 -0
- package/dist/chunks/{code-snippet.ByoBEM00.js → code-snippet.D1iNH2rn.js} +2 -2
- package/dist/chunks/{code-snippet.ByoBEM00.js.map → code-snippet.D1iNH2rn.js.map} +1 -1
- package/dist/chunks/{data-grid.CMIG82Xt.js → data-grid.D70AFJkA.js} +573 -568
- package/dist/chunks/data-grid.D70AFJkA.js.map +1 -0
- package/dist/chunks/{date-picker.CsGq3iSK.js → date-picker.De5ox4c1.js} +15 -15
- package/dist/chunks/{date-picker.CsGq3iSK.js.map → date-picker.De5ox4c1.js.map} +1 -1
- package/dist/chunks/date-range-picker.qXIfFq69.js +1100 -0
- package/dist/chunks/date-range-picker.qXIfFq69.js.map +1 -0
- package/dist/chunks/date-range-picker.types.Ckt7zxGy.js +5 -0
- package/dist/chunks/date-range-picker.types.Ckt7zxGy.js.map +1 -0
- package/dist/chunks/{dropdown-tag.B90dpg8J.js → dropdown-tag.D63up7xm.js} +2 -2
- package/dist/chunks/{dropdown-tag.B90dpg8J.js.map → dropdown-tag.D63up7xm.js.map} +1 -1
- package/dist/chunks/{dropdown.DYDHM__3.js → dropdown.cUORKsFC.js} +19 -19
- package/dist/chunks/{dropdown.DYDHM__3.js.map → dropdown.cUORKsFC.js.map} +1 -1
- package/dist/chunks/es6.MoTTyETW.js.map +1 -1
- package/dist/chunks/{filter-bar.CmF92iAr.js → filter-bar.CnKxMs_L.js} +84 -84
- package/dist/chunks/filter-bar.CnKxMs_L.js.map +1 -0
- package/dist/chunks/{header-with-views.xPfeOz0Y.js → header-with-views.C773fdiL.js} +2 -2
- package/dist/chunks/{header-with-views.xPfeOz0Y.js.map → header-with-views.C773fdiL.js.map} +1 -1
- package/dist/chunks/{input-field-password.BZBYVyAb.js → input-field-password.COET8hlJ.js} +3 -3
- package/dist/chunks/{input-field-password.BZBYVyAb.js.map → input-field-password.COET8hlJ.js.map} +1 -1
- package/dist/chunks/{input-field-phone-number.a8Mw5PAW.js → input-field-phone-number.rBDPxxxe.js} +3 -3
- package/dist/chunks/{input-field-phone-number.a8Mw5PAW.js.map → input-field-phone-number.rBDPxxxe.js.map} +1 -1
- package/dist/chunks/{input-field.CYGGIK48.js → input-field.GEIdI0nu.js} +2 -2
- package/dist/chunks/{input-field.CYGGIK48.js.map → input-field.GEIdI0nu.js.map} +1 -1
- package/dist/chunks/{pagination.CYdGcyMA.js → pagination.BZbMpRHw.js} +2 -2
- package/dist/chunks/{pagination.CYdGcyMA.js.map → pagination.BZbMpRHw.js.map} +1 -1
- package/dist/chunks/{radio-group.B_8R6vGx.js → radio-group.D3GbOHUx.js} +102 -101
- package/dist/chunks/radio-group.D3GbOHUx.js.map +1 -0
- package/dist/chunks/{search-bar.D3Ri_RUK.js → search-bar.eP4fk79T.js} +3 -3
- package/dist/chunks/{search-bar.D3Ri_RUK.js.map → search-bar.eP4fk79T.js.map} +1 -1
- package/dist/chunks/{secondary-nav.CAb20jWW.js → secondary-nav.CKA07_TU.js} +2 -2
- package/dist/chunks/{secondary-nav.CAb20jWW.js.map → secondary-nav.CKA07_TU.js.map} +1 -1
- package/dist/chunks/selection-card-group.B8Uoar3X.js +415 -0
- package/dist/chunks/{selection-card-group.F8alOPtl.js.map → selection-card-group.B8Uoar3X.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker.js +5 -4
- package/dist/date-range-picker.js.map +1 -1
- package/dist/dropdown.js +2 -2
- package/dist/filter-bar.js +1 -1
- package/dist/header-with-views.js +1 -1
- package/dist/index.js +381 -356
- 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/pagination.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/styles/bento-dark.css +5 -0
- package/dist/styles/bento-light.css +5 -0
- package/dist/styles/bento.css +5 -0
- package/dist/styles/legacy.css +5 -0
- package/dist/styles/styleguide.css +5 -0
- package/dist/web-types.json +1 -1
- package/package.json +6 -6
- package/dist/chunks/checkbox-group.COUx8Ne8.js +0 -192
- package/dist/chunks/checkbox-group.COUx8Ne8.js.map +0 -1
- package/dist/chunks/data-grid.CMIG82Xt.js.map +0 -1
- package/dist/chunks/date-range-picker.C19CWG27.js +0 -1149
- package/dist/chunks/date-range-picker.C19CWG27.js.map +0 -1
- package/dist/chunks/filter-bar.CmF92iAr.js.map +0 -1
- package/dist/chunks/radio-group.B_8R6vGx.js.map +0 -1
- package/dist/chunks/selection-card-group.F8alOPtl.js +0 -412
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { defineComponent as q, useSlots as D, toRefs as
|
|
2
|
-
import { u as
|
|
3
|
-
import { u as
|
|
4
|
-
import { g as
|
|
5
|
-
import { B as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { u as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import { defineComponent as q, useSlots as D, toRefs as P, ref as F, computed as c, createElementBlock as b, openBlock as l, normalizeClass as U, createVNode as R, createElementVNode as Z, unref as e, createCommentVNode as f, createBlock as v, withCtx as i, renderSlot as y, mergeProps as j, toRef as M, watch as Y, createSlots as $, Fragment as J, renderList as K, createTextVNode as O, toDisplayString as w } from "vue";
|
|
2
|
+
import { u as Q } from "./use-form-layout-loading.D3lALhtC.js";
|
|
3
|
+
import { u as H } from "./use-has-slot.B7eQSabc.js";
|
|
4
|
+
import { g as C } from "./generate-uid.NJ8tVoha.js";
|
|
5
|
+
import { B as V, d as W } from "./typography.yBEME_Gu.js";
|
|
6
|
+
import { u as X } from "./form-field.BBqLu-vs.js";
|
|
7
|
+
import { C as x } from "./controls-group.cbGiHr7n.js";
|
|
8
|
+
import { B as ee } from "./tag.CjaB9DxL.js";
|
|
9
|
+
import { u as oe } from "./aria-label.CaUURpnB.js";
|
|
10
|
+
import { u as ae } from "./use-default-slot-validator.O02rzsob.js";
|
|
11
|
+
import { g as te } from "./get-slot-text.CQRAP2_q.js";
|
|
12
|
+
import { R as A, a as re } from "./radio-input.CBNE-AkM.js";
|
|
13
|
+
import { _ as z } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
14
|
+
import { E as le } from "./field-label.C97CrBI_.js";
|
|
14
15
|
import "../assets/radio-group.css";
|
|
15
|
-
const
|
|
16
|
+
const de = ["for"], se = {
|
|
16
17
|
key: 0,
|
|
17
18
|
class: "b-radio-button__primary-label"
|
|
18
|
-
},
|
|
19
|
+
}, ne = {
|
|
19
20
|
name: "bento-radio-button",
|
|
20
21
|
model: { prop: "modelValue" }
|
|
21
|
-
},
|
|
22
|
-
...
|
|
22
|
+
}, ie = /* @__PURE__ */ q({
|
|
23
|
+
...ne,
|
|
23
24
|
props: {
|
|
24
25
|
/**
|
|
25
26
|
* Disable the radio button (optional)
|
|
@@ -63,96 +64,96 @@ const re = ["for"], le = {
|
|
|
63
64
|
}
|
|
64
65
|
},
|
|
65
66
|
emits: ["input", "update:model-value"],
|
|
66
|
-
setup(a, { expose: k, emit:
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
const
|
|
67
|
+
setup(a, { expose: k, emit: S }) {
|
|
68
|
+
const p = D(), s = H(p), t = a, h = S, { value: r } = P(t), g = C("bento-radio-button"), m = C("description"), u = F(null);
|
|
69
|
+
ae("bento-radio-button", p.default, p.description);
|
|
70
|
+
const I = c(() => ({
|
|
70
71
|
[`b-radio-button--${A.DISABLED}`]: t.disabled,
|
|
71
72
|
[`b-radio-button--${A.READONLY}`]: t.readonly
|
|
72
|
-
})),
|
|
73
|
-
ariaLabel:
|
|
73
|
+
})), B = oe({
|
|
74
|
+
ariaLabel: te(p)("default"),
|
|
74
75
|
label: r.value
|
|
75
|
-
}),
|
|
76
|
-
!t.disabled && !t.readonly && (
|
|
76
|
+
}), _ = c(() => t.value === t.modelValue), E = () => {
|
|
77
|
+
!t.disabled && !t.readonly && (h("update:model-value", t.value), h("input", t.value));
|
|
77
78
|
};
|
|
78
79
|
return k({
|
|
79
80
|
focus: () => {
|
|
80
|
-
|
|
81
|
+
u.value.focus();
|
|
81
82
|
}
|
|
82
|
-
}), (
|
|
83
|
-
class: U(["b-radio-button",
|
|
83
|
+
}), (n, T) => (l(), b("div", {
|
|
84
|
+
class: U(["b-radio-button", I.value]),
|
|
84
85
|
"data-testid": "radio-button-container"
|
|
85
86
|
}, [
|
|
86
|
-
|
|
87
|
-
id: e(
|
|
87
|
+
R(e(re), {
|
|
88
|
+
id: e(g),
|
|
88
89
|
ref_key: "radioInputRef",
|
|
89
|
-
ref:
|
|
90
|
-
"aria-label": e(
|
|
91
|
-
"aria-describedby": e(s)("description") ? e(
|
|
92
|
-
checked:
|
|
90
|
+
ref: u,
|
|
91
|
+
"aria-label": e(B),
|
|
92
|
+
"aria-describedby": e(s)("description") ? e(m) : "",
|
|
93
|
+
checked: _.value,
|
|
93
94
|
disabled: a.disabled,
|
|
94
95
|
readonly: a.readonly,
|
|
95
96
|
"has-error": a.hasError,
|
|
96
97
|
value: e(r),
|
|
97
98
|
"model-value": a.modelValue,
|
|
98
99
|
name: a.name,
|
|
99
|
-
"onUpdate:modelValue":
|
|
100
|
+
"onUpdate:modelValue": E
|
|
100
101
|
}, null, 8, ["id", "aria-label", "aria-describedby", "checked", "disabled", "readonly", "has-error", "value", "model-value", "name"]),
|
|
101
|
-
|
|
102
|
-
e(s)("default") ? (l(),
|
|
102
|
+
Z("div", null, [
|
|
103
|
+
e(s)("default") ? (l(), b("label", {
|
|
103
104
|
key: 0,
|
|
104
|
-
for: e(
|
|
105
|
+
for: e(g),
|
|
105
106
|
class: "b-radio-button__label-container"
|
|
106
107
|
}, [
|
|
107
|
-
e(s)("default") ? (l(),
|
|
108
|
-
|
|
108
|
+
e(s)("default") ? (l(), b("span", se, [
|
|
109
|
+
R(e(V), {
|
|
109
110
|
class: "b-radio-button__label",
|
|
110
111
|
el: "span",
|
|
111
112
|
variant: "body"
|
|
112
113
|
}, {
|
|
113
|
-
default:
|
|
114
|
-
|
|
114
|
+
default: i(() => [
|
|
115
|
+
y(n.$slots, "default", {}, void 0, !0)
|
|
115
116
|
]),
|
|
116
117
|
_: 3
|
|
117
118
|
}),
|
|
118
|
-
a.tag ? (l(),
|
|
119
|
+
a.tag ? (l(), v(e(ee), j({
|
|
119
120
|
key: 0,
|
|
120
121
|
class: "b-radio-button__label-tag"
|
|
121
|
-
}, a.tag), null, 16)) :
|
|
122
|
-
])) :
|
|
123
|
-
e(s)("default") && e(s)("description") ? (l(),
|
|
122
|
+
}, a.tag), null, 16)) : f("", !0)
|
|
123
|
+
])) : f("", !0),
|
|
124
|
+
e(s)("default") && e(s)("description") ? (l(), v(e(V), {
|
|
124
125
|
key: 1,
|
|
125
|
-
id: e(
|
|
126
|
+
id: e(m),
|
|
126
127
|
class: "b-radio-button__description",
|
|
127
128
|
el: "span",
|
|
128
129
|
variant: "body"
|
|
129
130
|
}, {
|
|
130
|
-
default:
|
|
131
|
-
|
|
131
|
+
default: i(() => [
|
|
132
|
+
y(n.$slots, "description", {}, void 0, !0)
|
|
132
133
|
]),
|
|
133
134
|
_: 3
|
|
134
|
-
}, 8, ["id"])) :
|
|
135
|
-
], 8,
|
|
136
|
-
e(s)("content") &&
|
|
135
|
+
}, 8, ["id"])) : f("", !0)
|
|
136
|
+
], 8, de)) : f("", !0),
|
|
137
|
+
e(s)("content") && _.value ? (l(), v(e(V), {
|
|
137
138
|
key: 1,
|
|
138
139
|
class: "b-radio-button__content",
|
|
139
140
|
el: "div"
|
|
140
141
|
}, {
|
|
141
|
-
default:
|
|
142
|
-
|
|
142
|
+
default: i(() => [
|
|
143
|
+
y(n.$slots, "content", {}, void 0, !0)
|
|
143
144
|
]),
|
|
144
145
|
_: 3
|
|
145
|
-
})) :
|
|
146
|
+
})) : f("", !0)
|
|
146
147
|
])
|
|
147
148
|
], 2));
|
|
148
149
|
}
|
|
149
|
-
}),
|
|
150
|
-
var
|
|
151
|
-
const
|
|
150
|
+
}), ue = /* @__PURE__ */ z(ie, [["__scopeId", "data-v-db65f460"]]);
|
|
151
|
+
var L = /* @__PURE__ */ ((a) => (a.HORIZONTAL = "horizontal", a.VERTICAL = "vertical", a))(L || {});
|
|
152
|
+
const ce = { class: "b-radio-group" }, pe = {
|
|
152
153
|
name: "bento-radio-group",
|
|
153
154
|
model: { prop: "modelValue" }
|
|
154
|
-
},
|
|
155
|
-
...
|
|
155
|
+
}, fe = /* @__PURE__ */ q({
|
|
156
|
+
...pe,
|
|
156
157
|
props: {
|
|
157
158
|
formId: { default: null },
|
|
158
159
|
hasError: { type: Boolean, default: !1 },
|
|
@@ -160,7 +161,7 @@ const ie = { class: "b-radio-group" }, ue = {
|
|
|
160
161
|
items: {},
|
|
161
162
|
label: {},
|
|
162
163
|
modelValue: { default: null },
|
|
163
|
-
variant: { default:
|
|
164
|
+
variant: { default: L.VERTICAL },
|
|
164
165
|
description: { default: null },
|
|
165
166
|
disabled: { type: Boolean, default: !1 },
|
|
166
167
|
errorMessage: { default: null },
|
|
@@ -170,23 +171,23 @@ const ie = { class: "b-radio-group" }, ue = {
|
|
|
170
171
|
required: { type: Boolean, default: !1 },
|
|
171
172
|
tooltipText: { default: null }
|
|
172
173
|
},
|
|
173
|
-
emits: ["
|
|
174
|
-
setup(a, { expose: k, emit:
|
|
175
|
-
const
|
|
176
|
-
() => !r.disabled && !
|
|
177
|
-
),
|
|
178
|
-
"b-radio-group__buttons--horizontal": r.variant ===
|
|
179
|
-
})),
|
|
180
|
-
|
|
174
|
+
emits: ["update:model-value", "input"],
|
|
175
|
+
setup(a, { expose: k, emit: S }) {
|
|
176
|
+
const p = "bento-radio-group", s = D(), t = H(s), h = S, r = a, g = M(r, "modelValue"), m = C("error"), { isReadOnly: u } = Q(M(r, "readonly")), { emitValue: I } = X(h), B = F(null), _ = c(
|
|
177
|
+
() => !r.disabled && !u.value && (!!r.errorMessage || r.hasError)
|
|
178
|
+
), E = c(() => !r.disabled && !u.value && !!r.errorMessage), N = c(() => ({
|
|
179
|
+
"b-radio-group__buttons--horizontal": r.variant === L.HORIZONTAL
|
|
180
|
+
})), n = c(() => r.variant === "vertical"), T = c(() => t("content") && !(n != null && n.value)), G = (o) => {
|
|
181
|
+
I(o);
|
|
181
182
|
};
|
|
182
|
-
return r.hasError &&
|
|
183
|
+
return r.hasError && W(
|
|
183
184
|
'BentoRadioGroup "hasError" property',
|
|
184
185
|
`Use the BentoRadioGroup "errorMessage" property instead to indicate that there is a modifier error.
|
|
185
186
|
Having the field as "undefined" will hide/remove the error.
|
|
186
187
|
<bento-radio-group errorMessage="Error message text" />`,
|
|
187
188
|
"2.0.0"
|
|
188
|
-
),
|
|
189
|
-
|
|
189
|
+
), Y(
|
|
190
|
+
T,
|
|
190
191
|
(o) => {
|
|
191
192
|
if (o)
|
|
192
193
|
throw new Error("The content slot is only available for the vertical radio group layout");
|
|
@@ -196,13 +197,13 @@ const ie = { class: "b-radio-group" }, ue = {
|
|
|
196
197
|
}
|
|
197
198
|
), k({
|
|
198
199
|
focus: () => {
|
|
199
|
-
|
|
200
|
+
B.value[0].focus();
|
|
200
201
|
}
|
|
201
|
-
}), (o,
|
|
202
|
-
|
|
203
|
-
class: U(["b-radio-group__buttons",
|
|
204
|
-
"aria-describedby":
|
|
205
|
-
"component-name":
|
|
202
|
+
}), (o, be) => (l(), b("div", ce, [
|
|
203
|
+
R(e(x), {
|
|
204
|
+
class: U(["b-radio-group__buttons", N.value]),
|
|
205
|
+
"aria-describedby": E.value ? e(m) : "",
|
|
206
|
+
"component-name": p,
|
|
206
207
|
description: o.description,
|
|
207
208
|
disabled: o.disabled,
|
|
208
209
|
form: o.formId,
|
|
@@ -212,39 +213,39 @@ const ie = { class: "b-radio-group" }, ue = {
|
|
|
212
213
|
"hide-label": o.hideLabel,
|
|
213
214
|
"tooltip-text": o.tooltipText,
|
|
214
215
|
role: "radiogroup",
|
|
215
|
-
"aria-readonly": e(
|
|
216
|
+
"aria-readonly": e(u)
|
|
216
217
|
}, $({
|
|
217
|
-
default:
|
|
218
|
-
(l(!0),
|
|
218
|
+
default: i(() => [
|
|
219
|
+
(l(!0), b(J, null, K(o.items, (d) => (l(), v(e(ue), {
|
|
219
220
|
ref_for: !0,
|
|
220
221
|
ref_key: "radioButton",
|
|
221
|
-
ref:
|
|
222
|
+
ref: B,
|
|
222
223
|
key: d.value,
|
|
223
|
-
"model-value":
|
|
224
|
+
"model-value": g.value,
|
|
224
225
|
value: d.value,
|
|
225
226
|
disabled: o.disabled || d.disabled,
|
|
226
|
-
readonly: e(
|
|
227
|
-
"has-error":
|
|
227
|
+
readonly: e(u) || d.readonly,
|
|
228
|
+
"has-error": _.value || d.hasError,
|
|
228
229
|
tag: d.tag,
|
|
229
230
|
name: o.formId || o.label,
|
|
230
|
-
"onUpdate:modelValue":
|
|
231
|
+
"onUpdate:modelValue": G
|
|
231
232
|
}, $({
|
|
232
|
-
default:
|
|
233
|
+
default: i(() => [
|
|
233
234
|
O(w(d.label), 1)
|
|
234
235
|
]),
|
|
235
236
|
_: 2
|
|
236
237
|
}, [
|
|
237
238
|
d.description ? {
|
|
238
239
|
name: "description",
|
|
239
|
-
fn:
|
|
240
|
+
fn: i(() => [
|
|
240
241
|
O(w(d.description), 1)
|
|
241
242
|
]),
|
|
242
243
|
key: "0"
|
|
243
244
|
} : void 0,
|
|
244
|
-
e(t)("content") &&
|
|
245
|
+
e(t)("content") && n.value ? {
|
|
245
246
|
name: "content",
|
|
246
|
-
fn:
|
|
247
|
-
|
|
247
|
+
fn: i(() => [
|
|
248
|
+
y(o.$slots, "content", {}, void 0, !0)
|
|
248
249
|
]),
|
|
249
250
|
key: "1"
|
|
250
251
|
} : void 0
|
|
@@ -254,24 +255,24 @@ const ie = { class: "b-radio-group" }, ue = {
|
|
|
254
255
|
}, [
|
|
255
256
|
e(t)("description") ? {
|
|
256
257
|
name: "description",
|
|
257
|
-
fn:
|
|
258
|
-
|
|
258
|
+
fn: i(() => [
|
|
259
|
+
y(o.$slots, "description", {}, void 0, !0)
|
|
259
260
|
]),
|
|
260
261
|
key: "0"
|
|
261
262
|
} : void 0
|
|
262
263
|
]), 1032, ["aria-describedby", "class", "description", "disabled", "form", "label", "optional", "required", "hide-label", "tooltip-text", "aria-readonly"]),
|
|
263
|
-
|
|
264
|
+
E.value ? (l(), v(e(le), {
|
|
264
265
|
key: 0,
|
|
265
|
-
id: e(
|
|
266
|
+
id: e(m),
|
|
266
267
|
"error-message": o.errorMessage,
|
|
267
268
|
class: "b-radio-group__error-message"
|
|
268
|
-
}, null, 8, ["id", "error-message"])) :
|
|
269
|
+
}, null, 8, ["id", "error-message"])) : f("", !0)
|
|
269
270
|
]));
|
|
270
271
|
}
|
|
271
|
-
}),
|
|
272
|
+
}), Ne = /* @__PURE__ */ z(fe, [["__scopeId", "data-v-f123ff7b"]]);
|
|
272
273
|
export {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
Ne as B,
|
|
275
|
+
L as a,
|
|
276
|
+
ue as b
|
|
276
277
|
};
|
|
277
|
-
//# sourceMappingURL=radio-group.
|
|
278
|
+
//# sourceMappingURL=radio-group.D3GbOHUx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-group.D3GbOHUx.js","sources":["../../../vue2/src/components/radio-group/components/radio-button/radio-button.vue","../../../vue2/src/components/radio-group/radio-group.types.ts","../../../vue2/src/components/radio-group/radio-group.vue"],"sourcesContent":["<template>\n <div class=\"b-radio-button\" data-testid=\"radio-button-container\" :class=\"conditionalClassContainer\">\n <radio-input\n :id=\"radioButtonId\"\n ref=\"radioInputRef\"\n :aria-label=\"ariaLabel\"\n :aria-describedby=\"hasSlot('description') ? descriptionId : ''\"\n :checked=\"isChecked\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :has-error=\"hasError\"\n :value=\"value\"\n :model-value=\"modelValue\"\n :name=\"name\"\n @update:model-value=\"onChange\"\n />\n <div>\n <label v-if=\"hasSlot('default')\" :for=\"radioButtonId\" class=\"b-radio-button__label-container\">\n <span v-if=\"hasSlot('default')\" class=\"b-radio-button__primary-label\">\n <bento-typography class=\"b-radio-button__label\" el=\"span\" variant=\"body\"><slot /></bento-typography>\n <bento-tag v-if=\"tag\" class=\"b-radio-button__label-tag\" v-bind=\"tag\" />\n </span>\n <bento-typography\n v-if=\"hasSlot('default') && hasSlot('description')\"\n :id=\"descriptionId\"\n class=\"b-radio-button__description\"\n el=\"span\"\n variant=\"body\"\n >\n <slot name=\"description\"></slot>\n </bento-typography>\n </label>\n <bento-typography v-if=\"hasSlot('content') && isChecked\" class=\"b-radio-button__content\" el=\"div\">\n <slot name=\"content\"></slot>\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { BentoTag } from '@/components/tag';\n import { BentoTypography } from '@/components/typography';\n import { RadioInput } from '../../../internal/radio-input';\n import { useAriaLabel } from '@/utils/ts/aria-label';\n import { generateUid } from '@/core/utils/ts';\n import { computed, type ComputedRef, type PropType, ref, toRefs, useSlots } from 'vue';\n import { useDefaultSlotValidator, useHasSlot } from '@/composables';\n import { BentoRadioButtonStateClass, type BentoRadioButtonTag, type BentoRadioButtonValue } from './radio-button.types';\n import { getSlotText } from '@/utils/ts/get-slot-text';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const props = defineProps({\n /**\n * Disable the radio button (optional)\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Shows bento-radio-button in error state (optional)\n */\n hasError: { type: Boolean, default: false },\n\n /**\n * This property should not be used directly.\n * It will be used by v-model directive on radio component.\n */\n modelValue: {\n type: [String, Number] as PropType<BentoRadioButtonValue>,\n default: null,\n },\n\n /**\n * Sets the radio button to readonly (optional)\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Sets the properties of the BentoTag component that is placed next to the label.\n * {@see BentoTag}\n */\n tag: { type: Object as PropType<BentoRadioButtonTag>, default: undefined },\n\n /**\n * Indicates the value of the input that will be returned when it's checked\n */\n value: {\n type: [String, Number] as PropType<BentoRadioButtonValue>,\n required: true,\n },\n\n /**\n * Sets the name of the radio input.\n * Used for differentiating radio groups or accessing input via form submission.\n */\n name: {\n type: String,\n default: null,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the radio button is clicked. Enables Vue2 \"v-model\"\n */\n (e: 'input', value: BentoRadioButtonValue);\n\n /**\n * Emitted when the radio button is clicked. Enables Vue3 \"v-model\"\n */\n (e: 'update:model-value', value: BentoRadioButtonValue);\n }>();\n\n const { value } = toRefs(props);\n const radioButtonId = generateUid('bento-radio-button');\n const descriptionId = generateUid('description');\n const radioInputRef = ref(null);\n\n useDefaultSlotValidator('bento-radio-button', slots.default, slots.description);\n\n const conditionalClassContainer = computed(() => ({\n [`b-radio-button--${BentoRadioButtonStateClass.DISABLED}`]: props.disabled,\n [`b-radio-button--${BentoRadioButtonStateClass.READONLY}`]: props.readonly,\n }));\n\n const ariaLabel = useAriaLabel({\n ariaLabel: getSlotText(slots)('default'),\n label: value.value as string,\n });\n\n const isChecked: ComputedRef<boolean> = computed(() => props.value === props.modelValue);\n\n const onChange = () => {\n if (!props.disabled && !props.readonly) {\n emit('update:model-value', props.value);\n emit('input', props.value);\n }\n };\n\n const focus = () => {\n radioInputRef.value.focus();\n };\n\n defineExpose({\n focus,\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Radio buttons are used when two or more options are mutually exclusive,\n * the user can only select a single option from a list of pre-defined options.\n * The label tag area is also clickable.\n * Only to be used internally.\n *\n * @example\n * import { BentoRadioButton } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoRadioButton },\n * template: `\n * <bento-radio-button\n * disabled\n * value=\"inputRadio\"\n * model-value.sync=\"modelValue\"\n * >\n * Label text\n * <template #description>Description text below label</template>\n * <template #content>Content shown when checked</template>\n * </bento-radio-button>\n * `,\n * setup() {\n * const modelValue = ref('anyValue')\n * const value = 'option-value'\n *\n * return {\n * modelValue,\n * value,\n * }\n * }\n * }\n */\n export default {\n name: 'bento-radio-button',\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./radio-button.scss\" />\n","import type { FormField, FormFieldEmits } from '../../types/form-field';\nimport type { BentoRadioButtonTag, BentoRadioButtonValue } from './components/radio-button';\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoRadioGroupVariant {\n HORIZONTAL = 'horizontal',\n VERTICAL = 'vertical',\n}\n\nexport type BentoRadioGroupValue = BentoRadioButtonValue;\n\nexport interface BentoRadioGroupItem {\n value: BentoRadioGroupValue;\n label: string;\n description?: string;\n disabled?: boolean;\n readonly?: boolean;\n hasError?: boolean;\n tag?: BentoRadioButtonTag;\n}\n\nexport type BentoRadioGroupItems = Array<BentoRadioGroupItem>;\n\nexport type BentoRadioGroupEmits = FormFieldEmits<BentoRadioGroupValue>;\n\nexport interface BentoRadioGroupProps extends FormField {\n /**\n * The form id the radio group is associated with. Defaults to null, as a radio group can also be used standalone.\n * @default null\n */\n formId?: string | null;\n\n /**\n * If set to true, renders all bento-radio-buttons in the group in an error state.\n * @deprecated Use \"errorMessage\" prop instead\n * @default false\n */\n hasError?: boolean;\n\n /**\n * Shows/hides the group label.\n * @default null\n */\n hideLabel?: boolean | null;\n\n /**\n * The radio group's items.\n * Required.\n */\n items: BentoRadioGroupItems;\n\n /**\n * The name associated with the group. Required for accessibility purposes.\n * Required.\n */\n label: string;\n\n /**\n * Determines the initially selected value of the group. Corresponds to the BentoRadioButtonItem's value.\n * Defaults to no value selected.\n * @default null\n */\n modelValue?: BentoRadioGroupValue | null;\n\n /**\n * The radio group's layout. It can be vertical or horizontal. Defaults to vertical.\n * @default BentoRadioGroupVariant.VERTICAL\n */\n variant?: BentoRadioGroupVariant | `${BentoRadioGroupVariant}`;\n}\n","<template>\n <div class=\"b-radio-group\">\n <controls-group\n class=\"b-radio-group__buttons\"\n :aria-describedby=\"shouldShowErrorMessage ? errorId : ''\"\n :component-name=\"COMPONENT_NAME\"\n :class=\"conditionalClasses\"\n :description=\"description\"\n :disabled=\"disabled\"\n :form=\"formId\"\n :label=\"label\"\n :optional=\"optional\"\n :required=\"required\"\n :hide-label=\"hideLabel\"\n :tooltip-text=\"tooltipText\"\n role=\"radiogroup\"\n :aria-readonly=\"isReadOnly\"\n >\n <bento-radio-button\n v-for=\"item in items\"\n ref=\"radioButton\"\n :key=\"item.value\"\n :model-value=\"inputValue\"\n :value=\"item.value\"\n :disabled=\"disabled || item.disabled\"\n :readonly=\"isReadOnly || item.readonly\"\n :has-error=\"shouldShowError || item.hasError\"\n :tag=\"item.tag\"\n :name=\"formId || label\"\n @update:model-value=\"onUpdateModelValue\"\n >\n <template #default>{{ item.label }}</template>\n <template v-if=\"item.description\" #description>{{ item.description }}</template>\n <template v-if=\"hasSlot('content') && isVertical\" #content>\n <slot name=\"content\"></slot>\n </template>\n </bento-radio-button>\n <template v-if=\"hasSlot('description')\" #description>\n <slot name=\"description\" />\n </template>\n </controls-group>\n <error-message\n v-if=\"shouldShowErrorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-radio-group__error-message\"\n />\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, ref, toRef, useSlots, watch } from 'vue';\n import { ControlsGroup, ErrorMessage } from '@/components/internal';\n import { BentoRadioButton } from './components/radio-button';\n import { useHasSlot } from '@/composables';\n import { generateUid } from '@/core/utils/ts';\n import { deprecate } from '@/utils/ts/deprecate';\n import { useFormFieldEmits } from '@/utils/ts/form-field/form-field';\n import { type BentoRadioGroupEmits, type BentoRadioGroupProps, BentoRadioGroupVariant } from './radio-group.types';\n import { useFormLayoutFieldLoading } from '@/composables/use-form-layout-loading/use-form-layout-loading';\n\n /**\n * The name of the component to be used in the Vue devtools and console warnings.\n */\n const COMPONENT_NAME = 'bento-radio-group';\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const emit = defineEmits<BentoRadioGroupEmits>();\n\n const props = withDefaults(defineProps<BentoRadioGroupProps>(), {\n description: null,\n disabled: false,\n errorMessage: null,\n formId: null,\n hasError: false,\n hideLabel: null,\n modelValue: null,\n optional: false,\n readonly: false,\n required: false,\n tooltipText: null,\n variant: BentoRadioGroupVariant.VERTICAL,\n });\n\n const inputValue = toRef(props, 'modelValue');\n const errorId = generateUid('error');\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n const { emitValue } = useFormFieldEmits(emit);\n const radioButton = ref(null);\n\n const shouldShowError = computed(\n () => !props.disabled && !isReadOnly.value && (!!props.errorMessage || props.hasError)\n );\n const shouldShowErrorMessage = computed(() => !props.disabled && !isReadOnly.value && !!props.errorMessage);\n\n const conditionalClasses = computed(() => ({\n 'b-radio-group__buttons--horizontal': props.variant === BentoRadioGroupVariant.HORIZONTAL,\n }));\n\n // Content slot logic\n const isVertical = computed(() => props.variant === 'vertical');\n const shouldShowSlotError = computed(() => hasSlot('content') && !isVertical?.value);\n\n const onUpdateModelValue = value => {\n emitValue(value);\n };\n\n if (props.hasError) {\n deprecate(\n 'BentoRadioGroup \"hasError\" property',\n `Use the BentoRadioGroup \"errorMessage\" property instead to indicate that there is a modifier error.\n Having the field as \"undefined\" will hide/remove the error.\n <bento-radio-group errorMessage=\"Error message text\" />`,\n '2.0.0'\n );\n }\n\n watch(\n shouldShowSlotError,\n newVal => {\n if (newVal) {\n throw new Error('The content slot is only available for the vertical radio group layout');\n }\n },\n {\n immediate: true,\n }\n );\n\n const focus = () => {\n radioButton.value[0].focus();\n };\n\n defineExpose({\n focus,\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * A radio group component should be used whenever it is necessary to use a set of radio buttons\n * This component conforms to the official WAI-ARIA guidelines for grouping controls: https://www.w3.org/WAI/tutorials/forms/grouping/\n *\n * import { BentoRadioGroup } from '@adyen/bento-vue2/';\n *\n * export default {\n * components: { BentoRadioGroup },\n * template: `\n * <bento-radio-group\n * label=\"Your group label\"\n * :items=\"[\n * { value: 1, label: 'Your label' },\n * { value: 2, label: 'Another label', description: 'Your descriptive sub label' },\n * ]\"\n * variant=\"horizontal\"\n * />\n * `\n * };\n */\n export default {\n name: 'bento-radio-group',\n model: { prop: 'modelValue' },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./radio-group.scss\" />\n"],"names":["__default__$1","slots","useSlots","hasSlot","useHasSlot","props","__props","emit","__emit","value","toRefs","radioButtonId","generateUid","descriptionId","radioInputRef","ref","useDefaultSlotValidator","conditionalClassContainer","computed","RadioInputStateClass","ariaLabel","useAriaLabel","getSlotText","isChecked","onChange","__expose","BentoRadioGroupVariant","BentoRadioGroupVariant2","__default__","COMPONENT_NAME","inputValue","toRef","errorId","isReadOnly","useFormLayoutFieldLoading","emitValue","useFormFieldEmits","radioButton","shouldShowError","shouldShowErrorMessage","conditionalClasses","isVertical","shouldShowSlotError","onUpdateModelValue","deprecate","watch","newVal"],"mappings":"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"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as A, provide as P, toRef as T, useAttrs as y, ref as p, watch as F, createElementBlock as N, openBlock as S, createVNode as n, mergeProps as g, unref as o, createSlots as L, withCtx as m, createElementVNode as U, withKeys as f } from "vue";
|
|
2
2
|
import { d as k } from "./debounce.DUTu11PS.js";
|
|
3
3
|
import { u as K } from "./index.pdBj0KQU.js";
|
|
4
|
-
import { I as R } from "./dropdown.
|
|
5
|
-
import { B as w } from "./input-field.
|
|
4
|
+
import { I as R } from "./dropdown.cUORKsFC.js";
|
|
5
|
+
import { B as w } from "./input-field.GEIdI0nu.js";
|
|
6
6
|
import { S as B } from "./search.PczW-onY.js";
|
|
7
7
|
import { C as D } from "./cross-circle-fill.CYLL7jfC.js";
|
|
8
8
|
import { _ as $ } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
@@ -113,4 +113,4 @@ export {
|
|
|
113
113
|
b as a,
|
|
114
114
|
x as b
|
|
115
115
|
};
|
|
116
|
-
//# sourceMappingURL=search-bar.
|
|
116
|
+
//# sourceMappingURL=search-bar.eP4fk79T.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-bar.
|
|
1
|
+
{"version":3,"file":"search-bar.eP4fk79T.js","sources":["../../../vue2/src/components/search-bar/search-bar.types.ts","../../../vue2/src/components/search-bar/search-bar.vue"],"sourcesContent":["export enum BentoSearchBarInternalEvent {\n CLEAR = 'clear',\n ESCAPE = 'escape-pressed',\n INPUT = 'input',\n UPDATE = 'update:search-term',\n}\n\nexport enum BentoSearchBarEvent {\n CLEAR = 'search-clear',\n INPUT = 'search-input',\n UPDATE = 'update:search-term',\n}\n\nexport interface BentoSearchBarItem {\n label: string;\n items?: Array<BentoSearchBarItem>;\n}\n\nexport type BentoSearchBarData = Array<BentoSearchBarItem>;\n\nexport interface BentoSearchBarProps {\n /**\n * Text that labels an the search bar input element\n */\n inputFieldAriaLabel: string;\n\n /**\n * Reduces height of the search bar. Default: false\n */\n condensed?: boolean;\n\n /**\n * Custom debounce time. Default: 300\n */\n debounceTime?: number;\n\n /**\n * Disables the text input.\n */\n disabled?: boolean;\n\n /**\n * Text displayed as a hint when the field is not empty\n */\n hint?: string;\n\n /**\n * Text displayed as the placeholder of the input-field\n */\n placeholder?: string;\n\n /**\n * Text displayed as the value being searched\n */\n value?: string;\n}\n","<template>\n <div class=\"b-search-bar\">\n <bento-input-field\n ref=\"bentoInputField\"\n v-bind=\"attrs\"\n :value=\"searchTerm\"\n type=\"search\"\n :condensed=\"condensed\"\n :aria-label=\"inputFieldAriaLabel\"\n :aria-hidden=\"false\"\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n @input=\"onInputEvent\"\n @focus=\"emit('focus')\"\n @blur=\"emit('blur')\"\n @escape-pressed=\"emit(BentoSearchBarInternalEvent.ESCAPE)\"\n >\n <template #iconBefore>\n <search-icon :svg-title=\"t('search')\" aria-hidden=\"true\" />\n </template>\n\n <template v-if=\"searchTerm\" #iconAfter>\n <div\n class=\"b-search-bar__clear-search\"\n tabindex=\"0\"\n data-testid=\"b-search-bar-clear-search-button\"\n @click=\"onClearSearch\"\n @keypress.enter=\"onClearSearch\"\n @keyup.space=\"onClearSearch\"\n >\n <cross-circle-fill-icon :svg-title=\"t('clearSearch')\" />\n </div>\n </template>\n </bento-input-field>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { provide, ref, toRef, useAttrs, watch } from 'vue';\n import { debounce } from '@/utils/ts/debounce';\n import { BentoSearchBarInternalEvent, type BentoSearchBarProps } from './search-bar.types';\n import { useI18n } from '@/utils/ts/i18n';\n import { INPUT_FIELD_HINT_INJECTION_KEY } from '@/components/input-field/input-field.keys';\n // eslint-disable-next-line @typescript-eslint/consistent-type-imports\n import BentoInputField from '@/components/input-field/input-field.vue';\n import SearchIcon from '@adyen/ui-assets-icons-16/vue/search';\n import CrossCircleFillIcon from '@adyen/ui-assets-icons-16/vue/cross-circle-fill';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const props = withDefaults(defineProps<BentoSearchBarProps>(), {\n condensed: false,\n debounceTime: 300,\n disabled: false,\n hint: '',\n placeholder: '',\n value: undefined,\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the input value changes by typing a search. Debounced by the `debounceTime` property\n */\n (e: 'input', inputValue: string): void;\n\n /**\n * Emitted when the \"clear search\" button is clicked\n */\n (e: 'clear'): void;\n\n /**\n * Emitted when the \"ESC\" key is pressed inside the Search Bar input\n */\n (e: 'escape-pressed'): void;\n\n /**\n * Emitted when the element has lost focus\n */\n (e: 'blur'): void;\n\n /**\n * Emitted when the element has received focus\n */\n (e: 'focus'): void;\n }>();\n\n provide(INPUT_FIELD_HINT_INJECTION_KEY, toRef(props, 'hint'));\n\n const attrs = useAttrs();\n const searchTerm = ref(props.value);\n const bentoInputField = ref<InstanceType<typeof BentoInputField> | null>();\n\n watch(\n () => props.value,\n () => {\n searchTerm.value = props.value;\n },\n { immediate: true }\n );\n\n const onClearSearch = () => {\n searchTerm.value = '';\n emit('clear');\n emit('input', '');\n };\n\n const debouncedEmit = debounce(() => {\n emit('input', searchTerm.value);\n }, props.debounceTime);\n\n const onInputEvent = (value: string) => {\n searchTerm.value = value;\n debouncedEmit();\n };\n\n const focus = () => {\n // bentoInputField.value?.focusInput();\n bentoInputField.value.focusInput();\n };\n\n // Expose method so that it can be used to focus on the input from outside the component\n defineExpose({\n /**\n * Focus on the input field when called.\n */\n focus,\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Search functionality to help users find the desired data quicker.\n * When a user starts typing, the data is dynamically filtered to\n * only show the relevant results.\n *\n * Clearing the search field displays the entire list again.\n *\n * @example\n * import {\n * BentoSearchBar,\n * BentoSearchBarData,\n * useSearchBarFilter\n * } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSearchBar },\n * template: `\n * <bento-search-bar\n * input-field-aria-label=\"Search bar\"\n * v-model=\"searchTerm\"\n * @input=\"onInput\"\n * @clear=\"onClearSearch\"\n * />\n * // Render the filtered data\n * {{ filteredData }}\n * `,\n * setup() {\n * const searchTerm = ref('');\n * const data = ref<BentoSearchBarData>([]);\n * const filteredData = useSearchBarFilter(searchTerm, data);\n *\n * consdt onInput = () => {}\n * consdt onClearSearch = () => {}\n *\n * return {\n * searchTerm,\n * filteredData,\n * onInput,\n * onClearSearch,\n * };\n * }\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./search-bar.scss\" />\n"],"names":["BentoSearchBarInternalEvent","BentoSearchBarInternalEvent2","BentoSearchBarEvent","BentoSearchBarEvent2","__default__","messages","t","useI18n","props","__props","emit","__emit","provide","INPUT_FIELD_HINT_INJECTION_KEY","toRef","attrs","useAttrs","searchTerm","ref","bentoInputField","watch","onClearSearch","debouncedEmit","debounce","onInputEvent","value","__expose"],"mappings":";;;;;;;;;AAAY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,SAAA,kBACAA,EAAA,QAAA,SACAA,EAAA,SAAA,sBAJQA,IAAAD,KAAA,CAAA,CAAA,GAOAE,IAAA,kBAAAC,OACRA,EAAA,QAAA,gBACAA,EAAA,QAAA,gBACAA,EAAA,SAAA,sBAHQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;;;;;;kCCyKRE,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;AA/HA,UAAA,EAAA,GAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAF,EAAA,CAAA,GAEAG,IAAAC,GASAC,IAAAC;AA2BA,IAAAC,EAAAC,GAAAC,EAAAN,GAAA,MAAA,CAAA;AAEA,UAAAO,IAAAC,EAAA,GACAC,IAAAC,EAAAV,EAAA,KAAA,GACAW,IAAAD,EAAA;AAEA,IAAAE;AAAA,MAAA,MAAAZ,EAAA;AAAA,MACgB,MAAA;AAER,QAAAS,EAAA,QAAAT,EAAA;AAAA,MAAyB;AAAA,MAC7B,EAAA,WAAA,GAAA;AAAA,IACkB;AAGtB,UAAAa,IAAA,MAAA;AACI,MAAAJ,EAAA,QAAA,IACAP,EAAA,OAAA,GACAA,EAAA,SAAA,EAAA;AAAA,IAAgB,GAGpBY,IAAAC,EAAA,MAAA;AACI,MAAAb,EAAA,SAAAO,EAAA,KAAA;AAAA,IAA8B,GAAAT,EAAA,YAAA,GAGlCgB,IAAA,CAAAC,MAAA;AACI,MAAAR,EAAA,QAAAQ,GACAH,EAAA;AAAA,IAAc;AASlB,WAAAI,EAAA;AAAA;AAAA;AAAA;AAAA,MAAa,OANb,MAAA;AAEI,QAAAP,EAAA,MAAA,WAAA;AAAA,MAAiC;AAAA,IAQjC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as g, inject as E, computed as u, createElementBlock as s, openBlock as a, normalizeClass as O, createVNode as f, unref as t, withCtx as I, createTextVNode as V, toDisplayString as w, createElementVNode as T, Fragment as B, renderList as N, ref as x, readonly as L, watch as M, provide as j, createBlock as y } from "vue";
|
|
2
|
-
import { B as F } from "./dropdown.
|
|
2
|
+
import { B as F } from "./dropdown.cUORKsFC.js";
|
|
3
3
|
import { g as U } from "./index.E60QniEu.js";
|
|
4
4
|
import { u as q } from "./index.pdBj0KQU.js";
|
|
5
5
|
import { a as z } from "./es6.MoTTyETW.js";
|
|
@@ -135,4 +135,4 @@ const C = Symbol("secondary nav state"), Q = ["aria-selected"], R = {}, Y = /* @
|
|
|
135
135
|
export {
|
|
136
136
|
ie as s
|
|
137
137
|
};
|
|
138
|
-
//# sourceMappingURL=secondary-nav.
|
|
138
|
+
//# sourceMappingURL=secondary-nav.CKA07_TU.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secondary-nav.
|
|
1
|
+
{"version":3,"file":"secondary-nav.CKA07_TU.js","sources":["../../../vue2/src/components/secondary-nav/secondary-nav.keys.ts","../../../vue2/src/components/secondary-nav/components/secondary-nav-item/secondary-nav-item.vue","../../../vue2/src/components/secondary-nav/components/secondary-nav-category/secondary-nav-category.vue","../../../vue2/src/components/secondary-nav/secondary-nav.vue"],"sourcesContent":["import { type InjectionKey } from 'vue';\nimport { type BentoSecondaryNavState } from './secondary-nav.types';\n\nexport const SECONDARY_NAV_STATE = Symbol('secondary nav state') as InjectionKey<BentoSecondaryNavState>;\n","<template>\n <button class=\"b-secondary-nav-item\" :class=\"conditionalClasses\" :aria-selected=\"isItemSelected\" @click=\"onClick\">\n <bento-typography class=\"b-secondary-nav-item__title\" variant=\"body\" stronger>\n {{ label }}\n </bento-typography>\n </button>\n</template>\n\n<script lang=\"ts\" setup>\n import { SECONDARY_NAV_STATE } from '../../secondary-nav.keys';\n import { BentoTypography } from '@/components/typography';\n import { computed, inject } from 'vue';\n\n const { activeItemValue, updateActiveItemValue } = inject(SECONDARY_NAV_STATE);\n\n const props = defineProps<{\n /**\n * The display name of the navigation item\n */\n label: string;\n /**\n * The value of this item.\n */\n value: string;\n }>();\n\n const isItemSelected = computed(() => activeItemValue.value === props.value);\n\n const conditionalClasses = computed(() => ({\n 'b-secondary-nav-item--active': isItemSelected.value,\n }));\n\n const emit = defineEmits<{\n /**\n * Event emitted when this element is clicked\n */\n (e: 'click', clickEvent: MouseEvent): void;\n }>();\n\n const onClick = (e: MouseEvent) => {\n emit('click', e);\n updateActiveItemValue(props.value);\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * This component shouldn't be used directly. It is internally used by {@see BentoSecondaryNav}\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav-item.scss\" />\n","<template>\n <section class=\"b-secondary-nav-category\" :aria-label=\"label\">\n <bento-typography el=\"h1\" class=\"b-secondary-nav-category__label\" variant=\"caption\" stronger>{{\n label\n }}</bento-typography>\n <ul class=\"b-secondary-nav__list\">\n <li v-for=\"item in items\" :key=\"item.value\">\n <secondary-nav-item :label=\"item.label\" :value=\"item.value\" />\n </li>\n </ul>\n </section>\n</template>\n\n<script lang=\"ts\" setup>\n import { BentoTypography } from '@/components/typography';\n import { SecondaryNavItem } from '../secondary-nav-item';\n import { type BentoSecondaryNavItemsItem } from '../../secondary-nav.types';\n\n defineProps<{\n /**\n * The display name of the category\n */\n label: string;\n /**\n * A list of {@see BentoSecondaryNavItemsItem} that belongs to this category\n */\n items: Array<BentoSecondaryNavItemsItem>;\n }>();\n</script>\n\n<script lang=\"ts\">\n /**\n * This component shouldn't be used directly. It is internally used by {@see BentoSecondaryNav}\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav-category.scss\" />\n","<template>\n <nav class=\"b-secondary-nav\">\n <bento-dropdown\n v-if=\"isMobile\"\n :aria-label=\"t('mobileDropdownAriaLabel')\"\n :items=\"dropdownItems\"\n :static-categories=\"hasCategories\"\n :model-value=\"activeItemValue\"\n @update:model-value=\"updateActiveItemValue\"\n />\n <ul v-else class=\"b-secondary-nav__list\">\n <li v-for=\"item in items\" :key=\"item.label\">\n <secondary-nav-category v-if=\"'items' in item\" :label=\"item.label\" :items=\"item.items\" />\n <secondary-nav-item v-else :label=\"item.label\" :value=\"item.value\" />\n </li>\n </ul>\n </nav>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, provide, readonly, ref, watch } from 'vue';\n import { SecondaryNavItem } from './components/secondary-nav-item';\n import { SecondaryNavCategory } from './components/secondary-nav-category';\n import { SECONDARY_NAV_STATE } from './secondary-nav.keys';\n import { type BentoSecondaryNavItems, type BentoSecondaryNavState } from './secondary-nav.types';\n import { BentoDropdown } from '@/components/dropdown';\n import { useBreakpoints } from '@vueuse/core';\n import { useI18n } from '@/utils/ts/i18n';\n import { type BentoListboxOptions } from '@/types/listbox';\n import { BMediaQuerySMax } from '@adyen/bento-design-tokens/dist/js/bento/es6';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const breakpoints = useBreakpoints({\n s: BMediaQuerySMax,\n });\n\n const isMobile = breakpoints.smallerOrEqual('s');\n const props = defineProps<{\n /**\n * An array containing all the items on the nav. The array can have either {@see BentoSecondaryNavItemsCategory },\n * which is used to group different items or {@see BentoSecondaryNavItemsItem } if you don't need to group them.\n */\n items: BentoSecondaryNavItems;\n /**\n * The value of the selected item.\n * If nothing is passed, it defaults to the first item value in items.\n */\n value?: string;\n }>();\n\n const emit = defineEmits<{\n /**\n * Emmited when the current selected item changes\n */\n (e: 'change', category: string): void;\n }>();\n\n const hasCategories = computed(() => props.items.some(item => Object.hasOwn(item, 'items')));\n const dropdownItems = computed(() => props.items as BentoListboxOptions);\n\n const activeItemValueFallback = computed(() => {\n const firstDropdownItem = (dropdownItems.value as BentoSecondaryNavItems)[0];\n\n if ('items' in firstDropdownItem) {\n return firstDropdownItem.items[0].value;\n } else {\n return firstDropdownItem.value;\n }\n });\n const activeItemValue = ref(props.value ?? activeItemValueFallback.value);\n const updateActiveItemValue = (value: string) => {\n activeItemValue.value = value;\n emit('change', value);\n };\n\n // The component's state is inject on `secondary-nav-item` to determine the\n // current active item and to change its value\n const state: BentoSecondaryNavState = {\n activeItemValue: readonly(activeItemValue),\n updateActiveItemValue,\n };\n\n watch(\n () => props.value,\n value => {\n activeItemValue.value = value;\n }\n );\n\n provide(SECONDARY_NAV_STATE, state);\n</script>\n\n<script lang=\"ts\">\n /**\n * Secondary Nav offers users a structured way to access information.\n * It also provides a clear hierarchy for users to understand and navigate through various information.\n *\n * @example\n * import { BentoSecondaryNav } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSecondaryNav },\n * template: `\n * <bento-secondary-nav :value=\"value\" :items=\"items\" />\n * `,\n * setup() {\n * const value = ref(2) // Active item value\n * const items: BentoSecondaryNavItemInfo[] = [\n * { label: 'Option 1', value: 1 },\n * { label: 'Option 2', value: 2 },\n * ];\n * return { items, value };\n * }\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./secondary-nav.scss\" />\n"],"names":["SECONDARY_NAV_STATE","__default__$2","activeItemValue","updateActiveItemValue","inject","props","__props","isItemSelected","computed","conditionalClasses","emit","__emit","onClick","e","__default__$1","__default__","messages","t","useI18n","isMobile","useBreakpoints","BMediaQuerySMax","hasCategories","item","dropdownItems","activeItemValueFallback","firstDropdownItem","ref","value","state","readonly","watch","provide"],"mappings":";;;;;;;;AAGa,MAAAA,IAAA,OAAA,qBAAA,0BC8CTC,IAAA,CAAA;;;;;;;;;AApCA,UAAA,EAAA,iBAAAC,GAAA,uBAAAC,EAAA,IAAAC,EAAAJ,CAAA,GAEAK,IAAAC,GAWAC,IAAAC,EAAA,MAAAN,EAAA,UAAAG,EAAA,KAAA,GAEAI,IAAAD,EAAA,OAAA;AAAA,MAA2C,gCAAAD,EAAA;AAAA,IACQ,EAAA,GAGnDG,IAAAC,GAOAC,IAAA,CAAAC,MAAA;AACI,MAAAH,EAAA,SAAAG,CAAA,GACAV,EAAAE,EAAA,KAAA;AAAA,IAAiC;;;;;;;;;;;;;;;;;;8HCPrCS,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GCsFAC,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;AAvFA,UAAA,EAAA,GAAAC,EAAA,IAAAC,EAAA,EAAA,UAAAF,EAAA,CAAA,GAMAG,IAJAC,EAAA;AAAA,MAAmC,GAAAC;AAAA,IAC5B,CAAA,EAGP,eAAA,GAAA,GACAhB,IAAAC,GAaAI,IAAAC,GAOAW,IAAAd,EAAA,MAAAH,EAAA,MAAA,KAAA,CAAAkB,MAAA,OAAA,OAAAA,GAAA,OAAA,CAAA,CAAA,GACAC,IAAAhB,EAAA,MAAAH,EAAA,KAAA,GAEAoB,IAAAjB,EAAA,MAAA;AACI,YAAAkB,IAAAF,EAAA,MAAA,CAAA;AAEA,aAAA,WAAAE,IACIA,EAAA,MAAA,CAAA,EAAA,QAEAA,EAAA;AAAA,IACJ,CAAA,GAEJxB,IAAAyB,EAAAtB,EAAA,SAAAoB,EAAA,KAAA,GACAtB,IAAA,CAAAyB,MAAA;AACI,MAAA1B,EAAA,QAAA0B,GACAlB,EAAA,UAAAkB,CAAA;AAAA,IAAoB,GAKxBC,IAAA;AAAA,MAAsC,iBAAAC,EAAA5B,CAAA;AAAA,MACO,uBAAAC;AAAA,IACzC;AAGJ,WAAA4B;AAAA,MAAA,MAAA1B,EAAA;AAAA,MACgB,CAAAuB,MAAA;AAER,QAAA1B,EAAA,QAAA0B;AAAA,MAAwB;AAAA,IAC5B,GAGJI,EAAAhC,GAAA6B,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|