@tesouro/embedded-components-react 0.5.219 → 0.5.221

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. package/dist/index.css +3 -0
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.js +1 -1
  4. package/dist/lib/ReceivablesWidget.d.ts +1 -0
  5. package/dist/lib/ReceivablesWidget.js +1 -1
  6. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +2 -2
  7. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index12.js +22 -1
  8. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +39 -70
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js +34 -106
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js +75 -307
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index27.js +121 -0
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js +317 -0
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +15 -15
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +6 -6
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +50 -335
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +353 -0
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +8 -7
  19. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  20. package/package.json +1 -1
@@ -0,0 +1,317 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { Calendar as e, Skeleton as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { EmbeddedToaster as n } from "../../../shared/ui/dist/lib/EmbeddedToaster.js";
7
+ import "../../../shared/ui/dist/index.js";
8
+ import { useAnalyticsTrack as r } from "../../../shared/feature/dist/lib/analytics/hooks.js";
9
+ import { WidgetProvider as i } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
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 { ReceivableDetailsSheet as p } from "../../ui/dist/index22.js";
20
+ import { ReceivableFormSheet as m } from "../../ui/dist/index25.js";
21
+ import { ReceivablePaymentDialog as h } from "../../ui/dist/index26.js";
22
+ import { ReceivableRecurrenceEmailDialog as g } from "../../ui/dist/index27.js";
23
+ import { ReceivableRecurrenceSection as _ } from "../../ui/dist/index29.js";
24
+ import { ReceivableRemindersSection as v } from "../../ui/dist/index31.js";
25
+ import { ReceivableSendDialog as y } from "../../ui/dist/index32.js";
26
+ import { ReceivablesScreen as b } from "../../ui/dist/index34.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 "./index27.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";
35
+ //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js
36
+ function j({ counterpartFormLabels: i, counterpartMessageLabels: c, defaultTab: j, detailsLabels: M, embeddedBankName: N, enabledTabs: P, formLabels: F, measureUnitDeleteLabels: I, measureUnitsLabels: L, messageLabels: R, onReceivableCreated: z, onReceivableOpened: B, onTemplateSettingsClick: V, pageSizeOptions: H = l, paymentLabels: U, productMessageLabels: W, screenLabels: G, sendLabels: K, actionLabels: q }) {
37
+ let J = r();
38
+ T(() => {
39
+ J(s.Mounted);
40
+ }, [J]);
41
+ let Y = w({
42
+ counterpartMessageLabels: c,
43
+ defaultTab: j,
44
+ embeddedBankName: N,
45
+ enabledTabs: P,
46
+ messageLabels: R,
47
+ onReceivableCreated: z,
48
+ onReceivableOpened: B,
49
+ screenLabels: G
50
+ }), [X, Z] = D(!1), Q = E(), $ = E(), ee = E(), te = E();
51
+ return /* @__PURE__ */ A(O, { children: [
52
+ /* @__PURE__ */ k(n, {}),
53
+ /* @__PURE__ */ k(b, {
54
+ rows: Y.table.rows,
55
+ activeTab: Y.activeTab,
56
+ enabledTabs: Y.enabledTabs,
57
+ onTabChange: Y.setActiveTab,
58
+ isLoading: Y.table.isLoading,
59
+ isError: Y.table.isError,
60
+ sorting: Y.table.sorting,
61
+ onSortingChange: Y.table.onSortingChange,
62
+ pageSize: Y.table.pageSize,
63
+ onPageSizeChange: Y.table.onPageSizeChange,
64
+ pageSizeOptions: H,
65
+ hasNextPage: Y.table.hasNextPage,
66
+ hasPrevPage: Y.table.hasPrevPage,
67
+ onNextPage: Y.table.onNextPage,
68
+ onPrevPage: Y.table.onPrevPage,
69
+ searchValue: Y.table.searchValue,
70
+ onSearchChange: Y.table.onSearchChange,
71
+ statusFilter: Y.table.statusFilter,
72
+ statusOptions: Y.table.statusOptions,
73
+ onStatusFilterChange: Y.table.onStatusFilterChange,
74
+ statusCards: Y.table.statusCards,
75
+ onStatusCardSelect: Y.table.onStatusFilterChange,
76
+ isFiltering: Y.table.isFiltering,
77
+ onCreateClick: Y.openCreate,
78
+ onTemplateSettingsClick: V,
79
+ onRowClick: Y.handleRowClick,
80
+ onActionClick: Y.handleActionClick,
81
+ onRetry: Y.table.onRetry,
82
+ labels: G
83
+ }),
84
+ /* @__PURE__ */ k(m, {
85
+ open: Y.form.open,
86
+ onOpenChange: (e) => {
87
+ e || Y.form.close();
88
+ },
89
+ mode: Y.form.mode,
90
+ values: Y.form.sheetValues,
91
+ errors: Y.form.errors,
92
+ currencyOptions: Y.form.currencyOptions,
93
+ unitOptions: Y.form.lineItemUnitOptions,
94
+ currencySymbol: Y.form.currencySymbol,
95
+ lineItemControls: Y.form.lineItemControls,
96
+ autoFocusLineItemId: Y.form.autoFocusLineItemId,
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
+ onValueChange: (e) => Y.form.updateValues({ customerId: e }),
103
+ onCreateClick: Y.form.openCounterpartCreate
104
+ }),
105
+ renderProductSelector: (e, t) => /* @__PURE__ */ k(C, {
106
+ ...t,
107
+ inputValue: e.name,
108
+ selectedProductId: Y.form.values.lineItems.find((t) => t.id === e.id)?.productId || void 0,
109
+ currency: Y.form.values.currency,
110
+ maxLength: 100,
111
+ onInputValueChange: (t) => Y.form.updateLineItem(e.id, { name: t }),
112
+ onProductSelect: (t) => Y.form.selectProduct(e.id, t)
113
+ }),
114
+ onChange: Y.form.updateValues,
115
+ onLineItemChange: Y.form.updateLineItem,
116
+ onLineItemCommit: Y.form.commitLineItem,
117
+ onLineItemQuantityStep: Y.form.stepLineItem,
118
+ onTaxRateCommit: Y.form.commitTaxRate,
119
+ onDiscountFocus: Y.form.focusDiscount,
120
+ onDiscountCommit: Y.form.commitDiscount,
121
+ totals: Y.form.totalsView,
122
+ onManageUnits: () => Z(!0),
123
+ onAddLineItem: Y.form.addLineItem,
124
+ onRemoveLineItem: Y.form.removeLineItem,
125
+ showDueDateField: Y.form.showDueDateField,
126
+ billingSection: Y.form.showBillingSection && /* @__PURE__ */ k(f, {
127
+ idPrefix: Q,
128
+ paymentTerms: Y.form.paymentTerms.view,
129
+ paymentTermsError: Y.form.errors.paymentTermsId,
130
+ disabled: Y.form.isSubmitting,
131
+ onPaymentTermsChange: Y.form.paymentTerms.select,
132
+ onCustomDatePickerOpenChange: Y.form.paymentTerms.changeCustomDatePickerOpen,
133
+ customDateCalendar: /* @__PURE__ */ k(e, {
134
+ mode: "single",
135
+ captionLayout: "dropdown",
136
+ ...Y.form.paymentTerms.calendar,
137
+ onSelect: Y.form.paymentTerms.selectCustomDate
138
+ }),
139
+ recurrenceSection: Y.form.showRecurrenceSection && (Y.form.recurrenceLoading ? /* @__PURE__ */ k(t, { className: "ttw:h-9 ttw:w-full" }) : /* @__PURE__ */ k(_, {
140
+ idPrefix: $,
141
+ view: Y.form.recurrence.view,
142
+ disabled: Y.form.isSubmitting,
143
+ onFrequencyChange: Y.form.recurrence.changeFrequency,
144
+ onMonthDayChange: Y.form.recurrence.changeMonthDay,
145
+ onWeekdayChange: Y.form.recurrence.changeWeekday,
146
+ onStartDateChange: Y.form.recurrence.changeStartDate,
147
+ onEndModeChange: Y.form.recurrence.changeEndMode,
148
+ onEndDateChange: Y.form.recurrence.changeEndDate,
149
+ onMaxOccurrencesChange: Y.form.recurrence.changeMaxOccurrences,
150
+ onCreationModeChange: Y.form.recurrence.changeCreationMode,
151
+ onSetUpEmailClick: Y.form.recurrence.setUpEmail,
152
+ emailDialog: /* @__PURE__ */ k(g, {
153
+ idPrefix: $,
154
+ view: Y.form.recurrence.emailView,
155
+ onOpenChange: Y.form.recurrence.changeEmailOpen,
156
+ onChange: Y.form.recurrence.changeEmail,
157
+ onSave: Y.form.recurrence.saveEmail,
158
+ labels: F
159
+ }),
160
+ labels: F
161
+ })),
162
+ labels: F
163
+ }),
164
+ remindersSection: Y.form.reminders.view && /* @__PURE__ */ k(v, {
165
+ idPrefix: te,
166
+ view: Y.form.reminders.view,
167
+ onToggle: Y.form.reminders.toggle,
168
+ onPaymentReminderSelect: Y.form.reminders.selectPaymentReminder,
169
+ onOverdueReminderSelect: Y.form.reminders.selectOverdueReminder,
170
+ onBeforeDueInputChange: Y.form.reminders.changeBeforeDueInput,
171
+ onBeforeDueSave: Y.form.reminders.saveBeforeDue,
172
+ onOverdueTermChange: Y.form.reminders.changeOverdueTerm,
173
+ onOverdueAddTerm: Y.form.reminders.addOverdueTerm,
174
+ onOverdueClear: Y.form.reminders.clearOverdueTerms,
175
+ onOverdueSave: Y.form.reminders.saveOverdue,
176
+ labels: F
177
+ }),
178
+ bankAccountSection: /* @__PURE__ */ k(d, {
179
+ idPrefix: ee,
180
+ view: Y.form.bankAccount.view,
181
+ disabled: Y.form.isSubmitting,
182
+ onAccountSelect: Y.form.bankAccount.selectAccount,
183
+ onAddAccountClick: Y.form.bankAccount.openAddAccount,
184
+ onFormChange: Y.form.bankAccount.updateAccountForm,
185
+ onFormSave: Y.form.bankAccount.saveAccount,
186
+ onFormCancel: Y.form.bankAccount.cancelAddAccount,
187
+ labels: F
188
+ }),
189
+ attachmentsSection: Y.form.attachmentsView && /* @__PURE__ */ k(x, {
190
+ view: Y.form.attachmentsView,
191
+ disabled: Y.form.isSubmitting,
192
+ onFilesSelect: Y.form.selectAttachmentFiles,
193
+ onIncludeInEmailChange: Y.form.setAttachmentIncludeInEmail,
194
+ onRemove: Y.form.removeAttachment,
195
+ labels: F
196
+ }),
197
+ cancelDisabled: Y.form.attachmentsUploading,
198
+ saveDisabled: Y.form.saveDisabled,
199
+ submitLabel: Y.form.submitLabel,
200
+ onSubmit: Y.form.submit,
201
+ onCancel: Y.form.close,
202
+ labels: F
203
+ }),
204
+ /* @__PURE__ */ k(p, {
205
+ open: Y.detailsOpen,
206
+ onOpenChange: (e) => {
207
+ e || Y.closeDetails();
208
+ },
209
+ details: Y.details.detailsView,
210
+ isLoading: Y.details.isLoading,
211
+ isError: Y.details.isError,
212
+ onActionClick: Y.handleDetailsActionClick,
213
+ onClose: Y.closeDetails,
214
+ labels: M
215
+ }),
216
+ /* @__PURE__ */ k(y, {
217
+ open: Y.actions.sendOpen,
218
+ onOpenChange: (e) => {
219
+ e || Y.actions.closeSend();
220
+ },
221
+ values: Y.actions.sendValues,
222
+ errors: Y.actions.sendErrors,
223
+ inProgress: Y.actions.sendInProgress,
224
+ onChange: (e) => Y.actions.setSendValues((t) => ({
225
+ ...t,
226
+ ...e
227
+ })),
228
+ onSubmit: Y.actions.submitSend,
229
+ onCancel: Y.actions.closeSend,
230
+ labels: K
231
+ }),
232
+ /* @__PURE__ */ k(h, {
233
+ open: Y.actions.paymentOpen,
234
+ onOpenChange: (e) => {
235
+ e || Y.actions.closePayment();
236
+ },
237
+ values: Y.actions.paymentValues,
238
+ errors: Y.actions.paymentErrors,
239
+ inProgress: Y.actions.paymentInProgress,
240
+ onChange: (e) => Y.actions.setPaymentValues((t) => ({
241
+ ...t,
242
+ ...e
243
+ })),
244
+ onSubmit: Y.actions.submitPayment,
245
+ onCancel: Y.actions.closePayment,
246
+ labels: U
247
+ }),
248
+ Y.actions.actionDialog && /* @__PURE__ */ k(u, {
249
+ open: !!Y.actions.actionTarget,
250
+ onOpenChange: (e) => {
251
+ e || Y.actions.closeAction();
252
+ },
253
+ title: Y.actions.actionDialog.title,
254
+ description: Y.actions.actionDialog.description,
255
+ confirmLabel: Y.actions.actionDialog.confirmLabel,
256
+ destructive: Y.actions.actionDialog.destructive,
257
+ error: Y.actions.actionError,
258
+ inProgress: Y.actions.actionInProgress,
259
+ onConfirm: Y.actions.confirmAction,
260
+ onCancel: Y.actions.closeAction,
261
+ labels: q
262
+ }),
263
+ /* @__PURE__ */ k(a, {
264
+ open: Y.form.counterpartView === "create",
265
+ onOpenChange: (e) => {
266
+ e || Y.form.counterpartForm.close();
267
+ },
268
+ mode: "create",
269
+ values: Y.form.counterpartForm.values,
270
+ errors: Y.form.counterpartForm.errors,
271
+ stateOptions: Y.form.stateOptions,
272
+ inProgress: Y.form.counterpartForm.isSubmitting,
273
+ onChange: (e) => Y.form.counterpartForm.setValues((t) => ({
274
+ ...t,
275
+ ...e
276
+ })),
277
+ onAddressChange: (e) => Y.form.counterpartForm.setValues((t) => ({
278
+ ...t,
279
+ address: {
280
+ ...t.address,
281
+ ...e
282
+ }
283
+ })),
284
+ onSubmit: Y.form.counterpartForm.submit,
285
+ onCancel: Y.form.counterpartForm.close,
286
+ labels: i
287
+ }),
288
+ /* @__PURE__ */ k(S, {
289
+ open: X,
290
+ onClose: () => Z(!1),
291
+ managerLabels: L,
292
+ deleteLabels: I,
293
+ messageLabels: W
294
+ })
295
+ ] });
296
+ }
297
+ 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 }) {
298
+ return /* @__PURE__ */ k(i, {
299
+ widgetName: c,
300
+ baseUrl: e,
301
+ widgetToken: t,
302
+ organizationId: n,
303
+ configClient: r,
304
+ gatewayRouting: a,
305
+ linkComponent: o,
306
+ implementation: s,
307
+ uiFramework: l,
308
+ errorFallback: u,
309
+ onError: d,
310
+ analytics: f,
311
+ disclosuresAcceptance: p,
312
+ providerLabels: m,
313
+ children: /* @__PURE__ */ k(j, { ...h })
314
+ });
315
+ }
316
+ //#endregion
317
+ export { M as ReceivablesWidget, M as default };
@@ -1,22 +1,22 @@
1
1
  import "./index2.js";
