@tesouro/embedded-components-react 0.5.279 → 0.5.280

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 (104) hide show
  1. package/dist/index.d.ts +21 -6
  2. package/dist/lib/ReceivablesWidget.d.ts +21 -6
  3. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +14 -13
  4. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +24 -168
  5. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +173 -44
  6. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js +42 -94
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index13.js +91 -76
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index14.js +67 -173
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index15.js +186 -17
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index16.js +27 -0
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index3.js +11 -13
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index4.js +42 -27
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index5.js +28 -132
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js +137 -16
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index7.js +16 -62
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index8.js +66 -28
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index9.js +28 -34
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivableAttachmentsSection.js +1 -1
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivableCustomerSection.js +38 -0
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +304 -287
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/auditHistory/labels.js +1 -1
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/customer.js +58 -0
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +15 -15
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +14 -6
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/paymentTerms.js +1 -1
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/permissions.js +2 -1
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/preview.js +62 -62
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurrence.js +41 -35
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/reminders.js +1 -1
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/totals.js +21 -13
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActions.js +124 -124
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableActionsModal.js +11 -11
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableAttachmentUploads.js +13 -13
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableBankAccount.js +1 -1
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableCustomerPicker.js +109 -0
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableDetails.js +6 -6
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +520 -476
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableIssuePreflight.js +10 -10
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentRecord.js +6 -6
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentTerms.js +1 -1
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePreview.js +1 -1
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableRecurrence.js +92 -77
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableReminders.js +11 -11
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableStatusCards.js +1 -1
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesTable.js +4 -4
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +79 -75
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useSendReceivableWithPaymentLink.js +3 -3
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +26 -23
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +9 -25
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +26 -228
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +227 -52
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +50 -212
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +193 -138
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +157 -12
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +10 -19
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +23 -2
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +2 -116
  58. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +118 -3
  59. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +3 -39
  60. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +209 -53
  61. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +2 -23
  62. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +36 -7
  63. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +53 -77
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +17 -35
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +8 -18
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +73 -37
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +36 -26
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +17 -19
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +39 -8
  70. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +26 -33
  71. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +20 -14
  72. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +8 -24
  73. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +34 -84
  74. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +14 -492
  75. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +28 -2
  76. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +79 -39
  77. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +490 -68
  78. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +2 -487
  79. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +41 -217
  80. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +70 -21
  81. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +440 -5
  82. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +224 -0
  83. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +21 -263
  84. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +8 -2
  85. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +261 -24
  86. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +2 -237
  87. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +100 -3
  88. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index52.js +21 -242
  89. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index53.js +226 -82
  90. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index54.js +3 -60
  91. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index55.js +233 -178
  92. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index56.js +85 -37
  93. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index57.js +60 -0
  94. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index58.js +194 -0
  95. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index59.js +45 -0
  96. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +9 -9
  97. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/CounterpartSelector.js +2 -23
  98. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartSelector.js +2 -51
  99. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +8 -8
  100. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index15.js +4 -80
  101. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index2.js +10 -22
  102. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  103. package/package.json +1 -1
  104. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +0 -100
@@ -6,22 +6,22 @@ import { useMyEntityQuery as e } from "../../../../../shared/data-access/dist/li
6
6
  import "../../../../../shared/data-access/dist/index.js";
7
7
  import { useCounterpartQuery as t } from "../../../../../shared/counterpart-management/data-access/dist/index3.js";
8
8
  import "../../../../../shared/counterpart-management/feature/dist/index.js";
9
- import { useReceivableRequiredFieldsQuery as n } from "../../../../data-access/dist/index13.js";
9
+ import { useReceivableRequiredFieldsQuery as n } from "../../../../data-access/dist/index14.js";
10
10
  import "../../../../data-access/dist/index.js";
