@adyen/bento-vue3 1.19.0 → 1.20.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/packages/vue2/src/components/code-snippet/utils/indent-same-as-line-before-extension.d.ts +8 -0
- package/dist/@types/packages/vue2/src/components/code-snippet/utils/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.types.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.vue.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/filter-bar/components/date-range-filter/date-range-filter.vue.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/link/link.vue.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/payment-method/payment-method.types.d.ts +3 -1079
- package/dist/@types/packages/vue2/src/components/payment-method/payment-method.vue.d.ts +7 -8
- package/dist/@types/packages/vue2/src/components/segmented-control/components/segmented-control-button/segmented-control-button.vue.d.ts +1 -1
- package/dist/accordion.js +2 -2
- package/dist/action-bar.js +6 -6
- package/dist/alert.js +3 -3
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown-default-textbox.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/assets/index10.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/index46.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/avatar-image.js +1 -1
- package/dist/badge.js +1 -1
- package/dist/button.js +4 -4
- package/dist/card.js +3 -3
- package/dist/checkbox.js +6 -6
- package/dist/chunks/{base-button.585f4113.js → base-button.14dbcade.js} +2 -2
- package/dist/chunks/{base-button.585f4113.js.map → base-button.14dbcade.js.map} +1 -1
- package/dist/chunks/{base-modal.d3079635.js → base-modal.63e229a7.js} +110 -108
- package/dist/chunks/base-modal.63e229a7.js.map +1 -0
- package/dist/chunks/{button-actions-with-menu.dbba09d8.js → button-actions-with-menu.d6826d2b.js} +4 -4
- package/dist/chunks/{button-actions-with-menu.dbba09d8.js.map → button-actions-with-menu.d6826d2b.js.map} +1 -1
- package/dist/chunks/{button-actions.96f2b551.js → button-actions.dcfa4863.js} +3 -3
- package/dist/chunks/{button-actions.96f2b551.js.map → button-actions.dcfa4863.js.map} +1 -1
- package/dist/chunks/{button.22a91e4b.js → button.09a85d48.js} +3 -3
- package/dist/chunks/{button.22a91e4b.js.map → button.09a85d48.js.map} +1 -1
- package/dist/chunks/{calendar.1e8edacc.js → calendar.2d30e6bf.js} +163 -163
- package/dist/chunks/{calendar.1e8edacc.js.map → calendar.2d30e6bf.js.map} +1 -1
- package/dist/chunks/{checkbox.696307fa.js → checkbox.959f35a2.js} +3 -3
- package/dist/chunks/{checkbox.696307fa.js.map → checkbox.959f35a2.js.map} +1 -1
- package/dist/chunks/{controls-group.5be9f363.js → controls-group.c1bd2e23.js} +3 -3
- package/dist/chunks/{controls-group.5be9f363.js.map → controls-group.c1bd2e23.js.map} +1 -1
- package/dist/chunks/{copy.bcfb0bd0.js → copy.ae6eb33c.js} +4 -4
- package/dist/chunks/{copy.bcfb0bd0.js.map → copy.ae6eb33c.js.map} +1 -1
- package/dist/chunks/{dialog-page.4051a197.js → dialog-page.fa8cd314.js} +3 -3
- package/dist/chunks/{dialog-page.4051a197.js.map → dialog-page.fa8cd314.js.map} +1 -1
- package/dist/chunks/{dropdown-default-textbox.2f55222c.js → dropdown-default-textbox.e5689274.js} +116 -114
- package/dist/chunks/dropdown-default-textbox.e5689274.js.map +1 -0
- package/dist/chunks/{dropdown.03b54389.js → dropdown.d5a800b1.js} +25 -25
- package/dist/chunks/{dropdown.03b54389.js.map → dropdown.d5a800b1.js.map} +1 -1
- package/dist/chunks/{error-message.c1768603.js → error-message.002c5b52.js} +2 -2
- package/dist/chunks/{error-message.c1768603.js.map → error-message.002c5b52.js.map} +1 -1
- package/dist/chunks/{fixed-scroller.c35f1726.js → fixed-scroller.a27181f0.js} +2 -2
- package/dist/chunks/{fixed-scroller.c35f1726.js.map → fixed-scroller.a27181f0.js.map} +1 -1
- package/dist/chunks/{footer-actions.98e94560.js → footer-actions.1a3be1c3.js} +4 -4
- package/dist/chunks/{footer-actions.98e94560.js.map → footer-actions.1a3be1c3.js.map} +1 -1
- package/dist/chunks/index.299ed134.js +116 -0
- package/dist/chunks/index.299ed134.js.map +1 -0
- package/dist/chunks/{index.23a4ac80.js → index.358fcf5c.js} +6 -6
- package/dist/chunks/{index.23a4ac80.js.map → index.358fcf5c.js.map} +1 -1
- package/dist/chunks/{index.27509a03.js → index.47437c1b.js} +12 -12
- package/dist/chunks/{index.27509a03.js.map → index.47437c1b.js.map} +1 -1
- package/dist/chunks/{index.9a976e6e.js → index.5e79bb18.js} +3 -3
- package/dist/chunks/{index.9a976e6e.js.map → index.5e79bb18.js.map} +1 -1
- package/dist/chunks/{index.b29c7715.js → index.70c1282d.js} +6 -6
- package/dist/chunks/{index.b29c7715.js.map → index.70c1282d.js.map} +1 -1
- package/dist/chunks/{index.b21b8d6c.js → index.9213cd28.js} +2 -2
- package/dist/chunks/{index.b21b8d6c.js.map → index.9213cd28.js.map} +1 -1
- package/dist/chunks/index.995d6d84.js +125 -0
- package/dist/chunks/{index.14631d93.js.map → index.995d6d84.js.map} +1 -1
- package/dist/chunks/{index.2dfc4f88.js → index.b4ca0b44.js} +3 -3
- package/dist/chunks/{index.2dfc4f88.js.map → index.b4ca0b44.js.map} +1 -1
- package/dist/chunks/index.c2872321.js +23 -0
- package/dist/chunks/{index.fd1de76a.js.map → index.c2872321.js.map} +1 -1
- package/dist/chunks/{index.32b6c1a6.js → index.e30ba012.js} +2 -2
- package/dist/chunks/{index.32b6c1a6.js.map → index.e30ba012.js.map} +1 -1
- package/dist/chunks/{index.c446e6f7.js → index.e8e4c870.js} +123 -122
- package/dist/chunks/index.e8e4c870.js.map +1 -0
- package/dist/chunks/{index.0e4474d0.js → index.eba75263.js} +7 -7
- package/dist/chunks/{index.0e4474d0.js.map → index.eba75263.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.98903f6b.js → listbox-option-tag.34a061e6.js} +3 -3
- package/dist/chunks/{listbox-option-tag.98903f6b.js.map → listbox-option-tag.34a061e6.js.map} +1 -1
- package/dist/chunks/{listbox.a53a52ee.js → listbox.a54c9e2e.js} +5 -5
- package/dist/chunks/{listbox.a53a52ee.js.map → listbox.a54c9e2e.js.map} +1 -1
- package/dist/chunks/{loading-button.db938c88.js → loading-button.b770140c.js} +2 -2
- package/dist/chunks/{loading-button.db938c88.js.map → loading-button.b770140c.js.map} +1 -1
- package/dist/chunks/{tooltip.b2da7195.js → tooltip.f252f6b5.js} +3 -3
- package/dist/chunks/{tooltip.b2da7195.js.map → tooltip.f252f6b5.js.map} +1 -1
- package/dist/code-snippet.js +179 -163
- package/dist/code-snippet.js.map +1 -1
- package/dist/country.js +2 -2
- package/dist/currency.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +20 -20
- package/dist/date-picker.js.map +1 -1
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/divider.js +1 -1
- package/dist/dropdown.js +6 -6
- package/dist/empty-state.js +3 -3
- package/dist/filter-bar.js +748 -743
- package/dist/filter-bar.js.map +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +2 -2
- package/dist/header.js +4 -4
- package/dist/index.js +20 -20
- package/dist/info-icon.js +3 -3
- package/dist/input-field.js +4 -4
- package/dist/internal.js +8 -8
- 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 +53 -53
- package/dist/payment-method.js.map +1 -1
- package/dist/popover.js +1 -1
- package/dist/popper-container.js +1 -1
- package/dist/radio-group.js +4 -4
- package/dist/search-bar.js +14 -14
- package/dist/search-bar.js.map +1 -1
- package/dist/secondary-nav.js +2 -2
- package/dist/segmented-control.js +3 -3
- package/dist/sidepanel.js +6 -6
- 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 +3 -3
- package/dist/tag.js +3 -3
- package/dist/textarea.js +4 -4
- package/dist/timeline.js +7 -7
- package/dist/toast.js +3 -3
- package/dist/toggle.js +2 -2
- package/dist/tutorial.js +6 -6
- package/dist/typography.js +1 -1
- package/dist/web-types.json +10 -1
- package/package.json +3 -3
- package/dist/chunks/base-modal.d3079635.js.map +0 -1
- package/dist/chunks/dropdown-default-textbox.2f55222c.js.map +0 -1
- package/dist/chunks/index.14631d93.js +0 -125
- package/dist/chunks/index.368bb7c9.js +0 -112
- package/dist/chunks/index.368bb7c9.js.map +0 -1
- package/dist/chunks/index.c446e6f7.js.map +0 -1
- package/dist/chunks/index.fd1de76a.js +0 -21
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { B as
|
|
3
|
-
import { a as
|
|
4
|
-
import { B as
|
|
5
|
-
import { B as te } from "./index.b21b8d6c.js";
|
|
1
|
+
import { defineComponent as N, useSlots as Q, useAttrs as j, ref as B, computed as n, watch as G, onMounted as V, provide as X, openBlock as i, createElementBlock as O, createElementVNode as u, unref as t, normalizeClass as k, withKeys as Z, createBlock as b, withCtx as r, normalizeStyle as g, createVNode as T, createCommentVNode as c, renderSlot as m } from "vue";
|
|
2
|
+
import { B as M } from "./index.995d6d84.js";
|
|
3
|
+
import { a as ee } from "./button.09a85d48.js";
|
|
4
|
+
import { B as te } from "./index.9213cd28.js";
|
|
6
5
|
import { u as ae } from "./use-has-slot.4d98bf29.js";
|
|
7
6
|
import { u as oe } from "./i18n.f7e6533e.js";
|
|
8
7
|
import { M as se } from "./base-modal.keys.b08a6bdf.js";
|
|
@@ -11,20 +10,20 @@ import { C as ne } from "./cross.26509efc.js";
|
|
|
11
10
|
import { G as ie, a as de } from "./grid-layout.c2fe3057.js";
|
|
12
11
|
import { _ as re } from "./_plugin-vue_export-helper.dad06003.js";
|
|
13
12
|
import "../assets/base-modal.css";
|
|
14
|
-
var ce = /* @__PURE__ */ ((e) => (e.DEFAULT = "default", e.DIALOG = "dialog", e))(ce || {}),
|
|
15
|
-
const
|
|
13
|
+
var ce = /* @__PURE__ */ ((e) => (e.DEFAULT = "default", e.DIALOG = "dialog", e))(ce || {}), ue = /* @__PURE__ */ ((e) => (e.DEFAULT = "BentoModalDefault", e.DIALOG = "BentoModalDialog", e))(ue || {}), h = /* @__PURE__ */ ((e) => (e.SMALL = "small", e.MEDIUM = "medium", e.LARGE = "large", e))(h || {}), y = /* @__PURE__ */ ((e) => (e.SMALLER = "smaller", e.EQUAL = "equal", e.BIGGER = "bigger", e))(y || {}), v = /* @__PURE__ */ ((e) => (e.DIALOG = "dialog", e.ALERT_DIALOG = "alertdialog", e))(v || {}), me = /* @__PURE__ */ ((e) => (e.CONFIRMATION = "confirmation", e.DESTRUCTIVE = "destructive", e.INFO = "info", e.ACKNOWLEDGEMENT = "acknowledgement", e))(me || {}), _e = /* @__PURE__ */ ((e) => (e.CLOSE_MODAL = "close-modal", e))(_e || {});
|
|
14
|
+
const R = {
|
|
16
15
|
"en-US": {
|
|
17
16
|
ariaLabelFallback: "modal",
|
|
18
17
|
close: "Close"
|
|
19
18
|
}
|
|
20
|
-
},
|
|
19
|
+
}, pe = { class: "b-modal-base" }, fe = ["id", "role", "aria-label", "open", "onKeydown"], be = { class: "b-modal-base__wrapper" }, ge = { class: "b-modal-base__header" }, ye = {
|
|
21
20
|
"aria-label": "modal actions",
|
|
22
21
|
class: "b-modal-base__actions"
|
|
23
|
-
},
|
|
24
|
-
i18n: { messages:
|
|
22
|
+
}, ve = N({
|
|
23
|
+
i18n: { messages: R },
|
|
25
24
|
name: "base-modal"
|
|
26
|
-
}), Le = /* @__PURE__ */
|
|
27
|
-
...
|
|
25
|
+
}), Le = /* @__PURE__ */ N({
|
|
26
|
+
...ve,
|
|
28
27
|
props: {
|
|
29
28
|
/**
|
|
30
29
|
* List of actions that will be used to render the buttons.
|
|
@@ -63,7 +62,7 @@ const T = {
|
|
|
63
62
|
*/
|
|
64
63
|
columnsSize: {
|
|
65
64
|
type: String,
|
|
66
|
-
default:
|
|
65
|
+
default: y.SMALLER
|
|
67
66
|
},
|
|
68
67
|
/**
|
|
69
68
|
* If provided, manages the padding of the whole modal container
|
|
@@ -94,7 +93,7 @@ const T = {
|
|
|
94
93
|
*/
|
|
95
94
|
size: {
|
|
96
95
|
type: String,
|
|
97
|
-
default:
|
|
96
|
+
default: h.SMALL
|
|
98
97
|
},
|
|
99
98
|
/**
|
|
100
99
|
* If provided, renders the modal's content in a two-column layout an wth dividers separating its content
|
|
@@ -102,8 +101,8 @@ const T = {
|
|
|
102
101
|
withColumnLayout: { type: Boolean, default: !1 }
|
|
103
102
|
},
|
|
104
103
|
emits: ["close-modal"],
|
|
105
|
-
setup(e, { expose:
|
|
106
|
-
const a = e,
|
|
104
|
+
setup(e, { expose: w, emit: P }) {
|
|
105
|
+
const a = e, F = 500, U = 26, { t: E } = oe({ messages: R }), z = Q(), $ = j(), l = ae(z), d = B(null), _ = B(!1), I = le("modal"), S = n(() => a.isDismissible && !a.hideCloseButton), p = n(() => {
|
|
107
106
|
if (!a.customPadding)
|
|
108
107
|
return {};
|
|
109
108
|
const o = {
|
|
@@ -111,169 +110,172 @@ const T = {
|
|
|
111
110
|
paddingRight: a.customPadding
|
|
112
111
|
}, s = { ...o, paddingTop: void 0, paddingBottom: void 0 };
|
|
113
112
|
return l("default") || (s.paddingTop = a.customPadding), l("actions") || (s.paddingBottom = a.customPadding), {
|
|
114
|
-
header: {
|
|
113
|
+
header: {
|
|
114
|
+
...o,
|
|
115
|
+
paddingTop: a.customPadding,
|
|
116
|
+
flex: 0,
|
|
117
|
+
paddingRight: `${parseInt(a.customPadding, 10) + U}px`
|
|
118
|
+
},
|
|
115
119
|
content: s,
|
|
120
|
+
closeButton: { top: a.customPadding, right: a.customPadding },
|
|
116
121
|
actions: { ...o, paddingBottom: a.customPadding }
|
|
117
122
|
};
|
|
118
|
-
}),
|
|
119
|
-
|
|
120
|
-
}, K = () => {
|
|
121
|
-
F("close-modal");
|
|
123
|
+
}), K = n(() => $["aria-label"] ?? E("ariaLabelFallback")), L = n(() => a.withColumnLayout && a.size === h.LARGE), D = () => {
|
|
124
|
+
d.value.showModal();
|
|
122
125
|
}, q = () => {
|
|
123
|
-
|
|
124
|
-
},
|
|
125
|
-
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
},
|
|
129
|
-
o && o.
|
|
130
|
-
}, W =
|
|
126
|
+
P("close-modal");
|
|
127
|
+
}, x = () => {
|
|
128
|
+
_.value && (d.value.close(), q(), _.value = !1);
|
|
129
|
+
}, C = () => {
|
|
130
|
+
d.value.open && (_.value = !0);
|
|
131
|
+
}, f = (o) => {
|
|
132
|
+
o && o.preventDefault(), !(!a.isDismissible && a.modalRole === v.DIALOG) && C();
|
|
133
|
+
}, W = ({ target: o }) => {
|
|
134
|
+
o && o.tagName === v.DIALOG.toUpperCase() && f();
|
|
135
|
+
}, H = n(() => ({
|
|
131
136
|
[`b-modal-base__container--${a.size}`]: a.size,
|
|
132
|
-
"b-modal-base__container--hide":
|
|
133
|
-
"b-modal-base__container--column-layout":
|
|
134
|
-
})), Y =
|
|
135
|
-
"b-modal-base__content--column-layout":
|
|
137
|
+
"b-modal-base__container--hide": _.value,
|
|
138
|
+
"b-modal-base__container--column-layout": L.value
|
|
139
|
+
})), Y = n(() => ({
|
|
140
|
+
"b-modal-base__content--column-layout": L.value,
|
|
136
141
|
"b-modal-base__content--with-header": l("default"),
|
|
137
142
|
"b-modal-base__content--with-actions": l("actions")
|
|
138
|
-
})),
|
|
143
|
+
})), J = n(() => a.columnsSize === y.SMALLER ? [
|
|
139
144
|
{ small: 4, medium: 4, large: 4 },
|
|
140
145
|
{ small: 8, medium: 8, large: 8 }
|
|
141
|
-
] : a.columnsSize ===
|
|
146
|
+
] : a.columnsSize === y.BIGGER ? [
|
|
142
147
|
{ small: 8, medium: 8, large: 8 },
|
|
143
148
|
{ small: 4, medium: 4, large: 4 }
|
|
144
149
|
] : [
|
|
145
150
|
{ small: 6, medium: 6, large: 6 },
|
|
146
151
|
{ small: 6, medium: 6, large: 6 }
|
|
147
152
|
]);
|
|
148
|
-
return
|
|
149
|
-
() => [a.isOpen,
|
|
153
|
+
return G(
|
|
154
|
+
() => [a.isOpen, d.value],
|
|
150
155
|
([o, s], [, A]) => {
|
|
151
156
|
if (!s)
|
|
152
157
|
return;
|
|
153
|
-
o ?
|
|
158
|
+
o ? D() : !A || C();
|
|
154
159
|
}
|
|
155
|
-
),
|
|
160
|
+
), G(
|
|
156
161
|
() => a.actions,
|
|
157
162
|
() => {
|
|
158
163
|
var o, s;
|
|
159
|
-
((s = (o = a.actions) == null ? void 0 : o[0]) == null ? void 0 : s.state) === "success" && setTimeout(
|
|
164
|
+
((s = (o = a.actions) == null ? void 0 : o[0]) == null ? void 0 : s.state) === "success" && setTimeout(C, F);
|
|
160
165
|
},
|
|
161
166
|
{ deep: !0 }
|
|
162
|
-
),
|
|
163
|
-
a.isOpen &&
|
|
164
|
-
}),
|
|
165
|
-
internalModalActionClose:
|
|
166
|
-
}),
|
|
167
|
-
|
|
167
|
+
), V(() => {
|
|
168
|
+
a.isOpen && d.value && D();
|
|
169
|
+
}), w({
|
|
170
|
+
internalModalActionClose: f
|
|
171
|
+
}), X(se, I), (o, s) => (i(), O("div", pe, [
|
|
172
|
+
u("dialog", {
|
|
168
173
|
id: t(I),
|
|
169
174
|
ref_key: "modal",
|
|
170
|
-
ref:
|
|
175
|
+
ref: d,
|
|
171
176
|
role: e.modalRole,
|
|
172
|
-
"aria-label": t(
|
|
173
|
-
class:
|
|
177
|
+
"aria-label": t(K),
|
|
178
|
+
class: k(["b-modal-base__container", t(H)]),
|
|
174
179
|
open: e.initiallyOpen,
|
|
175
|
-
onAnimationend:
|
|
176
|
-
onClick: s[0] || (s[0] = (A) => e.isDismissible &&
|
|
177
|
-
onKeydown:
|
|
180
|
+
onAnimationend: x,
|
|
181
|
+
onClick: s[0] || (s[0] = (A) => e.isDismissible && W(A)),
|
|
182
|
+
onKeydown: Z(f, ["esc"])
|
|
178
183
|
}, [
|
|
179
|
-
e.isOpen || e.initiallyOpen ? (
|
|
180
|
-
default:
|
|
181
|
-
|
|
182
|
-
|
|
184
|
+
e.isOpen || e.initiallyOpen ? (i(), b(t(te), { key: 0 }, {
|
|
185
|
+
default: r(() => [
|
|
186
|
+
t(S) ? (i(), b(t(ee), {
|
|
187
|
+
key: 0,
|
|
188
|
+
class: "b-modal-base__close-button",
|
|
189
|
+
variant: "tertiary",
|
|
190
|
+
type: "button",
|
|
191
|
+
style: g(t(p).closeButton),
|
|
192
|
+
onClick: f
|
|
193
|
+
}, {
|
|
194
|
+
default: r(() => [
|
|
195
|
+
T(t(ne), {
|
|
196
|
+
"svg-title": t(E)("close")
|
|
197
|
+
}, null, 8, ["svg-title"])
|
|
198
|
+
]),
|
|
199
|
+
_: 1
|
|
200
|
+
}, 8, ["style"])) : c("", !0),
|
|
201
|
+
u("div", be, [
|
|
202
|
+
t(l)("default") || t(S) ? (i(), O("div", {
|
|
183
203
|
key: 0,
|
|
184
204
|
class: "b-modal-base__header-container",
|
|
185
|
-
style:
|
|
205
|
+
style: g(t(p).header)
|
|
186
206
|
}, [
|
|
187
|
-
|
|
188
|
-
|
|
207
|
+
u("div", ge, [
|
|
208
|
+
T(t(M), {
|
|
189
209
|
class: "b-modal-base__title",
|
|
190
210
|
"aria-label": "base modal title",
|
|
191
211
|
el: "span",
|
|
192
212
|
variant: "title",
|
|
193
213
|
stronger: ""
|
|
194
214
|
}, {
|
|
195
|
-
default:
|
|
196
|
-
t(l)("default") ?
|
|
215
|
+
default: r(() => [
|
|
216
|
+
t(l)("default") ? m(o.$slots, "default", { key: 0 }, void 0, !0) : c("", !0)
|
|
197
217
|
]),
|
|
198
218
|
_: 3
|
|
199
|
-
})
|
|
200
|
-
t(D) ? (n(), u(t(Z), {
|
|
201
|
-
key: 0,
|
|
202
|
-
class: "b-modal-base__close-button",
|
|
203
|
-
variant: "tertiary",
|
|
204
|
-
type: "button",
|
|
205
|
-
onClick: b
|
|
206
|
-
}, {
|
|
207
|
-
default: c(() => [
|
|
208
|
-
M(t(ne), {
|
|
209
|
-
"svg-title": t(O)("close")
|
|
210
|
-
}, null, 8, ["svg-title"])
|
|
211
|
-
]),
|
|
212
|
-
_: 1
|
|
213
|
-
})) : d("", !0)
|
|
219
|
+
})
|
|
214
220
|
])
|
|
215
|
-
], 4)) :
|
|
216
|
-
|
|
217
|
-
class:
|
|
218
|
-
style:
|
|
221
|
+
], 4)) : c("", !0),
|
|
222
|
+
u("div", {
|
|
223
|
+
class: k(["b-modal-base__content", t(Y)]),
|
|
224
|
+
style: g(t(p).content)
|
|
219
225
|
}, [
|
|
220
|
-
t(l)("content") || t(l)("content-col-1") && t(l)("content-col-2") ? (
|
|
226
|
+
t(l)("content") || t(l)("content-col-1") && t(l)("content-col-2") ? (i(), b(t(M), {
|
|
221
227
|
key: 0,
|
|
222
228
|
"aria-label": "base modal content",
|
|
223
229
|
el: "div",
|
|
224
230
|
variant: "body",
|
|
225
231
|
stronger: ""
|
|
226
232
|
}, {
|
|
227
|
-
default:
|
|
228
|
-
t(
|
|
233
|
+
default: r(() => [
|
|
234
|
+
t(L) ? (i(), b(t(ie), {
|
|
229
235
|
key: 0,
|
|
230
|
-
"column-width": t(
|
|
236
|
+
"column-width": t(J),
|
|
231
237
|
"container-type": t(de).NORMAL,
|
|
232
238
|
"no-gap": "",
|
|
233
239
|
class: "b-modal-base__grid"
|
|
234
240
|
}, {
|
|
235
|
-
"col-1":
|
|
236
|
-
|
|
241
|
+
"col-1": r(() => [
|
|
242
|
+
m(o.$slots, "content-col-1", {}, void 0, !0)
|
|
237
243
|
]),
|
|
238
|
-
"col-2":
|
|
239
|
-
|
|
244
|
+
"col-2": r(() => [
|
|
245
|
+
m(o.$slots, "content-col-2", {}, void 0, !0)
|
|
240
246
|
]),
|
|
241
247
|
_: 3
|
|
242
|
-
}, 8, ["column-width", "container-type"])) :
|
|
248
|
+
}, 8, ["column-width", "container-type"])) : m(o.$slots, "content", { key: 1 }, void 0, !0)
|
|
243
249
|
]),
|
|
244
250
|
_: 3
|
|
245
|
-
})) :
|
|
251
|
+
})) : c("", !0)
|
|
246
252
|
], 6),
|
|
247
|
-
t(l)("actions") ? (
|
|
253
|
+
t(l)("actions") ? (i(), O("div", {
|
|
248
254
|
key: 1,
|
|
249
255
|
class: "b-modal-base__actions-container",
|
|
250
|
-
style:
|
|
256
|
+
style: g(t(p).actions)
|
|
251
257
|
}, [
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
class: "b-modal-base__divider"
|
|
255
|
-
})) : d("", !0),
|
|
256
|
-
m("div", ve, [
|
|
257
|
-
_(o.$slots, "actions", {}, void 0, !0)
|
|
258
|
+
u("div", ye, [
|
|
259
|
+
m(o.$slots, "actions", {}, void 0, !0)
|
|
258
260
|
])
|
|
259
|
-
], 4)) :
|
|
261
|
+
], 4)) : c("", !0)
|
|
260
262
|
])
|
|
261
263
|
]),
|
|
262
264
|
_: 3
|
|
263
|
-
})) :
|
|
264
|
-
], 42,
|
|
265
|
+
})) : c("", !0)
|
|
266
|
+
], 42, fe)
|
|
265
267
|
]));
|
|
266
268
|
}
|
|
267
269
|
});
|
|
268
|
-
const
|
|
270
|
+
const Me = /* @__PURE__ */ re(Le, [["__scopeId", "data-v-a849076a"]]);
|
|
269
271
|
export {
|
|
270
272
|
ce as B,
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
273
|
+
ue as a,
|
|
274
|
+
h as b,
|
|
275
|
+
y as c,
|
|
274
276
|
v as d,
|
|
275
|
-
|
|
277
|
+
me as e,
|
|
276
278
|
_e as f,
|
|
277
|
-
|
|
279
|
+
Me as g
|
|
278
280
|
};
|
|
279
|
-
//# sourceMappingURL=base-modal.
|
|
281
|
+
//# sourceMappingURL=base-modal.63e229a7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-modal.63e229a7.js","sources":["../../../vue2/src/components/modal/modal.types.ts","../../../vue2/src/components/modal/components/base-modal/base-modal.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoModalVariant {\n DEFAULT = 'default',\n DIALOG = 'dialog',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoModalVariantMapping {\n DEFAULT = 'BentoModalDefault',\n DIALOG = 'BentoModalDialog',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoModalSize {\n SMALL = 'small',\n MEDIUM = 'medium',\n LARGE = 'large',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoModalColumnLayoutVariant {\n SMALLER = 'smaller',\n EQUAL = 'equal',\n BIGGER = 'bigger',\n}\n\nexport enum BentoModalRole {\n DIALOG = 'dialog',\n ALERT_DIALOG = 'alertdialog',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoModalDialogType {\n CONFIRMATION = 'confirmation',\n DESTRUCTIVE = 'destructive',\n INFO = 'info',\n ACKNOWLEDGEMENT = 'acknowledgement',\n}\n\nexport enum BentoModalEvent {\n CLOSE_MODAL = 'close-modal',\n}\n","<template>\n <div class=\"b-modal-base\">\n <dialog\n :id=\"modalId\"\n ref=\"modal\"\n :role=\"modalRole\"\n :aria-label=\"computedAriaLabel\"\n class=\"b-modal-base__container\"\n :class=\"modalConditionalClasses\"\n :open=\"initiallyOpen\"\n @animationend=\"closeModalAfterAnimation\"\n @click=\"isDismissible && closeModalOnClickOutside($event)\"\n @keydown.esc=\"internalModalActionClose\"\n >\n <bento-focus-trap v-if=\"isOpen || initiallyOpen\">\n <bento-button\n v-if=\"showCloseButton\"\n class=\"b-modal-base__close-button\"\n variant=\"tertiary\"\n type=\"button\"\n :style=\"customPaddingStyles.closeButton\"\n @click=\"internalModalActionClose\"\n >\n <cross-icon :svg-title=\"t('close')\" />\n </bento-button>\n <div class=\"b-modal-base__wrapper\">\n <div\n v-if=\"hasSlot('default') || showCloseButton\"\n class=\"b-modal-base__header-container\"\n :style=\"customPaddingStyles.header\"\n >\n <div class=\"b-modal-base__header\">\n <bento-typography\n class=\"b-modal-base__title\"\n aria-label=\"base modal title\"\n el=\"span\"\n variant=\"title\"\n stronger\n >\n <slot v-if=\"hasSlot('default')\" />\n </bento-typography>\n </div>\n </div>\n\n <div\n class=\"b-modal-base__content\"\n :class=\"modalContentConditionalClasses\"\n :style=\"customPaddingStyles.content\"\n >\n <bento-typography\n v-if=\"hasSlot('content') || (hasSlot('content-col-1') && hasSlot('content-col-2'))\"\n aria-label=\"base modal content\"\n el=\"div\"\n variant=\"body\"\n stronger\n >\n <grid-layout\n v-if=\"hasColumnLayout\"\n :column-width=\"computedColumnWidth\"\n :container-type=\"GridLayoutContainerType.NORMAL\"\n no-gap\n class=\"b-modal-base__grid\"\n >\n <template #col-1><slot name=\"content-col-1\"></slot></template>\n <template #col-2><slot name=\"content-col-2\"></slot></template>\n </grid-layout>\n <slot v-else name=\"content\" />\n </bento-typography>\n </div>\n\n <div\n v-if=\"hasSlot('actions')\"\n class=\"b-modal-base__actions-container\"\n :style=\"customPaddingStyles.actions\"\n >\n <div aria-label=\"modal actions\" class=\"b-modal-base__actions\">\n <slot name=\"actions\" />\n </div>\n </div>\n </div>\n </bento-focus-trap>\n </dialog>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, onMounted, PropType, provide, ref, useAttrs, useSlots, watch } from 'vue';\n import { BentoModalColumnLayoutVariant, BentoModalRole, BentoModalSize } from '@/components/modal/modal.types';\n import { BentoTypography } from '@/components/typography';\n import { BentoButton, BentoButtonActionsList } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import { GridLayout, GridLayoutContainerType } from '@/internal';\n import { useHasSlot } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import { MODAL_DIALOG_ID_INJECTION_KEY } from '@/components/modal/components/base-modal/base-modal.keys';\n import { generateUid } from '@/utils/ts/unique-id';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n const LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME = 500;\n const CLOSE_BUTTON_ICON_WIDTH = 26;\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const slots = useSlots();\n const attrs = useAttrs();\n const hasSlot = useHasSlot(slots);\n const modal = ref<HTMLDialogElement>(null);\n const isClosing = ref(false);\n const modalId = generateUid('modal');\n\n const emit = defineEmits<{\n /**\n * Emitted when the modal is closed.\n */\n (e: 'close-modal');\n }>();\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n * But you may change the color of 1-st action to red with 'critial' key\n * Not more than 3 action buttons can be provided\n * Or 2 action buttons and 1 Label for them\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon`: Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * ```\n * [{\n * title: 'Primary',2\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * If a column layout is provided, it renders the respective left column width variant. This can be smaller than the second column, the same size as the second column or bigger than the second column.\n */\n columnsSize: {\n type: String as PropType<BentoModalColumnLayoutVariant>,\n default: BentoModalColumnLayoutVariant.SMALLER,\n },\n\n /**\n * If provided, manages the padding of the whole modal container\n */\n customPadding: { type: String, default: null },\n\n /**\n * Hides a cross icon on the right side of the title\n */\n hideCloseButton: { type: Boolean, required: true },\n\n /**\n * Sets the open attribute on the dialog element, use isOpen instead to toggle modal visbility.\n */\n initiallyOpen: { type: Boolean, default: false },\n\n /**\n * If set to true, it allows the modal to be closed by clicking outside of it\n */\n isDismissible: { type: Boolean, required: true },\n\n /**\n * Controls the modal's state from the outside. Set it to true to open the modal\n */\n isOpen: { type: Boolean, required: true },\n\n /**\n * Defines whether the modal will be an alert modal\n */\n modalRole: { type: String, default: BentoModalRole.DIALOG },\n\n /**\n * Sets the width of the modal\n */\n size: {\n type: String as PropType<BentoModalSize | `${BentoModalSize}`>,\n default: BentoModalSize.SMALL,\n },\n\n /**\n * If provided, renders the modal's content in a two-column layout an wth dividers separating its content\n */\n withColumnLayout: { type: Boolean, default: false },\n });\n\n const showCloseButton = computed(() => props.isDismissible && !props.hideCloseButton);\n\n const customPaddingStyles = computed(() => {\n if (!props.customPadding) {\n return {};\n }\n\n const xPadding = {\n paddingLeft: props.customPadding,\n paddingRight: props.customPadding,\n };\n\n const content = { ...xPadding, paddingTop: undefined, paddingBottom: undefined };\n\n if (!hasSlot('default')) {\n content.paddingTop = props.customPadding;\n }\n\n if (!hasSlot('actions')) {\n content.paddingBottom = props.customPadding;\n }\n\n return {\n header: {\n ...xPadding,\n paddingTop: props.customPadding,\n flex: 0,\n paddingRight: `${parseInt(props.customPadding, 10) + CLOSE_BUTTON_ICON_WIDTH}px`,\n },\n content,\n closeButton: { top: props.customPadding, right: props.customPadding },\n actions: { ...xPadding, paddingBottom: props.customPadding },\n };\n });\n\n const computedAriaLabel = computed(() => (attrs['aria-label'] as string) ?? (t('ariaLabelFallback') as string));\n const hasColumnLayout = computed(() => props.withColumnLayout && props.size === BentoModalSize.LARGE);\n\n const openModal = (): void => {\n modal.value.showModal();\n };\n\n const emitCloseEvent = (): void => {\n emit('close-modal');\n };\n\n // Handle closing and closing animation for dialog element\n const closeModalAfterAnimation = () => {\n if (isClosing.value) {\n modal.value.close();\n emitCloseEvent();\n isClosing.value = false;\n }\n };\n\n const startCloseModalAnimation = () => {\n if (!modal.value.open) {\n return;\n }\n isClosing.value = true;\n };\n\n /**\n * If the user has pressed escape, clicked outside or clicked the close icon.\n * Needs to be called from outside, following the \"dialog.close()\" pattern,\n * when the closing event is triggered outside of the \"base-modal\"\n * component (e.g. from a closing action).\n */\n const internalModalActionClose = (event?: Event) => {\n if (event) {\n event.preventDefault();\n }\n if (!props.isDismissible && props.modalRole === BentoModalRole.DIALOG) {\n return;\n }\n startCloseModalAnimation();\n };\n\n /**\n * Since the dialog HTML element doesn't automatically close when clicking outside, a check on when the user is clicking is needed.\n * If the click doesn't happen in the dialog box itself, the modal closes\n */\n const closeModalOnClickOutside = ({ target }: Event): void => {\n if (target && (target as HTMLElement).tagName === BentoModalRole.DIALOG.toUpperCase()) {\n internalModalActionClose();\n }\n };\n\n const modalConditionalClasses = computed(() => ({\n [`b-modal-base__container--${props.size}`]: props.size,\n 'b-modal-base__container--hide': isClosing.value,\n 'b-modal-base__container--column-layout': hasColumnLayout.value,\n }));\n\n const modalContentConditionalClasses = computed(() => ({\n 'b-modal-base__content--column-layout': hasColumnLayout.value,\n 'b-modal-base__content--with-header': hasSlot('default'),\n 'b-modal-base__content--with-actions': hasSlot('actions'),\n }));\n\n const computedColumnWidth = computed(() => {\n if (props.columnsSize === BentoModalColumnLayoutVariant.SMALLER) {\n return [\n { small: 4, medium: 4, large: 4 },\n { small: 8, medium: 8, large: 8 },\n ];\n }\n if (props.columnsSize === BentoModalColumnLayoutVariant.BIGGER) {\n return [\n { small: 8, medium: 8, large: 8 },\n { small: 4, medium: 4, large: 4 },\n ];\n }\n return [\n { small: 6, medium: 6, large: 6 },\n { small: 6, medium: 6, large: 6 },\n ];\n });\n\n watch(\n () => [props.isOpen, modal.value],\n ([newIsOpen, newModalValue], [, oldModalValue]): void => {\n if (!newModalValue) {\n return;\n }\n\n const isFirstMutation = !oldModalValue;\n if (newIsOpen) {\n openModal();\n } else if (!isFirstMutation) {\n startCloseModalAnimation();\n }\n }\n );\n\n // If the first button is a loading button then close the modal have 0.5 seconds\n // if the state is changed to 'success'.\n watch(\n () => props.actions,\n () => {\n if (props.actions?.[0]?.state === 'success') {\n setTimeout(startCloseModalAnimation, LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME);\n }\n },\n { deep: true }\n );\n\n onMounted(() => {\n if (props.isOpen && modal.value) {\n openModal();\n }\n });\n\n /**\n * Expose methods through its 'ref'\n */\n defineExpose({\n internalModalActionClose,\n });\n\n // Let's Children components know they are inside a Modal (dialog element)\n provide(MODAL_DIALOG_ID_INJECTION_KEY, modalId);\n</script>\n\n<script lang=\"ts\">\n /**\n * Dialog container. It creates a dialog HTML element for the modal to use.\n *\n * @example\n * import BaseModal from './components/base-modal/base-modal.vue';\n *\n * export default {\n * components: { BaseModal },\n * template: `\n * <base-modal\n * :hide-close-button=\"true\"\n * :is-dismissible=\"false\"\n * :is-open=\"isOpen\"\n * @close-modal=\"isOpen = false\"\n * >\n * <template #content-col-1>\n * // Content on the left side column\n * </template>\n *\n * <template #content-col-2>\n * // Content on the right side column\n * </template>\n *\n * <template v-if=\"actions\" #actions>\n * <footer-actions :actions=\"actions\" />\n * </template>\n * </base-modal>\n * `,\n * setup() {\n * const isOpen = ref(true)\n * const footerActions = [{\n * title: 'Primary action',\n * event: () => { ... }\n * }]\n * }\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'base-modal',\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./base-modal.scss\" />\n"],"names":["BentoModalVariant","BentoModalVariant2","BentoModalVariantMapping","BentoModalVariantMapping2","BentoModalSize","BentoModalSize2","BentoModalColumnLayoutVariant","BentoModalColumnLayoutVariant2","BentoModalRole","BentoModalRole2","BentoModalDialogType","BentoModalDialogType2","BentoModalEvent","BentoModalEvent2","__default__","defineComponent","messages","LOADING_BTN_CLOSE_AFTER_SUCCESS_DELAY_TIME","CLOSE_BUTTON_ICON_WIDTH","t","useI18n","slots","useSlots","attrs","useAttrs","hasSlot","useHasSlot","modal","ref","isClosing","modalId","generateUid","showCloseButton","computed","props","customPaddingStyles","xPadding","content","computedAriaLabel","hasColumnLayout","openModal","emitCloseEvent","emit","closeModalAfterAnimation","startCloseModalAnimation","internalModalActionClose","event","closeModalOnClickOutside","target","modalConditionalClasses","modalContentConditionalClasses","computedColumnWidth","watch","newIsOpen","newModalValue","oldModalValue","_b","_a","onMounted","expose","provide","MODAL_DIALOG_ID_INJECTION_KEY"],"mappings":"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"}
|
package/dist/chunks/{button-actions-with-menu.dbba09d8.js → button-actions-with-menu.d6826d2b.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as d, computed as s, toRef as u, provide as l, openBlock as c, createElementBlock as p, createElementVNode as m, createVNode as _, unref as n, createBlock as f, createCommentVNode as v } from "vue";
|
|
2
|
-
import { M as b, B as y } from "./index.
|
|
3
|
-
import { B } from "./index.
|
|
4
|
-
import { B as h } from "./button-actions.
|
|
2
|
+
import { M as b, B as y } from "./index.eba75263.js";
|
|
3
|
+
import { B } from "./index.70c1282d.js";
|
|
4
|
+
import { B as h } from "./button-actions.dcfa4863.js";
|
|
5
5
|
import { _ as A } from "./_plugin-vue_export-helper.dad06003.js";
|
|
6
6
|
import "../assets/button-actions-with-menu.css";
|
|
7
7
|
const N = { class: "b-button-actions-with-menu" }, E = {
|
|
@@ -104,4 +104,4 @@ const C = /* @__PURE__ */ A(M, [["__scopeId", "data-v-f58eba13"]]);
|
|
|
104
104
|
export {
|
|
105
105
|
C as B
|
|
106
106
|
};
|
|
107
|
-
//# sourceMappingURL=button-actions-with-menu.
|
|
107
|
+
//# sourceMappingURL=button-actions-with-menu.d6826d2b.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-actions-with-menu.
|
|
1
|
+
{"version":3,"file":"button-actions-with-menu.d6826d2b.js","sources":["../../../vue2/src/components/internal/button-actions-with-menu/button-actions-with-menu.vue"],"sourcesContent":["<template>\n <div class=\"b-button-actions-with-menu\">\n <div role=\"group\" class=\"b-button-actions-with-menu__container-wrapper\">\n <bento-button-actions :actions=\"computedActions\" :inverse=\"inverse\" />\n <bento-menu v-if=\"computedMenuActions.length\" :data=\"computedMenuActions\" :menu-position=\"menuPosition\" />\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, provide, toRef } from 'vue';\n import BentoMenu from '@/components/menu/menu.vue';\n import { BentoMenuItem } from '@/components/menu/components/menu-item/menu-item.types';\n import { BentoButtonActions, BentoButtonActionsList } from '@/components/button';\n import { MENU_INVERSE_INJECTION_KEY } from '@/components/menu/menu.keys';\n import { BentoPopoverPositions } from '@/components/popover';\n\n /**\n * An internal button actions component with the option to display some of the actions in a menu.\n *\n * @example\n * <button-actions-with-menu\n * :actions=\"[\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\n * :displayedActions=\"2\"\n * />\n */\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon` (optional): Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n variant: 'default',\n external: true,\n to: 'https://www.adyen.com/'\n },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: 'primary',\n * critical: true\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n required: true,\n },\n\n /**\n * The number of actions to be displayed. The rest of the actions will be collapsed in a menu component.\n */\n displayedActions: {\n type: Number,\n default: undefined,\n },\n\n /**\n * Set inverse color scheme to buttons and menu\n */\n inverse: {\n type: Boolean,\n default: false,\n },\n\n /**\n * The position of where the menu should open.\n */\n menuPosition: {\n type: String as PropType<BentoPopoverPositions | `${BentoPopoverPositions}`>,\n default: 'bottom-start',\n validator: (value: BentoPopoverPositions) => Object.values(BentoPopoverPositions).includes(value),\n },\n });\n\n const computedActions = computed(() => props.actions.slice(0, props.displayedActions));\n const inverseRef = toRef(props, 'inverse');\n\n provide(MENU_INVERSE_INJECTION_KEY, inverseRef);\n\n const computedMenuActions = computed(() =>\n props.displayedActions !== undefined && props.displayedActions < props.actions.length\n ? (props.actions.slice(props.displayedActions, props.actions.length).map(el => ({\n text: el.title,\n handler: el.event,\n icon: el.icon,\n critical: el.critical,\n disabled: el.disabled,\n })) as BentoMenuItem[])\n : []\n );\n</script>\n\n<script lang=\"ts\">\n /**\n * An internal button actions component with the option to display some of the actions in a menu.\n *\n * @example\n * <button-actions-with-menu\n * :actions=\"[\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: BentoButtonVariant.PRIMARY,\n * critical: true\n * }]\n * :displayedActions=\"2\"\n * />\n */\n\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./button-actions-with-menu.scss\" />\n"],"names":["__default__","computedActions","computed","props","inverseRef","toRef","provide","MENU_INVERSE_INJECTION_KEY","computedMenuActions","el"],"mappings":";;;;;;;;;GAwJIA,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA5CAC,IAAAC,EAAA,MAAAC,EAAA,QAAA,MAAA,GAAAA,EAAA,gBAAA,CAAA,GACAC,IAAAC,EAAAF,GAAA,SAAA;AAEA,IAAAG,EAAAC,GAAAH,CAAA;AAEA,UAAAI,IAAAN;AAAA,MAA4B,MAAAC,EAAA,qBAAA,UAAAA,EAAA,mBAAAA,EAAA,QAAA,SAAAA,EAAA,QAAA,MAAAA,EAAA,kBAAAA,EAAA,QAAA,MAAA,EAAA,IAAA,CAAAM,OAAA;AAAA,QAE4D,MAAAA,EAAA;AAAA,QACjE,SAAAA,EAAA;AAAA,QACG,MAAAA,EAAA;AAAA,QACH,UAAAA,EAAA;AAAA,QACI,UAAAA,EAAA;AAAA,MACA,EAAA,IAAA,CAAA;AAAA,IAEhB;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as C, computed as p, openBlock as n, createElementBlock as l, createElementVNode as S, normalizeClass as A, unref as o, Fragment as h, renderList as L, createBlock as i, mergeProps as m, toHandlers as f, withCtx as s, createTextVNode as g, toDisplayString as y, createSlots as x, resolveDynamicComponent as k } from "vue";
|
|
2
|
-
import { a as I } from "./button.
|
|
3
|
-
import { B as R } from "./loading-button.
|
|
2
|
+
import { a as I } from "./button.09a85d48.js";
|
|
3
|
+
import { B as R } from "./loading-button.b770140c.js";
|
|
4
4
|
import { _ as O } from "./_plugin-vue_export-helper.dad06003.js";
|
|
5
5
|
import "../assets/button-actions.css";
|
|
6
6
|
var B = /* @__PURE__ */ ((t) => (t.BUTTONS_END = "buttons-end", t.FILL_CONTAINER = "fill-container", t.SPACE_BETWEEN = "space-between", t.VERTICAL_STACK = "vertical-stack", t))(B || {}), E = /* @__PURE__ */ ((t) => (t.BUTTONS_START = "buttons-start", t))(E || {});
|
|
@@ -146,4 +146,4 @@ export {
|
|
|
146
146
|
E as b,
|
|
147
147
|
T as c
|
|
148
148
|
};
|
|
149
|
-
//# sourceMappingURL=button-actions.
|
|
149
|
+
//# sourceMappingURL=button-actions.dcfa4863.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-actions.
|
|
1
|
+
{"version":3,"file":"button-actions.dcfa4863.js","sources":["../../../vue2/src/components/button/components/button-actions/button-actions.types.ts","../../../vue2/src/components/button/components/button-actions/button-actions.vue"],"sourcesContent":["import type { VueNodeElement } from '@/types';\nimport type { BentoButtonProps, BentoLoadingButtonState } from '@/components/button';\n\nexport interface BentoButtonActionObject extends BentoButtonProps {\n title: string;\n event?: (event: Event) => void;\n icon?: VueNodeElement;\n iconLeft?: VueNodeElement;\n iconRight?: VueNodeElement;\n state?: BentoLoadingButtonState | `${BentoLoadingButtonState}`;\n}\n\nexport type BentoButtonActionsList = Array<BentoButtonActionObject>;\n\nexport enum BentoButtonActionsLayoutBasic {\n BUTTONS_END = 'buttons-end',\n FILL_CONTAINER = 'fill-container',\n SPACE_BETWEEN = 'space-between',\n VERTICAL_STACK = 'vertical-stack',\n}\nexport enum BentoButtonActionsLayoutExtended {\n BUTTONS_START = 'buttons-start',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport const BentoButtonActionsLayout = { ...BentoButtonActionsLayoutBasic, ...BentoButtonActionsLayoutExtended };\nexport type BentoButtonActionsLayout = BentoButtonActionsLayoutBasic | BentoButtonActionsLayoutExtended;\n","<template>\n <div class=\"b-button-actions\">\n <div class=\"b-button-actions__container-wrapper\" :class=\"conditionalClasses\" role=\"group\">\n <div v-for=\"(button, index) in reversedActionsList\" :key=\"index\" class=\"b-button-actions__button-wrapper\">\n <bento-loading-button\n v-if=\"button.state\"\n :condensed=\"button.condensed\"\n :critical=\"button.critical\"\n :disabled=\"button.disabled\"\n :inverse=\"inverse\"\n :state=\"button.state\"\n :variant=\"button.variant || generateButtonVariantByIndex(index)\"\n v-on=\"generateButtonEvents(button)\"\n >\n {{ button.title }}\n </bento-loading-button>\n <bento-button\n v-else\n :condensed=\"button.condensed\"\n :critical=\"button.critical\"\n :disabled=\"button.disabled\"\n :inverse=\"inverse\"\n :link=\"button.link\"\n :variant=\"button.variant || generateButtonVariantByIndex(index)\"\n v-on=\"generateButtonEvents(button)\"\n >\n <template v-if=\"button.icon || button.iconLeft\" #iconLeft>\n <component :is=\"button.icon || button.iconLeft\" :svg-title=\"button.title\"></component>\n </template>\n {{ button.title }}\n <template v-if=\"button.iconRight\" #iconRight>\n <component :is=\"button.iconRight\" :svg-title=\"button.title\"></component>\n </template>\n </bento-button>\n </div>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType } from 'vue';\n import BentoButton from '../../button.vue';\n import { BentoButtonActionObject, BentoButtonActionsLayout, BentoButtonActionsList } from './button-actions.types';\n import { BentoLoadingButton } from '../loading-button';\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * Each object in the list should have a `title`, an `event` and\n * (optional) a Vue `icon` from the library `@adyen/ui-assets-icons-16`.\n *\n * `title`: Button's text.\n *\n * `event`: Event triggered when clicking the Button.\n *\n * `icon` (optional): Vue Icon from the library `@adyen/ui-assets-icons-16`.\n *\n * @see BentoButton for a list of all the other props supported by each button action.\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon,\n * link: {\n * variant: 'default',\n * external: true,\n * to: 'https://www.adyen.com/'\n * },\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * disabled: true,\n * variant: 'secondary',\n * critical: true\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n required: true,\n },\n\n /**\n * Sets the Button Actions to color scheme inverse\n */\n inverse: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Defines the layout in which the button actions is presented.\n * It can be one of:\n *\n * @values BUTTONS_START\n * @values BUTTONS_END\n * @values FILL_CONTAINER\n * @values SPACE_BETWEEN\n * @values VERTICAL_STACK\n */\n layout: {\n type: String as PropType<BentoButtonActionsLayout | `${BentoButtonActionsLayout}`>,\n default: BentoButtonActionsLayout.BUTTONS_END,\n validator: (layout: BentoButtonActionsLayout) => Object.values(BentoButtonActionsLayout).includes(layout),\n },\n });\n\n const reversedActionsList = computed(() => props.actions.slice().reverse());\n const generateButtonVariantByIndex = actionIndex => {\n const lastActionIndex = props.actions.length - 1;\n return actionIndex === lastActionIndex ? 'primary' : 'secondary';\n };\n\n const conditionalClasses = computed(() => ({\n [`b-button-actions--${props.layout}`]: true,\n }));\n\n const generateButtonEvents = (button: BentoButtonActionObject) =>\n button?.event !== undefined\n ? {\n click: button.event,\n }\n : {};\n</script>\n\n<script lang=\"ts\">\n /**\n * ButtonActions component component manages a set of actions a user can choose from by displaying a group of buttons.\n *\n * @example\n * import { BentoButtonActions } from '@adyen/bento-vue2';\n * import MachineLearningIcon from '@adyen/ui-assets-icons-16/vue/machine-learning';\n *\n * const clickedAction = () => { //your action here }\n *\n * <template>\n * <bento-button-actions\n * :actions=\"[{\n * title: 'Primary',\n * event: clickedAction,\n * icon: MachineLearningIcon,\n * }, {\n * title: 'Secondary',\n * event: clickedAction,\n * }, {\n * title: 'Tertiary',\n * event: clickedAction,\n * }]\"\n * />\n * </template>\n */\n export default {};\n</script>\n\n<style lang=\"scss\" scoped src=\"./button-actions.scss\" />\n"],"names":["BentoButtonActionsLayoutBasic","BentoButtonActionsLayoutBasic2","BentoButtonActionsLayoutExtended","BentoButtonActionsLayoutExtended2","BentoButtonActionsLayout","__default__","reversedActionsList","computed","props","generateButtonVariantByIndex","actionIndex","lastActionIndex","conditionalClasses","generateButtonEvents","button"],"mappings":";;;;;AAcY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,cAAA,eACAA,EAAA,iBAAA,kBACAA,EAAA,gBAAA,iBACAA,EAAA,iBAAA,kBAJQA,IAAAD,KAAA,CAAA,CAAA,GAMAE,IAAA,kBAAAC,OACRA,EAAA,gBAAA,iBADQA,IAAAD,KAAA,CAAA,CAAA;AAOL,MAAAE,IAAA,EAAA,GAAAJ,GAAA,GAAAE,EAAA,sCCgIHG,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA5CAC,IAAAC,EAAA,MAAAC,EAAA,QAAA,MAAA,EAAA,QAAA,CAAA,GACAC,IAAA,CAAAC,MAAA;AACI,YAAAC,IAAAH,EAAA,QAAA,SAAA;AACA,aAAAE,MAAAC,IAAA,YAAA;AAAA,IAAqD,GAGzDC,IAAAL,EAAA,OAAA;AAAA,MAA2C,CAAA,qBAAAC,EAAA,QAAA,GAAA;AAAA,IACA,EAAA,GAG3CK,IAAA,CAAAC,OAAAA,KAAA,gBAAAA,EAAA,WAAA,SAAA;AAAA,MAEU,OAAAA,EAAA;AAAA,IACkB,IAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as R, useAttrs as C, useSlots as I, computed as s, openBlock as i, createBlock as f, resolveDynamicComponent as N, unref as a, mergeProps as h, withCtx as y, createElementBlock as m, renderSlot as c, createCommentVNode as d } from "vue";
|
|
2
|
-
import { B as T } from "./index.
|
|
2
|
+
import { B as T } from "./index.995d6d84.js";
|
|
3
3
|
import { u as $ } from "./use-has-slot.4d98bf29.js";
|
|
4
|
-
import { B as A, a as L } from "./index.
|
|
4
|
+
import { B as A, a as L } from "./index.299ed134.js";
|
|
5
5
|
import { _ as O } from "./_plugin-vue_export-helper.dad06003.js";
|
|
6
6
|
import "../assets/button.css";
|
|
7
7
|
var u = /* @__PURE__ */ ((t) => (t.PRIMARY = "primary", t.SECONDARY = "secondary", t.TERTIARY = "tertiary", t))(u || {}), n = /* @__PURE__ */ ((t) => (t.CONDENSED = "condensed", t.DESTRUCTIVE = "critical", t.DISABLED = "disabled", t.ICON_ONLY = "icon-only", t.INVERSE = "inverse", t))(n || {});
|
|
@@ -115,4 +115,4 @@ export {
|
|
|
115
115
|
H as a,
|
|
116
116
|
n as b
|
|
117
117
|
};
|
|
118
|
-
//# sourceMappingURL=button.
|
|
118
|
+
//# sourceMappingURL=button.09a85d48.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.
|
|
1
|
+
{"version":3,"file":"button.09a85d48.js","sources":["../../../core/src/components/button/button.types.ts","../../../vue2/src/components/button/button.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoButtonVariant {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n TERTIARY = 'tertiary',\n}\n\nexport enum BentoButtonPropClass {\n CONDENSED = 'condensed',\n DESTRUCTIVE = 'critical',\n DISABLED = 'disabled',\n ICON_ONLY = 'icon-only',\n INVERSE = 'inverse',\n}\n\nexport interface BentoButtonProps {\n condensed?: boolean;\n critical?: boolean;\n disabled?: boolean;\n inverse?: boolean;\n variant?: BentoButtonVariant | `${BentoButtonVariant}`;\n type?: string;\n link?: object;\n}\n","<template>\n <component\n :is=\"componentType\"\n v-bind=\"componentProps\"\n class=\"b-button\"\n :class=\"conditionalClasses\"\n @click.capture=\"onClickButton\"\n >\n <span v-if=\"hasSlot('iconLeft')\" class=\"b-button__icon-left\" data-testid=\"icon-button-left\">\n <slot name=\"iconLeft\" />\n </span>\n <bento-typography v-if=\"hasSlot('default')\" el=\"span\" variant=\"body\" stronger class=\"b-button__label\">\n <slot />\n </bento-typography>\n <span v-if=\"hasSlot('iconRight')\" class=\"b-button__icon-right\" data-testid=\"icon-button-right\">\n <slot name=\"iconRight\" />\n </span>\n </component>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, PropType, useAttrs, useSlots } from 'vue';\n import { BentoButtonPropClass, BentoButtonVariant } from '@/core/components/button/button.types';\n import { BentoTypography } from '@/components/typography';\n import { useHasSlot } from '@/composables/use-has-slot/use-has-slot';\n import { Booleanish } from '@/types/prop-types';\n import type { RouterLinkProps } from 'vue-router/types/router';\n import type { AnchorHTMLAttributes, ButtonHTMLAttributes } from 'vue/types/jsx';\n import { BentoLink, BentoLinkVariant } from '@/components/link';\n\n // TODO: replace all this code when migrated to Vue 3 is complete as this is the only\n // current way to extend the `router-link` component in Vue 2 and Vue Router 3\n export interface LinkProps extends RouterLinkProps, AnchorHTMLAttributes {\n // eslint-disable-next-line vue/require-default-prop\n args?: { props: RouterLinkProps };\n\n /**\n * Set the rendered link to a regular external anchor link.\n */\n external: boolean;\n }\n\n const props = defineProps({\n /**\n * Reduces sizing of button\n */\n condensed: { type: Boolean, default: false },\n\n /**\n * Displays button as critical\n */\n critical: { type: Boolean, default: false },\n\n /**\n * Disables button functionality\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Sets color set to inverse\n */\n inverse: { type: Boolean, default: false },\n\n /**\n * Object containing props passed on to the BentoLink component. @see BentoLink documentation for which properties you can pass.\n */\n link: { type: Object, default: undefined },\n\n /**\n * The default behavior of the button.\n * Possible values are: 'button', 'reset', 'submit'\n */\n type: {\n type: String as PropType<ButtonHTMLAttributes['type']>,\n default: 'button',\n },\n\n /**\n * Types of flavour of Button\n * @values primary, secondary, tertiary\n */\n variant: {\n type: String as PropType<BentoButtonVariant | `${BentoButtonVariant}`>,\n default: BentoButtonVariant.PRIMARY,\n validator: (value: BentoButtonVariant) => Object.values(BentoButtonVariant).includes(value),\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emitted when the element has lost focus\n */\n (e: 'blur');\n\n /**\n * Emitted when the button is clicked\n */\n (e: 'click', event: MouseEvent);\n\n /**\n * Emitted when the element has received focus\n */\n (e: 'focus');\n\n /**\n * Emitted when the \"ESC\" key is pressed\n */\n (e: 'keydown.esc');\n }>();\n\n const attrs = useAttrs();\n const slots = useSlots();\n const hasSlot = useHasSlot(slots);\n\n const componentType = computed(() => {\n if (props?.link !== undefined) {\n return BentoLink;\n }\n return 'button';\n });\n const ariaAttributes = computed(() => ({\n 'aria-controls': attrs['aria-controls']?.toString() as string,\n 'aria-expanded': attrs['aria-expanded']?.toString() as Booleanish,\n }));\n\n const componentProps = computed(() =>\n componentType.value === 'button'\n ? {\n ...ariaAttributes.value,\n disabled: props.disabled,\n type: props.type,\n }\n : { ...props.link, disableTypography: true, variant: BentoLinkVariant.DEFAULT, isButton: true }\n );\n\n const variantClass = computed(() => ({\n [`b-button--${props.variant}${props.critical ? `-${BentoButtonPropClass.DESTRUCTIVE}` : ''}`]: true,\n }));\n\n const conditionalClasses = computed(() => ({\n ...variantClass.value,\n [`b-button--${BentoButtonPropClass.CONDENSED}`]: props.condensed,\n [`b-button--${BentoButtonPropClass.DISABLED}`]: props.disabled,\n [`b-button--${BentoButtonPropClass.ICON_ONLY}`]: !slots.default,\n [`b-button--${BentoButtonPropClass.INVERSE}`]: props.inverse,\n }));\n\n const onClickButton = (e: MouseEvent) => {\n if (!props.disabled) {\n emit('click', e);\n } else {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * Button component for all the various types of bento buttons.\n *\n * @example\n * import { BentoButton } from '@adyen/bento-vue2';\n * import { CheckMarkIcon } from '@adyen/ui-assets-icons-16';\n *\n * export default {\n * components: { BentoButton },\n * template: `\n * <bento-button\n * disabled\n * variant=\"secondary\"\n * >\n * <template #iconLeft>\n * <check-mark svg-title=\"checked\" />\n * </template>\n *\n * Button text\n *\n * <template #iconRight>\n * <check-mark svg-title=\"checked\" />\n * </template>\n * </bento-button>\n * `,\n * }\n */\n export default {\n name: 'bento-button',\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"@/core/components/button/button.scss\" />\n"],"names":["BentoButtonVariant","BentoButtonVariant2","BentoButtonPropClass","BentoButtonPropClass2","__default__","attrs","useAttrs","slots","useSlots","hasSlot","useHasSlot","componentType","computed","props","BentoLink","ariaAttributes","_a","_b","componentProps","BentoLinkVariant","variantClass","conditionalClasses","onClickButton","e","emit"],"mappings":";;;;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,UAAA,WACAA,EAAA,YAAA,aACAA,EAAA,WAAA,YAHQA,IAAAD,KAAA,CAAA,CAAA,GAMAE,IAAA,kBAAAC,OACRA,EAAA,YAAA,aACAA,EAAA,cAAA,YACAA,EAAA,WAAA,YACAA,EAAA,YAAA,aACAA,EAAA,UAAA,WALQA,IAAAD,KAAA,CAAA,CAAA;;;;;;;;;GCgLRE,IAAA;AAAA,EAAe,MAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA7EAC,IAAAC,EAAA,GACAC,IAAAC,EAAA,GACAC,IAAAC,EAAAH,CAAA,GAEAI,IAAAC,EAAA,OACIC,KAAA,gBAAAA,EAAA,UAAA,SACIC,IAEJ,QAAO,GAEXC,IAAAH,EAAA,MAAA;;AAAA;AAAA,QAAuC,kBAAAI,IAAAX,EAAA,eAAA,MAAA,gBAAAW,EAAA;AAAA,QACe,kBAAAC,IAAAZ,EAAA,eAAA,MAAA,gBAAAY,EAAA;AAAA,MACA;AAAA,KAAA,GAGtDC,IAAAN;AAAA,MAAuB,MAAAD,EAAA,UAAA,WAAA;AAAA,QAEb,GAAAI,EAAA;AAAA,QACsB,UAAAF,EAAA;AAAA,QACF,MAAAA,EAAA;AAAA,MACJ,IAAA,EAAA,GAAAA,EAAA,MAAA,mBAAA,IAAA,SAAAM,EAAA,SAAA,UAAA,GAAA;AAAA,IAE4E,GAGtGC,IAAAR,EAAA,OAAA;AAAA,MAAqC,CAAA,aAAAC,EAAA,UAAAA,EAAA,WAAA,IAAAX,EAAA,gBAAA,IAAA,GAAA;AAAA,IAC8D,EAAA,GAGnGmB,IAAAT,EAAA,OAAA;AAAA,MAA2C,GAAAQ,EAAA;AAAA,MACvB,CAAA,aAAAlB,EAAA,WAAA,GAAAW,EAAA;AAAA,MACuC,CAAA,aAAAX,EAAA,UAAA,GAAAW,EAAA;AAAA,MACD,CAAA,aAAAX,EAAA,WAAA,GAAA,CAAAK,EAAA;AAAA,MACE,CAAA,aAAAL,EAAA,SAAA,GAAAW,EAAA;AAAA,IACH,EAAA,GAGzDS,IAAA,CAAAC,MAAA;AACI,MAAAV,EAAA,YAGIU,EAAA,eAAA,GACAA,EAAA,gBAAA,KAHAC,EAAA,SAAAD,CAAA;AAAA,IAIJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|