@tesouro/embedded-components-react 0.5.227 → 0.5.230

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