@tesouro/embedded-components-react 0.5.246 → 0.5.248
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 +27 -26
- package/dist/index.d.ts +2 -1
- package/dist/lib/ReceivablesWidget.d.ts +2 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +58 -57
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivableForm.js +5 -4
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js +140 -131
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -505,32 +505,33 @@ Lists, creates, edits and acts on an organization's invoices, quotes and credit
|
|
|
505
505
|
|
|
506
506
|
#### Props
|
|
507
507
|
|
|
508
|
-
| Prop | Type | Default | Description
|
|
509
|
-
| -------------------------- | ---------------------------------------------------- | ---------------------------------------- |
|
|
510
|
-
| `defaultTab` | `ReceivablesWidgetTab` | `'invoices'` | Initial tab; if omitted or disabled, the widget starts on the first enabled tab.
|
|
511
|
-
| `enabledTabs` | `ReceivablesWidgetTab[]` | `['invoices', 'quotes', 'credit_notes']` | Tabs visible to the user. Duplicate or unknown values are ignored.
|
|
512
|
-
| `
|
|
513
|
-
| `
|
|
514
|
-
| `
|
|
515
|
-
| `
|
|
516
|
-
| `
|
|
517
|
-
| `
|
|
518
|
-
| `
|
|
519
|
-
| `
|
|
520
|
-
| `
|
|
521
|
-
| `
|
|
522
|
-
| `
|
|
523
|
-
| `
|
|
524
|
-
| `
|
|
525
|
-
| `
|
|
526
|
-
| `
|
|
527
|
-
| `
|
|
528
|
-
| `
|
|
529
|
-
| `
|
|
530
|
-
| `
|
|
531
|
-
| `
|
|
532
|
-
| `
|
|
533
|
-
| `
|
|
508
|
+
| Prop | Type | Default | Description |
|
|
509
|
+
| -------------------------- | ---------------------------------------------------- | ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
510
|
+
| `defaultTab` | `ReceivablesWidgetTab` | `'invoices'` | Initial tab; if omitted or disabled, the widget starts on the first enabled tab. |
|
|
511
|
+
| `enabledTabs` | `ReceivablesWidgetTab[]` | `['invoices', 'quotes', 'credit_notes']` | Tabs visible to the user. Duplicate or unknown values are ignored. |
|
|
512
|
+
| `initialView` | `'create'` | `undefined` | Opens the create-invoice form once on mount, when the user can create invoices. Closing it does not reopen it. |
|
|
513
|
+
| `initialCounterpartId` | `string` | `undefined` | With `initialView: 'create'`, preselects this customer in that first create form only. Otherwise, opens the invoice list filtered to this customer, with a chip naming them. Clear all removes it. |
|
|
514
|
+
| `pageSizeOptions` | `number[]` | `[10, 25, 50, 100]` | Rows-per-page choices. The first page loads with a page size of `10`. |
|
|
515
|
+
| `onReceivableCreated` | `(id: string, type: ReceivableDocumentType) => void` | `undefined` | Called after a create or clone succeeds. |
|
|
516
|
+
| `onReceivableOpened` | `(id: string, type: ReceivableDocumentType) => void` | `undefined` | Called when the user opens a row's details panel. |
|
|
517
|
+
| `onTemplateSettingsClick` | `() => void` | `undefined` | Shows a template settings action in the header and calls this handler when clicked. |
|
|
518
|
+
| `embeddedBankName` | `string` | `undefined` | Sponsor bank name shown as "Powered by {embeddedBankName}" next to embedded accounts in the invoice payment-account picker. Omitted when unset. |
|
|
519
|
+
| `screenLabels` | `ReceivablesScreenLabelOverrides` | English labels | Table, tab, filter, empty, error, action and status badge copy. |
|
|
520
|
+
| `filterBarLabels` | `InvoicesFilterBarLabelOverrides` | English labels | Invoice filter bar copy: field names, search, amount bounds, the customer panel and Clear all. |
|
|
521
|
+
| `filterLabels` | `InvoicesFilterLabelOverrides` | English labels | Invoice filter copy built from state: date presets, status descriptions and chip wording. |
|
|
522
|
+
| `formLabels` | `Partial<ReceivableFormSheetLabels>` | English labels | Create/edit form copy; the save and issue buttons are in `messageLabels`. |
|
|
523
|
+
| `detailsLabels` | `ReceivableDetailsPanelLabelOverrides` | English labels | Details panel copy. Status badge copy comes from `screenLabels.statusBadge`. |
|
|
524
|
+
| `auditHistoryLabels` | `Partial<ReceivableAuditHistoryLabels>` | English labels | Audit history row copy. Document and status names follow `messageLabels` and `screenLabels.statusBadge` unless overridden here. |
|
|
525
|
+
| `sendLabels` | `Partial<ReceivableSendDialogLabels>` | English labels | Send-email dialog copy. |
|
|
526
|
+
| `paymentLabels` | `Partial<ReceivablePaymentDialogLabels>` | English labels | Manual payment dialog copy. |
|
|
527
|
+
| `actionLabels` | `Partial<ReceivableActionDialogLabels>` | English labels | Confirmation dialog buttons; per-action titles come from `messageLabels`. |
|
|
528
|
+
| `actionsModalLabels` | `Partial<ReceivableActionsModalLabels>` | English labels | Copy of the modal shown after a create: the email step and the save-items-as-products step. Its titles, toasts and select-all toggle are in `messageLabels`. |
|
|
529
|
+
| `counterpartFormLabels` | `PartialDeep<CounterpartFormSheetLabels>` | English labels | Inline customer creation copy. |
|
|
530
|
+
| `measureUnitsLabels` | `Partial<MeasureUnitsManagerLabels>` | English labels | Measure-unit manager copy. |
|
|
531
|
+
| `measureUnitDeleteLabels` | `Partial<MeasureUnitDeleteDialogLabels>` | English labels | Measure-unit delete confirmation copy. |
|
|
532
|
+
| `messageLabels` | `Partial<ReceivableMessageLabels>` | English labels | Validation, fallback, details panel, reminder and confirmation messages, including the form's save and issue buttons and a new reminder's subject and body. |
|
|
533
|
+
| `productMessageLabels` | `Partial<ProductMessageLabels>` | English labels | Product validation and error messages. |
|
|
534
|
+
| `counterpartMessageLabels` | `Partial<CounterpartMessageLabels>` | English labels | Customer validation and error messages. |
|
|
534
535
|
|
|
535
536
|
### SettingsWidget
|
|
536
537
|
|
package/dist/index.d.ts
CHANGED
|
@@ -5615,7 +5615,8 @@ interface ReceivablesWidgetOwnProps {
|
|
|
5615
5615
|
/** Sponsor bank shown as "Powered by {bank}" beside embedded accounts. */
|
|
5616
5616
|
embeddedBankName?: string;
|
|
5617
5617
|
enabledTabs?: ReceivablesWidgetTab[];
|
|
5618
|
-
|
|
5618
|
+
initialView?: 'create';
|
|
5619
|
+
/** Preselects this customer in the create form with `initialView: 'create'`; otherwise filters the invoice list to them. */
|
|
5619
5620
|
initialCounterpartId?: string;
|
|
5620
5621
|
pageSizeOptions?: number[];
|
|
5621
5622
|
onReceivableCreated?: (id: string, type: ReceivableDocumentType) => void;
|
|
@@ -1624,7 +1624,8 @@ interface ReceivablesWidgetOwnProps {
|
|
|
1624
1624
|
/** Sponsor bank shown as "Powered by {bank}" beside embedded accounts. */
|
|
1625
1625
|
embeddedBankName?: string;
|
|
1626
1626
|
enabledTabs?: ReceivablesWidgetTab[];
|
|
1627
|
-
|
|
1627
|
+
initialView?: 'create';
|
|
1628
|
+
/** Preselects this customer in the create form with `initialView: 'create'`; otherwise filters the invoice list to them. */
|
|
1628
1629
|
initialCounterpartId?: string;
|
|
1629
1630
|
pageSizeOptions?: number[];
|
|
1630
1631
|
onReceivableCreated?: (id: string, type: ReceivableDocumentType) => void;
|
|
@@ -25,37 +25,38 @@ import { ReceivableRecurrenceEmailDialog as v } from "../../../../ui/dist/index4
|
|
|
25
25
|
import { ReceivableRecurrenceSection as y } from "../../../../ui/dist/index46.js";
|
|
26
26
|
import { ReceivableRemindersSection as b } from "../../../../ui/dist/index48.js";
|
|
27
27
|
import { ReceivableSendDialog as x } from "../../../../ui/dist/index49.js";
|
|
28
|
-
import { ReceivablesScreen as
|
|
28
|
+
import { ReceivablesScreen as ee } from "../../../../ui/dist/index51.js";
|
|
29
29
|
import "../../../../ui/dist/index.js";
|
|
30
|
-
import { ReceivableAttachmentsSection as
|
|
31
|
-
import { MeasureUnitsManagerContainer as
|
|
32
|
-
import { ProductSelector as
|
|
30
|
+
import { ReceivableAttachmentsSection as te } from "./ReceivableAttachmentsSection.js";
|
|
31
|
+
import { MeasureUnitsManagerContainer as ne } from "../../../../../shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js";
|
|
32
|
+
import { ProductSelector as S } from "../../../../../shared/product-catalog/feature/dist/lib/ProductSelector.js";
|
|
33
33
|
import "../../../../../shared/product-catalog/feature/dist/index.js";
|
|
34
|
-
import { useReceivablesWidget as
|
|
35
|
-
import { useEffect as
|
|
36
|
-
import { Fragment as
|
|
34
|
+
import { useReceivablesWidget as C } from "./useReceivablesWidget.js";
|
|
35
|
+
import { useEffect as w, useId as T } from "react";
|
|
36
|
+
import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
37
37
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js
|
|
38
|
-
function
|
|
38
|
+
function k({ auditHistoryLabels: i, counterpartFormLabels: c, counterpartMessageLabels: k, defaultTab: A, detailsLabels: j, embeddedBankName: M, enabledTabs: N, filterBarLabels: P, filterLabels: F, formLabels: I, initialCounterpartId: L, initialView: R, measureUnitDeleteLabels: re, measureUnitsLabels: z, messageLabels: B, onReceivableCreated: V, onReceivableOpened: H, onTemplateSettingsClick: U, pageSizeOptions: W = l, paymentLabels: G, productMessageLabels: K, screenLabels: q, sendLabels: J, actionLabels: Y, actionsModalLabels: X }) {
|
|
39
39
|
let Z = r();
|
|
40
|
-
|
|
40
|
+
w(() => {
|
|
41
41
|
Z(s.Mounted);
|
|
42
42
|
}, [Z]);
|
|
43
|
-
let Q =
|
|
43
|
+
let Q = C({
|
|
44
44
|
auditHistoryLabels: i,
|
|
45
|
-
counterpartMessageLabels:
|
|
46
|
-
defaultTab:
|
|
47
|
-
embeddedBankName:
|
|
48
|
-
enabledTabs:
|
|
49
|
-
filterLabels:
|
|
50
|
-
initialCounterpartId:
|
|
45
|
+
counterpartMessageLabels: k,
|
|
46
|
+
defaultTab: A,
|
|
47
|
+
embeddedBankName: M,
|
|
48
|
+
enabledTabs: N,
|
|
49
|
+
filterLabels: F,
|
|
50
|
+
initialCounterpartId: L,
|
|
51
|
+
initialView: R,
|
|
51
52
|
messageLabels: B,
|
|
52
53
|
onReceivableCreated: V,
|
|
53
54
|
onReceivableOpened: H,
|
|
54
55
|
screenLabels: q
|
|
55
|
-
}),
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */
|
|
56
|
+
}), ie = T(), $ = T(), ae = T(), oe = T(), se = T();
|
|
57
|
+
return /* @__PURE__ */ O(E, { children: [
|
|
58
|
+
/* @__PURE__ */ D(n, {}),
|
|
59
|
+
/* @__PURE__ */ D(ee, {
|
|
59
60
|
rows: Q.table.rows,
|
|
60
61
|
activeTab: Q.activeTab,
|
|
61
62
|
enabledTabs: Q.enabledTabs,
|
|
@@ -79,9 +80,9 @@ function A({ auditHistoryLabels: i, counterpartFormLabels: c, counterpartMessage
|
|
|
79
80
|
onStatusFilterChange: Q.table.onStatusFilterChange,
|
|
80
81
|
statusCards: Q.table.statusCards,
|
|
81
82
|
onStatusCardSelect: Q.table.onStatusCardSelect,
|
|
82
|
-
filterBar: Q.table.invoicesFilterBar && /* @__PURE__ */
|
|
83
|
+
filterBar: Q.table.invoicesFilterBar && /* @__PURE__ */ D(u, {
|
|
83
84
|
...Q.table.invoicesFilterBar,
|
|
84
|
-
labels:
|
|
85
|
+
labels: P
|
|
85
86
|
}),
|
|
86
87
|
isFiltering: Q.table.isFiltering,
|
|
87
88
|
onCreateClick: Q.canWrite ? Q.openCreate : void 0,
|
|
@@ -91,7 +92,7 @@ function A({ auditHistoryLabels: i, counterpartFormLabels: c, counterpartMessage
|
|
|
91
92
|
onRetry: Q.onRetry,
|
|
92
93
|
labels: q
|
|
93
94
|
}),
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ D(g, {
|
|
95
96
|
open: Q.form.open,
|
|
96
97
|
onOpenChange: (e) => {
|
|
97
98
|
e || Q.form.close();
|
|
@@ -106,14 +107,14 @@ function A({ auditHistoryLabels: i, counterpartFormLabels: c, counterpartMessage
|
|
|
106
107
|
autoFocusLineItemId: Q.form.autoFocusLineItemId,
|
|
107
108
|
lineItemsLoading: Q.form.lineItemsLoading,
|
|
108
109
|
inProgress: Q.form.isSubmitting || Q.actionsSuspended,
|
|
109
|
-
customerSelector: /* @__PURE__ */
|
|
110
|
+
customerSelector: /* @__PURE__ */ D(o, {
|
|
110
111
|
mode: "customer",
|
|
111
112
|
value: Q.form.values.customerId || void 0,
|
|
112
113
|
invalid: !!Q.form.errors.customerId,
|
|
113
114
|
onValueChange: (e) => Q.form.updateValues({ customerId: e }),
|
|
114
115
|
onCreateClick: Q.form.openCounterpartCreate
|
|
115
116
|
}),
|
|
116
|
-
renderProductSelector: (e, t) => /* @__PURE__ */
|
|
117
|
+
renderProductSelector: (e, t) => /* @__PURE__ */ D(S, {
|
|
117
118
|
...t,
|
|
118
119
|
inputValue: e.name,
|
|
119
120
|
selectedProductId: Q.form.values.lineItems.find((t) => t.id === e.id)?.productId || void 0,
|
|
@@ -134,20 +135,20 @@ function A({ auditHistoryLabels: i, counterpartFormLabels: c, counterpartMessage
|
|
|
134
135
|
onAddLineItem: Q.form.addLineItem,
|
|
135
136
|
onRemoveLineItem: Q.form.removeLineItem,
|
|
136
137
|
showDueDateField: Q.form.showDueDateField,
|
|
137
|
-
billingSection: Q.form.showBillingSection && /* @__PURE__ */
|
|
138
|
-
idPrefix:
|
|
138
|
+
billingSection: Q.form.showBillingSection && /* @__PURE__ */ D(m, {
|
|
139
|
+
idPrefix: ie,
|
|
139
140
|
paymentTerms: Q.form.paymentTerms.view,
|
|
140
141
|
paymentTermsError: Q.form.errors.paymentTermsId,
|
|
141
142
|
disabled: Q.form.isSubmitting,
|
|
142
143
|
onPaymentTermsChange: Q.form.paymentTerms.select,
|
|
143
144
|
onCustomDatePickerOpenChange: Q.form.paymentTerms.changeCustomDatePickerOpen,
|
|
144
|
-
customDateCalendar: /* @__PURE__ */
|
|
145
|
+
customDateCalendar: /* @__PURE__ */ D(e, {
|
|
145
146
|
mode: "single",
|
|
146
147
|
captionLayout: "dropdown",
|
|
147
148
|
...Q.form.paymentTerms.calendar,
|
|
148
149
|
onSelect: Q.form.paymentTerms.selectCustomDate
|
|
149
150
|
}),
|
|
150
|
-
recurrenceSection: Q.form.showRecurrenceSection && (Q.form.recurrenceLoading ? /* @__PURE__ */
|
|
151
|
+
recurrenceSection: Q.form.showRecurrenceSection && (Q.form.recurrenceLoading ? /* @__PURE__ */ D(t, { className: "ttw:h-9 ttw:w-full" }) : /* @__PURE__ */ D(y, {
|
|
151
152
|
idPrefix: $,
|
|
152
153
|
view: Q.form.recurrence.view,
|
|
153
154
|
disabled: Q.form.isSubmitting,
|
|
@@ -160,20 +161,20 @@ function A({ auditHistoryLabels: i, counterpartFormLabels: c, counterpartMessage
|
|
|
160
161
|
onMaxOccurrencesChange: Q.form.recurrence.changeMaxOccurrences,
|
|
161
162
|
onCreationModeChange: Q.form.recurrence.changeCreationMode,
|
|
162
163
|
onSetUpEmailClick: Q.form.recurrence.setUpEmail,
|
|
163
|
-
emailDialog: /* @__PURE__ */
|
|
164
|
+
emailDialog: /* @__PURE__ */ D(v, {
|
|
164
165
|
idPrefix: $,
|
|
165
166
|
view: Q.form.recurrence.emailView,
|
|
166
167
|
onOpenChange: Q.form.recurrence.changeEmailOpen,
|
|
167
168
|
onChange: Q.form.recurrence.changeEmail,
|
|
168
169
|
onSave: Q.form.recurrence.saveEmail,
|
|
169
|
-
labels:
|
|
170
|
+
labels: I
|
|
170
171
|
}),
|
|
171
|
-
labels:
|
|
172
|
+
labels: I
|
|
172
173
|
})),
|
|
173
|
-
labels:
|
|
174
|
+
labels: I
|
|
174
175
|
}),
|
|
175
|
-
remindersSection: Q.form.reminders.view && /* @__PURE__ */
|
|
176
|
-
idPrefix:
|
|
176
|
+
remindersSection: Q.form.reminders.view && /* @__PURE__ */ D(b, {
|
|
177
|
+
idPrefix: oe,
|
|
177
178
|
view: Q.form.reminders.view,
|
|
178
179
|
onToggle: Q.form.reminders.toggle,
|
|
179
180
|
onPaymentReminderSelect: Q.form.reminders.selectPaymentReminder,
|
|
@@ -184,10 +185,10 @@ function A({ auditHistoryLabels: i, counterpartFormLabels: c, counterpartMessage
|
|
|
184
185
|
onOverdueAddTerm: Q.form.reminders.addOverdueTerm,
|
|
185
186
|
onOverdueClear: Q.form.reminders.clearOverdueTerms,
|
|
186
187
|
onOverdueSave: Q.form.reminders.saveOverdue,
|
|
187
|
-
labels:
|
|
188
|
+
labels: I
|
|
188
189
|
}),
|
|
189
|
-
bankAccountSection: /* @__PURE__ */
|
|
190
|
-
idPrefix:
|
|
190
|
+
bankAccountSection: /* @__PURE__ */ D(p, {
|
|
191
|
+
idPrefix: ae,
|
|
191
192
|
view: Q.form.bankAccount.view,
|
|
192
193
|
error: Q.form.errors.bankAccountId,
|
|
193
194
|
disabled: Q.form.isSubmitting,
|
|
@@ -196,15 +197,15 @@ function A({ auditHistoryLabels: i, counterpartFormLabels: c, counterpartMessage
|
|
|
196
197
|
onFormChange: Q.form.bankAccount.updateAccountForm,
|
|
197
198
|
onFormSave: Q.form.bankAccount.saveAccount,
|
|
198
199
|
onFormCancel: Q.form.bankAccount.cancelAddAccount,
|
|
199
|
-
labels:
|
|
200
|
+
labels: I
|
|
200
201
|
}),
|
|
201
|
-
attachmentsSection: Q.form.attachmentsView && /* @__PURE__ */
|
|
202
|
+
attachmentsSection: Q.form.attachmentsView && /* @__PURE__ */ D(te, {
|
|
202
203
|
view: Q.form.attachmentsView,
|
|
203
204
|
disabled: Q.form.isSubmitting,
|
|
204
205
|
onFilesSelect: Q.form.selectAttachmentFiles,
|
|
205
206
|
onIncludeInEmailChange: Q.form.setAttachmentIncludeInEmail,
|
|
206
207
|
onRemove: Q.form.removeAttachment,
|
|
207
|
-
labels:
|
|
208
|
+
labels: I
|
|
208
209
|
}),
|
|
209
210
|
cancelDisabled: Q.form.isSubmitting || Q.form.attachmentsUploading,
|
|
210
211
|
draftButtonLabel: Q.form.draftButtonLabel,
|
|
@@ -218,9 +219,9 @@ function A({ auditHistoryLabels: i, counterpartFormLabels: c, counterpartMessage
|
|
|
218
219
|
onDraftClick: Q.form.selectDraftMode,
|
|
219
220
|
onPrimaryClick: Q.form.selectPrimaryMode,
|
|
220
221
|
onCancel: Q.form.close,
|
|
221
|
-
labels:
|
|
222
|
+
labels: I
|
|
222
223
|
}),
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ D(h, {
|
|
224
225
|
open: Q.detailsOpen,
|
|
225
226
|
onOpenChange: (e) => {
|
|
226
227
|
e || Q.closeDetails();
|
|
@@ -234,9 +235,9 @@ function A({ auditHistoryLabels: i, counterpartFormLabels: c, counterpartMessage
|
|
|
234
235
|
openSections: Q.details.openSections,
|
|
235
236
|
onOpenSectionsChange: Q.details.setOpenSections,
|
|
236
237
|
disabledActions: Q.actions.pendingActions,
|
|
237
|
-
labels:
|
|
238
|
+
labels: j
|
|
238
239
|
}),
|
|
239
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ D(x, {
|
|
240
241
|
open: Q.actions.sendOpen,
|
|
241
242
|
onOpenChange: (e) => {
|
|
242
243
|
e || Q.actions.closeSend();
|
|
@@ -252,7 +253,7 @@ function A({ auditHistoryLabels: i, counterpartFormLabels: c, counterpartMessage
|
|
|
252
253
|
onCancel: Q.actions.closeSend,
|
|
253
254
|
labels: J
|
|
254
255
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
256
|
+
/* @__PURE__ */ D(_, {
|
|
256
257
|
open: Q.actions.paymentOpen,
|
|
257
258
|
onOpenChange: (e) => {
|
|
258
259
|
e || Q.actions.closePayment();
|
|
@@ -268,7 +269,7 @@ function A({ auditHistoryLabels: i, counterpartFormLabels: c, counterpartMessage
|
|
|
268
269
|
onCancel: Q.actions.closePayment,
|
|
269
270
|
labels: G
|
|
270
271
|
}),
|
|
271
|
-
Q.actions.actionDialog && /* @__PURE__ */
|
|
272
|
+
Q.actions.actionDialog && /* @__PURE__ */ D(f, {
|
|
272
273
|
open: !!Q.actions.actionTarget,
|
|
273
274
|
onOpenChange: (e) => {
|
|
274
275
|
e || Q.actions.closeAction();
|
|
@@ -287,8 +288,8 @@ function A({ auditHistoryLabels: i, counterpartFormLabels: c, counterpartMessage
|
|
|
287
288
|
onCancel: Q.actions.closeAction,
|
|
288
289
|
labels: Y
|
|
289
290
|
}),
|
|
290
|
-
/* @__PURE__ */
|
|
291
|
-
idPrefix:
|
|
291
|
+
/* @__PURE__ */ D(d, {
|
|
292
|
+
idPrefix: se,
|
|
292
293
|
open: Q.actionsModal.isOpen,
|
|
293
294
|
view: Q.actionsModal.view,
|
|
294
295
|
onSkip: Q.actionsModal.skip,
|
|
@@ -301,7 +302,7 @@ function A({ auditHistoryLabels: i, counterpartFormLabels: c, counterpartMessage
|
|
|
301
302
|
onSaveItems: Q.actionsModal.saveItems,
|
|
302
303
|
labels: X
|
|
303
304
|
}),
|
|
304
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ D(a, {
|
|
305
306
|
open: Q.form.counterpartView === "create",
|
|
306
307
|
onOpenChange: (e) => {
|
|
307
308
|
e || Q.form.counterpartForm.close();
|
|
@@ -326,18 +327,18 @@ function A({ auditHistoryLabels: i, counterpartFormLabels: c, counterpartMessage
|
|
|
326
327
|
onCancel: Q.form.counterpartForm.close,
|
|
327
328
|
labels: c
|
|
328
329
|
}),
|
|
329
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ D(ne, {
|
|
330
331
|
open: Q.measureUnitsOpen,
|
|
331
332
|
onClose: Q.closeMeasureUnits,
|
|
332
333
|
suspended: Q.actionsSuspended,
|
|
333
|
-
managerLabels:
|
|
334
|
-
deleteLabels:
|
|
334
|
+
managerLabels: z,
|
|
335
|
+
deleteLabels: re,
|
|
335
336
|
messageLabels: K
|
|
336
337
|
})
|
|
337
338
|
] });
|
|
338
339
|
}
|
|
339
|
-
function
|
|
340
|
-
return /* @__PURE__ */
|
|
340
|
+
function A({ 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 }) {
|
|
341
|
+
return /* @__PURE__ */ D(i, {
|
|
341
342
|
widgetName: c,
|
|
342
343
|
baseUrl: e,
|
|
343
344
|
widgetToken: t,
|
|
@@ -352,8 +353,8 @@ function j({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gat
|
|
|
352
353
|
analytics: f,
|
|
353
354
|
disclosuresAcceptance: p,
|
|
354
355
|
providerLabels: m,
|
|
355
|
-
children: /* @__PURE__ */
|
|
356
|
+
children: /* @__PURE__ */ D(k, { ...h })
|
|
356
357
|
});
|
|
357
358
|
}
|
|
358
359
|
//#endregion
|
|
359
|
-
export {
|
|
360
|
+
export { A as ReceivablesWidget, A as default };
|
|
@@ -170,13 +170,14 @@ function _({ messages: _, counterpartMessageLabels: it, embeddedBankName: at, on
|
|
|
170
170
|
lines: !1,
|
|
171
171
|
discount: !1
|
|
172
172
|
}, B(), K();
|
|
173
|
-
}, [B, K]), on = f((e = "invoice") => {
|
|
173
|
+
}, [B, K]), on = f((e = "invoice", { customerId: t = "" } = {}) => {
|
|
174
174
|
Gt(), qt(), K();
|
|
175
|
-
let
|
|
175
|
+
let n = {
|
|
176
176
|
...je(),
|
|
177
|
-
type: e
|
|
177
|
+
type: e,
|
|
178
|
+
customerId: t
|
|
178
179
|
};
|
|
179
|
-
rn(Be(
|
|
180
|
+
rn(Be(n)), S.current = [], x.current = void 0, v.current = "draft", y.current = !1, b.current = !1, G.current = void 0, Dt(void 0), _t("create"), yt(void 0), xt(void 0), D(n), O({}), B(), Ot(!1), I(!1), F.current = {
|
|
180
181
|
lines: !1,
|
|
181
182
|
discount: !1
|
|
182
183
|
}, w(!0);
|
|
@@ -19,195 +19,204 @@ import { useReceivableActionsModal as fe } from "./useReceivableActionsModal.js"
|
|
|
19
19
|
import { useReceivableDetails as pe } from "./useReceivableDetails.js";
|
|
20
20
|
import { useReceivableForm as me } from "./useReceivableForm.js";
|
|
21
21
|
import { useReceivablesTable as he } from "./useReceivablesTable.js";
|
|
22
|
-
import { useCallback as o, useEffect as s, useMemo as c, useState as l } from "react";
|
|
22
|
+
import { useCallback as o, useEffect as s, useMemo as c, useRef as ge, useState as l } from "react";
|
|
23
23
|
//#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js
|
|
24
|
-
function u({ auditHistoryLabels: u, counterpartMessageLabels:
|
|
25
|
-
let
|
|
24
|
+
function u({ auditHistoryLabels: u, counterpartMessageLabels: _e, defaultTab: f, embeddedBankName: ve, enabledTabs: p, filterLabels: ye, initialCounterpartId: m, initialView: h, messageLabels: g, onReceivableCreated: _, onReceivableOpened: v, screenLabels: be }) {
|
|
25
|
+
let y = e();
|
|
26
26
|
s(() => {
|
|
27
|
-
|
|
28
|
-
}, [
|
|
29
|
-
let { initResponse:
|
|
27
|
+
y(ne.Mounted);
|
|
28
|
+
}, [y]);
|
|
29
|
+
let { initResponse: b, widgetToken: xe } = n(), x = te(), Se = r(), Ce = t(), S = ee(), C = !!b && !S, w = c(() => ue(b?.scopes), [b?.scopes]), we = !!b && S, T = !!b && w.canRead, E = !!b && w.canWrite, D = C && w.canRead, O = C && w.canWrite, k = !!Se && !C && !x, A = !C && !k && !!(xe || x), j = c(() => ({
|
|
30
30
|
...le,
|
|
31
|
-
...
|
|
32
|
-
}), [
|
|
31
|
+
...g
|
|
32
|
+
}), [g]), M = be?.statusBadge, N = c(() => ({
|
|
33
33
|
...re,
|
|
34
|
-
...
|
|
35
|
-
}), [
|
|
34
|
+
...M
|
|
35
|
+
}), [M]), P = c(() => oe(p), [p]), [F, I] = l(() => i({
|
|
36
36
|
defaultTab: f,
|
|
37
|
-
enabledTabs:
|
|
38
|
-
})), [
|
|
37
|
+
enabledTabs: P
|
|
38
|
+
})), [Te, L] = l(), [R, z] = l(!1), [B, V] = l(!1), Ee = o(() => V(!0), []), H = o(() => V(!1), []);
|
|
39
39
|
s(() => {
|
|
40
|
-
|
|
40
|
+
P.includes(F) || I(i({
|
|
41
41
|
defaultTab: f,
|
|
42
|
-
enabledTabs:
|
|
42
|
+
enabledTabs: P
|
|
43
43
|
}));
|
|
44
44
|
}, [
|
|
45
|
-
|
|
45
|
+
F,
|
|
46
46
|
f,
|
|
47
|
-
|
|
47
|
+
P
|
|
48
48
|
]);
|
|
49
|
-
let
|
|
50
|
-
|
|
51
|
-
}, [
|
|
52
|
-
|
|
49
|
+
let De = o((e, t) => {
|
|
50
|
+
I(a(t)), L(e), z(!0), _?.(e, t);
|
|
51
|
+
}, [_]), U = fe({ messages: j }), W = U.open, Oe = o((e, t, n) => {
|
|
52
|
+
I(a(t));
|
|
53
53
|
let r = ae(n);
|
|
54
|
-
r.openDetails && (
|
|
54
|
+
r.openDetails && (L(e), z(!0)), r.actionsModal && W({
|
|
55
55
|
action: n.mode,
|
|
56
56
|
receivableId: e,
|
|
57
57
|
counterpartId: n.counterpartId,
|
|
58
58
|
inlineItems: n.inlineItems,
|
|
59
59
|
showEmailStep: r.actionsModal.showEmailStep
|
|
60
|
-
}),
|
|
61
|
-
}, [
|
|
62
|
-
activeTab:
|
|
63
|
-
initialCounterpartId:
|
|
64
|
-
messages:
|
|
65
|
-
statusLabels:
|
|
60
|
+
}), _?.(e, t);
|
|
61
|
+
}, [_, W]), G = he({
|
|
62
|
+
activeTab: F,
|
|
63
|
+
initialCounterpartId: h === "create" ? void 0 : m,
|
|
64
|
+
messages: j,
|
|
65
|
+
statusLabels: N,
|
|
66
66
|
filterLabels: ye,
|
|
67
|
-
enabled:
|
|
68
|
-
visible:
|
|
69
|
-
}),
|
|
70
|
-
|
|
71
|
-
}, [
|
|
72
|
-
selectedReceivableId:
|
|
73
|
-
enabled:
|
|
74
|
-
canWrite:
|
|
75
|
-
messages:
|
|
76
|
-
statusLabels:
|
|
67
|
+
enabled: D,
|
|
68
|
+
visible: T
|
|
69
|
+
}), ke = o((e) => {
|
|
70
|
+
L(e), z(!0), v?.(e, "invoice");
|
|
71
|
+
}, [v]), K = pe({
|
|
72
|
+
selectedReceivableId: Te,
|
|
73
|
+
enabled: R && D,
|
|
74
|
+
canWrite: E,
|
|
75
|
+
messages: j,
|
|
76
|
+
statusLabels: N,
|
|
77
77
|
auditHistoryLabels: u,
|
|
78
|
-
onOpenReceivable:
|
|
79
|
-
}),
|
|
80
|
-
messages:
|
|
81
|
-
counterpartMessageLabels:
|
|
82
|
-
embeddedBankName:
|
|
83
|
-
onCreated:
|
|
84
|
-
}),
|
|
85
|
-
if (!
|
|
86
|
-
let e = ce(
|
|
87
|
-
|
|
78
|
+
onOpenReceivable: ke
|
|
79
|
+
}), q = me({
|
|
80
|
+
messages: j,
|
|
81
|
+
counterpartMessageLabels: _e,
|
|
82
|
+
embeddedBankName: ve,
|
|
83
|
+
onCreated: Oe
|
|
84
|
+
}), Ae = o(() => {
|
|
85
|
+
if (!O) return;
|
|
86
|
+
let e = ce(F);
|
|
87
|
+
q.openCreate(e === "quote" ? "quote" : "invoice");
|
|
88
|
+
}, [
|
|
89
|
+
F,
|
|
90
|
+
O,
|
|
91
|
+
q.openCreate
|
|
92
|
+
]), J = ge(!1);
|
|
93
|
+
s(() => {
|
|
94
|
+
J.current || h === "create" && O && (J.current = !0, q.openCreate("invoice", { customerId: m }));
|
|
88
95
|
}, [
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
O,
|
|
97
|
+
q.openCreate,
|
|
98
|
+
m,
|
|
99
|
+
h
|
|
100
|
+
]);
|
|
101
|
+
let Y = de({
|
|
102
|
+
selectedReceivable: K.receivable,
|
|
103
|
+
selectedRecurrence: K.recurrence,
|
|
104
|
+
messages: j,
|
|
105
|
+
onCreated: De,
|
|
97
106
|
onDeleted: (e) => {
|
|
98
|
-
e ===
|
|
107
|
+
e === Te && (L(void 0), z(!1));
|
|
99
108
|
},
|
|
100
109
|
onCompleteBeforeIssue: (e) => {
|
|
101
|
-
|
|
110
|
+
q.openEdit(e, { highlightForIssue: !0 }), z(!1);
|
|
102
111
|
}
|
|
103
|
-
}),
|
|
112
|
+
}), X = C && !w.canWrite, Z = q.open || q.counterpartView !== "none" || !!Y.actionTarget || Y.sendOpen || Y.paymentOpen || U.isOpen || B, je = q.close, Q = q.counterpartForm.close, { closeAction: Me, closeSend: Ne, closePayment: Pe } = Y, $ = U.close;
|
|
104
113
|
s(() => {
|
|
105
|
-
|
|
114
|
+
X && Z && (je(), Q(), Me(), Ne(), Pe(), $(), H());
|
|
106
115
|
}, [
|
|
107
|
-
|
|
116
|
+
Me,
|
|
108
117
|
$,
|
|
109
|
-
Y,
|
|
110
|
-
J,
|
|
111
|
-
z,
|
|
112
118
|
Q,
|
|
119
|
+
je,
|
|
120
|
+
H,
|
|
121
|
+
Pe,
|
|
122
|
+
Ne,
|
|
113
123
|
Z,
|
|
114
|
-
|
|
115
|
-
K
|
|
124
|
+
X
|
|
116
125
|
]);
|
|
117
|
-
let
|
|
118
|
-
ie() || (
|
|
119
|
-
}, [
|
|
120
|
-
|
|
121
|
-
}, []),
|
|
122
|
-
if (!
|
|
123
|
-
let n =
|
|
126
|
+
let Fe = o((e) => {
|
|
127
|
+
ie() || (L(e.id), z(!0), v?.(e.id, e.type));
|
|
128
|
+
}, [v]), Ie = o(() => {
|
|
129
|
+
z(!1), L(void 0);
|
|
130
|
+
}, []), Le = o((e, t) => {
|
|
131
|
+
if (!O) return;
|
|
132
|
+
let n = G.getReceivableById(t.id);
|
|
124
133
|
if (e === "edit") {
|
|
125
134
|
if (n) {
|
|
126
|
-
|
|
135
|
+
q.openEdit(n);
|
|
127
136
|
return;
|
|
128
137
|
}
|
|
129
|
-
|
|
138
|
+
L(t.id), z(!0);
|
|
130
139
|
return;
|
|
131
140
|
}
|
|
132
|
-
|
|
141
|
+
L(t.id), Y.openAction(e, t, n ?? null);
|
|
133
142
|
}, [
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
]),
|
|
139
|
-
if (
|
|
143
|
+
Y,
|
|
144
|
+
O,
|
|
145
|
+
q.openEdit,
|
|
146
|
+
G.getReceivableById
|
|
147
|
+
]), Re = o((e, t) => {
|
|
148
|
+
if (O) {
|
|
140
149
|
if (e === "edit") {
|
|
141
|
-
|
|
150
|
+
K.receivable && (q.openEdit(K.receivable), z(!1));
|
|
142
151
|
return;
|
|
143
152
|
}
|
|
144
|
-
|
|
153
|
+
Y.openAction(e, {
|
|
145
154
|
id: t.id,
|
|
146
|
-
title:
|
|
155
|
+
title: K.receivable ? se(K.receivable, j) : t.title,
|
|
147
156
|
type: t.type
|
|
148
|
-
},
|
|
157
|
+
}, K.receivable ?? null);
|
|
149
158
|
}
|
|
150
159
|
}, [
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
160
|
+
Y,
|
|
161
|
+
O,
|
|
162
|
+
K.receivable,
|
|
163
|
+
q.openEdit,
|
|
164
|
+
j
|
|
156
165
|
]);
|
|
157
166
|
return {
|
|
158
|
-
activeTab:
|
|
159
|
-
enabledTabs:
|
|
160
|
-
setActiveTab:
|
|
161
|
-
canWrite:
|
|
162
|
-
actionsSuspended:
|
|
163
|
-
isAccessRestricted:
|
|
164
|
-
table:
|
|
165
|
-
...
|
|
167
|
+
activeTab: F,
|
|
168
|
+
enabledTabs: P,
|
|
169
|
+
setActiveTab: I,
|
|
170
|
+
canWrite: E,
|
|
171
|
+
actionsSuspended: we,
|
|
172
|
+
isAccessRestricted: C && !w.canRead,
|
|
173
|
+
table: T ? G : {
|
|
174
|
+
...G,
|
|
166
175
|
rows: [],
|
|
167
176
|
statusCards: void 0,
|
|
168
177
|
isError: !1
|
|
169
178
|
},
|
|
170
|
-
isTableLoading:
|
|
171
|
-
isError:
|
|
172
|
-
onRetry:
|
|
173
|
-
details:
|
|
174
|
-
detailsOpen:
|
|
175
|
-
closeDetails:
|
|
179
|
+
isTableLoading: T ? G.isLoading || A && G.rows.length === 0 : A,
|
|
180
|
+
isError: k || T && G.isError,
|
|
181
|
+
onRetry: k ? Ce : G.onRetry,
|
|
182
|
+
details: K,
|
|
183
|
+
detailsOpen: R && T,
|
|
184
|
+
closeDetails: Ie,
|
|
176
185
|
form: {
|
|
177
|
-
...
|
|
178
|
-
open:
|
|
179
|
-
counterpartView:
|
|
186
|
+
...q,
|
|
187
|
+
open: E && q.open,
|
|
188
|
+
counterpartView: E ? q.counterpartView : "none",
|
|
180
189
|
counterpartForm: {
|
|
181
|
-
...
|
|
182
|
-
submit: d(
|
|
190
|
+
...q.counterpartForm,
|
|
191
|
+
submit: d(O, q.counterpartForm.submit)
|
|
183
192
|
},
|
|
184
|
-
submit: d(
|
|
185
|
-
submitDraft: d(
|
|
186
|
-
submitPrimary: d(
|
|
193
|
+
submit: d(O, q.submit),
|
|
194
|
+
submitDraft: d(O, q.submitDraft),
|
|
195
|
+
submitPrimary: d(O, q.submitPrimary)
|
|
187
196
|
},
|
|
188
|
-
openCreate:
|
|
189
|
-
measureUnitsOpen:
|
|
190
|
-
openMeasureUnits:
|
|
191
|
-
closeMeasureUnits:
|
|
197
|
+
openCreate: Ae,
|
|
198
|
+
measureUnitsOpen: E && B,
|
|
199
|
+
openMeasureUnits: Ee,
|
|
200
|
+
closeMeasureUnits: H,
|
|
192
201
|
actions: {
|
|
193
|
-
...
|
|
194
|
-
actionDialog:
|
|
195
|
-
sendOpen:
|
|
196
|
-
paymentOpen:
|
|
197
|
-
openAction: d(
|
|
198
|
-
confirmAction: d(
|
|
199
|
-
submitSend: d(
|
|
200
|
-
submitPayment: d(
|
|
202
|
+
...Y,
|
|
203
|
+
actionDialog: E ? Y.actionDialog : void 0,
|
|
204
|
+
sendOpen: E && Y.sendOpen,
|
|
205
|
+
paymentOpen: E && Y.paymentOpen,
|
|
206
|
+
openAction: d(O, Y.openAction),
|
|
207
|
+
confirmAction: d(O, Y.confirmAction),
|
|
208
|
+
submitSend: d(O, Y.submitSend),
|
|
209
|
+
submitPayment: d(O, Y.submitPayment)
|
|
201
210
|
},
|
|
202
211
|
actionsModal: {
|
|
203
|
-
...
|
|
204
|
-
isOpen:
|
|
205
|
-
send: d(
|
|
206
|
-
saveItems: d(
|
|
212
|
+
...U,
|
|
213
|
+
isOpen: E && U.isOpen,
|
|
214
|
+
send: d(O, U.send),
|
|
215
|
+
saveItems: d(O, U.saveItems)
|
|
207
216
|
},
|
|
208
|
-
handleRowClick:
|
|
209
|
-
handleActionClick:
|
|
210
|
-
handleDetailsActionClick:
|
|
217
|
+
handleRowClick: Fe,
|
|
218
|
+
handleActionClick: Le,
|
|
219
|
+
handleDetailsActionClick: Re
|
|
211
220
|
};
|
|
212
221
|
}
|
|
213
222
|
function d(e, t) {
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.5.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.5.248", n = "1e98d8cd5ad737f67b5124bf65db872b4cb5ebf8", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|