@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 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 p = { currency: t };
29
- if (i ? p.counterpart_id = i : a && (p.counterpart_id = null), i ? p.counterpart_bank_account_id = o ?? null : a && (p.counterpart_bank_account_id = null), e.invoiceNumber && (p.document_id = e.invoiceNumber), e.invoiceDate && (p.issued_at = e.invoiceDate), e.dueDate && (p.due_date = e.dueDate), f && (p.base64_encoded_file = f.base64EncodedFile, p.file_name = f.fileName), s && (p.discount = n(s.discount) ?? 0, p.tax_amount = n(s.tax) ?? 0, s.total !== void 0 && (p.total_amount = (n(s.total) ?? 0) + (n(s.discount) ?? 0))), c && d) {
30
- let e = u(d).reduce((e, t) => e + t.subtotal, 0), t = n(c.tax) ?? 0, r = n(c.discount) ?? 0, i = c.total === void 0 ? e + t : (n(c.total) ?? 0) + r;
31
- p.subtotal = e, p.tax_amount = t, p.total_amount = i;
32
- } else if (r && !("total_amount" in p)) {
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 && (p.total_amount = e);
36
+ e !== void 0 && (m.total_amount = e);
35
37
  }
36
- return p;
38
+ return m;
37
39
  }
38
40
  function l(e, t) {
39
- let r = !1, a = e.reduce((e, t) => {
40
- if (!i(t)) return e;
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 d(e, t) {
74
+ function p(e, t) {
62
75
  return s(Math.round(o(e) * a(t)));
63
76
  }
64
- function f(e, t, n) {
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 { f as calculateTotal, d as displayLineAmount, i as isPersistableLineItem, c as mapBillFormToPayload, u as mapLineItemsToPayload, n as parseMoneyToMinorUnits, r as parseQuantity };
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 te, validateBillTotalIsPayable as ne, validateBillTotals as d, validateBillValues as f, validateLineItems as p, validateStoredAmountDue as m } from "./index56.js";
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 re = "pending-vendor";
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 C(e, t) {
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 w({ payableId: t, form: v, counterpartId: y, isVendorPending: b, clearCounterpart: w, prepareVendorForSave: T, onSaved: E, onPayableCreated: D, readSavedStatus: O, onDraftSaved: k, onFinalized: A, labels: j }) {
52
- let M = {
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
- ...j
55
- }, [N, P] = _(), F = t ?? N, [I, L] = _(), R = h(() => L(void 0), []), [z, B] = _(!1), ie = h(() => B(!0), []), [V, H] = _(), U = g(!1), [ae, oe] = _(0), W = h(() => oe((e) => e + 1), []), G = r(), K = i(), q = o(), J = n(), Y = s(), X = a(), Z = h(() => v.isTotalsDirty ? d(v.discount, v.tax, v.totalOverride, M) : void 0, [v, M]), Q = h(() => {
56
- let t = f(v.values, M), n = p(v.lineItems, M), r = Z();
57
- return v.setErrors(t), v.setLineItemErrors(n), v.setTotalsErrors(r), !t && !n && !r || (n && e.error(M.lineItemsNeedAttention), W(), !1);
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
- M,
60
+ j,
61
61
  W,
62
62
  Z
63
63
  ]), $ = h(async (e, t) => {
64
- let n = !F && I ? {
65
- base64EncodedFile: await l(I),
66
- fileName: I.name
67
- } : void 0, r = u({
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: F ? void 0 : v.lineItems,
73
+ initialLineItems: P ? void 0 : v.lineItems,
70
74
  counterpartId: t ?? y,
71
- clearCounterpart: w,
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
- }), i = F;
86
- if (i ? await q.mutateAsync({
87
- path: { payable_id: i },
88
- body: r
89
- }) : (i = (await G.mutateAsync({ body: r }))?.id, i && (P(i), D?.(i), n && L(void 0))), !i) throw Error("Payable was created without an id");
90
- if (z) {
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: i } });
92
+ await K.mutateAsync({ path: { payable_id: a } });
93
93
  } catch {}
94
- B(!1);
94
+ R(!1);
95
95
  }
96
96
  return await J.mutateAsync({
97
- path: { payable_id: i },
98
- body: { data: ee(v.lineItems) }
99
- }), i;
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
- w,
108
+ C,
103
109
  G,
104
110
  K,
105
- z,
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
- D,
113
- F,
118
+ E,
119
+ P,
114
120
  J,
115
- I,
121
+ F,
116
122
  q
117
- ]), se = h(async () => {
118
- F && (await K.mutateAsync({ path: { payable_id: F } }), B(!1));
119
- }, [K, F]);
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 (!U.current && Q()) {
123
- U.current = !0, H("draft");
128
+ if (!V.current && Q()) {
129
+ V.current = !0, B("draft");
124
130
  try {
125
- let t = await T?.();
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), E?.(n), k?.(n);
129
- let r = await O?.();
130
- return e.success(r === "draft" ? M.submittedDemoted : M.draftSaved), n;
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) ? M.discountTaxBlockedByLineItems : M.saveFailed), W();
138
+ v.setSaveFailureMessage(x(e) ? j.discountTaxBlockedByLineItems : j.saveFailed), W();
133
139
  return;
134
140
  } finally {
135
- H(void 0), U.current = !1;
141
+ B(void 0), V.current = !1;
136
142
  }
137
143
  }
