@tesouro/embedded-components-react 0.3.14 → 0.3.15

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.
@@ -6,157 +6,157 @@ import { useMoniteContext as r } from "./index47.js";
6
6
  import { useRootElements as i } from "./index206.js";
7
7
  import "./index207.js";
8
8
  import { useFileInput as a } from "./index209.js";
9
- import { useComponentSettings as o } from "./index215.js";
9
+ import { useComponentSettings as ee } from "./index215.js";
10
10
  import "./index217.js";
11
- import { Dialog as s } from "./index229.js";
11
+ import { Dialog as o } from "./index229.js";
12
12
  import "./index230.js";
13
- import { MoniteScopedProviders as c } from "./index237.js";
14
- import { useUserPermissions as ee } from "./index116.js";
15
- import { AccessRestriction as l } from "./index247.js";
13
+ import { MoniteScopedProviders as s } from "./index237.js";
14
+ import { useUserPermissions as te } from "./index116.js";
15
+ import { AccessRestriction as c } from "./index247.js";
16
16
  import "./index249.js";
17
- import { usePayableCallbacks as u } from "./index361.js";
18
- import { PayableDetails as d } from "./index425.js";
19
- import { PayablesTable as f } from "./index438.js";
17
+ import { usePayableCallbacks as l } from "./index361.js";
18
+ import { PayableDetails as u } from "./index425.js";
19
+ import { PayablesTable as ne } from "./index438.js";
20
20
  import "./index426.js";
21
21
  import "./index439.js";
22
- import { CreatePayableMenu as p } from "./index441.js";
22
+ import { CreatePayableMenu as d } from "./index441.js";
23
23
  import "./index442.js";
24
- import { useEffect as te, useMemo as ne, useRef as re, useState as m } from "react";
25
- import { jsx as h, jsxs as g } from "@emotion/react/jsx-runtime";
26
- import { toast as _ } from "react-hot-toast";
27
- import { useLingui as v } from "@lingui/react";
24
+ import { useEffect as re, useMemo as ie, useRef as ae, useState as f } from "react";
25
+ import { jsx as p, jsxs as m } from "@emotion/react/jsx-runtime";
26
+ import { toast as h } from "react-hot-toast";
27
+ import { useLingui as g } from "@lingui/react";
28
28
  //#region ../../libs/tesouro-embedded-components-react/monite-sdk/dist/index443.js
