@tesouro/embedded-components-react 0.5.135 → 0.5.136
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/feature/dist/index48.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +36 -16
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -33,6 +33,8 @@ var y = {
|
|
|
33
33
|
unreadableTotal: "Enter a valid total amount.",
|
|
34
34
|
totalNotGreaterThanZero: "Total amount must be greater than $0.",
|
|
35
35
|
poNumberTooLong: "PO number must be 255 characters or fewer.",
|
|
36
|
+
implausibleInvoiceDate: "Enter an invoice date within the last 10 years, no more than 30 days from today.",
|
|
37
|
+
implausibleDueDate: "Enter a due date within the last 10 years and next 5 years.",
|
|
36
38
|
dueBeforeInvoiceDate: "Due date must be on or after the invoice date."
|
|
37
39
|
}, b = {
|
|
38
40
|
paymentInstructionsValue: (e) => `Account ending in ${e}`,
|
|
@@ -1,16 +1,36 @@
|
|
|
1
1
|
import { BILL_CREATE_MESSAGE_LABELS_EN as e } from "./index48.js";
|
|
2
2
|
import { isPersistableLineItem as t, parseMoneyToMinorUnits as n, parseQuantity as r } from "./index54.js";
|
|
3
3
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js
|
|
4
|
-
var i = /^(?:\d{1,3}(?:,\d{3})+(?:\.\d+)?|\d+(?:\.\d+)?|\.\d+)$/, a = 255;
|
|
5
|
-
function
|
|
4
|
+
var i = /^(?:\d{1,3}(?:,\d{3})+(?:\.\d+)?|\d+(?:\.\d+)?|\.\d+)$/, a = 255, o = 10, s = 5, c = 30, l = 864e5;
|
|
5
|
+
function u() {
|
|
6
|
+
let e = /* @__PURE__ */ new Date();
|
|
7
|
+
return Date.UTC(e.getFullYear(), e.getMonth(), e.getDate());
|
|
8
|
+
}
|
|
9
|
+
function d() {
|
|
10
|
+
let e = new Date(u());
|
|
11
|
+
return e.setUTCFullYear(e.getUTCFullYear() - o), e;
|
|
12
|
+
}
|
|
13
|
+
function f(e) {
|
|
14
|
+
let t = new Date(e);
|
|
15
|
+
if (Number.isNaN(t.getTime())) return !1;
|
|
16
|
+
let n = new Date(u() + c * l);
|
|
17
|
+
return t < d() || t > n;
|
|
18
|
+
}
|
|
19
|
+
function p(e) {
|
|
20
|
+
let t = new Date(e);
|
|
21
|
+
if (Number.isNaN(t.getTime())) return !1;
|
|
22
|
+
let n = new Date(u());
|
|
23
|
+
return n.setUTCFullYear(n.getUTCFullYear() + s), t < d() || t > n;
|
|
24
|
+
}
|
|
25
|
+
function m(t, n = e) {
|
|
6
26
|
let r = {};
|
|
7
27
|
return t.poNumber.length > a && (r.poNumber = n.poNumberTooLong), Object.keys(r).length ? r : void 0;
|
|
8
28
|
}
|
|
9
|
-
function
|
|
29
|
+
function h(e) {
|
|
10
30
|
let t = e.trim();
|
|
11
31
|
return !t || n(t) !== null ? !0 : i.test(t) ? Number(t.replaceAll(",", "")) === 0 : !1;
|
|
12
32
|
}
|
|
13
|
-
function
|
|
33
|
+
function g(t, i = e) {
|
|
14
34
|
let a = {};
|
|
15
35
|
for (let e of t) {
|
|
16
36
|
let t = n(e.price), o = n(e.amount), s = {};
|
|
@@ -18,11 +38,11 @@ function c(t, i = e) {
|
|
|
18
38
|
}
|
|
19
39
|
return Object.keys(a).length ? a : void 0;
|
|
20
40
|
}
|
|
21
|
-
function
|
|
41
|
+
function _(i, a, o, s = e) {
|
|
22
42
|
let c = {};
|
|
23
43
|
a || (c.vendor = s.requiredField), i.invoiceNumber.trim() || (c.invoiceNumber = s.requiredField);
|
|
24
44
|
let l = i.invoiceDate.trim(), u = i.dueDate.trim();
|
|
25
|
-
l
|
|
45
|
+
l ? f(l) && (c.invoiceDate = s.implausibleInvoiceDate) : c.invoiceDate = s.requiredField, u ? p(u) ? c.dueDate = s.implausibleDueDate : l && u < l && (c.dueDate = s.dueBeforeInvoiceDate) : c.dueDate = s.requiredField;
|
|
26
46
|
let d = {};
|
|
27
47
|
return o.forEach((e, i) => {
|
|
28
48
|
if (i > 0 && !t(e)) return;
|
|
@@ -33,31 +53,31 @@ function l(i, a, o, s = e) {
|
|
|
33
53
|
lineItemErrors: Object.keys(d).length ? d : void 0
|
|
34
54
|
};
|
|
35
55
|
}
|
|
36
|
-
function
|
|
56
|
+
function v(e) {
|
|
37
57
|
let t = e.trim();
|
|
38
58
|
if (!t) return !0;
|
|
39
59
|
let n = t.startsWith("-") ? t.slice(1) : t;
|
|
40
60
|
return i.test(n) ? Number(t.replaceAll(",", "")) <= 0 : !1;
|
|
41
61
|
}
|
|
42
|
-
function
|
|
43
|
-
if (n(e) === null) return
|
|
62
|
+
function y(e, t) {
|
|
63
|
+
if (n(e) === null) return v(e) ? t.totalNotGreaterThanZero : t.unreadableTotal;
|
|
44
64
|
}
|
|
45
|
-
function
|
|
46
|
-
let r =
|
|
65
|
+
function b(t, n = e) {
|
|
66
|
+
let r = y(t, n);
|
|
47
67
|
return r ? { total: r } : void 0;
|
|
48
68
|
}
|
|
49
|
-
function
|
|
69
|
+
function x(t, r = e) {
|
|
50
70
|
if (t === void 0) return;
|
|
51
71
|
let i = n(t);
|
|
52
72
|
if (i !== null) return i > 0 ? void 0 : { total: r.totalNotGreaterThanZero };
|
|
53
73
|
}
|
|
54
|
-
function
|
|
74
|
+
function S(t, n, r, i = e) {
|
|
55
75
|
let a = {};
|
|
56
|
-
if (
|
|
57
|
-
let e =
|
|
76
|
+
if (h(t) || (a.discount = i.unreadableDiscount), h(n) || (a.tax = i.unreadableTax), r !== void 0) {
|
|
77
|
+
let e = y(r, i);
|
|
58
78
|
e && (a.total = e);
|
|
59
79
|
}
|
|
60
80
|
return Object.keys(a).length ? a : void 0;
|
|
61
81
|
}
|
|
62
82
|
//#endregion
|
|
63
|
-
export {
|
|
83
|
+
export { h as isReadableMoneyOrZero, _ as validateBillCompleteness, b as validateBillTotalIsPayable, S as validateBillTotals, m as validateBillValues, g as validateLineItems, x as validateStoredAmountDue };
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.5.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.5.136", n = "f26328360dc7183776dc20419d620482d87cc099", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|