@adyen/adyen-platform-experience-web 0.1.1 → 0.1.2
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/ModalContent-e2777391.js +2 -0
- package/dist/{ModalContent-83a84ba5.js.map → ModalContent-e2777391.js.map} +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/es/components/external/BaseElement.js +1 -1
- package/dist/es/components/external/TransactionDetails/components/TransactionData.js +3 -3
- package/dist/es/components/external/TransactionDetails/components/TransactionDataSkeleton.js +1 -1
- package/dist/es/components/external/Transactions/components/Balances/Balances.js +33 -34
- package/dist/es/components/external/Transactions/components/ModalContent.js +1 -1
- package/dist/es/components/external/Transactions/components/SummaryItem/SummaryItem.js +8 -8
- package/dist/es/components/external/Transactions/components/SummaryItem/constants.js +5 -4
- package/dist/es/components/external/Transactions/components/TransactionList.js +72 -69
- package/dist/es/components/external/Transactions/components/TransactionTotals/TransactionTotals.js +51 -45
- package/dist/es/components/external/Transactions/components/TransactionsOverview.js +77 -74
- package/dist/es/components/external/Transactions/hooks/useMaxWidths.js +9 -9
- package/dist/es/components/external/UIElement.js +4 -4
- package/dist/es/components/internal/Button/Button.js +12 -12
- package/dist/es/components/internal/Calendar/components/CalendarControls/CalendarControls.js +4 -4
- package/dist/es/components/internal/DataGrid/DataGrid.js +7 -7
- package/dist/es/components/internal/DataGrid/components/InteractiveBody.js +1 -1
- package/dist/es/components/internal/DataGrid/components/SkeletonBody.js +1 -1
- package/dist/es/components/internal/DataGrid/components/TableBody.js +3 -3
- package/dist/es/components/internal/DataGrid/components/TableCells.js +1 -1
- package/dist/es/components/internal/ErrorMessageDisplay/ErrorMessageDisplay.js +3 -3
- package/dist/es/components/internal/ExpandableCard/ExpandableCard.js +7 -7
- package/dist/es/components/internal/FilterBar/filters/BaseFilter/BaseFilter.js +4 -4
- package/dist/es/components/internal/FormFields/InputBase.js +17 -17
- package/dist/es/components/internal/FormFields/Select/components/SelectButton.js +1 -1
- package/dist/es/components/internal/FormFields/Select/components/SelectListItem.js +1 -1
- package/dist/es/components/internal/Modal/Modal.js +12 -11
- package/dist/es/components/internal/Popover/Popover.js +4 -4
- package/dist/es/components/internal/Popover/PopoverDismissButton/PopoverDismissButton.js +1 -1
- package/dist/es/core/Auth/AuthContext.js +1 -1
- package/dist/es/core/Auth/AuthProvider.js +4 -4
- package/dist/es/core/Context/CoreContext.js +1 -1
- package/dist/es/core/Context/CoreProvider.js +1 -1
- package/dist/es/core/Localization/Localization.js +57 -56
- package/dist/es/core/Localization/amount/amount-util.js +14 -14
- package/dist/es/core/core.js +3 -3
- package/dist/es/external/preact/compat/dist/compat.module.js +54 -55
- package/dist/es/external/preact/dist/preact.module.js +309 -0
- package/dist/es/external/preact/hooks/dist/hooks.module.js +3 -3
- package/dist/es/external/preact/jsx-runtime/dist/jsxRuntime.module.js +4 -4
- package/dist/es/hooks/useModalDetails/useModalDetails.js +24 -18
- package/dist/es/index.js +13 -13
- package/dist/index-0c9f4def.js +12 -0
- package/dist/index-0c9f4def.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/types/components/external/TransactionDetails/index.d.ts +1 -1
- package/dist/types/components/external/TransactionDetails/index.d.ts.map +1 -1
- package/dist/types/components/external/Transactions/components/Balances/Balances.d.ts +2 -2
- package/dist/types/components/external/Transactions/components/Balances/Balances.d.ts.map +1 -1
- package/dist/types/components/external/Transactions/components/SummaryItem/SummaryItem.d.ts.map +1 -1
- package/dist/types/components/external/Transactions/components/SummaryItem/constants.d.ts +1 -0
- package/dist/types/components/external/Transactions/components/SummaryItem/constants.d.ts.map +1 -1
- package/dist/types/components/external/Transactions/components/TransactionList.d.ts.map +1 -1
- package/dist/types/components/external/Transactions/components/TransactionTotals/TransactionTotals.d.ts +2 -1
- package/dist/types/components/external/Transactions/components/TransactionTotals/TransactionTotals.d.ts.map +1 -1
- package/dist/types/components/external/Transactions/components/TransactionsOverview.d.ts.map +1 -1
- package/dist/types/components/external/Transactions/hooks/useMaxWidths.d.ts.map +1 -1
- package/dist/types/components/external/Transactions/types.d.ts +2 -2
- package/dist/types/components/external/Transactions/types.d.ts.map +1 -1
- package/dist/types/components/internal/Modal/Modal.d.ts.map +1 -1
- package/dist/types/core/Localization/Localization.d.ts.map +1 -1
- package/dist/types/core/Localization/amount/amount-util.d.ts +1 -5
- package/dist/types/core/Localization/amount/amount-util.d.ts.map +1 -1
- package/dist/types/hooks/useModalDetails/types.d.ts +1 -1
- package/dist/types/hooks/useModalDetails/types.d.ts.map +1 -1
- package/package.json +4 -2
- package/dist/ModalContent-83a84ba5.js +0 -2
- package/dist/index-ff45d757.js +0 -12
- package/dist/index-ff45d757.js.map +0 -1
|
@@ -2,27 +2,28 @@ import { jsx as e } from "../../../external/preact/jsx-runtime/dist/jsxRuntime.m
|
|
|
2
2
|
import s from "../Button/Button.js";
|
|
3
3
|
import { ButtonVariant as _ } from "../Button/types.js";
|
|
4
4
|
import g from "../../../core/Context/useCoreContext.js";
|
|
5
|
-
import { useRef as L, useCallback as c, useEffect as
|
|
5
|
+
import { useRef as L, useCallback as c, useEffect as k } from "../../../external/preact/hooks/dist/hooks.module.js";
|
|
6
6
|
import m from "classnames";
|
|
7
7
|
import "./Modal.scss.js";
|
|
8
|
-
|
|
8
|
+
import { Fragment as C } from "../../../external/preact/dist/preact.module.js";
|
|
9
|
+
function x(d) {
|
|
9
10
|
return !(!d || !("nodeType" in d));
|
|
10
11
|
}
|
|
11
|
-
function
|
|
12
|
+
function A({
|
|
12
13
|
title: d,
|
|
13
14
|
children: i,
|
|
14
15
|
classNameModifiers: u = [],
|
|
15
16
|
isOpen: a,
|
|
16
17
|
onClose: l,
|
|
17
18
|
isDismissible: r = !0,
|
|
18
|
-
headerWithBorder:
|
|
19
|
+
headerWithBorder: h = !0,
|
|
19
20
|
size: o = "fluid",
|
|
20
|
-
...
|
|
21
|
+
...y
|
|
21
22
|
}) {
|
|
22
23
|
const t = L(null), { i18n: w } = g(), v = c(
|
|
23
24
|
(n) => {
|
|
24
25
|
var p;
|
|
25
|
-
r && a &&
|
|
26
|
+
r && a && x(n.target) && !((p = t == null ? void 0 : t.current) != null && p.contains(n.target)) && l();
|
|
26
27
|
},
|
|
27
28
|
[r, a, l]
|
|
28
29
|
), f = c(
|
|
@@ -31,7 +32,7 @@ function M({
|
|
|
31
32
|
},
|
|
32
33
|
[a, r, l]
|
|
33
34
|
);
|
|
34
|
-
return
|
|
35
|
+
return k(() => (a ? window.addEventListener("keydown", f) : window.removeEventListener("keydown", f), () => window.removeEventListener("keydown", f)), [a, f]), /* @__PURE__ */ e(C, { children: a && /* @__PURE__ */ e(
|
|
35
36
|
"div",
|
|
36
37
|
{
|
|
37
38
|
className: m(
|
|
@@ -43,7 +44,7 @@ function M({
|
|
|
43
44
|
"aria-modal": "true",
|
|
44
45
|
"aria-hidden": !open,
|
|
45
46
|
onClick: v,
|
|
46
|
-
...
|
|
47
|
+
...y,
|
|
47
48
|
children: /* @__PURE__ */ e(
|
|
48
49
|
"div",
|
|
49
50
|
{
|
|
@@ -61,7 +62,7 @@ function M({
|
|
|
61
62
|
{
|
|
62
63
|
className: m("adyen-fp-modal__header", {
|
|
63
64
|
"adyen-fp-modal__header--with-title": d,
|
|
64
|
-
"adyen-fp-modal__header--with-border-bottom":
|
|
65
|
+
"adyen-fp-modal__header--with-border-bottom": h
|
|
65
66
|
}),
|
|
66
67
|
children: [
|
|
67
68
|
d && /* @__PURE__ */ e("div", { className: "adyen-fp-modal__header__title", children: d }),
|
|
@@ -91,8 +92,8 @@ function M({
|
|
|
91
92
|
}
|
|
92
93
|
)
|
|
93
94
|
}
|
|
94
|
-
);
|
|
95
|
+
) });
|
|
95
96
|
}
|
|
96
97
|
export {
|
|
97
|
-
|
|
98
|
+
A as default
|
|
98
99
|
};
|
|
@@ -17,7 +17,7 @@ import { useMemo as $, useRef as O, useCallback as P, useEffect as ro } from "..
|
|
|
17
17
|
import "./Popover.scss.js";
|
|
18
18
|
import "./PopoverContainer.scss.js";
|
|
19
19
|
import eo from "../../../hooks/useReflex/hooks/useReflex.js";
|
|
20
|
-
import { Fragment as no } from "preact";
|
|
20
|
+
import { Fragment as no } from "../../../external/preact/dist/preact.module.js";
|
|
21
21
|
const to = (u) => {
|
|
22
22
|
var m;
|
|
23
23
|
let s;
|
|
@@ -61,7 +61,7 @@ function Lo({
|
|
|
61
61
|
), A = O(E), F = O(), L = Q(
|
|
62
62
|
Y([0, 15], r, m, j.BOTTOM),
|
|
63
63
|
o
|
|
64
|
-
),
|
|
64
|
+
), k = X(s ? null : L, w), V = eo(
|
|
65
65
|
P((t) => {
|
|
66
66
|
t instanceof Element && (cancelAnimationFrame(F.current), F.current = requestAnimationFrame(() => {
|
|
67
67
|
if (y.current === a || !(y.current = a))
|
|
@@ -70,7 +70,7 @@ function Lo({
|
|
|
70
70
|
c == null || c.focus();
|
|
71
71
|
}));
|
|
72
72
|
}, []),
|
|
73
|
-
s ? L :
|
|
73
|
+
s ? L : k
|
|
74
74
|
), B = $(
|
|
75
75
|
() => ({
|
|
76
76
|
[`${i}--medium`]: l === M.MEDIUM,
|
|
@@ -85,7 +85,7 @@ function Lo({
|
|
|
85
85
|
"div",
|
|
86
86
|
{
|
|
87
87
|
id: "popover",
|
|
88
|
-
ref:
|
|
88
|
+
ref: V,
|
|
89
89
|
...S,
|
|
90
90
|
className: oo(`${i} ${K}`, B),
|
|
91
91
|
style: { display: "none" },
|
|
@@ -4,7 +4,7 @@ import { ButtonVariant as r } from "../../Button/types.js";
|
|
|
4
4
|
import "./PopoverDismissButton.scss.js";
|
|
5
5
|
import s from "../../../../core/Context/useCoreContext.js";
|
|
6
6
|
import { memo as l } from "../../../../external/preact/compat/dist/compat.module.js";
|
|
7
|
-
import { Fragment as m } from "preact";
|
|
7
|
+
import { Fragment as m } from "../../../../external/preact/dist/preact.module.js";
|
|
8
8
|
function a({ image: t = !0, onClick: e }) {
|
|
9
9
|
const { i18n: i } = s();
|
|
10
10
|
return /* @__PURE__ */ o(m, { children: /* @__PURE__ */ o(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { AuthContext as
|
|
3
|
-
import { toChildArray as
|
|
4
|
-
const
|
|
1
|
+
import { jsx as a } from "../../external/preact/jsx-runtime/dist/jsxRuntime.module.js";
|
|
2
|
+
import { AuthContext as d } from "./AuthContext.js";
|
|
3
|
+
import { toChildArray as m } from "../../external/preact/dist/preact.module.js";
|
|
4
|
+
const s = ({ token: r, endpoints: o, children: t, updateCore: e, sessionSetupError: i }) => /* @__PURE__ */ a(d.Provider, { value: { token: r, endpoints: o, updateCore: e, sessionSetupError: i }, children: m(t) }), f = s;
|
|
5
5
|
export {
|
|
6
6
|
f as default
|
|
7
7
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as i } from "../../external/preact/jsx-runtime/dist/jsxRuntime.module.js";
|
|
2
|
-
import { toChildArray as f } from "preact";
|
|
2
|
+
import { toChildArray as f } from "../../external/preact/dist/preact.module.js";
|
|
3
3
|
import { useMemo as t, useEffect as d } from "../../external/preact/hooks/dist/hooks.module.js";
|
|
4
4
|
import { CoreContext as l } from "./CoreContext.js";
|
|
5
5
|
import p from "../../hooks/useBooleanState/useBooleanState.js";
|
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var b = Object.defineProperty;
|
|
2
|
+
var S = (r, t, e) => t in r ? b(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
|
|
3
|
+
var w = (r, t, e) => (S(r, typeof t != "symbol" ? t + "" : t, e), e), z = (r, t, e) => {
|
|
4
4
|
if (!t.has(r))
|
|
5
5
|
throw TypeError("Cannot " + e);
|
|
6
6
|
};
|
|
7
|
-
var s = (r, t, e) => (
|
|
7
|
+
var s = (r, t, e) => (z(r, t, "read from private field"), e ? e.call(r) : t.get(r)), a = (r, t, e) => {
|
|
8
8
|
if (t.has(r))
|
|
9
9
|
throw TypeError("Cannot add the same private member more than once");
|
|
10
10
|
t instanceof WeakSet ? t.add(r) : t.set(r, e);
|
|
11
|
-
}, n = (r, t, e, o) => (
|
|
12
|
-
var
|
|
11
|
+
}, n = (r, t, e, o) => (z(r, t, "write to private field"), o ? o.call(r, e) : t.set(r, e), e);
|
|
12
|
+
var O = (r, t, e) => (z(r, t, "access private method"), e);
|
|
13
13
|
import { getLocalisedAmount as $ } from "./amount/amount-util.js";
|
|
14
|
-
import { FALLBACK_LOCALE as
|
|
15
|
-
import { DEFAULT_LOCALES as
|
|
14
|
+
import { FALLBACK_LOCALE as C, defaultTranslation as F } from "./constants/locale.js";
|
|
15
|
+
import { DEFAULT_LOCALES as v, DEFAULT_DATETIME_FORMAT as U } from "./constants/localization.js";
|
|
16
16
|
import { createTranslationsLoader as x, getLocalizationProxyDescriptors as P } from "./localization-utils.js";
|
|
17
|
-
import { toTwoLetterCode as
|
|
18
|
-
import { struct as
|
|
19
|
-
import
|
|
20
|
-
import { en_US as
|
|
21
|
-
import
|
|
17
|
+
import { toTwoLetterCode as R, formatCustomTranslations as M, getTranslation as j } from "./utils.js";
|
|
18
|
+
import { struct as k, noop as B } from "../../utils/common/index.js";
|
|
19
|
+
import I from "../../utils/watchable/index.js";
|
|
20
|
+
import { en_US as K } from "./translations/index.js";
|
|
21
|
+
import W from "./datetime/restamper/restamper.js";
|
|
22
22
|
import { systemToTimezone as Z } from "./datetime/restamper/utils.js";
|
|
23
|
-
var
|
|
24
|
-
class
|
|
25
|
-
constructor(t =
|
|
26
|
-
a(this,
|
|
27
|
-
a(this,
|
|
28
|
-
a(this,
|
|
29
|
-
a(this,
|
|
23
|
+
var l, g, T, f, y, h, D, c, m, d, p, A, E;
|
|
24
|
+
class st {
|
|
25
|
+
constructor(t = C, e) {
|
|
26
|
+
a(this, A);
|
|
27
|
+
a(this, l, C);
|
|
28
|
+
a(this, g, R(s(this, l)));
|
|
29
|
+
a(this, T, v);
|
|
30
30
|
a(this, f, void 0);
|
|
31
|
-
a(this,
|
|
32
|
-
a(this,
|
|
33
|
-
a(this,
|
|
31
|
+
a(this, y, F);
|
|
32
|
+
a(this, h, x.call(this));
|
|
33
|
+
a(this, D, Promise.resolve());
|
|
34
34
|
a(this, c, void 0);
|
|
35
35
|
a(this, m, void 0);
|
|
36
|
-
a(this, d,
|
|
37
|
-
a(this,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
this.watch(
|
|
42
|
-
[
|
|
36
|
+
a(this, d, I({ timestamp: () => performance.now() }));
|
|
37
|
+
a(this, p, W());
|
|
38
|
+
w(this, "watch", s(this, d).watch.bind(void 0));
|
|
39
|
+
w(this, "i18n", k(P.call(this)));
|
|
40
|
+
w(this, "preferredTranslations");
|
|
41
|
+
this.watch(B), this.preferredTranslations = e && e.reduce((o, i) => ({ ...o, ...i }), {
|
|
42
|
+
[C]: K.en_US
|
|
43
43
|
}), this.locale = t;
|
|
44
44
|
}
|
|
45
45
|
get customTranslations() {
|
|
46
46
|
return s(this, f) ?? {};
|
|
47
47
|
}
|
|
48
48
|
set customTranslations(t) {
|
|
49
|
-
let e, o = [...
|
|
49
|
+
let e, o = [...v];
|
|
50
50
|
if (t != null) {
|
|
51
|
-
e =
|
|
51
|
+
e = M(t, v);
|
|
52
52
|
const i = Object.keys(e);
|
|
53
|
-
o = [...
|
|
54
|
-
(
|
|
53
|
+
o = [...v, ...i].filter(
|
|
54
|
+
(L, u, _) => _.indexOf(L) === u
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
|
-
s(this,
|
|
57
|
+
s(this, h).supportedLocales = o, O(this, A, E).call(this, e);
|
|
58
58
|
}
|
|
59
59
|
get languageCode() {
|
|
60
|
-
return s(this,
|
|
60
|
+
return s(this, g);
|
|
61
61
|
}
|
|
62
62
|
get lastRefreshTimestamp() {
|
|
63
63
|
return s(this, d).snapshot.timestamp;
|
|
64
64
|
}
|
|
65
65
|
get locale() {
|
|
66
|
-
return s(this,
|
|
66
|
+
return s(this, l);
|
|
67
67
|
}
|
|
68
68
|
set locale(t) {
|
|
69
69
|
if (t != null) {
|
|
70
|
-
if (s(this,
|
|
70
|
+
if (s(this, h).locale = t, s(this, l) === s(this, h).locale)
|
|
71
71
|
return;
|
|
72
|
-
|
|
72
|
+
O(this, A, E).call(this, s(this, f));
|
|
73
73
|
} else
|
|
74
|
-
this.locale =
|
|
74
|
+
this.locale = C;
|
|
75
75
|
}
|
|
76
76
|
get ready() {
|
|
77
|
-
return s(this,
|
|
77
|
+
return s(this, D);
|
|
78
78
|
}
|
|
79
79
|
get supportedLocales() {
|
|
80
|
-
return s(this,
|
|
80
|
+
return s(this, T);
|
|
81
81
|
}
|
|
82
82
|
get timezone() {
|
|
83
|
-
return s(this,
|
|
83
|
+
return s(this, p).tz.current;
|
|
84
84
|
}
|
|
85
85
|
set timezone(t) {
|
|
86
|
-
s(this,
|
|
86
|
+
s(this, p).tz = t;
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
89
89
|
* Returns a translated string from a key in the current {@link Localization.locale}
|
|
@@ -92,7 +92,7 @@ class rt {
|
|
|
92
92
|
* @returns Translated string
|
|
93
93
|
*/
|
|
94
94
|
get(t, e) {
|
|
95
|
-
const o =
|
|
95
|
+
const o = j(s(this, y), t, e);
|
|
96
96
|
return o !== null ? o : t;
|
|
97
97
|
}
|
|
98
98
|
/**
|
|
@@ -102,11 +102,12 @@ class rt {
|
|
|
102
102
|
* @param options - Options for String.prototype.toLocaleString
|
|
103
103
|
*/
|
|
104
104
|
amount(t, e, o) {
|
|
105
|
-
const {
|
|
105
|
+
const { hideCurrency: i, ...L } = o || {}, u = $(t, s(this, l), e, i, {
|
|
106
106
|
...L,
|
|
107
|
-
currencyDisplay: "symbol"
|
|
107
|
+
currencyDisplay: "symbol",
|
|
108
|
+
signDisplay: "never"
|
|
108
109
|
});
|
|
109
|
-
return
|
|
110
|
+
return t < 0 ? `- ${u}` : u;
|
|
110
111
|
}
|
|
111
112
|
/**
|
|
112
113
|
* Returns a localized string for a date
|
|
@@ -114,20 +115,20 @@ class rt {
|
|
|
114
115
|
* @param options - Options for {@link Date.toLocaleDateString}
|
|
115
116
|
*/
|
|
116
117
|
date(t, e = {}) {
|
|
117
|
-
const o = { ...U, timeZone: s(this,
|
|
118
|
-
return new Date(t).toLocaleDateString(s(this,
|
|
118
|
+
const o = { ...U, timeZone: s(this, p).tz.current, ...e };
|
|
119
|
+
return new Date(t).toLocaleDateString(s(this, l), o);
|
|
119
120
|
}
|
|
120
121
|
/**
|
|
121
122
|
* Returns a localized string for a full date
|
|
122
123
|
* @param date - Date to be localized
|
|
123
124
|
*/
|
|
124
125
|
fullDate(t) {
|
|
125
|
-
const e = Z(s(this,
|
|
126
|
-
return `${o} ${i}, ${
|
|
126
|
+
const e = Z(s(this, p), t), [, o, i, L, u] = new Date(e).toString().split(/\s+/g);
|
|
127
|
+
return `${o} ${i}, ${L}, ${u}`;
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
|
-
|
|
130
|
-
s(this, m) === void 0 && n(this,
|
|
130
|
+
l = new WeakMap(), g = new WeakMap(), T = new WeakMap(), f = new WeakMap(), y = new WeakMap(), h = new WeakMap(), D = new WeakMap(), c = new WeakMap(), m = new WeakMap(), d = new WeakMap(), p = new WeakMap(), A = new WeakSet(), E = function(t) {
|
|
131
|
+
s(this, m) === void 0 && n(this, D, new Promise((i) => {
|
|
131
132
|
n(this, m, () => {
|
|
132
133
|
i(s(this, c)), n(this, c, n(this, m, void 0));
|
|
133
134
|
});
|
|
@@ -136,12 +137,12 @@ h = new WeakMap(), T = new WeakMap(), y = new WeakMap(), f = new WeakMap(), w =
|
|
|
136
137
|
var i;
|
|
137
138
|
s(this, c) === o && ((i = s(this, m)) == null || i.call(this));
|
|
138
139
|
}, o = n(this, c, (async () => {
|
|
139
|
-
n(this,
|
|
140
|
+
n(this, y, await s(this, h).load(t)), n(this, l, s(this, h).locale), n(this, T, s(this, h).supportedLocales), n(this, f, t), n(this, g, R(s(this, l))), s(this, d).notify();
|
|
140
141
|
})());
|
|
141
142
|
o.then(e).catch((i) => {
|
|
142
143
|
e(), console.error(i);
|
|
143
144
|
});
|
|
144
145
|
};
|
|
145
146
|
export {
|
|
146
|
-
|
|
147
|
+
st as default
|
|
147
148
|
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import
|
|
1
|
+
import u from "../constants/currency-codes.js";
|
|
2
2
|
import a from "../constants/currency-decimals.js";
|
|
3
|
-
const
|
|
4
|
-
const r =
|
|
3
|
+
const l = (t) => a[t] || 100, y = (t) => !!u[t], A = (t) => y(t) ? u[t] : null, C = (t, e) => {
|
|
4
|
+
const r = l(e);
|
|
5
5
|
return parseInt(String(t), 10) / r;
|
|
6
|
-
},
|
|
7
|
-
const c = t.toString(), s =
|
|
6
|
+
}, D = (t, e, r, o = !1, n = {}) => {
|
|
7
|
+
const c = t.toString(), s = C(c, r), i = e.replace("_", "-"), m = {
|
|
8
8
|
style: "currency",
|
|
9
9
|
currency: r,
|
|
10
10
|
currencyDisplay: "symbol",
|
|
11
|
-
...
|
|
11
|
+
...n
|
|
12
12
|
};
|
|
13
13
|
try {
|
|
14
|
-
return
|
|
14
|
+
return o ? f(i, m, s) : s.toLocaleString(i, m);
|
|
15
15
|
} catch {
|
|
16
16
|
return c;
|
|
17
17
|
}
|
|
18
|
-
},
|
|
18
|
+
}, f = (t, e, r) => Intl.NumberFormat(t, e).formatToParts(r).filter((o) => o.type !== "currency").reduce((o, n) => o + n.value, "").trim();
|
|
19
19
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
f as formatAmountWithoutCurrency,
|
|
21
|
+
A as getCurrencyCode,
|
|
22
|
+
C as getDecimalAmount,
|
|
23
|
+
l as getDivider,
|
|
24
|
+
D as getLocalisedAmount,
|
|
25
|
+
y as isValidCurrencyCode
|
|
26
26
|
};
|
package/dist/es/core/core.js
CHANGED
|
@@ -82,10 +82,10 @@ class a {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
s(a, "version", {
|
|
85
|
-
version: "0.1.
|
|
86
|
-
revision: "
|
|
85
|
+
version: "0.1.2",
|
|
86
|
+
revision: "dd1e06a",
|
|
87
87
|
branch: "main",
|
|
88
|
-
buildId: "@adyen/adyen-fp-web-
|
|
88
|
+
buildId: "@adyen/adyen-fp-web-0a8cca55-50c0-42f1-8c0c-a713f57c131e"
|
|
89
89
|
});
|
|
90
90
|
const E = a;
|
|
91
91
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Component as s, options as
|
|
2
|
-
import {
|
|
3
|
-
import { useCallback as
|
|
4
|
-
function
|
|
1
|
+
import { Component as s, options as a, createElement as c, Fragment as y, toChildArray as v, render as b } from "../../dist/preact.module.js";
|
|
2
|
+
import { createContext as J } from "../../dist/preact.module.js";
|
|
3
|
+
import { useCallback as te, useContext as re, useEffect as ne, useImperativeHandle as oe, useLayoutEffect as ie, useMemo as ue, useReducer as ae, useRef as le, useState as _e } from "../../hooks/dist/hooks.module.js";
|
|
4
|
+
function R(e, t) {
|
|
5
5
|
for (var r in t)
|
|
6
6
|
e[r] = t[r];
|
|
7
7
|
return e;
|
|
@@ -31,32 +31,32 @@ function q(e, t) {
|
|
|
31
31
|
(C.prototype = new s()).isPureReactComponent = !0, C.prototype.shouldComponentUpdate = function(e, t) {
|
|
32
32
|
return h(this.props, e) || h(this.state, t);
|
|
33
33
|
};
|
|
34
|
-
var g =
|
|
35
|
-
|
|
34
|
+
var g = a.__b;
|
|
35
|
+
a.__b = function(e) {
|
|
36
36
|
e.type && e.type.__f && e.ref && (e.props.ref = e.ref, e.ref = null), g && g(e);
|
|
37
37
|
};
|
|
38
|
-
var
|
|
38
|
+
var $ = typeof Symbol < "u" && Symbol.for && Symbol.for("react.forward_ref") || 3911;
|
|
39
39
|
function K(e) {
|
|
40
40
|
function t(r) {
|
|
41
|
-
var n =
|
|
41
|
+
var n = R({}, r);
|
|
42
42
|
return delete n.ref, e(n, r.ref || null);
|
|
43
43
|
}
|
|
44
|
-
return t.$$typeof =
|
|
44
|
+
return t.$$typeof = $, t.render = t, t.prototype.isReactComponent = t.__f = !0, t.displayName = "ForwardRef(" + (e.displayName || e.name) + ")", t;
|
|
45
45
|
}
|
|
46
|
-
var
|
|
47
|
-
|
|
46
|
+
var W = a.__e;
|
|
47
|
+
a.__e = function(e, t, r, n) {
|
|
48
48
|
if (e.then) {
|
|
49
49
|
for (var o, i = t; i = i.__; )
|
|
50
50
|
if ((o = i.__c) && o.__c)
|
|
51
51
|
return t.__e == null && (t.__e = r.__e, t.__k = r.__k), o.__c(e, t);
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
W(e, t, r, n);
|
|
54
54
|
};
|
|
55
|
-
var k =
|
|
55
|
+
var k = a.unmount;
|
|
56
56
|
function O(e, t, r) {
|
|
57
57
|
return e && (e.__c && e.__c.__H && (e.__c.__H.__.forEach(function(n) {
|
|
58
58
|
typeof n.__c == "function" && n.__c();
|
|
59
|
-
}), e.__c.__H = null), (e =
|
|
59
|
+
}), e.__c.__H = null), (e = R({}, e)).__c != null && (e.__c.__P === r && (e.__c.__P = t), e.__c = null), e.__k = e.__k && e.__k.map(function(n) {
|
|
60
60
|
return O(n, t, r);
|
|
61
61
|
})), e;
|
|
62
62
|
}
|
|
@@ -90,17 +90,17 @@ function Q(e) {
|
|
|
90
90
|
function f() {
|
|
91
91
|
this.u = null, this.o = null;
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
a.unmount = function(e) {
|
|
94
94
|
var t = e.__c;
|
|
95
95
|
t && t.__R && t.__R(), t && e.__h === !0 && (e.type = null), k && k(e);
|
|
96
96
|
}, (d.prototype = new s()).__c = function(e, t) {
|
|
97
97
|
var r = t.__c, n = this;
|
|
98
98
|
n.t == null && (n.t = []), n.t.push(r);
|
|
99
99
|
var o = U(n.__v), i = !1, u = function() {
|
|
100
|
-
i || (i = !0, r.__R = null, o ? o(
|
|
100
|
+
i || (i = !0, r.__R = null, o ? o(l) : l());
|
|
101
101
|
};
|
|
102
102
|
r.__R = u;
|
|
103
|
-
var
|
|
103
|
+
var l = function() {
|
|
104
104
|
if (!--n.__u) {
|
|
105
105
|
if (n.state.__a) {
|
|
106
106
|
var p = n.state.__a;
|
|
@@ -110,8 +110,8 @@ _.unmount = function(e) {
|
|
|
110
110
|
for (n.setState({ __a: n.__b = null }); m = n.t.pop(); )
|
|
111
111
|
m.forceUpdate();
|
|
112
112
|
}
|
|
113
|
-
},
|
|
114
|
-
n.__u++ ||
|
|
113
|
+
}, _ = t.__h === !0;
|
|
114
|
+
n.__u++ || _ || n.setState({ __a: n.__b = n.__v.__k[0] }), e.then(u, u);
|
|
115
115
|
}, d.prototype.componentWillUnmount = function() {
|
|
116
116
|
this.t = [];
|
|
117
117
|
}, d.prototype.render = function(e, t) {
|
|
@@ -135,12 +135,12 @@ var N = function(e, t, r) {
|
|
|
135
135
|
e.u = r = r[2];
|
|
136
136
|
}
|
|
137
137
|
};
|
|
138
|
-
function
|
|
138
|
+
function A(e) {
|
|
139
139
|
return this.getChildContext = function() {
|
|
140
140
|
return e.context;
|
|
141
141
|
}, e.children;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function L(e) {
|
|
144
144
|
var t = this, r = e.i;
|
|
145
145
|
t.componentWillUnmount = function() {
|
|
146
146
|
b(null, t.l), t.l = null, t.i = null;
|
|
@@ -150,10 +150,10 @@ function H(e) {
|
|
|
150
150
|
this.childNodes.push(n), t.i.appendChild(n);
|
|
151
151
|
}, removeChild: function(n) {
|
|
152
152
|
this.childNodes.splice(this.childNodes.indexOf(n) >>> 1, 1), t.i.removeChild(n);
|
|
153
|
-
} }), b(c(
|
|
153
|
+
} }), b(c(A, { context: t.context }, e.__v), t.l);
|
|
154
154
|
}
|
|
155
155
|
function X(e, t) {
|
|
156
|
-
var r = c(
|
|
156
|
+
var r = c(L, { __v: e, i: t });
|
|
157
157
|
return r.containerInfo = t, r;
|
|
158
158
|
}
|
|
159
159
|
(f.prototype = new s()).__a = function(e) {
|
|
@@ -177,7 +177,7 @@ function X(e, t) {
|
|
|
177
177
|
N(e, r, t);
|
|
178
178
|
});
|
|
179
179
|
};
|
|
180
|
-
var
|
|
180
|
+
var B = typeof Symbol < "u" && Symbol.for && Symbol.for("react.element") || 60103, H = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, M = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, V = /[A-Z0-9]/g, z = typeof document < "u", F = function(e) {
|
|
181
181
|
return (typeof Symbol < "u" && typeof Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(e);
|
|
182
182
|
};
|
|
183
183
|
s.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(e) {
|
|
@@ -187,7 +187,7 @@ s.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveP
|
|
|
187
187
|
Object.defineProperty(this, e, { configurable: !0, writable: !0, value: t });
|
|
188
188
|
} });
|
|
189
189
|
});
|
|
190
|
-
var x =
|
|
190
|
+
var x = a.event;
|
|
191
191
|
function j() {
|
|
192
192
|
}
|
|
193
193
|
function D() {
|
|
@@ -196,59 +196,58 @@ function D() {
|
|
|
196
196
|
function I() {
|
|
197
197
|
return this.defaultPrevented;
|
|
198
198
|
}
|
|
199
|
-
|
|
199
|
+
a.event = function(e) {
|
|
200
200
|
return x && (e = x(e)), e.persist = j, e.isPropagationStopped = D, e.isDefaultPrevented = I, e.nativeEvent = e;
|
|
201
201
|
};
|
|
202
202
|
var T = { enumerable: !1, configurable: !0, get: function() {
|
|
203
203
|
return this.class;
|
|
204
|
-
} }, P =
|
|
205
|
-
|
|
204
|
+
} }, P = a.vnode;
|
|
205
|
+
a.vnode = function(e) {
|
|
206
206
|
typeof e.type == "string" && function(t) {
|
|
207
207
|
var r = t.props, n = t.type, o = {};
|
|
208
208
|
for (var i in r) {
|
|
209
209
|
var u = r[i];
|
|
210
|
-
if (!(i === "value" && "defaultValue" in r && u == null ||
|
|
211
|
-
var
|
|
212
|
-
i === "defaultValue" && "value" in r && r.value == null ? i = "value" : i === "download" && u === !0 ? u = "" :
|
|
210
|
+
if (!(i === "value" && "defaultValue" in r && u == null || z && i === "children" && n === "noscript" || i === "class" || i === "className")) {
|
|
211
|
+
var l = i.toLowerCase();
|
|
212
|
+
i === "defaultValue" && "value" in r && r.value == null ? i = "value" : i === "download" && u === !0 ? u = "" : l === "ondoubleclick" ? i = "ondblclick" : l !== "onchange" || n !== "input" && n !== "textarea" || F(r.type) ? l === "onfocus" ? i = "onfocusin" : l === "onblur" ? i = "onfocusout" : M.test(i) ? i = l : n.indexOf("-") === -1 && H.test(i) ? i = i.replace(V, "-$&").toLowerCase() : u === null && (u = void 0) : l = i = "oninput", l === "oninput" && o[i = l] && (i = "oninputCapture"), o[i] = u;
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
n == "select" && o.multiple && Array.isArray(o.value) && (o.value = v(r.children).forEach(function(
|
|
216
|
-
|
|
217
|
-
})), n == "select" && o.defaultValue != null && (o.value = v(r.children).forEach(function(
|
|
218
|
-
|
|
215
|
+
n == "select" && o.multiple && Array.isArray(o.value) && (o.value = v(r.children).forEach(function(_) {
|
|
216
|
+
_.props.selected = o.value.indexOf(_.props.value) != -1;
|
|
217
|
+
})), n == "select" && o.defaultValue != null && (o.value = v(r.children).forEach(function(_) {
|
|
218
|
+
_.props.selected = o.multiple ? o.defaultValue.indexOf(_.props.value) != -1 : o.defaultValue == _.props.value;
|
|
219
219
|
})), r.class && !r.className ? (o.class = r.class, Object.defineProperty(o, "className", T)) : (r.className && !r.class || r.class && r.className) && (o.class = o.className = r.className), t.props = o;
|
|
220
|
-
}(e), e.$$typeof =
|
|
220
|
+
}(e), e.$$typeof = B, P && P(e);
|
|
221
221
|
};
|
|
222
|
-
var w =
|
|
223
|
-
|
|
222
|
+
var w = a.__r;
|
|
223
|
+
a.__r = function(e) {
|
|
224
224
|
w && w(e), e.__c;
|
|
225
225
|
};
|
|
226
|
-
var
|
|
227
|
-
|
|
228
|
-
|
|
226
|
+
var S = a.diffed;
|
|
227
|
+
a.diffed = function(e) {
|
|
228
|
+
S && S(e);
|
|
229
229
|
var t = e.props, r = e.__e;
|
|
230
230
|
r != null && e.type === "textarea" && "value" in t && t.value !== r.value && (r.value = t.value == null ? "" : t.value);
|
|
231
231
|
};
|
|
232
232
|
export {
|
|
233
|
-
|
|
234
|
-
|
|
233
|
+
s as Component,
|
|
234
|
+
y as Fragment,
|
|
235
235
|
C as PureComponent,
|
|
236
236
|
d as Suspense,
|
|
237
237
|
f as SuspenseList,
|
|
238
|
-
|
|
239
|
-
|
|
238
|
+
J as createContext,
|
|
239
|
+
c as createElement,
|
|
240
240
|
X as createPortal,
|
|
241
|
-
ne as createRef,
|
|
242
241
|
K as forwardRef,
|
|
243
242
|
Q as lazy,
|
|
244
243
|
q as memo,
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
244
|
+
te as useCallback,
|
|
245
|
+
re as useContext,
|
|
246
|
+
ne as useEffect,
|
|
247
|
+
oe as useImperativeHandle,
|
|
248
|
+
ie as useLayoutEffect,
|
|
249
|
+
ue as useMemo,
|
|
250
|
+
ae as useReducer,
|
|
251
|
+
le as useRef,
|
|
252
|
+
_e as useState
|
|
254
253
|
};
|