@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.
Files changed (71) hide show
  1. package/dist/ModalContent-e2777391.js +2 -0
  2. package/dist/{ModalContent-83a84ba5.js.map → ModalContent-e2777391.js.map} +1 -1
  3. package/dist/cjs/index.js +1 -1
  4. package/dist/es/components/external/BaseElement.js +1 -1
  5. package/dist/es/components/external/TransactionDetails/components/TransactionData.js +3 -3
  6. package/dist/es/components/external/TransactionDetails/components/TransactionDataSkeleton.js +1 -1
  7. package/dist/es/components/external/Transactions/components/Balances/Balances.js +33 -34
  8. package/dist/es/components/external/Transactions/components/ModalContent.js +1 -1
  9. package/dist/es/components/external/Transactions/components/SummaryItem/SummaryItem.js +8 -8
  10. package/dist/es/components/external/Transactions/components/SummaryItem/constants.js +5 -4
  11. package/dist/es/components/external/Transactions/components/TransactionList.js +72 -69
  12. package/dist/es/components/external/Transactions/components/TransactionTotals/TransactionTotals.js +51 -45
  13. package/dist/es/components/external/Transactions/components/TransactionsOverview.js +77 -74
  14. package/dist/es/components/external/Transactions/hooks/useMaxWidths.js +9 -9
  15. package/dist/es/components/external/UIElement.js +4 -4
  16. package/dist/es/components/internal/Button/Button.js +12 -12
  17. package/dist/es/components/internal/Calendar/components/CalendarControls/CalendarControls.js +4 -4
  18. package/dist/es/components/internal/DataGrid/DataGrid.js +7 -7
  19. package/dist/es/components/internal/DataGrid/components/InteractiveBody.js +1 -1
  20. package/dist/es/components/internal/DataGrid/components/SkeletonBody.js +1 -1
  21. package/dist/es/components/internal/DataGrid/components/TableBody.js +3 -3
  22. package/dist/es/components/internal/DataGrid/components/TableCells.js +1 -1
  23. package/dist/es/components/internal/ErrorMessageDisplay/ErrorMessageDisplay.js +3 -3
  24. package/dist/es/components/internal/ExpandableCard/ExpandableCard.js +7 -7
  25. package/dist/es/components/internal/FilterBar/filters/BaseFilter/BaseFilter.js +4 -4
  26. package/dist/es/components/internal/FormFields/InputBase.js +17 -17
  27. package/dist/es/components/internal/FormFields/Select/components/SelectButton.js +1 -1
  28. package/dist/es/components/internal/FormFields/Select/components/SelectListItem.js +1 -1
  29. package/dist/es/components/internal/Modal/Modal.js +12 -11
  30. package/dist/es/components/internal/Popover/Popover.js +4 -4
  31. package/dist/es/components/internal/Popover/PopoverDismissButton/PopoverDismissButton.js +1 -1
  32. package/dist/es/core/Auth/AuthContext.js +1 -1
  33. package/dist/es/core/Auth/AuthProvider.js +4 -4
  34. package/dist/es/core/Context/CoreContext.js +1 -1
  35. package/dist/es/core/Context/CoreProvider.js +1 -1
  36. package/dist/es/core/Localization/Localization.js +57 -56
  37. package/dist/es/core/Localization/amount/amount-util.js +14 -14
  38. package/dist/es/core/core.js +3 -3
  39. package/dist/es/external/preact/compat/dist/compat.module.js +54 -55
  40. package/dist/es/external/preact/dist/preact.module.js +309 -0
  41. package/dist/es/external/preact/hooks/dist/hooks.module.js +3 -3
  42. package/dist/es/external/preact/jsx-runtime/dist/jsxRuntime.module.js +4 -4
  43. package/dist/es/hooks/useModalDetails/useModalDetails.js +24 -18
  44. package/dist/es/index.js +13 -13
  45. package/dist/index-0c9f4def.js +12 -0
  46. package/dist/index-0c9f4def.js.map +1 -0
  47. package/dist/style.css +1 -1
  48. package/dist/types/components/external/TransactionDetails/index.d.ts +1 -1
  49. package/dist/types/components/external/TransactionDetails/index.d.ts.map +1 -1
  50. package/dist/types/components/external/Transactions/components/Balances/Balances.d.ts +2 -2
  51. package/dist/types/components/external/Transactions/components/Balances/Balances.d.ts.map +1 -1
  52. package/dist/types/components/external/Transactions/components/SummaryItem/SummaryItem.d.ts.map +1 -1
  53. package/dist/types/components/external/Transactions/components/SummaryItem/constants.d.ts +1 -0
  54. package/dist/types/components/external/Transactions/components/SummaryItem/constants.d.ts.map +1 -1
  55. package/dist/types/components/external/Transactions/components/TransactionList.d.ts.map +1 -1
  56. package/dist/types/components/external/Transactions/components/TransactionTotals/TransactionTotals.d.ts +2 -1
  57. package/dist/types/components/external/Transactions/components/TransactionTotals/TransactionTotals.d.ts.map +1 -1
  58. package/dist/types/components/external/Transactions/components/TransactionsOverview.d.ts.map +1 -1
  59. package/dist/types/components/external/Transactions/hooks/useMaxWidths.d.ts.map +1 -1
  60. package/dist/types/components/external/Transactions/types.d.ts +2 -2
  61. package/dist/types/components/external/Transactions/types.d.ts.map +1 -1
  62. package/dist/types/components/internal/Modal/Modal.d.ts.map +1 -1
  63. package/dist/types/core/Localization/Localization.d.ts.map +1 -1
  64. package/dist/types/core/Localization/amount/amount-util.d.ts +1 -5
  65. package/dist/types/core/Localization/amount/amount-util.d.ts.map +1 -1
  66. package/dist/types/hooks/useModalDetails/types.d.ts +1 -1
  67. package/dist/types/hooks/useModalDetails/types.d.ts.map +1 -1
  68. package/package.json +4 -2
  69. package/dist/ModalContent-83a84ba5.js +0 -2
  70. package/dist/index-ff45d757.js +0 -12
  71. 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-83a84ba5.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":"iKAIA,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,uBAAU,SAAoBG,GAAAC,IAACC,EAAAA,mBAAoB,CAAA,GAAGF,CAAkB,CAAA,CAAG,CAAA,CAC/E"}
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-ff45d757.js");require("preact");require("classnames");exports.AdyenFP=_.AdyenFP;exports.Core=_.Core;exports.TransactionFilterParam=_.TransactionFilterParam;exports.TransactionsComponent=_.TransactionsElement;exports.TransactionsDetailsComponent=_.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;
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 k = ({ transaction: e, isFetching: y }) => {
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
- k as TransactionData
69
+ T as TransactionData
70
70
  };
