@tesouro/embedded-components-react 0.3.14 → 0.3.16
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/libs/tesouro-embedded-components-react/monite-sdk/dist/index247.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index392.js +124 -124
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index418.js +116 -116
- package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index443.js +94 -94
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +1206 -1201
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/packages/shared-ui-shadcn/dist/index.js +2625 -2626
- package/package.json +1 -1
|
@@ -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
|
|
9
|
+
import { useComponentSettings as ee } from "./index215.js";
|
|
10
10
|
import "./index217.js";
|
|
11
|
-
import { Dialog as
|
|
11
|
+
import { Dialog as o } from "./index229.js";
|
|
12
12
|
import "./index230.js";
|
|
13
|
-
import { MoniteScopedProviders as
|
|
14
|
-
import { useUserPermissions as
|
|
15
|
-
import { AccessRestriction as
|
|
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
|
|
18
|
-
import { PayableDetails as
|
|
19
|
-
import { PayablesTable as
|
|
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
|
|
22
|
+
import { CreatePayableMenu as d } from "./index441.js";
|
|
23
23
|
import "./index442.js";
|
|
24
|
-
import { useEffect as
|
|
25
|
-
import { jsx as
|
|
26
|
-
import { toast as
|
|
27
|
-
import { useLingui as
|
|
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
|
|
30
|
-
let { i18n:
|
|
31
|
-
onSaved:
|
|
32
|
-
onCanceled:
|
|
33
|
-
onSubmitted:
|
|
34
|
-
onRejected:
|
|
35
|
-
onApproved:
|
|
36
|
-
onReopened:
|
|
37
|
-
onDeleted:
|
|
38
|
-
onPay:
|
|
39
|
-
}), [
|
|
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
|
-
}),
|
|
44
|
-
|
|
43
|
+
}), z = () => {
|
|
44
|
+
R((e) => ({
|
|
45
45
|
...e,
|
|
46
46
|
open: !1,
|
|
47
47
|
shouldOpenEditMode: !1,
|
|
48
48
|
invoiceId: void 0
|
|
49
49
|
}));
|
|
50
|
-
}, [
|
|
51
|
-
|
|
52
|
-
}, { FileInput:
|
|
53
|
-
onSuccess: () =>
|
|
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
|
-
}),
|
|
55
|
+
}), q = (e) => {
|
|
56
56
|
let n = e instanceof File ? [e] : Array.from(e);
|
|
57
57
|
if (n.length > 10) {
|
|
58
|
-
|
|
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 =
|
|
62
|
+
let n = fe(e);
|
|
63
63
|
if (n) {
|
|
64
|
-
|
|
64
|
+
h.error(n);
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
loading:
|
|
69
|
-
success:
|
|
70
|
-
error: (e) => t(
|
|
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
|
-
},
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
v,
|
|
78
|
+
Y,
|
|
79
|
+
y
|
|
80
80
|
]);
|
|
81
|
-
let { root:
|
|
82
|
-
return /* @__PURE__ */
|
|
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:
|
|
84
|
+
style: pe,
|
|
85
85
|
children: [
|
|
86
|
-
|
|
87
|
-
isCreateAllowed:
|
|
86
|
+
s(/* @__PURE__ */ p(d, {
|
|
87
|
+
isCreateAllowed: Y,
|
|
88
88
|
onCreateInvoice: () => {
|
|
89
|
-
|
|
89
|
+
U(void 0), V(!0);
|
|
90
90
|
},
|
|
91
|
-
handleFileUpload:
|
|
91
|
+
handleFileUpload: q
|
|
92
92
|
})),
|
|
93
|
-
!
|
|
94
|
-
|
|
95
|
-
initialCounterpartId:
|
|
96
|
-
onRowClick: (e) =>
|
|
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:
|
|
101
|
-
onApproved:
|
|
102
|
-
onCanceled:
|
|
103
|
-
onSubmitted:
|
|
104
|
-
openFileInput:
|
|
105
|
-
setIsCreateInvoiceDialogOpen:
|
|
106
|
-
openEditDialog: (e) =>
|
|
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__ */
|
|
113
|
-
"aria-label":
|
|
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 &&
|
|
117
|
+
t && q(t);
|
|
118
118
|
}
|
|
119
119
|
}),
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
className: "
|
|
122
|
-
open:
|
|
123
|
-
container:
|
|
124
|
-
onClose:
|
|
125
|
-
onClosed:
|
|
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__ */
|
|
128
|
-
id:
|
|
129
|
-
shouldOpenInEditMode:
|
|
127
|
+
children: /* @__PURE__ */ p(u, {
|
|
128
|
+
id: L.invoiceId,
|
|
129
|
+
shouldOpenInEditMode: L.shouldOpenEditMode,
|
|
130
130
|
enableGLCodes: $,
|
|
131
|
-
onClose:
|
|
132
|
-
onSaved:
|
|
133
|
-
onCanceled:
|
|
134
|
-
onSubmitted:
|
|
135
|
-
onRejected:
|
|
136
|
-
onApproved:
|
|
137
|
-
onReopened:
|
|
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
|
-
|
|
139
|
+
F?.(e), z(), h(w._("Bill #{payableId} has been deleted", { payableId: e }), { duration: 5e3 });
|
|
140
140
|
},
|
|
141
|
-
onPay:
|
|
141
|
+
onPay: I
|
|
142
142
|
})
|
|
143
143
|
}),
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
className: "
|
|
146
|
-
open:
|
|
147
|
-
container:
|
|
148
|
-
onClose:
|
|
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__ */
|
|
150
|
+
children: /* @__PURE__ */ p(u, {
|
|
151
151
|
shouldOpenInEditMode: !0,
|
|
152
|
-
initialCounterpartId:
|
|
152
|
+
initialCounterpartId: H,
|
|
153
153
|
enableGLCodes: $,
|
|
154
|
-
onClose:
|
|
154
|
+
onClose: G,
|
|
155
155
|
onSaved: (e) => {
|
|
156
|
-
|
|
156
|
+
R({
|
|
157
157
|
open: !0,
|
|
158
158
|
invoiceId: e
|
|
159
|
-
}),
|
|
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 {
|
|
167
|
+
export { _ as Payables };
|