@tesouro/embedded-components-react 0.4.14 → 0.4.16
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/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +5 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index14.js +47 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index15.js +20 -77
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index16.js +75 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index17.js +36 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +64 -48
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +10 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +141 -118
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +93 -93
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +83 -67
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +235 -218
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +9 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +17 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +39 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index100.js +2 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index101.js +8 -50
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index102.js +52 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index103.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +26 -49
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +19 -306
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +154 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +2 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index29.js +60 -45
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +251 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +2 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index32.js +7 -48
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +49 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +2 -23
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index35.js +15 -337
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +50 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +2 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +21 -118
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +340 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +2 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +10 -97
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +99 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +1 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +11 -57
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +58 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +1 -54
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +52 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +10 -179
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +181 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +2 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +2 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +41 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +2 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index54.js +5 -90
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +92 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +2 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +2 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +16 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +1 -87
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +83 -291
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +292 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +13 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +1 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +6 -37
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +39 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +2 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +36 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index68.js +10 -199
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +201 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +3 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +15 -345
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +345 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +6 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +6 -91
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +93 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +2 -127
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +124 -25
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +26 -87
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +89 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +2 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +5 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +30 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +2 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +5 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +34 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +2 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +10 -104
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index89.js +105 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +2 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +15 -123
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index92.js +125 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index93.js +2 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index94.js +14 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index95.js +7 -167
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index96.js +170 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index97.js +2 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index98.js +11 -105
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index99.js +108 -2
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index3.js +15 -3
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js +63 -65
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +4 -2
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListDetailsSheet.js +6 -5
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListRow.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index4.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +19 -19
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +39 -33
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/subEntityForms.js +15 -15
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useAddressForm.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +37 -37
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartSelector.js +15 -15
- package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +0 -2
|
@@ -5,77 +5,75 @@
|
|
|
5
5
|
import { WidgetProvider as e } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
6
6
|
import "../../../shared/feature/dist/index.js";
|
|
7
7
|
import { WIDGET_NAME as t } from "./index2.js";
|
|
8
|
-
import {
|
|
9
|
-
import { resolveCardsListLabels as
|
|
10
|
-
import { CardsList as
|
|
11
|
-
import { CardsListDetailsSheet as
|
|
8
|
+
import { cardsListDetailsSheetTestIds as n, cardsListTestIds as r } from "./index3.js";
|
|
9
|
+
import { resolveCardsListLabels as i } from "../../ui/dist/lib/CardsList/labels.js";
|
|
10
|
+
import { CardsList as a } from "../../ui/dist/lib/CardsList/CardsList.js";
|
|
11
|
+
import { CardsListDetailsSheet as o } from "../../ui/dist/lib/CardsList/CardsListDetailsSheet.js";
|
|
12
12
|
import "../../ui/dist/index.js";
|
|
13
|
-
import { useCardsWidget as
|
|
14
|
-
import { CardDetailsWidget as
|
|
13
|
+
import { useCardsWidget as s } from "./index8.js";
|
|
14
|
+
import { CardDetailsWidget as c } from "../../../card-details-widget/feature/dist/index13.js";
|
|
15
15
|
import "../../../card-details-widget/feature/dist/index.js";
|
|
16
|
-
import { CreateCardWidget as
|
|
16
|
+
import { CreateCardWidget as l } from "../../../create-card-widget/feature/dist/index8.js";
|
|
17
17
|
import "../../../create-card-widget/feature/dist/index.js";
|
|
18
|
-
import { useCallback as
|
|
19
|
-
import { Fragment as
|
|
18
|
+
import { useCallback as u, useMemo as d, useState as f } from "react";
|
|
19
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
20
20
|
//#region ../../libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js
|
|
21
|
-
function
|
|
22
|
-
let { selectedCardId:
|
|
21
|
+
function g({ cardProgram: e, pagination: t, defaultPagination: g, onPaginationChange: _, labels: v, featureLabels: y, selectedCardId: b, defaultSelectedCardId: x, onSelectedCardIdChange: S, cardDetailsLabels: C, cardDetailsFeatureLabels: w, cardDetailsActivateLabels: T, bankLogoSrc: E, bankLogoAlt: D, cardArtSrc: O, createCardLabels: k, createCardFeatureLabels: A, onCreateCard: j, onActivateCard: M }) {
|
|
22
|
+
let { selectedCardId: N, onSelectCard: P, onCreateCardClick: F, canCreateCard: I, canReadCards: L, ...R } = s({
|
|
23
23
|
cardProgram: e,
|
|
24
24
|
pagination: t,
|
|
25
|
-
defaultPagination:
|
|
26
|
-
onPaginationChange:
|
|
27
|
-
featureLabels:
|
|
28
|
-
selectedCardId:
|
|
29
|
-
defaultSelectedCardId:
|
|
30
|
-
onSelectedCardIdChange:
|
|
31
|
-
onCreateCard:
|
|
32
|
-
onActivateCard:
|
|
33
|
-
cardArtSrc:
|
|
34
|
-
}),
|
|
35
|
-
|
|
36
|
-
}, [
|
|
37
|
-
|
|
38
|
-
}, [
|
|
39
|
-
|
|
40
|
-
}, [
|
|
41
|
-
|
|
42
|
-
let
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
-
...
|
|
45
|
-
canCreateCard:
|
|
46
|
-
onCreateCardClick:
|
|
47
|
-
labels:
|
|
48
|
-
testIds:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
onCancel: J,
|
|
63
|
-
onViewCard: I ? Y : void 0,
|
|
25
|
+
defaultPagination: g,
|
|
26
|
+
onPaginationChange: _,
|
|
27
|
+
featureLabels: y,
|
|
28
|
+
selectedCardId: b,
|
|
29
|
+
defaultSelectedCardId: x,
|
|
30
|
+
onSelectedCardIdChange: S,
|
|
31
|
+
onCreateCard: j,
|
|
32
|
+
onActivateCard: M,
|
|
33
|
+
cardArtSrc: O
|
|
34
|
+
}), z = d(() => i(v), [v]), [B, V] = f(!1), [H, U] = f(0), [W, G] = f(N), [K, q] = f(null), J = u(() => {
|
|
35
|
+
N !== null && P(null), U((e) => e + 1), V(!0);
|
|
36
|
+
}, [N, P]), Y = u(() => {
|
|
37
|
+
V(!1), N !== null && P(null);
|
|
38
|
+
}, [N, P]), X = u((e) => {
|
|
39
|
+
V(!1), P(e);
|
|
40
|
+
}, [P]), Z = e === "debit" && !!O && !!I && F === void 0, Q = B && N === null && Z;
|
|
41
|
+
B && (N !== null || !Z) && V(!1), Q ? K !== "create" && q("create") : N !== null && (K !== "details" && q("details"), N !== W && G(N));
|
|
42
|
+
let $ = K === "create", ee = N !== null || Q;
|
|
43
|
+
return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(a, {
|
|
44
|
+
...R,
|
|
45
|
+
canCreateCard: I,
|
|
46
|
+
onCreateCardClick: F ?? J,
|
|
47
|
+
labels: z,
|
|
48
|
+
testIds: r
|
|
49
|
+
}), /* @__PURE__ */ m(o, {
|
|
50
|
+
isOpen: ee,
|
|
51
|
+
labels: $ ? z.createSheet : z.detailsSheet,
|
|
52
|
+
contentClassName: $ ? "ttw:overflow-hidden ttw:p-0 ttw:min-h-0" : void 0,
|
|
53
|
+
onClose: Y,
|
|
54
|
+
testIds: n,
|
|
55
|
+
children: $ && Z && O ? /* @__PURE__ */ m(l, {
|
|
56
|
+
cardArtSrc: O,
|
|
57
|
+
labels: k,
|
|
58
|
+
featureLabels: A,
|
|
59
|
+
onClose: Y,
|
|
60
|
+
onCancel: Y,
|
|
61
|
+
onViewCard: L ? X : void 0,
|
|
64
62
|
className: "ttw:min-h-0 ttw:flex-1"
|
|
65
|
-
},
|
|
66
|
-
cardId:
|
|
63
|
+
}, H) : W === null ? null : /* @__PURE__ */ m(c, {
|
|
64
|
+
cardId: W,
|
|
67
65
|
cardProgram: e,
|
|
68
|
-
labels:
|
|
69
|
-
activateLabels:
|
|
70
|
-
featureLabels:
|
|
71
|
-
bankLogoSrc:
|
|
72
|
-
bankLogoAlt:
|
|
73
|
-
onClose:
|
|
74
|
-
},
|
|
66
|
+
labels: C,
|
|
67
|
+
activateLabels: T,
|
|
68
|
+
featureLabels: w,
|
|
69
|
+
bankLogoSrc: E,
|
|
70
|
+
bankLogoAlt: D,
|
|
71
|
+
onClose: Y
|
|
72
|
+
}, W)
|
|
75
73
|
})] });
|
|
76
74
|
}
|
|
77
|
-
function
|
|
78
|
-
return /* @__PURE__ */
|
|
75
|
+
function _({ baseUrl: n, widgetToken: r, organizationId: i, configClient: a, gatewayRouting: o, linkComponent: s, implementation: c, uiFramework: l, errorFallback: u, onError: d, analytics: f, disclosuresAcceptance: p, providerLabels: h, ..._ }) {
|
|
76
|
+
return /* @__PURE__ */ m(e, {
|
|
79
77
|
widgetName: t,
|
|
80
78
|
baseUrl: n,
|
|
81
79
|
widgetToken: r,
|
|
@@ -88,10 +86,10 @@ function g({ baseUrl: n, widgetToken: r, organizationId: i, configClient: a, gat
|
|
|
88
86
|
errorFallback: u,
|
|
89
87
|
onError: d,
|
|
90
88
|
analytics: f,
|
|
91
|
-
disclosuresAcceptance:
|
|
92
|
-
providerLabels:
|
|
93
|
-
children: /* @__PURE__ */
|
|
89
|
+
disclosuresAcceptance: p,
|
|
90
|
+
providerLabels: h,
|
|
91
|
+
children: /* @__PURE__ */ m(g, { ..._ })
|
|
94
92
|
});
|
|
95
93
|
}
|
|
96
94
|
//#endregion
|
|
97
|
-
export {
|
|
95
|
+
export { _ as CardsWidget, _ as default };
|
package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js
CHANGED
|
@@ -88,7 +88,8 @@ function w({ rows: t, columns: g, isLoading: S = !1, isError: w = !1, canToggleS
|
|
|
88
88
|
title: U.errorTitle,
|
|
89
89
|
description: U.errorDescription,
|
|
90
90
|
retryLabel: U.retryButton,
|
|
91
|
-
onRetry: A
|
|
91
|
+
onRetry: A,
|
|
92
|
+
testId: V?.error
|
|
92
93
|
})
|
|
93
94
|
})
|
|
94
95
|
}) : S ? /* @__PURE__ */ _(C, { columnCount: K }) : t.length === 0 ? /* @__PURE__ */ _(c, {
|
|
@@ -105,7 +106,8 @@ function w({ rows: t, columns: g, isLoading: S = !1, isError: w = !1, canToggleS
|
|
|
105
106
|
"aria-hidden": !0,
|
|
106
107
|
className: "ttw:size-4"
|
|
107
108
|
}),
|
|
108
|
-
onAction: W ? k : void 0
|
|
109
|
+
onAction: W ? k : void 0,
|
|
110
|
+
testId: V?.empty
|
|
109
111
|
})
|
|
110
112
|
})
|
|
111
113
|
}) : t.map((e) => /* @__PURE__ */ _(p, {
|
|
@@ -7,8 +7,8 @@ import { CARDS_LIST_LABELS_EN as a } from "./labels.js";
|
|
|
7
7
|
import { useMemo as o } from "react";
|
|
8
8
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
9
|
//#region ../../libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListDetailsSheet.js
|
|
10
|
-
function l({ isOpen: l, onClose: u, labels: d, contentClassName: f,
|
|
11
|
-
let
|
|
10
|
+
function l({ isOpen: l, onClose: u, labels: d, contentClassName: f, testIds: p, children: m }) {
|
|
11
|
+
let h = o(() => ({
|
|
12
12
|
...a.detailsSheet,
|
|
13
13
|
...d
|
|
14
14
|
}), [d]);
|
|
@@ -19,17 +19,18 @@ function l({ isOpen: l, onClose: u, labels: d, contentClassName: f, children: p
|
|
|
19
19
|
},
|
|
20
20
|
children: /* @__PURE__ */ c(t, {
|
|
21
21
|
showCloseButton: !1,
|
|
22
|
+
"data-testid": p?.root,
|
|
22
23
|
className: i("ttw:w-168 ttw:sm:max-w-168", "ttw:!gap-0", f ?? "ttw:overflow-y-auto"),
|
|
23
24
|
children: [
|
|
24
25
|
/* @__PURE__ */ s(r, {
|
|
25
26
|
className: "ttw:sr-only",
|
|
26
|
-
children:
|
|
27
|
+
children: h.title
|
|
27
28
|
}),
|
|
28
29
|
/* @__PURE__ */ s(n, {
|
|
29
30
|
className: "ttw:sr-only",
|
|
30
|
-
children:
|
|
31
|
+
children: h.description
|
|
31
32
|
}),
|
|
32
|
-
|
|
33
|
+
m
|
|
33
34
|
]
|
|
34
35
|
})
|
|
35
36
|
});
|
|
@@ -80,7 +80,7 @@ function l({ row: i, columns: a, labels: l, testIds: u }) {
|
|
|
80
80
|
})
|
|
81
81
|
};
|
|
82
82
|
return /* @__PURE__ */ s(n, {
|
|
83
|
-
"data-testid":
|
|
83
|
+
"data-testid": u?.rootPrefix ? `${u.rootPrefix}-${i.key}` : void 0,
|
|
84
84
|
className: f ? "ttw:relative ttw:h-18 ttw:cursor-pointer" : "ttw:h-18",
|
|
85
85
|
children: [a.map((e, n) => /* @__PURE__ */ s(t, { children: [n === 0 && f ? /* @__PURE__ */ o("button", {
|
|
86
86
|
type: "button",
|
package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index4.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { useCounterpartsQuery as e } from "../../../shared/counterpart-management/data-access/dist/index3.js";
|
|
6
|
+
import { useCounterpartAddressesForRowsQuery as t } from "../../../shared/counterpart-management/data-access/dist/index7.js";
|
|
7
|
+
import { buildAnalyticsMap as n, buildCounterpartRows as r } from "../../../shared/counterpart-management/feature/dist/lib/helpers.js";
|
|
8
8
|
import "../../../shared/counterpart-management/feature/dist/index.js";
|
|
9
9
|
import { PAYABLES_BILLED_STATUSES as i, PAYABLES_OWED_STATUSES as a, RECEIVABLES_BILLED_STATUSES as o, RECEIVABLES_DUE_STATUSES as s } from "./index3.js";
|
|
10
10
|
import { usePayablesAnalyticsByCounterpartQuery as c, useReceivablesAnalyticsByCounterpartQuery as l } from "../../data-access/dist/index2.js";
|
|
@@ -19,7 +19,7 @@ function m({ isCustomer: m, enabled: h = !0 }) {
|
|
|
19
19
|
}, 400);
|
|
20
20
|
return () => clearTimeout(e);
|
|
21
21
|
}, [S]);
|
|
22
|
-
let O = g[0]?.desc ? "desc" : "asc", k =
|
|
22
|
+
let O = g[0]?.desc ? "desc" : "asc", k = e({
|
|
23
23
|
sort: "counterpart_name",
|
|
24
24
|
order: O,
|
|
25
25
|
limit: v,
|
|
@@ -28,7 +28,7 @@ function m({ isCustomer: m, enabled: h = !0 }) {
|
|
|
28
28
|
type: E === "all" ? void 0 : E,
|
|
29
29
|
...m ? { is_customer: !0 } : { is_vendor: !0 },
|
|
30
30
|
enabled: h
|
|
31
|
-
}), A = f(() => k.data?.data.map((e) => e.id) ?? [], [k.data?.data]), j = A.length > 0, M =
|
|
31
|
+
}), A = f(() => k.data?.data.map((e) => e.id) ?? [], [k.data?.data]), j = A.length > 0, M = t({
|
|
32
32
|
counterpartIds: A,
|
|
33
33
|
enabled: h && j
|
|
34
34
|
}), N = l({
|
|
@@ -51,15 +51,15 @@ function m({ isCustomer: m, enabled: h = !0 }) {
|
|
|
51
51
|
statusIn: [...a],
|
|
52
52
|
counterpartIdIn: A,
|
|
53
53
|
enabled: h && !m && j
|
|
54
|
-
}), L = f(() => m ? N.data ?
|
|
54
|
+
}), L = f(() => m ? N.data ? n(N.data.data) : void 0 : F.data ? n(F.data.data) : void 0, [
|
|
55
55
|
m,
|
|
56
56
|
N.data,
|
|
57
57
|
F.data
|
|
58
|
-
]), R = f(() => m ? P.data ?
|
|
58
|
+
]), R = f(() => m ? P.data ? n(P.data.data) : void 0 : I.data ? n(I.data.data) : void 0, [
|
|
59
59
|
m,
|
|
60
60
|
P.data,
|
|
61
61
|
I.data
|
|
62
|
-
]), z = f(() => new Map(A.map((e, t) => [e, M[t]?.data?.data?.[0]])), [A, M]), B = f(() =>
|
|
62
|
+
]), z = f(() => new Map(A.map((e, t) => [e, M[t]?.data?.data?.[0]])), [A, M]), B = f(() => r({
|
|
63
63
|
counterparts: k.data?.data ?? [],
|
|
64
64
|
addresses: z,
|
|
65
65
|
billedAmounts: L,
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import { usePaymentTermsQuery as e } from "../../../shared/data-access/dist/lib/reference-data/usePaymentTermsQuery.js";
|
|
6
6
|
import { getStateOptions as t } from "../../../shared/util/dist/lib/usStates.js";
|
|
7
7
|
import { extractApiErrorMessage as n } from "../../../shared/util/dist/lib/apiErrors.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { useCounterpartAddressesQuery as r } from "../../../shared/counterpart-management/data-access/dist/index7.js";
|
|
9
|
+
import { COUNTERPART_MESSAGE_LABELS_EN as i } from "../../../shared/counterpart-management/feature/dist/lib/labels.js";
|
|
10
10
|
import { useCounterpartForm as ee } from "../../../shared/counterpart-management/feature/dist/lib/useCounterpartForm.js";
|
|
11
11
|
import "../../../shared/counterpart-management/feature/dist/index.js";
|
|
12
12
|
import { createEmptyReceivableFormValues as a, createLineItem as o, getPaymentTermOptions as s, hasReceivableFormErrors as c, receivableFormValuesToCreatePayload as l, receivableFormValuesToLineItemsPayload as te, receivableFormValuesToUpdatePayload as u, receivableToFormValues as d, validateReceivableForm as f } from "./index5.js";
|
|
@@ -24,9 +24,9 @@ function x({ messages: x, productMessageLabels: S, counterpartMessageLabels: C,
|
|
|
24
24
|
...ie,
|
|
25
25
|
...S
|
|
26
26
|
}), [S]), J = y(() => ({
|
|
27
|
-
...
|
|
27
|
+
...i,
|
|
28
28
|
...C
|
|
29
|
-
}), [C]), Y =
|
|
29
|
+
}), [C]), Y = r(F.customerId), ae = Y.data?.data?.[0], X = Y.data?.data?.[0]?.id, Z = _({
|
|
30
30
|
view: z,
|
|
31
31
|
setView: B,
|
|
32
32
|
selectedProductId: U,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "./index2.js";
|
|
2
|
-
import { useCounterpartQuery as
|
|
1
|
+
import { counterpartBankAccountsInvalidationKey as e } from "./index2.js";
|
|
2
|
+
import { useCounterpartQuery as t, useCounterpartsQuery as n, useCreateCounterpartMutation as r, useDeleteCounterpartMutation as i, useUpdateCounterpartMutation as a } from "./index3.js";
|
|
3
3
|
import "./index4.js";
|
|
4
|
-
import { useCounterpartBankAccountsQuery as
|
|
4
|
+
import { useCounterpartBankAccountsQuery as o, useCreateCounterpartBankAccountMutation as s, useDeleteCounterpartBankAccountMutation as c, useMakeCounterpartBankAccountDefaultMutation as l, useUpdateCounterpartBankAccountMutation as u } from "./index5.js";
|
|
5
5
|
import "./index6.js";
|
|
6
|
-
import { useCounterpartAddressesForRowsQuery as
|
|
7
|
-
export {
|
|
6
|
+
import { useCounterpartAddressesForRowsQuery as d, useCounterpartAddressesQuery as f, useCreateCounterpartAddressMutation as p, useUpdateCounterpartAddressMutation as m } from "./index7.js";
|
|
7
|
+
export { e as counterpartBankAccountsInvalidationKey, d as useCounterpartAddressesForRowsQuery, f as useCounterpartAddressesQuery, o as useCounterpartBankAccountsQuery, t as useCounterpartQuery, n as useCounterpartsQuery, p as useCreateCounterpartAddressMutation, s as useCreateCounterpartBankAccountMutation, r as useCreateCounterpartMutation, c as useDeleteCounterpartBankAccountMutation, i as useDeleteCounterpartMutation, l as useMakeCounterpartBankAccountDefaultMutation, m as useUpdateCounterpartAddressMutation, u as useUpdateCounterpartBankAccountMutation, a as useUpdateCounterpartMutation };
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import "../../../util/dist/lib/apiErrors.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { AddressFormSheet as a } from "../../ui/dist/index13.js";
|
|
6
|
-
import { ConfirmDeleteDialog as o } from "../../ui/dist/index14.js";
|
|
7
|
-
import "../../ui/dist/index.js";
|
|
8
|
-
import { COUNTERPART_MESSAGE_LABELS_EN as s } from "./lib/labels.js";
|
|
9
|
-
import { buildAnalyticsMap as c, buildCounterpartRows as l, counterpartFormBankAccountToCreatePayload as u, counterpartFormBankAccountToUpdatePayload as d, formatCounterpartDate as f, formatMoney as p, getAchInstructions as m, getCounterpartEmail as h, getCounterpartName as g, getPayableAchInstructions as _, hasAchFormValues as v, hasSelectedText as y, resolveCounterpartBankAccountWrite as b, validateAchFormValues as x } from "./lib/helpers.js";
|
|
10
|
-
import { useCounterpartsQuery as S } from "../../data-access/dist/index3.js";
|
|
11
|
-
import { useCounterpartBankAccountsQuery as C, useCreateCounterpartBankAccountMutation as w, useUpdateCounterpartBankAccountMutation as T } from "../../data-access/dist/index5.js";
|
|
12
|
-
import { useCounterpartAddressesForRowsQuery as E, useCounterpartAddressesQuery as D } from "../../data-access/dist/index7.js";
|
|
2
|
+
import { useCounterpartsQuery as e } from "../../data-access/dist/index3.js";
|
|
3
|
+
import { useCounterpartBankAccountsQuery as t, useCreateCounterpartBankAccountMutation as n, useUpdateCounterpartBankAccountMutation as r } from "../../data-access/dist/index5.js";
|
|
4
|
+
import { useCounterpartAddressesForRowsQuery as i, useCounterpartAddressesQuery as a } from "../../data-access/dist/index7.js";
|
|
13
5
|
import "../../data-access/dist/index.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
6
|
+
import { AchFieldGroup as o } from "../../ui/dist/index5.js";
|
|
7
|
+
import { CounterpartFormFields as s, CounterpartFormSheet as c, useFocusFirstInvalidField as l } from "../../ui/dist/index9.js";
|
|
8
|
+
import { BankAccountFormSheet as u } from "../../ui/dist/index11.js";
|
|
9
|
+
import { AddressFormSheet as d } from "../../ui/dist/index13.js";
|
|
10
|
+
import { ConfirmDeleteDialog as f } from "../../ui/dist/index14.js";
|
|
11
|
+
import "../../ui/dist/index.js";
|
|
12
|
+
import { COUNTERPART_MESSAGE_LABELS_EN as p } from "./lib/labels.js";
|
|
13
|
+
import { buildAnalyticsMap as m, buildCounterpartRows as h, counterpartFormBankAccountToCreatePayload as g, counterpartFormBankAccountToUpdatePayload as _, formatCounterpartDate as v, formatMoney as y, getAchInstructions as b, getCounterpartEmail as x, getCounterpartName as S, getPayableAchInstructions as C, hasAchFormValues as w, hasSelectedText as T, isAchCompatibleBankAccount as E, resolveCounterpartBankAccountWrite as D, validateAchFormValues as O } from "./lib/helpers.js";
|
|
14
|
+
import { useAddressForm as k } from "./lib/useAddressForm.js";
|
|
15
|
+
import { useCounterpartDetails as A } from "./lib/useCounterpartDetails.js";
|
|
16
|
+
import { usePayableAchInstructions as j } from "./lib/usePayableAchInstructions.js";
|
|
17
|
+
import { useCounterpartForm as M } from "./lib/useCounterpartForm.js";
|
|
18
18
|
import "./lib/useCounterpartSelector.js";
|
|
19
|
-
import { CounterpartSelector as
|
|
20
|
-
import { useDeleteController as
|
|
19
|
+
import { CounterpartSelector as N } from "./lib/CounterpartSelector.js";
|
|
20
|
+
import { useDeleteController as P } from "./lib/useDeleteController.js";
|
|
21
21
|
import "./lib/useSubEntityForm.js";
|
|
22
|
-
import { useBankAccountForm as
|
|
23
|
-
export {
|
|
22
|
+
import { useBankAccountForm as F } from "./lib/subEntityForms.js";
|
|
23
|
+
export { o as AchFieldGroup, d as AddressFormSheet, u as BankAccountFormSheet, p as COUNTERPART_MESSAGE_LABELS_EN, f as ConfirmDeleteDialog, s as CounterpartFormFields, c as CounterpartFormSheet, N as CounterpartSelector, m as buildAnalyticsMap, h as buildCounterpartRows, g as counterpartFormBankAccountToCreatePayload, _ as counterpartFormBankAccountToUpdatePayload, v as formatCounterpartDate, y as formatMoney, b as getAchInstructions, x as getCounterpartEmail, S as getCounterpartName, C as getPayableAchInstructions, w as hasAchFormValues, T as hasSelectedText, E as isAchCompatibleBankAccount, D as resolveCounterpartBankAccountWrite, k as useAddressForm, F as useBankAccountForm, i as useCounterpartAddressesForRowsQuery, a as useCounterpartAddressesQuery, t as useCounterpartBankAccountsQuery, A as useCounterpartDetails, M as useCounterpartForm, e as useCounterpartsQuery, n as useCreateCounterpartBankAccountMutation, P as useDeleteController, l as useFocusFirstInvalidField, j as usePayableAchInstructions, r as useUpdateCounterpartBankAccountMutation, O as validateAchFormValues };
|
|
@@ -129,8 +129,8 @@ function b(e) {
|
|
|
129
129
|
let t = (e ?? []).filter((e) => e.currency === "USD" && (!!e.routing_number || !!e.account_number));
|
|
130
130
|
return t.find((e) => e.is_default_for_currency) ?? t[0];
|
|
131
131
|
}
|
|
132
|
-
function x(e, t = "USD") {
|
|
133
|
-
return (e ?? []).find((e) => e.currency === t && e.is_default_for_currency && !!e.account_holder_name && !!e.routing_number && !!e.account_number);
|
|
132
|
+
function x(e, t = "USD", n) {
|
|
133
|
+
return n && (e ?? []).find((e) => e.id === n && R(e)) || (e ?? []).find((e) => e.currency === t && e.is_default_for_currency && !!e.account_holder_name && !!e.routing_number && !!e.account_number);
|
|
134
134
|
}
|
|
135
135
|
function S(e, t = {}) {
|
|
136
136
|
let n = e.line2.trim();
|
|
@@ -297,12 +297,18 @@ function L(e) {
|
|
|
297
297
|
e.bic
|
|
298
298
|
].every((e) => !e);
|
|
299
299
|
}
|
|
300
|
-
function R(e
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
300
|
+
function R(e) {
|
|
301
|
+
return !!(L(e) || e.currency === "USD" && (e.routing_number || e.account_number));
|
|
302
|
+
}
|
|
303
|
+
function z(e, t) {
|
|
304
|
+
if (t) {
|
|
305
|
+
let n = e?.find((e) => e.id === t);
|
|
306
|
+
return {
|
|
307
|
+
kind: "update",
|
|
308
|
+
bankAccountId: t,
|
|
309
|
+
includeAchDefaults: n ? L(n) : !1
|
|
310
|
+
};
|
|
311
|
+
}
|
|
306
312
|
let n = e?.find(L);
|
|
307
313
|
return n ? {
|
|
308
314
|
kind: "update",
|
|
@@ -313,7 +319,7 @@ function R(e, t) {
|
|
|
313
319
|
isDefaultForCurrency: !(e ?? []).some((e) => e.currency === "USD" && e.is_default_for_currency)
|
|
314
320
|
};
|
|
315
321
|
}
|
|
316
|
-
function
|
|
322
|
+
function B() {
|
|
317
323
|
return {
|
|
318
324
|
name: "",
|
|
319
325
|
accountHolderName: "",
|
|
@@ -326,7 +332,7 @@ function z() {
|
|
|
326
332
|
isDefault: !1
|
|
327
333
|
};
|
|
328
334
|
}
|
|
329
|
-
function
|
|
335
|
+
function V(e) {
|
|
330
336
|
return {
|
|
331
337
|
name: e.name ?? "",
|
|
332
338
|
accountHolderName: e.account_holder_name ?? "",
|
|
@@ -339,7 +345,7 @@ function B(e) {
|
|
|
339
345
|
isDefault: e.is_default_for_currency ?? !1
|
|
340
346
|
};
|
|
341
347
|
}
|
|
342
|
-
function
|
|
348
|
+
function H(e) {
|
|
343
349
|
return {
|
|
344
350
|
name: e.name.trim() || void 0,
|
|
345
351
|
account_holder_name: e.accountHolderName.trim() || void 0,
|
|
@@ -353,7 +359,7 @@ function V(e) {
|
|
|
353
359
|
is_default_for_currency: e.isDefault
|
|
354
360
|
};
|
|
355
361
|
}
|
|
356
|
-
function
|
|
362
|
+
function U(e) {
|
|
357
363
|
return {
|
|
358
364
|
name: e.name.trim(),
|
|
359
365
|
account_holder_name: e.accountHolderName.trim(),
|
|
@@ -366,54 +372,54 @@ function H(e) {
|
|
|
366
372
|
country: "US"
|
|
367
373
|
};
|
|
368
374
|
}
|
|
369
|
-
function
|
|
375
|
+
function W(e) {
|
|
370
376
|
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);
|
|
371
377
|
}
|
|
372
|
-
function
|
|
378
|
+
function G(e, t) {
|
|
373
379
|
let n = {};
|
|
374
380
|
return e.line1.trim().length === 0 && (n.line1 = t.addressLine1Required), e.city.trim().length === 0 && (n.city = t.cityRequired), e.state.trim().length === 0 && (n.state = t.stateRequired), e.postalCode.trim().length === 0 && (n.postalCode = t.postalCodeRequired), n;
|
|
375
381
|
}
|
|
376
|
-
function
|
|
382
|
+
function K(e) {
|
|
377
383
|
return Object.values(e).some(Boolean);
|
|
378
384
|
}
|
|
379
|
-
function
|
|
385
|
+
function q(e) {
|
|
380
386
|
if (!/^\d{9}$/.test(e)) return !1;
|
|
381
387
|
let t = [...e].map(Number);
|
|
382
388
|
return (3 * (t[0] + t[3] + t[6]) + 7 * (t[1] + t[4] + t[7]) + (t[2] + t[5] + t[8])) % 10 == 0;
|
|
383
389
|
}
|
|
384
|
-
function
|
|
390
|
+
function J(e, t = n) {
|
|
385
391
|
let r = {}, i = e.accountHolderName.trim(), a = e.routingNumber.trim(), o = e.accountNumber.trim();
|
|
386
|
-
return i.length === 0 && (r.accountHolderName = t.accountHolderNameRequired), (a.length === 0 || !
|
|
392
|
+
return i.length === 0 && (r.accountHolderName = t.accountHolderNameRequired), (a.length === 0 || !q(a)) && (r.routingNumber = t.routingNumberInvalid), (o.length === 0 || !/^\d{9,12}$/.test(o)) && (r.accountNumber = t.accountNumberInvalid), r;
|
|
387
393
|
}
|
|
388
|
-
function
|
|
394
|
+
function Y(e, t, r = n, i = "customer", a = !1) {
|
|
389
395
|
let o = {};
|
|
390
|
-
if (e.entityType === "organization" ? e.legalName.trim().length === 0 && (o.legalName = r.legalNameRequired) : (e.firstName.trim().length === 0 && (o.firstName = r.firstNameRequired), e.lastName.trim().length === 0 && (o.lastName = r.lastNameRequired)), e.email.trim().length === 0 ? o.email = r.emailRequired :
|
|
391
|
-
let t =
|
|
392
|
-
|
|
396
|
+
if (e.entityType === "organization" ? e.legalName.trim().length === 0 && (o.legalName = r.legalNameRequired) : (e.firstName.trim().length === 0 && (o.firstName = r.firstNameRequired), e.lastName.trim().length === 0 && (o.lastName = r.lastNameRequired)), e.email.trim().length === 0 ? o.email = r.emailRequired : W(e.email.trim()) || (o.email = r.emailInvalid), t === "create" && i === "vendor" || O(e.address)) {
|
|
397
|
+
let t = G(e.address, r);
|
|
398
|
+
K(t) && (o.address = t);
|
|
393
399
|
}
|
|
394
400
|
if (i === "vendor" && (a || P(e))) {
|
|
395
|
-
let t =
|
|
396
|
-
|
|
401
|
+
let t = J(e.bankAccount, r);
|
|
402
|
+
K(t) && (o.bankAccount = t);
|
|
397
403
|
}
|
|
398
404
|
return o;
|
|
399
405
|
}
|
|
400
|
-
function
|
|
406
|
+
function X(e) {
|
|
401
407
|
let { address: t, bankAccount: n, ...r } = e;
|
|
402
|
-
return
|
|
408
|
+
return K(r) || (t ? K(t) : !1) || (n ? K(n) : !1);
|
|
403
409
|
}
|
|
404
|
-
function
|
|
410
|
+
function Z(e, t = n) {
|
|
405
411
|
let r = {};
|
|
406
412
|
return e.name.trim().length === 0 && (r.name = t.bankAccountNameRequired), e.accountNumber.trim().length === 0 && e.iban.trim().length === 0 && (r.accountNumber = t.bankAccountIdentifierRequired), e.currency.trim().length === 0 && (r.currency = t.bankAccountCurrencyRequired), r;
|
|
407
413
|
}
|
|
408
|
-
function
|
|
409
|
-
return
|
|
414
|
+
function Q(e) {
|
|
415
|
+
return K(e);
|
|
410
416
|
}
|
|
411
|
-
function
|
|
412
|
-
return
|
|
417
|
+
function $(e, t = n) {
|
|
418
|
+
return G(e, t);
|
|
413
419
|
}
|
|
414
|
-
function
|
|
420
|
+
function ee() {
|
|
415
421
|
let e = globalThis.getSelection?.();
|
|
416
422
|
return !!(e && e.toString().length > 0);
|
|
417
423
|
}
|
|
418
424
|
//#endregion
|
|
419
|
-
export { w as addressFormToCreatePayload, T as addressFormToUpdatePayload, C as addressResponseToFormValues,
|
|
425
|
+
export { w as addressFormToCreatePayload, T as addressFormToUpdatePayload, C as addressResponseToFormValues, H as bankAccountFormToCreatePayload, U as bankAccountFormToUpdatePayload, V as bankAccountToFormValues, p as buildAnalyticsMap, y as buildBankAccountItems, _ as buildCounterpartDetailsView, m as buildCounterpartRows, F as counterpartFormBankAccountToCreatePayload, I as counterpartFormBankAccountToUpdatePayload, A as counterpartFormToCreatePayload, j as counterpartFormToUpdatePayload, D as counterpartToFormValues, B as emptyBankAccountFormValues, E as emptyCounterpartFormValues, l as formatCounterpartDate, s as formatMoney, o as fromMinorUnits, b as getAchInstructions, d as getCounterpartEmail, u as getCounterpartName, i as getCurrencyOptions, x as getPayableAchInstructions, N as hasAchFormValues, Q as hasBankAccountFormErrors, M as hasCounterpartFormAddressValues, P as hasCounterpartFormBankAccountValues, X as hasCounterpartFormErrors, ee as hasSelectedText, R as isAchCompatibleBankAccount, z as resolveCounterpartBankAccountWrite, J as validateAchFormValues, $ as validateAddressForm, Z as validateBankAccountForm, Y as validateCounterpartForm };
|
|
@@ -2,38 +2,38 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import { useCreateCounterpartBankAccountMutation as s, useMakeCounterpartBankAccountDefaultMutation as c, useUpdateCounterpartBankAccountMutation as l } from "../../../data-access/dist/index5.js";
|
|
5
|
+
import { useCreateCounterpartBankAccountMutation as e, useMakeCounterpartBankAccountDefaultMutation as t, useUpdateCounterpartBankAccountMutation as n } from "../../../data-access/dist/index5.js";
|
|
7
6
|
import "../../../data-access/dist/index.js";
|
|
7
|
+
import { bankAccountFormToCreatePayload as r, bankAccountFormToUpdatePayload as i, bankAccountToFormValues as a, emptyBankAccountFormValues as o, getCurrencyOptions as s, hasBankAccountFormErrors as c, validateBankAccountForm as l } from "./helpers.js";
|
|
8
8
|
import { useSubEntityForm as u } from "./useSubEntityForm.js";
|
|
9
9
|
import { useMemo as d } from "react";
|
|
10
10
|
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/subEntityForms.js
|
|
11
11
|
function f({ items: f, selectedId: p, messages: m }) {
|
|
12
|
-
let h =
|
|
12
|
+
let h = e(), g = n(), _ = t(), v = u({
|
|
13
13
|
items: f,
|
|
14
|
-
empty:
|
|
15
|
-
toFormValues:
|
|
16
|
-
validate: (e) =>
|
|
17
|
-
hasErrors:
|
|
14
|
+
empty: o,
|
|
15
|
+
toFormValues: a,
|
|
16
|
+
validate: (e) => l(e, m),
|
|
17
|
+
hasErrors: c,
|
|
18
18
|
genericError: m.genericError,
|
|
19
|
-
onSubmit: async ({ mode:
|
|
19
|
+
onSubmit: async ({ mode: e, id: t, values: n, existing: a }) => {
|
|
20
20
|
if (!p) return;
|
|
21
|
-
let o =
|
|
22
|
-
|
|
21
|
+
let o = t;
|
|
22
|
+
e === "edit" && t ? await g.mutateAsync({
|
|
23
23
|
path: {
|
|
24
24
|
counterpart_id: p,
|
|
25
|
-
bank_account_id:
|
|
25
|
+
bank_account_id: t
|
|
26
26
|
},
|
|
27
|
-
body:
|
|
27
|
+
body: i(n)
|
|
28
28
|
}) : o = (await h.mutateAsync({
|
|
29
29
|
path: { counterpart_id: p },
|
|
30
|
-
body:
|
|
31
|
-
}))?.id,
|
|
30
|
+
body: r(n)
|
|
31
|
+
}))?.id, n.isDefault && !a?.is_default_for_currency && o && await _.mutateAsync({ path: {
|
|
32
32
|
counterpart_id: p,
|
|
33
33
|
bank_account_id: o
|
|
34
34
|
} });
|
|
35
35
|
}
|
|
36
|
-
}), y = d(() =>
|
|
36
|
+
}), y = d(() => s(v.values.currency), [v.values.currency]);
|
|
37
37
|
return {
|
|
38
38
|
form: v,
|
|
39
39
|
inProgress: h.isPending || g.isPending || _.isPending,
|
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { extractApiErrorMessage as e } from "../../../../util/dist/lib/apiErrors.js";
|
|
6
|
-
import {
|
|
7
|
-
import { useCreateCounterpartAddressMutation as a, useUpdateCounterpartAddressMutation as o } from "../../../data-access/dist/index7.js";
|
|
6
|
+
import { useCreateCounterpartAddressMutation as t, useUpdateCounterpartAddressMutation as n } from "../../../data-access/dist/index7.js";
|
|
8
7
|
import "../../../data-access/dist/index.js";
|
|
8
|
+
import { addressFormToCreatePayload as r, addressFormToUpdatePayload as i, addressResponseToFormValues as a, validateAddressForm as o } from "./helpers.js";
|
|
9
9
|
import { useCallback as s, useState as c } from "react";
|
|
10
10
|
//#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useAddressForm.js
|
|
11
11
|
function l({ selectedId: l, primaryAddress: u, messages: d }) {
|
|
12
|
-
let f =
|
|
12
|
+
let f = t(), p = n(), [m, h] = c(!1), [g, _] = c(() => ({
|
|
13
13
|
line1: "",
|
|
14
14
|
line2: "",
|
|
15
15
|
city: "",
|
|
16
16
|
state: "",
|
|
17
17
|
postalCode: ""
|
|
18
18
|
})), [v, y] = c({}), [b, x] = c(), S = s(() => {
|
|
19
|
-
u && (_(
|
|
19
|
+
u && (_(a(u)), y({}), x(void 0), h(!0));
|
|
20
20
|
}, [u]), C = s(() => {
|
|
21
21
|
_({
|
|
22
22
|
line1: "",
|
|
@@ -27,9 +27,9 @@ function l({ selectedId: l, primaryAddress: u, messages: d }) {
|
|
|
27
27
|
}), y({}), x(void 0), h(!0);
|
|
28
28
|
}, []), w = s(() => h(!1), []), T = s(async () => {
|
|
29
29
|
if (!l) return;
|
|
30
|
-
let
|
|
31
|
-
if (Object.values(
|
|
32
|
-
y(
|
|
30
|
+
let t = o(g, d);
|
|
31
|
+
if (Object.values(t).some(Boolean)) {
|
|
32
|
+
y(t);
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
y({});
|
|
@@ -39,10 +39,10 @@ function l({ selectedId: l, primaryAddress: u, messages: d }) {
|
|
|
39
39
|
counterpart_id: l,
|
|
40
40
|
address_id: u.id
|
|
41
41
|
},
|
|
42
|
-
body:
|
|
42
|
+
body: i(g)
|
|
43
43
|
}) : await f.mutateAsync({
|
|
44
44
|
path: { counterpart_id: l },
|
|
45
|
-
body:
|
|
45
|
+
body: r(g)
|
|
46
46
|
}), h(!1);
|
|
47
47
|
} catch (t) {
|
|
48
48
|
x(e(t) ?? d.genericError);
|