@@ -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 s } from "../../../../../external/preact/jsx-runtime/dist/jsxRuntime.module.js";
2
- import { useSetupEndpoint as u } from "../../../../../hooks/useSetupEndpoint/useSetupEndpoint.js";
3
- import { useCallback as x, useMemo as E, useEffect as g } from "../../../../../external/preact/hooks/dist/hooks.module.js";
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 b } from "../../../../../external/preact/compat/dist/compat.module.js";
6
- import { BASE_CLASS as y } from "./constants.js";
7
- import C from "../../../../internal/ExpandableCard/ExpandableCard.js";
8
- import { BaseList as F } from "../../../../internal/BaseList/BaseList.js";
9
- import { BalanceItem as c } from "../BalanceItem/BalanceItem.js";
10
- import { useMaxWidthsState as M } from "../../hooks/useMaxWidths.js";
11
- import { EMPTY_OBJECT as k } from "../../../../../utils/common/constants.js";
12
- const P = b(
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: t,
15
- updateBalanceAccountCurrencies: o
14
+ balanceAccountId: s,
15
+ onCurrenciesChange: n
16
16
  }) => {
17
- const i = u("getBalances"), p = x(async () => i(k, {
18
- path: { balanceAccountId: t }
19
- }), [t, i]), { data: e, error: f, isFetching: h } = W({
20
- fetchOptions: E(() => ({ enabled: !!t }), [t]),
21
- queryFn: p
22
- });
23
- g(() => {
24
- e && o(e == null ? void 0 : e.balances.map(({ currency: r }) => r).sort());
25
- }, [e, o]);
26
- const m = !t || h, d = !!f || !(e != null && e.balances.length), B = e == null ? void 0 : e.balances, [S, ...n] = B ?? [], [a, l] = M();
27
- return /* @__PURE__ */ s("div", { className: y, children: /* @__PURE__ */ s(
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__ */ s(
31
- c,
29
+ renderHeader: /* @__PURE__ */ t(
30
+ h,
32
31
  {
33
- isEmpty: d,
32
+ isEmpty: B,
34
33
  balance: S,
35
- widths: a,
34
+ widths: p,
36
35
  isHeader: !0,
37
- isSkeleton: m,
38
- isLoading: m,
39
- onWidthsSet: l
36
+ isSkeleton: c,
37
+ isLoading: c,
38
+ onWidthsSet: f
40
39
  }
41
40
  ),
42
41
  filled: !0,
43
- children: n.length && /* @__PURE__ */ s(F, { children: n.map((r) => /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(c, { balance: r, widths: a, onWidthsSet: l }) }, r.currency)) })
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
- P as Balances
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 h, BODY_CLASS as E, LABEL_CLASS as u, PLACEHOLDER_CLASS as N } from "./constants.js";
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: y = !1,
14
- isLoading: L = !1,
13
+ isSkeletonVisible: h = !1,
14
+ isLoading: u = !1,
15
15
  widths: r,
16
16
  onWidthsSet: p,
17
- isEmpty: A
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(h, { [E]: !s }), children: o.map((e, a) => /* @__PURE__ */ t("div", { children: [
29
- s && e.labelKey && /* @__PURE__ */ t(S, { variant: m.CAPTION, className: u, children: C.get(e.labelKey) }),
30
- y ? /* @__PURE__ */ t(f, { isLoading: L, hasMargin: e.hasSkeletonMargin, width: e.skeletonWidth + "px" }) : A ? /* @__PURE__ */ t("span", { className: l([h, N]) }) : /* @__PURE__ */ t("div", { ref: e.ref, style: c(a), children: /* @__PURE__ */ t(
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({ [u]: e.valueHasLabelStyle }),
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", L = S + "--body", _ = S + "__label", o = S + "__placeholder";
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
- L as BODY_CLASS,
5
- _ as LABEL_CLASS,
6
- o as PLACEHOLDER_CLASS
5
+ _ as BODY_CLASS,
6
+ o as LABEL_CLASS,
7
+ L as PLACEHOLDER_CLASS
7
8
  };
@@ -1,78 +1,78 @@
1
- import { jsx as o } from "../../../../external/preact/jsx-runtime/dist/jsxRuntime.module.js";
2
- import L from "../../../internal/Modal/Modal.js";
3
- import N from "../../../internal/Spinner/Spinner.js";
4
- import x from "../../../../core/Context/useCoreContext.js";
5
- import P from "../../../../hooks/useModalDetails/useModalDetails.js";
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 D, lazy as I } from "../../../../external/preact/compat/dist/compat.module.js";
8
- import { useMemo as m, useCallback as $ } from "../../../../external/preact/hooks/dist/hooks.module.js";
9
- import { getLabel as B, parsePaymentMethodType as G } from "./utils.js";
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 p } from "../../../internal/Tag/Tag.js";
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 O } from "../../../internal/DataGrid/types.js";
14
- import { Image as U } from "../../../internal/Image/Image.js";
15
- import H from "./TransactionListError/TransactionListError.js";
16
- import { getCurrencyCode as W } from "../../../../core/Localization/amount/amount-util.js";
17
- import h from "../../../internal/DataGrid/DataGrid.js";
18
- import j from "../../../internal/Pagination/Pagination.js";
19
- import { Fragment as M } from "preact";
20
- const q = I(() => import("./ModalContent.js")), V = ["creationDate", "status", "paymentMethod", "type", "currency", "amount"];
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: d,
22
+ balanceAccountDescription: p,
23
23
  loading: T,
24
24
  transactions: b,
25
- onTransactionSelected: u,
26
- showPagination: E,
27
- showDetails: e,
28
- error: c,
25
+ onTransactionSelected: d,
26
+ showPagination: D,
27
+ showDetails: u,
28
+ error: m,
29
29
  onContactSupport: y,
30
- availableCurrencies: s,
31
- ...S
30
+ availableCurrencies: r,
31
+ ..._
32
32
  }) {
33
- const { i18n: n } = x(), l = s && s.length > 1, _ = m(
34
- () => V.map((t) => {
35
- const r = n.get(B(t));
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 ? r : `${r} ${s && s[0] ? `(${W(s[0])})` : ""}`,
39
- position: t === "amount" ? O.RIGHT : void 0
40
- } : { key: t, label: r };
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
- [s, l, n]
43
- ), f = m(
42
+ [r, l, n]
43
+ ), f = s(
44
44
  () => ({
45
- showDetails: [e == null ? void 0 : e.transaction],
46
- callback: u
45
+ showDetails: u ?? !0,
46
+ callback: d
47
47
  }),
48
- [e == null ? void 0 : e.transaction, u]
49
- ), k = m(() => ({ transaction: f }), [f]), { updateDetails: g, resetDetails: C, selectedDetail: a } = P(k), F = $(
48
+ [u, d]
49
+ ), k = s(() => ({ transaction: f }), [f]), { updateDetails: h, resetDetails: C, selectedDetail: o } = x(k), F = $(
50
50
  (t) => {
51
- g({
52
- selection: { type: "transaction", data: { ...t, balanceAccountDescription: d } },
51
+ h({
52
+ selection: { type: "transaction", data: { ...t, balanceAccountDescription: p } },
53
53
  modalSize: "small"
54
54
  }).callback({ id: t.id });
55
55
  },
56
- [g, d]
57
- ), R = {
56
+ [h, p]
57
+ ), N = {
58
58
  title: "weDidNotFindAnyTransaction",
59
59
  message: ["thereAreNoTransactionsForThisRequirements", "tryAgainPlease"]
60
- }, A = m(() => () => /* @__PURE__ */ o(H, { error: c, onContactSupport: y }), [c, y]);
61
- return /* @__PURE__ */ o(M, { children: [
62
- /* @__PURE__ */ o(
63
- h,
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: A,
66
- error: c,
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: R,
72
+ emptyTableMessage: N,
73
73
  customCells: {
74
- status: ({ value: t }) => /* @__PURE__ */ o(
75
- p,
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 r = n.amount(t.value, t.currency, {
85
- showSign: t.value < 0,
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 r;
92
- return /* @__PURE__ */ o(M, { children: t.paymentMethod || t.bankAccount ? /* @__PURE__ */ o("div", { className: "adyen-fp-transactions__payment-method", children: [
93
- /* @__PURE__ */ o("div", { className: "adyen-fp-transactions__payment-method-logo-container", children: /* @__PURE__ */ o(
94
- U,
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 ? G(t.paymentMethod) : (r = t.bankAccount) == null ? void 0 : r.accountNumberLastFourDigits
103
- ] }) : /* @__PURE__ */ o(p, { label: n.get("noData"), variant: i.WHITE }) });
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__ */ o(p, { label: t.amount.currency })
102
+ currency: ({ item: t }) => /* @__PURE__ */ a(c, { label: t.amount.currency })
106
103
  },
107
- children: E && /* @__PURE__ */ o(h.Footer, { children: /* @__PURE__ */ o(j, { ...S }) })
104
+ children: D && /* @__PURE__ */ a(g.Footer, { children: /* @__PURE__ */ a(W, { ..._ }) })
108
105
  }
109
106
  ),
110
- /* @__PURE__ */ o(
111
- L,
107
+ /* @__PURE__ */ a(
108
+ S,
112
109
  {
113
- title: a != null && a.title ? n.get(a.title) : void 0,
114
- isOpen: !!a,
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: (a == null ? void 0 : a.modalSize) ?? "large",
120
- children: a && /* @__PURE__ */ o(D, { fallback: /* @__PURE__ */ o(N, {}), children: /* @__PURE__ */ o(q, { data: a.selection.data }) })
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
  ] });
@@ -1,60 +1,66 @@
1
- import { jsx as t } from "../../../../../external/preact/jsx-runtime/dist/jsxRuntime.module.js";
2
- import { useSetupEndpoint as W } from "../../../../../hooks/useSetupEndpoint/useSetupEndpoint.js";
3
- import { useCallback as g, useMemo as y } from "../../../../../external/preact/hooks/dist/hooks.module.js";
4
- import { useFetch as F } from "../../../../../hooks/useFetch/useFetch.js";
5
- import M from "../../../../internal/ExpandableCard/ExpandableCard.js";
6
- import { BASE_CLASS as k } from "./constants.js";
7
- import { memo as B } from "../../../../../external/preact/compat/dist/compat.module.js";
8
- import { TransactionTotalItem as S } from "../TransactionTotalItem/TransactionTotalItem.js";
9
- import { BaseList as L } from "../../../../internal/BaseList/BaseList.js";
10
- import { useMaxWidthsState as O } from "../../hooks/useMaxWidths.js";
11
- import { EMPTY_OBJECT as q } from "../../../../../utils/common/constants.js";
12
- const K = B(
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
- balanceAccountId: r,
15
- createdSince: s,
16
- createdUntil: e,
17
- categories: i,
18
- statuses: a,
19
- maxAmount: m,
20
- minAmount: n,
21
- currencies: l,
22
- availableCurrencies: v
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 p = W("getTransactionTotals"), u = g(async () => p(q, {
25
+ const T = M("getTransactionTotals"), C = S(async () => T(j, {
25
26
  query: {
26
- createdSince: s,
27
- createdUntil: e,
28
- categories: i,
29
- statuses: a,
30
- maxAmount: m,
31
- minAmount: n,
32
- currencies: l,
33
- balanceAccountId: r
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
- }), [r, i, s, e, l, p, m, n, a]), { data: o, error: w, isFetching: x } = F({
36
- fetchOptions: y(() => ({ enabled: !!r }), [r]),
37
- queryFn: u
38
- }), f = !r || x, C = o == null ? void 0 : o.totals, [E, ...h] = C ?? [], [d, T] = O();
39
- return /* @__PURE__ */ t("div", { className: k, children: /* @__PURE__ */ t(
40
- M,
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__ */ t(
43
- S,
48
+ renderHeader: /* @__PURE__ */ o(
49
+ g,
44
50
  {
45
- total: E,
46
- widths: d,
51
+ total: W,
52
+ widths: u,
47
53
  isHeader: !0,
48
- isSkeleton: f,
49
- isLoading: f,
50
- onWidthsSet: T
54
+ isSkeleton: n,
55
+ isLoading: n,
56
+ onWidthsSet: x
51
57
  }
52
58
  ),
53
- children: h.length && /* @__PURE__ */ t(L, { children: h.map((c) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(S, { total: c, widths: d, onWidthsSet: T }) }, c.currency)) })
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
- K as default
65
+ Z as default
60
66
  };