@tesouro/embedded-components-react 0.5.231 → 0.5.233

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 (78) hide show
  1. package/README.md +1 -0
  2. package/dist/index.css +4 -0
  3. package/dist/index.d.ts +105 -2
  4. package/dist/index.js +1 -1
  5. package/dist/lib/ReceivablesWidget.d.ts +105 -2
  6. package/dist/lib/ReceivablesWidget.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +11 -10
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +92 -55
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +67 -142
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js +186 -17
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index13.js +27 -0
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index3.js +45 -74
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index4.js +68 -53
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index5.js +66 -32
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js +28 -34
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index7.js +24 -166
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index8.js +177 -1
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index9.js +42 -95
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +36 -33
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js +38 -0
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +1 -1
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +206 -147
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +2 -2
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +39 -58
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index20.js +53 -227
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +216 -287
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js +453 -43
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +103 -126
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +122 -146
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js +145 -41
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js +39 -115
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index27.js +113 -90
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js +81 -98
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index29.js +111 -27
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index30.js +26 -633
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index31.js +639 -39
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js +41 -40
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index33.js +35 -74
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index34.js +73 -130
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index35.js +133 -329
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index36.js +345 -0
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +13 -12
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +15 -12
  45. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +35 -24
  46. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +8 -71
  47. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +70 -17
  48. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +31 -12
  49. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +18 -30
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +12 -301
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +33 -1
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +14 -46
  53. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +23 -67
  54. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +76 -485
  55. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +395 -95
  56. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +2 -0
  57. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +48 -2
  58. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +72 -4
  59. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +496 -1
  60. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +97 -91
  61. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +2 -236
  62. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +3 -2
  63. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +1 -249
  64. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +89 -82
  65. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +23 -54
  66. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +223 -340
  67. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index43.js +3 -0
  68. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index44.js +249 -0
  69. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index45.js +93 -0
  70. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index46.js +59 -0
  71. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index47.js +353 -0
  72. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +18 -1
  73. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +41 -41
  74. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/clientRegistry.js +6 -3
  75. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +75 -43
  76. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  77. package/package.json +1 -1
  78. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +0 -28
@@ -2,339 +2,143 @@
2
2
  "use client";
3
3
  "use client";
4
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";
5
+ import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
10
6
  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";
7
+ import { ReceivablesWidgetAnalyticsEvent as t } from "./index2.js";
8
+ import { RECEIVABLE_STATUS_BADGE_LABELS_EN as n } from "../../ui/dist/index9.js";
28
9
  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";
10
+ import { hasSelectedText as r } from "../../../shared/product-catalog/feature/dist/lib/helpers.js";
32
11
  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";
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 "./index34.js";
20
+ import { useCallback as g, useEffect as _, useMemo as v, useState as y } from "react";
36
21
  //#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
22
+ function b({ auditHistoryLabels: b, counterpartMessageLabels: x, defaultTab: S, embeddedBankName: C, enabledTabs: w, messageLabels: T, onReceivableCreated: E, onReceivableOpened: D, screenLabels: O }) {
23
+ let k = e();
24
+ _(() => {
25
+ k(t.Mounted);
26
+ }, [k]);
27
+ let A = v(() => ({
28
+ ...u,
29
+ ...T
30
+ }), [T]), j = O?.statusBadge, M = v(() => ({
31
+ ...n,
32
+ ...j
33
+ }), [j]), N = v(() => a(w), [w]), [P, F] = y(() => s({
34
+ defaultTab: S,
35
+ enabledTabs: N
36
+ })), [I, L] = y(), [R, z] = y(!1);
37
+ _(() => {
38
+ N.includes(P) || F(s({
39
+ defaultTab: S,
40
+ enabledTabs: N
41
+ }));
42
+ }, [
43
+ P,
44
+ S,
45
+ N
46
+ ]);
47
+ let B = g((e, t) => {
48
+ F(c(t)), L(e), z(!0), E?.(e, t);
49
+ }, [E]), V = f({ messages: A }), H = V.open, U = g((e, t, n) => {
50
+ F(c(t));
51
+ let r = i(n);
52
+ r.openDetails && (L(e), z(!0)), r.actionsModal && H({
53
+ action: n.mode,
54
+ receivableId: e,
55
+ counterpartId: n.counterpartId,
56
+ inlineItems: n.inlineItems,
57
+ showEmailStep: r.actionsModal.showEmailStep
58
+ }), E?.(e, t);
59
+ }, [E, H]), W = h({
60
+ activeTab: P,
61
+ messages: A,
62
+ statusLabels: M
63
+ }), G = g((e) => {
64
+ L(e), z(!0), D?.(e, "invoice");
65
+ }, [D]), K = p({
66
+ selectedReceivableId: I,
67
+ enabled: R,
68
+ messages: A,
69
+ statusLabels: M,
70
+ auditHistoryLabels: b,
71
+ onOpenReceivable: G
72
+ }), q = m({
73
+ messages: A,
74
+ counterpartMessageLabels: x,
75
+ embeddedBankName: C,
76
+ onCreated: U
77
+ }), J = g(() => {
78
+ let e = l(P);
79
+ q.openCreate(e === "quote" ? "quote" : "invoice");
80
+ }, [P, q.openCreate]), Y = d({
81
+ selectedReceivable: K.receivable,
82
+ selectedRecurrence: K.recurrence,
83
+ messages: A,
84
+ onCreated: B,
85
+ onDeleted: (e) => {
86
+ e === I && (L(void 0), z(!1));
87
+ },
88
+ onCompleteBeforeIssue: (e) => {
89
+ q.openEdit(e, { highlightForIssue: !0 }), z(!1);
90
+ }
91
+ }), X = g((e) => {
92
+ r() || (L(e.id), z(!0), D?.(e.id, e.type));
93
+ }, [D]);
94
+ return {
95
+ activeTab: P,
96
+ enabledTabs: N,
97
+ setActiveTab: F,
98
+ table: W,
99
+ details: K,
100
+ detailsOpen: R,
101
+ closeDetails: g(() => {
102
+ z(!1), L(void 0);
103
+ }, []),
104
+ form: q,
105
+ openCreate: J,
106
+ actions: Y,
107
+ actionsModal: V,
108
+ handleRowClick: X,
109
+ handleActionClick: g((e, t) => {
110
+ let n = W.getReceivableById(t.id);
111
+ if (e === "edit") {
112
+ if (n) {
113
+ q.openEdit(n);
114
+ return;
305
115
  }
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
- });
116
+ L(t.id), z(!0);
117
+ return;
118
+ }
119
+ L(t.id), Y.openAction(e, t, n ?? null);
120
+ }, [
121
+ Y,
122
+ q.openEdit,
123
+ W.getReceivableById
124
+ ]),
125
+ handleDetailsActionClick: g((e, t) => {
126
+ if (e === "edit") {
127
+ K.receivable && (q.openEdit(K.receivable), z(!1));
128
+ return;
129
+ }
130
+ Y.openAction(e, {
131
+ id: t.id,
132
+ title: K.receivable ? o(K.receivable, A) : t.title,
133
+ type: t.type
134
+ }, K.receivable ?? null);
135
+ }, [
136
+ Y,
137
+ K.receivable,
138
+ q.openEdit,
139
+ A
140
+ ])
141
+ };
338
142
  }
339
143
  //#endregion
340
- export { M as ReceivablesWidget, M as default };
144
+ export { b as useReceivablesWidget };