@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
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-0c9f4def.js");require("classnames");const r=t=>n.hasOwnProperty(t,"id");function e({data:t}){const o=r(t)?{transaction:t}:{transactionId:t};return n.o(n.k,{children:o&&n.o(n.TransactionDetails,{...o})})}exports.default=e;
|
|
2
|
+
//# sourceMappingURL=ModalContent-e2777391.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalContent-
|
|
1
|
+
{"version":3,"file":"ModalContent-e2777391.js","sources":["../src/components/external/Transactions/components/ModalContent.tsx"],"sourcesContent":["import { SelectedDetail, TransactionDetailData } from '@src/components';\nimport TransactionDetails from '@src/components/external/TransactionDetails/components/TransactionDetails';\nimport { hasOwnProperty } from '@src/utils/common';\n\nconst isTransactionWithoutId = (data: string | TransactionDetailData): data is TransactionDetailData => hasOwnProperty(data, 'id');\nfunction ModalContent({ data }: SelectedDetail) {\n const transactionProps = isTransactionWithoutId(data) ? { transaction: data } : { transactionId: data };\n\n return <>{transactionProps && <TransactionDetails {...transactionProps} />}</>;\n}\nexport default ModalContent;\n"],"names":["isTransactionWithoutId","data","hasOwnProperty","ModalContent","transactionProps","jsx","TransactionDetails"],"mappings":"6IAIA,MAAMA,EAA0BC,GAAwEC,EAAA,eAAeD,EAAM,IAAI,EACjI,SAASE,EAAa,CAAE,KAAAF,GAAwB,CACtC,MAAAG,EAAmBJ,EAAuBC,CAAI,EAAI,CAAE,YAAaA,GAAS,CAAE,cAAeA,GAEjG,gBAAU,SAAoBG,GAAAC,IAACC,EAAAA,mBAAoB,CAAA,GAAGF,CAAkB,CAAA,CAAG,CAAA,CAC/E"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("../index-0c9f4def.js");require("classnames");exports.AdyenFP=_.AdyenFP;exports.Core=_.Core;exports.TransactionFilterParam=_.TransactionFilterParam;exports.TransactionsComponent=_.TransactionsElement;exports.TransactionsDetails=_.TransactionsElement$1;exports.all_locales=_.all_locales;exports.ar=_.ar;exports.cs_CZ=_.cs_CZ;exports.da_DK=_.da_DK;exports.de_DE=_.de_DE;exports.el_GR=_.el_GR;exports.en_US=_.en_US;exports.es_ES=_.es_ES;exports.fi_FI=_.fi_FI;exports.fr_FR=_.fr_FR;exports.hr_HR=_.hr_HR;exports.hu_HU=_.hu_HU;exports.it_IT=_.it_IT;exports.ja_JP=_.ja_JP;exports.ko_KR=_.ko_KR;exports.nl_NL=_.nl_NL;exports.no_NO=_.no_NO;exports.pl_PL=_.pl_PL;exports.pt_BR=_.pt_BR;exports.pt_PT=_.pt_PT;exports.ro_RO=_.ro_RO;exports.ru_RU=_.ru_RU;exports.sk_SK=_.sk_SK;exports.sl_SI=_.sl_SI;exports.sv_SE=_.sv_SE;exports.zh_CN=_.zh_CN;exports.zh_TW=_.zh_TW;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var a = Object.defineProperty;
|
|
2
2
|
var c = (e, t, s) => t in e ? a(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
3
|
var o = (e, t, s) => (c(e, typeof t != "symbol" ? t + "" : t, s), s);
|
|
4
|
-
import { render as n } from "preact";
|
|
4
|
+
import { render as n } from "../../external/preact/dist/preact.module.js";
|
|
5
5
|
import u from "./EventEmitter.js";
|
|
6
6
|
import m from "../../utils/uuid.js";
|
|
7
7
|
import { isString as d } from "../../utils/validator-utils.js";
|
|
@@ -6,8 +6,8 @@ import { Tag as p } from "../../../internal/Tag/Tag.js";
|
|
|
6
6
|
import { TagVariant as a } from "../../../internal/Tag/types.js";
|
|
7
7
|
import h from "../../../../core/Context/useCoreContext.js";
|
|
8
8
|
import { useMemo as r } from "../../../../external/preact/hooks/dist/hooks.module.js";
|
|
9
|
-
import { Fragment as g } from "preact";
|
|
10
|
-
const
|
|
9
|
+
import { Fragment as g } from "../../../../external/preact/dist/preact.module.js";
|
|
10
|
+
const T = ({ transaction: e, isFetching: y }) => {
|
|
11
11
|
var l;
|
|
12
12
|
const { i18n: m } = h(), o = r(
|
|
13
13
|
() => e ? m.date(new Date(e.creationDate), {
|
|
@@ -66,5 +66,5 @@ const k = ({ transaction: e, isFetching: y }) => {
|
|
|
66
66
|
] }) : /* @__PURE__ */ d(u, { isLoading: y, skeletonRowNumber: 6 }) });
|
|
67
67
|
};
|
|
68
68
|
export {
|
|
69
|
-
|
|
69
|
+
T as TransactionData
|
|
70
70
|
};
|
package/dist/es/components/external/TransactionDetails/components/TransactionDataSkeleton.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as n } from "../../../../external/preact/jsx-runtime/dist/jsxRuntime.module.js";
|
|
2
2
|
import s from "classnames";
|
|
3
3
|
import { useMemo as m } from "../../../../external/preact/hooks/dist/hooks.module.js";
|
|
4
|
-
import { Fragment as c } from "preact";
|
|
4
|
+
import { Fragment as c } from "../../../../external/preact/dist/preact.module.js";
|
|
5
5
|
const f = ({ isLoading: o, skeletonRowNumber: a = 0 }) => {
|
|
6
6
|
const e = m(() => Array.from({ length: a }, (t, r) => r), [a]);
|
|
7
7
|
return /* @__PURE__ */ n(c, { children: e.map((t) => /* @__PURE__ */ n(
|
|
@@ -1,50 +1,49 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useSetupEndpoint as
|
|
3
|
-
import { useCallback as
|
|
1
|
+
import { jsx as t } from "../../../../../external/preact/jsx-runtime/dist/jsxRuntime.module.js";
|
|
2
|
+
import { useSetupEndpoint as x } from "../../../../../hooks/useSetupEndpoint/useSetupEndpoint.js";
|
|
3
|
+
import { useCallback as E, useMemo as y, useEffect as g } from "../../../../../external/preact/hooks/dist/hooks.module.js";
|
|
4
4
|
import { useFetch as W } from "../../../../../hooks/useFetch/useFetch.js";
|
|
5
|
-
import { memo as
|
|
6
|
-
import { BASE_CLASS as
|
|
7
|
-
import
|
|
8
|
-
import { BaseList as
|
|
9
|
-
import { BalanceItem as
|
|
10
|
-
import { useMaxWidthsState as
|
|
11
|
-
import { EMPTY_OBJECT as
|
|
12
|
-
const
|
|
5
|
+
import { memo as C } from "../../../../../external/preact/compat/dist/compat.module.js";
|
|
6
|
+
import { BASE_CLASS as F } from "./constants.js";
|
|
7
|
+
import M from "../../../../internal/ExpandableCard/ExpandableCard.js";
|
|
8
|
+
import { BaseList as k } from "../../../../internal/BaseList/BaseList.js";
|
|
9
|
+
import { BalanceItem as h } from "../BalanceItem/BalanceItem.js";
|
|
10
|
+
import { useMaxWidthsState as L } from "../../hooks/useMaxWidths.js";
|
|
11
|
+
import { EMPTY_OBJECT as O } from "../../../../../utils/common/constants.js";
|
|
12
|
+
const Y = C(
|
|
13
13
|
({
|
|
14
|
-
balanceAccountId:
|
|
15
|
-
|
|
14
|
+
balanceAccountId: s,
|
|
15
|
+
onCurrenciesChange: n
|
|
16
16
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
path: { balanceAccountId:
|
|
19
|
-
}), [
|
|
20
|
-
fetchOptions:
|
|
21
|
-
queryFn:
|
|
22
|
-
});
|
|
23
|
-
g(() => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
C,
|
|
17
|
+
const a = x("getBalances"), d = E(async () => a(O, {
|
|
18
|
+
path: { balanceAccountId: s }
|
|
19
|
+
}), [s, a]), { data: e, error: u, isFetching: i } = W({
|
|
20
|
+
fetchOptions: y(() => ({ enabled: !!s }), [s]),
|
|
21
|
+
queryFn: d
|
|
22
|
+
}), c = !s || i, B = !!u || !(e != null && e.balances.length), o = e == null ? void 0 : e.balances.sort((r, m) => r.currency.localeCompare(m.currency)), [S, ...l] = o ?? [], [p, f] = L();
|
|
23
|
+
return g(() => {
|
|
24
|
+
const r = o == null ? void 0 : o.map(({ currency: m }) => m);
|
|
25
|
+
n(r, i);
|
|
26
|
+
}, [o, i, n]), /* @__PURE__ */ t("div", { className: F, children: /* @__PURE__ */ t(
|
|
27
|
+
M,
|
|
29
28
|
{
|
|
30
|
-
renderHeader: /* @__PURE__ */
|
|
31
|
-
|
|
29
|
+
renderHeader: /* @__PURE__ */ t(
|
|
30
|
+
h,
|
|
32
31
|
{
|
|
33
|
-
isEmpty:
|
|
32
|
+
isEmpty: B,
|
|
34
33
|
balance: S,
|
|
35
|
-
widths:
|
|
34
|
+
widths: p,
|
|
36
35
|
isHeader: !0,
|
|
37
|
-
isSkeleton:
|
|
38
|
-
isLoading:
|
|
39
|
-
onWidthsSet:
|
|
36
|
+
isSkeleton: c,
|
|
37
|
+
isLoading: c,
|
|
38
|
+
onWidthsSet: f
|
|
40
39
|
}
|
|
41
40
|
),
|
|
42
41
|
filled: !0,
|
|
43
|
-
children:
|
|
42
|
+
children: l.length && /* @__PURE__ */ t(k, { children: l.map((r) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(h, { balance: r, widths: p, onWidthsSet: f }) }, r.currency)) })
|
|
44
43
|
}
|
|
45
44
|
) });
|
|
46
45
|
}
|
|
47
46
|
);
|
|
48
47
|
export {
|
|
49
|
-
|
|
48
|
+
Y as Balances
|
|
50
49
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as r } from "../../../../external/preact/jsx-runtime/dist/jsxRuntime.module.js";
|
|
2
2
|
import n from "../../TransactionDetails/components/TransactionDetails.js";
|
|
3
3
|
import { hasOwnProperty as i } from "../../../../utils/common/index.js";
|
|
4
|
-
import { Fragment as s } from "preact";
|
|
4
|
+
import { Fragment as s } from "../../../../external/preact/dist/preact.module.js";
|
|
5
5
|
const a = (o) => i(o, "id");
|
|
6
6
|
function f({ data: o }) {
|
|
7
7
|
const t = a(o) ? { transaction: o } : { transactionId: o };
|
|
@@ -6,15 +6,15 @@ import { TypographyVariant as m } from "../../../../internal/Typography/types.js
|
|
|
6
6
|
import "./SummaryItem.scss.js";
|
|
7
7
|
import { AmountSkeleton as f } from "../AmountSkeleton/AmountSkeleton.js";
|
|
8
8
|
import { useEffect as v } from "../../../../../external/preact/hooks/dist/hooks.module.js";
|
|
9
|
-
import { BASE_CLASS as
|
|
9
|
+
import { BASE_CLASS as A, BODY_CLASS as N, LABEL_CLASS as L, PLACEHOLDER_CLASS as T, AMOUNT_CLASS as E } from "./constants.js";
|
|
10
10
|
const w = ({
|
|
11
11
|
columnConfigs: o,
|
|
12
12
|
isHeader: s = !1,
|
|
13
|
-
isSkeletonVisible:
|
|
14
|
-
isLoading:
|
|
13
|
+
isSkeletonVisible: h = !1,
|
|
14
|
+
isLoading: u = !1,
|
|
15
15
|
widths: r,
|
|
16
16
|
onWidthsSet: p,
|
|
17
|
-
isEmpty:
|
|
17
|
+
isEmpty: y
|
|
18
18
|
}) => {
|
|
19
19
|
const { i18n: C } = d();
|
|
20
20
|
v(() => {
|
|
@@ -25,13 +25,13 @@ const w = ({
|
|
|
25
25
|
p(e);
|
|
26
26
|
}, [p]);
|
|
27
27
|
const c = (e) => ({ width: r && r[e] ? r[e] : "auto" });
|
|
28
|
-
return /* @__PURE__ */ t("div", { className: l(
|
|
29
|
-
s && e.labelKey && /* @__PURE__ */ t(S, { variant: m.CAPTION, className:
|
|
30
|
-
|
|
28
|
+
return /* @__PURE__ */ t("div", { className: l(A, { [N]: !s }), children: o.map((e, a) => /* @__PURE__ */ t("div", { children: [
|
|
29
|
+
s && e.labelKey && /* @__PURE__ */ t(S, { variant: m.CAPTION, className: L, children: C.get(e.labelKey) }),
|
|
30
|
+
h ? /* @__PURE__ */ t(f, { isLoading: u, hasMargin: e.hasSkeletonMargin, width: e.skeletonWidth + "px" }) : y ? /* @__PURE__ */ t("span", { className: l([A, T]) }) : /* @__PURE__ */ t("div", { ref: e.ref, style: c(a), children: /* @__PURE__ */ t(
|
|
31
31
|
S,
|
|
32
32
|
{
|
|
33
33
|
variant: e.valueHasLabelStyle ? m.CAPTION : m.TITLE,
|
|
34
|
-
className: l({ [
|
|
34
|
+
className: l(E, { [L]: e.valueHasLabelStyle }),
|
|
35
35
|
children: e.getValue()
|
|
36
36
|
}
|
|
37
37
|
) })
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
const S = "adyen-fp-summary-item",
|
|
1
|
+
const S = "adyen-fp-summary-item", _ = S + "--body", o = S + "__label", A = S + "__amount", L = S + "__placeholder";
|
|
2
2
|
export {
|
|
3
|
+
A as AMOUNT_CLASS,
|
|
3
4
|
S as BASE_CLASS,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
_ as BODY_CLASS,
|
|
6
|
+
o as LABEL_CLASS,
|
|
7
|
+
L as PLACEHOLDER_CLASS
|
|
7
8
|
};
|
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { jsx as a } from "../../../../external/preact/jsx-runtime/dist/jsxRuntime.module.js";
|
|
2
|
+
import S from "../../../internal/Modal/Modal.js";
|
|
3
|
+
import A from "../../../internal/Spinner/Spinner.js";
|
|
4
|
+
import L from "../../../../core/Context/useCoreContext.js";
|
|
5
|
+
import x from "../../../../hooks/useModalDetails/useModalDetails.js";
|
|
6
6
|
import z from "classnames";
|
|
7
|
-
import { Suspense as
|
|
8
|
-
import { useMemo as
|
|
9
|
-
import { getLabel as
|
|
7
|
+
import { Suspense as P, lazy as I } from "../../../../external/preact/compat/dist/compat.module.js";
|
|
8
|
+
import { useMemo as s, useCallback as $ } from "../../../../external/preact/hooks/dist/hooks.module.js";
|
|
9
|
+
import { getLabel as w, parsePaymentMethodType as B } from "./utils.js";
|
|
10
10
|
import "./TransactionList.scss.js";
|
|
11
|
-
import { Tag as
|
|
11
|
+
import { Tag as c } from "../../../internal/Tag/Tag.js";
|
|
12
12
|
import { TagVariant as i } from "../../../internal/Tag/types.js";
|
|
13
|
-
import { CellTextPosition as
|
|
14
|
-
import { Image as
|
|
15
|
-
import
|
|
16
|
-
import { getCurrencyCode as
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
const
|
|
13
|
+
import { CellTextPosition as G } from "../../../internal/DataGrid/types.js";
|
|
14
|
+
import { Image as O } from "../../../internal/Image/Image.js";
|
|
15
|
+
import U from "./TransactionListError/TransactionListError.js";
|
|
16
|
+
import { getCurrencyCode as H } from "../../../../core/Localization/amount/amount-util.js";
|
|
17
|
+
import g from "../../../internal/DataGrid/DataGrid.js";
|
|
18
|
+
import { Fragment as M } from "../../../../external/preact/dist/preact.module.js";
|
|
19
|
+
import W from "../../../internal/Pagination/Pagination.js";
|
|
20
|
+
const j = I(() => import("./ModalContent.js")), q = ["creationDate", "status", "paymentMethod", "type", "currency", "amount"];
|
|
21
21
|
function pt({
|
|
22
|
-
balanceAccountDescription:
|
|
22
|
+
balanceAccountDescription: p,
|
|
23
23
|
loading: T,
|
|
24
24
|
transactions: b,
|
|
25
|
-
onTransactionSelected:
|
|
26
|
-
showPagination:
|
|
27
|
-
showDetails:
|
|
28
|
-
error:
|
|
25
|
+
onTransactionSelected: d,
|
|
26
|
+
showPagination: D,
|
|
27
|
+
showDetails: u,
|
|
28
|
+
error: m,
|
|
29
29
|
onContactSupport: y,
|
|
30
|
-
availableCurrencies:
|
|
31
|
-
...
|
|
30
|
+
availableCurrencies: r,
|
|
31
|
+
..._
|
|
32
32
|
}) {
|
|
33
|
-
const { i18n: n } =
|
|
34
|
-
() =>
|
|
35
|
-
const
|
|
33
|
+
const { i18n: n } = L(), l = r && r.length > 1, E = s(
|
|
34
|
+
() => q.map((t) => {
|
|
35
|
+
const e = n.get(w(t));
|
|
36
36
|
return t === "amount" ? {
|
|
37
37
|
key: t,
|
|
38
|
-
label: l ?
|
|
39
|
-
position: t === "amount" ?
|
|
40
|
-
} : { key: t, label:
|
|
38
|
+
label: l ? e : `${e} ${r && r[0] ? `(${H(r[0])})` : ""}`,
|
|
39
|
+
position: t === "amount" ? G.RIGHT : void 0
|
|
40
|
+
} : { key: t, label: e };
|
|
41
41
|
}),
|
|
42
|
-
[
|
|
43
|
-
), f =
|
|
42
|
+
[r, l, n]
|
|
43
|
+
), f = s(
|
|
44
44
|
() => ({
|
|
45
|
-
showDetails:
|
|
46
|
-
callback:
|
|
45
|
+
showDetails: u ?? !0,
|
|
46
|
+
callback: d
|
|
47
47
|
}),
|
|
48
|
-
[
|
|
49
|
-
), k =
|
|
48
|
+
[u, d]
|
|
49
|
+
), k = s(() => ({ transaction: f }), [f]), { updateDetails: h, resetDetails: C, selectedDetail: o } = x(k), F = $(
|
|
50
50
|
(t) => {
|
|
51
|
-
|
|
52
|
-
selection: { type: "transaction", data: { ...t, balanceAccountDescription:
|
|
51
|
+
h({
|
|
52
|
+
selection: { type: "transaction", data: { ...t, balanceAccountDescription: p } },
|
|
53
53
|
modalSize: "small"
|
|
54
54
|
}).callback({ id: t.id });
|
|
55
55
|
},
|
|
56
|
-
[
|
|
57
|
-
),
|
|
56
|
+
[h, p]
|
|
57
|
+
), N = {
|
|
58
58
|
title: "weDidNotFindAnyTransaction",
|
|
59
59
|
message: ["thereAreNoTransactionsForThisRequirements", "tryAgainPlease"]
|
|
60
|
-
},
|
|
61
|
-
return /* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
|
|
60
|
+
}, R = s(() => () => /* @__PURE__ */ a(U, { error: m, onContactSupport: y }), [m, y]);
|
|
61
|
+
return /* @__PURE__ */ a(M, { children: [
|
|
62
|
+
/* @__PURE__ */ a(
|
|
63
|
+
g,
|
|
64
64
|
{
|
|
65
|
-
errorDisplay:
|
|
66
|
-
error:
|
|
67
|
-
columns:
|
|
65
|
+
errorDisplay: R,
|
|
66
|
+
error: m,
|
|
67
|
+
columns: E,
|
|
68
68
|
data: b,
|
|
69
69
|
loading: T,
|
|
70
70
|
outline: !1,
|
|
71
71
|
onRowClick: { callback: F },
|
|
72
|
-
emptyTableMessage:
|
|
72
|
+
emptyTableMessage: N,
|
|
73
73
|
customCells: {
|
|
74
|
-
status: ({ value: t }) => /* @__PURE__ */
|
|
75
|
-
|
|
74
|
+
status: ({ value: t }) => /* @__PURE__ */ a(
|
|
75
|
+
c,
|
|
76
76
|
{
|
|
77
77
|
label: n.get(t),
|
|
78
78
|
variant: t === "Booked" ? i.SUCCESS : t === "Reversed" ? i.ERROR : i.DEFAULT
|
|
@@ -81,17 +81,14 @@ function pt({
|
|
|
81
81
|
type: ({ item: t }) => t.category ? n.get(`txType.${t.category}`) : null,
|
|
82
82
|
creationDate: ({ value: t }) => n.fullDate(t),
|
|
83
83
|
amount: ({ value: t }) => {
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
hideSymbol: !l
|
|
87
|
-
});
|
|
88
|
-
return /* @__PURE__ */ o("span", { className: z("adyen-fp-transactions__amount"), children: r });
|
|
84
|
+
const e = n.amount(t.value, t.currency, { hideCurrency: !l });
|
|
85
|
+
return /* @__PURE__ */ a("span", { className: z("adyen-fp-transactions__amount"), children: e });
|
|
89
86
|
},
|
|
90
87
|
paymentMethod: ({ item: t }) => {
|
|
91
|
-
var
|
|
92
|
-
return /* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
|
|
88
|
+
var e;
|
|
89
|
+
return /* @__PURE__ */ a(M, { children: t.paymentMethod || t.bankAccount ? /* @__PURE__ */ a("div", { className: "adyen-fp-transactions__payment-method", children: [
|
|
90
|
+
/* @__PURE__ */ a("div", { className: "adyen-fp-transactions__payment-method-logo-container", children: /* @__PURE__ */ a(
|
|
91
|
+
O,
|
|
95
92
|
{
|
|
96
93
|
name: t.paymentMethod ? t.paymentMethod.type : "bankTransfer",
|
|
97
94
|
alt: t.paymentMethod ? t.paymentMethod.type : "bankTransfer",
|
|
@@ -99,25 +96,31 @@ function pt({
|
|
|
99
96
|
className: "adyen-fp-transactions__payment-method-logo"
|
|
100
97
|
}
|
|
101
98
|
) }),
|
|
102
|
-
t.paymentMethod ?
|
|
103
|
-
] }) : /* @__PURE__ */
|
|
99
|
+
t.paymentMethod ? B(t.paymentMethod) : (e = t.bankAccount) == null ? void 0 : e.accountNumberLastFourDigits
|
|
100
|
+
] }) : /* @__PURE__ */ a(c, { label: n.get("noData"), variant: i.WHITE }) });
|
|
104
101
|
},
|
|
105
|
-
currency: ({ item: t }) => /* @__PURE__ */
|
|
102
|
+
currency: ({ item: t }) => /* @__PURE__ */ a(c, { label: t.amount.currency })
|
|
106
103
|
},
|
|
107
|
-
children:
|
|
104
|
+
children: D && /* @__PURE__ */ a(g.Footer, { children: /* @__PURE__ */ a(W, { ..._ }) })
|
|
108
105
|
}
|
|
109
106
|
),
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
|
|
107
|
+
/* @__PURE__ */ a(
|
|
108
|
+
S,
|
|
112
109
|
{
|
|
113
|
-
title:
|
|
114
|
-
isOpen: !!
|
|
110
|
+
title: o != null && o.title ? n.get(o.title) : void 0,
|
|
111
|
+
isOpen: !!o,
|
|
115
112
|
"aria-label": n.get("transactionDetails"),
|
|
116
113
|
onClose: C,
|
|
117
114
|
isDismissible: !0,
|
|
118
115
|
headerWithBorder: !1,
|
|
119
|
-
size: (
|
|
120
|
-
children:
|
|
116
|
+
size: (o == null ? void 0 : o.modalSize) ?? "large",
|
|
117
|
+
children: o && /* @__PURE__ */ a(
|
|
118
|
+
P,
|
|
119
|
+
{
|
|
120
|
+
fallback: /* @__PURE__ */ a("span", { className: "adyen-fp-transactions__spinner-container", children: /* @__PURE__ */ a(A, { size: "medium" }) }),
|
|
121
|
+
children: /* @__PURE__ */ a(j, { data: o.selection.data })
|
|
122
|
+
}
|
|
123
|
+
)
|
|
121
124
|
}
|
|
122
125
|
)
|
|
123
126
|
] });
|
package/dist/es/components/external/Transactions/components/TransactionTotals/TransactionTotals.js
CHANGED
|
@@ -1,60 +1,66 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useSetupEndpoint as
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import { useFetch as
|
|
5
|
-
import
|
|
6
|
-
import { BASE_CLASS as
|
|
7
|
-
import { memo as
|
|
8
|
-
import { TransactionTotalItem as
|
|
9
|
-
import { BaseList as
|
|
10
|
-
import { useMaxWidthsState as
|
|
11
|
-
import { EMPTY_OBJECT as
|
|
12
|
-
const
|
|
1
|
+
import { jsx as o } from "../../../../../external/preact/jsx-runtime/dist/jsxRuntime.module.js";
|
|
2
|
+
import { useSetupEndpoint as M } from "../../../../../hooks/useSetupEndpoint/useSetupEndpoint.js";
|
|
3
|
+
import { useCallback as S, useMemo as k } from "../../../../../external/preact/hooks/dist/hooks.module.js";
|
|
4
|
+
import { useFetch as B } from "../../../../../hooks/useFetch/useFetch.js";
|
|
5
|
+
import L from "../../../../internal/ExpandableCard/ExpandableCard.js";
|
|
6
|
+
import { BASE_CLASS as q } from "./constants.js";
|
|
7
|
+
import { memo as w } from "../../../../../external/preact/compat/dist/compat.module.js";
|
|
8
|
+
import { TransactionTotalItem as g } from "../TransactionTotalItem/TransactionTotalItem.js";
|
|
9
|
+
import { BaseList as H } from "../../../../internal/BaseList/BaseList.js";
|
|
10
|
+
import { useMaxWidthsState as _ } from "../../hooks/useMaxWidths.js";
|
|
11
|
+
import { EMPTY_OBJECT as j } from "../../../../../utils/common/constants.js";
|
|
12
|
+
const Z = w(
|
|
13
13
|
({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
availableCurrencies: i,
|
|
15
|
+
isAvailableCurrenciesFetching: y,
|
|
16
|
+
balanceAccountId: s,
|
|
17
|
+
createdSince: a,
|
|
18
|
+
createdUntil: m,
|
|
19
|
+
categories: l,
|
|
20
|
+
statuses: f,
|
|
21
|
+
maxAmount: p,
|
|
22
|
+
minAmount: d,
|
|
23
|
+
currencies: h
|
|
23
24
|
}) => {
|
|
24
|
-
const
|
|
25
|
+
const T = M("getTransactionTotals"), C = S(async () => T(j, {
|
|
25
26
|
query: {
|
|
26
|
-
createdSince:
|
|
27
|
-
createdUntil:
|
|
28
|
-
categories:
|
|
29
|
-
statuses:
|
|
30
|
-
maxAmount:
|
|
31
|
-
minAmount:
|
|
32
|
-
currencies:
|
|
33
|
-
balanceAccountId:
|
|
27
|
+
createdSince: a,
|
|
28
|
+
createdUntil: m,
|
|
29
|
+
categories: l,
|
|
30
|
+
statuses: f,
|
|
31
|
+
maxAmount: p,
|
|
32
|
+
minAmount: d,
|
|
33
|
+
currencies: h,
|
|
34
|
+
balanceAccountId: s
|
|
34
35
|
}
|
|
35
|
-
}), [
|
|
36
|
-
fetchOptions:
|
|
37
|
-
queryFn:
|
|
38
|
-
}),
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
}), [s, l, a, m, h, T, p, d, f]), { data: t, isFetching: E } = B({
|
|
37
|
+
fetchOptions: k(() => ({ enabled: !!s }), [s]),
|
|
38
|
+
queryFn: C
|
|
39
|
+
}), n = !s || E || y, O = S(() => {
|
|
40
|
+
if (!i || !t)
|
|
41
|
+
return t == null ? void 0 : t.totals;
|
|
42
|
+
const r = i.map((e) => t.totals.find((F) => F.currency === e) || { currency: e, incomings: 0, expenses: 0 });
|
|
43
|
+
return r.concat(t.totals.filter((e) => !r.includes(e)));
|
|
44
|
+
}, [i, t]), [W, ...c] = O() ?? [], [u, x] = _();
|
|
45
|
+
return /* @__PURE__ */ o("div", { className: q, children: /* @__PURE__ */ o(
|
|
46
|
+
L,
|
|
41
47
|
{
|
|
42
|
-
renderHeader: /* @__PURE__ */
|
|
43
|
-
|
|
48
|
+
renderHeader: /* @__PURE__ */ o(
|
|
49
|
+
g,
|
|
44
50
|
{
|
|
45
|
-
total:
|
|
46
|
-
widths:
|
|
51
|
+
total: W,
|
|
52
|
+
widths: u,
|
|
47
53
|
isHeader: !0,
|
|
48
|
-
isSkeleton:
|
|
49
|
-
isLoading:
|
|
50
|
-
onWidthsSet:
|
|
54
|
+
isSkeleton: n,
|
|
55
|
+
isLoading: n,
|
|
56
|
+
onWidthsSet: x
|
|
51
57
|
}
|
|
52
58
|
),
|
|
53
|
-
children:
|
|
59
|
+
children: !n && c.length && /* @__PURE__ */ o(H, { children: c.map((r) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o(g, { total: r, widths: u, onWidthsSet: x }) }, r.currency)) })
|
|
54
60
|
}
|
|
55
61
|
) });
|
|
56
62
|
}
|
|
57
63
|
);
|
|
58
64
|
export {
|
|
59
|
-
|
|
65
|
+
Z as default
|
|
60
66
|
};
|