@adyen/bento-vue2 1.34.0 → 1.35.1
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 +2 -2
- package/dist/accordion.js +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/avatar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/calendar.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/checkbox.css +1 -1
- package/dist/assets/code-snippet.css +1 -1
- package/dist/assets/currency.css +1 -0
- 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/dropdown.css +1 -1
- package/dist/assets/error-message.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/header.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/loading-button.css +1 -1
- package/dist/assets/menu.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/popover.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/structured-list-item.css +1 -1
- package/dist/assets/tutorial.css +1 -1
- package/dist/avatar.js +1 -1
- package/dist/button.js +2 -2
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/accordion-item.BDNSykyK.js +116 -0
- package/dist/chunks/accordion-item.BDNSykyK.js.map +1 -0
- package/dist/chunks/{action-bar.CsRmYQ-k.js → action-bar.CCVKS1xo.js} +51 -37
- package/dist/chunks/{action-bar.CsRmYQ-k.js.map → action-bar.CCVKS1xo.js.map} +1 -1
- package/dist/chunks/{alert.DtT7BRdr.js → alert.CVsckdGC.js} +17 -11
- package/dist/chunks/{alert.DtT7BRdr.js.map → alert.CVsckdGC.js.map} +1 -1
- package/dist/chunks/{avatar.0ffdL8i0.js → avatar.qcWk9clF.js} +9 -9
- package/dist/chunks/avatar.qcWk9clF.js.map +1 -0
- package/dist/chunks/{base-modal.zHjXVjwU.js → base-modal.BaHkDH5f.js} +15 -9
- package/dist/chunks/{base-modal.zHjXVjwU.js.map → base-modal.BaHkDH5f.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.B6Nb6Ohu.js → button-actions-with-menu.Bl82u6yP.js} +4 -4
- package/dist/chunks/{button-actions-with-menu.B6Nb6Ohu.js.map → button-actions-with-menu.Bl82u6yP.js.map} +1 -1
- package/dist/chunks/{button-actions.BQHr68sA.js → button-actions.DN4eIQes.js} +2 -2
- package/dist/chunks/{button-actions.BQHr68sA.js.map → button-actions.DN4eIQes.js.map} +1 -1
- package/dist/chunks/{calendar.CaTMWZUM.js → calendar.BFrqPClW.js} +230 -230
- package/dist/chunks/calendar.BFrqPClW.js.map +1 -0
- package/dist/chunks/card.lWLgpCWM.js +123 -0
- package/dist/chunks/card.lWLgpCWM.js.map +1 -0
- package/dist/chunks/{checkbox-group.D_mCZMPr.js → checkbox-group.C0cqbJWx.js} +4 -4
- package/dist/chunks/{checkbox-group.D_mCZMPr.js.map → checkbox-group.C0cqbJWx.js.map} +1 -1
- package/dist/chunks/{checkbox.CaX67eM_.js → checkbox.B3u_hzUo.js} +38 -28
- package/dist/chunks/{checkbox.CaX67eM_.js.map → checkbox.B3u_hzUo.js.map} +1 -1
- package/dist/chunks/{code-snippet.DgKK7fE8.js → code-snippet.BgjvWTHP.js} +43 -34
- package/dist/chunks/code-snippet.BgjvWTHP.js.map +1 -0
- package/dist/chunks/{controls-group.6aTaRWFI.js → controls-group.DLBxlPfl.js} +2 -2
- package/dist/chunks/{controls-group.6aTaRWFI.js.map → controls-group.DLBxlPfl.js.map} +1 -1
- package/dist/chunks/{copy.B1DYKX_q.js → copy.CmxcGt77.js} +31 -23
- package/dist/chunks/{copy.B1DYKX_q.js.map → copy.CmxcGt77.js.map} +1 -1
- package/dist/chunks/{currency.D_2CN1OJ.js → currency.CbZqZrBz.js} +9 -8
- package/dist/chunks/{currency.D_2CN1OJ.js.map → currency.CbZqZrBz.js.map} +1 -1
- package/dist/chunks/{dashboard-section.DWfQGGwS.js → dashboard-section.BfXtTf6l.js} +2 -2
- package/dist/chunks/{dashboard-section.DWfQGGwS.js.map → dashboard-section.BfXtTf6l.js.map} +1 -1
- package/dist/chunks/{dashed-underline.C7gLtEqx.js → dashed-underline.xq5j9fGG.js} +2 -2
- package/dist/chunks/{dashed-underline.C7gLtEqx.js.map → dashed-underline.xq5j9fGG.js.map} +1 -1
- package/dist/chunks/{data-grid-template.2xocKVqX.js → data-grid-template.C8AR5CxA.js} +2 -2
- package/dist/chunks/{data-grid-template.2xocKVqX.js.map → data-grid-template.C8AR5CxA.js.map} +1 -1
- package/dist/chunks/{data-grid.CUn6MrZz.js → data-grid.BCTcokYm.js} +472 -426
- package/dist/chunks/{data-grid.CUn6MrZz.js.map → data-grid.BCTcokYm.js.map} +1 -1
- package/dist/chunks/{date-picker.C6_KbCYT.js → date-picker.CPG0zksD.js} +91 -83
- package/dist/chunks/date-picker.CPG0zksD.js.map +1 -0
- package/dist/chunks/{date-range-picker.DaTgBXP1.js → date-range-picker.Bt439x32.js} +265 -243
- package/dist/chunks/date-range-picker.Bt439x32.js.map +1 -0
- package/dist/chunks/{date.DaiTzNEZ.js → date.C0uwNQjg.js} +80 -80
- package/dist/chunks/{date.DaiTzNEZ.js.map → date.C0uwNQjg.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.pJ_sQbJN.js → dropdown-tag.Cd4LGtwl.js} +3 -3
- package/dist/chunks/{dropdown-tag.pJ_sQbJN.js.map → dropdown-tag.Cd4LGtwl.js.map} +1 -1
- package/dist/chunks/{dropdown.DpsQPLy-.js → dropdown.B4KMM58m.js} +158 -139
- package/dist/chunks/dropdown.B4KMM58m.js.map +1 -0
- package/dist/chunks/{error-message.BnFyGbR7.js → error-message.GCYDEzGL.js} +28 -14
- package/dist/chunks/{error-message.BnFyGbR7.js.map → error-message.GCYDEzGL.js.map} +1 -1
- package/dist/chunks/es6.BvpG4Oi6.js.map +1 -1
- package/dist/chunks/{filter-bar.DGBvcKsz.js → filter-bar.Co2YeUUg.js} +604 -589
- package/dist/chunks/filter-bar.Co2YeUUg.js.map +1 -0
- package/dist/chunks/{footer-actions.CwHY2-Ap.js → footer-actions.CxxS87iQ.js} +2 -2
- package/dist/chunks/{footer-actions.CwHY2-Ap.js.map → footer-actions.CxxS87iQ.js.map} +1 -1
- package/dist/chunks/{form-layout-title.CRsR3o2x.js → form-layout-title.DomnJXLE.js} +2 -2
- package/dist/chunks/{form-layout-title.CRsR3o2x.js.map → form-layout-title.DomnJXLE.js.map} +1 -1
- package/dist/chunks/{index.B_UZQ6qF.js → get-date-locale.BN8xEjY0.js} +855 -204
- package/dist/chunks/get-date-locale.BN8xEjY0.js.map +1 -0
- package/dist/chunks/{header.BmNDoXio.js → header.zacQVbjn.js} +79 -73
- package/dist/chunks/{header.BmNDoXio.js.map → header.zacQVbjn.js.map} +1 -1
- package/dist/chunks/{index.Z84QE0E2.js → index.CrhTVr5J.js} +2 -2
- package/dist/chunks/{index.Z84QE0E2.js.map → index.CrhTVr5J.js.map} +1 -1
- package/dist/chunks/{index.xqFSZOAb.js → index.DDnf1O9p.js} +2 -2
- package/dist/chunks/{index.xqFSZOAb.js.map → index.DDnf1O9p.js.map} +1 -1
- package/dist/chunks/{index.B_EJflcs.js → index.DPafeRJa.js} +2 -2
- package/dist/chunks/{index.B_EJflcs.js.map → index.DPafeRJa.js.map} +1 -1
- package/dist/chunks/{input-field.S5HIZtYA.js → input-field.DBrzeKBj.js} +3 -3
- package/dist/chunks/{input-field.S5HIZtYA.js.map → input-field.DBrzeKBj.js.map} +1 -1
- package/dist/chunks/{inspector.types.D6kCCKNk.js → inspector.types.lu_MoQn5.js} +17 -9
- package/dist/chunks/{inspector.types.D6kCCKNk.js.map → inspector.types.lu_MoQn5.js.map} +1 -1
- package/dist/chunks/{loading-button.DDPZYO6r.js → loading-button.DoX2sopf.js} +39 -25
- package/dist/chunks/loading-button.DoX2sopf.js.map +1 -0
- package/dist/chunks/{menu.DSOJEn4v.js → menu.DHakGFS4.js} +2 -2
- package/dist/chunks/{menu.DSOJEn4v.js.map → menu.DHakGFS4.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.BQKE0bm0.js → modal-fullscreen.mIlp0LnL.js} +25 -19
- package/dist/chunks/{modal-fullscreen.BQKE0bm0.js.map → modal-fullscreen.mIlp0LnL.js.map} +1 -1
- package/dist/chunks/{modal.ClqkmzVZ.js → modal.CtTQWN8H.js} +25 -19
- package/dist/chunks/modal.CtTQWN8H.js.map +1 -0
- package/dist/chunks/{pagination.he0lQGAV.js → pagination.By-p9MjL.js} +2 -2
- package/dist/chunks/{pagination.he0lQGAV.js.map → pagination.By-p9MjL.js.map} +1 -1
- package/dist/chunks/{popover.UmNw_M-C.js → popover.BDaf6hmW.js} +2 -2
- package/dist/chunks/{popover.UmNw_M-C.js.map → popover.BDaf6hmW.js.map} +1 -1
- package/dist/chunks/{radio-group.D7cuMKzV.js → radio-group.OaYz1wJf.js} +3 -3
- package/dist/chunks/{radio-group.D7cuMKzV.js.map → radio-group.OaYz1wJf.js.map} +1 -1
- package/dist/chunks/{search-bar.BPyYb0WB.js → search-bar.eC-crOww.js} +14 -6
- package/dist/chunks/{search-bar.BPyYb0WB.js.map → search-bar.eC-crOww.js.map} +1 -1
- package/dist/chunks/{secondary-nav.CMUfpgQf.js → secondary-nav.1xw-o8OR.js} +2 -2
- package/dist/chunks/{secondary-nav.CMUfpgQf.js.map → secondary-nav.1xw-o8OR.js.map} +1 -1
- package/dist/chunks/{selection-card-group.DbMfzyTG.js → selection-card-group.BLPaJy5U.js} +3 -3
- package/dist/chunks/{selection-card-group.DbMfzyTG.js.map → selection-card-group.BLPaJy5U.js.map} +1 -1
- package/dist/chunks/{sidepanel.Ck6Ts9RR.js → sidepanel.ZYT_vzbj.js} +24 -18
- package/dist/chunks/{sidepanel.Ck6Ts9RR.js.map → sidepanel.ZYT_vzbj.js.map} +1 -1
- package/dist/chunks/{structured-list-item.DpLscUX4.js → structured-list-item.D7D8VpQY.js} +22 -16
- package/dist/chunks/{structured-list-item.DpLscUX4.js.map → structured-list-item.D7D8VpQY.js.map} +1 -1
- package/dist/chunks/{summary-grid-item-custom.B7Re6OCf.js → summary-grid-item-custom.v0QSLZKT.js} +2 -2
- package/dist/chunks/{summary-grid-item-custom.B7Re6OCf.js.map → summary-grid-item-custom.v0QSLZKT.js.map} +1 -1
- package/dist/chunks/{textarea.BRMpTWKS.js → textarea.C0IMS5XS.js} +2 -2
- package/dist/chunks/{textarea.BRMpTWKS.js.map → textarea.C0IMS5XS.js.map} +1 -1
- package/dist/chunks/{timeline-item.jh7UnviR.js → timeline-item.Dmd78uwQ.js} +53 -47
- package/dist/chunks/{timeline-item.jh7UnviR.js.map → timeline-item.Dmd78uwQ.js.map} +1 -1
- package/dist/chunks/{tutorial.DERGsCkg.js → tutorial.D64_0i0-.js} +50 -38
- package/dist/chunks/{tutorial.DERGsCkg.js.map → tutorial.D64_0i0-.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.B39-iEp4.js → use-cached-selected-values.BOAumEi7.js} +54 -40
- package/dist/chunks/{use-cached-selected-values.B39-iEp4.js.map → use-cached-selected-values.BOAumEi7.js.map} +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/currency.js +1 -1
- package/dist/dashboard-template.js +1 -1
- package/dist/dashed-underline.js +1 -1
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/dropdown.js +3 -3
- package/dist/filter-bar.js +1 -1
- package/dist/form-layout.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +43 -43
- package/dist/input-field.js +1 -1
- package/dist/inspector.js +1 -1
- package/dist/internal.js +5 -5
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/pagination.js +1 -1
- package/dist/popover.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/sidepanel.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/styles/bento.css +3 -0
- package/dist/styles/legacy.css +3 -0
- package/dist/styles/styleguide.css +3 -0
- package/dist/summary-grid.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/web-types.json +9 -9
- package/package.json +2 -2
- package/dist/chunks/accordion-item.IMlV_Vik.js +0 -100
- package/dist/chunks/accordion-item.IMlV_Vik.js.map +0 -1
- package/dist/chunks/avatar.0ffdL8i0.js.map +0 -1
- package/dist/chunks/calendar.CaTMWZUM.js.map +0 -1
- package/dist/chunks/card.ignL7-CH.js +0 -115
- package/dist/chunks/card.ignL7-CH.js.map +0 -1
- package/dist/chunks/code-snippet.DgKK7fE8.js.map +0 -1
- package/dist/chunks/date-picker.C6_KbCYT.js.map +0 -1
- package/dist/chunks/date-range-picker.DaTgBXP1.js.map +0 -1
- package/dist/chunks/dropdown.DpsQPLy-.js.map +0 -1
- package/dist/chunks/filter-bar.DGBvcKsz.js.map +0 -1
- package/dist/chunks/index.B_UZQ6qF.js.map +0 -1
- package/dist/chunks/loading-button.DDPZYO6r.js.map +0 -1
- package/dist/chunks/modal.ClqkmzVZ.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as x, computed as c, ref as b, toRefs as O, watch as g, provide as
|
|
2
|
-
import { B as
|
|
1
|
+
import { defineComponent as x, computed as c, ref as b, toRefs as O, watch as g, provide as P, nextTick as B } from "vue";
|
|
2
|
+
import { B as V } from "./button.79klAcOK.js";
|
|
3
3
|
import { B as R } from "./typography.CqQaHXhq.js";
|
|
4
|
-
import { B as F } from "./button-actions-with-menu.
|
|
4
|
+
import { B as F } from "./button-actions-with-menu.Bl82u6yP.js";
|
|
5
5
|
import { C as W } from "./cross.CsUPDmaA.js";
|
|
6
6
|
import { u as L } from "./i18n.BQkEbtPM.js";
|
|
7
7
|
import { u as k } from "./index.iCshT3Hx.js";
|
|
8
|
-
import { P as M } from "./popover.
|
|
9
|
-
import { B as U } from "./button-actions.
|
|
8
|
+
import { P as M } from "./popover.BDaf6hmW.js";
|
|
9
|
+
import { B as U } from "./button-actions.DN4eIQes.js";
|
|
10
10
|
import { n as z } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
11
11
|
import "../assets/action-bar.css";
|
|
12
12
|
const D = {
|
|
@@ -17,10 +17,24 @@ const D = {
|
|
|
17
17
|
save: "Save",
|
|
18
18
|
selected: "selected",
|
|
19
19
|
unsavedChanges: "unsaved change | unsaved changes"
|
|
20
|
+
},
|
|
21
|
+
"pt-BR": {
|
|
22
|
+
cancel: "Cancelar",
|
|
23
|
+
close: "Fechar",
|
|
24
|
+
save: "Salvar",
|
|
25
|
+
selected: "selecionados",
|
|
26
|
+
unsavedChanges: "alteração não salva | alterações não salvas"
|
|
27
|
+
},
|
|
28
|
+
"ja-JP": {
|
|
29
|
+
cancel: "キャンセル",
|
|
30
|
+
close: "閉じる",
|
|
31
|
+
save: "保存",
|
|
32
|
+
selected: "選択済み",
|
|
33
|
+
unsavedChanges: "未保存の変更"
|
|
20
34
|
}
|
|
21
35
|
}, G = {
|
|
22
36
|
i18n: { messages: D }
|
|
23
|
-
},
|
|
37
|
+
}, J = /* @__PURE__ */ x({
|
|
24
38
|
...G,
|
|
25
39
|
__name: "action-bar",
|
|
26
40
|
props: {
|
|
@@ -45,7 +59,7 @@ const D = {
|
|
|
45
59
|
visibleActions: {
|
|
46
60
|
type: Number,
|
|
47
61
|
default: 4,
|
|
48
|
-
validator: (
|
|
62
|
+
validator: (o) => o > 0 && o <= 4
|
|
49
63
|
},
|
|
50
64
|
/**
|
|
51
65
|
* Use when there are sticky elements at the bottom, like sticky pagination
|
|
@@ -78,12 +92,12 @@ const D = {
|
|
|
78
92
|
}
|
|
79
93
|
},
|
|
80
94
|
emits: ["close", "cancel", "save"],
|
|
81
|
-
setup(
|
|
82
|
-
const
|
|
95
|
+
setup(o, { emit: e }) {
|
|
96
|
+
const a = o, t = 100, v = 7, C = 500, m = 32, { t: r, tc: S } = L(), E = c(() => a.selectionLabel ? a.selectionLabel : r("selected")), l = b(null), { extraBottomSpacing: y, visibleActions: A } = O(a), { width: i } = k(), n = b(null), u = b(null), h = c(() => a.variant === "confirmation");
|
|
83
97
|
g(
|
|
84
98
|
() => A.value,
|
|
85
|
-
(
|
|
86
|
-
u.value =
|
|
99
|
+
(s) => {
|
|
100
|
+
u.value = s <= 4 ? s : 4, n.value = u.value;
|
|
87
101
|
},
|
|
88
102
|
{ immediate: !0 }
|
|
89
103
|
);
|
|
@@ -91,57 +105,57 @@ const D = {
|
|
|
91
105
|
"b-action-bar--extra-spacing": y.value,
|
|
92
106
|
"b-action-bar--confirmation": h.value
|
|
93
107
|
}));
|
|
94
|
-
|
|
108
|
+
P(M, v);
|
|
95
109
|
const T = c(() => {
|
|
96
|
-
const
|
|
110
|
+
const s = a.actions.map((w) => ({
|
|
97
111
|
...w,
|
|
98
112
|
variant: "secondary"
|
|
99
|
-
})),
|
|
100
|
-
return [...
|
|
113
|
+
})), _ = s.slice(0, n.value).reverse(), f = s.slice(n.value);
|
|
114
|
+
return [..._, ...f];
|
|
101
115
|
}), N = c(() => [
|
|
102
116
|
{
|
|
103
117
|
title: r("save"),
|
|
104
|
-
event: () =>
|
|
118
|
+
event: () => e("save")
|
|
105
119
|
},
|
|
106
120
|
{
|
|
107
121
|
title: r("cancel"),
|
|
108
122
|
variant: "secondary",
|
|
109
|
-
event: () =>
|
|
123
|
+
event: () => e("cancel")
|
|
110
124
|
}
|
|
111
|
-
]),
|
|
112
|
-
await B(), i.value > l.value.clientWidth +
|
|
113
|
-
},
|
|
114
|
-
await B(), i.value < l.value.clientWidth +
|
|
125
|
+
]), d = async () => {
|
|
126
|
+
await B(), i.value > l.value.clientWidth + m + t && n.value < u.value && (n.value += 1, d());
|
|
127
|
+
}, p = async () => {
|
|
128
|
+
await B(), i.value < l.value.clientWidth + m && n.value > 0 && (n.value -= 1, p());
|
|
115
129
|
};
|
|
116
130
|
return g(
|
|
117
131
|
() => i.value,
|
|
118
|
-
async (
|
|
132
|
+
async (s, _) => {
|
|
119
133
|
if (await B(), !l.value)
|
|
120
134
|
return;
|
|
121
|
-
const
|
|
122
|
-
i.value < C ?
|
|
135
|
+
const f = s > _;
|
|
136
|
+
i.value < C ? n.value = 0 : f ? d() : p();
|
|
123
137
|
},
|
|
124
138
|
{ immediate: !0 }
|
|
125
|
-
), { __sfc: !0, AVERAGE_BUTTON_SIZE: t, MENU_OFFSET:
|
|
139
|
+
), { __sfc: !0, AVERAGE_BUTTON_SIZE: t, MENU_OFFSET: v, RESPONSIVE_BREAKPOINT: C, SPACING: m, props: a, emit: e, t: r, tc: S, label: E, actionBar: l, extraBottomSpacing: y, visibleActions: A, width: i, internalDisplayedActions: n, internalVisibleActions: u, isConfirmationVariant: h, conditionalClasses: I, actionsInternal: T, confirmationActions: N, showActions: d, hideActions: p, BentoButton: V, BentoButtonActions: U, BentoTypography: R, ButtonActionsWithMenu: F, CrossIcon: W };
|
|
126
140
|
}
|
|
127
141
|
});
|
|
128
|
-
var
|
|
129
|
-
var
|
|
130
|
-
return
|
|
142
|
+
var K = function() {
|
|
143
|
+
var e = this, a = e._self._c, t = e._self._setupProxy;
|
|
144
|
+
return a("Transition", { attrs: { name: "b-action-bar__animation", appear: "" } }, [a("section", { staticClass: "b-action-bar", class: t.conditionalClasses, attrs: { "aria-label": t.t("actionBar") } }, [a("div", { ref: "actionBar", staticClass: "b-action-bar__container" }, [t.isConfirmationVariant ? e._e() : a("div", { staticClass: "b-action-bar__close-button" }, [a(t.BentoButton, { attrs: { variant: "tertiary", inverse: "", "aria-label": t.t("close") }, on: { click: function(v) {
|
|
131
145
|
return t.emit("close");
|
|
132
|
-
} }, scopedSlots:
|
|
133
|
-
return [
|
|
134
|
-
}, proxy: !0 }], null, !1, 4214210411) })], 1),
|
|
135
|
-
},
|
|
136
|
-
K,
|
|
137
|
-
q,
|
|
146
|
+
} }, scopedSlots: e._u([{ key: "iconLeft", fn: function() {
|
|
147
|
+
return [a(t.CrossIcon, { attrs: { "aria-hidden": !0 } })];
|
|
148
|
+
}, proxy: !0 }], null, !1, 4214210411) })], 1), a(t.BentoTypography, { staticClass: "b-action-bar__selection", attrs: { el: "span", stronger: "" } }, [e._v(" " + e._s(e.itemCounter) + " " + e._s(t.isConfirmationVariant ? t.tc("unsavedChanges", e.itemCounter) : t.label) + " ")]), t.isConfirmationVariant ? a(t.BentoButtonActions, { staticClass: "b-action-bar__actions", attrs: { actions: t.confirmationActions, inverse: "" } }) : a(t.ButtonActionsWithMenu, { staticClass: "b-action-bar__actions", attrs: { actions: t.actionsInternal, "displayed-actions": t.internalDisplayedActions, "menu-position": "top-end", inverse: "" } })], 1)])]);
|
|
149
|
+
}, j = [], q = /* @__PURE__ */ z(
|
|
138
150
|
J,
|
|
151
|
+
K,
|
|
152
|
+
j,
|
|
139
153
|
!1,
|
|
140
154
|
null,
|
|
141
155
|
"be92816e"
|
|
142
156
|
);
|
|
143
|
-
const
|
|
157
|
+
const st = q.exports;
|
|
144
158
|
export {
|
|
145
|
-
|
|
159
|
+
st as B
|
|
146
160
|
};
|
|
147
|
-
//# sourceMappingURL=action-bar.
|
|
161
|
+
//# sourceMappingURL=action-bar.CCVKS1xo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-bar.CsRmYQ-k.js","sources":["../../src/components/action-bar/action-bar.vue"],"sourcesContent":["<template>\n <Transition name=\"b-action-bar__animation\" appear>\n <section class=\"b-action-bar\" :class=\"conditionalClasses\" :aria-label=\"t('actionBar')\">\n <div ref=\"actionBar\" class=\"b-action-bar__container\">\n <div v-if=\"!isConfirmationVariant\" class=\"b-action-bar__close-button\">\n <bento-button variant=\"tertiary\" inverse :aria-label=\"t('close')\" @click=\"emit('close')\">\n <template #iconLeft><cross-icon :aria-hidden=\"true\" /></template>\n </bento-button>\n </div>\n <bento-typography el=\"span\" stronger class=\"b-action-bar__selection\">\n {{ itemCounter }} {{ isConfirmationVariant ? tc('unsavedChanges', itemCounter) : label }}\n </bento-typography>\n <bento-button-actions\n v-if=\"isConfirmationVariant\"\n :actions=\"confirmationActions\"\n class=\"b-action-bar__actions\"\n inverse\n />\n <button-actions-with-menu\n v-else\n :actions=\"actionsInternal\"\n class=\"b-action-bar__actions\"\n :displayed-actions=\"internalDisplayedActions\"\n menu-position=\"top-end\"\n inverse\n />\n </div>\n </section>\n </Transition>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, PropType, provide, ref, toRefs, watch } from 'vue';\n import { BentoButton, BentoButtonActions, BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n\n import { type BentoActionBarVariant } from '@/components/action-bar/action-bar.types';\n import ButtonActionsWithMenu from '@/components/internal/button-actions-with-menu/button-actions-with-menu.vue';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { useI18n } from '@/utils/ts/i18n';\n import { useWindowSize } from '@vueuse/core';\n\n import messages from './messages.json';\n import { POPOVER_OFFSET_INJECTION_KEY } from '@/components/popover/popover.keys';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n // Constants\n const AVERAGE_BUTTON_SIZE = 100;\n const MENU_OFFSET = 7;\n const RESPONSIVE_BREAKPOINT = 500;\n const SPACING = 32;\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * Required and used for the `default` variant.\n *\n * Each object in the list should have a `title`, an `event` and,\n * optionally, an `icon`.\n *\n * The component will display 4 actions and the hide the rest inside a menu.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: () => [],\n },\n /**\n * How many actions should be visible outside the menu, cannot be more than 4\n */\n visibleActions: {\n type: Number,\n default: 4,\n validator: (value: number) => value > 0 && value <= 4,\n },\n /**\n * Use when there are sticky elements at the bottom, like sticky pagination\n */\n extraBottomSpacing: {\n type: Boolean,\n default: false,\n },\n /**\n * Show how many items are selected\n */\n itemCounter: {\n type: Number,\n required: true,\n },\n /**\n * Label for the selection, e.g. 'selected'/'changed'\n */\n selectionLabel: {\n type: String,\n default: null,\n },\n /**\n * Variant for the action bar\n * @values default, confirmation\n */\n variant: {\n type: String as PropType<BentoActionBarVariant>,\n default: 'default',\n },\n });\n\n const emit = defineEmits([\"close\", \"cancel\", \"save\"]);\n\n const { t, tc } = useI18n<{ message: MessageSchema }>({ messages });\n const label = computed(() => (props.selectionLabel ? props.selectionLabel : t('selected')));\n\n // Refs\n const actionBar = ref<HTMLDivElement>(null);\n const { extraBottomSpacing, visibleActions } = toRefs(props);\n const { width } = useWindowSize();\n const internalDisplayedActions = ref(null);\n const internalVisibleActions = ref(null);\n\n const isConfirmationVariant = computed(() => props.variant === 'confirmation');\n\n watch(\n () => visibleActions.value,\n value => {\n internalVisibleActions.value = value <= 4 ? value : 4;\n internalDisplayedActions.value = internalVisibleActions.value;\n },\n { immediate: true }\n );\n\n // Styling\n const conditionalClasses = computed(() => ({\n 'b-action-bar--extra-spacing': extraBottomSpacing.value,\n 'b-action-bar--confirmation': isConfirmationVariant.value,\n }));\n\n // Provide POPOVER_OFFSET_INJECTION_KEY to change the value of the popover offset\n provide(POPOVER_OFFSET_INJECTION_KEY, MENU_OFFSET);\n\n // Manipulate actions array to display as intended\n const actionsInternal = computed(() => {\n // All buttons should be of type secondary in the action bar\n const actions = props.actions.map(action => ({\n ...action,\n variant: 'secondary',\n })) as BentoButtonActionsList;\n // Shown actions should display from left to right in action bar, instead of right to left which is the button actions default\n const shownActions = actions.slice(0, internalDisplayedActions.value).reverse();\n const hiddenActions = actions.slice(internalDisplayedActions.value);\n\n return [...shownActions, ...hiddenActions];\n });\n\n const confirmationActions = computed<BentoButtonActionsList>(() => [\n {\n title: t('save'),\n event: () => emit('save'),\n },\n {\n title: t('cancel'),\n variant: 'secondary',\n event: () => emit('cancel'),\n },\n ]);\n\n // Recursive functions to determine how many actions should be visible/hidden based on the screens width\n const showActions = async () => {\n await nextTick();\n if (\n width.value > actionBar.value.clientWidth + SPACING + AVERAGE_BUTTON_SIZE &&\n internalDisplayedActions.value < internalVisibleActions.value\n ) {\n internalDisplayedActions.value += 1;\n showActions();\n }\n };\n\n const hideActions = async () => {\n await nextTick();\n if (width.value < actionBar.value.clientWidth + SPACING && internalDisplayedActions.value > 0) {\n internalDisplayedActions.value -= 1;\n hideActions();\n }\n };\n\n // Screen width watcher to toggle hidden/visible actions\n watch(\n () => width.value,\n async (newValue, oldValue) => {\n await nextTick();\n if (!actionBar.value) {\n return;\n }\n const isIncreasing = newValue > oldValue;\n if (width.value < RESPONSIVE_BREAKPOINT) {\n internalDisplayedActions.value = 0;\n } else if (isIncreasing) {\n showActions();\n } else {\n hideActions();\n }\n },\n { immediate: true }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * Action bar is a floating bar that provides users with quick access to key actions that can be applied to one or multiple items.\n *\n * @example\n * import { BentoActionBar } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoActionBar },\n * template: `\n * <bento-action-bar\n * :actions='[\n * {\n * title: 'Delete',\n * critical: true,\n * icon: BinIcon,\n * event: () => true,\n * },\n * {\n * title: 'Edit',\n * icon: EditIcon,\n * event: () => true,\n * }\n * ]'\n * @close=\"closeAction\"\n * :item-counter=\"5\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./action-bar.scss\" />\n"],"names":["__default__","messages","AVERAGE_BUTTON_SIZE","MENU_OFFSET","RESPONSIVE_BREAKPOINT","SPACING","t","tc","useI18n","label","computed","props","actionBar","ref","extraBottomSpacing","visibleActions","toRefs","width","useWindowSize","internalDisplayedActions","internalVisibleActions","isConfirmationVariant","watch","value","conditionalClasses","provide","POPOVER_OFFSET_INJECTION_KEY","actionsInternal","actions","action","shownActions","hiddenActions","confirmationActions","emit","showActions","nextTick","hideActions","newValue","oldValue","isIncreasing"],"mappings":";;;;;;;;;;;;;;;;;;;;GA8OIA,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA/LAC,IAAA,KACAC,IAAA,GACAC,IAAA,KACAC,IAAA,IA2DA,EAAA,GAAAC,GAAA,IAAAC,EAAA,IAAAC,EAAA,GACAC,IAAAC,EAAA,MAAAC,EAAA,iBAAAA,EAAA,iBAAAL,EAAA,UAAA,CAAA,GAGAM,IAAAC,EAAA,IAAA,GACA,EAAA,oBAAAC,GAAA,gBAAAC,EAAA,IAAAC,EAAAL,CAAA,GACA,EAAA,OAAAM,EAAA,IAAAC,EAAA,GACAC,IAAAN,EAAA,IAAA,GACAO,IAAAP,EAAA,IAAA,GAEAQ,IAAAX,EAAA,MAAAC,EAAA,YAAA,cAAA;AAEA,IAAAW;AAAA,MAAA,MAAAP,EAAA;AAAA,MACyB,CAAAQ,MAAA;AAEjB,QAAAH,EAAA,QAAAG,KAAA,IAAAA,IAAA,GACAJ,EAAA,QAAAC,EAAA;AAAA,MAAwD;AAAA,MAC5D,EAAA,WAAA,GAAA;AAAA,IACkB;AAItB,UAAAI,IAAAd,EAAA,OAAA;AAAA,MAA2C,+BAAAI,EAAA;AAAA,MACW,8BAAAO,EAAA;AAAA,IACE,EAAA;AAIxD,IAAAI,EAAAC,GAAAvB,CAAA;AAGA,UAAAwB,IAAAjB,EAAA,MAAA;AAEI,YAAAkB,IAAAjB,EAAA,QAAA,IAAA,CAAAkB,OAAA;AAAA,QAA6C,GAAAA;AAAA,QACtC,SAAA;AAAA,MACM,EAAA,GAGbC,IAAAF,EAAA,MAAA,GAAAT,EAAA,KAAA,EAAA,QAAA,GACAY,IAAAH,EAAA,MAAAT,EAAA,KAAA;AAEA,aAAA,CAAA,GAAAW,GAAA,GAAAC,CAAA;AAAA,IAAyC,CAAA,GAG7CC,IAAAtB,EAAA,MAAA;AAAA,MAAmE;AAAA,QAC/D,OAAAJ,EAAA,MAAA;AAAA,QACmB,OAAA,MAAA2B,EAAA,MAAA;AAAA,MACS;AAAA,MAC5B;AAAA,QACA,OAAA3B,EAAA,QAAA;AAAA,QACqB,SAAA;AAAA,QACR,OAAA,MAAA2B,EAAA,QAAA;AAAA,MACiB;AAAA,IAC9B,CAAA,GAIJC,IAAA,YAAA;AACI,YAAAC,EAAA,GACAlB,EAAA,QAAAL,EAAA,MAAA,cAAAP,IAAAH,KAAAiB,EAAA,QAAAC,EAAA,UAIID,EAAA,SAAA,GACAe,EAAA;AAAA,IACJ,GAGJE,IAAA,YAAA;AACI,YAAAD,EAAA,GACAlB,EAAA,QAAAL,EAAA,MAAA,cAAAP,KAAAc,EAAA,QAAA,MACIA,EAAA,SAAA,GACAiB,EAAA;AAAA,IACJ;AAIJ,WAAAd;AAAA,MAAA,MAAAL,EAAA;AAAA,MACgB,OAAAoB,GAAAC,MAAA;AAGR,YADA,MAAAH,EAAA,GACA,CAAAvB,EAAA;AACI;AAEJ,cAAA2B,IAAAF,IAAAC;AACA,QAAArB,EAAA,QAAAb,IACIe,EAAA,QAAA,IAAiCoB,IAEjCL,EAAA,IAEAE,EAAA;AAAA,MACJ;AAAA,MACJ,EAAA,WAAA,GAAA;AAAA,IACkB;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"action-bar.CCVKS1xo.js","sources":["../../src/components/action-bar/action-bar.vue"],"sourcesContent":["<template>\n <Transition name=\"b-action-bar__animation\" appear>\n <section class=\"b-action-bar\" :class=\"conditionalClasses\" :aria-label=\"t('actionBar')\">\n <div ref=\"actionBar\" class=\"b-action-bar__container\">\n <div v-if=\"!isConfirmationVariant\" class=\"b-action-bar__close-button\">\n <bento-button variant=\"tertiary\" inverse :aria-label=\"t('close')\" @click=\"emit('close')\">\n <template #iconLeft><cross-icon :aria-hidden=\"true\" /></template>\n </bento-button>\n </div>\n <bento-typography el=\"span\" stronger class=\"b-action-bar__selection\">\n {{ itemCounter }} {{ isConfirmationVariant ? tc('unsavedChanges', itemCounter) : label }}\n </bento-typography>\n <bento-button-actions\n v-if=\"isConfirmationVariant\"\n :actions=\"confirmationActions\"\n class=\"b-action-bar__actions\"\n inverse\n />\n <button-actions-with-menu\n v-else\n :actions=\"actionsInternal\"\n class=\"b-action-bar__actions\"\n :displayed-actions=\"internalDisplayedActions\"\n menu-position=\"top-end\"\n inverse\n />\n </div>\n </section>\n </Transition>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, PropType, provide, ref, toRefs, watch } from 'vue';\n import { BentoButton, BentoButtonActions, BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n\n import { type BentoActionBarVariant } from '@/components/action-bar/action-bar.types';\n import ButtonActionsWithMenu from '@/components/internal/button-actions-with-menu/button-actions-with-menu.vue';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import { useI18n } from '@/utils/ts/i18n';\n import { useWindowSize } from '@vueuse/core';\n\n import messages from './messages.json';\n import { POPOVER_OFFSET_INJECTION_KEY } from '@/components/popover/popover.keys';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n // Constants\n const AVERAGE_BUTTON_SIZE = 100;\n const MENU_OFFSET = 7;\n const RESPONSIVE_BREAKPOINT = 500;\n const SPACING = 32;\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * Required and used for the `default` variant.\n *\n * Each object in the list should have a `title`, an `event` and,\n * optionally, an `icon`.\n *\n * The component will display 4 actions and the hide the rest inside a menu.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: () => [],\n },\n /**\n * How many actions should be visible outside the menu, cannot be more than 4\n */\n visibleActions: {\n type: Number,\n default: 4,\n validator: (value: number) => value > 0 && value <= 4,\n },\n /**\n * Use when there are sticky elements at the bottom, like sticky pagination\n */\n extraBottomSpacing: {\n type: Boolean,\n default: false,\n },\n /**\n * Show how many items are selected\n */\n itemCounter: {\n type: Number,\n required: true,\n },\n /**\n * Label for the selection, e.g. 'selected'/'changed'\n */\n selectionLabel: {\n type: String,\n default: null,\n },\n /**\n * Variant for the action bar\n * @values default, confirmation\n */\n variant: {\n type: String as PropType<BentoActionBarVariant>,\n default: 'default',\n },\n });\n\n const emit = defineEmits([\"close\", \"cancel\", \"save\"]);\n\n const { t, tc } = useI18n<{ message: MessageSchema }>({ messages });\n const label = computed(() => (props.selectionLabel ? props.selectionLabel : t('selected')));\n\n // Refs\n const actionBar = ref<HTMLDivElement>(null);\n const { extraBottomSpacing, visibleActions } = toRefs(props);\n const { width } = useWindowSize();\n const internalDisplayedActions = ref(null);\n const internalVisibleActions = ref(null);\n\n const isConfirmationVariant = computed(() => props.variant === 'confirmation');\n\n watch(\n () => visibleActions.value,\n value => {\n internalVisibleActions.value = value <= 4 ? value : 4;\n internalDisplayedActions.value = internalVisibleActions.value;\n },\n { immediate: true }\n );\n\n // Styling\n const conditionalClasses = computed(() => ({\n 'b-action-bar--extra-spacing': extraBottomSpacing.value,\n 'b-action-bar--confirmation': isConfirmationVariant.value,\n }));\n\n // Provide POPOVER_OFFSET_INJECTION_KEY to change the value of the popover offset\n provide(POPOVER_OFFSET_INJECTION_KEY, MENU_OFFSET);\n\n // Manipulate actions array to display as intended\n const actionsInternal = computed(() => {\n // All buttons should be of type secondary in the action bar\n const actions = props.actions.map(action => ({\n ...action,\n variant: 'secondary',\n })) as BentoButtonActionsList;\n // Shown actions should display from left to right in action bar, instead of right to left which is the button actions default\n const shownActions = actions.slice(0, internalDisplayedActions.value).reverse();\n const hiddenActions = actions.slice(internalDisplayedActions.value);\n\n return [...shownActions, ...hiddenActions];\n });\n\n const confirmationActions = computed<BentoButtonActionsList>(() => [\n {\n title: t('save'),\n event: () => emit('save'),\n },\n {\n title: t('cancel'),\n variant: 'secondary',\n event: () => emit('cancel'),\n },\n ]);\n\n // Recursive functions to determine how many actions should be visible/hidden based on the screens width\n const showActions = async () => {\n await nextTick();\n if (\n width.value > actionBar.value.clientWidth + SPACING + AVERAGE_BUTTON_SIZE &&\n internalDisplayedActions.value < internalVisibleActions.value\n ) {\n internalDisplayedActions.value += 1;\n showActions();\n }\n };\n\n const hideActions = async () => {\n await nextTick();\n if (width.value < actionBar.value.clientWidth + SPACING && internalDisplayedActions.value > 0) {\n internalDisplayedActions.value -= 1;\n hideActions();\n }\n };\n\n // Screen width watcher to toggle hidden/visible actions\n watch(\n () => width.value,\n async (newValue, oldValue) => {\n await nextTick();\n if (!actionBar.value) {\n return;\n }\n const isIncreasing = newValue > oldValue;\n if (width.value < RESPONSIVE_BREAKPOINT) {\n internalDisplayedActions.value = 0;\n } else if (isIncreasing) {\n showActions();\n } else {\n hideActions();\n }\n },\n { immediate: true }\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * Action bar is a floating bar that provides users with quick access to key actions that can be applied to one or multiple items.\n *\n * @example\n * import { BentoActionBar } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoActionBar },\n * template: `\n * <bento-action-bar\n * :actions='[\n * {\n * title: 'Delete',\n * critical: true,\n * icon: BinIcon,\n * event: () => true,\n * },\n * {\n * title: 'Edit',\n * icon: EditIcon,\n * event: () => true,\n * }\n * ]'\n * @close=\"closeAction\"\n * :item-counter=\"5\"\n * />\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./action-bar.scss\" />\n"],"names":["__default__","messages","AVERAGE_BUTTON_SIZE","MENU_OFFSET","RESPONSIVE_BREAKPOINT","SPACING","t","tc","useI18n","label","computed","props","actionBar","ref","extraBottomSpacing","visibleActions","toRefs","width","useWindowSize","internalDisplayedActions","internalVisibleActions","isConfirmationVariant","watch","value","conditionalClasses","provide","POPOVER_OFFSET_INJECTION_KEY","actionsInternal","actions","action","shownActions","hiddenActions","confirmationActions","emit","showActions","nextTick","hideActions","newValue","oldValue","isIncreasing"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8OIA,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA/LAC,IAAA,KACAC,IAAA,GACAC,IAAA,KACAC,IAAA,IA2DA,EAAA,GAAAC,GAAA,IAAAC,EAAA,IAAAC,EAAA,GACAC,IAAAC,EAAA,MAAAC,EAAA,iBAAAA,EAAA,iBAAAL,EAAA,UAAA,CAAA,GAGAM,IAAAC,EAAA,IAAA,GACA,EAAA,oBAAAC,GAAA,gBAAAC,EAAA,IAAAC,EAAAL,CAAA,GACA,EAAA,OAAAM,EAAA,IAAAC,EAAA,GACAC,IAAAN,EAAA,IAAA,GACAO,IAAAP,EAAA,IAAA,GAEAQ,IAAAX,EAAA,MAAAC,EAAA,YAAA,cAAA;AAEA,IAAAW;AAAA,MAAA,MAAAP,EAAA;AAAA,MACyB,CAAAQ,MAAA;AAEjB,QAAAH,EAAA,QAAAG,KAAA,IAAAA,IAAA,GACAJ,EAAA,QAAAC,EAAA;AAAA,MAAwD;AAAA,MAC5D,EAAA,WAAA,GAAA;AAAA,IACkB;AAItB,UAAAI,IAAAd,EAAA,OAAA;AAAA,MAA2C,+BAAAI,EAAA;AAAA,MACW,8BAAAO,EAAA;AAAA,IACE,EAAA;AAIxD,IAAAI,EAAAC,GAAAvB,CAAA;AAGA,UAAAwB,IAAAjB,EAAA,MAAA;AAEI,YAAAkB,IAAAjB,EAAA,QAAA,IAAA,CAAAkB,OAAA;AAAA,QAA6C,GAAAA;AAAA,QACtC,SAAA;AAAA,MACM,EAAA,GAGbC,IAAAF,EAAA,MAAA,GAAAT,EAAA,KAAA,EAAA,QAAA,GACAY,IAAAH,EAAA,MAAAT,EAAA,KAAA;AAEA,aAAA,CAAA,GAAAW,GAAA,GAAAC,CAAA;AAAA,IAAyC,CAAA,GAG7CC,IAAAtB,EAAA,MAAA;AAAA,MAAmE;AAAA,QAC/D,OAAAJ,EAAA,MAAA;AAAA,QACmB,OAAA,MAAA2B,EAAA,MAAA;AAAA,MACS;AAAA,MAC5B;AAAA,QACA,OAAA3B,EAAA,QAAA;AAAA,QACqB,SAAA;AAAA,QACR,OAAA,MAAA2B,EAAA,QAAA;AAAA,MACiB;AAAA,IAC9B,CAAA,GAIJC,IAAA,YAAA;AACI,YAAAC,EAAA,GACAlB,EAAA,QAAAL,EAAA,MAAA,cAAAP,IAAAH,KAAAiB,EAAA,QAAAC,EAAA,UAIID,EAAA,SAAA,GACAe,EAAA;AAAA,IACJ,GAGJE,IAAA,YAAA;AACI,YAAAD,EAAA,GACAlB,EAAA,QAAAL,EAAA,MAAA,cAAAP,KAAAc,EAAA,QAAA,MACIA,EAAA,SAAA,GACAiB,EAAA;AAAA,IACJ;AAIJ,WAAAd;AAAA,MAAA,MAAAL,EAAA;AAAA,MACgB,OAAAoB,GAAAC,MAAA;AAGR,YADA,MAAAH,EAAA,GACA,CAAAvB,EAAA;AACI;AAEJ,cAAA2B,IAAAF,IAAAC;AACA,QAAArB,EAAA,QAAAb,IACIe,EAAA,QAAA,IAAiCoB,IAEjCL,EAAA,IAEAE,EAAA;AAAA,MACJ;AAAA,MACJ,EAAA,WAAA,GAAA;AAAA,IACkB;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -4,10 +4,10 @@ import { B as H } from "./button.79klAcOK.js";
|
|
|
4
4
|
import { C as B } from "./cross-small.BLUwtRB-.js";
|
|
5
5
|
import { W as w } from "./warning-filled.CLKRzGMT.js";
|
|
6
6
|
import { C as L } from "./cross-circle-fill.CnYH4R_h.js";
|
|
7
|
-
import { C as
|
|
7
|
+
import { C as R } from "./checkmark-circle-fill.DVl6QSwm.js";
|
|
8
8
|
import { n as p } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
9
|
-
import { u as
|
|
10
|
-
import { u as
|
|
9
|
+
import { u as E } from "./use-has-slot.C9lQZ6nz.js";
|
|
10
|
+
import { u as G } from "./i18n.BQkEbtPM.js";
|
|
11
11
|
import "../assets/alert.css";
|
|
12
12
|
var n = /* @__PURE__ */ ((e) => (e.DEFAULT = "default", e.TIP = "tip", e))(n || {}), o = /* @__PURE__ */ ((e) => (e.WARNING = "warning", e.CRITICAL = "critical", e.HIGHLIGHT = "highlight", e.SUCCESS = "success", e))(o || {}), u = /* @__PURE__ */ ((e) => (e.CLOSE_ALERT = "close-alert", e))(u || {});
|
|
13
13
|
let _ = 0;
|
|
@@ -27,19 +27,25 @@ var $ = function() {
|
|
|
27
27
|
null,
|
|
28
28
|
null
|
|
29
29
|
);
|
|
30
|
-
const
|
|
30
|
+
const F = P.exports, k = {
|
|
31
31
|
"en-US": {
|
|
32
32
|
highlightIcon: "Highlight icon",
|
|
33
33
|
successIcon: "Success icon",
|
|
34
34
|
criticalIcon: "Critical icon",
|
|
35
35
|
warningIcon: "Warning icon",
|
|
36
36
|
close: "Close"
|
|
37
|
+
},
|
|
38
|
+
"pt-BR": {
|
|
39
|
+
close: "Fechar"
|
|
40
|
+
},
|
|
41
|
+
"ja-JP": {
|
|
42
|
+
close: "閉じる"
|
|
37
43
|
}
|
|
38
|
-
},
|
|
39
|
-
i18n: { messages:
|
|
44
|
+
}, x = {
|
|
45
|
+
i18n: { messages: k },
|
|
40
46
|
name: "bento-alert"
|
|
41
47
|
}, N = /* @__PURE__ */ I({
|
|
42
|
-
...
|
|
48
|
+
...x,
|
|
43
49
|
props: {
|
|
44
50
|
closeButton: { type: Boolean, default: !1 },
|
|
45
51
|
type: { default: o.HIGHLIGHT },
|
|
@@ -47,7 +53,7 @@ const k = P.exports, x = {
|
|
|
47
53
|
},
|
|
48
54
|
emits: ["close-alert"],
|
|
49
55
|
setup(e, { emit: s }) {
|
|
50
|
-
const t = e, a = y(), C =
|
|
56
|
+
const t = e, a = y(), C = E(a), { t: l } = G(), i = r(() => t.variant === n.TIP), d = r(() => ({
|
|
51
57
|
[`b-alert--${t.type}`]: t.type,
|
|
52
58
|
[`b-alert--${n.TIP}`]: i.value
|
|
53
59
|
})), f = r(() => l(`${t.type}Icon`)), m = r(() => {
|
|
@@ -55,12 +61,12 @@ const k = P.exports, x = {
|
|
|
55
61
|
case o.CRITICAL:
|
|
56
62
|
return L;
|
|
57
63
|
case o.SUCCESS:
|
|
58
|
-
return
|
|
64
|
+
return R;
|
|
59
65
|
case o.WARNING:
|
|
60
66
|
return w;
|
|
61
67
|
case o.HIGHLIGHT:
|
|
62
68
|
default:
|
|
63
|
-
return
|
|
69
|
+
return F;
|
|
64
70
|
}
|
|
65
71
|
}), h = r(() => ({
|
|
66
72
|
el: S.DIV,
|
|
@@ -93,4 +99,4 @@ export {
|
|
|
93
99
|
o as b,
|
|
94
100
|
u as c
|
|
95
101
|
};
|
|
96
|
-
//# sourceMappingURL=alert.
|
|
102
|
+
//# sourceMappingURL=alert.CVsckdGC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.
|
|
1
|
+
{"version":3,"file":"alert.CVsckdGC.js","sources":["../../src/components/alert/alert.types.ts","../../../../node_modules/.pnpm/@adyen+ui-assets-icons-16@4.1.0_vue@2.7.16/node_modules/@adyen/ui-assets-icons-16/dist/vue/info-filled.vue","../../src/components/alert/alert.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoAlertVariant {\n DEFAULT = 'default',\n TIP = 'tip',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoAlertTypeOption {\n WARNING = 'warning',\n CRITICAL = 'critical',\n HIGHLIGHT = 'highlight',\n SUCCESS = 'success',\n}\n\n/**\n * @deprecated from version 2.0.0. Use \"@close-alert\" instead.\n */\nexport enum BentoAlertEvent {\n CLOSE_ALERT = 'close-alert',\n}\n","\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><g :clip-path=\"'url(#uia-icons-16-info_filled__a' + uuid + ')'\"><path fill=\"#00112C\" d=\"M5.0342 0.839937C6.45033 0.253358 8.00859 0.0998821 9.51195 0.398918C11.0153 0.697953 12.3962 1.43607 13.4801 2.51993C14.5639 3.60378 15.3021 4.9847 15.6011 6.48805C15.9001 7.99141 15.7466 9.54967 15.1601 10.9658C14.5735 12.3819 13.5801 13.5923 12.3057 14.4439C11.0312 15.2955 9.53281 15.75 8 15.75C5.94457 15.75 3.97333 14.9335 2.51992 13.4801C1.06652 12.0267 0.25 10.0554 0.25 8C0.25 6.4672 0.704529 4.96881 1.55611 3.69433C2.40769 2.41985 3.61808 1.42652 5.0342 0.839937ZM8.75 4.5C8.75 4.23478 8.64464 3.98043 8.45711 3.79289C8.26957 3.60536 8.01522 3.5 7.75 3.5C7.55222 3.5 7.35888 3.55865 7.19443 3.66853C7.02998 3.77841 6.90181 3.93459 6.82612 4.11732C6.75043 4.30004 6.73063 4.50111 6.76921 4.69509C6.8078 4.88907 6.90304 5.06725 7.04289 5.20711C7.18275 5.34696 7.36093 5.4422 7.55491 5.48079C7.74889 5.51937 7.94996 5.49957 8.13268 5.42388C8.31541 5.34819 8.47159 5.22002 8.58147 5.05557C8.69135 4.89112 8.75 4.69778 8.75 4.5ZM8.75 6.25H6.25V7.75H7.25V10.25H6.25V11.75H9.75V10.25H8.75V6.25Z\"/></g><defs><clipPath :id=\"'uia-icons-16-info_filled__a' + uuid\"><rect width=\"16\" height=\"16\" fill=\"#fff\"/></clipPath></defs></svg>\n</template>\n<script>\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n<style>\n @import '../css/main.css';\n</style>\n","<template>\n <div class=\"b-alert\" :role=\"computedRole\">\n <div class=\"b-alert__inner-container\" :class=\"alertConditionalClasses\">\n <div class=\"b-alert__icon\">\n <component :is=\"iconComponent\" aria-hidden=\"true\" :svg-title=\"iconSvgTitle\" />\n </div>\n\n <div class=\"b-alert__content\">\n <bento-typography\n v-if=\"hasSlot('default') && !isTipVariant\"\n class=\"b-alert__title\"\n el=\"div\"\n variant=\"body\"\n strongest\n wide\n >\n <slot />\n </bento-typography>\n\n <bento-typography\n v-if=\"hasSlot('description')\"\n class=\"b-alert__description\"\n v-bind=\"descriptionTypography\"\n data-testid=\"alert-description\"\n >\n <slot name=\"description\" />\n </bento-typography>\n\n <div v-if=\"hasSlot('actions') && !isTipVariant\" class=\"b-alert__actions\" data-testid=\"alert-actions\">\n <slot name=\"actions\" />\n </div>\n </div>\n\n <bento-button\n v-if=\"closeButton && !isTipVariant\"\n class=\"b-alert__close-button\"\n variant=\"tertiary\"\n type=\"button\"\n @click=\"onCloseButtonClick\"\n >\n <cross-small :svg-title=\"t('close')\" />\n </bento-button>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, onMounted, useSlots } from 'vue';\n\n // Component\n import { BentoAlertEvent, BentoAlertTypeOption, BentoAlertVariant } from '@/components/alert/alert.types';\n import { BentoTypography, BentoTypographyElement, BentoTypographyVariant } from '@/components/typography';\n import { BentoButton } from '@/components/button';\n\n import CrossSmall from '@adyen/ui-assets-icons-16/vue/cross-small';\n import Warning from '@adyen/ui-assets-icons-16/vue/warning-filled';\n import CrossCircle from '@adyen/ui-assets-icons-16/vue/cross-circle-fill';\n import CheckedCircle from '@adyen/ui-assets-icons-16/vue/checkmark-circle-fill';\n import Info from '@adyen/ui-assets-icons-16/vue/info-filled';\n\n // Utils\n import { useHasSlot } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const emit = defineEmits([\"close-alert\"]);\n\n const props = defineProps({\n closeButton: { type: Boolean, default: false },\n type: { default: BentoAlertTypeOption.HIGHLIGHT },\n variant: { default: BentoAlertVariant.DEFAULT }\n});\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const isTipVariant = computed(() => props.variant === BentoAlertVariant.TIP);\n\n const alertConditionalClasses = computed(() => ({\n [`b-alert--${props.type}`]: props.type,\n [`b-alert--${BentoAlertVariant.TIP}`]: isTipVariant.value,\n }));\n\n const iconSvgTitle = computed(() => t(`${props.type}Icon`));\n\n const iconComponent = computed(() => {\n switch (props.type) {\n case BentoAlertTypeOption.CRITICAL:\n return CrossCircle;\n case BentoAlertTypeOption.SUCCESS:\n return CheckedCircle;\n case BentoAlertTypeOption.WARNING:\n return Warning;\n case BentoAlertTypeOption.HIGHLIGHT:\n default:\n return Info;\n }\n });\n\n const descriptionTypography = computed(() => ({\n el: BentoTypographyElement.DIV,\n variant: isTipVariant.value ? BentoTypographyVariant.CAPTION : BentoTypographyVariant.BODY,\n wide: true,\n }));\n\n const computedRole = computed(() => (props.type === BentoAlertTypeOption.HIGHLIGHT ? 'status' : 'alert'));\n\n const onCloseButtonClick = () => {\n emit(BentoAlertEvent.CLOSE_ALERT);\n };\n\n onMounted(() => {\n if (!slots.default && !slots.description) {\n throw new Error('Alert Component requires a title or a description');\n }\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * An Alert component is used to display a persistent\n * notification containing information important to the user\n *\n * @example\n * import { BentoAlert, BentoAlertTypeOption } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoAlert },\n * template: `\n * <bento-alert type=\"highlight\">\n * Title of the Alert\n * </bento-alert>\n * `\n * }\n */\n export default {\n i18n: { messages },\n name: 'bento-alert',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./alert.scss\" />\n"],"names":["BentoAlertVariant","BentoAlertVariant2","BentoAlertTypeOption","BentoAlertTypeOption2","BentoAlertEvent","BentoAlertEvent2","uuid","_sfc_main$1","__default__","messages","slots","useSlots","hasSlot","useHasSlot","t","useI18n","isTipVariant","computed","props","alertConditionalClasses","iconSvgTitle","iconComponent","CrossCircleFillIcon","CheckmarkIcon","WarningIcon","Info","descriptionTypography","BentoTypographyElement","BentoTypographyVariant","computedRole","onCloseButtonClick","emit","onMounted"],"mappings":";;;;;;;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,MAAA,OAFQA,IAAAD,KAAA,CAAA,CAAA,GAQAE,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,WAAA,YACAA,EAAA,YAAA,aACAA,EAAA,UAAA,WAJQA,IAAAD,KAAA,CAAA,CAAA,GAUAE,IAAA,kBAAAC,OACRA,EAAA,cAAA,eADQA,IAAAD,KAAA,CAAA,CAAA;AChBZ,IAAAE,IAAA;AAEA,MAAAC,IAAA;AAAA,EACA,eAAA;AACA,SAAA,OAAAD,EAAA,SAAA,GACAA,KAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;GCgIIE,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAAA,EACM,MAAA;AAErB;;;;;;;;;iBA3EAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAUA,EAAA,GAAAI,EAAA,IAAAC,EAAA,GAEAC,IAAAC,EAAA,MAAAC,EAAA,YAAAlB,EAAA,GAAA,GAEAmB,IAAAF,EAAA,OAAA;AAAA,MAAgD,CAAA,YAAAC,EAAA,IAAA,EAAA,GAAAA,EAAA;AAAA,MACV,CAAA,YAAAlB,EAAA,GAAA,EAAA,GAAAgB,EAAA;AAAA,IACkB,EAAA,GAGxDI,IAAAH,EAAA,MAAAH,EAAA,GAAAI,EAAA,IAAA,MAAA,CAAA,GAEAG,IAAAJ,EAAA,MAAA;AACI,cAAAC,EAAA,MAAA;AAAA,QAAoB,KAAAhB,EAAA;AAEZ,iBAAAoB;AAAA,QAAO,KAAApB,EAAA;AAEP,iBAAAqB;AAAA,QAAO,KAAArB,EAAA;AAEP,iBAAAsB;AAAA,QAAO,KAAAtB,EAAA;AAAA,QACe;AAEtB,iBAAAuB;AAAA,MAAO;AAAA,IACf,CAAA,GAGJC,IAAAT,EAAA,OAAA;AAAA,MAA8C,IAAAU,EAAA;AAAA,MACf,SAAAX,EAAA,QAAAY,EAAA,UAAAA,EAAA;AAAA,MAC2D,MAAA;AAAA,IAChF,EAAA,GAGVC,IAAAZ,EAAA,MAAAC,EAAA,SAAAhB,EAAA,YAAA,WAAA,OAAA,GAEA4B,IAAA,MAAA;AACI,MAAAC,EAAA3B,EAAA,WAAA;AAAA,IAAgC;AAGpC,WAAA4B,EAAA,MAAA;AACI,UAAA,CAAAtB,EAAA,WAAA,CAAAA,EAAA;AACI,cAAA,IAAA,MAAA,mDAAA;AAAA,IACJ,CAAA;;;;;;;;;;;;;;;","x_google_ignoreList":[1]}
|
|
@@ -3,7 +3,7 @@ import { B as p } from "./typography.CqQaHXhq.js";
|
|
|
3
3
|
import "./index.Cl4_42j5.js";
|
|
4
4
|
import { n as v } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
5
5
|
import "../assets/avatar.css";
|
|
6
|
-
const
|
|
6
|
+
const d = (t) => {
|
|
7
7
|
const a = b(t);
|
|
8
8
|
return n(() => a.value ? a.value.trim().charAt(0).toUpperCase() : null);
|
|
9
9
|
};
|
|
@@ -18,7 +18,7 @@ const L = {}, y = /* @__PURE__ */ _({
|
|
|
18
18
|
variant: { default: o.LARGE }
|
|
19
19
|
},
|
|
20
20
|
setup(t) {
|
|
21
|
-
const a = t, { username: r } = m(a), e =
|
|
21
|
+
const a = t, { username: r } = m(a), e = d(r), c = n(() => ({
|
|
22
22
|
[`b-avatar-image--${o.SMALL}`]: a.variant === o.SMALL,
|
|
23
23
|
[`b-avatar-image--${a.color}`]: a.color
|
|
24
24
|
}));
|
|
@@ -27,14 +27,14 @@ const L = {}, y = /* @__PURE__ */ _({
|
|
|
27
27
|
});
|
|
28
28
|
var g = function() {
|
|
29
29
|
var a = this, r = a._self._c, e = a._self._setupProxy;
|
|
30
|
-
return r("div", { staticClass: "b-avatar-image", class: e.conditionalClasses, attrs: { "aria-hidden": "true", "data-testid": "avatar" } }, [a.src ? r("img", { staticClass: "b-avatar-image__image", attrs: { src: a.src, alt: "
|
|
30
|
+
return r("div", { staticClass: "b-avatar-image", class: e.conditionalClasses, attrs: { "aria-hidden": "true", "data-testid": "avatar" } }, [a.src ? r("img", { staticClass: "b-avatar-image__image", attrs: { src: a.src, alt: "", "data-testid": "avatar-content" } }) : r("div", { staticClass: "b-avatar-image__default", attrs: { "data-testid": "avatar-content" } }, [r(e.BentoTypography, { attrs: { el: "span", variant: "body", strongest: "" } }, [a._v(" " + a._s(e.initials) + " ")])], 1)]);
|
|
31
31
|
}, C = [], E = /* @__PURE__ */ v(
|
|
32
32
|
y,
|
|
33
33
|
g,
|
|
34
34
|
C,
|
|
35
35
|
!1,
|
|
36
36
|
null,
|
|
37
|
-
"
|
|
37
|
+
"7cac2ac2"
|
|
38
38
|
);
|
|
39
39
|
const h = E.exports, A = {
|
|
40
40
|
name: "bento-avatar"
|
|
@@ -46,11 +46,11 @@ const h = E.exports, A = {
|
|
|
46
46
|
username: null
|
|
47
47
|
},
|
|
48
48
|
setup(t) {
|
|
49
|
-
const a = t, { username: r } = m(a), e = n(() => a.iconOnly ? a.username : null), c = n(() => a.src ? null : a.username), u =
|
|
49
|
+
const a = t, { username: r } = m(a), e = n(() => a.iconOnly ? a.username : null), c = n(() => a.src ? null : a.username), u = d(r), l = n(() => u.value ? u.value.charCodeAt(0) - 65 : null), f = n(() => {
|
|
50
50
|
const i = 26 / Object.keys(s).length;
|
|
51
51
|
return l.value <= i ? s.YELLOW : l.value <= i * 2 ? s.BLUE : l.value <= i * 3 ? s.GREEN : s.RED;
|
|
52
52
|
});
|
|
53
|
-
return { __sfc: !0, props: a, username: r, computedAriaLabel: e, computedUsername: c, initials: u, charCode: l, avatarColor:
|
|
53
|
+
return { __sfc: !0, props: a, username: r, computedAriaLabel: e, computedUsername: c, initials: u, charCode: l, avatarColor: f, AvatarImage: h, BentoAvatarImageVariant: o, BentoTypography: p };
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
var R = function() {
|
|
@@ -64,8 +64,8 @@ var R = function() {
|
|
|
64
64
|
null,
|
|
65
65
|
"2be0bf91"
|
|
66
66
|
);
|
|
67
|
-
const
|
|
67
|
+
const W = B.exports;
|
|
68
68
|
export {
|
|
69
|
-
|
|
69
|
+
W as B
|
|
70
70
|
};
|
|
71
|
-
//# sourceMappingURL=avatar.
|
|
71
|
+
//# sourceMappingURL=avatar.qcWk9clF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar.qcWk9clF.js","sources":["../../src/composables/initials.ts","../../src/components/avatar/components/avatar-image/avatar-image.types.ts","../../src/components/avatar/components/avatar-image/avatar-image.vue","../../src/components/avatar/avatar.vue"],"sourcesContent":["import { computed, ComputedRef, ref } from 'vue';\nimport { MaybeRef } from '@/types';\n\n/** Extracts the first letter of a username\n * @param username - The name to return the initials of\n * Common patterns:\n * 1. John => J\n * 2. John Smith => J\n * John Smith Doe Holly => J\n */\nexport const useInitials = (username: MaybeRef<string | null>): ComputedRef<string | null> => {\n const computedUsername = ref(username);\n return computed(() => (computedUsername.value ? computedUsername.value.trim().charAt(0).toUpperCase() : null));\n};\n","export enum BentoAvatarImageVariant {\n LARGE = 'large',\n SMALL = 'small',\n}\n\nexport enum BentoAvatarImageColor {\n BLUE = 'blue',\n GREEN = 'green',\n RED = 'red',\n YELLOW = 'yellow',\n}\n","<template>\n <div class=\"b-avatar-image\" :class=\"conditionalClasses\" aria-hidden=\"true\" data-testid=\"avatar\">\n <img v-if=\"src\" :src=\"src\" class=\"b-avatar-image__image\" alt=\"\" data-testid=\"avatar-content\" />\n <div v-else class=\"b-avatar-image__default\" data-testid=\"avatar-content\">\n <bento-typography el=\"span\" variant=\"body\" strongest>\n {{ initials }}\n </bento-typography>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, toRefs } from 'vue';\n import { BentoAvatarImageColor, BentoAvatarImageVariant } from './avatar-image.types';\n import { BentoTypography } from '@/components/typography';\n import { useInitials } from '@/composables';\n\n const props = defineProps({\n color: { default: BentoAvatarImageColor.YELLOW },\n src: { default: null },\n username: { default: null },\n variant: { default: BentoAvatarImageVariant.LARGE }\n});\n\n const { username } = toRefs(props);\n const initials = useInitials(username);\n\n const conditionalClasses = computed(() => ({\n [`b-avatar-image--${BentoAvatarImageVariant.SMALL}`]: props.variant === BentoAvatarImageVariant.SMALL,\n [`b-avatar-image--${props.color}`]: props.color,\n }));\n</script>\n\n<script lang=\"ts\">\n /**\n * Image used as user profile inside bento-avatar.\n *\n * @example\n * import { AvatarImage } from './components/avatar-image';\n *\n * export default {\n * components: { AvatarImage },\n * template: `<avatar-image :src=\"userAvatarSrc\" username=\"Jane\" />`\n * }\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./avatar-image.scss\" />\n","<template>\n <div class=\"b-avatar\" :aria-label=\"computedAriaLabel\">\n <avatar-image\n :src=\"src\"\n :username=\"computedUsername\"\n :variant=\"BentoAvatarImageVariant.SMALL\"\n :color=\"avatarColor\"\n />\n <bento-typography v-if=\"!iconOnly\" class=\"b-avatar__label\" el=\"span\" variant=\"body\">\n {{ username }}\n </bento-typography>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, toRefs } from 'vue';\n import { AvatarImage, BentoAvatarImageColor, BentoAvatarImageVariant } from './components/avatar-image';\n import { BentoTypography } from '@/components/typography';\n import { useInitials } from '@/composables';\n\n const props = defineProps({\n iconOnly: { type: Boolean, default: false },\n src: { default: null },\n username: null\n});\n\n const { username } = toRefs(props);\n\n const computedAriaLabel = computed(() => (props.iconOnly ? props.username : null));\n const computedUsername = computed(() => (!props.src ? props.username : null));\n const initials = useInitials(username);\n\n // Returns the UTF-16 char code\n const charCode = computed(() => (initials.value ? initials.value.charCodeAt(0) - 65 : null));\n\n // Returns a computed color based on the letter passed\n const avatarColor = computed(() => {\n const numberOfAlphabetLetters = 26;\n const numberOfColors = Object.keys(BentoAvatarImageColor).length;\n const rangeStep = numberOfAlphabetLetters / numberOfColors;\n\n if (charCode.value <= rangeStep) {\n return BentoAvatarImageColor.YELLOW;\n }\n if (charCode.value <= rangeStep * 2) {\n return BentoAvatarImageColor.BLUE;\n }\n if (charCode.value <= rangeStep * 3) {\n return BentoAvatarImageColor.GREEN;\n }\n return BentoAvatarImageColor.RED;\n });\n</script>\n\n<script lang=\"ts\">\n /**\n * Displays an user profile including an avatar and optionally a label.\n *\n * @example\n * import { BentoAvatar } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoAvatar },\n * template: `<bento-avatar :src=\"userAvatarSrc\" username=\"Jane\" />`\n * }\n */\n export default {\n name: 'bento-avatar',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./avatar.scss\" />\n"],"names":["useInitials","username","computedUsername","ref","computed","BentoAvatarImageVariant","BentoAvatarImageVariant2","BentoAvatarImageColor","BentoAvatarImageColor2","__default__$1","toRefs","props","initials","conditionalClasses","__default__","computedAriaLabel","charCode","avatarColor","rangeStep"],"mappings":";;;;;AAUa,MAAAA,IAAA,CAAAC,MAAA;AACT,QAAAC,IAAAC,EAAAF,CAAA;AACA,SAAAG,EAAA,MAAAF,EAAA,QAAAA,EAAA,MAAA,KAAA,EAAA,OAAA,CAAA,EAAA,YAAA,IAAA,IAAA;AACJ;ACbY,IAAAG,IAAA,kBAAAC,OACRA,EAAA,QAAA,SACAA,EAAA,QAAA,SAFQA,IAAAD,KAAA,CAAA,CAAA,GAKAE,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,QAAA,SACAA,EAAA,MAAA,OACAA,EAAA,SAAA,UAJQA,IAAAD,KAAA,CAAA,CAAA;ACwCR,MAAAE,IAAA,CAAA;;;;;;;;;;iBArBA,EAAA,UAAAR,EAAA,IAAAS,EAAAC,CAAA,GACAC,IAAAZ,EAAAC,CAAA,GAEAY,IAAAT,EAAA,OAAA;AAAA,MAA2C,CAAA,mBAAAC,EAAA,KAAA,EAAA,GAAAM,EAAA,YAAAN,EAAA;AAAA,MACyD,CAAA,mBAAAM,EAAA,KAAA,EAAA,GAAAA,EAAA;AAAA,IACtD,EAAA;;;;;;;;;;;;;;;qBCqC9CG,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;iBA1CA,EAAA,UAAAb,EAAA,IAAAS,EAAAC,CAAA,GAEAI,IAAAX,EAAA,MAAAO,EAAA,WAAAA,EAAA,WAAA,IAAA,GACAT,IAAAE,EAAA,MAAAO,EAAA,MAAA,OAAAA,EAAA,QAAA,GACAC,IAAAZ,EAAAC,CAAA,GAGAe,IAAAZ,EAAA,MAAAQ,EAAA,QAAAA,EAAA,MAAA,WAAA,CAAA,IAAA,KAAA,IAAA,GAGAK,IAAAb,EAAA,MAAA;AAGI,YAAAc,IAAA,KADA,OAAA,KAAAX,CAAA,EAAA;AAGA,aAAAS,EAAA,SAAAE,IACIX,EAAA,SAEJS,EAAA,SAAAE,IAAA,IACIX,EAAA,OAEJS,EAAA,SAAAE,IAAA,IACIX,EAAA,QAEJA,EAAA;AAAA,IAA6B,CAAA;;;;;;;;;;;;;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as T, useSlots as
|
|
1
|
+
import { defineComponent as T, useSlots as Y, ref as u, computed as l, inject as Q, watch as w, nextTick as X, onUnmounted as Z, useAttrs as V, onMounted as tt, provide as D, toRefs as et } from "vue";
|
|
2
2
|
import { B as at } from "./button.79klAcOK.js";
|
|
3
3
|
import { B as ot } from "./focus-trap.DSkLNO_i.js";
|
|
4
|
-
import { u as
|
|
4
|
+
import { u as q } from "./use-has-slot.C9lQZ6nz.js";
|
|
5
5
|
import { u as nt } from "./i18n.BQkEbtPM.js";
|
|
6
6
|
import { M as st } from "./base-modal.keys.C2PQXcE2.js";
|
|
7
7
|
import { g as lt } from "./unique-id.XFfoKuc2.js";
|
|
8
8
|
import { B as it } from "./typography.CqQaHXhq.js";
|
|
9
|
-
import { F as rt } from "./footer-actions.
|
|
9
|
+
import { F as rt } from "./footer-actions.CxxS87iQ.js";
|
|
10
10
|
import { D as ut, B as ct, b as dt, a as mt } from "./dialog-page.bmDDYmn9.js";
|
|
11
11
|
import { o as pt } from "./resize.Bqks3WUm.js";
|
|
12
12
|
import { G as ft, a as gt } from "./grid-layout.HvTAa4to.js";
|
|
@@ -19,6 +19,12 @@ const bt = {
|
|
|
19
19
|
"en-US": {
|
|
20
20
|
ariaLabelFallback: "modal",
|
|
21
21
|
close: "Close"
|
|
22
|
+
},
|
|
23
|
+
"pt-BR": {
|
|
24
|
+
close: "Fechar"
|
|
25
|
+
},
|
|
26
|
+
"ja-JP": {
|
|
27
|
+
close: "閉じる"
|
|
22
28
|
}
|
|
23
29
|
}, j = Symbol("modal config data injection key"), Lt = T({}), St = /* @__PURE__ */ T({
|
|
24
30
|
...Lt,
|
|
@@ -97,7 +103,7 @@ const bt = {
|
|
|
97
103
|
}
|
|
98
104
|
},
|
|
99
105
|
setup(a) {
|
|
100
|
-
const e = a, o = 26, t =
|
|
106
|
+
const e = a, o = 26, t = Y(), n = q(t), c = u(null), O = l(() => ({
|
|
101
107
|
"b-modal-page--custom-padding": e.customPadding
|
|
102
108
|
})), I = l(() => {
|
|
103
109
|
var r;
|
|
@@ -271,7 +277,7 @@ const It = Ot.exports, Bt = T({
|
|
|
271
277
|
},
|
|
272
278
|
emits: ["update:active-page", "close-modal"],
|
|
273
279
|
setup(a, { expose: e, emit: o }) {
|
|
274
|
-
const t = a, n = 500, { t: c } = nt(), O =
|
|
280
|
+
const t = a, n = 500, { t: c } = nt(), O = Y(), I = V(), R = q(O), d = u(null), f = u(!1), g = lt("modal"), _ = l(() => t.isDismissible && !t.hideCloseButton), m = u(t.customPadding), B = l(() => m.value ? { top: m.value, right: m.value } : {}), x = l(() => I["aria-label"] ?? c("ariaLabelFallback")), b = l(() => t.withColumnLayout && t.size === G.LARGE), h = () => {
|
|
275
281
|
d.value.showModal();
|
|
276
282
|
}, p = () => {
|
|
277
283
|
o("close-modal");
|
|
@@ -311,10 +317,10 @@ const It = Ot.exports, Bt = T({
|
|
|
311
317
|
const { activePage: v, isOpen: S, size: z } = et(t), U = u(ct.TRANSITION_LEVEL_DEEPER), P = u([]), y = u([]), $ = (s) => o("update:active-page", s), H = (s) => () => {
|
|
312
318
|
var C;
|
|
313
319
|
P.value = (C = P.value) == null ? void 0 : C.filter((N) => N !== s);
|
|
314
|
-
},
|
|
320
|
+
}, J = (s) => (s && P.value.push(s), { unregisterPage: H(s) }), K = u(""), M = u(!1);
|
|
315
321
|
return D(j, {
|
|
316
322
|
activePage: v,
|
|
317
|
-
height:
|
|
323
|
+
height: K,
|
|
318
324
|
isAnimationActive: M,
|
|
319
325
|
pageCustomPadding: m,
|
|
320
326
|
showCloseButton: _,
|
|
@@ -326,7 +332,7 @@ const It = Ot.exports, Bt = T({
|
|
|
326
332
|
pages: P,
|
|
327
333
|
previousPages: y,
|
|
328
334
|
updatePage: $
|
|
329
|
-
}), D(mt,
|
|
335
|
+
}), D(mt, J), { __sfc: !0, LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME: n, t: c, slots: O, attrs: I, hasSlot: R, modal: d, isClosing: f, modalId: g, emit: o, props: t, showCloseButton: _, pageCustomPadding: m, customPaddingStyles: B, computedAriaLabel: x, hasColumnLayout: b, openModal: h, emitCloseEvent: p, closeModalAfterAnimation: r, startCloseModalAnimation: i, internalModalActionClose: A, closeModalOnClickOutside: k, modalConditionalClasses: L, activePage: v, isOpen: S, size: z, animation: U, pages: P, previousPages: y, updatePage: $, unregisterPage: H, registerPage: J, height: K, isAnimationActive: M, BentoButton: at, BentoFocusTrap: ot, vBentoClickOutsideDirective: vt, BentoModalPage: It, CrossIcon: _t };
|
|
330
336
|
}
|
|
331
337
|
});
|
|
332
338
|
var Dt = function() {
|
|
@@ -364,4 +370,4 @@ export {
|
|
|
364
370
|
At as g,
|
|
365
371
|
Qt as h
|
|
366
372
|
};
|
|
367
|
-
//# sourceMappingURL=base-modal.
|
|
373
|
+
//# sourceMappingURL=base-modal.BaHkDH5f.js.map
|