@tesouro/embedded-components-react 0.5.47 → 0.5.49
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 +56 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +30 -17
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +87 -81
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index3.js +12 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +242 -210
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -2460,6 +2460,12 @@
|
|
|
2460
2460
|
.ttw\:bg-background {
|
|
2461
2461
|
background-color: var(--ttw-background);
|
|
2462
2462
|
}
|
|
2463
|
+
.ttw\:bg-background\/85 {
|
|
2464
|
+
background-color: var(--ttw-background);
|
|
2465
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
2466
|
+
background-color: color-mix(in oklab, var(--ttw-background) 85%, transparent);
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2463
2469
|
.ttw\:bg-black {
|
|
2464
2470
|
background-color: var(--ttw-color-black);
|
|
2465
2471
|
}
|
|
@@ -3794,6 +3800,11 @@
|
|
|
3794
3800
|
--tw-blur: blur(var(--ttw-blur-md));
|
|
3795
3801
|
filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
|
|
3796
3802
|
}
|
|
3803
|
+
.ttw\:backdrop-blur-\[1px\] {
|
|
3804
|
+
--tw-backdrop-blur: blur(1px);
|
|
3805
|
+
-webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
|
|
3806
|
+
backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
|
|
3807
|
+
}
|
|
3797
3808
|
.ttw\:transition {
|
|
3798
3809
|
transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events;
|
|
3799
3810
|
transition-timing-function: var(--tw-ease, var(--ttw-default-transition-timing-function));
|
|
@@ -6908,6 +6919,42 @@
|
|
|
6908
6919
|
syntax: "*";
|
|
6909
6920
|
inherits: false;
|
|
6910
6921
|
}
|
|
6922
|
+
@property --tw-backdrop-blur {
|
|
6923
|
+
syntax: "*";
|
|
6924
|
+
inherits: false;
|
|
6925
|
+
}
|
|
6926
|
+
@property --tw-backdrop-brightness {
|
|
6927
|
+
syntax: "*";
|
|
6928
|
+
inherits: false;
|
|
6929
|
+
}
|
|
6930
|
+
@property --tw-backdrop-contrast {
|
|
6931
|
+
syntax: "*";
|
|
6932
|
+
inherits: false;
|
|
6933
|
+
}
|
|
6934
|
+
@property --tw-backdrop-grayscale {
|
|
6935
|
+
syntax: "*";
|
|
6936
|
+
inherits: false;
|
|
6937
|
+
}
|
|
6938
|
+
@property --tw-backdrop-hue-rotate {
|
|
6939
|
+
syntax: "*";
|
|
6940
|
+
inherits: false;
|
|
6941
|
+
}
|
|
6942
|
+
@property --tw-backdrop-invert {
|
|
6943
|
+
syntax: "*";
|
|
6944
|
+
inherits: false;
|
|
6945
|
+
}
|
|
6946
|
+
@property --tw-backdrop-opacity {
|
|
6947
|
+
syntax: "*";
|
|
6948
|
+
inherits: false;
|
|
6949
|
+
}
|
|
6950
|
+
@property --tw-backdrop-saturate {
|
|
6951
|
+
syntax: "*";
|
|
6952
|
+
inherits: false;
|
|
6953
|
+
}
|
|
6954
|
+
@property --tw-backdrop-sepia {
|
|
6955
|
+
syntax: "*";
|
|
6956
|
+
inherits: false;
|
|
6957
|
+
}
|
|
6911
6958
|
@property --tw-duration {
|
|
6912
6959
|
syntax: "*";
|
|
6913
6960
|
inherits: false;
|
|
@@ -7025,6 +7072,15 @@
|
|
|
7025
7072
|
--tw-drop-shadow-color: initial;
|
|
7026
7073
|
--tw-drop-shadow-alpha: 100%;
|
|
7027
7074
|
--tw-drop-shadow-size: initial;
|
|
7075
|
+
--tw-backdrop-blur: initial;
|
|
7076
|
+
--tw-backdrop-brightness: initial;
|
|
7077
|
+
--tw-backdrop-contrast: initial;
|
|
7078
|
+
--tw-backdrop-grayscale: initial;
|
|
7079
|
+
--tw-backdrop-hue-rotate: initial;
|
|
7080
|
+
--tw-backdrop-invert: initial;
|
|
7081
|
+
--tw-backdrop-opacity: initial;
|
|
7082
|
+
--tw-backdrop-saturate: initial;
|
|
7083
|
+
--tw-backdrop-sepia: initial;
|
|
7028
7084
|
--tw-duration: initial;
|
|
7029
7085
|
--tw-ease: initial;
|
|
7030
7086
|
--tw-content: "";
|
|
@@ -24,26 +24,39 @@ function o(e) {
|
|
|
24
24
|
function s(e) {
|
|
25
25
|
return (e / 100).toFixed(2);
|
|
26
26
|
}
|
|
27
|
-
function c({ values: e, initialLineItems: r, counterpartId: i, clearCounterpart: a, counterpartBankAccountId: o, editedTotals: s, currentTotals: c, lineItems: d, document: f }) {
|
|
28
|
-
let
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
function c({ values: e, initialLineItems: r, counterpartId: i, clearCounterpart: a, counterpartBankAccountId: o, editedTotals: s, currentTotals: c, lineItems: d, document: f, includeBlankPoNumber: p = !0 }) {
|
|
28
|
+
let m = { currency: t };
|
|
29
|
+
i ? m.counterpart_id = i : a && (m.counterpart_id = null), i ? m.counterpart_bank_account_id = o ?? null : a && (m.counterpart_bank_account_id = null), e.invoiceNumber && (m.document_id = e.invoiceNumber), e.invoiceDate && (m.issued_at = e.invoiceDate), e.dueDate && (m.due_date = e.dueDate);
|
|
30
|
+
let h = e.poNumber.trim();
|
|
31
|
+
if ((h || p) && (m.purchase_order_number = h || null), f && (m.base64_encoded_file = f.base64EncodedFile, m.file_name = f.fileName), s && (m.discount = n(s.discount) ?? 0, m.tax_amount = n(s.tax) ?? 0, s.total !== void 0 && (m.total_amount = (n(s.total) ?? 0) + (n(s.discount) ?? 0))), c && d) {
|
|
32
|
+
let e = u(d), t = n(c.tax) ?? 0, r = n(c.discount) ?? 0, i = c.total === void 0 ? (e ?? 0) + t : (n(c.total) ?? 0) + r;
|
|
33
|
+
e !== void 0 && (m.subtotal = e), m.tax_amount = t, m.total_amount = i;
|
|
34
|
+
} else if (r && !("total_amount" in m)) {
|
|
33
35
|
let e = l(r, s?.tax);
|
|
34
|
-
e !== void 0 && (
|
|
36
|
+
e !== void 0 && (m.total_amount = e);
|
|
35
37
|
}
|
|
36
|
-
return
|
|
38
|
+
return m;
|
|
37
39
|
}
|
|
38
40
|
function l(e, t) {
|
|
39
|
-
let r =
|
|
40
|
-
|
|
41
|
-
let a = n(t.amount);
|
|
42
|
-
return a === null ? e : (r = !0, e + a);
|
|
43
|
-
}, 0);
|
|
44
|
-
if (r) return a + (t ? n(t) ?? 0 : 0);
|
|
41
|
+
let r = u(e);
|
|
42
|
+
if (r !== void 0) return r + (t ? n(t) ?? 0 : 0);
|
|
45
43
|
}
|
|
46
44
|
function u(e) {
|
|
45
|
+
let t = !1, r = e.reduce((e, r) => {
|
|
46
|
+
if (!i(r)) return e;
|
|
47
|
+
let a = n(r.amount);
|
|
48
|
+
return a === null ? e : (t = !0, e + a);
|
|
49
|
+
}, 0);
|
|
50
|
+
if (t) return r;
|
|
51
|
+
}
|
|
52
|
+
function d({ lineItems: e, editedTotals: t }) {
|
|
53
|
+
let r = u(e), i = n(t.tax) ?? 0, a = n(t.discount) ?? 0, o = {
|
|
54
|
+
discount: a,
|
|
55
|
+
tax_amount: i
|
|
56
|
+
};
|
|
57
|
+
return r !== void 0 && (o.subtotal = r), t.total === void 0 ? r !== void 0 && (o.total_amount = r + i) : o.total_amount = (n(t.total) ?? 0) + a, o;
|
|
58
|
+
}
|
|
59
|
+
function f(e) {
|
|
47
60
|
return e.filter(i).map((e) => {
|
|
48
61
|
let t = n(e.amount), i = r(e.quantity) ?? 1, a = n(e.price) ?? (t === null ? 0 : Math.round(t / i)), o = Math.round(i * a), s = t ?? o;
|
|
49
62
|
return {
|
|
@@ -58,11 +71,11 @@ function u(e) {
|
|
|
58
71
|
};
|
|
59
72
|
});
|
|
60
73
|
}
|
|
61
|
-
function
|
|
74
|
+
function p(e, t) {
|
|
62
75
|
return s(Math.round(o(e) * a(t)));
|
|
63
76
|
}
|
|
64
|
-
function
|
|
77
|
+
function m(e, t, n) {
|
|
65
78
|
return s(e.reduce((e, t) => e + a(t.amount), 0) + a(t) - a(n));
|
|
66
79
|
}
|
|
67
80
|
//#endregion
|
|
68
|
-
export {
|
|
81
|
+
export { m as calculateTotal, p as displayLineAmount, i as isPersistableLineItem, c as mapBillFormToPayload, f as mapLineItemsToPayload, d as mapPayableAmountFieldsToPayload, n as parseMoneyToMinorUnits, r as parseQuantity };
|
|
@@ -10,8 +10,8 @@ import { useCreatePayableMutation as r, useDeletePayableFileMutation as i, useSu
|
|
|
10
10
|
import "../../data-access/dist/index.js";
|
|
11
11
|
import { BILL_CREATE_MESSAGE_LABELS_EN as c } from "./index49.js";
|
|
12
12
|
import { encodeFileToBase64 as l } from "./index54.js";
|
|
13
|
-
import { mapBillFormToPayload as u, mapLineItemsToPayload as ee } from "./index55.js";
|
|
14
|
-
import { validateBillCompleteness as
|
|
13
|
+
import { mapBillFormToPayload as u, mapLineItemsToPayload as d, mapPayableAmountFieldsToPayload as ee } from "./index55.js";
|
|
14
|
+
import { validateBillCompleteness as f, validateBillTotalIsPayable as te, validateBillTotals as ne, validateBillValues as p, validateLineItems as m, validateStoredAmountDue as re } from "./index56.js";
|
|
15
15
|
import { useCallback as h, useRef as g, useState as _ } from "react";
|
|
16
16
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js
|
|
17
17
|
var v = {
|
|
@@ -24,7 +24,7 @@ var v = {
|
|
|
24
24
|
function b(e) {
|
|
25
25
|
return e.type === "type_error.none.not_allowed" || e.msg === "none is not an allowed value";
|
|
26
26
|
}
|
|
27
|
-
var
|
|
27
|
+
var ie = "pending-vendor";
|
|
28
28
|
function x(e) {
|
|
29
29
|
return !!t(e)?.includes("line_items_enabled");
|
|
30
30
|
}
|
|
@@ -39,7 +39,7 @@ function S(e, t = c) {
|
|
|
39
39
|
totalsErrors: Object.keys(r).length ? r : void 0
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function ae(e, t) {
|
|
43
43
|
if (!e && !t) return;
|
|
44
44
|
let n = {}, r = /* @__PURE__ */ new Set([...Object.keys(e ?? {}), ...Object.keys(t ?? {})]);
|
|
45
45
|
for (let i of r) n[i] = {
|
|
@@ -48,176 +48,182 @@ function C(e, t) {
|
|
|
48
48
|
};
|
|
49
49
|
return n;
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
let
|
|
51
|
+
function C({ payableId: t, form: v, counterpartId: y, isVendorPending: b, clearCounterpart: C, prepareVendorForSave: w, onSaved: T, onPayableCreated: E, readSavedStatus: D, onDraftSaved: O, onFinalized: k, labels: A }) {
|
|
52
|
+
let j = {
|
|
53
53
|
...c,
|
|
54
|
-
...
|
|
55
|
-
}, [
|
|
56
|
-
let t =
|
|
57
|
-
return v.setErrors(t), v.setLineItemErrors(n), v.setTotalsErrors(r), !t && !n && !r || (n && e.error(
|
|
54
|
+
...A
|
|
55
|
+
}, [M, N] = _(), P = t ?? M, [F, I] = _(), oe = h(() => I(void 0), []), [L, R] = _(!1), se = h(() => R(!0), []), [z, B] = _(), V = g(!1), [H, U] = _(0), W = h(() => U((e) => e + 1), []), G = r(), K = i(), q = o(), J = n(), Y = s(), X = a(), Z = h(() => v.isTotalsDirty ? ne(v.discount, v.tax, v.totalOverride, j) : void 0, [v, j]), Q = h(() => {
|
|
56
|
+
let t = p(v.values, j), n = m(v.lineItems, j), r = Z();
|
|
57
|
+
return v.setErrors(t), v.setLineItemErrors(n), v.setTotalsErrors(r), !t && !n && !r || (n && e.error(j.lineItemsNeedAttention), W(), !1);
|
|
58
58
|
}, [
|
|
59
59
|
v,
|
|
60
|
-
|
|
60
|
+
j,
|
|
61
61
|
W,
|
|
62
62
|
Z
|
|
63
63
|
]), $ = h(async (e, t) => {
|
|
64
|
-
let n = !
|
|
65
|
-
base64EncodedFile: await l(
|
|
66
|
-
fileName:
|
|
67
|
-
} : void 0, r =
|
|
64
|
+
let n = !P && F ? {
|
|
65
|
+
base64EncodedFile: await l(F),
|
|
66
|
+
fileName: F.name
|
|
67
|
+
} : void 0, r = v.isTotalsDirty ? {
|
|
68
|
+
discount: v.discount,
|
|
69
|
+
tax: v.tax,
|
|
70
|
+
total: v.totalOverride
|
|
71
|
+
} : void 0, i = u({
|
|
68
72
|
values: v.values,
|
|
69
|
-
initialLineItems:
|
|
73
|
+
initialLineItems: P ? void 0 : v.lineItems,
|
|
70
74
|
counterpartId: t ?? y,
|
|
71
|
-
clearCounterpart:
|
|
75
|
+
clearCounterpart: C,
|
|
72
76
|
counterpartBankAccountId: e,
|
|
73
|
-
editedTotals: v.isTotalsDirty ? {
|
|
74
|
-
discount: v.discount,
|
|
75
|
-
tax: v.tax,
|
|
76
|
-
total: v.totalOverride
|
|
77
|
-
} : void 0,
|
|
78
77
|
currentTotals: {
|
|
79
78
|
discount: v.discount,
|
|
80
79
|
tax: v.tax,
|
|
81
80
|
total: v.totalOverride
|
|
82
81
|
},
|
|
83
82
|
lineItems: v.lineItems,
|
|
83
|
+
editedTotals: r,
|
|
84
84
|
document: n
|
|
85
|
-
}),
|
|
86
|
-
if (
|
|
87
|
-
path: { payable_id:
|
|
88
|
-
body:
|
|
89
|
-
}) : (
|
|
90
|
-
if (
|
|
85
|
+
}), a = P;
|
|
86
|
+
if (a ? await q.mutateAsync({
|
|
87
|
+
path: { payable_id: a },
|
|
88
|
+
body: i
|
|
89
|
+
}) : (a = (await G.mutateAsync({ body: i }))?.id, a && (N(a), E?.(a), n && I(void 0))), !a) throw Error("Payable was created without an id");
|
|
90
|
+
if (L) {
|
|
91
91
|
try {
|
|
92
|
-
await K.mutateAsync({ path: { payable_id:
|
|
92
|
+
await K.mutateAsync({ path: { payable_id: a } });
|
|
93
93
|
} catch {}
|
|
94
|
-
|
|
94
|
+
R(!1);
|
|
95
95
|
}
|
|
96
96
|
return await J.mutateAsync({
|
|
97
|
-
path: { payable_id:
|
|
98
|
-
body: { data:
|
|
99
|
-
}),
|
|
97
|
+
path: { payable_id: a },
|
|
98
|
+
body: { data: d(v.lineItems) }
|
|
99
|
+
}), r && await q.mutateAsync({
|
|
100
|
+
path: { payable_id: a },
|
|
101
|
+
body: ee({
|
|
102
|
+
lineItems: v.lineItems,
|
|
103
|
+
editedTotals: r
|
|
104
|
+
})
|
|
105
|
+
}), a;
|
|
100
106
|
}, [
|
|
101
107
|
y,
|
|
102
|
-
|
|
108
|
+
C,
|
|
103
109
|
G,
|
|
104
110
|
K,
|
|
105
|
-
|
|
111
|
+
L,
|
|
106
112
|
v.discount,
|
|
107
113
|
v.isTotalsDirty,
|
|
108
114
|
v.lineItems,
|
|
109
115
|
v.tax,
|
|
110
116
|
v.totalOverride,
|
|
111
117
|
v.values,
|
|
112
|
-
|
|
113
|
-
|
|
118
|
+
E,
|
|
119
|
+
P,
|
|
114
120
|
J,
|
|
115
|
-
|
|
121
|
+
F,
|
|
116
122
|
q
|
|
117
|
-
]),
|
|
118
|
-
|
|
119
|
-
}, [K,
|
|
123
|
+
]), ce = h(async () => {
|
|
124
|
+
P && (await K.mutateAsync({ path: { payable_id: P } }), R(!1));
|
|
125
|
+
}, [K, P]);
|
|
120
126
|
return {
|
|
121
127
|
saveDraft: h(async () => {
|
|
122
|
-
if (!
|
|
123
|
-
|
|
128
|
+
if (!V.current && Q()) {
|
|
129
|
+
V.current = !0, B("draft");
|
|
124
130
|
try {
|
|
125
|
-
let t = await
|
|
131
|
+
let t = await w?.();
|
|
126
132
|
if (t && !t.ok) return;
|
|
127
133
|
let n = await $(t?.counterpartBankAccountId, t?.counterpartId);
|
|
128
|
-
v.setErrors(void 0),
|
|
129
|
-
let r = await
|
|
130
|
-
return e.success(r === "draft" ?
|
|
134
|
+
v.setErrors(void 0), T?.(n), O?.(n);
|
|
135
|
+
let r = await D?.();
|
|
136
|
+
return e.success(r === "draft" ? j.submittedDemoted : j.draftSaved), n;
|
|
131
137
|
} catch (e) {
|
|
132
|
-
v.setSaveFailureMessage(x(e) ?
|
|
138
|
+
v.setSaveFailureMessage(x(e) ? j.discountTaxBlockedByLineItems : j.saveFailed), W();
|
|
133
139
|
return;
|
|
134
140
|
} finally {
|
|
135
|
-
|
|
141
|
+
B(void 0), V.current = !1;
|
|
136
142
|
}
|
|
137
143
|
}
|
|
138
144
|
}, [
|
|
139
145
|
v,
|
|
140
146
|
Q,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
k,
|
|
146
|
-
E,
|
|
147
|
+
j.discountTaxBlockedByLineItems,
|
|
148
|
+
j.draftSaved,
|
|
149
|
+
j.saveFailed,
|
|
150
|
+
j.submittedDemoted,
|
|
147
151
|
O,
|
|
148
152
|
T,
|
|
153
|
+
D,
|
|
154
|
+
w,
|
|
149
155
|
$,
|
|
150
156
|
W
|
|
151
157
|
]),
|
|
152
158
|
finalize: h(async () => {
|
|
153
|
-
if (
|
|
154
|
-
let t =
|
|
159
|
+
if (V.current) return;
|
|
160
|
+
let t = m(v.lineItems, j), n = p(v.values, j), r = Z(), i = te(v.total, j), a = v.isTotalsDirty ? re(v.totalOverride, j) : void 0, o = r || i || a ? {
|
|
155
161
|
...a,
|
|
156
162
|
...i,
|
|
157
163
|
...r
|
|
158
|
-
} : void 0, { formErrors: s, lineItemErrors: c } =
|
|
164
|
+
} : void 0, { formErrors: s, lineItemErrors: c } = f(v.values, y ?? (b ? ie : void 0), v.lineItems, j), l = ae(c, t);
|
|
159
165
|
v.setLineItemErrors(l), v.setTotalsErrors(o);
|
|
160
166
|
let u = {
|
|
161
167
|
...s,
|
|
162
168
|
...n
|
|
163
169
|
};
|
|
164
|
-
if (v.setErrors(Object.keys(u).length ? u : void 0), t && e.error(
|
|
170
|
+
if (v.setErrors(Object.keys(u).length ? u : void 0), t && e.error(j.lineItemsNeedAttention), l || o || Object.keys(u).length) {
|
|
165
171
|
W();
|
|
166
172
|
return;
|
|
167
173
|
}
|
|
168
|
-
|
|
174
|
+
V.current = !0, B("finalize");
|
|
169
175
|
try {
|
|
170
176
|
let t;
|
|
171
177
|
try {
|
|
172
|
-
let e = await
|
|
178
|
+
let e = await w?.();
|
|
173
179
|
if (e && !e.ok) return;
|
|
174
180
|
t = await $(e?.counterpartBankAccountId, e?.counterpartId);
|
|
175
181
|
} catch (e) {
|
|
176
|
-
v.setSaveFailureMessage(x(e) ?
|
|
182
|
+
v.setSaveFailureMessage(x(e) ? j.discountTaxBlockedByLineItems : j.saveFailed), W();
|
|
177
183
|
return;
|
|
178
184
|
}
|
|
179
|
-
|
|
185
|
+
T?.(t);
|
|
180
186
|
try {
|
|
181
187
|
let n = await Y.mutateAsync({ path: { payable_id: t } });
|
|
182
188
|
if (n.validation_errors.length) {
|
|
183
|
-
let e = S(n.validation_errors,
|
|
189
|
+
let e = S(n.validation_errors, j);
|
|
184
190
|
v.setErrors(e.formErrors), v.setTotalsErrors(e.totalsErrors), W();
|
|
185
191
|
return;
|
|
186
192
|
}
|
|
187
|
-
await X.mutateAsync({ path: { payable_id: t } }), v.setErrors(void 0),
|
|
193
|
+
await X.mutateAsync({ path: { payable_id: t } }), v.setErrors(void 0), k?.(t), e.success(j.billFinalized);
|
|
188
194
|
} catch {
|
|
189
|
-
v.setSaveFailureMessage(
|
|
195
|
+
v.setSaveFailureMessage(j.finalizeFailed), W();
|
|
190
196
|
}
|
|
191
197
|
} finally {
|
|
192
|
-
|
|
198
|
+
B(void 0), V.current = !1;
|
|
193
199
|
}
|
|
194
200
|
}, [
|
|
195
201
|
y,
|
|
196
202
|
b,
|
|
197
203
|
v,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
E,
|
|
204
|
+
j,
|
|
205
|
+
k,
|
|
201
206
|
T,
|
|
207
|
+
w,
|
|
202
208
|
$,
|
|
203
209
|
W,
|
|
204
210
|
X,
|
|
205
211
|
Z,
|
|
206
212
|
Y
|
|
207
213
|
]),
|
|
208
|
-
payableId:
|
|
209
|
-
isSavingDraft:
|
|
210
|
-
isFinalizing:
|
|
211
|
-
stagedFile:
|
|
212
|
-
stageFile:
|
|
213
|
-
clearStagedFile:
|
|
214
|
-
scrollToErrorToken:
|
|
215
|
-
isFileDeletionPending:
|
|
216
|
-
requestFileDeletion:
|
|
217
|
-
detachFileNow:
|
|
214
|
+
payableId: P,
|
|
215
|
+
isSavingDraft: z === "draft",
|
|
216
|
+
isFinalizing: z === "finalize",
|
|
217
|
+
stagedFile: F,
|
|
218
|
+
stageFile: I,
|
|
219
|
+
clearStagedFile: oe,
|
|
220
|
+
scrollToErrorToken: H,
|
|
221
|
+
isFileDeletionPending: L,
|
|
222
|
+
requestFileDeletion: se,
|
|
223
|
+
detachFileNow: ce,
|
|
218
224
|
isDeletingFile: K.isPending,
|
|
219
225
|
hasFileDeletionFailed: K.isError
|
|
220
226
|
};
|
|
221
227
|
}
|
|
222
228
|
//#endregion
|
|
223
|
-
export { S as mapValidationErrorsToForm,
|
|
229
|
+
export { S as mapValidationErrorsToForm, C as useBillCreateController };
|
|
@@ -10,11 +10,15 @@ function u(e, t) {
|
|
|
10
10
|
let n = t.split(",").map((e) => e.trim()).filter(Boolean);
|
|
11
11
|
return n.length === 0 || n.some((t) => t.startsWith(".") ? e.name.toLowerCase().endsWith(t.toLowerCase()) : t.endsWith("/*") ? e.type.startsWith(t.slice(0, -1)) : e.type === t);
|
|
12
12
|
}
|
|
13
|
-
function d(
|
|
13
|
+
function d(e, t, n = !0) {
|
|
14
|
+
let r = e.filter((e) => u(e, t));
|
|
15
|
+
return n ? r : r.slice(0, 1);
|
|
16
|
+
}
|
|
17
|
+
function f({ status: u = "idle", errorMessage: f, accept: p = ".pdf,.png,.jpg,.jpeg", multiple: m = !0, maxFiles: h, onFilesSelected: g, testId: _, labels: v }) {
|
|
14
18
|
let y = {
|
|
15
19
|
...n,
|
|
16
20
|
...v
|
|
17
|
-
}, b = r(null), [x, S] = i(!1), C =
|
|
21
|
+
}, b = r(null), [x, S] = i(!1), C = u === "uploading";
|
|
18
22
|
return /* @__PURE__ */ s("div", {
|
|
19
23
|
className: "ttw:flex ttw:flex-col ttw:gap-2",
|
|
20
24
|
"data-testid": _,
|
|
@@ -32,8 +36,8 @@ function d({ status: d = "idle", errorMessage: f, accept: p = ".pdf,.png,.jpg,.j
|
|
|
32
36
|
},
|
|
33
37
|
onDrop: (e) => {
|
|
34
38
|
if (e.preventDefault(), S(!1), C) return;
|
|
35
|
-
let t = (e.dataTransfer.files ? Array.from(e.dataTransfer.files) : []
|
|
36
|
-
|
|
39
|
+
let t = d(e.dataTransfer.files ? Array.from(e.dataTransfer.files) : [], p, m);
|
|
40
|
+
t.length > 0 && g(t);
|
|
37
41
|
},
|
|
38
42
|
children: [C ? /* @__PURE__ */ o(c, { className: "ttw:size-5 ttw:animate-spin ttw:text-primary" }) : /* @__PURE__ */ o(l, { className: "ttw:size-5 ttw:text-muted-foreground" }), /* @__PURE__ */ s("span", {
|
|
39
43
|
className: "ttw:flex ttw:flex-col ttw:items-start",
|
|
@@ -62,13 +66,13 @@ function d({ status: d = "idle", errorMessage: f, accept: p = ".pdf,.png,.jpg,.j
|
|
|
62
66
|
"aria-label": y.fileInput,
|
|
63
67
|
className: "ttw:hidden",
|
|
64
68
|
onChange: (e) => {
|
|
65
|
-
let t = (e.target.files ? Array.from(e.target.files) : []
|
|
66
|
-
|
|
69
|
+
let t = d(e.target.files ? Array.from(e.target.files) : [], p, m);
|
|
70
|
+
t.length > 0 && g(t), e.target.value = "";
|
|
67
71
|
}
|
|
68
72
|
}),
|
|
69
|
-
|
|
73
|
+
u === "error" && f ? /* @__PURE__ */ o(t, { children: f }) : null
|
|
70
74
|
]
|
|
71
75
|
});
|
|
72
76
|
}
|
|
73
77
|
//#endregion
|
|
74
|
-
export {
|
|
78
|
+
export { f as BillUploadDropzone, f as default, d as getAcceptedBillUploadFiles };
|
|
@@ -2,375 +2,407 @@ import { Alert as e, AlertTitle as t, Button as n, DataTable as r, DataTableSort
|
|
|
2
2
|
import { EmptyState as d } from "../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
|
|
3
3
|
import { ErrorState as re } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
4
4
|
import "../../../shared/ui/dist/index.js";
|
|
5
|
+
import { getAcceptedBillUploadFiles as ie } from "./index3.js";
|
|
6
|
+
import "./index5.js";
|
|
5
7
|
import { AddBillPanel as f } from "./index7.js";
|
|
6
8
|
import "./index8.js";
|
|
7
|
-
import { BillStatusBadge as
|
|
9
|
+
import { BillStatusBadge as ae } from "./index19.js";
|
|
8
10
|
import "./index20.js";
|
|
9
|
-
import { DueDateValue as
|
|
11
|
+
import { DueDateValue as p } from "./index22.js";
|
|
10
12
|
import "./index23.js";
|
|
11
|
-
import { MissingValue as
|
|
13
|
+
import { MissingValue as m } from "./index59.js";
|
|
12
14
|
import "./index60.js";
|
|
13
15
|
import { NoValue as oe } from "./index62.js";
|
|
14
16
|
import "./index63.js";
|
|
15
|
-
import { BILLS_SCREEN_LABELS_EN as
|
|
17
|
+
import { BILLS_SCREEN_LABELS_EN as h, BILLS_SCREEN_UPLOAD_ACCEPT as g } from "./index64.js";
|
|
16
18
|
import { BillsFilterBar as se } from "./index79.js";
|
|
17
19
|
import "./index80.js";
|
|
18
|
-
import { BillColumn as
|
|
19
|
-
import { useMemo as
|
|
20
|
-
import { jsx as
|
|
21
|
-
import { ChevronRightIcon as
|
|
20
|
+
import { BillColumn as _ } from "./index81.js";
|
|
21
|
+
import { useMemo as v, useState as ce } from "react";
|
|
22
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
23
|
+
import { ChevronRightIcon as le, PaperclipIcon as ue, PlusIcon as de, SearchIcon as fe, SettingsIcon as pe, UploadIcon as me } from "lucide-react";
|
|
22
24
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js
|
|
23
|
-
var
|
|
25
|
+
var he = [
|
|
24
26
|
10,
|
|
25
27
|
25,
|
|
26
28
|
50,
|
|
27
29
|
100
|
|
28
|
-
],
|
|
30
|
+
], ge = 240, _e = {
|
|
29
31
|
default: "",
|
|
30
32
|
warning: "ttw:bg-amber-50 ttw:hover:bg-amber-100 ttw:border-l-4! ttw:border-l-amber-600!"
|
|
31
|
-
},
|
|
33
|
+
}, ve = {
|
|
32
34
|
default: "",
|
|
33
35
|
warning: "ttw:-ml-1 ttw:font-semibold ttw:text-amber-800"
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
],
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
36
|
+
}, x = 40, ye = [
|
|
37
|
+
_.Vendor,
|
|
38
|
+
_.Attachment,
|
|
39
|
+
_.IssueDate,
|
|
40
|
+
_.DueDate,
|
|
41
|
+
_.ScheduledDate,
|
|
42
|
+
_.PaidDate,
|
|
43
|
+
_.Status,
|
|
44
|
+
_.AmountDue,
|
|
45
|
+
_.AmountScheduled,
|
|
46
|
+
_.AmountPaid,
|
|
47
|
+
_.TotalAmount,
|
|
48
|
+
_.AddedOn
|
|
49
|
+
], S = [
|
|
50
|
+
_.Vendor,
|
|
51
|
+
_.Attachment,
|
|
52
|
+
_.DueDate,
|
|
53
|
+
_.Status,
|
|
54
|
+
_.AmountDue,
|
|
55
|
+
_.AddedOn
|
|
54
56
|
];
|
|
55
|
-
function
|
|
56
|
-
let
|
|
57
|
-
...
|
|
58
|
-
...
|
|
57
|
+
function C({ rows: C, isLoading: w, isError: T, sorting: be, onSortingChange: xe, pageSize: Se, onPageSizeChange: Ce, pageSizeOptions: we = he, pageInfo: Te, hasNextPage: Ee, hasPrevPage: E, onNextPage: D, onPrevPage: De, filterTabs: O, selectedFilterTabId: k, onFilterTabChange: Oe, searchValue: ke, onSearchChange: Ae, filters: A, visibleColumns: j = S, cellTestIds: M, isSearchActive: N, showAddPanelWhenEmpty: je, emptyState: P, onCreateClick: F, onSettingsClick: I, onRetry: L, onFilesSelected: R, maxFiles: z, onEnterManually: B, uploadStatus: V, uploadErrorMessage: H, emailAddress: U, onCopyEmail: W, labels: G, duplicateWarning: K, onReviewDuplicates: q }) {
|
|
58
|
+
let J = v(() => ({
|
|
59
|
+
...h,
|
|
60
|
+
...G,
|
|
59
61
|
statusBadge: {
|
|
60
|
-
...
|
|
61
|
-
...
|
|
62
|
+
...h.statusBadge,
|
|
63
|
+
...G?.statusBadge
|
|
62
64
|
},
|
|
63
65
|
addBill: {
|
|
64
|
-
...
|
|
65
|
-
...
|
|
66
|
+
...h.addBill,
|
|
67
|
+
...G?.addBill,
|
|
66
68
|
dropzone: {
|
|
67
|
-
...
|
|
68
|
-
...
|
|
69
|
+
...h.addBill.dropzone,
|
|
70
|
+
...G?.addBill?.dropzone
|
|
69
71
|
}
|
|
70
72
|
},
|
|
71
73
|
sortableHeader: {
|
|
72
|
-
...
|
|
73
|
-
...
|
|
74
|
+
...h.sortableHeader,
|
|
75
|
+
...G?.sortableHeader
|
|
74
76
|
},
|
|
75
77
|
missingValue: {
|
|
76
|
-
...
|
|
77
|
-
...
|
|
78
|
+
...h.missingValue,
|
|
79
|
+
...G?.missingValue
|
|
78
80
|
},
|
|
79
81
|
noValue: {
|
|
80
|
-
...
|
|
81
|
-
...
|
|
82
|
+
...h.noValue,
|
|
83
|
+
...G?.noValue
|
|
82
84
|
},
|
|
83
85
|
dueDate: {
|
|
84
|
-
...
|
|
85
|
-
...
|
|
86
|
+
...h.dueDate,
|
|
87
|
+
...G?.dueDate
|
|
86
88
|
}
|
|
87
|
-
}), [
|
|
89
|
+
}), [G]), [Me, Y] = ce(!1), X = !!R, Z = (e) => Array.from(e.dataTransfer.types).includes("Files"), Ne = (e) => {
|
|
90
|
+
!X || !Z(e) || (e.preventDefault(), Y(!0));
|
|
91
|
+
}, Pe = (e) => {
|
|
92
|
+
!X || !Z(e) || (e.preventDefault(), e.dataTransfer.dropEffect = "copy", Y(!0));
|
|
93
|
+
}, Fe = (e) => {
|
|
94
|
+
e.currentTarget.contains(e.relatedTarget) || !X || Y(!1);
|
|
95
|
+
}, Ie = (e) => {
|
|
96
|
+
if (!X) return;
|
|
97
|
+
e.preventDefault(), Y(!1);
|
|
98
|
+
let t = e.dataTransfer.files ? Array.from(e.dataTransfer.files) : [], n = ie(t, g, z !== 1).slice(0, z);
|
|
99
|
+
n.length && R?.(n);
|
|
100
|
+
}, Q = v(() => {
|
|
88
101
|
let e = (e) => function({ column: t }) {
|
|
89
|
-
return /* @__PURE__ */
|
|
102
|
+
return /* @__PURE__ */ y(i, {
|
|
90
103
|
column: t,
|
|
91
104
|
title: e,
|
|
92
|
-
labels:
|
|
105
|
+
labels: J.sortableHeader
|
|
93
106
|
});
|
|
94
|
-
}, t = (e, t, n = /* @__PURE__ */
|
|
95
|
-
let a = r && i.original[r] ? /* @__PURE__ */
|
|
96
|
-
return /* @__PURE__ */
|
|
107
|
+
}, t = (e, t, n = /* @__PURE__ */ y(m, { labels: J.missingValue }), r) => function({ row: i }) {
|
|
108
|
+
let a = r && i.original[r] ? /* @__PURE__ */ y(m, { labels: J.missingValue }) : n;
|
|
109
|
+
return /* @__PURE__ */ y("span", {
|
|
97
110
|
className: "ttw:whitespace-nowrap",
|
|
98
|
-
"data-testid":
|
|
111
|
+
"data-testid": M?.[t],
|
|
99
112
|
children: i.original[e] || a
|
|
100
113
|
});
|
|
101
114
|
}, n = function({ row: e }) {
|
|
102
|
-
return /* @__PURE__ */
|
|
115
|
+
return /* @__PURE__ */ y("span", {
|
|
103
116
|
className: "ttw:whitespace-nowrap",
|
|
104
|
-
"data-testid":
|
|
105
|
-
children: /* @__PURE__ */
|
|
106
|
-
value: e.original.dueDateLabel || /* @__PURE__ */
|
|
117
|
+
"data-testid": M?.[_.DueDate],
|
|
118
|
+
children: /* @__PURE__ */ y(p, {
|
|
119
|
+
value: e.original.dueDateLabel || /* @__PURE__ */ y(m, { labels: J.missingValue }),
|
|
107
120
|
tone: e.original.dueDateTone,
|
|
108
|
-
labels:
|
|
121
|
+
labels: J.dueDate
|
|
109
122
|
})
|
|
110
123
|
});
|
|
111
|
-
}, r = (e, t, n = /* @__PURE__ */
|
|
112
|
-
let a = r && i.original[r] ? /* @__PURE__ */
|
|
113
|
-
return /* @__PURE__ */
|
|
124
|
+
}, r = (e, t, n = /* @__PURE__ */ y(m, { labels: J.missingValue }), r) => function({ row: i }) {
|
|
125
|
+
let a = r && i.original[r] ? /* @__PURE__ */ y(m, { labels: J.missingValue }) : n;
|
|
126
|
+
return /* @__PURE__ */ y("div", {
|
|
114
127
|
className: "ttw:text-right ttw:whitespace-nowrap",
|
|
115
|
-
"data-testid":
|
|
128
|
+
"data-testid": M?.[t],
|
|
116
129
|
children: i.original[e] || a
|
|
117
130
|
});
|
|
118
|
-
}, a = /* @__PURE__ */
|
|
119
|
-
return /* @__PURE__ */
|
|
131
|
+
}, a = /* @__PURE__ */ y(oe, { labels: J.noValue }), o = (e) => function() {
|
|
132
|
+
return /* @__PURE__ */ y("div", {
|
|
120
133
|
className: "ttw:text-right",
|
|
121
134
|
children: e
|
|
122
135
|
});
|
|
123
136
|
};
|
|
124
137
|
return {
|
|
125
|
-
[
|
|
138
|
+
[_.Vendor]: {
|
|
126
139
|
accessorKey: "vendorLabel",
|
|
127
140
|
enableSorting: !0,
|
|
128
|
-
minSize:
|
|
129
|
-
header: e(
|
|
130
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
131
|
-
className:
|
|
132
|
-
"data-testid":
|
|
133
|
-
children: [e.original.vendorLabel || /* @__PURE__ */
|
|
141
|
+
minSize: ge,
|
|
142
|
+
header: e(J.columnVendor),
|
|
143
|
+
cell: ({ row: e }) => /* @__PURE__ */ b("span", {
|
|
144
|
+
className: ve[e.original.rowTone ?? "default"],
|
|
145
|
+
"data-testid": M?.[_.Vendor],
|
|
146
|
+
children: [e.original.vendorLabel || /* @__PURE__ */ y(m, { labels: J.missingValue }), e.original.rowNote ? /* @__PURE__ */ y("span", {
|
|
134
147
|
className: "ttw:sr-only",
|
|
135
148
|
children: ` ${e.original.rowNote}`
|
|
136
149
|
}) : null]
|
|
137
150
|
})
|
|
138
151
|
},
|
|
139
|
-
[
|
|
152
|
+
[_.Attachment]: {
|
|
140
153
|
accessorKey: "attachment",
|
|
141
154
|
enableSorting: !1,
|
|
142
|
-
size:
|
|
143
|
-
minSize:
|
|
144
|
-
header: () => /* @__PURE__ */
|
|
155
|
+
size: x,
|
|
156
|
+
minSize: x,
|
|
157
|
+
header: () => /* @__PURE__ */ y("span", {
|
|
145
158
|
className: "ttw:sr-only",
|
|
146
|
-
children:
|
|
159
|
+
children: J.columnAttachment
|
|
147
160
|
}),
|
|
148
|
-
cell: ({ row: e }) => e.original.attachment ? /* @__PURE__ */
|
|
161
|
+
cell: ({ row: e }) => e.original.attachment ? /* @__PURE__ */ y("div", {
|
|
149
162
|
className: "ttw:flex ttw:justify-center",
|
|
150
|
-
"data-testid":
|
|
151
|
-
children: /* @__PURE__ */
|
|
163
|
+
"data-testid": M?.[_.Attachment],
|
|
164
|
+
children: /* @__PURE__ */ y(l, { children: /* @__PURE__ */ b(s, { children: [/* @__PURE__ */ y(u, {
|
|
152
165
|
type: "button",
|
|
153
166
|
className: "ttw:inline-flex ttw:cursor-default",
|
|
154
167
|
"aria-label": e.original.attachment.label,
|
|
155
168
|
onClick: (e) => e.stopPropagation(),
|
|
156
|
-
children: /* @__PURE__ */
|
|
157
|
-
}), /* @__PURE__ */
|
|
169
|
+
children: /* @__PURE__ */ y(ue, { className: "ttw:size-3.5 ttw:shrink-0 ttw:text-muted-foreground" })
|
|
170
|
+
}), /* @__PURE__ */ y(c, { children: e.original.attachment.label })] }) })
|
|
158
171
|
}) : null
|
|
159
172
|
},
|
|
160
|
-
[
|
|
173
|
+
[_.IssueDate]: {
|
|
161
174
|
accessorKey: "issueDateLabel",
|
|
162
175
|
enableSorting: !0,
|
|
163
|
-
header: e(
|
|
164
|
-
cell: t("issueDateLabel",
|
|
176
|
+
header: e(J.columnIssueDate),
|
|
177
|
+
cell: t("issueDateLabel", _.IssueDate)
|
|
165
178
|
},
|
|
166
|
-
[
|
|
179
|
+
[_.DueDate]: {
|
|
167
180
|
accessorKey: "dueDateLabel",
|
|
168
181
|
enableSorting: !0,
|
|
169
|
-
header: e(
|
|
182
|
+
header: e(J.columnDueDate),
|
|
170
183
|
cell: n
|
|
171
184
|
},
|
|
172
|
-
[
|
|
185
|
+
[_.ScheduledDate]: {
|
|
173
186
|
accessorKey: "scheduledDateLabel",
|
|
174
187
|
enableSorting: !0,
|
|
175
|
-
header: e(
|
|
176
|
-
cell: t("scheduledDateLabel",
|
|
188
|
+
header: e(J.columnScheduledDate),
|
|
189
|
+
cell: t("scheduledDateLabel", _.ScheduledDate, a, "scheduledDateIsGap")
|
|
177
190
|
},
|
|
178
|
-
[
|
|
191
|
+
[_.PaidDate]: {
|
|
179
192
|
accessorKey: "paidDateLabel",
|
|
180
193
|
enableSorting: !1,
|
|
181
|
-
header:
|
|
182
|
-
cell: t("paidDateLabel",
|
|
194
|
+
header: J.columnPaidDate,
|
|
195
|
+
cell: t("paidDateLabel", _.PaidDate)
|
|
183
196
|
},
|
|
184
|
-
[
|
|
197
|
+
[_.Status]: {
|
|
185
198
|
accessorKey: "status",
|
|
186
199
|
enableSorting: !1,
|
|
187
|
-
header:
|
|
188
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
200
|
+
header: J.columnStatus,
|
|
201
|
+
cell: ({ row: e }) => /* @__PURE__ */ y("div", {
|
|
189
202
|
className: "ttw:flex ttw:items-center ttw:gap-1",
|
|
190
|
-
"data-testid":
|
|
191
|
-
children: /* @__PURE__ */
|
|
203
|
+
"data-testid": M?.[_.Status],
|
|
204
|
+
children: /* @__PURE__ */ y(ae, {
|
|
192
205
|
status: e.original.status,
|
|
193
206
|
tone: e.original.statusTone,
|
|
194
|
-
labels:
|
|
207
|
+
labels: J.statusBadge
|
|
195
208
|
})
|
|
196
209
|
})
|
|
197
210
|
},
|
|
198
|
-
[
|
|
211
|
+
[_.AmountDue]: {
|
|
199
212
|
accessorKey: "amountDueLabel",
|
|
200
213
|
enableSorting: !1,
|
|
201
|
-
header: o(
|
|
202
|
-
cell: r("amountDueLabel",
|
|
214
|
+
header: o(J.columnAmountDue),
|
|
215
|
+
cell: r("amountDueLabel", _.AmountDue)
|
|
203
216
|
},
|
|
204
|
-
[
|
|
217
|
+
[_.AmountScheduled]: {
|
|
205
218
|
accessorKey: "amountScheduledLabel",
|
|
206
219
|
enableSorting: !1,
|
|
207
|
-
header: o(
|
|
208
|
-
cell: r("amountScheduledLabel",
|
|
220
|
+
header: o(J.columnAmountScheduled),
|
|
221
|
+
cell: r("amountScheduledLabel", _.AmountScheduled)
|
|
209
222
|
},
|
|
210
|
-
[
|
|
223
|
+
[_.AmountPaid]: {
|
|
211
224
|
accessorKey: "amountPaidLabel",
|
|
212
225
|
enableSorting: !1,
|
|
213
|
-
header: o(
|
|
214
|
-
cell: r("amountPaidLabel",
|
|
226
|
+
header: o(J.columnAmountPaid),
|
|
227
|
+
cell: r("amountPaidLabel", _.AmountPaid, a, "amountPaidIsGap")
|
|
215
228
|
},
|
|
216
|
-
[
|
|
229
|
+
[_.TotalAmount]: {
|
|
217
230
|
accessorKey: "totalAmountLabel",
|
|
218
231
|
enableSorting: !1,
|
|
219
|
-
header: o(
|
|
220
|
-
cell: r("totalAmountLabel",
|
|
232
|
+
header: o(J.columnTotalAmount),
|
|
233
|
+
cell: r("totalAmountLabel", _.TotalAmount)
|
|
221
234
|
},
|
|
222
|
-
[
|
|
235
|
+
[_.AddedOn]: {
|
|
223
236
|
accessorKey: "addedOnLabel",
|
|
224
237
|
enableSorting: !0,
|
|
225
|
-
header: e(
|
|
226
|
-
cell: t("addedOnLabel",
|
|
238
|
+
header: e(J.columnAddedOn),
|
|
239
|
+
cell: t("addedOnLabel", _.AddedOn)
|
|
227
240
|
}
|
|
228
241
|
};
|
|
229
|
-
}, [
|
|
242
|
+
}, [J, M]), Le = v(() => [...ye.filter((e) => j.includes(e)).map((e) => Q[e]), {
|
|
230
243
|
id: "actions",
|
|
231
244
|
enableSorting: !1,
|
|
232
|
-
header: () => /* @__PURE__ */
|
|
245
|
+
header: () => /* @__PURE__ */ y("span", {
|
|
233
246
|
className: "ttw:sr-only",
|
|
234
|
-
children:
|
|
247
|
+
children: J.columnActions
|
|
235
248
|
}),
|
|
236
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
249
|
+
cell: ({ row: e }) => /* @__PURE__ */ y("div", {
|
|
237
250
|
className: "ttw:flex ttw:justify-end",
|
|
238
|
-
children: /* @__PURE__ */
|
|
251
|
+
children: /* @__PURE__ */ y(n, {
|
|
239
252
|
variant: "ghost",
|
|
240
253
|
size: "icon",
|
|
241
|
-
"aria-label":
|
|
254
|
+
"aria-label": J.openRow(e.original.vendorLabel || J.missingValue.missing),
|
|
242
255
|
onClick: (t) => {
|
|
243
256
|
t.stopPropagation(), e.original.onOpen();
|
|
244
257
|
},
|
|
245
|
-
children: /* @__PURE__ */
|
|
258
|
+
children: /* @__PURE__ */ y(le, { className: "ttw:size-4" })
|
|
246
259
|
})
|
|
247
260
|
})
|
|
248
261
|
}], [
|
|
249
262
|
Q,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
]),
|
|
263
|
+
J,
|
|
264
|
+
j
|
|
265
|
+
]), Re = !!(F && R) && !w && !T && !N && C.length === 0 && je === !0, $ = /* @__PURE__ */ b("div", {
|
|
253
266
|
className: "ttw:relative ttw:w-80",
|
|
254
|
-
children: [/* @__PURE__ */
|
|
267
|
+
children: [/* @__PURE__ */ y(fe, { className: "ttw:pointer-events-none ttw:absolute ttw:left-3 ttw:top-1/2 ttw:size-4 ttw:-translate-y-1/2 ttw:text-muted-foreground" }), /* @__PURE__ */ y(a, {
|
|
255
268
|
className: "ttw:pl-9",
|
|
256
269
|
type: "search",
|
|
257
|
-
"aria-label":
|
|
258
|
-
placeholder:
|
|
259
|
-
value:
|
|
260
|
-
onChange: (e) =>
|
|
270
|
+
"aria-label": J.searchLabel,
|
|
271
|
+
placeholder: J.searchPlaceholder,
|
|
272
|
+
value: ke,
|
|
273
|
+
onChange: (e) => Ae(e.target.value)
|
|
261
274
|
})]
|
|
262
|
-
}),
|
|
263
|
-
...
|
|
275
|
+
}), ze = A ? /* @__PURE__ */ y(se, {
|
|
276
|
+
...A,
|
|
264
277
|
className: "ttw:px-4",
|
|
265
278
|
searchSlot: $
|
|
266
|
-
}) : /* @__PURE__ */
|
|
279
|
+
}) : /* @__PURE__ */ y("div", {
|
|
267
280
|
className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-2 ttw:px-4",
|
|
268
281
|
children: $
|
|
269
282
|
});
|
|
270
|
-
return /* @__PURE__ */
|
|
283
|
+
return /* @__PURE__ */ b("div", {
|
|
271
284
|
className: "ttw:flex ttw:flex-col ttw:gap-3",
|
|
272
|
-
children: [
|
|
285
|
+
children: [K ? /* @__PURE__ */ b(e, {
|
|
273
286
|
className: "ttw:flex ttw:items-center ttw:gap-3 ttw:rounded-none ttw:border-0 ttw:border-l-4 ttw:border-l-amber-600 ttw:bg-amber-50 ttw:py-2 ttw:text-amber-700",
|
|
274
|
-
children: [/* @__PURE__ */
|
|
287
|
+
children: [/* @__PURE__ */ y(t, {
|
|
275
288
|
className: "ttw:flex-1 ttw:font-semibold",
|
|
276
|
-
children:
|
|
277
|
-
}),
|
|
289
|
+
children: K
|
|
290
|
+
}), q ? /* @__PURE__ */ y(n, {
|
|
278
291
|
type: "button",
|
|
279
292
|
variant: "outline",
|
|
280
293
|
className: "ttw:text-foreground",
|
|
281
|
-
onClick:
|
|
282
|
-
children:
|
|
294
|
+
onClick: q,
|
|
295
|
+
children: J.duplicateBillsReviewButton
|
|
283
296
|
}) : null]
|
|
284
|
-
}) : null, /* @__PURE__ */
|
|
285
|
-
value:
|
|
286
|
-
onValueChange:
|
|
297
|
+
}) : null, /* @__PURE__ */ b(o, {
|
|
298
|
+
value: k,
|
|
299
|
+
onValueChange: Oe,
|
|
287
300
|
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
288
|
-
children: [/* @__PURE__ */
|
|
301
|
+
children: [/* @__PURE__ */ b("div", {
|
|
289
302
|
className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:justify-between ttw:gap-3",
|
|
290
|
-
children: [/* @__PURE__ */
|
|
291
|
-
"aria-label":
|
|
292
|
-
children:
|
|
303
|
+
children: [/* @__PURE__ */ y(te, {
|
|
304
|
+
"aria-label": J.filterTabsLabel,
|
|
305
|
+
children: O.map((e) => /* @__PURE__ */ b(ne, {
|
|
293
306
|
value: e.id,
|
|
294
307
|
className: "ttw:min-w-28",
|
|
295
308
|
children: [e.icon, e.label]
|
|
296
309
|
}, e.id))
|
|
297
|
-
}), /* @__PURE__ */
|
|
310
|
+
}), /* @__PURE__ */ b("div", {
|
|
298
311
|
className: "ttw:flex ttw:items-center ttw:gap-2",
|
|
299
|
-
children: [
|
|
312
|
+
children: [I ? /* @__PURE__ */ y(l, { children: /* @__PURE__ */ b(s, { children: [/* @__PURE__ */ y(u, {
|
|
300
313
|
asChild: !0,
|
|
301
|
-
children: /* @__PURE__ */
|
|
314
|
+
children: /* @__PURE__ */ y(n, {
|
|
302
315
|
variant: "outline",
|
|
303
316
|
size: "icon",
|
|
304
|
-
"aria-label":
|
|
305
|
-
onClick:
|
|
306
|
-
children: /* @__PURE__ */
|
|
317
|
+
"aria-label": J.settingsButton,
|
|
318
|
+
onClick: I,
|
|
319
|
+
children: /* @__PURE__ */ y(pe, { className: "ttw:size-4" })
|
|
307
320
|
})
|
|
308
|
-
}), /* @__PURE__ */
|
|
309
|
-
onClick:
|
|
310
|
-
children: [/* @__PURE__ */
|
|
321
|
+
}), /* @__PURE__ */ y(c, { children: J.settingsButton })] }) }) : null, F ? /* @__PURE__ */ b(n, {
|
|
322
|
+
onClick: F,
|
|
323
|
+
children: [/* @__PURE__ */ y(de, { className: "ttw:size-4" }), J.createButton]
|
|
311
324
|
}) : null]
|
|
312
325
|
})]
|
|
313
326
|
}), (() => {
|
|
314
|
-
let e =
|
|
315
|
-
title:
|
|
316
|
-
description:
|
|
317
|
-
retryLabel:
|
|
318
|
-
onRetry:
|
|
319
|
-
}) :
|
|
327
|
+
let e = T ? /* @__PURE__ */ y(re, {
|
|
328
|
+
title: J.errorTitle,
|
|
329
|
+
description: J.errorDescription,
|
|
330
|
+
retryLabel: L ? J.errorRetry : void 0,
|
|
331
|
+
onRetry: L
|
|
332
|
+
}) : Re && F && R ? /* @__PURE__ */ y("div", {
|
|
320
333
|
className: "ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card",
|
|
321
|
-
children:
|
|
322
|
-
emailAddress:
|
|
323
|
-
onCopyEmail:
|
|
324
|
-
onFilesSelected:
|
|
325
|
-
accept:
|
|
326
|
-
maxFiles:
|
|
327
|
-
uploadStatus:
|
|
328
|
-
uploadErrorMessage:
|
|
329
|
-
onEnterManually:
|
|
330
|
-
labels:
|
|
331
|
-
}) : /* @__PURE__ */
|
|
332
|
-
onFilesSelected:
|
|
333
|
-
accept:
|
|
334
|
-
maxFiles:
|
|
335
|
-
uploadStatus:
|
|
336
|
-
uploadErrorMessage:
|
|
337
|
-
onEnterManually:
|
|
338
|
-
labels:
|
|
334
|
+
children: U && W ? /* @__PURE__ */ y(f, {
|
|
335
|
+
emailAddress: U,
|
|
336
|
+
onCopyEmail: W,
|
|
337
|
+
onFilesSelected: R,
|
|
338
|
+
accept: g,
|
|
339
|
+
maxFiles: z,
|
|
340
|
+
uploadStatus: V,
|
|
341
|
+
uploadErrorMessage: H,
|
|
342
|
+
onEnterManually: B ?? F,
|
|
343
|
+
labels: J.addBill
|
|
344
|
+
}) : /* @__PURE__ */ y(f, {
|
|
345
|
+
onFilesSelected: R,
|
|
346
|
+
accept: g,
|
|
347
|
+
maxFiles: z,
|
|
348
|
+
uploadStatus: V,
|
|
349
|
+
uploadErrorMessage: H,
|
|
350
|
+
onEnterManually: B ?? F,
|
|
351
|
+
labels: J.addBill
|
|
339
352
|
})
|
|
340
|
-
}) : /* @__PURE__ */
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
353
|
+
}) : /* @__PURE__ */ b("div", {
|
|
354
|
+
className: "ttw:relative",
|
|
355
|
+
onDragEnter: Ne,
|
|
356
|
+
onDragOver: Pe,
|
|
357
|
+
onDragLeave: Fe,
|
|
358
|
+
onDrop: Ie,
|
|
359
|
+
children: [/* @__PURE__ */ y(r, {
|
|
360
|
+
columns: Le,
|
|
361
|
+
data: C,
|
|
362
|
+
getRowId: (e) => e.rowKey,
|
|
363
|
+
animatesNewRows: !0,
|
|
364
|
+
isLoading: w,
|
|
365
|
+
sorting: be,
|
|
366
|
+
onSortingChange: xe,
|
|
367
|
+
pageSize: Se,
|
|
368
|
+
onPageSizeChange: Ce,
|
|
369
|
+
pageSizeOptions: we,
|
|
370
|
+
pageInfo: Te,
|
|
371
|
+
hasNextPage: Ee,
|
|
372
|
+
hasPrevPage: E,
|
|
373
|
+
onNextPage: D,
|
|
374
|
+
onPrevPage: De,
|
|
375
|
+
onRowClick: (e) => e.onOpen(),
|
|
376
|
+
rowClassName: (e) => _e[e.rowTone ?? "default"],
|
|
377
|
+
filterComponent: ze,
|
|
378
|
+
children: N ? /* @__PURE__ */ y(d, {
|
|
379
|
+
title: J.filteredEmptyTitle,
|
|
380
|
+
description: J.filteredEmptyDescription
|
|
381
|
+
}) : P ? /* @__PURE__ */ y(d, {
|
|
382
|
+
title: P.title,
|
|
383
|
+
description: P.description
|
|
384
|
+
}) : void 0
|
|
385
|
+
}), Me ? /* @__PURE__ */ y("div", {
|
|
386
|
+
className: "ttw:pointer-events-none ttw:absolute ttw:inset-0 ttw:z-20 ttw:flex ttw:items-center ttw:justify-center ttw:rounded-xl ttw:border-2 ttw:border-dashed ttw:border-primary ttw:bg-background/85 ttw:backdrop-blur-[1px]",
|
|
387
|
+
children: /* @__PURE__ */ b("div", {
|
|
388
|
+
className: "ttw:flex ttw:items-center ttw:gap-3 ttw:rounded-lg ttw:border ttw:bg-card ttw:px-4 ttw:py-3 ttw:shadow-sm",
|
|
389
|
+
children: [/* @__PURE__ */ y(me, { className: "ttw:size-5 ttw:text-muted-foreground" }), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
390
|
+
className: "ttw:text-sm ttw:font-medium",
|
|
391
|
+
children: J.tableDropzoneTitle
|
|
392
|
+
}), /* @__PURE__ */ y("p", {
|
|
393
|
+
className: "ttw:text-xs ttw:text-muted-foreground",
|
|
394
|
+
children: z === void 0 ? J.addBill.dropzone.fileTypesHint : `${J.addBill.dropzone.fileTypesHint} · ${J.addBill.dropzone.fileCountHint(z)}`
|
|
395
|
+
})] })]
|
|
396
|
+
})
|
|
397
|
+
}) : null]
|
|
366
398
|
});
|
|
367
|
-
return
|
|
399
|
+
return O.map((t) => /* @__PURE__ */ y(ee, {
|
|
368
400
|
value: t.id,
|
|
369
|
-
children: t.id ===
|
|
401
|
+
children: t.id === k ? e : null
|
|
370
402
|
}, t.id));
|
|
371
403
|
})()]
|
|
372
404
|
})]
|
|
373
405
|
});
|
|
374
406
|
}
|
|
375
407
|
//#endregion
|
|
376
|
-
export {
|
|
408
|
+
export { C as BillsScreen, C as default, S as DEFAULT_BILL_COLUMNS };
|
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.49", n = "35cfe2ead26ab15b6504fc73ea208acfe15f4b89", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|