29
- var y = (e) => /* @__PURE__ */ h(c, { children: /* @__PURE__ */ h(b, { ...e }) }), b = ({ pageTitleComponent: c, enableGLCodes: y, initialView: b, initialCounterpartId: x, onSaved: S, onCanceled: C, onSubmitted: w, onRejected: T, onApproved: ie, onReopened: ae, onDeleted: oe, onPay: se }) => {
30
- let { i18n: E } = v(), { api: D, queryClient: O, theme: k } = r(), { componentSettings: A } = o(), { handleSaved: j, handleCanceled: M, handleSubmitted: N, handleRejected: P, handleApproved: F, handleReopened: I, handleDeleted: L, handlePay: R } = u({
31
- onSaved: S,
32
- onCanceled: C,
33
- onSubmitted: w,
34
- onRejected: T,
35
- onApproved: ie,
36
- onReopened: ae,
37
- onDeleted: oe,
38
- onPay: se
39
- }), [z, B] = m({
29
+ var _ = (e) => /* @__PURE__ */ p(s, { children: /* @__PURE__ */ p(v, { ...e }) }), v = ({ pageTitleComponent: s, enableGLCodes: _, initialView: v, initialCounterpartId: y, onSaved: b, onCanceled: x, onSubmitted: S, onRejected: C, onApproved: oe, onReopened: se, onDeleted: ce, onPay: le }) => {
30
+ let { i18n: w } = g(), { api: T, queryClient: E, theme: D } = r(), { componentSettings: O } = ee(), { handleSaved: k, handleCanceled: A, handleSubmitted: j, handleRejected: M, handleApproved: N, handleReopened: P, handleDeleted: F, handlePay: I } = l({
31
+ onSaved: b,
32
+ onCanceled: x,
33
+ onSubmitted: S,
34
+ onRejected: C,
35
+ onApproved: oe,
36
+ onReopened: se,
37
+ onDeleted: ce,
38
+ onPay: le
39
+ }), [L, R] = f({
40
40
  invoiceId: void 0,
41
41
  open: !1,
42
42
  shouldOpenEditMode: !1
43
- }), V = () => {
44
- B((e) => ({
43
+ }), z = () => {
44
+ R((e) => ({
45
45
  ...e,
46
46
  open: !1,
47
47
  shouldOpenEditMode: !1,
48
48
  invoiceId: void 0
49
49
  }));
50
- }, [ce, H] = m(!1), [U, W] = m(void 0), G = re(!1), K = () => {
51
- H(!1), W(void 0);
52
- }, { FileInput: le, openFileInput: ue, checkFileError: de } = a(), q = D.finops.postPayablesUploadFromFile.useMutation({}, {
53
- onSuccess: () => D.finops.getPayables.invalidateQueries(O),
50
+ }, [B, V] = f(!1), [H, U] = f(void 0), W = ae(!1), G = () => {
51
+ V(!1), U(void 0);
52
+ }, { FileInput: ue, openFileInput: de, checkFileError: fe } = a(), K = T.finops.postPayablesUploadFromFile.useMutation({}, {
53
+ onSuccess: () => T.finops.getPayables.invalidateQueries(E),
54
54
  onError: () => {}
55
- }), J = (e) => {
55
+ }), q = (e) => {
56
56
  let n = e instanceof File ? [e] : Array.from(e);
57
57
  if (n.length > 10) {
58
- _.error(E._("You can only upload up to {fileCount} files at a time", { fileCount: 10 }));
58
+ h.error(w._("You can only upload up to {fileCount} files at a time", { fileCount: 10 }));
59
59
  return;
60
60
  }
61
61
  n.forEach((e) => {
62
- let n = de(e);
62
+ let n = fe(e);
63
63
  if (n) {
64
- _.error(n);
64
+ h.error(n);
65
65
  return;
66
66
  }
67
- _.promise(q.mutateAsync({ file: e }), {
68
- loading: E._("Uploading {fileName}", { fileName: e.name }),
69
- success: E._("Payable {fileName} uploaded successfully", { fileName: e.name }),
70
- error: (e) => t(E, e)
67
+ h.promise(K.mutateAsync({ file: e }), {
68
+ loading: w._("Uploading {fileName}", { fileName: e.name }),
69
+ success: w._("Payable {fileName} uploaded successfully", { fileName: e.name }),
70
+ error: (e) => t(w, e)
71
71
  });
72
72
  });
73
- }, Y = ee(), X = Y.has(e.PayableWriteOrg), Z = Y.has(e.PayableReadOrg);
74
- te(() => {
75
- G.current || b === "create" && X && (G.current = !0, W(x), H(!0));
73
+ }, J = te(), Y = J.has(e.PayableWriteOrg), X = J.has(e.PayableReadOrg);
74
+ re(() => {
75
+ W.current || v === "create" && Y && (W.current = !0, U(y), V(!0));
76
76
  }, [
77
- b,
78
- X,
79
- x
77
+ v,
78
+ Y,
79
+ y
80
80
  ]);
81
- let { root: Q } = i(), $ = y ?? A?.payables?.enableGLCodes ?? !1, fe = ne(() => n(k.components?.styles?.payables?.button), [k.components?.styles?.payables?.button]);
82
- return /* @__PURE__ */ g("div", {
81
+ let { root: Z } = i(), Q = "Monite-Payables-Header", $ = _ ?? O?.payables?.enableGLCodes ?? !1, pe = ie(() => n(D.components?.styles?.payables?.button), [D.components?.styles?.payables?.button]);
82
+ return /* @__PURE__ */ m("div", {
83
83
  className: "Monite-Payables",
84
- style: fe,
84
+ style: pe,
85
85
  children: [
86
- c(/* @__PURE__ */ h(p, {
87
- isCreateAllowed: X,
86
+ s(/* @__PURE__ */ p(d, {
87
+ isCreateAllowed: Y,
88
88
  onCreateInvoice: () => {
89
- W(void 0), H(!0);
89
+ U(void 0), V(!0);
90
90
  },
91
- handleFileUpload: J
91
+ handleFileUpload: q
92
92
  })),
93
- !Z && /* @__PURE__ */ h(l, {}),
94
- Z && /* @__PURE__ */ h(f, {
95
- initialCounterpartId: b === "create" ? void 0 : x,
96
- onRowClick: (e) => B({
93
+ !X && /* @__PURE__ */ p(c, {}),
94
+ X && /* @__PURE__ */ p(ne, {
95
+ initialCounterpartId: v === "create" ? void 0 : y,
96
+ onRowClick: (e) => R({
97
97
  open: !0,
98
98
  invoiceId: e
99
99
  }),
100
- onPay: R,
101
- onApproved: F,
102
- onCanceled: M,
103
- onSubmitted: N,
104
- openFileInput: ue,
105
- setIsCreateInvoiceDialogOpen: H,
106
- openEditDialog: (e) => B({
100
+ onPay: I,
101
+ onApproved: N,
102
+ onCanceled: A,
103
+ onSubmitted: j,
104
+ openFileInput: de,
105
+ setIsCreateInvoiceDialogOpen: V,
106
+ openEditDialog: (e) => R({
107
107
  open: !0,
108
108
  invoiceId: e,
109
109
  shouldOpenEditMode: !0
110
110
  })
111
111
  }),
112
- /* @__PURE__ */ h(le, {
113
- "aria-label": E._("Upload payable files"),
112
+ /* @__PURE__ */ p(ue, {
113
+ "aria-label": w._("Upload payable files"),
114
114
  multiple: !0,
115
115
  onChange: (e) => {
116
116
  let t = e.target.files;
117
- t && J(t);
117
+ t && q(t);
118
118
  }
119
119
  }),
120
- /* @__PURE__ */ h(s, {
121
- className: "Monite-Payables-Header-Dialog-PayableDetails",
122
- open: z.open,
123
- container: Q,
124
- onClose: V,
125
- onClosed: V,
120
+ /* @__PURE__ */ p(o, {
121
+ className: Q + "-Dialog-PayableDetails",
122
+ open: L.open,
123
+ container: Z,
124
+ onClose: z,
125
+ onClosed: z,
126
126
  fullScreen: !0,
127
- children: /* @__PURE__ */ h(d, {
128
- id: z.invoiceId,
129
- shouldOpenInEditMode: z.shouldOpenEditMode,
127
+ children: /* @__PURE__ */ p(u, {
128
+ id: L.invoiceId,
129
+ shouldOpenInEditMode: L.shouldOpenEditMode,
130
130
  enableGLCodes: $,
131
- onClose: V,
132
- onSaved: j,
133
- onCanceled: M,
134
- onSubmitted: N,
135
- onRejected: P,
136
- onApproved: F,
137
- onReopened: I,
131
+ onClose: z,
132
+ onSaved: k,
133
+ onCanceled: A,
134
+ onSubmitted: j,
135
+ onRejected: M,
136
+ onApproved: N,
137
+ onReopened: P,
138
138
  onDeleted: (e) => {
139
- L?.(e), V(), _(E._("Bill #{payableId} has been deleted", { payableId: e }), { duration: 5e3 });
139
+ F?.(e), z(), h(w._("Bill #{payableId} has been deleted", { payableId: e }), { duration: 5e3 });
140
140
  },
141
- onPay: R
141
+ onPay: I
142
142
  })
143
143
  }),
144
- /* @__PURE__ */ h(s, {
145
- className: "Monite-Payables-Header-Dialog-CreatePayable",
146
- open: ce,
147
- container: Q,
148
- onClose: K,
144
+ /* @__PURE__ */ p(o, {
145
+ className: Q + "-Dialog-CreatePayable",
146
+ open: B,
147
+ container: Z,
148
+ onClose: G,
149
149
  fullScreen: !0,
150
- children: /* @__PURE__ */ h(d, {
150
+ children: /* @__PURE__ */ p(u, {
151
151
  shouldOpenInEditMode: !0,
152
- initialCounterpartId: U,
152
+ initialCounterpartId: H,
153
153
  enableGLCodes: $,
154
- onClose: K,
154
+ onClose: G,
155
155
  onSaved: (e) => {
156
- B({
156
+ R({
157
157
  open: !0,
158
158
  invoiceId: e
159
- }), K(), j?.(e);
159
+ }), G(), k?.(e);
160
160
  }
161
161
  })
162
162
  })
@@ -164,4 +164,4 @@ var y = (e) => /* @__PURE__ */ h(c, { children: /* @__PURE__ */ h(b, { ...e }) }
164
164
  });
165
165
  };
166
166
  //#endregion
167
- export { y as Payables };
167
+ export { _ as Payables };
@@ -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.3.14", n = "2a1475af2f1e1ba3d43e315eb4b008c3a3484ee0", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.3.15", n = "b52c0921dc11a20dc30c5c3c2af1f990354d1b72", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n