@tesouro/embedded-components-react 0.2.281 → 0.2.283
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 +17 -6
- package/dist/index.js +1 -1
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +9 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +42 -39
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +69 -54
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +21 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +46 -41
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +81 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +46 -47
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +3 -11
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +2 -8
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +5 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +43 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +1 -102
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +11 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +9 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +4 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +127 -76
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +7 -112
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +85 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index3.js +16 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +2 -24
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +114 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +50 -49
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +25 -12
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +86 -69
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +17 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +89 -124
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +31 -26
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +80 -77
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +20 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +228 -6
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListRow.js +13 -15
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js +53 -11
- 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/index5.js +1 -1
- package/dist/packages/shared-ui-shadcn/dist/index.js +3445 -3413
- package/package.json +1 -1
|
@@ -9,126 +9,143 @@ import { useReplacePayableLineItemsMutation as n } from "../../data-access/dist/
|
|
|
9
9
|
import { useCreatePayableMutation as r, useSubmitPayableForApprovalMutation as i, useUpdatePayableMutation as a, useValidatePayableMutation as o } from "../../data-access/dist/index7.js";
|
|
10
10
|
import "../../data-access/dist/index.js";
|
|
11
11
|
import { mapBillFormToPayload as s, mapLineItemsToPayload as c } from "./index6.js";
|
|
12
|
-
import {
|
|
13
|
-
import { useCallback as
|
|
12
|
+
import { validateBillCompleteness as l, validateBillTotals as u, validateLineItems as d } from "./index7.js";
|
|
13
|
+
import { useCallback as f, useRef as p, useState as m } from "react";
|
|
14
14
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js
|
|
15
|
-
var
|
|
15
|
+
var h = {
|
|
16
16
|
document_id: "invoiceNumber",
|
|
17
17
|
issued_at: "invoiceDate",
|
|
18
|
-
due_date: "dueDate"
|
|
18
|
+
due_date: "dueDate",
|
|
19
|
+
counterpart_id: "vendor"
|
|
19
20
|
};
|
|
20
|
-
function
|
|
21
|
+
function g(e) {
|
|
21
22
|
return e.type === "type_error.none.not_allowed" || e.msg === "none is not an allowed value";
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
+
function _(e, n = t) {
|
|
24
25
|
let r = {}, i = [];
|
|
25
26
|
for (let t of e) {
|
|
26
|
-
let e = t.loc[0] ?? n.unknownValidationField, a =
|
|
27
|
+
let e = t.loc[0] ?? n.unknownValidationField, a = h[e], o = g(t) ? n.requiredField : t.msg;
|
|
27
28
|
a ? r[a] = o : i.push(n.unmappedValidationError(e, o));
|
|
28
29
|
}
|
|
29
30
|
return i.length && (r.form = i.join(" ")), r;
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
32
|
+
function v(e, t) {
|
|
33
|
+
if (!e && !t) return;
|
|
34
|
+
let n = {}, r = /* @__PURE__ */ new Set([...Object.keys(e ?? {}), ...Object.keys(t ?? {})]);
|
|
35
|
+
for (let i of r) n[i] = {
|
|
36
|
+
...e?.[i],
|
|
37
|
+
...t?.[i]
|
|
38
|
+
};
|
|
39
|
+
return n;
|
|
40
|
+
}
|
|
41
|
+
function y({ payableId: h, form: g, counterpartId: y, onSaved: b, onPayableCreated: x, onDraftSaved: S, onFinalized: C, labels: w }) {
|
|
42
|
+
let T = {
|
|
33
43
|
...t,
|
|
34
|
-
...
|
|
35
|
-
}, [
|
|
36
|
-
let
|
|
37
|
-
return
|
|
38
|
-
}, [
|
|
44
|
+
...w
|
|
45
|
+
}, [E, D] = m(), O = h ?? E, [k, A] = m(), j = p(!1), M = r(), N = a(), P = n(), F = o(), I = i(), L = f(() => {
|
|
46
|
+
let t = d(g.lineItems, T), n = u(g.discount, g.tax, g.totalOverride, T);
|
|
47
|
+
return g.setLineItemErrors(t), !t && !n || (t ? (g.setErrors(void 0), e.error(T.lineItemsNeedAttention)) : g.setErrors(n), !1);
|
|
48
|
+
}, [g, T]), R = f(async () => {
|
|
39
49
|
let e = s({
|
|
40
|
-
values:
|
|
41
|
-
counterpartId:
|
|
42
|
-
editedTotals:
|
|
43
|
-
discount:
|
|
44
|
-
tax:
|
|
45
|
-
total:
|
|
50
|
+
values: g.values,
|
|
51
|
+
counterpartId: y,
|
|
52
|
+
editedTotals: g.isTotalsDirty ? {
|
|
53
|
+
discount: g.discount,
|
|
54
|
+
tax: g.tax,
|
|
55
|
+
total: g.totalOverride
|
|
46
56
|
} : void 0
|
|
47
|
-
}), t =
|
|
48
|
-
if (t ? await
|
|
57
|
+
}), t = O;
|
|
58
|
+
if (t ? await N.mutateAsync({
|
|
49
59
|
path: { payable_id: t },
|
|
50
60
|
body: e
|
|
51
|
-
}) : (t = (await
|
|
52
|
-
return await
|
|
61
|
+
}) : (t = (await M.mutateAsync({ body: e }))?.id, t && (D(t), x?.(t))), !t) throw Error("Payable was created without an id");
|
|
62
|
+
return await P.mutateAsync({
|
|
53
63
|
path: { payable_id: t },
|
|
54
|
-
body: { data: c(
|
|
64
|
+
body: { data: c(g.lineItems) }
|
|
55
65
|
}), t;
|
|
56
66
|
}, [
|
|
57
|
-
_,
|
|
58
|
-
A,
|
|
59
|
-
h.discount,
|
|
60
|
-
h.isTotalsDirty,
|
|
61
|
-
h.lineItems,
|
|
62
|
-
h.tax,
|
|
63
|
-
h.totalOverride,
|
|
64
|
-
h.values,
|
|
65
67
|
y,
|
|
66
|
-
E,
|
|
67
68
|
M,
|
|
68
|
-
|
|
69
|
+
g.discount,
|
|
70
|
+
g.isTotalsDirty,
|
|
71
|
+
g.lineItems,
|
|
72
|
+
g.tax,
|
|
73
|
+
g.totalOverride,
|
|
74
|
+
g.values,
|
|
75
|
+
x,
|
|
76
|
+
O,
|
|
77
|
+
P,
|
|
78
|
+
N
|
|
69
79
|
]);
|
|
70
80
|
return {
|
|
71
|
-
saveDraft:
|
|
72
|
-
if (!
|
|
73
|
-
|
|
81
|
+
saveDraft: f(async () => {
|
|
82
|
+
if (!j.current && L()) {
|
|
83
|
+
j.current = !0, A("draft");
|
|
74
84
|
try {
|
|
75
|
-
let t = await
|
|
76
|
-
|
|
85
|
+
let t = await R();
|
|
86
|
+
g.setErrors(void 0), b?.(t), S?.(t), e.success(T.draftSaved);
|
|
77
87
|
} catch {
|
|
78
|
-
|
|
88
|
+
g.setErrors({ form: T.saveFailed });
|
|
79
89
|
} finally {
|
|
80
|
-
|
|
90
|
+
A(void 0), j.current = !1;
|
|
81
91
|
}
|
|
82
92
|
}
|
|
83
93
|
}, [
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
94
|
+
g,
|
|
95
|
+
L,
|
|
96
|
+
T.draftSaved,
|
|
97
|
+
T.saveFailed,
|
|
98
|
+
S,
|
|
88
99
|
b,
|
|
89
|
-
|
|
90
|
-
I
|
|
100
|
+
R
|
|
91
101
|
]),
|
|
92
|
-
finalize:
|
|
93
|
-
if (
|
|
94
|
-
|
|
102
|
+
finalize: f(async () => {
|
|
103
|
+
if (j.current) return;
|
|
104
|
+
let t = d(g.lineItems, T), n = u(g.discount, g.tax, g.totalOverride, T), { formErrors: r, lineItemErrors: i } = l(g.values, y, g.lineItems, T), a = v(i, t);
|
|
105
|
+
g.setLineItemErrors(a);
|
|
106
|
+
let o = {
|
|
107
|
+
...r,
|
|
108
|
+
...n
|
|
109
|
+
};
|
|
110
|
+
if (g.setErrors(Object.keys(o).length ? o : void 0), t && e.error(T.lineItemsNeedAttention), !(a || Object.keys(o).length)) {
|
|
111
|
+
j.current = !0, A("finalize");
|
|
95
112
|
try {
|
|
96
113
|
let t;
|
|
97
114
|
try {
|
|
98
|
-
t = await
|
|
115
|
+
t = await R();
|
|
99
116
|
} catch {
|
|
100
|
-
|
|
117
|
+
g.setErrors({ form: T.saveFailed });
|
|
101
118
|
return;
|
|
102
119
|
}
|
|
103
|
-
|
|
120
|
+
b?.(t);
|
|
104
121
|
try {
|
|
105
|
-
let n = await
|
|
122
|
+
let n = await F.mutateAsync({ path: { payable_id: t } });
|
|
106
123
|
if (n.validation_errors.length) {
|
|
107
|
-
|
|
124
|
+
g.setErrors(_(n.validation_errors, T));
|
|
108
125
|
return;
|
|
109
126
|
}
|
|
110
|
-
await
|
|
127
|
+
await I.mutateAsync({ path: { payable_id: t } }), g.setErrors(void 0), C?.(t), e.success(T.billFinalized);
|
|
111
128
|
} catch {
|
|
112
|
-
|
|
129
|
+
g.setErrors({ form: T.finalizeFailed });
|
|
113
130
|
}
|
|
114
131
|
} finally {
|
|
115
|
-
|
|
132
|
+
A(void 0), j.current = !1;
|
|
116
133
|
}
|
|
117
134
|
}
|
|
118
135
|
}, [
|
|
119
|
-
|
|
120
|
-
|
|
136
|
+
y,
|
|
137
|
+
g,
|
|
138
|
+
T,
|
|
121
139
|
C,
|
|
122
|
-
|
|
123
|
-
|
|
140
|
+
b,
|
|
141
|
+
R,
|
|
124
142
|
I,
|
|
125
|
-
|
|
126
|
-
N
|
|
143
|
+
F
|
|
127
144
|
]),
|
|
128
|
-
payableId:
|
|
129
|
-
isSavingDraft:
|
|
130
|
-
isFinalizing:
|
|
145
|
+
payableId: O,
|
|
146
|
+
isSavingDraft: k === "draft",
|
|
147
|
+
isFinalizing: k === "finalize"
|
|
131
148
|
};
|
|
132
149
|
}
|
|
133
150
|
//#endregion
|
|
134
|
-
export {
|
|
151
|
+
export { _ as mapValidationErrorsToForm, y as useBillCreateController };
|
|
@@ -28,16 +28,16 @@ import "./index32.js";
|
|
|
28
28
|
import "./index33.js";
|
|
29
29
|
import "./index34.js";
|
|
30
30
|
import "./index35.js";
|
|
31
|
-
import "./index36.js";
|
|
32
|
-
import "./index37.js";
|
|
33
|
-
import { BillsScreen as
|
|
31
|
+
import { BILL_DETAILS_SHEET_LABELS_EN as r } from "./index36.js";
|
|
32
|
+
import { BillDetailsSheet as i } from "./index37.js";
|
|
33
|
+
import { BillsScreen as a } from "./index38.js";
|
|
34
34
|
import "./index39.js";
|
|
35
|
-
import { BillUploadStatusTray as
|
|
35
|
+
import { BillUploadStatusTray as o } from "./index41.js";
|
|
36
36
|
import "./index43.js";
|
|
37
37
|
import "./index44.js";
|
|
38
|
-
import { ExtractionNotice as
|
|
38
|
+
import { ExtractionNotice as s } from "./index45.js";
|
|
39
39
|
import "./index46.js";
|
|
40
40
|
import "./index47.js";
|
|
41
|
-
import { SourceDocumentPanel as
|
|
41
|
+
import { SourceDocumentPanel as c } from "./index48.js";
|
|
42
42
|
import "./index49.js";
|
|
43
|
-
export { e as AddBillDialog, t as BillCreateScreen, n as BillPayWidgetUi,
|
|
43
|
+
export { e as AddBillDialog, r as BILL_DETAILS_SHEET_LABELS_EN, t as BillCreateScreen, i as BillDetailsSheet, n as BillPayWidgetUi, o as BillUploadStatusTray, a as BillsScreen, s as ExtractionNotice, c as SourceDocumentPanel };
|
|
@@ -3,44 +3,45 @@ import { BILL_FORM_FIELDS_LABELS_EN as n } from "./index12.js";
|
|
|
3
3
|
import { useId as r } from "react";
|
|
4
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
|
-
function o({ values: o, errors: s, onChange: c,
|
|
7
|
-
let
|
|
6
|
+
function o({ values: o, errors: s, onChange: c, disabled: l, testId: u, labels: d }) {
|
|
7
|
+
let f = {
|
|
8
8
|
...n,
|
|
9
|
-
...
|
|
10
|
-
},
|
|
11
|
-
let
|
|
9
|
+
...d
|
|
10
|
+
}, p = r(), m = (n, r, u) => {
|
|
11
|
+
let d = `${p}-${n}`, f = `${d}-error`, m = s?.[n];
|
|
12
12
|
return /* @__PURE__ */ a("div", {
|
|
13
13
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
14
14
|
children: [
|
|
15
15
|
/* @__PURE__ */ i(t, {
|
|
16
|
-
htmlFor:
|
|
16
|
+
htmlFor: d,
|
|
17
17
|
children: r
|
|
18
18
|
}),
|
|
19
19
|
/* @__PURE__ */ i(e, {
|
|
20
|
-
id:
|
|
21
|
-
type:
|
|
20
|
+
id: d,
|
|
21
|
+
type: u,
|
|
22
22
|
value: o[n],
|
|
23
|
-
|
|
24
|
-
"aria-
|
|
23
|
+
disabled: l,
|
|
24
|
+
"aria-invalid": m ? !0 : void 0,
|
|
25
|
+
"aria-describedby": m ? f : void 0,
|
|
25
26
|
onChange: (e) => c({ [n]: e.target.value })
|
|
26
27
|
}),
|
|
27
|
-
|
|
28
|
-
id:
|
|
28
|
+
m ? /* @__PURE__ */ i("p", {
|
|
29
|
+
id: f,
|
|
29
30
|
className: "ttw:text-sm ttw:text-destructive",
|
|
30
|
-
children:
|
|
31
|
+
children: m
|
|
31
32
|
}) : null
|
|
32
33
|
]
|
|
33
34
|
});
|
|
34
35
|
};
|
|
35
36
|
return /* @__PURE__ */ a("div", {
|
|
36
37
|
className: "ttw:flex ttw:flex-col ttw:gap-4",
|
|
37
|
-
"data-testid":
|
|
38
|
+
"data-testid": u,
|
|
38
39
|
children: [/* @__PURE__ */ a("div", {
|
|
39
40
|
className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
|
|
40
|
-
children: [
|
|
41
|
+
children: [m("invoiceDate", f.invoiceDate, "date"), m("dueDate", f.dueDate, "date")]
|
|
41
42
|
}), /* @__PURE__ */ a("div", {
|
|
42
43
|
className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
|
|
43
|
-
children: [
|
|
44
|
+
children: [m("invoiceNumber", f.invoiceNumber), m("poNumber", f.poNumber)]
|
|
44
45
|
})]
|
|
45
46
|
});
|
|
46
47
|
}
|
|
@@ -86,6 +86,7 @@ function y({ items: y, glCodeOptions: b, discount: x, onDiscountChange: S, tax:
|
|
|
86
86
|
onValueChange: (e) => d.onChange({ glCode: e }),
|
|
87
87
|
children: [/* @__PURE__ */ m(l, {
|
|
88
88
|
id: `${p}-gl-code`,
|
|
89
|
+
className: "ttw:w-full",
|
|
89
90
|
"aria-invalid": S("glCode") ? !0 : void 0,
|
|
90
91
|
"aria-describedby": S("glCode") ? x("glCode") : void 0,
|
|
91
92
|
children: /* @__PURE__ */ m(u, { placeholder: M.glCodePlaceholder })
|
|
@@ -1,131 +1,96 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { VENDOR_SEARCH_COMBOBOX_LABELS_EN as
|
|
3
|
-
import { useId as
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { Plus as
|
|
1
|
+
import { Command as e, CommandGroup as t, CommandInput as n, CommandItem as r, CommandList as i, CommandSeparator as a, Label as o, Popover as s, PopoverContent as c, PopoverTrigger as l, Skeleton as u, cn as d } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { VENDOR_SEARCH_COMBOBOX_LABELS_EN as f } from "./index21.js";
|
|
3
|
+
import { useId as p, useState as m } from "react";
|
|
4
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
5
|
+
import { Plus as _, Search as v } from "lucide-react";
|
|
6
6
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
let
|
|
10
|
-
...
|
|
11
|
-
...
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
}, k = () => {
|
|
15
|
-
C(!1), T(-1), g();
|
|
16
|
-
}, A = () => {
|
|
17
|
-
C(!1), T(-1);
|
|
18
|
-
};
|
|
19
|
-
return /* @__PURE__ */ s("div", {
|
|
7
|
+
var y = 5, b = "ttw:min-h-44";
|
|
8
|
+
function x({ query: x, onQueryChange: S, results: C, isLoading: w, onAddVendor: T, testId: E, labels: D }) {
|
|
9
|
+
let O = {
|
|
10
|
+
...f,
|
|
11
|
+
...D
|
|
12
|
+
}, k = p(), [A, j] = m(!1);
|
|
13
|
+
return /* @__PURE__ */ g("div", {
|
|
20
14
|
className: "ttw:flex ttw:flex-col ttw:gap-1.5",
|
|
21
|
-
"data-testid":
|
|
22
|
-
children: [/* @__PURE__ */ o
|
|
23
|
-
htmlFor:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
children: [/* @__PURE__ */
|
|
29
|
-
|
|
30
|
-
children:
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
}), /* @__PURE__ */ o(e, {
|
|
34
|
-
id: b,
|
|
35
|
-
value: f,
|
|
36
|
-
onChange: (e) => {
|
|
37
|
-
C(!0), T(-1), p(e.target.value);
|
|
38
|
-
},
|
|
39
|
-
onFocus: () => C(!0),
|
|
40
|
-
onBlur: A,
|
|
41
|
-
onKeyDown: (e) => {
|
|
42
|
-
if (e.key === "Escape") {
|
|
43
|
-
A();
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
if (E) {
|
|
47
|
-
if (e.key === "ArrowDown") {
|
|
48
|
-
e.preventDefault(), C(!0), T((e) => e >= E - 1 ? 0 : e + 1);
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
if (e.key === "ArrowUp") {
|
|
52
|
-
e.preventDefault(), C(!0), T((e) => e <= 0 ? E - 1 : e - 1);
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
e.key === "Enter" && S && w >= 0 && (e.preventDefault(), w < m.length ? O(m[w].onSelect) : k());
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
placeholder: y.placeholder,
|
|
15
|
+
"data-testid": E,
|
|
16
|
+
children: [/* @__PURE__ */ h(o, {
|
|
17
|
+
htmlFor: k,
|
|
18
|
+
children: O.fieldLabel
|
|
19
|
+
}), /* @__PURE__ */ g(s, {
|
|
20
|
+
open: A,
|
|
21
|
+
onOpenChange: j,
|
|
22
|
+
children: [/* @__PURE__ */ h(l, {
|
|
23
|
+
asChild: !0,
|
|
24
|
+
children: /* @__PURE__ */ g("button", {
|
|
25
|
+
type: "button",
|
|
26
|
+
id: k,
|
|
59
27
|
role: "combobox",
|
|
60
|
-
"aria-
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
})
|
|
125
|
-
]
|
|
126
|
-
}) : null]
|
|
28
|
+
"aria-expanded": A,
|
|
29
|
+
className: "ttw:flex ttw:h-10 ttw:w-full ttw:items-center ttw:gap-2 ttw:rounded-md ttw:border ttw:border-border ttw:bg-background ttw:px-3 ttw:text-left ttw:text-sm ttw:shadow-xs ttw:outline-none ttw:focus-visible:border-ring ttw:focus-visible:ring-[3px] ttw:focus-visible:ring-ring/50",
|
|
30
|
+
children: [/* @__PURE__ */ h(v, {
|
|
31
|
+
"aria-hidden": !0,
|
|
32
|
+
className: "ttw:size-4 ttw:shrink-0 ttw:opacity-50"
|
|
33
|
+
}), /* @__PURE__ */ h("span", {
|
|
34
|
+
className: d("ttw:min-w-0 ttw:flex-1 ttw:truncate", !x && "ttw:text-muted-foreground"),
|
|
35
|
+
children: x || O.placeholder
|
|
36
|
+
})]
|
|
37
|
+
})
|
|
38
|
+
}), /* @__PURE__ */ h(c, {
|
|
39
|
+
align: "start",
|
|
40
|
+
className: "ttw:w-[var(--radix-popover-trigger-width)] ttw:p-0",
|
|
41
|
+
children: /* @__PURE__ */ g(e, {
|
|
42
|
+
shouldFilter: !1,
|
|
43
|
+
children: [/* @__PURE__ */ h(n, {
|
|
44
|
+
value: x,
|
|
45
|
+
onValueChange: S,
|
|
46
|
+
placeholder: O.placeholder,
|
|
47
|
+
"aria-label": O.placeholder
|
|
48
|
+
}), /* @__PURE__ */ g(i, {
|
|
49
|
+
className: d("ttw:max-h-72", b),
|
|
50
|
+
children: [
|
|
51
|
+
w ? /* @__PURE__ */ g("div", {
|
|
52
|
+
className: "ttw:flex ttw:flex-col ttw:gap-2 ttw:p-2",
|
|
53
|
+
"aria-busy": "true",
|
|
54
|
+
children: [/* @__PURE__ */ h("span", {
|
|
55
|
+
className: "ttw:sr-only",
|
|
56
|
+
children: O.loading
|
|
57
|
+
}), Array.from({ length: y }).map((e, t) => /* @__PURE__ */ g("div", {
|
|
58
|
+
className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-4 ttw:px-2 ttw:py-1.5",
|
|
59
|
+
children: [/* @__PURE__ */ h(u, {
|
|
60
|
+
height: 14,
|
|
61
|
+
width: "55%"
|
|
62
|
+
}), /* @__PURE__ */ h(u, {
|
|
63
|
+
height: 14,
|
|
64
|
+
width: "30%"
|
|
65
|
+
})]
|
|
66
|
+
}, t))]
|
|
67
|
+
}) : C.length === 0 && x ? /* @__PURE__ */ h("div", {
|
|
68
|
+
className: d("ttw:flex ttw:items-center ttw:justify-center ttw:py-6 ttw:text-center ttw:text-sm", b),
|
|
69
|
+
children: O.emptyResults
|
|
70
|
+
}) : C.length > 0 ? /* @__PURE__ */ h(t, { children: C.map((e, t) => /* @__PURE__ */ g(r, {
|
|
71
|
+
value: `${e.name} ${e.email} ${t}`,
|
|
72
|
+
onSelect: () => e.onSelect(),
|
|
73
|
+
children: [/* @__PURE__ */ h("span", {
|
|
74
|
+
className: "ttw:text-foreground",
|
|
75
|
+
children: e.name
|
|
76
|
+
}), /* @__PURE__ */ h("span", {
|
|
77
|
+
className: "ttw:ml-auto ttw:text-muted-foreground",
|
|
78
|
+
children: e.email
|
|
79
|
+
})]
|
|
80
|
+
}, `${e.name}:${e.email}:${t}`)) }) : null,
|
|
81
|
+
w || C.length > 0 || x ? /* @__PURE__ */ h(a, {}) : null,
|
|
82
|
+
/* @__PURE__ */ g(r, {
|
|
83
|
+
value: "__add_vendor__",
|
|
84
|
+
onSelect: T,
|
|
85
|
+
className: "ttw:sticky ttw:bottom-0 ttw:bg-popover ttw:text-primary",
|
|
86
|
+
children: [/* @__PURE__ */ h(_, { className: "ttw:size-4 ttw:text-primary" }), O.addVendorAction]
|
|
87
|
+
})
|
|
88
|
+
]
|
|
89
|
+
})]
|
|
90
|
+
})
|
|
91
|
+
})]
|
|
127
92
|
})]
|
|
128
93
|
});
|
|
129
94
|
}
|
|
130
95
|
//#endregion
|
|
131
|
-
export {
|
|
96
|
+
export { x as VendorSearchCombobox, x as default };
|
|
@@ -1,48 +1,53 @@
|
|
|
1
1
|
import { Typography as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
-
import {
|
|
3
|
-
import "../../../shared/ui/dist/index.js";
|
|
4
|
-
import { VendorSummaryCard as n } from "./index19.js";
|
|
2
|
+
import { VendorSummaryCard as t } from "./index19.js";
|
|
5
3
|
import "./index20.js";
|
|
6
|
-
import { VendorSearchCombobox as
|
|
4
|
+
import { VendorSearchCombobox as n } from "./index22.js";
|
|
7
5
|
import "./index23.js";
|
|
8
|
-
import { VENDOR_SECTION_LABELS_EN as
|
|
9
|
-
import { jsx as
|
|
6
|
+
import { VENDOR_SECTION_LABELS_EN as r } from "./index24.js";
|
|
7
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
10
8
|
//#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js
|
|
11
|
-
function
|
|
12
|
-
let { onEdit:
|
|
13
|
-
...
|
|
14
|
-
...
|
|
9
|
+
function o(o) {
|
|
10
|
+
let { onEdit: s, onClear: c, error: l, testId: u, labels: d, disabled: f } = o, p = {
|
|
11
|
+
...r,
|
|
12
|
+
...d,
|
|
15
13
|
summaryCard: {
|
|
16
|
-
...
|
|
17
|
-
...
|
|
14
|
+
...r.summaryCard,
|
|
15
|
+
...d?.summaryCard
|
|
18
16
|
},
|
|
19
17
|
search: {
|
|
20
|
-
...
|
|
21
|
-
...
|
|
18
|
+
...r.search,
|
|
19
|
+
...d?.search
|
|
22
20
|
}
|
|
23
21
|
};
|
|
24
|
-
return /* @__PURE__ */
|
|
22
|
+
return /* @__PURE__ */ a("section", {
|
|
25
23
|
className: "ttw:flex ttw:flex-col ttw:gap-3",
|
|
26
|
-
"data-testid":
|
|
24
|
+
"data-testid": u,
|
|
27
25
|
children: [
|
|
28
|
-
/* @__PURE__ */
|
|
26
|
+
/* @__PURE__ */ i(e, {
|
|
29
27
|
component: "h2",
|
|
30
28
|
variant: "h6",
|
|
31
29
|
className: "ttw:font-semibold",
|
|
32
30
|
children: p.heading
|
|
33
31
|
}),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
onClear: l,
|
|
32
|
+
o.mode === "resolved" ? /* @__PURE__ */ i(t, {
|
|
33
|
+
summary: o.summary,
|
|
34
|
+
onEdit: s,
|
|
35
|
+
onClear: c,
|
|
39
36
|
labels: p.summaryCard
|
|
40
|
-
}) :
|
|
41
|
-
|
|
37
|
+
}) : f ? /* @__PURE__ */ i(e, {
|
|
38
|
+
variant: "body2",
|
|
39
|
+
className: "ttw:text-muted-foreground",
|
|
40
|
+
children: p.noVendorPlaceholder
|
|
41
|
+
}) : o.mode === "selecting" ? /* @__PURE__ */ i(n, {
|
|
42
|
+
...o.search,
|
|
42
43
|
labels: p.search
|
|
43
|
-
}) :
|
|
44
|
+
}) : o.newVendorForm,
|
|
45
|
+
l ? /* @__PURE__ */ i("p", {
|
|
46
|
+
className: "ttw:text-sm ttw:text-destructive",
|
|
47
|
+
children: l
|
|
48
|
+
}) : null
|
|
44
49
|
]
|
|
45
50
|
});
|
|
46
51
|
}
|
|
47
52
|
//#endregion
|
|
48
|
-
export {
|
|
53
|
+
export { o as VendorSection, o as default };
|