@adyen/bento-vue2 1.24.0 → 1.26.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 +484 -629
- package/dist/accordion.js +2 -2
- package/dist/action-bar.js +6 -6
- package/dist/alert.js +69 -104
- package/dist/alert.js.map +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/index10.css +1 -1
- package/dist/assets/index11.css +1 -1
- package/dist/assets/index12.css +1 -1
- package/dist/assets/index13.css +1 -1
- package/dist/assets/index14.css +1 -1
- package/dist/assets/index15.css +1 -1
- package/dist/assets/index16.css +1 -1
- package/dist/assets/index17.css +1 -1
- package/dist/assets/index18.css +1 -1
- package/dist/assets/index19.css +1 -1
- package/dist/assets/index2.css +1 -1
- package/dist/assets/index20.css +1 -1
- package/dist/assets/index21.css +1 -1
- package/dist/assets/index22.css +1 -1
- package/dist/assets/index23.css +1 -1
- package/dist/assets/index24.css +1 -1
- package/dist/assets/index25.css +1 -1
- package/dist/assets/index26.css +1 -1
- package/dist/assets/index27.css +1 -1
- package/dist/assets/index28.css +1 -1
- package/dist/assets/index29.css +1 -1
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index30.css +1 -1
- package/dist/assets/index31.css +1 -1
- package/dist/assets/index32.css +1 -1
- package/dist/assets/index33.css +1 -1
- package/dist/assets/index34.css +1 -1
- package/dist/assets/index35.css +1 -1
- package/dist/assets/index36.css +1 -1
- package/dist/assets/index37.css +1 -1
- package/dist/assets/index38.css +1 -1
- package/dist/assets/index39.css +1 -1
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index40.css +1 -1
- package/dist/assets/index41.css +1 -1
- package/dist/assets/index42.css +1 -1
- package/dist/assets/index43.css +1 -1
- package/dist/assets/index44.css +1 -1
- package/dist/assets/index45.css +1 -1
- package/dist/assets/index47.css +1 -1
- package/dist/assets/index48.css +1 -1
- package/dist/assets/index5.css +1 -1
- package/dist/assets/index6.css +1 -1
- package/dist/assets/index7.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/assets/{listbox.css → use-cached-selected-values.css} +1 -1
- package/dist/avatar-image.js +1 -1
- package/dist/button.js +5 -5
- package/dist/card.js +83 -180
- package/dist/card.js.map +1 -1
- package/dist/checkbox.js +5 -5
- package/dist/chunks/{base-button.090f511d.js → base-button.ad74b6f8.js} +2 -2
- package/dist/chunks/{base-button.090f511d.js.map → base-button.ad74b6f8.js.map} +1 -1
- package/dist/chunks/{base-modal.aa09a60c.js → base-modal.1fff7abe.js} +6 -6
- package/dist/chunks/{base-modal.aa09a60c.js.map → base-modal.1fff7abe.js.map} +1 -1
- package/dist/chunks/{button-actions-with-menu.879c4573.js → button-actions-with-menu.e845d77a.js} +4 -4
- package/dist/chunks/{button-actions-with-menu.879c4573.js.map → button-actions-with-menu.e845d77a.js.map} +1 -1
- package/dist/chunks/{button-actions.239456cb.js → button-actions.81db18e8.js} +3 -3
- package/dist/chunks/{button-actions.239456cb.js.map → button-actions.81db18e8.js.map} +1 -1
- package/dist/chunks/{button.6e6324f0.js → button.9d6435ae.js} +3 -3
- package/dist/chunks/{button.6e6324f0.js.map → button.9d6435ae.js.map} +1 -1
- package/dist/chunks/{calendar.1e416969.js → calendar.640b8d25.js} +4 -4
- package/dist/chunks/{calendar.1e416969.js.map → calendar.640b8d25.js.map} +1 -1
- package/dist/chunks/{checkbox.f38276e6.js → checkbox.bfed007c.js} +3 -3
- package/dist/chunks/{checkbox.f38276e6.js.map → checkbox.bfed007c.js.map} +1 -1
- package/dist/chunks/{controls-group.f1dfa419.js → controls-group.4fb50009.js} +3 -3
- package/dist/chunks/{controls-group.f1dfa419.js.map → controls-group.4fb50009.js.map} +1 -1
- package/dist/chunks/{copy.acc9f1b0.js → copy.f85700c6.js} +4 -4
- package/dist/chunks/{copy.acc9f1b0.js.map → copy.f85700c6.js.map} +1 -1
- package/dist/chunks/dialog-page.73da22cf.js +133 -0
- package/dist/chunks/dialog-page.73da22cf.js.map +1 -0
- package/dist/chunks/{dropdown-default-textbox.c1f8fe5f.js → dropdown-default-textbox.54ca1b18.js} +2 -2
- package/dist/chunks/{dropdown-default-textbox.c1f8fe5f.js.map → dropdown-default-textbox.54ca1b18.js.map} +1 -1
- package/dist/chunks/dropdown.10c034aa.js +775 -0
- package/dist/chunks/dropdown.10c034aa.js.map +1 -0
- package/dist/chunks/{error-message.8734e591.js → error-message.31ec12b7.js} +2 -2
- package/dist/chunks/{error-message.8734e591.js.map → error-message.31ec12b7.js.map} +1 -1
- package/dist/chunks/{fixed-scroller.772ad033.js → fixed-scroller.4eb9a9ac.js} +2 -2
- package/dist/chunks/{fixed-scroller.772ad033.js.map → fixed-scroller.4eb9a9ac.js.map} +1 -1
- package/dist/chunks/{footer-actions.11071f12.js → footer-actions.a1e09b4f.js} +4 -4
- package/dist/chunks/{footer-actions.11071f12.js.map → footer-actions.a1e09b4f.js.map} +1 -1
- package/dist/chunks/{index.5d5f2200.js → index.15b088b9.js} +6 -6
- package/dist/chunks/{index.5d5f2200.js.map → index.15b088b9.js.map} +1 -1
- package/dist/chunks/{index.87180cdd.js → index.1ea85d4a.js} +138 -119
- package/dist/chunks/index.1ea85d4a.js.map +1 -0
- package/dist/chunks/{index.8e6bc325.js → index.317fca12.js} +3 -3
- package/dist/chunks/{index.8e6bc325.js.map → index.317fca12.js.map} +1 -1
- package/dist/chunks/{index.51308a21.js → index.671768a1.js} +3 -3
- package/dist/chunks/{index.51308a21.js.map → index.671768a1.js.map} +1 -1
- package/dist/chunks/{index.49ce3f6a.js → index.7eefc59c.js} +3 -3
- package/dist/chunks/{index.49ce3f6a.js.map → index.7eefc59c.js.map} +1 -1
- package/dist/chunks/{index.f19887a1.js → index.885d05a9.js} +2 -2
- package/dist/chunks/{index.f19887a1.js.map → index.885d05a9.js.map} +1 -1
- package/dist/chunks/{index.73abb1a9.js → index.8b8c3b16.js} +9 -9
- package/dist/chunks/{index.73abb1a9.js.map → index.8b8c3b16.js.map} +1 -1
- package/dist/chunks/{index.ff09389c.js → index.aaf965f8.js} +6 -6
- package/dist/chunks/{index.ff09389c.js.map → index.aaf965f8.js.map} +1 -1
- package/dist/chunks/{index.03ae22b4.js → index.b21197ca.js} +2 -2
- package/dist/chunks/{index.03ae22b4.js.map → index.b21197ca.js.map} +1 -1
- package/dist/chunks/{index.94980f50.js → index.d553d3d1.js} +2 -2
- package/dist/chunks/{index.94980f50.js.map → index.d553d3d1.js.map} +1 -1
- package/dist/chunks/{index.ba6c1040.js → index.dd30e538.js} +3 -3
- package/dist/chunks/index.dd30e538.js.map +1 -0
- package/dist/chunks/{listbox-option-tag.c0a56a95.js → listbox-option-tag.6bbb6bbe.js} +3 -3
- package/dist/chunks/{listbox-option-tag.c0a56a95.js.map → listbox-option-tag.6bbb6bbe.js.map} +1 -1
- package/dist/chunks/{loading-button.84a5529d.js → loading-button.eafc9e1b.js} +2 -2
- package/dist/chunks/{loading-button.84a5529d.js.map → loading-button.eafc9e1b.js.map} +1 -1
- package/dist/chunks/{payment-method.faa302de.js → payment-method.6c1ce07c.js} +2 -2
- package/dist/chunks/{payment-method.faa302de.js.map → payment-method.6c1ce07c.js.map} +1 -1
- package/dist/chunks/{tooltip.8e9d733c.js → tooltip.58ef3f4a.js} +3 -3
- package/dist/chunks/{tooltip.8e9d733c.js.map → tooltip.58ef3f4a.js.map} +1 -1
- package/dist/chunks/{use-bento-toast-controller.7d4436ad.js → use-bento-toast-controller.c3277f73.js} +2 -2
- package/dist/chunks/{use-bento-toast-controller.7d4436ad.js.map → use-bento-toast-controller.c3277f73.js.map} +1 -1
- package/dist/chunks/{listbox.e6e1bc90.js → use-cached-selected-values.69297473.js} +510 -448
- package/dist/chunks/use-cached-selected-values.69297473.js.map +1 -0
- package/dist/code-snippet.js +7 -7
- package/dist/code-snippet.js.map +1 -1
- package/dist/country.js +2 -2
- package/dist/currency.js +1 -1
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +947 -885
- package/dist/data-grid.js.map +1 -1
- package/dist/date-picker.js +8 -8
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/divider.js +1 -1
- package/dist/dropdown.js +7 -7
- package/dist/empty-state.js +3 -3
- package/dist/filter-bar.js +1115 -955
- package/dist/filter-bar.js.map +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +15 -14
- package/dist/form-layout.js.map +1 -1
- package/dist/header.js +4 -4
- package/dist/index.js +177 -169
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +3 -3
- package/dist/input-field.js +31 -29
- package/dist/input-field.js.map +1 -1
- package/dist/internal.js +31 -78
- package/dist/internal.js.map +1 -1
- package/dist/link.js +1 -1
- package/dist/loading-indicator.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +6 -6
- package/dist/modal.js +6 -6
- package/dist/pagination.js +4 -4
- package/dist/payment-method.js +1 -1
- package/dist/popover.js +1 -1
- package/dist/popper-container.js +1 -1
- package/dist/radio-group.js +62 -62
- package/dist/radio-group.js.map +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +2 -2
- package/dist/segmented-control.js +2 -2
- package/dist/selection-card.js +4 -4
- package/dist/sidepanel.js +52 -50
- package/dist/sidepanel.js.map +1 -1
- package/dist/status.js +2 -2
- package/dist/stepper.js +3 -3
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +3 -3
- package/dist/tabs.js +52 -52
- package/dist/tabs.js.map +1 -1
- package/dist/tag.js +3 -3
- package/dist/textarea.js +4 -4
- package/dist/timeline.js +7 -7
- package/dist/toast.js +4 -4
- package/dist/toggle.js +2 -2
- package/dist/tutorial.js +88 -67
- package/dist/tutorial.js.map +1 -1
- package/dist/typography.js +1 -1
- package/dist/web-types.json +550 -266
- package/package.json +3 -2
- package/dist/chunks/dialog-page.75b295b7.js +0 -133
- package/dist/chunks/dialog-page.75b295b7.js.map +0 -1
- package/dist/chunks/dropdown.669b858b.js +0 -797
- package/dist/chunks/dropdown.669b858b.js.map +0 -1
- package/dist/chunks/index.87180cdd.js.map +0 -1
- package/dist/chunks/index.ba6c1040.js.map +0 -1
- package/dist/chunks/listbox.e6e1bc90.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adyen/bento-vue2",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.0",
|
|
4
4
|
"description": "Adyen Bento Vue2 components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"url": "git@github.com:Adyen/bento.git"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@adyen/bento-design-tokens": "1.
|
|
65
|
+
"@adyen/bento-design-tokens": "1.26.0",
|
|
66
66
|
"@adyen/ui-assets-icons-16": "4.1.0",
|
|
67
67
|
"@adyen/ui-assets-payment-method-icons": "6.1.0",
|
|
68
68
|
"@codemirror/commands": "6.3.3",
|
|
@@ -90,6 +90,7 @@
|
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@adyen/bento-cli": "0.0.15",
|
|
93
|
+
"@adyen/lume": "1.11.1",
|
|
93
94
|
"@storybook/addon-a11y": "7.6.17",
|
|
94
95
|
"@storybook/addon-essentials": "7.6.17",
|
|
95
96
|
"@storybook/addon-storysource": "7.6.17",
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { defineComponent as H, useSlots as V, ref as c, computed as r, inject as A, watch as h, nextTick as P, onUnmounted as j } from "vue";
|
|
2
|
-
import { a as U } from "./button.6e6324f0.js";
|
|
3
|
-
import { n as N } from "./_plugin-vue2_normalizer.71e2aa87.js";
|
|
4
|
-
import { u as F } from "./use-has-slot.fbeb19ec.js";
|
|
5
|
-
import { u as J } from "./i18n.eb5b985b.js";
|
|
6
|
-
import { i as K } from "./index.ba6c1040.js";
|
|
7
|
-
import "../assets/dialog-page.css";
|
|
8
|
-
let B = 0;
|
|
9
|
-
const Y = {
|
|
10
|
-
beforeCreate() {
|
|
11
|
-
this.uuid = B.toString(), B += 1;
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
var z = function() {
|
|
15
|
-
var e = this, t = e._self._c;
|
|
16
|
-
return t("svg", e._b({ staticClass: "ui-assets-icons-16", attrs: { role: "img", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none" } }, "svg", e.$attrs, !1), [e.$attrs["svg-title"] ? t("title", [e._v(e._s(e.$attrs["svg-title"]))]) : e._e(), t("path", { attrs: { fill: "#00112C", d: "M3.80655 7.25434L8.06077 3.00011L7.00011 1.93945L0.939453 8.00011L7.00011 14.0608L8.06077 13.0001L3.81499 8.75433L14.7508 8.74316L14.7492 7.24316L3.80655 7.25434Z" } })]);
|
|
17
|
-
}, M = [], Z = /* @__PURE__ */ N(
|
|
18
|
-
Y,
|
|
19
|
-
z,
|
|
20
|
-
M,
|
|
21
|
-
!1,
|
|
22
|
-
null,
|
|
23
|
-
null,
|
|
24
|
-
null,
|
|
25
|
-
null
|
|
26
|
-
);
|
|
27
|
-
const q = Z.exports;
|
|
28
|
-
var E = /* @__PURE__ */ ((l) => (l.TRANSITION_LEVEL_DEEPER = "b-dialog-page__animation--level-deeper", l.TRANSITION_LEVEL_UPPER = "b-dialog-page__animation--level-upper", l))(E || {});
|
|
29
|
-
const Q = Symbol("dialog registerPage injection key"), W = Symbol("dialog page config data injection key"), X = {
|
|
30
|
-
"en-US": {
|
|
31
|
-
goToPreviousPage: "Go to previous page"
|
|
32
|
-
}
|
|
33
|
-
}, ee = {
|
|
34
|
-
i18n: { messages: X }
|
|
35
|
-
}, te = /* @__PURE__ */ H({
|
|
36
|
-
...ee,
|
|
37
|
-
__name: "dialog-page",
|
|
38
|
-
props: {
|
|
39
|
-
/**
|
|
40
|
-
* Identifier of the page, used with activePage prop to handle navigation
|
|
41
|
-
*/
|
|
42
|
-
pageId: {
|
|
43
|
-
type: String,
|
|
44
|
-
default: void 0
|
|
45
|
-
},
|
|
46
|
-
/**
|
|
47
|
-
* Show header and actions border
|
|
48
|
-
*/
|
|
49
|
-
alwaysShowBorder: {
|
|
50
|
-
type: Boolean,
|
|
51
|
-
default: !1
|
|
52
|
-
},
|
|
53
|
-
/**
|
|
54
|
-
* Pass custom styling to the back button to position it correctly with the header slot
|
|
55
|
-
*/
|
|
56
|
-
backButtonStyling: { type: Object, default: null },
|
|
57
|
-
/**
|
|
58
|
-
* ID of the page for the back button to navigate to. Only use it to overwrite the default back behavior
|
|
59
|
-
* Used when the back button should not take the user to the natural previous page
|
|
60
|
-
* Set to `null` to hide back button in the page
|
|
61
|
-
*/
|
|
62
|
-
previousPage: {
|
|
63
|
-
type: String,
|
|
64
|
-
default: void 0
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
emits: ["animationend"],
|
|
68
|
-
setup(l, { emit: e }) {
|
|
69
|
-
const t = l, a = V(), S = F(a), { t: O } = J(), s = c(null), u = c(!1), _ = c(!0), v = c(!1), g = r(() => n.value ? n.value === t.pageId : !0), R = r(() => ({
|
|
70
|
-
"b-dialog-page__header--with-border": t.alwaysShowBorder || u.value && !_.value
|
|
71
|
-
})), k = r(() => ({
|
|
72
|
-
"b-dialog-page__footer--with-border": t.alwaysShowBorder || u.value && !v.value
|
|
73
|
-
})), x = () => {
|
|
74
|
-
s.value && (_.value = s.value.scrollTop === 0, v.value = s.value.scrollHeight - s.value.clientHeight === s.value.scrollTop);
|
|
75
|
-
}, d = async (i) => {
|
|
76
|
-
i && (await P(), u.value = s.value && s.value.scrollHeight > s.value.clientHeight);
|
|
77
|
-
}, { activePage: n, animation: p, isOpen: f, pages: w, previousPages: o, updatePage: y } = A(
|
|
78
|
-
W
|
|
79
|
-
);
|
|
80
|
-
h(() => f.value, d, { immediate: !0 }), h(() => g.value, d, { immediate: !0 });
|
|
81
|
-
const $ = r(() => t.previousPage ? !0 : t.previousPage === null ? !1 : b.value && g.value), G = () => {
|
|
82
|
-
p.value = E.TRANSITION_LEVEL_DEEPER, e("animationend");
|
|
83
|
-
}, b = r(() => o.value.length > 1), m = r(() => o.value[o.value.length - 1]), I = r(() => w.value.some((i) => i === n.value)), D = async (i) => {
|
|
84
|
-
if (i) {
|
|
85
|
-
const T = o.value.indexOf(i);
|
|
86
|
-
T !== -1 ? o.value = o.value.slice(0, T + 1) : o.value = [i];
|
|
87
|
-
} else
|
|
88
|
-
o.value.pop();
|
|
89
|
-
p.value = E.TRANSITION_LEVEL_UPPER, await P(), y(m.value);
|
|
90
|
-
};
|
|
91
|
-
h(
|
|
92
|
-
() => n.value,
|
|
93
|
-
async () => {
|
|
94
|
-
if (await P(), !!f.value) {
|
|
95
|
-
if (n.value && !I.value && K) {
|
|
96
|
-
console.error(
|
|
97
|
-
`The activePage passed "${n.value}" does not match the id of any of the pages`
|
|
98
|
-
);
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
n.value !== m.value && o.value.push(n.value);
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
{ immediate: !0 }
|
|
105
|
-
);
|
|
106
|
-
const L = A(Q), { unregisterPage: C } = L(t.pageId);
|
|
107
|
-
return j(() => C()), { __sfc: !0, props: t, emit: e, slots: a, hasSlot: S, t: O, contentElement: s, hasScroll: u, isScrollAtTop: _, isScrollAtBottom: v, showPage: g, headerConditionalClasses: R, footerConditionalClasses: k, onScroll: x, calculateScroll: d, activePage: n, animation: p, isOpen: f, pages: w, previousPages: o, updatePage: y, showBackButton: $, updateAnimation: G, hasPreviousPages: b, lastPage: m, isActivePageValid: I, goToPreviousPage: D, registerPage: L, unregisterPage: C, BentoButton: U, ArrowLeftIcon: q };
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
var ae = function() {
|
|
111
|
-
var e = this, t = e._self._c, a = e._self._setupProxy;
|
|
112
|
-
return t("Transition", { attrs: { name: a.animation, mode: "out-in" }, on: { "after-leave": a.updateAnimation } }, [a.isOpen && a.showPage ? t("div", { staticClass: "b-dialog-page" }, [a.hasSlot("header") ? t("div", { staticClass: "b-dialog-page__header", class: a.headerConditionalClasses }, [a.showBackButton ? t("div", { staticClass: "b-dialog-page__back-button", style: e.backButtonStyling, attrs: { "data-testid": "back-button" } }, [t(a.BentoButton, { attrs: { variant: "tertiary" }, on: { click: function(S) {
|
|
113
|
-
return a.goToPreviousPage(e.previousPage);
|
|
114
|
-
} } }, [t(a.ArrowLeftIcon, { attrs: { "svg-title": a.t("goToPreviousPage") } })], 1)], 1) : e._e(), e._t("header")], 2) : e._e(), a.hasSlot("content") ? t("div", { ref: "contentElement", staticClass: "b-dialog-page__content", on: { scroll: a.onScroll } }, [e._t("content")], 2) : e._e(), a.hasSlot("footer") ? t("div", { staticClass: "b-dialog-page__footer", class: a.footerConditionalClasses }, [e._t("footer")], 2) : e._e()]) : e._e()]);
|
|
115
|
-
}, oe = [], se = /* @__PURE__ */ N(
|
|
116
|
-
te,
|
|
117
|
-
ae,
|
|
118
|
-
oe,
|
|
119
|
-
!1,
|
|
120
|
-
null,
|
|
121
|
-
"99832465",
|
|
122
|
-
null,
|
|
123
|
-
null
|
|
124
|
-
);
|
|
125
|
-
const _e = se.exports;
|
|
126
|
-
export {
|
|
127
|
-
q as A,
|
|
128
|
-
E as B,
|
|
129
|
-
_e as D,
|
|
130
|
-
Q as a,
|
|
131
|
-
W as b
|
|
132
|
-
};
|
|
133
|
-
//# sourceMappingURL=dialog-page.75b295b7.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-page.75b295b7.js","sources":["../../../../node_modules/@adyen/ui-assets-icons-16/dist/vue/arrow-left.vue","../../src/components/internal/dialog-page/dialog-page.types.ts","../../src/components/internal/dialog-page/dialog-page.keys.ts","../../src/components/internal/dialog-page/dialog-page.vue"],"sourcesContent":["\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><path fill=\"#00112C\" d=\"M3.80655 7.25434L8.06077 3.00011L7.00011 1.93945L0.939453 8.00011L7.00011 14.0608L8.06077 13.0001L3.81499 8.75433L14.7508 8.74316L14.7492 7.24316L3.80655 7.25434Z\"/></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","import { Ref } from 'vue';\n\nexport enum BentoDialogPageAnimation {\n TRANSITION_LEVEL_DEEPER = 'b-dialog-page__animation--level-deeper',\n TRANSITION_LEVEL_UPPER = 'b-dialog-page__animation--level-upper',\n}\n\nexport interface BentoDialogPageConfigData {\n activePage: Ref<string>;\n animation: Ref<string>;\n isOpen: Ref<boolean>;\n pages: Ref<string[]>;\n previousPages: Ref<string[]>;\n updatePage: (page: string) => void;\n}\n\nexport type BentoDialogPageRegisterPage = (pageId: string) => { unregisterPage: () => void };\n","export const DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY = Symbol('dialog registerPage injection key');\nexport const DIALOG_PAGE_CONFIG_INJECTION_KEY = Symbol('dialog page config data injection key');\n","<template>\n <Transition :name=\"animation\" mode=\"out-in\" @after-leave=\"updateAnimation\">\n <div v-if=\"isOpen && showPage\" class=\"b-dialog-page\">\n <div v-if=\"hasSlot('header')\" class=\"b-dialog-page__header\" :class=\"headerConditionalClasses\">\n <div\n v-if=\"showBackButton\"\n class=\"b-dialog-page__back-button\"\n :style=\"backButtonStyling\"\n data-testid=\"back-button\"\n >\n <bento-button variant=\"tertiary\" @click=\"goToPreviousPage(previousPage)\">\n <arrow-left-icon :svg-title=\"t('goToPreviousPage')\" />\n </bento-button>\n </div>\n <slot name=\"header\"></slot>\n </div>\n <div v-if=\"hasSlot('content')\" ref=\"contentElement\" class=\"b-dialog-page__content\" @scroll=\"onScroll\">\n <slot name=\"content\" />\n </div>\n <div v-if=\"hasSlot('footer')\" class=\"b-dialog-page__footer\" :class=\"footerConditionalClasses\">\n <slot name=\"footer\" />\n </div>\n </div>\n </Transition>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, nextTick, onUnmounted, PropType, ref, useSlots, watch } from 'vue';\n\n import { BentoButton } from '@/components/button';\n import ArrowLeftIcon from '@adyen/ui-assets-icons-16/vue/arrow-left';\n\n import { useHasSlot } from '@/composables/use-has-slot/use-has-slot';\n import { useI18n } from '@/utils/ts/i18n';\n import { isDevelopmentEnviroment } from '@/utils/ts/dev-environment';\n\n import {\n BentoDialogPageAnimation,\n BentoDialogPageConfigData,\n BentoDialogPageRegisterPage,\n } from './dialog-page.types';\n import type { CSSProperties } from 'vue/types/jsx';\n\n import { DIALOG_PAGE_CONFIG_INJECTION_KEY, DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY } from './dialog-page.keys';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n /**\n * Identifier of the page, used with activePage prop to handle navigation\n */\n pageId: {\n type: String,\n default: undefined,\n },\n\n /**\n * Show header and actions border\n */\n alwaysShowBorder: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Pass custom styling to the back button to position it correctly with the header slot\n */\n backButtonStyling: { type: Object as PropType<CSSProperties>, default: null },\n\n /**\n * ID of the page for the back button to navigate to. Only use it to overwrite the default back behavior\n * Used when the back button should not take the user to the natural previous page\n * Set to `null` to hide back button in the page\n */\n previousPage: {\n type: String,\n default: undefined,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Fires when the animation ends\n */\n (e: 'animationend'): void;\n }>();\n\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n // Refs\n const contentElement = ref<HTMLDivElement>(null);\n const hasScroll = ref(false);\n const isScrollAtTop = ref(true);\n const isScrollAtBottom = ref(false);\n\n // Logic to choose which page is active/shown\n const showPage = computed(() => (activePage.value ? activePage.value === props.pageId : true));\n\n // Scrolling styling logic\n const headerConditionalClasses = computed(() => ({\n 'b-dialog-page__header--with-border': props.alwaysShowBorder || (hasScroll.value && !isScrollAtTop.value),\n }));\n\n const footerConditionalClasses = computed(() => ({\n 'b-dialog-page__footer--with-border': props.alwaysShowBorder || (hasScroll.value && !isScrollAtBottom.value),\n }));\n\n const onScroll = () => {\n if (!contentElement.value) {\n return;\n }\n\n isScrollAtTop.value = contentElement.value.scrollTop === 0;\n isScrollAtBottom.value =\n contentElement.value.scrollHeight - contentElement.value.clientHeight === contentElement.value.scrollTop;\n };\n\n const calculateScroll = async watchedValue => {\n if (!watchedValue) {\n return;\n }\n // Wait for content to be rendered to be able to calculate the height\n await nextTick();\n hasScroll.value = contentElement.value && contentElement.value.scrollHeight > contentElement.value.clientHeight;\n };\n\n const { activePage, animation, isOpen, pages, previousPages, updatePage } = inject<BentoDialogPageConfigData>(\n DIALOG_PAGE_CONFIG_INJECTION_KEY\n );\n\n watch(() => isOpen.value, calculateScroll, { immediate: true });\n watch(() => showPage.value, calculateScroll, { immediate: true });\n\n // Logic to determine whether the back button should be shown on the page\n const showBackButton = computed(() => {\n if (props.previousPage) {\n return true;\n }\n if (props.previousPage === null) {\n return false;\n }\n return hasPreviousPages.value && showPage.value;\n });\n\n // Animation\n const updateAnimation = () => {\n animation.value = BentoDialogPageAnimation.TRANSITION_LEVEL_DEEPER;\n emit('animationend');\n };\n\n // Previous page logic\n const hasPreviousPages = computed(() => previousPages.value.length > 1);\n const lastPage = computed(() => previousPages.value[previousPages.value.length - 1]);\n const isActivePageValid = computed(() => pages.value.some(page => page === activePage.value));\n\n const goToPreviousPage = async (page: string) => {\n if (page) {\n const index = previousPages.value.indexOf(page);\n if (index !== -1) {\n previousPages.value = previousPages.value.slice(0, index + 1);\n } else {\n previousPages.value = [page];\n }\n } else {\n previousPages.value.pop();\n }\n\n animation.value = BentoDialogPageAnimation.TRANSITION_LEVEL_UPPER;\n await nextTick();\n updatePage(lastPage.value);\n };\n\n // Add new page to the previousPage array to keep track of user navigation\n watch(\n () => activePage.value,\n async () => {\n await nextTick();\n if (!isOpen.value) {\n return;\n }\n\n if (!!activePage.value && !isActivePageValid.value) {\n if (isDevelopmentEnviroment) {\n // eslint-disable-next-line no-console\n console.error(\n `The activePage passed \"${activePage.value}\" does not match the id of any of the pages`\n );\n return;\n }\n }\n\n if (activePage.value !== lastPage.value) {\n previousPages.value.push(activePage.value);\n }\n },\n { immediate: true }\n );\n\n // Register page to parent component and inject data from parent component\n const registerPage = inject<BentoDialogPageRegisterPage>(DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY);\n const { unregisterPage } = registerPage(props.pageId);\n\n // Unregister page on unmounting the page\n onUnmounted(() => unregisterPage());\n</script>\n\n<script lang=\"ts\">\n /**\n * DialogPage is an internal component used to render different pages of dialog components (Modal, ModalFullscreen and Sidepanel)\n *\n * @example\n * import { DialogPage } from '@/internal';\n *\n * export default {\n * components: { DialogPage },\n * template: `\n * <dialog-page pageId='step1' always-show-border>\n * <template #header>Header</template>\n * <template #content>Content</template>\n * <template #footer>Footer</template>\n * </dialog-page>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./dialog-page.scss\" />\n"],"names":["uuid","_sfc_main$1","BentoDialogPageAnimation","BentoDialogPageAnimation2","DIALOG_PAGE_REGISTER_PAGE_INJECTION_KEY","DIALOG_PAGE_CONFIG_INJECTION_KEY","__default__","messages","slots","useSlots","hasSlot","useHasSlot","t","useI18n","contentElement","ref","hasScroll","isScrollAtTop","isScrollAtBottom","showPage","computed","activePage","props","headerConditionalClasses","footerConditionalClasses","onScroll","calculateScroll","watchedValue","nextTick","animation","isOpen","pages","previousPages","updatePage","inject","watch","showBackButton","hasPreviousPages","updateAnimation","emit","lastPage","isActivePageValid","page","goToPreviousPage","index","isDevelopmentEnviroment","registerPage","unregister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