@tesouro/embedded-components-react 0.5.268 → 0.5.271

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.
Files changed (60) hide show
  1. package/dist/index.css +4 -10
  2. package/dist/index.d.ts +13 -9
  3. package/dist/lib/ReceivablesWidget.d.ts +13 -9
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index2.js +22 -18
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js +8 -4
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/invalidation.js +3 -3
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/invalidatePayableQueries/reconcileSubmittedForApprovalQueries.js +1 -1
  8. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index.js +3 -1
  9. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartDetailsContainer.js +44 -0
  10. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsSheetView.js +97 -0
  11. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartsWidget.js +76 -150
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +63 -57
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/actionsModal.js +1 -1
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/auditHistory/labels.js +1 -1
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js +161 -152
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +30 -34
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +12 -8
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/statusCards.js +18 -19
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +208 -158
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +91 -85
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +197 -196
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +147 -115
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +14 -14
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +3 -5
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +37 -34
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +22 -7
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +17 -15
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +17 -13
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +37 -31
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +29 -23
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +38 -11
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +26 -28
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +20 -14
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +8 -24
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +34 -83
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +14 -404
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +28 -2
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +79 -39
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +490 -68
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +2 -502
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +41 -216
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +70 -21
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +484 -5
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +224 -0
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +21 -263
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +8 -2
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +261 -24
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +2 -237
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +100 -3
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +21 -242
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +226 -82
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +3 -59
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +233 -178
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +85 -37
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +60 -0
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +194 -0
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +45 -0
  58. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  59. package/package.json +1 -1
  60. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +0 -100
@@ -6,108 +6,114 @@ import { buildReceivableAuditHistory as e } from "../../../../../shared/util/dis
6
6
  import { hasAnyScope as t } from "../../../../../shared/data-access/dist/lib/hasAnyScope.js";
7
7
  import { Scope as n } from "../../../../../shared/data-access/dist/lib/scopes.js";
8
8
  import "../../../../../shared/data-access/dist/index.js";
9
- import { useWidgetConfig as ee } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
10
- import { useOrganizationUserNames as r } from "../../../../../shared/feature/dist/lib/user/useOrganizationUserNames.js";
9
+ import { useWidgetConfig as r } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
10
+ import { useOrganizationUserNames as i } from "../../../../../shared/feature/dist/lib/user/useOrganizationUserNames.js";
11
11
  import "../../../../../shared/feature/dist/index.js";
12
- import { RECEIVABLE_DETAILS_SECTION as i } from "../../../../ui/dist/index25.js";
12
+ import { RECEIVABLE_DETAILS_SECTION as a } from "../../../../ui/dist/index25.js";
13
13
  import "../../../../ui/dist/index.js";
14
- import { useAllReceivableHistoryQuery as a } from "../../../../data-access/dist/index3.js";
15
- import { usePaymentAccountsQuery as te } from "../../../../data-access/dist/index5.js";
16
- import { useReceivablePaymentRecordsQuery as o } from "../../../../data-access/dist/index10.js";
17
- import { useReceivablePdfLinkQuery as s, useReceivableQuery as ne, useReceivablesByIdQueries as re } from "../../../../data-access/dist/index12.js";
18
- import { useOverdueRemindersQuery as c, usePaymentRemindersQuery as ie, useRecurrenceQuery as l } from "../../../../data-access/dist/index13.js";
14
+ import { useAllReceivableHistoryQuery as ee } from "../../../../data-access/dist/index3.js";
15
+ import { usePaymentAccountsQuery as o } from "../../../../data-access/dist/index5.js";
16
+ import { useReceivablePaymentRecordsQuery as s } from "../../../../data-access/dist/index10.js";
17
+ import { useReceivablePdfLinkQuery as te, useReceivableQuery as ne, useReceivablesByIdQueries as re } from "../../../../data-access/dist/index12.js";
18
+ import { useOverdueRemindersQuery as ie, usePaymentRemindersQuery as c, useRecurrenceQuery as l } from "../../../../data-access/dist/index13.js";
19
19
  import "../../../../data-access/dist/index.js";
20
20
  import { canRecordPayments as u } from "./paymentRecord.js";