2
2
  import "./index3.js";
3
- import "./index4.js";
4
- import { ReceivableActionDialog as e } from "./index5.js";
5
- import { ReceivableBankAccountSection as t } from "./index6.js";
6
- import { ReceivableAttachmentsSection as n } from "./index7.js";
7
- import { RECEIVABLE_PAYMENT_TERMS_CUSTOM_DATE as r, RECEIVABLE_PAYMENT_TERMS_RECEIPT_DUE as i } from "./index10.js";
8
- import { ReceivableBillingSection as a } from "./index11.js";
3
+ import { RECEIVABLE_STATUS_BADGE_LABELS_EN as e } from "./index4.js";
4
+ import { ReceivableActionDialog as t } from "./index5.js";
5
+ import { ReceivableBankAccountSection as n } from "./index6.js";
6
+ import { ReceivableAttachmentsSection as r } from "./index7.js";
7
+ import { RECEIVABLE_PAYMENT_TERMS_CUSTOM_DATE as i, RECEIVABLE_PAYMENT_TERMS_RECEIPT_DUE as a } from "./index10.js";
8
+ import { ReceivableBillingSection as o } from "./index11.js";
9
9
  import "./index12.js";
10
10
  import "./index13.js";
11
11
  import "./index20.js";
12
12
  import "./index21.js";
