@tesouro/embedded-components-react 0.2.264 → 0.2.267
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/README.md +8 -6
- package/dist/experimental/WidgetSuite.d.ts +93 -2
- package/dist/experimental/WidgetSuite.js +5 -5
- package/dist/experimental/index.d.ts +93 -2
- package/dist/experimental/index.js +5 -5
- package/dist/index.css +45 -9
- package/dist/index.d.ts +29 -9
- package/dist/index.js +2 -2
- package/dist/lib/AcceptDisclosuresWidget.d.ts +17 -5
- package/dist/lib/AcceptDisclosuresWidget.js +1 -1
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/lib/WidgetProvider.d.ts +12 -4
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/data-access/dist/index2.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index3.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index4.js +36 -34
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/index.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/{index3.js → lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js} +3 -3
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/{index2.js → lib/AcceptDisclosuresWidget/labels.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +99 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +7 -97
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +99 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +2 -41
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +43 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +1 -50
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +48 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +9 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +8 -91
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +6 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +7 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +100 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +3 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +6 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +9 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +83 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +2 -111
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +8 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +103 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +37 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +15 -116
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +126 -31
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +32 -69
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +0 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +34 -69
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +261 -181
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +32 -33
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index7.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index3.js +4 -15
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index4.js +26 -91
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index5.js +87 -74
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index6.js +142 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/ui/dist/index2.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/ui/dist/index3.js +49 -33
- package/package.json +1 -1
|
@@ -1,74 +1,37 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use client";
|
|
3
|
-
"use client";
|
|
4
|
-
"use client";
|
|
5
|
-
import { displayLineAmount as e, displayTotal as t } from "./index6.js";
|
|
6
|
-
import { emptyLineItem as n, mapPayableToBillForm as r } from "./index8.js";
|
|
7
|
-
import { useCallback as i, useEffect as a, useMemo as o, useState as s } from "react";
|
|
8
1
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js
|
|
9
|
-
function
|
|
10
|
-
let u = o(() => r({
|
|
11
|
-
payable: c ?? {},
|
|
12
|
-
lineItems: l ?? []
|
|
13
|
-
}), [c, l]), [d, f] = s(u.values), [p, m] = s(u.lineItems), [h, g] = s(), [_, v] = s(!1), [y, b] = s(!1);
|
|
14
|
-
a(() => {
|
|
15
|
-
_ || f(u.values);
|
|
16
|
-
}, [u]), a(() => {
|
|
17
|
-
y || m(u.lineItems);
|
|
18
|
-
}, [u]);
|
|
19
|
-
let x = i((e) => {
|
|
20
|
-
f((t) => ({
|
|
21
|
-
...t,
|
|
22
|
-
...e
|
|
23
|
-
})), v(!0);
|
|
24
|
-
}, []), S = i((t, n) => {
|
|
25
|
-
m((r) => r.map((r) => {
|
|
26
|
-
if (r.id !== t) return r;
|
|
27
|
-
let i = {
|
|
28
|
-
...r,
|
|
29
|
-
...n
|
|
30
|
-
};
|
|
31
|
-
return {
|
|
32
|
-
...i,
|
|
33
|
-
amount: e(i.quantity, i.price)
|
|
34
|
-
};
|
|
35
|
-
})), b(!0);
|
|
36
|
-
}, []), C = i((t, n) => {
|
|
37
|
-
m((r) => r.map((r) => {
|
|
38
|
-
if (r.id !== t) return r;
|
|
39
|
-
let i = Number.parseFloat(r.quantity), a = String(Math.max(1, (Number.isFinite(i) ? i : 1) + n));
|
|
40
|
-
return {
|
|
41
|
-
...r,
|
|
42
|
-
quantity: a,
|
|
43
|
-
amount: e(a, r.price)
|
|
44
|
-
};
|
|
45
|
-
})), b(!0);
|
|
46
|
-
}, []), w = i((e) => {
|
|
47
|
-
m((t) => t.length <= 1 ? t : t.filter((t) => t.id !== e)), b(!0);
|
|
48
|
-
}, []), T = i(() => {
|
|
49
|
-
m((e) => [...e, n()]), b(!0);
|
|
50
|
-
}, []);
|
|
2
|
+
function e() {
|
|
51
3
|
return {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
4
|
+
id: crypto.randomUUID(),
|
|
5
|
+
description: "",
|
|
6
|
+
glCode: "",
|
|
7
|
+
quantity: "1",
|
|
8
|
+
price: "",
|
|
9
|
+
amount: ""
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function t(e) {
|
|
13
|
+
return typeof e == "number" ? (e / 100).toFixed(2) : "";
|
|
14
|
+
}
|
|
15
|
+
function n({ payable: n, lineItems: r }) {
|
|
16
|
+
let i = {
|
|
17
|
+
invoiceNumber: n.document_id ?? "",
|
|
18
|
+
invoiceDate: n.issued_at ?? "",
|
|
19
|
+
dueDate: n.due_date ?? "",
|
|
20
|
+
poNumber: ""
|
|
21
|
+
}, a = r.map((e) => ({
|
|
22
|
+
id: e.id,
|
|
23
|
+
description: e.name ?? "",
|
|
24
|
+
glCode: e.ledger_account_id ?? "",
|
|
25
|
+
quantity: e.quantity == null ? "" : String(e.quantity),
|
|
26
|
+
price: t(e.unit_price),
|
|
27
|
+
amount: t(e.subtotal)
|
|
28
|
+
}));
|
|
29
|
+
return {
|
|
30
|
+
values: i,
|
|
31
|
+
lineItems: a.length ? a : [e()],
|
|
32
|
+
discount: t(n.discount),
|
|
33
|
+
tax: t(n.tax_amount)
|
|
71
34
|
};
|
|
72
35
|
}
|
|
73
36
|
//#endregion
|
|
74
|
-
export {
|
|
37
|
+
export { e as emptyLineItem, n as mapPayableToBillForm };
|
|
@@ -3,9 +3,6 @@ var e = {
|
|
|
3
3
|
invoiceNumber: "Invoice number",
|
|
4
4
|
invoiceDate: "Invoice date",
|
|
5
5
|
dueDate: "Due date",
|
|
6
|
-
paymentTerms: "Payment terms (optional)",
|
|
7
|
-
paymentTermsPlaceholder: "Select payment terms",
|
|
8
|
-
paymentTermsNone: "No payment terms",
|
|
9
6
|
poNumber: "PO number (optional)"
|
|
10
7
|
};
|
|
11
8
|
//#endregion
|
|
@@ -1,83 +1,48 @@
|
|
|
1
|
-
import { Input as e, Label as t
|
|
2
|
-
import { BILL_FORM_FIELDS_LABELS_EN as
|
|
3
|
-
import { useId as
|
|
4
|
-
import { jsx as
|
|
1
|
+
import { Input as e, Label as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { BILL_FORM_FIELDS_LABELS_EN as n } from "./index12.js";
|
|
3
|
+
import { useId as r } from "react";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
5
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
...
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return /* @__PURE__ */ u("div", {
|
|
6
|
+
function o({ values: o, errors: s, onChange: c, testId: l, labels: u }) {
|
|
7
|
+
let d = {
|
|
8
|
+
...n,
|
|
9
|
+
...u
|
|
10
|
+
}, f = r(), p = (n, r, l) => {
|
|
11
|
+
let u = `${f}-${n}`, d = `${u}-error`, p = s?.[n];
|
|
12
|
+
return /* @__PURE__ */ a("div", {
|
|
14
13
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
15
14
|
children: [
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
htmlFor:
|
|
15
|
+
/* @__PURE__ */ i(t, {
|
|
16
|
+
htmlFor: u,
|
|
18
17
|
children: r
|
|
19
18
|
}),
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
id:
|
|
22
|
-
type:
|
|
23
|
-
value:
|
|
24
|
-
"aria-invalid":
|
|
25
|
-
"aria-describedby":
|
|
26
|
-
onChange: (e) =>
|
|
19
|
+
/* @__PURE__ */ i(e, {
|
|
20
|
+
id: u,
|
|
21
|
+
type: l,
|
|
22
|
+
value: o[n],
|
|
23
|
+
"aria-invalid": p ? !0 : void 0,
|
|
24
|
+
"aria-describedby": p ? d : void 0,
|
|
25
|
+
onChange: (e) => c({ [n]: e.target.value })
|
|
27
26
|
}),
|
|
28
|
-
|
|
29
|
-
id:
|
|
27
|
+
p ? /* @__PURE__ */ i("p", {
|
|
28
|
+
id: d,
|
|
30
29
|
className: "ttw:text-sm ttw:text-destructive",
|
|
31
|
-
children:
|
|
30
|
+
children: p
|
|
32
31
|
}) : null
|
|
33
32
|
]
|
|
34
33
|
});
|
|
35
|
-
}
|
|
36
|
-
return /* @__PURE__ */
|
|
34
|
+
};
|
|
35
|
+
return /* @__PURE__ */ a("div", {
|
|
37
36
|
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
38
|
-
"data-testid":
|
|
39
|
-
children: [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
|
|
47
|
-
children: [/* @__PURE__ */ u("div", {
|
|
48
|
-
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
49
|
-
children: [
|
|
50
|
-
/* @__PURE__ */ l(t, {
|
|
51
|
-
htmlFor: x,
|
|
52
|
-
children: v.paymentTerms
|
|
53
|
-
}),
|
|
54
|
-
/* @__PURE__ */ u(n, {
|
|
55
|
-
value: f.paymentTerms || d,
|
|
56
|
-
onValueChange: (e) => m({ paymentTerms: e === d ? "" : e }),
|
|
57
|
-
children: [/* @__PURE__ */ l(a, {
|
|
58
|
-
id: x,
|
|
59
|
-
className: "ttw:w-full",
|
|
60
|
-
"aria-invalid": C ? !0 : void 0,
|
|
61
|
-
"aria-describedby": C ? S : void 0,
|
|
62
|
-
children: /* @__PURE__ */ l(o, { placeholder: v.paymentTermsPlaceholder })
|
|
63
|
-
}), /* @__PURE__ */ u(r, { children: [/* @__PURE__ */ l(i, {
|
|
64
|
-
value: d,
|
|
65
|
-
children: v.paymentTermsNone
|
|
66
|
-
}), h.map((e) => /* @__PURE__ */ l(i, {
|
|
67
|
-
value: e.value,
|
|
68
|
-
children: e.label
|
|
69
|
-
}, e.value))] })]
|
|
70
|
-
}),
|
|
71
|
-
C ? /* @__PURE__ */ l("p", {
|
|
72
|
-
id: S,
|
|
73
|
-
className: "ttw:text-sm ttw:text-destructive",
|
|
74
|
-
children: C
|
|
75
|
-
}) : null
|
|
76
|
-
]
|
|
77
|
-
}), b("poNumber", v.poNumber)]
|
|
78
|
-
})
|
|
79
|
-
]
|
|
37
|
+
"data-testid": l,
|
|
38
|
+
children: [/* @__PURE__ */ a("div", {
|
|
39
|
+
className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
|
|
40
|
+
children: [p("invoiceDate", d.invoiceDate, "date"), p("dueDate", d.dueDate, "date")]
|
|
41
|
+
}), /* @__PURE__ */ a("div", {
|
|
42
|
+
className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
|
|
43
|
+
children: [p("invoiceNumber", d.invoiceNumber), p("poNumber", d.poNumber)]
|
|
44
|
+
})]
|
|
80
45
|
});
|
|
81
46
|
}
|
|
82
47
|
//#endregion
|
|
83
|
-
export {
|
|
48
|
+
export { o as BillFormFields, o as default };
|
|
@@ -9,6 +9,10 @@ var e = {
|
|
|
9
9
|
quantity: "Quantity",
|
|
10
10
|
price: "Price",
|
|
11
11
|
amount: "Amount",
|
|
12
|
+
currencySymbol: "$",
|
|
13
|
+
discount: "Discounts",
|
|
14
|
+
tax: "Tax",
|
|
15
|
+
totalAmount: "Total amount",
|
|
12
16
|
addLineItem: "+ Add line item",
|
|
13
17
|
increaseQuantity: (e) => `Increase quantity — line item ${e}`,
|
|
14
18
|
decreaseQuantity: (e) => `Decrease quantity — line item ${e}`,
|