21
- import { buildReceivableAuditHistoryLabels as d } from "./auditHistory/labels.js";
22
- import { getBankAccountPermissions as f } from "./bankAccounts.js";
23
- import { buildReceivableDetailsView as ae, buildUnsupportedDetailsView as oe } from "./details.js";
24
- import { useMemo as p, useState as m } from "react";
21
+ import { buildReceivableAuditHistoryLabels as ae } from "./auditHistory/labels.js";
22
+ import { getBankAccountPermissions as oe } from "./bankAccounts.js";
23
+ import { buildDetailsMessageView as se, buildReceivableDetailsView as ce } from "./details.js";
24
+ import { useMemo as d, useState as f } from "react";
25
25
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js
26
- var h = [i.attachments];
27
- function g({ selectedReceivableId: g, enabled: _ = !0, canWrite: v = !0, messages: y, statusLabels: b, auditHistoryLabels: x, onOpenReceivable: S }) {
28
- let { initResponse: C } = ee(), w = p(() => f(C?.scopes), [C?.scopes]), T = u(C?.scopes), E = ne(g, { enabled: _ }), D = E.data, O = D?.type === "invoice" ? D : void 0, k = s(g, { enabled: _ && !!O }), se = ie({ enabled: _ && !!O?.payment_reminder_id }), ce = c({ enabled: _ && !!O?.overdue_reminder_id }), A = te({
29
- enabled: _ && !!O,
30
- canReadEmbedded: w.canReadEmbedded,
31
- canReadExternal: w.canReadExternal
32
- }), j = l(_ ? O?.recurrence_id : void 0), M = j.data, N = o(O?.id, { enabled: _ }), P = a(O?.id, { enabled: _ && !!O }), F = p(() => O?.status === "recurring" ? (M?.iterations ?? []).flatMap((e) => e.issued_invoice_id ? [e.issued_invoice_id] : []) : [], [O?.status, M?.iterations]), I = re(F, { enabled: _ }), L = p(() => new Map(I.filter((e) => !!e).map((e) => [e.id, e])), [I]), [R, z] = m(h), [B, V] = m(g);
33
- B !== g && (V(g), z(h));
34
- let H = R.includes(i.auditHistory), U = p(() => P.data?.data ?? [], [P.data]), W = U.some((e) => e.recorded_by === "user" && !!e.entity_user_id), G = t(C?.scopes, [n.UserReadOrg]), { userNames: K, isError: q } = r({ enabled: _ && H && G && W }), J = p(() => ({
35
- ...d(y, b),
36
- ...x
26
+ var p = [a.attachments];
27
+ function m({ selectedReceivableId: m, enabled: h = !0, canWrite: g = !0, messages: _, statusLabels: v, auditHistoryLabels: y, onOpenReceivable: b, onOpenCustomer: x }) {
28
+ let { initResponse: S } = r(), C = d(() => oe(S?.scopes), [S?.scopes]), w = u(S?.scopes), T = ne(m, { enabled: h }), E = T.data, D = E?.type === "invoice" ? E : void 0, le = te(m, { enabled: h && !!D }), ue = c({ enabled: h && !!D?.payment_reminder_id }), O = ie({ enabled: h && !!D?.overdue_reminder_id }), k = o({
29
+ enabled: h && !!D,
30
+ canReadEmbedded: C.canReadEmbedded,
31
+ canReadExternal: C.canReadExternal
32
+ }), A = l(h ? D?.recurrence_id : void 0), j = A.data, M = s(D?.id, { enabled: h }), N = ee(D?.id, { enabled: h && !!D }), P = d(() => D?.status === "recurring" ? (j?.iterations ?? []).flatMap((e) => e.issued_invoice_id ? [e.issued_invoice_id] : []) : [], [D?.status, j?.iterations]), F = re(P, { enabled: h }), I = d(() => new Map(F.filter((e) => !!e).map((e) => [e.id, e])), [F]), [L, R] = f(p), [z, B] = f(m);
33
+ z !== m && (B(m), R(p));
34
+ let V = L.includes(a.auditHistory), H = d(() => N.data?.data ?? [], [N.data]), U = H.some((e) => e.recorded_by === "user" && !!e.entity_user_id), W = t(S?.scopes, [n.UserReadOrg]), { userNames: G, isError: K } = i({ enabled: h && V && W && U }), q = d(() => ({
35
+ ...ae(_, v),
36
+ ...y
37
37
  }), [
38
- y,
39
- b,
40
- x
41
- ]), Y = p(() => {
42
- let t = O ? e(U, K, J, {
38
+ _,
39
+ v,
40
+ y
41
+ ]), J = d(() => {
42
+ let t = D ? e(H, G, q, {
43
43
  documentType: "invoice",
44
- currency: O.currency,
45
- documentNumber: O.document_id,
46
- dueDate: O.due_date
44
+ currency: D.currency,
45
+ documentNumber: D.document_id,
46
+ dueDate: D.due_date
47
47
  }) : [];
48
48
  return {
49
49
  rows: t,
50
- countLabel: P.data && !P.isLoading && !P.isError ? String(t.length) : void 0,
51
- isLoading: P.isLoading,
52
- isError: P.isError,
53
- showNamesError: G && q && W
50
+ countLabel: N.data && !N.isLoading && !N.isError ? String(t.length) : void 0,
51
+ isLoading: N.isLoading,
52
+ isError: N.isError,
53
+ showNamesError: W && K && U
54
54
  };
55
55
  }, [
56
- O,
57
- U,
58
- K,
59
- J,
60
- P.data,
61
- P.isLoading,
62
- P.isError,
56
+ D,
57
+ H,
63
58
  G,
64
59
  q,
65
- W
66
- ]), X = se.data?.data.find((e) => e.id === O?.payment_reminder_id), Z = ce.data?.data.find((e) => e.id === O?.overdue_reminder_id), Q = A.paymentAccounts.find((e) => e.id === O?.bank_account_id), $ = k.data?.file_url || void 0;
60
+ N.data,
61
+ N.isLoading,
62
+ N.isError,
63
+ W,
64
+ K,
65
+ U
66
+ ]), Y = ue.data?.data.find((e) => e.id === D?.payment_reminder_id), X = O.data?.data.find((e) => e.id === D?.overdue_reminder_id), Z = k.paymentAccounts.find((e) => e.id === D?.bank_account_id), Q = le.data?.file_url || void 0, de = d(() => ce({
67
+ receivable: E,
68
+ pdfUrl: Q,
69
+ paymentReminder: Y,
70
+ overdueReminder: X,
71
+ depositAccount: Z,
72
+ isAccountListIncomplete: k.isIncomplete,
73
+ recurrence: j,
74
+ paymentRecords: M.data?.data,
75
+ isLoadingPaymentRecords: M.isLoading,
76
+ iterationInvoices: I,
77
+ auditHistory: J,
78
+ statusLabels: v,
79
+ messages: _,
80
+ canRecordPayment: w,
81
+ canWrite: g,
82
+ onOpenReceivable: b,
83
+ onOpenCustomer: x
84
+ }), [
85
+ E,
86
+ Q,
87
+ Y,
88
+ X,
89
+ Z,
90
+ k.isIncomplete,
91
+ j,
92
+ M.data,
93
+ M.isLoading,
94
+ I,
95
+ J,
96
+ v,
97
+ _,
98
+ w,
99
+ g,
100
+ b,
101
+ x
102
+ ]), $ = T.isLoading || A.isLoading;
67
103
  return {
68
- receivable: D,
69
- recurrence: M,
70
- detailsView: p(() => ae({
71
- receivable: D,
72
- pdfUrl: $,
73
- paymentReminder: X,
74
- overdueReminder: Z,
75
- depositAccount: Q,
76
- isAccountListIncomplete: A.isIncomplete,
77
- recurrence: M,
78
- paymentRecords: N.data?.data,
79
- isLoadingPaymentRecords: N.isLoading,
80
- iterationInvoices: L,
81
- auditHistory: Y,
82
- statusLabels: b,
83
- messages: y,
84
- canRecordPayment: T,
85
- canWrite: v,
86
- onOpenReceivable: S
87
- }), [
88
- D,
104
+ receivable: E,
105
+ recurrence: j,
106
+ detailsView: de,
107
+ messageView: d(() => $ ? void 0 : se(E, m ?? "", _), [
89
108
  $,
90
- X,
91
- Z,
92
- Q,
93
- A.isIncomplete,
94
- M,
95
- N.data,
96
- N.isLoading,
97
- L,
98
- Y,
99
- b,
100
- y,
101
- T,
102
- v,
103
- S
109
+ E,
110
+ m,
111
+ _
104
112
  ]),
105
- unsupportedView: p(() => oe(D, y), [D, y]),
106
- openSections: R,
107
- setOpenSections: z,
108
- isLoading: E.isLoading || k.isLoading || j.isLoading,
109
- isError: E.isError
113
+ openSections: L,
114
+ setOpenSections: R,
115
+ isLoading: $
110
116
  };
111
117
  }
112
118
  //#endregion
113
- export { g as useReceivableDetails };
119
+ export { m as useReceivableDetails };