@tesouro/embedded-components-react 0.5.227 → 0.5.228
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.
- package/README.md +21 -21
- package/dist/index.d.ts +54 -34
- package/dist/index.js +1 -1
- package/dist/lib/ReceivablesWidget.d.ts +54 -34
- package/dist/lib/ReceivablesWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +29 -59
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +36 -141
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +26 -16
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +58 -37
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +228 -122
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +300 -147
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index20.js +34 -37
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +126 -122
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js +150 -58
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +38 -91
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +113 -107
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js +98 -231
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js +111 -27
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index27.js +25 -624
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js +631 -39
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index29.js +41 -40
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index30.js +35 -74
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index31.js +73 -115
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js +115 -313
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index33.js +325 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index7.js +15 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +11 -12
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +42 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +19 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +73 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +3 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +16 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +32 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +304 -11
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +42 -258
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +62 -38
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +485 -61
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +90 -480
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +3 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +0 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +100 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +23 -95
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +231 -23
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +3 -236
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +249 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +78 -234
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +53 -87
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +343 -49
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +29 -20
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +40 -40
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +189 -211
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +43 -59
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +0 -106
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +0 -353
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js
CHANGED
|
@@ -2,323 +2,125 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
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 {
|
|
12
|
-
import {
|
|
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 { ReceivableActionDialog as u } from "../../ui/dist/index5.js";
|
|
17
|
-
import { ReceivableBankAccountSection as d } from "../../ui/dist/index6.js";
|
|
18
|
-
import { ReceivableBillingSection as f } from "../../ui/dist/index11.js";
|
|
19
|
-
import { ReceivableDetailsSheet as p } from "../../ui/dist/index22.js";
|
|
20
|
-
import { ReceivableFormSheet as m } from "../../ui/dist/index25.js";
|
|
21
|
-
import { ReceivablePaymentDialog as h } from "../../ui/dist/index26.js";
|
|
22
|
-
import { ReceivableRecurrenceEmailDialog as g } from "../../ui/dist/index31.js";
|
|
23
|
-
import { ReceivableRecurrenceSection as _ } from "../../ui/dist/index33.js";
|
|
24
|
-
import { ReceivableRemindersSection as v } from "../../ui/dist/index35.js";
|
|
25
|
-
import { ReceivableSendDialog as y } from "../../ui/dist/index36.js";
|
|
26
|
-
import { ReceivablesScreen as b } from "../../ui/dist/index38.js";
|
|
7
|
+
import { ReceivablesWidgetAnalyticsEvent as t } from "./index2.js";
|
|
8
|
+
import { RECEIVABLE_STATUS_BADGE_LABELS_EN as n } from "../../ui/dist/index4.js";
|
|
27
9
|
import "../../ui/dist/index.js";
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
10
|
+
import { coerceEnabledTabs as r, getDocumentTitle as i, resolveInitialTab as a, tabForType as o, typeForTab as s } from "./index12.js";
|
|
11
|
+
import { RECEIVABLE_MESSAGE_LABELS_EN as c } from "./index13.js";
|
|
12
|
+
import { useReceivableActions as l } from "./index16.js";
|
|
13
|
+
import { useReceivableDetails as u } from "./index20.js";
|
|
14
|
+
import { hasSelectedText as d } from "../../../shared/product-catalog/feature/dist/lib/helpers.js";
|
|
31
15
|
import "../../../shared/product-catalog/feature/dist/index.js";
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
16
|
+
import { useReceivableForm as f } from "./index28.js";
|
|
17
|
+
import { useReceivablesTable as p } from "./index31.js";
|
|
18
|
+
import { useCallback as m, useEffect as h, useMemo as g, useState as _ } from "react";
|
|
35
19
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js
|
|
36
|
-
function
|
|
37
|
-
let
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}, [
|
|
41
|
-
let
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}), [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
onProductSelect: (t) => Y.form.selectProduct(e.id, t)
|
|
114
|
-
}),
|
|
115
|
-
onChange: Y.form.updateValues,
|
|
116
|
-
onLineItemChange: Y.form.updateLineItem,
|
|
117
|
-
onLineItemCommit: Y.form.commitLineItem,
|
|
118
|
-
onLineItemQuantityStep: Y.form.stepLineItem,
|
|
119
|
-
onTaxRateCommit: Y.form.commitTaxRate,
|
|
120
|
-
onDiscountFocus: Y.form.focusDiscount,
|
|
121
|
-
onDiscountCommit: Y.form.commitDiscount,
|
|
122
|
-
totals: Y.form.totalsView,
|
|
123
|
-
onManageUnits: () => Z(!0),
|
|
124
|
-
onAddLineItem: Y.form.addLineItem,
|
|
125
|
-
onRemoveLineItem: Y.form.removeLineItem,
|
|
126
|
-
showDueDateField: Y.form.showDueDateField,
|
|
127
|
-
billingSection: Y.form.showBillingSection && /* @__PURE__ */ k(f, {
|
|
128
|
-
idPrefix: Q,
|
|
129
|
-
paymentTerms: Y.form.paymentTerms.view,
|
|
130
|
-
paymentTermsError: Y.form.errors.paymentTermsId,
|
|
131
|
-
disabled: Y.form.isSubmitting,
|
|
132
|
-
onPaymentTermsChange: Y.form.paymentTerms.select,
|
|
133
|
-
onCustomDatePickerOpenChange: Y.form.paymentTerms.changeCustomDatePickerOpen,
|
|
134
|
-
customDateCalendar: /* @__PURE__ */ k(e, {
|
|
135
|
-
mode: "single",
|
|
136
|
-
captionLayout: "dropdown",
|
|
137
|
-
...Y.form.paymentTerms.calendar,
|
|
138
|
-
onSelect: Y.form.paymentTerms.selectCustomDate
|
|
139
|
-
}),
|
|
140
|
-
recurrenceSection: Y.form.showRecurrenceSection && (Y.form.recurrenceLoading ? /* @__PURE__ */ k(t, { className: "ttw:h-9 ttw:w-full" }) : /* @__PURE__ */ k(_, {
|
|
141
|
-
idPrefix: $,
|
|
142
|
-
view: Y.form.recurrence.view,
|
|
143
|
-
disabled: Y.form.isSubmitting,
|
|
144
|
-
onFrequencyChange: Y.form.recurrence.changeFrequency,
|
|
145
|
-
onMonthDayChange: Y.form.recurrence.changeMonthDay,
|
|
146
|
-
onWeekdayChange: Y.form.recurrence.changeWeekday,
|
|
147
|
-
onStartDateChange: Y.form.recurrence.changeStartDate,
|
|
148
|
-
onEndModeChange: Y.form.recurrence.changeEndMode,
|
|
149
|
-
onEndDateChange: Y.form.recurrence.changeEndDate,
|
|
150
|
-
onMaxOccurrencesChange: Y.form.recurrence.changeMaxOccurrences,
|
|
151
|
-
onCreationModeChange: Y.form.recurrence.changeCreationMode,
|
|
152
|
-
onSetUpEmailClick: Y.form.recurrence.setUpEmail,
|
|
153
|
-
emailDialog: /* @__PURE__ */ k(g, {
|
|
154
|
-
idPrefix: $,
|
|
155
|
-
view: Y.form.recurrence.emailView,
|
|
156
|
-
onOpenChange: Y.form.recurrence.changeEmailOpen,
|
|
157
|
-
onChange: Y.form.recurrence.changeEmail,
|
|
158
|
-
onSave: Y.form.recurrence.saveEmail,
|
|
159
|
-
labels: F
|
|
160
|
-
}),
|
|
161
|
-
labels: F
|
|
162
|
-
})),
|
|
163
|
-
labels: F
|
|
164
|
-
}),
|
|
165
|
-
remindersSection: Y.form.reminders.view && /* @__PURE__ */ k(v, {
|
|
166
|
-
idPrefix: te,
|
|
167
|
-
view: Y.form.reminders.view,
|
|
168
|
-
onToggle: Y.form.reminders.toggle,
|
|
169
|
-
onPaymentReminderSelect: Y.form.reminders.selectPaymentReminder,
|
|
170
|
-
onOverdueReminderSelect: Y.form.reminders.selectOverdueReminder,
|
|
171
|
-
onBeforeDueInputChange: Y.form.reminders.changeBeforeDueInput,
|
|
172
|
-
onBeforeDueSave: Y.form.reminders.saveBeforeDue,
|
|
173
|
-
onOverdueTermChange: Y.form.reminders.changeOverdueTerm,
|
|
174
|
-
onOverdueAddTerm: Y.form.reminders.addOverdueTerm,
|
|
175
|
-
onOverdueClear: Y.form.reminders.clearOverdueTerms,
|
|
176
|
-
onOverdueSave: Y.form.reminders.saveOverdue,
|
|
177
|
-
labels: F
|
|
178
|
-
}),
|
|
179
|
-
bankAccountSection: /* @__PURE__ */ k(d, {
|
|
180
|
-
idPrefix: ee,
|
|
181
|
-
view: Y.form.bankAccount.view,
|
|
182
|
-
error: Y.form.errors.bankAccountId,
|
|
183
|
-
disabled: Y.form.isSubmitting,
|
|
184
|
-
onAccountSelect: Y.form.bankAccount.selectAccount,
|
|
185
|
-
onAddAccountClick: Y.form.bankAccount.openAddAccount,
|
|
186
|
-
onFormChange: Y.form.bankAccount.updateAccountForm,
|
|
187
|
-
onFormSave: Y.form.bankAccount.saveAccount,
|
|
188
|
-
onFormCancel: Y.form.bankAccount.cancelAddAccount,
|
|
189
|
-
labels: F
|
|
190
|
-
}),
|
|
191
|
-
attachmentsSection: Y.form.attachmentsView && /* @__PURE__ */ k(x, {
|
|
192
|
-
view: Y.form.attachmentsView,
|
|
193
|
-
disabled: Y.form.isSubmitting,
|
|
194
|
-
onFilesSelect: Y.form.selectAttachmentFiles,
|
|
195
|
-
onIncludeInEmailChange: Y.form.setAttachmentIncludeInEmail,
|
|
196
|
-
onRemove: Y.form.removeAttachment,
|
|
197
|
-
labels: F
|
|
198
|
-
}),
|
|
199
|
-
cancelDisabled: Y.form.isSubmitting || Y.form.attachmentsUploading,
|
|
200
|
-
draftButtonLabel: Y.form.draftButtonLabel,
|
|
201
|
-
draftDisabled: Y.form.draftDisabled,
|
|
202
|
-
primaryButtonLabel: Y.form.primaryButtonLabel,
|
|
203
|
-
primaryDisabled: Y.form.primaryDisabled,
|
|
204
|
-
scrollContainerRef: Y.form.scrollContainerRef,
|
|
205
|
-
onSubmit: Y.form.submit,
|
|
206
|
-
onDraftClick: Y.form.selectDraftMode,
|
|
207
|
-
onPrimaryClick: Y.form.selectPrimaryMode,
|
|
208
|
-
onCancel: Y.form.close,
|
|
209
|
-
labels: F
|
|
210
|
-
}),
|
|
211
|
-
/* @__PURE__ */ k(p, {
|
|
212
|
-
open: Y.detailsOpen,
|
|
213
|
-
onOpenChange: (e) => {
|
|
214
|
-
e || Y.closeDetails();
|
|
215
|
-
},
|
|
216
|
-
details: Y.details.detailsView,
|
|
217
|
-
isLoading: Y.details.isLoading,
|
|
218
|
-
isError: Y.details.isError,
|
|
219
|
-
onActionClick: Y.handleDetailsActionClick,
|
|
220
|
-
onClose: Y.closeDetails,
|
|
221
|
-
labels: M
|
|
222
|
-
}),
|
|
223
|
-
/* @__PURE__ */ k(y, {
|
|
224
|
-
open: Y.actions.sendOpen,
|
|
225
|
-
onOpenChange: (e) => {
|
|
226
|
-
e || Y.actions.closeSend();
|
|
227
|
-
},
|
|
228
|
-
values: Y.actions.sendValues,
|
|
229
|
-
errors: Y.actions.sendErrors,
|
|
230
|
-
inProgress: Y.actions.sendInProgress,
|
|
231
|
-
onChange: (e) => Y.actions.setSendValues((t) => ({
|
|
232
|
-
...t,
|
|
233
|
-
...e
|
|
234
|
-
})),
|
|
235
|
-
onSubmit: Y.actions.submitSend,
|
|
236
|
-
onCancel: Y.actions.closeSend,
|
|
237
|
-
labels: K
|
|
238
|
-
}),
|
|
239
|
-
/* @__PURE__ */ k(h, {
|
|
240
|
-
open: Y.actions.paymentOpen,
|
|
241
|
-
onOpenChange: (e) => {
|
|
242
|
-
e || Y.actions.closePayment();
|
|
243
|
-
},
|
|
244
|
-
values: Y.actions.paymentValues,
|
|
245
|
-
errors: Y.actions.paymentErrors,
|
|
246
|
-
inProgress: Y.actions.paymentInProgress,
|
|
247
|
-
onChange: (e) => Y.actions.setPaymentValues((t) => ({
|
|
248
|
-
...t,
|
|
249
|
-
...e
|
|
250
|
-
})),
|
|
251
|
-
onSubmit: Y.actions.submitPayment,
|
|
252
|
-
onCancel: Y.actions.closePayment,
|
|
253
|
-
labels: U
|
|
254
|
-
}),
|
|
255
|
-
Y.actions.actionDialog && /* @__PURE__ */ k(u, {
|
|
256
|
-
open: !!Y.actions.actionTarget,
|
|
257
|
-
onOpenChange: (e) => {
|
|
258
|
-
e || Y.actions.closeAction();
|
|
259
|
-
},
|
|
260
|
-
title: Y.actions.actionDialog.title,
|
|
261
|
-
description: Y.actions.actionDialog.description,
|
|
262
|
-
confirmLabel: Y.actions.actionDialog.confirmLabel,
|
|
263
|
-
destructive: Y.actions.actionDialog.destructive,
|
|
264
|
-
error: Y.actions.actionError,
|
|
265
|
-
inProgress: Y.actions.actionInProgress,
|
|
266
|
-
onConfirm: Y.actions.confirmAction,
|
|
267
|
-
onCancel: Y.actions.closeAction,
|
|
268
|
-
labels: q
|
|
269
|
-
}),
|
|
270
|
-
/* @__PURE__ */ k(a, {
|
|
271
|
-
open: Y.form.counterpartView === "create",
|
|
272
|
-
onOpenChange: (e) => {
|
|
273
|
-
e || Y.form.counterpartForm.close();
|
|
274
|
-
},
|
|
275
|
-
mode: "create",
|
|
276
|
-
values: Y.form.counterpartForm.values,
|
|
277
|
-
errors: Y.form.counterpartForm.errors,
|
|
278
|
-
stateOptions: Y.form.stateOptions,
|
|
279
|
-
inProgress: Y.form.counterpartForm.isSubmitting,
|
|
280
|
-
onChange: (e) => Y.form.counterpartForm.setValues((t) => ({
|
|
281
|
-
...t,
|
|
282
|
-
...e
|
|
283
|
-
})),
|
|
284
|
-
onAddressChange: (e) => Y.form.counterpartForm.setValues((t) => ({
|
|
285
|
-
...t,
|
|
286
|
-
address: {
|
|
287
|
-
...t.address,
|
|
288
|
-
...e
|
|
20
|
+
function v({ counterpartMessageLabels: v, defaultTab: y, embeddedBankName: b, enabledTabs: x, messageLabels: S, onReceivableCreated: C, onReceivableOpened: w, screenLabels: T }) {
|
|
21
|
+
let E = e();
|
|
22
|
+
h(() => {
|
|
23
|
+
E(t.Mounted);
|
|
24
|
+
}, [E]);
|
|
25
|
+
let D = g(() => ({
|
|
26
|
+
...c,
|
|
27
|
+
...S
|
|
28
|
+
}), [S]), O = T?.statusBadge, k = g(() => ({
|
|
29
|
+
...n,
|
|
30
|
+
...O
|
|
31
|
+
}), [O]), A = g(() => r(x), [x]), [j, M] = _(() => a({
|
|
32
|
+
defaultTab: y,
|
|
33
|
+
enabledTabs: A
|
|
34
|
+
})), [N, P] = _(), [F, I] = _(!1);
|
|
35
|
+
h(() => {
|
|
36
|
+
A.includes(j) || M(a({
|
|
37
|
+
defaultTab: y,
|
|
38
|
+
enabledTabs: A
|
|
39
|
+
}));
|
|
40
|
+
}, [
|
|
41
|
+
j,
|
|
42
|
+
y,
|
|
43
|
+
A
|
|
44
|
+
]);
|
|
45
|
+
let L = m((e, t) => {
|
|
46
|
+
M(o(t)), P(e), I(!0), C?.(e, t);
|
|
47
|
+
}, [C]), R = p({
|
|
48
|
+
activeTab: j,
|
|
49
|
+
messages: D,
|
|
50
|
+
statusLabels: k
|
|
51
|
+
}), z = u({
|
|
52
|
+
selectedReceivableId: N,
|
|
53
|
+
enabled: F,
|
|
54
|
+
messages: D,
|
|
55
|
+
statusLabels: k
|
|
56
|
+
}), B = f({
|
|
57
|
+
messages: D,
|
|
58
|
+
counterpartMessageLabels: v,
|
|
59
|
+
embeddedBankName: b,
|
|
60
|
+
onCreated: L
|
|
61
|
+
}), V = m(() => {
|
|
62
|
+
let e = s(j);
|
|
63
|
+
B.openCreate(e === "quote" ? "quote" : "invoice");
|
|
64
|
+
}, [j, B.openCreate]), H = l({
|
|
65
|
+
selectedReceivable: z.receivable,
|
|
66
|
+
messages: D,
|
|
67
|
+
onCreated: L,
|
|
68
|
+
onDeleted: (e) => {
|
|
69
|
+
e === N && (P(void 0), I(!1));
|
|
70
|
+
},
|
|
71
|
+
onCompleteBeforeIssue: (e) => {
|
|
72
|
+
B.openEdit(e, { highlightForIssue: !0 }), I(!1);
|
|
73
|
+
}
|
|
74
|
+
}), U = m((e) => {
|
|
75
|
+
d() || (P(e.id), I(!0), w?.(e.id, e.type));
|
|
76
|
+
}, [w]);
|
|
77
|
+
return {
|
|
78
|
+
activeTab: j,
|
|
79
|
+
enabledTabs: A,
|
|
80
|
+
setActiveTab: M,
|
|
81
|
+
table: R,
|
|
82
|
+
details: z,
|
|
83
|
+
detailsOpen: F,
|
|
84
|
+
closeDetails: m(() => {
|
|
85
|
+
I(!1), P(void 0);
|
|
86
|
+
}, []),
|
|
87
|
+
form: B,
|
|
88
|
+
openCreate: V,
|
|
89
|
+
actions: H,
|
|
90
|
+
handleRowClick: U,
|
|
91
|
+
handleActionClick: m((e, t) => {
|
|
92
|
+
let n = R.getReceivableById(t.id);
|
|
93
|
+
if (e === "edit") {
|
|
94
|
+
if (n) {
|
|
95
|
+
B.openEdit(n);
|
|
96
|
+
return;
|
|
289
97
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
onError: d,
|
|
317
|
-
analytics: f,
|
|
318
|
-
disclosuresAcceptance: p,
|
|
319
|
-
providerLabels: m,
|
|
320
|
-
children: /* @__PURE__ */ k(j, { ...h })
|
|
321
|
-
});
|
|
98
|
+
P(t.id), I(!0);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
P(t.id), H.openAction(e, t, n ?? null);
|
|
102
|
+
}, [
|
|
103
|
+
H,
|
|
104
|
+
B.openEdit,
|
|
105
|
+
R.getReceivableById
|
|
106
|
+
]),
|
|
107
|
+
handleDetailsActionClick: m((e, t) => {
|
|
108
|
+
if (e === "edit") {
|
|
109
|
+
z.receivable && (B.openEdit(z.receivable), I(!1));
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
H.openAction(e, {
|
|
113
|
+
id: t.id,
|
|
114
|
+
title: z.receivable ? i(z.receivable, D) : t.title,
|
|
115
|
+
type: t.type
|
|
116
|
+
}, z.receivable ?? null);
|
|
117
|
+
}, [
|
|
118
|
+
H,
|
|
119
|
+
z.receivable,
|
|
120
|
+
B.openEdit,
|
|
121
|
+
D
|
|
122
|
+
])
|
|
123
|
+
};
|
|
322
124
|
}
|
|
323
125
|
//#endregion
|
|
324
|
-
export {
|
|
126
|
+
export { v as useReceivablesWidget };
|