@tesouro/embedded-components-react 0.11.179 → 0.11.181
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/index.css +22 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index.js +24 -23
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index10.js +16 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index11.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index12.js +5 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index13.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index14.js +4 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index15.js +13 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index16.js +34 -19
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index17.js +23 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index18.js +26 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index19.js +12 -57
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index2.js +34 -85
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index20.js +48 -29
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index21.js +36 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index22.js +20 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index23.js +14 -37
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index24.js +31 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index25.js +26 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index26.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index3.js +90 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index4.js +30 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index5.js +8 -74
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index6.js +60 -19
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index7.js +6 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index8.js +12 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index9.js +20 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index10.js +17 -36
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index11.js +42 -54
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index12.js +89 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index13.js +5 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js +15 -92
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index15.js +103 -10
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index16.js +10 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index17.js +8 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index18.js +7 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index19.js +11 -29
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index20.js +24 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js +22 -14
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +14 -137
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index23.js +139 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +12 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +15 -32
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js +39 -108
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +96 -80
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index28.js +94 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js +4 -57
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index30.js +56 -116
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +114 -197
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +194 -75
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +75 -67
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js +69 -111
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +108 -459
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +450 -102
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +117 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +8 -85
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +73 -67
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +71 -246
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +251 -40
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +38 -237
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js +244 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +21 -529
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +530 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +4 -44
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +41 -242
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +245 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index49.js +3 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index50.js +4 -63
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index51.js +64 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index52.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index9.js +6 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index3.js +7 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index10.js +14 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index11.js +82 -13
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index12.js +47 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index13.js +261 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index14.js +23 -251
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index15.js +450 -25
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +286 -442
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +4 -300
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index18.js +5 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index19.js +37 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index20.js +1 -38
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index5.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index7.js +88 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index8.js +17 -89
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index9.js +18 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index10.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +263 -262
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/invalidatePayableQueries/approvalDecisionQueries.js +22 -19
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/invalidatePayableQueries/invalidatePayableQueries.js +20 -20
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/queryKeys.js +32 -21
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/mocks/labels.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/index.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +42 -42
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +237 -215
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +151 -135
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +7 -5
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/AttentionStrip/AttentionStrip.js +29 -0
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/AttentionStrip/AttentionViewBar.js +33 -0
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index21.js +0 -1
|
@@ -1,22 +1,245 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { BILL_CREATE_MESSAGE_LABELS_EN as e } from "./index32.js";
|
|
6
|
+
import { calculateTotal as t, displayLineAmount as n, normalizeMoneyOnBlur as r, parseMoneyToMinorUnits as i, parseQuantity as a } from "./index39.js";
|
|
7
|
+
import { validateBillTotals as o } from "./index40.js";
|
|
8
|
+
import { emptyLineItem as s, mapPayableToBillForm as c } from "./index42.js";
|
|
9
|
+
import { useCallback as l, useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
1
10
|
// ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
11
|
+
var m = /^[0-9.,-]+$/;
|
|
12
|
+
function h(e) {
|
|
13
|
+
let t = e.trim().replace(/^\$\s*/, "");
|
|
14
|
+
return t ? m.test(t) ? t : null : "";
|
|
15
|
+
}
|
|
16
|
+
var g = [
|
|
17
|
+
"quantity",
|
|
18
|
+
"price",
|
|
19
|
+
"amount"
|
|
20
|
+
];
|
|
21
|
+
function _(e) {
|
|
22
|
+
let t = e.trim(), n = /[.,]$/.test(t) ? t.slice(0, -1) : t;
|
|
23
|
+
return t && !n ? null : n;
|
|
24
|
+
}
|
|
25
|
+
function v(e, t, n) {
|
|
26
|
+
if (t === void 0) return;
|
|
27
|
+
let r = _(t);
|
|
28
|
+
if (r !== null) return o(e === "discount" ? r : "", e === "tax" ? r : "", e === "total" ? r : void 0, n)?.[e];
|
|
29
|
+
}
|
|
30
|
+
function y(e, t) {
|
|
31
|
+
let n = {}, r = {
|
|
32
|
+
price: null,
|
|
33
|
+
amount: null
|
|
34
|
+
};
|
|
35
|
+
for (let a of ["price", "amount"]) {
|
|
36
|
+
let o = _(e[a]);
|
|
37
|
+
o !== null && (r[a] = i(o), o && r[a] === null && (n[a] = t.unreadableMoney));
|
|
38
|
+
}
|
|
39
|
+
let o = _(e.quantity);
|
|
40
|
+
if (o !== null) {
|
|
41
|
+
let e = r.price !== null || r.amount !== null;
|
|
42
|
+
a(o) === null && (o || e) && (n.quantity = t.unusableQuantity);
|
|
43
|
+
}
|
|
44
|
+
return n;
|
|
45
|
+
}
|
|
46
|
+
function b(e, t, r) {
|
|
47
|
+
return i(t) === null ? r : n(e, t);
|
|
48
|
+
}
|
|
49
|
+
function x({ payable: n, lineItems: i, labels: a = e } = {}) {
|
|
50
|
+
let o = d(() => c({
|
|
51
|
+
payable: n ?? {},
|
|
52
|
+
lineItems: i ?? []
|
|
53
|
+
}), [n, i]), [m, _] = p(o.values), [x, S] = p(o.lineItems), [C, w] = p(o.discount), [T, E] = p(o.tax), [D, O] = p(o.total || void 0), [ee, k] = p(), A = f(void 0), te = l((e) => {
|
|
54
|
+
k((t) => {
|
|
55
|
+
let n = typeof e == "function" ? e(t) : e;
|
|
56
|
+
return n?.form !== A.current && (A.current = void 0), n;
|
|
57
|
+
});
|
|
58
|
+
}, []), ne = l((e) => {
|
|
59
|
+
A.current = e, k((t) => ({
|
|
60
|
+
...t,
|
|
61
|
+
form: e
|
|
62
|
+
}));
|
|
63
|
+
}, []), j = l(() => {
|
|
64
|
+
k((e) => {
|
|
65
|
+
if (!e?.form || e.form !== A.current) return e;
|
|
66
|
+
A.current = void 0;
|
|
67
|
+
let t = { ...e };
|
|
68
|
+
return delete t.form, Object.keys(t).length ? t : void 0;
|
|
69
|
+
});
|
|
70
|
+
}, []), [re, M] = p(), [N, P] = p(), [F, I] = p(!1), [L, R] = p(!1), [z, B] = p(!1);
|
|
71
|
+
u(() => {
|
|
72
|
+
F || _(o.values);
|
|
73
|
+
}, [o]), u(() => {
|
|
74
|
+
L || S(o.lineItems);
|
|
75
|
+
}, [o]), u(() => {
|
|
76
|
+
z || (w(o.discount), E(o.tax), O(o.total || void 0));
|
|
77
|
+
}, [o]);
|
|
78
|
+
let ie = l((e) => {
|
|
79
|
+
_((t) => ({
|
|
80
|
+
...t,
|
|
81
|
+
...e
|
|
82
|
+
})), I(!0), k((t) => {
|
|
83
|
+
if (!t) return t;
|
|
84
|
+
let n = { ...t };
|
|
85
|
+
for (let t of Object.keys(e)) delete n[t];
|
|
86
|
+
return Object.keys(n).length ? n : void 0;
|
|
87
|
+
}), j();
|
|
88
|
+
}, [j]), V = l((e, t) => {
|
|
89
|
+
M((n) => {
|
|
90
|
+
if (!n?.[e] && !t) return n;
|
|
91
|
+
let r = {
|
|
92
|
+
...n,
|
|
93
|
+
[e]: t
|
|
94
|
+
};
|
|
95
|
+
return t || delete r[e], Object.keys(r).length ? r : void 0;
|
|
96
|
+
});
|
|
97
|
+
}, []), H = l((e, t) => {
|
|
98
|
+
V(e, v(e, t, a));
|
|
99
|
+
}, [a, V]), U = l(() => {
|
|
100
|
+
O(void 0), H("total", void 0), j();
|
|
101
|
+
}, [H, j]), W = l((e, t = []) => {
|
|
102
|
+
let n = y(e, a);
|
|
103
|
+
P((r) => {
|
|
104
|
+
let i = r?.[e.id], a = { ...i };
|
|
105
|
+
for (let e of [
|
|
106
|
+
"price",
|
|
107
|
+
"amount",
|
|
108
|
+
"quantity"
|
|
109
|
+
]) n[e] ? a[e] = n[e] : delete a[e];
|
|
110
|
+
t.includes("description") && delete a.description;
|
|
111
|
+
let o = Object.keys(a).length > 0;
|
|
112
|
+
if (!i && !o) return r;
|
|
113
|
+
let s = { ...r };
|
|
114
|
+
return o ? s[e.id] = a : delete s[e.id], Object.keys(s).length ? s : void 0;
|
|
115
|
+
});
|
|
116
|
+
}, [a]), G = l((e, t, n) => {
|
|
117
|
+
P((r) => ({
|
|
118
|
+
...r,
|
|
119
|
+
[e]: {
|
|
120
|
+
...r?.[e],
|
|
121
|
+
[t]: n
|
|
122
|
+
}
|
|
123
|
+
}));
|
|
124
|
+
}, []), K = l((e, t, n = []) => {
|
|
125
|
+
let r = x.find((t) => t.id === e);
|
|
126
|
+
if (!r) return;
|
|
127
|
+
let i = t(r);
|
|
128
|
+
S(x.map((t) => t.id === e ? i : t)), W(i, n), R(!0), U();
|
|
129
|
+
}, [
|
|
130
|
+
U,
|
|
131
|
+
x,
|
|
132
|
+
W
|
|
133
|
+
]), q = l((e, t) => {
|
|
134
|
+
let n = { ...t };
|
|
135
|
+
for (let r of g) {
|
|
136
|
+
let i = t[r];
|
|
137
|
+
if (i === void 0) continue;
|
|
138
|
+
let o = h(i);
|
|
139
|
+
if (o === null) {
|
|
140
|
+
G(e, r, a.numbersOnly);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
n[r] = o;
|
|
144
|
+
}
|
|
145
|
+
K(e, (e) => {
|
|
146
|
+
let t = {
|
|
147
|
+
...e,
|
|
148
|
+
...n
|
|
149
|
+
};
|
|
150
|
+
return "amount" in n ? t : {
|
|
151
|
+
...t,
|
|
152
|
+
amount: b(t.quantity, t.price, t.amount)
|
|
153
|
+
};
|
|
154
|
+
}, Object.keys(n));
|
|
155
|
+
}, [
|
|
156
|
+
K,
|
|
157
|
+
a,
|
|
158
|
+
G
|
|
159
|
+
]), J = l((e, t) => {
|
|
160
|
+
S((n) => n.map((n) => n.id === e ? {
|
|
161
|
+
...n,
|
|
162
|
+
[t]: r(n[t])
|
|
163
|
+
} : n));
|
|
164
|
+
}, []), Y = l((e, t) => {
|
|
165
|
+
K(e, (e) => {
|
|
166
|
+
let n = Number.parseFloat(e.quantity), r = String(Math.max(1, (Number.isFinite(n) ? n : 0) + t));
|
|
167
|
+
return {
|
|
168
|
+
...e,
|
|
169
|
+
quantity: r,
|
|
170
|
+
amount: b(r, e.price, e.amount)
|
|
171
|
+
};
|
|
172
|
+
});
|
|
173
|
+
}, [K]), X = l((e) => {
|
|
174
|
+
P((t) => {
|
|
175
|
+
if (!t?.[e]) return t;
|
|
176
|
+
let n = { ...t };
|
|
177
|
+
return delete n[e], Object.keys(n).length ? n : void 0;
|
|
178
|
+
});
|
|
179
|
+
}, []), Z = l((e) => {
|
|
180
|
+
X(e), S((t) => t.length <= 1 ? t : t.filter((t) => t.id !== e)), R(!0), U();
|
|
181
|
+
}, [X, U]), ae = l(() => {
|
|
182
|
+
S((e) => [...e, s()]), R(!0), U();
|
|
183
|
+
}, [U]), Q = l((e, t, n) => {
|
|
184
|
+
let r = h(t);
|
|
185
|
+
r === null ? V(e, a.numbersOnly) : (n(r), B(!0), U(), H(e, r));
|
|
186
|
+
}, [
|
|
187
|
+
U,
|
|
188
|
+
a,
|
|
189
|
+
H,
|
|
190
|
+
V
|
|
191
|
+
]), oe = l((e) => Q("discount", e, w), [Q]), se = l((e) => Q("tax", e, E), [Q]), $ = l(() => w((e) => r(e)), []), ce = l(() => E((e) => r(e)), []), le = l((e) => {
|
|
192
|
+
let t = h(e);
|
|
193
|
+
t === null ? V("total", a.numbersOnly) : (O(t), B(!0), H("total", t), j());
|
|
194
|
+
}, [
|
|
195
|
+
j,
|
|
196
|
+
a,
|
|
197
|
+
H,
|
|
198
|
+
V
|
|
199
|
+
]), ue = l(() => {
|
|
200
|
+
O((e) => e === void 0 ? e : r(e));
|
|
201
|
+
}, []), de = d(() => x.map((e) => ({
|
|
202
|
+
...e,
|
|
203
|
+
onChange: (t) => q(e.id, t),
|
|
204
|
+
onBlur: (t) => J(e.id, t),
|
|
205
|
+
onQuantityStep: (t) => Y(e.id, t),
|
|
206
|
+
onRemove: () => Z(e.id)
|
|
207
|
+
})), [
|
|
208
|
+
J,
|
|
209
|
+
x,
|
|
210
|
+
q,
|
|
211
|
+
Z,
|
|
212
|
+
Y
|
|
213
|
+
]), fe = d(() => t(x, T, C), [
|
|
214
|
+
x,
|
|
215
|
+
T,
|
|
216
|
+
C
|
|
217
|
+
]);
|
|
218
|
+
return {
|
|
219
|
+
values: m,
|
|
220
|
+
errors: ee,
|
|
221
|
+
setErrors: te,
|
|
222
|
+
setSaveFailureMessage: ne,
|
|
223
|
+
lineItemErrors: N,
|
|
224
|
+
setLineItemErrors: P,
|
|
225
|
+
totalsErrors: re,
|
|
226
|
+
setTotalsErrors: M,
|
|
227
|
+
onChange: ie,
|
|
228
|
+
lineItems: x,
|
|
229
|
+
lineItemRows: de,
|
|
230
|
+
discount: C,
|
|
231
|
+
onDiscountChange: oe,
|
|
232
|
+
onDiscountBlur: $,
|
|
233
|
+
tax: T,
|
|
234
|
+
onTaxChange: se,
|
|
235
|
+
onTaxBlur: ce,
|
|
236
|
+
total: D ?? fe,
|
|
237
|
+
totalOverride: D,
|
|
238
|
+
onTotalChange: le,
|
|
239
|
+
onTotalBlur: ue,
|
|
240
|
+
onAddLineItem: ae,
|
|
241
|
+
isTotalsDirty: z,
|
|
242
|
+
isDirty: F || L || z
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
export { x as useBillForm };
|