@tesouro/embedded-components-react 0.5.228 → 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.
- package/README.md +22 -21
- package/dist/index.d.ts +34 -1
- package/dist/index.js +1 -1
- package/dist/lib/ReceivablesWidget.d.ts +34 -1
- package/dist/lib/ReceivablesWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index5.js +32 -33
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js +34 -32
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index7.js +1 -1
- 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/index10.js +120 -52
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index11.js +44 -100
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +93 -337
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +356 -211
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js +225 -157
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +152 -21
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +18 -221
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +224 -56
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +126 -231
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +53 -298
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index20.js +232 -43
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +295 -118
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js +38 -145
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +126 -46
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +145 -117
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js +38 -91
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js +113 -107
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index27.js +94 -27
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js +104 -619
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index29.js +34 -41
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index30.js +635 -34
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index31.js +39 -77
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js +34 -117
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index33.js +75 -318
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index34.js +139 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index35.js +340 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +55 -468
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +443 -97
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +24 -21
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +32 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +205 -84
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +161 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +12 -20
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +23 -40
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +2 -17
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +90 -68
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +3 -20
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +20 -12
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +40 -30
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +14 -7
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +15 -301
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +73 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +17 -45
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +12 -68
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +26 -490
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +294 -95
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +48 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +72 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +496 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index3.js +121 -27
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +97 -91
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +2 -236
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +1 -249
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +89 -82
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +23 -54
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +223 -340
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +249 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +100 -216
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +93 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +59 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +353 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index5.js +35 -29
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +2 -216
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +9 -159
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index8.js +27 -14
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +216 -23
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/index.js +12 -12
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +0 -28
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index33.js
CHANGED
|
@@ -2,324 +2,81 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import "
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
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 { 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 { ReceivableDetailsPanel as p } from "../../ui/dist/index20.js";
|
|
20
|
-
import { ReceivableFormSheet as m } from "../../ui/dist/index24.js";
|
|
21
|
-
import { ReceivablePaymentDialog as h } from "../../ui/dist/index25.js";
|
|
22
|
-
import { ReceivableRecurrenceEmailDialog as g } from "../../ui/dist/index30.js";
|
|
23
|
-
import { ReceivableRecurrenceSection as _ } from "../../ui/dist/index32.js";
|
|
24
|
-
import { ReceivableRemindersSection as v } from "../../ui/dist/index34.js";
|
|
25
|
-
import { ReceivableSendDialog as y } from "../../ui/dist/index35.js";
|
|
26
|
-
import { ReceivablesScreen as b } from "../../ui/dist/index37.js";
|
|
27
|
-
import "../../ui/dist/index.js";
|
|
28
|
-
import { ReceivableAttachmentsSection as x } from "./index5.js";
|
|
29
|
-
import { MeasureUnitsManagerContainer as S } from "../../../shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js";
|
|
30
|
-
import { ProductSelector as C } from "../../../shared/product-catalog/feature/dist/lib/ProductSelector.js";
|
|
31
|
-
import "../../../shared/product-catalog/feature/dist/index.js";
|
|
32
|
-
import { useReceivablesWidget as w } from "./index32.js";
|
|
33
|
-
import { useEffect as T, useId as E, useState as D } from "react";
|
|
34
|
-
import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
5
|
+
import { buildReceivableRows as e, statusFilterOptions as t, typeForTab as n } from "./index13.js";
|
|
6
|
+
import { useReceivablesQuery as r } from "../../data-access/dist/index10.js";
|
|
7
|
+
import "../../data-access/dist/index.js";
|
|
8
|
+
import { useReceivableStatusCards as i } from "./index32.js";
|
|
9
|
+
import { useCallback as a, useEffect as o, useMemo as s, useState as c } from "react";
|
|
35
10
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index33.js
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
lineItemsLoading: Y.form.lineItemsLoading,
|
|
98
|
-
inProgress: Y.form.isSubmitting,
|
|
99
|
-
customerSelector: /* @__PURE__ */ k(o, {
|
|
100
|
-
mode: "customer",
|
|
101
|
-
value: Y.form.values.customerId || void 0,
|
|
102
|
-
invalid: !!Y.form.errors.customerId,
|
|
103
|
-
onValueChange: (e) => Y.form.updateValues({ customerId: e }),
|
|
104
|
-
onCreateClick: Y.form.openCounterpartCreate
|
|
105
|
-
}),
|
|
106
|
-
renderProductSelector: (e, t) => /* @__PURE__ */ k(C, {
|
|
107
|
-
...t,
|
|
108
|
-
inputValue: e.name,
|
|
109
|
-
selectedProductId: Y.form.values.lineItems.find((t) => t.id === e.id)?.productId || void 0,
|
|
110
|
-
currency: Y.form.values.currency,
|
|
111
|
-
maxLength: 100,
|
|
112
|
-
onInputValueChange: (t) => Y.form.updateLineItem(e.id, { name: t }),
|
|
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
|
-
unsupported: Y.details.unsupportedView,
|
|
218
|
-
isLoading: Y.details.isLoading,
|
|
219
|
-
isError: Y.details.isError,
|
|
220
|
-
onActionClick: Y.handleDetailsActionClick,
|
|
221
|
-
onClose: Y.closeDetails,
|
|
222
|
-
labels: M
|
|
223
|
-
}),
|
|
224
|
-
/* @__PURE__ */ k(y, {
|
|
225
|
-
open: Y.actions.sendOpen,
|
|
226
|
-
onOpenChange: (e) => {
|
|
227
|
-
e || Y.actions.closeSend();
|
|
228
|
-
},
|
|
229
|
-
values: Y.actions.sendValues,
|
|
230
|
-
errors: Y.actions.sendErrors,
|
|
231
|
-
inProgress: Y.actions.sendInProgress,
|
|
232
|
-
onChange: (e) => Y.actions.setSendValues((t) => ({
|
|
233
|
-
...t,
|
|
234
|
-
...e
|
|
235
|
-
})),
|
|
236
|
-
onSubmit: Y.actions.submitSend,
|
|
237
|
-
onCancel: Y.actions.closeSend,
|
|
238
|
-
labels: K
|
|
239
|
-
}),
|
|
240
|
-
/* @__PURE__ */ k(h, {
|
|
241
|
-
open: Y.actions.paymentOpen,
|
|
242
|
-
onOpenChange: (e) => {
|
|
243
|
-
e || Y.actions.closePayment();
|
|
244
|
-
},
|
|
245
|
-
values: Y.actions.paymentValues,
|
|
246
|
-
errors: Y.actions.paymentErrors,
|
|
247
|
-
inProgress: Y.actions.paymentInProgress,
|
|
248
|
-
onChange: (e) => Y.actions.setPaymentValues((t) => ({
|
|
249
|
-
...t,
|
|
250
|
-
...e
|
|
251
|
-
})),
|
|
252
|
-
onSubmit: Y.actions.submitPayment,
|
|
253
|
-
onCancel: Y.actions.closePayment,
|
|
254
|
-
labels: U
|
|
255
|
-
}),
|
|
256
|
-
Y.actions.actionDialog && /* @__PURE__ */ k(u, {
|
|
257
|
-
open: !!Y.actions.actionTarget,
|
|
258
|
-
onOpenChange: (e) => {
|
|
259
|
-
e || Y.actions.closeAction();
|
|
260
|
-
},
|
|
261
|
-
title: Y.actions.actionDialog.title,
|
|
262
|
-
description: Y.actions.actionDialog.description,
|
|
263
|
-
confirmLabel: Y.actions.actionDialog.confirmLabel,
|
|
264
|
-
destructive: Y.actions.actionDialog.destructive,
|
|
265
|
-
error: Y.actions.actionError,
|
|
266
|
-
inProgress: Y.actions.actionInProgress,
|
|
267
|
-
onConfirm: Y.actions.confirmAction,
|
|
268
|
-
onCancel: Y.actions.closeAction,
|
|
269
|
-
labels: q
|
|
270
|
-
}),
|
|
271
|
-
/* @__PURE__ */ k(a, {
|
|
272
|
-
open: Y.form.counterpartView === "create",
|
|
273
|
-
onOpenChange: (e) => {
|
|
274
|
-
e || Y.form.counterpartForm.close();
|
|
275
|
-
},
|
|
276
|
-
mode: "create",
|
|
277
|
-
values: Y.form.counterpartForm.values,
|
|
278
|
-
errors: Y.form.counterpartForm.errors,
|
|
279
|
-
stateOptions: Y.form.stateOptions,
|
|
280
|
-
inProgress: Y.form.counterpartForm.isSubmitting,
|
|
281
|
-
onChange: (e) => Y.form.counterpartForm.setValues((t) => ({
|
|
282
|
-
...t,
|
|
283
|
-
...e
|
|
284
|
-
})),
|
|
285
|
-
onAddressChange: (e) => Y.form.counterpartForm.setValues((t) => ({
|
|
286
|
-
...t,
|
|
287
|
-
address: {
|
|
288
|
-
...t.address,
|
|
289
|
-
...e
|
|
290
|
-
}
|
|
291
|
-
})),
|
|
292
|
-
onSubmit: Y.form.counterpartForm.submit,
|
|
293
|
-
onCancel: Y.form.counterpartForm.close,
|
|
294
|
-
labels: i
|
|
295
|
-
}),
|
|
296
|
-
/* @__PURE__ */ k(S, {
|
|
297
|
-
open: X,
|
|
298
|
-
onClose: () => Z(!1),
|
|
299
|
-
managerLabels: L,
|
|
300
|
-
deleteLabels: I,
|
|
301
|
-
messageLabels: W
|
|
302
|
-
})
|
|
303
|
-
] });
|
|
304
|
-
}
|
|
305
|
-
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 }) {
|
|
306
|
-
return /* @__PURE__ */ k(i, {
|
|
307
|
-
widgetName: c,
|
|
308
|
-
baseUrl: e,
|
|
309
|
-
widgetToken: t,
|
|
310
|
-
organizationId: n,
|
|
311
|
-
configClient: r,
|
|
312
|
-
gatewayRouting: a,
|
|
313
|
-
linkComponent: o,
|
|
314
|
-
implementation: s,
|
|
315
|
-
uiFramework: l,
|
|
316
|
-
errorFallback: u,
|
|
317
|
-
onError: d,
|
|
318
|
-
analytics: f,
|
|
319
|
-
disclosuresAcceptance: p,
|
|
320
|
-
providerLabels: m,
|
|
321
|
-
children: /* @__PURE__ */ k(j, { ...h })
|
|
322
|
-
});
|
|
11
|
+
var l = [];
|
|
12
|
+
function u({ activeTab: u, messages: f, statusLabels: p }) {
|
|
13
|
+
let [m, h] = c([]), [g, _] = c(10), [v, y] = c(), [b, x] = c(""), [S, C] = c(""), [w, T] = c("all");
|
|
14
|
+
o(() => {
|
|
15
|
+
y(void 0), T("all");
|
|
16
|
+
}, [u]), o(() => {
|
|
17
|
+
let e = setTimeout(() => {
|
|
18
|
+
C(b), y(void 0);
|
|
19
|
+
}, 300);
|
|
20
|
+
return () => clearTimeout(e);
|
|
21
|
+
}, [b]);
|
|
22
|
+
let E = m[0]?.id, D = E ? d[E] : void 0, O = m[0] ? m[0].desc ? "desc" : "asc" : void 0, k = r({
|
|
23
|
+
type: n(u),
|
|
24
|
+
limit: g,
|
|
25
|
+
pagination_token: v,
|
|
26
|
+
search_text: S || void 0,
|
|
27
|
+
status: w === "all" ? void 0 : w,
|
|
28
|
+
...D ? {
|
|
29
|
+
sort: D,
|
|
30
|
+
order: O
|
|
31
|
+
} : {}
|
|
32
|
+
}), A = i({
|
|
33
|
+
enabled: u === "invoices",
|
|
34
|
+
statusFilter: w,
|
|
35
|
+
messages: f,
|
|
36
|
+
statusLabels: p
|
|
37
|
+
}), j = k.data?.data ?? l, M = s(() => new Map(j.map((e) => [e.id, e])), [j]), N = a((e) => M.get(e), [M]), P = s(() => e({
|
|
38
|
+
receivables: j,
|
|
39
|
+
messages: f
|
|
40
|
+
}), [f, j]), F = !!S || w !== "all", I = a((e) => {
|
|
41
|
+
let t = typeof e == "function" ? e(m) : e;
|
|
42
|
+
h(t), y(void 0);
|
|
43
|
+
}, [m]), L = a((e) => {
|
|
44
|
+
_(e), y(void 0);
|
|
45
|
+
}, []), R = a((e) => {
|
|
46
|
+
T(e), y(void 0);
|
|
47
|
+
}, []), z = a(() => y(k.data?.next_pagination_token ?? void 0), [k.data?.next_pagination_token]), B = a(() => y(k.data?.prev_pagination_token ?? void 0), [k.data?.prev_pagination_token]), V = a(() => {
|
|
48
|
+
k.refetch();
|
|
49
|
+
}, [k]);
|
|
50
|
+
return {
|
|
51
|
+
rows: P,
|
|
52
|
+
isLoading: k.isLoading,
|
|
53
|
+
isError: k.isError,
|
|
54
|
+
sorting: m,
|
|
55
|
+
onSortingChange: I,
|
|
56
|
+
pageSize: g,
|
|
57
|
+
onPageSizeChange: L,
|
|
58
|
+
hasNextPage: !!k.data?.next_pagination_token,
|
|
59
|
+
hasPrevPage: !!k.data?.prev_pagination_token,
|
|
60
|
+
onNextPage: z,
|
|
61
|
+
onPrevPage: B,
|
|
62
|
+
searchValue: b,
|
|
63
|
+
onSearchChange: x,
|
|
64
|
+
statusFilter: w,
|
|
65
|
+
statusOptions: t(w),
|
|
66
|
+
onStatusFilterChange: R,
|
|
67
|
+
statusCards: A,
|
|
68
|
+
isFiltering: F,
|
|
69
|
+
onRetry: V,
|
|
70
|
+
getReceivableById: N
|
|
71
|
+
};
|
|
323
72
|
}
|
|
73
|
+
var d = {
|
|
74
|
+
documentLabel: "document_id",
|
|
75
|
+
customerLabel: "counterpart_name",
|
|
76
|
+
status: "status",
|
|
77
|
+
issueDateLabel: "issue_date",
|
|
78
|
+
dueDateLabel: "due_date",
|
|
79
|
+
totalLabel: "total_amount"
|
|
80
|
+
};
|
|
324
81
|
//#endregion
|
|
325
|
-
export {
|
|
82
|
+
export { u as useReceivablesTable };
|
|
@@ -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 };
|