11
11
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableIssuePreflight.js
12
- function r({ counterpartId: r, billingAddressId: i, billingCountry: a }) {
13
- let o = e(), s = t(r || void 0), c = s.data?.id === r ? s.data : void 0, l = n({
12
+ function r({ counterpartId: r, billingAddressId: i, billingCountry: a, inlineCustomerType: o }) {
13
+ let s = e(), c = t(r || void 0), l = c.data?.id === r ? c.data : void 0, u = n({
14
14
  counterpart_id: r || void 0,
15
15
  counterpart_billing_address_id: i || void 0,
16
16
  counterpart_country: a,
17
- counterpart_type: c?.type,
18
- enabled: !!(r && i)
19
- }), u = !!l.data?.entity?.tax_id?.required, d = !!r && !c && (s.isLoading || s.isFetching);
17
+ counterpart_type: l?.type ?? o,
18
+ enabled: !!(r || o)
19
+ }), d = !!u.data?.entity?.tax_id?.required, f = !!r && !l && (c.isLoading || c.isFetching);
20
20
  return {
21
- counterpart: c,
22
- isCounterpartLoading: d,
23
- isLoading: o.isLoading || l.isLoading || d,
24
- isTaxIdMissing: u && !o.data?.tax_id
21
+ counterpart: l,
22
+ isCounterpartLoading: f,
23
+ isLoading: s.isLoading || u.isLoading || f,
24
+ isTaxIdMissing: d && !s.data?.tax_id
25
25
  };
26
26
  }
27
27
  //#endregion
@@ -9,15 +9,15 @@ import "../../../../../shared/data-access/dist/index.js";
9
9
  import "../../../../../shared/ui/dist/index.js";
10
10
  import { useWidgetConfig as r } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
11
11
  import "../../../../../shared/feature/dist/index.js";
12
- import { getCurrencySymbol as i } from "./lineItems.js";
13
- import { formatMoney as a } from "./helpers.js";
14
- import { useCreateReceivablePaymentRecordMutation as o } from "../../../../data-access/dist/index12.js";
12
+ import { useCreateReceivablePaymentRecordMutation as i } from "../../../../data-access/dist/index13.js";
15
13
  import "../../../../data-access/dist/index.js";
14
+ import { getCurrencySymbol as a } from "./lineItems.js";
15
+ import { formatMoney as o } from "./helpers.js";
16
16
  import { amountDueInputValue as s, buildPaymentRecordPayload as c, buildPaymentReviewView as l, defaultPaymentRecordValues as u, hasPaymentRecordErrors as d, validatePaymentRecordValues as f } from "./paymentRecord.js";
17
17
  import { useCallback as p, useState as m } from "react";
18
18
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentRecord.js
19
19
  function h({ messages: h }) {
20
- let [g, _] = m(), [v, y] = m("form"), [b, x] = m(() => u()), [S, C] = m({}), [w, T] = m(!1), { initResponse: E } = r(), D = E?.userId ?? void 0, O = o(), k = n({ enabled: !!g }), A = p((e) => {
20
+ let [g, _] = m(), [v, y] = m("form"), [b, x] = m(() => u()), [S, C] = m({}), [w, T] = m(!1), { initResponse: E } = r(), D = E?.userId ?? void 0, O = i(), k = n({ enabled: !!g }), A = p((e) => {
21
21
  _(e), y("form"), x(u()), C({}), T(!1);
22
22
  }, []), j = p(() => _(void 0), []), M = p((e) => {
23
23
  let t = {
@@ -65,8 +65,8 @@ function h({ messages: h }) {
65
65
  step: v,
66
66
  values: b,
67
67
  errors: S,
68
- currencySymbol: g ? i(g.currency) : "",
69
- amountDueLabel: g ? a({
68
+ currencySymbol: g ? a(g.currency) : "",
69
+ amountDueLabel: g ? o({
70
70
  amount: g.amount_due,
71
71
  currency: g.currency,
72
72
  fallback: ""
@@ -3,8 +3,8 @@
3
3
  "use client";
4
4
  "use client";
5
5
  import { usePaymentTermsQuery as e } from "../../../../../shared/data-access/dist/lib/reference-data/usePaymentTermsQuery.js";
6
- import { buildCustomDateCalendar as t, buildPaymentTermsView as n, closeCustomDatePickerFields as r, resolveIssueDate as i, selectPaymentTermsFields as a, toCustomDateValue as o } from "./paymentTerms.js";
7
6
  import "../../../../data-access/dist/index.js";
7
+ import { buildCustomDateCalendar as t, buildPaymentTermsView as n, closeCustomDatePickerFields as r, resolveIssueDate as i, selectPaymentTermsFields as a, toCustomDateValue as o } from "./paymentTerms.js";
8
8
  import { useCallback as s, useMemo as c, useState as l } from "react";
9
9
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablePaymentTerms.js
10
10
  function u({ paymentTermsId: u, paymentTermsCustomDate: d, issueDate: f, isRecurring: p, messages: m, onChange: h }) {
@@ -7,7 +7,7 @@ import { usePaymentTermsQuery as t } from "../../../../../shared/data-access/dis
7
7
  import "../../../../../shared/data-access/dist/index.js";
8
8
  import { useCounterpartQuery as n } from "../../../../../shared/counterpart-management/data-access/dist/index3.js";
9
9
  import "../../../../../shared/counterpart-management/feature/dist/index.js";
10
- import { useEntityPaymentMethodsQuery as r, useEntitySettingsQuery as i } from "../../../../data-access/dist/index4.js";
10
+ import { useEntityPaymentMethodsQuery as r, useEntitySettingsQuery as i } from "../../../../data-access/dist/index5.js";
11
11
  import "../../../../data-access/dist/index.js";
12
12
  import { buildReceivablePreviewView as a, displaysBankAccount as o, hasReceivePaymentMethod as s } from "./preview.js";
13
13
  import { useMemo as c } from "react";
@@ -5,123 +5,138 @@
5
5
  import { getCounterpartEmail as e } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
6
6
  import { useCounterpartQuery as t } from "../../../../../shared/counterpart-management/data-access/dist/index3.js";
7
7
  import "../../../../../shared/counterpart-management/feature/dist/index.js";
8
- import { applyRecurrenceEmailDraft as n, buildRecurrenceEmailView as r, buildRecurrenceView as i, clearRecurrenceRecipients as a, createRecurrenceEmailDraft as o, selectRecurrenceDate as s, selectRecurrenceDayOfWeek as c, selectRecurrenceEndMode as l, selectRecurrenceFrequency as u, selectRecurrenceIssueMode as d, shouldOpenRecurrenceEmail as f } from "./recurrence.js";
9
- import { useCallback as p, useEffect as m, useMemo as h, useRef as g, useState as _ } from "react";
8
+ import { applyRecurrenceEmailDraft as n, buildRecurrenceEmailView as r, buildRecurrenceView as i, clearRecurrenceRecipients as a, createRecurrenceEmailDraft as o, resetRecurrenceRecipientsTo as s, selectRecurrenceDate as c, selectRecurrenceDayOfWeek as l, selectRecurrenceEndMode as u, selectRecurrenceFrequency as d, selectRecurrenceIssueMode as f, shouldOpenRecurrenceEmail as p } from "./recurrence.js";
9
+ import { useCallback as m, useEffect as h, useMemo as g, useRef as _, useState as v } from "react";
10
10
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableRecurrence.js
11
- var v = [
11
+ var y = [
12
12
  "recurrenceStartDate",
13
13
  "recurrenceEndDate",
14
14
  "recurrenceIssueMode",
15
15
  "recurrenceDayOfWeek",
16
16
  "recurrenceEndMode",
17
17
  "recurrenceMaxOccurrences"
18
- ], y = [
18
+ ], b = [
19
19
  "recurrenceSubject",
20
20
  "recurrenceBody",
21
21
  "recurrenceRecipientsTo",
22
22
  "recurrenceRecipientsCc",
23
23
  "recurrenceRecipientsBcc"
24
24
  ];
25
- function b({ values: b, errors: x, lockSchedule: S, messages: C, onChange: w, onClearErrors: T, onRevalidateErrors: E }) {
26
- let D = t(b.customerId || void 0), O = D.data ? e(D.data).trim() : "", [k, A] = _(!1), [j, M] = _(b), [N, P] = _(null), F = h(() => N ?? o(j, O), [
27
- O,
28
- N,
29
- j
30
- ]), I = g(O);
31
- m(() => {
32
- let e = I.current;
33
- I.current = O, e && e !== O && w(a);
34
- }, [O, w]);
35
- let L = p((e) => {
36
- M(e), P(null), A(!0);
25
+ function x({ values: x, errors: S, lockSchedule: C, messages: w, onChange: T, onClearErrors: E, onRevalidateErrors: D }) {
26
+ let O = t(x.customerId || void 0), k = x.customerEmail.trim() || (O.data ? e(O.data).trim() : ""), [A, j] = v(!1), [M, N] = v(x), [P, F] = v(null), I = g(() => P ?? o(M, k), [
27
+ k,
28
+ P,
29
+ M
30
+ ]), L = _({
31
+ id: x.customerId,
32
+ email: k
33
+ });
34
+ h(() => {
35
+ if (!k && O.isLoading) return;
36
+ let e = L.current;
37
+ L.current = {
38
+ id: x.customerId,
39
+ email: k
40
+ }, e.email && e.email !== k && T(e.id === x.customerId ? s : a);
41
+ }, [
42
+ O.isLoading,
43
+ k,
44
+ T,
45
+ x.customerId
46
+ ]);
47
+ let R = m((e) => {
48
+ N(e), F(null), j(!0);
37
49
  }, []);
38
50
  return {
39
- view: h(() => i({
40
- fields: b,
41
- errors: x,
42
- lockSchedule: S,
43
- messages: C
51
+ view: g(() => i({
52
+ fields: x,
53
+ errors: S,
54
+ lockSchedule: C,
55
+ messages: w
44
56
  }), [
45
- x,
46
57
  S,
47
58
  C,
48
- b
59
+ w,
60
+ x
49
61
  ]),
50
- emailView: h(() => r({
51
- open: k,
52
- ready: !D.isLoading,
53
- draft: F,
54
- messages: C
62
+ emailView: g(() => r({
63
+ open: A,
64
+ ready: !O.isLoading,
65
+ draft: I,
66
+ messages: w
55
67
  }), [
56
- D.isLoading,
57
- F,
58
- k,
59
- C
68
+ O.isLoading,
69
+ I,
70
+ A,
71
+ w
60
72
  ]),
61
- changeFrequency: p((e) => {
62
- T(v), w((t) => u(t, e));
63
- }, [w, T]),
64
- changeMonthDay: p((e) => {
65
- E(["recurrenceIssueMode"]), w((t) => d(t, e, { lockSchedule: S }));
73
+ changeFrequency: m((e) => {
74
+ E(y), T((t) => d(t, e));
75
+ }, [T, E]),
76
+ changeMonthDay: m((e) => {
77
+ D(["recurrenceIssueMode"]), T((t) => f(t, e, { lockSchedule: C }));
66
78
  }, [
67
- S,
68
- w,
69
- E
79
+ C,
80
+ T,
81
+ D
70
82
  ]),
71
- changeWeekday: p((e) => {
72
- S || (T(["recurrenceStartDate"]), E(["recurrenceDayOfWeek"]), w((t) => c(t, e, { lockSchedule: S })));
83
+ changeWeekday: m((e) => {
84
+ C || (E(["recurrenceStartDate"]), D(["recurrenceDayOfWeek"]), T((t) => l(t, e, { lockSchedule: C })));
73
85
  }, [
74
- S,
75
- w,
86
+ C,
76
87
  T,
77
- E
88
+ E,
89
+ D
78
90
  ]),
79
- changeStartDate: p((e) => {
80
- E(["recurrenceStartDate"]), w((t) => s(t, "recurrenceStartDate", e));
81
- }, [w, E]),
82
- changeEndDate: p((e) => {
83
- E(["recurrenceEndDate"]), w((t) => s(t, "recurrenceEndDate", e));
84
- }, [w, E]),
85
- changeEndMode: p((e) => {
86
- E(["recurrenceEndMode"]), w((t) => l(t, e));
87
- }, [w, E]),
88
- changeMaxOccurrences: p((e) => {
89
- E(["recurrenceMaxOccurrences"]), w((t) => ({
91
+ changeStartDate: m((e) => {
92
+ D(["recurrenceStartDate"]), T((t) => c(t, "recurrenceStartDate", e));
93
+ }, [T, D]),
94
+ changeEndDate: m((e) => {
95
+ D(["recurrenceEndDate"]), T((t) => c(t, "recurrenceEndDate", e));
96
+ }, [T, D]),
97
+ changeEndMode: m((e) => {
98
+ D(["recurrenceEndMode"]), T((t) => u(t, e));
99
+ }, [T, D]),
100
+ changeMaxOccurrences: m((e) => {
101
+ D(["recurrenceMaxOccurrences"]), T((t) => ({
90
102
  ...t,
91
103
  recurrenceMaxOccurrences: e
92
104
  }));
93
- }, [w, E]),
94
- changeCreationMode: p((e) => {
105
+ }, [T, D]),
106
+ changeCreationMode: m((e) => {
95
107
  let t = {
96
- ...b,
108
+ ...x,
97
109
  recurrenceAutomationLevel: e
98
110
  };
99
- w((t) => ({
111
+ T((t) => ({
100
112
  ...t,
101
113
  recurrenceAutomationLevel: e
102
- })), f(t, e) && L(t);
114
+ })), p(t, e) && R(t);
103
115
  }, [
104
- w,
105
- L,
106
- b
116
+ T,
117
+ R,
118
+ x
107
119
  ]),
108
- setUpEmail: p(() => L(b), [L, b]),
109
- changeEmailOpen: A,
110
- changeEmail: p((e, t) => P((n) => ({
111
- ...n ?? F,
120
+ setUpEmail: m(() => R(x), [R, x]),
121
+ changeEmailOpen: j,
122
+ changeEmail: m((e, t) => F((n) => ({
123
+ ...n ?? I,
112
124
  [e]: t
113
- })), [F]),
114
- saveEmail: p(() => {
115
- w((e) => n(e, F)), T(y), A(!1);
125
+ })), [I]),
126
+ saveEmail: m(() => {
127
+ T((e) => n(e, I)), E(b), j(!1);
116
128
  }, [
117
- F,
118
- w,
119
- T
129
+ I,
130
+ T,
131
+ E
120
132
  ]),
121
- reset: p(() => {
122
- A(!1), I.current = "";
133
+ reset: m(() => {
134
+ j(!1), L.current = {
135
+ id: "",
136
+ email: ""
137
+ };
123
138
  }, [])
124
139
  };
125
140
  }
126
141
  //#endregion
127
- export { b as useReceivableRecurrence };
142
+ export { x as useReceivableRecurrence };
@@ -8,26 +8,26 @@ import { usePaymentTermsQuery as n } from "../../../../../shared/data-access/dis
8
8
  import "../../../../../shared/ui/dist/index.js";
9
9
  import { useWidgetConfig as r } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
10
10
  import "../../../../../shared/feature/dist/index.js";
11
- import { areOverdueTermsValid as i, buildOverdueReminderPayload as a, buildPaymentReminderPayload as o, buildRemindersView as s, canCreateReminders as c, getImpliedDueDate as l, isBeforeDueDaysValid as u, sanitizeReminderDays as d } from "./reminders.js";
12
- import { useCreateOverdueReminderMutation as f, useCreatePaymentReminderMutation as p, useOverdueRemindersQuery as m, usePaymentRemindersQuery as h } from "../../../../data-access/dist/index14.js";
11
+ import { useCreateOverdueReminderMutation as i, useCreatePaymentReminderMutation as a, useOverdueRemindersQuery as o, usePaymentRemindersQuery as s } from "../../../../data-access/dist/index15.js";
13
12
  import "../../../../data-access/dist/index.js";
13
+ import { areOverdueTermsValid as c, buildOverdueReminderPayload as l, buildPaymentReminderPayload as u, buildRemindersView as d, canCreateReminders as f, getImpliedDueDate as p, isBeforeDueDaysValid as m, sanitizeReminderDays as h } from "./reminders.js";
14
14
  import { useCallback as g, useMemo as _, useState as v } from "react";
15
15
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableReminders.js
16
16
  var y = [""];
17
17
  function b({ open: b, isInvoice: x, disabled: S, paymentTermsId: C, paymentTermsCustomDate: w, paymentReminderId: T, overdueReminderId: E, messages: D, onSelect: O }) {
18
- let { initResponse: k } = r(), A = n().data?.data, j = _(() => c(k?.scopes), [k?.scopes]), [M, N] = v(!1), [P, F] = v(""), [I, L] = v(y), R = b && x && M, z = h({ enabled: R }), B = m({ enabled: R }), V = p(), H = f(), U = g((e) => {
18
+ let { initResponse: k } = r(), A = n().data?.data, j = _(() => f(k?.scopes), [k?.scopes]), [M, N] = v(!1), [P, F] = v(""), [I, L] = v(y), R = b && x && M, z = s({ enabled: R }), B = o({ enabled: R }), V = a(), H = i(), U = g((e) => {
19
19
  N(e), F(""), L(y);
20
20
  }, []), W = g((e) => {
21
21
  e || (O({
22
22
  paymentReminderId: "",
23
23
  overdueReminderId: ""
24
24
  }), F(""), L(y)), N(e);
25
- }, [O]), G = g((e) => O({ paymentReminderId: e }), [O]), K = g((e) => O({ overdueReminderId: e }), [O]), q = g((e) => F(d(e)), []), J = g((e, t) => {
26
- let n = d(t);
25
+ }, [O]), G = g((e) => O({ paymentReminderId: e }), [O]), K = g((e) => O({ overdueReminderId: e }), [O]), q = g((e) => F(h(e)), []), J = g((e, t) => {
26
+ let n = h(t);
27
27
  L((t) => t.map((t, r) => r === e ? n : t));
28
28
  }, []), Y = g(() => {
29
29
  L((e) => e.length < 3 ? [...e, ""] : e);
30
- }, []), X = g(() => L(y), []), Z = g(() => l({
30
+ }, []), X = g(() => L(y), []), Z = g(() => p({
31
31
  paymentTermsId: C,
32
32
  paymentTermsCustomDate: w,
33
33
  paymentTerms: A,
@@ -37,8 +37,8 @@ function b({ open: b, isInvoice: x, disabled: S, paymentTermsId: C, paymentTerms
37
37
  w,
38
38
  C
39
39
  ]), Q = g(async () => {
40
- if (u(P)) try {
41
- let t = await V.mutateAsync({ body: o({
40
+ if (m(P)) try {
41
+ let t = await V.mutateAsync({ body: u({
42
42
  daysBefore: Number(P),
43
43
  dueDate: Z(),
44
44
  messages: D
@@ -54,8 +54,8 @@ function b({ open: b, isInvoice: x, disabled: S, paymentTermsId: C, paymentTerms
54
54
  D,
55
55
  O
56
56
  ]), $ = g(async () => {
57
- if (i(I)) try {
58
- let t = await H.mutateAsync({ body: a({
57
+ if (c(I)) try {
58
+ let t = await H.mutateAsync({ body: l({
59
59
  terms: I,
60
60
  dueDate: Z(),
61
61
  messages: D
@@ -72,7 +72,7 @@ function b({ open: b, isInvoice: x, disabled: S, paymentTermsId: C, paymentTerms
72
72
  I
73
73
  ]);
74
74
  return {
75
- view: _(() => x ? s({
75
+ view: _(() => x ? d({
76
76
  showReminders: M,
77
77
  paymentTermsId: C,
78
78
  paymentTermsCustomDate: w,
@@ -2,7 +2,7 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { useReceivablesAnalyticsQuery as e } from "../../../../data-access/dist/index15.js";
5
+ import { useReceivablesAnalyticsQuery as e } from "../../../../data-access/dist/index16.js";
6
6
  import "../../../../data-access/dist/index.js";
7
7
  import { buildReceivableStatusCardsView as t } from "./statusCards.js";
8
8
  import { useMemo as n } from "react";
@@ -2,9 +2,9 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { buildReceivableRows as e } from "./helpers.js";
6
- import { useReceivablesQuery as t } from "../../../../data-access/dist/index13.js";
5
+ import { useReceivablesQuery as e } from "../../../../data-access/dist/index14.js";
7
6
  import "../../../../data-access/dist/index.js";
7
+ import { buildReceivableRows as t } from "./helpers.js";
8
8
  import { useInvoicesFilter as n } from "./useInvoicesFilter.js";
9
9
  import { useReceivableCustomerNames as r } from "./useReceivableCustomerNames.js";
10
10
  import { useReceivableStatusCards as i } from "./useReceivableStatusCards.js";
@@ -29,7 +29,7 @@ function d({ initialCounterpartId: d, messages: p, statusLabels: m, filterLabels
29
29
  }, 300);
30
30
  return () => clearTimeout(e);
31
31
  }, [T]);
32
- let j = y[0]?.id, M = j ? f[j] : void 0, N = y[0] ? y[0].desc ? "desc" : "asc" : void 0, P = t({
32
+ let j = y[0]?.id, M = j ? f[j] : void 0, N = y[0] ? y[0].desc ? "desc" : "asc" : void 0, P = e({
33
33
  enabled: _,
34
34
  type: "invoice",
35
35
  limit: x,
@@ -46,7 +46,7 @@ function d({ initialCounterpartId: d, messages: p, statusLabels: m, filterLabels
46
46
  statusFilter: A.cardStatus,
47
47
  messages: p,
48
48
  statusLabels: m
49
- }), I = P.data?.data ?? l, L = s(() => new Map(I.map((e) => [e.id, e])), [I]), R = a((e) => L.get(e), [L]), z = r(I), B = s(() => e({
49
+ }), I = P.data?.data ?? l, L = s(() => new Map(I.map((e) => [e.id, e])), [I]), R = a((e) => L.get(e), [L]), z = r(I), B = s(() => t({
50
50
  receivables: I,
51
51
  messages: p,
52
52
  customerNames: z