@tesouro/embedded-components-react 0.5.233 → 0.5.236

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 (87) hide show
  1. package/README.md +19 -14
  2. package/dist/index.d.ts +175 -16
  3. package/dist/index.js +1 -1
  4. package/dist/lib/BankAccountOnboardingWidget.d.ts +39 -1
  5. package/dist/lib/ReceivablesWidget.d.ts +110 -1
  6. package/dist/lib/ReceivablesWidget.js +1 -1
  7. package/dist/lib/WidgetSuite.d.ts +65 -15
  8. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index.js +3 -2
  9. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index12.js +2 -1
  10. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js +6 -0
  11. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index23.js +15 -11
  12. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index26.js +441 -409
  13. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index10.js +18 -14
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +1 -1
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +1 -1
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +3 -3
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +1 -1
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index31.js +210 -208
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js +98 -40
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index33.js +159 -39
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index34.js +53 -77
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index35.js +99 -132
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index36.js +40 -341
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index37.js +43 -0
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index38.js +92 -0
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index39.js +146 -0
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index40.js +354 -0
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +1 -1
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +1 -1
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +28 -24
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +2 -37
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +9 -214
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +27 -159
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +233 -14
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +34 -22
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +214 -2
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +153 -87
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +16 -3
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +22 -21
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +2 -51
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +30 -15
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +90 -14
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +3 -10
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +20 -69
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +51 -33
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +16 -17
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +8 -14
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +70 -30
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +33 -14
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +17 -25
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +12 -83
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index3.js +9 -121
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +28 -401
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +16 -2
  58. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +22 -42
  59. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +80 -65
  60. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +383 -473
  61. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +2 -106
  62. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +48 -0
  63. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +72 -2
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +498 -4
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +106 -1
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +141 -93
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +2 -28
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +4 -236
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +0 -2
  70. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +90 -239
  71. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +24 -89
  72. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +231 -54
  73. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +3 -353
  74. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index48.js +249 -0
  75. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index49.js +93 -0
  76. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index5.js +3 -40
  77. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index50.js +59 -0
  78. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index51.js +353 -0
  79. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +18 -2
  80. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +121 -9
  81. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index8.js +100 -27
  82. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +38 -233
  83. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  84. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index16.js +123 -92
  85. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index4.js +12 -5
  86. package/package.json +1 -1
  87. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +0 -100