138
144
  }, [
139
145
  v,
140
146
  Q,
141
- M.discountTaxBlockedByLineItems,
142
- M.draftSaved,
143
- M.saveFailed,
144
- M.submittedDemoted,
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 (U.current) return;
154
- let t = p(v.lineItems, M), n = f(v.values, M), r = Z(), i = ne(v.total, M), a = v.isTotalsDirty ? m(v.totalOverride, M) : void 0, o = r || i || a ? {
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 } = te(v.values, y ?? (b ? re : void 0), v.lineItems, M), l = C(c, t);
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(M.lineItemsNeedAttention), l || o || Object.keys(u).length) {
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
- U.current = !0, H("finalize");
174
+ V.current = !0, B("finalize");
169
175
  try {
170
176
  let t;
171
177
  try {
172
- let e = await T?.();
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) ? M.discountTaxBlockedByLineItems : M.saveFailed), W();
182
+ v.setSaveFailureMessage(x(e) ? j.discountTaxBlockedByLineItems : j.saveFailed), W();
177
183
  return;
178
184
  }
179
- E?.(t);
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, M);
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), A?.(t), e.success(M.billFinalized);
193
+ await X.mutateAsync({ path: { payable_id: t } }), v.setErrors(void 0), k?.(t), e.success(j.billFinalized);
188
194
  } catch {
189
- v.setSaveFailureMessage(M.finalizeFailed), W();
195
+ v.setSaveFailureMessage(j.finalizeFailed), W();
190
196
  }
191
197
  } finally {
192
- H(void 0), U.current = !1;
198
+ B(void 0), V.current = !1;
193
199
  }
194
200
  }, [
195
201
  y,
196
202
  b,
197
203
  v,
198
- M,
199
- A,
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: F,
209
- isSavingDraft: V === "draft",
210
- isFinalizing: V === "finalize",
211
- stagedFile: I,
212
- stageFile: L,
213
- clearStagedFile: R,
214
- scrollToErrorToken: ae,
215
- isFileDeletionPending: z,
216
- requestFileDeletion: ie,
217
- detachFileNow: se,
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, w as useBillCreateController };
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({ status: d = "idle", errorMessage: f, accept: p = ".pdf,.png,.jpg,.jpeg", multiple: m = !0, maxFiles: h, onFilesSelected: g, testId: _, labels: v }) {
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 = d === "uploading";
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) : []).filter((e) => u(e, p)), n = m ? t : t.slice(0, 1);
36
- n.length > 0 && g(n);
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) : []).filter((e) => u(e, p)), n = m ? t : t.slice(0, 1);
66
- n.length > 0 && g(n), e.target.value = "";
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
- d === "error" && f ? /* @__PURE__ */ o(t, { children: f }) : null
73
+ u === "error" && f ? /* @__PURE__ */ o(t, { children: f }) : null
70
74
  ]
