@tesouro/embedded-components-react 0.5.274 → 0.5.275

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 CHANGED
@@ -513,7 +513,7 @@ Lists, creates, edits and acts on an organization's invoices, including sending
513
513
  | -------------------------- | ---------------------------------------------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
514
514
  | `initialView` | `'create'` | `undefined` | Opens the create-invoice form once on mount, when the user can create invoices. Closing it does not reopen it. |
515
515
  | `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. |
516
- | `pageSizeOptions` | `number[]` | `[10, 25, 50, 100]` | Rows-per-page choices. The first page loads with a page size of `10`. |
516
+ | `pageSizeOptions` | `number[]` | `[10, 25, 50, 100]` | Rows-per-page choices. The first page loads at the first choice, or `10` when the list is empty. |
517
517
  | `onReceivableCreated` | `(id: string, type: ReceivableDocumentType) => void` | `undefined` | Called after a create or clone succeeds. |
518
518
  | `onReceivableOpened` | `(id: string, type: ReceivableDocumentType) => void` | `undefined` | Called when the user opens a row's details panel. |
519
519
  | `onTemplateSettingsClick` | `() => void` | `undefined` | Shows the invoice settings button in the header, for users holding `organization_settings:write:org`, and calls this when it is clicked. |
@@ -25,13 +25,13 @@ import { ReceivableFormDialog as _ } from "../../../../ui/dist/index41.js";
25
25
  import { ReceivablePaymentDialog as v } from "../../../../ui/dist/index42.js";
26
26
  import { ReceivablePreview as y } from "../../../../ui/dist/index46.js";
27
27
  import { ReceivableRecurrenceEmailDialog as b } from "../../../../ui/dist/index48.js";
28
- import { ReceivableRecurrenceSection as ee } from "../../../../ui/dist/index50.js";
29
- import { ReceivableRemindersSection as te } from "../../../../ui/dist/index52.js";
30
- import { ReceivableSendDialog as ne } from "../../../../ui/dist/index53.js";
31
- import { ReceivablesScreen as re } from "../../../../ui/dist/index55.js";
32
- import { UnsavedInvoiceDialog as ie } from "../../../../ui/dist/index56.js";
28
+ import { ReceivableRecurrenceSection as x } from "../../../../ui/dist/index50.js";
29
+ import { ReceivableRemindersSection as ee } from "../../../../ui/dist/index52.js";
30
+ import { ReceivableSendDialog as te } from "../../../../ui/dist/index53.js";
31
+ import { ReceivablesScreen as ne } from "../../../../ui/dist/index55.js";
32
+ import { UnsavedInvoiceDialog as re } from "../../../../ui/dist/index56.js";
33
33
  import "../../../../ui/dist/index.js";
34
- import { ReceivableAttachmentsSection as x } from "./ReceivableAttachmentsSection.js";
34
+ import { ReceivableAttachmentsSection as ie } from "./ReceivableAttachmentsSection.js";
35
35
  import { MeasureUnitsManagerContainer as S } from "../../../../../shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js";
36
36
  import { ProductSelector as C } from "../../../../../shared/product-catalog/feature/dist/lib/ProductSelector.js";
37
37
  import "../../../../../shared/product-catalog/feature/dist/index.js";
@@ -39,7 +39,7 @@ import { useReceivablesWidget as w } from "./useReceivablesWidget.js";
39
39
  import { useEffect as T, useId as E } from "react";
40
40
  import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
41
41
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js
42
- function A({ auditHistoryLabels: i, bankAttribution: l, counterpartFormLabels: A, counterpartMessageLabels: j, detailsLabels: M, embeddedBankName: N, filterBarLabels: P, filterLabels: F, formLabels: I, headerStart: L, initialCounterpartId: R, initialView: z, measureUnitDeleteLabels: B, measureUnitsLabels: ae, messageLabels: V, onReceivableCreated: H, onReceivableOpened: U, onTemplateSettingsClick: W, pageSizeOptions: G = u, paymentLabels: K, previewLabels: q, productMessageLabels: J, screenLabels: Y, sendLabels: oe, actionLabels: se, actionsModalLabels: ce }) {
42
+ function A({ auditHistoryLabels: i, bankAttribution: l, counterpartFormLabels: A, counterpartMessageLabels: j, detailsLabels: M, embeddedBankName: N, filterBarLabels: P, filterLabels: F, formLabels: I, headerStart: L, initialCounterpartId: ae, initialView: R, measureUnitDeleteLabels: z, measureUnitsLabels: B, messageLabels: V, onReceivableCreated: H, onReceivableOpened: U, onTemplateSettingsClick: W, pageSizeOptions: G = u, paymentLabels: K, previewLabels: q, productMessageLabels: J, screenLabels: Y, sendLabels: oe, actionLabels: se, actionsModalLabels: ce }) {
43
43
  let X = r();
44
44
  T(() => {
45
45
  X(c.Mounted);
@@ -49,16 +49,17 @@ function A({ auditHistoryLabels: i, bankAttribution: l, counterpartFormLabels: A
49
49
  counterpartMessageLabels: j,
50
50
  embeddedBankName: N,
51
51
  filterLabels: F,
52
- initialCounterpartId: R,
53
- initialView: z,
52
+ initialCounterpartId: ae,
53
+ initialView: R,
54
54
  messageLabels: V,
55
55
  onReceivableCreated: H,
56
56
  onReceivableOpened: U,
57
+ pageSizeOptions: G,
57
58
  screenLabels: Y
58
59
  }), le = E(), Q = E(), $ = E(), ue = E(), de = E();
59
60
  return /* @__PURE__ */ k(D, { children: [
60
61
  /* @__PURE__ */ O(n, { position: "bottom-left" }),
61
- /* @__PURE__ */ O(re, {
62
+ /* @__PURE__ */ O(ne, {
62
63
  rows: Z.table.rows,
63
64
  isLoading: Z.isTableLoading,
64
65
  isError: Z.isError,
@@ -142,7 +143,7 @@ function A({ auditHistoryLabels: i, bankAttribution: l, counterpartFormLabels: A
142
143
  ...Z.form.paymentTerms.calendar,
143
144
  onSelect: Z.form.paymentTerms.selectCustomDate
144
145
  }),
145
- recurrenceSection: Z.form.showRecurrenceSection && (Z.form.recurrenceLoading ? /* @__PURE__ */ O(t, { className: "ttw:h-9 ttw:w-full" }) : /* @__PURE__ */ O(ee, {
146
+ recurrenceSection: Z.form.showRecurrenceSection && (Z.form.recurrenceLoading ? /* @__PURE__ */ O(t, { className: "ttw:h-9 ttw:w-full" }) : /* @__PURE__ */ O(x, {
146
147
  idPrefix: Q,
147
148
  view: Z.form.recurrence.view,
148
149
  disabled: Z.form.isSubmitting,
@@ -165,7 +166,7 @@ function A({ auditHistoryLabels: i, bankAttribution: l, counterpartFormLabels: A
165
166
  }),
166
167
  labels: I
167
168
  })),
168
- remindersSection: Z.form.reminders.view && /* @__PURE__ */ O(te, {
169
+ remindersSection: Z.form.reminders.view && /* @__PURE__ */ O(ee, {
169
170
  idPrefix: ue,
170
171
  view: Z.form.reminders.view,
171
172
  onToggle: Z.form.reminders.toggle,
@@ -193,7 +194,7 @@ function A({ auditHistoryLabels: i, bankAttribution: l, counterpartFormLabels: A
193
194
  onFormCancel: Z.form.bankAccount.cancelAddAccount,
194
195
  labels: I
195
196
  }),
196
- attachmentsSection: Z.form.attachmentsView && /* @__PURE__ */ O(x, {
197
+ attachmentsSection: Z.form.attachmentsView && /* @__PURE__ */ O(ie, {
197
198
  view: Z.form.attachmentsView,
198
199
  disabled: Z.form.isSubmitting,
199
200
  onFilesSelect: Z.form.selectAttachmentFiles,
@@ -219,7 +220,7 @@ function A({ auditHistoryLabels: i, bankAttribution: l, counterpartFormLabels: A
219
220
  onPrimaryClick: Z.form.selectPrimaryMode,
220
221
  labels: I
221
222
  }),
222
- /* @__PURE__ */ O(ie, {
223
+ /* @__PURE__ */ O(re, {
223
224
  ...Z.form.unsavedPrompt,
224
225
  labels: I
225
226
  }),
@@ -243,7 +244,7 @@ function A({ auditHistoryLabels: i, bankAttribution: l, counterpartFormLabels: A
243
244
  counterpartType: "customer",
244
245
  onClose: Z.closeCustomerDetails
245
246
  }),
246
- /* @__PURE__ */ O(ne, {
247
+ /* @__PURE__ */ O(te, {
247
248
  open: Z.actions.sendOpen,
248
249
  onOpenChange: (e) => {
249
250
  e || Z.actions.closeSend();
@@ -341,8 +342,8 @@ function A({ auditHistoryLabels: i, bankAttribution: l, counterpartFormLabels: A
341
342
  open: Z.measureUnitsOpen,
342
343
  onClose: Z.closeMeasureUnits,
343
344
  suspended: Z.actionsSuspended,
344
- managerLabels: ae,
345
- deleteLabels: B,
345
+ managerLabels: B,
346
+ deleteLabels: z,
346
347
  messageLabels: J
347
348
  })
348
349
  ] });
@@ -14,72 +14,72 @@ var l = [], u = [{
14
14
  id: "dueDateLabel",
15
15
  desc: !0
16
16
  }];
17
- function d({ initialCounterpartId: d, messages: p, statusLabels: m, filterLabels: h, enabled: g = !0, visible: _ = g }) {
18
- let [v, y] = c(u), [b, x] = c(10), [S, C] = c(), [w, T] = c(""), [E, D] = c(""), O = a(() => C(void 0), []), k = n({
17
+ function d({ initialCounterpartId: d, messages: p, statusLabels: m, filterLabels: h, pageSizeOptions: g, enabled: _ = !0, visible: v = _ }) {
18
+ let [y, b] = c(u), [x, S] = c(g?.[0] ?? 10), [C, w] = c(), [T, E] = c(""), [D, O] = c(""), k = a(() => w(void 0), []), A = n({
19
19
  initialCounterpartId: d,
20
- search: w,
21
- onSearchChange: T,
22
- onFiltersChange: O,
20
+ search: T,
21
+ onSearchChange: E,
22
+ onFiltersChange: k,
23
23
  statusLabels: m,
24
24
  labels: h
25
25
  });
26
26
  o(() => {
27
27
  let e = setTimeout(() => {
28
- D(w), C(void 0);
28
+ O(T), w(void 0);
29
29
  }, 300);
30
30
  return () => clearTimeout(e);
31
- }, [w]);
32
- let A = v[0]?.id, j = A ? f[A] : void 0, M = v[0] ? v[0].desc ? "desc" : "asc" : void 0, N = t({
33
- enabled: g,
31
+ }, [T]);
32
+ let j = y[0]?.id, M = j ? f[j] : void 0, N = y[0] ? y[0].desc ? "desc" : "asc" : void 0, P = t({
33
+ enabled: _,
34
34
  type: "invoice",
35
- limit: b,
36
- pagination_token: S,
37
- search_text: E || void 0,
38
- ...k.query,
39
- ...j ? {
40
- sort: j,
41
- order: M
35
+ limit: x,
36
+ pagination_token: C,
37
+ search_text: D || void 0,
38
+ ...A.query,
39
+ ...M ? {
40
+ sort: M,
41
+ order: N
42
42
  } : {}
43
- }), P = i({
44
- enabled: g,
45
- visible: _,
46
- statusFilter: k.cardStatus,
43
+ }), F = i({
44
+ enabled: _,
45
+ visible: v,
46
+ statusFilter: A.cardStatus,
47
47
  messages: p,
48
48
  statusLabels: m
49
- }), F = N.data?.data ?? l, I = s(() => new Map(F.map((e) => [e.id, e])), [F]), L = a((e) => I.get(e), [I]), R = r(F), z = s(() => e({
50
- receivables: F,
49
+ }), I = P.data?.data ?? l, L = s(() => new Map(I.map((e) => [e.id, e])), [I]), R = a((e) => L.get(e), [L]), z = r(I), B = s(() => e({
50
+ receivables: I,
51
51
  messages: p,
52
- customerNames: R
52
+ customerNames: z
53
53
  }), [
54
- R,
54
+ z,
55
55
  p,
56
- F
57
- ]), B = a((e) => {
58
- let t = typeof e == "function" ? e(v) : e;
59
- y(t[0] && Object.hasOwn(f, t[0].id) ? t : u), C(void 0);
60
- }, [v]), V = a((e) => {
61
- x(e), C(void 0);
62
- }, []), H = a(() => C(N.data?.next_pagination_token ?? void 0), [N.data?.next_pagination_token]), U = a(() => C(N.data?.prev_pagination_token ?? void 0), [N.data?.prev_pagination_token]), W = a(() => {
63
- N.refetch();
64
- }, [N]);
56
+ I
57
+ ]), V = a((e) => {
58
+ let t = typeof e == "function" ? e(y) : e;
59
+ b(t[0] && Object.hasOwn(f, t[0].id) ? t : u), w(void 0);
60
+ }, [y]), H = a((e) => {
61
+ S(e), w(void 0);
62
+ }, []), U = a(() => w(P.data?.next_pagination_token ?? void 0), [P.data?.next_pagination_token]), W = a(() => w(P.data?.prev_pagination_token ?? void 0), [P.data?.prev_pagination_token]), G = a(() => {
63
+ P.refetch();
64
+ }, [P]);
65
65
  return {
66
- rows: z,
67
- isLoading: N.isLoading,
68
- isError: N.isError,
69
- sorting: v,
70
- onSortingChange: B,
71
- pageSize: b,
72
- onPageSizeChange: V,
73
- hasNextPage: !!N.data?.next_pagination_token,
74
- hasPrevPage: !!N.data?.prev_pagination_token,
75
- onNextPage: H,
76
- onPrevPage: U,
77
- statusCards: P,
78
- onStatusCardSelect: k.selectStatusCard,
79
- filterBar: k.filterBar,
80
- isFiltering: k.isFiltering,
81
- onRetry: W,
82
- getReceivableById: L
66
+ rows: B,
67
+ isLoading: P.isLoading,
68
+ isError: P.isError,
69
+ sorting: y,
70
+ onSortingChange: V,
71
+ pageSize: x,
72
+ onPageSizeChange: H,
73
+ hasNextPage: !!P.data?.next_pagination_token,
74
+ hasPrevPage: !!P.data?.prev_pagination_token,
75
+ onNextPage: U,
76
+ onPrevPage: W,
77
+ statusCards: F,
78
+ onStatusCardSelect: A.selectStatusCard,
79
+ filterBar: A.filterBar,
80
+ isFiltering: A.isFiltering,
81
+ onRetry: G,
82
+ getReceivableById: R
83
83
  };
84
84
  }
85
85
  var f = {
@@ -24,24 +24,24 @@ import { useReceivableForm as pe } from "./useReceivableForm.js";
24
24
  import { useReceivablesTable as me } from "./useReceivablesTable.js";
25
25
  import { useCallback as a, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
26
26
  //#region ../../libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/useReceivablesWidget.js
27
- function u({ auditHistoryLabels: u, counterpartMessageLabels: he, embeddedBankName: ge, filterLabels: _e, initialCounterpartId: f, initialView: p, messageLabels: m, onReceivableCreated: h, onReceivableOpened: g, screenLabels: ve }) {
28
- let _ = n();
27
+ function u({ auditHistoryLabels: u, counterpartMessageLabels: he, embeddedBankName: ge, filterLabels: _e, initialCounterpartId: f, initialView: p, messageLabels: m, onReceivableCreated: h, onReceivableOpened: g, pageSizeOptions: ve, screenLabels: ye }) {
28
+ let be = n();
29
29
  o(() => {
30
- _(re.Mounted);
31
- }, [_]);
32
- let { initResponse: v, widgetToken: ye } = i(), y = ne(), be = ee(), xe = r(), b = te(), x = !!v && !b, S = s(() => le(v?.scopes), [v?.scopes]), Se = !!v && b, C = !!v && S.canRead, w = !!v && S.canWrite, T = x && S.canRead, E = x && S.canWrite, D = !!be && !x && !y, O = !x && !D && !!(ye || y), k = s(() => ({
30
+ be(re.Mounted);
31
+ }, [be]);
32
+ let { initResponse: _, widgetToken: xe } = i(), v = ne(), Se = ee(), Ce = r(), y = te(), b = !!_ && !y, x = s(() => le(_?.scopes), [_?.scopes]), we = !!_ && y, S = !!_ && x.canRead, C = !!_ && x.canWrite, w = b && x.canRead, T = b && x.canWrite, E = !!Se && !b && !v, D = !b && !E && !!(xe || v), O = s(() => ({
33
33
  ...ce,
34
34
  ...m
35
- }), [m]), A = ve?.statusBadge, j = s(() => ({
35
+ }), [m]), k = ye?.statusBadge, A = s(() => ({
36
36
  ...ie,
37
- ...A
38
- }), [A]), [M, N] = l(), [P, F] = l(!1), [I, Ce] = l(M);
39
- M && M !== I && Ce(M);
40
- let [L, R] = l(!1), [we, z] = l(), Te = e(v?.scopes, [t.CounterpartReadOrg]), Ee = a(() => z(void 0), []), [B, V] = l(!1), De = a(() => V(!0), []), H = a(() => V(!1), []), Oe = a((e, t) => {
41
- N(e), F(!0), h?.(e, t);
42
- }, [h]), U = de({ messages: k }), W = U.open, ke = a((e, t, n) => {
37
+ ...k
38
+ }), [k]), [j, M] = l(), [N, P] = l(!1), [F, Te] = l(j);
39
+ j && j !== F && Te(j);
40
+ let [I, L] = l(!1), [Ee, R] = l(), De = e(_?.scopes, [t.CounterpartReadOrg]), Oe = a(() => R(void 0), []), [z, B] = l(!1), ke = a(() => B(!0), []), V = a(() => B(!1), []), Ae = a((e, t) => {
41
+ M(e), P(!0), h?.(e, t);
42
+ }, [h]), H = de({ messages: O }), U = H.open, je = a((e, t, n) => {
43
43
  let r = oe(n);
44
- r.openDetails && (N(e), F(!0)), r.actionsModal && W({
44
+ r.openDetails && (M(e), P(!0)), r.actionsModal && U({
45
45
  action: n.mode,
46
46
  receivableId: e,
47
47
  documentType: t,
@@ -49,27 +49,28 @@ function u({ auditHistoryLabels: u, counterpartMessageLabels: he, embeddedBankNa
49
49
  inlineItems: n.inlineItems,
50
50
  showEmailStep: r.actionsModal.showEmailStep
51
51
  }), h?.(e, t);
52
- }, [h, W]), G = me({
52
+ }, [h, U]), W = me({
53
53
  initialCounterpartId: p === "create" ? void 0 : f,
54
- messages: k,
55
- statusLabels: j,
54
+ messages: O,
55
+ statusLabels: A,
56
56
  filterLabels: _e,
57
- enabled: T,
58
- visible: C
59
- }), Ae = a((e) => {
60
- N(e), F(!0), g?.(e, "invoice");
61
- }, [g]), K = fe({
62
- selectedReceivableId: M,
63
- enabled: P && T,
64
- canWrite: w,
65
- messages: k,
66
- statusLabels: j,
57
+ pageSizeOptions: ve,
58
+ enabled: w,
59
+ visible: S
60
+ }), Me = a((e) => {
61
+ M(e), P(!0), g?.(e, "invoice");
62
+ }, [g]), G = fe({
63
+ selectedReceivableId: j,
64
+ enabled: N && w,
65
+ canWrite: C,
66
+ messages: O,
67
+ statusLabels: A,
67
68
  auditHistoryLabels: u,
68
- onOpenReceivable: Ae,
69
- onOpenCustomer: Te ? z : void 0
70
- }), q = c("edit"), je = a((e, t, n) => {
71
- let r = n.mode === "issue", i = r && q.current !== "issue" && n.hasCustomerEmail;
72
- (i || n.inlineItems.length !== 0) && W({
69
+ onOpenReceivable: Me,
70
+ onOpenCustomer: De ? R : void 0
71
+ }), K = c("edit"), Ne = a((e, t, n) => {
72
+ let r = n.mode === "issue", i = r && K.current !== "issue" && n.hasCustomerEmail;
73
+ (i || n.inlineItems.length !== 0) && U({
73
74
  action: r || n.mode === "recurrence" ? n.mode : "update",
74
75
  receivableId: e,
75
76
  documentType: t,
@@ -77,35 +78,35 @@ function u({ auditHistoryLabels: u, counterpartMessageLabels: he, embeddedBankNa
77
78
  inlineItems: n.inlineItems,
78
79
  showEmailStep: i
79
80
  });
80
- }, [W]), J = pe({
81
- messages: k,
81
+ }, [U]), q = pe({
82
+ messages: O,
82
83
  counterpartMessageLabels: he,
83
84
  embeddedBankName: ge,
84
- onCreated: ke,
85
- onUpdated: je
86
- }), Me = a(() => {
87
- E && J.openCreate("invoice");
88
- }, [E, J.openCreate]), Y = c(!1);
85
+ onCreated: je,
86
+ onUpdated: Ne
87
+ }), Pe = a(() => {
88
+ T && q.openCreate("invoice");
89
+ }, [T, q.openCreate]), J = c(!1);
89
90
  o(() => {
90
- Y.current || p === "create" && E && (Y.current = !0, J.openCreate("invoice", { customerId: f }));
91
+ J.current || p === "create" && T && (J.current = !0, q.openCreate("invoice", { customerId: f }));
91
92
  }, [
92
- E,
93
- J.openCreate,
93
+ T,
94
+ q.openCreate,
94
95
  f,
95
96
  p
96
97
  ]);
97
- let X = ue({
98
- selectedReceivable: K.receivable,
99
- selectedRecurrence: K.recurrence,
100
- messages: k,
101
- onCreated: Oe,
98
+ let Y = ue({
99
+ selectedReceivable: G.receivable,
100
+ selectedRecurrence: G.recurrence,
101
+ messages: O,
102
+ onCreated: Ae,
102
103
  onDeleted: (e) => {
103
- e === M && (N(void 0), F(!1));
104
+ e === j && (M(void 0), P(!1));
104
105
  },
105
106
  onCompleteBeforeIssue: (e, t) => {
106
- q.current = t, J.openEdit(e, { highlightForIssue: !0 }), P && R(!0), F(!1);
107
+ K.current = t, q.openEdit(e, { highlightForIssue: !0 }), N && L(!0), P(!1);
107
108
  },
108
- onIssuedForSend: (e, t) => W({
109
+ onIssuedForSend: (e, t) => U({
109
110
  action: "issue",
110
111
  receivableId: e,
111
112
  documentType: "invoice",
@@ -115,105 +116,105 @@ function u({ auditHistoryLabels: u, counterpartMessageLabels: he, embeddedBankNa
115
116
  })
116
117
  });
117
118
  o(() => {
118
- J.open || (q.current = "edit");
119
- }, [J.open]), o(() => {
120
- !J.open && L && (R(!1), F(!0));
121
- }, [J.open, L]);
122
- let Z = x && !S.canWrite, Q = J.open || J.counterpartView !== "none" || !!X.actionTarget || X.sendOpen || X.payment.isOpen || U.isOpen || B, Ne = J.close, Pe = J.counterpartForm.close, { closeAction: Fe, closeSend: Ie } = X, Le = X.payment.close, $ = U.close;
119
+ q.open || (K.current = "edit");
120
+ }, [q.open]), o(() => {
121
+ !q.open && I && (L(!1), P(!0));
122
+ }, [q.open, I]);
123
+ let X = b && !x.canWrite, Z = q.open || q.counterpartView !== "none" || !!Y.actionTarget || Y.sendOpen || Y.payment.isOpen || H.isOpen || z, Fe = q.close, Ie = q.counterpartForm.close, { closeAction: Le, closeSend: Re } = Y, Q = Y.payment.close, $ = H.close;
123
124
  o(() => {
124
- Z && Q && (Ne(), Pe(), Fe(), Ie(), Le(), $(), H());
125
+ X && Z && (Fe(), Ie(), Le(), Re(), Q(), $(), V());
125
126
  }, [
126
- Fe,
127
- $,
128
- Pe,
129
- Ne,
130
- H,
131
127
  Le,
128
+ $,
132
129
  Ie,
130
+ Fe,
131
+ V,
133
132
  Q,
134
- Z
133
+ Re,
134
+ Z,
135
+ X
135
136
  ]);
136
- let Re = a((e) => {
137
- ae() || (N(e.id), F(!0), g?.(e.id, e.type));
138
- }, [g]), ze = a(() => {
139
- F(!1), N(void 0), z(void 0);
140
- }, []), Be = a((e, t) => {
141
- if (E) {
137
+ let ze = a((e) => {
138
+ ae() || (M(e.id), P(!0), g?.(e.id, e.type));
139
+ }, [g]), Be = a(() => {
140
+ P(!1), M(void 0), R(void 0);
141
+ }, []), Ve = a((e, t) => {
142
+ if (T) {
142
143
  if (e === "edit") {
143
- K.receivable && (q.current = "edit", J.openEdit(K.receivable), R(!0), F(!1));
144
+ G.receivable && (K.current = "edit", q.openEdit(G.receivable), L(!0), P(!1));
144
145
  return;
145
146
  }
146
- X.openAction(e, {
147
+ Y.openAction(e, {
147
148
  id: t.id,
148
- title: K.receivable ? se(K.receivable, k) : t.title,
149
+ title: G.receivable ? se(G.receivable, O) : t.title,
149
150
  type: t.type
150
- }, K.receivable ?? null);
151
+ }, G.receivable ?? null);
151
152
  }
152
153
  }, [
153
- X,
154
- E,
155
- K.receivable,
156
- J.openEdit,
157
- k
154
+ Y,
155
+ T,
156
+ G.receivable,
157
+ q.openEdit,
158
+ O
158
159
  ]);
159
160
  return {
160
- canWrite: w,
161
- canEditSettings: C && S.canEditSettings,
162
- actionsSuspended: Se,
163
- isAccessRestricted: x && !S.canRead,
164
- table: C ? G : {
165
- ...G,
161
+ canWrite: C,
162
+ canEditSettings: S && x.canEditSettings,
163
+ actionsSuspended: we,
164
+ isAccessRestricted: b && !x.canRead,
165
+ table: S ? W : {
166
+ ...W,
166
167
  rows: [],
167
168
  statusCards: void 0,
168
169
  isError: !1
169
170
  },
170
- isTableLoading: C ? G.isLoading || O && G.rows.length === 0 : O,
171
- isError: D || C && G.isError,
172
- onRetry: D ? xe : G.onRetry,
173
- details: K,
174
- detailsOpen: P && C,
175
- closeDetails: ze,
176
- detailsPanelKey: I,
177
- customerDetailsId: we,
178
- closeCustomerDetails: Ee,
171
+ isTableLoading: S ? W.isLoading || D && W.rows.length === 0 : D,
172
+ isError: E || S && W.isError,
173
+ onRetry: E ? Ce : W.onRetry,
174
+ details: G,
175
+ detailsOpen: N && S,
176
+ closeDetails: Be,
177
+ detailsPanelKey: F,
178
+ customerDetailsId: Ee,
179
+ closeCustomerDetails: Oe,
179
180
  form: {
180
- ...J,
181
- open: w && J.open,
182
- counterpartView: w ? J.counterpartView : "none",
181
+ ...q,
182
+ open: C && q.open,
183
+ counterpartView: C ? q.counterpartView : "none",
183
184
  counterpartForm: {
184
- ...J.counterpartForm,
185
- submit: d(E, J.counterpartForm.submit)
185
+ ...q.counterpartForm,
186
+ submit: d(T, q.counterpartForm.submit)
186
187
  },
187
- submit: d(E, J.submit),
188
- submitDraft: d(E, J.submitDraft),
189
- submitPrimary: d(E, J.submitPrimary)
188
+ submit: d(T, q.submit),
189
+ submitDraft: d(T, q.submitDraft),
190
+ submitPrimary: d(T, q.submitPrimary)
190
191
  },
191
- openCreate: Me,
192
- measureUnitsOpen: w && B,
193
- openMeasureUnits: De,
194
- closeMeasureUnits: H,
192
+ openCreate: Pe,
193
+ measureUnitsOpen: C && z,
194
+ openMeasureUnits: ke,
195
+ closeMeasureUnits: V,
195
196
  actions: {
196
- ...X,
197
- actionDialog: w ? X.actionDialog : void 0,
198
- sendOpen: w && X.sendOpen,
199
- openAction: d(E, X.openAction),
200
- confirmAction: d(E, X.confirmAction),
201
- submitSend: d(E, X.submitSend),
197
+ ...Y,
198
+ actionDialog: C ? Y.actionDialog : void 0,
199
+ sendOpen: C && Y.sendOpen,
200
+ openAction: d(T, Y.openAction),
201
+ confirmAction: d(T, Y.confirmAction),
202
+ submitSend: d(T, Y.submitSend),
202
203
  payment: {
203
- ...X.payment,
204
- isOpen: w && X.payment.isOpen,
205
- save: d(E, X.payment.save),
206
- confirm: d(E, X.payment.confirm)
204
+ ...Y.payment,
205
+ isOpen: C && Y.payment.isOpen,
206
+ save: d(T, Y.payment.save),
207
+ confirm: d(T, Y.payment.confirm)
207
208
  }
208
209
  },
209
210
  actionsModal: {
210
- ...U,
211
- isOpen: w && U.isOpen,
212
- send: d(E, U.send),
213
- saveItems: d(E, U.saveItems)
211
+ ...H,
212
+ isOpen: C && H.isOpen,
213
+ send: d(T, H.send),
214
+ saveItems: d(T, H.saveItems)
214
215
  },
215
- handleRowClick: Re,
216
- handleDetailsActionClick: Be
216
+ handleRowClick: ze,
217
+ handleDetailsActionClick: Ve
217
218
  };
218
219
  }
219
220
  function d(e, t) {
@@ -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.274", n = "a78fe1de158c36f129730c30a41e9ed9494ad8e8", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.5.275", n = "2217cd3c5d18126e2fa27a854a1770b84bdbb2f2", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.5.274",
3
+ "version": "0.5.275",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "packageDepSync": {