@tesouro/embedded-components-react 0.5.214 → 0.5.216
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/dist/index.d.ts +144 -3
- package/dist/index.js +14 -13
- package/dist/lib/BankAccountOnboardingWidget.d.ts +56 -2
- package/dist/lib/BankAccountOnboardingWidget.js +4 -3
- package/dist/lib/MarketingWidget.js +1 -1
- package/dist/lib/ReceivablesWidget.d.ts +88 -1
- package/dist/lib/ReceivablesWidget.js +1 -1
- package/dist/lib/WidgetSuite.d.ts +53 -0
- package/dist/libs/shared/util-validation/dist/index5.js +7 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index11.js +72 -72
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index12.js +4 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index13.js +15 -15
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index14.js +60 -60
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index15.js +12 -12
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index16.js +16 -16
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index18.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index21.js +8 -8
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js +71 -5
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index23.js +95 -33
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index24.js +6 -17
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index25.js +16 -616
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index26.js +669 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js +15 -13
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index10.js +52 -37
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index11.js +31 -37
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index12.js +33 -89
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index13.js +39 -12
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index14.js +98 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index15.js +14 -4
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index16.js +2 -185
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index17.js +4 -30
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index18.js +183 -21
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index19.js +26 -66
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index20.js +21 -233
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index21.js +66 -27
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index22.js +233 -26
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index23.js +27 -72
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index24.js +26 -85
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index25.js +74 -8
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index26.js +83 -55
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index27.js +6 -7
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index28.js +37 -42
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index29.js +11 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index30.js +64 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index9.js +7 -33
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index10.js +63 -67
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +160 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js +6 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index2.js +32 -25
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js +25 -200
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index7.js +175 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index8.js +1 -101
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index9.js +92 -71
- 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 +44 -100
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index11.js +93 -421
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +442 -112
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +166 -157
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js +150 -204
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +202 -31
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +32 -145
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +145 -37
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +44 -58
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +113 -87
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index20.js +58 -116
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +83 -357
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js +111 -65
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +449 -99
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +68 -281
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js +115 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js +314 -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/index6.js +34 -23
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +444 -92
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +113 -52
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +18 -14
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +2 -92
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +95 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +3 -24
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +24 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +1 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +3 -18
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +18 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +0 -3
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +0 -8
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +11 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +1 -264
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +258 -42
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +38 -62
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +61 -463
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +457 -89
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +91 -234
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +89 -82
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +22 -338
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +236 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index3.js +26 -204
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +249 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +93 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +344 -0
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +208 -32
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index5.js +29 -202
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +183 -137
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +157 -12
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index8.js +10 -19
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +23 -2
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index5.js +16 -19
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index6.js +157 -16
- 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/onboardingSuppressionReason.js +3 -1
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +167 -156
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +66 -34
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/index.js +2 -1
- 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/feature/dist/lib/application/bankAccountApplication.js +26 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index16.js +1 -1
- package/dist/packages/shared-ui-shadcn/dist/index.js +13 -13
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index7.js +0 -161
package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js
CHANGED
|
@@ -2,287 +2,74 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import "
|
|
8
|
-
import {
|
|
9
|
-
import { WidgetProvider as r } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
10
|
-
import "../../../shared/feature/dist/index.js";
|
|
11
|
-
import { CounterpartFormSheet as i } from "../../../shared/counterpart-management/ui/dist/index9.js";
|
|
12
|
-
import { CounterpartSelector as a } from "../../../shared/counterpart-management/feature/dist/lib/CounterpartSelector.js";
|
|
13
|
-
import "../../../shared/counterpart-management/feature/dist/index.js";
|
|
14
|
-
import { ReceivablesWidgetAnalyticsEvent as o, WIDGET_NAME as s } from "./index2.js";
|
|
15
|
-
import { PAGE_SIZE_OPTIONS as c } from "./index4.js";
|
|
16
|
-
import { ReceivableActionDialog as l } from "../../ui/dist/index4.js";
|
|
17
|
-
import { ReceivableBankAccountSection as u } from "../../ui/dist/index5.js";
|
|
18
|
-
import { ReceivableBillingSection as d } from "../../ui/dist/index10.js";
|
|
19
|
-
import { ReceivableDetailsSheet as f } from "../../ui/dist/index21.js";
|
|
20
|
-
import { ReceivableFormSheet as p } from "../../ui/dist/index24.js";
|
|
21
|
-
import { ReceivablePaymentDialog as m } from "../../ui/dist/index25.js";
|
|
22
|
-
import { ReceivableRemindersSection as h } from "../../ui/dist/index26.js";
|
|
23
|
-
import { ReceivableSendDialog as g } from "../../ui/dist/index27.js";
|
|
24
|
-
import { ReceivablesScreen as _ } from "../../ui/dist/index28.js";
|
|
25
|
-
import "../../ui/dist/index.js";
|
|
26
|
-
import { ReceivableAttachmentsSection as v } from "./index5.js";
|
|
27
|
-
import { MeasureUnitsManagerContainer as y } from "../../../shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js";
|
|
28
|
-
import { ProductSelector as b } from "../../../shared/product-catalog/feature/dist/lib/ProductSelector.js";
|
|
29
|
-
import "../../../shared/product-catalog/feature/dist/index.js";
|
|
30
|
-
import { useReceivablesWidget as x } from "./index23.js";
|
|
31
|
-
import { useEffect as S, useId as C, useState as w } from "react";
|
|
32
|
-
import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
5
|
+
import { buildReceivableRows as e, statusFilterOptions as t, typeForTab as n } from "./index12.js";
|
|
6
|
+
import { useReceivablesQuery as r } from "../../data-access/dist/index10.js";
|
|
7
|
+
import "../../data-access/dist/index.js";
|
|
8
|
+
import { useCallback as i, useEffect as a, useMemo as o, useState as s } from "react";
|
|
33
9
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
currencySymbol: K.form.currencySymbol,
|
|
90
|
-
lineItemControls: K.form.lineItemControls,
|
|
91
|
-
autoFocusLineItemId: K.form.autoFocusLineItemId,
|
|
92
|
-
lineItemsLoading: K.form.lineItemsLoading,
|
|
93
|
-
inProgress: K.form.isSubmitting,
|
|
94
|
-
customerSelector: /* @__PURE__ */ E(a, {
|
|
95
|
-
mode: "customer",
|
|
96
|
-
value: K.form.values.customerId || void 0,
|
|
97
|
-
onValueChange: (e) => K.form.updateValues({ customerId: e }),
|
|
98
|
-
onCreateClick: K.form.openCounterpartCreate
|
|
99
|
-
}),
|
|
100
|
-
renderProductSelector: (e, t) => /* @__PURE__ */ E(b, {
|
|
101
|
-
...t,
|
|
102
|
-
inputValue: e.name,
|
|
103
|
-
selectedProductId: K.form.values.lineItems.find((t) => t.id === e.id)?.productId || void 0,
|
|
104
|
-
currency: K.form.values.currency,
|
|
105
|
-
maxLength: 100,
|
|
106
|
-
onInputValueChange: (t) => K.form.updateLineItem(e.id, { name: t }),
|
|
107
|
-
onProductSelect: (t) => K.form.selectProduct(e.id, t)
|
|
108
|
-
}),
|
|
109
|
-
onChange: K.form.updateValues,
|
|
110
|
-
onLineItemChange: K.form.updateLineItem,
|
|
111
|
-
onLineItemCommit: K.form.commitLineItem,
|
|
112
|
-
onLineItemQuantityStep: K.form.stepLineItem,
|
|
113
|
-
onTaxRateCommit: K.form.commitTaxRate,
|
|
114
|
-
onDiscountFocus: K.form.focusDiscount,
|
|
115
|
-
onDiscountCommit: K.form.commitDiscount,
|
|
116
|
-
totals: K.form.totalsView,
|
|
117
|
-
onManageUnits: () => J(!0),
|
|
118
|
-
onAddLineItem: K.form.addLineItem,
|
|
119
|
-
onRemoveLineItem: K.form.removeLineItem,
|
|
120
|
-
showDueDateField: K.form.showDueDateField,
|
|
121
|
-
billingSection: K.form.showBillingSection && /* @__PURE__ */ E(d, {
|
|
122
|
-
idPrefix: Y,
|
|
123
|
-
paymentTerms: K.form.paymentTerms.view,
|
|
124
|
-
paymentTermsError: K.form.errors.paymentTermsId,
|
|
125
|
-
disabled: K.form.isSubmitting,
|
|
126
|
-
onPaymentTermsChange: K.form.paymentTerms.select,
|
|
127
|
-
onCustomDatePickerOpenChange: K.form.paymentTerms.changeCustomDatePickerOpen,
|
|
128
|
-
customDateCalendar: /* @__PURE__ */ E(e, {
|
|
129
|
-
mode: "single",
|
|
130
|
-
captionLayout: "dropdown",
|
|
131
|
-
...K.form.paymentTerms.calendar,
|
|
132
|
-
onSelect: K.form.paymentTerms.selectCustomDate
|
|
133
|
-
}),
|
|
134
|
-
labels: M
|
|
135
|
-
}),
|
|
136
|
-
remindersSection: K.form.reminders.view && /* @__PURE__ */ E(h, {
|
|
137
|
-
idPrefix: Z,
|
|
138
|
-
view: K.form.reminders.view,
|
|
139
|
-
onToggle: K.form.reminders.toggle,
|
|
140
|
-
onPaymentReminderSelect: K.form.reminders.selectPaymentReminder,
|
|
141
|
-
onOverdueReminderSelect: K.form.reminders.selectOverdueReminder,
|
|
142
|
-
onBeforeDueInputChange: K.form.reminders.changeBeforeDueInput,
|
|
143
|
-
onBeforeDueSave: K.form.reminders.saveBeforeDue,
|
|
144
|
-
onOverdueTermChange: K.form.reminders.changeOverdueTerm,
|
|
145
|
-
onOverdueAddTerm: K.form.reminders.addOverdueTerm,
|
|
146
|
-
onOverdueClear: K.form.reminders.clearOverdueTerms,
|
|
147
|
-
onOverdueSave: K.form.reminders.saveOverdue,
|
|
148
|
-
labels: M
|
|
149
|
-
}),
|
|
150
|
-
bankAccountSection: /* @__PURE__ */ E(u, {
|
|
151
|
-
idPrefix: X,
|
|
152
|
-
view: K.form.bankAccount.view,
|
|
153
|
-
disabled: K.form.isSubmitting,
|
|
154
|
-
onAccountSelect: K.form.bankAccount.selectAccount,
|
|
155
|
-
onAddAccountClick: K.form.bankAccount.openAddAccount,
|
|
156
|
-
onFormChange: K.form.bankAccount.updateAccountForm,
|
|
157
|
-
onFormSave: K.form.bankAccount.saveAccount,
|
|
158
|
-
onFormCancel: K.form.bankAccount.cancelAddAccount,
|
|
159
|
-
labels: M
|
|
160
|
-
}),
|
|
161
|
-
attachmentsSection: K.form.attachmentsView && /* @__PURE__ */ E(v, {
|
|
162
|
-
view: K.form.attachmentsView,
|
|
163
|
-
disabled: K.form.isSubmitting,
|
|
164
|
-
onFilesSelect: K.form.selectAttachmentFiles,
|
|
165
|
-
onIncludeInEmailChange: K.form.setAttachmentIncludeInEmail,
|
|
166
|
-
onRemove: K.form.removeAttachment,
|
|
167
|
-
labels: M
|
|
168
|
-
}),
|
|
169
|
-
cancelDisabled: K.form.attachmentsUploading,
|
|
170
|
-
saveDisabled: K.form.saveDisabled,
|
|
171
|
-
onSubmit: K.form.submit,
|
|
172
|
-
onCancel: K.form.close,
|
|
173
|
-
labels: M
|
|
174
|
-
}),
|
|
175
|
-
/* @__PURE__ */ E(f, {
|
|
176
|
-
open: K.detailsOpen,
|
|
177
|
-
onOpenChange: (e) => {
|
|
178
|
-
e || K.closeDetails();
|
|
179
|
-
},
|
|
180
|
-
details: K.details.detailsView,
|
|
181
|
-
isLoading: K.details.isLoading,
|
|
182
|
-
isError: K.details.isError,
|
|
183
|
-
onActionClick: K.handleDetailsActionClick,
|
|
184
|
-
onClose: K.closeDetails,
|
|
185
|
-
labels: k
|
|
186
|
-
}),
|
|
187
|
-
/* @__PURE__ */ E(g, {
|
|
188
|
-
open: K.actions.sendOpen,
|
|
189
|
-
onOpenChange: (e) => {
|
|
190
|
-
e || K.actions.closeSend();
|
|
191
|
-
},
|
|
192
|
-
values: K.actions.sendValues,
|
|
193
|
-
errors: K.actions.sendErrors,
|
|
194
|
-
inProgress: K.actions.sendInProgress,
|
|
195
|
-
onChange: (e) => K.actions.setSendValues((t) => ({
|
|
196
|
-
...t,
|
|
197
|
-
...e
|
|
198
|
-
})),
|
|
199
|
-
onSubmit: K.actions.submitSend,
|
|
200
|
-
onCancel: K.actions.closeSend,
|
|
201
|
-
labels: U
|
|
202
|
-
}),
|
|
203
|
-
/* @__PURE__ */ E(m, {
|
|
204
|
-
open: K.actions.paymentOpen,
|
|
205
|
-
onOpenChange: (e) => {
|
|
206
|
-
e || K.actions.closePayment();
|
|
207
|
-
},
|
|
208
|
-
values: K.actions.paymentValues,
|
|
209
|
-
errors: K.actions.paymentErrors,
|
|
210
|
-
inProgress: K.actions.paymentInProgress,
|
|
211
|
-
onChange: (e) => K.actions.setPaymentValues((t) => ({
|
|
212
|
-
...t,
|
|
213
|
-
...e
|
|
214
|
-
})),
|
|
215
|
-
onSubmit: K.actions.submitPayment,
|
|
216
|
-
onCancel: K.actions.closePayment,
|
|
217
|
-
labels: B
|
|
218
|
-
}),
|
|
219
|
-
K.actions.actionDialog && /* @__PURE__ */ E(l, {
|
|
220
|
-
open: !!K.actions.actionTarget,
|
|
221
|
-
onOpenChange: (e) => {
|
|
222
|
-
e || K.actions.closeAction();
|
|
223
|
-
},
|
|
224
|
-
title: K.actions.actionDialog.title,
|
|
225
|
-
description: K.actions.actionDialog.description,
|
|
226
|
-
confirmLabel: K.actions.actionDialog.confirmLabel,
|
|
227
|
-
destructive: K.actions.actionDialog.destructive,
|
|
228
|
-
error: K.actions.actionError,
|
|
229
|
-
inProgress: K.actions.actionInProgress,
|
|
230
|
-
onConfirm: K.actions.confirmAction,
|
|
231
|
-
onCancel: K.actions.closeAction,
|
|
232
|
-
labels: W
|
|
233
|
-
}),
|
|
234
|
-
/* @__PURE__ */ E(i, {
|
|
235
|
-
open: K.form.counterpartView === "create",
|
|
236
|
-
onOpenChange: (e) => {
|
|
237
|
-
e || K.form.counterpartForm.close();
|
|
238
|
-
},
|
|
239
|
-
mode: "create",
|
|
240
|
-
values: K.form.counterpartForm.values,
|
|
241
|
-
errors: K.form.counterpartForm.errors,
|
|
242
|
-
stateOptions: K.form.stateOptions,
|
|
243
|
-
inProgress: K.form.counterpartForm.isSubmitting,
|
|
244
|
-
onChange: (e) => K.form.counterpartForm.setValues((t) => ({
|
|
245
|
-
...t,
|
|
246
|
-
...e
|
|
247
|
-
})),
|
|
248
|
-
onAddressChange: (e) => K.form.counterpartForm.setValues((t) => ({
|
|
249
|
-
...t,
|
|
250
|
-
address: {
|
|
251
|
-
...t.address,
|
|
252
|
-
...e
|
|
253
|
-
}
|
|
254
|
-
})),
|
|
255
|
-
onSubmit: K.form.counterpartForm.submit,
|
|
256
|
-
onCancel: K.form.counterpartForm.close,
|
|
257
|
-
labels: r
|
|
258
|
-
}),
|
|
259
|
-
/* @__PURE__ */ E(y, {
|
|
260
|
-
open: q,
|
|
261
|
-
onClose: () => J(!1),
|
|
262
|
-
managerLabels: P,
|
|
263
|
-
deleteLabels: N,
|
|
264
|
-
messageLabels: V
|
|
265
|
-
})
|
|
266
|
-
] });
|
|
267
|
-
}
|
|
268
|
-
function k({ baseUrl: e, widgetToken: t, organizationId: n, configClient: i, gatewayRouting: a, linkComponent: o, implementation: c, uiFramework: l, errorFallback: u, onError: d, analytics: f, disclosuresAcceptance: p, providerLabels: m, ...h }) {
|
|
269
|
-
return /* @__PURE__ */ E(r, {
|
|
270
|
-
widgetName: s,
|
|
271
|
-
baseUrl: e,
|
|
272
|
-
widgetToken: t,
|
|
273
|
-
organizationId: n,
|
|
274
|
-
configClient: i,
|
|
275
|
-
gatewayRouting: a,
|
|
276
|
-
linkComponent: o,
|
|
277
|
-
implementation: c,
|
|
278
|
-
uiFramework: l,
|
|
279
|
-
errorFallback: u,
|
|
280
|
-
onError: d,
|
|
281
|
-
analytics: f,
|
|
282
|
-
disclosuresAcceptance: p,
|
|
283
|
-
providerLabels: m,
|
|
284
|
-
children: /* @__PURE__ */ E(O, { ...h })
|
|
285
|
-
});
|
|
10
|
+
var c = [];
|
|
11
|
+
function l({ activeTab: l, messages: d }) {
|
|
12
|
+
let [f, p] = s([]), [m, h] = s(10), [g, _] = s(), [v, y] = s(""), [b, x] = s(""), [S, C] = s("all");
|
|
13
|
+
a(() => {
|
|
14
|
+
_(void 0), C("all");
|
|
15
|
+
}, [l]), a(() => {
|
|
16
|
+
let e = setTimeout(() => {
|
|
17
|
+
x(v), _(void 0);
|
|
18
|
+
}, 300);
|
|
19
|
+
return () => clearTimeout(e);
|
|
20
|
+
}, [v]);
|
|
21
|
+
let w = f[0]?.id, T = w ? u[w] : void 0, E = f[0] ? f[0].desc ? "desc" : "asc" : void 0, D = r({
|
|
22
|
+
type: n(l),
|
|
23
|
+
limit: m,
|
|
24
|
+
pagination_token: g,
|
|
25
|
+
search_text: b || void 0,
|
|
26
|
+
status: S === "all" ? void 0 : S,
|
|
27
|
+
...T ? {
|
|
28
|
+
sort: T,
|
|
29
|
+
order: E
|
|
30
|
+
} : {}
|
|
31
|
+
}), O = D.data?.data ?? c, k = o(() => new Map(O.map((e) => [e.id, e])), [O]), A = i((e) => k.get(e), [k]), j = o(() => e({
|
|
32
|
+
receivables: O,
|
|
33
|
+
messages: d
|
|
34
|
+
}), [d, O]), M = !!b || S !== "all", N = i((e) => {
|
|
35
|
+
let t = typeof e == "function" ? e(f) : e;
|
|
36
|
+
p(t), _(void 0);
|
|
37
|
+
}, [f]), P = i((e) => {
|
|
38
|
+
h(e), _(void 0);
|
|
39
|
+
}, []), F = i((e) => {
|
|
40
|
+
C(e), _(void 0);
|
|
41
|
+
}, []), I = i(() => _(D.data?.next_pagination_token ?? void 0), [D.data?.next_pagination_token]), L = i(() => _(D.data?.prev_pagination_token ?? void 0), [D.data?.prev_pagination_token]), R = i(() => {
|
|
42
|
+
D.refetch();
|
|
43
|
+
}, [D]);
|
|
44
|
+
return {
|
|
45
|
+
rows: j,
|
|
46
|
+
isLoading: D.isLoading,
|
|
47
|
+
isError: D.isError,
|
|
48
|
+
sorting: f,
|
|
49
|
+
onSortingChange: N,
|
|
50
|
+
pageSize: m,
|
|
51
|
+
onPageSizeChange: P,
|
|
52
|
+
hasNextPage: !!D.data?.next_pagination_token,
|
|
53
|
+
hasPrevPage: !!D.data?.prev_pagination_token,
|
|
54
|
+
onNextPage: I,
|
|
55
|
+
onPrevPage: L,
|
|
56
|
+
searchValue: v,
|
|
57
|
+
onSearchChange: y,
|
|
58
|
+
statusFilter: S,
|
|
59
|
+
statusOptions: t(),
|
|
60
|
+
onStatusFilterChange: F,
|
|
61
|
+
isFiltering: M,
|
|
62
|
+
onRetry: R,
|
|
63
|
+
getReceivableById: A
|
|
64
|
+
};
|
|
286
65
|
}
|
|
66
|
+
var u = {
|
|
67
|
+
documentLabel: "document_id",
|
|
68
|
+
customerLabel: "counterpart_name",
|
|
69
|
+
status: "status",
|
|
70
|
+
issueDateLabel: "issue_date",
|
|
71
|
+
dueDateLabel: "due_date",
|
|
72
|
+
totalLabel: "total_amount"
|
|
73
|
+
};
|
|
287
74
|
//#endregion
|
|
288
|
-
export {
|
|
75
|
+
export { l as useReceivablesTable };
|
|
@@ -0,0 +1,115 @@
|
|
|
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 { coerceEnabledTabs as n, resolveInitialTab as r, tabForType as i, typeForTab as a } from "./index12.js";
|
|
9
|
+
import { RECEIVABLE_MESSAGE_LABELS_EN as o } from "./index13.js";
|
|
10
|
+
import { useReceivableActions as s } from "./index15.js";
|
|
11
|
+
import { useReceivableDetails as c } from "./index16.js";
|
|
12
|
+
import { hasSelectedText as l } from "../../../shared/product-catalog/feature/dist/lib/helpers.js";
|
|
13
|
+
import "../../../shared/product-catalog/feature/dist/index.js";
|
|
14
|
+
import { useReceivableForm as u } from "./index23.js";
|
|
15
|
+
import { useReceivablesTable as d } from "./index24.js";
|
|
16
|
+
import { useCallback as f, useEffect as p, useMemo as m, useState as h } from "react";
|
|
17
|
+
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js
|
|
18
|
+
function g({ counterpartMessageLabels: g, defaultTab: _, embeddedBankName: v, enabledTabs: y, messageLabels: b, onReceivableCreated: x, onReceivableOpened: S }) {
|
|
19
|
+
let C = e();
|
|
20
|
+
p(() => {
|
|
21
|
+
C(t.Mounted);
|
|
22
|
+
}, [C]);
|
|
23
|
+
let w = m(() => ({
|
|
24
|
+
...o,
|
|
25
|
+
...b
|
|
26
|
+
}), [b]), T = m(() => n(y), [y]), [E, D] = h(() => r({
|
|
27
|
+
defaultTab: _,
|
|
28
|
+
enabledTabs: T
|
|
29
|
+
})), [O, k] = h(), [A, j] = h(!1);
|
|
30
|
+
p(() => {
|
|
31
|
+
T.includes(E) || D(r({
|
|
32
|
+
defaultTab: _,
|
|
33
|
+
enabledTabs: T
|
|
34
|
+
}));
|
|
35
|
+
}, [
|
|
36
|
+
E,
|
|
37
|
+
_,
|
|
38
|
+
T
|
|
39
|
+
]);
|
|
40
|
+
let M = f((e, t) => {
|
|
41
|
+
D(i(t)), k(e), j(!0), x?.(e, t);
|
|
42
|
+
}, [x]), N = d({
|
|
43
|
+
activeTab: E,
|
|
44
|
+
messages: w
|
|
45
|
+
}), P = c({
|
|
46
|
+
selectedReceivableId: O,
|
|
47
|
+
enabled: A,
|
|
48
|
+
messages: w
|
|
49
|
+
}), F = u({
|
|
50
|
+
messages: w,
|
|
51
|
+
counterpartMessageLabels: g,
|
|
52
|
+
embeddedBankName: v,
|
|
53
|
+
onCreated: M
|
|
54
|
+
}), I = f(() => {
|
|
55
|
+
let e = a(E);
|
|
56
|
+
F.openCreate(e === "quote" ? "quote" : "invoice");
|
|
57
|
+
}, [E, F.openCreate]), L = s({
|
|
58
|
+
selectedReceivable: P.receivable,
|
|
59
|
+
messages: w,
|
|
60
|
+
onCreated: M,
|
|
61
|
+
onDeleted: (e) => {
|
|
62
|
+
e === O && (k(void 0), j(!1));
|
|
63
|
+
}
|
|
64
|
+
}), R = f((e) => {
|
|
65
|
+
l() || (k(e.id), j(!0), S?.(e.id, e.type));
|
|
66
|
+
}, [S]);
|
|
67
|
+
return {
|
|
68
|
+
activeTab: E,
|
|
69
|
+
enabledTabs: T,
|
|
70
|
+
setActiveTab: D,
|
|
71
|
+
table: N,
|
|
72
|
+
details: P,
|
|
73
|
+
detailsOpen: A,
|
|
74
|
+
closeDetails: f(() => {
|
|
75
|
+
j(!1), k(void 0);
|
|
76
|
+
}, []),
|
|
77
|
+
form: F,
|
|
78
|
+
openCreate: I,
|
|
79
|
+
actions: L,
|
|
80
|
+
handleRowClick: R,
|
|
81
|
+
handleActionClick: f((e, t) => {
|
|
82
|
+
let n = N.getReceivableById(t.id);
|
|
83
|
+
if (e === "edit") {
|
|
84
|
+
if (n) {
|
|
85
|
+
F.openEdit(n);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
k(t.id), j(!0);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
k(t.id), L.openAction(e, t, n ?? null);
|
|
92
|
+
}, [
|
|
93
|
+
L,
|
|
94
|
+
F.openEdit,
|
|
95
|
+
N.getReceivableById
|
|
96
|
+
]),
|
|
97
|
+
handleDetailsActionClick: f((e, t) => {
|
|
98
|
+
if (e === "edit") {
|
|
99
|
+
P.receivable && (F.openEdit(P.receivable), j(!1));
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
L.openAction(e, {
|
|
103
|
+
id: t.id,
|
|
104
|
+
title: t.title,
|
|
105
|
+
type: t.type
|
|
106
|
+
}, P.receivable ?? null);
|
|
107
|
+
}, [
|
|
108
|
+
L,
|
|
109
|
+
P.receivable,
|
|
110
|
+
F.openEdit
|
|
111
|
+
])
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
//#endregion
|
|
115
|
+
export { g as useReceivablesWidget };
|