71
75
  });
72
76
  }
73
77
  //#endregion
74
- export { d as BillUploadDropzone, d as default };
78
+ export { f as BillUploadDropzone, f as default, d as getAcceptedBillUploadFiles };
@@ -79,6 +79,7 @@ var s = {
79
79
  errorTitle: "Couldn't load bills",
80
80
  errorDescription: "Something went wrong. Try again.",
81
81
  errorRetry: "Retry",
82
+ tableDropzoneTitle: "Drop your files here",
82
83
  statusBadge: r,
83
84
  addBill: l,
84
85
  sortableHeader: {
@@ -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 ie } from "./index19.js";
9
+ import { BillStatusBadge as ae } from "./index19.js";
8
10
  import "./index20.js";
9
- import { DueDateValue as ae } from "./index22.js";
11
+ import { DueDateValue as p } from "./index22.js";
10
12
  import "./index23.js";
11
- import { MissingValue as p } from "./index59.js";
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 m, BILLS_SCREEN_UPLOAD_ACCEPT as h } from "./index64.js";
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 g } from "./index81.js";
19
- import { useMemo as _ } from "react";
20
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
21
- import { ChevronRightIcon as b, PaperclipIcon as x, PlusIcon as ce, SearchIcon as le, SettingsIcon as ue } from "lucide-react";
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 de = [
25
+ var he = [
24
26
  10,
25
27
  25,
26
28
  50,
27
29
  100
28
- ], fe = 240, pe = {
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
- }, me = {
33
+ }, ve = {
32
34
  default: "",
33
35
  warning: "ttw:-ml-1 ttw:font-semibold ttw:text-amber-800"
34
- }, S = 40, he = [
35
- g.Vendor,
36
- g.Attachment,
37
- g.IssueDate,
38
- g.DueDate,
39
- g.ScheduledDate,
40
- g.PaidDate,
41
- g.Status,
42
- g.AmountDue,
43
- g.AmountScheduled,
44
- g.AmountPaid,
45
- g.TotalAmount,
46
- g.AddedOn
47
- ], C = [
48
- g.Vendor,
49
- g.Attachment,
50
- g.DueDate,
51
- g.Status,
52
- g.AmountDue,
53
- g.AddedOn
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 w({ rows: w, isLoading: T, isError: E, sorting: ge, onSortingChange: _e, pageSize: ve, onPageSizeChange: ye, pageSizeOptions: be = de, pageInfo: xe, hasNextPage: D, hasPrevPage: O, onNextPage: k, onPrevPage: A, filterTabs: j, selectedFilterTabId: M, onFilterTabChange: Se, searchValue: Ce, onSearchChange: we, filters: N, visibleColumns: P = C, cellTestIds: F, isSearchActive: I, showAddPanelWhenEmpty: Te, emptyState: L, onCreateClick: R, onSettingsClick: z, onRetry: B, onFilesSelected: V, maxFiles: H, onEnterManually: U, uploadStatus: W, uploadErrorMessage: G, emailAddress: K, onCopyEmail: q, labels: J, duplicateWarning: Y, onReviewDuplicates: X }) {
56
- let Z = _(() => ({
57
- ...m,
58
- ...J,
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
- ...m.statusBadge,
61
- ...J?.statusBadge
62
+ ...h.statusBadge,
63
+ ...G?.statusBadge
62
64
  },
63
65
  addBill: {
64
- ...m.addBill,
65
- ...J?.addBill,
66
+ ...h.addBill,
67
+ ...G?.addBill,
66
68
  dropzone: {
67
- ...m.addBill.dropzone,
68
- ...J?.addBill?.dropzone
69
+ ...h.addBill.dropzone,
70
+ ...G?.addBill?.dropzone
69
71
  }
70
72
  },
71
73
  sortableHeader: {
72
- ...m.sortableHeader,
73
- ...J?.sortableHeader
74
+ ...h.sortableHeader,
75
+ ...G?.sortableHeader
74
76
  },
75
77
  missingValue: {
76
- ...m.missingValue,
77
- ...J?.missingValue
78
+ ...h.missingValue,
79
+ ...G?.missingValue
78
80
  },
79
81
  noValue: {
80
- ...m.noValue,
81
- ...J?.noValue
82
+ ...h.noValue,
83
+ ...G?.noValue
82
84
  },
83
85
  dueDate: {
84
- ...m.dueDate,
85
- ...J?.dueDate
86
+ ...h.dueDate,
87
+ ...G?.dueDate
86
88
  }
87
- }), [J]), Q = _(() => {
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__ */ v(i, {
102
+ return /* @__PURE__ */ y(i, {
90
103
  column: t,
91
104
  title: e,
92
- labels: Z.sortableHeader
105
+ labels: J.sortableHeader
93
106
  });
94
- }, t = (e, t, n = /* @__PURE__ */ v(p, { labels: Z.missingValue }), r) => function({ row: i }) {
95
- let a = r && i.original[r] ? /* @__PURE__ */ v(p, { labels: Z.missingValue }) : n;
96
- return /* @__PURE__ */ v("span", {
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": F?.[t],
111
+ "data-testid": M?.[t],
99
112
  children: i.original[e] || a
100
113
  });
101
114
  }, n = function({ row: e }) {
102
- return /* @__PURE__ */ v("span", {
115
+ return /* @__PURE__ */ y("span", {
103
116
  className: "ttw:whitespace-nowrap",
104
- "data-testid": F?.[g.DueDate],
105
- children: /* @__PURE__ */ v(ae, {
106
- value: e.original.dueDateLabel || /* @__PURE__ */ v(p, { labels: Z.missingValue }),
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: Z.dueDate
121
+ labels: J.dueDate
109
122
  })
110
123
  });
111
- }, r = (e, t, n = /* @__PURE__ */ v(p, { labels: Z.missingValue }), r) => function({ row: i }) {
112
- let a = r && i.original[r] ? /* @__PURE__ */ v(p, { labels: Z.missingValue }) : n;
113
- return /* @__PURE__ */ v("div", {
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": F?.[t],
128
+ "data-testid": M?.[t],
116
129
  children: i.original[e] || a
117
130
  });
118
- }, a = /* @__PURE__ */ v(oe, { labels: Z.noValue }), o = (e) => function() {
119
- return /* @__PURE__ */ v("div", {
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
- [g.Vendor]: {
138
+ [_.Vendor]: {
126
139
  accessorKey: "vendorLabel",
127
140
  enableSorting: !0,
128
- minSize: fe,
129
- header: e(Z.columnVendor),
130
- cell: ({ row: e }) => /* @__PURE__ */ y("span", {
131
- className: me[e.original.rowTone ?? "default"],
132
- "data-testid": F?.[g.Vendor],
133
- children: [e.original.vendorLabel || /* @__PURE__ */ v(p, { labels: Z.missingValue }), e.original.rowNote ? /* @__PURE__ */ v("span", {
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
- [g.Attachment]: {
152
+ [_.Attachment]: {
140
153
  accessorKey: "attachment",
141
154
  enableSorting: !1,
142
- size: S,
143
- minSize: S,
144
- header: () => /* @__PURE__ */ v("span", {
155
+ size: x,
156
+ minSize: x,
157
+ header: () => /* @__PURE__ */ y("span", {
145
158
  className: "ttw:sr-only",
146
- children: Z.columnAttachment
159
+ children: J.columnAttachment
147
160
  }),
148
- cell: ({ row: e }) => e.original.attachment ? /* @__PURE__ */ v("div", {
161
+ cell: ({ row: e }) => e.original.attachment ? /* @__PURE__ */ y("div", {
149
162
  className: "ttw:flex ttw:justify-center",
150
- "data-testid": F?.[g.Attachment],
151
- children: /* @__PURE__ */ v(l, { children: /* @__PURE__ */ y(s, { children: [/* @__PURE__ */ v(u, {
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__ */ v(x, { className: "ttw:size-3.5 ttw:shrink-0 ttw:text-muted-foreground" })
157
- }), /* @__PURE__ */ v(c, { children: e.original.attachment.label })] }) })
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
- [g.IssueDate]: {
173
+ [_.IssueDate]: {
161
174
  accessorKey: "issueDateLabel",
162
175
  enableSorting: !0,
163
- header: e(Z.columnIssueDate),
164
- cell: t("issueDateLabel", g.IssueDate)
176
+ header: e(J.columnIssueDate),
177
+ cell: t("issueDateLabel", _.IssueDate)
165
178
  },
166
- [g.DueDate]: {
179
+ [_.DueDate]: {
167
180
  accessorKey: "dueDateLabel",
168
181
  enableSorting: !0,
169
- header: e(Z.columnDueDate),
182
+ header: e(J.columnDueDate),
170
183
  cell: n
171
184
  },
172
- [g.ScheduledDate]: {
185
+ [_.ScheduledDate]: {
173
186
  accessorKey: "scheduledDateLabel",
174
187
  enableSorting: !0,
175
- header: e(Z.columnScheduledDate),
176
- cell: t("scheduledDateLabel", g.ScheduledDate, a, "scheduledDateIsGap")
188
+ header: e(J.columnScheduledDate),
189
+ cell: t("scheduledDateLabel", _.ScheduledDate, a, "scheduledDateIsGap")
177
190
  },
178
- [g.PaidDate]: {
191
+ [_.PaidDate]: {
179
192
  accessorKey: "paidDateLabel",
180
193
  enableSorting: !1,
181
- header: Z.columnPaidDate,
182
- cell: t("paidDateLabel", g.PaidDate)
194
+ header: J.columnPaidDate,
195
+ cell: t("paidDateLabel", _.PaidDate)
183
196
  },
184
- [g.Status]: {
197
+ [_.Status]: {
185
198
  accessorKey: "status",
186
199
  enableSorting: !1,
187
- header: Z.columnStatus,
188
- cell: ({ row: e }) => /* @__PURE__ */ v("div", {
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": F?.[g.Status],
191
- children: /* @__PURE__ */ v(ie, {
203
+ "data-testid": M?.[_.Status],
204
+ children: /* @__PURE__ */ y(ae, {
192
205
  status: e.original.status,
193
206
  tone: e.original.statusTone,
194
- labels: Z.statusBadge
207
+ labels: J.statusBadge
195
208
  })
196
209
  })
197
210
  },
198
- [g.AmountDue]: {
211
+ [_.AmountDue]: {
199
212
  accessorKey: "amountDueLabel",
200
213
  enableSorting: !1,
201
- header: o(Z.columnAmountDue),
202
- cell: r("amountDueLabel", g.AmountDue)
214
+ header: o(J.columnAmountDue),
215
+ cell: r("amountDueLabel", _.AmountDue)
203
216
  },
204
- [g.AmountScheduled]: {
217
+ [_.AmountScheduled]: {
205
218
  accessorKey: "amountScheduledLabel",
206
219
  enableSorting: !1,
207
- header: o(Z.columnAmountScheduled),
208
- cell: r("amountScheduledLabel", g.AmountScheduled)
220
+ header: o(J.columnAmountScheduled),
221
+ cell: r("amountScheduledLabel", _.AmountScheduled)
209
222
  },
210
- [g.AmountPaid]: {
223
+ [_.AmountPaid]: {
211
224
  accessorKey: "amountPaidLabel",
212
225
  enableSorting: !1,
213
- header: o(Z.columnAmountPaid),
214
- cell: r("amountPaidLabel", g.AmountPaid, a, "amountPaidIsGap")
226
+ header: o(J.columnAmountPaid),
227
+ cell: r("amountPaidLabel", _.AmountPaid, a, "amountPaidIsGap")
215
228
  },
216
- [g.TotalAmount]: {
229
+ [_.TotalAmount]: {
217
230
  accessorKey: "totalAmountLabel",
218
231
  enableSorting: !1,
219
- header: o(Z.columnTotalAmount),
220
- cell: r("totalAmountLabel", g.TotalAmount)
232
+ header: o(J.columnTotalAmount),
233
+ cell: r("totalAmountLabel", _.TotalAmount)
221
234
  },
222
- [g.AddedOn]: {
235
+ [_.AddedOn]: {
223
236
  accessorKey: "addedOnLabel",
224
237
  enableSorting: !0,
225
- header: e(Z.columnAddedOn),
226
- cell: t("addedOnLabel", g.AddedOn)
238
+ header: e(J.columnAddedOn),
239
+ cell: t("addedOnLabel", _.AddedOn)
227
240
  }
228
241
  };
229
- }, [Z, F]), Ee = _(() => [...he.filter((e) => P.includes(e)).map((e) => Q[e]), {
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__ */ v("span", {
245
+ header: () => /* @__PURE__ */ y("span", {
233
246
  className: "ttw:sr-only",
234
- children: Z.columnActions
247
+ children: J.columnActions
235
248
  }),
236
- cell: ({ row: e }) => /* @__PURE__ */ v("div", {
249
+ cell: ({ row: e }) => /* @__PURE__ */ y("div", {
237
250
  className: "ttw:flex ttw:justify-end",
238
- children: /* @__PURE__ */ v(n, {
251
+ children: /* @__PURE__ */ y(n, {
239
252
  variant: "ghost",
240
253
  size: "icon",
241
- "aria-label": Z.openRow(e.original.vendorLabel || Z.missingValue.missing),
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__ */ v(b, { className: "ttw:size-4" })
258
+ children: /* @__PURE__ */ y(le, { className: "ttw:size-4" })
246
259
  })
247
260
  })
248
261
  }], [
249
262
  Q,
250
- Z,
251
- P
252
- ]), De = !!(R && V) && !T && !E && !I && w.length === 0 && Te === !0, $ = /* @__PURE__ */ y("div", {
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__ */ v(le, { 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__ */ v(a, {
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": Z.searchLabel,
258
- placeholder: Z.searchPlaceholder,
259
- value: Ce,
260
- onChange: (e) => we(e.target.value)
270
+ "aria-label": J.searchLabel,
271
+ placeholder: J.searchPlaceholder,
272
+ value: ke,
273
+ onChange: (e) => Ae(e.target.value)
261
274
  })]
262
- }), Oe = N ? /* @__PURE__ */ v(se, {
263
- ...N,
275
+ }), ze = A ? /* @__PURE__ */ y(se, {
276
+ ...A,
264
277
  className: "ttw:px-4",
265
278
  searchSlot: $
266
- }) : /* @__PURE__ */ v("div", {
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__ */ y("div", {
283
+ return /* @__PURE__ */ b("div", {
271
284
  className: "ttw:flex ttw:flex-col ttw:gap-3",
272
- children: [Y ? /* @__PURE__ */ y(e, {
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__ */ v(t, {
287
+ children: [/* @__PURE__ */ y(t, {
275
288
  className: "ttw:flex-1 ttw:font-semibold",
276
- children: Y
277
- }), X ? /* @__PURE__ */ v(n, {
289
+ children: K
290
+ }), q ? /* @__PURE__ */ y(n, {
278
291
  type: "button",
279
292
  variant: "outline",
280
293
  className: "ttw:text-foreground",
281
- onClick: X,
282
- children: Z.duplicateBillsReviewButton
294
+ onClick: q,
295
+ children: J.duplicateBillsReviewButton
283
296
  }) : null]
284
- }) : null, /* @__PURE__ */ y(o, {
285
- value: M,
286
- onValueChange: Se,
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__ */ y("div", {
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__ */ v(te, {
291
- "aria-label": Z.filterTabsLabel,
292
- children: j.map((e) => /* @__PURE__ */ y(ne, {
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__ */ y("div", {
310
+ }), /* @__PURE__ */ b("div", {
298
311
  className: "ttw:flex ttw:items-center ttw:gap-2",
299
- children: [z ? /* @__PURE__ */ v(l, { children: /* @__PURE__ */ y(s, { children: [/* @__PURE__ */ v(u, {
312
+ children: [I ? /* @__PURE__ */ y(l, { children: /* @__PURE__ */ b(s, { children: [/* @__PURE__ */ y(u, {
300
313
  asChild: !0,
301
- children: /* @__PURE__ */ v(n, {
314
+ children: /* @__PURE__ */ y(n, {
302
315
  variant: "outline",
303
316
  size: "icon",
304
- "aria-label": Z.settingsButton,
305
- onClick: z,
306
- children: /* @__PURE__ */ v(ue, { className: "ttw:size-4" })
317
+ "aria-label": J.settingsButton,
318
+ onClick: I,
319
+ children: /* @__PURE__ */ y(pe, { className: "ttw:size-4" })
307
320
  })
308
- }), /* @__PURE__ */ v(c, { children: Z.settingsButton })] }) }) : null, R ? /* @__PURE__ */ y(n, {
309
- onClick: R,
310
- children: [/* @__PURE__ */ v(ce, { className: "ttw:size-4" }), Z.createButton]
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 = E ? /* @__PURE__ */ v(re, {
315
- title: Z.errorTitle,
316
- description: Z.errorDescription,
317
- retryLabel: B ? Z.errorRetry : void 0,
318
- onRetry: B
319
- }) : De && R && V ? /* @__PURE__ */ v("div", {
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: K && q ? /* @__PURE__ */ v(f, {
322
- emailAddress: K,
323
- onCopyEmail: q,
324
- onFilesSelected: V,
325
- accept: h,
326
- maxFiles: H,
327
- uploadStatus: W,
328
- uploadErrorMessage: G,
329
- onEnterManually: U ?? R,
330
- labels: Z.addBill
331
- }) : /* @__PURE__ */ v(f, {
332
- onFilesSelected: V,
333
- accept: h,
334
- maxFiles: H,
335
- uploadStatus: W,
336
- uploadErrorMessage: G,
337
- onEnterManually: U ?? R,
338
- labels: Z.addBill
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__ */ v(r, {
341
- columns: Ee,
342
- data: w,
343
- getRowId: (e) => e.rowKey,
344
- animatesNewRows: !0,
345
- isLoading: T,
346
- sorting: ge,
347
- onSortingChange: _e,
348
- pageSize: ve,
349
- onPageSizeChange: ye,
350
- pageSizeOptions: be,
351
- pageInfo: xe,
352
- hasNextPage: D,
353
- hasPrevPage: O,
354
- onNextPage: k,
355
- onPrevPage: A,
356
- onRowClick: (e) => e.onOpen(),
357
- rowClassName: (e) => pe[e.rowTone ?? "default"],
358
- filterComponent: Oe,
359
- children: I ? /* @__PURE__ */ v(d, {
360
- title: Z.filteredEmptyTitle,
361
- description: Z.filteredEmptyDescription
362
- }) : L ? /* @__PURE__ */ v(d, {
363
- title: L.title,
364
- description: L.description
365
- }) : void 0
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 j.map((t) => /* @__PURE__ */ v(ee, {
399
+ return O.map((t) => /* @__PURE__ */ y(ee, {
368
400
  value: t.id,
369
- children: t.id === M ? e : null
401
+ children: t.id === k ? e : null
370
402
  }, t.id));
371
403
  })()]
372
404
  })]
373
405
  });
374
406
  }
375
407
  //#endregion
376
- export { w as BillsScreen, w as default, C as DEFAULT_BILL_COLUMNS };
408
+ export { C as BillsScreen, C as default, S as DEFAULT_BILL_COLUMNS };
@@ -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.47", n = "785e2bd58161d610aed5483b8f00f53c3713758a", r = Object.freeze({
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.5.47",
3
+ "version": "0.5.49",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "packageDepSync": {