@@ -0,0 +1,92 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { buildReceivableRows as e, statusFilterOptions as t, typeForTab as n } from "./index13.js";
6
+ import { useReceivablesQuery as r } from "../../data-access/dist/index11.js";
7
+ import "../../data-access/dist/index.js";
8
+ import { useInvoicesFilter as i } from "./index35.js";
9
+ import { useReceivableStatusCards as a } from "./index37.js";
10
+ import { useCallback as o, useEffect as s, useMemo as c, useState as l } from "react";
11
+ //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index38.js
12
+ var u = [];
13
+ function d({ activeTab: d, initialCounterpartId: p, messages: m, statusLabels: h, filterLabels: g }) {
14
+ let [_, v] = l([]), [y, b] = l(10), [x, S] = l(), [C, w] = l(""), [T, E] = l(""), [D, O] = l("all"), k = d === "invoices", A = o(() => S(void 0), []), j = i({
15
+ initialCounterpartId: p,
16
+ search: C,
17
+ onSearchChange: w,
18
+ onFiltersChange: A,
19
+ statusLabels: h,
20
+ labels: g
21
+ }), M = j.reset;
22
+ s(() => {
23
+ S(void 0), O("all"), w(""), E(""), M();
24
+ }, [d, M]), s(() => {
25
+ let e = setTimeout(() => {
26
+ E(C), S(void 0);
27
+ }, 300);
28
+ return () => clearTimeout(e);
29
+ }, [C]);
30
+ let N = _[0]?.id, P = N ? f[N] : void 0, F = _[0] ? _[0].desc ? "desc" : "asc" : void 0, I = r({
31
+ type: n(d),
32
+ limit: y,
33
+ pagination_token: x,
34
+ search_text: T || void 0,
35
+ ...k ? j.query : { status: D === "all" ? void 0 : D },
36
+ ...P ? {
37
+ sort: P,
38
+ order: F
39
+ } : {}
40
+ }), L = a({
41
+ enabled: k,
42
+ statusFilter: j.cardStatus,
43
+ messages: m,
44
+ statusLabels: h
45
+ }), R = I.data?.data ?? u, z = c(() => new Map(R.map((e) => [e.id, e])), [R]), B = o((e) => z.get(e), [z]), V = c(() => e({
46
+ receivables: R,
47
+ messages: m
48
+ }), [m, R]), H = k ? j.isFiltering : !!T || D !== "all", U = o((e) => {
49
+ let t = typeof e == "function" ? e(_) : e;
50
+ v(t), S(void 0);
51
+ }, [_]), W = o((e) => {
52
+ b(e), S(void 0);
53
+ }, []), G = o((e) => {
54
+ O(e), S(void 0);
55
+ }, []), K = o(() => S(I.data?.next_pagination_token ?? void 0), [I.data?.next_pagination_token]), q = o(() => S(I.data?.prev_pagination_token ?? void 0), [I.data?.prev_pagination_token]), J = o(() => {
56
+ I.refetch();
57
+ }, [I]);
58
+ return {
59
+ rows: V,
60
+ isLoading: I.isLoading,
61
+ isError: I.isError,
62
+ sorting: _,
63
+ onSortingChange: U,
64
+ pageSize: y,
65
+ onPageSizeChange: W,
66
+ hasNextPage: !!I.data?.next_pagination_token,
67
+ hasPrevPage: !!I.data?.prev_pagination_token,
68
+ onNextPage: K,
69
+ onPrevPage: q,
70
+ searchValue: C,
71
+ onSearchChange: w,
72
+ statusFilter: D,
73
+ statusOptions: t(D),
74
+ onStatusFilterChange: G,
75
+ statusCards: L,
76
+ onStatusCardSelect: j.selectStatusCard,
77
+ invoicesFilterBar: k ? j.filterBar : void 0,
78
+ isFiltering: H,
79
+ onRetry: J,
80
+ getReceivableById: B
81
+ };
82
+ }
83
+ var f = {
84
+ documentLabel: "document_id",
85
+ customerLabel: "counterpart_name",
86
+ status: "status",
87
+ issueDateLabel: "issue_date",
88
+ dueDateLabel: "due_date",
89
+ totalLabel: "total_amount"
90
+ };
91
+ //#endregion
92
+ export { d as useReceivablesTable };
@@ -0,0 +1,146 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
6
+ import "../../../shared/feature/dist/index.js";
7
+ import { ReceivablesWidgetAnalyticsEvent as t } from "./index2.js";
8
+ import { RECEIVABLE_STATUS_BADGE_LABELS_EN as n } from "../../ui/dist/index13.js";
9
+ import "../../ui/dist/index.js";
10
+ import { hasSelectedText as r } from "../../../shared/product-catalog/feature/dist/lib/helpers.js";
11
+ import "../../../shared/product-catalog/feature/dist/index.js";
12
+ import { getCreateFollowUp as i } from "./index8.js";
13
+ import { coerceEnabledTabs as a, getDocumentTitle as o, resolveInitialTab as s, tabForType as c, typeForTab as l } from "./index13.js";
14
+ import { RECEIVABLE_MESSAGE_LABELS_EN as u } from "./index14.js";
15
+ import { useReceivableActions as d } from "./index17.js";
16
+ import { useReceivableActionsModal as f } from "./index18.js";
17
+ import { useReceivableDetails as p } from "./index23.js";
18
+ import { useReceivableForm as m } from "./index31.js";
19
+ import { useReceivablesTable as h } from "./index38.js";
20
+ import { useCallback as g, useEffect as _, useMemo as v, useState as y } from "react";
21
+ //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index39.js
22
+ function b({ auditHistoryLabels: b, counterpartMessageLabels: x, defaultTab: S, embeddedBankName: C, enabledTabs: w, filterLabels: T, initialCounterpartId: E, messageLabels: D, onReceivableCreated: O, onReceivableOpened: k, screenLabels: A }) {
23
+ let j = e();
24
+ _(() => {
25
+ j(t.Mounted);
26
+ }, [j]);
27
+ let M = v(() => ({
28
+ ...u,
29
+ ...D
30
+ }), [D]), N = A?.statusBadge, P = v(() => ({
31
+ ...n,
32
+ ...N
33
+ }), [N]), F = v(() => a(w), [w]), [I, L] = y(() => s({
34
+ defaultTab: S,
35
+ enabledTabs: F
36
+ })), [R, z] = y(), [B, V] = y(!1);
37
+ _(() => {
38
+ F.includes(I) || L(s({
39
+ defaultTab: S,
40
+ enabledTabs: F
41
+ }));
42
+ }, [
43
+ I,
44
+ S,
45
+ F
46
+ ]);
47
+ let H = g((e, t) => {
48
+ L(c(t)), z(e), V(!0), O?.(e, t);
49
+ }, [O]), U = f({ messages: M }), W = U.open, G = g((e, t, n) => {
50
+ L(c(t));
51
+ let r = i(n);
52
+ r.openDetails && (z(e), V(!0)), r.actionsModal && W({
53
+ action: n.mode,
54
+ receivableId: e,
55
+ counterpartId: n.counterpartId,
56
+ inlineItems: n.inlineItems,
57
+ showEmailStep: r.actionsModal.showEmailStep
58
+ }), O?.(e, t);
59
+ }, [O, W]), K = h({
60
+ activeTab: I,
61
+ initialCounterpartId: E,
62
+ messages: M,
63
+ statusLabels: P,
64
+ filterLabels: T
65
+ }), q = g((e) => {
66
+ z(e), V(!0), k?.(e, "invoice");
67
+ }, [k]), J = p({
68
+ selectedReceivableId: R,
69
+ enabled: B,
70
+ messages: M,
71
+ statusLabels: P,
72
+ auditHistoryLabels: b,
73
+ onOpenReceivable: q
74
+ }), Y = m({
75
+ messages: M,
76
+ counterpartMessageLabels: x,
77
+ embeddedBankName: C,
78
+ onCreated: G
79
+ }), X = g(() => {
80
+ let e = l(I);
81
+ Y.openCreate(e === "quote" ? "quote" : "invoice");
82
+ }, [I, Y.openCreate]), Z = d({
83
+ selectedReceivable: J.receivable,
84
+ selectedRecurrence: J.recurrence,
85
+ messages: M,
86
+ onCreated: H,
87
+ onDeleted: (e) => {
88
+ e === R && (z(void 0), V(!1));
89
+ },
90
+ onCompleteBeforeIssue: (e) => {
91
+ Y.openEdit(e, { highlightForIssue: !0 }), V(!1);
92
+ }
93
+ }), Q = g((e) => {
94
+ r() || (z(e.id), V(!0), k?.(e.id, e.type));
95
+ }, [k]);
96
+ return {
97
+ activeTab: I,
98
+ enabledTabs: F,
99
+ setActiveTab: L,
100
+ table: K,
101
+ details: J,
102
+ detailsOpen: B,
103
+ closeDetails: g(() => {
104
+ V(!1), z(void 0);
105
+ }, []),
106
+ form: Y,
107
+ openCreate: X,
108
+ actions: Z,
109
+ actionsModal: U,
110
+ handleRowClick: Q,
111
+ handleActionClick: g((e, t) => {
112
+ let n = K.getReceivableById(t.id);
113
+ if (e === "edit") {
114
+ if (n) {
115
+ Y.openEdit(n);
116
+ return;
117
+ }
118
+ z(t.id), V(!0);
119
+ return;
120
+ }
121
+ z(t.id), Z.openAction(e, t, n ?? null);
122
+ }, [
123
+ Z,
124
+ Y.openEdit,
125
+ K.getReceivableById
126
+ ]),
127
+ handleDetailsActionClick: g((e, t) => {
128
+ if (e === "edit") {
129
+ J.receivable && (Y.openEdit(J.receivable), V(!1));
130
+ return;
131
+ }
132
+ Z.openAction(e, {
133
+ id: t.id,
134
+ title: J.receivable ? o(J.receivable, M) : t.title,
135
+ type: t.type
136
+ }, J.receivable ?? null);
137
+ }, [
138
+ Z,
139
+ J.receivable,
140
+ Y.openEdit,
141
+ M
142
+ ])
143
+ };
144
+ }
145
+ //#endregion
146
+ export { b as useReceivablesWidget };
@@ -0,0 +1,354 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { Calendar as e, Skeleton as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { EmbeddedToaster as n } from "../../../shared/ui/dist/lib/EmbeddedToaster.js";
7
+ import "../../../shared/ui/dist/index.js";
8
+ import { useAnalyticsTrack as r } from "../../../shared/feature/dist/lib/analytics/hooks.js";
9
+ import { WidgetProvider as i } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
10
+ import "../../../shared/feature/dist/index.js";
11
+ import { CounterpartFormSheet as a } from "../../../shared/counterpart-management/ui/dist/index9.js";
12
+ import { CounterpartSelector as o } from "../../../shared/counterpart-management/feature/dist/lib/CounterpartSelector.js";
13
+ import "../../../shared/counterpart-management/feature/dist/index.js";
14
+ import { ReceivablesWidgetAnalyticsEvent as s, WIDGET_NAME as c } from "./index2.js";
15
+ import { PAGE_SIZE_OPTIONS as l } from "./index4.js";
16
+ import { InvoicesFilterBar as u } from "../../ui/dist/index4.js";
17
+ import { ReceivableActionsModal as d } from "../../ui/dist/index9.js";
18
+ import { ReceivableActionDialog as f } from "../../ui/dist/index14.js";
19
+ import { ReceivableBankAccountSection as p } from "../../ui/dist/index15.js";
20
+ import { ReceivableBillingSection as m } from "../../ui/dist/index20.js";
21
+ import { ReceivableDetailsPanel as h } from "../../ui/dist/index34.js";
22
+ import { ReceivableFormSheet as g } from "../../ui/dist/index38.js";
23
+ import { ReceivablePaymentDialog as _ } from "../../ui/dist/index39.js";
24
+ import { ReceivableRecurrenceEmailDialog as v } from "../../ui/dist/index44.js";
25
+ import { ReceivableRecurrenceSection as y } from "../../ui/dist/index46.js";
26
+ import { ReceivableRemindersSection as b } from "../../ui/dist/index48.js";
27
+ import { ReceivableSendDialog as x } from "../../ui/dist/index49.js";
28
+ import { ReceivablesScreen as ee } from "../../ui/dist/index51.js";
29
+ import "../../ui/dist/index.js";
30
+ import { ReceivableAttachmentsSection as te } from "./index5.js";
31
+ import { MeasureUnitsManagerContainer as ne } from "../../../shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js";
32
+ import { ProductSelector as re } from "../../../shared/product-catalog/feature/dist/lib/ProductSelector.js";
33
+ import "../../../shared/product-catalog/feature/dist/index.js";
34
+ import { useReceivablesWidget as ie } from "./index39.js";
35
+ import { useEffect as S, useId as C, useState as w } from "react";
36
+ import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
37
+ //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index40.js
38
+ function O({ auditHistoryLabels: i, counterpartFormLabels: c, counterpartMessageLabels: O, defaultTab: k, detailsLabels: A, embeddedBankName: j, enabledTabs: M, filterBarLabels: N, filterLabels: P, formLabels: F, initialCounterpartId: I, measureUnitDeleteLabels: L, measureUnitsLabels: ae, messageLabels: R, onReceivableCreated: z, onReceivableOpened: B, onTemplateSettingsClick: V, pageSizeOptions: H = l, paymentLabels: U, productMessageLabels: W, screenLabels: G, sendLabels: K, actionLabels: q, actionsModalLabels: J }) {
39
+ let Y = r();
40
+ S(() => {
41
+ Y(s.Mounted);
42
+ }, [Y]);
43
+ let X = ie({
44
+ auditHistoryLabels: i,
45
+ counterpartMessageLabels: O,
46
+ defaultTab: k,
47
+ embeddedBankName: j,
48
+ enabledTabs: M,
49
+ filterLabels: P,
50
+ initialCounterpartId: I,
51
+ messageLabels: R,
52
+ onReceivableCreated: z,
53
+ onReceivableOpened: B,
54
+ screenLabels: G
55
+ }), [Z, Q] = w(!1), oe = C(), $ = C(), se = C(), ce = C(), le = C();
56
+ return /* @__PURE__ */ D(T, { children: [
57
+ /* @__PURE__ */ E(n, {}),
58
+ /* @__PURE__ */ E(ee, {
59
+ rows: X.table.rows,
60
+ activeTab: X.activeTab,
61
+ enabledTabs: X.enabledTabs,
62
+ onTabChange: X.setActiveTab,
63
+ isLoading: X.table.isLoading,
64
+ isError: X.table.isError,
65
+ sorting: X.table.sorting,
66
+ onSortingChange: X.table.onSortingChange,
67
+ pageSize: X.table.pageSize,
68
+ onPageSizeChange: X.table.onPageSizeChange,
69
+ pageSizeOptions: H,
70
+ hasNextPage: X.table.hasNextPage,
71
+ hasPrevPage: X.table.hasPrevPage,
72
+ onNextPage: X.table.onNextPage,
73
+ onPrevPage: X.table.onPrevPage,
74
+ searchValue: X.table.searchValue,
75
+ onSearchChange: X.table.onSearchChange,
76
+ statusFilter: X.table.statusFilter,
77
+ statusOptions: X.table.statusOptions,
78
+ onStatusFilterChange: X.table.onStatusFilterChange,
79
+ statusCards: X.table.statusCards,
80
+ onStatusCardSelect: X.table.onStatusCardSelect,
81
+ filterBar: X.table.invoicesFilterBar && /* @__PURE__ */ E(u, {
82
+ ...X.table.invoicesFilterBar,
83
+ labels: N
84
+ }),
85
+ isFiltering: X.table.isFiltering,
86
+ onCreateClick: X.openCreate,
87
+ onTemplateSettingsClick: V,
88
+ onRowClick: X.handleRowClick,
89
+ onActionClick: X.handleActionClick,
90
+ onRetry: X.table.onRetry,
91
+ labels: G
92
+ }),
93
+ /* @__PURE__ */ E(g, {
94
+ open: X.form.open,
95
+ onOpenChange: (e) => {
96
+ e || X.form.close();
97
+ },
98
+ mode: X.form.mode,
99
+ values: X.form.sheetValues,
100
+ errors: X.form.errors,
101
+ currencyOptions: X.form.currencyOptions,
102
+ unitOptions: X.form.lineItemUnitOptions,
103
+ currencySymbol: X.form.currencySymbol,
104
+ lineItemControls: X.form.lineItemControls,
105
+ autoFocusLineItemId: X.form.autoFocusLineItemId,
106
+ lineItemsLoading: X.form.lineItemsLoading,
107
+ inProgress: X.form.isSubmitting,
108
+ customerSelector: /* @__PURE__ */ E(o, {
109
+ mode: "customer",
110
+ value: X.form.values.customerId || void 0,
111
+ invalid: !!X.form.errors.customerId,
112
+ onValueChange: (e) => X.form.updateValues({ customerId: e }),
113
+ onCreateClick: X.form.openCounterpartCreate
114
+ }),
115
+ renderProductSelector: (e, t) => /* @__PURE__ */ E(re, {
116
+ ...t,
117
+ inputValue: e.name,
118
+ selectedProductId: X.form.values.lineItems.find((t) => t.id === e.id)?.productId || void 0,
119
+ currency: X.form.values.currency,
120
+ maxLength: 100,
121
+ onInputValueChange: (t) => X.form.updateLineItem(e.id, { name: t }),
122
+ onProductSelect: (t) => X.form.selectProduct(e.id, t)
123
+ }),
124
+ onChange: X.form.updateValues,
125
+ onLineItemChange: X.form.updateLineItem,
126
+ onLineItemCommit: X.form.commitLineItem,
127
+ onLineItemQuantityStep: X.form.stepLineItem,
128
+ onTaxRateCommit: X.form.commitTaxRate,
129
+ onDiscountFocus: X.form.focusDiscount,
130
+ onDiscountCommit: X.form.commitDiscount,
131
+ totals: X.form.totalsView,
132
+ onManageUnits: () => Q(!0),
133
+ onAddLineItem: X.form.addLineItem,
134
+ onRemoveLineItem: X.form.removeLineItem,
135
+ showDueDateField: X.form.showDueDateField,
136
+ billingSection: X.form.showBillingSection && /* @__PURE__ */ E(m, {
137
+ idPrefix: oe,
138
+ paymentTerms: X.form.paymentTerms.view,
139
+ paymentTermsError: X.form.errors.paymentTermsId,
140
+ disabled: X.form.isSubmitting,
141
+ onPaymentTermsChange: X.form.paymentTerms.select,
142
+ onCustomDatePickerOpenChange: X.form.paymentTerms.changeCustomDatePickerOpen,
143
+ customDateCalendar: /* @__PURE__ */ E(e, {
144
+ mode: "single",
145
+ captionLayout: "dropdown",
146
+ ...X.form.paymentTerms.calendar,
147
+ onSelect: X.form.paymentTerms.selectCustomDate
148
+ }),
149
+ recurrenceSection: X.form.showRecurrenceSection && (X.form.recurrenceLoading ? /* @__PURE__ */ E(t, { className: "ttw:h-9 ttw:w-full" }) : /* @__PURE__ */ E(y, {
150
+ idPrefix: $,
151
+ view: X.form.recurrence.view,
152
+ disabled: X.form.isSubmitting,
153
+ onFrequencyChange: X.form.recurrence.changeFrequency,
154
+ onMonthDayChange: X.form.recurrence.changeMonthDay,
155
+ onWeekdayChange: X.form.recurrence.changeWeekday,
156
+ onStartDateChange: X.form.recurrence.changeStartDate,
157
+ onEndModeChange: X.form.recurrence.changeEndMode,
158
+ onEndDateChange: X.form.recurrence.changeEndDate,
159
+ onMaxOccurrencesChange: X.form.recurrence.changeMaxOccurrences,
160
+ onCreationModeChange: X.form.recurrence.changeCreationMode,
161
+ onSetUpEmailClick: X.form.recurrence.setUpEmail,
162
+ emailDialog: /* @__PURE__ */ E(v, {
163
+ idPrefix: $,
164
+ view: X.form.recurrence.emailView,
165
+ onOpenChange: X.form.recurrence.changeEmailOpen,
166
+ onChange: X.form.recurrence.changeEmail,
167
+ onSave: X.form.recurrence.saveEmail,
168
+ labels: F
169
+ }),
170
+ labels: F
171
+ })),
172
+ labels: F
173
+ }),
174
+ remindersSection: X.form.reminders.view && /* @__PURE__ */ E(b, {
175
+ idPrefix: ce,
176
+ view: X.form.reminders.view,
177
+ onToggle: X.form.reminders.toggle,
178
+ onPaymentReminderSelect: X.form.reminders.selectPaymentReminder,
179
+ onOverdueReminderSelect: X.form.reminders.selectOverdueReminder,
180
+ onBeforeDueInputChange: X.form.reminders.changeBeforeDueInput,
181
+ onBeforeDueSave: X.form.reminders.saveBeforeDue,
182
+ onOverdueTermChange: X.form.reminders.changeOverdueTerm,
183
+ onOverdueAddTerm: X.form.reminders.addOverdueTerm,
184
+ onOverdueClear: X.form.reminders.clearOverdueTerms,
185
+ onOverdueSave: X.form.reminders.saveOverdue,
186
+ labels: F
187
+ }),
188
+ bankAccountSection: /* @__PURE__ */ E(p, {
189
+ idPrefix: se,
190
+ view: X.form.bankAccount.view,
191
+ error: X.form.errors.bankAccountId,
192
+ disabled: X.form.isSubmitting,
193
+ onAccountSelect: X.form.bankAccount.selectAccount,
194
+ onAddAccountClick: X.form.bankAccount.openAddAccount,
195
+ onFormChange: X.form.bankAccount.updateAccountForm,
196
+ onFormSave: X.form.bankAccount.saveAccount,
197
+ onFormCancel: X.form.bankAccount.cancelAddAccount,
198
+ labels: F
199
+ }),
200
+ attachmentsSection: X.form.attachmentsView && /* @__PURE__ */ E(te, {
201
+ view: X.form.attachmentsView,
202
+ disabled: X.form.isSubmitting,
203
+ onFilesSelect: X.form.selectAttachmentFiles,
204
+ onIncludeInEmailChange: X.form.setAttachmentIncludeInEmail,
205
+ onRemove: X.form.removeAttachment,
206
+ labels: F
207
+ }),
208
+ cancelDisabled: X.form.isSubmitting || X.form.attachmentsUploading,
209
+ draftButtonLabel: X.form.draftButtonLabel,
210
+ draftDisabled: X.form.draftDisabled,
211
+ draftLoading: X.form.draftLoading,
212
+ primaryButtonLabel: X.form.primaryButtonLabel,
213
+ primaryDisabled: X.form.primaryDisabled,
214
+ primaryLoading: X.form.primaryLoading,
215
+ scrollContainerRef: X.form.scrollContainerRef,
216
+ onSubmit: X.form.submit,
217
+ onDraftClick: X.form.selectDraftMode,
218
+ onPrimaryClick: X.form.selectPrimaryMode,
219
+ onCancel: X.form.close,
220
+ labels: F
221
+ }),
222
+ /* @__PURE__ */ E(h, {
223
+ open: X.detailsOpen,
224
+ onOpenChange: (e) => {
225
+ e || X.closeDetails();
226
+ },
227
+ details: X.details.detailsView,
228
+ unsupported: X.details.unsupportedView,
229
+ isLoading: X.details.isLoading,
230
+ isError: X.details.isError,
231
+ onActionClick: X.handleDetailsActionClick,
232
+ onClose: X.closeDetails,
233
+ openSections: X.details.openSections,
234
+ onOpenSectionsChange: X.details.setOpenSections,
235
+ disabledActions: X.actions.pendingActions,
236
+ labels: A
237
+ }),
238
+ /* @__PURE__ */ E(x, {
239
+ open: X.actions.sendOpen,
240
+ onOpenChange: (e) => {
241
+ e || X.actions.closeSend();
242
+ },
243
+ values: X.actions.sendValues,
244
+ errors: X.actions.sendErrors,
245
+ inProgress: X.actions.sendInProgress,
246
+ onChange: (e) => X.actions.setSendValues((t) => ({
247
+ ...t,
248
+ ...e
249
+ })),
250
+ onSubmit: X.actions.submitSend,
251
+ onCancel: X.actions.closeSend,
252
+ labels: K
253
+ }),
254
+ /* @__PURE__ */ E(_, {
255
+ open: X.actions.paymentOpen,
256
+ onOpenChange: (e) => {
257
+ e || X.actions.closePayment();
258
+ },
259
+ values: X.actions.paymentValues,
260
+ errors: X.actions.paymentErrors,
261
+ inProgress: X.actions.paymentInProgress,
262
+ onChange: (e) => X.actions.setPaymentValues((t) => ({
263
+ ...t,
264
+ ...e
265
+ })),
266
+ onSubmit: X.actions.submitPayment,
267
+ onCancel: X.actions.closePayment,
268
+ labels: U
269
+ }),
270
+ X.actions.actionDialog && /* @__PURE__ */ E(f, {
271
+ open: !!X.actions.actionTarget,
272
+ onOpenChange: (e) => {
273
+ e || X.actions.closeAction();
274
+ },
275
+ title: X.actions.actionDialog.title,
276
+ description: X.actions.actionDialog.description,
277
+ confirmLabel: X.actions.actionDialog.confirmLabel,
278
+ cancelLabel: X.actions.actionDialog.cancelLabel,
279
+ destructive: X.actions.actionDialog.destructive,
280
+ error: X.actions.actionError,
281
+ inProgress: X.actions.actionInProgress,
282
+ onConfirm: X.actions.confirmAction,
283
+ onCancel: X.actions.closeAction,
284
+ labels: q
285
+ }),
286
+ /* @__PURE__ */ E(d, {
287
+ idPrefix: le,
288
+ open: X.actionsModal.isOpen,
289
+ view: X.actionsModal.view,
290
+ onSkip: X.actionsModal.skip,
291
+ onSubjectChange: X.actionsModal.changeSubject,
292
+ onMessageChange: X.actionsModal.changeMessage,
293
+ onSend: X.actionsModal.send,
294
+ onToggleItem: X.actionsModal.toggleItem,
295
+ onToggleAll: X.actionsModal.toggleAll,
296
+ onAllSelectedChange: X.actionsModal.setAllSelected,
297
+ onSaveItems: X.actionsModal.saveItems,
298
+ labels: J
299
+ }),
300
+ /* @__PURE__ */ E(a, {
301
+ open: X.form.counterpartView === "create",
302
+ onOpenChange: (e) => {
303
+ e || X.form.counterpartForm.close();
304
+ },
305
+ mode: "create",
306
+ values: X.form.counterpartForm.values,
307
+ errors: X.form.counterpartForm.errors,
308
+ stateOptions: X.form.stateOptions,
309
+ inProgress: X.form.counterpartForm.isSubmitting,
310
+ onChange: (e) => X.form.counterpartForm.setValues((t) => ({
311
+ ...t,
312
+ ...e
313
+ })),
314
+ onAddressChange: (e) => X.form.counterpartForm.setValues((t) => ({
315
+ ...t,
316
+ address: {
317
+ ...t.address,
318
+ ...e
319
+ }
320
+ })),
321
+ onSubmit: X.form.counterpartForm.submit,
322
+ onCancel: X.form.counterpartForm.close,
323
+ labels: c
324
+ }),
325
+ /* @__PURE__ */ E(ne, {
326
+ open: Z,
327
+ onClose: () => Q(!1),
328
+ managerLabels: ae,
329
+ deleteLabels: L,
330
+ messageLabels: W
331
+ })
332
+ ] });
333
+ }
334
+ function k({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: a, linkComponent: o, implementation: s, uiFramework: l, errorFallback: u, onError: d, analytics: f, disclosuresAcceptance: p, providerLabels: m, ...h }) {
335
+ return /* @__PURE__ */ E(i, {
336
+ widgetName: c,
337
+ baseUrl: e,
338
+ widgetToken: t,
339
+ organizationId: n,
340
+ configClient: r,
341
+ gatewayRouting: a,
342
+ linkComponent: o,
343
+ implementation: s,
344
+ uiFramework: l,
345
+ errorFallback: u,
346
+ onError: d,
347
+ analytics: f,
348
+ disclosuresAcceptance: p,
349
+ providerLabels: m,
350
+ children: /* @__PURE__ */ E(O, { ...h })
351
+ });
352
+ }
353
+ //#endregion
354
+ export { k as ReceivablesWidget, k as default };
@@ -2,7 +2,7 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { ReceivableAttachmentsSection as e } from "../../ui/dist/index12.js";
5
+ import { ReceivableAttachmentsSection as e } from "../../ui/dist/index16.js";
6
6
  import "../../ui/dist/index.js";
7
7
  import { useRef as t, useState as n } from "react";
8
8
  import { jsx as r } from "react/jsx-runtime";
@@ -1,5 +1,5 @@
1
1
  import { isEmail as e } from "../../../../shared/util-validation/dist/index5.js";
2
- import { RECEIVABLE_PAYMENT_TERMS_RECEIPT_DUE as t } from "../../ui/dist/index15.js";
2
+ import { RECEIVABLE_PAYMENT_TERMS_RECEIPT_DUE as t } from "../../ui/dist/index19.js";
3
3
  import "../../ui/dist/index.js";
4
4
  import { addDays as n, format as r, parseISO as i, startOfDay as a } from "date-fns";
5
5
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js
@@ -1,27 +1,31 @@
1
1
  import "./index2.js";
2
- import { ReceivableActionsModal as e } from "./index5.js";
2
+ import { InvoicesFilterField as e } from "./index3.js";
3
+ import { InvoicesFilterBar as t } from "./index4.js";
4
+ import "./index5.js";
3
5
  import "./index6.js";
4
- import "./index7.js";
5
- import "./index8.js";
6
- import { RECEIVABLE_STATUS_BADGE_LABELS_EN as t } from "./index9.js";
7
- import { ReceivableActionDialog as n } from "./index10.js";
8
- import { ReceivableBankAccountSection as r } from "./index11.js";
9
- import { ReceivableAttachmentsSection as i } from "./index12.js";
10
- import { RECEIVABLE_PAYMENT_TERMS_CUSTOM_DATE as a, RECEIVABLE_PAYMENT_TERMS_RECEIPT_DUE as o } from "./index15.js";
11
- import { ReceivableBillingSection as s } from "./index16.js";
12
- import "./index17.js";
13
- import "./index18.js";
14
- import { RECEIVABLE_DETAILS_SECTION as c } from "./index21.js";
15
- import { ReceivableDetailsPanel as l } from "./index30.js";
16
- import "./index31.js";
17
- import { ReceivableFormSheet as u } from "./index34.js";
18
- import { ReceivablePaymentDialog as d } from "./index35.js";
19
- import "./index38.js";
20
- import "./index39.js";
21
- import { ReceivableRecurrenceEmailDialog as f } from "./index40.js";
22
- import { ReceivableRecurrenceSection as p } from "./index42.js";
6
+ import { ReceivableActionsModal as n } from "./index9.js";
7
+ import "./index10.js";
8
+ import "./index11.js";
9
+ import "./index12.js";
10
+ import { RECEIVABLE_STATUS_BADGE_LABELS_EN as r } from "./index13.js";
11
+ import { ReceivableActionDialog as i } from "./index14.js";
12
+ import { ReceivableBankAccountSection as a } from "./index15.js";
13
+ import { ReceivableAttachmentsSection as o } from "./index16.js";
14
+ import { RECEIVABLE_PAYMENT_TERMS_CUSTOM_DATE as s, RECEIVABLE_PAYMENT_TERMS_RECEIPT_DUE as c } from "./index19.js";
15
+ import { ReceivableBillingSection as l } from "./index20.js";
16
+ import "./index21.js";
17
+ import "./index22.js";
18
+ import { RECEIVABLE_DETAILS_SECTION as u } from "./index25.js";
19
+ import { ReceivableDetailsPanel as d } from "./index34.js";
20
+ import "./index35.js";
21
+ import { ReceivableFormSheet as f } from "./index38.js";
22
+ import { ReceivablePaymentDialog as p } from "./index39.js";
23
+ import "./index42.js";
23
24
  import "./index43.js";
24
- import { ReceivableRemindersSection as m } from "./index44.js";
25
- import { ReceivableSendDialog as h } from "./index45.js";
26
- import { ReceivablesScreen as g } from "./index47.js";
27
- export { c as RECEIVABLE_DETAILS_SECTION, a as RECEIVABLE_PAYMENT_TERMS_CUSTOM_DATE, o as RECEIVABLE_PAYMENT_TERMS_RECEIPT_DUE, t as RECEIVABLE_STATUS_BADGE_LABELS_EN, n as ReceivableActionDialog, e as ReceivableActionsModal, i as ReceivableAttachmentsSection, r as ReceivableBankAccountSection, s as ReceivableBillingSection, l as ReceivableDetailsPanel, u as ReceivableFormSheet, d as ReceivablePaymentDialog, f as ReceivableRecurrenceEmailDialog, p as ReceivableRecurrenceSection, m as ReceivableRemindersSection, h as ReceivableSendDialog, g as ReceivablesScreen };
25
+ import { ReceivableRecurrenceEmailDialog as m } from "./index44.js";
26
+ import { ReceivableRecurrenceSection as h } from "./index46.js";
27
+ import "./index47.js";
28
+ import { ReceivableRemindersSection as g } from "./index48.js";
29
+ import { ReceivableSendDialog as _ } from "./index49.js";
30
+ import { ReceivablesScreen as v } from "./index51.js";
31
+ export { t as InvoicesFilterBar, e as InvoicesFilterField, u as RECEIVABLE_DETAILS_SECTION, s as RECEIVABLE_PAYMENT_TERMS_CUSTOM_DATE, c as RECEIVABLE_PAYMENT_TERMS_RECEIPT_DUE, r as RECEIVABLE_STATUS_BADGE_LABELS_EN, i as ReceivableActionDialog, n as ReceivableActionsModal, o as ReceivableAttachmentsSection, a as ReceivableBankAccountSection, l as ReceivableBillingSection, d as ReceivableDetailsPanel, f as ReceivableFormSheet, p as ReceivablePaymentDialog, m as ReceivableRecurrenceEmailDialog, h as ReceivableRecurrenceSection, g as ReceivableRemindersSection, _ as ReceivableSendDialog, v as ReceivablesScreen };