@tesouro/embedded-components-react 0.5.7 → 0.5.9

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 CHANGED
@@ -2147,6 +2147,14 @@
2147
2147
  border-left-style: var(--tw-border-style);
2148
2148
  border-left-width: 2px;
2149
2149
  }
2150
+ .ttw\:border-l-4 {
2151
+ border-left-style: var(--tw-border-style);
2152
+ border-left-width: 4px;
2153
+ }
2154
+ .ttw\:border-l-4\! {
2155
+ border-left-style: var(--tw-border-style) !important;
2156
+ border-left-width: 4px !important;
2157
+ }
2150
2158
  .ttw\:\!border-none {
2151
2159
  --tw-border-style: none !important;
2152
2160
  border-style: none !important;
@@ -2332,6 +2340,12 @@
2332
2340
  .ttw\:border-b-transparent {
2333
2341
  border-bottom-color: transparent;
2334
2342
  }
2343
+ .ttw\:border-l-amber-600 {
2344
+ border-left-color: var(--ttw-color-amber-600);
2345
+ }
2346
+ .ttw\:border-l-amber-600\! {
2347
+ border-left-color: var(--ttw-color-amber-600) !important;
2348
+ }
2335
2349
  .ttw\:\!bg-gray-800 {
2336
2350
  background-color: var(--ttw-color-gray-800) !important;
2337
2351
  }
@@ -25,7 +25,8 @@ var p = {
25
25
  lineItemsNeedAttention: "Check the highlighted line items before saving.",
26
26
  unreadableDiscount: "Enter a valid discount amount.",
27
27
  unreadableTax: "Enter a valid tax amount.",
28
- unreadableTotal: "Enter a valid total amount."
28
+ unreadableTotal: "Enter a valid total amount.",
29
+ totalNotGreaterThanZero: "Total amount must be greater than $0."
29
30
  }, m = {
30
31
  achMethod: "via ACH bank transfer",
31
32
  noMethod: "No payment method on file",
@@ -27,9 +27,31 @@ function s(i, a, o, s = e) {
27
27
  lineItemErrors: Object.keys(l).length ? l : void 0
28
28
  };
29
29
  }
30
- function c(t, r, i, o = e) {
31
- let s = {};
32
- return a(t) || (s.discount = o.unreadableDiscount), a(r) || (s.tax = o.unreadableTax), i !== void 0 && n(i) === null && (s.total = o.unreadableTotal), Object.keys(s).length ? s : void 0;
30
+ function c(e) {
31
+ let t = e.trim();
32
+ if (!t) return !0;
33
+ let n = t.startsWith("-") ? t.slice(1) : t;
34
+ return i.test(n) ? Number(t.replaceAll(",", "")) <= 0 : !1;
35
+ }
36
+ function l(e, t) {
37
+ if (n(e) === null) return c(e) ? t.totalNotGreaterThanZero : t.unreadableTotal;
38
+ }
39
+ function u(t, n = e) {
40
+ let r = l(t, n);
41
+ return r ? { total: r } : void 0;
42
+ }
43
+ function d(t, r, i = e) {
44
+ if (t === void 0) return;
45
+ let a = n(t);
46
+ if (a !== null) return a - (n(r) ?? 0) > 0 ? void 0 : { total: i.totalNotGreaterThanZero };
47
+ }
48
+ function f(t, n, r, i = e) {
49
+ let o = {};
50
+ if (a(t) || (o.discount = i.unreadableDiscount), a(n) || (o.tax = i.unreadableTax), r !== void 0) {
51
+ let e = l(r, i);
52
+ e && (o.total = e);
53
+ }
54
+ return Object.keys(o).length ? o : void 0;
33
55
  }
34
56
  //#endregion
35
- export { a as isReadableMoneyOrZero, s as validateBillCompleteness, c as validateBillTotals, o as validateLineItems };
57
+ export { a as isReadableMoneyOrZero, s as validateBillCompleteness, u as validateBillTotalIsPayable, f as validateBillTotals, o as validateLineItems, d as validateStoredAmountDue };
@@ -9,27 +9,27 @@ import { useReplacePayableLineItemsMutation as n } from "../../data-access/dist/
9
9
  import { useCreatePayableMutation as r, useDeletePayableFileMutation as i, useSubmitPayableForApprovalMutation as a, useUpdatePayableMutation as o, useValidatePayableMutation as s } from "../../data-access/dist/index13.js";
10
10
  import "../../data-access/dist/index.js";
11
11
  import { BILL_CREATE_MESSAGE_LABELS_EN as c } from "./index47.js";
12
- import { encodeFileToBase64 as ee } from "./index53.js";
13
- import { mapBillFormToPayload as l, mapLineItemsToPayload as u } from "./index54.js";
14
- import { validateBillCompleteness as d, validateBillTotals as f, validateLineItems as p } from "./index55.js";
15
- import { useCallback as m, useRef as h, useState as g } from "react";
12
+ import { encodeFileToBase64 as l } from "./index53.js";
13
+ import { mapBillFormToPayload as u, mapLineItemsToPayload as d } from "./index54.js";
14
+ import { validateBillCompleteness as f, validateBillTotalIsPayable as p, validateBillTotals as m, validateLineItems as h, validateStoredAmountDue as ee } from "./index55.js";
15
+ import { useCallback as g, useRef as _, useState as v } from "react";
16
16
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js
17
- var _ = {
17
+ var y = {
18
18
  document_id: "invoiceNumber",
19
19
  issued_at: "invoiceDate",
20
20
  due_date: "dueDate",
21
21
  counterpart_id: "vendor"
22
- }, v = { tax_amount: "tax" };
23
- function y(e) {
22
+ }, b = { tax_amount: "tax" };
23
+ function x(e) {
24
24
  return e.type === "type_error.none.not_allowed" || e.msg === "none is not an allowed value";
25
25
  }
26
- function b(e) {
26
+ function S(e) {
27
27
  return !!t(e)?.includes("line_items_enabled");
28
28
  }
29
- function x(e, t = c) {
29
+ function C(e, t = c) {
30
30
  let n = {}, r = {}, i = [];
31
31
  for (let a of e) {
32
- let e = a.loc[0] ?? t.unknownValidationField, o = _[e], s = v[e], c = y(a) ? t.requiredField : a.msg;
32
+ let e = a.loc[0] ?? t.unknownValidationField, o = y[e], s = b[e], c = x(a) ? t.requiredField : a.msg;
33
33
  o ? n[o] = c : s ? r[s] = c : i.push(t.unmappedValidationError(e, c));
34
34
  }
35
35
  return i.length && (n.form = i.join(" ")), {
@@ -37,7 +37,7 @@ function x(e, t = c) {
37
37
  totalsErrors: Object.keys(r).length ? r : void 0
38
38
  };
39
39
  }
40
- function S(e, t) {
40
+ function te(e, t) {
41
41
  if (!e && !t) return;
42
42
  let n = {}, r = /* @__PURE__ */ new Set([...Object.keys(e ?? {}), ...Object.keys(t ?? {})]);
43
43
  for (let i of r) n[i] = {
@@ -46,161 +46,165 @@ function S(e, t) {
46
46
  };
47
47
  return n;
48
48
  }
49
- function C({ payableId: t, form: _, counterpartId: v, clearCounterpart: y, prepareVendorForSave: C, onSaved: w, onPayableCreated: T, readSavedStatus: E, onDraftSaved: D, onFinalized: O, labels: k }) {
50
- let A = {
49
+ function w({ payableId: t, form: y, counterpartId: b, clearCounterpart: x, prepareVendorForSave: w, onSaved: T, onPayableCreated: E, readSavedStatus: D, onDraftSaved: O, onFinalized: k, labels: A }) {
50
+ let j = {
51
51
  ...c,
52
- ...k
53
- }, [j, M] = g(), N = t ?? j, [P, F] = g(), I = m(() => F(void 0), []), [L, R] = g(!1), z = m(() => R(!0), []), [B, V] = g(), H = h(!1), [U, te] = g(0), W = m(() => te((e) => e + 1), []), G = r(), K = i(), q = o(), J = n(), Y = s(), X = a(), Z = m(() => _.isTotalsDirty ? f(_.discount, _.tax, _.totalOverride, A) : void 0, [_, A]), Q = m(() => {
54
- let t = p(_.lineItems, A), n = Z();
55
- return _.setLineItemErrors(t), _.setTotalsErrors(n), !t && !n || (_.setErrors(void 0), t && e.error(A.lineItemsNeedAttention), W(), !1);
52
+ ...A
53
+ }, [M, N] = v(), P = t ?? M, [F, I] = v(), L = g(() => I(void 0), []), [R, z] = v(!1), B = g(() => z(!0), []), [V, H] = v(), U = _(!1), [ne, re] = v(0), W = g(() => re((e) => e + 1), []), G = r(), K = i(), q = o(), J = n(), Y = s(), X = a(), Z = g(() => y.isTotalsDirty ? m(y.discount, y.tax, y.totalOverride, j) : void 0, [y, j]), Q = g(() => {
54
+ let t = h(y.lineItems, j), n = Z();
55
+ return y.setLineItemErrors(t), y.setTotalsErrors(n), !t && !n || (y.setErrors(void 0), t && e.error(j.lineItemsNeedAttention), W(), !1);
56
56
  }, [
57
- _,
58
- A,
57
+ y,
58
+ j,
59
59
  W,
60
60
  Z
61
- ]), $ = m(async (e) => {
62
- let t = !N && P ? {
63
- base64EncodedFile: await ee(P),
64
- fileName: P.name
65
- } : void 0, n = l({
66
- values: _.values,
67
- counterpartId: v,
68
- clearCounterpart: y,
61
+ ]), $ = g(async (e) => {
62
+ let t = !P && F ? {
63
+ base64EncodedFile: await l(F),
64
+ fileName: F.name
65
+ } : void 0, n = u({
66
+ values: y.values,
67
+ counterpartId: b,
68
+ clearCounterpart: x,
69
69
  counterpartBankAccountId: e,
70
- editedTotals: _.isTotalsDirty ? {
71
- discount: _.discount,
72
- tax: _.tax,
73
- total: _.totalOverride
70
+ editedTotals: y.isTotalsDirty ? {
71
+ discount: y.discount,
72
+ tax: y.tax,
73
+ total: y.totalOverride
74
74
  } : void 0,
75
75
  document: t
76
- }), r = N;
76
+ }), r = P;
77
77
  if (r ? await q.mutateAsync({
78
78
  path: { payable_id: r },
79
79
  body: n
80
- }) : (r = (await G.mutateAsync({ body: n }))?.id, r && (M(r), T?.(r), t && F(void 0))), !r) throw Error("Payable was created without an id");
81
- if (L) {
80
+ }) : (r = (await G.mutateAsync({ body: n }))?.id, r && (N(r), E?.(r), t && I(void 0))), !r) throw Error("Payable was created without an id");
81
+ if (R) {
82
82
  try {
83
83
  await K.mutateAsync({ path: { payable_id: r } });
84
84
  } catch {}
85
- R(!1);
85
+ z(!1);
86
86
  }
87
87
  return await J.mutateAsync({
88
88
  path: { payable_id: r },
89
- body: { data: u(_.lineItems) }
89
+ body: { data: d(y.lineItems) }
90
90
  }), r;
91
91
  }, [
92
- v,
93
- y,
92
+ b,
93
+ x,
94
94
  G,
95
95
  K,
96
- L,
97
- _.discount,
98
- _.isTotalsDirty,
99
- _.lineItems,
100
- _.tax,
101
- _.totalOverride,
102
- _.values,
103
- T,
104
- N,
105
- J,
96
+ R,
97
+ y.discount,
98
+ y.isTotalsDirty,
99
+ y.lineItems,
100
+ y.tax,
101
+ y.totalOverride,
102
+ y.values,
103
+ E,
106
104
  P,
105
+ J,
106
+ F,
107
107
  q
108
- ]), ne = m(async () => {
109
- N && (await K.mutateAsync({ path: { payable_id: N } }), R(!1));
110
- }, [K, N]);
108
+ ]), ie = g(async () => {
109
+ P && (await K.mutateAsync({ path: { payable_id: P } }), z(!1));
110
+ }, [K, P]);
111
111
  return {
112
- saveDraft: m(async () => {
113
- if (!H.current && Q()) {
114
- H.current = !0, V("draft");
112
+ saveDraft: g(async () => {
113
+ if (!U.current && Q()) {
114
+ U.current = !0, H("draft");
115
115
  try {
116
- let t = await C?.();
116
+ let t = await w?.();
117
117
  if (t && !t.ok) return;
118
118
  let n = await $(t?.counterpartBankAccountId);
119
- _.setErrors(void 0), w?.(n), D?.(n);
120
- let r = await E?.();
121
- return e.success(r === "draft" ? A.submittedDemoted : A.draftSaved), n;
119
+ y.setErrors(void 0), T?.(n), O?.(n);
120
+ let r = await D?.();
121
+ return e.success(r === "draft" ? j.submittedDemoted : j.draftSaved), n;
122
122
  } catch (e) {
123
- _.setSaveFailureMessage(b(e) ? A.discountTaxBlockedByLineItems : A.saveFailed), W();
123
+ y.setSaveFailureMessage(S(e) ? j.discountTaxBlockedByLineItems : j.saveFailed), W();
124
124
  return;
125
125
  } finally {
126
- V(void 0), H.current = !1;
126
+ H(void 0), U.current = !1;
127
127
  }
128
128
  }
129
129
  }, [
130
- _,
130
+ y,
131
131
  Q,
132
- A.discountTaxBlockedByLineItems,
133
- A.draftSaved,
134
- A.saveFailed,
135
- A.submittedDemoted,
132
+ j.discountTaxBlockedByLineItems,
133
+ j.draftSaved,
134
+ j.saveFailed,
135
+ j.submittedDemoted,
136
+ O,
137
+ T,
136
138
  D,
137
139
  w,
138
- E,
139
- C,
140
140
  $,
141
141
  W
142
142
  ]),
143
- finalize: m(async () => {
144
- if (H.current) return;
145
- let t = p(_.lineItems, A), n = Z(), { formErrors: r, lineItemErrors: i } = d(_.values, v, _.lineItems, A), a = S(i, t);
146
- _.setLineItemErrors(a), _.setTotalsErrors(n);
147
- let o = r ?? {};
148
- if (_.setErrors(Object.keys(o).length ? o : void 0), t && e.error(A.lineItemsNeedAttention), a || n || Object.keys(o).length) {
143
+ finalize: g(async () => {
144
+ if (U.current) return;
145
+ let t = h(y.lineItems, j), n = Z(), r = p(y.total, j), i = y.isTotalsDirty ? ee(y.totalOverride, y.discount, j) : void 0, a = n || r || i ? {
146
+ ...i,
147
+ ...r,
148
+ ...n
149
+ } : void 0, { formErrors: o, lineItemErrors: s } = f(y.values, b, y.lineItems, j), c = te(s, t);
150
+ y.setLineItemErrors(c), y.setTotalsErrors(a);
151
+ let l = o ?? {};
152
+ if (y.setErrors(Object.keys(l).length ? l : void 0), t && e.error(j.lineItemsNeedAttention), c || a || Object.keys(l).length) {
149
153
  W();
150
154
  return;
151
155
  }
152
- H.current = !0, V("finalize");
156
+ U.current = !0, H("finalize");
153
157
  try {
154
158
  let t;
155
159
  try {
156
- let e = await C?.();
160
+ let e = await w?.();
157
161
  if (e && !e.ok) return;
158
162
  t = await $(e?.counterpartBankAccountId);
159
163
  } catch (e) {
160
- _.setSaveFailureMessage(b(e) ? A.discountTaxBlockedByLineItems : A.saveFailed), W();
164
+ y.setSaveFailureMessage(S(e) ? j.discountTaxBlockedByLineItems : j.saveFailed), W();
161
165
  return;
162
166
  }
163
- w?.(t);
167
+ T?.(t);
164
168
  try {
165
169
  let n = await Y.mutateAsync({ path: { payable_id: t } });
166
170
  if (n.validation_errors.length) {
167
- let e = x(n.validation_errors, A);
168
- _.setErrors(e.formErrors), _.setTotalsErrors(e.totalsErrors), W();
171
+ let e = C(n.validation_errors, j);
172
+ y.setErrors(e.formErrors), y.setTotalsErrors(e.totalsErrors), W();
169
173
  return;
170
174
  }
171
- await X.mutateAsync({ path: { payable_id: t } }), _.setErrors(void 0), O?.(t), e.success(A.billFinalized);
175
+ await X.mutateAsync({ path: { payable_id: t } }), y.setErrors(void 0), k?.(t), e.success(j.billFinalized);
172
176
  } catch {
173
- _.setSaveFailureMessage(A.finalizeFailed), W();
177
+ y.setSaveFailureMessage(j.finalizeFailed), W();
174
178
  }
175
179
  } finally {
176
- V(void 0), H.current = !1;
180
+ H(void 0), U.current = !1;
177
181
  }
178
182
  }, [
179
- v,
180
- _,
181
- A,
182
- O,
183
+ b,
184
+ y,
185
+ j,
186
+ k,
187
+ T,
183
188
  w,
184
- C,
185
189
  $,
186
190
  W,
187
191
  X,
188
192
  Z,
189
193
  Y
190
194
  ]),
191
- payableId: N,
192
- isSavingDraft: B === "draft",
193
- isFinalizing: B === "finalize",
194
- stagedFile: P,
195
- stageFile: F,
196
- clearStagedFile: I,
197
- scrollToErrorToken: U,
198
- isFileDeletionPending: L,
199
- requestFileDeletion: z,
200
- detachFileNow: ne,
195
+ payableId: P,
196
+ isSavingDraft: V === "draft",
197
+ isFinalizing: V === "finalize",
198
+ stagedFile: F,
199
+ stageFile: I,
200
+ clearStagedFile: L,
201
+ scrollToErrorToken: ne,
202
+ isFileDeletionPending: R,
203
+ requestFileDeletion: B,
204
+ detachFileNow: ie,
201
205
  isDeletingFile: K.isPending,
202
206
  hasFileDeletionFailed: K.isError
203
207
  };
204
208
  }
205
209
  //#endregion
206
- export { x as mapValidationErrorsToForm, C as useBillCreateController };
210
+ export { C as mapValidationErrorsToForm, w as useBillCreateController };
@@ -32,7 +32,7 @@ var t = {
32
32
  duplicateWarningMany: (e) => `${e} possible duplicate bills found`,
33
33
  duplicateWarningManyCapped: (e) => `${e}+ possible duplicate bills found`,
34
34
  duplicateWarningUnavailable: "Couldn't check for possible duplicates. Try again shortly.",
35
- duplicateBadge: "Duplicate?",
35
+ duplicateRowNote: "Possible duplicate",
36
36
  attachmentIndicator: "Has an attachment",
37
37
  emptyHeading: "Add your first bill",
38
38
  nonEmptyHeading: "Add a bill",
@@ -18,7 +18,7 @@ var x = 10, S = [{
18
18
  id: "addedOnLabel",
19
19
  desc: !0
20
20
  }];
21
- function C({ enabled: C = !0, canReadVendors: w = !0, isVendorFilterPaused: T = !1, filterLabels: E, onOpenBill: D, duplicateBadgeLabel: O, attachmentLabel: k }) {
21
+ function C({ enabled: C = !0, canReadVendors: w = !0, isVendorFilterPaused: T = !1, filterLabels: E, onOpenBill: D, duplicateRowNote: O, attachmentLabel: k }) {
22
22
  let [A, j] = b(l), [M, N] = b(S), [P, F] = b(x), [I, L] = b(), [R, z] = b(""), [B, V] = b(""), H = _(() => L(void 0), []);
23
23
  v(() => {
24
24
  let e = setTimeout(() => {
@@ -63,10 +63,10 @@ function C({ enabled: C = !0, canReadVendors: w = !0, isVendorFilterPaused: T =
63
63
  status: i.status,
64
64
  statusTone: i.tone,
65
65
  addedOnLabel: e(r.created_at?.slice(0, 10)),
66
- duplicateBadge: n(r) ? {
67
- label: O,
68
- tone: "warning"
69
- } : void 0,
66
+ ...n(r) ? {
67
+ rowTone: "warning",
68
+ rowNote: O
69
+ } : {},
70
70
  onOpen: () => D(r.id, s(r.status))
71
71
  };
72
72
  }), [
@@ -100,7 +100,7 @@ function D({ labels: u, onEnqueueFiles: b, openPayableId: x, onOpenPayableHandle
100
100
  isVendorFilterPaused: V,
101
101
  filterLabels: w.filters,
102
102
  onOpenBill: K,
103
- duplicateBadgeLabel: w.duplicateBadge,
103
+ duplicateRowNote: w.duplicateRowNote,
104
104
  attachmentLabel: w.attachmentIndicator
105
105
  }), Y = i({ enabled: W }), oe = m(Y, w), se = g(() => l.map((e) => ({
106
106
  id: e,
@@ -255,7 +255,7 @@ function E({ items: E, glCodeOptions: D, glCodeDisabled: O, glCodeUnavailableMes
255
255
  htmlFor: `${U}-discount`,
256
256
  children: H.discount
257
257
  }), /* @__PURE__ */ b("div", {
258
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
258
+ className: "ttw:flex ttw:flex-col ttw:items-end ttw:gap-1.5",
259
259
  children: [/* @__PURE__ */ b(n, {
260
260
  className: "ttw:w-36",
261
261
  children: [/* @__PURE__ */ y(r, {
@@ -282,7 +282,7 @@ function E({ items: E, glCodeOptions: D, glCodeDisabled: O, glCodeUnavailableMes
282
282
  htmlFor: `${U}-tax`,
283
283
  children: H.tax
284
284
  }), /* @__PURE__ */ b("div", {
285
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
285
+ className: "ttw:flex ttw:flex-col ttw:items-end ttw:gap-1.5",
286
286
  children: [/* @__PURE__ */ b(n, {
287
287
  className: "ttw:w-36",
288
288
  children: [/* @__PURE__ */ y(r, {
@@ -310,7 +310,7 @@ function E({ items: E, glCodeOptions: D, glCodeDisabled: O, glCodeUnavailableMes
310
310
  className: "ttw:font-semibold",
311
311
  children: H.totalAmount
312
312
  }), /* @__PURE__ */ b("div", {
313
- className: "ttw:flex ttw:flex-col ttw:gap-1.5",
313
+ className: "ttw:flex ttw:flex-col ttw:items-end ttw:gap-1.5",
314
314
  children: [/* @__PURE__ */ b(n, {
315
315
  className: "ttw:w-36",
316
316
  children: [/* @__PURE__ */ y(r, {
@@ -1,13 +1,2 @@
1
- import { Badge as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { BADGE_TONE_CLASS_NAME as t } from "./index18.js";
3
- import { jsx as n } from "react/jsx-runtime";
4
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js
5
- function r({ label: r, tone: i = "warning" }) {
6
- return /* @__PURE__ */ n(e, {
7
- variant: "outline",
8
- className: t[i],
9
- children: r
10
- });
11
- }
12
- //#endregion
13
- export { r as BillDuplicateBadge, r as default };
1
+ import "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import "react/jsx-runtime";
@@ -11,21 +11,25 @@ import "./index23.js";
11
11
  import { MissingValue as u } from "./index59.js";
12
12
  import "./index60.js";
13
13
  import { BILLS_SCREEN_LABELS_EN as d, BILLS_SCREEN_UPLOAD_ACCEPT as f } from "./index61.js";
14
- import { BillDuplicateBadge as le } from "./index63.js";
15
- import "./index64.js";
16
- import { BillsFilterBar as ue } from "./index73.js";
14
+ import { BillsFilterBar as le } from "./index73.js";
17
15
  import "./index74.js";
18
16
  import { BillColumn as p } from "./index75.js";
19
17
  import { useMemo as m } from "react";
20
18
  import { jsx as h, jsxs as g } from "react/jsx-runtime";
21
- import { ChevronRightIcon as de, CopyX as fe, PaperclipIcon as pe, PlusIcon as me, SearchIcon as he } from "lucide-react";
19
+ import { ChevronRightIcon as ue, PaperclipIcon as de, PlusIcon as fe, SearchIcon as pe } from "lucide-react";
22
20
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js
23
- var ge = [
21
+ var me = [
24
22
  10,
25
23
  25,
26
24
  50,
27
25
  100
28
- ], _e = 240, _ = 40, ve = [
26
+ ], he = 240, ge = {
27
+ default: "",
28
+ warning: "ttw:bg-amber-50 ttw:hover:bg-amber-100 ttw:border-l-4! ttw:border-l-amber-600!"
29
+ }, _e = {
30
+ default: "",
31
+ warning: "ttw:-ml-1 ttw:font-semibold ttw:text-amber-800"
32
+ }, _ = 40, ve = [
29
33
  p.Vendor,
30
34
  p.Attachment,
31
35
  p.IssueDate,
@@ -46,7 +50,7 @@ var ge = [
46
50
  p.AmountDue,
47
51
  p.AddedOn
48
52
  ];
49
- function y({ rows: y, isLoading: b, isError: x, sorting: ye, onSortingChange: be, pageSize: S, onPageSizeChange: C, pageSizeOptions: w = ge, pageInfo: T, hasNextPage: E, hasPrevPage: D, onNextPage: O, onPrevPage: k, filterTabs: A, selectedFilterTabId: j, onFilterTabChange: M, searchValue: N, onSearchChange: xe, filters: P, visibleColumns: F = v, cellTestIds: I, isSearchActive: L, showAddPanelWhenEmpty: Se, emptyState: R, onCreateClick: z, onRetry: B, onFilesSelected: V, maxFiles: H, onEnterManually: U, uploadStatus: W, uploadErrorMessage: G, emailAddress: K, onCopyEmail: q, labels: J, duplicateWarning: Y, onReviewDuplicates: X }) {
53
+ function y({ rows: y, isLoading: b, isError: x, sorting: ye, onSortingChange: be, pageSize: S, onPageSizeChange: C, pageSizeOptions: w = me, pageInfo: T, hasNextPage: E, hasPrevPage: D, onNextPage: O, onPrevPage: k, filterTabs: A, selectedFilterTabId: j, onFilterTabChange: M, searchValue: N, onSearchChange: xe, filters: P, visibleColumns: F = v, cellTestIds: I, isSearchActive: L, showAddPanelWhenEmpty: Se, emptyState: R, onCreateClick: z, onRetry: B, onFilesSelected: V, maxFiles: H, onEnterManually: U, uploadStatus: W, uploadErrorMessage: G, emailAddress: K, onCopyEmail: q, labels: J, duplicateWarning: Y, onReviewDuplicates: X }) {
50
54
  let Z = m(() => ({
51
55
  ...d,
52
56
  ...J,
@@ -113,11 +117,15 @@ function y({ rows: y, isLoading: b, isError: x, sorting: ye, onSortingChange: be
113
117
  [p.Vendor]: {
114
118
  accessorKey: "vendorLabel",
115
119
  enableSorting: !0,
116
- minSize: _e,
120
+ minSize: he,
117
121
  header: e(Z.columnVendor),
118
- cell: ({ row: e }) => /* @__PURE__ */ h("span", {
122
+ cell: ({ row: e }) => /* @__PURE__ */ g("span", {
123
+ className: _e[e.original.rowTone ?? "default"],
119
124
  "data-testid": I?.[p.Vendor],
120
- children: e.original.vendorLabel || /* @__PURE__ */ h(u, { labels: Z.missingValue })
125
+ children: [e.original.vendorLabel || /* @__PURE__ */ h(u, { labels: Z.missingValue }), e.original.rowNote ? /* @__PURE__ */ h("span", {
126
+ className: "ttw:sr-only",
127
+ children: ` ${e.original.rowNote}`
128
+ }) : null]
121
129
  })
122
130
  },
123
131
  [p.Attachment]: {
@@ -137,7 +145,7 @@ function y({ rows: y, isLoading: b, isError: x, sorting: ye, onSortingChange: be
137
145
  className: "ttw:inline-flex ttw:cursor-default",
138
146
  "aria-label": e.original.attachment.label,
139
147
  onClick: (e) => e.stopPropagation(),
140
- children: /* @__PURE__ */ h(pe, { className: "ttw:size-3.5 ttw:shrink-0 ttw:text-muted-foreground" })
148
+ children: /* @__PURE__ */ h(de, { className: "ttw:size-3.5 ttw:shrink-0 ttw:text-muted-foreground" })
141
149
  }), /* @__PURE__ */ h(re, { children: e.original.attachment.label })] }) })
142
150
  }) : null
143
151
  },
@@ -169,14 +177,14 @@ function y({ rows: y, isLoading: b, isError: x, sorting: ye, onSortingChange: be
169
177
  accessorKey: "status",
170
178
  enableSorting: !1,
171
179
  header: Z.columnStatus,
172
- cell: ({ row: e }) => /* @__PURE__ */ g("div", {
180
+ cell: ({ row: e }) => /* @__PURE__ */ h("div", {
173
181
  className: "ttw:flex ttw:items-center ttw:gap-1",
174
182
  "data-testid": I?.[p.Status],
175
- children: [/* @__PURE__ */ h(se, {
183
+ children: /* @__PURE__ */ h(se, {
176
184
  status: e.original.status,
177
185
  tone: e.original.statusTone,
178
186
  labels: Z.statusBadge
179
- }), e.original.duplicateBadge ? /* @__PURE__ */ h(le, { ...e.original.duplicateBadge }) : null]
187
+ })
180
188
  })
181
189
  },
182
190
  [p.AmountDue]: {
@@ -226,7 +234,7 @@ function y({ rows: y, isLoading: b, isError: x, sorting: ye, onSortingChange: be
226
234
  onClick: (t) => {
227
235
  t.stopPropagation(), e.original.onOpen();
228
236
  },
229
- children: /* @__PURE__ */ h(de, { className: "ttw:size-4" })
237
+ children: /* @__PURE__ */ h(ue, { className: "ttw:size-4" })
230
238
  })
231
239
  })
232
240
  }], [
@@ -235,7 +243,7 @@ function y({ rows: y, isLoading: b, isError: x, sorting: ye, onSortingChange: be
235
243
  F
236
244
  ]), we = !!(z && V) && !b && !x && !L && y.length === 0 && Se === !0, $ = /* @__PURE__ */ g("div", {
237
245
  className: "ttw:relative ttw:w-80",
238
- children: [/* @__PURE__ */ h(he, { 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__ */ h(i, {
246
+ children: [/* @__PURE__ */ h(pe, { 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__ */ h(i, {
239
247
  className: "ttw:pl-9",
240
248
  type: "search",
241
249
  "aria-label": Z.searchLabel,
@@ -243,7 +251,7 @@ function y({ rows: y, isLoading: b, isError: x, sorting: ye, onSortingChange: be
243
251
  value: N,
244
252
  onChange: (e) => xe(e.target.value)
245
253
  })]
246
- }), Te = P ? /* @__PURE__ */ h(ue, {
254
+ }), Te = P ? /* @__PURE__ */ h(le, {
247
255
  ...P,
248
256
  className: "ttw:px-4",
249
257
  searchSlot: $
@@ -254,21 +262,17 @@ function y({ rows: y, isLoading: b, isError: x, sorting: ye, onSortingChange: be
254
262
  return /* @__PURE__ */ g("div", {
255
263
  className: "ttw:flex ttw:flex-col ttw:gap-3",
256
264
  children: [Y ? /* @__PURE__ */ g(e, {
257
- className: "ttw:[&>svg]:size-6 ttw:flex ttw:items-center ttw:bg-amber-50 ttw:text-amber-700 ttw:border-amber-300",
258
- children: [
259
- /* @__PURE__ */ h(fe, {}),
260
- /* @__PURE__ */ h(t, {
261
- className: "ttw:flex-1",
262
- children: Y
263
- }),
264
- X ? /* @__PURE__ */ h(n, {
265
- type: "button",
266
- variant: "outline",
267
- className: "ttw:text-foreground",
268
- onClick: X,
269
- children: Z.duplicateBillsReviewButton
270
- }) : null
271
- ]
265
+ 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",
266
+ children: [/* @__PURE__ */ h(t, {
267
+ className: "ttw:flex-1 ttw:font-semibold",
268
+ children: Y
269
+ }), X ? /* @__PURE__ */ h(n, {
270
+ type: "button",
271
+ variant: "outline",
272
+ className: "ttw:text-foreground",
273
+ onClick: X,
274
+ children: Z.duplicateBillsReviewButton
275
+ }) : null]
272
276
  }) : null, /* @__PURE__ */ g(te, {
273
277
  value: j,
274
278
  onValueChange: M,
@@ -284,7 +288,7 @@ function y({ rows: y, isLoading: b, isError: x, sorting: ye, onSortingChange: be
284
288
  }, e.id))
285
289
  }), z ? /* @__PURE__ */ g(n, {
286
290
  onClick: z,
287
- children: [/* @__PURE__ */ h(me, { className: "ttw:size-4" }), Z.createButton]
291
+ children: [/* @__PURE__ */ h(fe, { className: "ttw:size-4" }), Z.createButton]
288
292
  }) : null]
289
293
  }), (() => {
290
294
  let e = x ? /* @__PURE__ */ h(oe, {
@@ -328,6 +332,7 @@ function y({ rows: y, isLoading: b, isError: x, sorting: ye, onSortingChange: be
328
332
  onNextPage: O,
329
333
  onPrevPage: k,
330
334
  onRowClick: (e) => e.onOpen(),
335
+ rowClassName: (e) => ge[e.rowTone ?? "default"],
331
336
  filterComponent: Te,
332
337
  children: L ? /* @__PURE__ */ h(c, {
333
338
  title: Z.filteredEmptyTitle,
@@ -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.7", n = "8f5acc275bfd0dc04a0b01538da86c5fd2b31132", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.5.9", n = "fa29013241e781286ad74752703fc9b45fd401b2", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n