13
- import { ReceivableDetailsSheet as o } from "./index22.js";
14
- import { ReceivableFormSheet as s } from "./index25.js";
15
- import { ReceivablePaymentDialog as c } from "./index26.js";
16
- import { ReceivableRecurrenceEmailDialog as l } from "./index27.js";
17
- import { ReceivableRecurrenceSection as u } from "./index29.js";
13
+ import { ReceivableDetailsSheet as s } from "./index22.js";
14
+ import { ReceivableFormSheet as c } from "./index25.js";
15
+ import { ReceivablePaymentDialog as l } from "./index26.js";
16
+ import { ReceivableRecurrenceEmailDialog as u } from "./index27.js";
17
+ import { ReceivableRecurrenceSection as d } from "./index29.js";
18
18
  import "./index30.js";
19
- import { ReceivableRemindersSection as d } from "./index31.js";
20
- import { ReceivableSendDialog as f } from "./index32.js";
21
- import { ReceivablesScreen as p } from "./index33.js";
22
- export { r as RECEIVABLE_PAYMENT_TERMS_CUSTOM_DATE, i as RECEIVABLE_PAYMENT_TERMS_RECEIPT_DUE, e as ReceivableActionDialog, n as ReceivableAttachmentsSection, t as ReceivableBankAccountSection, a as ReceivableBillingSection, o as ReceivableDetailsSheet, s as ReceivableFormSheet, c as ReceivablePaymentDialog, l as ReceivableRecurrenceEmailDialog, u as ReceivableRecurrenceSection, d as ReceivableRemindersSection, f as ReceivableSendDialog, p as ReceivablesScreen };
19
+ import { ReceivableRemindersSection as f } from "./index31.js";
20
+ import { ReceivableSendDialog as p } from "./index32.js";
21
+ import { ReceivablesScreen as m } from "./index34.js";
22
+ export { i as RECEIVABLE_PAYMENT_TERMS_CUSTOM_DATE, a as RECEIVABLE_PAYMENT_TERMS_RECEIPT_DUE, e as RECEIVABLE_STATUS_BADGE_LABELS_EN, t as ReceivableActionDialog, r as ReceivableAttachmentsSection, n as ReceivableBankAccountSection, o as ReceivableBillingSection, s as ReceivableDetailsSheet, c as ReceivableFormSheet, l as ReceivablePaymentDialog, u as ReceivableRecurrenceEmailDialog, d as ReceivableRecurrenceSection, f as ReceivableRemindersSection, p as ReceivableSendDialog, m as ReceivablesScreen };
@@ -9,15 +9,15 @@ var i = {
9
9
  success: "ttw:border-emerald-200 ttw:bg-emerald-50 ttw:text-emerald-700 ttw:hover:bg-emerald-50",
10
10
  warning: "ttw:border-amber-200 ttw:bg-amber-50 ttw:text-amber-800 ttw:hover:bg-amber-50"
11
11
  };
12
- function a({ status: a, tone: o, labels: s, icon: c }) {
13
- let l = {
12
+ function a({ status: a, label: o, tone: s, labels: c, icon: l }) {
13
+ let u = {
14
14
  ...n,
15
- ...s
16
- }, u = l[a] ?? l.unknown;
15
+ ...c
16
+ }, d = o ?? u[a] ?? u.unknown;
17
17
  return /* @__PURE__ */ r(e, {
18
18
  variant: "outline",
19
- className: t(c && "ttw:gap-1", i[o]),
20
- children: [c, u]
19
+ className: t(l && "ttw:gap-1", i[s]),
20
+ children: [l, d]
21
21
  });
22
22
  }
23
23
  //#endregion